Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrevor Norris <trev.norris@gmail.com>2015-07-10 19:03:37 +0300
committerTrevor Norris <trev.norris@gmail.com>2015-07-10 20:05:03 +0300
commit3beae2ca85e6c2c411b2d8e03d9ec07a3d5bb98a (patch)
treeffd8b528ebff5deced96dd03a1d3afe590ba6da1
parent73872975cd4eb3537f59a5c208d0478d79ec3e77 (diff)
parent12bc397207dc1c4d63a390f5167b3a51a952ed83 (diff)
Merge branch 'master' into nextv3.0.0-rc.3
Conflicts: Makefile lib/buffer.js lib/smalloc.js src/node_buffer.cc src/node_version.h vcbuild.bat
-rw-r--r--.eslintrc3
-rw-r--r--.mailmap1
-rw-r--r--AUTHORS11
-rw-r--r--CHANGELOG.md122
-rw-r--r--Makefile7
-rw-r--r--README.md16
-rw-r--r--benchmark/README.md8
-rw-r--r--benchmark/buffers/buffer-tostring.js26
-rw-r--r--benchmark/http_bench.js33
-rw-r--r--benchmark/path/format.js31
-rw-r--r--benchmark/path/isAbsolute.js27
-rw-r--r--benchmark/path/join.js18
-rw-r--r--benchmark/path/normalize.js18
-rw-r--r--benchmark/path/relative.js26
-rw-r--r--benchmark/path/resolve.js18
-rwxr-xr-xconfigure2
-rw-r--r--deps/npm/AUTHORS3
-rw-r--r--deps/npm/CHANGELOG.md184
-rw-r--r--deps/npm/doc/cli/npm-install.md19
-rw-r--r--deps/npm/doc/cli/npm-version.md14
-rw-r--r--deps/npm/doc/files/package.json.md11
-rw-r--r--deps/npm/html/doc/README.html4
-rw-r--r--deps/npm/html/doc/api/npm-bin.html2
-rw-r--r--deps/npm/html/doc/api/npm-bugs.html2
-rw-r--r--deps/npm/html/doc/api/npm-cache.html2
-rw-r--r--deps/npm/html/doc/api/npm-commands.html2
-rw-r--r--deps/npm/html/doc/api/npm-config.html2
-rw-r--r--deps/npm/html/doc/api/npm-deprecate.html2
-rw-r--r--deps/npm/html/doc/api/npm-docs.html2
-rw-r--r--deps/npm/html/doc/api/npm-edit.html2
-rw-r--r--deps/npm/html/doc/api/npm-explore.html2
-rw-r--r--deps/npm/html/doc/api/npm-help-search.html2
-rw-r--r--deps/npm/html/doc/api/npm-init.html2
-rw-r--r--deps/npm/html/doc/api/npm-install.html2
-rw-r--r--deps/npm/html/doc/api/npm-link.html2
-rw-r--r--deps/npm/html/doc/api/npm-load.html2
-rw-r--r--deps/npm/html/doc/api/npm-ls.html2
-rw-r--r--deps/npm/html/doc/api/npm-outdated.html2
-rw-r--r--deps/npm/html/doc/api/npm-owner.html2
-rw-r--r--deps/npm/html/doc/api/npm-pack.html2
-rw-r--r--deps/npm/html/doc/api/npm-ping.html (renamed from deps/npm/html/doc/api/npm-submodule.html)31
-rw-r--r--deps/npm/html/doc/api/npm-prefix.html2
-rw-r--r--deps/npm/html/doc/api/npm-prune.html2
-rw-r--r--deps/npm/html/doc/api/npm-publish.html2
-rw-r--r--deps/npm/html/doc/api/npm-rebuild.html2
-rw-r--r--deps/npm/html/doc/api/npm-repo.html2
-rw-r--r--deps/npm/html/doc/api/npm-restart.html2
-rw-r--r--deps/npm/html/doc/api/npm-root.html2
-rw-r--r--deps/npm/html/doc/api/npm-run-script.html2
-rw-r--r--deps/npm/html/doc/api/npm-search.html2
-rw-r--r--deps/npm/html/doc/api/npm-shrinkwrap.html2
-rw-r--r--deps/npm/html/doc/api/npm-start.html2
-rw-r--r--deps/npm/html/doc/api/npm-stop.html2
-rw-r--r--deps/npm/html/doc/api/npm-tag.html2
-rw-r--r--deps/npm/html/doc/api/npm-test.html2
-rw-r--r--deps/npm/html/doc/api/npm-uninstall.html2
-rw-r--r--deps/npm/html/doc/api/npm-unpublish.html2
-rw-r--r--deps/npm/html/doc/api/npm-update.html2
-rw-r--r--deps/npm/html/doc/api/npm-version.html2
-rw-r--r--deps/npm/html/doc/api/npm-view.html2
-rw-r--r--deps/npm/html/doc/api/npm-whoami.html2
-rw-r--r--deps/npm/html/doc/api/npm.html4
-rw-r--r--deps/npm/html/doc/cli/npm-access.html2
-rw-r--r--deps/npm/html/doc/cli/npm-adduser.html2
-rw-r--r--deps/npm/html/doc/cli/npm-bin.html2
-rw-r--r--deps/npm/html/doc/cli/npm-bugs.html2
-rw-r--r--deps/npm/html/doc/cli/npm-build.html2
-rw-r--r--deps/npm/html/doc/cli/npm-bundle.html2
-rw-r--r--deps/npm/html/doc/cli/npm-cache.html2
-rw-r--r--deps/npm/html/doc/cli/npm-completion.html2
-rw-r--r--deps/npm/html/doc/cli/npm-config.html2
-rw-r--r--deps/npm/html/doc/cli/npm-dedupe.html2
-rw-r--r--deps/npm/html/doc/cli/npm-deprecate.html2
-rw-r--r--deps/npm/html/doc/cli/npm-dist-tag.html2
-rw-r--r--deps/npm/html/doc/cli/npm-docs.html2
-rw-r--r--deps/npm/html/doc/cli/npm-edit.html2
-rw-r--r--deps/npm/html/doc/cli/npm-explore.html2
-rw-r--r--deps/npm/html/doc/cli/npm-help-search.html2
-rw-r--r--deps/npm/html/doc/cli/npm-help.html2
-rw-r--r--deps/npm/html/doc/cli/npm-init.html2
-rw-r--r--deps/npm/html/doc/cli/npm-install.html23
-rw-r--r--deps/npm/html/doc/cli/npm-link.html2
-rw-r--r--deps/npm/html/doc/cli/npm-logout.html2
-rw-r--r--deps/npm/html/doc/cli/npm-ls.html4
-rw-r--r--deps/npm/html/doc/cli/npm-outdated.html2
-rw-r--r--deps/npm/html/doc/cli/npm-owner.html2
-rw-r--r--deps/npm/html/doc/cli/npm-pack.html2
-rw-r--r--deps/npm/html/doc/cli/npm-ping.html (renamed from deps/npm/html/doc/cli/npm-submodule.html)28
-rw-r--r--deps/npm/html/doc/cli/npm-prefix.html2
-rw-r--r--deps/npm/html/doc/cli/npm-prune.html2
-rw-r--r--deps/npm/html/doc/cli/npm-publish.html2
-rw-r--r--deps/npm/html/doc/cli/npm-rebuild.html2
-rw-r--r--deps/npm/html/doc/cli/npm-repo.html2
-rw-r--r--deps/npm/html/doc/cli/npm-restart.html2
-rw-r--r--deps/npm/html/doc/cli/npm-rm.html2
-rw-r--r--deps/npm/html/doc/cli/npm-root.html2
-rw-r--r--deps/npm/html/doc/cli/npm-run-script.html2
-rw-r--r--deps/npm/html/doc/cli/npm-search.html2
-rw-r--r--deps/npm/html/doc/cli/npm-shrinkwrap.html2
-rw-r--r--deps/npm/html/doc/cli/npm-star.html2
-rw-r--r--deps/npm/html/doc/cli/npm-stars.html2
-rw-r--r--deps/npm/html/doc/cli/npm-start.html2
-rw-r--r--deps/npm/html/doc/cli/npm-stop.html2
-rw-r--r--deps/npm/html/doc/cli/npm-tag.html2
-rw-r--r--deps/npm/html/doc/cli/npm-test.html2
-rw-r--r--deps/npm/html/doc/cli/npm-uninstall.html2
-rw-r--r--deps/npm/html/doc/cli/npm-unpublish.html2
-rw-r--r--deps/npm/html/doc/cli/npm-update.html2
-rw-r--r--deps/npm/html/doc/cli/npm-version.html16
-rw-r--r--deps/npm/html/doc/cli/npm-view.html2
-rw-r--r--deps/npm/html/doc/cli/npm-whoami.html2
-rw-r--r--deps/npm/html/doc/cli/npm.html10
-rw-r--r--deps/npm/html/doc/files/npm-folders.html2
-rw-r--r--deps/npm/html/doc/files/npm-global.html2
-rw-r--r--deps/npm/html/doc/files/npm-json.html12
-rw-r--r--deps/npm/html/doc/files/npmrc.html2
-rw-r--r--deps/npm/html/doc/files/package.json.html12
-rw-r--r--deps/npm/html/doc/index.html2
-rw-r--r--deps/npm/html/doc/misc/npm-coding-style.html2
-rw-r--r--deps/npm/html/doc/misc/npm-config.html2
-rw-r--r--deps/npm/html/doc/misc/npm-developers.html2
-rw-r--r--deps/npm/html/doc/misc/npm-disputes.html8
-rw-r--r--deps/npm/html/doc/misc/npm-faq.html4
-rw-r--r--deps/npm/html/doc/misc/npm-index.html2
-rw-r--r--deps/npm/html/doc/misc/npm-registry.html2
-rw-r--r--deps/npm/html/doc/misc/npm-scope.html2
-rw-r--r--deps/npm/html/doc/misc/npm-scripts.html2
-rw-r--r--deps/npm/html/doc/misc/removing-npm.html2
-rw-r--r--deps/npm/html/doc/misc/semver.html2
-rw-r--r--deps/npm/html/partial/doc/README.html2
-rw-r--r--deps/npm/html/partial/doc/api/npm-ping.html8
-rw-r--r--deps/npm/html/partial/doc/api/npm-submodule.html21
-rw-r--r--deps/npm/html/partial/doc/api/npm.html2
-rw-r--r--deps/npm/html/partial/doc/cli/npm-install.html21
-rw-r--r--deps/npm/html/partial/doc/cli/npm-ls.html2
-rw-r--r--deps/npm/html/partial/doc/cli/npm-ping.html11
-rw-r--r--deps/npm/html/partial/doc/cli/npm-submodule.html21
-rw-r--r--deps/npm/html/partial/doc/cli/npm-version.html14
-rw-r--r--deps/npm/html/partial/doc/cli/npm.html8
-rw-r--r--deps/npm/html/partial/doc/files/npm-json.html10
-rw-r--r--deps/npm/html/partial/doc/files/package.json.html10
-rw-r--r--deps/npm/html/partial/doc/misc/npm-disputes.html6
-rw-r--r--deps/npm/html/partial/doc/misc/npm-faq.html2
-rw-r--r--deps/npm/lib/cache/add-remote-git.js36
-rw-r--r--deps/npm/lib/cache/get-stat.js74
-rw-r--r--deps/npm/lib/outdated.js2
-rw-r--r--deps/npm/lib/utils/correct-mkdir.js110
-rw-r--r--deps/npm/lib/utils/locker.js32
-rw-r--r--deps/npm/lib/view.js8
-rw-r--r--deps/npm/man/man1/npm-README.12
-rw-r--r--deps/npm/man/man1/npm-access.12
-rw-r--r--deps/npm/man/man1/npm-adduser.12
-rw-r--r--deps/npm/man/man1/npm-bin.12
-rw-r--r--deps/npm/man/man1/npm-bugs.12
-rw-r--r--deps/npm/man/man1/npm-build.12
-rw-r--r--deps/npm/man/man1/npm-bundle.12
-rw-r--r--deps/npm/man/man1/npm-cache.12
-rw-r--r--deps/npm/man/man1/npm-completion.12
-rw-r--r--deps/npm/man/man1/npm-config.12
-rw-r--r--deps/npm/man/man1/npm-dedupe.12
-rw-r--r--deps/npm/man/man1/npm-deprecate.12
-rw-r--r--deps/npm/man/man1/npm-dist-tag.12
-rw-r--r--deps/npm/man/man1/npm-docs.12
-rw-r--r--deps/npm/man/man1/npm-edit.12
-rw-r--r--deps/npm/man/man1/npm-explore.12
-rw-r--r--deps/npm/man/man1/npm-help-search.12
-rw-r--r--deps/npm/man/man1/npm-help.12
-rw-r--r--deps/npm/man/man1/npm-init.12
-rw-r--r--deps/npm/man/man1/npm-install.129
-rw-r--r--deps/npm/man/man1/npm-link.12
-rw-r--r--deps/npm/man/man1/npm-logout.12
-rw-r--r--deps/npm/man/man1/npm-ls.14
-rw-r--r--deps/npm/man/man1/npm-outdated.12
-rw-r--r--deps/npm/man/man1/npm-owner.12
-rw-r--r--deps/npm/man/man1/npm-pack.12
-rw-r--r--deps/npm/man/man1/npm-ping.123
-rw-r--r--deps/npm/man/man1/npm-prefix.12
-rw-r--r--deps/npm/man/man1/npm-prune.12
-rw-r--r--deps/npm/man/man1/npm-publish.12
-rw-r--r--deps/npm/man/man1/npm-rebuild.12
-rw-r--r--deps/npm/man/man1/npm-repo.12
-rw-r--r--deps/npm/man/man1/npm-restart.12
-rw-r--r--deps/npm/man/man1/npm-rm.12
-rw-r--r--deps/npm/man/man1/npm-root.12
-rw-r--r--deps/npm/man/man1/npm-run-script.12
-rw-r--r--deps/npm/man/man1/npm-search.12
-rw-r--r--deps/npm/man/man1/npm-shrinkwrap.12
-rw-r--r--deps/npm/man/man1/npm-star.12
-rw-r--r--deps/npm/man/man1/npm-stars.12
-rw-r--r--deps/npm/man/man1/npm-start.12
-rw-r--r--deps/npm/man/man1/npm-stop.12
-rw-r--r--deps/npm/man/man1/npm-submodule.141
-rw-r--r--deps/npm/man/man1/npm-tag.12
-rw-r--r--deps/npm/man/man1/npm-test.12
-rw-r--r--deps/npm/man/man1/npm-uninstall.12
-rw-r--r--deps/npm/man/man1/npm-unpublish.12
-rw-r--r--deps/npm/man/man1/npm-update.12
-rw-r--r--deps/npm/man/man1/npm-version.116
-rw-r--r--deps/npm/man/man1/npm-view.12
-rw-r--r--deps/npm/man/man1/npm-whoami.12
-rw-r--r--deps/npm/man/man1/npm.14
-rw-r--r--deps/npm/man/man3/npm-bin.32
-rw-r--r--deps/npm/man/man3/npm-bugs.32
-rw-r--r--deps/npm/man/man3/npm-cache.32
-rw-r--r--deps/npm/man/man3/npm-commands.32
-rw-r--r--deps/npm/man/man3/npm-config.32
-rw-r--r--deps/npm/man/man3/npm-deprecate.32
-rw-r--r--deps/npm/man/man3/npm-docs.32
-rw-r--r--deps/npm/man/man3/npm-edit.32
-rw-r--r--deps/npm/man/man3/npm-explore.32
-rw-r--r--deps/npm/man/man3/npm-help-search.32
-rw-r--r--deps/npm/man/man3/npm-init.32
-rw-r--r--deps/npm/man/man3/npm-install.32
-rw-r--r--deps/npm/man/man3/npm-link.32
-rw-r--r--deps/npm/man/man3/npm-load.32
-rw-r--r--deps/npm/man/man3/npm-ls.32
-rw-r--r--deps/npm/man/man3/npm-outdated.32
-rw-r--r--deps/npm/man/man3/npm-owner.32
-rw-r--r--deps/npm/man/man3/npm-pack.32
-rw-r--r--deps/npm/man/man3/npm-ping.317
-rw-r--r--deps/npm/man/man3/npm-prefix.32
-rw-r--r--deps/npm/man/man3/npm-prune.32
-rw-r--r--deps/npm/man/man3/npm-publish.32
-rw-r--r--deps/npm/man/man3/npm-rebuild.32
-rw-r--r--deps/npm/man/man3/npm-repo.32
-rw-r--r--deps/npm/man/man3/npm-restart.32
-rw-r--r--deps/npm/man/man3/npm-root.32
-rw-r--r--deps/npm/man/man3/npm-run-script.32
-rw-r--r--deps/npm/man/man3/npm-search.32
-rw-r--r--deps/npm/man/man3/npm-shrinkwrap.32
-rw-r--r--deps/npm/man/man3/npm-start.32
-rw-r--r--deps/npm/man/man3/npm-stop.32
-rw-r--r--deps/npm/man/man3/npm-submodule.341
-rw-r--r--deps/npm/man/man3/npm-tag.32
-rw-r--r--deps/npm/man/man3/npm-test.32
-rw-r--r--deps/npm/man/man3/npm-uninstall.32
-rw-r--r--deps/npm/man/man3/npm-unpublish.32
-rw-r--r--deps/npm/man/man3/npm-update.34
-rw-r--r--deps/npm/man/man3/npm-version.32
-rw-r--r--deps/npm/man/man3/npm-view.32
-rw-r--r--deps/npm/man/man3/npm-whoami.32
-rw-r--r--deps/npm/man/man3/npm.34
-rw-r--r--deps/npm/man/man5/npm-folders.52
-rw-r--r--deps/npm/man/man5/npm-global.52
-rw-r--r--deps/npm/man/man5/npm-json.517
-rw-r--r--deps/npm/man/man5/npmrc.52
-rw-r--r--deps/npm/man/man5/package.json.517
-rw-r--r--deps/npm/man/man7/npm-coding-style.72
-rw-r--r--deps/npm/man/man7/npm-config.72
-rw-r--r--deps/npm/man/man7/npm-developers.72
-rw-r--r--deps/npm/man/man7/npm-disputes.72
-rw-r--r--deps/npm/man/man7/npm-faq.72
-rw-r--r--deps/npm/man/man7/npm-index.72
-rw-r--r--deps/npm/man/man7/npm-registry.72
-rw-r--r--deps/npm/man/man7/npm-scope.72
-rw-r--r--deps/npm/man/man7/npm-scripts.72
-rw-r--r--deps/npm/man/man7/removing-npm.72
-rw-r--r--deps/npm/man/man7/semver.72
-rw-r--r--deps/npm/node_modules/dezalgo/.travis.yml7
-rw-r--r--deps/npm/node_modules/dezalgo/node_modules/asap/CHANGES.md63
-rw-r--r--deps/npm/node_modules/dezalgo/node_modules/asap/LICENSE.md3
-rw-r--r--deps/npm/node_modules/dezalgo/node_modules/asap/README.md236
-rw-r--r--deps/npm/node_modules/dezalgo/node_modules/asap/asap.js162
-rw-r--r--deps/npm/node_modules/dezalgo/node_modules/asap/browser-asap.js66
-rw-r--r--deps/npm/node_modules/dezalgo/node_modules/asap/browser-raw.js220
-rw-r--r--deps/npm/node_modules/dezalgo/node_modules/asap/package.json77
-rw-r--r--deps/npm/node_modules/dezalgo/node_modules/asap/raw.js101
-rw-r--r--deps/npm/node_modules/dezalgo/package.json37
-rw-r--r--deps/npm/node_modules/fstream-npm/fstream-npm.js4
-rw-r--r--deps/npm/node_modules/fstream-npm/package.json14
-rw-r--r--deps/npm/node_modules/fstream/examples/filter-pipe.js19
-rw-r--r--deps/npm/node_modules/fstream/examples/pipe.js17
-rw-r--r--deps/npm/node_modules/fstream/examples/symlink-write.js2
-rw-r--r--deps/npm/node_modules/fstream/lib/abstract.js32
-rw-r--r--deps/npm/node_modules/fstream/lib/dir-writer.js4
-rw-r--r--deps/npm/node_modules/fstream/lib/file-reader.js10
-rw-r--r--deps/npm/node_modules/fstream/lib/link-reader.js2
-rw-r--r--deps/npm/node_modules/fstream/lib/link-writer.js6
-rw-r--r--deps/npm/node_modules/fstream/lib/reader.js24
-rw-r--r--deps/npm/node_modules/fstream/lib/writer.js18
-rw-r--r--deps/npm/node_modules/fstream/package.json42
-rw-r--r--deps/npm/node_modules/init-package-json/.travis.yml5
-rw-r--r--deps/npm/node_modules/init-package-json/default-input.js3
-rw-r--r--deps/npm/node_modules/init-package-json/node_modules/promzard/package.json2
-rw-r--r--deps/npm/node_modules/init-package-json/node_modules/validate-npm-package-license/LICENSE.md7
-rw-r--r--deps/npm/node_modules/init-package-json/node_modules/validate-npm-package-license/README.md29
-rw-r--r--deps/npm/node_modules/init-package-json/node_modules/validate-npm-package-license/index.js26
-rw-r--r--deps/npm/node_modules/init-package-json/node_modules/validate-npm-package-license/node_modules/spdx-correct/.npmignore5
-rw-r--r--deps/npm/node_modules/init-package-json/package.json46
-rw-r--r--deps/npm/node_modules/init-package-json/test/basic.js2
-rw-r--r--deps/npm/node_modules/init-package-json/test/license.js7
-rw-r--r--deps/npm/node_modules/init-package-json/test/name-spaces.js7
-rw-r--r--deps/npm/node_modules/init-package-json/test/name-uppercase.js7
-rw-r--r--deps/npm/node_modules/init-package-json/test/scope-in-config-existing-name.js30
-rw-r--r--deps/npm/node_modules/init-package-json/test/scope-in-config.js18
-rw-r--r--deps/npm/node_modules/init-package-json/test/scope.js3
-rw-r--r--deps/npm/node_modules/init-package-json/test/yes-defaults.js2
-rw-r--r--deps/npm/node_modules/nopt/.travis.yml9
-rw-r--r--deps/npm/node_modules/nopt/README.md7
-rw-r--r--deps/npm/node_modules/nopt/package.json23
-rw-r--r--deps/npm/node_modules/normalize-git-url/.eslintrc19
-rw-r--r--deps/npm/node_modules/normalize-git-url/normalize-git-url.js23
-rw-r--r--deps/npm/node_modules/normalize-git-url/package.json33
-rw-r--r--deps/npm/node_modules/normalize-git-url/test/basic.js54
-rw-r--r--deps/npm/node_modules/normalize-package-data/README.md2
-rw-r--r--deps/npm/node_modules/normalize-package-data/lib/fixer.js18
-rw-r--r--deps/npm/node_modules/normalize-package-data/lib/warning_messages.json2
-rw-r--r--deps/npm/node_modules/normalize-package-data/package.json14
-rw-r--r--deps/npm/node_modules/normalize-package-data/test/normalize.js2
-rw-r--r--deps/npm/node_modules/npm-registry-client/test/fixtures/@npm/npm-registry-client/cache.json1
-rw-r--r--deps/npm/node_modules/npm-registry-client/test/fixtures/underscore/1.3.3/cache.json1
-rw-r--r--deps/npm/node_modules/npm-registry-client/test/fixtures/underscore/1.3.3/package.tgzbin58692 -> 0 bytes
-rw-r--r--deps/npm/node_modules/npm-registry-client/test/fixtures/underscore/cache.json1
-rw-r--r--deps/npm/node_modules/read-installed/.travis.yml9
-rw-r--r--deps/npm/node_modules/read-installed/node_modules/debuglog/package.json2
-rw-r--r--deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/package.json2
-rw-r--r--deps/npm/node_modules/read-installed/node_modules/util-extend/package.json4
-rw-r--r--deps/npm/node_modules/read-installed/package.json44
-rw-r--r--deps/npm/node_modules/read-installed/read-installed.js16
-rw-r--r--deps/npm/node_modules/read-installed/test/issue-40.js15
-rw-r--r--deps/npm/node_modules/request/.eslintrc45
-rw-r--r--deps/npm/node_modules/request/.travis.yml6
-rw-r--r--deps/npm/node_modules/request/CHANGELOG.md6
-rw-r--r--deps/npm/node_modules/request/README.md3
-rwxr-xr-xdeps/npm/node_modules/request/index.js25
-rw-r--r--deps/npm/node_modules/request/lib/copy.js10
-rw-r--r--deps/npm/node_modules/request/lib/helpers.js9
-rw-r--r--deps/npm/node_modules/request/lib/oauth.js7
-rw-r--r--deps/npm/node_modules/request/lib/tunnel.js183
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/.jshintrc59
-rw-r--r--deps/npm/node_modules/request/node_modules/combined-stream/Readme.md11
-rw-r--r--deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/package.json2
-rw-r--r--deps/npm/node_modules/request/node_modules/combined-stream/package.json25
-rw-r--r--deps/npm/node_modules/request/node_modules/extend/.jscs.json67
-rw-r--r--deps/npm/node_modules/request/node_modules/extend/.npmignore1
-rw-r--r--deps/npm/node_modules/request/node_modules/extend/.travis.yml36
-rw-r--r--deps/npm/node_modules/request/node_modules/extend/CHANGELOG.md60
-rw-r--r--deps/npm/node_modules/request/node_modules/extend/LICENSE22
-rw-r--r--deps/npm/node_modules/request/node_modules/extend/README.md61
-rw-r--r--deps/npm/node_modules/request/node_modules/extend/component.json31
-rw-r--r--deps/npm/node_modules/request/node_modules/extend/index.js88
-rw-r--r--deps/npm/node_modules/request/node_modules/extend/package.json70
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/lib/form_data.js4
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/async/.jshintrc25
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/async/.travis.yml3
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/async/CHANGELOG.md65
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/async/README.md392
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/async/bower.json11
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/async/component.json3
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/base.css182
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/index.html73
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lcov-report/base.css182
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lcov-report/index.html73
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lcov-report/lib/async.js.html3900
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lcov-report/lib/index.html73
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lcov-report/prettify.css1
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lcov-report/prettify.js1
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lcov-report/sort-arrow-sprite.pngbin0 -> 209 bytes
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lcov-report/sorter.js156
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lcov.info1452
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lib/async.js.html3597
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lib/index.html73
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/prettify.css1
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/prettify.js1
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/sort-arrow-sprite.pngbin0 -> 209 bytes
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/sorter.js156
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js1028
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/async/nyc_output/5074.json1
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/async/package.json41
-rwxr-xr-xdeps/npm/node_modules/request/node_modules/form-data/node_modules/async/support/sync-package-managers.js2
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/Readme.md132
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/lib/combined_stream.js188
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/.npmignore2
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Makefile6
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Readme.md154
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js99
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/package.json42
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/common.js6
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js36
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js21
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js14
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js48
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js15
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js18
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js13
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js13
-rwxr-xr-xdeps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/run.js7
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json37
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/HISTORY.md135
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/LICENSE23
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/README.md103
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/index.js188
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/HISTORY.md228
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/LICENSE22
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/README.md82
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/db.json6406
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/index.js11
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/package.json94
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/package.json84
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/package.json62
-rw-r--r--deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/changelog.md19
-rw-r--r--deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/browser/bluebird.js60
-rw-r--r--deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/browser/bluebird.min.js8
-rw-r--r--deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/async.js19
-rw-r--r--deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/debuggability.js6
-rw-r--r--deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/promise_array.js2
-rw-r--r--deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/promisify.js11
-rw-r--r--deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/util.js20
-rw-r--r--deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/package.json19
-rwxr-xr-xdeps/npm/node_modules/request/node_modules/hawk/node_modules/boom/README.md20
-rwxr-xr-xdeps/npm/node_modules/request/node_modules/hawk/node_modules/boom/index.js1
-rwxr-xr-xdeps/npm/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js12
-rw-r--r--deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/package.json21
-rwxr-xr-xdeps/npm/node_modules/request/node_modules/hawk/node_modules/boom/test/index.js1
-rw-r--r--deps/npm/node_modules/request/node_modules/isstream/.jshintrc59
-rw-r--r--deps/npm/node_modules/request/node_modules/mime-types/HISTORY.md12
-rw-r--r--deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md17
-rw-r--r--deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json32
-rw-r--r--deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json22
-rw-r--r--deps/npm/node_modules/request/node_modules/mime-types/package.json16
-rw-r--r--deps/npm/node_modules/request/node_modules/qs/.jshintrc10
-rw-r--r--deps/npm/node_modules/request/node_modules/tough-cookie/README.md296
-rw-r--r--deps/npm/node_modules/request/node_modules/tough-cookie/lib/cookie.js321
-rw-r--r--deps/npm/node_modules/request/node_modules/tough-cookie/lib/memstore.js34
-rw-r--r--deps/npm/node_modules/request/node_modules/tough-cookie/lib/store.js6
-rw-r--r--deps/npm/node_modules/request/node_modules/tough-cookie/package.json14
-rw-r--r--deps/npm/node_modules/request/node_modules/tough-cookie/public-suffix.txt374
-rw-r--r--deps/npm/node_modules/request/node_modules/tough-cookie/test/cookie_sorting_test.js66
-rw-r--r--deps/npm/node_modules/request/node_modules/tough-cookie/test/cookie_to_json_test.js4
-rw-r--r--deps/npm/node_modules/request/node_modules/tough-cookie/test/ietf_test.js3
-rw-r--r--deps/npm/node_modules/request/node_modules/tough-cookie/test/jar_serialization_test.js348
-rw-r--r--deps/npm/node_modules/request/node_modules/tunnel-agent/.jshintrc5
-rw-r--r--deps/npm/node_modules/request/package.json26
-rw-r--r--deps/npm/node_modules/request/request.js175
-rw-r--r--deps/npm/node_modules/validate-npm-package-license/LICENSE174
-rw-r--r--deps/npm/node_modules/validate-npm-package-license/README.md61
-rw-r--r--deps/npm/node_modules/validate-npm-package-license/index.js74
-rw-r--r--deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/LICENSE174
-rw-r--r--deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/README.md (renamed from deps/npm/node_modules/init-package-json/node_modules/validate-npm-package-license/node_modules/spdx-correct/README.md)0
-rw-r--r--deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/package.json (renamed from deps/npm/node_modules/init-package-json/node_modules/validate-npm-package-license/node_modules/spdx-correct/package.json)37
-rw-r--r--deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/spdx-correct.js (renamed from deps/npm/node_modules/init-package-json/node_modules/validate-npm-package-license/node_modules/spdx-correct/spdx-correct.js)0
-rw-r--r--deps/npm/node_modules/validate-npm-package-license/package.json (renamed from deps/npm/node_modules/init-package-json/node_modules/validate-npm-package-license/package.json)37
-rw-r--r--deps/npm/package.json25
-rw-r--r--deps/npm/test/fixtures/config/userconfig-with-gc2
-rw-r--r--deps/npm/test/tap/add-remote-git-get-resolved.js25
-rw-r--r--deps/openssl/config/archs/BSD-x86/opensslconf.h4
-rw-r--r--deps/openssl/config/archs/BSD-x86_64/opensslconf.h4
-rw-r--r--deps/openssl/config/archs/VC-WIN32/opensslconf.h4
-rw-r--r--deps/openssl/config/archs/VC-WIN64A/opensslconf.h4
-rw-r--r--deps/openssl/config/archs/darwin-i386-cc/opensslconf.h4
-rw-r--r--deps/openssl/config/archs/darwin64-x86_64-cc/opensslconf.h4
-rw-r--r--deps/openssl/config/archs/linux-aarch64/opensslconf.h4
-rw-r--r--deps/openssl/config/archs/linux-armv4/opensslconf.h4
-rw-r--r--deps/openssl/config/archs/linux-elf/opensslconf.h4
-rw-r--r--deps/openssl/config/archs/linux-x32/opensslconf.h4
-rw-r--r--deps/openssl/config/archs/linux-x86_64/opensslconf.h4
-rw-r--r--deps/openssl/config/archs/solaris-x86-gcc/opensslconf.h4
-rw-r--r--deps/openssl/config/archs/solaris64-x86_64-gcc/opensslconf.h4
-rw-r--r--deps/openssl/doc/UPGRADING.md9
-rw-r--r--deps/openssl/openssl/CHANGES15
-rw-r--r--deps/openssl/openssl/Makefile13
-rw-r--r--deps/openssl/openssl/Makefile.bak13
-rw-r--r--deps/openssl/openssl/Makefile.org11
-rw-r--r--deps/openssl/openssl/NEWS4
-rw-r--r--deps/openssl/openssl/README2
-rw-r--r--deps/openssl/openssl/apps/ocsp.c1
-rw-r--r--deps/openssl/openssl/crypto/bio/bio.h2
-rw-r--r--deps/openssl/openssl/crypto/bn/Makefile1
-rw-r--r--deps/openssl/openssl/crypto/bn/bn_exp.c8
-rw-r--r--deps/openssl/openssl/crypto/bn/bntest.c3
-rw-r--r--deps/openssl/openssl/crypto/bn/rsaz_exp.c10
-rw-r--r--deps/openssl/openssl/crypto/bn/rsaz_exp.h11
-rw-r--r--deps/openssl/openssl/crypto/cms/cms_smime.c3
-rw-r--r--deps/openssl/openssl/crypto/evp/e_aes.c2
-rw-r--r--deps/openssl/openssl/crypto/hmac/hmactest.c3
-rw-r--r--deps/openssl/openssl/crypto/opensslconf.h.in2
-rw-r--r--deps/openssl/openssl/crypto/opensslv.h6
-rw-r--r--deps/openssl/openssl/crypto/pkcs12/p12_kiss.c2
-rw-r--r--deps/openssl/openssl/crypto/srp/srptest.c1
-rw-r--r--deps/openssl/openssl/crypto/threads/mttest.c365
-rwxr-xr-xdeps/openssl/openssl/crypto/threads/pthread2.sh3
-rw-r--r--deps/openssl/openssl/crypto/x509/Makefile2
-rw-r--r--deps/openssl/openssl/crypto/x509/verify_extra_test.c208
-rw-r--r--deps/openssl/openssl/crypto/x509/x509_vfy.c24
-rw-r--r--deps/openssl/openssl/doc/apps/verify.pod11
-rw-r--r--deps/openssl/openssl/doc/crypto/X509_NAME_get_index_by_NID.pod7
-rw-r--r--deps/openssl/openssl/doc/crypto/X509_STORE_CTX_new.pod13
-rw-r--r--deps/openssl/openssl/doc/crypto/X509_verify_cert.pod3
-rw-r--r--deps/openssl/openssl/doc/ssl/SSL_CTX_get0_param.pod55
-rw-r--r--deps/openssl/openssl/doc/ssl/SSL_CTX_use_serverinfo.pod2
-rw-r--r--deps/openssl/openssl/include/openssl/aes.h150
-rw-r--r--deps/openssl/openssl/include/openssl/asn1.h1420
-rw-r--r--deps/openssl/openssl/include/openssl/asn1_mac.h580
-rw-r--r--deps/openssl/openssl/include/openssl/asn1t.h974
-rw-r--r--deps/openssl/openssl/include/openssl/bio.h880
-rw-r--r--deps/openssl/openssl/include/openssl/blowfish.h131
-rw-r--r--deps/openssl/openssl/include/openssl/bn.h940
-rw-r--r--deps/openssl/openssl/include/openssl/buffer.h120
-rw-r--r--deps/openssl/openssl/include/openssl/camellia.h133
-rw-r--r--deps/openssl/openssl/include/openssl/cast.h108
-rw-r--r--deps/openssl/openssl/include/openssl/cmac.h83
-rw-r--r--deps/openssl/openssl/include/openssl/cms.h556
-rw-r--r--deps/openssl/openssl/include/openssl/comp.h80
-rw-r--r--deps/openssl/openssl/include/openssl/conf.h268
-rw-r--r--deps/openssl/openssl/include/openssl/conf_api.h90
-rw-r--r--deps/openssl/openssl/include/openssl/crypto.h662
-rw-r--r--deps/openssl/openssl/include/openssl/des.h258
-rw-r--r--deps/openssl/openssl/include/openssl/des_old.h498
-rw-r--r--deps/openssl/openssl/include/openssl/dh.h393
-rw-r--r--deps/openssl/openssl/include/openssl/dsa.h333
-rw-r--r--deps/openssl/openssl/include/openssl/dso.h452
-rw-r--r--deps/openssl/openssl/include/openssl/dtls1.h273
-rw-r--r--deps/openssl/openssl/include/openssl/e_os2.h329
-rw-r--r--deps/openssl/openssl/include/openssl/ebcdic.h27
-rw-r--r--deps/openssl/openssl/include/openssl/ec.h1283
-rw-r--r--deps/openssl/openssl/include/openssl/ecdh.h135
-rw-r--r--deps/openssl/openssl/include/openssl/ecdsa.h336
-rw-r--r--deps/openssl/openssl/include/openssl/engine.h961
-rw-r--r--deps/openssl/openssl/include/openssl/err.h390
-rw-r--r--deps/openssl/openssl/include/openssl/evp.h1535
-rw-r--r--deps/openssl/openssl/include/openssl/hmac.h110
-rw-r--r--deps/openssl/openssl/include/openssl/idea.h106
-rw-r--r--deps/openssl/openssl/include/openssl/krb5_asn.h241
-rw-r--r--deps/openssl/openssl/include/openssl/kssl.h198
-rw-r--r--deps/openssl/openssl/include/openssl/lhash.h241
-rw-r--r--deps/openssl/openssl/include/openssl/md4.h120
-rw-r--r--deps/openssl/openssl/include/openssl/md5.h120
-rw-r--r--deps/openssl/openssl/include/openssl/mdc2.h95
-rw-r--r--deps/openssl/openssl/include/openssl/modes.h164
-rw-r--r--deps/openssl/openssl/include/openssl/obj_mac.h4195
-rw-r--r--deps/openssl/openssl/include/openssl/objects.h1144
-rw-r--r--deps/openssl/openssl/include/openssl/ocsp.h638
-rw-r--r--deps/openssl/openssl/include/openssl/opensslv.h98
-rw-r--r--deps/openssl/openssl/include/openssl/ossl_typ.h212
-rw-r--r--deps/openssl/openssl/include/openssl/pem.h616
-rw-r--r--deps/openssl/openssl/include/openssl/pem2.h71
-rw-r--r--deps/openssl/openssl/include/openssl/pkcs12.h343
-rw-r--r--deps/openssl/openssl/include/openssl/pkcs7.h482
-rw-r--r--deps/openssl/openssl/include/openssl/pqueue.h100
-rw-r--r--deps/openssl/openssl/include/openssl/rand.h151
-rw-r--r--deps/openssl/openssl/include/openssl/rc2.h104
-rw-r--r--deps/openssl/openssl/include/openssl/rc4.h89
-rw-r--r--deps/openssl/openssl/include/openssl/ripemd.h106
-rw-r--r--deps/openssl/openssl/include/openssl/rsa.h665
-rw-r--r--deps/openssl/openssl/include/openssl/safestack.h2673
-rw-r--r--deps/openssl/openssl/include/openssl/seed.h150
-rw-r--r--deps/openssl/openssl/include/openssl/sha.h215
-rw-r--r--deps/openssl/openssl/include/openssl/srp.h170
-rw-r--r--deps/openssl/openssl/include/openssl/srtp.h148
-rw-r--r--deps/openssl/openssl/include/openssl/ssl.h3165
-rw-r--r--deps/openssl/openssl/include/openssl/ssl2.h266
-rw-r--r--deps/openssl/openssl/include/openssl/ssl23.h85
-rw-r--r--deps/openssl/openssl/include/openssl/ssl3.h775
-rw-r--r--deps/openssl/openssl/include/openssl/stack.h108
-rw-r--r--deps/openssl/openssl/include/openssl/symhacks.h517
-rw-r--r--deps/openssl/openssl/include/openssl/tls1.h814
-rw-r--r--deps/openssl/openssl/include/openssl/ts.h863
-rw-r--r--deps/openssl/openssl/include/openssl/txt_db.h113
-rw-r--r--deps/openssl/openssl/include/openssl/ui.h416
-rw-r--r--deps/openssl/openssl/include/openssl/ui_compat.h89
-rw-r--r--deps/openssl/openssl/include/openssl/whrlpool.h42
-rw-r--r--deps/openssl/openssl/include/openssl/x509.h1328
-rw-r--r--deps/openssl/openssl/include/openssl/x509_vfy.h648
-rw-r--r--deps/openssl/openssl/include/openssl/x509v3.h1056
-rw-r--r--deps/openssl/openssl/openssl.spec2
-rw-r--r--deps/openssl/openssl/ssl/s3_clnt.c17
-rw-r--r--deps/openssl/openssl/ssl/s3_lib.c2
-rw-r--r--deps/openssl/openssl/ssl/s3_srvr.c2
-rw-r--r--deps/openssl/openssl/test/Makefile31
-rw-r--r--deps/openssl/openssl/test/certs/bad.key27
-rw-r--r--deps/openssl/openssl/test/certs/bad.pem21
-rw-r--r--deps/openssl/openssl/test/certs/interCA.key27
-rw-r--r--deps/openssl/openssl/test/certs/interCA.pem21
-rw-r--r--deps/openssl/openssl/test/certs/leaf.key27
-rw-r--r--deps/openssl/openssl/test/certs/leaf.pem21
-rw-r--r--deps/openssl/openssl/test/certs/rootCA.key27
-rw-r--r--deps/openssl/openssl/test/certs/rootCA.pem21
-rw-r--r--deps/openssl/openssl/test/certs/roots.pem42
-rw-r--r--deps/openssl/openssl/test/certs/subinterCA-ss.pem21
-rw-r--r--deps/openssl/openssl/test/certs/subinterCA.key27
-rw-r--r--deps/openssl/openssl/test/certs/subinterCA.pem21
-rw-r--r--deps/openssl/openssl/test/certs/untrusted.pem42
-rw-r--r--deps/openssl/openssl/test/testssl19
l---------deps/openssl/openssl/test/verify_extra_test.c1
-rw-r--r--deps/v8/src/log.cc2
-rw-r--r--deps/v8/src/unicode-decoder.cc10
-rw-r--r--deps/v8/src/unicode-decoder.h8
-rw-r--r--doc/api/process.markdown8
-rw-r--r--doc/api/stream.markdown2
-rw-r--r--doc/releases.md102
-rw-r--r--doc/tsc-meetings/2015-05-27.md142
-rw-r--r--doc/tsc-meetings/2015-06-10.md (renamed from doc/tc-meetings/2015-06-10.md)0
-rw-r--r--doc/tsc-meetings/2015-06-17.md133
-rw-r--r--doc/tsc-meetings/io.js/2014-10-09.md (renamed from doc/tc-meetings/2014-10-09.md)0
-rw-r--r--doc/tsc-meetings/io.js/2014-10-15.md (renamed from doc/tc-meetings/2014-10-15.md)0
-rw-r--r--doc/tsc-meetings/io.js/2014-10-29.md (renamed from doc/tc-meetings/2014-10-29.md)0
-rw-r--r--doc/tsc-meetings/io.js/2014-12-10.md (renamed from doc/tc-meetings/2014-12-10.md)0
-rw-r--r--doc/tsc-meetings/io.js/2014-12-17.md (renamed from doc/tc-meetings/2014-12-17.md)0
-rw-r--r--doc/tsc-meetings/io.js/2014-12-30.md (renamed from doc/tc-meetings/2014-12-30.md)0
-rw-r--r--doc/tsc-meetings/io.js/2015-01-07.md (renamed from doc/tc-meetings/2015-01-07.md)0
-rw-r--r--doc/tsc-meetings/io.js/2015-01-13.md (renamed from doc/tc-meetings/2015-01-13.md)0
-rw-r--r--doc/tsc-meetings/io.js/2015-01-21.md (renamed from doc/tc-meetings/2015-01-21.md)0
-rw-r--r--doc/tsc-meetings/io.js/2015-01-28.md (renamed from doc/tc-meetings/2015-01-28.md)0
-rw-r--r--doc/tsc-meetings/io.js/2015-02-04.md (renamed from doc/tc-meetings/2015-02-04.md)0
-rw-r--r--doc/tsc-meetings/io.js/2015-02-18.md (renamed from doc/tc-meetings/2015-02-18.md)0
-rw-r--r--doc/tsc-meetings/io.js/2015-03-04.md (renamed from doc/tc-meetings/2015-03-04.md)0
-rw-r--r--doc/tsc-meetings/io.js/2015-03-18.md (renamed from doc/tc-meetings/2015-03-18.md)0
-rw-r--r--doc/tsc-meetings/io.js/2015-04-01.md (renamed from doc/tc-meetings/2015-04-01.md)0
-rw-r--r--doc/tsc-meetings/io.js/2015-04-08.md (renamed from doc/tc-meetings/2015-04-08.md)0
-rw-r--r--doc/tsc-meetings/io.js/2015-04-15.md (renamed from doc/tc-meetings/2015-04-15.md)0
-rw-r--r--doc/tsc-meetings/io.js/2015-04-22.md (renamed from doc/tc-meetings/2015-04-22.md)0
-rw-r--r--doc/tsc-meetings/io.js/2015-04-29.md (renamed from doc/tc-meetings/2015-04-29.md)0
-rw-r--r--doc/tsc-meetings/io.js/2015-05-13.md137
-rw-r--r--lib/_http_outgoing.js5
-rw-r--r--lib/_stream_wrap.js134
-rw-r--r--lib/_stream_writable.js7
-rw-r--r--lib/_tls_wrap.js32
-rw-r--r--lib/buffer.js21
-rw-r--r--lib/child_process.js6
-rw-r--r--lib/crypto.js14
-rw-r--r--lib/http.js8
-rw-r--r--lib/internal/util.js22
-rw-r--r--lib/module.js16
-rw-r--r--lib/net.js20
-rw-r--r--lib/os.js6
-rw-r--r--lib/path.js139
-rw-r--r--lib/readline.js6
-rw-r--r--lib/repl.js16
-rw-r--r--lib/smalloc.js7
-rw-r--r--lib/tty.js6
-rw-r--r--lib/url.js2
-rw-r--r--lib/util.js34
-rw-r--r--src/js_stream.cc2
-rw-r--r--src/node.cc7
-rw-r--r--src/node.js4
-rw-r--r--src/node_buffer.cc40
-rw-r--r--src/node_crypto.cc2
-rw-r--r--src/tls_wrap.cc7
-rw-r--r--test/disabled/test-cat.js53
-rw-r--r--test/disabled/test-child-process-custom-fds.js94
-rw-r--r--test/disabled/test-child-process-customfd-bounded.js9
-rw-r--r--test/disabled/test-dgram-multicast.js96
-rw-r--r--test/disabled/test-dgram-unix-anon.js58
-rw-r--r--test/disabled/test-dgram-unix.js52
-rw-r--r--test/disabled/test-eio-race2.js23
-rw-r--r--test/disabled/test-eio-race3.js20
-rw-r--r--test/disabled/test-eio-race4.js22
-rw-r--r--test/disabled/test-http-agent2.js64
-rw-r--r--test/disabled/test-http-big-proxy-responses.js112
-rw-r--r--test/disabled/test-http-head-request.js44
-rw-r--r--test/disabled/test-http-stress.js43
-rw-r--r--test/disabled/test-http-tls.js155
-rw-r--r--test/disabled/test-idle-watcher.js16
-rw-r--r--test/disabled/test-net-fd-passing.js71
-rw-r--r--test/disabled/test-net-tls-pummel.js127
-rw-r--r--test/disabled/test-net-tls.js112
-rw-r--r--test/disabled/test-process-title.js40
-rw-r--r--test/disabled/test-remote-module-loading.js39
-rw-r--r--test/disabled/test-tls-large-push.js65
-rw-r--r--test/disabled/test-tls-server.js36
-rw-r--r--test/disabled/test-tty-stdio.js13
-rw-r--r--test/disabled/tls-client.js23
-rw-r--r--test/disabled/tls_client.js44
-rw-r--r--test/fixtures/deprecated-userland-function.js6
-rw-r--r--test/internet/test-tls-connnect-cnnic.js7
-rw-r--r--test/internet/test-tls-connnect-melissadata.js7
-rw-r--r--test/parallel/test-buffer-fakes.js56
-rw-r--r--test/parallel/test-crypto.js15
-rw-r--r--test/parallel/test-dgram-bind-shared-ports.js15
-rw-r--r--test/parallel/test-dgram-oob-buffer.js2
-rw-r--r--test/parallel/test-dgram-setTTL.js17
-rw-r--r--test/parallel/test-domain-http-server.js2
-rw-r--r--test/parallel/test-fs-mkdir.js2
-rw-r--r--test/parallel/test-fs-read-stream-inherit.js4
-rw-r--r--test/parallel/test-fs-read-stream.js4
-rw-r--r--test/parallel/test-fs-readfile-pipe-large.js1
-rw-r--r--test/parallel/test-fs-readfile-pipe.js1
-rw-r--r--test/parallel/test-fs-readfilesync-pipe-large.js1
-rw-r--r--test/parallel/test-http-response-close-event-race.js90
-rw-r--r--test/parallel/test-http-server-multiheaders.js6
-rw-r--r--test/parallel/test-path-parse-format.js26
-rw-r--r--test/parallel/test-repl-tab-complete.js132
-rw-r--r--test/parallel/test-repl-unexpected-token-recoverable.js33
-rw-r--r--test/parallel/test-stream-wrap.js39
-rw-r--r--test/parallel/test-sys.js2
-rw-r--r--test/parallel/test-tls-cnnic-whitelist.js89
-rw-r--r--test/parallel/test-tls-connect-given-socket.js29
-rw-r--r--test/parallel/test-tls-destroy-whilst-write.js29
-rw-r--r--test/parallel/test-tls-npn-server-client.js6
-rw-r--r--test/parallel/test-tls-session-cache.js4
-rw-r--r--test/parallel/test-util-log.js2
-rw-r--r--test/parallel/test-zlib-dictionary-fail.js4
-rw-r--r--test/sequential/test-deprecation-flags.js18
-rw-r--r--test/sequential/test-tls-honorcipherorder.js2
-rw-r--r--tools/eslint/README.md38
-rwxr-xr-xtools/eslint/bin/eslint.js15
-rw-r--r--tools/eslint/conf/environments.js9
-rw-r--r--tools/eslint/conf/eslint.json16
-rw-r--r--tools/eslint/lib/api.js3
-rw-r--r--tools/eslint/lib/cli-engine.js120
-rw-r--r--tools/eslint/lib/cli.js1
-rw-r--r--tools/eslint/lib/config-initializer.js145
-rw-r--r--tools/eslint/lib/config-validator.js110
-rw-r--r--tools/eslint/lib/config.js160
-rw-r--r--tools/eslint/lib/eslint.js51
-rw-r--r--tools/eslint/lib/file-finder.js4
-rw-r--r--tools/eslint/lib/formatters/tap.js6
-rw-r--r--tools/eslint/lib/ignored-paths.js4
-rw-r--r--tools/eslint/lib/options.js11
-rw-r--r--tools/eslint/lib/rules/accessor-pairs.js65
-rw-r--r--tools/eslint/lib/rules/array-bracket-spacing.js180
-rw-r--r--tools/eslint/lib/rules/block-scoped-var.js2
-rw-r--r--tools/eslint/lib/rules/brace-style.js26
-rw-r--r--tools/eslint/lib/rules/camelcase.js12
-rw-r--r--tools/eslint/lib/rules/comma-dangle.js13
-rw-r--r--tools/eslint/lib/rules/comma-spacing.js36
-rw-r--r--tools/eslint/lib/rules/comma-style.js18
-rw-r--r--tools/eslint/lib/rules/complexity.js6
-rw-r--r--tools/eslint/lib/rules/computed-property-spacing.js144
-rw-r--r--tools/eslint/lib/rules/consistent-return.js2
-rw-r--r--tools/eslint/lib/rules/consistent-this.js15
-rw-r--r--tools/eslint/lib/rules/constructor-super.js108
-rw-r--r--tools/eslint/lib/rules/curly.js6
-rw-r--r--tools/eslint/lib/rules/default-case.js2
-rw-r--r--tools/eslint/lib/rules/dot-location.js63
-rw-r--r--tools/eslint/lib/rules/dot-notation.js15
-rw-r--r--tools/eslint/lib/rules/eol-last.js2
-rw-r--r--tools/eslint/lib/rules/eqeqeq.js6
-rw-r--r--tools/eslint/lib/rules/func-names.js2
-rw-r--r--tools/eslint/lib/rules/func-style.js6
-rw-r--r--tools/eslint/lib/rules/generator-star-spacing.js53
-rw-r--r--tools/eslint/lib/rules/generator-star.js6
-rw-r--r--tools/eslint/lib/rules/global-strict.js6
-rw-r--r--tools/eslint/lib/rules/guard-for-in.js2
-rw-r--r--tools/eslint/lib/rules/handle-callback-err.js83
-rw-r--r--tools/eslint/lib/rules/indent.js24
-rw-r--r--tools/eslint/lib/rules/key-spacing.js20
-rw-r--r--tools/eslint/lib/rules/linebreak-style.js44
-rw-r--r--tools/eslint/lib/rules/lines-around-comment.js224
-rw-r--r--tools/eslint/lib/rules/max-depth.js6
-rw-r--r--tools/eslint/lib/rules/max-len.js15
-rw-r--r--tools/eslint/lib/rules/max-nested-callbacks.js6
-rw-r--r--tools/eslint/lib/rules/max-params.js6
-rw-r--r--tools/eslint/lib/rules/max-statements.js6
-rw-r--r--tools/eslint/lib/rules/new-cap.js31
-rw-r--r--tools/eslint/lib/rules/new-parens.js2
-rw-r--r--tools/eslint/lib/rules/newline-after-var.js6
-rw-r--r--tools/eslint/lib/rules/no-alert.js133
-rw-r--r--tools/eslint/lib/rules/no-array-constructor.js2
-rw-r--r--tools/eslint/lib/rules/no-bitwise.js2
-rw-r--r--tools/eslint/lib/rules/no-caller.js2
-rw-r--r--tools/eslint/lib/rules/no-catch-shadow.js2
-rw-r--r--tools/eslint/lib/rules/no-comma-dangle.js2
-rw-r--r--tools/eslint/lib/rules/no-cond-assign.js6
-rw-r--r--tools/eslint/lib/rules/no-console.js2
-rw-r--r--tools/eslint/lib/rules/no-constant-condition.js2
-rw-r--r--tools/eslint/lib/rules/no-continue.js2
-rw-r--r--tools/eslint/lib/rules/no-control-regex.js2
-rw-r--r--tools/eslint/lib/rules/no-debugger.js2
-rw-r--r--tools/eslint/lib/rules/no-delete-var.js2
-rw-r--r--tools/eslint/lib/rules/no-div-regex.js2
-rw-r--r--tools/eslint/lib/rules/no-dupe-args.js8
-rw-r--r--tools/eslint/lib/rules/no-dupe-keys.js2
-rw-r--r--tools/eslint/lib/rules/no-duplicate-case.js8
-rw-r--r--tools/eslint/lib/rules/no-else-return.js2
-rw-r--r--tools/eslint/lib/rules/no-empty-character-class.js43
-rw-r--r--tools/eslint/lib/rules/no-empty-class.js2
-rw-r--r--tools/eslint/lib/rules/no-empty-label.js2
-rw-r--r--tools/eslint/lib/rules/no-empty.js2
-rw-r--r--tools/eslint/lib/rules/no-eq-null.js2
-rw-r--r--tools/eslint/lib/rules/no-eval.js2
-rw-r--r--tools/eslint/lib/rules/no-ex-assign.js2
-rw-r--r--tools/eslint/lib/rules/no-extend-native.js30
-rw-r--r--tools/eslint/lib/rules/no-extra-bind.js2
-rw-r--r--tools/eslint/lib/rules/no-extra-boolean-cast.js2
-rw-r--r--tools/eslint/lib/rules/no-extra-parens.js137
-rw-r--r--tools/eslint/lib/rules/no-extra-semi.js53
-rw-r--r--tools/eslint/lib/rules/no-extra-strict.js2
-rw-r--r--tools/eslint/lib/rules/no-fallthrough.js2
-rw-r--r--tools/eslint/lib/rules/no-floating-decimal.js2
-rw-r--r--tools/eslint/lib/rules/no-func-assign.js2
-rw-r--r--tools/eslint/lib/rules/no-implied-eval.js2
-rw-r--r--tools/eslint/lib/rules/no-inline-comments.js2
-rw-r--r--tools/eslint/lib/rules/no-inner-declarations.js6
-rw-r--r--tools/eslint/lib/rules/no-invalid-regexp.js2
-rw-r--r--tools/eslint/lib/rules/no-irregular-whitespace.js83
-rw-r--r--tools/eslint/lib/rules/no-iterator.js2
-rw-r--r--tools/eslint/lib/rules/no-label-var.js2
-rw-r--r--tools/eslint/lib/rules/no-labels.js2
-rw-r--r--tools/eslint/lib/rules/no-lone-blocks.js95
-rw-r--r--tools/eslint/lib/rules/no-lonely-if.js2
-rw-r--r--tools/eslint/lib/rules/no-loop-func.js45
-rw-r--r--tools/eslint/lib/rules/no-mixed-requires.js6
-rw-r--r--tools/eslint/lib/rules/no-mixed-spaces-and-tabs.js6
-rw-r--r--tools/eslint/lib/rules/no-multi-spaces.js18
-rw-r--r--tools/eslint/lib/rules/no-multi-str.js2
-rw-r--r--tools/eslint/lib/rules/no-multiple-empty-lines.js44
-rw-r--r--tools/eslint/lib/rules/no-native-reassign.js31
-rw-r--r--tools/eslint/lib/rules/no-negated-in-lhs.js2
-rw-r--r--tools/eslint/lib/rules/no-nested-ternary.js2
-rw-r--r--tools/eslint/lib/rules/no-new-func.js2
-rw-r--r--tools/eslint/lib/rules/no-new-object.js2
-rw-r--r--tools/eslint/lib/rules/no-new-require.js2
-rw-r--r--tools/eslint/lib/rules/no-new-wrappers.js2
-rw-r--r--tools/eslint/lib/rules/no-new.js2
-rw-r--r--tools/eslint/lib/rules/no-obj-calls.js2
-rw-r--r--tools/eslint/lib/rules/no-octal-escape.js2
-rw-r--r--tools/eslint/lib/rules/no-octal.js2
-rw-r--r--tools/eslint/lib/rules/no-param-reassign.js2
-rw-r--r--tools/eslint/lib/rules/no-path-concat.js2
-rw-r--r--tools/eslint/lib/rules/no-plusplus.js2
-rw-r--r--tools/eslint/lib/rules/no-process-env.js2
-rw-r--r--tools/eslint/lib/rules/no-process-exit.js2
-rw-r--r--tools/eslint/lib/rules/no-proto.js2
-rw-r--r--tools/eslint/lib/rules/no-redeclare.js22
-rw-r--r--tools/eslint/lib/rules/no-regex-spaces.js2
-rw-r--r--tools/eslint/lib/rules/no-reserved-keys.js2
-rw-r--r--tools/eslint/lib/rules/no-restricted-modules.js13
-rw-r--r--tools/eslint/lib/rules/no-return-assign.js37
-rw-r--r--tools/eslint/lib/rules/no-script-url.js2
-rw-r--r--tools/eslint/lib/rules/no-self-compare.js2
-rw-r--r--tools/eslint/lib/rules/no-sequences.js2
-rw-r--r--tools/eslint/lib/rules/no-shadow-restricted-names.js2
-rw-r--r--tools/eslint/lib/rules/no-shadow.js151
-rw-r--r--tools/eslint/lib/rules/no-space-before-semi.js2
-rw-r--r--tools/eslint/lib/rules/no-spaced-func.js2
-rw-r--r--tools/eslint/lib/rules/no-sparse-arrays.js2
-rw-r--r--tools/eslint/lib/rules/no-sync.js2
-rw-r--r--tools/eslint/lib/rules/no-ternary.js2
-rw-r--r--tools/eslint/lib/rules/no-this-before-super.js144
-rw-r--r--tools/eslint/lib/rules/no-throw-literal.js2
-rw-r--r--tools/eslint/lib/rules/no-trailing-spaces.js58
-rw-r--r--tools/eslint/lib/rules/no-undef-init.js2
-rw-r--r--tools/eslint/lib/rules/no-undef.js2
-rw-r--r--tools/eslint/lib/rules/no-undefined.js2
-rw-r--r--tools/eslint/lib/rules/no-underscore-dangle.js2
-rw-r--r--tools/eslint/lib/rules/no-unexpected-multiline.js58
-rw-r--r--tools/eslint/lib/rules/no-unneeded-ternary.js48
-rw-r--r--tools/eslint/lib/rules/no-unreachable.js2
-rw-r--r--tools/eslint/lib/rules/no-unused-expressions.js2
-rw-r--r--tools/eslint/lib/rules/no-unused-vars.js218
-rw-r--r--tools/eslint/lib/rules/no-use-before-define.js44
-rw-r--r--tools/eslint/lib/rules/no-var.js2
-rw-r--r--tools/eslint/lib/rules/no-void.js2
-rw-r--r--tools/eslint/lib/rules/no-warning-comments.js18
-rw-r--r--tools/eslint/lib/rules/no-with.js2
-rw-r--r--tools/eslint/lib/rules/no-wrap-func.js33
-rw-r--r--tools/eslint/lib/rules/object-curly-spacing.js231
-rw-r--r--tools/eslint/lib/rules/object-shorthand.js20
-rw-r--r--tools/eslint/lib/rules/one-var.js260
-rw-r--r--tools/eslint/lib/rules/operator-assignment.js6
-rw-r--r--tools/eslint/lib/rules/operator-linebreak.js14
-rw-r--r--tools/eslint/lib/rules/padded-blocks.js6
-rw-r--r--tools/eslint/lib/rules/prefer-const.js91
-rw-r--r--tools/eslint/lib/rules/quote-props.js6
-rw-r--r--tools/eslint/lib/rules/quotes.js11
-rw-r--r--tools/eslint/lib/rules/radix.js2
-rw-r--r--tools/eslint/lib/rules/semi-spacing.js17
-rw-r--r--tools/eslint/lib/rules/semi.js6
-rw-r--r--tools/eslint/lib/rules/sort-vars.js12
-rw-r--r--tools/eslint/lib/rules/space-after-function-name.js6
-rw-r--r--tools/eslint/lib/rules/space-after-keywords.js8
-rw-r--r--tools/eslint/lib/rules/space-before-blocks.js6
-rw-r--r--tools/eslint/lib/rules/space-before-function-paren.js22
-rw-r--r--tools/eslint/lib/rules/space-before-function-parentheses.js22
-rw-r--r--tools/eslint/lib/rules/space-in-brackets.js35
-rw-r--r--tools/eslint/lib/rules/space-in-parens.js19
-rw-r--r--tools/eslint/lib/rules/space-infix-ops.js12
-rw-r--r--tools/eslint/lib/rules/space-return-throw-case.js2
-rw-r--r--tools/eslint/lib/rules/space-unary-ops.js26
-rw-r--r--tools/eslint/lib/rules/spaced-comment.js143
-rw-r--r--tools/eslint/lib/rules/spaced-line-comment.js18
-rw-r--r--tools/eslint/lib/rules/strict.js6
-rw-r--r--tools/eslint/lib/rules/use-isnan.js2
-rw-r--r--tools/eslint/lib/rules/valid-jsdoc.js28
-rw-r--r--tools/eslint/lib/rules/valid-typeof.js2
-rw-r--r--tools/eslint/lib/rules/vars-on-top.js2
-rw-r--r--tools/eslint/lib/rules/wrap-iife.js6
-rw-r--r--tools/eslint/lib/rules/wrap-regex.js2
-rw-r--r--tools/eslint/lib/rules/yoda.js30
l---------[-rwxr-xr-x]tools/eslint/node_modules/.bin/esparse128
l---------[-rwxr-xr-x]tools/eslint/node_modules/.bin/esvalidate200
l---------[-rwxr-xr-x]tools/eslint/node_modules/.bin/js-yaml143
l---------[-rwxr-xr-x]tools/eslint/node_modules/.bin/mkdirp34
l---------[-rwxr-xr-x]tools/eslint/node_modules/.bin/strip-json-comments42
l---------[-rwxr-xr-x]tools/eslint/node_modules/.bin/user-home27
l---------[-rwxr-xr-x]tools/eslint/node_modules/chalk/node_modules/.bin/has-ansi46
l---------[-rwxr-xr-x]tools/eslint/node_modules/chalk/node_modules/.bin/strip-ansi48
l---------[-rwxr-xr-x]tools/eslint/node_modules/chalk/node_modules/.bin/supports-color30
-rw-r--r--tools/eslint/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/package.json2
-rw-r--r--tools/eslint/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/package.json2
-rw-r--r--tools/eslint/node_modules/concat-stream/.npmignore1
-rw-r--r--tools/eslint/node_modules/concat-stream/node_modules/inherits/package.json4
-rw-r--r--tools/eslint/node_modules/concat-stream/node_modules/readable-stream/.travis.yml39
-rw-r--r--tools/eslint/node_modules/concat-stream/node_modules/readable-stream/.zuul.yml1
-rw-r--r--tools/eslint/node_modules/concat-stream/node_modules/readable-stream/README.md33
-rw-r--r--tools/eslint/node_modules/concat-stream/node_modules/readable-stream/doc/stream.markdown1651
-rw-r--r--tools/eslint/node_modules/concat-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md60
-rw-r--r--tools/eslint/node_modules/concat-stream/node_modules/readable-stream/float.patch923
-rw-r--r--tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_duplex.js43
-rw-r--r--tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_passthrough.js23
-rw-r--r--tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_readable.js153
-rw-r--r--tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_transform.js42
-rw-r--r--tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js210
-rw-r--r--tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/package.json2
-rw-r--r--tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml7
-rw-r--r--tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/index.js13
-rw-r--r--tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/package.json44
-rw-r--r--tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/readme.md18
-rw-r--r--tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/test.js17
-rw-r--r--tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/package.json26
-rw-r--r--tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/History.md11
-rw-r--r--tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/LICENSE24
-rw-r--r--tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/README.md53
-rw-r--r--tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/browser.js62
-rw-r--r--tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/node.js6
-rw-r--r--tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/package.json53
-rw-r--r--tools/eslint/node_modules/concat-stream/node_modules/readable-stream/package.json67
-rw-r--r--tools/eslint/node_modules/concat-stream/node_modules/readable-stream/readable.js7
-rw-r--r--tools/eslint/node_modules/concat-stream/node_modules/typedarray/package.json23
-rw-r--r--tools/eslint/node_modules/concat-stream/package.json25
-rw-r--r--tools/eslint/node_modules/concat-stream/readme.md10
-rw-r--r--tools/eslint/node_modules/concat-stream/test/array.js12
-rw-r--r--tools/eslint/node_modules/concat-stream/test/buffer.js31
-rw-r--r--tools/eslint/node_modules/concat-stream/test/infer.js15
-rw-r--r--tools/eslint/node_modules/concat-stream/test/nothing.js25
-rw-r--r--tools/eslint/node_modules/concat-stream/test/objects.js29
-rw-r--r--tools/eslint/node_modules/concat-stream/test/server/ls.js16
-rw-r--r--tools/eslint/node_modules/concat-stream/test/string.js76
-rw-r--r--tools/eslint/node_modules/concat-stream/test/typedarray.js33
-rw-r--r--tools/eslint/node_modules/debug/History.md9
-rw-r--r--tools/eslint/node_modules/debug/Makefile7
-rw-r--r--tools/eslint/node_modules/debug/Readme.md16
-rw-r--r--tools/eslint/node_modules/debug/bower.json2
-rw-r--r--tools/eslint/node_modules/debug/browser.js21
-rw-r--r--tools/eslint/node_modules/debug/component.json4
-rw-r--r--tools/eslint/node_modules/debug/node_modules/ms/README.md2
-rw-r--r--tools/eslint/node_modules/debug/node_modules/ms/index.js2
-rw-r--r--tools/eslint/node_modules/debug/node_modules/ms/package.json19
-rw-r--r--tools/eslint/node_modules/debug/package.json20
-rw-r--r--tools/eslint/node_modules/escope/gulpfile.js4
-rw-r--r--tools/eslint/node_modules/escope/lib/reference.js9
-rw-r--r--tools/eslint/node_modules/escope/lib/referencer.js181
-rw-r--r--tools/eslint/node_modules/escope/lib/scope.js77
-rw-r--r--tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/package.json2
-rw-r--r--tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/package.json2
-rw-r--r--tools/eslint/node_modules/escope/package.json32
-rw-r--r--tools/eslint/node_modules/escope/src/reference.js7
-rw-r--r--tools/eslint/node_modules/escope/src/referencer.js181
-rw-r--r--tools/eslint/node_modules/escope/src/scope.js72
-rw-r--r--tools/eslint/node_modules/espree/README.md4
-rw-r--r--tools/eslint/node_modules/espree/espree.js13
-rw-r--r--tools/eslint/node_modules/espree/lib/syntax.js6
-rw-r--r--tools/eslint/node_modules/espree/package.json14
-rw-r--r--tools/eslint/node_modules/estraverse/estraverse.js12
-rw-r--r--tools/eslint/node_modules/estraverse/package.json23
-rw-r--r--tools/eslint/node_modules/globals/globals.json13
-rw-r--r--tools/eslint/node_modules/globals/package.json27
-rw-r--r--tools/eslint/node_modules/inquirer/README.md295
-rw-r--r--tools/eslint/node_modules/inquirer/lib/inquirer.js79
-rw-r--r--tools/eslint/node_modules/inquirer/lib/objects/choice.js44
-rw-r--r--tools/eslint/node_modules/inquirer/lib/objects/choices.js180
-rw-r--r--tools/eslint/node_modules/inquirer/lib/objects/separator.js47
-rw-r--r--tools/eslint/node_modules/inquirer/lib/prompts/base.js231
-rw-r--r--tools/eslint/node_modules/inquirer/lib/prompts/checkbox.js258
-rw-r--r--tools/eslint/node_modules/inquirer/lib/prompts/confirm.js105
-rw-r--r--tools/eslint/node_modules/inquirer/lib/prompts/expand.js258
-rw-r--r--tools/eslint/node_modules/inquirer/lib/prompts/input.js106
-rw-r--r--tools/eslint/node_modules/inquirer/lib/prompts/list.js194
-rw-r--r--tools/eslint/node_modules/inquirer/lib/prompts/password.js153
-rw-r--r--tools/eslint/node_modules/inquirer/lib/prompts/rawlist.js191
-rw-r--r--tools/eslint/node_modules/inquirer/lib/ui/baseUI.js83
-rw-r--r--tools/eslint/node_modules/inquirer/lib/ui/bottom-bar.js77
-rw-r--r--tools/eslint/node_modules/inquirer/lib/ui/prompt.js136
-rw-r--r--tools/eslint/node_modules/inquirer/lib/utils/events.js32
-rw-r--r--tools/eslint/node_modules/inquirer/lib/utils/tty.js130
-rw-r--r--tools/eslint/node_modules/inquirer/lib/utils/utils.js123
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/ansi-regex/index.js4
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/ansi-regex/license21
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/ansi-regex/package.json86
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/ansi-regex/readme.md33
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/cli-width/.npmignore3
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/cli-width/README.md28
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/cli-width/index.js20
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/cli-width/package.json49
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/cli-width/test/index.js40
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/figures/index.js87
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/figures/package.json67
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/figures/readme.md34
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/LICENSE.txt22
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/README.md120
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array.js44
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array/chunk.js47
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array/compact.js30
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array/difference.js28
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array/drop.js39
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array/dropRight.js40
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array/dropRightWhile.js59
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array/dropWhile.js59
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array/fill.js44
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array/findIndex.js53
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array/findLastIndex.js53
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array/first.js22
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array/flatten.js32
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array/flattenDeep.js21
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array/head.js1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array/indexOf.js54
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array/initial.js20
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array/intersection.js58
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array/last.js19
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array/lastIndexOf.js60
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array/object.js1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array/pull.js52
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array/pullAt.js40
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array/remove.js64
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array/rest.js21
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array/slice.js30
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array/sortedIndex.js53
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array/sortedLastIndex.js25
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array/tail.js1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array/take.js39
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array/takeRight.js40
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array/takeRightWhile.js59
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array/takeWhile.js59
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array/union.js24
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array/uniq.js71
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array/unique.js1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array/unzip.js47
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array/unzipWith.js41
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array/without.js27
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array/xor.js34
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array/zip.js21
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array/zipObject.js43
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/array/zipWith.js36
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/chain.js15
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/chain/chain.js35
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/chain/commit.js1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/chain/lodash.js123
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/chain/plant.js1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/chain/reverse.js1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/chain/run.js1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/chain/tap.js29
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/chain/thru.js26
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/chain/toJSON.js1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/chain/toString.js1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/chain/value.js1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/chain/valueOf.js1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperChain.js32
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperCommit.js32
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperPlant.js45
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperReverse.js38
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperToString.js17
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperValue.js20
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection.js44
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection/all.js1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection/any.js1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection/at.js29
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection/collect.js1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection/contains.js1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection/countBy.js54
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection/detect.js1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection/each.js1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection/eachRight.js1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection/every.js66
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection/filter.js61
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection/find.js56
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection/findLast.js25
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection/findWhere.js37
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection/foldl.js1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection/foldr.js1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection/forEach.js37
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection/forEachRight.js26
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection/groupBy.js59
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection/include.js1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection/includes.js60
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection/indexBy.js53
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection/inject.js1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection/invoke.js42
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection/map.js68
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection/max.js1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection/min.js1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection/partition.js66
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection/pluck.js31
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection/reduce.js43
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection/reduceRight.js29
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection/reject.js50
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection/sample.js50
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection/select.js1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection/shuffle.js24
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection/size.js30
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection/some.js67
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection/sortBy.js71
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection/sortByAll.js52
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection/sortByOrder.js55
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection/sum.js1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/collection/where.js37
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/date.js3
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/date/now.js24
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/function.js27
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/function/after.js48
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/function/ary.js34
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/function/backflow.js1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/function/before.js42
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/function/bind.js56
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/function/bindAll.js50
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/function/bindKey.js66
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/function/compose.js1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/function/curry.js51
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/function/curryRight.js48
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/function/debounce.js187
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/function/defer.js25
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/function/delay.js26
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/function/flow.js25
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/function/flowRight.js25
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/function/memoize.js80
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/function/negate.js32
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/function/once.js24
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/function/partial.js43
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/function/partialRight.js42
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/function/rearg.js40
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/function/restParam.js58
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/function/spread.js44
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/function/throttle.js72
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/function/wrap.js33
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/index.js12235
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/LazyWrapper.js27
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/LodashWrapper.js21
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/MapCache.js24
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/SetCache.js29
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arrayCopy.js20
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arrayEach.js22
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arrayEachRight.js21
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arrayEvery.js23
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arrayExtremum.js30
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arrayFilter.js25
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arrayMap.js21
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arrayReduce.js26
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arrayReduceRight.js24
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arraySome.js23
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arraySum.js18
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/assignDefaults.js13
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/assignOwnDefaults.js26
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/assignWith.js32
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseAssign.js19
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseAt.js32
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseCallback.js35
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseClone.js128
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseCompareAscending.js34
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseCopy.js23
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseCreate.js23
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseDelay.js21
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseDifference.js52
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseEach.js15
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseEachRight.js15
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseEvery.js22
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseExtremum.js (renamed from tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/extremumBy.js)22
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseFill.js31
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseFilter.js22
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseFind.js25
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseFindIndex.js23
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseFlatten.js43
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseFor.js17
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseForIn.js17
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseForOwn.js17
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseForOwnRight.js17
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseForRight.js15
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseFunctions.js27
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseGet.js29
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseIndexOf.js27
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseIsEqual.js28
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseIsEqualDeep.js102
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseIsFunction.js15
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseIsMatch.js52
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseLodash.js10
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseMap.js23
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseMatches.js30
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseMatchesProperty.js45
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseMerge.js56
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseMergeDeep.js67
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseProperty.js14
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/basePropertyDeep.js19
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/basePullAt.js30
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseRandom.js20
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseReduce.js24
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseSetData.js17
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseSlice.js32
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseSome.js23
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseSortBy.js21
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseSortByOrder.js31
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseSum.js20
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseToString.js16
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseUniq.js57
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseValues.js22
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseWhile.js24
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseWrapperValue.js37
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/binaryIndex.js39
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/binaryIndexBy.js59
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/bindCallback.js39
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/bufferClone.js55
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/cacheIndexOf.js19
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/cachePush.js20
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/charsLeftIndex.js18
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/charsRightIndex.js17
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/compareAscending.js16
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/compareMultiple.js43
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/composeArgs.js34
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/composeArgsRight.js36
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createAggregator.js40
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createAssigner.js44
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createBaseEach.js31
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createBaseFor.js27
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createBindWrapper.js22
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createCache.js22
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createCompounder.js26
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createCtorWrapper.js35
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createCurry.js23
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createExtremum.js32
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createFind.js25
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createFindIndex.js21
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createFindKey.js18
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createFlow.js69
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createForEach.js20
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createForIn.js20
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createForOwn.js19
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createHybridWrapper.js111
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createObjectMapper.js26
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createPadDir.js18
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createPadding.js31
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createPartial.js20
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createPartialWrapper.js43
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createReduce.js22
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createSortedIndex.js20
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createWrapper.js86
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/deburrLetter.js33
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/equalArrays.js51
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/equalByTag.js48
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/equalObjects.js67
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/escapeHtmlChar.js22
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/escapeStringChar.js23
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/getData.js15
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/getFuncName.js25
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/getLength.js15
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/getMatchData.js21
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/getNative.js16
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/getView.js33
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/indexOfNaN.js23
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/initCloneArray.js26
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/initCloneByTag.js63
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/initCloneObject.js16
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/invokePath.js26
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/isArrayLike.js15
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/isIndex.js24
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/isIterateeCall.js28
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/isKey.js28
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/isLaziable.js26
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/isLength.js20
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/isObjectLike.js12
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/isSpace.js14
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/isStrictComparable.js15
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/lazyClone.js27
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/lazyReverse.js23
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/lazyValue.js81
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/mapDelete.js14
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/mapGet.js14
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/mapHas.js20
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/mapSet.js18
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/mergeData.js89
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/metaMap.js9
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/pickByArray.js28
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/pickByCallback.js22
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/reEscape.js4
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/reEvaluate.js4
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/reInterpolate.js4
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/realNames.js4
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/reorder.js29
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/replaceHolders.js28
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/setData.js41
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/shimIsPlainObject.js50
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/shimKeys.js41
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/sortedUniq.js29
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/toIterable.js22
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/toObject.js14
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/toPath.js28
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/trimmedLeftIndex.js19
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/trimmedRightIndex.js18
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/unescapeHtmlChar.js22
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/internal/wrapperClone.js18
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/lang.js32
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/lang/clone.js70
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/lang/cloneDeep.js55
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/lang/eq.js1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/lang/gt.js25
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/lang/gte.js25
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isArguments.js36
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isArray.js40
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isBoolean.js35
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isDate.js35
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isElement.js41
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isEmpty.js47
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isEqual.js54
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isError.js36
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isFinite.js38
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isFunction.js42
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isMatch.js49
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isNaN.js34
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isNative.js57
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isNull.js21
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isNumber.js41
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isObject.js28
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isPlainObject.js61
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isRegExp.js35
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isString.js35
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isTypedArray.js74
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isUndefined.js21
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/lang/lt.js25
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/lang/lte.js25
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/lang/toArray.js32
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/lang/toPlainObject.js31
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/math.js6
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/math/add.js19
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/math/max.js56
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/math/min.js56
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/math/sum.js52
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/number.js4
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/number/inRange.js47
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/number/random.js70
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/object.js30
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/object/assign.js43
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/object/create.js47
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/object/defaults.js32
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/object/extend.js1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/object/findKey.js54
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/object/findLastKey.js54
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/object/forIn.js33
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/object/forInRight.js31
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/object/forOwn.js33
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/object/forOwnRight.js31
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/object/functions.js23
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/object/get.js33
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/object/has.js57
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/object/invert.js60
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/object/keys.js45
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/object/keysIn.js64
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/object/mapKeys.js25
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/object/mapValues.js46
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/object/merge.js54
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/object/methods.js1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/object/omit.js47
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/object/pairs.js33
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/object/pick.js42
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/object/result.js49
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/object/set.js55
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/object/transform.js61
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/object/values.js33
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/object/valuesIn.js31
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/package.json94
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/string.js25
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/string/camelCase.js27
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/string/capitalize.js21
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/string/deburr.js29
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/string/endsWith.js40
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/string/escape.js48
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/string/escapeRegExp.js32
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/string/kebabCase.js26
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/string/pad.js49
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/string/padLeft.js27
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/string/padRight.js27
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/string/parseInt.js67
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/string/repeat.js49
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/string/snakeCase.js26
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/string/startCase.js26
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/string/startsWith.js36
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/string/template.js226
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/string/templateSettings.js67
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/string/trim.js42
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/string/trimLeft.js36
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/string/trimRight.js36
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/string/trunc.js105
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/string/unescape.js33
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/string/words.js38
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/support.js34
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/utility.js18
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/utility/attempt.js32
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/utility/callback.js53
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/utility/constant.js23
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/utility/identity.js20
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/utility/iteratee.js1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/utility/matches.js33
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/utility/matchesProperty.js32
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/utility/method.js33
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/utility/methodOf.js32
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/utility/mixin.js89
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/utility/noop.js19
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/utility/property.js31
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/utility/propertyOf.js30
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/utility/range.js68
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/utility/times.js62
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/lodash/utility/uniqueId.js27
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/readline2/README.md32
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/readline2/index.js171
l---------tools/eslint/node_modules/inquirer/node_modules/readline2/node_modules/.bin/strip-ansi1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/readline2/node_modules/mute-stream/LICENSE27
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/readline2/node_modules/mute-stream/README.md68
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/readline2/node_modules/mute-stream/mute.js140
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/readline2/node_modules/mute-stream/package.json55
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/readline2/node_modules/mute-stream/test/basic.js207
-rwxr-xr-xtools/eslint/node_modules/inquirer/node_modules/readline2/node_modules/strip-ansi/cli.js47
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/readline2/node_modules/strip-ansi/index.js6
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/readline2/node_modules/strip-ansi/package.json89
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/readline2/node_modules/strip-ansi/readme.md43
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/readline2/package.json63
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/.coveralls.yml2
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/.jamignore14
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/.jscsrc54
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/.jscsrc.todo19
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/authors.txt3
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/bower.json37
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/component.json62
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.aggregates.js838
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.aggregates.map1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.aggregates.min.js3
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.all.compat.js10945
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.all.compat.map1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.all.compat.min.js7
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.all.js10723
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.all.map1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.all.min.js6
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.async.compat.js586
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.async.compat.map1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.async.compat.min.js3
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.async.js509
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.async.map1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.async.min.js3
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.backpressure.js580
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.backpressure.map1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.backpressure.min.js3
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.binding.js519
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.binding.map1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.binding.min.js3
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.coincidence.js815
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.coincidence.map1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.coincidence.min.js3
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.compat.js5778
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.compat.map1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.compat.min.js5
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.experimental.js597
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.experimental.map1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.experimental.min.js3
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.joinpatterns.js313
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.joinpatterns.map1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.joinpatterns.min.js3
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.js5587
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.compat.js6529
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.compat.map1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.compat.min.js5
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.extras.compat.js630
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.extras.compat.map1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.extras.compat.min.js3
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.extras.js630
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.extras.map1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.extras.min.js3
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.js6263
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.map1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.min.js6
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.map1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.min.js6
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.sorting.js72
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.sorting.map1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.sorting.min.js3
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.testing.js530
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.testing.map1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.testing.min.js3
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.time.js1168
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.time.map1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.time.min.js3
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.virtualtime.js313
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.virtualtime.map1
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.virtualtime.min.js3
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/index.js14
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/license.txt15
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/logos/logo.pngbin0 -> 12929 bytes
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/package.json80
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/readme.md447
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx-lite.d.ts695
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.aggregates.d.ts61
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.all.d.ts20
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.async-lite.d.ts72
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.async-tests.ts84
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.async.d.ts43
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.backpressure-lite.d.ts48
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.backpressure-tests.ts22
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.backpressure.d.ts11
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.binding-lite.d.ts73
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.binding.d.ts11
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.coincidence-lite.d.ts34
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.coincidence.d.ts36
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.d.ts67
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.experimental.d.ts321
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.joinpatterns.d.ts60
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.lite.d.ts15
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.testing.d.ts64
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.time-lite.d.ts47
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.time.d.ts66
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.virtualtime.d.ts41
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/through/.travis.yml5
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/through/LICENSE.APACHE215
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/through/LICENSE.MIT24
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/through/index.js108
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/through/package.json66
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/through/readme.markdown64
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/through/test/async.js28
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/through/test/auto-destroy.js30
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/through/test/buffering.js71
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/through/test/end.js45
-rw-r--r--tools/eslint/node_modules/inquirer/node_modules/through/test/index.js133
-rw-r--r--tools/eslint/node_modules/inquirer/package.json75
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/.npmignore2
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/.travis.yml3
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/LICENSE21
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/README.md173
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/example.js18
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/formats.js14
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/index.js569
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/.npmignore (renamed from tools/eslint/node_modules/optionator/node_modules/wordwrap/.npmignore)0
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/.travis.yml3
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/README.md72
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/example.js27
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/index.js61
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/package.json53
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/test.js33
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/.npmignore1
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/.travis.yml3
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/LICENSE21
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/README.md19
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/index.js12
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/.npmignore17
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/LICENSE (renamed from deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/License)5
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/README.md28
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/is-property.js5
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/package.json59
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/package.json51
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/test.js12
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/.travis.yml6
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/README.md31
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/jsonpointer.js79
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/package.json61
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/test.js100
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/.jshintrc (renamed from deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/.jshintrc)0
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/.npmignore1
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/LICENCE (renamed from deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/License)2
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/Makefile4
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/README.md32
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/immutable.js17
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/mutable.js15
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/package.json88
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/test.js63
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/package.json67
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/require.js12
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/test/fixtures/cosmic.js84
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/additionalItems.json82
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/additionalProperties.json88
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/allOf.json112
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/anyOf.json68
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/bignum.json107
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/default.json49
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/definitions.json32
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/dependencies.json113
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/enum.json72
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/format.json143
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/items.json46
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maxItems.json28
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maxLength.json28
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maxProperties.json28
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maximum.json42
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minItems.json28
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minLength.json28
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minProperties.json28
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minimum.json42
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/multipleOf.json60
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/not.json96
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/nullAndFormat.json18
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/oneOf.json68
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/pattern.json23
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/patternProperties.json110
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/properties.json92
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/ref.json128
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/refRemote.json74
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/required.json39
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/type.json330
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/uniqueItems.json79
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/test/json-schema.js23
-rw-r--r--tools/eslint/node_modules/is-my-json-valid/test/misc.js429
-rw-r--r--tools/eslint/node_modules/js-yaml/CHANGELOG.md7
-rw-r--r--tools/eslint/node_modules/js-yaml/README.md2
-rw-r--r--tools/eslint/node_modules/js-yaml/dist/js-yaml.js81
-rw-r--r--tools/eslint/node_modules/js-yaml/examples/custom_types.js30
-rw-r--r--tools/eslint/node_modules/js-yaml/lib/js-yaml/dumper.js13
-rw-r--r--tools/eslint/node_modules/js-yaml/lib/js-yaml/loader.js2
l---------[-rwxr-xr-x]tools/eslint/node_modules/js-yaml/node_modules/.bin/esparse128
l---------[-rwxr-xr-x]tools/eslint/node_modules/js-yaml/node_modules/.bin/esvalidate200
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/README.md11
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/difference.js4
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/intersection.js41
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/union.js4
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/xor.js2
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/zipWith.js4
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/lodash.js41
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/invoke.js4
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/map.js2
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/reduce.js2
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/sample.js18
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/shuffle.js21
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/date/now.js4
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/debounce.js13
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/memoize.js6
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/throttle.js12
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/index.js1141
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/SetCache.js6
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arrayExtremum.js30
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arrayMax.js25
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arrayMin.js25
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/assignWith.js13
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseAssign.js34
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseAt.js2
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseCompareAscending.js19
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseCreate.js10
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseExtremum.js29
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseGet.js6
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseIsEqual.js13
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseIsEqualDeep.js8
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseIsMatch.js47
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseMatches.js41
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseMatchesProperty.js15
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseMerge.js17
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/basePullAt.js2
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseToString.js2
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/binaryIndex.js4
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/binaryIndexBy.js10
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/bufferClone.js12
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/charAtCallback.js12
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createAssigner.js10
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createCache.js6
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createCtorWrapper.js14
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createExtremum.js32
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createFlow.js17
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createHybridWrapper.js17
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/equalArrays.js45
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/equalObjects.js35
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/getFuncName.js38
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/getMatchData.js21
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/getNative.js16
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/getSymbols.js19
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/isIndex.js7
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/isLaziable.js11
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/isLength.js2
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/metaMap.js4
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/shimKeys.js7
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/toIterable.js2
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/toObject.js2
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/toPath.js2
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang.js5
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/clone.js5
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/cloneDeep.js5
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/eq.js1
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/gt.js25
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/gte.js25
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isArray.js6
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isEqual.js11
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isFinite.js4
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isFunction.js4
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isMatch.js33
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isNative.js7
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isObject.js2
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isPlainObject.js8
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/lt.js25
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/lte.js25
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/math/max.js9
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/math/min.js9
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/get.js2
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/has.js12
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/keys.js8
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/keysIn.js5
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/pairs.js5
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/set.js4
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/transform.js2
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/package.json16
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/escape.js2
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/pad.js2
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/padLeft.js2
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/padRight.js2
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/trunc.js2
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/support.js45
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/matches.js2
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/matchesProperty.js8
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/method.js4
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/methodOf.js6
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/mixin.js3
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/noop.js2
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/property.js2
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/propertyOf.js2
-rw-r--r--tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/times.js2
-rw-r--r--tools/eslint/node_modules/js-yaml/package.json14
-rw-r--r--tools/eslint/node_modules/minimatch/LICENSE32
-rw-r--r--tools/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json23
-rw-r--r--tools/eslint/node_modules/minimatch/package.json25
-rw-r--r--tools/eslint/node_modules/mkdirp/.npmignore2
-rw-r--r--tools/eslint/node_modules/mkdirp/.travis.yml7
-rw-r--r--tools/eslint/node_modules/mkdirp/index.js5
-rw-r--r--tools/eslint/node_modules/mkdirp/package.json33
-rw-r--r--tools/eslint/node_modules/mkdirp/test/chmod.js9
-rw-r--r--tools/eslint/node_modules/mkdirp/test/clobber.js3
-rw-r--r--tools/eslint/node_modules/mkdirp/test/mkdirp.js6
-rw-r--r--tools/eslint/node_modules/mkdirp/test/opts_fs.js6
-rw-r--r--tools/eslint/node_modules/mkdirp/test/opts_fs_sync.js6
-rw-r--r--tools/eslint/node_modules/mkdirp/test/perm.js8
-rw-r--r--tools/eslint/node_modules/mkdirp/test/perm_sync.js8
-rw-r--r--tools/eslint/node_modules/mkdirp/test/race.js17
-rw-r--r--tools/eslint/node_modules/mkdirp/test/rel.js6
-rw-r--r--tools/eslint/node_modules/mkdirp/test/root.js3
-rw-r--r--tools/eslint/node_modules/mkdirp/test/sync.js6
-rw-r--r--tools/eslint/node_modules/mkdirp/test/umask.js4
-rw-r--r--tools/eslint/node_modules/mkdirp/test/umask_sync.js4
-rw-r--r--tools/eslint/node_modules/object-assign/license21
-rw-r--r--tools/eslint/node_modules/object-assign/package.json20
-rw-r--r--tools/eslint/node_modules/optionator/node_modules/prelude-ls/CHANGELOG.md99
-rw-r--r--tools/eslint/node_modules/optionator/node_modules/prelude-ls/lib/Func.js26
-rw-r--r--tools/eslint/node_modules/optionator/node_modules/prelude-ls/lib/List.js21
-rw-r--r--tools/eslint/node_modules/optionator/node_modules/prelude-ls/lib/Num.js4
-rw-r--r--tools/eslint/node_modules/optionator/node_modules/prelude-ls/lib/Obj.js44
-rw-r--r--tools/eslint/node_modules/optionator/node_modules/prelude-ls/lib/Str.js2
-rw-r--r--tools/eslint/node_modules/optionator/node_modules/prelude-ls/lib/index.js4
-rw-r--r--tools/eslint/node_modules/optionator/node_modules/prelude-ls/package.json27
-rw-r--r--tools/eslint/node_modules/optionator/node_modules/wordwrap/LICENSE18
-rw-r--r--tools/eslint/node_modules/optionator/node_modules/wordwrap/package.json32
-rw-r--r--tools/eslint/node_modules/path-is-absolute/index.js20
-rw-r--r--tools/eslint/node_modules/path-is-absolute/license21
-rw-r--r--tools/eslint/node_modules/path-is-absolute/package.json70
-rw-r--r--tools/eslint/node_modules/path-is-absolute/readme.md51
-rw-r--r--tools/eslint/node_modules/text-table/package.json4
-rw-r--r--tools/eslint/package.json36
-rw-r--r--tools/gyp/PRESUBMIT.py1
-rw-r--r--tools/gyp/buildbot/aosp_manifest.xml466
-rwxr-xr-xtools/gyp/buildbot/buildbot_run.py119
-rw-r--r--tools/gyp/buildbot/commit_queue/cq_config.json1
-rw-r--r--tools/gyp/pylib/gyp/MSVSVersion.py5
-rwxr-xr-xtools/gyp/pylib/gyp/__init__.py16
-rw-r--r--tools/gyp/pylib/gyp/generator/analyzer.py49
-rw-r--r--tools/gyp/pylib/gyp/generator/android.py1094
-rw-r--r--tools/gyp/pylib/gyp/generator/cmake.py384
-rw-r--r--tools/gyp/pylib/gyp/generator/dump_dependency_json.py20
-rw-r--r--tools/gyp/pylib/gyp/generator/make.py67
-rw-r--r--tools/gyp/pylib/gyp/generator/msvs.py10
-rw-r--r--tools/gyp/pylib/gyp/generator/ninja.py2
-rw-r--r--tools/gyp/pylib/gyp/input.py35
-rwxr-xr-xtools/gyp/pylib/gyp/mac_tool.py3
-rw-r--r--tools/gyp/pylib/gyp/xcode_emulation.py12
-rwxr-xr-xtools/install.py2
-rw-r--r--tools/rpm/iojs.spec4
-rw-r--r--vcbuild.bat13
1759 files changed, 165676 insertions, 12268 deletions
diff --git a/.eslintrc b/.eslintrc
index 9ff3f48aece..c90fa5e57ad 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -43,8 +43,7 @@ rules:
## 2 space indentation
indent: [2, 2]
## add space after comma
- ## set to 'warn' because of https://github.com/eslint/eslint/issues/2408
- comma-spacing: 1
+ comma-spacing: 2
## put semi-colon
semi: 2
## require spaces operator like var sum = 1 + 1;
diff --git a/.mailmap b/.mailmap
index de9a9bc61ec..38e5c1928a7 100644
--- a/.mailmap
+++ b/.mailmap
@@ -52,6 +52,7 @@ Igor Zinkovsky <igorzi@microsoft.com>
Isaac Z. Schlueter <i@izs.me>
Isaac Z. Schlueter <i@izs.me> <i@foohack.com>
Jake Verbaten <raynos2@gmail.com>
+James Hartig <fastest963@gmail.com> <james.hartig@grooveshark.com>
Jered Schmidt <tr@nslator.jp>
Jeremiah Senkpiel <fishrock123@rocketmail.com>
Joe Shaw <joe@joeshaw.org> <joeshaw@litl.com>
diff --git a/AUTHORS b/AUTHORS
index 29956111569..2b2fe64309b 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -260,7 +260,7 @@ Adam Malcontenti-Wilson <adman.com@gmail.com>
Avi Flax <avi@aviflax.com>
Pedro Teixeira <pedro.teixeira@gmail.com>
Johan Bergström <bugs@bergstroem.nu>
-James Hartig <james.hartig@grooveshark.com>
+James Hartig <fastest963@gmail.com>
Shannen Saez <shannenlaptop@gmail.com>
Seong-Rak Choi <ragiragi@hanmail.net>
Dave Irvine <davman99@gmail.com>
@@ -764,5 +764,14 @@ Frederic Hemberger <mail@frederic-hemberger.de>
Sharat M R <cosmosgenius@gmail.com>
Rich Trott <rtrott@gmail.com>
Felipe Batista <fsbatista1@gmail.com>
+Rebecca Turner <me@re-becca.org>
+Tyler Anton <mtyleranton@gmail.com>
+João Reis <reis@janeasystems.com>
+Kat Marchán <kzm@sykosomatic.org>
+Ryan Petschek <petschekr@gmail.com>
+Pierre Inglebert <pierre.inglebert@gmail.com>
+Ivan Yan <yan.2314@gmail.com>
+Sangmin Yoon <sangmin.yoon@croquis.com>
+Mark Plomer <mark.plomer@boerse-go.de>
# Generated by tools/update-authors.sh
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2c316b92319..c1144d227e3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,123 @@
# io.js ChangeLog
+## 2015-07-09, Version 2.3.4, @Fishrock123
+
+### Notable changes
+
+* **openssl**: Upgrade to 1.0.2d, fixes CVE-2015-1793 (Alternate Chains Certificate Forgery) (Shigeki Ohtsu) [#2141](https://github.com/nodejs/io.js/pull/2141).
+* **npm**: Upgraded to v2.12.1, release notes can be found in <https://github.com/npm/npm/releases/tag/v2.12.0> and <https://github.com/npm/npm/releases/tag/v2.12.1> (Kat Marchán) [#2112](https://github.com/nodejs/io.js/pull/2112).
+
+### Known issues
+
+See https://github.com/nodejs/io.js/labels/confirmed-bug for complete and current list of known issues.
+
+* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/io.js/issues/1264).
+* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/io.js/issues/690)
+* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/nodejs/io.js/issues/760).
+* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/io.js/issues/894)
+* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/io.js/issues/1435).
+
+### Commits
+
+* [[`0d15161c24`](https://github.com/nodejs/io.js/commit/0d15161c24)] - **benchmark**: Add some path benchmarks for #1778 (Nathan Woltman) [#1778](https://github.com/nodejs/io.js/pull/1778)
+* [[`c70e68fa32`](https://github.com/nodejs/io.js/commit/c70e68fa32)] - **deps**: update deps/openssl/conf/arch/*/opensslconf.h (Shigeki Ohtsu) [#2141](https://github.com/nodejs/io.js/pull/2141)
+* [[`ca93f7f2e6`](https://github.com/nodejs/io.js/commit/ca93f7f2e6)] - **deps**: upgrade openssl sources to 1.0.2d (Shigeki Ohtsu) [#2141](https://github.com/nodejs/io.js/pull/2141)
+* [[`b18c841ec1`](https://github.com/nodejs/io.js/commit/b18c841ec1)] - **deps**: make node-gyp work with io.js (cjihrig) [iojs/io.js#990](https://github.com/iojs/io.js/pull/990)
+* [[`863cdbdd08`](https://github.com/nodejs/io.js/commit/863cdbdd08)] - **deps**: upgrade to npm 2.12.1 (Kat Marchán) [#2112](https://github.com/nodejs/io.js/pull/2112)
+* [[`84b3915764`](https://github.com/nodejs/io.js/commit/84b3915764)] - **doc**: document current release procedure (Rod Vagg) [#2099](https://github.com/nodejs/io.js/pull/2099)
+* [[`46140334cd`](https://github.com/nodejs/io.js/commit/46140334cd)] - **doc**: update AUTHORS list (Rod Vagg) [#2100](https://github.com/nodejs/io.js/pull/2100)
+* [[`bca53dce76`](https://github.com/nodejs/io.js/commit/bca53dce76)] - **path**: refactor for performance and consistency (Nathan Woltman) [#1778](https://github.com/nodejs/io.js/pull/1778)
+* [[`6bef15afe7`](https://github.com/nodejs/io.js/commit/6bef15afe7)] - **src**: remove traceSyncIO property from process (Bradley Meck) [#2143](https://github.com/nodejs/io.js/pull/2143)
+* [[`2ba1740ba1`](https://github.com/nodejs/io.js/commit/2ba1740ba1)] - **test**: add missing crypto checks (Johan Bergström) [#2129](https://github.com/nodejs/io.js/pull/2129)
+* [[`180fd392ca`](https://github.com/nodejs/io.js/commit/180fd392ca)] - **test**: refactor test-repl-tab-complete (Sakthipriyan Vairamani) [#2122](https://github.com/nodejs/io.js/pull/2122)
+* [[`fb05c8e27d`](https://github.com/nodejs/io.js/commit/fb05c8e27d)] - ***Revert*** "**test**: add test for missing `close`/`finish` event" (Fedor Indutny)
+* [[`9436a860cb`](https://github.com/nodejs/io.js/commit/9436a860cb)] - **test**: add test for missing `close`/`finish` event (Mark Plomer) [iojs/io.js#1373](https://github.com/iojs/io.js/pull/1373)
+* [[`ee3ce2ed88`](https://github.com/nodejs/io.js/commit/ee3ce2ed88)] - **tools**: install gdbinit from v8 to $PREFIX/share (Ali Ijaz Sheikh) [#2123](https://github.com/nodejs/io.js/pull/2123)
+* [[`dd523c75da`](https://github.com/nodejs/io.js/commit/dd523c75da)] - **win,node-gyp**: enable delay-load hook by default (Bert Belder) [iojs/io.js#1433](https://github.com/iojs/io.js/pull/1433)
+
+## 2015-07-04, Version 2.3.3, @Fishrock123
+
+### Notable changes
+
+* **deps**: Fixed an out-of-band write in utf8 decoder. **This is an important security update** as it can be used to cause a denial of service attack.
+
+### Known issues
+
+See https://github.com/nodejs/io.js/labels/confirmed-bug for complete and current list of known issues.
+
+* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/io.js/issues/1264).
+* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/io.js/issues/690)
+* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/nodejs/io.js/issues/760).
+* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/io.js/issues/894)
+* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/io.js/issues/1435).
+
+## Commits
+
+* [[`030f8045c7`](https://github.com/nodejs/io.js/commit/030f8045c7)] - **deps**: fix out-of-band write in utf8 decoder (Fedor Indutny)
+* [[`0f09b8db28`](https://github.com/nodejs/io.js/commit/0f09b8db28)] - **doc**: don't recommend domains for error handling (Benjamin Gruenbaum) [#2056](https://github.com/nodejs/io.js/pull/2056)
+* [[`9cd44bb2b6`](https://github.com/nodejs/io.js/commit/9cd44bb2b6)] - **util**: prepend '(node) ' to deprecation messages (Sakthipriyan Vairamani) [#1892](https://github.com/nodejs/io.js/pull/1892)
+
+## 2015-07-01, Version 2.3.2, @rvagg
+
+### Notable changes
+
+* **build**:
+ - Added support for compiling with Microsoft Visual C++ 2015
+ - Started building and distributing headers-only tarballs along with binaries
+
+### Known issues
+
+See https://github.com/nodejs/io.js/labels/confirmed-bug for complete and current list of known issues.
+
+* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/io.js/issues/1264).
+* Surrogate pair in REPL can freeze terminal [#690](https://github.com/nodejs/io.js/issues/690)
+* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/nodejs/io.js/issues/760) and fix in [#774](https://github.com/nodejs/io.js/issues/774)
+* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion [#894](https://github.com/nodejs/io.js/issues/894)
+* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/io.js/issues/1435).
+
+## Commits
+
+* [[`9180140231`](https://github.com/nodejs/io.js/commit/9180140231)] - **_stream_wrap**: prevent use after free in TLS (Fedor Indutny) [#1910](https://github.com/nodejs/io.js/pull/1910)
+* [[`05a73c0f25`](https://github.com/nodejs/io.js/commit/05a73c0f25)] - **benchmark**: make concurrent requests configurable (Rich Trott) [#2068](https://github.com/nodejs/io.js/pull/2068)
+* [[`f52d73352e`](https://github.com/nodejs/io.js/commit/f52d73352e)] - **benchmark**: fix typo in README (Rich Trott) [#2067](https://github.com/nodejs/io.js/pull/2067)
+* [[`1cd9eeb556`](https://github.com/nodejs/io.js/commit/1cd9eeb556)] - **buffer**: prevent abort on bad proto (Trevor Norris) [#2012](https://github.com/nodejs/io.js/pull/2012)
+* [[`8350f3a3a2`](https://github.com/nodejs/io.js/commit/8350f3a3a2)] - **buffer**: optimize Buffer#toString() (Ben Noordhuis) [#2027](https://github.com/nodejs/io.js/pull/2027)
+* [[`628a3ab093`](https://github.com/nodejs/io.js/commit/628a3ab093)] - **build**: add tar-headers target for headers-only tar (Rod Vagg) [#1975](https://github.com/nodejs/io.js/pull/1975)
+* [[`dcbb9e1da6`](https://github.com/nodejs/io.js/commit/dcbb9e1da6)] - **build**: update build targets for io.js (Rod Vagg) [#1938](https://github.com/nodejs/io.js/pull/1938)
+* [[`c87c34c242`](https://github.com/nodejs/io.js/commit/c87c34c242)] - **build**: fix cherry-pick ooops, fix comment wording (Rod Vagg) [#2036](https://github.com/nodejs/io.js/pull/2036)
+* [[`4208dc4fef`](https://github.com/nodejs/io.js/commit/4208dc4fef)] - **build**: add MSVS 2015 support (Rod Vagg) [#2036](https://github.com/nodejs/io.js/pull/2036)
+* [[`834a365113`](https://github.com/nodejs/io.js/commit/834a365113)] - **build**: DTrace is enabled by default on darwin (Evan Lucas) [#2019](https://github.com/nodejs/io.js/pull/2019)
+* [[`c0c0d73269`](https://github.com/nodejs/io.js/commit/c0c0d73269)] - **build,win**: set env before generating projects (Alexis Campailla) [joyent/node#20109](https://github.com/joyent/node/pull/20109)
+* [[`9e890fe8b4`](https://github.com/nodejs/io.js/commit/9e890fe8b4)] - **crypto**: fix VerifyCallback in case of verify error (Shigeki Ohtsu) [#2064](https://github.com/nodejs/io.js/pull/2064)
+* [[`1f371e3988`](https://github.com/nodejs/io.js/commit/1f371e3988)] - **deps**: copy all openssl header files to include dir (Shigeki Ohtsu) [#2016](https://github.com/nodejs/io.js/pull/2016)
+* [[`c370bd3aea`](https://github.com/nodejs/io.js/commit/c370bd3aea)] - **doc**: make the abbreviation 1MM clear (Ivan Yan) [#2053](https://github.com/nodejs/io.js/pull/2053)
+* [[`54d5437566`](https://github.com/nodejs/io.js/commit/54d5437566)] - **doc**: Added sample command to test iojs build (Jimmy Hsu) [#850](https://github.com/nodejs/io.js/pull/850)
+* [[`f1f1b7e597`](https://github.com/nodejs/io.js/commit/f1f1b7e597)] - **doc**: add TSC meeting minutes 2015-06-17 (Rod Vagg) [#2048](https://github.com/nodejs/io.js/pull/2048)
+* [[`dbd5dc932d`](https://github.com/nodejs/io.js/commit/dbd5dc932d)] - **doc**: clarify prerequisites in benchmark/README.md (Jeremiah Senkpiel) [#2034](https://github.com/nodejs/io.js/pull/2034)
+* [[`50dbc8e143`](https://github.com/nodejs/io.js/commit/50dbc8e143)] - **doc**: add TSC meeting minutes 2015-05-27 (Rod Vagg) [#2037](https://github.com/nodejs/io.js/pull/2037)
+* [[`941ad362a7`](https://github.com/nodejs/io.js/commit/941ad362a7)] - **doc**: archive io.js TC minutes (Rod Vagg)
+* [[`644b2eaa89`](https://github.com/nodejs/io.js/commit/644b2eaa89)] - **doc**: rename tc-meetings to tsc-meetings (Rod Vagg)
+* [[`1330ee3b27`](https://github.com/nodejs/io.js/commit/1330ee3b27)] - **doc**: add TC meeting 2015-05-13 minutes (Rod Vagg) [#1700](https://github.com/nodejs/io.js/pull/1700)
+* [[`392e8fd64e`](https://github.com/nodejs/io.js/commit/392e8fd64e)] - **doc**: add @shigeki and @mscdex to TC (Rod Vagg) [#2008](https://github.com/nodejs/io.js/pull/2008)
+* [[`af249fa8a1`](https://github.com/nodejs/io.js/commit/af249fa8a1)] - **net**: wrap connect in nextTick (Evan Lucas) [#2054](https://github.com/nodejs/io.js/pull/2054)
+* [[`7f63449fde`](https://github.com/nodejs/io.js/commit/7f63449fde)] - **net**: fix debug for dnsopts (Evan Lucas) [#2059](https://github.com/nodejs/io.js/pull/2059)
+* [[`eabed2f518`](https://github.com/nodejs/io.js/commit/eabed2f518)] - **repl**: remove obsolete TODO (Rich Trott) [#2081](https://github.com/nodejs/io.js/pull/2081)
+* [[`a198c68b56`](https://github.com/nodejs/io.js/commit/a198c68b56)] - **repl**: make 'Unexpected token' errors recoverable (Julien Gilli) [#2052](https://github.com/nodejs/io.js/pull/2052)
+* [[`d735b2c6ef`](https://github.com/nodejs/io.js/commit/d735b2c6ef)] - **repl**: fix tab completion for a non-global context (Sangmin Yoon) [#2052](https://github.com/nodejs/io.js/pull/2052)
+* [[`8cee8f54fc`](https://github.com/nodejs/io.js/commit/8cee8f54fc)] - **src**: nix stdin _readableState.reading manipulation (Chris Dickinson) [#454](https://github.com/nodejs/io.js/pull/454)
+* [[`856c11f8c8`](https://github.com/nodejs/io.js/commit/856c11f8c8)] - **test**: purge stale disabled tests (Rich Trott) [#2045](https://github.com/nodejs/io.js/pull/2045)
+* [[`4d5089e181`](https://github.com/nodejs/io.js/commit/4d5089e181)] - **test**: do not swallow OpenSSL support error (Rich Trott) [#2042](https://github.com/nodejs/io.js/pull/2042)
+* [[`06721fe005`](https://github.com/nodejs/io.js/commit/06721fe005)] - **test**: fix test-repl-tab-complete.js (cjihrig) [#2052](https://github.com/nodejs/io.js/pull/2052)
+* [[`8e9089ac35`](https://github.com/nodejs/io.js/commit/8e9089ac35)] - **test**: check for error on Windows (Rich Trott) [#2035](https://github.com/nodejs/io.js/pull/2035)
+* [[`776a65ebcd`](https://github.com/nodejs/io.js/commit/776a65ebcd)] - **test**: remove obsolete TODO comments (Rich Trott) [#2033](https://github.com/nodejs/io.js/pull/2033)
+* [[`bdfeb798ad`](https://github.com/nodejs/io.js/commit/bdfeb798ad)] - **test**: remove obsolete TODO comments (Rich Trott) [#2032](https://github.com/nodejs/io.js/pull/2032)
+* [[`58e914f9bc`](https://github.com/nodejs/io.js/commit/58e914f9bc)] - **tools**: fix gyp to work on MacOSX without XCode (Shigeki Ohtsu) [iojs/io.js#1325](https://github.com/iojs/io.js/pull/1325)
+* [[`99cbbc0a13`](https://github.com/nodejs/io.js/commit/99cbbc0a13)] - **tools**: update gyp to 25ed9ac (Ben Noordhuis) [#2074](https://github.com/nodejs/io.js/pull/2074)
+* [[`e3f9335c40`](https://github.com/nodejs/io.js/commit/e3f9335c40)] - **tools**: re-enable comma-spacing linter rule (Roman Reiss) [#2072](https://github.com/nodejs/io.js/pull/2072)
+* [[`d91e10b3bd`](https://github.com/nodejs/io.js/commit/d91e10b3bd)] - **tools**: update eslint to 0.24.0 (Roman Reiss) [#2072](https://github.com/nodejs/io.js/pull/2072)
+* [[`6c61ca5325`](https://github.com/nodejs/io.js/commit/6c61ca5325)] - **url**: fix typo in comment (Rich Trott) [#2071](https://github.com/nodejs/io.js/pull/2071)
+* [[`1a51f0058c`](https://github.com/nodejs/io.js/commit/1a51f0058c)] - **v8**: cherry-pick JitCodeEvent patch from upstream (Ben Noordhuis) [#2075](https://github.com/nodejs/io.js/pull/2075)
+
## 2015-06-23, Version 2.3.1, @rvagg
### Notable changes
@@ -209,8 +327,8 @@ See https://github.com/nodejs/io.js/labels/confirmed-bug for complete and curren
### Commits
* [[`c5a1009903`](https://github.com/nodejs/io.js/commit/c5a1009903)] - **build**: avoid passing empty strings to build flags (Johan Bergström) [#1789](https://github.com/nodejs/io.js/pull/1789)
-* [[`5d83401086`](https://github.com/nodejs/io.js/commit/5d83401086)] - **doc**: put SEMVER-MINOR on pre-load module fix 2.2.0 (Rod Vagg)
-* [[`4d6b768e5d`](https://github.com/nodejs/io.js/commit/4d6b768e5d)] - **http**: revert deprecation of client property (Michaël Zasso) [#1852](https://github.com/nodejs/io.js/pull/1852)
+* [[`5d83401086`](https://github.com/nodejs/io.js/commit/5d83401086)] - **doc**: put SEMVER-MINOR on pre-load module fix 2.2.0 (Rod Vagg)
+* [[`4d6b768e5d`](https://github.com/nodejs/io.js/commit/4d6b768e5d)] - **http**: revert deprecation of client property (Michaël Zasso) [#1852](https://github.com/nodejs/io.js/pull/1852)
## 2015-05-31, Version 2.2.0, @rvagg
diff --git a/Makefile b/Makefile
index a59f55c0dc1..fcc0b83720e 100644
--- a/Makefile
+++ b/Makefile
@@ -185,6 +185,11 @@ docopen: out/doc/api/all.html
docclean:
-rm -rf out/doc
+run-ci:
+ $(PYTHON) ./configure $(CONFIG_FLAGS)
+ $(MAKE)
+ $(MAKE) test-ci
+
RAWVER=$(shell $(PYTHON) tools/getnodeversion.py)
VERSION=v$(RAWVER)
@@ -464,4 +469,4 @@ lint: jslint cpplint
dynamiclib test test-all test-addons build-addons website-upload pkg \
blog blogclean tar binary release-only bench-http-simple bench-idle \
bench-all bench bench-misc bench-array bench-buffer bench-net \
- bench-http bench-fs bench-tls cctest
+ bench-http bench-fs bench-tls cctest run-ci
diff --git a/README.md b/README.md
index 0d1c2e80960..f46d286ce5f 100644
--- a/README.md
+++ b/README.md
@@ -119,6 +119,12 @@ To read the documentation:
$ man doc/iojs.1
```
+To test if io.js was built correctly:
+
+```
+$ iojs -e "console.log('Hello from io.js ' + process.version)"
+```
+
### Windows
Prerequisites:
@@ -140,6 +146,12 @@ To run the tests:
> vcbuild test
```
+To test if io.js was built correctly:
+
+```
+$ iojs -e "console.log('Hello from io.js ' + process.version)"
+```
+
### Android / Android based devices, aka. Firefox OS
Be sure you have downloaded and extracted [Android NDK]
@@ -319,10 +331,10 @@ information about the governance of the io.js project, see
* **Nikolai Vavilov** &lt;vvnicholas@gmail.com&gt; ([@seishun](https://github.com/seishun))
* **Nicu Micleușanu** &lt;micnic90@gmail.com&gt; ([@micnic](https://github.com/micnic))
* **Aleksey Smolenchuk** &lt;lxe@lxe.co&gt; ([@lxe](https://github.com/lxe))
-* **Shigeki Ohtsu** &lt;ohtsu@iij.ad.jp&gt; ([@shigeki](https://github.com/shigeki))
+* **Shigeki Ohtsu** &lt;ohtsu@iij.ad.jp&gt; ([@shigeki](https://github.com/shigeki)) (Technical Committee)
* **Sam Roberts** &lt;vieuxtech@gmail.com&gt; ([@sam-github](https://github.com/sam-github))
* **Wyatt Preul** &lt;wpreul@gmail.com&gt; ([@geek](https://github.com/geek))
-* **Brian White** &lt;mscdex@mscdex.net&gt; ([@mscdex](https://github.com/mscdex))
+* **Brian White** &lt;mscdex@mscdex.net&gt; ([@mscdex](https://github.com/mscdex)) (Technical Committee)
* **Christian Tellnes** &lt;christian@tellnes.no&gt; ([@tellnes](https://github.com/tellnes))
* **Robert Kowalski** &lt;rok@kowalski.gd&gt; ([@robertkowalski](https://github.com/robertkowalski))
* **Julian Duque** &lt;julianduquej@gmail.com&gt; ([@julianduque](https://github.com/julianduque))
diff --git a/benchmark/README.md b/benchmark/README.md
index 7ed96403bc0..456cdf1769f 100644
--- a/benchmark/README.md
+++ b/benchmark/README.md
@@ -5,8 +5,12 @@ io.js APIs.
## Prerequisites
-Most of the http benchmarks require [`wrk`][wrk] and [`ab`][ab] being installed.
-These are most often available through your preferred package manager.
+Most of the http benchmarks require [`wrk`][wrk] and [`ab`][ab] (ApacheBench) being installed.
+These may be available through your preferred package manager.
+
+If they are not available:
+- `wrk` may easily be built [from source][wrk] via `make`.
+- `ab` is sometimes bundled in a package called `apache2-utils`.
[wrk]: https://github.com/wg/wrk
[ab]: http://httpd.apache.org/docs/2.2/programs/ab.html
diff --git a/benchmark/buffers/buffer-tostring.js b/benchmark/buffers/buffer-tostring.js
new file mode 100644
index 00000000000..948052042d6
--- /dev/null
+++ b/benchmark/buffers/buffer-tostring.js
@@ -0,0 +1,26 @@
+'use strict';
+
+const common = require('../common.js');
+
+const bench = common.createBenchmark(main, {
+ arg: [true, false],
+ len: [0, 1, 64, 1024],
+ n: [1e7]
+});
+
+function main(conf) {
+ const arg = conf.arg;
+ const len = conf.len | 0;
+ const n = conf.n | 0;
+ const buf = Buffer(len).fill(42);
+
+ bench.start();
+ if (arg) {
+ for (var i = 0; i < n; i += 1)
+ buf.toString('utf8');
+ } else {
+ for (var i = 0; i < n; i += 1)
+ buf.toString();
+ }
+ bench.end(n);
+}
diff --git a/benchmark/http_bench.js b/benchmark/http_bench.js
index 0541667760a..a8f99e2f0e7 100644
--- a/benchmark/http_bench.js
+++ b/benchmark/http_bench.js
@@ -8,7 +8,8 @@ var options = {
port: 22344,
path: '/',
servers: 1,
- clients: 1
+ clients: 1,
+ clientConcurrentRequests: 2
};
for (var i = 2; i < process.argv.length; ++i) {
@@ -44,13 +45,25 @@ function patch(fun) {
function startMaster() {
if (!cluster.isMaster) return startServer();
- for (var i = ~~options.servers; i > 0; --i) cluster.fork();
+ var forkCount = 0;
+
+ cluster.on('online', function () {
+ forkCount = forkCount + 1;
+ if (forkCount === ~~options.servers) {
+ var args = [
+ __filename,
+ 'mode=client',
+ 'clientConcurrentRequests=' + options.clientConcurrentRequests
+ ];
+ for (var i = ~~options.clients; i > 0; --i) {
+ var cp = spawn(process.execPath, args);
+ cp.stdout.pipe(process.stdout);
+ cp.stderr.pipe(process.stderr);
+ }
+ }
+ });
- for (var i = ~~options.clients; i > 0; --i) {
- var cp = spawn(process.execPath, [__filename, 'mode=client']);
- cp.stdout.pipe(process.stdout);
- cp.stderr.pipe(process.stderr);
- }
+ for (var i = ~~options.servers; i > 0; --i) cluster.fork();
}
function startServer() {
@@ -73,9 +86,9 @@ function startServer() {
function startClient() {
// send off a bunch of concurrent requests
- // TODO make configurable
- sendRequest();
- sendRequest();
+ for (var i = ~~options.clientConcurrentRequests; i > 0; --i) {
+ sendRequest();
+ }
function sendRequest() {
var req = http.request(options, onConnection);
diff --git a/benchmark/path/format.js b/benchmark/path/format.js
new file mode 100644
index 00000000000..02fb691fe7f
--- /dev/null
+++ b/benchmark/path/format.js
@@ -0,0 +1,31 @@
+var common = require('../common.js');
+var path = require('path');
+
+var bench = common.createBenchmark(main, {
+ type: ['win32', 'posix'],
+ n: [1e7],
+});
+
+function main(conf) {
+ var n = +conf.n;
+ var p = path[conf.type];
+ var test = conf.type === 'win32' ? {
+ root: 'C:\\',
+ dir: 'C:\\path\\dir',
+ base: 'index.html',
+ ext: '.html',
+ name: 'index'
+ } : {
+ root : '/',
+ dir : '/home/user/dir',
+ base : 'index.html',
+ ext : '.html',
+ name : 'index'
+ };
+
+ bench.start();
+ for (var i = 0; i < n; i++) {
+ p.format(test);
+ }
+ bench.end(n);
+}
diff --git a/benchmark/path/isAbsolute.js b/benchmark/path/isAbsolute.js
new file mode 100644
index 00000000000..c9489fe85cb
--- /dev/null
+++ b/benchmark/path/isAbsolute.js
@@ -0,0 +1,27 @@
+var common = require('../common.js');
+var path = require('path');
+
+var bench = common.createBenchmark(main, {
+ type: ['win32', 'posix'],
+ n: [1e6],
+});
+
+function main(conf) {
+ var n = +conf.n;
+ var p = path[conf.type];
+ var tests = conf.type === 'win32'
+ ? ['//server', 'C:\\baz\\..', 'bar\\baz', '.']
+ : ['/foo/bar', '/baz/..', 'bar/baz', '.'];
+
+ bench.start();
+ for (var i = 0; i < n; i++) {
+ runTests(p, tests);
+ }
+ bench.end(n);
+}
+
+function runTests(p, tests) {
+ for (var i = 0; i < tests.length; i++) {
+ p.isAbsolute(tests[i]);
+ }
+}
diff --git a/benchmark/path/join.js b/benchmark/path/join.js
new file mode 100644
index 00000000000..54d02a6450e
--- /dev/null
+++ b/benchmark/path/join.js
@@ -0,0 +1,18 @@
+var common = require('../common.js');
+var path = require('path');
+
+var bench = common.createBenchmark(main, {
+ type: ['win32', 'posix'],
+ n: [1e6],
+});
+
+function main(conf) {
+ var n = +conf.n;
+ var p = path[conf.type];
+
+ bench.start();
+ for (var i = 0; i < n; i++) {
+ p.join('/foo', 'bar', '', 'baz/asdf', 'quux', '..');
+ }
+ bench.end(n);
+}
diff --git a/benchmark/path/normalize.js b/benchmark/path/normalize.js
new file mode 100644
index 00000000000..10ca23037a7
--- /dev/null
+++ b/benchmark/path/normalize.js
@@ -0,0 +1,18 @@
+var common = require('../common.js');
+var path = require('path');
+
+var bench = common.createBenchmark(main, {
+ type: ['win32', 'posix'],
+ n: [1e6],
+});
+
+function main(conf) {
+ var n = +conf.n;
+ var p = path[conf.type];
+
+ bench.start();
+ for (var i = 0; i < n; i++) {
+ p.normalize('/foo/bar//baz/asdf/quux/..');
+ }
+ bench.end(n);
+}
diff --git a/benchmark/path/relative.js b/benchmark/path/relative.js
new file mode 100644
index 00000000000..3e12f8b532d
--- /dev/null
+++ b/benchmark/path/relative.js
@@ -0,0 +1,26 @@
+var common = require('../common.js');
+var path = require('path');
+
+var bench = common.createBenchmark(main, {
+ type: ['win32', 'posix'],
+ n: [1e5],
+});
+
+function main(conf) {
+ var n = +conf.n;
+ var runTest = conf.type === 'win32' ? runWin32Test : runPosixTest;
+
+ bench.start();
+ for (var i = 0; i < n; i++) {
+ runTest();
+ }
+ bench.end(n);
+}
+
+function runWin32Test() {
+ path.win32.relative('C:\\orandea\\test\\aaa', 'C:\\orandea\\impl\\bbb');
+}
+
+function runPosixTest() {
+ path.posix.relative('/data/orandea/test/aaa', '/data/orandea/impl/bbb');
+}
diff --git a/benchmark/path/resolve.js b/benchmark/path/resolve.js
new file mode 100644
index 00000000000..ecf30f32fab
--- /dev/null
+++ b/benchmark/path/resolve.js
@@ -0,0 +1,18 @@
+var common = require('../common.js');
+var path = require('path');
+
+var bench = common.createBenchmark(main, {
+ type: ['win32', 'posix'],
+ n: [1e6],
+});
+
+function main(conf) {
+ var n = +conf.n;
+ var p = path[conf.type];
+
+ bench.start();
+ for (var i = 0; i < n; i++) {
+ p.resolve('foo/bar', '/tmp/file/', '..', 'a/../subfile');
+ }
+ bench.end(n);
+}
diff --git a/configure b/configure
index dc56a10c6f5..d198d79fd2d 100755
--- a/configure
+++ b/configure
@@ -230,7 +230,7 @@ parser.add_option('--with-mips-float-abi',
parser.add_option('--with-dtrace',
action='store_true',
dest='with_dtrace',
- help='build with DTrace (default is true on sunos)')
+ help='build with DTrace (default is true on sunos and darwin)')
parser.add_option('--with-lttng',
action='store_true',
diff --git a/deps/npm/AUTHORS b/deps/npm/AUTHORS
index 92dee7cfc1e..1608ec0fa74 100644
--- a/deps/npm/AUTHORS
+++ b/deps/npm/AUTHORS
@@ -288,3 +288,6 @@ Cedric Nelson <cedric.nelson@gmail.com>
Kat Marchán <kzm@sykosomatic.org>
Andrew <talktome@aboutandrew.co.uk>
Eduardo Pinho <enet4mikeenet@gmail.com>
+Rachel Hutchison <rhutchix@intel.com>
+Ryan Temple <ryantemple145@gmail.com>
+Eugene Sharygin <eush77@gmail.com>
diff --git a/deps/npm/CHANGELOG.md b/deps/npm/CHANGELOG.md
index a2b62ecf174..385805c4470 100644
--- a/deps/npm/CHANGELOG.md
+++ b/deps/npm/CHANGELOG.md
@@ -1,3 +1,177 @@
+### v2.12.1 (2015-06-25):
+
+#### HEY WHERE DID EVERYBODY GO
+
+I keep [hearing some commotion](https://github.com/npm/npm/releases/tag/v3.0.0).
+Is there something going on? Like, a party or something? Anyway, here's a small
+release with at least two significant bug fixes, at least one of which some of
+you have been waiting for for quite a while.
+
+#### REMEMBER WHEN I SAID "REMEMBER WHEN I SAID THAT THING ABOUT PERMISSIONS?"?
+
+`npm@2.12.0` has a change that introduces a fix for a permissions problem
+whereby the `_locks` directory in the cache directory can up being owned by
+root. The fix in 2.12.0 takes care of that problem, but introduces a new
+problem for Windows users where npm tries to call `process.getuid()`, which
+doesn't exist on Windows. It was easy enough to fix (but more or less
+impossible to test, thanks to all the external dependencies involved with
+permissions and platforms and whatnot), but as a result, Windows users might
+want to skip `npm@2.12.0` and go straight to `npm@2.12.1`. Sorry about that!
+
+* [`7e5da23`](https://github.com/npm/npm/commit/7e5da238ee869201fdb9027c27b79b0f76b440a8)
+ When using the new, "fixed" cache directory creator, be extra-careful to not
+ call `process.getuid()` on platforms that lack it.
+ ([@othiym23](https://github.com/othiym23))
+
+#### WHEW! ALL DONE FIXING GIT FOREVER!
+
+New npm CLI team hero [@zkat](https://github.com/zkat) has finally (FINALLY)
+fixed the regression somebody (hi!) introduced a couple months ago whereby git
+URLs of the format `git+ssh://user@githost.com:org/repo.git` suddenly stopped
+working, and also started being saved (and cached) incorrectly. I am 100% sure
+there are absolutely no more bugs in the git caching code at all ever. Mm hm.
+Yep. Pretty sure. Maybe. Hmm... I hope.
+
+*Sighs audibly.*
+
+[Let us know](http://github.com/npm/npm/issues/new) if we broke something else
+with this fix.
+
+* [`94ca4a7`](https://github.com/npm/npm/commit/94ca4a711619ba8e40ce3d20bc42b13cdb7611b7)
+ [#8031](https://github.com/npm/npm/issues/8031) Even though
+ `git+ssh://user@githost.com:org/repo.git` isn't a URL, treat it like one for
+ the purposes of npm. ([@zkat](https://github.com/zkat))
+* [`e7f56e5`](https://github.com/npm/npm/commit/e7f56e5a97fcf1c52d5c5bee71303b0126129815)
+ [#8031](https://github.com/npm/npm/issues/8031) `normalize-git-url@2.0.0`:
+ Handle git URLs (and URL-like remote refs) in a manner consistent with npm's
+ docs. ([@zkat](https://github.com/zkat))
+
+#### YEP, THERE ARE STILL DEPENDENCY UPGRADES
+
+* [`679bf47`](https://github.com/npm/npm/commit/679bf4745ac2cfbb01c9ce273e189807fd04fa33)
+ [#40](http://github.com/npm/read-installed/issues/40) `read-installed@4.0.1`:
+ Handle prerelease versions in top-level dependencies not in `package.json`
+ without marking those packages as invalid.
+ ([@benjamn](https://github.com/benjamn))
+* [`3a67410`](https://github.com/npm/npm/commit/3a6741068c9119174c920496778aeee870ebdac0)
+ `tap@1.3.1` ([@isaacs](https://github.com/isaacs))
+* [`151904a`](https://github.com/npm/npm/commit/151904af39dc24567f8c98529a2a64a4dbcc960a)
+ `nopt@3.0.3` ([@isaacs](https://github.com/isaacs))
+
+### v2.12.0 (2015-06-18):
+
+#### REMEMBER WHEN I SAID THAT THING ABOUT PERMISSIONS?
+
+About [a million people](https://github.com/npm/npm/issues?utf8=%E2%9C%93&q=is%3Aissue+EACCES+_locks)
+have filed issues related to having a tough time using npm after they've run
+npm once or twice with sudo. "Don't worry about it!" I said. "We've fixed all
+those permissions problems ages ago! Use this one weird trick and you'll never
+have to deal with this again!"
+
+Well, uh, if you run npm with root the first time you run npm on a machine, it
+turns out that the directory npm uses to store lockfiles ends up being owned by
+the wrong user (almost always root), and that can, well, it can cause problems
+sometimes. By which I mean every time you run npm without being root it'll barf
+with `EACCES` errors. Whoops!
+
+This is an obnoxious regression, and to prevent it from recurring, we've made
+it so that the cache, cached git remotes, and the lockfile directories are all
+created and maintained using the same utilty module, which not only creates the
+relevant paths with the correct permissions, but will fix the permissions on
+those directories (if it can) when it notices that they're broken. An `npm
+install` run as root ought to be sufficient to fix things up (and if that
+doesn't work, first tell us about it, and then run `sudo chown -R $(whoami)
+$HOME/.npm`)
+
+Also, I apologize for inadvertently gaslighting any of you by claiming this bug
+wasn't actually a bug. I do think we've got this permanently dealt with now,
+but I'll be paying extra-close attention to permissions issues related to the
+cache for a while.
+
+* [`85d1a53`](https://github.com/npm/npm/commit/85d1a53d7b5e0fc04823187e522ae3711ede61fa)
+ Set permissions on lock directory to the owner of the process.
+ ([@othiym23](https://github.com/othiym23))
+
+#### I WENT TO NODECONF AND ALL I GOT WAS THIS LOUSY SPDX T-SHIRT
+
+That's not literally true. We spent very little time discussing SPDX,
+[@kemitchell](https://github.com/kemitchell) is a champ, and I had a lot of fun
+playing drum & bass to a mostly empty Boogie Barn and only ended up with one
+moderately severe cold for my pains. Another winner of a NodeConf! (I would
+probably wear a SPDX T-shirt if somebody gave me one, though.)
+
+A bunch of us did have a spirited discussion of the basics of open-source
+intellectual property, and the convergence of me,
+[@kemitchell](https://github.com/kemitchell), and
+[@jandrieu](https://github.com/jandrieu) in one place allowed us to hammmer out
+a small but significant issue that had been bedeviling early adopters of the
+new SPDX expression syntax in `package.json` license fields: how to deal with
+packages that are left without a license on purpose.
+
+Refer to [the docs](https://github.com/npm/npm/blob/16a3dd545b10f8a2464e2037506ce39124739b41/doc/files/package.json.md#license)
+for the specifics, but the short version is that instead of using
+`LicenseRef-LICENSE` for proprietary licenses, you can now use either
+`UNLICENSED` if you want to make it clear that you don't _want_ your software
+to be licensed (and want npm to stop warning you about this), or `SEE LICENSE
+IN <filename>` if there's a license with custom text you want to use. At some
+point in the near term, we'll be updating npm to verify that the mentioned
+file actually exists, but for now you're all on the honor system.
+
+* [`4827fc7`](https://github.com/npm/npm/commit/4827fc784117c17f35dd9b51b21d1eff6094f661)
+ [#8557](https://github.com/npm/npm/issues/8557)
+ `normalize-package-data@2.2.1`: Allow `UNLICENSED` and `SEE LICENSE IN
+ <filename>` in "license" field of `package.json`.
+ ([@kemitchell](https://github.com/kemitchell))
+* [`16a3dd5`](https://github.com/npm/npm/commit/16a3dd545b10f8a2464e2037506ce39124739b41)
+ [#8557](https://github.com/npm/npm/issues/8557) Document the new accepted
+ values for the "license" field.
+ ([@kemitchell](https://github.com/kemitchell))
+* [`8155311`](https://github.com/npm/npm/commit/81553119350deaf199e79e38e35b52a5c8ad206c)
+ [#8557](https://github.com/npm/npm/issues/8557) `init-package-json@1.7.0`:
+ Support new "license" field values at init time.
+ ([@kemitchell](https://github.com/kemitchell))
+
+#### SMALLISH BUG FIXES
+
+* [`9d8cac9`](https://github.com/npm/npm/commit/9d8cac94a258db648a2b1069b1c8c6529c79d013)
+ [#8548](https://github.com/npm/npm/issues/8548) Remove extraneous newline
+ from `npm view` output, making it easier to use in shell scripts.
+ ([@eush77](https://github.com/eush77))
+* [`765fd4b`](https://github.com/npm/npm/commit/765fd4bfca8ea3e2a4a399765b17eec40a3d893d)
+ [#8521](https://github.com/npm/npm/issues/8521) When checking for outdated
+ packages, or updating packages, raise an error when the registry is
+ unreachable instead of silently "succeeding".
+ ([@ryantemple](https://github.com/ryantemple))
+
+#### SMALLERISH DOCUMENTATION TWEAKS
+
+* [`5018335`](https://github.com/npm/npm/commit/5018335ce1754a9f771954ecbc1a93acde9b8c0a)
+ [#8365](https://github.com/npm/npm/issues/8365) Add details about which git
+ environment variables are whitelisted by npm.
+ ([@nmalaguti](https://github.com/nmalaguti))
+* [`bed9edd`](https://github.com/npm/npm/commit/bed9edddfdcc6d22a80feab33b53e4ef9172ec72)
+ [#8554](https://github.com/npm/npm/issues/8554) Fix typo in version docs.
+ ([@rainyday](https://github.com/rainyday))
+
+#### WELL, I GUESS THERE ARE MORE DEPENDENCY UPGRADES
+
+* [`7ce2f06`](https://github.com/npm/npm/commit/7ce2f06f6f34d469b1d2e248084d4f3fef10c05e)
+ `request@2.58.0`: Refactor tunneling logic, and use `extend` instead of
+ abusing `util._extend`. ([@simov](https://github.com/simov))
+* [`e6c6195`](https://github.com/npm/npm/commit/e6c61954aad42e20eec49745615c7640b2026a6c)
+ `nock@2.6.0`: Refined interception behavior.
+ ([@pgte](https://github.com/pgte))
+* [`9583cc3`](https://github.com/npm/npm/commit/9583cc3cb192c2fced006927cfba7cd37b588605)
+ `fstream-npm@1.0.3`: Ensure that `main` entry in `package.json` is always
+ included in the bundled package tarball.
+ ([@coderhaoxin](https://github.com/coderhaoxin))
+* [`df89493`](https://github.com/npm/npm/commit/df894930f2716adac28740b29b2e863170919990)
+ `fstream@1.0.7` ([@isaacs](https://github.com/isaacs))
+* [`9744049`](https://github.com/npm/npm/commit/974404934758124aa8ae5b54f7d5257c3bd6b588)
+ `dezalgo@1.0.3`: `dezalgo` should be usable in the browser, and can be now
+ that `asap` has been upgraded to be browserifiable.
+ ([@mvayngrib](https://github.com/mvayngrib))
+
### v2.11.3 (2015-06-11):
This was a very quiet week. This release was done by
@@ -15,19 +189,19 @@ NodeConf Adventure!
* [`9f439da`](https://github.com/npm/npm/commit/9f439da)
`spdx@0.4.1`: License range updates
- (@kemitchell)[https://github.com/kemitchell]
+ ([@kemitchell](https://github.com/kemitchell))
* [`2dd055b`](https://github.com/npm/npm/commit/2dd055b)
`normalize-package-data@2.2.1`: Fixes a crashing bug when the package.json
`scripts` property is not an object.
- (@iarna)[https://github.com/iarna]
+ ([@iarna](https://github.com/iarna))
* [`e02e85d`](https://github.com/npm/npm/commit/e02e85d)
`osenv@0.1.2`: Switches to using the `os-tmpdir` module instead of
`os.tmpdir()` for greate consistency in behavior between node versions.
- (@iarna)[https://github.com/iarna]
+ ([@iarna](https://github.com/iarna))
* [`a6f0265`](https://github.com/npm/npm/commit/a6f0265)
- `ini@1.3.4` (@isaacs)[https://github.com/isaacs]
+ `ini@1.3.4` ([@isaacs](https://github.com/isaacs))
* [`7395977`](https://github.com/npm/npm/commit/7395977)
- `rimraf@2.4.0` (@isaacs)[https://github.com/isaacs]
+ `rimraf@2.4.0` ([@isaacs](https://github.com/isaacs))
### v2.11.2 (2015-06-04):
diff --git a/deps/npm/doc/cli/npm-install.md b/deps/npm/doc/cli/npm-install.md
index b2f4e077b40..be32f7b296e 100644
--- a/deps/npm/doc/cli/npm-install.md
+++ b/deps/npm/doc/cli/npm-install.md
@@ -166,11 +166,24 @@ after packing it up into a tarball (b).
`git+https`. If no `<commit-ish>` is specified, then `master` is
used.
+ The following git environment variables are recognized by npm and will be added
+ to the environment when running git:
+
+ * `GIT_ASKPASS`
+ * `GIT_PROXY_COMMAND`
+ * `GIT_SSH`
+ * `GIT_SSH_COMMAND`
+ * `GIT_SSL_CAINFO`
+ * `GIT_SSL_NO_VERIFY`
+
+ See the git man page for details.
+
Examples:
- git+ssh://git@github.com:npm/npm.git#v1.0.27
- git+https://isaacs@github.com/npm/npm.git
- git://github.com/npm/npm.git#v1.0.27
+ npm install git+ssh://git@github.com:npm/npm.git#v1.0.27
+ npm install git+https://isaacs@github.com/npm/npm.git
+ npm install git://github.com/npm/npm.git#v1.0.27
+ GIT_SSH_COMMAND='ssh -i ~/.ssh/custom_ident' npm install git+ssh://git@github.com:npm/npm.git
* `npm install <githubname>/<githubrepo>[#<commit-ish>]`:
* `npm install github:<githubname>/<githubrepo>[#<commit-ish>]`:
diff --git a/deps/npm/doc/cli/npm-version.md b/deps/npm/doc/cli/npm-version.md
index 63a5e951229..abcd25b3a5c 100644
--- a/deps/npm/doc/cli/npm-version.md
+++ b/deps/npm/doc/cli/npm-version.md
@@ -11,8 +11,8 @@ Run this in a package directory to bump the version and write the new
data back to `package.json` and, if present, `npm-shrinkwrap.json`.
The `newversion` argument should be a valid semver string, *or* a
-valid second argument to semver.inc (one of "patch", "minor", "major",
-"prepatch", "preminor", "premajor", "prerelease"). In the second case,
+valid second argument to semver.inc (one of `patch`, `minor`, `major`,
+`prepatch`, `preminor`, `premajor`, `prerelease`). In the second case,
the existing version will be incremented by 1 in the specified field.
If run in a git repo, it will also create a version commit and tag, and fail if
@@ -40,11 +40,11 @@ in your git config for this to work properly. For example:
Enter passphrase:
-If "preversion", "version", "postversion" in the "scripts" property of
-the package.json, it will execute by running `npm version`. preversion
-and version ware executed before bump the package version, postversion
-was executed after bump the package version. For example to run `npm version`
-after passed all test:
+If `preversion`, `version`, or `postversion` are in the `scripts` property of
+the package.json, they will be executed as part of running `npm version`.
+`preversion` and `version` are executed before bumping the package version, and
+`postversion` is executed afterwards. For example, to run `npm version` only if
+all tests pass:
"scripts": { "preversion": "npm test" }
diff --git a/deps/npm/doc/files/package.json.md b/deps/npm/doc/files/package.json.md
index ad2b6623a1e..f402e2ebcc8 100644
--- a/deps/npm/doc/files/package.json.md
+++ b/deps/npm/doc/files/package.json.md
@@ -115,9 +115,9 @@ expression syntax version 2.0 string](http://npmjs.com/package/spdx), like this:
If you are using a license that hasn't been assigned an SPDX identifier, or if
you are using a custom license, use the following valid SPDX expression:
- { "license" : "LicenseRef-LICENSE" }
+ { "license" : "SEE LICENSE IN <filename>" }
-Then include a LICENSE file at the top level of the package.
+Then include a file named `<filename>` at the top level of the package.
Some old packages used license objects or a "licenses" property containing an
array of license objects:
@@ -147,6 +147,13 @@ Those styles are now deprecated. Instead, use SPDX expressions, like this:
{ "license": "(MIT OR Apache-2.0)" }
+Finally, if you do not wish to grant others the right to use a private or
+unpublished package under any terms:
+
+ { "license": "UNLICENSED"}
+
+Consider also setting `"private": true` to prevent accidental publication.
+
## people fields: author, contributors
The "author" is one person. "contributors" is an array of people. A "person"
diff --git a/deps/npm/html/doc/README.html b/deps/npm/html/doc/README.html
index 58a7ad43f2e..1926ad3df3c 100644
--- a/deps/npm/html/doc/README.html
+++ b/deps/npm/html/doc/README.html
@@ -140,7 +140,7 @@ specific purpose, or lack of malice in any given npm package.</p>
<p>If you have a complaint about a package in the public npm registry,
and cannot <a href="https://docs.npmjs.com/misc/disputes">resolve it with the package
owner</a>, please email
-<a href="&#109;&#97;&#x69;&#x6c;&#116;&#111;&#58;&#115;&#x75;&#112;&#x70;&#x6f;&#114;&#116;&#64;&#110;&#x70;&#109;&#106;&#115;&#x2e;&#x63;&#111;&#x6d;">&#115;&#x75;&#112;&#x70;&#x6f;&#114;&#116;&#64;&#110;&#x70;&#109;&#106;&#115;&#x2e;&#x63;&#111;&#x6d;</a> and explain the situation.</p>
+<a href="&#109;&#x61;&#105;&#x6c;&#116;&#x6f;&#x3a;&#x73;&#x75;&#112;&#x70;&#x6f;&#114;&#x74;&#x40;&#x6e;&#x70;&#x6d;&#x6a;&#x73;&#x2e;&#x63;&#111;&#x6d;">&#x73;&#x75;&#112;&#x70;&#x6f;&#114;&#x74;&#x40;&#x6e;&#x70;&#x6d;&#x6a;&#x73;&#x2e;&#x63;&#111;&#x6d;</a> and explain the situation.</p>
<p>Any data published to The npm Registry (including user account
information) may be removed or modified at the sole discretion of the
npm server administrators.</p>
@@ -183,5 +183,5 @@ will no doubt tell you to put the output in a gist or email.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer"><a href="../doc/README.html">README</a> &mdash; npm@2.11.3</p>
+<p id="footer"><a href="../doc/README.html">README</a> &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/api/npm-bin.html b/deps/npm/html/doc/api/npm-bin.html
index dcc8dbdee89..64adca3d027 100644
--- a/deps/npm/html/doc/api/npm-bin.html
+++ b/deps/npm/html/doc/api/npm-bin.html
@@ -28,5 +28,5 @@ to the <code>npm.bin</code> property.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-bin &mdash; npm@2.11.3</p>
+<p id="footer">npm-bin &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/api/npm-bugs.html b/deps/npm/html/doc/api/npm-bugs.html
index 9abf98e959d..d35432367fa 100644
--- a/deps/npm/html/doc/api/npm-bugs.html
+++ b/deps/npm/html/doc/api/npm-bugs.html
@@ -33,5 +33,5 @@ friendly for programmatic use.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-bugs &mdash; npm@2.11.3</p>
+<p id="footer">npm-bugs &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/api/npm-cache.html b/deps/npm/html/doc/api/npm-cache.html
index 218f930996d..315c9b175d8 100644
--- a/deps/npm/html/doc/api/npm-cache.html
+++ b/deps/npm/html/doc/api/npm-cache.html
@@ -42,5 +42,5 @@ incrementation.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-cache &mdash; npm@2.11.3</p>
+<p id="footer">npm-cache &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/api/npm-commands.html b/deps/npm/html/doc/api/npm-commands.html
index b7074c74f75..d6ee6c7d029 100644
--- a/deps/npm/html/doc/api/npm-commands.html
+++ b/deps/npm/html/doc/api/npm-commands.html
@@ -36,5 +36,5 @@ usage, or <code>man 3 npm-&lt;command&gt;</code> for programmatic usage.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-commands &mdash; npm@2.11.3</p>
+<p id="footer">npm-commands &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/api/npm-config.html b/deps/npm/html/doc/api/npm-config.html
index 8f9c9904f5a..96bab2a3b29 100644
--- a/deps/npm/html/doc/api/npm-config.html
+++ b/deps/npm/html/doc/api/npm-config.html
@@ -57,5 +57,5 @@ functions instead.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-config &mdash; npm@2.11.3</p>
+<p id="footer">npm-config &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/api/npm-deprecate.html b/deps/npm/html/doc/api/npm-deprecate.html
index 123c1905fc6..f5ca6ebd56d 100644
--- a/deps/npm/html/doc/api/npm-deprecate.html
+++ b/deps/npm/html/doc/api/npm-deprecate.html
@@ -47,5 +47,5 @@ a deprecation warning to all who attempt to install it.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-deprecate &mdash; npm@2.11.3</p>
+<p id="footer">npm-deprecate &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/api/npm-docs.html b/deps/npm/html/doc/api/npm-docs.html
index 0c1b8509ca1..a32de59094c 100644
--- a/deps/npm/html/doc/api/npm-docs.html
+++ b/deps/npm/html/doc/api/npm-docs.html
@@ -33,5 +33,5 @@ friendly for programmatic use.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-docs &mdash; npm@2.11.3</p>
+<p id="footer">npm-docs &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/api/npm-edit.html b/deps/npm/html/doc/api/npm-edit.html
index 1c3ba0f7d56..7a6987160b6 100644
--- a/deps/npm/html/doc/api/npm-edit.html
+++ b/deps/npm/html/doc/api/npm-edit.html
@@ -36,5 +36,5 @@ and how this is used.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-edit &mdash; npm@2.11.3</p>
+<p id="footer">npm-edit &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/api/npm-explore.html b/deps/npm/html/doc/api/npm-explore.html
index 3f4534ad726..4fec2308eb9 100644
--- a/deps/npm/html/doc/api/npm-explore.html
+++ b/deps/npm/html/doc/api/npm-explore.html
@@ -31,5 +31,5 @@ sure to use <code>npm rebuild &lt;pkg&gt;</code> if you make any changes.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-explore &mdash; npm@2.11.3</p>
+<p id="footer">npm-explore &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/api/npm-help-search.html b/deps/npm/html/doc/api/npm-help-search.html
index eb7701580ca..3e8273d5da1 100644
--- a/deps/npm/html/doc/api/npm-help-search.html
+++ b/deps/npm/html/doc/api/npm-help-search.html
@@ -44,5 +44,5 @@ Name of the file that matched</li>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-help-search &mdash; npm@2.11.3</p>
+<p id="footer">npm-help-search &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/api/npm-init.html b/deps/npm/html/doc/api/npm-init.html
index 55e914a2086..d27d34ddb16 100644
--- a/deps/npm/html/doc/api/npm-init.html
+++ b/deps/npm/html/doc/api/npm-init.html
@@ -39,5 +39,5 @@ then go ahead and use this programmatically.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-init &mdash; npm@2.11.3</p>
+<p id="footer">npm-init &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/api/npm-install.html b/deps/npm/html/doc/api/npm-install.html
index 84aed0de0c8..7cde08d6db3 100644
--- a/deps/npm/html/doc/api/npm-install.html
+++ b/deps/npm/html/doc/api/npm-install.html
@@ -32,5 +32,5 @@ installed or when an error has been encountered.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-install &mdash; npm@2.11.3</p>
+<p id="footer">npm-install &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/api/npm-link.html b/deps/npm/html/doc/api/npm-link.html
index ac8ff4f6c9b..dc18b43863d 100644
--- a/deps/npm/html/doc/api/npm-link.html
+++ b/deps/npm/html/doc/api/npm-link.html
@@ -42,5 +42,5 @@ the package in the current working directory</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-link &mdash; npm@2.11.3</p>
+<p id="footer">npm-link &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/api/npm-load.html b/deps/npm/html/doc/api/npm-load.html
index 7f33487782a..bd94687203c 100644
--- a/deps/npm/html/doc/api/npm-load.html
+++ b/deps/npm/html/doc/api/npm-load.html
@@ -37,5 +37,5 @@ config object.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-load &mdash; npm@2.11.3</p>
+<p id="footer">npm-load &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/api/npm-ls.html b/deps/npm/html/doc/api/npm-ls.html
index 07d9134612a..044365d1af5 100644
--- a/deps/npm/html/doc/api/npm-ls.html
+++ b/deps/npm/html/doc/api/npm-ls.html
@@ -63,5 +63,5 @@ dependency will only be output once.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-ls &mdash; npm@2.11.3</p>
+<p id="footer">npm-ls &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/api/npm-outdated.html b/deps/npm/html/doc/api/npm-outdated.html
index a0262030674..ae1e594ff76 100644
--- a/deps/npm/html/doc/api/npm-outdated.html
+++ b/deps/npm/html/doc/api/npm-outdated.html
@@ -28,5 +28,5 @@ currently outdated.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-outdated &mdash; npm@2.11.3</p>
+<p id="footer">npm-outdated &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/api/npm-owner.html b/deps/npm/html/doc/api/npm-owner.html
index 185c373df43..200449a4219 100644
--- a/deps/npm/html/doc/api/npm-owner.html
+++ b/deps/npm/html/doc/api/npm-owner.html
@@ -47,5 +47,5 @@ that is not implemented at this time.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-owner &mdash; npm@2.11.3</p>
+<p id="footer">npm-owner &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/api/npm-pack.html b/deps/npm/html/doc/api/npm-pack.html
index 6ea6ed1dd2d..a26be859a53 100644
--- a/deps/npm/html/doc/api/npm-pack.html
+++ b/deps/npm/html/doc/api/npm-pack.html
@@ -33,5 +33,5 @@ overwritten the second time.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-pack &mdash; npm@2.11.3</p>
+<p id="footer">npm-pack &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/api/npm-submodule.html b/deps/npm/html/doc/api/npm-ping.html
index f4b5c85c6e0..b96caf3b069 100644
--- a/deps/npm/html/doc/api/npm-submodule.html
+++ b/deps/npm/html/doc/api/npm-ping.html
@@ -1,35 +1,22 @@
<!doctype html>
<html>
- <title>npm-submodule</title>
+ <title>npm-ping</title>
<meta http-equiv="content-type" value="text/html;utf-8">
<link rel="stylesheet" type="text/css" href="../../static/style.css">
- <link rel="canonical" href="https://www.npmjs.org/doc/api/npm-submodule.html">
+ <link rel="canonical" href="https://www.npmjs.org/doc/api/npm-ping.html">
<script async=true src="../../static/toc.js"></script>
<body>
<div id="wrapper">
-<h1><a href="../api/npm-submodule.html">npm-submodule</a></h1> <p>Add a package as a git submodule</p>
+<h1><a href="../api/npm-ping.html">npm-ping</a></h1> <p>Ping npm registry</p>
<h2 id="synopsis">SYNOPSIS</h2>
-<pre><code>npm.commands.submodule(packages, callback)
+<pre><code>npm.registry.ping(registry, options, function (er, pong))
</code></pre><h2 id="description">DESCRIPTION</h2>
-<p>For each package specified, npm will check if it has a git repository url
-in its package.json description then add it as a git submodule at
-<code>node_modules/&lt;pkg name&gt;</code>.</p>
-<p>This is a convenience only. From then on, it&#39;s up to you to manage
-updates by using the appropriate git commands. npm will stubbornly
-refuse to update, modify, or remove anything with a <code>.git</code> subfolder
-in it.</p>
-<p>This command also does not install missing dependencies, if the package
-does not include them in its git repository. If <code>npm ls</code> reports that
-things are missing, you can either install, link, or submodule them yourself,
-or you can do <code>npm explore &lt;pkgname&gt; -- npm install</code> to install the
-dependencies into the submodule folder.</p>
-<h2 id="see-also">SEE ALSO</h2>
-<ul>
-<li>npm help json</li>
-<li>git help submodule</li>
-</ul>
+<p>Attempts to connect to the given registry, returning a <code>pong</code>
+object with various metadata if it succeeds.</p>
+<p>This function is primarily useful for debugging connection issues
+to npm registries.</p>
</div>
@@ -42,4 +29,4 @@ dependencies into the submodule folder.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-submodule &mdash; npm@1.4.28</p>
+<p id="footer">npm-ping &mdash; npm@2.13.0</p>
diff --git a/deps/npm/html/doc/api/npm-prefix.html b/deps/npm/html/doc/api/npm-prefix.html
index beb56a37fcf..3882f616bbb 100644
--- a/deps/npm/html/doc/api/npm-prefix.html
+++ b/deps/npm/html/doc/api/npm-prefix.html
@@ -29,5 +29,5 @@
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-prefix &mdash; npm@2.11.3</p>
+<p id="footer">npm-prefix &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/api/npm-prune.html b/deps/npm/html/doc/api/npm-prune.html
index 01ab1055a99..1bd5ec6c6f4 100644
--- a/deps/npm/html/doc/api/npm-prune.html
+++ b/deps/npm/html/doc/api/npm-prune.html
@@ -30,5 +30,5 @@ package&#39;s dependencies list.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-prune &mdash; npm@2.11.3</p>
+<p id="footer">npm-prune &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/api/npm-publish.html b/deps/npm/html/doc/api/npm-publish.html
index c870b3d3679..797c4ced267 100644
--- a/deps/npm/html/doc/api/npm-publish.html
+++ b/deps/npm/html/doc/api/npm-publish.html
@@ -46,5 +46,5 @@ the registry. Overwrites when the &quot;force&quot; environment variable is set
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-publish &mdash; npm@2.11.3</p>
+<p id="footer">npm-publish &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/api/npm-rebuild.html b/deps/npm/html/doc/api/npm-rebuild.html
index 612acf114d4..335cd30082c 100644
--- a/deps/npm/html/doc/api/npm-rebuild.html
+++ b/deps/npm/html/doc/api/npm-rebuild.html
@@ -30,5 +30,5 @@ the new binary. If no &#39;packages&#39; parameter is specify, every package wil
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-rebuild &mdash; npm@2.11.3</p>
+<p id="footer">npm-rebuild &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/api/npm-repo.html b/deps/npm/html/doc/api/npm-repo.html
index e426c2ad641..8faed4f4011 100644
--- a/deps/npm/html/doc/api/npm-repo.html
+++ b/deps/npm/html/doc/api/npm-repo.html
@@ -33,5 +33,5 @@ friendly for programmatic use.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-repo &mdash; npm@2.11.3</p>
+<p id="footer">npm-repo &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/api/npm-restart.html b/deps/npm/html/doc/api/npm-restart.html
index ae60b9b904c..ba1c8946a00 100644
--- a/deps/npm/html/doc/api/npm-restart.html
+++ b/deps/npm/html/doc/api/npm-restart.html
@@ -52,5 +52,5 @@ behavior will be accompanied by an increase in major version number</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-restart &mdash; npm@2.11.3</p>
+<p id="footer">npm-restart &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/api/npm-root.html b/deps/npm/html/doc/api/npm-root.html
index c3d418d3af2..4ddf95c43eb 100644
--- a/deps/npm/html/doc/api/npm-root.html
+++ b/deps/npm/html/doc/api/npm-root.html
@@ -29,5 +29,5 @@
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-root &mdash; npm@2.11.3</p>
+<p id="footer">npm-root &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/api/npm-run-script.html b/deps/npm/html/doc/api/npm-run-script.html
index 1c4aa15dc5f..db67f161237 100644
--- a/deps/npm/html/doc/api/npm-run-script.html
+++ b/deps/npm/html/doc/api/npm-run-script.html
@@ -41,5 +41,5 @@ assumed to be the command to run. All other elements are ignored.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-run-script &mdash; npm@2.11.3</p>
+<p id="footer">npm-run-script &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/api/npm-search.html b/deps/npm/html/doc/api/npm-search.html
index 1638a63e060..fe33b071299 100644
--- a/deps/npm/html/doc/api/npm-search.html
+++ b/deps/npm/html/doc/api/npm-search.html
@@ -53,5 +53,5 @@ like).</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-search &mdash; npm@2.11.3</p>
+<p id="footer">npm-search &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/api/npm-shrinkwrap.html b/deps/npm/html/doc/api/npm-shrinkwrap.html
index 9dfff6c718f..32b42c69a5d 100644
--- a/deps/npm/html/doc/api/npm-shrinkwrap.html
+++ b/deps/npm/html/doc/api/npm-shrinkwrap.html
@@ -33,5 +33,5 @@ been saved.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-shrinkwrap &mdash; npm@2.11.3</p>
+<p id="footer">npm-shrinkwrap &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/api/npm-start.html b/deps/npm/html/doc/api/npm-start.html
index d1f5ff7a804..d682d0271df 100644
--- a/deps/npm/html/doc/api/npm-start.html
+++ b/deps/npm/html/doc/api/npm-start.html
@@ -28,5 +28,5 @@
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-start &mdash; npm@2.11.3</p>
+<p id="footer">npm-start &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/api/npm-stop.html b/deps/npm/html/doc/api/npm-stop.html
index cb3b83a4ad9..7743a930391 100644
--- a/deps/npm/html/doc/api/npm-stop.html
+++ b/deps/npm/html/doc/api/npm-stop.html
@@ -28,5 +28,5 @@ in the <code>packages</code> parameter.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-stop &mdash; npm@2.11.3</p>
+<p id="footer">npm-stop &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/api/npm-tag.html b/deps/npm/html/doc/api/npm-tag.html
index 51d7af306ae..732ccb34b55 100644
--- a/deps/npm/html/doc/api/npm-tag.html
+++ b/deps/npm/html/doc/api/npm-tag.html
@@ -36,5 +36,5 @@ used. For more information about how to set this config, check
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-tag &mdash; npm@2.11.3</p>
+<p id="footer">npm-tag &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/api/npm-test.html b/deps/npm/html/doc/api/npm-test.html
index 10303feadc2..a2dd4ad4a5e 100644
--- a/deps/npm/html/doc/api/npm-test.html
+++ b/deps/npm/html/doc/api/npm-test.html
@@ -30,5 +30,5 @@ in the <code>packages</code> parameter.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-test &mdash; npm@2.11.3</p>
+<p id="footer">npm-test &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/api/npm-uninstall.html b/deps/npm/html/doc/api/npm-uninstall.html
index 4cc010db456..bd4ccf0ee3a 100644
--- a/deps/npm/html/doc/api/npm-uninstall.html
+++ b/deps/npm/html/doc/api/npm-uninstall.html
@@ -30,5 +30,5 @@ uninstalled or when an error has been encountered.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-uninstall &mdash; npm@2.11.3</p>
+<p id="footer">npm-uninstall &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/api/npm-unpublish.html b/deps/npm/html/doc/api/npm-unpublish.html
index 60f9e3b2b60..9b8aebb8dd9 100644
--- a/deps/npm/html/doc/api/npm-unpublish.html
+++ b/deps/npm/html/doc/api/npm-unpublish.html
@@ -33,5 +33,5 @@ the root package entry is removed from the registry entirely.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-unpublish &mdash; npm@2.11.3</p>
+<p id="footer">npm-unpublish &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/api/npm-update.html b/deps/npm/html/doc/api/npm-update.html
index c31fcd059de..ce64de4d404 100644
--- a/deps/npm/html/doc/api/npm-update.html
+++ b/deps/npm/html/doc/api/npm-update.html
@@ -33,5 +33,5 @@ parameter will be called when done or when an error occurs.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-update &mdash; npm@2.11.3</p>
+<p id="footer">npm-update &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/api/npm-version.html b/deps/npm/html/doc/api/npm-version.html
index 02ac457e29e..2d2c827bb7e 100644
--- a/deps/npm/html/doc/api/npm-version.html
+++ b/deps/npm/html/doc/api/npm-version.html
@@ -32,5 +32,5 @@ not have exactly one element. The only element should be a version number.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-version &mdash; npm@2.11.3</p>
+<p id="footer">npm-version &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/api/npm-view.html b/deps/npm/html/doc/api/npm-view.html
index 59b0f4bda80..e6723356401 100644
--- a/deps/npm/html/doc/api/npm-view.html
+++ b/deps/npm/html/doc/api/npm-view.html
@@ -81,5 +81,5 @@ the field name.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-view &mdash; npm@2.11.3</p>
+<p id="footer">npm-view &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/api/npm-whoami.html b/deps/npm/html/doc/api/npm-whoami.html
index 6f63d93daf1..5e0bceaaaf2 100644
--- a/deps/npm/html/doc/api/npm-whoami.html
+++ b/deps/npm/html/doc/api/npm-whoami.html
@@ -29,5 +29,5 @@
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-whoami &mdash; npm@2.11.3</p>
+<p id="footer">npm-whoami &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/api/npm.html b/deps/npm/html/doc/api/npm.html
index 2f75c679475..1331c2e6d34 100644
--- a/deps/npm/html/doc/api/npm.html
+++ b/deps/npm/html/doc/api/npm.html
@@ -23,7 +23,7 @@ npm.load([configObject, ]function (er, npm) {
npm.commands.install([&quot;package&quot;], cb)
})
</code></pre><h2 id="version">VERSION</h2>
-<p>2.11.3</p>
+<p>2.12.1</p>
<h2 id="description">DESCRIPTION</h2>
<p>This is the API documentation for npm.
To find documentation of the command line
@@ -109,5 +109,5 @@ method names. Use the <code>npm.deref</code> method to find the real name.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm &mdash; npm@2.11.3</p>
+<p id="footer">npm &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-access.html b/deps/npm/html/doc/cli/npm-access.html
index ef5fda3e6aa..2d1184e412b 100644
--- a/deps/npm/html/doc/cli/npm-access.html
+++ b/deps/npm/html/doc/cli/npm-access.html
@@ -75,5 +75,5 @@ with an HTTP 402 status code (logically enough), unless you use
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-access &mdash; npm@2.11.3</p>
+<p id="footer">npm-access &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-adduser.html b/deps/npm/html/doc/cli/npm-adduser.html
index 5eda2bf5ce6..48c78be553f 100644
--- a/deps/npm/html/doc/cli/npm-adduser.html
+++ b/deps/npm/html/doc/cli/npm-adduser.html
@@ -68,5 +68,5 @@ precedence over any global configuration.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-adduser &mdash; npm@2.11.3</p>
+<p id="footer">npm-adduser &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-bin.html b/deps/npm/html/doc/cli/npm-bin.html
index 000641e2e5e..f6aa1f85b26 100644
--- a/deps/npm/html/doc/cli/npm-bin.html
+++ b/deps/npm/html/doc/cli/npm-bin.html
@@ -35,5 +35,5 @@
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-bin &mdash; npm@2.11.3</p>
+<p id="footer">npm-bin &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-bugs.html b/deps/npm/html/doc/cli/npm-bugs.html
index 62539c0ddce..ddba552dbe1 100644
--- a/deps/npm/html/doc/cli/npm-bugs.html
+++ b/deps/npm/html/doc/cli/npm-bugs.html
@@ -54,5 +54,5 @@ a <code>package.json</code> in the current folder and use the <code>name</code>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-bugs &mdash; npm@2.11.3</p>
+<p id="footer">npm-bugs &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-build.html b/deps/npm/html/doc/cli/npm-build.html
index b6b1b9c3bb9..262749a5218 100644
--- a/deps/npm/html/doc/cli/npm-build.html
+++ b/deps/npm/html/doc/cli/npm-build.html
@@ -40,5 +40,5 @@ directly, run:</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-build &mdash; npm@2.11.3</p>
+<p id="footer">npm-build &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-bundle.html b/deps/npm/html/doc/cli/npm-bundle.html
index f9b1deea9a9..5e8637979e0 100644
--- a/deps/npm/html/doc/cli/npm-bundle.html
+++ b/deps/npm/html/doc/cli/npm-bundle.html
@@ -31,5 +31,5 @@ install packages into the local space.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-bundle &mdash; npm@2.11.3</p>
+<p id="footer">npm-bundle &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-cache.html b/deps/npm/html/doc/cli/npm-cache.html
index 4f174bbc440..d153046cf23 100644
--- a/deps/npm/html/doc/cli/npm-cache.html
+++ b/deps/npm/html/doc/cli/npm-cache.html
@@ -81,5 +81,5 @@ they do not make an HTTP request to the registry.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-cache &mdash; npm@2.11.3</p>
+<p id="footer">npm-cache &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-completion.html b/deps/npm/html/doc/cli/npm-completion.html
index 2632938af4e..3fb24cfcef2 100644
--- a/deps/npm/html/doc/cli/npm-completion.html
+++ b/deps/npm/html/doc/cli/npm-completion.html
@@ -42,5 +42,5 @@ completions based on the arguments.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-completion &mdash; npm@2.11.3</p>
+<p id="footer">npm-completion &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-config.html b/deps/npm/html/doc/cli/npm-config.html
index 376bbd48067..771f1c2f5fe 100644
--- a/deps/npm/html/doc/cli/npm-config.html
+++ b/deps/npm/html/doc/cli/npm-config.html
@@ -66,5 +66,5 @@ global config.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-config &mdash; npm@2.11.3</p>
+<p id="footer">npm-config &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-dedupe.html b/deps/npm/html/doc/cli/npm-dedupe.html
index b93f3fcb75a..77a12279cfb 100644
--- a/deps/npm/html/doc/cli/npm-dedupe.html
+++ b/deps/npm/html/doc/cli/npm-dedupe.html
@@ -63,5 +63,5 @@ versions.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-dedupe &mdash; npm@2.11.3</p>
+<p id="footer">npm-dedupe &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-deprecate.html b/deps/npm/html/doc/cli/npm-deprecate.html
index d916b791c93..b4293ca7545 100644
--- a/deps/npm/html/doc/cli/npm-deprecate.html
+++ b/deps/npm/html/doc/cli/npm-deprecate.html
@@ -38,5 +38,5 @@ something like this:</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-deprecate &mdash; npm@2.11.3</p>
+<p id="footer">npm-deprecate &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-dist-tag.html b/deps/npm/html/doc/cli/npm-dist-tag.html
index 1fdf4b97a6f..ce634444632 100644
--- a/deps/npm/html/doc/cli/npm-dist-tag.html
+++ b/deps/npm/html/doc/cli/npm-dist-tag.html
@@ -77,5 +77,5 @@ begin with a number or the letter <code>v</code>.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-dist-tag &mdash; npm@2.11.3</p>
+<p id="footer">npm-dist-tag &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-docs.html b/deps/npm/html/doc/cli/npm-docs.html
index 8dfd9f0a615..ca71e1fc77c 100644
--- a/deps/npm/html/doc/cli/npm-docs.html
+++ b/deps/npm/html/doc/cli/npm-docs.html
@@ -56,5 +56,5 @@ the current folder and use the <code>name</code> property.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-docs &mdash; npm@2.11.3</p>
+<p id="footer">npm-docs &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-edit.html b/deps/npm/html/doc/cli/npm-edit.html
index 44581b1e827..1a245893de5 100644
--- a/deps/npm/html/doc/cli/npm-edit.html
+++ b/deps/npm/html/doc/cli/npm-edit.html
@@ -49,5 +49,5 @@ or <code>&quot;notepad&quot;</code> on Windows.</li>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-edit &mdash; npm@2.11.3</p>
+<p id="footer">npm-edit &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-explore.html b/deps/npm/html/doc/cli/npm-explore.html
index d6b2c363fdd..45297d48dc2 100644
--- a/deps/npm/html/doc/cli/npm-explore.html
+++ b/deps/npm/html/doc/cli/npm-explore.html
@@ -49,5 +49,5 @@ Windows</li>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-explore &mdash; npm@2.11.3</p>
+<p id="footer">npm-explore &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-help-search.html b/deps/npm/html/doc/cli/npm-help-search.html
index a39aad66566..b9a647aed75 100644
--- a/deps/npm/html/doc/cli/npm-help-search.html
+++ b/deps/npm/html/doc/cli/npm-help-search.html
@@ -46,5 +46,5 @@ where the terms were found in the documentation.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-help-search &mdash; npm@2.11.3</p>
+<p id="footer">npm-help-search &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-help.html b/deps/npm/html/doc/cli/npm-help.html
index a9ac805bbff..1c2ec94b6a0 100644
--- a/deps/npm/html/doc/cli/npm-help.html
+++ b/deps/npm/html/doc/cli/npm-help.html
@@ -52,5 +52,5 @@ matches are equivalent to specifying a topic name.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-help &mdash; npm@2.11.3</p>
+<p id="footer">npm-help &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-init.html b/deps/npm/html/doc/cli/npm-init.html
index 5791edd4acc..94890ec1511 100644
--- a/deps/npm/html/doc/cli/npm-init.html
+++ b/deps/npm/html/doc/cli/npm-init.html
@@ -48,5 +48,5 @@ defaults and not prompt you for any options.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-init &mdash; npm@2.11.3</p>
+<p id="footer">npm-init &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-install.html b/deps/npm/html/doc/cli/npm-install.html
index 35162c5018e..d10c5b13e27 100644
--- a/deps/npm/html/doc/cli/npm-install.html
+++ b/deps/npm/html/doc/cli/npm-install.html
@@ -138,11 +138,24 @@ fetch the package by name if it is not valid.
</code></pre><p> <code>&lt;protocol&gt;</code> is one of <code>git</code>, <code>git+ssh</code>, <code>git+http</code>, or
<code>git+https</code>. If no <code>&lt;commit-ish&gt;</code> is specified, then <code>master</code> is
used.</p>
-<p> Examples:</p>
-<pre><code> git+ssh://git@github.com:npm/npm.git#v1.0.27
- git+https://isaacs@github.com/npm/npm.git
- git://github.com/npm/npm.git#v1.0.27
+<p> The following git environment variables are recognized by npm and will be added
+ to the environment when running git:</p>
+<ul>
+<li><code>GIT_ASKPASS</code></li>
+<li><code>GIT_PROXY_COMMAND</code></li>
+<li><code>GIT_SSH</code></li>
+<li><code>GIT_SSH_COMMAND</code></li>
+<li><code>GIT_SSL_CAINFO</code></li>
+<li><p><code>GIT_SSL_NO_VERIFY</code></p>
+<p>See the git man page for details.</p>
+<p>Examples:</p>
+<pre><code>npm install git+ssh://git@github.com:npm/npm.git#v1.0.27
+npm install git+https://isaacs@github.com/npm/npm.git
+npm install git://github.com/npm/npm.git#v1.0.27
+GIT_SSH_COMMAND=&#39;ssh -i ~/.ssh/custom_ident&#39; npm install git+ssh://git@github.com:npm/npm.git
</code></pre></li>
+</ul>
+</li>
<li><p><code>npm install &lt;githubname&gt;/&lt;githubrepo&gt;[#&lt;commit-ish&gt;]</code>:</p>
</li>
<li><p><code>npm install github:&lt;githubname&gt;/&lt;githubrepo&gt;[#&lt;commit-ish&gt;]</code>:</p>
@@ -264,5 +277,5 @@ affects a real use-case, it will be investigated.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-install &mdash; npm@2.11.3</p>
+<p id="footer">npm-install &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-link.html b/deps/npm/html/doc/cli/npm-link.html
index fa2d33cc3a8..b59b57521c2 100644
--- a/deps/npm/html/doc/cli/npm-link.html
+++ b/deps/npm/html/doc/cli/npm-link.html
@@ -72,5 +72,5 @@ include that scope, e.g.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-link &mdash; npm@2.11.3</p>
+<p id="footer">npm-link &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-logout.html b/deps/npm/html/doc/cli/npm-logout.html
index add0967b268..1f4b7579306 100644
--- a/deps/npm/html/doc/cli/npm-logout.html
+++ b/deps/npm/html/doc/cli/npm-logout.html
@@ -55,5 +55,5 @@ that registry at the same time.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-logout &mdash; npm@2.11.3</p>
+<p id="footer">npm-logout &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-ls.html b/deps/npm/html/doc/cli/npm-ls.html
index 90a2aa75033..f33a19d33e7 100644
--- a/deps/npm/html/doc/cli/npm-ls.html
+++ b/deps/npm/html/doc/cli/npm-ls.html
@@ -22,7 +22,7 @@ installed, as well as their dependencies, in a tree-structure.</p>
limit the results to only the paths to the packages named. Note that
nested packages will <em>also</em> show the paths to the specified packages.
For example, running <code>npm ls promzard</code> in npm&#39;s source tree will show:</p>
-<pre><code>npm@2.11.3 /path/to/npm
+<pre><code>npm@2.12.1 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5
</code></pre><p>It will print out extraneous, missing, and invalid packages.</p>
@@ -97,5 +97,5 @@ project.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-ls &mdash; npm@2.11.3</p>
+<p id="footer">npm-ls &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-outdated.html b/deps/npm/html/doc/cli/npm-outdated.html
index e0ecfd26c2d..be9d397e287 100644
--- a/deps/npm/html/doc/cli/npm-outdated.html
+++ b/deps/npm/html/doc/cli/npm-outdated.html
@@ -67,5 +67,5 @@ project.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-outdated &mdash; npm@2.11.3</p>
+<p id="footer">npm-outdated &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-owner.html b/deps/npm/html/doc/cli/npm-owner.html
index 9b83f7e6735..8592ba4a19f 100644
--- a/deps/npm/html/doc/cli/npm-owner.html
+++ b/deps/npm/html/doc/cli/npm-owner.html
@@ -49,5 +49,5 @@ that is not implemented at this time.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-owner &mdash; npm@2.11.3</p>
+<p id="footer">npm-owner &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-pack.html b/deps/npm/html/doc/cli/npm-pack.html
index ccebbe323da..b03703e5cf5 100644
--- a/deps/npm/html/doc/cli/npm-pack.html
+++ b/deps/npm/html/doc/cli/npm-pack.html
@@ -41,5 +41,5 @@ overwritten the second time.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-pack &mdash; npm@2.11.3</p>
+<p id="footer">npm-pack &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-submodule.html b/deps/npm/html/doc/cli/npm-ping.html
index 30bde01b318..850ddcf1912 100644
--- a/deps/npm/html/doc/cli/npm-submodule.html
+++ b/deps/npm/html/doc/cli/npm-ping.html
@@ -1,34 +1,24 @@
<!doctype html>
<html>
- <title>npm-submodule</title>
+ <title>npm-ping</title>
<meta http-equiv="content-type" value="text/html;utf-8">
<link rel="stylesheet" type="text/css" href="../../static/style.css">
- <link rel="canonical" href="https://www.npmjs.org/doc/cli/npm-submodule.html">
+ <link rel="canonical" href="https://www.npmjs.org/doc/cli/npm-ping.html">
<script async=true src="../../static/toc.js"></script>
<body>
<div id="wrapper">
-<h1><a href="../cli/npm-submodule.html">npm-submodule</a></h1> <p>Add a package as a git submodule</p>
+<h1><a href="../cli/npm-ping.html">npm-ping</a></h1> <p>Ping npm registry</p>
<h2 id="synopsis">SYNOPSIS</h2>
-<pre><code>npm submodule &lt;pkg&gt;
+<pre><code>npm ping [--registry &lt;registry&gt;]
</code></pre><h2 id="description">DESCRIPTION</h2>
-<p>If the specified package has a git repository url in its package.json
-description, then this command will add it as a git submodule at
-<code>node_modules/&lt;pkg name&gt;</code>.</p>
-<p>This is a convenience only. From then on, it&#39;s up to you to manage
-updates by using the appropriate git commands. npm will stubbornly
-refuse to update, modify, or remove anything with a <code>.git</code> subfolder
-in it.</p>
-<p>This command also does not install missing dependencies, if the package
-does not include them in its git repository. If <code>npm ls</code> reports that
-things are missing, you can either install, link, or submodule them yourself,
-or you can do <code>npm explore &lt;pkgname&gt; -- npm install</code> to install the
-dependencies into the submodule folder.</p>
+<p>Ping the configured or given npm registry and verify authentication.</p>
<h2 id="see-also">SEE ALSO</h2>
<ul>
-<li><a href="../files/package.json.html">package.json(5)</a></li>
-<li>git help submodule</li>
+<li><a href="../cli/npm-config.html"><a href="../cli/npm-config.html">npm-config(1)</a></a></li>
+<li><a href="../misc/npm-config.html"><a href="../misc/npm-config.html">npm-config(7)</a></a></li>
+<li><a href="../files/npmrc.html"><a href="../files/npmrc.html">npmrc(5)</a></a></li>
</ul>
</div>
@@ -42,4 +32,4 @@ dependencies into the submodule folder.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-submodule &mdash; npm@1.4.28</p>
+<p id="footer">npm-ping &mdash; npm@2.13.0</p>
diff --git a/deps/npm/html/doc/cli/npm-prefix.html b/deps/npm/html/doc/cli/npm-prefix.html
index f9af61318d4..8d450ab718a 100644
--- a/deps/npm/html/doc/cli/npm-prefix.html
+++ b/deps/npm/html/doc/cli/npm-prefix.html
@@ -38,5 +38,5 @@ to contain a package.json file unless <code>-g</code> is also specified.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-prefix &mdash; npm@2.11.3</p>
+<p id="footer">npm-prefix &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-prune.html b/deps/npm/html/doc/cli/npm-prune.html
index 58125c41649..ab019bcbfb0 100644
--- a/deps/npm/html/doc/cli/npm-prune.html
+++ b/deps/npm/html/doc/cli/npm-prune.html
@@ -41,5 +41,5 @@ negate <code>NODE_ENV</code> being set to <code>production</code>.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-prune &mdash; npm@2.11.3</p>
+<p id="footer">npm-prune &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-publish.html b/deps/npm/html/doc/cli/npm-publish.html
index ba1bad9e26c..0116ce51385 100644
--- a/deps/npm/html/doc/cli/npm-publish.html
+++ b/deps/npm/html/doc/cli/npm-publish.html
@@ -66,5 +66,5 @@ it is removed with <a href="../cli/npm-unpublish.html"><a href="../cli/npm-unpub
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-publish &mdash; npm@2.11.3</p>
+<p id="footer">npm-publish &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-rebuild.html b/deps/npm/html/doc/cli/npm-rebuild.html
index 38bc945329a..8733ba248ef 100644
--- a/deps/npm/html/doc/cli/npm-rebuild.html
+++ b/deps/npm/html/doc/cli/npm-rebuild.html
@@ -38,5 +38,5 @@ the new binary.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-rebuild &mdash; npm@2.11.3</p>
+<p id="footer">npm-rebuild &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-repo.html b/deps/npm/html/doc/cli/npm-repo.html
index 63b850a61ed..8154b2937b5 100644
--- a/deps/npm/html/doc/cli/npm-repo.html
+++ b/deps/npm/html/doc/cli/npm-repo.html
@@ -42,5 +42,5 @@ a <code>package.json</code> in the current folder and use the <code>name</code>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-repo &mdash; npm@2.11.3</p>
+<p id="footer">npm-repo &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-restart.html b/deps/npm/html/doc/cli/npm-restart.html
index faafb1d00e4..8b2cf83f98d 100644
--- a/deps/npm/html/doc/cli/npm-restart.html
+++ b/deps/npm/html/doc/cli/npm-restart.html
@@ -53,5 +53,5 @@ behavior will be accompanied by an increase in major version number</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-restart &mdash; npm@2.11.3</p>
+<p id="footer">npm-restart &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-rm.html b/deps/npm/html/doc/cli/npm-rm.html
index 09ece656aa2..1bdde2466ad 100644
--- a/deps/npm/html/doc/cli/npm-rm.html
+++ b/deps/npm/html/doc/cli/npm-rm.html
@@ -39,5 +39,5 @@ on its behalf.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-rm &mdash; npm@2.11.3</p>
+<p id="footer">npm-rm &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-root.html b/deps/npm/html/doc/cli/npm-root.html
index c3092e686fd..e37b7fc178f 100644
--- a/deps/npm/html/doc/cli/npm-root.html
+++ b/deps/npm/html/doc/cli/npm-root.html
@@ -35,5 +35,5 @@
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-root &mdash; npm@2.11.3</p>
+<p id="footer">npm-root &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-run-script.html b/deps/npm/html/doc/cli/npm-run-script.html
index 03f1aa201a2..5923437be52 100644
--- a/deps/npm/html/doc/cli/npm-run-script.html
+++ b/deps/npm/html/doc/cli/npm-run-script.html
@@ -56,5 +56,5 @@ you should write <code>&quot;scripts&quot;: {&quot;test&quot;: &quot;tap test/\*
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-run-script &mdash; npm@2.11.3</p>
+<p id="footer">npm-run-script &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-search.html b/deps/npm/html/doc/cli/npm-search.html
index fc065f99915..82b754f9cb2 100644
--- a/deps/npm/html/doc/cli/npm-search.html
+++ b/deps/npm/html/doc/cli/npm-search.html
@@ -49,5 +49,5 @@ fall on multiple lines.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-search &mdash; npm@2.11.3</p>
+<p id="footer">npm-search &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-shrinkwrap.html b/deps/npm/html/doc/cli/npm-shrinkwrap.html
index b6f8ddc6d04..5eab7f08366 100644
--- a/deps/npm/html/doc/cli/npm-shrinkwrap.html
+++ b/deps/npm/html/doc/cli/npm-shrinkwrap.html
@@ -164,5 +164,5 @@ contents rather than versions.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-shrinkwrap &mdash; npm@2.11.3</p>
+<p id="footer">npm-shrinkwrap &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-star.html b/deps/npm/html/doc/cli/npm-star.html
index 273ba24060f..89bd24f62ab 100644
--- a/deps/npm/html/doc/cli/npm-star.html
+++ b/deps/npm/html/doc/cli/npm-star.html
@@ -36,5 +36,5 @@ a vaguely positive way to show that you care.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-star &mdash; npm@2.11.3</p>
+<p id="footer">npm-star &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-stars.html b/deps/npm/html/doc/cli/npm-stars.html
index 1899557adf5..39921bdde02 100644
--- a/deps/npm/html/doc/cli/npm-stars.html
+++ b/deps/npm/html/doc/cli/npm-stars.html
@@ -37,5 +37,5 @@ you will most certainly enjoy this command.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-stars &mdash; npm@2.11.3</p>
+<p id="footer">npm-stars &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-start.html b/deps/npm/html/doc/cli/npm-start.html
index eb36bd5b29f..2a392546733 100644
--- a/deps/npm/html/doc/cli/npm-start.html
+++ b/deps/npm/html/doc/cli/npm-start.html
@@ -34,5 +34,5 @@
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-start &mdash; npm@2.11.3</p>
+<p id="footer">npm-start &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-stop.html b/deps/npm/html/doc/cli/npm-stop.html
index c772f894616..68f80c5ea4f 100644
--- a/deps/npm/html/doc/cli/npm-stop.html
+++ b/deps/npm/html/doc/cli/npm-stop.html
@@ -34,5 +34,5 @@
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-stop &mdash; npm@2.11.3</p>
+<p id="footer">npm-stop &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-tag.html b/deps/npm/html/doc/cli/npm-tag.html
index 414e84a0dd1..b520e62c851 100644
--- a/deps/npm/html/doc/cli/npm-tag.html
+++ b/deps/npm/html/doc/cli/npm-tag.html
@@ -62,5 +62,5 @@ that do not begin with a number or the letter <code>v</code>.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-tag &mdash; npm@2.11.3</p>
+<p id="footer">npm-tag &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-test.html b/deps/npm/html/doc/cli/npm-test.html
index 1adc8897703..ef6b87e2b80 100644
--- a/deps/npm/html/doc/cli/npm-test.html
+++ b/deps/npm/html/doc/cli/npm-test.html
@@ -37,5 +37,5 @@ true.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-test &mdash; npm@2.11.3</p>
+<p id="footer">npm-test &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-uninstall.html b/deps/npm/html/doc/cli/npm-uninstall.html
index aae5ca9b4d8..17745924636 100644
--- a/deps/npm/html/doc/cli/npm-uninstall.html
+++ b/deps/npm/html/doc/cli/npm-uninstall.html
@@ -57,5 +57,5 @@ npm uninstall dtrace-provider --save-optional
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-uninstall &mdash; npm@2.11.3</p>
+<p id="footer">npm-uninstall &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-unpublish.html b/deps/npm/html/doc/cli/npm-unpublish.html
index 1f042fc55e3..bf76c55580f 100644
--- a/deps/npm/html/doc/cli/npm-unpublish.html
+++ b/deps/npm/html/doc/cli/npm-unpublish.html
@@ -47,5 +47,5 @@ package again, a new version number must be used.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-unpublish &mdash; npm@2.11.3</p>
+<p id="footer">npm-unpublish &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-update.html b/deps/npm/html/doc/cli/npm-update.html
index ae6685d4495..c03ee4e296a 100644
--- a/deps/npm/html/doc/cli/npm-update.html
+++ b/deps/npm/html/doc/cli/npm-update.html
@@ -119,5 +119,5 @@ be <em>downgraded</em>.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-update &mdash; npm@2.11.3</p>
+<p id="footer">npm-update &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-version.html b/deps/npm/html/doc/cli/npm-version.html
index 941df172003..2582f880ba2 100644
--- a/deps/npm/html/doc/cli/npm-version.html
+++ b/deps/npm/html/doc/cli/npm-version.html
@@ -16,8 +16,8 @@
<p>Run this in a package directory to bump the version and write the new
data back to <code>package.json</code> and, if present, <code>npm-shrinkwrap.json</code>.</p>
<p>The <code>newversion</code> argument should be a valid semver string, <em>or</em> a
-valid second argument to semver.inc (one of &quot;patch&quot;, &quot;minor&quot;, &quot;major&quot;,
-&quot;prepatch&quot;, &quot;preminor&quot;, &quot;premajor&quot;, &quot;prerelease&quot;). In the second case,
+valid second argument to semver.inc (one of <code>patch</code>, <code>minor</code>, <code>major</code>,
+<code>prepatch</code>, <code>preminor</code>, <code>premajor</code>, <code>prerelease</code>). In the second case,
the existing version will be incremented by 1 in the specified field.</p>
<p>If run in a git repo, it will also create a version commit and tag, and fail if
the repo is not clean. This behavior is controlled by <code>git-tag-version</code> (see
@@ -39,11 +39,11 @@ user: &quot;isaacs (http://blog.izs.me/) &lt;i@izs.me&gt;&quot;
2048-bit RSA key, ID 6C481CF6, created 2010-08-31
Enter passphrase:
-</code></pre><p>If &quot;preversion&quot;, &quot;version&quot;, &quot;postversion&quot; in the &quot;scripts&quot; property of
-the package.json, it will execute by running <code>npm version</code>. preversion
-and version ware executed before bump the package version, postversion
-was executed after bump the package version. For example to run <code>npm version</code>
-after passed all test:</p>
+</code></pre><p>If <code>preversion</code>, <code>version</code>, or <code>postversion</code> are in the <code>scripts</code> property of
+the package.json, they will be executed as part of running <code>npm version</code>.
+<code>preversion</code> and <code>version</code> are executed before bumping the package version, and
+<code>postversion</code> is executed afterwards. For example, to run <code>npm version</code> only if
+all tests pass:</p>
<pre><code>&quot;scripts&quot;: { &quot;preversion&quot;: &quot;npm test&quot; }
</code></pre><h2 id="configuration">CONFIGURATION</h2>
<h3 id="git-tag-version">git-tag-version</h3>
@@ -73,5 +73,5 @@ after passed all test:</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-version &mdash; npm@2.11.3</p>
+<p id="footer">npm-version &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-view.html b/deps/npm/html/doc/cli/npm-view.html
index e0f48b675e9..4090da26735 100644
--- a/deps/npm/html/doc/cli/npm-view.html
+++ b/deps/npm/html/doc/cli/npm-view.html
@@ -82,5 +82,5 @@ the field name.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-view &mdash; npm@2.11.3</p>
+<p id="footer">npm-view &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm-whoami.html b/deps/npm/html/doc/cli/npm-whoami.html
index 9b451f148cc..c75b3d68893 100644
--- a/deps/npm/html/doc/cli/npm-whoami.html
+++ b/deps/npm/html/doc/cli/npm-whoami.html
@@ -33,5 +33,5 @@
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-whoami &mdash; npm@2.11.3</p>
+<p id="footer">npm-whoami &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/cli/npm.html b/deps/npm/html/doc/cli/npm.html
index 83fe67d5759..e46c314de57 100644
--- a/deps/npm/html/doc/cli/npm.html
+++ b/deps/npm/html/doc/cli/npm.html
@@ -13,7 +13,7 @@
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm &lt;command&gt; [args]
</code></pre><h2 id="version">VERSION</h2>
-<p>2.11.3</p>
+<p>2.12.1</p>
<h2 id="description">DESCRIPTION</h2>
<p>npm is the package manager for the Node JavaScript platform. It puts
modules in place so that node can find them, and manages dependency
@@ -110,7 +110,7 @@ easily by doing <code>npm view npm contributors</code>.</p>
the issues list or ask on the mailing list.</p>
<ul>
<li><a href="http://github.com/npm/npm/issues">http://github.com/npm/npm/issues</a></li>
-<li><a href="&#x6d;&#x61;&#x69;&#x6c;&#116;&#x6f;&#x3a;&#110;&#112;&#x6d;&#45;&#64;&#103;&#111;&#111;&#103;&#108;&#101;&#x67;&#x72;&#x6f;&#117;&#112;&#x73;&#46;&#x63;&#111;&#x6d;">&#110;&#112;&#x6d;&#45;&#64;&#103;&#111;&#111;&#103;&#108;&#101;&#x67;&#x72;&#x6f;&#117;&#112;&#x73;&#46;&#x63;&#111;&#x6d;</a></li>
+<li><a href="&#109;&#x61;&#x69;&#x6c;&#x74;&#111;&#x3a;&#x6e;&#112;&#109;&#x2d;&#64;&#x67;&#x6f;&#111;&#103;&#108;&#x65;&#x67;&#114;&#x6f;&#x75;&#112;&#115;&#x2e;&#99;&#111;&#109;">&#x6e;&#112;&#109;&#x2d;&#64;&#x67;&#x6f;&#111;&#103;&#108;&#x65;&#x67;&#114;&#x6f;&#x75;&#112;&#115;&#x2e;&#99;&#111;&#109;</a></li>
</ul>
<h2 id="bugs">BUGS</h2>
<p>When you find issues, please report them:</p>
@@ -118,7 +118,7 @@ the issues list or ask on the mailing list.</p>
<li>web:
<a href="http://github.com/npm/npm/issues">http://github.com/npm/npm/issues</a></li>
<li>email:
-<a href="&#109;&#x61;&#x69;&#x6c;&#116;&#111;&#x3a;&#x6e;&#112;&#109;&#45;&#x40;&#103;&#111;&#111;&#x67;&#108;&#101;&#103;&#x72;&#111;&#x75;&#112;&#x73;&#46;&#x63;&#111;&#109;">&#x6e;&#112;&#109;&#45;&#x40;&#103;&#111;&#111;&#x67;&#108;&#101;&#103;&#x72;&#111;&#x75;&#112;&#x73;&#46;&#x63;&#111;&#109;</a></li>
+<a href="&#109;&#97;&#x69;&#x6c;&#x74;&#x6f;&#58;&#110;&#112;&#x6d;&#x2d;&#64;&#103;&#x6f;&#x6f;&#103;&#108;&#x65;&#103;&#114;&#111;&#x75;&#112;&#x73;&#46;&#99;&#111;&#109;">&#110;&#112;&#x6d;&#x2d;&#64;&#103;&#x6f;&#x6f;&#103;&#108;&#x65;&#103;&#114;&#111;&#x75;&#112;&#x73;&#46;&#99;&#111;&#109;</a></li>
</ul>
<p>Be sure to include <em>all</em> of the output from the npm command that didn&#39;t work
as expected. The <code>npm-debug.log</code> file is also helpful to provide.</p>
@@ -128,7 +128,7 @@ will no doubt tell you to put the output in a gist or email.</p>
<p><a href="http://blog.izs.me/">Isaac Z. Schlueter</a> ::
<a href="https://github.com/isaacs/">isaacs</a> ::
<a href="http://twitter.com/izs">@izs</a> ::
-<a href="&#109;&#97;&#105;&#x6c;&#x74;&#111;&#x3a;&#105;&#x40;&#105;&#x7a;&#115;&#46;&#x6d;&#x65;">&#105;&#x40;&#105;&#x7a;&#115;&#46;&#x6d;&#x65;</a></p>
+<a href="&#109;&#97;&#x69;&#x6c;&#116;&#x6f;&#58;&#x69;&#x40;&#105;&#x7a;&#115;&#x2e;&#109;&#101;">&#x69;&#x40;&#105;&#x7a;&#115;&#x2e;&#109;&#101;</a></p>
<h2 id="see-also">SEE ALSO</h2>
<ul>
<li><a href="../cli/npm-help.html"><a href="../cli/npm-help.html">npm-help(1)</a></a></li>
@@ -154,5 +154,5 @@ will no doubt tell you to put the output in a gist or email.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm &mdash; npm@2.11.3</p>
+<p id="footer">npm &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/files/npm-folders.html b/deps/npm/html/doc/files/npm-folders.html
index db8b092111a..b7dfa4cced3 100644
--- a/deps/npm/html/doc/files/npm-folders.html
+++ b/deps/npm/html/doc/files/npm-folders.html
@@ -184,5 +184,5 @@ cannot be found elsewhere. See <code><a href="../files/package.json.html"><a hr
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-folders &mdash; npm@2.11.3</p>
+<p id="footer">npm-folders &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/files/npm-global.html b/deps/npm/html/doc/files/npm-global.html
index ddc76520145..48172f2987c 100644
--- a/deps/npm/html/doc/files/npm-global.html
+++ b/deps/npm/html/doc/files/npm-global.html
@@ -184,5 +184,5 @@ cannot be found elsewhere. See <code><a href="../files/package.json.html"><a hr
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-global &mdash; npm@2.11.3</p>
+<p id="footer">npm-global &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/files/npm-json.html b/deps/npm/html/doc/files/npm-json.html
index faf036a9816..460d90062f0 100644
--- a/deps/npm/html/doc/files/npm-json.html
+++ b/deps/npm/html/doc/files/npm-json.html
@@ -91,8 +91,8 @@ expression syntax version 2.0 string</a>, like this:</p>
<pre><code>{ &quot;license&quot; : &quot;(ISC OR GPL-3.0)&quot; }
</code></pre><p>If you are using a license that hasn&#39;t been assigned an SPDX identifier, or if
you are using a custom license, use the following valid SPDX expression:</p>
-<pre><code>{ &quot;license&quot; : &quot;LicenseRef-LICENSE&quot; }
-</code></pre><p>Then include a LICENSE file at the top level of the package.</p>
+<pre><code>{ &quot;license&quot; : &quot;SEE LICENSE IN &lt;filename&gt;&quot; }
+</code></pre><p>Then include a file named <code>&lt;filename&gt;</code> at the top level of the package.</p>
<p>Some old packages used license objects or a &quot;licenses&quot; property containing an
array of license objects:</p>
<pre><code>// Not valid metadata
@@ -117,7 +117,11 @@ array of license objects:</p>
<pre><code>{ &quot;license&quot;: &quot;ISC&quot; }
{ &quot;license&quot;: &quot;(MIT OR Apache-2.0)&quot; }
-</code></pre><h2 id="people-fields-author-contributors">people fields: author, contributors</h2>
+</code></pre><p>Finally, if you do not wish to grant others the right to use a private or
+unpublished package under any terms:</p>
+<pre><code>{ &quot;license&quot;: &quot;UNLICENSED&quot;}
+</code></pre><p>Consider also setting <code>&quot;private&quot;: true</code> to prevent accidental publication.</p>
+<h2 id="people-fields-author-contributors">people fields: author, contributors</h2>
<p>The &quot;author&quot; is one person. &quot;contributors&quot; is an array of people. A &quot;person&quot;
is an object with a &quot;name&quot; field and optionally &quot;url&quot; and &quot;email&quot;, like this:</p>
<pre><code>{ &quot;name&quot; : &quot;Barney Rubble&quot;
@@ -538,5 +542,5 @@ ignored.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-json &mdash; npm@2.11.3</p>
+<p id="footer">npm-json &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/files/npmrc.html b/deps/npm/html/doc/files/npmrc.html
index 38f5c86e3e9..5233d60efba 100644
--- a/deps/npm/html/doc/files/npmrc.html
+++ b/deps/npm/html/doc/files/npmrc.html
@@ -81,5 +81,5 @@ manner.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npmrc &mdash; npm@2.11.3</p>
+<p id="footer">npmrc &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/files/package.json.html b/deps/npm/html/doc/files/package.json.html
index 66651bd4e50..b8d9c487e87 100644
--- a/deps/npm/html/doc/files/package.json.html
+++ b/deps/npm/html/doc/files/package.json.html
@@ -91,8 +91,8 @@ expression syntax version 2.0 string</a>, like this:</p>
<pre><code>{ &quot;license&quot; : &quot;(ISC OR GPL-3.0)&quot; }
</code></pre><p>If you are using a license that hasn&#39;t been assigned an SPDX identifier, or if
you are using a custom license, use the following valid SPDX expression:</p>
-<pre><code>{ &quot;license&quot; : &quot;LicenseRef-LICENSE&quot; }
-</code></pre><p>Then include a LICENSE file at the top level of the package.</p>
+<pre><code>{ &quot;license&quot; : &quot;SEE LICENSE IN &lt;filename&gt;&quot; }
+</code></pre><p>Then include a file named <code>&lt;filename&gt;</code> at the top level of the package.</p>
<p>Some old packages used license objects or a &quot;licenses&quot; property containing an
array of license objects:</p>
<pre><code>// Not valid metadata
@@ -117,7 +117,11 @@ array of license objects:</p>
<pre><code>{ &quot;license&quot;: &quot;ISC&quot; }
{ &quot;license&quot;: &quot;(MIT OR Apache-2.0)&quot; }
-</code></pre><h2 id="people-fields-author-contributors">people fields: author, contributors</h2>
+</code></pre><p>Finally, if you do not wish to grant others the right to use a private or
+unpublished package under any terms:</p>
+<pre><code>{ &quot;license&quot;: &quot;UNLICENSED&quot;}
+</code></pre><p>Consider also setting <code>&quot;private&quot;: true</code> to prevent accidental publication.</p>
+<h2 id="people-fields-author-contributors">people fields: author, contributors</h2>
<p>The &quot;author&quot; is one person. &quot;contributors&quot; is an array of people. A &quot;person&quot;
is an object with a &quot;name&quot; field and optionally &quot;url&quot; and &quot;email&quot;, like this:</p>
<pre><code>{ &quot;name&quot; : &quot;Barney Rubble&quot;
@@ -538,5 +542,5 @@ ignored.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">package.json &mdash; npm@2.11.3</p>
+<p id="footer">package.json &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/index.html b/deps/npm/html/doc/index.html
index e45b852b5f9..12bbaa598b7 100644
--- a/deps/npm/html/doc/index.html
+++ b/deps/npm/html/doc/index.html
@@ -236,5 +236,5 @@
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">index &mdash; npm@2.11.3</p>
+<p id="footer">index &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/misc/npm-coding-style.html b/deps/npm/html/doc/misc/npm-coding-style.html
index c336977c58d..c79f9bbb2fa 100644
--- a/deps/npm/html/doc/misc/npm-coding-style.html
+++ b/deps/npm/html/doc/misc/npm-coding-style.html
@@ -147,5 +147,5 @@ set to anything.&quot;</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-coding-style &mdash; npm@2.11.3</p>
+<p id="footer">npm-coding-style &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/misc/npm-config.html b/deps/npm/html/doc/misc/npm-config.html
index baa0762f1bb..da29ee3f545 100644
--- a/deps/npm/html/doc/misc/npm-config.html
+++ b/deps/npm/html/doc/misc/npm-config.html
@@ -799,5 +799,5 @@ exit successfully.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-config &mdash; npm@2.11.3</p>
+<p id="footer">npm-config &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/misc/npm-developers.html b/deps/npm/html/doc/misc/npm-developers.html
index c3b26357b23..1c83216989a 100644
--- a/deps/npm/html/doc/misc/npm-developers.html
+++ b/deps/npm/html/doc/misc/npm-developers.html
@@ -189,5 +189,5 @@ from a fresh checkout.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-developers &mdash; npm@2.11.3</p>
+<p id="footer">npm-developers &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/misc/npm-disputes.html b/deps/npm/html/doc/misc/npm-disputes.html
index 797d3e6bce9..39f7c77ab9e 100644
--- a/deps/npm/html/doc/misc/npm-disputes.html
+++ b/deps/npm/html/doc/misc/npm-disputes.html
@@ -13,7 +13,7 @@
<h2 id="synopsis">SYNOPSIS</h2>
<ol>
<li>Get the author email with <code>npm owner ls &lt;pkgname&gt;</code></li>
-<li>Email the author, CC <a href="&#x6d;&#x61;&#x69;&#x6c;&#x74;&#x6f;&#58;&#115;&#117;&#x70;&#112;&#111;&#x72;&#116;&#64;&#x6e;&#x70;&#109;&#x6a;&#x73;&#x2e;&#x63;&#x6f;&#109;">&#115;&#117;&#x70;&#112;&#111;&#x72;&#116;&#64;&#x6e;&#x70;&#109;&#x6a;&#x73;&#x2e;&#x63;&#x6f;&#109;</a></li>
+<li>Email the author, CC <a href="&#x6d;&#x61;&#105;&#108;&#x74;&#111;&#58;&#115;&#117;&#112;&#112;&#x6f;&#x72;&#116;&#x40;&#110;&#112;&#x6d;&#x6a;&#115;&#46;&#x63;&#x6f;&#x6d;">&#115;&#117;&#112;&#112;&#x6f;&#x72;&#116;&#x40;&#110;&#112;&#x6d;&#x6a;&#115;&#46;&#x63;&#x6f;&#x6d;</a></li>
<li>After a few weeks, if there&#39;s no resolution, we&#39;ll sort it out.</li>
</ol>
<p>Don&#39;t squat on package names. Publish code or move out of the way.</p>
@@ -51,12 +51,12 @@ Joe&#39;s appropriate course of action in each case is the same.</p>
owner (Bob).</li>
<li>Joe emails Bob, explaining the situation <strong>as respectfully as
possible</strong>, and what he would like to do with the module name. He
-adds the npm support staff <a href="&#x6d;&#x61;&#105;&#108;&#116;&#x6f;&#58;&#x73;&#117;&#112;&#x70;&#111;&#114;&#116;&#x40;&#x6e;&#112;&#x6d;&#106;&#x73;&#x2e;&#99;&#111;&#109;">&#x73;&#117;&#112;&#x70;&#111;&#114;&#116;&#x40;&#x6e;&#112;&#x6d;&#106;&#x73;&#x2e;&#99;&#111;&#109;</a> to the CC list of
+adds the npm support staff <a href="&#109;&#97;&#x69;&#108;&#116;&#x6f;&#x3a;&#115;&#117;&#112;&#112;&#111;&#114;&#x74;&#64;&#x6e;&#x70;&#109;&#106;&#x73;&#46;&#x63;&#x6f;&#x6d;">&#115;&#117;&#112;&#112;&#111;&#114;&#x74;&#64;&#x6e;&#x70;&#109;&#106;&#x73;&#46;&#x63;&#x6f;&#x6d;</a> to the CC list of
the email. Mention in the email that Bob can run <code>npm owner add
joe foo</code> to add Joe as an owner of the <code>foo</code> package.</li>
<li>After a reasonable amount of time, if Bob has not responded, or if
Bob and Joe can&#39;t come to any sort of resolution, email support
-<a href="&#109;&#x61;&#105;&#108;&#116;&#x6f;&#x3a;&#x73;&#x75;&#x70;&#x70;&#x6f;&#x72;&#116;&#64;&#110;&#112;&#109;&#x6a;&#x73;&#x2e;&#x63;&#111;&#x6d;">&#x73;&#x75;&#x70;&#x70;&#x6f;&#x72;&#116;&#64;&#110;&#112;&#109;&#x6a;&#x73;&#x2e;&#x63;&#111;&#x6d;</a> and we&#39;ll sort it out. (&quot;Reasonable&quot; is
+<a href="&#109;&#x61;&#x69;&#108;&#x74;&#111;&#58;&#115;&#x75;&#x70;&#112;&#111;&#114;&#116;&#64;&#110;&#x70;&#x6d;&#x6a;&#115;&#46;&#x63;&#111;&#x6d;">&#115;&#x75;&#x70;&#112;&#111;&#114;&#116;&#64;&#110;&#x70;&#x6d;&#x6a;&#115;&#46;&#x63;&#111;&#x6d;</a> and we&#39;ll sort it out. (&quot;Reasonable&quot; is
usually at least 4 weeks, but extra time is allowed around common
holidays.)</li>
</ol>
@@ -112,5 +112,5 @@ things into it.</li>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-disputes &mdash; npm@2.11.3</p>
+<p id="footer">npm-disputes &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/misc/npm-faq.html b/deps/npm/html/doc/misc/npm-faq.html
index 01ef2c2d42f..6d004eb5b7f 100644
--- a/deps/npm/html/doc/misc/npm-faq.html
+++ b/deps/npm/html/doc/misc/npm-faq.html
@@ -236,7 +236,7 @@ that has a package.json in its root, or a git url.
<p>To check if the registry is down, open up
<a href="https://registry.npmjs.org/">https://registry.npmjs.org/</a> in a web browser. This will also tell
you if you are just unable to access the internet for some reason.</p>
-<p>If the registry IS down, let us know by emailing <a href="&#109;&#97;&#x69;&#x6c;&#x74;&#x6f;&#x3a;&#x73;&#x75;&#112;&#112;&#111;&#114;&#116;&#64;&#x6e;&#112;&#x6d;&#x6a;&#x73;&#46;&#99;&#111;&#x6d;">&#x73;&#x75;&#112;&#112;&#111;&#114;&#116;&#64;&#x6e;&#112;&#x6d;&#x6a;&#x73;&#46;&#99;&#111;&#x6d;</a>
+<p>If the registry IS down, let us know by emailing <a href="&#109;&#x61;&#x69;&#108;&#116;&#111;&#x3a;&#115;&#x75;&#x70;&#112;&#x6f;&#x72;&#x74;&#64;&#110;&#112;&#x6d;&#106;&#x73;&#x2e;&#x63;&#x6f;&#109;">&#115;&#x75;&#x70;&#112;&#x6f;&#x72;&#x74;&#64;&#110;&#112;&#x6d;&#106;&#x73;&#x2e;&#x63;&#x6f;&#109;</a>
or posting an issue at <a href="https://github.com/npm/npm/issues">https://github.com/npm/npm/issues</a>. If it&#39;s
down for the world (and not just on your local network) then we&#39;re
probably already being pinged about it.</p>
@@ -307,5 +307,5 @@ good folks at <a href="http://www.npmjs.com">npm, Inc.</a></p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-faq &mdash; npm@2.11.3</p>
+<p id="footer">npm-faq &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/misc/npm-index.html b/deps/npm/html/doc/misc/npm-index.html
index 18d73b0abbb..d32d85a2430 100644
--- a/deps/npm/html/doc/misc/npm-index.html
+++ b/deps/npm/html/doc/misc/npm-index.html
@@ -236,5 +236,5 @@
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-index &mdash; npm@2.11.3</p>
+<p id="footer">npm-index &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/misc/npm-registry.html b/deps/npm/html/doc/misc/npm-registry.html
index 23c36db63c6..82beb74bc67 100644
--- a/deps/npm/html/doc/misc/npm-registry.html
+++ b/deps/npm/html/doc/misc/npm-registry.html
@@ -70,5 +70,5 @@ effectively implement the entire CouchDB API anyway.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-registry &mdash; npm@2.11.3</p>
+<p id="footer">npm-registry &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/misc/npm-scope.html b/deps/npm/html/doc/misc/npm-scope.html
index 027e64ed948..61521e3d362 100644
--- a/deps/npm/html/doc/misc/npm-scope.html
+++ b/deps/npm/html/doc/misc/npm-scope.html
@@ -91,5 +91,5 @@ that registry instead.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-scope &mdash; npm@2.11.3</p>
+<p id="footer">npm-scope &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/misc/npm-scripts.html b/deps/npm/html/doc/misc/npm-scripts.html
index 982c219fea6..3c1eaa80e56 100644
--- a/deps/npm/html/doc/misc/npm-scripts.html
+++ b/deps/npm/html/doc/misc/npm-scripts.html
@@ -207,5 +207,5 @@ scripts is for compilation which must be done on the target architecture.</li>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">npm-scripts &mdash; npm@2.11.3</p>
+<p id="footer">npm-scripts &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/misc/removing-npm.html b/deps/npm/html/doc/misc/removing-npm.html
index 37253651bb5..2d088b0ca3d 100644
--- a/deps/npm/html/doc/misc/removing-npm.html
+++ b/deps/npm/html/doc/misc/removing-npm.html
@@ -57,5 +57,5 @@ modules. To track those down, you can do the following:</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">removing-npm &mdash; npm@2.11.3</p>
+<p id="footer">removing-npm &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/doc/misc/semver.html b/deps/npm/html/doc/misc/semver.html
index bf227e4834a..7a41012044e 100644
--- a/deps/npm/html/doc/misc/semver.html
+++ b/deps/npm/html/doc/misc/semver.html
@@ -282,5 +282,5 @@ range, use the <code>satisfies(version, range)</code> function.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
-<p id="footer">semver &mdash; npm@2.11.3</p>
+<p id="footer">semver &mdash; npm@2.12.1</p>
diff --git a/deps/npm/html/partial/doc/README.html b/deps/npm/html/partial/doc/README.html
index 7db20d8965a..f64b9a1d9a5 100644
--- a/deps/npm/html/partial/doc/README.html
+++ b/deps/npm/html/partial/doc/README.html
@@ -129,7 +129,7 @@ specific purpose, or lack of malice in any given npm package.</p>
<p>If you have a complaint about a package in the public npm registry,
and cannot <a href="https://docs.npmjs.com/misc/disputes">resolve it with the package
owner</a>, please email
-<a href="&#109;&#97;&#x69;&#x6c;&#116;&#111;&#58;&#115;&#x75;&#112;&#x70;&#x6f;&#114;&#116;&#64;&#110;&#x70;&#109;&#106;&#115;&#x2e;&#x63;&#111;&#x6d;">&#115;&#x75;&#112;&#x70;&#x6f;&#114;&#116;&#64;&#110;&#x70;&#109;&#106;&#115;&#x2e;&#x63;&#111;&#x6d;</a> and explain the situation.</p>
+<a href="&#109;&#x61;&#105;&#x6c;&#116;&#x6f;&#x3a;&#x73;&#x75;&#112;&#x70;&#x6f;&#114;&#x74;&#x40;&#x6e;&#x70;&#x6d;&#x6a;&#x73;&#x2e;&#x63;&#111;&#x6d;">&#x73;&#x75;&#112;&#x70;&#x6f;&#114;&#x74;&#x40;&#x6e;&#x70;&#x6d;&#x6a;&#x73;&#x2e;&#x63;&#111;&#x6d;</a> and explain the situation.</p>
<p>Any data published to The npm Registry (including user account
information) may be removed or modified at the sole discretion of the
npm server administrators.</p>
diff --git a/deps/npm/html/partial/doc/api/npm-ping.html b/deps/npm/html/partial/doc/api/npm-ping.html
new file mode 100644
index 00000000000..ac8a29e185c
--- /dev/null
+++ b/deps/npm/html/partial/doc/api/npm-ping.html
@@ -0,0 +1,8 @@
+<h1><a href="../api/npm-ping.html">npm-ping</a></h1> <p>Ping npm registry</p>
+<h2 id="synopsis">SYNOPSIS</h2>
+<pre><code>npm.registry.ping(registry, options, function (er, pong))
+</code></pre><h2 id="description">DESCRIPTION</h2>
+<p>Attempts to connect to the given registry, returning a <code>pong</code>
+object with various metadata if it succeeds.</p>
+<p>This function is primarily useful for debugging connection issues
+to npm registries.</p>
diff --git a/deps/npm/html/partial/doc/api/npm-submodule.html b/deps/npm/html/partial/doc/api/npm-submodule.html
deleted file mode 100644
index cc7dd822ada..00000000000
--- a/deps/npm/html/partial/doc/api/npm-submodule.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<h1><a href="../api/npm-submodule.html">npm-submodule</a></h1> <p>Add a package as a git submodule</p>
-<h2 id="synopsis">SYNOPSIS</h2>
-<pre><code>npm.commands.submodule(packages, callback)
-</code></pre><h2 id="description">DESCRIPTION</h2>
-<p>For each package specified, npm will check if it has a git repository url
-in its package.json description then add it as a git submodule at
-<code>node_modules/&lt;pkg name&gt;</code>.</p>
-<p>This is a convenience only. From then on, it&#39;s up to you to manage
-updates by using the appropriate git commands. npm will stubbornly
-refuse to update, modify, or remove anything with a <code>.git</code> subfolder
-in it.</p>
-<p>This command also does not install missing dependencies, if the package
-does not include them in its git repository. If <code>npm ls</code> reports that
-things are missing, you can either install, link, or submodule them yourself,
-or you can do <code>npm explore &lt;pkgname&gt; -- npm install</code> to install the
-dependencies into the submodule folder.</p>
-<h2 id="see-also">SEE ALSO</h2>
-<ul>
-<li>npm help json</li>
-<li>git help submodule</li>
-</ul>
diff --git a/deps/npm/html/partial/doc/api/npm.html b/deps/npm/html/partial/doc/api/npm.html
index 8e9de746a14..a1bb5c84874 100644
--- a/deps/npm/html/partial/doc/api/npm.html
+++ b/deps/npm/html/partial/doc/api/npm.html
@@ -12,7 +12,7 @@ npm.load([configObject, ]function (er, npm) {
npm.commands.install([&quot;package&quot;], cb)
})
</code></pre><h2 id="version">VERSION</h2>
-<p>2.11.3</p>
+<p>2.12.1</p>
<h2 id="description">DESCRIPTION</h2>
<p>This is the API documentation for npm.
To find documentation of the command line
diff --git a/deps/npm/html/partial/doc/cli/npm-install.html b/deps/npm/html/partial/doc/cli/npm-install.html
index 1f6aef82499..98dadcc9135 100644
--- a/deps/npm/html/partial/doc/cli/npm-install.html
+++ b/deps/npm/html/partial/doc/cli/npm-install.html
@@ -127,11 +127,24 @@ fetch the package by name if it is not valid.
</code></pre><p> <code>&lt;protocol&gt;</code> is one of <code>git</code>, <code>git+ssh</code>, <code>git+http</code>, or
<code>git+https</code>. If no <code>&lt;commit-ish&gt;</code> is specified, then <code>master</code> is
used.</p>
-<p> Examples:</p>
-<pre><code> git+ssh://git@github.com:npm/npm.git#v1.0.27
- git+https://isaacs@github.com/npm/npm.git
- git://github.com/npm/npm.git#v1.0.27
+<p> The following git environment variables are recognized by npm and will be added
+ to the environment when running git:</p>
+<ul>
+<li><code>GIT_ASKPASS</code></li>
+<li><code>GIT_PROXY_COMMAND</code></li>
+<li><code>GIT_SSH</code></li>
+<li><code>GIT_SSH_COMMAND</code></li>
+<li><code>GIT_SSL_CAINFO</code></li>
+<li><p><code>GIT_SSL_NO_VERIFY</code></p>
+<p>See the git man page for details.</p>
+<p>Examples:</p>
+<pre><code>npm install git+ssh://git@github.com:npm/npm.git#v1.0.27
+npm install git+https://isaacs@github.com/npm/npm.git
+npm install git://github.com/npm/npm.git#v1.0.27
+GIT_SSH_COMMAND=&#39;ssh -i ~/.ssh/custom_ident&#39; npm install git+ssh://git@github.com:npm/npm.git
</code></pre></li>
+</ul>
+</li>
<li><p><code>npm install &lt;githubname&gt;/&lt;githubrepo&gt;[#&lt;commit-ish&gt;]</code>:</p>
</li>
<li><p><code>npm install github:&lt;githubname&gt;/&lt;githubrepo&gt;[#&lt;commit-ish&gt;]</code>:</p>
diff --git a/deps/npm/html/partial/doc/cli/npm-ls.html b/deps/npm/html/partial/doc/cli/npm-ls.html
index f240024f22f..764efd448f8 100644
--- a/deps/npm/html/partial/doc/cli/npm-ls.html
+++ b/deps/npm/html/partial/doc/cli/npm-ls.html
@@ -11,7 +11,7 @@ installed, as well as their dependencies, in a tree-structure.</p>
limit the results to only the paths to the packages named. Note that
nested packages will <em>also</em> show the paths to the specified packages.
For example, running <code>npm ls promzard</code> in npm&#39;s source tree will show:</p>
-<pre><code>npm@2.11.3 /path/to/npm
+<pre><code>npm@2.12.1 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5
</code></pre><p>It will print out extraneous, missing, and invalid packages.</p>
diff --git a/deps/npm/html/partial/doc/cli/npm-ping.html b/deps/npm/html/partial/doc/cli/npm-ping.html
new file mode 100644
index 00000000000..c71423d5eee
--- /dev/null
+++ b/deps/npm/html/partial/doc/cli/npm-ping.html
@@ -0,0 +1,11 @@
+<h1><a href="../cli/npm-ping.html">npm-ping</a></h1> <p>Ping npm registry</p>
+<h2 id="synopsis">SYNOPSIS</h2>
+<pre><code>npm ping [--registry &lt;registry&gt;]
+</code></pre><h2 id="description">DESCRIPTION</h2>
+<p>Ping the configured or given npm registry and verify authentication.</p>
+<h2 id="see-also">SEE ALSO</h2>
+<ul>
+<li><a href="../cli/npm-config.html">npm-config(1)</a></li>
+<li><a href="../misc/npm-config.html">npm-config(7)</a></li>
+<li><a href="../files/npmrc.html">npmrc(5)</a></li>
+</ul>
diff --git a/deps/npm/html/partial/doc/cli/npm-submodule.html b/deps/npm/html/partial/doc/cli/npm-submodule.html
deleted file mode 100644
index dd7c7e8878e..00000000000
--- a/deps/npm/html/partial/doc/cli/npm-submodule.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<h1><a href="../cli/npm-submodule.html">npm-submodule</a></h1> <p>Add a package as a git submodule</p>
-<h2 id="synopsis">SYNOPSIS</h2>
-<pre><code>npm submodule &lt;pkg&gt;
-</code></pre><h2 id="description">DESCRIPTION</h2>
-<p>If the specified package has a git repository url in its package.json
-description, then this command will add it as a git submodule at
-<code>node_modules/&lt;pkg name&gt;</code>.</p>
-<p>This is a convenience only. From then on, it&#39;s up to you to manage
-updates by using the appropriate git commands. npm will stubbornly
-refuse to update, modify, or remove anything with a <code>.git</code> subfolder
-in it.</p>
-<p>This command also does not install missing dependencies, if the package
-does not include them in its git repository. If <code>npm ls</code> reports that
-things are missing, you can either install, link, or submodule them yourself,
-or you can do <code>npm explore &lt;pkgname&gt; -- npm install</code> to install the
-dependencies into the submodule folder.</p>
-<h2 id="see-also">SEE ALSO</h2>
-<ul>
-<li><a href="../files/package.json.html">package.json(5)</a></li>
-<li>git help submodule</li>
-</ul>
diff --git a/deps/npm/html/partial/doc/cli/npm-version.html b/deps/npm/html/partial/doc/cli/npm-version.html
index 515f19a6dea..ba4ac5a7b09 100644
--- a/deps/npm/html/partial/doc/cli/npm-version.html
+++ b/deps/npm/html/partial/doc/cli/npm-version.html
@@ -5,8 +5,8 @@
<p>Run this in a package directory to bump the version and write the new
data back to <code>package.json</code> and, if present, <code>npm-shrinkwrap.json</code>.</p>
<p>The <code>newversion</code> argument should be a valid semver string, <em>or</em> a
-valid second argument to semver.inc (one of &quot;patch&quot;, &quot;minor&quot;, &quot;major&quot;,
-&quot;prepatch&quot;, &quot;preminor&quot;, &quot;premajor&quot;, &quot;prerelease&quot;). In the second case,
+valid second argument to semver.inc (one of <code>patch</code>, <code>minor</code>, <code>major</code>,
+<code>prepatch</code>, <code>preminor</code>, <code>premajor</code>, <code>prerelease</code>). In the second case,
the existing version will be incremented by 1 in the specified field.</p>
<p>If run in a git repo, it will also create a version commit and tag, and fail if
the repo is not clean. This behavior is controlled by <code>git-tag-version</code> (see
@@ -28,11 +28,11 @@ user: &quot;isaacs (http://blog.izs.me/) &lt;i@izs.me&gt;&quot;
2048-bit RSA key, ID 6C481CF6, created 2010-08-31
Enter passphrase:
-</code></pre><p>If &quot;preversion&quot;, &quot;version&quot;, &quot;postversion&quot; in the &quot;scripts&quot; property of
-the package.json, it will execute by running <code>npm version</code>. preversion
-and version ware executed before bump the package version, postversion
-was executed after bump the package version. For example to run <code>npm version</code>
-after passed all test:</p>
+</code></pre><p>If <code>preversion</code>, <code>version</code>, or <code>postversion</code> are in the <code>scripts</code> property of
+the package.json, they will be executed as part of running <code>npm version</code>.
+<code>preversion</code> and <code>version</code> are executed before bumping the package version, and
+<code>postversion</code> is executed afterwards. For example, to run <code>npm version</code> only if
+all tests pass:</p>
<pre><code>&quot;scripts&quot;: { &quot;preversion&quot;: &quot;npm test&quot; }
</code></pre><h2 id="configuration">CONFIGURATION</h2>
<h3 id="git-tag-version">git-tag-version</h3>
diff --git a/deps/npm/html/partial/doc/cli/npm.html b/deps/npm/html/partial/doc/cli/npm.html
index b09a9846790..87ef252b9b8 100644
--- a/deps/npm/html/partial/doc/cli/npm.html
+++ b/deps/npm/html/partial/doc/cli/npm.html
@@ -2,7 +2,7 @@
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm &lt;command&gt; [args]
</code></pre><h2 id="version">VERSION</h2>
-<p>2.11.3</p>
+<p>2.12.1</p>
<h2 id="description">DESCRIPTION</h2>
<p>npm is the package manager for the Node JavaScript platform. It puts
modules in place so that node can find them, and manages dependency
@@ -99,7 +99,7 @@ easily by doing <code>npm view npm contributors</code>.</p>
the issues list or ask on the mailing list.</p>
<ul>
<li><a href="http://github.com/npm/npm/issues">http://github.com/npm/npm/issues</a></li>
-<li><a href="&#x6d;&#x61;&#x69;&#x6c;&#116;&#x6f;&#x3a;&#110;&#112;&#x6d;&#45;&#64;&#103;&#111;&#111;&#103;&#108;&#101;&#x67;&#x72;&#x6f;&#117;&#112;&#x73;&#46;&#x63;&#111;&#x6d;">&#110;&#112;&#x6d;&#45;&#64;&#103;&#111;&#111;&#103;&#108;&#101;&#x67;&#x72;&#x6f;&#117;&#112;&#x73;&#46;&#x63;&#111;&#x6d;</a></li>
+<li><a href="&#109;&#x61;&#x69;&#x6c;&#x74;&#111;&#x3a;&#x6e;&#112;&#109;&#x2d;&#64;&#x67;&#x6f;&#111;&#103;&#108;&#x65;&#x67;&#114;&#x6f;&#x75;&#112;&#115;&#x2e;&#99;&#111;&#109;">&#x6e;&#112;&#109;&#x2d;&#64;&#x67;&#x6f;&#111;&#103;&#108;&#x65;&#x67;&#114;&#x6f;&#x75;&#112;&#115;&#x2e;&#99;&#111;&#109;</a></li>
</ul>
<h2 id="bugs">BUGS</h2>
<p>When you find issues, please report them:</p>
@@ -107,7 +107,7 @@ the issues list or ask on the mailing list.</p>
<li>web:
<a href="http://github.com/npm/npm/issues">http://github.com/npm/npm/issues</a></li>
<li>email:
-<a href="&#109;&#x61;&#x69;&#x6c;&#116;&#111;&#x3a;&#x6e;&#112;&#109;&#45;&#x40;&#103;&#111;&#111;&#x67;&#108;&#101;&#103;&#x72;&#111;&#x75;&#112;&#x73;&#46;&#x63;&#111;&#109;">&#x6e;&#112;&#109;&#45;&#x40;&#103;&#111;&#111;&#x67;&#108;&#101;&#103;&#x72;&#111;&#x75;&#112;&#x73;&#46;&#x63;&#111;&#109;</a></li>
+<a href="&#109;&#97;&#x69;&#x6c;&#x74;&#x6f;&#58;&#110;&#112;&#x6d;&#x2d;&#64;&#103;&#x6f;&#x6f;&#103;&#108;&#x65;&#103;&#114;&#111;&#x75;&#112;&#x73;&#46;&#99;&#111;&#109;">&#110;&#112;&#x6d;&#x2d;&#64;&#103;&#x6f;&#x6f;&#103;&#108;&#x65;&#103;&#114;&#111;&#x75;&#112;&#x73;&#46;&#99;&#111;&#109;</a></li>
</ul>
<p>Be sure to include <em>all</em> of the output from the npm command that didn&#39;t work
as expected. The <code>npm-debug.log</code> file is also helpful to provide.</p>
@@ -117,7 +117,7 @@ will no doubt tell you to put the output in a gist or email.</p>
<p><a href="http://blog.izs.me/">Isaac Z. Schlueter</a> ::
<a href="https://github.com/isaacs/">isaacs</a> ::
<a href="http://twitter.com/izs">@izs</a> ::
-<a href="&#109;&#97;&#105;&#x6c;&#x74;&#111;&#x3a;&#105;&#x40;&#105;&#x7a;&#115;&#46;&#x6d;&#x65;">&#105;&#x40;&#105;&#x7a;&#115;&#46;&#x6d;&#x65;</a></p>
+<a href="&#109;&#97;&#x69;&#x6c;&#116;&#x6f;&#58;&#x69;&#x40;&#105;&#x7a;&#115;&#x2e;&#109;&#101;">&#x69;&#x40;&#105;&#x7a;&#115;&#x2e;&#109;&#101;</a></p>
<h2 id="see-also">SEE ALSO</h2>
<ul>
<li><a href="../cli/npm-help.html">npm-help(1)</a></li>
diff --git a/deps/npm/html/partial/doc/files/npm-json.html b/deps/npm/html/partial/doc/files/npm-json.html
index 752a10cbe5c..7de449e6563 100644
--- a/deps/npm/html/partial/doc/files/npm-json.html
+++ b/deps/npm/html/partial/doc/files/npm-json.html
@@ -80,8 +80,8 @@ expression syntax version 2.0 string</a>, like this:</p>
<pre><code>{ &quot;license&quot; : &quot;(ISC OR GPL-3.0)&quot; }
</code></pre><p>If you are using a license that hasn&#39;t been assigned an SPDX identifier, or if
you are using a custom license, use the following valid SPDX expression:</p>
-<pre><code>{ &quot;license&quot; : &quot;LicenseRef-LICENSE&quot; }
-</code></pre><p>Then include a LICENSE file at the top level of the package.</p>
+<pre><code>{ &quot;license&quot; : &quot;SEE LICENSE IN &lt;filename&gt;&quot; }
+</code></pre><p>Then include a file named <code>&lt;filename&gt;</code> at the top level of the package.</p>
<p>Some old packages used license objects or a &quot;licenses&quot; property containing an
array of license objects:</p>
<pre><code>// Not valid metadata
@@ -106,7 +106,11 @@ array of license objects:</p>
<pre><code>{ &quot;license&quot;: &quot;ISC&quot; }
{ &quot;license&quot;: &quot;(MIT OR Apache-2.0)&quot; }
-</code></pre><h2 id="people-fields-author-contributors">people fields: author, contributors</h2>
+</code></pre><p>Finally, if you do not wish to grant others the right to use a private or
+unpublished package under any terms:</p>
+<pre><code>{ &quot;license&quot;: &quot;UNLICENSED&quot;}
+</code></pre><p>Consider also setting <code>&quot;private&quot;: true</code> to prevent accidental publication.</p>
+<h2 id="people-fields-author-contributors">people fields: author, contributors</h2>
<p>The &quot;author&quot; is one person. &quot;contributors&quot; is an array of people. A &quot;person&quot;
is an object with a &quot;name&quot; field and optionally &quot;url&quot; and &quot;email&quot;, like this:</p>
<pre><code>{ &quot;name&quot; : &quot;Barney Rubble&quot;
diff --git a/deps/npm/html/partial/doc/files/package.json.html b/deps/npm/html/partial/doc/files/package.json.html
index 752a10cbe5c..7de449e6563 100644
--- a/deps/npm/html/partial/doc/files/package.json.html
+++ b/deps/npm/html/partial/doc/files/package.json.html
@@ -80,8 +80,8 @@ expression syntax version 2.0 string</a>, like this:</p>
<pre><code>{ &quot;license&quot; : &quot;(ISC OR GPL-3.0)&quot; }
</code></pre><p>If you are using a license that hasn&#39;t been assigned an SPDX identifier, or if
you are using a custom license, use the following valid SPDX expression:</p>
-<pre><code>{ &quot;license&quot; : &quot;LicenseRef-LICENSE&quot; }
-</code></pre><p>Then include a LICENSE file at the top level of the package.</p>
+<pre><code>{ &quot;license&quot; : &quot;SEE LICENSE IN &lt;filename&gt;&quot; }
+</code></pre><p>Then include a file named <code>&lt;filename&gt;</code> at the top level of the package.</p>
<p>Some old packages used license objects or a &quot;licenses&quot; property containing an
array of license objects:</p>
<pre><code>// Not valid metadata
@@ -106,7 +106,11 @@ array of license objects:</p>
<pre><code>{ &quot;license&quot;: &quot;ISC&quot; }
{ &quot;license&quot;: &quot;(MIT OR Apache-2.0)&quot; }
-</code></pre><h2 id="people-fields-author-contributors">people fields: author, contributors</h2>
+</code></pre><p>Finally, if you do not wish to grant others the right to use a private or
+unpublished package under any terms:</p>
+<pre><code>{ &quot;license&quot;: &quot;UNLICENSED&quot;}
+</code></pre><p>Consider also setting <code>&quot;private&quot;: true</code> to prevent accidental publication.</p>
+<h2 id="people-fields-author-contributors">people fields: author, contributors</h2>
<p>The &quot;author&quot; is one person. &quot;contributors&quot; is an array of people. A &quot;person&quot;
is an object with a &quot;name&quot; field and optionally &quot;url&quot; and &quot;email&quot;, like this:</p>
<pre><code>{ &quot;name&quot; : &quot;Barney Rubble&quot;
diff --git a/deps/npm/html/partial/doc/misc/npm-disputes.html b/deps/npm/html/partial/doc/misc/npm-disputes.html
index ee9992f7702..ff652858195 100644
--- a/deps/npm/html/partial/doc/misc/npm-disputes.html
+++ b/deps/npm/html/partial/doc/misc/npm-disputes.html
@@ -2,7 +2,7 @@
<h2 id="synopsis">SYNOPSIS</h2>
<ol>
<li>Get the author email with <code>npm owner ls &lt;pkgname&gt;</code></li>
-<li>Email the author, CC <a href="&#x6d;&#x61;&#x69;&#x6c;&#x74;&#x6f;&#58;&#115;&#117;&#x70;&#112;&#111;&#x72;&#116;&#64;&#x6e;&#x70;&#109;&#x6a;&#x73;&#x2e;&#x63;&#x6f;&#109;">&#115;&#117;&#x70;&#112;&#111;&#x72;&#116;&#64;&#x6e;&#x70;&#109;&#x6a;&#x73;&#x2e;&#x63;&#x6f;&#109;</a></li>
+<li>Email the author, CC <a href="&#x6d;&#x61;&#105;&#108;&#x74;&#111;&#58;&#115;&#117;&#112;&#112;&#x6f;&#x72;&#116;&#x40;&#110;&#112;&#x6d;&#x6a;&#115;&#46;&#x63;&#x6f;&#x6d;">&#115;&#117;&#112;&#112;&#x6f;&#x72;&#116;&#x40;&#110;&#112;&#x6d;&#x6a;&#115;&#46;&#x63;&#x6f;&#x6d;</a></li>
<li>After a few weeks, if there&#39;s no resolution, we&#39;ll sort it out.</li>
</ol>
<p>Don&#39;t squat on package names. Publish code or move out of the way.</p>
@@ -40,12 +40,12 @@ Joe&#39;s appropriate course of action in each case is the same.</p>
owner (Bob).</li>
<li>Joe emails Bob, explaining the situation <strong>as respectfully as
possible</strong>, and what he would like to do with the module name. He
-adds the npm support staff <a href="&#x6d;&#x61;&#105;&#108;&#116;&#x6f;&#58;&#x73;&#117;&#112;&#x70;&#111;&#114;&#116;&#x40;&#x6e;&#112;&#x6d;&#106;&#x73;&#x2e;&#99;&#111;&#109;">&#x73;&#117;&#112;&#x70;&#111;&#114;&#116;&#x40;&#x6e;&#112;&#x6d;&#106;&#x73;&#x2e;&#99;&#111;&#109;</a> to the CC list of
+adds the npm support staff <a href="&#109;&#97;&#x69;&#108;&#116;&#x6f;&#x3a;&#115;&#117;&#112;&#112;&#111;&#114;&#x74;&#64;&#x6e;&#x70;&#109;&#106;&#x73;&#46;&#x63;&#x6f;&#x6d;">&#115;&#117;&#112;&#112;&#111;&#114;&#x74;&#64;&#x6e;&#x70;&#109;&#106;&#x73;&#46;&#x63;&#x6f;&#x6d;</a> to the CC list of
the email. Mention in the email that Bob can run <code>npm owner add
joe foo</code> to add Joe as an owner of the <code>foo</code> package.</li>
<li>After a reasonable amount of time, if Bob has not responded, or if
Bob and Joe can&#39;t come to any sort of resolution, email support
-<a href="&#109;&#x61;&#105;&#108;&#116;&#x6f;&#x3a;&#x73;&#x75;&#x70;&#x70;&#x6f;&#x72;&#116;&#64;&#110;&#112;&#109;&#x6a;&#x73;&#x2e;&#x63;&#111;&#x6d;">&#x73;&#x75;&#x70;&#x70;&#x6f;&#x72;&#116;&#64;&#110;&#112;&#109;&#x6a;&#x73;&#x2e;&#x63;&#111;&#x6d;</a> and we&#39;ll sort it out. (&quot;Reasonable&quot; is
+<a href="&#109;&#x61;&#x69;&#108;&#x74;&#111;&#58;&#115;&#x75;&#x70;&#112;&#111;&#114;&#116;&#64;&#110;&#x70;&#x6d;&#x6a;&#115;&#46;&#x63;&#111;&#x6d;">&#115;&#x75;&#x70;&#112;&#111;&#114;&#116;&#64;&#110;&#x70;&#x6d;&#x6a;&#115;&#46;&#x63;&#111;&#x6d;</a> and we&#39;ll sort it out. (&quot;Reasonable&quot; is
usually at least 4 weeks, but extra time is allowed around common
holidays.)</li>
</ol>
diff --git a/deps/npm/html/partial/doc/misc/npm-faq.html b/deps/npm/html/partial/doc/misc/npm-faq.html
index 448ef469483..5452d1731a3 100644
--- a/deps/npm/html/partial/doc/misc/npm-faq.html
+++ b/deps/npm/html/partial/doc/misc/npm-faq.html
@@ -225,7 +225,7 @@ that has a package.json in its root, or a git url.
<p>To check if the registry is down, open up
<a href="https://registry.npmjs.org/">https://registry.npmjs.org/</a> in a web browser. This will also tell
you if you are just unable to access the internet for some reason.</p>
-<p>If the registry IS down, let us know by emailing <a href="&#109;&#97;&#x69;&#x6c;&#x74;&#x6f;&#x3a;&#x73;&#x75;&#112;&#112;&#111;&#114;&#116;&#64;&#x6e;&#112;&#x6d;&#x6a;&#x73;&#46;&#99;&#111;&#x6d;">&#x73;&#x75;&#112;&#112;&#111;&#114;&#116;&#64;&#x6e;&#112;&#x6d;&#x6a;&#x73;&#46;&#99;&#111;&#x6d;</a>
+<p>If the registry IS down, let us know by emailing <a href="&#109;&#x61;&#x69;&#108;&#116;&#111;&#x3a;&#115;&#x75;&#x70;&#112;&#x6f;&#x72;&#x74;&#64;&#110;&#112;&#x6d;&#106;&#x73;&#x2e;&#x63;&#x6f;&#109;">&#115;&#x75;&#x70;&#112;&#x6f;&#x72;&#x74;&#64;&#110;&#112;&#x6d;&#106;&#x73;&#x2e;&#x63;&#x6f;&#109;</a>
or posting an issue at <a href="https://github.com/npm/npm/issues">https://github.com/npm/npm/issues</a>. If it&#39;s
down for the world (and not just on your local network) then we&#39;re
probably already being pinged about it.</p>
diff --git a/deps/npm/lib/cache/add-remote-git.js b/deps/npm/lib/cache/add-remote-git.js
index dc40cb3b64c..d3ecccdce9a 100644
--- a/deps/npm/lib/cache/add-remote-git.js
+++ b/deps/npm/lib/cache/add-remote-git.js
@@ -15,7 +15,7 @@ var npa = require('npm-package-arg')
var realizePackageSpecifier = require('realize-package-specifier')
var addLocal = require('./add-local.js')
-var getCacheStat = require('./get-stat.js')
+var correctMkdir = require('../utils/correct-mkdir.js')
var git = require('../utils/git.js')
var npm = require('../npm.js')
var rm = require('../utils/gently-rm.js')
@@ -380,7 +380,7 @@ function checkoutTreeish (from, resolvedURL, resolvedTreeish, tmpdir, cb) {
}
function getGitDir (cb) {
- getCacheStat(function (er, stats) {
+ correctMkdir(remotes, function (er, stats) {
if (er) return cb(er)
// We don't need global templates when cloning. Use an empty directory for
@@ -391,11 +391,7 @@ function getGitDir (cb) {
// Ensure that both the template and remotes directories have the correct
// permissions.
fs.chown(templates, stats.uid, stats.gid, function (er) {
- if (er) return cb(er)
-
- fs.chown(remotes, stats.uid, stats.gid, function (er) {
- cb(er, stats)
- })
+ cb(er, stats)
})
})
})
@@ -429,25 +425,19 @@ function getResolved (uri, treeish) {
var parsed = url.parse(uri)
- // non-hosted SSH strings that are not URLs (git@whatever.com:foo.git) are
- // no bueno
- // https://github.com/npm/npm/issues/7961
- if (!parsed.protocol) return
-
- parsed.hash = treeish
- if (!/^git[+:]/.test(parsed.protocol)) {
- parsed.protocol = 'git+' + parsed.protocol
+ // Checks for known protocols:
+ // http:, https:, ssh:, and git:, with optional git+ prefix.
+ if (!parsed.protocol ||
+ !parsed.protocol.match(/^(((git\+)?(https?|ssh))|git|file):$/)) {
+ uri = 'git+ssh://' + uri
}
- // node incorrectly sticks a / at the start of the path We know that the host
- // won't change, so split and detect this
- // https://github.com/npm/npm/issues/3224
- var spo = uri.split(parsed.host)
- var spr = url.format(parsed).split(parsed.host)
- if (spo[1] && spo[1].charAt(0) === ':' && spr[1] && spr[1].charAt(0) === '/') {
- spr[1] = spr[1].slice(1)
+ if (!/^git[+:]/.test(uri)) {
+ uri = 'git+' + uri
}
- return spr.join(parsed.host)
+
+ // Not all URIs are actually URIs, so use regex for the treeish.
+ return uri.replace(/(?:#.*)?$/, '#' + treeish)
}
// similar to chmodr except it add permissions rather than overwriting them
diff --git a/deps/npm/lib/cache/get-stat.js b/deps/npm/lib/cache/get-stat.js
index 98f95ad6ae1..6ea797a4da8 100644
--- a/deps/npm/lib/cache/get-stat.js
+++ b/deps/npm/lib/cache/get-stat.js
@@ -1,74 +1,6 @@
-var mkdir = require("mkdirp")
- , fs = require("graceful-fs")
- , log = require("npmlog")
- , chownr = require("chownr")
- , npm = require("../npm.js")
- , inflight = require("inflight")
+var npm = require('../npm.js')
+var correctMkdir = require('../utils/correct-mkdir.js')
-// to maintain the cache dir's permissions consistently.
-var cacheStat = null
module.exports = function getCacheStat (cb) {
- if (cacheStat) return cb(null, cacheStat)
-
- fs.stat(npm.cache, function (er, st) {
- if (er) return makeCacheDir(cb)
- if (!st.isDirectory()) {
- log.error("getCacheStat", "invalid cache dir %j", npm.cache)
- return cb(er)
- }
- return cb(null, cacheStat = st)
- })
-}
-
-function makeCacheDir (cb) {
- cb = inflight("makeCacheDir", cb)
- if (!cb) {
- return log.verbose(
- "getCacheStat",
- "cache creation already in flight; waiting"
- )
- }
- log.verbose("getCacheStat", "cache creation not in flight; initializing")
-
- if (!process.getuid) return mkdir(npm.cache, function (er) {
- log.verbose("makeCacheDir", "UID & GID are irrelevant on", process.platform)
- cacheStat = { uid : 0, gid : 0 }
- return cb(er, cacheStat)
- })
-
- var uid = +process.getuid()
- , gid = +process.getgid()
-
- if (uid === 0) {
- if (process.env.SUDO_UID) uid = +process.env.SUDO_UID
- if (process.env.SUDO_GID) gid = +process.env.SUDO_GID
- }
-
- if (uid !== 0 || !process.env.HOME) {
- cacheStat = { uid : uid, gid : gid }
- return mkdir(npm.cache, afterMkdir)
- }
-
- fs.stat(process.env.HOME, function (er, st) {
- if (er) {
- log.error("makeCacheDir", "homeless?")
- return cb(er)
- }
- cacheStat = st
- log.silly("makeCacheDir", "cache dir uid, gid", [st.uid, st.gid])
- return mkdir(npm.cache, afterMkdir)
- })
-
- function afterMkdir (er, made) {
- if (er || !cacheStat || isNaN(cacheStat.uid) || isNaN(cacheStat.gid)) {
- return cb(er, cacheStat)
- }
-
- if (!made) return cb(er, cacheStat)
-
- // ensure that the ownership is correct.
- chownr(made, cacheStat.uid, cacheStat.gid, function (er) {
- return cb(er, cacheStat)
- })
- }
+ correctMkdir(npm.cache, cb)
}
diff --git a/deps/npm/lib/outdated.js b/deps/npm/lib/outdated.js
index fa27dfc8027..ab49d109690 100644
--- a/deps/npm/lib/outdated.js
+++ b/deps/npm/lib/outdated.js
@@ -344,7 +344,7 @@ function shouldUpdate (args, dir, dep, has, req, depth, cb, type) {
function updateDeps (er, d) {
if (er) {
- if (parsed.type !== 'local') return cb()
+ if (parsed.type !== 'local') return cb(er)
return updateLocalDeps()
}
diff --git a/deps/npm/lib/utils/correct-mkdir.js b/deps/npm/lib/utils/correct-mkdir.js
new file mode 100644
index 00000000000..650c56fb17d
--- /dev/null
+++ b/deps/npm/lib/utils/correct-mkdir.js
@@ -0,0 +1,110 @@
+var chownr = require('chownr')
+var dezalgo = require('dezalgo')
+var fs = require('graceful-fs')
+var inflight = require('inflight')
+var log = require('npmlog')
+var mkdirp = require('mkdirp')
+
+// memoize the directories created by this step
+var stats = {}
+var effectiveOwner
+module.exports = function correctMkdir (path, cb) {
+ cb = dezalgo(cb)
+ if (stats[path]) return cb(null, stats[path])
+
+ fs.stat(path, function (er, st) {
+ if (er) return makeDirectory(path, cb)
+
+ if (!st.isDirectory()) {
+ log.error('correctMkdir', 'invalid dir %s', path)
+ return cb(er)
+ }
+
+ var ownerStats = calculateOwner()
+ // there's always a chance the permissions could have been frobbed, so fix
+ if (st.uid !== ownerStats.uid) {
+ stats[path] = ownerStats
+ setPermissions(path, ownerStats, cb)
+ } else {
+ stats[path] = st
+ cb(null, stats[path])
+ }
+ })
+}
+
+function calculateOwner () {
+ if (!effectiveOwner) {
+ effectiveOwner = { uid: 0, gid: 0 }
+
+ if (process.getuid) effectiveOwner.uid = +process.getuid()
+ if (process.getgid) effectiveOwner.gid = +process.getgid()
+
+ if (effectiveOwner.uid === 0) {
+ if (process.env.SUDO_UID) effectiveOwner.uid = +process.env.SUDO_UID
+ if (process.env.SUDO_GID) effectiveOwner.gid = +process.env.SUDO_GID
+ }
+ }
+
+ return effectiveOwner
+}
+
+function makeDirectory (path, cb) {
+ cb = inflight('makeDirectory:' + path, cb)
+ if (!cb) {
+ return log.verbose('makeDirectory', path, 'creation already in flight; waiting')
+ } else {
+ log.verbose('makeDirectory', path, 'creation not in flight; initializing')
+ }
+
+ var owner = calculateOwner()
+
+ if (!process.getuid) {
+ return mkdirp(path, function (er) {
+ log.verbose('makeCacheDir', 'UID & GID are irrelevant on', process.platform)
+
+ stats[path] = owner
+ return cb(er, stats[path])
+ })
+ }
+
+ if (owner.uid !== 0 || !process.env.HOME) {
+ log.silly(
+ 'makeDirectory', path,
+ 'uid:', owner.uid,
+ 'gid:', owner.gid
+ )
+ stats[path] = owner
+ mkdirp(path, afterMkdir)
+ } else {
+ fs.stat(process.env.HOME, function (er, st) {
+ if (er) {
+ log.error('makeDirectory', 'homeless?')
+ return cb(er)
+ }
+
+ log.silly(
+ 'makeDirectory', path,
+ 'uid:', st.uid,
+ 'gid:', st.gid
+ )
+ stats[path] = st
+ mkdirp(path, afterMkdir)
+ })
+ }
+
+ function afterMkdir (er, made) {
+ if (er || !stats[path] || isNaN(stats[path].uid) || isNaN(stats[path].gid)) {
+ return cb(er, stats[path])
+ }
+
+ if (!made) return cb(er, stats[path])
+
+ setPermissions(made, stats[path], cb)
+ }
+}
+
+function setPermissions (path, st, cb) {
+ chownr(path, st.uid, st.gid, function (er) {
+ return cb(er, st)
+ })
+}
diff --git a/deps/npm/lib/utils/locker.js b/deps/npm/lib/utils/locker.js
index 4479f241dab..293d2da052b 100644
--- a/deps/npm/lib/utils/locker.js
+++ b/deps/npm/lib/utils/locker.js
@@ -6,7 +6,7 @@ var log = require("npmlog")
var mkdirp = require("mkdirp")
var npm = require("../npm.js")
-var getStat = require("../cache/get-stat.js")
+var correctMkdir = require('../utils/correct-mkdir.js')
var installLocks = {}
@@ -20,25 +20,23 @@ function lockFileName (base, name) {
}
function lock (base, name, cb) {
- getStat(function (er) {
- var lockDir = resolve(npm.cache, "_locks")
- mkdirp(lockDir, function () {
- if (er) return cb(er)
+ var lockDir = resolve(npm.cache, "_locks")
+ correctMkdir(lockDir, function (er) {
+ if (er) return cb(er)
- var opts = { stale: npm.config.get("cache-lock-stale")
- , retries: npm.config.get("cache-lock-retries")
- , wait: npm.config.get("cache-lock-wait") }
- var lf = lockFileName(base, name)
- lockfile.lock(lf, opts, function (er) {
- if (er) log.warn("locking", lf, "failed", er)
+ var opts = { stale: npm.config.get("cache-lock-stale")
+ , retries: npm.config.get("cache-lock-retries")
+ , wait: npm.config.get("cache-lock-wait") }
+ var lf = lockFileName(base, name)
+ lockfile.lock(lf, opts, function (er) {
+ if (er) log.warn("locking", lf, "failed", er)
- if (!er) {
- log.verbose("lock", "using", lf, "for", resolve(base, name))
- installLocks[lf] = true
- }
+ if (!er) {
+ log.verbose("lock", "using", lf, "for", resolve(base, name))
+ installLocks[lf] = true
+ }
- cb(er)
- })
+ cb(er)
})
})
}
diff --git a/deps/npm/lib/view.js b/deps/npm/lib/view.js
index 47da39b642c..9199d352ae7 100644
--- a/deps/npm/lib/view.js
+++ b/deps/npm/lib/view.js
@@ -254,7 +254,13 @@ function printData (data, name, cb) {
})
})
- console.log(msg)
+ // preserve output symmetry by adding a whitespace-only line at the end if
+ // there's one at the beginning
+ if (/^\s*\n/.test(msg)) msg += "\n"
+
+ // print directly to stdout to not unnecessarily add blank lines
+ process.stdout.write(msg)
+
cb(null, data)
}
function cleanup (data) {
diff --git a/deps/npm/man/man1/npm-README.1 b/deps/npm/man/man1/npm-README.1
index 7a755a96b0b..8235f7ccfe1 100644
--- a/deps/npm/man/man1/npm-README.1
+++ b/deps/npm/man/man1/npm-README.1
@@ -1,4 +1,4 @@
-.TH "NPM" "1" "June 2015" "" ""
+.TH "NPM" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm\fR \- a JavaScript package manager
.P
diff --git a/deps/npm/man/man1/npm-access.1 b/deps/npm/man/man1/npm-access.1
index 6e0caff8338..e99a216d02e 100644
--- a/deps/npm/man/man1/npm-access.1
+++ b/deps/npm/man/man1/npm-access.1
@@ -1,4 +1,4 @@
-.TH "NPM\-ACCESS" "1" "June 2015" "" ""
+.TH "NPM\-ACCESS" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-access\fR \- Set access level on published packages
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-adduser.1 b/deps/npm/man/man1/npm-adduser.1
index 4c8015eff37..7d00b795273 100644
--- a/deps/npm/man/man1/npm-adduser.1
+++ b/deps/npm/man/man1/npm-adduser.1
@@ -1,4 +1,4 @@
-.TH "NPM\-ADDUSER" "1" "June 2015" "" ""
+.TH "NPM\-ADDUSER" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-adduser\fR \- Add a registry user account
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-bin.1 b/deps/npm/man/man1/npm-bin.1
index 2ddb41bd109..6250b242ff4 100644
--- a/deps/npm/man/man1/npm-bin.1
+++ b/deps/npm/man/man1/npm-bin.1
@@ -1,4 +1,4 @@
-.TH "NPM\-BIN" "1" "June 2015" "" ""
+.TH "NPM\-BIN" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-bin\fR \- Display npm bin folder
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-bugs.1 b/deps/npm/man/man1/npm-bugs.1
index d1aa52202bf..126065fa5cb 100644
--- a/deps/npm/man/man1/npm-bugs.1
+++ b/deps/npm/man/man1/npm-bugs.1
@@ -1,4 +1,4 @@
-.TH "NPM\-BUGS" "1" "June 2015" "" ""
+.TH "NPM\-BUGS" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-bugs\fR \- Bugs for a package in a web browser maybe
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-build.1 b/deps/npm/man/man1/npm-build.1
index ed46425c57f..7bfeb2b84ae 100644
--- a/deps/npm/man/man1/npm-build.1
+++ b/deps/npm/man/man1/npm-build.1
@@ -1,4 +1,4 @@
-.TH "NPM\-BUILD" "1" "June 2015" "" ""
+.TH "NPM\-BUILD" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-build\fR \- Build a package
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-bundle.1 b/deps/npm/man/man1/npm-bundle.1
index 68ae0ae9aa6..202a09079c4 100644
--- a/deps/npm/man/man1/npm-bundle.1
+++ b/deps/npm/man/man1/npm-bundle.1
@@ -1,4 +1,4 @@
-.TH "NPM\-BUNDLE" "1" "June 2015" "" ""
+.TH "NPM\-BUNDLE" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-bundle\fR \- REMOVED
.SH DESCRIPTION
diff --git a/deps/npm/man/man1/npm-cache.1 b/deps/npm/man/man1/npm-cache.1
index effe1b30b62..dd473fc2168 100644
--- a/deps/npm/man/man1/npm-cache.1
+++ b/deps/npm/man/man1/npm-cache.1
@@ -1,4 +1,4 @@
-.TH "NPM\-CACHE" "1" "June 2015" "" ""
+.TH "NPM\-CACHE" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-cache\fR \- Manipulates packages cache
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-completion.1 b/deps/npm/man/man1/npm-completion.1
index 5a5d24eafd9..13a7135e082 100644
--- a/deps/npm/man/man1/npm-completion.1
+++ b/deps/npm/man/man1/npm-completion.1
@@ -1,4 +1,4 @@
-.TH "NPM\-COMPLETION" "1" "June 2015" "" ""
+.TH "NPM\-COMPLETION" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-completion\fR \- Tab Completion for npm
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-config.1 b/deps/npm/man/man1/npm-config.1
index 17d74488a15..fddf9dfa9eb 100644
--- a/deps/npm/man/man1/npm-config.1
+++ b/deps/npm/man/man1/npm-config.1
@@ -1,4 +1,4 @@
-.TH "NPM\-CONFIG" "1" "June 2015" "" ""
+.TH "NPM\-CONFIG" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-config\fR \- Manage the npm configuration files
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-dedupe.1 b/deps/npm/man/man1/npm-dedupe.1
index 89a3302f639..ac963952961 100644
--- a/deps/npm/man/man1/npm-dedupe.1
+++ b/deps/npm/man/man1/npm-dedupe.1
@@ -1,4 +1,4 @@
-.TH "NPM\-DEDUPE" "1" "June 2015" "" ""
+.TH "NPM\-DEDUPE" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-dedupe\fR \- Reduce duplication
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-deprecate.1 b/deps/npm/man/man1/npm-deprecate.1
index c50e7841099..a379e6b133a 100644
--- a/deps/npm/man/man1/npm-deprecate.1
+++ b/deps/npm/man/man1/npm-deprecate.1
@@ -1,4 +1,4 @@
-.TH "NPM\-DEPRECATE" "1" "June 2015" "" ""
+.TH "NPM\-DEPRECATE" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-deprecate\fR \- Deprecate a version of a package
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-dist-tag.1 b/deps/npm/man/man1/npm-dist-tag.1
index 4c8e977ac5d..b821da4f9e0 100644
--- a/deps/npm/man/man1/npm-dist-tag.1
+++ b/deps/npm/man/man1/npm-dist-tag.1
@@ -1,4 +1,4 @@
-.TH "NPM\-DIST\-TAG" "1" "June 2015" "" ""
+.TH "NPM\-DIST\-TAG" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-dist-tag\fR \- Modify package distribution tags
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-docs.1 b/deps/npm/man/man1/npm-docs.1
index 8e986706717..36c6e042aa4 100644
--- a/deps/npm/man/man1/npm-docs.1
+++ b/deps/npm/man/man1/npm-docs.1
@@ -1,4 +1,4 @@
-.TH "NPM\-DOCS" "1" "June 2015" "" ""
+.TH "NPM\-DOCS" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-docs\fR \- Docs for a package in a web browser maybe
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-edit.1 b/deps/npm/man/man1/npm-edit.1
index 14787f50739..711e8576fbb 100644
--- a/deps/npm/man/man1/npm-edit.1
+++ b/deps/npm/man/man1/npm-edit.1
@@ -1,4 +1,4 @@
-.TH "NPM\-EDIT" "1" "June 2015" "" ""
+.TH "NPM\-EDIT" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-edit\fR \- Edit an installed package
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-explore.1 b/deps/npm/man/man1/npm-explore.1
index a90a66ac9aa..70786382a7b 100644
--- a/deps/npm/man/man1/npm-explore.1
+++ b/deps/npm/man/man1/npm-explore.1
@@ -1,4 +1,4 @@
-.TH "NPM\-EXPLORE" "1" "June 2015" "" ""
+.TH "NPM\-EXPLORE" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-explore\fR \- Browse an installed package
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-help-search.1 b/deps/npm/man/man1/npm-help-search.1
index 1dae614a2f2..e9284f79d19 100644
--- a/deps/npm/man/man1/npm-help-search.1
+++ b/deps/npm/man/man1/npm-help-search.1
@@ -1,4 +1,4 @@
-.TH "NPM\-HELP\-SEARCH" "1" "June 2015" "" ""
+.TH "NPM\-HELP\-SEARCH" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-help-search\fR \- Search npm help documentation
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-help.1 b/deps/npm/man/man1/npm-help.1
index e8cd06d8c43..69a3f9b5150 100644
--- a/deps/npm/man/man1/npm-help.1
+++ b/deps/npm/man/man1/npm-help.1
@@ -1,4 +1,4 @@
-.TH "NPM\-HELP" "1" "June 2015" "" ""
+.TH "NPM\-HELP" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-help\fR \- Get help on npm
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-init.1 b/deps/npm/man/man1/npm-init.1
index e91ef4acf75..f40cd2ce622 100644
--- a/deps/npm/man/man1/npm-init.1
+++ b/deps/npm/man/man1/npm-init.1
@@ -1,4 +1,4 @@
-.TH "NPM\-INIT" "1" "June 2015" "" ""
+.TH "NPM\-INIT" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-init\fR \- Interactively create a package\.json file
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-install.1 b/deps/npm/man/man1/npm-install.1
index aae70eb8b08..994000c8e06 100644
--- a/deps/npm/man/man1/npm-install.1
+++ b/deps/npm/man/man1/npm-install.1
@@ -1,4 +1,4 @@
-.TH "NPM\-INSTALL" "1" "June 2015" "" ""
+.TH "NPM\-INSTALL" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-install\fR \- Install a package
.SH SYNOPSIS
@@ -193,15 +193,34 @@ fetch the package by name if it is not valid\.
\fB<protocol>\fR is one of \fBgit\fR, \fBgit+ssh\fR, \fBgit+http\fR, or
\fBgit+https\fR\|\. If no \fB<commit\-ish>\fR is specified, then \fBmaster\fR is
used\.
- Examples:
+ The following git environment variables are recognized by npm and will be added
+ to the environment when running git:
+.RS 0
+.IP \(bu 2
+\fBGIT_ASKPASS\fR
+.IP \(bu 2
+\fBGIT_PROXY_COMMAND\fR
+.IP \(bu 2
+\fBGIT_SSH\fR
+.IP \(bu 2
+\fBGIT_SSH_COMMAND\fR
+.IP \(bu 2
+\fBGIT_SSL_CAINFO\fR
+.IP \(bu 2
+\fBGIT_SSL_NO_VERIFY\fR
+See the git man page for details\.
+Examples:
.P
.RS 2
.nf
- git+ssh://git@github\.com:npm/npm\.git#v1\.0\.27
- git+https://isaacs@github\.com/npm/npm\.git
- git://github\.com/npm/npm\.git#v1\.0\.27
+npm install git+ssh://git@github\.com:npm/npm\.git#v1\.0\.27
+npm install git+https://isaacs@github\.com/npm/npm\.git
+npm install git://github\.com/npm/npm\.git#v1\.0\.27
+GIT_SSH_COMMAND='ssh \-i ~/\.ssh/custom_ident' npm install git+ssh://git@github\.com:npm/npm\.git
.fi
.RE
+
+.RE
.IP \(bu 2
\fBnpm install <githubname>/<githubrepo>[#<commit\-ish>]\fR:
.IP \(bu 2
diff --git a/deps/npm/man/man1/npm-link.1 b/deps/npm/man/man1/npm-link.1
index 9aa054dea25..e063986b17b 100644
--- a/deps/npm/man/man1/npm-link.1
+++ b/deps/npm/man/man1/npm-link.1
@@ -1,4 +1,4 @@
-.TH "NPM\-LINK" "1" "June 2015" "" ""
+.TH "NPM\-LINK" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-link\fR \- Symlink a package folder
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-logout.1 b/deps/npm/man/man1/npm-logout.1
index a4c21651e1d..e5e0b99690e 100644
--- a/deps/npm/man/man1/npm-logout.1
+++ b/deps/npm/man/man1/npm-logout.1
@@ -1,4 +1,4 @@
-.TH "NPM\-LOGOUT" "1" "June 2015" "" ""
+.TH "NPM\-LOGOUT" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-logout\fR \- Log out of the registry
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-ls.1 b/deps/npm/man/man1/npm-ls.1
index 31d93d17b4a..729bde91908 100644
--- a/deps/npm/man/man1/npm-ls.1
+++ b/deps/npm/man/man1/npm-ls.1
@@ -1,4 +1,4 @@
-.TH "NPM\-LS" "1" "June 2015" "" ""
+.TH "NPM\-LS" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-ls\fR \- List installed packages
.SH SYNOPSIS
@@ -23,7 +23,7 @@ For example, running \fBnpm ls promzard\fR in npm's source tree will show:
.P
.RS 2
.nf
-npm@2.11.3 /path/to/npm
+npm@2.12.1 /path/to/npm
└─┬ init\-package\-json@0\.0\.4
└── promzard@0\.1\.5
.fi
diff --git a/deps/npm/man/man1/npm-outdated.1 b/deps/npm/man/man1/npm-outdated.1
index e9998f4a7f7..01b44601404 100644
--- a/deps/npm/man/man1/npm-outdated.1
+++ b/deps/npm/man/man1/npm-outdated.1
@@ -1,4 +1,4 @@
-.TH "NPM\-OUTDATED" "1" "June 2015" "" ""
+.TH "NPM\-OUTDATED" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-outdated\fR \- Check for outdated packages
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-owner.1 b/deps/npm/man/man1/npm-owner.1
index ee291a46bbb..c6ef75bb35c 100644
--- a/deps/npm/man/man1/npm-owner.1
+++ b/deps/npm/man/man1/npm-owner.1
@@ -1,4 +1,4 @@
-.TH "NPM\-OWNER" "1" "June 2015" "" ""
+.TH "NPM\-OWNER" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-owner\fR \- Manage package owners
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-pack.1 b/deps/npm/man/man1/npm-pack.1
index 16d56c949f8..7781bbdbd10 100644
--- a/deps/npm/man/man1/npm-pack.1
+++ b/deps/npm/man/man1/npm-pack.1
@@ -1,4 +1,4 @@
-.TH "NPM\-PACK" "1" "June 2015" "" ""
+.TH "NPM\-PACK" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-pack\fR \- Create a tarball from a package
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-ping.1 b/deps/npm/man/man1/npm-ping.1
new file mode 100644
index 00000000000..098e82cfb67
--- /dev/null
+++ b/deps/npm/man/man1/npm-ping.1
@@ -0,0 +1,23 @@
+.TH "NPM\-PING" "1" "July 2015" "" ""
+.SH "NAME"
+\fBnpm-ping\fR \- Ping npm registry
+.SH SYNOPSIS
+.P
+.RS 2
+.nf
+npm ping [\-\-registry <registry>]
+.fi
+.RE
+.SH DESCRIPTION
+.P
+Ping the configured or given npm registry and verify authentication\.
+.SH SEE ALSO
+.RS 0
+.IP \(bu 2
+npm help config
+.IP \(bu 2
+npm help 7 config
+.IP \(bu 2
+npm help 5 npmrc
+
+.RE
diff --git a/deps/npm/man/man1/npm-prefix.1 b/deps/npm/man/man1/npm-prefix.1
index 308b8be08e6..1f42ea7a758 100644
--- a/deps/npm/man/man1/npm-prefix.1
+++ b/deps/npm/man/man1/npm-prefix.1
@@ -1,4 +1,4 @@
-.TH "NPM\-PREFIX" "1" "June 2015" "" ""
+.TH "NPM\-PREFIX" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-prefix\fR \- Display prefix
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-prune.1 b/deps/npm/man/man1/npm-prune.1
index a6178226e85..304dcece16e 100644
--- a/deps/npm/man/man1/npm-prune.1
+++ b/deps/npm/man/man1/npm-prune.1
@@ -1,4 +1,4 @@
-.TH "NPM\-PRUNE" "1" "June 2015" "" ""
+.TH "NPM\-PRUNE" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-prune\fR \- Remove extraneous packages
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-publish.1 b/deps/npm/man/man1/npm-publish.1
index 5a092c16d73..0daaae7d566 100644
--- a/deps/npm/man/man1/npm-publish.1
+++ b/deps/npm/man/man1/npm-publish.1
@@ -1,4 +1,4 @@
-.TH "NPM\-PUBLISH" "1" "June 2015" "" ""
+.TH "NPM\-PUBLISH" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-publish\fR \- Publish a package
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-rebuild.1 b/deps/npm/man/man1/npm-rebuild.1
index e8347ea552e..d3c1c615bb7 100644
--- a/deps/npm/man/man1/npm-rebuild.1
+++ b/deps/npm/man/man1/npm-rebuild.1
@@ -1,4 +1,4 @@
-.TH "NPM\-REBUILD" "1" "June 2015" "" ""
+.TH "NPM\-REBUILD" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-rebuild\fR \- Rebuild a package
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-repo.1 b/deps/npm/man/man1/npm-repo.1
index bbbc8b1282b..a6638b0078c 100644
--- a/deps/npm/man/man1/npm-repo.1
+++ b/deps/npm/man/man1/npm-repo.1
@@ -1,4 +1,4 @@
-.TH "NPM\-REPO" "1" "June 2015" "" ""
+.TH "NPM\-REPO" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-repo\fR \- Open package repository page in the browser
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-restart.1 b/deps/npm/man/man1/npm-restart.1
index f45e6411439..ec21ac709cb 100644
--- a/deps/npm/man/man1/npm-restart.1
+++ b/deps/npm/man/man1/npm-restart.1
@@ -1,4 +1,4 @@
-.TH "NPM\-RESTART" "1" "June 2015" "" ""
+.TH "NPM\-RESTART" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-restart\fR \- Restart a package
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-rm.1 b/deps/npm/man/man1/npm-rm.1
index 548a870f21e..784d7e283f4 100644
--- a/deps/npm/man/man1/npm-rm.1
+++ b/deps/npm/man/man1/npm-rm.1
@@ -1,4 +1,4 @@
-.TH "NPM\-RM" "1" "June 2015" "" ""
+.TH "NPM\-RM" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-rm\fR \- Remove a package
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-root.1 b/deps/npm/man/man1/npm-root.1
index 7e0eeacb3be..8c80364536c 100644
--- a/deps/npm/man/man1/npm-root.1
+++ b/deps/npm/man/man1/npm-root.1
@@ -1,4 +1,4 @@
-.TH "NPM\-ROOT" "1" "June 2015" "" ""
+.TH "NPM\-ROOT" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-root\fR \- Display npm root
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-run-script.1 b/deps/npm/man/man1/npm-run-script.1
index 351800eb59a..2e1e87f9ce5 100644
--- a/deps/npm/man/man1/npm-run-script.1
+++ b/deps/npm/man/man1/npm-run-script.1
@@ -1,4 +1,4 @@
-.TH "NPM\-RUN\-SCRIPT" "1" "June 2015" "" ""
+.TH "NPM\-RUN\-SCRIPT" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-run-script\fR \- Run arbitrary package scripts
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-search.1 b/deps/npm/man/man1/npm-search.1
index b617bbbe703..5081cf32eb3 100644
--- a/deps/npm/man/man1/npm-search.1
+++ b/deps/npm/man/man1/npm-search.1
@@ -1,4 +1,4 @@
-.TH "NPM\-SEARCH" "1" "June 2015" "" ""
+.TH "NPM\-SEARCH" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-search\fR \- Search for packages
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-shrinkwrap.1 b/deps/npm/man/man1/npm-shrinkwrap.1
index 521634d13b3..e0eb3ce1b42 100644
--- a/deps/npm/man/man1/npm-shrinkwrap.1
+++ b/deps/npm/man/man1/npm-shrinkwrap.1
@@ -1,4 +1,4 @@
-.TH "NPM\-SHRINKWRAP" "1" "June 2015" "" ""
+.TH "NPM\-SHRINKWRAP" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-shrinkwrap\fR \- Lock down dependency versions
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-star.1 b/deps/npm/man/man1/npm-star.1
index 0cbc9ed2e75..d28d81168b0 100644
--- a/deps/npm/man/man1/npm-star.1
+++ b/deps/npm/man/man1/npm-star.1
@@ -1,4 +1,4 @@
-.TH "NPM\-STAR" "1" "June 2015" "" ""
+.TH "NPM\-STAR" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-star\fR \- Mark your favorite packages
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-stars.1 b/deps/npm/man/man1/npm-stars.1
index 88208b575ee..0f6c5342e8c 100644
--- a/deps/npm/man/man1/npm-stars.1
+++ b/deps/npm/man/man1/npm-stars.1
@@ -1,4 +1,4 @@
-.TH "NPM\-STARS" "1" "June 2015" "" ""
+.TH "NPM\-STARS" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-stars\fR \- View packages marked as favorites
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-start.1 b/deps/npm/man/man1/npm-start.1
index f8b70dacfb3..55e2e9c7f20 100644
--- a/deps/npm/man/man1/npm-start.1
+++ b/deps/npm/man/man1/npm-start.1
@@ -1,4 +1,4 @@
-.TH "NPM\-START" "1" "June 2015" "" ""
+.TH "NPM\-START" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-start\fR \- Start a package
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-stop.1 b/deps/npm/man/man1/npm-stop.1
index b4d80840414..b4d12d6b779 100644
--- a/deps/npm/man/man1/npm-stop.1
+++ b/deps/npm/man/man1/npm-stop.1
@@ -1,4 +1,4 @@
-.TH "NPM\-STOP" "1" "June 2015" "" ""
+.TH "NPM\-STOP" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-stop\fR \- Stop a package
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-submodule.1 b/deps/npm/man/man1/npm-submodule.1
deleted file mode 100644
index 771f0c0a228..00000000000
--- a/deps/npm/man/man1/npm-submodule.1
+++ /dev/null
@@ -1,41 +0,0 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
-.TH "NPM\-SUBMODULE" "1" "September 2014" "" ""
-.
-.SH "NAME"
-\fBnpm-submodule\fR \-\- Add a package as a git submodule
-.
-.SH "SYNOPSIS"
-.
-.nf
-npm submodule <pkg>
-.
-.fi
-.
-.SH "DESCRIPTION"
-If the specified package has a git repository url in its package\.json
-description, then this command will add it as a git submodule at \fBnode_modules/<pkg name>\fR\|\.
-.
-.P
-This is a convenience only\. From then on, it\'s up to you to manage
-updates by using the appropriate git commands\. npm will stubbornly
-refuse to update, modify, or remove anything with a \fB\|\.git\fR subfolder
-in it\.
-.
-.P
-This command also does not install missing dependencies, if the package
-does not include them in its git repository\. If \fBnpm ls\fR reports that
-things are missing, you can either install, link, or submodule them yourself,
-or you can do \fBnpm explore <pkgname> \-\- npm install\fR to install the
-dependencies into the submodule folder\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
-npm help 5 package\.json
-.
-.IP "\(bu" 4
-git help submodule
-.
-.IP "" 0
diff --git a/deps/npm/man/man1/npm-tag.1 b/deps/npm/man/man1/npm-tag.1
index c0336b2e636..6fb58d1d379 100644
--- a/deps/npm/man/man1/npm-tag.1
+++ b/deps/npm/man/man1/npm-tag.1
@@ -1,4 +1,4 @@
-.TH "NPM\-TAG" "1" "June 2015" "" ""
+.TH "NPM\-TAG" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-tag\fR \- Tag a published version
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-test.1 b/deps/npm/man/man1/npm-test.1
index f5f409a64ab..5a07a465531 100644
--- a/deps/npm/man/man1/npm-test.1
+++ b/deps/npm/man/man1/npm-test.1
@@ -1,4 +1,4 @@
-.TH "NPM\-TEST" "1" "June 2015" "" ""
+.TH "NPM\-TEST" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-test\fR \- Test a package
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-uninstall.1 b/deps/npm/man/man1/npm-uninstall.1
index d59dcb14baa..aef162fab2a 100644
--- a/deps/npm/man/man1/npm-uninstall.1
+++ b/deps/npm/man/man1/npm-uninstall.1
@@ -1,4 +1,4 @@
-.TH "NPM\-RM" "1" "June 2015" "" ""
+.TH "NPM\-RM" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-rm\fR \- Remove a package
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-unpublish.1 b/deps/npm/man/man1/npm-unpublish.1
index 8094933ab08..c6be18c7873 100644
--- a/deps/npm/man/man1/npm-unpublish.1
+++ b/deps/npm/man/man1/npm-unpublish.1
@@ -1,4 +1,4 @@
-.TH "NPM\-UNPUBLISH" "1" "June 2015" "" ""
+.TH "NPM\-UNPUBLISH" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-unpublish\fR \- Remove a package from the registry
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-update.1 b/deps/npm/man/man1/npm-update.1
index 7b548a6e13f..9945f4704ad 100644
--- a/deps/npm/man/man1/npm-update.1
+++ b/deps/npm/man/man1/npm-update.1
@@ -1,4 +1,4 @@
-.TH "NPM\-UPDATE" "1" "June 2015" "" ""
+.TH "NPM\-UPDATE" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-update\fR \- Update a package
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-version.1 b/deps/npm/man/man1/npm-version.1
index 6c9444ff778..38d7ae62dff 100644
--- a/deps/npm/man/man1/npm-version.1
+++ b/deps/npm/man/man1/npm-version.1
@@ -1,4 +1,4 @@
-.TH "NPM\-VERSION" "1" "June 2015" "" ""
+.TH "NPM\-VERSION" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-version\fR \- Bump a package version
.SH SYNOPSIS
@@ -14,8 +14,8 @@ Run this in a package directory to bump the version and write the new
data back to \fBpackage\.json\fR and, if present, \fBnpm\-shrinkwrap\.json\fR\|\.
.P
The \fBnewversion\fR argument should be a valid semver string, \fIor\fR a
-valid second argument to semver\.inc (one of "patch", "minor", "major",
-"prepatch", "preminor", "premajor", "prerelease")\. In the second case,
+valid second argument to semver\.inc (one of \fBpatch\fR, \fBminor\fR, \fBmajor\fR,
+\fBprepatch\fR, \fBpreminor\fR, \fBpremajor\fR, \fBprerelease\fR)\. In the second case,
the existing version will be incremented by 1 in the specified field\.
.P
If run in a git repo, it will also create a version commit and tag, and fail if
@@ -51,11 +51,11 @@ Enter passphrase:
.fi
.RE
.P
-If "preversion", "version", "postversion" in the "scripts" property of
-the package\.json, it will execute by running \fBnpm version\fR\|\. preversion
-and version ware executed before bump the package version, postversion
-was executed after bump the package version\. For example to run \fBnpm version\fR
-after passed all test:
+If \fBpreversion\fR, \fBversion\fR, or \fBpostversion\fR are in the \fBscripts\fR property of
+the package\.json, they will be executed as part of running \fBnpm version\fR\|\.
+\fBpreversion\fR and \fBversion\fR are executed before bumping the package version, and
+\fBpostversion\fR is executed afterwards\. For example, to run \fBnpm version\fR only if
+all tests pass:
.P
.RS 2
.nf
diff --git a/deps/npm/man/man1/npm-view.1 b/deps/npm/man/man1/npm-view.1
index 8960067d00d..9c2ca518ee5 100644
--- a/deps/npm/man/man1/npm-view.1
+++ b/deps/npm/man/man1/npm-view.1
@@ -1,4 +1,4 @@
-.TH "NPM\-VIEW" "1" "June 2015" "" ""
+.TH "NPM\-VIEW" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-view\fR \- View registry info
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm-whoami.1 b/deps/npm/man/man1/npm-whoami.1
index 812bbf87a7d..133290c7268 100644
--- a/deps/npm/man/man1/npm-whoami.1
+++ b/deps/npm/man/man1/npm-whoami.1
@@ -1,4 +1,4 @@
-.TH "NPM\-WHOAMI" "1" "June 2015" "" ""
+.TH "NPM\-WHOAMI" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-whoami\fR \- Display npm username
.SH SYNOPSIS
diff --git a/deps/npm/man/man1/npm.1 b/deps/npm/man/man1/npm.1
index b38102a3f9b..b1a505a82ea 100644
--- a/deps/npm/man/man1/npm.1
+++ b/deps/npm/man/man1/npm.1
@@ -1,4 +1,4 @@
-.TH "NPM" "1" "June 2015" "" ""
+.TH "NPM" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm\fR \- javascript package manager
.SH SYNOPSIS
@@ -10,7 +10,7 @@ npm <command> [args]
.RE
.SH VERSION
.P
-2.11.3
+2.12.1
.SH DESCRIPTION
.P
npm is the package manager for the Node JavaScript platform\. It puts
diff --git a/deps/npm/man/man3/npm-bin.3 b/deps/npm/man/man3/npm-bin.3
index 12f03b262ac..ece642c43f2 100644
--- a/deps/npm/man/man3/npm-bin.3
+++ b/deps/npm/man/man3/npm-bin.3
@@ -1,4 +1,4 @@
-.TH "NPM\-BIN" "3" "June 2015" "" ""
+.TH "NPM\-BIN" "3" "July 2015" "" ""
.SH "NAME"
\fBnpm-bin\fR \- Display npm bin folder
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-bugs.3 b/deps/npm/man/man3/npm-bugs.3
index f04fdf2afa1..8ba65077770 100644
--- a/deps/npm/man/man3/npm-bugs.3
+++ b/deps/npm/man/man3/npm-bugs.3
@@ -1,4 +1,4 @@
-.TH "NPM\-BUGS" "3" "June 2015" "" ""
+.TH "NPM\-BUGS" "3" "July 2015" "" ""
.SH "NAME"
\fBnpm-bugs\fR \- Bugs for a package in a web browser maybe
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-cache.3 b/deps/npm/man/man3/npm-cache.3
index bcfb6138b5b..9416a1dc3e3 100644
--- a/deps/npm/man/man3/npm-cache.3
+++ b/deps/npm/man/man3/npm-cache.3
@@ -1,4 +1,4 @@
-.TH "NPM\-CACHE" "3" "June 2015" "" ""
+.TH "NPM\-CACHE" "3" "July 2015" "" ""
.SH "NAME"
\fBnpm-cache\fR \- manage the npm cache programmatically
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-commands.3 b/deps/npm/man/man3/npm-commands.3
index 0dca71c8c78..429213c5d3d 100644
--- a/deps/npm/man/man3/npm-commands.3
+++ b/deps/npm/man/man3/npm-commands.3
@@ -1,4 +1,4 @@
-.TH "NPM\-COMMANDS" "3" "June 2015" "" ""
+.TH "NPM\-COMMANDS" "3" "July 2015" "" ""
.SH "NAME"
\fBnpm-commands\fR \- npm commands
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-config.3 b/deps/npm/man/man3/npm-config.3
index 0c92c3a2819..1970f311f30 100644
--- a/deps/npm/man/man3/npm-config.3
+++ b/deps/npm/man/man3/npm-config.3
@@ -1,4 +1,4 @@
-.TH "NPM\-CONFIG" "3" "June 2015" "" ""
+.TH "NPM\-CONFIG" "3" "July 2015" "" ""
.SH "NAME"
\fBnpm-config\fR \- Manage the npm configuration files
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-deprecate.3 b/deps/npm/man/man3/npm-deprecate.3
index 54237fce684..ba6f31f8174 100644
--- a/deps/npm/man/man3/npm-deprecate.3
+++ b/deps/npm/man/man3/npm-deprecate.3
@@ -1,4 +1,4 @@
-.TH "NPM\-DEPRECATE" "3" "June 2015" "" ""
+.TH "NPM\-DEPRECATE" "3" "July 2015" "" ""
.SH "NAME"
\fBnpm-deprecate\fR \- Deprecate a version of a package
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-docs.3 b/deps/npm/man/man3/npm-docs.3
index e23f1dcad33..3c32506800b 100644
--- a/deps/npm/man/man3/npm-docs.3
+++ b/deps/npm/man/man3/npm-docs.3
@@ -1,4 +1,4 @@
-.TH "NPM\-DOCS" "3" "June 2015" "" ""
+.TH "NPM\-DOCS" "3" "July 2015" "" ""
.SH "NAME"
\fBnpm-docs\fR \- Docs for a package in a web browser maybe
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-edit.3 b/deps/npm/man/man3/npm-edit.3
index ceb99ec01f6..68c08b8b08e 100644
--- a/deps/npm/man/man3/npm-edit.3
+++ b/deps/npm/man/man3/npm-edit.3
@@ -1,4 +1,4 @@
-.TH "NPM\-EDIT" "3" "June 2015" "" ""
+.TH "NPM\-EDIT" "3" "July 2015" "" ""
.SH "NAME"
\fBnpm-edit\fR \- Edit an installed package
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-explore.3 b/deps/npm/man/man3/npm-explore.3
index d9887378d2d..66c8adbb993 100644
--- a/deps/npm/man/man3/npm-explore.3
+++ b/deps/npm/man/man3/npm-explore.3
@@ -1,4 +1,4 @@
-.TH "NPM\-EXPLORE" "3" "June 2015" "" ""
+.TH "NPM\-EXPLORE" "3" "July 2015" "" ""
.SH "NAME"
\fBnpm-explore\fR \- Browse an installed package
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-help-search.3 b/deps/npm/man/man3/npm-help-search.3
index ae547a52959..6aa3df57047 100644
--- a/deps/npm/man/man3/npm-help-search.3
+++ b/deps/npm/man/man3/npm-help-search.3
@@ -1,4 +1,4 @@
-.TH "NPM\-HELP\-SEARCH" "3" "June 2015" "" ""
+.TH "NPM\-HELP\-SEARCH" "3" "July 2015" "" ""
.SH "NAME"
\fBnpm-help-search\fR \- Search the help pages
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-init.3 b/deps/npm/man/man3/npm-init.3
index 325e217281b..b69fdfd952b 100644
--- a/deps/npm/man/man3/npm-init.3
+++ b/deps/npm/man/man3/npm-init.3
@@ -1,4 +1,4 @@
-.TH "NPM" "" "June 2015" "" ""
+.TH "NPM" "" "July 2015" "" ""
.SH "NAME"
\fBnpm\fR
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-install.3 b/deps/npm/man/man3/npm-install.3
index 1d9497e3949..e639afde0a5 100644
--- a/deps/npm/man/man3/npm-install.3
+++ b/deps/npm/man/man3/npm-install.3
@@ -1,4 +1,4 @@
-.TH "NPM\-INSTALL" "3" "June 2015" "" ""
+.TH "NPM\-INSTALL" "3" "July 2015" "" ""
.SH "NAME"
\fBnpm-install\fR \- install a package programmatically
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-link.3 b/deps/npm/man/man3/npm-link.3
index ab67f393336..08d653057fd 100644
--- a/deps/npm/man/man3/npm-link.3
+++ b/deps/npm/man/man3/npm-link.3
@@ -1,4 +1,4 @@
-.TH "NPM\-LINK" "3" "June 2015" "" ""
+.TH "NPM\-LINK" "3" "July 2015" "" ""
.SH "NAME"
\fBnpm-link\fR \- Symlink a package folder
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-load.3 b/deps/npm/man/man3/npm-load.3
index dd92ce6846a..01e1d4107d2 100644
--- a/deps/npm/man/man3/npm-load.3
+++ b/deps/npm/man/man3/npm-load.3
@@ -1,4 +1,4 @@
-.TH "NPM\-LOAD" "3" "June 2015" "" ""
+.TH "NPM\-LOAD" "3" "July 2015" "" ""
.SH "NAME"
\fBnpm-load\fR \- Load config settings
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-ls.3 b/deps/npm/man/man3/npm-ls.3
index 82d3dbd948c..9e4691380aa 100644
--- a/deps/npm/man/man3/npm-ls.3
+++ b/deps/npm/man/man3/npm-ls.3
@@ -1,4 +1,4 @@
-.TH "NPM\-LS" "3" "June 2015" "" ""
+.TH "NPM\-LS" "3" "July 2015" "" ""
.SH "NAME"
\fBnpm-ls\fR \- List installed packages
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-outdated.3 b/deps/npm/man/man3/npm-outdated.3
index 01cdf0c6800..9a570e8215a 100644
--- a/deps/npm/man/man3/npm-outdated.3
+++ b/deps/npm/man/man3/npm-outdated.3
@@ -1,4 +1,4 @@
-.TH "NPM\-OUTDATED" "3" "June 2015" "" ""
+.TH "NPM\-OUTDATED" "3" "July 2015" "" ""
.SH "NAME"
\fBnpm-outdated\fR \- Check for outdated packages
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-owner.3 b/deps/npm/man/man3/npm-owner.3
index 5a82efdae61..03b8d869e6b 100644
--- a/deps/npm/man/man3/npm-owner.3
+++ b/deps/npm/man/man3/npm-owner.3
@@ -1,4 +1,4 @@
-.TH "NPM\-OWNER" "3" "June 2015" "" ""
+.TH "NPM\-OWNER" "3" "July 2015" "" ""
.SH "NAME"
\fBnpm-owner\fR \- Manage package owners
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-pack.3 b/deps/npm/man/man3/npm-pack.3
index f1d65b2d3c0..77d25321b66 100644
--- a/deps/npm/man/man3/npm-pack.3
+++ b/deps/npm/man/man3/npm-pack.3
@@ -1,4 +1,4 @@
-.TH "NPM\-PACK" "3" "June 2015" "" ""
+.TH "NPM\-PACK" "3" "July 2015" "" ""
.SH "NAME"
\fBnpm-pack\fR \- Create a tarball from a package
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-ping.3 b/deps/npm/man/man3/npm-ping.3
new file mode 100644
index 00000000000..9dc6a343b35
--- /dev/null
+++ b/deps/npm/man/man3/npm-ping.3
@@ -0,0 +1,17 @@
+.TH "NPM\-PING" "3" "July 2015" "" ""
+.SH "NAME"
+\fBnpm-ping\fR \- Ping npm registry
+.SH SYNOPSIS
+.P
+.RS 2
+.nf
+npm\.registry\.ping(registry, options, function (er, pong))
+.fi
+.RE
+.SH DESCRIPTION
+.P
+Attempts to connect to the given registry, returning a \fBpong\fR
+object with various metadata if it succeeds\.
+.P
+This function is primarily useful for debugging connection issues
+to npm registries\.
diff --git a/deps/npm/man/man3/npm-prefix.3 b/deps/npm/man/man3/npm-prefix.3
index 9bf285db13b..39b7e382e90 100644
--- a/deps/npm/man/man3/npm-prefix.3
+++ b/deps/npm/man/man3/npm-prefix.3
@@ -1,4 +1,4 @@
-.TH "NPM\-PREFIX" "3" "June 2015" "" ""
+.TH "NPM\-PREFIX" "3" "July 2015" "" ""
.SH "NAME"
\fBnpm-prefix\fR \- Display prefix
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-prune.3 b/deps/npm/man/man3/npm-prune.3
index 4ea94640047..1adb72e0564 100644
--- a/deps/npm/man/man3/npm-prune.3
+++ b/deps/npm/man/man3/npm-prune.3
@@ -1,4 +1,4 @@
-.TH "NPM\-PRUNE" "3" "June 2015" "" ""
+.TH "NPM\-PRUNE" "3" "July 2015" "" ""
.SH "NAME"
\fBnpm-prune\fR \- Remove extraneous packages
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-publish.3 b/deps/npm/man/man3/npm-publish.3
index fe3ce639c1d..5e25c4cbcb7 100644
--- a/deps/npm/man/man3/npm-publish.3
+++ b/deps/npm/man/man3/npm-publish.3
@@ -1,4 +1,4 @@
-.TH "NPM\-PUBLISH" "3" "June 2015" "" ""
+.TH "NPM\-PUBLISH" "3" "July 2015" "" ""
.SH "NAME"
\fBnpm-publish\fR \- Publish a package
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-rebuild.3 b/deps/npm/man/man3/npm-rebuild.3
index 668e2c99ea0..5f09b055504 100644
--- a/deps/npm/man/man3/npm-rebuild.3
+++ b/deps/npm/man/man3/npm-rebuild.3
@@ -1,4 +1,4 @@
-.TH "NPM\-REBUILD" "3" "June 2015" "" ""
+.TH "NPM\-REBUILD" "3" "July 2015" "" ""
.SH "NAME"
\fBnpm-rebuild\fR \- Rebuild a package
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-repo.3 b/deps/npm/man/man3/npm-repo.3
index c88f5d22a47..ba421377a9a 100644
--- a/deps/npm/man/man3/npm-repo.3
+++ b/deps/npm/man/man3/npm-repo.3
@@ -1,4 +1,4 @@
-.TH "NPM\-REPO" "3" "June 2015" "" ""
+.TH "NPM\-REPO" "3" "July 2015" "" ""
.SH "NAME"
\fBnpm-repo\fR \- Open package repository page in the browser
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-restart.3 b/deps/npm/man/man3/npm-restart.3
index f792e500457..fef30139eb6 100644
--- a/deps/npm/man/man3/npm-restart.3
+++ b/deps/npm/man/man3/npm-restart.3
@@ -1,4 +1,4 @@
-.TH "NPM\-RESTART" "3" "June 2015" "" ""
+.TH "NPM\-RESTART" "3" "July 2015" "" ""
.SH "NAME"
\fBnpm-restart\fR \- Restart a package
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-root.3 b/deps/npm/man/man3/npm-root.3
index 1bcf8913c43..7c208f41fce 100644
--- a/deps/npm/man/man3/npm-root.3
+++ b/deps/npm/man/man3/npm-root.3
@@ -1,4 +1,4 @@
-.TH "NPM\-ROOT" "3" "June 2015" "" ""
+.TH "NPM\-ROOT" "3" "July 2015" "" ""
.SH "NAME"
\fBnpm-root\fR \- Display npm root
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-run-script.3 b/deps/npm/man/man3/npm-run-script.3
index 2ec6ff50c29..2908d02eaa0 100644
--- a/deps/npm/man/man3/npm-run-script.3
+++ b/deps/npm/man/man3/npm-run-script.3
@@ -1,4 +1,4 @@
-.TH "NPM\-RUN\-SCRIPT" "3" "June 2015" "" ""
+.TH "NPM\-RUN\-SCRIPT" "3" "July 2015" "" ""
.SH "NAME"
\fBnpm-run-script\fR \- Run arbitrary package scripts
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-search.3 b/deps/npm/man/man3/npm-search.3
index 7186d9d318a..b4cb98248b3 100644
--- a/deps/npm/man/man3/npm-search.3
+++ b/deps/npm/man/man3/npm-search.3
@@ -1,4 +1,4 @@
-.TH "NPM\-SEARCH" "3" "June 2015" "" ""
+.TH "NPM\-SEARCH" "3" "July 2015" "" ""
.SH "NAME"
\fBnpm-search\fR \- Search for packages
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-shrinkwrap.3 b/deps/npm/man/man3/npm-shrinkwrap.3
index e4047cde351..63d019aa749 100644
--- a/deps/npm/man/man3/npm-shrinkwrap.3
+++ b/deps/npm/man/man3/npm-shrinkwrap.3
@@ -1,4 +1,4 @@
-.TH "NPM\-SHRINKWRAP" "3" "June 2015" "" ""
+.TH "NPM\-SHRINKWRAP" "3" "July 2015" "" ""
.SH "NAME"
\fBnpm-shrinkwrap\fR \- programmatically generate package shrinkwrap file
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-start.3 b/deps/npm/man/man3/npm-start.3
index ef2c760c3f7..9200312fd2c 100644
--- a/deps/npm/man/man3/npm-start.3
+++ b/deps/npm/man/man3/npm-start.3
@@ -1,4 +1,4 @@
-.TH "NPM\-START" "3" "June 2015" "" ""
+.TH "NPM\-START" "3" "July 2015" "" ""
.SH "NAME"
\fBnpm-start\fR \- Start a package
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-stop.3 b/deps/npm/man/man3/npm-stop.3
index ed4b4c64cea..f857069e6ae 100644
--- a/deps/npm/man/man3/npm-stop.3
+++ b/deps/npm/man/man3/npm-stop.3
@@ -1,4 +1,4 @@
-.TH "NPM\-STOP" "3" "June 2015" "" ""
+.TH "NPM\-STOP" "3" "July 2015" "" ""
.SH "NAME"
\fBnpm-stop\fR \- Stop a package
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-submodule.3 b/deps/npm/man/man3/npm-submodule.3
deleted file mode 100644
index d2e23d7e8fc..00000000000
--- a/deps/npm/man/man3/npm-submodule.3
+++ /dev/null
@@ -1,41 +0,0 @@
-.\" Generated with Ronnjs 0.3.8
-.\" http://github.com/kapouer/ronnjs/
-.
-.TH "NPM\-SUBMODULE" "3" "September 2014" "" ""
-.
-.SH "NAME"
-\fBnpm-submodule\fR \-\- Add a package as a git submodule
-.
-.SH "SYNOPSIS"
-.
-.nf
-npm\.commands\.submodule(packages, callback)
-.
-.fi
-.
-.SH "DESCRIPTION"
-For each package specified, npm will check if it has a git repository url
-in its package\.json description then add it as a git submodule at \fBnode_modules/<pkg name>\fR\|\.
-.
-.P
-This is a convenience only\. From then on, it\'s up to you to manage
-updates by using the appropriate git commands\. npm will stubbornly
-refuse to update, modify, or remove anything with a \fB\|\.git\fR subfolder
-in it\.
-.
-.P
-This command also does not install missing dependencies, if the package
-does not include them in its git repository\. If \fBnpm ls\fR reports that
-things are missing, you can either install, link, or submodule them yourself,
-or you can do \fBnpm explore <pkgname> \-\- npm install\fR to install the
-dependencies into the submodule folder\.
-.
-.SH "SEE ALSO"
-.
-.IP "\(bu" 4
-npm help json
-.
-.IP "\(bu" 4
-git help submodule
-.
-.IP "" 0
diff --git a/deps/npm/man/man3/npm-tag.3 b/deps/npm/man/man3/npm-tag.3
index c60b49fc8ed..4eae2c4b0af 100644
--- a/deps/npm/man/man3/npm-tag.3
+++ b/deps/npm/man/man3/npm-tag.3
@@ -1,4 +1,4 @@
-.TH "NPM\-TAG" "3" "June 2015" "" ""
+.TH "NPM\-TAG" "3" "July 2015" "" ""
.SH "NAME"
\fBnpm-tag\fR \- Tag a published version
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-test.3 b/deps/npm/man/man3/npm-test.3
index 1cde98cb3a1..67aa24ad9c0 100644
--- a/deps/npm/man/man3/npm-test.3
+++ b/deps/npm/man/man3/npm-test.3
@@ -1,4 +1,4 @@
-.TH "NPM\-TEST" "3" "June 2015" "" ""
+.TH "NPM\-TEST" "3" "July 2015" "" ""
.SH "NAME"
\fBnpm-test\fR \- Test a package
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-uninstall.3 b/deps/npm/man/man3/npm-uninstall.3
index 0bd8ec3023c..d5027d84b14 100644
--- a/deps/npm/man/man3/npm-uninstall.3
+++ b/deps/npm/man/man3/npm-uninstall.3
@@ -1,4 +1,4 @@
-.TH "NPM\-UNINSTALL" "3" "June 2015" "" ""
+.TH "NPM\-UNINSTALL" "3" "July 2015" "" ""
.SH "NAME"
\fBnpm-uninstall\fR \- uninstall a package programmatically
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-unpublish.3 b/deps/npm/man/man3/npm-unpublish.3
index 5cbc92dc306..f9b333da5be 100644
--- a/deps/npm/man/man3/npm-unpublish.3
+++ b/deps/npm/man/man3/npm-unpublish.3
@@ -1,4 +1,4 @@
-.TH "NPM\-UNPUBLISH" "3" "June 2015" "" ""
+.TH "NPM\-UNPUBLISH" "3" "July 2015" "" ""
.SH "NAME"
\fBnpm-unpublish\fR \- Remove a package from the registry
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-update.3 b/deps/npm/man/man3/npm-update.3
index 4ac31fe1508..60f2d065efa 100644
--- a/deps/npm/man/man3/npm-update.3
+++ b/deps/npm/man/man3/npm-update.3
@@ -1,4 +1,4 @@
-.TH "NPM\-UPDATE" "3" "June 2015" "" ""
+.TH "NPM\-UPDATE" "3" "July 2015" "" ""
.SH "NAME"
\fBnpm-update\fR \- Update a package
.SH SYNOPSIS
@@ -8,7 +8,7 @@
npm\.commands\.update(packages, callback)
.fi
.RE
-.TH "DESCRIPTION" "" "June 2015" "" ""
+.TH "DESCRIPTION" "" "July 2015" "" ""
.SH "NAME"
\fBDESCRIPTION\fR
.P
diff --git a/deps/npm/man/man3/npm-version.3 b/deps/npm/man/man3/npm-version.3
index 61ed5d174a0..bbc5785d885 100644
--- a/deps/npm/man/man3/npm-version.3
+++ b/deps/npm/man/man3/npm-version.3
@@ -1,4 +1,4 @@
-.TH "NPM\-VERSION" "3" "June 2015" "" ""
+.TH "NPM\-VERSION" "3" "July 2015" "" ""
.SH "NAME"
\fBnpm-version\fR \- Bump a package version
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-view.3 b/deps/npm/man/man3/npm-view.3
index 2b8645ee80b..8722bf1ce8d 100644
--- a/deps/npm/man/man3/npm-view.3
+++ b/deps/npm/man/man3/npm-view.3
@@ -1,4 +1,4 @@
-.TH "NPM\-VIEW" "3" "June 2015" "" ""
+.TH "NPM\-VIEW" "3" "July 2015" "" ""
.SH "NAME"
\fBnpm-view\fR \- View registry info
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm-whoami.3 b/deps/npm/man/man3/npm-whoami.3
index 6f0fc323fd6..474ac65236e 100644
--- a/deps/npm/man/man3/npm-whoami.3
+++ b/deps/npm/man/man3/npm-whoami.3
@@ -1,4 +1,4 @@
-.TH "NPM\-WHOAMI" "3" "June 2015" "" ""
+.TH "NPM\-WHOAMI" "3" "July 2015" "" ""
.SH "NAME"
\fBnpm-whoami\fR \- Display npm username
.SH SYNOPSIS
diff --git a/deps/npm/man/man3/npm.3 b/deps/npm/man/man3/npm.3
index a27078deb1c..de1f5430395 100644
--- a/deps/npm/man/man3/npm.3
+++ b/deps/npm/man/man3/npm.3
@@ -1,4 +1,4 @@
-.TH "NPM" "3" "June 2015" "" ""
+.TH "NPM" "3" "July 2015" "" ""
.SH "NAME"
\fBnpm\fR \- javascript package manager
.SH SYNOPSIS
@@ -20,7 +20,7 @@ npm\.load([configObject, ]function (er, npm) {
.RE
.SH VERSION
.P
-2.11.3
+2.12.1
.SH DESCRIPTION
.P
This is the API documentation for npm\.
diff --git a/deps/npm/man/man5/npm-folders.5 b/deps/npm/man/man5/npm-folders.5
index 71816580cff..321b079edbc 100644
--- a/deps/npm/man/man5/npm-folders.5
+++ b/deps/npm/man/man5/npm-folders.5
@@ -1,4 +1,4 @@
-.TH "NPM\-FOLDERS" "5" "June 2015" "" ""
+.TH "NPM\-FOLDERS" "5" "July 2015" "" ""
.SH "NAME"
\fBnpm-folders\fR \- Folder Structures Used by npm
.SH DESCRIPTION
diff --git a/deps/npm/man/man5/npm-global.5 b/deps/npm/man/man5/npm-global.5
index 71816580cff..321b079edbc 100644
--- a/deps/npm/man/man5/npm-global.5
+++ b/deps/npm/man/man5/npm-global.5
@@ -1,4 +1,4 @@
-.TH "NPM\-FOLDERS" "5" "June 2015" "" ""
+.TH "NPM\-FOLDERS" "5" "July 2015" "" ""
.SH "NAME"
\fBnpm-folders\fR \- Folder Structures Used by npm
.SH DESCRIPTION
diff --git a/deps/npm/man/man5/npm-json.5 b/deps/npm/man/man5/npm-json.5
index ed3ee7c241a..855b5bd0e27 100644
--- a/deps/npm/man/man5/npm-json.5
+++ b/deps/npm/man/man5/npm-json.5
@@ -1,4 +1,4 @@
-.TH "PACKAGE\.JSON" "5" "June 2015" "" ""
+.TH "PACKAGE\.JSON" "5" "July 2015" "" ""
.SH "NAME"
\fBpackage.json\fR \- Specifics of npm's package\.json handling
.SH DESCRIPTION
@@ -134,11 +134,11 @@ you are using a custom license, use the following valid SPDX expression:
.P
.RS 2
.nf
-{ "license" : "LicenseRef\-LICENSE" }
+{ "license" : "SEE LICENSE IN <filename>" }
.fi
.RE
.P
-Then include a LICENSE file at the top level of the package\.
+Then include a file named \fB<filename>\fR at the top level of the package\.
.P
Some old packages used license objects or a "licenses" property containing an
array of license objects:
@@ -175,6 +175,17 @@ Those styles are now deprecated\. Instead, use SPDX expressions, like this:
{ "license": "(MIT OR Apache\-2\.0)" }
.fi
.RE
+.P
+Finally, if you do not wish to grant others the right to use a private or
+unpublished package under any terms:
+.P
+.RS 2
+.nf
+{ "license": "UNLICENSED"}
+.fi
+.RE
+.P
+Consider also setting \fB"private": true\fR to prevent accidental publication\.
.SH people fields: author, contributors
.P
The "author" is one person\. "contributors" is an array of people\. A "person"
diff --git a/deps/npm/man/man5/npmrc.5 b/deps/npm/man/man5/npmrc.5
index 172b909b824..e867f54e40f 100644
--- a/deps/npm/man/man5/npmrc.5
+++ b/deps/npm/man/man5/npmrc.5
@@ -1,4 +1,4 @@
-.TH "NPMRC" "5" "June 2015" "" ""
+.TH "NPMRC" "5" "July 2015" "" ""
.SH "NAME"
\fBnpmrc\fR \- The npm config files
.SH DESCRIPTION
diff --git a/deps/npm/man/man5/package.json.5 b/deps/npm/man/man5/package.json.5
index ed3ee7c241a..855b5bd0e27 100644
--- a/deps/npm/man/man5/package.json.5
+++ b/deps/npm/man/man5/package.json.5
@@ -1,4 +1,4 @@
-.TH "PACKAGE\.JSON" "5" "June 2015" "" ""
+.TH "PACKAGE\.JSON" "5" "July 2015" "" ""
.SH "NAME"
\fBpackage.json\fR \- Specifics of npm's package\.json handling
.SH DESCRIPTION
@@ -134,11 +134,11 @@ you are using a custom license, use the following valid SPDX expression:
.P
.RS 2
.nf
-{ "license" : "LicenseRef\-LICENSE" }
+{ "license" : "SEE LICENSE IN <filename>" }
.fi
.RE
.P
-Then include a LICENSE file at the top level of the package\.
+Then include a file named \fB<filename>\fR at the top level of the package\.
.P
Some old packages used license objects or a "licenses" property containing an
array of license objects:
@@ -175,6 +175,17 @@ Those styles are now deprecated\. Instead, use SPDX expressions, like this:
{ "license": "(MIT OR Apache\-2\.0)" }
.fi
.RE
+.P
+Finally, if you do not wish to grant others the right to use a private or
+unpublished package under any terms:
+.P
+.RS 2
+.nf
+{ "license": "UNLICENSED"}
+.fi
+.RE
+.P
+Consider also setting \fB"private": true\fR to prevent accidental publication\.
.SH people fields: author, contributors
.P
The "author" is one person\. "contributors" is an array of people\. A "person"
diff --git a/deps/npm/man/man7/npm-coding-style.7 b/deps/npm/man/man7/npm-coding-style.7
index ce9923214e0..d2ef01785a8 100644
--- a/deps/npm/man/man7/npm-coding-style.7
+++ b/deps/npm/man/man7/npm-coding-style.7
@@ -1,4 +1,4 @@
-.TH "NPM\-CODING\-STYLE" "7" "June 2015" "" ""
+.TH "NPM\-CODING\-STYLE" "7" "July 2015" "" ""
.SH "NAME"
\fBnpm-coding-style\fR \- npm's "funny" coding style
.SH DESCRIPTION
diff --git a/deps/npm/man/man7/npm-config.7 b/deps/npm/man/man7/npm-config.7
index 5e4a9a2af7a..ce56bc69443 100644
--- a/deps/npm/man/man7/npm-config.7
+++ b/deps/npm/man/man7/npm-config.7
@@ -1,4 +1,4 @@
-.TH "NPM\-CONFIG" "7" "June 2015" "" ""
+.TH "NPM\-CONFIG" "7" "July 2015" "" ""
.SH "NAME"
\fBnpm-config\fR \- More than you probably want to know about npm configuration
.SH DESCRIPTION
diff --git a/deps/npm/man/man7/npm-developers.7 b/deps/npm/man/man7/npm-developers.7
index 3709946de31..560d17e7564 100644
--- a/deps/npm/man/man7/npm-developers.7
+++ b/deps/npm/man/man7/npm-developers.7
@@ -1,4 +1,4 @@
-.TH "NPM\-DEVELOPERS" "7" "June 2015" "" ""
+.TH "NPM\-DEVELOPERS" "7" "July 2015" "" ""
.SH "NAME"
\fBnpm-developers\fR \- Developer Guide
.SH DESCRIPTION
diff --git a/deps/npm/man/man7/npm-disputes.7 b/deps/npm/man/man7/npm-disputes.7
index a740f66d574..fe98cec5943 100644
--- a/deps/npm/man/man7/npm-disputes.7
+++ b/deps/npm/man/man7/npm-disputes.7
@@ -1,4 +1,4 @@
-.TH "NPM\-DISPUTES" "7" "June 2015" "" ""
+.TH "NPM\-DISPUTES" "7" "July 2015" "" ""
.SH "NAME"
\fBnpm-disputes\fR \- Handling Module Name Disputes
.SH SYNOPSIS
diff --git a/deps/npm/man/man7/npm-faq.7 b/deps/npm/man/man7/npm-faq.7
index 1ee30f51634..a21de1c4eac 100644
--- a/deps/npm/man/man7/npm-faq.7
+++ b/deps/npm/man/man7/npm-faq.7
@@ -1,4 +1,4 @@
-.TH "NPM\-FAQ" "7" "June 2015" "" ""
+.TH "NPM\-FAQ" "7" "July 2015" "" ""
.SH "NAME"
\fBnpm-faq\fR \- Frequently Asked Questions
.SH Where can I find these docs in HTML?
diff --git a/deps/npm/man/man7/npm-index.7 b/deps/npm/man/man7/npm-index.7
index 413e94b66eb..f0db12127b2 100644
--- a/deps/npm/man/man7/npm-index.7
+++ b/deps/npm/man/man7/npm-index.7
@@ -1,4 +1,4 @@
-.TH "NPM\-INDEX" "7" "June 2015" "" ""
+.TH "NPM\-INDEX" "7" "July 2015" "" ""
.SH "NAME"
\fBnpm-index\fR \- Index of all npm documentation
.SS npm help README
diff --git a/deps/npm/man/man7/npm-registry.7 b/deps/npm/man/man7/npm-registry.7
index 0121ee552fa..9f4914e9a0b 100644
--- a/deps/npm/man/man7/npm-registry.7
+++ b/deps/npm/man/man7/npm-registry.7
@@ -1,4 +1,4 @@
-.TH "NPM\-REGISTRY" "7" "June 2015" "" ""
+.TH "NPM\-REGISTRY" "7" "July 2015" "" ""
.SH "NAME"
\fBnpm-registry\fR \- The JavaScript Package Registry
.SH DESCRIPTION
diff --git a/deps/npm/man/man7/npm-scope.7 b/deps/npm/man/man7/npm-scope.7
index 29586c7a739..f79d7e51cb9 100644
--- a/deps/npm/man/man7/npm-scope.7
+++ b/deps/npm/man/man7/npm-scope.7
@@ -1,4 +1,4 @@
-.TH "NPM\-SCOPE" "7" "June 2015" "" ""
+.TH "NPM\-SCOPE" "7" "July 2015" "" ""
.SH "NAME"
\fBnpm-scope\fR \- Scoped packages
.SH DESCRIPTION
diff --git a/deps/npm/man/man7/npm-scripts.7 b/deps/npm/man/man7/npm-scripts.7
index cdd740396e8..bcd8af8395a 100644
--- a/deps/npm/man/man7/npm-scripts.7
+++ b/deps/npm/man/man7/npm-scripts.7
@@ -1,4 +1,4 @@
-.TH "NPM\-SCRIPTS" "7" "June 2015" "" ""
+.TH "NPM\-SCRIPTS" "7" "July 2015" "" ""
.SH "NAME"
\fBnpm-scripts\fR \- How npm handles the "scripts" field
.SH DESCRIPTION
diff --git a/deps/npm/man/man7/removing-npm.7 b/deps/npm/man/man7/removing-npm.7
index 61426f8b9fe..e3fa17eba8c 100644
--- a/deps/npm/man/man7/removing-npm.7
+++ b/deps/npm/man/man7/removing-npm.7
@@ -1,4 +1,4 @@
-.TH "NPM\-REMOVAL" "1" "June 2015" "" ""
+.TH "NPM\-REMOVAL" "1" "July 2015" "" ""
.SH "NAME"
\fBnpm-removal\fR \- Cleaning the Slate
.SH SYNOPSIS
diff --git a/deps/npm/man/man7/semver.7 b/deps/npm/man/man7/semver.7
index cac3ad61719..78a1993a50a 100644
--- a/deps/npm/man/man7/semver.7
+++ b/deps/npm/man/man7/semver.7
@@ -1,4 +1,4 @@
-.TH "SEMVER" "7" "June 2015" "" ""
+.TH "SEMVER" "7" "July 2015" "" ""
.SH "NAME"
\fBsemver\fR \- The semantic versioner for npm
.SH Usage
diff --git a/deps/npm/node_modules/dezalgo/.travis.yml b/deps/npm/node_modules/dezalgo/.travis.yml
new file mode 100644
index 00000000000..e1bcee1acd9
--- /dev/null
+++ b/deps/npm/node_modules/dezalgo/.travis.yml
@@ -0,0 +1,7 @@
+language: node_js
+before_script: npm install -g npm@latest
+node_js:
+ - '0.8'
+ - '0.10'
+ - '0.12'
+ - 'iojs'
diff --git a/deps/npm/node_modules/dezalgo/node_modules/asap/CHANGES.md b/deps/npm/node_modules/dezalgo/node_modules/asap/CHANGES.md
new file mode 100644
index 00000000000..8e6202305ae
--- /dev/null
+++ b/deps/npm/node_modules/dezalgo/node_modules/asap/CHANGES.md
@@ -0,0 +1,63 @@
+
+## 2.0.3
+
+Version 2.0.3 fixes a bug when adjusting the capacity of the task queue.
+
+## 2.0.1-2.02
+
+Version 2.0.1 fixes a bug in the way redirects were expressed that affected the
+function of Browserify, but which Mr would tolerate.
+
+## 2.0.0
+
+Version 2 of ASAP is a full rewrite with a few salient changes.
+First, the ASAP source is CommonJS only and designed with [Browserify][] and
+[Browserify-compatible][Mr] module loaders in mind.
+
+[Browserify]: https://github.com/substack/node-browserify
+[Mr]: https://github.com/montagejs/mr
+
+The new version has been refactored in two dimensions.
+Support for Node.js and browsers have been separated, using Browserify
+redirects and ASAP has been divided into two modules.
+The "raw" layer depends on the tasks to catch thrown exceptions and unravel
+Node.js domains.
+
+The full implementation of ASAP is loadable as `require("asap")` in both Node.js
+and browsers.
+
+The raw layer that lacks exception handling overhead is loadable as
+`require("asap/raw")`.
+The interface is the same for both layers.
+
+Tasks are no longer required to be functions, but can rather be any object that
+implements `task.call()`.
+With this feature you can recycle task objects to avoid garbage collector churn
+and avoid closures in general.
+
+The implementation has been rigorously documented so that our successors can
+understand the scope of the problem that this module solves and all of its
+nuances, ensuring that the next generation of implementations know what details
+are essential.
+
+- [asap.js](https://github.com/kriskowal/asap/blob/master/asap.js)
+- [raw.js](https://github.com/kriskowal/asap/blob/master/raw.js)
+- [browser-asap.js](https://github.com/kriskowal/asap/blob/master/browser-asap.js)
+- [browser-raw.js](https://github.com/kriskowal/asap/blob/master/browser-raw.js)
+
+The new version has also been rigorously tested across a broad spectrum of
+browsers, in both the window and worker context.
+The following charts capture the browser test results for the most recent
+release.
+The first chart shows test results for ASAP running in the main window context.
+The second chart shows test results for ASAP running in a web worker context.
+Test results are inconclusive (grey) on browsers that do not support web
+workers.
+These data are captured automatically by [Continuous
+Integration][].
+
+![Browser Compatibility](http://kriskowal-asap.s3-website-us-west-2.amazonaws.com/train/integration-2/saucelabs-results-matrix.svg)
+
+![Compatibility in Web Workers](http://kriskowal-asap.s3-website-us-west-2.amazonaws.com/train/integration-2/saucelabs-worker-results-matrix.svg)
+
+[Continuous Integration]: https://github.com/kriskowal/asap/blob/master/CONTRIBUTING.md
diff --git a/deps/npm/node_modules/dezalgo/node_modules/asap/LICENSE.md b/deps/npm/node_modules/dezalgo/node_modules/asap/LICENSE.md
index 5d98ad8fe99..ba18c61390d 100644
--- a/deps/npm/node_modules/dezalgo/node_modules/asap/LICENSE.md
+++ b/deps/npm/node_modules/dezalgo/node_modules/asap/LICENSE.md
@@ -1,5 +1,6 @@
-Copyright 2009–2013 Contributors. All rights reserved.
+Copyright 2009–2014 Contributors. All rights reserved.
+
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
diff --git a/deps/npm/node_modules/dezalgo/node_modules/asap/README.md b/deps/npm/node_modules/dezalgo/node_modules/asap/README.md
index 9a42759761d..452fd8c2037 100644
--- a/deps/npm/node_modules/dezalgo/node_modules/asap/README.md
+++ b/deps/npm/node_modules/dezalgo/node_modules/asap/README.md
@@ -1,9 +1,14 @@
-
# ASAP
-This `asap` CommonJS package contains a single `asap` module that
-exports a single `asap` function that executes a function **as soon as
-possible**.
+[![Build Status](https://travis-ci.org/kriskowal/asap.png?branch=master)](https://travis-ci.org/kriskowal/asap)
+
+Promise and asynchronous observer libraries, as well as hand-rolled callback
+programs and libraries, often need a mechanism to postpone the execution of a
+callback until the next available event.
+(See [Designing API’s for Asynchrony][Zalgo].)
+The `asap` function executes a task **as soon as possible** but not before it
+returns, waiting only for the completion of the current event and previously
+scheduled tasks.
```javascript
asap(function () {
@@ -11,27 +16,54 @@ asap(function () {
});
```
-More formally, ASAP provides a fast event queue that will execute tasks
-until it is empty before yielding to the JavaScript engine's underlying
-event-loop. When the event queue becomes non-empty, ASAP schedules a
-flush event, preferring for that event to occur before the JavaScript
-engine has an opportunity to perform IO tasks or rendering, thus making
-the first task and subsequent tasks semantically indistinguishable.
-ASAP uses a variety of techniques to preserve this invariant on
-different versions of browsers and NodeJS.
-
-By design, ASAP can starve the event loop on the theory that, if there
-is enough work to be done synchronously, albeit in separate events, long
-enough to starve input or output, it is a strong indicator that the
-program needs to push back on scheduling more work.
-
-Take care. ASAP can sustain infinite recursive calls indefinitely
-without warning. This is behaviorally equivalent to an infinite loop.
-It will not halt from a stack overflow, but it *will* chew through
-memory (which is an oddity I cannot explain at this time). Just as with
-infinite loops, you can monitor a Node process for this behavior with a
-heart-beat signal. As with infinite loops, a very small amount of
-caution goes a long way to avoiding problems.
+[Zalgo]: http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony
+
+This CommonJS package provides an `asap` module that exports a function that
+executes a task function *as soon as possible*.
+
+ASAP strives to schedule events to occur before yielding for IO, reflow,
+or redrawing.
+Each event receives an independent stack, with only platform code in parent
+frames and the events run in the order they are scheduled.
+
+ASAP provides a fast event queue that will execute tasks until it is
+empty before yielding to the JavaScript engine's underlying event-loop.
+When a task gets added to a previously empty event queue, ASAP schedules a flush
+event, preferring for that event to occur before the JavaScript engine has an
+opportunity to perform IO tasks or rendering, thus making the first task and
+subsequent tasks semantically indistinguishable.
+ASAP uses a variety of techniques to preserve this invariant on different
+versions of browsers and Node.js.
+
+By design, ASAP prevents input events from being handled until the task
+queue is empty.
+If the process is busy enough, this may cause incoming connection requests to be
+dropped, and may cause existing connections to inform the sender to reduce the
+transmission rate or stall.
+ASAP allows this on the theory that, if there is enough work to do, there is no
+sense in looking for trouble.
+As a consequence, ASAP can interfere with smooth animation.
+If your task should be tied to the rendering loop, consider using
+`requestAnimationFrame` instead.
+A long sequence of tasks can also effect the long running script dialog.
+If this is a problem, you may be able to use ASAP’s cousin `setImmediate` to
+break long processes into shorter intervals and periodically allow the browser
+to breathe.
+`setImmediate` will yield for IO, reflow, and repaint events.
+It also returns a handler and can be canceled.
+For a `setImmediate` shim, consider [YuzuJS setImmediate][setImmediate].
+
+[setImmediate]: https://github.com/YuzuJS/setImmediate
+
+Take care.
+ASAP can sustain infinite recursive calls without warning.
+It will not halt from a stack overflow, and it will not consume unbounded
+memory.
+This is behaviorally equivalent to an infinite loop.
+Just as with infinite loops, you can monitor a Node.js process for this behavior
+with a heart-beat signal.
+As with infinite loops, a very small amount of caution goes a long way to
+avoiding problems.
```javascript
function loop() {
@@ -40,16 +72,113 @@ function loop() {
loop();
```
-ASAP is distinct from `setImmediate` in that it does not suffer the
-overhead of returning a handle and being possible to cancel. For a
-`setImmediate` shim, consider [setImmediate][].
+In browsers, if a task throws an exception, it will not interrupt the flushing
+of high-priority tasks.
+The exception will be postponed to a later, low-priority event to avoid
+slow-downs.
+In Node.js, if a task throws an exception, ASAP will resume flushing only if—and
+only after—the error is handled by `domain.on("error")` or
+`process.on("uncaughtException")`.
+
+## Raw ASAP
+
+Checking for exceptions comes at a cost.
+The package also provides an `asap/raw` module that exports the underlying
+implementation which is faster but stalls if a task throws an exception.
+This internal version of the ASAP function does not check for errors.
+If a task does throw an error, it will stall the event queue unless you manually
+call `rawAsap.requestFlush()` before throwing the error, or any time after.
+
+In Node.js, `asap/raw` also runs all tasks outside any domain.
+If you need a task to be bound to your domain, you will have to do it manually.
+
+```js
+if (process.domain) {
+ task = process.domain.bind(task);
+}
+rawAsap(task);
+```
+
+## Tasks
+
+A task may be any object that implements `call()`.
+A function will suffice, but closures tend not to be reusable and can cause
+garbage collector churn.
+Both `asap` and `rawAsap` accept task objects to give you the option of
+recycling task objects or using higher callable object abstractions.
+See the `asap` source for an illustration.
+
+
+## Compatibility
+
+ASAP is tested on Node.js v0.10 and in a broad spectrum of web browsers.
+The following charts capture the browser test results for the most recent
+release.
+The first chart shows test results for ASAP running in the main window context.
+The second chart shows test results for ASAP running in a web worker context.
+Test results are inconclusive (grey) on browsers that do not support web
+workers.
+These data are captured automatically by [Continuous
+Integration][].
+
+[Continuous Integration]: https://github.com/kriskowal/asap/blob/master/CONTRIBUTING.md
+
+![Browser Compatibility](http://kriskowal-asap.s3-website-us-west-2.amazonaws.com/train/integration-2/saucelabs-results-matrix.svg)
-[setImmediate]: https://github.com/noblejs/setimmediate
+![Compatibility in Web Workers](http://kriskowal-asap.s3-website-us-west-2.amazonaws.com/train/integration-2/saucelabs-worker-results-matrix.svg)
+
+## Caveats
+
+When a task is added to an empty event queue, it is not always possible to
+guarantee that the task queue will begin flushing immediately after the current
+event.
+However, once the task queue begins flushing, it will not yield until the queue
+is empty, even if the queue grows while executing tasks.
+
+The following browsers allow the use of [DOM mutation observers][] to access
+the HTML [microtask queue][], and thus begin flushing ASAP's task queue
+immediately at the end of the current event loop turn, before any rendering or
+IO:
+
+[microtask queue]: http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#microtask-queue
+[DOM mutation observers]: http://dom.spec.whatwg.org/#mutation-observers
+
+- Android 4–4.3
+- Chrome 26–34
+- Firefox 14–29
+- Internet Explorer 11
+- iPad Safari 6–7.1
+- iPhone Safari 7–7.1
+- Safari 6–7
+
+In the absense of mutation observers, there are a few browsers, and situations
+like web workers in some of the above browsers, where [message channels][]
+would be a useful way to avoid falling back to timers.
+Message channels give direct access to the HTML [task queue][], so the ASAP
+task queue would flush after any already queued rendering and IO tasks, but
+without having the minimum delay imposed by timers.
+However, among these browsers, Internet Explorer 10 and Safari do not reliably
+dispatch messages, so they are not worth the trouble to implement.
+
+[message channels]: http://www.whatwg.org/specs/web-apps/current-work/multipage/web-messaging.html#message-channels
+[task queue]: http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#concept-task
+
+- Internet Explorer 10
+- Safair 5.0-1
+- Opera 11-12
+
+In the absense of mutation observers, these browsers and the following browsers
+all fall back to using `setTimeout` and `setInterval` to ensure that a `flush`
+occurs.
+The implementation uses both and cancels whatever handler loses the race, since
+`setTimeout` tends to occasionally skip tasks in unisolated circumstances.
+Timers generally delay the flushing of ASAP's task queue for four milliseconds.
+
+- Firefox 3–13
+- Internet Explorer 6–10
+- iPad Safari 4.3
+- Lynx 2.8.7
-If a task throws an exception, it will not interrupt the flushing of
-high-priority tasks. The exception will be postponed to a later,
-low-priority event to avoid slow-downs, when the underlying JavaScript
-engine will treat it as it does any unhandled exception.
## Heritage
@@ -58,13 +187,13 @@ It originally had a naïve implementation in terms of `setTimeout`, but
[Malte Ubl][NonBlocking] provided an insight that `postMessage` might be
useful for creating a high-priority, no-delay event dispatch hack.
Since then, Internet Explorer proposed and implemented `setImmediate`.
-Robert Kratić began contributing to Q by measuring the performance of
+Robert Katić began contributing to Q by measuring the performance of
the internal implementation of `asap`, paying particular attention to
-error recovery. Domenic, Robert, and I collectively settled on the
-current strategy of unrolling the high-priority event queue internally
-regardless of what strategy we used to dispatch the potentially
-lower-priority flush event. Domenic went on to make ASAP cooperate with
-NodeJS domains.
+error recovery.
+Domenic, Robert, and Kris Kowal collectively settled on the current strategy of
+unrolling the high-priority event queue internally regardless of what strategy
+we used to dispatch the potentially lower-priority flush event.
+Domenic went on to make ASAP cooperate with Node.js domains.
[Q]: https://github.com/kriskowal/q
[NonBlocking]: http://www.nonblocking.io/2011/06/windownexttick.html
@@ -74,8 +203,35 @@ Case for setImmediate][NCZ].
[NCZ]: http://www.nczonline.net/blog/2013/07/09/the-case-for-setimmediate/
+Ember’s RSVP promise implementation later [adopted][RSVP ASAP] the name ASAP but
+further developed the implentation.
+Particularly, The `MessagePort` implementation was abandoned due to interaction
+[problems with Mobile Internet Explorer][IE Problems] in favor of an
+implementation backed on the newer and more reliable DOM `MutationObserver`
+interface.
+These changes were back-ported into this library.
+
+[IE Problems]: https://github.com/cujojs/when/issues/197
+[RSVP ASAP]: https://github.com/tildeio/rsvp.js/blob/cddf7232546a9cf858524b75cde6f9edf72620a7/lib/rsvp/asap.js
+
+In addition, ASAP factored into `asap` and `asap/raw`, such that `asap` remained
+exception-safe, but `asap/raw` provided a tight kernel that could be used for
+tasks that guaranteed that they would not throw exceptions.
+This core is useful for promise implementations that capture thrown errors in
+rejected promises and do not need a second safety net.
+At the same time, the exception handling in `asap` was factored into separate
+implementations for Node.js and browsers, using the the [Browserify][Browser
+Config] `browser` property in `package.json` to instruct browser module loaders
+and bundlers, including [Browserify][], [Mr][], and [Mop][], to use the
+browser-only implementation.
+
+[Browser Config]: https://gist.github.com/defunctzombie/4339901
+[Browserify]: https://github.com/substack/node-browserify
+[Mr]: https://github.com/montagejs/mr
+[Mop]: https://github.com/montagejs/mop
+
## License
-Copyright 2009-2013 by Contributors
+Copyright 2009-2014 by Contributors
MIT License (enclosed)
diff --git a/deps/npm/node_modules/dezalgo/node_modules/asap/asap.js b/deps/npm/node_modules/dezalgo/node_modules/asap/asap.js
index 2f85516cde0..f04fcd58fc0 100644
--- a/deps/npm/node_modules/dezalgo/node_modules/asap/asap.js
+++ b/deps/npm/node_modules/dezalgo/node_modules/asap/asap.js
@@ -1,113 +1,65 @@
-
-// Use the fastest possible means to execute a task in a future turn
-// of the event loop.
-
-// linked list of tasks (single, with head node)
-var head = {task: void 0, next: null};
-var tail = head;
-var flushing = false;
-var requestFlush = void 0;
-var isNodeJS = false;
-
-function flush() {
- /* jshint loopfunc: true */
-
- while (head.next) {
- head = head.next;
- var task = head.task;
- head.task = void 0;
- var domain = head.domain;
-
- if (domain) {
- head.domain = void 0;
- domain.enter();
- }
-
- try {
- task();
-
- } catch (e) {
- if (isNodeJS) {
- // In node, uncaught exceptions are considered fatal errors.
- // Re-throw them synchronously to interrupt flushing!
-
- // Ensure continuation if the uncaught exception is suppressed
- // listening "uncaughtException" events (as domains does).
- // Continue in next event to avoid tick recursion.
- if (domain) {
- domain.exit();
- }
- setTimeout(flush, 0);
- if (domain) {
- domain.enter();
- }
-
- throw e;
-
- } else {
- // In browsers, uncaught exceptions are not fatal.
- // Re-throw them asynchronously to avoid slow-downs.
- setTimeout(function() {
- throw e;
- }, 0);
- }
- }
-
- if (domain) {
- domain.exit();
- }
- }
-
- flushing = false;
-}
-
-if (typeof process !== "undefined" && process.nextTick) {
- // Node.js before 0.9. Note that some fake-Node environments, like the
- // Mocha test runner, introduce a `process` global without a `nextTick`.
- isNodeJS = true;
-
- requestFlush = function () {
- process.nextTick(flush);
- };
-
-} else if (typeof setImmediate === "function") {
- // In IE10, Node.js 0.9+, or https://github.com/NobleJS/setImmediate
- if (typeof window !== "undefined") {
- requestFlush = setImmediate.bind(window, flush);
+"use strict";
+
+var rawAsap = require("./raw");
+var freeTasks = [];
+
+/**
+ * Calls a task as soon as possible after returning, in its own event, with
+ * priority over IO events. An exception thrown in a task can be handled by
+ * `process.on("uncaughtException") or `domain.on("error")`, but will otherwise
+ * crash the process. If the error is handled, all subsequent tasks will
+ * resume.
+ *
+ * @param {{call}} task A callable object, typically a function that takes no
+ * arguments.
+ */
+module.exports = asap;
+function asap(task) {
+ var rawTask;
+ if (freeTasks.length) {
+ rawTask = freeTasks.pop();
} else {
- requestFlush = function () {
- setImmediate(flush);
- };
+ rawTask = new RawTask();
}
-
-} else if (typeof MessageChannel !== "undefined") {
- // modern browsers
- // http://www.nonblocking.io/2011/06/windownexttick.html
- var channel = new MessageChannel();
- channel.port1.onmessage = flush;
- requestFlush = function () {
- channel.port2.postMessage(0);
- };
-
-} else {
- // old browsers
- requestFlush = function () {
- setTimeout(flush, 0);
- };
+ rawTask.task = task;
+ rawTask.domain = process.domain;
+ rawAsap(rawTask);
}
-function asap(task) {
- tail = tail.next = {
- task: task,
- domain: isNodeJS && process.domain,
- next: null
- };
+function RawTask() {
+ this.task = null;
+ this.domain = null;
+}
- if (!flushing) {
- flushing = true;
- requestFlush();
+RawTask.prototype.call = function () {
+ if (this.domain) {
+ this.domain.enter();
+ }
+ var threw = true;
+ try {
+ this.task.call();
+ threw = false;
+ // If the task throws an exception (presumably) Node.js restores the
+ // domain stack for the next event.
+ if (this.domain) {
+ this.domain.exit();
+ }
+ } finally {
+ // We use try/finally and a threw flag to avoid messing up stack traces
+ // when we catch and release errors.
+ if (threw) {
+ // In Node.js, uncaught exceptions are considered fatal errors.
+ // Re-throw them to interrupt flushing!
+ // Ensure that flushing continues if an uncaught exception is
+ // suppressed listening process.on("uncaughtException") or
+ // domain.on("error").
+ rawAsap.requestFlush();
+ }
+ // If the task threw an error, we do not want to exit the domain here.
+ // Exiting the domain would prevent the domain from catching the error.
+ this.task = null;
+ this.domain = null;
+ freeTasks.push(this);
}
};
-module.exports = asap;
-
diff --git a/deps/npm/node_modules/dezalgo/node_modules/asap/browser-asap.js b/deps/npm/node_modules/dezalgo/node_modules/asap/browser-asap.js
new file mode 100644
index 00000000000..805c9824605
--- /dev/null
+++ b/deps/npm/node_modules/dezalgo/node_modules/asap/browser-asap.js
@@ -0,0 +1,66 @@
+"use strict";
+
+// rawAsap provides everything we need except exception management.
+var rawAsap = require("./raw");
+// RawTasks are recycled to reduce GC churn.
+var freeTasks = [];
+// We queue errors to ensure they are thrown in right order (FIFO).
+// Array-as-queue is good enough here, since we are just dealing with exceptions.
+var pendingErrors = [];
+var requestErrorThrow = rawAsap.makeRequestCallFromTimer(throwFirstError);
+
+function throwFirstError() {
+ if (pendingErrors.length) {
+ throw pendingErrors.shift();
+ }
+}
+
+/**
+ * Calls a task as soon as possible after returning, in its own event, with priority
+ * over other events like animation, reflow, and repaint. An error thrown from an
+ * event will not interrupt, nor even substantially slow down the processing of
+ * other events, but will be rather postponed to a lower priority event.
+ * @param {{call}} task A callable object, typically a function that takes no
+ * arguments.
+ */
+module.exports = asap;
+function asap(task) {
+ var rawTask;
+ if (freeTasks.length) {
+ rawTask = freeTasks.pop();
+ } else {
+ rawTask = new RawTask();
+ }
+ rawTask.task = task;
+ rawAsap(rawTask);
+}
+
+// We wrap tasks with recyclable task objects. A task object implements
+// `call`, just like a function.
+function RawTask() {
+ this.task = null;
+}
+
+// The sole purpose of wrapping the task is to catch the exception and recycle
+// the task object after its single use.
+RawTask.prototype.call = function () {
+ try {
+ this.task.call();
+ } catch (error) {
+ if (asap.onerror) {
+ // This hook exists purely for testing purposes.
+ // Its name will be periodically randomized to break any code that
+ // depends on its existence.
+ asap.onerror(error);
+ } else {
+ // In a web browser, exceptions are not fatal. However, to avoid
+ // slowing down the queue of pending tasks, we rethrow the error in a
+ // lower priority turn.
+ pendingErrors.push(error);
+ requestErrorThrow();
+ }
+ } finally {
+ this.task = null;
+ freeTasks[freeTasks.length] = this;
+ }
+};
diff --git a/deps/npm/node_modules/dezalgo/node_modules/asap/browser-raw.js b/deps/npm/node_modules/dezalgo/node_modules/asap/browser-raw.js
new file mode 100644
index 00000000000..1cfd77293b6
--- /dev/null
+++ b/deps/npm/node_modules/dezalgo/node_modules/asap/browser-raw.js
@@ -0,0 +1,220 @@
+"use strict";
+
+// Use the fastest means possible to execute a task in its own turn, with
+// priority over other events including IO, animation, reflow, and redraw
+// events in browsers.
+//
+// An exception thrown by a task will permanently interrupt the processing of
+// subsequent tasks. The higher level `asap` function ensures that if an
+// exception is thrown by a task, that the task queue will continue flushing as
+// soon as possible, but if you use `rawAsap` directly, you are responsible to
+// either ensure that no exceptions are thrown from your task, or to manually
+// call `rawAsap.requestFlush` if an exception is thrown.
+module.exports = rawAsap;
+function rawAsap(task) {
+ if (!queue.length) {
+ requestFlush();
+ flushing = true;
+ }
+ // Equivalent to push, but avoids a function call.
+ queue[queue.length] = task;
+}
+
+var queue = [];
+// Once a flush has been requested, no further calls to `requestFlush` are
+// necessary until the next `flush` completes.
+var flushing = false;
+// `requestFlush` is an implementation-specific method that attempts to kick
+// off a `flush` event as quickly as possible. `flush` will attempt to exhaust
+// the event queue before yielding to the browser's own event loop.
+var requestFlush;
+// The position of the next task to execute in the task queue. This is
+// preserved between calls to `flush` so that it can be resumed if
+// a task throws an exception.
+var index = 0;
+// If a task schedules additional tasks recursively, the task queue can grow
+// unbounded. To prevent memory exhaustion, the task queue will periodically
+// truncate already-completed tasks.
+var capacity = 1024;
+
+// The flush function processes all tasks that have been scheduled with
+// `rawAsap` unless and until one of those tasks throws an exception.
+// If a task throws an exception, `flush` ensures that its state will remain
+// consistent and will resume where it left off when called again.
+// However, `flush` does not make any arrangements to be called again if an
+// exception is thrown.
+function flush() {
+ while (index < queue.length) {
+ var currentIndex = index;
+ // Advance the index before calling the task. This ensures that we will
+ // begin flushing on the next task the task throws an error.
+ index = index + 1;
+ queue[currentIndex].call();
+ // Prevent leaking memory for long chains of recursive calls to `asap`.
+ // If we call `asap` within tasks scheduled by `asap`, the queue will
+ // grow, but to avoid an O(n) walk for every task we execute, we don't
+ // shift tasks off the queue after they have been executed.
+ // Instead, we periodically shift 1024 tasks off the queue.
+ if (index > capacity) {
+ // Manually shift all values starting at the index back to the
+ // beginning of the queue.
+ for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {
+ queue[scan] = queue[scan + index];
+ }
+ queue.length -= index;
+ index = 0;
+ }
+ }
+ queue.length = 0;
+ index = 0;
+ flushing = false;
+}
+
+// `requestFlush` is implemented using a strategy based on data collected from
+// every available SauceLabs Selenium web driver worker at time of writing.
+// https://docs.google.com/spreadsheets/d/1mG-5UYGup5qxGdEMWkhP6BWCz053NUb2E1QoUTU16uA/edit#gid=783724593
+
+// Safari 6 and 6.1 for desktop, iPad, and iPhone are the only browsers that
+// have WebKitMutationObserver but not un-prefixed MutationObserver.
+// Must use `global` instead of `window` to work in both frames and web
+// workers. `global` is a provision of Browserify, Mr, Mrs, or Mop.
+var BrowserMutationObserver = global.MutationObserver || global.WebKitMutationObserver;
+
+// MutationObservers are desirable because they have high priority and work
+// reliably everywhere they are implemented.
+// They are implemented in all modern browsers.
+//
+// - Android 4-4.3
+// - Chrome 26-34
+// - Firefox 14-29
+// - Internet Explorer 11
+// - iPad Safari 6-7.1
+// - iPhone Safari 7-7.1
+// - Safari 6-7
+if (typeof BrowserMutationObserver === "function") {
+ requestFlush = makeRequestCallFromMutationObserver(flush);
+
+// MessageChannels are desirable because they give direct access to the HTML
+// task queue, are implemented in Internet Explorer 10, Safari 5.0-1, and Opera
+// 11-12, and in web workers in many engines.
+// Although message channels yield to any queued rendering and IO tasks, they
+// would be better than imposing the 4ms delay of timers.
+// However, they do not work reliably in Internet Explorer or Safari.
+
+// Internet Explorer 10 is the only browser that has setImmediate but does
+// not have MutationObservers.
+// Although setImmediate yields to the browser's renderer, it would be
+// preferrable to falling back to setTimeout since it does not have
+// the minimum 4ms penalty.
+// Unfortunately there appears to be a bug in Internet Explorer 10 Mobile (and
+// Desktop to a lesser extent) that renders both setImmediate and
+// MessageChannel useless for the purposes of ASAP.
+// https://github.com/kriskowal/q/issues/396
+
+// Timers are implemented universally.
+// We fall back to timers in workers in most engines, and in foreground
+// contexts in the following browsers.
+// However, note that even this simple case requires nuances to operate in a
+// broad spectrum of browsers.
+//
+// - Firefox 3-13
+// - Internet Explorer 6-9
+// - iPad Safari 4.3
+// - Lynx 2.8.7
+} else {
+ requestFlush = makeRequestCallFromTimer(flush);
+}
+
+// `requestFlush` requests that the high priority event queue be flushed as
+// soon as possible.
+// This is useful to prevent an error thrown in a task from stalling the event
+// queue if the exception handled by Node.js’s
+// `process.on("uncaughtException")` or by a domain.
+rawAsap.requestFlush = requestFlush;
+
+// To request a high priority event, we induce a mutation observer by toggling
+// the text of a text node between "1" and "-1".
+function makeRequestCallFromMutationObserver(callback) {
+ var toggle = 1;
+ var observer = new BrowserMutationObserver(callback);
+ var node = document.createTextNode("");
+ observer.observe(node, {characterData: true});
+ return function requestCall() {
+ toggle = -toggle;
+ node.data = toggle;
+ };
+}
+
+// The message channel technique was discovered by Malte Ubl and was the
+// original foundation for this library.
+// http://www.nonblocking.io/2011/06/windownexttick.html
+
+// Safari 6.0.5 (at least) intermittently fails to create message ports on a
+// page's first load. Thankfully, this version of Safari supports
+// MutationObservers, so we don't need to fall back in that case.
+
+// function makeRequestCallFromMessageChannel(callback) {
+// var channel = new MessageChannel();
+// channel.port1.onmessage = callback;
+// return function requestCall() {
+// channel.port2.postMessage(0);
+// };
+// }
+
+// For reasons explained above, we are also unable to use `setImmediate`
+// under any circumstances.
+// Even if we were, there is another bug in Internet Explorer 10.
+// It is not sufficient to assign `setImmediate` to `requestFlush` because
+// `setImmediate` must be called *by name* and therefore must be wrapped in a
+// closure.
+// Never forget.
+
+// function makeRequestCallFromSetImmediate(callback) {
+// return function requestCall() {
+// setImmediate(callback);
+// };
+// }
+
+// Safari 6.0 has a problem where timers will get lost while the user is
+// scrolling. This problem does not impact ASAP because Safari 6.0 supports
+// mutation observers, so that implementation is used instead.
+// However, if we ever elect to use timers in Safari, the prevalent work-around
+// is to add a scroll event listener that calls for a flush.
+
+// `setTimeout` does not call the passed callback if the delay is less than
+// approximately 7 in web workers in Firefox 8 through 18, and sometimes not
+// even then.
+
+function makeRequestCallFromTimer(callback) {
+ return function requestCall() {
+ // We dispatch a timeout with a specified delay of 0 for engines that
+ // can reliably accommodate that request. This will usually be snapped
+ // to a 4 milisecond delay, but once we're flushing, there's no delay
+ // between events.
+ var timeoutHandle = setTimeout(handleTimer, 0);
+ // However, since this timer gets frequently dropped in Firefox
+ // workers, we enlist an interval handle that will try to fire
+ // an event 20 times per second until it succeeds.
+ var intervalHandle = setInterval(handleTimer, 50);
+
+ function handleTimer() {
+ // Whichever timer succeeds will cancel both timers and
+ // execute the callback.
+ clearTimeout(timeoutHandle);
+ clearInterval(intervalHandle);
+ callback();
+ }
+ };
+}
+
+// This is for `asap.js` only.
+// Its name will be periodically randomized to break any code that depends on
+// its existence.
+rawAsap.makeRequestCallFromTimer = makeRequestCallFromTimer;
+
+// ASAP was originally a nextTick shim included in Q. This was factored out
+// into this ASAP package. It was later adapted to RSVP which made further
+// amendments. These decisions, particularly to marginalize MessageChannel and
+// to capture the MutationObserver implementation in a closure, were integrated
+// back into ASAP proper.
+// https://github.com/tildeio/rsvp.js/blob/cddf7232546a9cf858524b75cde6f9edf72620a7/lib/rsvp/asap.js
diff --git a/deps/npm/node_modules/dezalgo/node_modules/asap/package.json b/deps/npm/node_modules/dezalgo/node_modules/asap/package.json
index 25ffeeb9495..e01b3f06de9 100644
--- a/deps/npm/node_modules/dezalgo/node_modules/asap/package.json
+++ b/deps/npm/node_modules/dezalgo/node_modules/asap/package.json
@@ -1,26 +1,66 @@
{
"name": "asap",
- "version": "1.0.0",
+ "version": "2.0.3",
"description": "High-priority task queue for Node.js and browsers",
"keywords": [
"event",
"task",
"queue"
],
- "licenses": [
- {
- "type": "MIT",
- "url": "https://github.com/kriskowal/asap/raw/master/LICENSE.md"
- }
+ "license": {
+ "type": "MIT",
+ "url": "https://github.com/kriskowal/asap/raw/master/LICENSE.md"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/kriskowal/asap.git"
+ },
+ "main": "./asap.js",
+ "browser": {
+ "./asap.js": "./browser-asap.js",
+ "./raw.js": "./browser-raw.js",
+ "./test/domain.js": "./test/browser-domain.js"
+ },
+ "files": [
+ "raw.js",
+ "asap.js",
+ "browser-raw.js",
+ "browser-asap.js"
],
- "main": "asap",
- "_id": "asap@1.0.0",
- "dist": {
- "shasum": "b2a45da5fdfa20b0496fc3768cc27c12fa916a7d",
- "tarball": "http://registry.npmjs.org/asap/-/asap-1.0.0.tgz"
+ "scripts": {
+ "test": "npm run lint && npm run test-node",
+ "test-travis": "npm run lint && npm run test-node && npm run test-saucelabs && npm run test-saucelabs-worker",
+ "test-node": "node test/asap-test.js",
+ "test-publish": "node scripts/publish-bundle.js test/asap-test.js | pbcopy",
+ "test-browser": "node scripts/publish-bundle.js test/asap-test.js | xargs opener",
+ "test-saucelabs": "node scripts/saucelabs.js test/asap-test.js scripts/saucelabs-spot-configurations.json",
+ "test-saucelabs-all": "node scripts/saucelabs.js test/asap-test.js scripts/saucelabs-all-configurations.json",
+ "test-saucelabs-worker": "node scripts/saucelabs-worker-test.js scripts/saucelabs-spot-configurations.json",
+ "test-saucelabs-worker-all": "node scripts/saucelabs-worker-test.js scripts/saucelabs-all-configurations.json",
+ "lint": "jshint raw.js asap.js browser-raw.js browser-asap.js $(find scripts -name '*.js' | grep -v gauntlet)"
},
- "_from": "asap@>=1.0.0 <2.0.0",
- "_npmVersion": "1.2.15",
+ "devDependencies": {
+ "events": "^1.0.1",
+ "jshint": "^2.5.1",
+ "knox": "^0.8.10",
+ "mr": "^2.0.5",
+ "opener": "^1.3.0",
+ "q": "^2.0.3",
+ "q-io": "^2.0.3",
+ "saucelabs": "^0.1.1",
+ "wd": "^0.2.21",
+ "weak-map": "^1.0.5"
+ },
+ "gitHead": "ccbf94d4e4a0c3afc2df13331044020a46a74ab6",
+ "bugs": {
+ "url": "https://github.com/kriskowal/asap/issues"
+ },
+ "homepage": "https://github.com/kriskowal/asap#readme",
+ "_id": "asap@2.0.3",
+ "_shasum": "1fc1d1564ee11620dfca6d67029850913f9f4679",
+ "_from": "asap@>=2.0.0 <3.0.0",
+ "_npmVersion": "2.8.3",
+ "_nodeVersion": "1.8.1",
"_npmUser": {
"name": "kriskowal",
"email": "kris.kowal@cixar.com"
@@ -29,10 +69,17 @@
{
"name": "kriskowal",
"email": "kris.kowal@cixar.com"
+ },
+ {
+ "name": "forbeslindesay",
+ "email": "forbes@lindesay.co.uk"
}
],
+ "dist": {
+ "shasum": "1fc1d1564ee11620dfca6d67029850913f9f4679",
+ "tarball": "http://registry.npmjs.org/asap/-/asap-2.0.3.tgz"
+ },
"directories": {},
- "_shasum": "b2a45da5fdfa20b0496fc3768cc27c12fa916a7d",
- "_resolved": "https://registry.npmjs.org/asap/-/asap-1.0.0.tgz",
+ "_resolved": "https://registry.npmjs.org/asap/-/asap-2.0.3.tgz",
"readme": "ERROR: No README data found!"
}
diff --git a/deps/npm/node_modules/dezalgo/node_modules/asap/raw.js b/deps/npm/node_modules/dezalgo/node_modules/asap/raw.js
new file mode 100644
index 00000000000..ae3b8923168
--- /dev/null
+++ b/deps/npm/node_modules/dezalgo/node_modules/asap/raw.js
@@ -0,0 +1,101 @@
+"use strict";
+
+var domain; // The domain module is executed on demand
+var hasSetImmediate = typeof setImmediate === "function";
+
+// Use the fastest means possible to execute a task in its own turn, with
+// priority over other events including network IO events in Node.js.
+//
+// An exception thrown by a task will permanently interrupt the processing of
+// subsequent tasks. The higher level `asap` function ensures that if an
+// exception is thrown by a task, that the task queue will continue flushing as
+// soon as possible, but if you use `rawAsap` directly, you are responsible to
+// either ensure that no exceptions are thrown from your task, or to manually
+// call `rawAsap.requestFlush` if an exception is thrown.
+module.exports = rawAsap;
+function rawAsap(task) {
+ if (!queue.length) {
+ requestFlush();
+ flushing = true;
+ }
+ // Avoids a function call
+ queue[queue.length] = task;
+}
+
+var queue = [];
+// Once a flush has been requested, no further calls to `requestFlush` are
+// necessary until the next `flush` completes.
+var flushing = false;
+// The position of the next task to execute in the task queue. This is
+// preserved between calls to `flush` so that it can be resumed if
+// a task throws an exception.
+var index = 0;
+// If a task schedules additional tasks recursively, the task queue can grow
+// unbounded. To prevent memory excaustion, the task queue will periodically
+// truncate already-completed tasks.
+var capacity = 1024;
+
+// The flush function processes all tasks that have been scheduled with
+// `rawAsap` unless and until one of those tasks throws an exception.
+// If a task throws an exception, `flush` ensures that its state will remain
+// consistent and will resume where it left off when called again.
+// However, `flush` does not make any arrangements to be called again if an
+// exception is thrown.
+function flush() {
+ while (index < queue.length) {
+ var currentIndex = index;
+ // Advance the index before calling the task. This ensures that we will
+ // begin flushing on the next task the task throws an error.
+ index = index + 1;
+ queue[currentIndex].call();
+ // Prevent leaking memory for long chains of recursive calls to `asap`.
+ // If we call `asap` within tasks scheduled by `asap`, the queue will
+ // grow, but to avoid an O(n) walk for every task we execute, we don't
+ // shift tasks off the queue after they have been executed.
+ // Instead, we periodically shift 1024 tasks off the queue.
+ if (index > capacity) {
+ // Manually shift all values starting at the index back to the
+ // beginning of the queue.
+ for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {
+ queue[scan] = queue[scan + index];
+ }
+ queue.length -= index;
+ index = 0;
+ }
+ }
+ queue.length = 0;
+ index = 0;
+ flushing = false;
+}
+
+rawAsap.requestFlush = requestFlush;
+function requestFlush() {
+ // Ensure flushing is not bound to any domain.
+ // It is not sufficient to exit the domain, because domains exist on a stack.
+ // To execute code outside of any domain, the following dance is necessary.
+ var parentDomain = process.domain;
+ if (parentDomain) {
+ if (!domain) {
+ // Lazy execute the domain module.
+ // Only employed if the user elects to use domains.
+ domain = require("domain");
+ }
+ domain.active = process.domain = null;
+ }
+
+ // `setImmediate` is slower that `process.nextTick`, but `process.nextTick`
+ // cannot handle recursion.
+ // `requestFlush` will only be called recursively from `asap.js`, to resume
+ // flushing after an error is thrown into a domain.
+ // Conveniently, `setImmediate` was introduced in the same version
+ // `process.nextTick` started throwing recursion errors.
+ if (flushing && hasSetImmediate) {
+ setImmediate(flush);
+ } else {
+ process.nextTick(flush);
+ }
+
+ if (parentDomain) {
+ domain.active = process.domain = parentDomain;
+ }
+}
diff --git a/deps/npm/node_modules/dezalgo/package.json b/deps/npm/node_modules/dezalgo/package.json
index 656dd0c5f85..ea2b1a6d30d 100644
--- a/deps/npm/node_modules/dezalgo/package.json
+++ b/deps/npm/node_modules/dezalgo/package.json
@@ -1,17 +1,17 @@
{
"name": "dezalgo",
- "version": "1.0.2",
+ "version": "1.0.3",
"description": "Contain async insanity so that the dark pony lord doesn't eat souls",
"main": "dezalgo.js",
"directories": {
"test": "test"
},
"dependencies": {
- "asap": "^1.0.0",
+ "asap": "^2.0.0",
"wrappy": "1"
},
"devDependencies": {
- "tap": "^0.4.11"
+ "tap": "^1.2.0"
},
"scripts": {
"test": "tap test/*.js"
@@ -43,29 +43,10 @@
"url": "https://github.com/npm/dezalgo/issues"
},
"homepage": "https://github.com/npm/dezalgo",
- "gitHead": "fabfd09a9a4ad458d0c801a1dbfff2338b9bc001",
- "_id": "dezalgo@1.0.2",
- "_shasum": "2bc8b5a1683131764a98def7e4aa22105a688a5a",
- "_from": "dezalgo@>=1.0.1 <1.1.0",
- "_npmVersion": "2.10.1",
- "_nodeVersion": "2.0.2",
- "_npmUser": {
- "name": "othiym23",
- "email": "ogd@aoaioxxysz.net"
- },
- "dist": {
- "shasum": "2bc8b5a1683131764a98def7e4aa22105a688a5a",
- "tarball": "http://registry.npmjs.org/dezalgo/-/dezalgo-1.0.2.tgz"
- },
- "maintainers": [
- {
- "name": "isaacs",
- "email": "isaacs@npmjs.com"
- },
- {
- "name": "othiym23",
- "email": "ogd@aoaioxxysz.net"
- }
- ],
- "_resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.2.tgz"
+ "readme": "# dezalgo\n\nContain async insanity so that the dark pony lord doesn't eat souls\n\nSee [this blog\npost](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony).\n\n## USAGE\n\nPass a callback to `dezalgo` and it will ensure that it is *always*\ncalled in a future tick, and never in this tick.\n\n```javascript\nvar dz = require('dezalgo')\n\nvar cache = {}\nfunction maybeSync(arg, cb) {\n cb = dz(cb)\n\n // this will actually defer to nextTick\n if (cache[arg]) cb(null, cache[arg])\n\n fs.readFile(arg, function (er, data) {\n // since this is *already* defered, it will call immediately\n if (er) cb(er)\n cb(null, cache[arg] = data)\n })\n}\n```\n",
+ "readmeFilename": "README.md",
+ "gitHead": "d4d3f3f6f47b1a326194d5281349c83dde258458",
+ "_id": "dezalgo@1.0.3",
+ "_shasum": "7f742de066fc748bc8db820569dddce49bf0d456",
+ "_from": "dezalgo@>=1.0.3 <1.1.0"
}
diff --git a/deps/npm/node_modules/fstream-npm/fstream-npm.js b/deps/npm/node_modules/fstream-npm/fstream-npm.js
index 7e44072bc98..c1f76bf8744 100644
--- a/deps/npm/node_modules/fstream-npm/fstream-npm.js
+++ b/deps/npm/node_modules/fstream-npm/fstream-npm.js
@@ -104,6 +104,10 @@ Packer.prototype.applyIgnores = function (entry, partial, entryObj) {
// special rules. see below.
if (entry === 'node_modules' && this.packageRoot) return true
+ // package.json main file should never be ignored.
+ var mainFile = this.package.main
+ if (mainFile && path.resolve(this.path, entry) === path.resolve(this.path, mainFile)) return true
+
// some files are *never* allowed under any circumstances
if (entry === '.git' ||
entry === '.lock-wscript' ||
diff --git a/deps/npm/node_modules/fstream-npm/package.json b/deps/npm/node_modules/fstream-npm/package.json
index f3c5d3cfce7..9a75817d3c3 100644
--- a/deps/npm/node_modules/fstream-npm/package.json
+++ b/deps/npm/node_modules/fstream-npm/package.json
@@ -6,7 +6,7 @@
},
"name": "fstream-npm",
"description": "fstream class for creating npm packages",
- "version": "1.0.2",
+ "version": "1.0.3",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/fstream-npm.git"
@@ -20,17 +20,17 @@
"inherits": "2"
},
"devDependencies": {
- "standard": "^2.7.3"
+ "standard": "^4.3.1"
},
"license": "ISC",
"readme": "# fstream-npm\n\nThis is an fstream DirReader class that will read a directory and filter\nthings according to the semantics of what goes in an npm package.\n\nFor example:\n\n```javascript\n// This will print out all the files that would be included\n// by 'npm publish' or 'npm install' of this directory.\n\nvar FN = require(\"fstream-npm\")\nFN({ path: \"./\" })\n .on(\"child\", function (e) {\n console.error(e.path.substr(e.root.path.length + 1))\n })\n```\n\n",
"readmeFilename": "README.md",
- "gitHead": "d5e26643135522925effa2c112258f1feeec2ba5",
+ "gitHead": "910a52b38c7fb4d4f2204058b37294e4e370e2cb",
"bugs": {
"url": "https://github.com/isaacs/fstream-npm/issues"
},
- "homepage": "https://github.com/isaacs/fstream-npm",
- "_id": "fstream-npm@1.0.2",
- "_shasum": "a1d2a4ce6ac2db731f0f66a85b4dddfea9565d77",
- "_from": "fstream-npm@>=1.0.2 <1.1.0"
+ "homepage": "https://github.com/isaacs/fstream-npm#readme",
+ "_id": "fstream-npm@1.0.3",
+ "_shasum": "67cfb5437b14237155bf319c0536e6d4335170fe",
+ "_from": "fstream-npm@>=1.0.3 <1.1.0"
}
diff --git a/deps/npm/node_modules/fstream/examples/filter-pipe.js b/deps/npm/node_modules/fstream/examples/filter-pipe.js
index fc59cfc7aba..83dadef8a6f 100644
--- a/deps/npm/node_modules/fstream/examples/filter-pipe.js
+++ b/deps/npm/node_modules/fstream/examples/filter-pipe.js
@@ -81,9 +81,9 @@ function missile (entry) {
return function (c) {
var e = Math.random() < 0.5
console.error(indent + '%s %s for %d damage!',
- entry.basename,
- e ? 'is struck' : 'fires a chunk',
- c.length)
+ entry.basename,
+ e ? 'is struck' : 'fires a chunk',
+ c.length)
}
}
@@ -91,8 +91,8 @@ function runaway (entry) {
return function () {
var e = Math.random() < 0.5
console.error(indent + '%s %s',
- entry.basename,
- e ? 'turns to flee' : 'is vanquished!')
+ entry.basename,
+ e ? 'turns to flee' : 'is vanquished!')
indent = indent.slice(0, -1)
}
}
@@ -101,7 +101,7 @@ w.on('entry', attacks)
// w.on('ready', function () { attacks(w) })
function attacks (entry) {
console.error(indent + '%s %s!', entry.basename,
- entry.type === 'Directory' ? 'calls for backup' : 'attacks')
+ entry.type === 'Directory' ? 'calls for backup' : 'attacks')
entry.on('entry', attacks)
}
@@ -121,13 +121,14 @@ r.on('end', function () {
checker.on('child', function (e) {
var ok = e.type === 'Directory'
console.log((ok ? '' : 'not ') + 'ok ' + (i++) +
- ' should be a dir: ' +
- e.path.substr(checker.path.length + 1))
+ ' should be a dir: ' +
+ e.path.substr(checker.path.length + 1))
})
})
process.on('exit', function () {
- console.log((ended ? '' : 'not ') + 'ok ' + (i++) + ' ended')
+ console.log((ended ? '' : 'not ') + 'ok ' + (i) + ' ended')
+ console.log('1..' + i)
})
r.pipe(w)
diff --git a/deps/npm/node_modules/fstream/examples/pipe.js b/deps/npm/node_modules/fstream/examples/pipe.js
index c611dd5c47b..3de42ef32bf 100644
--- a/deps/npm/node_modules/fstream/examples/pipe.js
+++ b/deps/npm/node_modules/fstream/examples/pipe.js
@@ -5,8 +5,8 @@ var r = fstream.Reader({
path: path.dirname(__dirname),
filter: function () {
return !this.basename.match(/^\./) &&
- !this.basename.match(/^node_modules$/) &&
- !this.basename.match(/^deep-copy$/)
+ !this.basename.match(/^node_modules$/) &&
+ !this.basename.match(/^deep-copy$/)
}
})
@@ -76,9 +76,9 @@ function missile (entry) {
return function (c) {
var e = Math.random() < 0.5
console.error(indent + '%s %s for %d damage!',
- entry.basename,
- e ? 'is struck' : 'fires a chunk',
- c.length)
+ entry.basename,
+ e ? 'is struck' : 'fires a chunk',
+ c.length)
}
}
@@ -86,8 +86,8 @@ function runaway (entry) {
return function () {
var e = Math.random() < 0.5
console.error(indent + '%s %s',
- entry.basename,
- e ? 'turns to flee' : 'is vanquished!')
+ entry.basename,
+ e ? 'turns to flee' : 'is vanquished!')
indent = indent.slice(0, -1)
}
}
@@ -96,7 +96,7 @@ w.on('entry', attacks)
// w.on('ready', function () { attacks(w) })
function attacks (entry) {
console.error(indent + '%s %s!', entry.basename,
- entry.type === 'Directory' ? 'calls for backup' : 'attacks')
+ entry.type === 'Directory' ? 'calls for backup' : 'attacks')
entry.on('entry', attacks)
}
@@ -112,6 +112,7 @@ r.on('end', function () {
process.on('exit', function () {
console.log((ended ? '' : 'not ') + 'ok 2 ended')
+ console.log('1..2')
})
r.pipe(w)
diff --git a/deps/npm/node_modules/fstream/examples/symlink-write.js b/deps/npm/node_modules/fstream/examples/symlink-write.js
index f6f51099bc2..19e81eea9fe 100644
--- a/deps/npm/node_modules/fstream/examples/symlink-write.js
+++ b/deps/npm/node_modules/fstream/examples/symlink-write.js
@@ -1,5 +1,6 @@
var fstream = require('../fstream.js')
var notOpen = false
+process.chdir(__dirname)
fstream
.Writer({
@@ -22,4 +23,5 @@ fstream
process.on('exit', function () {
console.log((notOpen ? '' : 'not ') + 'ok 3 should be closed')
+ console.log('1..3')
})
diff --git a/deps/npm/node_modules/fstream/lib/abstract.js b/deps/npm/node_modules/fstream/lib/abstract.js
index 94af1ae0865..97c120e1d52 100644
--- a/deps/npm/node_modules/fstream/lib/abstract.js
+++ b/deps/npm/node_modules/fstream/lib/abstract.js
@@ -32,22 +32,22 @@ Abstract.prototype.warn = function (msg, code) {
var er = decorate(msg, code, self)
if (!self.listeners('warn')) {
console.error('%s %s\n' +
- 'path = %s\n' +
- 'syscall = %s\n' +
- 'fstream_type = %s\n' +
- 'fstream_path = %s\n' +
- 'fstream_unc_path = %s\n' +
- 'fstream_class = %s\n' +
- 'fstream_stack =\n%s\n',
- code || 'UNKNOWN',
- er.stack,
- er.path,
- er.syscall,
- er.fstream_type,
- er.fstream_path,
- er.fstream_unc_path,
- er.fstream_class,
- er.fstream_stack.join('\n'))
+ 'path = %s\n' +
+ 'syscall = %s\n' +
+ 'fstream_type = %s\n' +
+ 'fstream_path = %s\n' +
+ 'fstream_unc_path = %s\n' +
+ 'fstream_class = %s\n' +
+ 'fstream_stack =\n%s\n',
+ code || 'UNKNOWN',
+ er.stack,
+ er.path,
+ er.syscall,
+ er.fstream_type,
+ er.fstream_path,
+ er.fstream_unc_path,
+ er.fstream_class,
+ er.fstream_stack.join('\n'))
} else {
self.emit('warn', er)
}
diff --git a/deps/npm/node_modules/fstream/lib/dir-writer.js b/deps/npm/node_modules/fstream/lib/dir-writer.js
index aed9e4db146..ec50dca900d 100644
--- a/deps/npm/node_modules/fstream/lib/dir-writer.js
+++ b/deps/npm/node_modules/fstream/lib/dir-writer.js
@@ -23,7 +23,7 @@ function DirWriter (props) {
// should already be established as a Directory type
if (props.type !== 'Directory' || !props.Directory) {
self.error('Non-directory type ' + props.type + ' ' +
- JSON.stringify(props), null, true)
+ JSON.stringify(props), null, true)
}
Writer.call(this, props)
@@ -102,7 +102,7 @@ DirWriter.prototype._process = function () {
do {
pp = p._path || p.path
if (pp === self.root._path || pp === self._path ||
- (pp && pp.indexOf(self._path) === 0)) {
+ (pp && pp.indexOf(self._path) === 0)) {
// console.error('DW Exit (recursive)', entry.basename, self._path)
self._processing = false
if (entry._collected) entry.pipe()
diff --git a/deps/npm/node_modules/fstream/lib/file-reader.js b/deps/npm/node_modules/fstream/lib/file-reader.js
index 0757b286b50..baa01f4b3db 100644
--- a/deps/npm/node_modules/fstream/lib/file-reader.js
+++ b/deps/npm/node_modules/fstream/lib/file-reader.js
@@ -21,7 +21,7 @@ function FileReader (props) {
// XXX Todo: preserve hardlinks by tracking dev+inode+nlink,
// with a HardLinkReader class.
if (!((props.type === 'Link' && props.Link) ||
- (props.type === 'File' && props.File))) {
+ (props.type === 'File' && props.File))) {
throw new Error('Non-file type ' + props.type)
}
@@ -63,8 +63,8 @@ FileReader.prototype._getStream = function () {
if (self._bytesEmitted !== self.props.size) {
self.error("Didn't get expected byte count\n" +
- 'expect: ' + self.props.size + '\n' +
- 'actual: ' + self._bytesEmitted)
+ 'expect: ' + self.props.size + '\n' +
+ 'actual: ' + self._bytesEmitted)
}
})
@@ -124,8 +124,8 @@ FileReader.prototype._read = function () {
}
self._buffer.length = 0
}
- // console.error("FR _read done")
- // that's about all there is to it.
+// console.error("FR _read done")
+// that's about all there is to it.
}
FileReader.prototype.pause = function (who) {
diff --git a/deps/npm/node_modules/fstream/lib/link-reader.js b/deps/npm/node_modules/fstream/lib/link-reader.js
index a44dd39d7cd..fb4cc67a98d 100644
--- a/deps/npm/node_modules/fstream/lib/link-reader.js
+++ b/deps/npm/node_modules/fstream/lib/link-reader.js
@@ -19,7 +19,7 @@ function LinkReader (props) {
}
if (!((props.type === 'Link' && props.Link) ||
- (props.type === 'SymbolicLink' && props.SymbolicLink))) {
+ (props.type === 'SymbolicLink' && props.SymbolicLink))) {
throw new Error('Non-link type ' + props.type)
}
diff --git a/deps/npm/node_modules/fstream/lib/link-writer.js b/deps/npm/node_modules/fstream/lib/link-writer.js
index 07a9abf7e6f..af54284008f 100644
--- a/deps/npm/node_modules/fstream/lib/link-writer.js
+++ b/deps/npm/node_modules/fstream/lib/link-writer.js
@@ -16,7 +16,7 @@ function LinkWriter (props) {
// should already be established as a Link type
if (!((props.type === 'Link' && props.Link) ||
- (props.type === 'SymbolicLink' && props.SymbolicLink))) {
+ (props.type === 'SymbolicLink' && props.SymbolicLink))) {
throw new Error('Non-link type ' + props.type)
}
@@ -66,8 +66,8 @@ function create (self, lp, link) {
// windows in some nice fashion.
if (er) {
if ((er.code === 'ENOENT' ||
- er.code === 'EACCES' ||
- er.code === 'EPERM') && process.platform === 'win32') {
+ er.code === 'EACCES' ||
+ er.code === 'EPERM') && process.platform === 'win32') {
self.ready = true
self.emit('ready')
self.emit('end')
diff --git a/deps/npm/node_modules/fstream/lib/reader.js b/deps/npm/node_modules/fstream/lib/reader.js
index 1d007ee211c..876021f92bc 100644
--- a/deps/npm/node_modules/fstream/lib/reader.js
+++ b/deps/npm/node_modules/fstream/lib/reader.js
@@ -54,13 +54,13 @@ function Reader (props, currentStat) {
break
case 'Link':
- // XXX hard links are just files.
- // However, it would be good to keep track of files' dev+inode
- // and nlink values, and create a HardLinkReader that emits
- // a linkpath value of the original copy, so that the tar
- // writer can preserve them.
- // ClassType = HardLinkReader
- // break
+ // XXX hard links are just files.
+ // However, it would be good to keep track of files' dev+inode
+ // and nlink values, and create a HardLinkReader that emits
+ // a linkpath value of the original copy, so that the tar
+ // writer can preserve them.
+ // ClassType = HardLinkReader
+ // break
case 'File':
ClassType = require('./file-reader.js')
@@ -103,7 +103,7 @@ function Reader (props, currentStat) {
self._swallowErrors = true
// if (self._path.indexOf(" ") === -1) {
self._path = '\\\\?\\' + self.path.replace(/\//g, '\\')
- // }
+ // }
}
}
self.basename = props.basename = path.basename(self.path)
@@ -126,10 +126,10 @@ function Reader (props, currentStat) {
function alphasort (a, b) {
return a === b ? 0
- : a.toLowerCase() > b.toLowerCase() ? 1
- : a.toLowerCase() < b.toLowerCase() ? -1
- : a > b ? 1
- : -1
+ : a.toLowerCase() > b.toLowerCase() ? 1
+ : a.toLowerCase() < b.toLowerCase() ? -1
+ : a > b ? 1
+ : -1
}
Reader.prototype._stat = function (currentStat) {
diff --git a/deps/npm/node_modules/fstream/lib/writer.js b/deps/npm/node_modules/fstream/lib/writer.js
index 25a608def22..ca3396b5d14 100644
--- a/deps/npm/node_modules/fstream/lib/writer.js
+++ b/deps/npm/node_modules/fstream/lib/writer.js
@@ -113,7 +113,7 @@ Writer.prototype._create = function () {
fs[self.props.follow ? 'stat' : 'lstat'](self._path, function (er) {
if (er) {
return self.warn('Cannot create ' + self._path + '\n' +
- 'Unsupported type: ' + self.type, 'ENOTSUP')
+ 'Unsupported type: ' + self.type, 'ENOTSUP')
}
self._finish()
})
@@ -179,7 +179,7 @@ function create (self) {
function endChmod (self, want, current, path, cb) {
var wantMode = want.mode
var chmod = want.follow || self.type !== 'SymbolicLink'
- ? 'chmod' : 'lchmod'
+ ? 'chmod' : 'lchmod'
if (!fs[chmod]) return cb()
if (typeof wantMode !== 'number') return cb()
@@ -196,13 +196,13 @@ function endChown (self, want, current, path, cb) {
if (process.platform === 'win32') return cb()
if (!process.getuid || process.getuid() !== 0) return cb()
if (typeof want.uid !== 'number' &&
- typeof want.gid !== 'number') return cb()
+ typeof want.gid !== 'number') return cb()
if (current.uid === want.uid &&
- current.gid === want.gid) return cb()
+ current.gid === want.gid) return cb()
var chown = (self.props.follow || self.type !== 'SymbolicLink')
- ? 'chown' : 'lchown'
+ ? 'chown' : 'lchown'
if (!fs[chown]) return cb()
if (typeof want.uid !== 'number') want.uid = current.uid
@@ -215,7 +215,7 @@ function endUtimes (self, want, current, path, cb) {
if (!fs.utimes || process.platform === 'win32') return cb()
var utimes = (want.follow || self.type !== 'SymbolicLink')
- ? 'utimes' : 'lutimes'
+ ? 'utimes' : 'lutimes'
if (utimes === 'lutimes' && !fs[utimes]) {
utimes = 'utimes'
@@ -235,7 +235,7 @@ function endUtimes (self, want, current, path, cb) {
if (!isDate(meM)) meA = new Date(meM)
if (meA.getTime() === curA.getTime() &&
- meM.getTime() === curM.getTime()) return cb()
+ meM.getTime() === curM.getTime()) return cb()
fs[utimes](path, meA, meM, cb)
}
@@ -274,8 +274,8 @@ Writer.prototype._finish = function () {
// doesn't exist yet (especially if it was intended as a symlink),
// so swallow ENOENT errors here and just soldier on.
if (er.code === 'ENOENT' &&
- (self.type === 'Link' || self.type === 'SymbolicLink') &&
- process.platform === 'win32') {
+ (self.type === 'Link' || self.type === 'SymbolicLink') &&
+ process.platform === 'win32') {
self.ready = true
self.emit('ready')
self.emit('end')
diff --git a/deps/npm/node_modules/fstream/package.json b/deps/npm/node_modules/fstream/package.json
index aa6bc1cf3e4..0109d940c27 100644
--- a/deps/npm/node_modules/fstream/package.json
+++ b/deps/npm/node_modules/fstream/package.json
@@ -6,7 +6,7 @@
},
"name": "fstream",
"description": "Advanced file system stream things",
- "version": "1.0.6",
+ "version": "1.0.7",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/fstream.git"
@@ -22,45 +22,21 @@
"rimraf": "2"
},
"devDependencies": {
- "tap": "0",
- "standard": "^2.3.2"
+ "standard": "^4.0.0",
+ "tap": "^1.2.0"
},
"scripts": {
"test": "standard && tap examples/*.js"
},
"license": "ISC",
- "gitHead": "e0c0024379c5a94ca228d232e2794b6ffb0d3caf",
+ "readme": "Like FS streams, but with stat on them, and supporting directories and\nsymbolic links, as well as normal files. Also, you can use this to set\nthe stats on a file, even if you don't change its contents, or to create\na symlink, etc.\n\nSo, for example, you can \"write\" a directory, and it'll call `mkdir`. You\ncan specify a uid and gid, and it'll call `chown`. You can specify a\n`mtime` and `atime`, and it'll call `utimes`. You can call it a symlink\nand provide a `linkpath` and it'll call `symlink`.\n\nNote that it won't automatically resolve symbolic links. So, if you\ncall `fstream.Reader('/some/symlink')` then you'll get an object\nthat stats and then ends immediately (since it has no data). To follow\nsymbolic links, do this: `fstream.Reader({path:'/some/symlink', follow:\ntrue })`.\n\nThere are various checks to make sure that the bytes emitted are the\nsame as the intended size, if the size is set.\n\n## Examples\n\n```javascript\nfstream\n .Writer({ path: \"path/to/file\"\n , mode: 0755\n , size: 6\n })\n .write(\"hello\\n\")\n .end()\n```\n\nThis will create the directories if they're missing, and then write\n`hello\\n` into the file, chmod it to 0755, and assert that 6 bytes have\nbeen written when it's done.\n\n```javascript\nfstream\n .Writer({ path: \"path/to/file\"\n , mode: 0755\n , size: 6\n , flags: \"a\"\n })\n .write(\"hello\\n\")\n .end()\n```\n\nYou can pass flags in, if you want to append to a file.\n\n```javascript\nfstream\n .Writer({ path: \"path/to/symlink\"\n , linkpath: \"./file\"\n , SymbolicLink: true\n , mode: \"0755\" // octal strings supported\n })\n .end()\n```\n\nIf isSymbolicLink is a function, it'll be called, and if it returns\ntrue, then it'll treat it as a symlink. If it's not a function, then\nany truish value will make a symlink, or you can set `type:\n'SymbolicLink'`, which does the same thing.\n\nNote that the linkpath is relative to the symbolic link location, not\nthe parent dir or cwd.\n\n```javascript\nfstream\n .Reader(\"path/to/dir\")\n .pipe(fstream.Writer(\"path/to/other/dir\"))\n```\n\nThis will do like `cp -Rp path/to/dir path/to/other/dir`. If the other\ndir exists and isn't a directory, then it'll emit an error. It'll also\nset the uid, gid, mode, etc. to be identical. In this way, it's more\nlike `rsync -a` than simply a copy.\n",
+ "readmeFilename": "README.md",
+ "gitHead": "586e8efc1cf77883f6c22fc32a7cb38f0eb88911",
"bugs": {
"url": "https://github.com/isaacs/fstream/issues"
},
"homepage": "https://github.com/isaacs/fstream#readme",
- "_id": "fstream@1.0.6",
- "_shasum": "817e50312fb4ed90da865c8eb5ecd1d1d7aed0ec",
- "_from": "fstream@>=1.0.6 <1.1.0",
- "_npmVersion": "2.9.0",
- "_nodeVersion": "2.0.0",
- "_npmUser": {
- "name": "iarna",
- "email": "me@re-becca.org"
- },
- "maintainers": [
- {
- "name": "isaacs",
- "email": "isaacs@npmjs.com"
- },
- {
- "name": "othiym23",
- "email": "ogd@aoaioxxysz.net"
- },
- {
- "name": "iarna",
- "email": "me@re-becca.org"
- }
- ],
- "dist": {
- "shasum": "817e50312fb4ed90da865c8eb5ecd1d1d7aed0ec",
- "tarball": "http://registry.npmjs.org/fstream/-/fstream-1.0.6.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.6.tgz"
+ "_id": "fstream@1.0.7",
+ "_shasum": "455a1aa1d46077668d95b6d27838e1b1daa78c78",
+ "_from": "fstream@>=1.0.7 <1.1.0"
}
diff --git a/deps/npm/node_modules/init-package-json/.travis.yml b/deps/npm/node_modules/init-package-json/.travis.yml
index 05d299e6764..991d04b6e22 100644
--- a/deps/npm/node_modules/init-package-json/.travis.yml
+++ b/deps/npm/node_modules/init-package-json/.travis.yml
@@ -1,4 +1,5 @@
language: node_js
node_js:
- - "0.10"
- - "0.11"
+ - '0.10'
+ - '0.12'
+ - 'iojs'
diff --git a/deps/npm/node_modules/init-package-json/default-input.js b/deps/npm/node_modules/init-package-json/default-input.js
index 886291dcea6..ef5161e7926 100644
--- a/deps/npm/node_modules/init-package-json/default-input.js
+++ b/deps/npm/node_modules/init-package-json/default-input.js
@@ -12,7 +12,7 @@ function isTestPkg (p) {
}
function niceName (n) {
- return n.replace(/^node-|[.-]js$/g, '')
+ return n.replace(/^node-|[.-]js$/g, '').toLowerCase()
}
function readDeps (test) { return function (cb) {
@@ -72,7 +72,6 @@ exports.version = yes ?
if (semver.valid(version)) return version
var er = new Error('Invalid version: "' + version + '"')
er.notValid = true
- er.again = true
return er
})
diff --git a/deps/npm/node_modules/init-package-json/node_modules/promzard/package.json b/deps/npm/node_modules/init-package-json/node_modules/promzard/package.json
index 1007cdde443..1407e97be58 100644
--- a/deps/npm/node_modules/init-package-json/node_modules/promzard/package.json
+++ b/deps/npm/node_modules/init-package-json/node_modules/promzard/package.json
@@ -8,7 +8,7 @@
"description": "prompting wizardly",
"version": "0.3.0",
"repository": {
- "url": "git://github.com/isaacs/promzard"
+ "url": "git://github.com/isaacs/promzard.git"
},
"dependencies": {
"read": "1"
diff --git a/deps/npm/node_modules/init-package-json/node_modules/validate-npm-package-license/LICENSE.md b/deps/npm/node_modules/init-package-json/node_modules/validate-npm-package-license/LICENSE.md
deleted file mode 100644
index 2180a8c1a36..00000000000
--- a/deps/npm/node_modules/init-package-json/node_modules/validate-npm-package-license/LICENSE.md
+++ /dev/null
@@ -1,7 +0,0 @@
-Copyright Kyle E. Mitchell
-
-Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
diff --git a/deps/npm/node_modules/init-package-json/node_modules/validate-npm-package-license/README.md b/deps/npm/node_modules/init-package-json/node_modules/validate-npm-package-license/README.md
deleted file mode 100644
index 904f74b9d3b..00000000000
--- a/deps/npm/node_modules/init-package-json/node_modules/validate-npm-package-license/README.md
+++ /dev/null
@@ -1,29 +0,0 @@
-npm-validate-package-license
-============================
-
-Give me a string and I'll tell you if it's a valid npm package license.
-
-*This package is not endorsed or approved by npm. It is part of a proposal to add license field validation to the npm command-line interface.*
-
-<!-- js var valid = require('./'); -->
-
-```js
-var validResult = {
- validForNewPackages: true,
- validForOldPackages: true
-};
-
-valid('Apache-2.0'); // => validResult
-valid('GPL-3.0 OR BSD-2-Clause'); // => validResult
-
-var invalidResult = {
- validForOldPackages: false,
- validForNewPackages: false,
- warnings: [
- 'license should be a valid SPDX license expression',
- 'license is similar to the valid expression "Apache-2.0"'
- ]
-};
-
-valid('Apache 2.0'); // => invalidResult
-```
diff --git a/deps/npm/node_modules/init-package-json/node_modules/validate-npm-package-license/index.js b/deps/npm/node_modules/init-package-json/node_modules/validate-npm-package-license/index.js
deleted file mode 100644
index c8407a52037..00000000000
--- a/deps/npm/node_modules/init-package-json/node_modules/validate-npm-package-license/index.js
+++ /dev/null
@@ -1,26 +0,0 @@
-var spdx = require('spdx');
-var correct = require('spdx-correct');
-
-module.exports = function(argument) {
- if (spdx.valid(argument)) {
- return {
- validForNewPackages: true,
- validForOldPackages: true
- };
- } else {
- var warnings = [
- 'license should be a valid SPDX license expression'
- ];
- var corrected = correct(argument);
- if (corrected) {
- warnings.push(
- 'license is similar to the valid expression "' + corrected + '"'
- );
- }
- return {
- validForOldPackages: false,
- validForNewPackages: false,
- warnings: warnings
- };
- }
-};
diff --git a/deps/npm/node_modules/init-package-json/node_modules/validate-npm-package-license/node_modules/spdx-correct/.npmignore b/deps/npm/node_modules/init-package-json/node_modules/validate-npm-package-license/node_modules/spdx-correct/.npmignore
deleted file mode 100644
index 5229acdc80b..00000000000
--- a/deps/npm/node_modules/init-package-json/node_modules/validate-npm-package-license/node_modules/spdx-correct/.npmignore
+++ /dev/null
@@ -1,5 +0,0 @@
-.gitignore
-.jscsrc
-.jshintrc
-test
-.travis.yml
diff --git a/deps/npm/node_modules/init-package-json/package.json b/deps/npm/node_modules/init-package-json/package.json
index 62d01c59d55..05a2df56bc1 100644
--- a/deps/npm/node_modules/init-package-json/package.json
+++ b/deps/npm/node_modules/init-package-json/package.json
@@ -1,13 +1,13 @@
{
"name": "init-package-json",
- "version": "1.6.0",
+ "version": "1.7.0",
"main": "init-package-json.js",
"scripts": {
"test": "tap test/*.js"
},
"repository": {
"type": "git",
- "url": "git://github.com/isaacs/init-package-json"
+ "url": "git://github.com/isaacs/init-package-json.git"
},
"author": {
"name": "Isaac Z. Schlueter",
@@ -23,13 +23,13 @@
"read": "~1.0.1",
"read-package-json": "1 || 2",
"semver": "2.x || 3.x || 4",
- "validate-npm-package-license": "1.0.0-prerelease-2",
+ "validate-npm-package-license": "^2.0.0",
"validate-npm-package-name": "^2.0.1"
},
"devDependencies": {
"npm": "^2",
"rimraf": "^2.1.4",
- "tap": "^0.7.1"
+ "tap": "^1.2.0"
},
"keywords": [
"init",
@@ -41,38 +41,14 @@
"prompt",
"start"
],
- "gitHead": "b747e9f71eb65b22bb9139e5252bf8efb23571e1",
+ "readme": "# init-package-json\n\nA node module to get your node module started.\n\n[![Build Status](https://secure.travis-ci.org/npm/init-package-json.svg)](http://travis-ci.org/npm/init-package-json)\n\n## Usage\n\n```javascript\nvar init = require('init-package-json')\nvar path = require('path')\n\n// a path to a promzard module. In the event that this file is\n// not found, one will be provided for you.\nvar initFile = path.resolve(process.env.HOME, '.npm-init')\n\n// the dir where we're doin stuff.\nvar dir = process.cwd()\n\n// extra stuff that gets put into the PromZard module's context.\n// In npm, this is the resolved config object. Exposed as 'config'\n// Optional.\nvar configData = { some: 'extra stuff' }\n\n// Any existing stuff from the package.json file is also exposed in the\n// PromZard module as the `package` object. There will also be free\n// vars for:\n// * `filename` path to the package.json file\n// * `basename` the tip of the package dir\n// * `dirname` the parent of the package dir\n\ninit(dir, initFile, configData, function (er, data) {\n // the data's already been written to {dir}/package.json\n // now you can do stuff with it\n})\n```\n\nOr from the command line:\n\n```\n$ npm-init\n```\n\nSee [PromZard](https://github.com/isaacs/promzard) for details about\nwhat can go in the config file.\n",
+ "readmeFilename": "README.md",
+ "gitHead": "04acc558503c6a133a1704aeec276d817617fa12",
"bugs": {
"url": "https://github.com/isaacs/init-package-json/issues"
},
- "homepage": "https://github.com/isaacs/init-package-json",
- "_id": "init-package-json@1.6.0",
- "_shasum": "8c4c2561abca1ad30d88f5594ddb4159211a36ff",
- "_from": "init-package-json@1.6.0",
- "_npmVersion": "2.7.6",
- "_nodeVersion": "1.6.2",
- "_npmUser": {
- "name": "iarna",
- "email": "me@re-becca.org"
- },
- "dist": {
- "shasum": "8c4c2561abca1ad30d88f5594ddb4159211a36ff",
- "tarball": "http://registry.npmjs.org/init-package-json/-/init-package-json-1.6.0.tgz"
- },
- "maintainers": [
- {
- "name": "isaacs",
- "email": "i@izs.me"
- },
- {
- "name": "othiym23",
- "email": "ogd@aoaioxxysz.net"
- },
- {
- "name": "iarna",
- "email": "me@re-becca.org"
- }
- ],
- "directories": {},
- "_resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-1.6.0.tgz"
+ "homepage": "https://github.com/isaacs/init-package-json#readme",
+ "_id": "init-package-json@1.7.0",
+ "_shasum": "dc573523777fa4f83eca808976735ce5d7cfac77",
+ "_from": "init-package-json@>=1.7.0 <1.8.0"
}
diff --git a/deps/npm/node_modules/init-package-json/test/basic.js b/deps/npm/node_modules/init-package-json/test/basic.js
index f07f435bcd2..d67e0c3b12a 100644
--- a/deps/npm/node_modules/init-package-json/test/basic.js
+++ b/deps/npm/node_modules/init-package-json/test/basic.js
@@ -6,6 +6,7 @@ var test = require('tap').test
test('the basics', function (t) {
var i = path.join(__dirname, 'basic.input')
+ rimraf.sync(__dirname + '/package.json')
init(__dirname, i, { foo: 'bar' }, function (er, data) {
if (er) throw er
var expect = {
@@ -18,6 +19,7 @@ test('the basics', function (t) {
config: { foo: 'bar' },
package: {}
}
+ console.log('')
t.same(data, expect)
t.end()
})
diff --git a/deps/npm/node_modules/init-package-json/test/license.js b/deps/npm/node_modules/init-package-json/test/license.js
index 87333fbf8f1..8d8ae93dd64 100644
--- a/deps/npm/node_modules/init-package-json/test/license.js
+++ b/deps/npm/node_modules/init-package-json/test/license.js
@@ -5,7 +5,9 @@ var common = require('./lib/common')
test('license', function (t) {
init(__dirname, '', {}, function (er, data) {
- t.ok(!er, 'should not error')
+ if (er)
+ throw er
+
var wanted = {
name: 'the-name',
version: '1.0.0',
@@ -15,7 +17,8 @@ test('license', function (t) {
author: '',
main: 'basic.js'
}
- t.same(data, wanted)
+ console.log('')
+ t.has(data, wanted)
t.end()
})
common.drive([
diff --git a/deps/npm/node_modules/init-package-json/test/name-spaces.js b/deps/npm/node_modules/init-package-json/test/name-spaces.js
index dee974fc8aa..a395afb9a26 100644
--- a/deps/npm/node_modules/init-package-json/test/name-spaces.js
+++ b/deps/npm/node_modules/init-package-json/test/name-spaces.js
@@ -4,8 +4,10 @@ var rimraf = require('rimraf')
var common = require('./lib/common')
test('spaces', function (t) {
+ rimraf.sync(__dirname + '/package.json')
init(__dirname, '', {}, function (er, data) {
- t.ok(!er, 'should not error')
+ if (er)
+ throw er
var wanted = {
name: 'the-name',
version: '1.0.0',
@@ -15,7 +17,8 @@ test('spaces', function (t) {
author: '',
main: 'basic.js'
}
- t.same(data, wanted)
+ console.log('')
+ t.has(data, wanted)
t.end()
})
common.drive([
diff --git a/deps/npm/node_modules/init-package-json/test/name-uppercase.js b/deps/npm/node_modules/init-package-json/test/name-uppercase.js
index ddedc30e524..d1623260a64 100644
--- a/deps/npm/node_modules/init-package-json/test/name-uppercase.js
+++ b/deps/npm/node_modules/init-package-json/test/name-uppercase.js
@@ -5,7 +5,9 @@ var common = require('./lib/common')
test('uppercase', function (t) {
init(__dirname, '', {}, function (er, data) {
- t.ok(!er, 'should not error')
+ if (er)
+ throw er
+
var wanted = {
name: 'the-name',
version: '1.0.0',
@@ -15,7 +17,8 @@ test('uppercase', function (t) {
author: '',
main: 'basic.js'
}
- t.same(data, wanted)
+ console.log('')
+ t.has(data, wanted)
t.end()
})
common.drive([
diff --git a/deps/npm/node_modules/init-package-json/test/scope-in-config-existing-name.js b/deps/npm/node_modules/init-package-json/test/scope-in-config-existing-name.js
new file mode 100644
index 00000000000..39dc90f4292
--- /dev/null
+++ b/deps/npm/node_modules/init-package-json/test/scope-in-config-existing-name.js
@@ -0,0 +1,30 @@
+var fs = require('fs')
+var path = require('path')
+
+var rimraf = require('rimraf')
+var tap = require('tap')
+
+var init = require('../')
+
+var json = {
+ name: '@already/scoped',
+ version: '1.0.0'
+}
+
+tap.test('with existing package.json', function (t) {
+ fs.writeFileSync(path.join(__dirname, 'package.json'), JSON.stringify(json, null, 2))
+ console.log(fs.readFileSync(path.join(__dirname, 'package.json'), 'utf8'))
+ console.error('wrote json', json)
+ init(__dirname, __dirname, { yes: 'yes', scope: '@still' }, function (er, data) {
+ if (er) throw er
+
+ console.log('')
+ t.equal(data.name, '@still/scoped', 'new scope is added, basic name is kept')
+ t.end()
+ })
+})
+
+tap.test('teardown', function (t) {
+ rimraf.sync(path.join(__dirname, 'package.json'))
+ t.end()
+})
diff --git a/deps/npm/node_modules/init-package-json/test/scope-in-config.js b/deps/npm/node_modules/init-package-json/test/scope-in-config.js
index 1fa83d9c13a..32bba16ede8 100644
--- a/deps/npm/node_modules/init-package-json/test/scope-in-config.js
+++ b/deps/npm/node_modules/init-package-json/test/scope-in-config.js
@@ -21,22 +21,8 @@ tap.test('--yes with scope', function (t) {
init(__dirname, __dirname, { yes: 'yes', scope: '@scoped' }, function (er, data) {
if (er) throw er
- t.same(EXPECT, data)
- t.end()
- })
-})
-
-var json = {
- name: '@already/scoped',
- version: '1.0.0'
-}
-
-tap.test('with existing package.json', function (t) {
- fs.writeFileSync(path.join(__dirname, 'package.json'), JSON.stringify(json, null, 2))
- init(__dirname, __dirname, { yes: 'yes', scope: '@still' }, function (er, data) {
- if (er) throw er
-
- t.equal(data.name, '@still/scoped', 'new scope is added, basic name is kept')
+ console.log('')
+ t.has(data, EXPECT)
t.end()
})
})
diff --git a/deps/npm/node_modules/init-package-json/test/scope.js b/deps/npm/node_modules/init-package-json/test/scope.js
index 971916f2d86..4fa0649282b 100644
--- a/deps/npm/node_modules/init-package-json/test/scope.js
+++ b/deps/npm/node_modules/init-package-json/test/scope.js
@@ -19,7 +19,8 @@ tap.test('the scope', function (t) {
init(dir, i, {scope: '@foo'}, function (er, data) {
if (er) throw er
- t.same(EXPECT, data)
+ console.log('')
+ t.has(data, EXPECT)
t.end()
})
setTimeout(function () {
diff --git a/deps/npm/node_modules/init-package-json/test/yes-defaults.js b/deps/npm/node_modules/init-package-json/test/yes-defaults.js
index 747ab38fdd2..f7cae28c549 100644
--- a/deps/npm/node_modules/init-package-json/test/yes-defaults.js
+++ b/deps/npm/node_modules/init-package-json/test/yes-defaults.js
@@ -17,7 +17,7 @@ tap.test('--yes defaults', function (t) {
init(__dirname, __dirname, {yes: 'yes'}, function (er, data) {
if (er) throw er
- t.same(EXPECT, data, 'used the default data')
+ t.has(data, EXPECT, 'used the default data')
t.end()
})
})
diff --git a/deps/npm/node_modules/nopt/.travis.yml b/deps/npm/node_modules/nopt/.travis.yml
new file mode 100644
index 00000000000..99f2bbf5068
--- /dev/null
+++ b/deps/npm/node_modules/nopt/.travis.yml
@@ -0,0 +1,9 @@
+language: node_js
+language: node_js
+node_js:
+ - '0.8'
+ - '0.10'
+ - '0.12'
+ - 'iojs'
+before_install:
+ - npm install -g npm@latest
diff --git a/deps/npm/node_modules/nopt/README.md b/deps/npm/node_modules/nopt/README.md
index 5aba088b568..22c50ec406e 100644
--- a/deps/npm/node_modules/nopt/README.md
+++ b/deps/npm/node_modules/nopt/README.md
@@ -5,9 +5,10 @@ The Wrong Way is to sit down and write an option parser. We've all done
that.
The Right Way is to write some complex configurable program with so many
-options that you go half-insane just trying to manage them all, and put
-it off with duct-tape solutions until you see exactly to the core of the
-problem, and finally snap and write an awesome option parser.
+options that you hit the limit of your frustration just trying to
+manage them all, and defer it with duct-tape solutions until you see
+exactly to the core of the problem, and finally snap and write an
+awesome option parser.
If you want to write an option parser, don't write an option parser.
Write a package manager, or a source control system, or a service
diff --git a/deps/npm/node_modules/nopt/package.json b/deps/npm/node_modules/nopt/package.json
index 97c090b2f51..c44afa1a269 100644
--- a/deps/npm/node_modules/nopt/package.json
+++ b/deps/npm/node_modules/nopt/package.json
@@ -1,6 +1,6 @@
{
"name": "nopt",
- "version": "3.0.2",
+ "version": "3.0.3",
"description": "Option parsing for Node, supporting types, shorthands, etc. Used by npm.",
"author": {
"name": "Isaac Z. Schlueter",
@@ -23,25 +23,25 @@
"abbrev": "1"
},
"devDependencies": {
- "tap": "~0.4.8"
+ "tap": "^1.2.0"
},
- "gitHead": "a0ff8dcbb29ae9da68769c9f782bd4d70746b02d",
+ "gitHead": "f64a64cd48d9f2660dd4e59191ff46a26397d6b1",
"bugs": {
"url": "https://github.com/isaacs/nopt/issues"
},
"homepage": "https://github.com/isaacs/nopt#readme",
- "_id": "nopt@3.0.2",
- "_shasum": "a82a87f9d8c3df140fe78fb29657a7a774403b5e",
- "_from": "nopt@>=3.0.2 <3.1.0",
- "_npmVersion": "2.10.0",
- "_nodeVersion": "2.0.1",
+ "_id": "nopt@3.0.3",
+ "_shasum": "0e9978f33016bae0b75e3748c03bbbb71da5c530",
+ "_from": "nopt@>=3.0.3 <3.1.0",
+ "_npmVersion": "2.12.0",
+ "_nodeVersion": "2.2.1",
"_npmUser": {
"name": "isaacs",
"email": "isaacs@npmjs.com"
},
"dist": {
- "shasum": "a82a87f9d8c3df140fe78fb29657a7a774403b5e",
- "tarball": "http://registry.npmjs.org/nopt/-/nopt-3.0.2.tgz"
+ "shasum": "0e9978f33016bae0b75e3748c03bbbb71da5c530",
+ "tarball": "http://registry.npmjs.org/nopt/-/nopt-3.0.3.tgz"
},
"maintainers": [
{
@@ -50,6 +50,5 @@
}
],
"directories": {},
- "_resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.2.tgz",
- "readme": "ERROR: No README data found!"
+ "_resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.3.tgz"
}
diff --git a/deps/npm/node_modules/normalize-git-url/.eslintrc b/deps/npm/node_modules/normalize-git-url/.eslintrc
deleted file mode 100644
index b54e30fd2aa..00000000000
--- a/deps/npm/node_modules/normalize-git-url/.eslintrc
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "env" : {
- "node" : true
- },
- "rules" : {
- "semi": [2, "never"],
- "strict": 0,
- "quotes": [1, "double", "avoid-escape"],
- "no-use-before-define": 0,
- "curly": 0,
- "no-underscore-dangle": 0,
- "no-lonely-if": 1,
- "no-unused-vars": [2, {"vars" : "all", "args" : "after-used"}],
- "no-mixed-requires": 0,
- "space-infix-ops": 0,
- "key-spacing": 0,
- "no-multi-spaces": 0
- }
-}
diff --git a/deps/npm/node_modules/normalize-git-url/normalize-git-url.js b/deps/npm/node_modules/normalize-git-url/normalize-git-url.js
index 7662037940f..859e18b9ce7 100644
--- a/deps/npm/node_modules/normalize-git-url/normalize-git-url.js
+++ b/deps/npm/node_modules/normalize-git-url/normalize-git-url.js
@@ -1,4 +1,4 @@
-var url = require("url")
+var url = require('url')
module.exports = function normalize (u) {
var parsed = url.parse(u, true)
@@ -9,19 +9,22 @@ module.exports = function normalize (u) {
// If the path is like ssh://foo:some/path then it works, but
// only if you remove the ssh://
if (parsed.protocol) {
- parsed.protocol = parsed.protocol.replace(/^git\+/, "")
-
- // ssh paths that are scp-style urls don't need the ssh://
- parsed.pathname = parsed.pathname.replace(/^\/?:/, "/")
+ parsed.protocol = parsed.protocol.replace(/^git\+/, '')
}
// figure out what we should check out.
- var checkout = parsed.hash && parsed.hash.substr(1) || "master"
- parsed.hash = ""
+ var checkout = parsed.hash && parsed.hash.substr(1) || 'master'
+ parsed.hash = ''
+
+ var returnedUrl
+ if (parsed.pathname.match(/\/?:/)) {
+ returnedUrl = u.replace(/^(?:git\+)?ssh:\/\//, '').replace(/#[^#]*$/, '')
+ } else {
+ returnedUrl = url.format(parsed)
+ }
- u = url.format(parsed)
return {
- url : u,
- branch : checkout
+ url: returnedUrl,
+ branch: checkout
}
}
diff --git a/deps/npm/node_modules/normalize-git-url/package.json b/deps/npm/node_modules/normalize-git-url/package.json
index 6008db67536..12b758b6eca 100644
--- a/deps/npm/node_modules/normalize-git-url/package.json
+++ b/deps/npm/node_modules/normalize-git-url/package.json
@@ -1,6 +1,6 @@
{
"name": "normalize-git-url",
- "version": "1.0.1",
+ "version": "2.0.0",
"description": "Normalizes Git URLs. For npm, but you can use it too.",
"main": "normalize-git-url.js",
"directories": {
@@ -33,10 +33,29 @@
"url": "https://github.com/npm/normalize-git-url/issues"
},
"homepage": "https://github.com/npm/normalize-git-url",
- "readme": "# normalize-git-url\n\nYou have a bunch of Git URLs. You want to convert them to a canonical\nrepresentation, probably for use inside npm so that it doesn't end up creating\na bunch of superfluous cached origins. You use this package.\n\n## Usage\n\n```javascript\nvar ngu = require('normalize-git-url');\nvar normalized = ngu(\"git+ssh://git@github.com:organization/repo.git#hashbrowns\")\n// get back:\n// {\n// url : \"ssh://git@github.com/organization/repo.git\",\n// branch : \"hashbrowns\" // did u know hashbrowns are delicious?\n// }\n```\n\n## API\n\nThere's just the one function, and all it takes is a single parameter, a non-normalized Git URL.\n\n### normalizeGitUrl(url)\n\n* `url` {String} The Git URL (very loosely speaking) to be normalized.\n\nReturns an object with the following format:\n\n* `url` {String} The normalized URL.\n* `branch` {String} The treeish to be checked out once the repo at `url` is\n cloned. It doesn't have to be a branch, but it's a lot easier to intuit what\n the output is for with that name.\n\n## Limitations\n\nRight now this doesn't try to special-case GitHub too much -- it doesn't ensure\nthat `.git` is added to the end of URLs, it doesn't prefer `https:` over\n`http:` or `ssh:`, it doesn't deal with redirects, and it doesn't try to\nresolve symbolic names to treeish hashcodes. For now, it just tries to account\nfor minor differences in representation.\n",
- "readmeFilename": "README.md",
- "gitHead": "d87bf42e845ed664e4a8bab3490052fb44c90433",
- "_id": "normalize-git-url@1.0.1",
- "_shasum": "1b561345d66e3a3bc5513a5ace85f155ca42613e",
- "_from": "normalize-git-url@>=1.0.1 <1.1.0"
+ "gitHead": "cf9fb245bc25d2a8914b71e8989ec426e7819e00",
+ "_id": "normalize-git-url@2.0.0",
+ "_shasum": "2cf92aeda24dd2bccf076edef83f4feaf925e436",
+ "_from": "normalize-git-url@latest",
+ "_npmVersion": "2.11.3",
+ "_nodeVersion": "2.3.1",
+ "_npmUser": {
+ "name": "iarna",
+ "email": "me@re-becca.org"
+ },
+ "dist": {
+ "shasum": "2cf92aeda24dd2bccf076edef83f4feaf925e436",
+ "tarball": "http://registry.npmjs.org/normalize-git-url/-/normalize-git-url-2.0.0.tgz"
+ },
+ "maintainers": [
+ {
+ "name": "othiym23",
+ "email": "ogd@aoaioxxysz.net"
+ },
+ {
+ "name": "iarna",
+ "email": "me@re-becca.org"
+ }
+ ],
+ "_resolved": "https://registry.npmjs.org/normalize-git-url/-/normalize-git-url-2.0.0.tgz"
}
diff --git a/deps/npm/node_modules/normalize-git-url/test/basic.js b/deps/npm/node_modules/normalize-git-url/test/basic.js
index f8f199f6506..00ac6d3131b 100644
--- a/deps/npm/node_modules/normalize-git-url/test/basic.js
+++ b/deps/npm/node_modules/normalize-git-url/test/basic.js
@@ -1,55 +1,55 @@
-var test = require("tap").test
+var test = require('tap').test
-var normalize = require("../normalize-git-url.js")
+var normalize = require('../normalize-git-url.js')
-test("basic normalization tests", function (t) {
+test('basic normalization tests', function (t) {
t.same(
- normalize("git+ssh://user@hostname:project.git#commit-ish"),
- { url : "ssh://user@hostname/project.git", branch : "commit-ish" }
+ normalize('git+ssh://user@hostname:project.git#commit-ish'),
+ { url: 'user@hostname:project.git', branch: 'commit-ish' }
)
t.same(
- normalize("git+http://user@hostname/project/blah.git#commit-ish"),
- { url : "http://user@hostname/project/blah.git", branch : "commit-ish" }
+ normalize('git+http://user@hostname/project/blah.git#commit-ish'),
+ { url: 'http://user@hostname/project/blah.git', branch: 'commit-ish' }
)
t.same(
- normalize("git+https://user@hostname/project/blah.git#commit-ish"),
- { url : "https://user@hostname/project/blah.git", branch : "commit-ish" }
+ normalize('git+https://user@hostname/project/blah.git#commit-ish'),
+ { url: 'https://user@hostname/project/blah.git', branch: 'commit-ish' }
)
t.same(
- normalize("git+ssh://git@github.com:npm/npm.git#v1.0.27"),
- { url : "ssh://git@github.com/npm/npm.git", branch : "v1.0.27" }
+ normalize('git+ssh://git@github.com:npm/npm.git#v1.0.27'),
+ { url: 'git@github.com:npm/npm.git', branch: 'v1.0.27' }
)
t.same(
- normalize("git+ssh://git@github.com:org/repo#dev"),
- { url : "ssh://git@github.com/org/repo", branch : "dev" }
+ normalize('git+ssh://git@github.com:org/repo#dev'),
+ { url: 'git@github.com:org/repo', branch: 'dev' }
)
t.same(
- normalize("git+ssh://git@github.com/org/repo#dev"),
- { url : "ssh://git@github.com/org/repo", branch : "dev" }
+ normalize('git+ssh://git@github.com/org/repo#dev'),
+ { url: 'ssh://git@github.com/org/repo', branch: 'dev' }
)
t.same(
- normalize("git+ssh://foo:22/some/path"),
- { url : "ssh://foo:22/some/path", branch : "master" }
+ normalize('git+ssh://foo:22/some/path'),
+ { url: 'ssh://foo:22/some/path', branch: 'master' }
)
t.same(
- normalize("git@github.com:org/repo#dev"),
- { url : "git@github.com:org/repo", branch : "dev" }
+ normalize('git@github.com:org/repo#dev'),
+ { url: 'git@github.com:org/repo', branch: 'dev' }
)
t.same(
- normalize("git+https://github.com/KenanY/node-uuid"),
- { url : "https://github.com/KenanY/node-uuid", branch : "master" }
+ normalize('git+https://github.com/KenanY/node-uuid'),
+ { url: 'https://github.com/KenanY/node-uuid', branch: 'master' }
)
t.same(
- normalize("git+https://github.com/KenanY/node-uuid#7a018f2d075b03a73409e8356f9b29c9ad4ea2c5"),
- { url : "https://github.com/KenanY/node-uuid", branch : "7a018f2d075b03a73409e8356f9b29c9ad4ea2c5" }
+ normalize('git+https://github.com/KenanY/node-uuid#7a018f2d075b03a73409e8356f9b29c9ad4ea2c5'),
+ { url: 'https://github.com/KenanY/node-uuid', branch: '7a018f2d075b03a73409e8356f9b29c9ad4ea2c5' }
)
t.same(
- normalize("git+ssh://git@git.example.com:b/b.git#v1.0.0"),
- { url : "ssh://git@git.example.com/b/b.git", branch : "v1.0.0" }
+ normalize('git+ssh://git@git.example.com:b/b.git#v1.0.0'),
+ { url: 'git@git.example.com:b/b.git', branch: 'v1.0.0' }
)
t.same(
- normalize("git+ssh://git@github.com:npm/npm-proto.git#othiym23/organized"),
- { url : "ssh://git@github.com/npm/npm-proto.git", branch : "othiym23/organized" }
+ normalize('git+ssh://git@github.com:npm/npm-proto.git#othiym23/organized'),
+ { url: 'git@github.com:npm/npm-proto.git', branch: 'othiym23/organized' }
)
t.end()
diff --git a/deps/npm/node_modules/normalize-package-data/README.md b/deps/npm/node_modules/normalize-package-data/README.md
index 0b9d7b5b423..da4d9f6519b 100644
--- a/deps/npm/node_modules/normalize-package-data/README.md
+++ b/deps/npm/node_modules/normalize-package-data/README.md
@@ -95,7 +95,7 @@ If `version` field is given, the value of the version field must be a valid *sem
### Rules for license field
-The `license` field should be a valid *SDPDX license expression* string, as determined by the `spdx.valid` method. See [documentation for the spdx module](https://github.com/kemitchell/spdx.js).
+The `license` field should be a valid *SDPDX license expression* or one of the special values allowed by [validate-npm-package-license](https://npmjs.com/packages/validate-npm-package-license). See [documentation for the license field in package.json](https://docs.npmjs.com/files/package.json#license).
## Credits
diff --git a/deps/npm/node_modules/normalize-package-data/lib/fixer.js b/deps/npm/node_modules/normalize-package-data/lib/fixer.js
index 3d9380b6e43..c96f0bcc4f1 100644
--- a/deps/npm/node_modules/normalize-package-data/lib/fixer.js
+++ b/deps/npm/node_modules/normalize-package-data/lib/fixer.js
@@ -1,5 +1,5 @@
var semver = require("semver")
-var spdx = require('spdx');
+var validateLicense = require('validate-npm-package-license');
var hostedGitInfo = require("hosted-git-info")
var depTypes = ["dependencies","devDependencies","optionalDependencies"]
var extractDescription = require("./extract_description")
@@ -292,12 +292,16 @@ var fixer = module.exports = {
, fixLicenseField: function(data) {
if (!data.license) {
return this.warn("missingLicense")
- } else if (
- typeof(data.license) !== 'string' ||
- data.license.length < 1 ||
- !spdx.valid(data.license)
- ) {
- this.warn("nonSPDXLicense")
+ } else{
+ if (
+ typeof(data.license) !== 'string' ||
+ data.license.length < 1
+ ) {
+ this.warn("invalidLicense")
+ } else {
+ if (!validateLicense(data.license).validForNewPackages)
+ this.warn("invalidLicense")
+ }
}
}
}
diff --git a/deps/npm/node_modules/normalize-package-data/lib/warning_messages.json b/deps/npm/node_modules/normalize-package-data/lib/warning_messages.json
index 3bfce72cd4d..5fd19f3223f 100644
--- a/deps/npm/node_modules/normalize-package-data/lib/warning_messages.json
+++ b/deps/npm/node_modules/normalize-package-data/lib/warning_messages.json
@@ -25,7 +25,7 @@
,"nonEmailBugsEmailField": "bugs.email field must be a string email. Deleted."
,"emptyNormalizedBugs": "Normalized value of bugs field is an empty object. Deleted."
,"nonUrlHomepage": "homepage field must be a string url. Deleted."
- ,"nonSPDXLicense": "license should be a valid SPDX license expression"
+ ,"invalidLicense": "license should be a valid SPDX license expression"
,"missingProtocolHomepage": "homepage field must start with a protocol."
,"typo": "%s should probably be %s."
}
diff --git a/deps/npm/node_modules/normalize-package-data/package.json b/deps/npm/node_modules/normalize-package-data/package.json
index 44ca4d58675..f81f30f06dc 100644
--- a/deps/npm/node_modules/normalize-package-data/package.json
+++ b/deps/npm/node_modules/normalize-package-data/package.json
@@ -1,6 +1,6 @@
{
"name": "normalize-package-data",
- "version": "2.2.1",
+ "version": "2.3.0",
"author": {
"name": "Meryn Stol",
"email": "merynstol@gmail.com"
@@ -18,7 +18,7 @@
"dependencies": {
"hosted-git-info": "^2.0.2",
"semver": "2 || 3 || 4",
- "spdx": "^0.4.0"
+ "validate-npm-package-license": "^2.0.0"
},
"devDependencies": {
"async": "~0.9.0",
@@ -39,14 +39,14 @@
"email": "rok@kowalski.gd"
}
],
- "readme": "# normalize-package-data [![Build Status](https://travis-ci.org/npm/normalize-package-data.png?branch=master)](https://travis-ci.org/npm/normalize-package-data)\n\nnormalize-package data exports a function that normalizes package metadata. This data is typically found in a package.json file, but in principle could come from any source - for example the npm registry.\n\nnormalize-package-data is used by [read-package-json](https://npmjs.org/package/read-package-json) to normalize the data it reads from a package.json file. In turn, read-package-json is used by [npm](https://npmjs.org/package/npm) and various npm-related tools.\n\n## Installation\n\n```\nnpm install normalize-package-data\n```\n\n## Usage\n\nBasic usage is really simple. You call the function that normalize-package-data exports. Let's call it `normalizeData`.\n\n```javascript\nnormalizeData = require('normalize-package-data')\npackageData = fs.readFileSync(\"package.json\")\nnormalizeData(packageData)\n// packageData is now normalized\n```\n\n#### Strict mode\n\nYou may activate strict validation by passing true as the second argument.\n\n```javascript\nnormalizeData = require('normalize-package-data')\npackageData = fs.readFileSync(\"package.json\")\nwarnFn = function(msg) { console.error(msg) }\nnormalizeData(packageData, true)\n// packageData is now normalized\n```\n\nIf strict mode is activated, only Semver 2.0 version strings are accepted. Otherwise, Semver 1.0 strings are accepted as well. Packages must have a name, and the name field must not have contain leading or trailing whitespace.\n\n#### Warnings\n\nOptionally, you may pass a \"warning\" function. It gets called whenever the `normalizeData` function encounters something that doesn't look right. It indicates less than perfect input data.\n\n```javascript\nnormalizeData = require('normalize-package-data')\npackageData = fs.readFileSync(\"package.json\")\nwarnFn = function(msg) { console.error(msg) }\nnormalizeData(packageData, warnFn)\n// packageData is now normalized. Any number of warnings may have been logged.\n```\n\nYou may combine strict validation with warnings by passing `true` as the second argument, and `warnFn` as third.\n\nWhen `private` field is set to `true`, warnings will be suppressed.\n\n### Potential exceptions\n\nIf the supplied data has an invalid name or version vield, `normalizeData` will throw an error. Depending on where you call `normalizeData`, you may want to catch these errors so can pass them to a callback.\n\n## What normalization (currently) entails\n\n* The value of `name` field gets trimmed (unless in strict mode).\n* The value of the `version` field gets cleaned by `semver.clean`. See [documentation for the semver module](https://github.com/isaacs/node-semver).\n* If `name` and/or `version` fields are missing, they are set to empty strings.\n* If `files` field is not an array, it will be removed.\n* If `bin` field is a string, then `bin` field will become an object with `name` set to the value of the `name` field, and `bin` set to the original string value.\n* If `man` field is a string, it will become an array with the original string as its sole member.\n* If `keywords` field is string, it is considered to be a list of keywords separated by one or more white-space characters. It gets converted to an array by splitting on `\\s+`.\n* All people fields (`author`, `maintainers`, `contributors`) get converted into objects with name, email and url properties.\n* If `bundledDependencies` field (a typo) exists and `bundleDependencies` field does not, `bundledDependencies` will get renamed to `bundleDependencies`.\n* If the value of any of the dependencies fields (`dependencies`, `devDependencies`, `optionalDependencies`) is a string, it gets converted into an object with familiar `name=>value` pairs.\n* The values in `optionalDependencies` get added to `dependencies`. The `optionalDependencies` array is left untouched.\n* As of v2: Dependencies that point at known hosted git providers (currently: github, bitbucket, gitlab) will have their URLs canonicalized, but protocols will be preserved.\n* As of v2: Dependencies that use shortcuts for hosted git providers (`org/proj`, `github:org/proj`, `bitbucket:org/proj`, `gitlab:org/proj`, `gist:docid`) will have the shortcut left in place. (In the case of github, the `org/proj` form will be expanded to `github:org/proj`.) THIS MARKS A BREAKING CHANGE FROM V1, where the shorcut was previously expanded to a URL.\n* If `description` field does not exist, but `readme` field does, then (more or less) the first paragraph of text that's found in the readme is taken as value for `description`.\n* If `repository` field is a string, it will become an object with `url` set to the original string value, and `type` set to `\"git\"`.\n* If `repository.url` is not a valid url, but in the style of \"[owner-name]/[repo-name]\", `repository.url` will be set to https://github.com/[owner-name]/[repo-name]\n* If `bugs` field is a string, the value of `bugs` field is changed into an object with `url` set to the original string value.\n* If `bugs` field does not exist, but `repository` field points to a repository hosted on GitHub, the value of the `bugs` field gets set to an url in the form of https://github.com/[owner-name]/[repo-name]/issues . If the repository field points to a GitHub Gist repo url, the associated http url is chosen.\n* If `bugs` field is an object, the resulting value only has email and url properties. If email and url properties are not strings, they are ignored. If no valid values for either email or url is found, bugs field will be removed.\n* If `homepage` field is not a string, it will be removed.\n* If the url in the `homepage` field does not specify a protocol, then http is assumed. For example, `myproject.org` will be changed to `http://myproject.org`.\n* If `homepage` field does not exist, but `repository` field points to a repository hosted on GitHub, the value of the `homepage` field gets set to an url in the form of https://github.com/[owner-name]/[repo-name]/ . If the repository field points to a GitHub Gist repo url, the associated http url is chosen.\n\n### Rules for name field\n\nIf `name` field is given, the value of the name field must be a string. The string may not:\n\n* start with a period.\n* contain the following characters: `/@\\s+%`\n* contain and characters that would need to be encoded for use in urls.\n* resemble the word `node_modules` or `favicon.ico` (case doesn't matter).\n\n### Rules for version field\n\nIf `version` field is given, the value of the version field must be a valid *semver* string, as determined by the `semver.valid` method. See [documentation for the semver module](https://github.com/isaacs/node-semver).\n\n### Rules for license field\n\nThe `license` field should be a valid *SDPDX license expression* string, as determined by the `spdx.valid` method. See [documentation for the spdx module](https://github.com/kemitchell/spdx.js).\n\n## Credits\n\nThis package contains code based on read-package-json written by Isaac Z. Schlueter. Used with permisson.\n\n## License\n\nnormalize-package-data is released under the [BSD 2-Clause License](http://opensource.org/licenses/MIT). \nCopyright (c) 2013 Meryn Stol \n",
+ "readme": "# normalize-package-data [![Build Status](https://travis-ci.org/npm/normalize-package-data.png?branch=master)](https://travis-ci.org/npm/normalize-package-data)\n\nnormalize-package data exports a function that normalizes package metadata. This data is typically found in a package.json file, but in principle could come from any source - for example the npm registry.\n\nnormalize-package-data is used by [read-package-json](https://npmjs.org/package/read-package-json) to normalize the data it reads from a package.json file. In turn, read-package-json is used by [npm](https://npmjs.org/package/npm) and various npm-related tools.\n\n## Installation\n\n```\nnpm install normalize-package-data\n```\n\n## Usage\n\nBasic usage is really simple. You call the function that normalize-package-data exports. Let's call it `normalizeData`.\n\n```javascript\nnormalizeData = require('normalize-package-data')\npackageData = fs.readFileSync(\"package.json\")\nnormalizeData(packageData)\n// packageData is now normalized\n```\n\n#### Strict mode\n\nYou may activate strict validation by passing true as the second argument.\n\n```javascript\nnormalizeData = require('normalize-package-data')\npackageData = fs.readFileSync(\"package.json\")\nwarnFn = function(msg) { console.error(msg) }\nnormalizeData(packageData, true)\n// packageData is now normalized\n```\n\nIf strict mode is activated, only Semver 2.0 version strings are accepted. Otherwise, Semver 1.0 strings are accepted as well. Packages must have a name, and the name field must not have contain leading or trailing whitespace.\n\n#### Warnings\n\nOptionally, you may pass a \"warning\" function. It gets called whenever the `normalizeData` function encounters something that doesn't look right. It indicates less than perfect input data.\n\n```javascript\nnormalizeData = require('normalize-package-data')\npackageData = fs.readFileSync(\"package.json\")\nwarnFn = function(msg) { console.error(msg) }\nnormalizeData(packageData, warnFn)\n// packageData is now normalized. Any number of warnings may have been logged.\n```\n\nYou may combine strict validation with warnings by passing `true` as the second argument, and `warnFn` as third.\n\nWhen `private` field is set to `true`, warnings will be suppressed.\n\n### Potential exceptions\n\nIf the supplied data has an invalid name or version vield, `normalizeData` will throw an error. Depending on where you call `normalizeData`, you may want to catch these errors so can pass them to a callback.\n\n## What normalization (currently) entails\n\n* The value of `name` field gets trimmed (unless in strict mode).\n* The value of the `version` field gets cleaned by `semver.clean`. See [documentation for the semver module](https://github.com/isaacs/node-semver).\n* If `name` and/or `version` fields are missing, they are set to empty strings.\n* If `files` field is not an array, it will be removed.\n* If `bin` field is a string, then `bin` field will become an object with `name` set to the value of the `name` field, and `bin` set to the original string value.\n* If `man` field is a string, it will become an array with the original string as its sole member.\n* If `keywords` field is string, it is considered to be a list of keywords separated by one or more white-space characters. It gets converted to an array by splitting on `\\s+`.\n* All people fields (`author`, `maintainers`, `contributors`) get converted into objects with name, email and url properties.\n* If `bundledDependencies` field (a typo) exists and `bundleDependencies` field does not, `bundledDependencies` will get renamed to `bundleDependencies`.\n* If the value of any of the dependencies fields (`dependencies`, `devDependencies`, `optionalDependencies`) is a string, it gets converted into an object with familiar `name=>value` pairs.\n* The values in `optionalDependencies` get added to `dependencies`. The `optionalDependencies` array is left untouched.\n* As of v2: Dependencies that point at known hosted git providers (currently: github, bitbucket, gitlab) will have their URLs canonicalized, but protocols will be preserved.\n* As of v2: Dependencies that use shortcuts for hosted git providers (`org/proj`, `github:org/proj`, `bitbucket:org/proj`, `gitlab:org/proj`, `gist:docid`) will have the shortcut left in place. (In the case of github, the `org/proj` form will be expanded to `github:org/proj`.) THIS MARKS A BREAKING CHANGE FROM V1, where the shorcut was previously expanded to a URL.\n* If `description` field does not exist, but `readme` field does, then (more or less) the first paragraph of text that's found in the readme is taken as value for `description`.\n* If `repository` field is a string, it will become an object with `url` set to the original string value, and `type` set to `\"git\"`.\n* If `repository.url` is not a valid url, but in the style of \"[owner-name]/[repo-name]\", `repository.url` will be set to https://github.com/[owner-name]/[repo-name]\n* If `bugs` field is a string, the value of `bugs` field is changed into an object with `url` set to the original string value.\n* If `bugs` field does not exist, but `repository` field points to a repository hosted on GitHub, the value of the `bugs` field gets set to an url in the form of https://github.com/[owner-name]/[repo-name]/issues . If the repository field points to a GitHub Gist repo url, the associated http url is chosen.\n* If `bugs` field is an object, the resulting value only has email and url properties. If email and url properties are not strings, they are ignored. If no valid values for either email or url is found, bugs field will be removed.\n* If `homepage` field is not a string, it will be removed.\n* If the url in the `homepage` field does not specify a protocol, then http is assumed. For example, `myproject.org` will be changed to `http://myproject.org`.\n* If `homepage` field does not exist, but `repository` field points to a repository hosted on GitHub, the value of the `homepage` field gets set to an url in the form of https://github.com/[owner-name]/[repo-name]/ . If the repository field points to a GitHub Gist repo url, the associated http url is chosen.\n\n### Rules for name field\n\nIf `name` field is given, the value of the name field must be a string. The string may not:\n\n* start with a period.\n* contain the following characters: `/@\\s+%`\n* contain and characters that would need to be encoded for use in urls.\n* resemble the word `node_modules` or `favicon.ico` (case doesn't matter).\n\n### Rules for version field\n\nIf `version` field is given, the value of the version field must be a valid *semver* string, as determined by the `semver.valid` method. See [documentation for the semver module](https://github.com/isaacs/node-semver).\n\n### Rules for license field\n\nThe `license` field should be a valid *SDPDX license expression* or one of the special values allowed by [validate-npm-package-license](https://npmjs.com/packages/validate-npm-package-license). See [documentation for the license field in package.json](https://docs.npmjs.com/files/package.json#license).\n\n## Credits\n\nThis package contains code based on read-package-json written by Isaac Z. Schlueter. Used with permisson.\n\n## License\n\nnormalize-package-data is released under the [BSD 2-Clause License](http://opensource.org/licenses/MIT). \nCopyright (c) 2013 Meryn Stol \n",
"readmeFilename": "README.md",
- "gitHead": "e319259b7ebac34c470ae0dc55610befa711dbb6",
+ "gitHead": "2b006a6d53490fc053ba5ee727d36fbb4ff64868",
"bugs": {
"url": "https://github.com/npm/normalize-package-data/issues"
},
"homepage": "https://github.com/npm/normalize-package-data#readme",
- "_id": "normalize-package-data@2.2.1",
- "_shasum": "0e00ebd73ac065eb19092fd313531dd291a0e045",
- "_from": "normalize-package-data@latest"
+ "_id": "normalize-package-data@2.3.0",
+ "_shasum": "5a81b77a6bc2edcea5fceb380d3e34ae28059f51",
+ "_from": "normalize-package-data@>=2.3.0 <2.4.0"
}
diff --git a/deps/npm/node_modules/normalize-package-data/test/normalize.js b/deps/npm/node_modules/normalize-package-data/test/normalize.js
index 3dce3c05771..de6f1ce5b5b 100644
--- a/deps/npm/node_modules/normalize-package-data/test/normalize.js
+++ b/deps/npm/node_modules/normalize-package-data/test/normalize.js
@@ -160,7 +160,7 @@ tap.test("license field should be a valid SPDX expression", function(t) {
[ warningMessages.missingDescription,
warningMessages.missingRepository,
warningMessages.missingReadme,
- warningMessages.nonSPDXLicense]
+ warningMessages.invalidLicense]
t.same(warnings, expect)
t.end()
})
diff --git a/deps/npm/node_modules/npm-registry-client/test/fixtures/@npm/npm-registry-client/cache.json b/deps/npm/node_modules/npm-registry-client/test/fixtures/@npm/npm-registry-client/cache.json
deleted file mode 100644
index 4561db502b1..00000000000
--- a/deps/npm/node_modules/npm-registry-client/test/fixtures/@npm/npm-registry-client/cache.json
+++ /dev/null
@@ -1 +0,0 @@
-{"_id":"@npm%2fnpm-registry-client","_rev":"213-0a1049cf56172b7d9a1184742c6477b9","name":"@npm/npm-registry-client","description":"Client for the npm registry","dist-tags":{"latest":"2.0.4","v2.0":"2.0.3"},"versions":{"0.0.1":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.0.1","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"node-uuid":"~1.3.3","request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.0.14","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"engines":{"node":"*"},"_npmUser":{"name":"isaacs","email":"i@izs.me"},"_id":"@npm%2fnpm-registry-client@0.0.1","_engineSupported":true,"_npmVersion":"1.1.24","_nodeVersion":"v0.7.10-pre","_defaultsLoaded":true,"dist":{"shasum":"693a08f6d2faea22bbd2bf412508a63d3e6229a7","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.0.1.tgz"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.0.2":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.0.2","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"node-uuid":"~1.3.3","request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.0.14","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"engines":{"node":"*"},"_npmUser":{"name":"isaacs","email":"i@izs.me"},"_id":"@npm%2fnpm-registry-client@0.0.2","_engineSupported":true,"_npmVersion":"1.1.24","_nodeVersion":"v0.7.10-pre","_defaultsLoaded":true,"dist":{"shasum":"b48c0ec5563c6a6fdc253454fc56d2c60c5a26f4","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.0.2.tgz"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.0.3":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.0.3","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"node-uuid":"~1.3.3","request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.0.14","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"engines":{"node":"*"},"_npmUser":{"name":"isaacs","email":"i@izs.me"},"_id":"@npm%2fnpm-registry-client@0.0.3","_engineSupported":true,"_npmVersion":"1.1.24","_nodeVersion":"v0.7.10-pre","_defaultsLoaded":true,"dist":{"shasum":"ccc0254c2d59e3ea9b9050e2b16edef78df1a1e8","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.0.3.tgz"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.0.4":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.0.4","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"node-uuid":"~1.3.3","request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.0.14","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"engines":{"node":"*"},"_npmUser":{"name":"isaacs","email":"i@izs.me"},"_id":"@npm%2fnpm-registry-client@0.0.4","_engineSupported":true,"_npmVersion":"1.1.25","_nodeVersion":"v0.7.10-pre","_defaultsLoaded":true,"dist":{"shasum":"faabd25ef477521c74ac21e0f4cf3a2f66d18fb3","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.0.4.tgz"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.0.5":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.0.5","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"node-uuid":"~1.3.3","request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.0.14","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"engines":{"node":"*"},"_id":"@npm%2fnpm-registry-client@0.0.5","dist":{"shasum":"85219810c9d89ae8d28ea766e7cf74efbd9f1e52","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.0.5.tgz"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.0.6":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"The code that npm uses to talk to the registry","version":"0.0.6","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"node-uuid":"~1.3.3","request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.0.14","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"engines":{"node":"*"},"_id":"@npm%2fnpm-registry-client@0.0.6","dist":{"shasum":"cc6533b3b41df65e6e9db2601fbbf1a509a7e94c","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.0.6.tgz"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.0.7":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"The code that npm uses to talk to the registry","version":"0.0.7","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"node-uuid":"~1.3.3","request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.0.14","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"engines":{"node":"*"},"_id":"@npm%2fnpm-registry-client@0.0.7","dist":{"shasum":"0cee1d1c61f1c8e483774fe1f7bbb81c4f394a3a","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.0.7.tgz"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.0.8":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.0.8","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"node-uuid":"~1.3.3","request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.0.14","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","retry":"0.6.0","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.0.8","dist":{"shasum":"1b7411c3f7310ec2a96b055b00e7ca606e47bd07","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.0.8.tgz"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.0.9":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.0.9","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"node-uuid":"~1.3.3","request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.0.14","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","retry":"0.6.0","couch-login":"~0.1.6","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.0.9","dist":{"shasum":"6d5bfde431559ac9e2e52a7db85f5839b874f022","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.0.9.tgz"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.0.10":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.0.10","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"node-uuid":"~1.3.3","request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.0.14","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","retry":"0.6.0","couch-login":"~0.1.6","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.0.10","dist":{"shasum":"0c8b6a4615bce82aa6cc04a0d1f7dc89921f7a38","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.0.10.tgz"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.0.11":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.0.11","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"node-uuid":"~1.3.3","request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.0.14","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","retry":"0.6.0","couch-login":"~0.1.6","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.0.11","dist":{"shasum":"afab40be5bed1faa946d8e1827844698f2ec1db7","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.0.11.tgz"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.1.0":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.1.0","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"node-uuid":"~1.3.3","request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.0.14","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","retry":"0.6.0","couch-login":"~0.1.6","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.1.0","dist":{"shasum":"1077d6bbb5e432450239dc6622a59474953ffbea","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.1.0.tgz"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.1.1":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.1.1","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"node-uuid":"~1.3.3","request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.0.14","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","retry":"0.6.0","couch-login":"~0.1.6","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.1.1","dist":{"shasum":"759765361d09b715270f59cf50f10908e4e9c5fc","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.1.1.tgz"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.1.2":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.1.2","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"node-uuid":"~1.3.3","request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.0.14","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","retry":"0.6.0","couch-login":"~0.1.6","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.1.2","dist":{"shasum":"541ce93abb3d35f5c325545c718dd3bbeaaa9ff0","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.1.2.tgz"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.1.3":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.1.3","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"node-uuid":"~1.3.3","request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.0.14","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","retry":"0.6.0","couch-login":"~0.1.6","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.1.3","dist":{"shasum":"e9a40d7031e8f809af5fd85aa9aac979e17efc97","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.1.3.tgz"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.1.4":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.1.4","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"node-uuid":"~1.3.3","request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.0.14","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","retry":"0.6.0","couch-login":"~0.1.6","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.1.4","dist":{"shasum":"b211485b046191a1085362376530316f0cab0420","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.1.4.tgz"},"_npmVersion":"1.1.48","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.0":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.0","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"node-uuid":"~1.3.3","request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.0.14","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","retry":"0.6.0","couch-login":"~0.1.6","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.2.0","dist":{"shasum":"6508a4b4d96f31057d5200ca5779531bafd2b840","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.0.tgz"},"_npmVersion":"1.1.49","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.1":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.1","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"node-uuid":"~1.3.3","request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.0.14","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","retry":"0.6.0","couch-login":"~0.1.6","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.2.1","dist":{"shasum":"1bc8c4576c368cd88253d8a52daf40c55b89bb1a","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.1.tgz"},"_npmVersion":"1.1.49","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.5":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.5","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.0.14","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","retry":"0.6.0","couch-login":"~0.1.6","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.2.5","dist":{"shasum":"2f55d675dfb977403b1ad0d96874c1d30e8058d7","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.5.tgz"},"_npmVersion":"1.1.51","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.6":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.6","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.0.14","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","retry":"0.6.0","couch-login":"~0.1.6","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.2.6","dist":{"shasum":"f05df6695360360ad220e6e13a6a7bace7165fbe","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.6.tgz"},"_npmVersion":"1.1.56","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.7":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.7","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.0.14","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","retry":"0.6.0","couch-login":"~0.1.6","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.2.7","dist":{"shasum":"867bad8854cae82ed89ee3b7f1d391af59491671","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.7.tgz"},"_npmVersion":"1.1.59","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.8":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.8","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.1.0","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","retry":"0.6.0","couch-login":"~0.1.6","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.2.8","dist":{"shasum":"ef194cdb70f1ea03a576cff2c97392fa96e36563","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.8.tgz"},"_npmVersion":"1.1.62","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.9":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.9","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.1.0","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","retry":"0.6.0","couch-login":"~0.1.15","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.2.9","dist":{"shasum":"3cec10431dfed1594adaf99c50f482ee56ecf9e4","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.9.tgz"},"_npmVersion":"1.1.59","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.10":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.10","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.1.0","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","retry":"0.6.0","couch-login":"~0.1.15","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.2.10","dist":{"shasum":"1e69726dae0944e78562fd77243f839c6a2ced1e","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.10.tgz"},"_npmVersion":"1.1.64","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.11":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.11","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.1.0","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.15","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.2.11","dist":{"shasum":"d92f33c297eb1bbd57fd597c3d8f5f7e9340a0b5","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.11.tgz"},"_npmVersion":"1.1.70","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.12":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.12","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.1.0","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.15","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.2.12","dist":{"shasum":"3bfb6fc0e4b131d665580cd1481c341fe521bfd3","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.12.tgz"},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.13":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.13","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"~2.9.202","graceful-fs":"~1.2.0","semver":"~1.1.0","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.15","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.2.13","dist":{"shasum":"e03f2a4340065511b7184a3e2862cd5d459ef027","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.13.tgz"},"_from":".","_npmVersion":"1.2.4","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.14":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.14","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"~2.9.202","graceful-fs":"~1.2.0","semver":"~1.1.0","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.15","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.2.14","dist":{"shasum":"186874a7790417a340d582b1cd4a7c338087ee12","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.14.tgz"},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.15":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.15","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"~2.9.202","graceful-fs":"~1.2.0","semver":"~1.1.0","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.15","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.2.15","dist":{"shasum":"f71f32b7185855f1f8b7a5ef49e49d2357c2c552","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.15.tgz"},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.16":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.16","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"~2.9.202","graceful-fs":"~1.2.0","semver":"~1.1.0","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.15","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.2.16","dist":{"shasum":"3331323b5050fc5afdf77c3a35913c16f3e43964","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.16.tgz"},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.17":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.17","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"~2.9.202","graceful-fs":"~1.2.0","semver":"~1.1.0","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.15","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.2.17","dist":{"shasum":"1df2bbecac6751f5d9600fb43722aef96d956773","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.17.tgz"},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.18":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.18","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"~2.9.202","graceful-fs":"~1.2.0","semver":"~1.1.0","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.15","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.2.18","dist":{"shasum":"198c8d15ed9b1ed546faf6e431eb63a6b18193ad","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.18.tgz"},"_from":".","_npmVersion":"1.2.13","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.19":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.19","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"~2.16","graceful-fs":"~1.2.0","semver":"~1.1.0","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.15","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.2.19","dist":{"shasum":"106da826f0d2007f6e081f2b68fb6f26fa951b20","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.19.tgz"},"_from":".","_npmVersion":"1.2.14","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.20":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.20","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"~2.16","graceful-fs":"~1.2.0","semver":"~1.1.0","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.15","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.2.20","dist":{"shasum":"3fff194331e26660be2cf8ebf45ddf7d36add5f6","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.20.tgz"},"_from":".","_npmVersion":"1.2.15","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.21":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.21","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"~2.16","graceful-fs":"~1.2.0","semver":"~1.1.0","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.15","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"_id":"@npm%2fnpm-registry-client@0.2.21","dist":{"shasum":"d85dd32525f193925c46ff9eb0e0f529dfd1b254","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.21.tgz"},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.22":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.22","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"~2.20.0","graceful-fs":"~1.2.0","semver":"~1.1.0","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.15","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"_id":"@npm%2fnpm-registry-client@0.2.22","dist":{"shasum":"caa22ff40a1ccd632a660b8b80c333c8f92d5a17","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.22.tgz"},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.23":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.23","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.20.0","graceful-fs":"~1.2.0","semver":"~1.1.0","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.15","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"_id":"@npm%2fnpm-registry-client@0.2.23","dist":{"shasum":"a320ab2b1d048b4f7b88e40bd86974ca322b4c24","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.23.tgz"},"_from":".","_npmVersion":"1.2.19","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.24":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.24","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.20.0","graceful-fs":"~1.2.0","semver":"~1.1.0","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.15","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"_id":"@npm%2fnpm-registry-client@0.2.24","dist":{"shasum":"e12f644338619319ee7f233363a1714a87f3c72d","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.24.tgz"},"_from":".","_npmVersion":"1.2.22","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.25":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.25","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.20.0","graceful-fs":"~1.2.0","semver":"~2.0.5","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.15","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"_id":"@npm%2fnpm-registry-client@0.2.25","dist":{"shasum":"c2caeb1dcf937d6fcc4a187765d401f5e2f54027","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.25.tgz"},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.26":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.26","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.20.0","graceful-fs":"~1.2.0","semver":"~2.0.5","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.15","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"_id":"@npm%2fnpm-registry-client@0.2.26","dist":{"shasum":"4c5a2b3de946e383032f10fa497d0c15ee5f4c60","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.26.tgz"},"_from":".","_npmVersion":"1.3.1","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.27":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.27","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.20.0","graceful-fs":"~2.0.0","semver":"~2.0.5","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.15","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"_id":"@npm%2fnpm-registry-client@0.2.27","dist":{"shasum":"8f338189d32769267886a07ad7b7fd2267446adf","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.27.tgz"},"_from":".","_npmVersion":"1.3.2","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.28":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.28","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"~2.1.0","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.18","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"_id":"@npm%2fnpm-registry-client@0.2.28","dist":{"shasum":"959141fc0180d7b1ad089e87015a8a2142a8bffc","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.28.tgz"},"_from":".","_npmVersion":"1.3.6","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.29":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.29","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"^2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.18","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.2.29","dist":{"shasum":"66ff2766f0c61d41e8a6139d3692d8833002c686","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.29.tgz"},"_from":".","_npmVersion":"1.3.12","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.30":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.30","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"^2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.18","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.2.30","dist":{"shasum":"f01cae5c51aa0a1c5dc2516cbad3ebde068d3eaa","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.30.tgz"},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.31":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.31","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"^2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.18","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.2.31","dist":{"shasum":"24a23e24e43246677cb485f8391829e9536563d4","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.31.tgz"},"_from":".","_npmVersion":"1.3.17","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.3.0":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.3.0","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"^2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.18","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.3.0","dist":{"shasum":"66eab02a69be67f232ac14023eddfb8308c2eccd","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.3.0.tgz"},"_from":".","_npmVersion":"1.3.18","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.3.1":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.3.1","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"^2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.18","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.3.1","dist":{"shasum":"16dba07cc304442edcece378218672d0a1258ef8","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.3.1.tgz"},"_from":".","_npmVersion":"1.3.18","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.3.2":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.3.2","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"^2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.18","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.3.2","dist":{"shasum":"ea3060bd0a87fb1d97b87433b50f38f7272b1686","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.3.2.tgz"},"_from":".","_npmVersion":"1.3.20","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.3.3":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.3.3","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"^2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.18","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.3.3","dist":{"shasum":"da08bb681fb24aa5c988ca71f8c10f27f09daf4a","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.3.3.tgz"},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.3.4":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.3.4","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"^2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.18","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.3.4","dist":{"shasum":"25d771771590b1ca39277aea4506af234c5f4342","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.3.4.tgz"},"_from":".","_npmVersion":"1.3.25","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.3.5":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.3.5","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"^2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.18","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.3.5","dist":{"shasum":"98ba1ac851a3939a3fb9917c28fa8da522dc635f","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.3.5.tgz"},"_from":".","_npmVersion":"1.3.25","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.3.6":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.3.6","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"^2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.3.6","dist":{"shasum":"c48a2a03643769acc49672860f7920ec6bffac6e","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.3.6.tgz"},"_from":".","_npmVersion":"1.3.26","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.4.0":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.4.0","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"^2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.4.0","dist":{"shasum":"30d0c178b7f2e54183a6a3fc9fe4071eb10290bf","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.4.0.tgz"},"_from":".","_npmVersion":"1.3.26","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.4.1":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.4.1","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"^2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.4.1","dist":{"shasum":"9c49b3e44558e2072158fb085be8a083c5f83537","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.4.1.tgz"},"_from":".","_npmVersion":"1.4.0","_npmUser":{"name":"npm-www","email":"npm@npmjs.com"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.4.2":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.4.2","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"^2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.4.2","dist":{"shasum":"d9568a9413bee14951201ce73f3b3992ec6658c0","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.4.2.tgz"},"_from":".","_npmVersion":"1.4.1","_npmUser":{"name":"npm-www","email":"npm@npmjs.com"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.4.3":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.4.3","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"^2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.4.3","dist":{"shasum":"aa188fc5067158e991a57f4697c54994108f5389","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.4.3.tgz"},"_from":".","_npmVersion":"1.4.2","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.4.4":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.4.4","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"^2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.4.4","dist":{"shasum":"f9dbc383a49069d8c7f67755a3ff6e424aff584f","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.4.4.tgz"},"_from":".","_npmVersion":"1.4.2","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.4.5":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.4.5","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"^2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.4.5","dist":{"shasum":"7d6fdca46139470715f9477ddb5ad3e770d4de7b","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.4.5.tgz"},"_from":".","_npmVersion":"1.4.4","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.4.6":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.4.6","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"^2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.4.6","_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"dist":{"shasum":"657f69a79543fc4cc264c3b2de958bd15f7140fe","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.4.6.tgz"},"directories":{}},"0.4.7":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.4.7","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"^2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.4.7","dist":{"shasum":"f4369b59890da7882527eb7c427dd95d43707afb","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.4.7.tgz"},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.4.8":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.4.8","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"^2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.4.8","_shasum":"a6685a161033101be6064b7af887ab440e8695d0","_from":".","_npmVersion":"1.4.8","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"dist":{"shasum":"a6685a161033101be6064b7af887ab440e8695d0","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.4.8.tgz"},"directories":{}},"0.4.9":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.4.9","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"^2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.4.9","_shasum":"304d3d4726a58e33d8cc965afdc9ed70b996580c","_from":".","_npmVersion":"1.4.10","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"dist":{"shasum":"304d3d4726a58e33d8cc965afdc9ed70b996580c","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.4.9.tgz"},"directories":{}},"0.4.10":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.4.10","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"^2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.4.10","_shasum":"ab7bf1be3ba07d769eaf74dee3c9347e02283116","_from":".","_npmVersion":"1.4.10","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"dist":{"shasum":"ab7bf1be3ba07d769eaf74dee3c9347e02283116","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.4.10.tgz"},"directories":{}},"0.4.11":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.4.11","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"2 >=2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.4.11","_shasum":"032e9b6b050ed052ee9441841a945a184ea6bc33","_from":".","_npmVersion":"1.4.10","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"dist":{"shasum":"032e9b6b050ed052ee9441841a945a184ea6bc33","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.4.11.tgz"},"directories":{}},"0.4.12":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.4.12","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"2 >=2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.4.12","_shasum":"34303422f6a3da93ca3a387a2650d707c8595b99","_from":".","_npmVersion":"1.4.10","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"dist":{"shasum":"34303422f6a3da93ca3a387a2650d707c8595b99","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.4.12.tgz"},"directories":{}},"1.0.0":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"1.0.0","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"chownr":"0","graceful-fs":"~2.0.0","mkdirp":"~0.3.3","npm-cache-filename":"^1.0.0","request":"2 >=2.25.0","retry":"0.6.0","rimraf":"~2","semver":"2 >=2.2.1","slide":"~1.1.3","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@1.0.0","_shasum":"2a6f9dfdce5f8ebf4b9af4dbfd738384d25014e5","_from":".","_npmVersion":"1.4.10","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"dist":{"shasum":"2a6f9dfdce5f8ebf4b9af4dbfd738384d25014e5","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-1.0.0.tgz"},"directories":{}},"1.0.1":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"1.0.1","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"chownr":"0","graceful-fs":"~2.0.0","mkdirp":"~0.3.3","npm-cache-filename":"^1.0.0","request":"2 >=2.25.0","retry":"0.6.0","rimraf":"~2","semver":"2 >=2.2.1","slide":"~1.1.3","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","gitHead":"98b1278c230cf6c159f189e2f8c69daffa727ab8","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@1.0.1","_shasum":"c5f6a87d285f2005a35d3f67d9c724bce551b0f1","_from":".","_npmVersion":"1.4.13","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"dist":{"shasum":"c5f6a87d285f2005a35d3f67d9c724bce551b0f1","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-1.0.1.tgz"},"directories":{}},"2.0.0":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"2.0.0","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"chownr":"0","graceful-fs":"~2.0.0","mkdirp":"~0.3.3","npm-cache-filename":"^1.0.0","request":"2 >=2.25.0","retry":"0.6.0","rimraf":"~2","semver":"2 >=2.2.1","slide":"~1.1.3","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","gitHead":"47a98069b6a34e751cbd5b84ce92858cae5abe70","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@2.0.0","_shasum":"88810dac2d534c0df1d905c79e723392fcfc791a","_from":".","_npmVersion":"1.4.14","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"dist":{"shasum":"88810dac2d534c0df1d905c79e723392fcfc791a","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-2.0.0.tgz"},"directories":{}},"2.0.1":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"2.0.1","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"chownr":"0","graceful-fs":"^3.0.0","mkdirp":"~0.3.3","npm-cache-filename":"^1.0.0","request":"2 >=2.25.0","retry":"0.6.0","rimraf":"~2","semver":"2 >=2.2.1","slide":"~1.1.3","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","gitHead":"123e40131f83f7265f66ecd2a558cce44a3aea86","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@2.0.1","_shasum":"611c7cb7c8f7ff22be2ebc6398423b5de10db0e2","_from":".","_npmVersion":"1.4.14","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"},{"name":"othiym23","email":"ogd@aoaioxxysz.net"}],"dist":{"shasum":"611c7cb7c8f7ff22be2ebc6398423b5de10db0e2","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-2.0.1.tgz"},"directories":{}},"2.0.2":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"2.0.2","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"chownr":"0","graceful-fs":"^3.0.0","mkdirp":"~0.3.3","npm-cache-filename":"^1.0.0","request":"2 >=2.25.0","retry":"0.6.0","rimraf":"~2","semver":"2 >=2.2.1","slide":"~1.1.3","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","gitHead":"6ecc311c9dd4890f2d9b6bae60447070a3321e12","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@2.0.2","_shasum":"a82b000354c7f830114fb18444764bc477d5740f","_from":".","_npmVersion":"1.4.15","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"},{"name":"othiym23","email":"ogd@aoaioxxysz.net"}],"dist":{"shasum":"a82b000354c7f830114fb18444764bc477d5740f","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-2.0.2.tgz"},"directories":{}},"3.0.0":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"3.0.0","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"chownr":"0","graceful-fs":"^3.0.0","mkdirp":"~0.3.3","normalize-package-data":"^0.4.0","npm-cache-filename":"^1.0.0","request":"2 >=2.25.0","retry":"0.6.0","rimraf":"~2","semver":"2 >=2.2.1","slide":"~1.1.3","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","gitHead":"6bb1aec1e85fa82ee075bd997d6fb9f2dbb7f643","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@3.0.0","_shasum":"4febc5cdb274e9fa06bc3008910e3fa1ec007994","_from":".","_npmVersion":"1.5.0-pre","_npmUser":{"name":"othiym23","email":"ogd@aoaioxxysz.net"},"maintainers":[{"name":"isaacs","email":"i@izs.me"},{"name":"othiym23","email":"ogd@aoaioxxysz.net"}],"dist":{"shasum":"4febc5cdb274e9fa06bc3008910e3fa1ec007994","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-3.0.0.tgz"},"directories":{}},"3.0.1":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"3.0.1","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"chownr":"0","graceful-fs":"^3.0.0","mkdirp":"~0.3.3","normalize-package-data":"^0.4.0","npm-cache-filename":"^1.0.0","request":"2 >=2.25.0","retry":"0.6.0","rimraf":"~2","semver":"2 >=2.2.1","slide":"~1.1.3","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","gitHead":"fe8382dde609ea1e3580fcdc5bc3d0bba119cfc6","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@3.0.1","_shasum":"5f3ee362ce5c237cfb798fce22c77875fc1a63c2","_from":".","_npmVersion":"1.5.0-alpha-1","_npmUser":{"name":"othiym23","email":"ogd@aoaioxxysz.net"},"maintainers":[{"name":"isaacs","email":"i@izs.me"},{"name":"othiym23","email":"ogd@aoaioxxysz.net"}],"dist":{"shasum":"5f3ee362ce5c237cfb798fce22c77875fc1a63c2","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-3.0.1.tgz"},"directories":{}},"2.0.3":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"2.0.3","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"chownr":"0","graceful-fs":"^3.0.0","mkdirp":"~0.3.3","npm-cache-filename":"^1.0.0","request":"2 >=2.25.0","retry":"0.6.0","rimraf":"~2","semver":"2 >=2.2.1","slide":"~1.1.3","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","gitHead":"2578fb9a807d77417554ba235ba8fac39405e832","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@2.0.3","_shasum":"93dad3d9a162c99404badb71739c622c0f3b9a72","_from":".","_npmVersion":"1.5.0-alpha-1","_npmUser":{"name":"othiym23","email":"ogd@aoaioxxysz.net"},"maintainers":[{"name":"isaacs","email":"i@izs.me"},{"name":"othiym23","email":"ogd@aoaioxxysz.net"}],"dist":{"shasum":"93dad3d9a162c99404badb71739c622c0f3b9a72","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-2.0.3.tgz"},"directories":{}},"3.0.2":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"3.0.2","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"chownr":"0","graceful-fs":"^3.0.0","mkdirp":"~0.3.3","normalize-package-data":"^0.4.0","npm-cache-filename":"^1.0.0","request":"2 >=2.25.0","retry":"0.6.0","rimraf":"~2","semver":"2 >=2.2.1","slide":"~1.1.3","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","gitHead":"15343019160ace0b9874cf0ec186b3425dbc7301","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@3.0.2","_shasum":"5dd0910157ce55f4286a1871d39f9a2128cd3c99","_from":".","_npmVersion":"1.5.0-alpha-2","_npmUser":{"name":"othiym23","email":"ogd@aoaioxxysz.net"},"maintainers":[{"name":"isaacs","email":"i@izs.me"},{"name":"othiym23","email":"ogd@aoaioxxysz.net"}],"dist":{"shasum":"5dd0910157ce55f4286a1871d39f9a2128cd3c99","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-3.0.2.tgz"},"directories":{}},"3.0.3":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"3.0.3","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"chownr":"0","graceful-fs":"^3.0.0","mkdirp":"~0.3.3","normalize-package-data":"^0.4.0","npm-cache-filename":"^1.0.0","request":"2 >=2.25.0","retry":"0.6.0","rimraf":"~2","semver":"2 >=2.2.1 || 3.x","slide":"~1.1.3","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","gitHead":"b18a780d1185f27c06c27812147b83aba0d4a2f5","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@3.0.3","_shasum":"2377dc1cf69b4d374b3a95fb7feba8c804d8cb30","_from":".","_npmVersion":"2.0.0-alpha-5","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"},{"name":"othiym23","email":"ogd@aoaioxxysz.net"}],"dist":{"shasum":"2377dc1cf69b4d374b3a95fb7feba8c804d8cb30","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-3.0.3.tgz"},"directories":{}},"3.0.4":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"3.0.4","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"chownr":"0","graceful-fs":"^3.0.0","mkdirp":"~0.5.0","normalize-package-data":"^0.4.0","npm-cache-filename":"^1.0.0","request":"2 >=2.25.0","retry":"0.6.0","rimraf":"~2","semver":"2 >=2.2.1 || 3.x","slide":"~1.1.3","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","gitHead":"54900fe4b2eb5b99ee6dfe173f145732fdfae80e","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@3.0.4","_shasum":"d4a177d1f25615cfaef9b6844fa366ffbf5f578a","_from":".","_npmVersion":"2.0.0-alpha-5","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"},{"name":"othiym23","email":"ogd@aoaioxxysz.net"}],"dist":{"shasum":"d4a177d1f25615cfaef9b6844fa366ffbf5f578a","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-3.0.4.tgz"},"directories":{}},"3.0.5":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"3.0.5","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"chownr":"0","graceful-fs":"^3.0.0","mkdirp":"0.5","normalize-package-data":"0.4","npm-cache-filename":"^1.0.0","request":"2 >=2.25.0","retry":"0.6.0","rimraf":"2","semver":"2 >=2.2.1 || 3.x","slide":"^1.1.3","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","gitHead":"635db1654346bc86473df7b39626601425f46177","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@3.0.5","_shasum":"cdabaefa399b81ac8a86a48718aefd80e7b19ff3","_from":".","_npmVersion":"2.0.0-alpha-5","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"},{"name":"othiym23","email":"ogd@aoaioxxysz.net"}],"dist":{"shasum":"cdabaefa399b81ac8a86a48718aefd80e7b19ff3","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-3.0.5.tgz"},"directories":{}},"3.0.6":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"3.0.6","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"chownr":"0","graceful-fs":"^3.0.0","mkdirp":"^0.5.0","normalize-package-data":"0.4","npm-cache-filename":"^1.0.0","request":"2 >=2.25.0","retry":"0.6.0","rimraf":"2","semver":"2 >=2.2.1 || 3.x","slide":"^1.1.3","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"ISC","gitHead":"eba30fadd724ed5cad1aec95ac3ee907a59b7317","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@3.0.6","_shasum":"14a17d9a60ed2a80b04edcbc596dbce0d96540ee","_from":".","_npmVersion":"1.4.22","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"},{"name":"othiym23","email":"ogd@aoaioxxysz.net"}],"dist":{"shasum":"14a17d9a60ed2a80b04edcbc596dbce0d96540ee","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-3.0.6.tgz"},"directories":{}},"2.0.4":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"2.0.4","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"chownr":"0","graceful-fs":"^3.0.0","mkdirp":"^0.5.0","npm-cache-filename":"^1.0.0","request":"2 >=2.25.0","retry":"0.6.0","rimraf":"~2","semver":"2 >=2.2.1","slide":"~1.1.3","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"ISC","gitHead":"a10f621d9cdc813b9d3092a14b661f65bfa6d40d","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@2.0.4","_shasum":"528e08900d7655c12096d1637d1c3a7a5b451019","_from":".","_npmVersion":"1.4.22","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"},{"name":"othiym23","email":"ogd@aoaioxxysz.net"}],"dist":{"shasum":"528e08900d7655c12096d1637d1c3a7a5b451019","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-2.0.4.tgz"},"directories":{}}},"readme":"# npm-registry-client\u000a\u000aThe code that npm uses to talk to the registry.\u000a\u000aIt handles all the caching and HTTP calls.\u000a\u000a## Usage\u000a\u000a```javascript\u000avar RegClient = require('npm-registry-client')\u000avar client = new RegClient(config)\u000avar uri = \"npm://registry.npmjs.org/npm\"\u000avar options = {timeout: 1000}\u000a\u000aclient.get(uri, options, function (error, data, raw, res) {\u000a // error is an error if there was a problem.\u000a // data is the parsed data object\u000a // raw is the json string\u000a // res is the response from couch\u000a})\u000a```\u000a\u000a# Registry URLs\u000a\u000aThe registry calls take either a full URL pointing to a resource in the\u000aregistry, or a base URL for the registry as a whole (for the base URL, any path\u000awill be ignored). In addition to `http` and `https`, `npm` URLs are allowed.\u000a`npm` URLs are `https` URLs with the additional restrictions that they will\u000aalways include authorization credentials, and the response is always registry\u000ametadata (and not tarballs or other attachments).\u000a\u000a# Configuration\u000a\u000aThis program is designed to work with\u000a[npmconf](https://npmjs.org/package/npmconf), but you can also pass in\u000aa plain-jane object with the appropriate configs, and it'll shim it\u000afor you. Any configuration thingie that has get/set/del methods will\u000aalso be accepted.\u000a\u000a* `cache` **Required** {String} Path to the cache folder\u000a* `always-auth` {Boolean} Auth even for GET requests.\u000a* `auth` {String} A base64-encoded `username:password`\u000a* `email` {String} User's email address\u000a* `tag` {String} The default tag to use when publishing new packages.\u000a Default = `\"latest\"`\u000a* `ca` {String} Cerficate signing authority certificates to trust.\u000a* `cert` {String} Client certificate (PEM encoded). Enable access\u000a to servers that require client certificates\u000a* `key` {String} Private key (PEM encoded) for client certificate 'cert'\u000a* `strict-ssl` {Boolean} Whether or not to be strict with SSL\u000a certificates. Default = `true`\u000a* `user-agent` {String} User agent header to send. Default =\u000a `\"node/{process.version} {process.platform} {process.arch}\"`\u000a* `log` {Object} The logger to use. Defaults to `require(\"npmlog\")` if\u000a that works, otherwise logs are disabled.\u000a* `fetch-retries` {Number} Number of times to retry on GET failures.\u000a Default=2\u000a* `fetch-retry-factor` {Number} `factor` setting for `node-retry`. Default=10\u000a* `fetch-retry-mintimeout` {Number} `minTimeout` setting for `node-retry`.\u000a Default=10000 (10 seconds)\u000a* `fetch-retry-maxtimeout` {Number} `maxTimeout` setting for `node-retry`.\u000a Default=60000 (60 seconds)\u000a* `proxy` {URL} The url to proxy requests through.\u000a* `https-proxy` {URL} The url to proxy https requests through.\u000a Defaults to be the same as `proxy` if unset.\u000a* `_auth` {String} The base64-encoded authorization header.\u000a* `username` `_password` {String} Username/password to use to generate\u000a `_auth` if not supplied.\u000a* `_token` {Object} A token for use with\u000a [couch-login](https://npmjs.org/package/couch-login)\u000a\u000a# client.request(method, uri, options, cb)\u000a\u000a* `method` {String} HTTP method\u000a* `uri` {String} URI pointing to the resource to request\u000a* `options` {Object} Object containing optional per-request properties.\u000a * `what` {Stream | Buffer | String | Object} The request body. Objects\u000a that are not Buffers or Streams are encoded as JSON.\u000a * `etag` {String} The cached ETag\u000a * `follow` {Boolean} Follow 302/301 responses (defaults to true)\u000a* `cb` {Function}\u000a * `error` {Error | null}\u000a * `data` {Object} the parsed data object\u000a * `raw` {String} the json\u000a * `res` {Response Object} response from couch\u000a\u000aMake a request to the registry. All the other methods are wrappers around\u000a`request`.\u000a\u000a# client.adduser(base, username, password, email, cb)\u000a\u000a* `base` {String} Base registry URL\u000a* `username` {String}\u000a* `password` {String}\u000a* `email` {String}\u000a* `cb` {Function}\u000a\u000aAdd a user account to the registry, or verify the credentials.\u000a\u000a# client.deprecate(uri, version, message, cb)\u000a\u000a* `uri` {String} Full registry URI for the deprecated package\u000a* `version` {String} Semver version range\u000a* `message` {String} The message to use as a deprecation warning\u000a* `cb` {Function}\u000a\u000aDeprecate a version of a package in the registry.\u000a\u000a# client.bugs(uri, cb)\u000a\u000a* `uri` {String} Full registry URI for the package\u000a* `cb` {Function}\u000a\u000aGet the url for bugs of a package\u000a\u000a# client.get(uri, options, cb)\u000a\u000a* `uri` {String} The complete registry URI to fetch\u000a* `options` {Object} Object containing optional per-request properties.\u000a * `timeout` {Number} Duration before the request times out.\u000a * `follow` {Boolean} Follow 302/301 responses (defaults to true)\u000a * `staleOk` {Boolean} If there's cached data available, then return that\u000a to the callback quickly, and update the cache the background.\u000a\u000aFetches data from the registry via a GET request, saving it in the cache folder\u000awith the ETag.\u000a\u000a# client.publish(uri, data, tarball, cb)\u000a\u000a* `uri` {String} The registry URI to publish to\u000a* `data` {Object} Package data\u000a* `tarball` {String | Stream} Filename or stream of the package tarball\u000a* `cb` {Function}\u000a\u000aPublish a package to the registry.\u000a\u000aNote that this does not create the tarball from a folder. However, it can\u000aaccept a gzipped tar stream or a filename to a tarball.\u000a\u000a# client.star(uri, starred, cb)\u000a\u000a* `uri` {String} The complete registry URI to star\u000a* `starred` {Boolean} True to star the package, false to unstar it.\u000a* `cb` {Function}\u000a\u000aStar or unstar a package.\u000a\u000aNote that the user does not have to be the package owner to star or unstar a\u000apackage, though other writes do require that the user be the package owner.\u000a\u000a# client.stars(base, username, cb)\u000a\u000a* `base` {String} The base URL for the registry\u000a* `username` {String} Name of user to fetch starred packages for.\u000a* `cb` {Function}\u000a\u000aView your own or another user's starred packages.\u000a\u000a# client.tag(uri, version, tag, cb)\u000a\u000a* `uri` {String} The complete registry URI to tag\u000a* `version` {String} Version to tag\u000a* `tag` {String} Tag name to apply\u000a* `cb` {Function}\u000a\u000aMark a version in the `dist-tags` hash, so that `pkg@tag` will fetch the\u000aspecified version.\u000a\u000a# client.unpublish(uri, [ver], cb)\u000a\u000a* `uri` {String} The complete registry URI to unpublish\u000a* `ver` {String} version to unpublish. Leave blank to unpublish all\u000a versions.\u000a* `cb` {Function}\u000a\u000aRemove a version of a package (or all versions) from the registry. When the\u000alast version us unpublished, the entire document is removed from the database.\u000a\u000a# client.upload(uri, file, [etag], [nofollow], cb)\u000a\u000a* `uri` {String} The complete registry URI to upload to\u000a* `file` {String | Stream} Either the filename or a readable stream\u000a* `etag` {String} Cache ETag\u000a* `nofollow` {Boolean} Do not follow 301/302 responses\u000a* `cb` {Function}\u000a\u000aUpload an attachment. Mostly used by `client.publish()`.\u000a","maintainers":[{"name":"isaacs","email":"i@izs.me"},{"name":"othiym23","email":"ogd@aoaioxxysz.net"}],"time":{"modified":"2014-07-31T21:59:52.896Z","created":"2012-06-07T04:43:36.581Z","0.0.1":"2012-06-07T04:43:38.123Z","0.0.2":"2012-06-07T05:35:05.937Z","0.0.3":"2012-06-09T00:55:25.861Z","0.0.4":"2012-06-11T03:53:26.548Z","0.0.5":"2012-06-11T23:48:11.235Z","0.0.6":"2012-06-17T06:23:27.320Z","0.0.7":"2012-06-18T19:19:38.315Z","0.0.8":"2012-06-28T20:40:20.563Z","0.0.9":"2012-07-10T03:28:04.651Z","0.0.10":"2012-07-11T17:03:45.151Z","0.0.11":"2012-07-17T14:06:37.489Z","0.1.0":"2012-07-23T18:17:38.007Z","0.1.1":"2012-07-23T21:21:28.196Z","0.1.2":"2012-07-24T06:14:12.831Z","0.1.3":"2012-08-07T02:02:20.564Z","0.1.4":"2012-08-15T03:04:52.822Z","0.1.5":"2012-08-17T21:59:33.310Z","0.2.0":"2012-08-17T22:00:18.081Z","0.2.1":"2012-08-17T22:07:28.827Z","0.2.2":"2012-08-17T22:37:24.352Z","0.2.3":"2012-08-19T19:16:44.808Z","0.2.4":"2012-08-19T19:18:51.792Z","0.2.5":"2012-08-20T16:54:50.794Z","0.2.6":"2012-08-22T00:25:04.766Z","0.2.7":"2012-08-27T19:07:34.829Z","0.2.8":"2012-10-02T19:53:50.661Z","0.2.9":"2012-10-03T22:09:50.766Z","0.2.10":"2012-10-25T14:55:54.216Z","0.2.11":"2012-12-21T16:26:38.094Z","0.2.12":"2013-01-18T22:22:41.668Z","0.2.13":"2013-02-06T00:16:35.939Z","0.2.14":"2013-02-10T02:44:02.764Z","0.2.15":"2013-02-11T19:18:55.678Z","0.2.16":"2013-02-15T17:09:03.249Z","0.2.17":"2013-02-16T03:47:13.898Z","0.2.18":"2013-03-06T22:09:23.536Z","0.2.19":"2013-03-20T06:27:39.128Z","0.2.20":"2013-03-28T00:43:07.558Z","0.2.21":"2013-04-29T15:46:54.094Z","0.2.22":"2013-04-29T15:51:02.178Z","0.2.23":"2013-05-11T00:28:14.198Z","0.2.24":"2013-05-24T21:27:50.693Z","0.2.25":"2013-06-20T15:36:46.277Z","0.2.26":"2013-07-06T17:12:54.670Z","0.2.27":"2013-07-11T07:14:45.740Z","0.2.28":"2013-08-02T20:27:41.732Z","0.2.29":"2013-10-28T18:23:24.477Z","0.2.30":"2013-11-18T23:12:00.540Z","0.2.31":"2013-12-16T08:36:43.044Z","0.3.0":"2013-12-17T07:03:10.699Z","0.3.1":"2013-12-17T16:53:27.867Z","0.3.2":"2013-12-17T22:25:14.882Z","0.3.3":"2013-12-21T16:07:06.773Z","0.3.4":"2014-01-29T15:24:05.163Z","0.3.5":"2014-01-31T01:53:19.656Z","0.3.6":"2014-02-07T00:17:21.362Z","0.4.0":"2014-02-13T01:17:18.973Z","0.4.1":"2014-02-13T23:47:37.892Z","0.4.2":"2014-02-14T00:29:13.086Z","0.4.3":"2014-02-16T03:40:54.640Z","0.4.4":"2014-02-16T03:41:48.856Z","0.4.5":"2014-03-12T05:09:17.474Z","0.4.6":"2014-03-29T19:44:15.041Z","0.4.7":"2014-04-02T19:41:07.149Z","0.4.8":"2014-05-01T22:24:54.980Z","0.4.9":"2014-05-12T21:52:55.127Z","0.4.10":"2014-05-13T16:44:29.801Z","0.4.11":"2014-05-13T20:33:04.738Z","0.4.12":"2014-05-14T06:14:22.842Z","1.0.0":"2014-05-14T23:04:37.188Z","1.0.1":"2014-06-03T00:55:54.448Z","2.0.0":"2014-06-06T04:23:46.579Z","2.0.1":"2014-06-06T06:25:14.419Z","2.0.2":"2014-06-14T00:33:10.205Z","3.0.0":"2014-07-02T00:30:29.154Z","3.0.1":"2014-07-14T23:29:05.057Z","2.0.3":"2014-07-15T00:09:36.043Z","3.0.2":"2014-07-17T06:30:02.659Z","3.0.3":"2014-07-23T21:20:42.406Z","3.0.4":"2014-07-25T00:27:26.007Z","3.0.5":"2014-07-25T00:28:48.007Z","3.0.6":"2014-07-31T21:57:49.043Z","2.0.4":"2014-07-31T21:59:52.896Z"},"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"repository":{"url":"git://github.com/isaacs/npm-registry-client"},"users":{"fgribreau":true,"fengmk2":true},"readmeFilename":"README.md","homepage":"https://github.com/isaacs/npm-registry-client","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"license":"ISC","_attachments":{}}
diff --git a/deps/npm/node_modules/npm-registry-client/test/fixtures/underscore/1.3.3/cache.json b/deps/npm/node_modules/npm-registry-client/test/fixtures/underscore/1.3.3/cache.json
deleted file mode 100644
index 01da3002763..00000000000
--- a/deps/npm/node_modules/npm-registry-client/test/fixtures/underscore/1.3.3/cache.json
+++ /dev/null
@@ -1 +0,0 @@
-{"name":"underscore","description":"JavaScript's functional programming helper library.","homepage":"http://documentcloud.github.com/underscore/","keywords":["util","functional","server","client","browser"],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"repository":{"type":"git","url":"git://github.com/documentcloud/underscore.git"},"main":"underscore.js","version":"1.3.3","_npmUser":{"name":"jashkenas","email":"jashkenas@gmail.com"},"_id":"underscore@1.3.3","dependencies":{},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.1","_nodeVersion":"v0.6.11","_defaultsLoaded":true,"dist":{"shasum":"47ac53683daf832bfa952e1774417da47817ae42","tarball":"http://registry.npmjs.org/underscore/-/underscore-1.3.3.tgz"},"readme":" __ \n /\\ \\ __ \n __ __ ___ \\_\\ \\ __ _ __ ____ ___ ___ _ __ __ /\\_\\ ____ \n /\\ \\/\\ \\ /' _ `\\ /'_ \\ /'__`\\/\\ __\\/ ,__\\ / ___\\ / __`\\/\\ __\\/'__`\\ \\/\\ \\ /',__\\ \n \\ \\ \\_\\ \\/\\ \\/\\ \\/\\ \\ \\ \\/\\ __/\\ \\ \\//\\__, `\\/\\ \\__//\\ \\ \\ \\ \\ \\//\\ __/ __ \\ \\ \\/\\__, `\\\n \\ \\____/\\ \\_\\ \\_\\ \\___,_\\ \\____\\\\ \\_\\\\/\\____/\\ \\____\\ \\____/\\ \\_\\\\ \\____\\/\\_\\ _\\ \\ \\/\\____/\n \\/___/ \\/_/\\/_/\\/__,_ /\\/____/ \\/_/ \\/___/ \\/____/\\/___/ \\/_/ \\/____/\\/_//\\ \\_\\ \\/___/ \n \\ \\____/ \n \\/___/\n \nUnderscore.js is a utility-belt library for JavaScript that provides \nsupport for the usual functional suspects (each, map, reduce, filter...) \nwithout extending any core JavaScript objects.\n\nFor Docs, License, Tests, and pre-packed downloads, see:\nhttp://documentcloud.github.com/underscore/\n\nMany thanks to our contributors:\nhttps://github.com/documentcloud/underscore/contributors\n","maintainers":[{"name":"documentcloud","email":"jeremy@documentcloud.org"},{"name":"jashkenas","email":"jashkenas@gmail.com"}],"directories":{}} \ No newline at end of file
diff --git a/deps/npm/node_modules/npm-registry-client/test/fixtures/underscore/1.3.3/package.tgz b/deps/npm/node_modules/npm-registry-client/test/fixtures/underscore/1.3.3/package.tgz
deleted file mode 100644
index 19da9baa7fb..00000000000
--- a/deps/npm/node_modules/npm-registry-client/test/fixtures/underscore/1.3.3/package.tgz
+++ /dev/null
Binary files differ
diff --git a/deps/npm/node_modules/npm-registry-client/test/fixtures/underscore/cache.json b/deps/npm/node_modules/npm-registry-client/test/fixtures/underscore/cache.json
deleted file mode 100644
index d899f11922a..00000000000
--- a/deps/npm/node_modules/npm-registry-client/test/fixtures/underscore/cache.json
+++ /dev/null
@@ -1 +0,0 @@
-{"_id":"underscore","_rev":"72-47f2986bfd8e8b55068b204588bbf484","name":"underscore","description":"JavaScript's functional programming helper library.","dist-tags":{"latest":"1.3.3","stable":"1.3.3"},"versions":{"1.0.3":{"name":"underscore","description":"Functional programming aid for JavaScript. Works well with jQuery.","url":"http://documentcloud.github.com/underscore/","keywords":["util","functional","server","client","browser"],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"contributors":[],"dependencies":{},"lib":".","main":"underscore","version":"1.0.3","_id":"underscore@1.0.3","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"tarball":"http://registry.npmjs.org/underscore/-/underscore-1.0.3.tgz"},"directories":{},"_npmUser":{"name":"jashkenas","email":"jashkenas@gmail.com"},"maintainers":[{"name":"documentcloud","email":"jeremy@documentcloud.org"},{"name":"jashkenas","email":"jashkenas@gmail.com"}]},"1.0.4":{"name":"underscore","description":"Functional programming aid for JavaScript. Works well with jQuery.","url":"http://documentcloud.github.com/underscore/","keywords":["util","functional","server","client","browser"],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"contributors":[],"dependencies":{},"lib":".","main":"underscore","version":"1.0.4","_id":"underscore@1.0.4","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"tarball":"http://registry.npmjs.org/underscore/-/underscore-1.0.4.tgz"},"directories":{},"_npmUser":{"name":"jashkenas","email":"jashkenas@gmail.com"},"maintainers":[{"name":"documentcloud","email":"jeremy@documentcloud.org"},{"name":"jashkenas","email":"jashkenas@gmail.com"}]},"1.1.0":{"name":"underscore","description":"Functional programming aid for JavaScript. Works well with jQuery.","url":"http://documentcloud.github.com/underscore/","keywords":["util","functional","server","client","browser"],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"contributors":[],"dependencies":{},"lib":".","main":"underscore","version":"1.1.0","_id":"underscore@1.1.0","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"tarball":"http://registry.npmjs.org/underscore/-/underscore-1.1.0.tgz"},"directories":{},"_npmUser":{"name":"jashkenas","email":"jashkenas@gmail.com"},"maintainers":[{"name":"documentcloud","email":"jeremy@documentcloud.org"},{"name":"jashkenas","email":"jashkenas@gmail.com"}]},"1.1.1":{"name":"underscore","description":"Functional programming aid for JavaScript. Works well with jQuery.","url":"http://documentcloud.github.com/underscore/","keywords":["util","functional","server","client","browser"],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"contributors":[],"dependencies":{},"lib":".","main":"underscore","version":"1.1.1","_id":"underscore@1.1.1","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"tarball":"http://registry.npmjs.org/underscore/-/underscore-1.1.1.tgz"},"directories":{},"_npmUser":{"name":"jashkenas","email":"jashkenas@gmail.com"},"maintainers":[{"name":"documentcloud","email":"jeremy@documentcloud.org"},{"name":"jashkenas","email":"jashkenas@gmail.com"}]},"1.1.2":{"name":"underscore","description":"Functional programming aid for JavaScript. Works well with jQuery.","url":"http://documentcloud.github.com/underscore/","keywords":["util","functional","server","client","browser"],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"contributors":[],"dependencies":{},"lib":".","main":"underscore","version":"1.1.2","_id":"underscore@1.1.2","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"tarball":"http://registry.npmjs.org/underscore/-/underscore-1.1.2.tgz"},"directories":{},"_npmUser":{"name":"jashkenas","email":"jashkenas@gmail.com"},"maintainers":[{"name":"documentcloud","email":"jeremy@documentcloud.org"},{"name":"jashkenas","email":"jashkenas@gmail.com"}]},"1.1.3":{"name":"underscore","description":"Functional programming aid for JavaScript. Works well with jQuery.","url":"http://documentcloud.github.com/underscore/","keywords":["util","functional","server","client","browser"],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"contributors":[],"dependencies":{},"lib":".","main":"underscore","version":"1.1.3","_id":"underscore@1.1.3","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.8-1","_nodeVersion":"v0.2.5","dist":{"tarball":"http://registry.npmjs.org/underscore/-/underscore-1.1.3.tgz"},"directories":{},"_npmUser":{"name":"jashkenas","email":"jashkenas@gmail.com"},"maintainers":[{"name":"documentcloud","email":"jeremy@documentcloud.org"},{"name":"jashkenas","email":"jashkenas@gmail.com"}]},"1.1.4":{"name":"underscore","description":"Functional programming aid for JavaScript. Works well with jQuery.","url":"http://documentcloud.github.com/underscore/","keywords":["util","functional","server","client","browser"],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"contributors":[],"dependencies":{},"lib":".","main":"underscore.js","version":"1.1.4","_id":"underscore@1.1.4","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"0.3.9","_nodeVersion":"v0.5.0-pre","dist":{"shasum":"9e82274902865625b3a6d4c315a38ffd80047dae","tarball":"http://registry.npmjs.org/underscore/-/underscore-1.1.4.tgz"},"_npmUser":{"name":"jashkenas","email":"jashkenas@gmail.com"},"maintainers":[{"name":"documentcloud","email":"jeremy@documentcloud.org"},{"name":"jashkenas","email":"jashkenas@gmail.com"}],"directories":{}},"1.1.5":{"name":"underscore","description":"JavaScript's functional programming helper library.","homepage":"http://documentcloud.github.com/underscore/","keywords":["util","functional","server","client","browser"],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"contributors":[],"dependencies":{},"repository":{"type":"git","url":"git://github.com/documentcloud/underscore.git"},"main":"underscore.js","version":"1.1.5","_id":"underscore@1.1.5","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"0.3.16","_nodeVersion":"v0.4.2","directories":{},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"23601d62c75619998b2f0db24938102793336a56","tarball":"http://registry.npmjs.org/underscore/-/underscore-1.1.5.tgz"},"_npmUser":{"name":"jashkenas","email":"jashkenas@gmail.com"},"maintainers":[{"name":"documentcloud","email":"jeremy@documentcloud.org"},{"name":"jashkenas","email":"jashkenas@gmail.com"}]},"1.1.6":{"name":"underscore","description":"JavaScript's functional programming helper library.","homepage":"http://documentcloud.github.com/underscore/","keywords":["util","functional","server","client","browser"],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"contributors":[],"dependencies":{},"repository":{"type":"git","url":"git://github.com/documentcloud/underscore.git"},"main":"underscore.js","version":"1.1.6","_id":"underscore@1.1.6","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"0.3.18","_nodeVersion":"v0.4.2","directories":{},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"6868da1bdd72d75285be0b4e50f228e70d001a2c","tarball":"http://registry.npmjs.org/underscore/-/underscore-1.1.6.tgz"},"_npmUser":{"name":"jashkenas","email":"jashkenas@gmail.com"},"maintainers":[{"name":"documentcloud","email":"jeremy@documentcloud.org"},{"name":"jashkenas","email":"jashkenas@gmail.com"}]},"1.1.7":{"name":"underscore","description":"JavaScript's functional programming helper library.","homepage":"http://documentcloud.github.com/underscore/","keywords":["util","functional","server","client","browser"],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"contributors":[],"dependencies":{},"repository":{"type":"git","url":"git://github.com/documentcloud/underscore.git"},"main":"underscore.js","version":"1.1.7","devDependencies":{},"_id":"underscore@1.1.7","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.3","_nodeVersion":"v0.4.7","_defaultsLoaded":true,"dist":{"shasum":"40bab84bad19d230096e8d6ef628bff055d83db0","tarball":"http://registry.npmjs.org/underscore/-/underscore-1.1.7.tgz"},"scripts":{},"_npmUser":{"name":"jashkenas","email":"jashkenas@gmail.com"},"maintainers":[{"name":"documentcloud","email":"jeremy@documentcloud.org"},{"name":"jashkenas","email":"jashkenas@gmail.com"}],"directories":{}},"1.2.0":{"name":"underscore","description":"JavaScript's functional programming helper library.","homepage":"http://documentcloud.github.com/underscore/","keywords":["util","functional","server","client","browser"],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"contributors":[],"dependencies":{},"repository":{"type":"git","url":"git://github.com/documentcloud/underscore.git"},"main":"underscore.js","version":"1.2.0","_npmJsonOpts":{"file":"/Users/jashkenas/.npm/underscore/1.2.0/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"underscore@1.2.0","devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.22","_nodeVersion":"v0.4.10","_defaultsLoaded":true,"dist":{"shasum":"b32ce32c8c118caa8031c10b54c7f65ab3b557fd","tarball":"http://registry.npmjs.org/underscore/-/underscore-1.2.0.tgz"},"scripts":{},"maintainers":[{"name":"documentcloud","email":"jeremy@documentcloud.org"},{"name":"jashkenas","email":"jashkenas@gmail.com"}],"_npmUser":{"name":"jashkenas","email":"jashkenas@gmail.com"},"directories":{}},"1.2.1":{"name":"underscore","description":"JavaScript's functional programming helper library.","homepage":"http://documentcloud.github.com/underscore/","keywords":["util","functional","server","client","browser"],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"contributors":[],"dependencies":{},"repository":{"type":"git","url":"git://github.com/documentcloud/underscore.git"},"main":"underscore.js","version":"1.2.1","_npmJsonOpts":{"file":"/Users/jashkenas/.npm/underscore/1.2.1/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"underscore@1.2.1","devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.22","_nodeVersion":"v0.4.10","_defaultsLoaded":true,"dist":{"shasum":"fc5c6b0765673d92a2d4ac8b4dc0aa88702e2bd4","tarball":"http://registry.npmjs.org/underscore/-/underscore-1.2.1.tgz"},"scripts":{},"maintainers":[{"name":"documentcloud","email":"jeremy@documentcloud.org"},{"name":"jashkenas","email":"jashkenas@gmail.com"}],"_npmUser":{"name":"jashkenas","email":"jashkenas@gmail.com"},"directories":{}},"1.2.2":{"name":"underscore","description":"JavaScript's functional programming helper library.","homepage":"http://documentcloud.github.com/underscore/","keywords":["util","functional","server","client","browser"],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"contributors":[],"dependencies":{},"repository":{"type":"git","url":"git://github.com/documentcloud/underscore.git"},"main":"underscore.js","version":"1.2.2","_npmUser":{"name":"jashkenas","email":"jashkenas@gmail.com"},"_id":"underscore@1.2.2","devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.6.0","_defaultsLoaded":true,"dist":{"shasum":"74dd40e9face84e724eb2edae945b8aedc233ba3","tarball":"http://registry.npmjs.org/underscore/-/underscore-1.2.2.tgz"},"maintainers":[{"name":"documentcloud","email":"jeremy@documentcloud.org"},{"name":"jashkenas","email":"jashkenas@gmail.com"}],"directories":{}},"1.2.3":{"name":"underscore","description":"JavaScript's functional programming helper library.","homepage":"http://documentcloud.github.com/underscore/","keywords":["util","functional","server","client","browser"],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"contributors":[],"dependencies":{},"repository":{"type":"git","url":"git://github.com/documentcloud/underscore.git"},"main":"underscore.js","version":"1.2.3","_npmUser":{"name":"jashkenas","email":"jashkenas@gmail.com"},"_id":"underscore@1.2.3","devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.6.0","_defaultsLoaded":true,"dist":{"shasum":"11b874da70f4683d7d48bba2b44be1e600d2f6cf","tarball":"http://registry.npmjs.org/underscore/-/underscore-1.2.3.tgz"},"maintainers":[{"name":"documentcloud","email":"jeremy@documentcloud.org"},{"name":"jashkenas","email":"jashkenas@gmail.com"}],"directories":{}},"1.2.4":{"name":"underscore","description":"JavaScript's functional programming helper library.","homepage":"http://documentcloud.github.com/underscore/","keywords":["util","functional","server","client","browser"],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"contributors":[],"repository":{"type":"git","url":"git://github.com/documentcloud/underscore.git"},"main":"underscore.js","version":"1.2.4","_npmUser":{"name":"jashkenas","email":"jashkenas@gmail.com"},"_id":"underscore@1.2.4","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"e8da6241aa06f64df2473bb2590b8c17c84c3c7e","tarball":"http://registry.npmjs.org/underscore/-/underscore-1.2.4.tgz"},"maintainers":[{"name":"documentcloud","email":"jeremy@documentcloud.org"},{"name":"jashkenas","email":"jashkenas@gmail.com"}],"directories":{}},"1.3.0":{"name":"underscore","description":"JavaScript's functional programming helper library.","homepage":"http://documentcloud.github.com/underscore/","keywords":["util","functional","server","client","browser"],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"contributors":[],"repository":{"type":"git","url":"git://github.com/documentcloud/underscore.git"},"main":"underscore.js","version":"1.3.0","_npmUser":{"name":"jashkenas","email":"jashkenas@gmail.com"},"_id":"underscore@1.3.0","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"253b2d79b7bb67943ced0fc744eb18267963ede8","tarball":"http://registry.npmjs.org/underscore/-/underscore-1.3.0.tgz"},"maintainers":[{"name":"documentcloud","email":"jeremy@documentcloud.org"},{"name":"jashkenas","email":"jashkenas@gmail.com"}],"directories":{}},"1.3.1":{"name":"underscore","description":"JavaScript's functional programming helper library.","homepage":"http://documentcloud.github.com/underscore/","keywords":["util","functional","server","client","browser"],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"repository":{"type":"git","url":"git://github.com/documentcloud/underscore.git"},"main":"underscore.js","version":"1.3.1","_npmUser":{"name":"jashkenas","email":"jashkenas@gmail.com"},"_id":"underscore@1.3.1","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"6cb8aad0e77eb5dbbfb54b22bcd8697309cf9641","tarball":"http://registry.npmjs.org/underscore/-/underscore-1.3.1.tgz"},"maintainers":[{"name":"documentcloud","email":"jeremy@documentcloud.org"},{"name":"jashkenas","email":"jashkenas@gmail.com"}],"directories":{}},"1.3.2":{"name":"underscore","description":"JavaScript's functional programming helper library.","homepage":"http://documentcloud.github.com/underscore/","keywords":["util","functional","server","client","browser"],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"repository":{"type":"git","url":"git://github.com/documentcloud/underscore.git"},"main":"underscore.js","version":"1.3.2","_npmUser":{"name":"jashkenas","email":"jashkenas@gmail.com"},"_id":"underscore@1.3.2","dependencies":{},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.1","_nodeVersion":"v0.6.11","_defaultsLoaded":true,"dist":{"shasum":"1b4e455089ab1d1d38ab6794ffe6cf08f764394a","tarball":"http://registry.npmjs.org/underscore/-/underscore-1.3.2.tgz"},"readme":" __ \n /\\ \\ __ \n __ __ ___ \\_\\ \\ __ _ __ ____ ___ ___ _ __ __ /\\_\\ ____ \n /\\ \\/\\ \\ /' _ `\\ /'_ \\ /'__`\\/\\ __\\/ ,__\\ / ___\\ / __`\\/\\ __\\/'__`\\ \\/\\ \\ /',__\\ \n \\ \\ \\_\\ \\/\\ \\/\\ \\/\\ \\ \\ \\/\\ __/\\ \\ \\//\\__, `\\/\\ \\__//\\ \\ \\ \\ \\ \\//\\ __/ __ \\ \\ \\/\\__, `\\\n \\ \\____/\\ \\_\\ \\_\\ \\___,_\\ \\____\\\\ \\_\\\\/\\____/\\ \\____\\ \\____/\\ \\_\\\\ \\____\\/\\_\\ _\\ \\ \\/\\____/\n \\/___/ \\/_/\\/_/\\/__,_ /\\/____/ \\/_/ \\/___/ \\/____/\\/___/ \\/_/ \\/____/\\/_//\\ \\_\\ \\/___/ \n \\ \\____/ \n \\/___/\n \nUnderscore.js is a utility-belt library for JavaScript that provides \nsupport for the usual functional suspects (each, map, reduce, filter...) \nwithout extending any core JavaScript objects.\n\nFor Docs, License, Tests, and pre-packed downloads, see:\nhttp://documentcloud.github.com/underscore/\n\nMany thanks to our contributors:\nhttps://github.com/documentcloud/underscore/contributors\n","maintainers":[{"name":"documentcloud","email":"jeremy@documentcloud.org"},{"name":"jashkenas","email":"jashkenas@gmail.com"}],"directories":{}},"1.3.3":{"name":"underscore","description":"JavaScript's functional programming helper library.","homepage":"http://documentcloud.github.com/underscore/","keywords":["util","functional","server","client","browser"],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"repository":{"type":"git","url":"git://github.com/documentcloud/underscore.git"},"main":"underscore.js","version":"1.3.3","_npmUser":{"name":"jashkenas","email":"jashkenas@gmail.com"},"_id":"underscore@1.3.3","dependencies":{},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.1","_nodeVersion":"v0.6.11","_defaultsLoaded":true,"dist":{"shasum":"47ac53683daf832bfa952e1774417da47817ae42","tarball":"http://registry.npmjs.org/underscore/-/underscore-1.3.3.tgz"},"readme":" __ \n /\\ \\ __ \n __ __ ___ \\_\\ \\ __ _ __ ____ ___ ___ _ __ __ /\\_\\ ____ \n /\\ \\/\\ \\ /' _ `\\ /'_ \\ /'__`\\/\\ __\\/ ,__\\ / ___\\ / __`\\/\\ __\\/'__`\\ \\/\\ \\ /',__\\ \n \\ \\ \\_\\ \\/\\ \\/\\ \\/\\ \\ \\ \\/\\ __/\\ \\ \\//\\__, `\\/\\ \\__//\\ \\ \\ \\ \\ \\//\\ __/ __ \\ \\ \\/\\__, `\\\n \\ \\____/\\ \\_\\ \\_\\ \\___,_\\ \\____\\\\ \\_\\\\/\\____/\\ \\____\\ \\____/\\ \\_\\\\ \\____\\/\\_\\ _\\ \\ \\/\\____/\n \\/___/ \\/_/\\/_/\\/__,_ /\\/____/ \\/_/ \\/___/ \\/____/\\/___/ \\/_/ \\/____/\\/_//\\ \\_\\ \\/___/ \n \\ \\____/ \n \\/___/\n \nUnderscore.js is a utility-belt library for JavaScript that provides \nsupport for the usual functional suspects (each, map, reduce, filter...) \nwithout extending any core JavaScript objects.\n\nFor Docs, License, Tests, and pre-packed downloads, see:\nhttp://documentcloud.github.com/underscore/\n\nMany thanks to our contributors:\nhttps://github.com/documentcloud/underscore/contributors\n","maintainers":[{"name":"documentcloud","email":"jeremy@documentcloud.org"},{"name":"jashkenas","email":"jashkenas@gmail.com"}],"directories":{}}},"maintainers":[{"name":"documentcloud","email":"jeremy@documentcloud.org"},{"name":"jashkenas","email":"jashkenas@gmail.com"}],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"time":{"1.0.3":"2011-12-07T15:12:18.045Z","1.0.4":"2011-12-07T15:12:18.045Z","1.1.0":"2011-12-07T15:12:18.045Z","1.1.1":"2011-12-07T15:12:18.045Z","1.1.2":"2011-12-07T15:12:18.045Z","1.1.3":"2011-12-07T15:12:18.045Z","1.1.4":"2011-12-07T15:12:18.045Z","1.1.5":"2011-12-07T15:12:18.045Z","1.1.6":"2011-12-07T15:12:18.045Z","1.1.7":"2011-12-07T15:12:18.045Z","1.2.0":"2011-12-07T15:12:18.045Z","1.2.1":"2011-12-07T15:12:18.045Z","1.2.2":"2011-11-14T20:28:47.115Z","1.2.3":"2011-12-07T15:12:18.045Z","1.2.4":"2012-01-09T17:23:14.818Z","1.3.0":"2012-01-11T16:41:38.459Z","1.3.1":"2012-01-23T22:57:36.474Z","1.3.2":"2012-04-09T18:38:14.345Z","1.3.3":"2012-04-10T14:43:48.089Z"},"repository":{"type":"git","url":"git://github.com/documentcloud/underscore.git"},"users":{"vesln":true,"mvolkmann":true,"lancehunt":true,"mikl":true,"linus":true,"vasc":true,"bat":true,"dmalam":true,"mbrevoort":true,"danielr":true,"rsimoes":true,"thlorenz":true}} \ No newline at end of file
diff --git a/deps/npm/node_modules/read-installed/.travis.yml b/deps/npm/node_modules/read-installed/.travis.yml
new file mode 100644
index 00000000000..848ffd1c5f5
--- /dev/null
+++ b/deps/npm/node_modules/read-installed/.travis.yml
@@ -0,0 +1,9 @@
+language: node_js
+before_install:
+ - '[ "${TRAVIS_NODE_VERSION}" != "0.8" ] || npm install -g npm@1.4.28'
+ - npm install -g npm@latest
+node_js:
+ - '0.8'
+ - '0.10'
+ - '0.12'
+ - 'iojs'
diff --git a/deps/npm/node_modules/read-installed/node_modules/debuglog/package.json b/deps/npm/node_modules/read-installed/node_modules/debuglog/package.json
index 4a8257c9810..b622fe92286 100644
--- a/deps/npm/node_modules/read-installed/node_modules/debuglog/package.json
+++ b/deps/npm/node_modules/read-installed/node_modules/debuglog/package.json
@@ -6,7 +6,7 @@
"main": "debuglog.js",
"repository": {
"type": "git",
- "url": "https://github.com/sam-github/node-debuglog.git"
+ "url": "git+https://github.com/sam-github/node-debuglog.git"
},
"author": {
"name": "Sam Roberts",
diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/package.json b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/package.json
index de45b2f4da7..c3a39d401f6 100644
--- a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/package.json
+++ b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/package.json
@@ -20,7 +20,7 @@
},
"repository": {
"type": "git",
- "url": "https://github.com/npm/readdir-scoped-modules"
+ "url": "git+https://github.com/npm/readdir-scoped-modules.git"
},
"author": {
"name": "Isaac Z. Schlueter",
diff --git a/deps/npm/node_modules/read-installed/node_modules/util-extend/package.json b/deps/npm/node_modules/read-installed/node_modules/util-extend/package.json
index 942b786046c..259d6c1049f 100644
--- a/deps/npm/node_modules/read-installed/node_modules/util-extend/package.json
+++ b/deps/npm/node_modules/read-installed/node_modules/util-extend/package.json
@@ -8,7 +8,7 @@
},
"repository": {
"type": "git",
- "url": "git://github.com/isaacs/util-extend"
+ "url": "git://github.com/isaacs/util-extend.git"
},
"author": "",
"license": "MIT",
@@ -37,5 +37,5 @@
"directories": {},
"_shasum": "bb703b79480293ddcdcfb3c6a9fea20f483415bc",
"_resolved": "https://registry.npmjs.org/util-extend/-/util-extend-1.0.1.tgz",
- "homepage": "https://github.com/isaacs/util-extend"
+ "homepage": "https://github.com/isaacs/util-extend#readme"
}
diff --git a/deps/npm/node_modules/read-installed/package.json b/deps/npm/node_modules/read-installed/package.json
index 7ecdc716e24..4ea89c4952c 100644
--- a/deps/npm/node_modules/read-installed/package.json
+++ b/deps/npm/node_modules/read-installed/package.json
@@ -1,10 +1,10 @@
{
"name": "read-installed",
"description": "Read all the installed packages in a folder, and return a tree structure with all the data.",
- "version": "4.0.0",
+ "version": "4.0.1",
"repository": {
"type": "git",
- "url": "git://github.com/isaacs/read-installed"
+ "url": "git://github.com/isaacs/read-installed.git"
},
"main": "read-installed.js",
"scripts": {
@@ -31,16 +31,40 @@
"devDependencies": {
"mkdirp": "^0.5.0",
"rimraf": "^2.2.8",
- "tap": "~0.4.8"
+ "tap": "^1.2.0"
},
- "readme": "# read-installed\n\nRead all the installed packages in a folder, and return a tree\nstructure with all the data.\n\nnpm uses this.\n\n## 2.0.0\n\nBreaking changes in `2.0.0`:\n\nThe second argument is now an `Object` that contains the following keys:\n\n * `depth` optional, defaults to Infinity\n * `log` optional log Function\n * `dev` optional, default false, set to true to include devDependencies\n\n## Usage\n\n```javascript\nvar readInstalled = require(\"read-installed\")\n// optional options\nvar options = { dev: false, log: fn, depth: 2 }\nreadInstalled(folder, options, function (er, data) {\n ...\n})\n```\n",
- "readmeFilename": "README.md",
- "gitHead": "c1dea4823e2219a79d6184621917ee27d4283bc0",
+ "gitHead": "8547e3e176098051615651481f402d22e1f33c9d",
"bugs": {
"url": "https://github.com/isaacs/read-installed/issues"
},
- "homepage": "https://github.com/isaacs/read-installed",
- "_id": "read-installed@4.0.0",
- "_shasum": "dbca08d6bd83e2a3b93c962053ba4d839e0769ba",
- "_from": "read-installed@>=4.0.0 <4.1.0"
+ "homepage": "https://github.com/isaacs/read-installed#readme",
+ "_id": "read-installed@4.0.1",
+ "_shasum": "b8d8f8034159586fea57d606a9aaba3df74284c3",
+ "_from": "read-installed@>=4.0.1 <4.1.0",
+ "_npmVersion": "2.11.3",
+ "_nodeVersion": "2.3.1",
+ "_npmUser": {
+ "name": "iarna",
+ "email": "me@re-becca.org"
+ },
+ "dist": {
+ "shasum": "b8d8f8034159586fea57d606a9aaba3df74284c3",
+ "tarball": "http://registry.npmjs.org/read-installed/-/read-installed-4.0.1.tgz"
+ },
+ "maintainers": [
+ {
+ "name": "isaacs",
+ "email": "i@izs.me"
+ },
+ {
+ "name": "othiym23",
+ "email": "ogd@aoaioxxysz.net"
+ },
+ {
+ "name": "iarna",
+ "email": "me@re-becca.org"
+ }
+ ],
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/read-installed/-/read-installed-4.0.1.tgz"
}
diff --git a/deps/npm/node_modules/read-installed/read-installed.js b/deps/npm/node_modules/read-installed/read-installed.js
index 2e299445bcd..19e77be91bb 100644
--- a/deps/npm/node_modules/read-installed/read-installed.js
+++ b/deps/npm/node_modules/read-installed/read-installed.js
@@ -56,7 +56,7 @@ to READ(packagefolder, parentobj, name, reqver)
obj = read package.json
installed = ./node_modules/*
if parentobj is null, and no package.json
- obj = {dependencies:{<installed>:"*"}}
+ obj = {dependencies:{<installed>:ANY}}
deps = Object.keys(obj.dependencies)
obj.path = packagefolder
obj.parent = parentobj
@@ -105,6 +105,10 @@ var debug = require("debuglog")("read-installed")
var readdir = require("readdir-scoped-modules")
+// Sentinel catch-all version constraint used when a dependency is not
+// listed in the package.json file.
+var ANY = {}
+
module.exports = readInstalled
function readInstalled (folder, opts, cb) {
@@ -190,7 +194,7 @@ function readInstalled_ (folder, parent, name, reqver, depth, opts, cb) {
if (realpathSeen[real]) return cb(null, realpathSeen[real])
if (obj === true) {
obj = {dependencies:{}, path:folder}
- installed.forEach(function (i) { obj.dependencies[i] = "*" })
+ installed.forEach(function (i) { obj.dependencies[i] = ANY })
}
if (name && obj.name !== name) obj.invalid = true
obj.realName = name || obj.name
@@ -199,6 +203,14 @@ function readInstalled_ (folder, parent, name, reqver, depth, opts, cb) {
// At this point, figure out what dependencies we NEED to get met
obj._dependencies = copy(obj.dependencies)
+ if (reqver === ANY) {
+ // We were unable to determine the required version of this
+ // dependency from the package.json file, but we now know its actual
+ // version, so treat that version as the required version to avoid
+ // marking the dependency as invalid below. See #40.
+ reqver = obj.version;
+ }
+
// "foo":"http://blah" and "foo":"latest" are always presumed valid
if (reqver
&& semver.validRange(reqver, true)
diff --git a/deps/npm/node_modules/read-installed/test/issue-40.js b/deps/npm/node_modules/read-installed/test/issue-40.js
new file mode 100644
index 00000000000..3105fe24aef
--- /dev/null
+++ b/deps/npm/node_modules/read-installed/test/issue-40.js
@@ -0,0 +1,15 @@
+var readInstalled = require('../read-installed.js');
+var test = require('tap').test;
+var path = require('path');
+
+test('prerelease packages should not be marked invalid', function(t) {
+ readInstalled(
+ path.join(__dirname, 'fixtures/issue-40'),
+ { log: console.error },
+ function(err, map) {
+ t.strictEqual(map.dependencies.fake.version, '0.1.0-2');
+ t.notOk(map.dependencies.fake.invalid);
+ t.end();
+ }
+ );
+});
diff --git a/deps/npm/node_modules/request/.eslintrc b/deps/npm/node_modules/request/.eslintrc
deleted file mode 100644
index e79f481f0ce..00000000000
--- a/deps/npm/node_modules/request/.eslintrc
+++ /dev/null
@@ -1,45 +0,0 @@
-{
- "env": {
- "node": true
- },
- "rules": {
- // 2-space indentation
- "indent": [2, 2],
- // Disallow semi-colons, unless needed to disambiguate statement
- "semi": [2, "never"],
- // Require strings to use single quotes
- "quotes": [2, "single"],
- // Require curly braces for all control statements
- "curly": 2,
- // Disallow using variables and functions before they've been defined
- "no-use-before-define": 2,
- // Allow any case for variable naming
- "camelcase": 0,
- // Disallow unused variables, except as function arguments
- "no-unused-vars": [2, {"args":"none"}],
- // Allow leading underscores for method names
- // REASON: we use underscores to denote private methods
- "no-underscore-dangle": 0,
- // Allow multi spaces around operators since they are
- // used for alignment. This is not consistent in the
- // code.
- "no-multi-spaces": 0,
- // Style rule is: most objects use { beforeColon: false, afterColon: true }, unless aligning which uses:
- //
- // {
- // beforeColon : true,
- // afterColon : true
- // }
- //
- // eslint can't handle this, so the check is disabled.
- "key-spacing": 0,
- // Allow shadowing vars in outer scope (needs discussion)
- "no-shadow": 0,
- // Use if () { }
- // ^ space
- "space-after-keywords": [2, "always"],
- // Use if () { }
- // ^ space
- "space-before-blocks": [2, "always"]
- }
-}
diff --git a/deps/npm/node_modules/request/.travis.yml b/deps/npm/node_modules/request/.travis.yml
index bd0f638eb70..6180cb5d7fe 100644
--- a/deps/npm/node_modules/request/.travis.yml
+++ b/deps/npm/node_modules/request/.travis.yml
@@ -3,10 +3,12 @@ node_js:
- "io.js"
- "0.12"
- "0.10"
-after_script: ./node_modules/.bin/istanbul cover ./node_modules/tape/bin/tape tests/test-*.js --report lcovonly && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js --verbose
+sudo: false
+
+after_script: "npm run test-cov && cat ./coverage/lcov.info | codecov && cat ./coverage/lcov.info | coveralls"
+
webhooks:
urls: https://webhooks.gitter.im/e/237280ed4796c19cc626
on_success: change # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
on_start: false # default: false
-sudo: false
diff --git a/deps/npm/node_modules/request/CHANGELOG.md b/deps/npm/node_modules/request/CHANGELOG.md
index 2de0061ad32..6b3905edbe8 100644
--- a/deps/npm/node_modules/request/CHANGELOG.md
+++ b/deps/npm/node_modules/request/CHANGELOG.md
@@ -1,5 +1,11 @@
## Change Log
+### v2.58.0 (2015/06/16)
+- [#1638](https://github.com/request/request/pull/1638) Use the `extend` module to deep extend in the defaults method (@simov)
+- [#1631](https://github.com/request/request/pull/1631) Move tunnel logic into separate module (@simov)
+- [#1634](https://github.com/request/request/pull/1634) Fix OAuth query transport_method (@simov)
+- [#1603](https://github.com/request/request/pull/1603) Add codecov (@simov)
+
### v2.57.0 (2015/05/31)
- [#1615](https://github.com/request/request/pull/1615) Replace '.client' with '.socket' as the former was deprecated in 2.2.0. (@ChALkeR)
diff --git a/deps/npm/node_modules/request/README.md b/deps/npm/node_modules/request/README.md
index d8bd405701c..8530d1054e0 100644
--- a/deps/npm/node_modules/request/README.md
+++ b/deps/npm/node_modules/request/README.md
@@ -4,6 +4,7 @@
[![npm package](https://nodei.co/npm/request.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/request/)
[![Build status](https://img.shields.io/travis/request/request.svg?style=flat-square)](https://travis-ci.org/request/request)
+[![Coverage](https://img.shields.io/codecov/c/github/request/request.svg?style=flat-square)](https://codecov.io/github/request/request?branch=master)
[![Coverage](https://img.shields.io/coveralls/request/request.svg?style=flat-square)](https://coveralls.io/r/request/request)
[![Dependency Status](https://img.shields.io/david/request/request.svg?style=flat-square)](https://david-dm.org/request/request)
[![Gitter](https://img.shields.io/badge/gitter-join_chat-blue.svg?style=flat-square)](https://gitter.im/request/request?utm_source=badge)
@@ -410,7 +411,7 @@ request.post({url:url, oauth:oauth}, function (e, r, body) {
, user_id: perm_data.user_id
}
;
- request.get({url:url, oauth:oauth, json:true}, function (e, r, user) {
+ request.get({url:url, oauth:oauth, qs:qs, json:true}, function (e, r, user) {
console.log(user)
})
})
diff --git a/deps/npm/node_modules/request/index.js b/deps/npm/node_modules/request/index.js
index 5872824c829..3fe60017544 100755
--- a/deps/npm/node_modules/request/index.js
+++ b/deps/npm/node_modules/request/index.js
@@ -14,7 +14,7 @@
'use strict'
-var extend = require('util')._extend
+var extend = require('extend')
, cookies = require('./lib/cookies')
, helpers = require('./lib/helpers')
@@ -30,12 +30,11 @@ function initParams(uri, options, callback) {
var params = {}
if (typeof options === 'object') {
- params = extend({}, options)
- params = extend(params, {uri: uri})
+ extend(params, options, {uri: uri})
} else if (typeof uri === 'string') {
- params = extend({}, {uri: uri})
+ extend(params, {uri: uri})
} else {
- params = extend({}, uri)
+ extend(params, uri)
}
params.callback = callback
@@ -86,24 +85,18 @@ function wrapRequestMethod (method, options, requester, verb) {
return function (uri, opts, callback) {
var params = initParams(uri, opts, callback)
- var headerlessOptions = extend({}, options)
- delete headerlessOptions.headers
- params = extend(headerlessOptions, params)
-
- if (options.headers) {
- var headers = extend({}, options.headers)
- params.headers = extend(headers, params.headers)
- }
+ var target = {}
+ extend(true, target, options, params)
if (verb) {
- params.method = (verb === 'del' ? 'DELETE' : verb.toUpperCase())
+ target.method = (verb === 'del' ? 'DELETE' : verb.toUpperCase())
}
if (isFunction(requester)) {
method = requester
}
- return method(params, params.callback)
+ return method(target, target.callback)
}
}
@@ -131,7 +124,7 @@ request.defaults = function (options, requester) {
request.forever = function (agentOptions, optionsArg) {
var options = {}
if (optionsArg) {
- options = extend({}, optionsArg)
+ extend(options, optionsArg)
}
if (agentOptions) {
options.agentOptions = agentOptions
diff --git a/deps/npm/node_modules/request/lib/copy.js b/deps/npm/node_modules/request/lib/copy.js
deleted file mode 100644
index ad162a50892..00000000000
--- a/deps/npm/node_modules/request/lib/copy.js
+++ /dev/null
@@ -1,10 +0,0 @@
-'use strict'
-
-module.exports =
-function copy (obj) {
- var o = {}
- Object.keys(obj).forEach(function (i) {
- o[i] = obj[i]
- })
- return o
-}
diff --git a/deps/npm/node_modules/request/lib/helpers.js b/deps/npm/node_modules/request/lib/helpers.js
index 1d588ca9493..5cc79da86c7 100644
--- a/deps/npm/node_modules/request/lib/helpers.js
+++ b/deps/npm/node_modules/request/lib/helpers.js
@@ -46,10 +46,19 @@ function toBase64 (str) {
return (new Buffer(str || '', 'utf8')).toString('base64')
}
+function copy (obj) {
+ var o = {}
+ Object.keys(obj).forEach(function (i) {
+ o[i] = obj[i]
+ })
+ return o
+}
+
exports.isFunction = isFunction
exports.paramsHaveRequestBody = paramsHaveRequestBody
exports.safeStringify = safeStringify
exports.md5 = md5
exports.isReadStream = isReadStream
exports.toBase64 = toBase64
+exports.copy = copy
exports.defer = deferMethod()
diff --git a/deps/npm/node_modules/request/lib/oauth.js b/deps/npm/node_modules/request/lib/oauth.js
index 84059724a78..b0f7ab88418 100644
--- a/deps/npm/node_modules/request/lib/oauth.js
+++ b/deps/npm/node_modules/request/lib/oauth.js
@@ -1,6 +1,7 @@
'use strict'
-var qs = require('qs')
+var url = require('url')
+ , qs = require('qs')
, caseless = require('caseless')
, uuid = require('node-uuid')
, oauth = require('oauth-sign')
@@ -129,7 +130,9 @@ OAuth.prototype.onRequest = function (_oauth) {
break
case 'query':
- self.request.path = (query ? '&' : '?') + self.concatParams(oa, '&')
+ var href = self.request.uri.href += (query ? '&' : '?') + self.concatParams(oa, '&')
+ self.request.uri = url.parse(href)
+ self.request.path = self.request.uri.path
break
case 'body':
diff --git a/deps/npm/node_modules/request/lib/tunnel.js b/deps/npm/node_modules/request/lib/tunnel.js
new file mode 100644
index 00000000000..cf28016e26a
--- /dev/null
+++ b/deps/npm/node_modules/request/lib/tunnel.js
@@ -0,0 +1,183 @@
+'use strict'
+
+var url = require('url')
+ , tunnel = require('tunnel-agent')
+
+var defaultProxyHeaderWhiteList = [
+ 'accept',
+ 'accept-charset',
+ 'accept-encoding',
+ 'accept-language',
+ 'accept-ranges',
+ 'cache-control',
+ 'content-encoding',
+ 'content-language',
+ 'content-length',
+ 'content-location',
+ 'content-md5',
+ 'content-range',
+ 'content-type',
+ 'connection',
+ 'date',
+ 'expect',
+ 'max-forwards',
+ 'pragma',
+ 'referer',
+ 'te',
+ 'transfer-encoding',
+ 'user-agent',
+ 'via'
+]
+
+var defaultProxyHeaderExclusiveList = [
+ 'proxy-authorization'
+]
+
+function constructProxyHost(uriObject) {
+ var port = uriObject.portA
+ , protocol = uriObject.protocol
+ , proxyHost = uriObject.hostname + ':'
+
+ if (port) {
+ proxyHost += port
+ } else if (protocol === 'https:') {
+ proxyHost += '443'
+ } else {
+ proxyHost += '80'
+ }
+
+ return proxyHost
+}
+
+function constructProxyHeaderWhiteList(headers, proxyHeaderWhiteList) {
+ var whiteList = proxyHeaderWhiteList
+ .reduce(function (set, header) {
+ set[header.toLowerCase()] = true
+ return set
+ }, {})
+
+ return Object.keys(headers)
+ .filter(function (header) {
+ return whiteList[header.toLowerCase()]
+ })
+ .reduce(function (set, header) {
+ set[header] = headers[header]
+ return set
+ }, {})
+}
+
+function constructTunnelOptions (request, proxyHeaders) {
+ var proxy = request.proxy
+
+ var tunnelOptions = {
+ proxy : {
+ host : proxy.hostname,
+ port : +proxy.port,
+ proxyAuth : proxy.auth,
+ headers : proxyHeaders
+ },
+ headers : request.headers,
+ ca : request.ca,
+ cert : request.cert,
+ key : request.key,
+ passphrase : request.passphrase,
+ pfx : request.pfx,
+ ciphers : request.ciphers,
+ rejectUnauthorized : request.rejectUnauthorized,
+ secureOptions : request.secureOptions,
+ secureProtocol : request.secureProtocol
+ }
+
+ return tunnelOptions
+}
+
+function constructTunnelFnName(uri, proxy) {
+ var uriProtocol = (uri.protocol === 'https:' ? 'https' : 'http')
+ var proxyProtocol = (proxy.protocol === 'https:' ? 'Https' : 'Http')
+ return [uriProtocol, proxyProtocol].join('Over')
+}
+
+function getTunnelFn(request) {
+ var uri = request.uri
+ var proxy = request.proxy
+ var tunnelFnName = constructTunnelFnName(uri, proxy)
+ return tunnel[tunnelFnName]
+}
+
+
+function Tunnel (request) {
+ this.request = request
+ this.proxyHeaderWhiteList = defaultProxyHeaderWhiteList
+ this.proxyHeaderExclusiveList = []
+}
+
+Tunnel.prototype.isEnabled = function (options) {
+ var request = this.request
+ // Tunnel HTTPS by default, or if a previous request in the redirect chain
+ // was tunneled. Allow the user to override this setting.
+
+ // If self.tunnel is already set (because this is a redirect), use the
+ // existing value.
+ if (typeof request.tunnel !== 'undefined') {
+ return request.tunnel
+ }
+
+ // If options.tunnel is set (the user specified a value), use it.
+ if (typeof options.tunnel !== 'undefined') {
+ return options.tunnel
+ }
+
+ // If the destination is HTTPS, tunnel.
+ if (request.uri.protocol === 'https:') {
+ return true
+ }
+
+ // Otherwise, leave tunnel unset, because if a later request in the redirect
+ // chain is HTTPS then that request (and any subsequent ones) should be
+ // tunneled.
+ return undefined
+}
+
+Tunnel.prototype.setup = function (options) {
+ var self = this
+ , request = self.request
+
+ options = options || {}
+
+ if (typeof request.proxy === 'string') {
+ request.proxy = url.parse(request.proxy)
+ }
+
+ if (!request.proxy || !request.tunnel) {
+ return false
+ }
+
+ // Setup Proxy Header Exclusive List and White List
+ if (options.proxyHeaderWhiteList) {
+ self.proxyHeaderWhiteList = options.proxyHeaderWhiteList
+ }
+ if (options.proxyHeaderExclusiveList) {
+ self.proxyHeaderExclusiveList = options.proxyHeaderExclusiveList
+ }
+
+ var proxyHeaderExclusiveList = self.proxyHeaderExclusiveList.concat(defaultProxyHeaderExclusiveList)
+ var proxyHeaderWhiteList = self.proxyHeaderWhiteList.concat(proxyHeaderExclusiveList)
+
+ // Setup Proxy Headers and Proxy Headers Host
+ // Only send the Proxy White Listed Header names
+ var proxyHeaders = constructProxyHeaderWhiteList(request.headers, proxyHeaderWhiteList)
+ proxyHeaders.host = constructProxyHost(request.uri)
+
+ proxyHeaderExclusiveList.forEach(request.removeHeader, request)
+
+ // Set Agent from Tunnel Data
+ var tunnelFn = getTunnelFn(request)
+ var tunnelOptions = constructTunnelOptions(request, proxyHeaders)
+ request.agent = tunnelFn(tunnelOptions)
+
+ return true
+}
+
+Tunnel.defaultProxyHeaderWhiteList = defaultProxyHeaderWhiteList
+Tunnel.defaultProxyHeaderExclusiveList = defaultProxyHeaderExclusiveList
+exports.Tunnel = Tunnel
diff --git a/deps/npm/node_modules/request/node_modules/bl/.jshintrc b/deps/npm/node_modules/request/node_modules/bl/.jshintrc
deleted file mode 100644
index c8ef3ca4097..00000000000
--- a/deps/npm/node_modules/request/node_modules/bl/.jshintrc
+++ /dev/null
@@ -1,59 +0,0 @@
-{
- "predef": [ ]
- , "bitwise": false
- , "camelcase": false
- , "curly": false
- , "eqeqeq": false
- , "forin": false
- , "immed": false
- , "latedef": false
- , "noarg": true
- , "noempty": true
- , "nonew": true
- , "plusplus": false
- , "quotmark": true
- , "regexp": false
- , "undef": true
- , "unused": true
- , "strict": false
- , "trailing": true
- , "maxlen": 120
- , "asi": true
- , "boss": true
- , "debug": true
- , "eqnull": true
- , "esnext": true
- , "evil": true
- , "expr": true
- , "funcscope": false
- , "globalstrict": false
- , "iterator": false
- , "lastsemic": true
- , "laxbreak": true
- , "laxcomma": true
- , "loopfunc": true
- , "multistr": false
- , "onecase": false
- , "proto": false
- , "regexdash": false
- , "scripturl": true
- , "smarttabs": false
- , "shadow": false
- , "sub": true
- , "supernew": false
- , "validthis": true
- , "browser": true
- , "couch": false
- , "devel": false
- , "dojo": false
- , "mootools": false
- , "node": true
- , "nonstandard": true
- , "prototypejs": false
- , "rhino": false
- , "worker": true
- , "wsh": false
- , "nomen": false
- , "onevar": false
- , "passfail": false
-} \ No newline at end of file
diff --git a/deps/npm/node_modules/request/node_modules/combined-stream/Readme.md b/deps/npm/node_modules/request/node_modules/combined-stream/Readme.md
index 3068adcaff7..3a9e025fb47 100644
--- a/deps/npm/node_modules/request/node_modules/combined-stream/Readme.md
+++ b/deps/npm/node_modules/request/node_modules/combined-stream/Readme.md
@@ -2,12 +2,11 @@
A stream that emits multiple other streams one after another.
-**NB** This module uses streams1 and will always use streams1 for
-compatibility. If you're looking for something to use for your project, please
-use a streams2 module, e.g.,
-[multistream](https://www.npmjs.com/package/multistream). Moreover, this module
-is maintained for bugfixes to current downstream consumers, so PRs which add
-features generally aren't accepted.
+**NB** Currently `combined-stream` works with streams vesrion 1 only. There is ongoing effort to switch this library to streams version 2. Any help is welcome. :) Meanwhile you can explore other libraries that provide streams2 support with more or less compatability with `combined-stream`.
+
+- [combined-stream2](https://www.npmjs.com/package/combined-stream2): A drop-in streams2-compatible replacement for the combined-stream module.
+
+- [multistream](https://www.npmjs.com/package/multistream): A stream that emits multiple other streams one after another.
## Installation
diff --git a/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/package.json b/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/package.json
index 4b4890359df..8ac66b814c8 100644
--- a/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/package.json
+++ b/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/package.json
@@ -37,7 +37,7 @@
},
"_id": "delayed-stream@1.0.0",
"_shasum": "df3ae199acadfb7d440aaae0b29e2272b24ec619",
- "_from": "delayed-stream@>=1.0.0 <2.0.0",
+ "_from": "delayed-stream@>=1.0.0 <1.1.0",
"_npmVersion": "2.8.3",
"_nodeVersion": "1.6.4",
"_npmUser": {
diff --git a/deps/npm/node_modules/request/node_modules/combined-stream/package.json b/deps/npm/node_modules/request/node_modules/combined-stream/package.json
index 08d0f270600..93924d1b500 100644
--- a/deps/npm/node_modules/request/node_modules/combined-stream/package.json
+++ b/deps/npm/node_modules/request/node_modules/combined-stream/package.json
@@ -6,7 +6,7 @@
},
"name": "combined-stream",
"description": "A stream that emits multiple other streams one after another.",
- "version": "1.0.3",
+ "version": "1.0.5",
"homepage": "https://github.com/felixge/node-combined-stream",
"repository": {
"type": "git",
@@ -20,28 +20,28 @@
"node": ">= 0.8"
},
"dependencies": {
- "delayed-stream": "^1.0.0"
+ "delayed-stream": "~1.0.0"
},
"devDependencies": {
"far": "~0.0.7"
},
"license": "MIT",
- "gitHead": "f1a12682aed63acb3cd66857104202a7e7ca5565",
+ "gitHead": "cfc7b815d090a109bcedb5bb0f6713148d55a6b7",
"bugs": {
"url": "https://github.com/felixge/node-combined-stream/issues"
},
- "_id": "combined-stream@1.0.3",
- "_shasum": "c224cc35d3cb98e25dead532472a18e8f75df5ab",
+ "_id": "combined-stream@1.0.5",
+ "_shasum": "938370a57b4a51dea2c77c15d5c5fdf895164009",
"_from": "combined-stream@>=1.0.1 <1.1.0",
- "_npmVersion": "2.10.0",
- "_nodeVersion": "2.0.1",
+ "_npmVersion": "2.10.1",
+ "_nodeVersion": "0.12.4",
"_npmUser": {
- "name": "apechimp",
- "email": "apeherder@gmail.com"
+ "name": "alexindigo",
+ "email": "iam@alexindigo.com"
},
"dist": {
- "shasum": "c224cc35d3cb98e25dead532472a18e8f75df5ab",
- "tarball": "http://registry.npmjs.org/combined-stream/-/combined-stream-1.0.3.tgz"
+ "shasum": "938370a57b4a51dea2c77c15d5c5fdf895164009",
+ "tarball": "http://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz"
},
"maintainers": [
{
@@ -62,6 +62,5 @@
}
],
"directories": {},
- "_resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.3.tgz",
- "readme": "ERROR: No README data found!"
+ "_resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz"
}
diff --git a/deps/npm/node_modules/request/node_modules/extend/.jscs.json b/deps/npm/node_modules/request/node_modules/extend/.jscs.json
new file mode 100644
index 00000000000..97e6d12656c
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/extend/.jscs.json
@@ -0,0 +1,67 @@
+{
+ "additionalRules": [],
+
+ "requireCurlyBraces": ["if", "else", "for", "while", "do", "try", "catch"],
+
+ "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"],
+
+ "disallowSpaceAfterKeywords": [],
+
+ "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true },
+ "requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true },
+ "disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true },
+ "requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true },
+ "disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true },
+
+ "requireSpaceBetweenArguments": true,
+
+ "disallowSpacesInsideParentheses": true,
+
+ "disallowSpacesInsideArrayBrackets": true,
+
+ "disallowQuotedKeysInObjects": "allButReserved",
+
+ "disallowSpaceAfterObjectKeys": true,
+
+ "requireCommaBeforeLineBreak": true,
+
+ "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
+ "requireSpaceAfterPrefixUnaryOperators": [],
+
+ "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
+ "requireSpaceBeforePostfixUnaryOperators": [],
+
+ "disallowSpaceBeforeBinaryOperators": [],
+ "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="],
+
+ "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="],
+ "disallowSpaceAfterBinaryOperators": [],
+
+ "disallowImplicitTypeConversion": ["binary", "string"],
+
+ "disallowKeywords": ["with", "eval"],
+
+ "requireKeywordsOnNewLine": [],
+ "disallowKeywordsOnNewLine": ["else"],
+
+ "requireLineFeedAtFileEnd": true,
+
+ "disallowTrailingWhitespace": true,
+
+ "disallowTrailingComma": true,
+
+ "excludeFiles": ["node_modules/**", "vendor/**"],
+
+ "disallowMultipleLineStrings": true,
+
+ "requireDotNotation": true,
+
+ "requireParenthesesAroundIIFE": true,
+
+ "validateLineBreaks": "LF",
+
+ "validateQuoteMarks": {
+ "escape": true,
+ "mark": "'"
+ }
+}
diff --git a/deps/npm/node_modules/request/node_modules/extend/.npmignore b/deps/npm/node_modules/request/node_modules/extend/.npmignore
new file mode 100644
index 00000000000..30d74d25844
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/extend/.npmignore
@@ -0,0 +1 @@
+test \ No newline at end of file
diff --git a/deps/npm/node_modules/request/node_modules/extend/.travis.yml b/deps/npm/node_modules/request/node_modules/extend/.travis.yml
new file mode 100644
index 00000000000..e6f69e8d8cd
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/extend/.travis.yml
@@ -0,0 +1,36 @@
+language: node_js
+node_js:
+ - "iojs-v1.8"
+ - "iojs-v1.7"
+ - "iojs-v1.6"
+ - "iojs-v1.5"
+ - "iojs-v1.4"
+ - "iojs-v1.3"
+ - "iojs-v1.2"
+ - "iojs-v1.1"
+ - "iojs-v1.0"
+ - "0.12"
+ - "0.11"
+ - "0.10"
+ - "0.9"
+ - "0.8"
+ - "0.6"
+ - "0.4"
+before_install:
+ - '[ "${TRAVIS_NODE_VERSION}" == "0.6" ] || npm install -g npm@~1.4.6'
+matrix:
+ fast_finish: true
+ allow_failures:
+ - node_js: "iojs-v1.6"
+ - node_js: "iojs-v1.5"
+ - node_js: "iojs-v1.4"
+ - node_js: "iojs-v1.3"
+ - node_js: "iojs-v1.2"
+ - node_js: "iojs-v1.1"
+ - node_js: "iojs-v1.0"
+ - node_js: "0.11"
+ - node_js: "0.9"
+ - node_js: "0.8"
+ - node_js: "0.6"
+ - node_js: "0.4"
+sudo: false
diff --git a/deps/npm/node_modules/request/node_modules/extend/CHANGELOG.md b/deps/npm/node_modules/request/node_modules/extend/CHANGELOG.md
new file mode 100644
index 00000000000..3a224fc8a2f
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/extend/CHANGELOG.md
@@ -0,0 +1,60 @@
+2.0.1 / 2015-04-25
+==================
+ * Use an inline `isArray` check, for ES3 browsers. (#27)
+ * Some old browsers fail when an identifier is `toString`
+ * Test latest `node` and `io.js` versions on `travis-ci`; speed up builds
+ * Add license info to package.json (#25)
+ * Update `tape`, `jscs`
+ * Adding a CHANGELOG
+
+2.0.0 / 2014-10-01
+==================
+ * Increase code coverage to 100%; run code coverage as part of tests
+ * Add `npm run lint`; Run linter as part of tests
+ * Remove nodeType and setInterval checks in isPlainObject
+ * Updating `tape`, `jscs`, `covert`
+ * General style and README cleanup
+
+1.3.0 / 2014-06-20
+==================
+ * Add component.json for browser support (#18)
+ * Use SVG for badges in README (#16)
+ * Updating `tape`, `covert`
+ * Updating travis-ci to work with multiple node versions
+ * Fix `deep === false` bug (returning target as {}) (#14)
+ * Fixing constructor checks in isPlainObject
+ * Adding additional test coverage
+ * Adding `npm run coverage`
+ * Add LICENSE (#13)
+ * Adding a warning about `false`, per #11
+ * General style and whitespace cleanup
+
+1.2.1 / 2013-09-14
+==================
+ * Fixing hasOwnProperty bugs that would only have shown up in specific browsers. Fixes #8
+ * Updating `tape`
+
+1.2.0 / 2013-09-02
+==================
+ * Updating the README: add badges
+ * Adding a missing variable reference.
+ * Using `tape` instead of `buster` for tests; add more tests (#7)
+ * Adding node 0.10 to Travis CI (#6)
+ * Enabling "npm test" and cleaning up package.json (#5)
+ * Add Travis CI.
+
+1.1.3 / 2012-12-06
+==================
+ * Added unit tests.
+ * Ensure extend function is named. (Looks nicer in a stack trace.)
+ * README cleanup.
+
+1.1.1 / 2012-11-07
+==================
+ * README cleanup.
+ * Added installation instructions.
+ * Added a missing semicolon
+
+1.0.0 / 2012-04-08
+==================
+ * Initial commit
diff --git a/deps/npm/node_modules/request/node_modules/extend/LICENSE b/deps/npm/node_modules/request/node_modules/extend/LICENSE
new file mode 100644
index 00000000000..92d41503d32
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/extend/LICENSE
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Stefan Thomas
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/deps/npm/node_modules/request/node_modules/extend/README.md b/deps/npm/node_modules/request/node_modules/extend/README.md
new file mode 100644
index 00000000000..3a47b21880f
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/extend/README.md
@@ -0,0 +1,61 @@
+[![Build Status][travis-svg]][travis-url]
+[![dependency status][deps-svg]][deps-url]
+[![dev dependency status][dev-deps-svg]][dev-deps-url]
+
+# extend() for Node.js <sup>[![Version Badge][npm-version-png]][npm-url]</sup>
+
+`node-extend` is a port of the classic extend() method from jQuery. It behaves as you expect. It is simple, tried and true.
+
+## Installation
+
+This package is available on [npm][npm-url] as: `extend`
+
+``` sh
+npm install extend
+```
+
+## Usage
+
+**Syntax:** extend **(** [`deep`], `target`, `object1`, [`objectN`] **)**
+
+*Extend one object with one or more others, returning the modified object.*
+
+Keep in mind that the target object will be modified, and will be returned from extend().
+
+If a boolean true is specified as the first argument, extend performs a deep copy, recursively copying any objects it finds. Otherwise, the copy will share structure with the original object(s).
+Undefined properties are not copied. However, properties inherited from the object's prototype will be copied over.
+Warning: passing `false` as the first argument is not supported.
+
+### Arguments
+
+* `deep` *Boolean* (optional)
+If set, the merge becomes recursive (i.e. deep copy).
+* `target` *Object*
+The object to extend.
+* `object1` *Object*
+The object that will be merged into the first.
+* `objectN` *Object* (Optional)
+More objects to merge into the first.
+
+## License
+
+`node-extend` is licensed under the [MIT License][mit-license-url].
+
+## Acknowledgements
+
+All credit to the jQuery authors for perfecting this amazing utility.
+
+Ported to Node.js by [Stefan Thomas][github-justmoon] with contributions by [Jonathan Buchanan][github-insin] and [Jordan Harband][github-ljharb].
+
+[travis-svg]: https://travis-ci.org/justmoon/node-extend.svg
+[travis-url]: https://travis-ci.org/justmoon/node-extend
+[npm-url]: https://npmjs.org/package/extend
+[mit-license-url]: http://opensource.org/licenses/MIT
+[github-justmoon]: https://github.com/justmoon
+[github-insin]: https://github.com/insin
+[github-ljharb]: https://github.com/ljharb
+[npm-version-png]: http://vb.teelaun.ch/justmoon/node-extend.svg
+[deps-svg]: https://david-dm.org/justmoon/node-extend.svg
+[deps-url]: https://david-dm.org/justmoon/node-extend
+[dev-deps-svg]: https://david-dm.org/justmoon/node-extend/dev-status.svg
+[dev-deps-url]: https://david-dm.org/justmoon/node-extend#info=devDependencies
diff --git a/deps/npm/node_modules/request/node_modules/extend/component.json b/deps/npm/node_modules/request/node_modules/extend/component.json
new file mode 100644
index 00000000000..cd3956c5aa3
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/extend/component.json
@@ -0,0 +1,31 @@
+{
+ "name": "extend",
+ "author": "Stefan Thomas <justmoon@members.fsf.org> (http://www.justmoon.net)",
+ "version": "2.0.1",
+ "description": "Port of jQuery.extend for node.js and the browser.",
+ "scripts": [
+ "index.js"
+ ],
+ "contributors": [
+ {
+ "name": "Jordan Harband",
+ "url": "https://github.com/ljharb"
+ }
+ ],
+ "keywords": [
+ "extend",
+ "clone",
+ "merge"
+ ],
+ "repository" : {
+ "type": "git",
+ "url": "https://github.com/justmoon/node-extend.git"
+ },
+ "dependencies": {
+ },
+ "devDependencies": {
+ "tape" : "~3.0.0",
+ "covert": "~0.4.0",
+ "jscs": "~1.6.2"
+ }
+}
diff --git a/deps/npm/node_modules/request/node_modules/extend/index.js b/deps/npm/node_modules/request/node_modules/extend/index.js
new file mode 100644
index 00000000000..e489a8fd049
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/extend/index.js
@@ -0,0 +1,88 @@
+var hasOwn = Object.prototype.hasOwnProperty;
+var toStr = Object.prototype.toString;
+var undefined;
+
+var isArray = function isArray(arr) {
+ if (typeof Array.isArray === 'function') {
+ return Array.isArray(arr);
+ }
+
+ return toStr.call(arr) === '[object Array]';
+};
+
+var isPlainObject = function isPlainObject(obj) {
+ 'use strict';
+ if (!obj || toStr.call(obj) !== '[object Object]') {
+ return false;
+ }
+
+ var has_own_constructor = hasOwn.call(obj, 'constructor');
+ var has_is_property_of_method = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');
+ // Not own constructor property must be Object
+ if (obj.constructor && !has_own_constructor && !has_is_property_of_method) {
+ return false;
+ }
+
+ // Own properties are enumerated firstly, so to speed up,
+ // if last one is own, then all properties are own.
+ var key;
+ for (key in obj) {}
+
+ return key === undefined || hasOwn.call(obj, key);
+};
+
+module.exports = function extend() {
+ 'use strict';
+ var options, name, src, copy, copyIsArray, clone,
+ target = arguments[0],
+ i = 1,
+ length = arguments.length,
+ deep = false;
+
+ // Handle a deep copy situation
+ if (typeof target === 'boolean') {
+ deep = target;
+ target = arguments[1] || {};
+ // skip the boolean and the target
+ i = 2;
+ } else if ((typeof target !== 'object' && typeof target !== 'function') || target == null) {
+ target = {};
+ }
+
+ for (; i < length; ++i) {
+ options = arguments[i];
+ // Only deal with non-null/undefined values
+ if (options != null) {
+ // Extend the base object
+ for (name in options) {
+ src = target[name];
+ copy = options[name];
+
+ // Prevent never-ending loop
+ if (target === copy) {
+ continue;
+ }
+
+ // Recurse if we're merging plain objects or arrays
+ if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {
+ if (copyIsArray) {
+ copyIsArray = false;
+ clone = src && isArray(src) ? src : [];
+ } else {
+ clone = src && isPlainObject(src) ? src : {};
+ }
+
+ // Never move original objects, clone them
+ target[name] = extend(deep, clone, copy);
+
+ // Don't bring in undefined values
+ } else if (copy !== undefined) {
+ target[name] = copy;
+ }
+ }
+ }
+ }
+
+ // Return the modified object
+ return target;
+};
diff --git a/deps/npm/node_modules/request/node_modules/extend/package.json b/deps/npm/node_modules/request/node_modules/extend/package.json
new file mode 100644
index 00000000000..8eb102ff161
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/extend/package.json
@@ -0,0 +1,70 @@
+{
+ "name": "extend",
+ "author": {
+ "name": "Stefan Thomas",
+ "email": "justmoon@members.fsf.org",
+ "url": "http://www.justmoon.net"
+ },
+ "version": "2.0.1",
+ "description": "Port of jQuery.extend for node.js and the browser",
+ "main": "index",
+ "scripts": {
+ "test": "npm run lint && node test/index.js && npm run coverage-quiet",
+ "coverage": "covert test/index.js",
+ "coverage-quiet": "covert test/index.js --quiet",
+ "lint": "jscs *.js */*.js"
+ },
+ "contributors": [
+ {
+ "name": "Jordan Harband",
+ "url": "https://github.com/ljharb"
+ }
+ ],
+ "keywords": [
+ "extend",
+ "clone",
+ "merge"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/justmoon/node-extend.git"
+ },
+ "dependencies": {},
+ "devDependencies": {
+ "tape": "^4.0.0",
+ "covert": "^1.0.1",
+ "jscs": "^1.11.3"
+ },
+ "license": "MIT",
+ "gitHead": "ce3790222d3d2051f728f74be9565f155ed599c3",
+ "bugs": {
+ "url": "https://github.com/justmoon/node-extend/issues"
+ },
+ "homepage": "https://github.com/justmoon/node-extend#readme",
+ "_id": "extend@2.0.1",
+ "_shasum": "1ee8010689e7395ff9448241c98652bc759a8260",
+ "_from": "extend@>=2.0.1 <2.1.0",
+ "_npmVersion": "2.8.3",
+ "_nodeVersion": "1.8.1",
+ "_npmUser": {
+ "name": "ljharb",
+ "email": "ljharb@gmail.com"
+ },
+ "dist": {
+ "shasum": "1ee8010689e7395ff9448241c98652bc759a8260",
+ "tarball": "http://registry.npmjs.org/extend/-/extend-2.0.1.tgz"
+ },
+ "maintainers": [
+ {
+ "name": "justmoon",
+ "email": "justmoon@members.fsf.org"
+ },
+ {
+ "name": "ljharb",
+ "email": "ljharb@gmail.com"
+ }
+ ],
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/extend/-/extend-2.0.1.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/deps/npm/node_modules/request/node_modules/form-data/lib/form_data.js b/deps/npm/node_modules/request/node_modules/form-data/lib/form_data.js
index 5b33f554c62..b960dce9df5 100644
--- a/deps/npm/node_modules/request/node_modules/form-data/lib/form_data.js
+++ b/deps/npm/node_modules/request/node_modules/form-data/lib/form_data.js
@@ -67,7 +67,7 @@ FormData.prototype._trackLength = function(header, value, options) {
// @check why add CRLF? does this account for custom/multiple CRLFs?
this._overheadLength +=
Buffer.byteLength(header) +
- + FormData.LINE_BREAK.length;
+ FormData.LINE_BREAK.length;
// empty or either doesn't have path or not an http response
if (!value || ( !value.path && !(value.readable && value.hasOwnProperty('httpVersion')) )) {
@@ -306,7 +306,7 @@ FormData.prototype.submit = function(params, cb) {
options.headers = this.getHeaders(params.headers);
// https if specified, fallback to http in any other case
- if (params.protocol == 'https:') {
+ if (options.protocol == 'https:') {
request = https.request(options);
} else {
request = http.request(options);
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/.jshintrc b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/.jshintrc
deleted file mode 100644
index 7427dce48a3..00000000000
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/.jshintrc
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- // Enforcing options
- "eqeqeq": false,
- "forin": true,
- "indent": 4,
- "noarg": true,
- "undef": true,
- "unused": true,
- "trailing": true,
- "evil": true,
- "laxcomma": true,
-
- // Relaxing options
- "onevar": false,
- "asi": false,
- "eqnull": true,
- "expr": false,
- "loopfunc": true,
- "sub": true,
- "browser": true,
- "node": true,
- "globals": {
- "define": true
- }
-}
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/.travis.yml b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/.travis.yml
index 6064ca09264..0a62fcad57a 100644
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/.travis.yml
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/.travis.yml
@@ -2,4 +2,5 @@ language: node_js
node_js:
- "0.10"
- "0.12"
- - "iojs"
+ - "iojs-v2.1.0"
+after_success: npm run coveralls
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/CHANGELOG.md b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/CHANGELOG.md
new file mode 100644
index 00000000000..7ed0d1bbd7f
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/CHANGELOG.md
@@ -0,0 +1,65 @@
+# v1.2.1
+
+Bug Fix:
+
+- Small regression with synchronous iterator behavior in `eachSeries` with a 1-element array. Before 1.1.0, `eachSeries`'s callback was called on the same tick, which this patch restores. In 2.0.0, it will be called on the next tick. (#782)
+
+# v1.2.0
+
+New Features:
+
+- Added `timesLimit` (#743)
+- `concurrency` can be changed after initialization in `queue` by setting `q.concurrency`. The new concurrency will be reflected the next time a task is processed. (#747, #772)
+
+Bug Fixes:
+
+- Fixed a regression in `each` and family with empty arrays that have additional properties. (#775, #777)
+
+
+# v1.1.1
+
+Bug Fix:
+
+- Small regression with synchronous iterator behavior in `eachSeries` with a 1-element array. Before 1.1.0, `eachSeries`'s callback was called on the same tick, which this patch restores. In 2.0.0, it will be called on the next tick. (#782)
+
+
+# v1.1.0
+
+New Features:
+
+- `cargo` now supports all of the same methods and event callbacks as `queue`.
+- Added `ensureAsync` - A wrapper that ensures an async function calls its callback on a later tick. (#769)
+- Optimized `map`, `eachOf`, and `waterfall` families of functions
+- Passing a `null` or `undefined` array to `map`, `each`, `parallel` and families will be treated as an empty array (#667).
+- The callback is now optional for the composed results of `compose` and `seq`. (#618)
+- Reduced file size by 4kb, (minified version by 1kb)
+- Added code coverage through `nyc` and `coveralls` (#768)
+
+Bug Fixes:
+
+- `forever` will no longer stack overflow with a synchronous iterator (#622)
+- `eachLimit` and other limit functions will stop iterating once an error occurs (#754)
+- Always pass `null` in callbacks when there is no error (#439)
+- Ensure proper conditions when calling `drain()` after pushing an empty data set to a queue (#668)
+- `each` and family will properly handle an empty array (#578)
+- `eachSeries` and family will finish if the underlying array is modified during execution (#557)
+- `queue` will throw if a non-function is passed to `q.push()` (#593)
+- Doc fixes (#629, #766)
+
+
+# v1.0.0
+
+No known breaking changes, we are simply complying with semver from here on out.
+
+Changes:
+
+- Start using a changelog!
+- Add `forEachOf` for iterating over Objects (or to iterate Arrays with indexes available) (#168 #704 #321)
+- Detect deadlocks in `auto` (#663)
+- Better support for require.js (#527)
+- Throw if queue created with concurrency `0` (#714)
+- Fix unneeded iteration in `queue.resume()` (#758)
+- Guard against timer mocking overriding `setImmediate` (#609 #611)
+- Miscellaneous doc fixes (#542 #596 #615 #628 #631 #690 #729)
+- Use single noop function internally (#546)
+- Optimize internal `_each`, `_map` and `_keys` functions.
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/README.md b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/README.md
index 13b8dd386b8..109e045093f 100644
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/README.md
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/README.md
@@ -1,7 +1,8 @@
# Async.js
[![Build Status via Travis CI](https://travis-ci.org/caolan/async.svg?branch=master)](https://travis-ci.org/caolan/async)
-
+[![NPM version](http://img.shields.io/npm/v/async.svg)](https://www.npmjs.org/package/async)
+[![Coverage Status](https://coveralls.io/repos/caolan/async/badge.svg?branch=master)](https://coveralls.io/r/caolan/async?branch=master)
Async is a utility module which provides straight-forward, powerful functions
for working with asynchronous JavaScript. Although originally designed for
@@ -51,6 +52,43 @@ missing please create a GitHub issue for it.
## Common Pitfalls
+<a name="stack-overflow">
+### Synchronous iteration functions
+
+If you get an error like `RangeError: Maximum call stack size exceeded.` or other stack overflow issues when using async, you are likely using a synchronous iterator. By *synchronous* we mean a function that calls its callback on the same tick in the javascript event loop, without doing any I/O or using any timers. Calling many callbacks iteratively will quickly overflow the stack. If you run into this issue, just defer your callback with `async.nextTick` to start a new call stack on the next tick of the event loop.
+
+This can also arise by accident if you callback early in certain cases:
+
+```js
+async.eachSeries(hugeArray, function iterator(item, callback) {
+ if (inCache(item)) {
+ callback(null, cache[item]); // if many items are cached, you'll overflow
+ } else {
+ doSomeIO(item, callback);
+ }
+}, function done() {
+ //...
+});
+```
+
+Just change it to:
+
+```js
+async.eachSeries(hugeArray, function iterator(item, callback) {
+ if (inCache(item)) {
+ async.setImmediate(function () {
+ callback(null, cache[item]);
+ });
+ } else {
+ doSomeIO(item, callback);
+ //...
+```
+
+Async guards against synchronous functions in some, but not all, cases. If you are still running into stack overflows, you can defer as suggested above, or wrap functions with [`async.ensureAsync`](#ensureAsync) Functions that are asynchronous by their nature do not have this problem and don't need the extra callback deferral.
+
+If javascript's event loop is still a bit nebulous, check out [this article](http://blog.carbonfive.com/2013/10/27/the-javascript-event-loop-explained/) or [this talk](http://2014.jsconf.eu/speakers/philip-roberts-what-the-heck-is-the-event-loop-anyway.html) for more detailed information about how it works.
+
+
### Binding a context to an iterator
This section is really about `bind`, not about `async`. If you are wondering how to
@@ -61,7 +99,7 @@ a method of another library isn't working as an iterator, study this example:
// Here is a simple object with an (unnecessarily roundabout) squaring method
var AsyncSquaringLibrary = {
squareExponent: 2,
- square: function(number, callback){
+ square: function(number, callback){
var result = Math.pow(number, this.squareExponent);
setTimeout(function(){
callback(null, result);
@@ -79,7 +117,7 @@ async.map([1, 2, 3], AsyncSquaringLibrary.square, function(err, result){
async.map([1, 2, 3], AsyncSquaringLibrary.square.bind(AsyncSquaringLibrary), function(err, result){
// result is [1, 4, 9]
// With the help of bind we can attach a context to the iterator before
- // passing it to async. Now the square function will be executed in its
+ // passing it to async. Now the square function will be executed in its
// 'home' AsyncSquaringLibrary context and the value of `this.squareExponent`
// will be as expected.
});
@@ -88,16 +126,20 @@ async.map([1, 2, 3], AsyncSquaringLibrary.square.bind(AsyncSquaringLibrary), fun
## Download
The source is available for download from
-[GitHub](http://github.com/caolan/async).
+[GitHub](https://github.com/caolan/async/blob/master/lib/async.js).
Alternatively, you can install using Node Package Manager (`npm`):
npm install async
+As well as using Bower:
+
+ bower install async
+
__Development:__ [async.js](https://github.com/caolan/async/raw/master/lib/async.js) - 29.6kb Uncompressed
## In the Browser
-So far it's been tested in IE6, IE7, IE8, FF3.6 and Chrome 5.
+So far it's been tested in IE6, IE7, IE8, FF3.6 and Chrome 5.
Usage:
@@ -119,6 +161,9 @@ Usage:
* [`each`](#each)
* [`eachSeries`](#eachSeries)
* [`eachLimit`](#eachLimit)
+* [`forEachOf`](#forEachOf)
+* [`forEachOfSeries`](#forEachOfSeries)
+* [`forEachOfLimit`](#forEachOfLimit)
* [`map`](#map)
* [`mapSeries`](#mapSeries)
* [`mapLimit`](#mapLimit)
@@ -161,11 +206,13 @@ Usage:
* [`nextTick`](#nextTick)
* [`times`](#times)
* [`timesSeries`](#timesSeries)
+* [`timesLimit`](#timesLimit)
### Utils
* [`memoize`](#memoize)
* [`unmemoize`](#unmemoize)
+* [`ensureAsync`](#ensureAsync)
* [`log`](#log)
* [`dir`](#dir)
* [`noConflict`](#noConflict)
@@ -175,7 +222,7 @@ Usage:
<a name="forEach" />
<a name="each" />
-### each(arr, iterator, callback)
+### each(arr, iterator, [callback])
Applies the function `iterator` to each item in `arr`, in parallel.
The `iterator` is called with an item from the list, and a callback for when it
@@ -189,10 +236,11 @@ __Arguments__
* `arr` - An array to iterate over.
* `iterator(item, callback)` - A function to apply to each item in `arr`.
- The iterator is passed a `callback(err)` which must be called once it has
+ The iterator is passed a `callback(err)` which must be called once it has
completed. If no error has occurred, the `callback` should be run without
- arguments or with an explicit `null` argument.
-* `callback(err)` - A callback which is called when all `iterator` functions
+ arguments or with an explicit `null` argument. The array index is not passed
+ to the iterator. If you need the index, use [`forEachOf`](#forEachOf).
+* `callback(err)` - *Optional* A callback which is called when all `iterator` functions
have finished, or an error occurs.
__Examples__
@@ -208,13 +256,13 @@ async.each(openFiles, saveFile, function(err){
```
```js
-// assuming openFiles is an array of file names
+// assuming openFiles is an array of file names
async.each(openFiles, function(file, callback) {
-
+
// Perform operation on file here.
console.log('Processing file ' + file);
-
+
if( file.length > 32 ) {
console.log('This file name is too long');
callback('File name too long');
@@ -239,10 +287,10 @@ async.each(openFiles, function(file, callback) {
<a name="forEachSeries" />
<a name="eachSeries" />
-### eachSeries(arr, iterator, callback)
+### eachSeries(arr, iterator, [callback])
The same as [`each`](#each), only `iterator` is applied to each item in `arr` in
-series. The next `iterator` is only called once the current one has completed.
+series. The next `iterator` is only called once the current one has completed.
This means the `iterator` functions will complete in order.
@@ -250,12 +298,12 @@ This means the `iterator` functions will complete in order.
<a name="forEachLimit" />
<a name="eachLimit" />
-### eachLimit(arr, limit, iterator, callback)
+### eachLimit(arr, limit, iterator, [callback])
-The same as [`each`](#each), only no more than `limit` `iterator`s will be simultaneously
+The same as [`each`](#each), only no more than `limit` `iterator`s will be simultaneously
running at any time.
-Note that the items in `arr` are not processed in batches, so there is no guarantee that
+Note that the items in `arr` are not processed in batches, so there is no guarantee that
the first `limit` `iterator` functions will complete before any others are started.
__Arguments__
@@ -263,10 +311,10 @@ __Arguments__
* `arr` - An array to iterate over.
* `limit` - The maximum number of `iterator`s to run at any time.
* `iterator(item, callback)` - A function to apply to each item in `arr`.
- The iterator is passed a `callback(err)` which must be called once it has
+ The iterator is passed a `callback(err)` which must be called once it has
completed. If no error has occurred, the callback should be run without
arguments or with an explicit `null` argument.
-* `callback(err)` - A callback which is called when all `iterator` functions
+* `callback(err)` - *Optional* A callback which is called when all `iterator` functions
have finished, or an error occurs.
__Example__
@@ -282,26 +330,87 @@ async.eachLimit(documents, 20, requestApi, function(err){
---------------------------------------
+<a name="forEachOf" />
+<a name="eachOf" />
+
+### forEachOf(obj, iterator, [callback])
+
+Like `each`, except that it iterates over objects, and passes the key as the second argument to the iterator.
+
+__Arguments__
+
+* `obj` - An object or array to iterate over.
+* `iterator(item, key, callback)` - A function to apply to each item in `obj`.
+The `key` is the item's key, or index in the case of an array. The iterator is
+passed a `callback(err)` which must be called once it has completed. If no
+error has occurred, the callback should be run without arguments or with an
+explicit `null` argument.
+* `callback(err)` - *Optional* A callback which is called when all `iterator` functions have finished, or an error occurs.
+
+__Example__
+
+```js
+var obj = {dev: "/dev.json", test: "/test.json", prod: "/prod.json"};
+var configs = {};
+
+async.forEachOf(obj, function (value, key, callback) {
+ fs.readFile(__dirname + value, "utf8", function (err, data) {
+ if (err) return callback(err);
+ try {
+ configs[key] = JSON.parse(data);
+ } catch (e) {
+ return callback(e);
+ }
+ callback();
+ })
+}, function (err) {
+ if (err) console.error(err.message);
+ // configs is now a map of JSON data
+ doSomethingWith(configs);
+})
+```
+
+---------------------------------------
+
+<a name="forEachOfSeries" />
+<a name="eachOfSeries" />
+
+### forEachOfSeries(obj, iterator, [callback])
+
+Like [`forEachOf`](#forEachOf), except only one `iterator` is run at a time. The order of execution is not guaranteed for objects, but it will be guaranteed for arrays.
+
+---------------------------------------
+
+<a name="forEachOfLimit" />
+<a name="eachOfLimit" />
+
+### forEachOfLimit(obj, limit, iterator, [callback])
+
+Like [`forEachOf`](#forEachOf), except the number of `iterator`s running at a given time is controlled by `limit`.
+
+
+---------------------------------------
+
<a name="map" />
-### map(arr, iterator, callback)
+### map(arr, iterator, [callback])
Produces a new array of values by mapping each value in `arr` through
the `iterator` function. The `iterator` is called with an item from `arr` and a
-callback for when it has finished processing. Each of these callback takes 2 arguments:
-an `error`, and the transformed item from `arr`. If `iterator` passes an error to his
+callback for when it has finished processing. Each of these callback takes 2 arguments:
+an `error`, and the transformed item from `arr`. If `iterator` passes an error to its
callback, the main `callback` (for the `map` function) is immediately called with the error.
Note, that since this function applies the `iterator` to each item in parallel,
-there is no guarantee that the `iterator` functions will complete in order.
+there is no guarantee that the `iterator` functions will complete in order.
However, the results array will be in the same order as the original `arr`.
__Arguments__
* `arr` - An array to iterate over.
* `iterator(item, callback)` - A function to apply to each item in `arr`.
- The iterator is passed a `callback(err, transformed)` which must be called once
+ The iterator is passed a `callback(err, transformed)` which must be called once
it has completed with an error (which can be `null`) and a transformed item.
-* `callback(err, results)` - A callback which is called when all `iterator`
+* `callback(err, results)` - *Optional* A callback which is called when all `iterator`
functions have finished, or an error occurs. Results is an array of the
transformed items from the `arr`.
@@ -316,22 +425,22 @@ async.map(['file1','file2','file3'], fs.stat, function(err, results){
---------------------------------------
<a name="mapSeries" />
-### mapSeries(arr, iterator, callback)
+### mapSeries(arr, iterator, [callback])
The same as [`map`](#map), only the `iterator` is applied to each item in `arr` in
-series. The next `iterator` is only called once the current one has completed.
+series. The next `iterator` is only called once the current one has completed.
The results array will be in the same order as the original.
---------------------------------------
<a name="mapLimit" />
-### mapLimit(arr, limit, iterator, callback)
+### mapLimit(arr, limit, iterator, [callback])
-The same as [`map`](#map), only no more than `limit` `iterator`s will be simultaneously
+The same as [`map`](#map), only no more than `limit` `iterator`s will be simultaneously
running at any time.
-Note that the items are not processed in batches, so there is no guarantee that
+Note that the items are not processed in batches, so there is no guarantee that
the first `limit` `iterator` functions will complete before any others are started.
__Arguments__
@@ -339,7 +448,7 @@ __Arguments__
* `arr` - An array to iterate over.
* `limit` - The maximum number of `iterator`s to run at any time.
* `iterator(item, callback)` - A function to apply to each item in `arr`.
- The iterator is passed a `callback(err, transformed)` which must be called once
+ The iterator is passed a `callback(err, transformed)` which must be called once
it has completed with an error (which can be `null`) and a transformed item.
* `callback(err, results)` - A callback which is called when all `iterator`
calls have finished, or an error occurs. The result is an array of the
@@ -357,7 +466,7 @@ async.mapLimit(['file1','file2','file3'], 1, fs.stat, function(err, results){
<a name="select" />
<a name="filter" />
-### filter(arr, iterator, callback)
+### filter(arr, iterator, [callback])
__Alias:__ `select`
@@ -372,9 +481,9 @@ __Arguments__
* `arr` - An array to iterate over.
* `iterator(item, callback)` - A truth test to apply to each item in `arr`.
- The `iterator` is passed a `callback(truthValue)`, which must be called with a
+ The `iterator` is passed a `callback(truthValue)`, which must be called with a
boolean argument once it has completed.
-* `callback(results)` - A callback which is called after all the `iterator`
+* `callback(results)` - *Optional* A callback which is called after all the `iterator`
functions have finished.
__Example__
@@ -389,25 +498,25 @@ async.filter(['file1','file2','file3'], fs.exists, function(results){
<a name="selectSeries" />
<a name="filterSeries" />
-### filterSeries(arr, iterator, callback)
+### filterSeries(arr, iterator, [callback])
__Alias:__ `selectSeries`
The same as [`filter`](#filter) only the `iterator` is applied to each item in `arr` in
-series. The next `iterator` is only called once the current one has completed.
+series. The next `iterator` is only called once the current one has completed.
The results array will be in the same order as the original.
---------------------------------------
<a name="reject" />
-### reject(arr, iterator, callback)
+### reject(arr, iterator, [callback])
The opposite of [`filter`](#filter). Removes values that pass an `async` truth test.
---------------------------------------
<a name="rejectSeries" />
-### rejectSeries(arr, iterator, callback)
+### rejectSeries(arr, iterator, [callback])
The same as [`reject`](#reject), only the `iterator` is applied to each item in `arr`
in series.
@@ -416,17 +525,17 @@ in series.
---------------------------------------
<a name="reduce" />
-### reduce(arr, memo, iterator, callback)
+### reduce(arr, memo, iterator, [callback])
__Aliases:__ `inject`, `foldl`
Reduces `arr` into a single value using an async `iterator` to return
-each successive step. `memo` is the initial state of the reduction.
-This function only operates in series.
+each successive step. `memo` is the initial state of the reduction.
+This function only operates in series.
-For performance reasons, it may make sense to split a call to this function into
-a parallel map, and then use the normal `Array.prototype.reduce` on the results.
-This function is for situations where each step in the reduction needs to be async;
+For performance reasons, it may make sense to split a call to this function into
+a parallel map, and then use the normal `Array.prototype.reduce` on the results.
+This function is for situations where each step in the reduction needs to be async;
if you can get the data before reducing it, then it's probably a good idea to do so.
__Arguments__
@@ -435,11 +544,11 @@ __Arguments__
* `memo` - The initial state of the reduction.
* `iterator(memo, item, callback)` - A function applied to each item in the
array to produce the next step in the reduction. The `iterator` is passed a
- `callback(err, reduction)` which accepts an optional error as its first
- argument, and the state of the reduction as the second. If an error is
- passed to the callback, the reduction is stopped and the main `callback` is
+ `callback(err, reduction)` which accepts an optional error as its first
+ argument, and the state of the reduction as the second. If an error is
+ passed to the callback, the reduction is stopped and the main `callback` is
immediately called with the error.
-* `callback(err, result)` - A callback which is called after all the `iterator`
+* `callback(err, result)` - *Optional* A callback which is called after all the `iterator`
functions have finished. Result is the reduced value.
__Example__
@@ -458,7 +567,7 @@ async.reduce([1,2,3], 0, function(memo, item, callback){
---------------------------------------
<a name="reduceRight" />
-### reduceRight(arr, memo, iterator, callback)
+### reduceRight(arr, memo, iterator, [callback])
__Alias:__ `foldr`
@@ -468,7 +577,7 @@ Same as [`reduce`](#reduce), only operates on `arr` in reverse order.
---------------------------------------
<a name="detect" />
-### detect(arr, iterator, callback)
+### detect(arr, iterator, [callback])
Returns the first value in `arr` that passes an async truth test. The
`iterator` is applied in parallel, meaning the first iterator to return `true` will
@@ -481,12 +590,12 @@ __Arguments__
* `arr` - An array to iterate over.
* `iterator(item, callback)` - A truth test to apply to each item in `arr`.
- The iterator is passed a `callback(truthValue)` which must be called with a
- boolean argument once it has completed.
-* `callback(result)` - A callback which is called as soon as any iterator returns
+ The iterator is passed a `callback(truthValue)` which must be called with a
+ boolean argument once it has completed. **Note: this callback does not take an error as its first argument.**
+* `callback(result)` - *Optional* A callback which is called as soon as any iterator returns
`true`, or after all the `iterator` functions have finished. Result will be
the first item in the array that passes the truth test (iterator) or the
- value `undefined` if none passed.
+ value `undefined` if none passed. **Note: this callback does not take an error as its first argument.**
__Example__
@@ -499,7 +608,7 @@ async.detect(['file1','file2','file3'], fs.exists, function(result){
---------------------------------------
<a name="detectSeries" />
-### detectSeries(arr, iterator, callback)
+### detectSeries(arr, iterator, [callback])
The same as [`detect`](#detect), only the `iterator` is applied to each item in `arr`
in series. This means the result is always the first in the original `arr` (in
@@ -509,7 +618,7 @@ terms of array order) that passes the truth test.
---------------------------------------
<a name="sortBy" />
-### sortBy(arr, iterator, callback)
+### sortBy(arr, iterator, [callback])
Sorts a list by the results of running each `arr` value through an async `iterator`.
@@ -520,7 +629,7 @@ __Arguments__
The iterator is passed a `callback(err, sortValue)` which must be called once it
has completed with an error (which can be `null`) and a value to use as the sort
criteria.
-* `callback(err, results)` - A callback which is called after all the `iterator`
+* `callback(err, results)` - *Optional* A callback which is called after all the `iterator`
functions have finished, or an error occurs. Results is the items from
the original `arr` sorted by the values returned by the `iterator` calls.
@@ -560,7 +669,7 @@ async.sortBy([1,9,3,5], function(x, callback){
---------------------------------------
<a name="some" />
-### some(arr, iterator, callback)
+### some(arr, iterator, [callback])
__Alias:__ `any`
@@ -574,12 +683,13 @@ __Arguments__
* `arr` - An array to iterate over.
* `iterator(item, callback)` - A truth test to apply to each item in the array
- in parallel. The iterator is passed a callback(truthValue) which must be
+ in parallel. The iterator is passed a `callback(truthValue)`` which must be
called with a boolean argument once it has completed.
-* `callback(result)` - A callback which is called as soon as any iterator returns
+* `callback(result)` - *Optional* A callback which is called as soon as any iterator returns
`true`, or after all the iterator functions have finished. Result will be
either `true` or `false` depending on the values of the async tests.
+ **Note: the callbacks do not take an error as their first argument.**
__Example__
```js
@@ -591,7 +701,7 @@ async.some(['file1','file2','file3'], fs.exists, function(result){
---------------------------------------
<a name="every" />
-### every(arr, iterator, callback)
+### every(arr, iterator, [callback])
__Alias:__ `all`
@@ -604,12 +714,14 @@ __Arguments__
* `arr` - An array to iterate over.
* `iterator(item, callback)` - A truth test to apply to each item in the array
- in parallel. The iterator is passed a callback(truthValue) which must be
+ in parallel. The iterator is passed a `callback(truthValue)` which must be
called with a boolean argument once it has completed.
-* `callback(result)` - A callback which is called after all the `iterator`
+* `callback(result)` - *Optional* A callback which is called after all the `iterator`
functions have finished. Result will be either `true` or `false` depending on
the values of the async tests.
+ **Note: the callbacks do not take an error as their first argument.**
+
__Example__
```js
@@ -621,7 +733,7 @@ async.every(['file1','file2','file3'], fs.exists, function(result){
---------------------------------------
<a name="concat" />
-### concat(arr, iterator, callback)
+### concat(arr, iterator, [callback])
Applies `iterator` to each item in `arr`, concatenating the results. Returns the
concatenated list. The `iterator`s are called in parallel, and the results are
@@ -632,9 +744,9 @@ __Arguments__
* `arr` - An array to iterate over.
* `iterator(item, callback)` - A function to apply to each item in `arr`.
- The iterator is passed a `callback(err, results)` which must be called once it
+ The iterator is passed a `callback(err, results)` which must be called once it
has completed with an error (which can be `null`) and an array of results.
-* `callback(err, results)` - A callback which is called after all the `iterator`
+* `callback(err, results)` - *Optional* A callback which is called after all the `iterator`
functions have finished, or an error occurs. Results is an array containing
the concatenated results of the `iterator` function.
@@ -649,7 +761,7 @@ async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){
---------------------------------------
<a name="concatSeries" />
-### concatSeries(arr, iterator, callback)
+### concatSeries(arr, iterator, [callback])
Same as [`concat`](#concat), but executes in series instead of parallel.
@@ -661,7 +773,7 @@ Same as [`concat`](#concat), but executes in series instead of parallel.
Run the functions in the `tasks` array in series, each one running once the previous
function has completed. If any functions in the series pass an error to its
-callback, no more functions are run, and `callback` is immediately called with the value of the error.
+callback, no more functions are run, and `callback` is immediately called with the value of the error.
Otherwise, `callback` receives an array of results when `tasks` have completed.
It is also possible to use an object instead of an array. Each property will be
@@ -670,13 +782,13 @@ instead of an array. This can be a more readable way of handling results from
[`series`](#series).
**Note** that while many implementations preserve the order of object properties, the
-[ECMAScript Language Specifcation](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6)
+[ECMAScript Language Specifcation](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6)
explicitly states that
> The mechanics and order of enumerating the properties is not specified.
So if you rely on the order in which your series of functions are executed, and want
-this to work on all platforms, consider using an array.
+this to work on all platforms, consider using an array.
__Arguments__
@@ -684,7 +796,7 @@ __Arguments__
a `callback(err, result)` it must call on completion with an error `err` (which can
be `null`) and an optional `result` value.
* `callback(err, results)` - An optional callback to run once all the functions
- have completed. This function gets a results array (or object) containing all
+ have completed. This function gets a results array (or object) containing all
the result arguments passed to the `task` callbacks.
__Example__
@@ -743,11 +855,11 @@ instead of an array. This can be a more readable way of handling results from
__Arguments__
-* `tasks` - An array or object containing functions to run. Each function is passed
- a `callback(err, result)` which it must call on completion with an error `err`
+* `tasks` - An array or object containing functions to run. Each function is passed
+ a `callback(err, result)` which it must call on completion with an error `err`
(which can be `null`) and an optional `result` value.
* `callback(err, results)` - An optional callback to run once all the functions
- have completed. This function gets a results array (or object) containing all
+ have completed. This function gets a results array (or object) containing all
the result arguments passed to the task callbacks.
__Example__
@@ -795,20 +907,20 @@ function(err, results) {
<a name="parallelLimit" />
### parallelLimit(tasks, limit, [callback])
-The same as [`parallel`](#parallel), only `tasks` are executed in parallel
+The same as [`parallel`](#parallel), only `tasks` are executed in parallel
with a maximum of `limit` tasks executing at any time.
-Note that the `tasks` are not executed in batches, so there is no guarantee that
+Note that the `tasks` are not executed in batches, so there is no guarantee that
the first `limit` tasks will complete before any others are started.
__Arguments__
-* `tasks` - An array or object containing functions to run, each function is passed
+* `tasks` - An array or object containing functions to run, each function is passed
a `callback(err, result)` it must call on completion with an error `err` (which can
be `null`) and an optional `result` value.
* `limit` - The maximum number of `tasks` to run at any time.
* `callback(err, results)` - An optional callback to run once all the functions
- have completed. This function gets a results array (or object) containing all
+ have completed. This function gets a results array (or object) containing all
the result arguments passed to the `task` callbacks.
---------------------------------------
@@ -823,7 +935,7 @@ __Arguments__
* `test()` - synchronous truth test to perform before each execution of `fn`.
* `fn(callback)` - A function which is called each time `test` passes. The function is
- passed a `callback(err)`, which must be called once it has completed with an
+ passed a `callback(err)`, which must be called once it has completed with an
optional `err` argument.
* `callback(err)` - A callback which is called after the test fails and repeated
execution of `fn` has stopped.
@@ -850,8 +962,8 @@ async.whilst(
<a name="doWhilst" />
### doWhilst(fn, test, callback)
-The post-check version of [`whilst`](#whilst). To reflect the difference in
-the order of operations, the arguments `test` and `fn` are switched.
+The post-check version of [`whilst`](#whilst). To reflect the difference in
+the order of operations, the arguments `test` and `fn` are switched.
`doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.
@@ -875,7 +987,7 @@ Like [`doWhilst`](#doWhilst), except the `test` is inverted. Note the argument o
---------------------------------------
<a name="forever" />
-### forever(fn, errback)
+### forever(fn, [errback])
Calls the asynchronous function `fn` with a callback parameter that allows it to
call itself again, in series, indefinitely.
@@ -908,9 +1020,9 @@ the error.
__Arguments__
-* `tasks` - An array of functions to run, each function is passed a
+* `tasks` - An array of functions to run, each function is passed a
`callback(err, result1, result2, ...)` it must call on completion. The first
- argument is an error (which can be `null`) and any further arguments will be
+ argument is an error (which can be `null`) and any further arguments will be
passed as arguments in order to the next task.
* `callback(err, [results])` - An optional callback to run once all the functions
have completed. This will be passed the results of the last task's callback.
@@ -995,7 +1107,7 @@ __Example__
```js
// Requires lodash (or underscore), express3 and dresende's orm2.
// Part of an app, that fetches cats of the logged user.
-// This example uses `seq` function to avoid overnesting and error
+// This example uses `seq` function to avoid overnesting and error
// handling clutter.
app.get('/cats', function(request, response) {
var User = request.models.User;
@@ -1019,7 +1131,7 @@ app.get('/cats', function(request, response) {
<a name="applyEach" />
### applyEach(fns, args..., callback)
-Applies the provided arguments to each function in the array, calling
+Applies the provided arguments to each function in the array, calling
`callback` after all functions have completed. If you only provide the first
argument, then it will return a function which lets you pass in the
arguments as if it were a single function call.
@@ -1048,27 +1160,27 @@ async.each(
---------------------------------------
<a name="applyEachSeries" />
-### applyEachSeries(arr, iterator, callback)
+### applyEachSeries(arr, args..., callback)
The same as [`applyEach`](#applyEach) only the functions are applied in series.
---------------------------------------
<a name="queue" />
-### queue(worker, concurrency)
+### queue(worker, [concurrency])
Creates a `queue` object with the specified `concurrency`. Tasks added to the
`queue` are processed in parallel (up to the `concurrency` limit). If all
-`worker`s are in progress, the task is queued until one becomes available.
+`worker`s are in progress, the task is queued until one becomes available.
Once a `worker` completes a `task`, that `task`'s callback is called.
__Arguments__
* `worker(task, callback)` - An asynchronous function for processing a queued
- task, which must call its `callback(err)` argument when finished, with an
- optional `error` as an argument.
+ task, which must call its `callback(err)` argument when finished, with an
+ optional `error` as an argument. If you want to handle errors from an individual task, pass a callback to `q.push()`.
* `concurrency` - An `integer` for determining how many `worker` functions should be
- run in parallel.
+ run in parallel. If omitted, the concurrency defaults to `1`. If the concurrency is `0`, an error is thrown.
__Queue objects__
@@ -1082,11 +1194,11 @@ methods:
* `concurrency` - an integer for determining how many `worker` functions should be
run in parallel. This property can be changed after a `queue` is created to
alter the concurrency on-the-fly.
-* `push(task, [callback])` - add a new task to the `queue`. Calls `callback` once
+* `push(task, [callback])` - add a new task to the `queue`. Calls `callback` once
the `worker` has finished processing the task. Instead of a single task, a `tasks` array
can be submitted. The respective callback is used for every task in the list.
* `unshift(task, [callback])` - add a new task to the front of the `queue`.
-* `saturated` - a callback that is called when the `queue` length hits the `concurrency` limit,
+* `saturated` - a callback that is called when the `queue` length hits the `concurrency` limit,
and further tasks will be queued.
* `empty` - a callback that is called when the last item from the `queue` is given to a `worker`.
* `drain` - a callback that is called when the last item from the `queue` has returned from the `worker`.
@@ -1154,7 +1266,7 @@ Creates a `cargo` object with the specified payload. Tasks added to the
cargo will be processed altogether (up to the `payload` limit). If the
`worker` is in progress, the task is queued until it becomes available. Once
the `worker` has completed some tasks, each callback of those tasks is called.
-Check out [this animation](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) for how `cargo` and `queue` work.
+Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966) for how `cargo` and `queue` work.
While [queue](#queue) passes only one task to one of a group of workers
at a time, cargo passes an array of tasks to a single worker, repeating
@@ -1163,7 +1275,7 @@ when the worker is finished.
__Arguments__
* `worker(tasks, callback)` - An asynchronous function for processing an array of
- queued tasks, which must call its `callback(err)` argument when finished, with
+ queued tasks, which must call its `callback(err)` argument when finished, with
an optional `err` argument.
* `payload` - An optional `integer` for determining how many tasks should be
processed per round; if omitted, the default is unlimited.
@@ -1178,11 +1290,12 @@ methods:
process per round. This property can be changed after a `cargo` is created to
alter the payload on-the-fly.
* `push(task, [callback])` - Adds `task` to the `queue`. The callback is called
- once the `worker` has finished processing the task. Instead of a single task, an array of `tasks`
+ once the `worker` has finished processing the task. Instead of a single task, an array of `tasks`
can be submitted. The respective callback is used for every task in the list.
* `saturated` - A callback that is called when the `queue.length()` hits the concurrency and further tasks will be queued.
* `empty` - A callback that is called when the last item from the `queue` is given to a `worker`.
* `drain` - A callback that is called when the last item from the `queue` has returned from the `worker`.
+* `idle()`, `pause()`, `resume()`, `kill()` - cargo inherits all of the same methods and event calbacks as [`queue`](#queue)
__Example__
@@ -1215,18 +1328,18 @@ cargo.push({name: 'baz'}, function (err) {
<a name="auto" />
### auto(tasks, [callback])
-Determines the best order for running the functions in `tasks`, based on their
-requirements. Each function can optionally depend on other functions being completed
-first, and each function is run as soon as its requirements are satisfied.
+Determines the best order for running the functions in `tasks`, based on their
+requirements. Each function can optionally depend on other functions being completed
+first, and each function is run as soon as its requirements are satisfied.
-If any of the functions pass an error to their callback, it will not
-complete (so any other functions depending on it will not run), and the main
-`callback` is immediately called with the error. Functions also receive an
+If any of the functions pass an error to their callback, it will not
+complete (so any other functions depending on it will not run), and the main
+`callback` is immediately called with the error. Functions also receive an
object containing the results of functions which have completed so far.
-Note, all functions are called with a `results` object as a second argument,
+Note, all functions are called with a `results` object as a second argument,
so it is unsafe to pass functions in the `tasks` object which cannot handle the
-extra argument.
+extra argument.
For example, this snippet of code:
@@ -1243,7 +1356,7 @@ argument, which will fail:
fs.readFile('data.txt', 'utf-8', cb, {});
```
-Instead, wrap the call to `readFile` in a function which does not forward the
+Instead, wrap the call to `readFile` in a function which does not forward the
`results` object:
```js
@@ -1260,13 +1373,13 @@ __Arguments__
requirements, with the function itself the last item in the array. The object's key
of a property serves as the name of the task defined by that property,
i.e. can be used when specifying requirements for other tasks.
- The function receives two arguments: (1) a `callback(err, result)` which must be
- called when finished, passing an `error` (which can be `null`) and the result of
+ The function receives two arguments: (1) a `callback(err, result)` which must be
+ called when finished, passing an `error` (which can be `null`) and the result of
the function's execution, and (2) a `results` object, containing the results of
the previously executed functions.
* `callback(err, results)` - An optional callback which is called when all the
- tasks have been completed. It receives the `err` argument if any `tasks`
- pass an error to their callback. Results are always returned; however, if
+ tasks have been completed. It receives the `err` argument if any `tasks`
+ pass an error to their callback. Results are always returned; however, if
an error occurs, no further `tasks` will be performed, and the results
object will only contain partial results.
@@ -1357,7 +1470,7 @@ __Arguments__
* `times` - An integer indicating how many times to attempt the `task` before giving up. Defaults to 5.
* `task(callback, results)` - A function which receives two arguments: (1) a `callback(err, result)`
- which must be called when finished, passing `err` (which can be `null`) and the `result` of
+ which must be called when finished, passing `err` (which can be `null`) and the `result` of
the function's execution, and (2) a `results` object, containing the results of
the previously executed functions (if nested inside another control flow).
* `callback(err, results)` - An optional callback which is called when the
@@ -1426,7 +1539,7 @@ node> nextfn();
<a name="apply" />
### apply(function, arguments..)
-Creates a continuation function with some arguments already applied.
+Creates a continuation function with some arguments already applied.
Useful as a shorthand when combined with other control flow functions. Any arguments
passed to the returned function are added to the arguments originally passed
@@ -1500,15 +1613,16 @@ call_order.push('one')
```
<a name="times" />
-### times(n, callback)
+### times(n, iterator, [callback])
-Calls the `callback` function `n` times, and accumulates results in the same manner
+Calls the `iterator` function `n` times, and accumulates results in the same manner
you would use with [`map`](#map).
__Arguments__
* `n` - The number of times to run the function.
-* `callback` - The function to call `n` times.
+* `iterator` - The function to call `n` times.
+* `callback` - see [`map`](#map)
__Example__
@@ -1530,12 +1644,17 @@ async.times(5, function(n, next){
```
<a name="timesSeries" />
-### timesSeries(n, callback)
+### timesSeries(n, iterator, [callback])
The same as [`times`](#times), only the iterator is applied to each item in `arr` in
-series. The next `iterator` is only called once the current one has completed.
+series. The next `iterator` is only called once the current one has completed.
The results array will be in the same order as the original.
+<a name="timesLimit" />
+### timesLimit(n, limit, iterator, [callback])
+
+The same as [`times`](#times), except a maximum of `limit` iterators are run at a given time, similar to [`mapLimit`](#mapLimit).
+
## Utils
@@ -1546,13 +1665,15 @@ Caches the results of an `async` function. When creating a hash to store functio
results against, the callback is omitted from the hash and an optional hash
function can be used.
+If no hash function is specified, the first argument is used as a hash key, which may work reasonably if it is a string or a data type that converts to a distinct string. Note that objects and arrays will not behave reasonably. Neither will cases where the other arguments are significant. In such cases, specify your own hash function.
+
The cache of results is exposed as the `memo` property of the function returned
by `memoize`.
__Arguments__
* `fn` - The function to proxy and cache results from.
-* `hasher` - Tn optional function for generating a custom hash for storing
+* `hasher` - An optional function for generating a custom hash for storing
results. It has all the arguments applied to it apart from the callback, and
must be synchronous.
@@ -1581,6 +1702,41 @@ __Arguments__
* `fn` - the memoized function
+---------------------------------------
+
+<a name="ensureAsync" />
+### ensureAsync(fn)
+
+Wrap an async function and ensure it calls its callback on a later tick of the event loop. If the function already calls its callback on a next tick, no extra deferral is added. This is useful for preventing stack overflows (`RangeError: Maximum call stack size exceeded`) and generally keeping [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony) contained.
+
+__Arguments__
+
+* `fn` - an async function, one that expects a node-style callback as its last argument
+
+Returns a wrapped function with the exact same call signature as the function passed in.
+
+__Example__
+
+```js
+function sometimesAsync(arg, callback) {
+ if (cache[arg]) {
+ return callback(null, cache[arg]); // this would be synchronous!!
+ } else {
+ doSomeIO(arg, callback); // this IO would be asynchronous
+ }
+}
+
+// this has a risk of stack overflows if many results are cached in a row
+async.mapSeries(args, sometimesAsync, done);
+
+// this will defer sometimesAsync's callback if necessary,
+// preventing stack overflows
+async.mapSeries(args, async.ensureAsync(sometimesAsync), done);
+
+```
+
+---------------------------------------
+
<a name="log" />
### log(function, arguments)
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/bower.json b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/bower.json
index 18176881e00..60b78284a7d 100644
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/bower.json
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/bower.json
@@ -1,7 +1,7 @@
{
"name": "async",
"description": "Higher-order functions and common patterns for asynchronous code",
- "version": "0.9.2",
+ "version": "1.2.1",
"main": "lib/async.js",
"keywords": [
"async",
@@ -15,10 +15,15 @@
"url": "https://github.com/caolan/async.git"
},
"devDependencies": {
+ "benchmark": "bestiejs/benchmark.js",
+ "coveralls": "^2.11.2",
+ "jshint": "~2.7.0",
+ "lodash": ">=2.4.1",
+ "mkdirp": "~0.5.1",
"nodeunit": ">0.0.0",
+ "nyc": "^2.1.0",
"uglify-js": "1.2.x",
- "nodelint": ">0.0.0",
- "lodash": ">=2.4.1"
+ "yargs": "~3.9.1"
},
"moduleType": [
"amd",
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/component.json b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/component.json
index 5003a7c52ce..0684c869b05 100644
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/component.json
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/component.json
@@ -1,7 +1,7 @@
{
"name": "async",
"description": "Higher-order functions and common patterns for asynchronous code",
- "version": "0.9.2",
+ "version": "1.2.1",
"keywords": [
"async",
"callback",
@@ -9,6 +9,7 @@
"module"
],
"license": "MIT",
+ "main": "lib/async.js",
"repository": "caolan/async",
"scripts": [
"lib/async.js"
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/base.css b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/base.css
new file mode 100644
index 00000000000..7fb88272200
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/base.css
@@ -0,0 +1,182 @@
+body, html {
+ margin:0; padding: 0;
+}
+body {
+ font-family: Helvetica Neue, Helvetica,Arial;
+ font-size: 10pt;
+}
+div.header, div.footer {
+ background: #eee;
+ padding: 1em;
+}
+div.header {
+ z-index: 100;
+ position: fixed;
+ top: 0;
+ border-bottom: 1px solid #666;
+ width: 100%;
+}
+div.footer {
+ border-top: 1px solid #666;
+}
+div.body {
+ margin-top: 10em;
+}
+div.meta {
+ font-size: 90%;
+ text-align: center;
+}
+h1, h2, h3 {
+ font-weight: normal;
+}
+h1 {
+ font-size: 12pt;
+}
+h2 {
+ font-size: 10pt;
+}
+pre {
+ font-family: Consolas, Menlo, Monaco, monospace;
+ margin: 0;
+ padding: 0;
+ line-height: 14px;
+ font-size: 14px;
+ -moz-tab-size: 2;
+ -o-tab-size: 2;
+ tab-size: 2;
+}
+
+div.path { font-size: 110%; }
+div.path a:link, div.path a:visited { color: #000; }
+table.coverage { border-collapse: collapse; margin:0; padding: 0 }
+
+table.coverage td {
+ margin: 0;
+ padding: 0;
+ color: #111;
+ vertical-align: top;
+}
+table.coverage td.line-count {
+ width: 50px;
+ text-align: right;
+ padding-right: 5px;
+}
+table.coverage td.line-coverage {
+ color: #777 !important;
+ text-align: right;
+ border-left: 1px solid #666;
+ border-right: 1px solid #666;
+}
+
+table.coverage td.text {
+}
+
+table.coverage td span.cline-any {
+ display: inline-block;
+ padding: 0 5px;
+ width: 40px;
+}
+table.coverage td span.cline-neutral {
+ background: #eee;
+}
+table.coverage td span.cline-yes {
+ background: #b5d592;
+ color: #999;
+}
+table.coverage td span.cline-no {
+ background: #fc8c84;
+}
+
+.cstat-yes { color: #111; }
+.cstat-no { background: #fc8c84; color: #111; }
+.fstat-no { background: #ffc520; color: #111 !important; }
+.cbranch-no { background: yellow !important; color: #111; }
+
+.cstat-skip { background: #ddd; color: #111; }
+.fstat-skip { background: #ddd; color: #111 !important; }
+.cbranch-skip { background: #ddd !important; color: #111; }
+
+.missing-if-branch {
+ display: inline-block;
+ margin-right: 10px;
+ position: relative;
+ padding: 0 4px;
+ background: black;
+ color: yellow;
+}
+
+.skip-if-branch {
+ display: none;
+ margin-right: 10px;
+ position: relative;
+ padding: 0 4px;
+ background: #ccc;
+ color: white;
+}
+
+.missing-if-branch .typ, .skip-if-branch .typ {
+ color: inherit !important;
+}
+
+.entity, .metric { font-weight: bold; }
+.metric { display: inline-block; border: 1px solid #333; padding: 0.3em; background: white; }
+.metric small { font-size: 80%; font-weight: normal; color: #666; }
+
+div.coverage-summary table { border-collapse: collapse; margin: 3em; font-size: 110%; }
+div.coverage-summary td, div.coverage-summary table th { margin: 0; padding: 0.25em 1em; border-top: 1px solid #666; border-bottom: 1px solid #666; }
+div.coverage-summary th { text-align: left; border: 1px solid #666; background: #eee; font-weight: normal; }
+div.coverage-summary th.file { border-right: none !important; }
+div.coverage-summary th.pic { border-left: none !important; text-align: right; }
+div.coverage-summary th.pct { border-right: none !important; }
+div.coverage-summary th.abs { border-left: none !important; text-align: right; }
+div.coverage-summary td.pct { text-align: right; border-left: 1px solid #666; }
+div.coverage-summary td.abs { text-align: right; font-size: 90%; color: #444; border-right: 1px solid #666; }
+div.coverage-summary td.file { text-align: right; border-left: 1px solid #666; white-space: nowrap; }
+div.coverage-summary td.pic { min-width: 120px !important; }
+div.coverage-summary a:link { text-decoration: none; color: #000; }
+div.coverage-summary a:visited { text-decoration: none; color: #333; }
+div.coverage-summary a:hover { text-decoration: underline; }
+div.coverage-summary tfoot td { border-top: 1px solid #666; }
+
+div.coverage-summary .sorter {
+ height: 10px;
+ width: 7px;
+ display: inline-block;
+ margin-left: 0.5em;
+ background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent;
+}
+div.coverage-summary .sorted .sorter {
+ background-position: 0 -20px;
+}
+div.coverage-summary .sorted-desc .sorter {
+ background-position: 0 -10px;
+}
+
+.high { background: #b5d592 !important; }
+.medium { background: #ffe87c !important; }
+.low { background: #fc8c84 !important; }
+
+span.cover-fill, span.cover-empty {
+ display:inline-block;
+ border:1px solid #444;
+ background: white;
+ height: 12px;
+}
+span.cover-fill {
+ background: #ccc;
+ border-right: 1px solid #444;
+}
+span.cover-empty {
+ background: white;
+ border-left: none;
+}
+span.cover-full {
+ border-right: none !important;
+}
+pre.prettyprint {
+ border: none !important;
+ padding: 0 !important;
+ margin: 0 !important;
+}
+.com { color: #999 !important; }
+.ignore-none { color: #999; font-weight: normal; } \ No newline at end of file
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/index.html b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/index.html
new file mode 100644
index 00000000000..0a8d4b73555
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/index.html
@@ -0,0 +1,73 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <title>Code coverage report for All files</title>
+ <meta charset="utf-8">
+ <link rel="stylesheet" href="prettify.css">
+ <link rel="stylesheet" href="base.css">
+ <style type='text/css'>
+ div.coverage-summary .sorter {
+ background-image: url(sort-arrow-sprite.png);
+ }
+ </style>
+</head>
+<body>
+<div class="header high">
+ <h1>Code coverage report for <span class="entity">All files</span></h1>
+ <h2>
+ Statements: <span class="metric">94.88% <small>(611 / 644)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
+ Branches: <span class="metric">86.91% <small>(239 / 275)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
+ Functions: <span class="metric">95.41% <small>(187 / 196)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
+ Lines: <span class="metric">94.85% <small>(608 / 641)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
+ Ignored: <span class="metric"><span class="ignore-none">none</span></span> &nbsp;&nbsp;&nbsp;&nbsp;
+ </h2>
+ <div class="path"></div>
+</div>
+<div class="body">
+<div class="coverage-summary">
+<table>
+<thead>
+<tr>
+ <th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
+ <th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
+ <th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
+ <th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
+ <th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
+ <th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
+ <th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
+ <th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
+ <th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
+ <th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
+</tr>
+</thead>
+<tbody><tr>
+ <td class="file high" data-value="lib/"><a href="lib/index.html">lib/</a></td>
+ <td data-value="94.88" class="pic high"><span class="cover-fill" style="width: 94px;"></span><span class="cover-empty" style="width:6px;"></span></td>
+ <td data-value="94.88" class="pct high">94.88%</td>
+ <td data-value="644" class="abs high">(611&nbsp;/&nbsp;644)</td>
+ <td data-value="86.91" class="pct high">86.91%</td>
+ <td data-value="275" class="abs high">(239&nbsp;/&nbsp;275)</td>
+ <td data-value="95.41" class="pct high">95.41%</td>
+ <td data-value="196" class="abs high">(187&nbsp;/&nbsp;196)</td>
+ <td data-value="94.85" class="pct high">94.85%</td>
+ <td data-value="641" class="abs high">(608&nbsp;/&nbsp;641)</td>
+ </tr>
+
+</tbody>
+</table>
+</div>
+</div>
+<div class="footer">
+ <div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Mon Jun 01 2015 15:22:05 GMT-0700 (PDT)</div>
+</div>
+<script src="prettify.js"></script>
+<script>
+window.onload = function () {
+ if (typeof prettyPrint === 'function') {
+ prettyPrint();
+ }
+};
+</script>
+<script src="sorter.js"></script>
+</body>
+</html>
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lcov-report/base.css b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lcov-report/base.css
new file mode 100644
index 00000000000..7fb88272200
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lcov-report/base.css
@@ -0,0 +1,182 @@
+body, html {
+ margin:0; padding: 0;
+}
+body {
+ font-family: Helvetica Neue, Helvetica,Arial;
+ font-size: 10pt;
+}
+div.header, div.footer {
+ background: #eee;
+ padding: 1em;
+}
+div.header {
+ z-index: 100;
+ position: fixed;
+ top: 0;
+ border-bottom: 1px solid #666;
+ width: 100%;
+}
+div.footer {
+ border-top: 1px solid #666;
+}
+div.body {
+ margin-top: 10em;
+}
+div.meta {
+ font-size: 90%;
+ text-align: center;
+}
+h1, h2, h3 {
+ font-weight: normal;
+}
+h1 {
+ font-size: 12pt;
+}
+h2 {
+ font-size: 10pt;
+}
+pre {
+ font-family: Consolas, Menlo, Monaco, monospace;
+ margin: 0;
+ padding: 0;
+ line-height: 14px;
+ font-size: 14px;
+ -moz-tab-size: 2;
+ -o-tab-size: 2;
+ tab-size: 2;
+}
+
+div.path { font-size: 110%; }
+div.path a:link, div.path a:visited { color: #000; }
+table.coverage { border-collapse: collapse; margin:0; padding: 0 }
+
+table.coverage td {
+ margin: 0;
+ padding: 0;
+ color: #111;
+ vertical-align: top;
+}
+table.coverage td.line-count {
+ width: 50px;
+ text-align: right;
+ padding-right: 5px;
+}
+table.coverage td.line-coverage {
+ color: #777 !important;
+ text-align: right;
+ border-left: 1px solid #666;
+ border-right: 1px solid #666;
+}
+
+table.coverage td.text {
+}
+
+table.coverage td span.cline-any {
+ display: inline-block;
+ padding: 0 5px;
+ width: 40px;
+}
+table.coverage td span.cline-neutral {
+ background: #eee;
+}
+table.coverage td span.cline-yes {
+ background: #b5d592;
+ color: #999;
+}
+table.coverage td span.cline-no {
+ background: #fc8c84;
+}
+
+.cstat-yes { color: #111; }
+.cstat-no { background: #fc8c84; color: #111; }
+.fstat-no { background: #ffc520; color: #111 !important; }
+.cbranch-no { background: yellow !important; color: #111; }
+
+.cstat-skip { background: #ddd; color: #111; }
+.fstat-skip { background: #ddd; color: #111 !important; }
+.cbranch-skip { background: #ddd !important; color: #111; }
+
+.missing-if-branch {
+ display: inline-block;
+ margin-right: 10px;
+ position: relative;
+ padding: 0 4px;
+ background: black;
+ color: yellow;
+}
+
+.skip-if-branch {
+ display: none;
+ margin-right: 10px;
+ position: relative;
+ padding: 0 4px;
+ background: #ccc;
+ color: white;
+}
+
+.missing-if-branch .typ, .skip-if-branch .typ {
+ color: inherit !important;
+}
+
+.entity, .metric { font-weight: bold; }
+.metric { display: inline-block; border: 1px solid #333; padding: 0.3em; background: white; }
+.metric small { font-size: 80%; font-weight: normal; color: #666; }
+
+div.coverage-summary table { border-collapse: collapse; margin: 3em; font-size: 110%; }
+div.coverage-summary td, div.coverage-summary table th { margin: 0; padding: 0.25em 1em; border-top: 1px solid #666; border-bottom: 1px solid #666; }
+div.coverage-summary th { text-align: left; border: 1px solid #666; background: #eee; font-weight: normal; }
+div.coverage-summary th.file { border-right: none !important; }
+div.coverage-summary th.pic { border-left: none !important; text-align: right; }
+div.coverage-summary th.pct { border-right: none !important; }
+div.coverage-summary th.abs { border-left: none !important; text-align: right; }
+div.coverage-summary td.pct { text-align: right; border-left: 1px solid #666; }
+div.coverage-summary td.abs { text-align: right; font-size: 90%; color: #444; border-right: 1px solid #666; }
+div.coverage-summary td.file { text-align: right; border-left: 1px solid #666; white-space: nowrap; }
+div.coverage-summary td.pic { min-width: 120px !important; }
+div.coverage-summary a:link { text-decoration: none; color: #000; }
+div.coverage-summary a:visited { text-decoration: none; color: #333; }
+div.coverage-summary a:hover { text-decoration: underline; }
+div.coverage-summary tfoot td { border-top: 1px solid #666; }
+
+div.coverage-summary .sorter {
+ height: 10px;
+ width: 7px;
+ display: inline-block;
+ margin-left: 0.5em;
+ background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent;
+}
+div.coverage-summary .sorted .sorter {
+ background-position: 0 -20px;
+}
+div.coverage-summary .sorted-desc .sorter {
+ background-position: 0 -10px;
+}
+
+.high { background: #b5d592 !important; }
+.medium { background: #ffe87c !important; }
+.low { background: #fc8c84 !important; }
+
+span.cover-fill, span.cover-empty {
+ display:inline-block;
+ border:1px solid #444;
+ background: white;
+ height: 12px;
+}
+span.cover-fill {
+ background: #ccc;
+ border-right: 1px solid #444;
+}
+span.cover-empty {
+ background: white;
+ border-left: none;
+}
+span.cover-full {
+ border-right: none !important;
+}
+pre.prettyprint {
+ border: none !important;
+ padding: 0 !important;
+ margin: 0 !important;
+}
+.com { color: #999 !important; }
+.ignore-none { color: #999; font-weight: normal; } \ No newline at end of file
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lcov-report/index.html b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lcov-report/index.html
new file mode 100644
index 00000000000..6660bfa56fc
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lcov-report/index.html
@@ -0,0 +1,73 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <title>Code coverage report for All files</title>
+ <meta charset="utf-8">
+ <link rel="stylesheet" href="prettify.css">
+ <link rel="stylesheet" href="base.css">
+ <style type='text/css'>
+ div.coverage-summary .sorter {
+ background-image: url(sort-arrow-sprite.png);
+ }
+ </style>
+</head>
+<body>
+<div class="header high">
+ <h1>Code coverage report for <span class="entity">All files</span></h1>
+ <h2>
+ Statements: <span class="metric">94.13% <small>(673 / 715)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
+ Branches: <span class="metric">85% <small>(272 / 320)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
+ Functions: <span class="metric">94.2% <small>(195 / 207)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
+ Lines: <span class="metric">94.36% <small>(669 / 709)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
+ Ignored: <span class="metric"><span class="ignore-none">none</span></span> &nbsp;&nbsp;&nbsp;&nbsp;
+ </h2>
+ <div class="path"></div>
+</div>
+<div class="body">
+<div class="coverage-summary">
+<table>
+<thead>
+<tr>
+ <th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
+ <th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
+ <th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
+ <th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
+ <th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
+ <th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
+ <th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
+ <th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
+ <th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
+ <th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
+</tr>
+</thead>
+<tbody><tr>
+ <td class="file high" data-value="lib/"><a href="lib/index.html">lib/</a></td>
+ <td data-value="94.13" class="pic high"><span class="cover-fill" style="width: 94px;"></span><span class="cover-empty" style="width:6px;"></span></td>
+ <td data-value="94.13" class="pct high">94.13%</td>
+ <td data-value="715" class="abs high">(673&nbsp;/&nbsp;715)</td>
+ <td data-value="85" class="pct high">85%</td>
+ <td data-value="320" class="abs high">(272&nbsp;/&nbsp;320)</td>
+ <td data-value="94.2" class="pct high">94.2%</td>
+ <td data-value="207" class="abs high">(195&nbsp;/&nbsp;207)</td>
+ <td data-value="94.36" class="pct high">94.36%</td>
+ <td data-value="709" class="abs high">(669&nbsp;/&nbsp;709)</td>
+ </tr>
+
+</tbody>
+</table>
+</div>
+</div>
+<div class="footer">
+ <div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sun May 24 2015 15:04:25 GMT-0700 (PDT)</div>
+</div>
+<script src="prettify.js"></script>
+<script>
+window.onload = function () {
+ if (typeof prettyPrint === 'function') {
+ prettyPrint();
+ }
+};
+</script>
+<script src="sorter.js"></script>
+</body>
+</html>
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lcov-report/lib/async.js.html b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lcov-report/lib/async.js.html
new file mode 100644
index 00000000000..951e4c247c8
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lcov-report/lib/async.js.html
@@ -0,0 +1,3900 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <title>Code coverage report for lib/async.js</title>
+ <meta charset="utf-8">
+ <link rel="stylesheet" href="../prettify.css">
+ <link rel="stylesheet" href="../base.css">
+ <style type='text/css'>
+ div.coverage-summary .sorter {
+ background-image: url(../sort-arrow-sprite.png);
+ }
+ </style>
+</head>
+<body>
+<div class="header high">
+ <h1>Code coverage report for <span class="entity">lib/async.js</span></h1>
+ <h2>
+ Statements: <span class="metric">94.13% <small>(673 / 715)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
+ Branches: <span class="metric">85% <small>(272 / 320)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
+ Functions: <span class="metric">94.2% <small>(195 / 207)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
+ Lines: <span class="metric">94.36% <small>(669 / 709)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
+ Ignored: <span class="metric"><span class="ignore-none">none</span></span> &nbsp;&nbsp;&nbsp;&nbsp;
+ </h2>
+ <div class="path"><a href="../index.html">All files</a> &#187; <a href="index.html">lib/</a> &#187; async.js</div>
+</div>
+<div class="body">
+<pre><table class="coverage">
+<tr><td class="line-count">1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+994
+995
+996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286</td><td class="line-coverage"><span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">162</span>
+<span class="cline-any cline-yes">162</span>
+<span class="cline-any cline-yes">162</span>
+<span class="cline-any cline-yes">158</span>
+<span class="cline-any cline-yes">158</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">249</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">249</span>
+<span class="cline-any cline-yes">402</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">76</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">76</span>
+<span class="cline-any cline-yes">222</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">76</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">54</span>
+<span class="cline-any cline-yes">54</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">54</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">4</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">237</span>
+<span class="cline-any cline-yes">237</span>
+<span class="cline-any cline-yes">237</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">237</span>
+<span class="cline-any cline-yes">148</span>
+<span class="cline-any cline-yes">148</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">237</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">237</span>
+<span class="cline-any cline-yes">360</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">237</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">219</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">37</span>
+<span class="cline-any cline-yes">37</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">34</span>
+<span class="cline-any cline-yes">34</span>
+<span class="cline-any cline-yes">99</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">95</span>
+<span class="cline-any cline-yes">14</span>
+<span class="cline-any cline-yes">14</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">81</span>
+<span class="cline-any cline-yes">81</span>
+<span class="cline-any cline-yes">27</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">35</span>
+<span class="cline-any cline-yes">35</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">33</span>
+<span class="cline-any cline-yes">33</span>
+<span class="cline-any cline-yes">79</span>
+<span class="cline-any cline-yes">76</span>
+<span class="cline-any cline-yes">10</span>
+<span class="cline-any cline-yes">10</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">66</span>
+<span class="cline-any cline-yes">66</span>
+<span class="cline-any cline-yes">20</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">46</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">33</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">27</span>
+<span class="cline-any cline-yes">22</span>
+<span class="cline-any cline-yes">22</span>
+<span class="cline-any cline-yes">5</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">17</span>
+<span class="cline-any cline-yes">17</span>
+<span class="cline-any cline-yes">17</span>
+<span class="cline-any cline-yes">17</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">17</span>
+<span class="cline-any cline-yes">77</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">77</span>
+<span class="cline-any cline-yes">81</span>
+<span class="cline-any cline-yes">81</span>
+<span class="cline-any cline-yes">81</span>
+<span class="cline-any cline-yes">77</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">71</span>
+<span class="cline-any cline-yes">71</span>
+<span class="cline-any cline-yes">71</span>
+<span class="cline-any cline-yes">11</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">60</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">5</span>
+<span class="cline-any cline-yes">5</span>
+<span class="cline-any cline-yes">5</span>
+<span class="cline-any cline-yes">5</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">4</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">5</span>
+<span class="cline-any cline-yes">5</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">5</span>
+<span class="cline-any cline-yes">5</span>
+<span class="cline-any cline-yes">5</span>
+<span class="cline-any cline-yes">5</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">4</span>
+<span class="cline-any cline-yes">4</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">5</span>
+<span class="cline-any cline-yes">5</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">4</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-yes">20</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">20</span>
+<span class="cline-any cline-yes">22</span>
+<span class="cline-any cline-yes">22</span>
+<span class="cline-any cline-yes">22</span>
+<span class="cline-any cline-yes">22</span>
+<span class="cline-any cline-yes">20</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">19</span>
+<span class="cline-any cline-yes">19</span>
+<span class="cline-any cline-yes">19</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">13</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">25</span>
+<span class="cline-any cline-yes">25</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">13</span>
+<span class="cline-any cline-yes">12</span>
+<span class="cline-any cline-yes">12</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">20</span>
+<span class="cline-any cline-yes">20</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">40</span>
+<span class="cline-any cline-yes">142</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">40</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">39</span>
+<span class="cline-any cline-yes">39</span>
+<span class="cline-any cline-yes">99</span>
+<span class="cline-any cline-yes">97</span>
+<span class="cline-any cline-yes">97</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">39</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">13</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">10</span>
+<span class="cline-any cline-yes">24</span>
+<span class="cline-any cline-yes">24</span>
+<span class="cline-any cline-yes">24</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">10</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">5</span>
+<span class="cline-any cline-yes">15</span>
+<span class="cline-any cline-yes">15</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">13</span>
+<span class="cline-any cline-yes">13</span>
+<span class="cline-any cline-yes">13</span>
+<span class="cline-any cline-yes">13</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">12</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">12</span>
+<span class="cline-any cline-yes">12</span>
+<span class="cline-any cline-yes">27</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">12</span>
+<span class="cline-any cline-yes">13</span>
+<span class="cline-any cline-yes">19</span>
+<span class="cline-any cline-yes">13</span>
+<span class="cline-any cline-yes">13</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">12</span>
+<span class="cline-any cline-yes">25</span>
+<span class="cline-any cline-yes">25</span>
+<span class="cline-any cline-yes">47</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">12</span>
+<span class="cline-any cline-yes">25</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">12</span>
+<span class="cline-any cline-yes">34</span>
+<span class="cline-any cline-yes">34</span>
+<span class="cline-any cline-yes">28</span>
+<span class="cline-any cline-yes">28</span>
+<span class="cline-any cline-yes">27</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">28</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">25</span>
+<span class="cline-any cline-yes">25</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">34</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">34</span>
+<span class="cline-any cline-yes">34</span>
+<span class="cline-any cline-yes">34</span>
+<span class="cline-any cline-yes">23</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">22</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">32</span>
+<span class="cline-any cline-yes">54</span>
+<span class="cline-any cline-yes">54</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">32</span>
+<span class="cline-any cline-yes">17</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">15</span>
+<span class="cline-any cline-yes">22</span>
+<span class="cline-any cline-yes">13</span>
+<span class="cline-any cline-yes">13</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">15</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">13</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">13</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">18</span>
+<span class="cline-any cline-yes">19</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">18</span>
+<span class="cline-any cline-yes">18</span>
+<span class="cline-any cline-yes">18</span>
+<span class="cline-any cline-yes">12</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">18</span>
+<span class="cline-any cline-yes">18</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">13</span>
+<span class="cline-any cline-yes">13</span>
+<span class="cline-any cline-yes">11</span>
+<span class="cline-any cline-yes">21</span>
+<span class="cline-any cline-yes">21</span>
+<span class="cline-any cline-yes">21</span>
+<span class="cline-any cline-yes">21</span>
+<span class="cline-any cline-yes">19</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">21</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">4</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">10</span>
+<span class="cline-any cline-yes">10</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-yes">18</span>
+<span class="cline-any cline-yes">18</span>
+<span class="cline-any cline-yes">18</span>
+<span class="cline-any cline-yes">18</span>
+<span class="cline-any cline-yes">17</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">18</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-yes">38</span>
+<span class="cline-any cline-yes">25</span>
+<span class="cline-any cline-yes">24</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">25</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">38</span>
+<span class="cline-any cline-yes">46</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">38</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">5</span>
+<span class="cline-any cline-yes">5</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">5</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">10</span>
+<span class="cline-any cline-yes">10</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">10</span>
+<span class="cline-any cline-yes">10</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">5</span>
+<span class="cline-any cline-yes">5</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">5</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">10</span>
+<span class="cline-any cline-yes">10</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">10</span>
+<span class="cline-any cline-yes">10</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">20</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">17</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">45</span>
+<span class="cline-any cline-yes">17</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">45</span>
+<span class="cline-any cline-yes">39</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">45</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">43</span>
+<span class="cline-any cline-yes">56</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">56</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">48</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">56</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">56</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">19</span>
+<span class="cline-any cline-yes">19</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">37</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">132</span>
+<span class="cline-any cline-yes">63</span>
+<span class="cline-any cline-yes">63</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">63</span>
+<span class="cline-any cline-yes">63</span>
+<span class="cline-any cline-yes">63</span>
+<span class="cline-any cline-yes">63</span>
+<span class="cline-any cline-yes">31</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">63</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">63</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">63</span>
+<span class="cline-any cline-yes">63</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">37</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">4</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">4</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">5</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">19</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">10</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-yes">10</span>
+<span class="cline-any cline-yes">10</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">4</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">5</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">5</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">41</span>
+<span class="cline-any cline-yes">40</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">41</span>
+<span class="cline-any cline-yes">44</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">44</span>
+<span class="cline-any cline-yes">44</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">41</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">62</span>
+<span class="cline-any cline-yes">54</span>
+<span class="cline-any cline-yes">33</span>
+<span class="cline-any cline-yes">33</span>
+<span class="cline-any cline-yes">33</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">21</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">21</span>
+<span class="cline-any cline-yes">44</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">21</span>
+<span class="cline-any cline-yes">21</span>
+<span class="cline-any cline-yes">21</span>
+<span class="cline-any cline-yes">21</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">21</span>
+<span class="cline-any cline-yes">21</span>
+<span class="cline-any cline-yes">44</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">21</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">10</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">5</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">4</span>
+<span class="cline-any cline-yes">4</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-yes">11</span>
+<span class="cline-any cline-yes">11</span>
+<span class="cline-any cline-yes">11</span>
+<span class="cline-any cline-yes">11</span>
+<span class="cline-any cline-yes">4</span>
+<span class="cline-any cline-yes">4</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-yes">4</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-yes">10</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">14</span>
+<span class="cline-any cline-yes">14</span>
+<span class="cline-any cline-yes">14</span>
+<span class="cline-any cline-yes">14</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">51</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">50</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">/*!
+ * async
+ * https://github.com/caolan/async
+ *
+ * Copyright 2010-2014 Caolan McMahon
+ * Released under the MIT license
+ */
+(function () {
+&nbsp;
+ var async = {};
+ var noop = function () {};
+&nbsp;
+ // global on the server, window in the browser
+ var root, previous_async;
+&nbsp;
+ <span class="missing-if-branch" title="if path not taken" >I</span>if (typeof window == 'object' &amp;&amp; <span class="branch-1 cbranch-no" title="branch not covered" >this === window)</span> {
+<span class="cstat-no" title="statement not covered" > root = window;</span>
+ }
+ else <span class="missing-if-branch" title="else path not taken" >E</span>if (typeof global == 'object' &amp;&amp; this === global) {
+ root = global;
+ }
+ else {
+<span class="cstat-no" title="statement not covered" > root = this;</span>
+ }
+&nbsp;
+ <span class="missing-if-branch" title="else path not taken" >E</span>if (root != null) {
+ previous_async = root.async;
+ }
+&nbsp;
+ async.noConflict = <span class="fstat-no" title="function not covered" >function () {</span>
+<span class="cstat-no" title="statement not covered" > root.async = previous_async;</span>
+<span class="cstat-no" title="statement not covered" > return async;</span>
+ };
+&nbsp;
+ function only_once(fn) {
+ var called = false;
+ return function() {
+ if (called) throw new Error("Callback was already called.");
+ called = true;
+ fn.apply(root, arguments);
+ };
+ }
+&nbsp;
+ //// cross-browser compatiblity functions ////
+&nbsp;
+ var _toString = Object.prototype.toString;
+&nbsp;
+ var _isArray = Array.isArray || <span class="fstat-no" title="function not covered" ><span class="branch-1 cbranch-no" title="branch not covered" >function (obj) {</span></span>
+<span class="cstat-no" title="statement not covered" > return _toString.call(obj) === '[object Array]';</span>
+ };
+&nbsp;
+ var _each = function (arr, iterator) {
+ var index = -1,
+ length = arr.length;
+&nbsp;
+ while (++index &lt; length) {
+ iterator(arr[index], index, arr);
+ }
+ };
+&nbsp;
+ var _map = function (arr, iterator) {
+ var index = -1,
+ length = arr.length,
+ result = Array(length);
+&nbsp;
+ while (++index &lt; length) {
+ result[index] = iterator(arr[index], index, arr);
+ }
+ return result;
+ };
+&nbsp;
+ var _reduce = function (arr, iterator, memo) {
+ _each(arr, function (x, i, a) {
+ memo = iterator(memo, x, i, a);
+ });
+ return memo;
+ };
+&nbsp;
+ var _forEachOf = function (object, iterator) {
+ _each(_keys(object), function (key) {
+ iterator(object[key], key);
+ });
+ };
+&nbsp;
+ var _keys = Object.keys || <span class="fstat-no" title="function not covered" ><span class="branch-1 cbranch-no" title="branch not covered" >function (obj) {</span></span>
+<span class="cstat-no" title="statement not covered" > var keys = [];</span>
+<span class="cstat-no" title="statement not covered" > for (var k in obj) {</span>
+<span class="cstat-no" title="statement not covered" > if (obj.hasOwnProperty(k)) {</span>
+<span class="cstat-no" title="statement not covered" > keys.push(k);</span>
+ }
+ }
+<span class="cstat-no" title="statement not covered" > return keys;</span>
+ };
+&nbsp;
+ var _baseSlice = function (arr, start) {
+ start = start || 0;
+ var index = -1;
+ var length = arr.length;
+&nbsp;
+ if (start) {
+ length -= start;
+ length = length &lt; 0 ? 0 : length;
+ }
+ var result = Array(length);
+&nbsp;
+ while (++index &lt; length) {
+ result[index] = arr[index + start];
+ }
+ return result;
+ };
+&nbsp;
+ //// exported async module functions ////
+&nbsp;
+ //// nextTick implementation with browser-compatible fallback ////
+&nbsp;
+ // capture the global reference to guard against fakeTimer mocks
+ var _setImmediate;
+ <span class="missing-if-branch" title="else path not taken" >E</span>if (typeof setImmediate === 'function') {
+ _setImmediate = setImmediate;
+ }
+&nbsp;
+ <span class="missing-if-branch" title="if path not taken" >I</span>if (typeof process === 'undefined' || !(process.nextTick)) {
+<span class="cstat-no" title="statement not covered" > if (_setImmediate) {</span>
+<span class="cstat-no" title="statement not covered" > async.nextTick = <span class="fstat-no" title="function not covered" >function (fn) {</span></span>
+ // not a direct alias for IE10 compatibility
+<span class="cstat-no" title="statement not covered" > _setImmediate(fn);</span>
+ };
+<span class="cstat-no" title="statement not covered" > async.setImmediate = async.nextTick;</span>
+ }
+ else {
+<span class="cstat-no" title="statement not covered" > async.nextTick = <span class="fstat-no" title="function not covered" >function (fn) {</span></span>
+<span class="cstat-no" title="statement not covered" > setTimeout(fn, 0);</span>
+ };
+<span class="cstat-no" title="statement not covered" > async.setImmediate = async.nextTick;</span>
+ }
+ }
+ else {
+ async.nextTick = process.nextTick;
+ <span class="missing-if-branch" title="else path not taken" >E</span>if (_setImmediate) {
+ async.setImmediate = function (fn) {
+ // not a direct alias for IE10 compatibility
+ _setImmediate(fn);
+ };
+ }
+ else {
+<span class="cstat-no" title="statement not covered" > async.setImmediate = async.nextTick;</span>
+ }
+ }
+&nbsp;
+ async.each = function (arr, iterator, callback) {
+ callback = callback || noop;
+ if (!arr.length) {
+ return callback(null);
+ }
+ var completed = 0;
+ _each(arr, function (x) {
+ iterator(x, only_once(done) );
+ });
+ function done(err) {
+ if (err) {
+ callback(err);
+ callback = noop;
+ }
+ else {
+ completed += 1;
+ if (completed &gt;= arr.length) {
+ callback(null);
+ }
+ }
+ }
+ };
+ async.forEach = async.each;
+&nbsp;
+ async.eachSeries = function (arr, iterator, callback) {
+ callback = callback || noop;
+ if (!arr.length) {
+ return callback(null);
+ }
+ var completed = 0;
+ var iterate = function () {
+ iterator(arr[completed], function (err) {
+ if (err) {
+ callback(err);
+ callback = noop;
+ }
+ else {
+ completed += 1;
+ if (completed &gt;= arr.length) {
+ callback(null);
+ }
+ else {
+ iterate();
+ }
+ }
+ });
+ };
+ iterate();
+ };
+ async.forEachSeries = async.eachSeries;
+&nbsp;
+&nbsp;
+ async.eachLimit = function (arr, limit, iterator, callback) {
+ var fn = _eachLimit(limit);
+ fn.apply(null, [arr, iterator, callback]);
+ };
+ async.forEachLimit = async.eachLimit;
+&nbsp;
+ var _eachLimit = function (limit) {
+&nbsp;
+ return function (arr, iterator, callback) {
+ callback = callback || noop;
+ if (!arr.length || limit &lt;= 0) {
+ return callback(null);
+ }
+ var completed = 0;
+ var started = 0;
+ var running = 0;
+ var errored = false;
+&nbsp;
+ (function replenish () {
+ <span class="missing-if-branch" title="if path not taken" >I</span>if (completed &gt;= arr.length) {
+<span class="cstat-no" title="statement not covered" > return callback(null);</span>
+ }
+&nbsp;
+ while (running &lt; limit &amp;&amp; started &lt; arr.length &amp;&amp; !errored) {
+ started += 1;
+ running += 1;
+ iterator(arr[started - 1], function (err) {
+ if (err) {
+ callback(err);
+ errored = true;
+ callback = noop;
+ }
+ else {
+ completed += 1;
+ running -= 1;
+ if (completed &gt;= arr.length) {
+ callback(null);
+ }
+ else {
+ replenish();
+ }
+ }
+ });
+ }
+ })();
+ };
+ };
+&nbsp;
+&nbsp;
+&nbsp;
+ async.forEachOf = async.eachOf = function (object, iterator, callback) {
+ callback = callback || function () {};
+ var size = object.length || _keys(object).length;
+ var completed = 0;
+ if (!size) {
+ return callback(null);
+ }
+ _forEachOf(object, function (value, key) {
+ iterator(object[key], key, function (err) {
+ if (err) {
+ callback(err);
+ callback = function () {};
+ } else {
+ completed += 1;
+ if (completed === size) {
+ callback(null);
+ }
+ }
+ });
+ });
+ };
+&nbsp;
+ async.forEachOfSeries = async.eachOfSeries = function (obj, iterator, callback) {
+ callback = callback || function () {};
+ var keys = _keys(obj);
+ var size = keys.length;
+ if (!size) {
+ return callback();
+ }
+ var completed = 0;
+ var iterate = function () {
+ var sync = true;
+ var key = keys[completed];
+ iterator(obj[key], key, function (err) {
+ if (err) {
+ callback(err);
+ callback = <span class="fstat-no" title="function not covered" >function () {</span>};
+ }
+ else {
+ completed += 1;
+ if (completed &gt;= size) {
+ callback(null);
+ }
+ else {
+ <span class="missing-if-branch" title="if path not taken" >I</span>if (sync) {
+<span class="cstat-no" title="statement not covered" > async.nextTick(iterate);</span>
+ }
+ else {
+ iterate();
+ }
+ }
+ }
+ });
+ sync = false;
+ };
+ iterate();
+ };
+&nbsp;
+&nbsp;
+&nbsp;
+ async.forEachOfLimit = async.eachOfLimit = function (obj, limit, iterator, callback) {
+ _forEachOfLimit(limit)(obj, iterator, callback);
+ };
+&nbsp;
+ var _forEachOfLimit = function (limit) {
+&nbsp;
+ return function (obj, iterator, callback) {
+ callback = callback || function () {};
+ var keys = _keys(obj);
+ var size = keys.length;
+ if (!size || limit &lt;= 0) {
+ return callback(null);
+ }
+ var completed = 0;
+ var started = 0;
+ var running = 0;
+&nbsp;
+ (function replenish () {
+ <span class="missing-if-branch" title="if path not taken" >I</span>if (completed &gt;= size) {
+<span class="cstat-no" title="statement not covered" > return callback();</span>
+ }
+&nbsp;
+ while (running &lt; limit &amp;&amp; started &lt; size) {
+ started += 1;
+ running += 1;
+ var key = keys[started - 1];
+ iterator(obj[key], key, function (err) {
+ if (err) {
+ callback(err);
+ callback = <span class="fstat-no" title="function not covered" >function () {</span>};
+ }
+ else {
+ completed += 1;
+ running -= 1;
+ if (completed &gt;= size) {
+ callback(null);
+ }
+ else {
+ replenish();
+ }
+ }
+ });
+ }
+ })();
+ };
+ };
+&nbsp;
+&nbsp;
+ var doParallel = function (fn) {
+ return function () {
+ var args = _baseSlice(arguments);
+ return fn.apply(null, [async.each].concat(args));
+ };
+ };
+ var doParallelLimit = function(limit, fn) {
+ return function () {
+ var args = _baseSlice(arguments);
+ return fn.apply(null, [_eachLimit(limit)].concat(args));
+ };
+ };
+ var doSeries = function (fn) {
+ return function () {
+ var args = _baseSlice(arguments);
+ return fn.apply(null, [async.eachSeries].concat(args));
+ };
+ };
+&nbsp;
+&nbsp;
+ var _asyncMap = function (eachfn, arr, iterator, callback) {
+ arr = _map(arr, function (x, i) {
+ return {index: i, value: x};
+ });
+ if (!callback) {
+ eachfn(arr, function (x, callback) {
+ iterator(x.value, function (err) {
+ callback(err);
+ });
+ });
+ } else {
+ var results = [];
+ eachfn(arr, function (x, callback) {
+ iterator(x.value, function (err, v) {
+ results[x.index] = v;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, results);
+ });
+ }
+ };
+ async.map = doParallel(_asyncMap);
+ async.mapSeries = doSeries(_asyncMap);
+ async.mapLimit = function (arr, limit, iterator, callback) {
+ return _mapLimit(limit)(arr, iterator, callback);
+ };
+&nbsp;
+ var _mapLimit = function(limit) {
+ return doParallelLimit(limit, _asyncMap);
+ };
+&nbsp;
+ // reduce only has a series version, as doing reduce in parallel won't
+ // work in many situations.
+ async.reduce = function (arr, memo, iterator, callback) {
+ async.eachSeries(arr, function (x, callback) {
+ iterator(memo, x, function (err, v) {
+ memo = v;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err || null, memo);
+ });
+ };
+ // inject alias
+ async.inject = async.reduce;
+ // foldl alias
+ async.foldl = async.reduce;
+&nbsp;
+ async.reduceRight = function (arr, memo, iterator, callback) {
+ var reversed = _map(arr, function (x) {
+ return x;
+ }).reverse();
+ async.reduce(reversed, memo, iterator, callback);
+ };
+ // foldr alias
+ async.foldr = async.reduceRight;
+&nbsp;
+ var _filter = function (eachfn, arr, iterator, callback) {
+ var results = [];
+ arr = _map(arr, function (x, i) {
+ return {index: i, value: x};
+ });
+ eachfn(arr, function (x, callback) {
+ iterator(x.value, function (v) {
+ if (v) {
+ results.push(x);
+ }
+ callback();
+ });
+ }, function (err) {
+ callback(_map(results.sort(function (a, b) {
+ return a.index - b.index;
+ }), function (x) {
+ return x.value;
+ }));
+ });
+ };
+ async.filter = doParallel(_filter);
+ async.filterSeries = doSeries(_filter);
+ // select alias
+ async.select = async.filter;
+ async.selectSeries = async.filterSeries;
+&nbsp;
+ var _reject = function (eachfn, arr, iterator, callback) {
+ var results = [];
+ arr = _map(arr, function (x, i) {
+ return {index: i, value: x};
+ });
+ eachfn(arr, function (x, callback) {
+ iterator(x.value, function (v) {
+ if (!v) {
+ results.push(x);
+ }
+ callback();
+ });
+ }, function (err) {
+ callback(_map(results.sort(<span class="fstat-no" title="function not covered" >function (a, b) {</span>
+<span class="cstat-no" title="statement not covered" > return a.index - b.index;</span>
+ }), function (x) {
+ return x.value;
+ }));
+ });
+ };
+ async.reject = doParallel(_reject);
+ async.rejectSeries = doSeries(_reject);
+&nbsp;
+ var _detect = function (eachfn, arr, iterator, main_callback) {
+ eachfn(arr, function (x, callback) {
+ iterator(x, function (result) {
+ if (result) {
+ main_callback(x);
+ main_callback = noop;
+ }
+ else {
+ callback();
+ }
+ });
+ }, <span class="fstat-no" title="function not covered" >function (err) {</span>
+<span class="cstat-no" title="statement not covered" > main_callback();</span>
+ });
+ };
+ async.detect = doParallel(_detect);
+ async.detectSeries = doSeries(_detect);
+&nbsp;
+ async.some = function (arr, iterator, main_callback) {
+ async.each(arr, function (x, callback) {
+ iterator(x, function (v) {
+ if (v) {
+ main_callback(true);
+ main_callback = noop;
+ }
+ callback();
+ });
+ }, function (err) {
+ main_callback(false);
+ });
+ };
+ // any alias
+ async.any = async.some;
+&nbsp;
+ async.every = function (arr, iterator, main_callback) {
+ async.each(arr, function (x, callback) {
+ iterator(x, function (v) {
+ if (!v) {
+ main_callback(false);
+ main_callback = noop;
+ }
+ callback();
+ });
+ }, function (err) {
+ main_callback(true);
+ });
+ };
+ // all alias
+ async.all = async.every;
+&nbsp;
+ async.sortBy = function (arr, iterator, callback) {
+ async.map(arr, function (x, callback) {
+ iterator(x, function (err, criteria) {
+ <span class="missing-if-branch" title="if path not taken" >I</span>if (err) {
+<span class="cstat-no" title="statement not covered" > callback(err);</span>
+ }
+ else {
+ callback(null, {value: x, criteria: criteria});
+ }
+ });
+ }, function (err, results) {
+ <span class="missing-if-branch" title="if path not taken" >I</span>if (err) {
+<span class="cstat-no" title="statement not covered" > return callback(err);</span>
+ }
+ else {
+ var fn = function (left, right) {
+ var a = left.criteria, b = right.criteria;
+ return a &lt; b ? -1 : a &gt; b ? 1 : <span class="branch-1 cbranch-no" title="branch not covered" >0;</span>
+ };
+ callback(null, _map(results.sort(fn), function (x) {
+ return x.value;
+ }));
+ }
+ });
+ };
+&nbsp;
+ async.auto = function (tasks, callback) {
+ callback = callback || noop;
+ var keys = _keys(tasks);
+ var remainingTasks = keys.length;
+ if (!remainingTasks) {
+ return callback(null);
+ }
+&nbsp;
+ var results = {};
+&nbsp;
+ var listeners = [];
+ var addListener = function (fn) {
+ listeners.unshift(fn);
+ };
+ var removeListener = function (fn) {
+ for (var i = 0; i &lt; listeners.length; i += 1) {
+ if (listeners[i] === fn) {
+ listeners.splice(i, 1);
+ return;
+ }
+ }
+ };
+ var taskComplete = function () {
+ remainingTasks--;
+ _each(listeners.slice(0), function (fn) {
+ fn();
+ });
+ };
+&nbsp;
+ addListener(function () {
+ if (!remainingTasks) {
+ var theCallback = callback;
+ // prevent final callback from calling itself if it errors
+ callback = noop;
+&nbsp;
+ theCallback(null, results);
+ }
+ });
+&nbsp;
+ _each(keys, function (k) {
+ var task = _isArray(tasks[k]) ? tasks[k]: [tasks[k]];
+ var taskCallback = function (err) {
+ var args = _baseSlice(arguments, 1);
+ if (args.length &lt;= 1) {
+ args = args[0];
+ }
+ if (err) {
+ var safeResults = {};
+ _each(_keys(results), function(rkey) {
+ safeResults[rkey] = results[rkey];
+ });
+ safeResults[k] = args;
+ callback(err, safeResults);
+ // stop subsequent errors hitting callback multiple times
+ callback = noop;
+ }
+ else {
+ results[k] = args;
+ async.setImmediate(taskComplete);
+ }
+ };
+ var requires = task.slice(0, Math.abs(task.length - 1)) || <span class="branch-1 cbranch-no" title="branch not covered" >[];</span>
+ // prevent dead-locks
+ var len = requires.length;
+ var dep;
+ while (len--) {
+ if (!(dep = tasks[requires[len]])) {
+ throw new Error('Has inexistant dependency');
+ }
+ if (_isArray(dep) &amp;&amp; !!~dep.indexOf(k)) {
+ throw new Error('Has cyclic dependencies');
+ }
+ }
+ var ready = function () {
+ return _reduce(requires, function (a, x) {
+ return (a &amp;&amp; results.hasOwnProperty(x));
+ }, true) &amp;&amp; !results.hasOwnProperty(k);
+ };
+ if (ready()) {
+ task[task.length - 1](taskCallback, results);
+ }
+ else {
+ var listener = function () {
+ if (ready()) {
+ removeListener(listener);
+ task[task.length - 1](taskCallback, results);
+ }
+ };
+ addListener(listener);
+ }
+ });
+ };
+&nbsp;
+ async.retry = function(times, task, callback) {
+ var DEFAULT_TIMES = 5;
+ var attempts = [];
+ // Use defaults if times not passed
+ if (typeof times === 'function') {
+ callback = task;
+ task = times;
+ times = DEFAULT_TIMES;
+ }
+ // Make sure times is a number
+ times = parseInt(times, 10) || <span class="branch-1 cbranch-no" title="branch not covered" >DEFAULT_TIMES;</span>
+ var wrappedTask = function(wrappedCallback, wrappedResults) {
+ var retryAttempt = function(task, finalAttempt) {
+ return function(seriesCallback) {
+ task(function(err, result){
+ seriesCallback(!err || finalAttempt, {err: err, result: result});
+ }, wrappedResults);
+ };
+ };
+ while (times) {
+ attempts.push(retryAttempt(task, !(times-=1)));
+ }
+ async.series(attempts, function(done, data){
+ data = data[data.length - 1];
+ (wrappedCallback || callback)(data.err, data.result);
+ });
+ };
+ // If a callback is passed, run this as a controll flow
+ return callback ? wrappedTask() : wrappedTask;
+ };
+&nbsp;
+ async.waterfall = function (tasks, callback) {
+ callback = callback || noop;
+ if (!_isArray(tasks)) {
+ var err = new Error('First argument to waterfall must be an array of functions');
+ return callback(err);
+ }
+ if (!tasks.length) {
+ return callback();
+ }
+ var wrapIterator = function (iterator) {
+ return function (err) {
+ if (err) {
+ callback.apply(null, arguments);
+ callback = noop;
+ }
+ else {
+ var args = _baseSlice(arguments, 1);
+ var next = iterator.next();
+ if (next) {
+ args.push(wrapIterator(next));
+ }
+ else {
+ args.push(callback);
+ }
+ async.setImmediate(function () {
+ iterator.apply(null, args);
+ });
+ }
+ };
+ };
+ wrapIterator(async.iterator(tasks))();
+ };
+&nbsp;
+ var _parallel = function(eachfn, tasks, callback) {
+ callback = callback || noop;
+ if (_isArray(tasks)) {
+ eachfn.map(tasks, function (fn, callback) {
+ <span class="missing-if-branch" title="else path not taken" >E</span>if (fn) {
+ fn(function (err) {
+ var args = _baseSlice(arguments, 1);
+ if (args.length &lt;= 1) {
+ args = args[0];
+ }
+ callback.call(null, err, args);
+ });
+ }
+ }, callback);
+ }
+ else {
+ var results = {};
+ eachfn.each(_keys(tasks), function (k, callback) {
+ tasks[k](function (err) {
+ var args = _baseSlice(arguments, 1);
+ if (args.length &lt;= 1) {
+ args = args[0];
+ }
+ results[k] = args;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, results);
+ });
+ }
+ };
+&nbsp;
+ async.parallel = function (tasks, callback) {
+ _parallel({ map: async.map, each: async.each }, tasks, callback);
+ };
+&nbsp;
+ async.parallelLimit = function(tasks, limit, callback) {
+ _parallel({ map: _mapLimit(limit), each: _eachLimit(limit) }, tasks, callback);
+ };
+&nbsp;
+ async.series = function (tasks, callback) {
+ callback = callback || noop;
+ if (_isArray(tasks)) {
+ async.mapSeries(tasks, function (fn, callback) {
+ <span class="missing-if-branch" title="else path not taken" >E</span>if (fn) {
+ fn(function (err) {
+ var args = _baseSlice(arguments, 1);
+ if (args.length &lt;= 1) {
+ args = args[0];
+ }
+ callback.call(null, err, args);
+ });
+ }
+ }, callback);
+ }
+ else {
+ var results = {};
+ async.eachSeries(_keys(tasks), function (k, callback) {
+ tasks[k](function (err) {
+ var args = _baseSlice(arguments, 1);
+ if (args.length &lt;= 1) {
+ args = args[0];
+ }
+ results[k] = args;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, results);
+ });
+ }
+ };
+&nbsp;
+ async.iterator = function (tasks) {
+ var makeCallback = function (index) {
+ var fn = function () {
+ if (tasks.length) {
+ tasks[index].apply(null, arguments);
+ }
+ return fn.next();
+ };
+ fn.next = function () {
+ return (index &lt; tasks.length - 1) ? makeCallback(index + 1): null;
+ };
+ return fn;
+ };
+ return makeCallback(0);
+ };
+&nbsp;
+ async.apply = function (fn) {
+ var args = _baseSlice(arguments, 1);
+ return function () {
+ return fn.apply(
+ null, args.concat(_baseSlice(arguments))
+ );
+ };
+ };
+&nbsp;
+ var _concat = function (eachfn, arr, fn, callback) {
+ var r = [];
+ eachfn(arr, function (x, cb) {
+ fn(x, function (err, y) {
+ r = r.concat(y || []);
+ cb(err);
+ });
+ }, function (err) {
+ callback(err, r);
+ });
+ };
+ async.concat = doParallel(_concat);
+ async.concatSeries = doSeries(_concat);
+&nbsp;
+ async.whilst = function (test, iterator, callback) {
+ if (test()) {
+ iterator(function (err) {
+ <span class="missing-if-branch" title="if path not taken" >I</span>if (err) {
+<span class="cstat-no" title="statement not covered" > return callback(err);</span>
+ }
+ async.whilst(test, iterator, callback);
+ });
+ }
+ else {
+ callback(null);
+ }
+ };
+&nbsp;
+ async.doWhilst = function (iterator, test, callback) {
+ iterator(function (err) {
+ <span class="missing-if-branch" title="if path not taken" >I</span>if (err) {
+<span class="cstat-no" title="statement not covered" > return callback(err);</span>
+ }
+ var args = _baseSlice(arguments, 1);
+ if (test.apply(null, args)) {
+ async.doWhilst(iterator, test, callback);
+ }
+ else {
+ callback(null);
+ }
+ });
+ };
+&nbsp;
+ async.until = function (test, iterator, callback) {
+ if (!test()) {
+ iterator(function (err) {
+ <span class="missing-if-branch" title="if path not taken" >I</span>if (err) {
+<span class="cstat-no" title="statement not covered" > return callback(err);</span>
+ }
+ async.until(test, iterator, callback);
+ });
+ }
+ else {
+ callback(null);
+ }
+ };
+&nbsp;
+ async.doUntil = function (iterator, test, callback) {
+ iterator(function (err) {
+ <span class="missing-if-branch" title="if path not taken" >I</span>if (err) {
+<span class="cstat-no" title="statement not covered" > return callback(err);</span>
+ }
+ var args = _baseSlice(arguments, 1);
+ if (!test.apply(null, args)) {
+ async.doUntil(iterator, test, callback);
+ }
+ else {
+ callback(null);
+ }
+ });
+ };
+&nbsp;
+ async.queue = function (worker, concurrency) {
+ if (concurrency === undefined) {
+ concurrency = 1;
+ }
+ else if(concurrency === 0) {
+ throw new Error('Concurrency must not be zero');
+ }
+ function _insert(q, data, pos, callback) {
+ if (!q.started){
+ q.started = true;
+ }
+ if (!_isArray(data)) {
+ data = [data];
+ }
+ if(data.length === 0) {
+ // call drain immediately if there are no tasks
+ return async.setImmediate(function() {
+ if (q.drain) {
+ q.drain();
+ }
+ });
+ }
+ _each(data, function(task) {
+ var item = {
+ data: task,
+ callback: typeof callback === 'function' ? callback : null
+ };
+&nbsp;
+ if (pos) {
+ q.tasks.unshift(item);
+ } else {
+ q.tasks.push(item);
+ }
+&nbsp;
+ if (q.saturated &amp;&amp; q.tasks.length === q.concurrency) {
+ q.saturated();
+ }
+ async.setImmediate(q.process);
+ });
+ }
+&nbsp;
+ var workers = 0;
+ var q = {
+ tasks: [],
+ concurrency: concurrency,
+ saturated: null,
+ empty: null,
+ drain: null,
+ started: false,
+ paused: false,
+ push: function (data, callback) {
+ _insert(q, data, false, callback);
+ },
+ kill: function () {
+ q.drain = null;
+ q.tasks = [];
+ },
+ unshift: function (data, callback) {
+ _insert(q, data, true, callback);
+ },
+ process: function () {
+ if (!q.paused &amp;&amp; workers &lt; q.concurrency &amp;&amp; q.tasks.length) {
+ var task = q.tasks.shift();
+ if (q.empty &amp;&amp; q.tasks.length === 0) {
+ q.empty();
+ }
+ workers += 1;
+ var next = function () {
+ workers -= 1;
+ if (task.callback) {
+ task.callback.apply(task, arguments);
+ }
+ if (q.drain &amp;&amp; q.tasks.length + workers === 0) {
+ q.drain();
+ }
+ q.process();
+ };
+ var cb = only_once(next);
+ worker(task.data, cb);
+ }
+ },
+ length: function () {
+ return q.tasks.length;
+ },
+ running: function () {
+ return workers;
+ },
+ idle: function() {
+ return q.tasks.length + workers === 0;
+ },
+ pause: function () {
+ <span class="missing-if-branch" title="if path not taken" >I</span>if (q.paused === true) { <span class="cstat-no" title="statement not covered" >return; </span>}
+ q.paused = true;
+ },
+ resume: function () {
+ if (q.paused === false) { return; }
+ q.paused = false;
+ var resumeCount = Math.min(q.concurrency, q.tasks.length);
+ // Need to call q.process once per concurrent
+ // worker to preserve full concurrency after pause
+ for (var w = 1; w &lt;= resumeCount; w++) {
+ async.setImmediate(q.process);
+ }
+ }
+ };
+ return q;
+ };
+&nbsp;
+ async.priorityQueue = function (worker, concurrency) {
+&nbsp;
+ function _compareTasks(a, b){
+ return a.priority - b.priority;
+ }
+&nbsp;
+ function _binarySearch(sequence, item, compare) {
+ var beg = -1,
+ end = sequence.length - 1;
+ while (beg &lt; end) {
+ var mid = beg + ((end - beg + 1) &gt;&gt;&gt; 1);
+ if (compare(item, sequence[mid]) &gt;= 0) {
+ beg = mid;
+ } else {
+ end = mid - 1;
+ }
+ }
+ return beg;
+ }
+&nbsp;
+ function _insert(q, data, priority, callback) {
+ if (!q.started){
+ q.started = true;
+ }
+ <span class="missing-if-branch" title="else path not taken" >E</span>if (!_isArray(data)) {
+ data = [data];
+ }
+ <span class="missing-if-branch" title="if path not taken" >I</span>if(data.length === 0) {
+ // call drain immediately if there are no tasks
+<span class="cstat-no" title="statement not covered" > return async.setImmediate(<span class="fstat-no" title="function not covered" >function() {</span></span>
+<span class="cstat-no" title="statement not covered" > if (q.drain) {</span>
+<span class="cstat-no" title="statement not covered" > q.drain();</span>
+ }
+ });
+ }
+ _each(data, function(task) {
+ var item = {
+ data: task,
+ priority: priority,
+ callback: typeof callback === 'function' ? callback : <span class="branch-1 cbranch-no" title="branch not covered" >null</span>
+ };
+&nbsp;
+ q.tasks.splice(_binarySearch(q.tasks, item, _compareTasks) + 1, 0, item);
+&nbsp;
+ <span class="missing-if-branch" title="if path not taken" >I</span>if (q.saturated &amp;&amp; <span class="branch-1 cbranch-no" title="branch not covered" >q.tasks.length === q.concurrency)</span> {
+<span class="cstat-no" title="statement not covered" > q.saturated();</span>
+ }
+ async.setImmediate(q.process);
+ });
+ }
+&nbsp;
+ // Start with a normal queue
+ var q = async.queue(worker, concurrency);
+&nbsp;
+ // Override push to accept second parameter representing priority
+ q.push = function (data, priority, callback) {
+ _insert(q, data, priority, callback);
+ };
+&nbsp;
+ // Remove unshift function
+ delete q.unshift;
+&nbsp;
+ return q;
+ };
+&nbsp;
+ async.cargo = function (worker, payload) {
+ var working = false,
+ tasks = [];
+&nbsp;
+ var cargo = {
+ tasks: tasks,
+ payload: payload,
+ saturated: null,
+ empty: null,
+ drain: null,
+ drained: true,
+ push: function (data, callback) {
+ if (!_isArray(data)) {
+ data = [data];
+ }
+ _each(data, function(task) {
+ tasks.push({
+ data: task,
+ callback: typeof callback === 'function' ? callback : null
+ });
+ cargo.drained = false;
+ <span class="missing-if-branch" title="if path not taken" >I</span>if (cargo.saturated &amp;&amp; <span class="branch-1 cbranch-no" title="branch not covered" >tasks.length === payload)</span> {
+<span class="cstat-no" title="statement not covered" > cargo.saturated();</span>
+ }
+ });
+ async.setImmediate(cargo.process);
+ },
+ process: function process() {
+ if (working) return;
+ if (tasks.length === 0) {
+ if(cargo.drain &amp;&amp; !cargo.drained) cargo.drain();
+ cargo.drained = true;
+ return;
+ }
+&nbsp;
+ var ts = typeof payload === 'number' ?
+ tasks.splice(0, payload) :
+<span class="branch-1 cbranch-no" title="branch not covered" > tasks.splice(0, tasks.length);</span>
+&nbsp;
+ var ds = _map(ts, function (task) {
+ return task.data;
+ });
+&nbsp;
+ <span class="missing-if-branch" title="if path not taken" >I</span>if(cargo.empty) <span class="cstat-no" title="statement not covered" >cargo.empty();</span>
+ working = true;
+ worker(ds, function () {
+ working = false;
+&nbsp;
+ var args = arguments;
+ _each(ts, function (data) {
+ if (data.callback) {
+ data.callback.apply(null, args);
+ }
+ });
+&nbsp;
+ process();
+ });
+ },
+ length: function () {
+ return tasks.length;
+ },
+ running: <span class="fstat-no" title="function not covered" >function () {</span>
+<span class="cstat-no" title="statement not covered" > return working;</span>
+ }
+ };
+ return cargo;
+ };
+&nbsp;
+ var _console_fn = function (name) {
+ return function (fn) {
+ var args = _baseSlice(arguments, 1);
+ fn.apply(null, args.concat([function (err) {
+ var args = _baseSlice(arguments, 1);
+ <span class="missing-if-branch" title="else path not taken" >E</span>if (typeof console !== 'undefined') {
+ if (err) {
+ <span class="missing-if-branch" title="else path not taken" >E</span>if (console.error) {
+ console.error(err);
+ }
+ }
+ else <span class="missing-if-branch" title="else path not taken" >E</span>if (console[name]) {
+ _each(args, function (x) {
+ console[name](x);
+ });
+ }
+ }
+ }]));
+ };
+ };
+ async.log = _console_fn('log');
+ async.dir = _console_fn('dir');
+ /*async.info = _console_fn('info');
+ async.warn = _console_fn('warn');
+ async.error = _console_fn('error');*/
+&nbsp;
+ async.memoize = function (fn, hasher) {
+ var memo = {};
+ var queues = {};
+ hasher = hasher || function (x) {
+ return x;
+ };
+ var memoized = function () {
+ var args = _baseSlice(arguments);
+ var callback = args.pop();
+ var key = hasher.apply(null, args);
+ if (key in memo) {
+ async.nextTick(function () {
+ callback.apply(null, memo[key]);
+ });
+ }
+ else if (key in queues) {
+ queues[key].push(callback);
+ }
+ else {
+ queues[key] = [callback];
+ fn.apply(null, args.concat([function () {
+ memo[key] = _baseSlice(arguments);
+ var q = queues[key];
+ delete queues[key];
+ for (var i = 0, l = q.length; i &lt; l; i++) {
+ q[i].apply(null, arguments);
+ }
+ }]));
+ }
+ };
+ memoized.memo = memo;
+ memoized.unmemoized = fn;
+ return memoized;
+ };
+&nbsp;
+ async.unmemoize = function (fn) {
+ return function () {
+ return (fn.unmemoized || fn).apply(null, arguments);
+ };
+ };
+&nbsp;
+ async.times = function (count, iterator, callback) {
+ var counter = [];
+ for (var i = 0; i &lt; count; i++) {
+ counter.push(i);
+ }
+ return async.map(counter, iterator, callback);
+ };
+&nbsp;
+ async.timesSeries = function (count, iterator, callback) {
+ var counter = [];
+ for (var i = 0; i &lt; count; i++) {
+ counter.push(i);
+ }
+ return async.mapSeries(counter, iterator, callback);
+ };
+&nbsp;
+ async.seq = function (/* functions... */) {
+ var fns = arguments;
+ return function () {
+ var that = this;
+ var args = _baseSlice(arguments);
+ var callback = args.pop();
+ async.reduce(fns, args, function (newargs, fn, cb) {
+ fn.apply(that, newargs.concat([function () {
+ var err = arguments[0];
+ var nextargs = _baseSlice(arguments, 1);
+ cb(err, nextargs);
+ }]));
+ },
+ function (err, results) {
+ callback.apply(that, [err].concat(results));
+ });
+ };
+ };
+&nbsp;
+ async.compose = function (/* functions... */) {
+ return async.seq.apply(null, Array.prototype.reverse.call(arguments));
+ };
+&nbsp;
+ var _applyEach = function (eachfn, fns /*args...*/) {
+ var go = function () {
+ var that = this;
+ var args = _baseSlice(arguments);
+ var callback = args.pop();
+ return eachfn(fns, function (fn, cb) {
+ fn.apply(that, args.concat([cb]));
+ },
+ callback);
+ };
+ if (arguments.length &gt; 2) {
+ var args = _baseSlice(arguments, 2);
+ return go.apply(this, args);
+ }
+ else {
+ return go;
+ }
+ };
+ async.applyEach = doParallel(_applyEach);
+ async.applyEachSeries = doSeries(_applyEach);
+&nbsp;
+ async.forever = function (fn, callback) {
+ function next(err) {
+ if (err) {
+ <span class="missing-if-branch" title="else path not taken" >E</span>if (callback) {
+ return callback(err);
+ }
+<span class="cstat-no" title="statement not covered" > throw err;</span>
+ }
+ fn(next);
+ }
+ next();
+ };
+&nbsp;
+ // Node.js
+ <span class="missing-if-branch" title="else path not taken" >E</span>if (typeof module !== 'undefined' &amp;&amp; module.exports) {
+ module.exports = async;
+ }
+ // AMD / RequireJS
+ else <span class="cstat-no" title="statement not covered" >if (typeof define !== 'undefined' &amp;&amp; define.amd) {</span>
+<span class="cstat-no" title="statement not covered" > define([], <span class="fstat-no" title="function not covered" >function () {</span></span>
+<span class="cstat-no" title="statement not covered" > return async;</span>
+ });
+ }
+ // included directly via &lt;script&gt; tag
+ else {
+<span class="cstat-no" title="statement not covered" > root.async = async;</span>
+ }
+&nbsp;
+}());
+&nbsp;</pre></td></tr>
+</table></pre>
+
+</div>
+<div class="footer">
+ <div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sun May 24 2015 15:04:25 GMT-0700 (PDT)</div>
+</div>
+<script src="../prettify.js"></script>
+<script>
+window.onload = function () {
+ if (typeof prettyPrint === 'function') {
+ prettyPrint();
+ }
+};
+</script>
+<script src="../sorter.js"></script>
+</body>
+</html>
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lcov-report/lib/index.html b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lcov-report/lib/index.html
new file mode 100644
index 00000000000..2a4e9132208
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lcov-report/lib/index.html
@@ -0,0 +1,73 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <title>Code coverage report for lib/</title>
+ <meta charset="utf-8">
+ <link rel="stylesheet" href="../prettify.css">
+ <link rel="stylesheet" href="../base.css">
+ <style type='text/css'>
+ div.coverage-summary .sorter {
+ background-image: url(../sort-arrow-sprite.png);
+ }
+ </style>
+</head>
+<body>
+<div class="header high">
+ <h1>Code coverage report for <span class="entity">lib/</span></h1>
+ <h2>
+ Statements: <span class="metric">94.13% <small>(673 / 715)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
+ Branches: <span class="metric">85% <small>(272 / 320)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
+ Functions: <span class="metric">94.2% <small>(195 / 207)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
+ Lines: <span class="metric">94.36% <small>(669 / 709)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
+ Ignored: <span class="metric"><span class="ignore-none">none</span></span> &nbsp;&nbsp;&nbsp;&nbsp;
+ </h2>
+ <div class="path"><a href="../index.html">All files</a> &#187; lib/</div>
+</div>
+<div class="body">
+<div class="coverage-summary">
+<table>
+<thead>
+<tr>
+ <th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
+ <th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
+ <th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
+ <th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
+ <th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
+ <th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
+ <th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
+ <th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
+ <th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
+ <th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
+</tr>
+</thead>
+<tbody><tr>
+ <td class="file high" data-value="async.js"><a href="async.js.html">async.js</a></td>
+ <td data-value="94.13" class="pic high"><span class="cover-fill" style="width: 94px;"></span><span class="cover-empty" style="width:6px;"></span></td>
+ <td data-value="94.13" class="pct high">94.13%</td>
+ <td data-value="715" class="abs high">(673&nbsp;/&nbsp;715)</td>
+ <td data-value="85" class="pct high">85%</td>
+ <td data-value="320" class="abs high">(272&nbsp;/&nbsp;320)</td>
+ <td data-value="94.2" class="pct high">94.2%</td>
+ <td data-value="207" class="abs high">(195&nbsp;/&nbsp;207)</td>
+ <td data-value="94.36" class="pct high">94.36%</td>
+ <td data-value="709" class="abs high">(669&nbsp;/&nbsp;709)</td>
+ </tr>
+
+</tbody>
+</table>
+</div>
+</div>
+<div class="footer">
+ <div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sun May 24 2015 15:04:25 GMT-0700 (PDT)</div>
+</div>
+<script src="../prettify.js"></script>
+<script>
+window.onload = function () {
+ if (typeof prettyPrint === 'function') {
+ prettyPrint();
+ }
+};
+</script>
+<script src="../sorter.js"></script>
+</body>
+</html>
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lcov-report/prettify.css b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lcov-report/prettify.css
new file mode 100644
index 00000000000..b317a7cda31
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lcov-report/prettify.css
@@ -0,0 +1 @@
+.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lcov-report/prettify.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lcov-report/prettify.js
new file mode 100644
index 00000000000..ef51e038668
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lcov-report/prettify.js
@@ -0,0 +1 @@
+window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V<U;++V){var ae=Z[V];if(ae.ignoreCase){ac=true}else{if(/[a-z]/i.test(ae.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){S=true;ac=false;break}}}var Y={b:8,t:9,n:10,v:11,f:12,r:13};function ab(ah){var ag=ah.charCodeAt(0);if(ag!==92){return ag}var af=ah.charAt(1);ag=Y[af];if(ag){return ag}else{if("0"<=af&&af<="7"){return parseInt(ah.substring(1),8)}else{if(af==="u"||af==="x"){return parseInt(ah.substring(2),16)}else{return ah.charCodeAt(1)}}}}function T(af){if(af<32){return(af<16?"\\x0":"\\x")+af.toString(16)}var ag=String.fromCharCode(af);if(ag==="\\"||ag==="-"||ag==="["||ag==="]"){ag="\\"+ag}return ag}function X(am){var aq=am.substring(1,am.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g"));var ak=[];var af=[];var ao=aq[0]==="^";for(var ar=ao?1:0,aj=aq.length;ar<aj;++ar){var ah=aq[ar];if(/\\[bdsw]/i.test(ah)){ak.push(ah)}else{var ag=ab(ah);var al;if(ar+2<aj&&"-"===aq[ar+1]){al=ab(aq[ar+2]);ar+=2}else{al=ag}af.push([ag,al]);if(!(al<65||ag>122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;ar<af.length;++ar){var at=af[ar];if(at[0]<=ap[1]+1){ap[1]=Math.max(ap[1],at[1])}else{ai.push(ap=at)}}var an=["["];if(ao){an.push("^")}an.push.apply(an,ak);for(var ar=0;ar<ai.length;++ar){var at=ai[ar];an.push(T(at[0]));if(at[1]>at[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak<ah;++ak){var ag=aj[ak];if(ag==="("){++am}else{if("\\"===ag.charAt(0)){var af=+ag.substring(1);if(af&&af<=am){an[af]=-1}}}}for(var ak=1;ak<an.length;++ak){if(-1===an[ak]){an[ak]=++ad}}for(var ak=0,am=0;ak<ah;++ak){var ag=aj[ak];if(ag==="("){++am;if(an[am]===undefined){aj[ak]="(?:"}}else{if("\\"===ag.charAt(0)){var af=+ag.substring(1);if(af&&af<=am){aj[ak]="\\"+an[am]}}}}for(var ak=0,am=0;ak<ah;++ak){if("^"===aj[ak]&&"^"!==aj[ak+1]){aj[ak]=""}}if(al.ignoreCase&&S){for(var ak=0;ak<ah;++ak){var ag=aj[ak];var ai=ag.charAt(0);if(ag.length>=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V<U;++V){var ae=Z[V];if(ae.global||ae.multiline){throw new Error(""+ae)}aa.push("(?:"+W(ae)+")")}return new RegExp(aa.join("|"),ac?"gi":"g")}function a(V){var U=/(?:^|\s)nocode(?:\s|$)/;var X=[];var T=0;var Z=[];var W=0;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=document.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Y=S&&"pre"===S.substring(0,3);function aa(ab){switch(ab.nodeType){case 1:if(U.test(ab.className)){return}for(var ae=ab.firstChild;ae;ae=ae.nextSibling){aa(ae)}var ad=ab.nodeName;if("BR"===ad||"LI"===ad){X[W]="\n";Z[W<<1]=T++;Z[(W++<<1)|1]=ab}break;case 3:case 4:var ac=ab.nodeValue;if(ac.length){if(!Y){ac=ac.replace(/[ \t\r\n]+/g," ")}else{ac=ac.replace(/\r\n?/g,"\n")}X[W]=ac;Z[W<<1]=T;T+=ac.length;Z[(W++<<1)|1]=ab}break}}aa(V);return{sourceCode:X.join("").replace(/\n$/,""),spans:Z}}function B(S,U,W,T){if(!U){return}var V={sourceCode:U,basePos:S};W(V);T.push.apply(T,V.decorations)}var v=/\S/;function o(S){var V=undefined;for(var U=S.firstChild;U;U=U.nextSibling){var T=U.nodeType;V=(T===1)?(V?S:U):(T===3)?(v.test(U.nodeValue)?S:V):V}return V===S?undefined:V}function g(U,T){var S={};var V;(function(){var ad=U.concat(T);var ah=[];var ag={};for(var ab=0,Z=ad.length;ab<Z;++ab){var Y=ad[ab];var ac=Y[3];if(ac){for(var ae=ac.length;--ae>=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae<aq;++ae){var ag=an[ae];var ap=aj[ag];var ai=void 0;var am;if(typeof ap==="string"){am=false}else{var aa=S[ag.charAt(0)];if(aa){ai=ag.match(aa[1]);ap=aa[0]}else{for(var ao=0;ao<X;++ao){aa=T[ao];ai=ag.match(aa[1]);if(ai){ap=aa[0];break}}if(!ai){ap=F}}am=ap.length>=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y<W.length;++Y){ae(W[Y])}if(ag===(ag|0)){W[0].setAttribute("value",ag)}var aa=ac.createElement("OL");aa.className="linenums";var X=Math.max(0,((ag-1))|0)||0;for(var Y=0,T=W.length;Y<T;++Y){af=W[Y];af.className="L"+((Y+X)%10);if(!af.firstChild){af.appendChild(ac.createTextNode("\xA0"))}aa.appendChild(af)}V.appendChild(aa)}function D(ac){var aj=/\bMSIE\b/.test(navigator.userAgent);var am=/\n/g;var al=ac.sourceCode;var an=al.length;var V=0;var aa=ac.spans;var T=aa.length;var ah=0;var X=ac.decorations;var Y=X.length;var Z=0;X[Y]=an;var ar,aq;for(aq=ar=0;aq<Y;){if(X[aq]!==X[aq+2]){X[ar++]=X[aq++];X[ar++]=X[aq++]}else{aq+=2}}Y=ar;for(aq=ar=0;aq<Y;){var at=X[aq];var ab=X[aq+1];var W=aq+2;while(W+2<=Y&&X[W+1]===ab){W+=2}X[ar++]=at;X[ar++]=ab;aq=W}Y=X.length=ar;var ae=null;while(ah<T){var af=aa[ah];var S=aa[ah+2]||an;var ag=X[Z];var ap=X[Z+2]||an;var W=Math.min(S,ap);var ak=aa[ah+1];var U;if(ak.nodeType!==1&&(U=al.substring(V,W))){if(aj){U=U.replace(am,"\r")}ak.nodeValue=U;var ai=ak.ownerDocument;var ao=ai.createElement("SPAN");ao.className=X[Z+1];var ad=ak.parentNode;ad.replaceChild(ao,ak);ao.appendChild(ak);if(V<S){aa[ah+1]=ak=ai.createTextNode(al.substring(W,S));ad.insertBefore(ak,ao.nextSibling)}}V=W;if(V>=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*</.test(S)?"default-markup":"default-code"}return t[T]}c(K,["default-code"]);c(g([],[[F,/^[^<?]+/],[E,/^<!\w[^>]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa<ac.length;++aa){for(var Z=0,V=ac[aa].length;Z<V;++Z){T.push(ac[aa][Z])}}ac=null;var W=Date;if(!W.now){W={now:function(){return +(new Date)}}}var X=0;var S;var ab=/\blang(?:uage)?-([\w.]+)(?!\S)/;var ae=/\bprettyprint\b/;function U(){var ag=(window.PR_SHOULD_USE_CONTINUATION?W.now()+250:Infinity);for(;X<T.length&&W.now()<ag;X++){var aj=T[X];var ai=aj.className;if(ai.indexOf("prettyprint")>=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X<T.length){setTimeout(U,250)}else{if(ad){ad()}}}U()}window.prettyPrintOne=y;window.prettyPrint=b;window.PR={createSimpleLexer:g,registerLangHandler:c,sourceDecorator:i,PR_ATTRIB_NAME:P,PR_ATTRIB_VALUE:n,PR_COMMENT:j,PR_DECLARATION:E,PR_KEYWORD:z,PR_LITERAL:G,PR_NOCODE:N,PR_PLAIN:F,PR_PUNCTUATION:L,PR_SOURCE:J,PR_STRING:C,PR_TAG:m,PR_TYPE:O}})();PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_DECLARATION,/^<!\w[^>]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^<script\b[^>]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:<!--|-->)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]);
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lcov-report/sort-arrow-sprite.png b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lcov-report/sort-arrow-sprite.png
new file mode 100644
index 00000000000..03f704a609c
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lcov-report/sort-arrow-sprite.png
Binary files differ
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lcov-report/sorter.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lcov-report/sorter.js
new file mode 100644
index 00000000000..6afb736c39f
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lcov-report/sorter.js
@@ -0,0 +1,156 @@
+var addSorting = (function () {
+ "use strict";
+ var cols,
+ currentSort = {
+ index: 0,
+ desc: false
+ };
+
+ // returns the summary table element
+ function getTable() { return document.querySelector('.coverage-summary table'); }
+ // returns the thead element of the summary table
+ function getTableHeader() { return getTable().querySelector('thead tr'); }
+ // returns the tbody element of the summary table
+ function getTableBody() { return getTable().querySelector('tbody'); }
+ // returns the th element for nth column
+ function getNthColumn(n) { return getTableHeader().querySelectorAll('th')[n]; }
+
+ // loads all columns
+ function loadColumns() {
+ var colNodes = getTableHeader().querySelectorAll('th'),
+ colNode,
+ cols = [],
+ col,
+ i;
+
+ for (i = 0; i < colNodes.length; i += 1) {
+ colNode = colNodes[i];
+ col = {
+ key: colNode.getAttribute('data-col'),
+ sortable: !colNode.getAttribute('data-nosort'),
+ type: colNode.getAttribute('data-type') || 'string'
+ };
+ cols.push(col);
+ if (col.sortable) {
+ col.defaultDescSort = col.type === 'number';
+ colNode.innerHTML = colNode.innerHTML + '<span class="sorter"></span>';
+ }
+ }
+ return cols;
+ }
+ // attaches a data attribute to every tr element with an object
+ // of data values keyed by column name
+ function loadRowData(tableRow) {
+ var tableCols = tableRow.querySelectorAll('td'),
+ colNode,
+ col,
+ data = {},
+ i,
+ val;
+ for (i = 0; i < tableCols.length; i += 1) {
+ colNode = tableCols[i];
+ col = cols[i];
+ val = colNode.getAttribute('data-value');
+ if (col.type === 'number') {
+ val = Number(val);
+ }
+ data[col.key] = val;
+ }
+ return data;
+ }
+ // loads all row data
+ function loadData() {
+ var rows = getTableBody().querySelectorAll('tr'),
+ i;
+
+ for (i = 0; i < rows.length; i += 1) {
+ rows[i].data = loadRowData(rows[i]);
+ }
+ }
+ // sorts the table using the data for the ith column
+ function sortByIndex(index, desc) {
+ var key = cols[index].key,
+ sorter = function (a, b) {
+ a = a.data[key];
+ b = b.data[key];
+ return a < b ? -1 : a > b ? 1 : 0;
+ },
+ finalSorter = sorter,
+ tableBody = document.querySelector('.coverage-summary tbody'),
+ rowNodes = tableBody.querySelectorAll('tr'),
+ rows = [],
+ i;
+
+ if (desc) {
+ finalSorter = function (a, b) {
+ return -1 * sorter(a, b);
+ };
+ }
+
+ for (i = 0; i < rowNodes.length; i += 1) {
+ rows.push(rowNodes[i]);
+ tableBody.removeChild(rowNodes[i]);
+ }
+
+ rows.sort(finalSorter);
+
+ for (i = 0; i < rows.length; i += 1) {
+ tableBody.appendChild(rows[i]);
+ }
+ }
+ // removes sort indicators for current column being sorted
+ function removeSortIndicators() {
+ var col = getNthColumn(currentSort.index),
+ cls = col.className;
+
+ cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, '');
+ col.className = cls;
+ }
+ // adds sort indicators for current column being sorted
+ function addSortIndicators() {
+ getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted';
+ }
+ // adds event listeners for all sorter widgets
+ function enableUI() {
+ var i,
+ el,
+ ithSorter = function ithSorter(i) {
+ var col = cols[i];
+
+ return function () {
+ var desc = col.defaultDescSort;
+
+ if (currentSort.index === i) {
+ desc = !currentSort.desc;
+ }
+ sortByIndex(i, desc);
+ removeSortIndicators();
+ currentSort.index = i;
+ currentSort.desc = desc;
+ addSortIndicators();
+ };
+ };
+ for (i =0 ; i < cols.length; i += 1) {
+ if (cols[i].sortable) {
+ el = getNthColumn(i).querySelector('.sorter');
+ if (el.addEventListener) {
+ el.addEventListener('click', ithSorter(i));
+ } else {
+ el.attachEvent('onclick', ithSorter(i));
+ }
+ }
+ }
+ }
+ // adds sorting functionality to the UI
+ return function () {
+ if (!getTable()) {
+ return;
+ }
+ cols = loadColumns();
+ loadData(cols);
+ addSortIndicators();
+ enableUI();
+ };
+})();
+
+window.addEventListener('load', addSorting);
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lcov.info b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lcov.info
new file mode 100644
index 00000000000..00e08de0629
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lcov.info
@@ -0,0 +1,1452 @@
+TN:
+SF:./lib/async.js
+FN:8,(anonymous_1)
+FN:11,(anonymous_2)
+FN:30,(anonymous_3)
+FN:35,only_once
+FN:37,(anonymous_5)
+FN:48,(anonymous_6)
+FN:52,(anonymous_7)
+FN:61,(anonymous_8)
+FN:72,(anonymous_9)
+FN:73,(anonymous_10)
+FN:79,(anonymous_11)
+FN:80,(anonymous_12)
+FN:85,(anonymous_13)
+FN:95,(anonymous_14)
+FN:124,(anonymous_15)
+FN:131,(anonymous_16)
+FN:140,(anonymous_17)
+FN:150,(anonymous_18)
+FN:156,(anonymous_19)
+FN:159,done
+FN:174,(anonymous_21)
+FN:180,(anonymous_22)
+FN:181,(anonymous_23)
+FN:202,(anonymous_24)
+FN:208,(anonymous_25)
+FN:210,(anonymous_26)
+FN:220,replenish
+FN:228,(anonymous_28)
+FN:252,(anonymous_29)
+FN:253,(anonymous_30)
+FN:259,(anonymous_31)
+FN:260,(anonymous_32)
+FN:263,(anonymous_33)
+FN:274,(anonymous_34)
+FN:275,(anonymous_35)
+FN:282,(anonymous_36)
+FN:285,(anonymous_37)
+FN:288,(anonymous_38)
+FN:312,(anonymous_39)
+FN:316,(anonymous_40)
+FN:318,(anonymous_41)
+FN:319,(anonymous_42)
+FN:329,replenish
+FN:338,(anonymous_44)
+FN:341,(anonymous_45)
+FN:360,(anonymous_46)
+FN:361,(anonymous_47)
+FN:366,(anonymous_48)
+FN:367,(anonymous_49)
+FN:372,(anonymous_50)
+FN:373,(anonymous_51)
+FN:380,(anonymous_52)
+FN:381,(anonymous_53)
+FN:385,(anonymous_54)
+FN:386,(anonymous_55)
+FN:392,(anonymous_56)
+FN:393,(anonymous_57)
+FN:397,(anonymous_58)
+FN:404,(anonymous_59)
+FN:408,(anonymous_60)
+FN:414,(anonymous_61)
+FN:415,(anonymous_62)
+FN:416,(anonymous_63)
+FN:420,(anonymous_64)
+FN:429,(anonymous_65)
+FN:430,(anonymous_66)
+FN:438,(anonymous_67)
+FN:440,(anonymous_68)
+FN:443,(anonymous_69)
+FN:444,(anonymous_70)
+FN:450,(anonymous_71)
+FN:451,(anonymous_72)
+FN:453,(anonymous_73)
+FN:464,(anonymous_74)
+FN:466,(anonymous_75)
+FN:469,(anonymous_76)
+FN:470,(anonymous_77)
+FN:476,(anonymous_78)
+FN:477,(anonymous_79)
+FN:479,(anonymous_80)
+FN:487,(anonymous_81)
+FN:488,(anonymous_82)
+FN:489,(anonymous_83)
+FN:498,(anonymous_84)
+FN:505,(anonymous_85)
+FN:506,(anonymous_86)
+FN:507,(anonymous_87)
+FN:514,(anonymous_88)
+FN:521,(anonymous_89)
+FN:522,(anonymous_90)
+FN:523,(anonymous_91)
+FN:530,(anonymous_92)
+FN:537,(anonymous_93)
+FN:538,(anonymous_94)
+FN:539,(anonymous_95)
+FN:547,(anonymous_96)
+FN:552,(anonymous_97)
+FN:556,(anonymous_98)
+FN:563,(anonymous_99)
+FN:574,(anonymous_100)
+FN:577,(anonymous_101)
+FN:585,(anonymous_102)
+FN:587,(anonymous_103)
+FN:592,(anonymous_104)
+FN:602,(anonymous_105)
+FN:604,(anonymous_106)
+FN:611,(anonymous_107)
+FN:636,(anonymous_108)
+FN:637,(anonymous_109)
+FN:645,(anonymous_110)
+FN:656,(anonymous_111)
+FN:667,(anonymous_112)
+FN:668,(anonymous_113)
+FN:669,(anonymous_114)
+FN:670,(anonymous_115)
+FN:678,(anonymous_116)
+FN:687,(anonymous_117)
+FN:696,(anonymous_118)
+FN:697,(anonymous_119)
+FN:711,(anonymous_120)
+FN:720,(anonymous_121)
+FN:723,(anonymous_122)
+FN:725,(anonymous_123)
+FN:737,(anonymous_124)
+FN:738,(anonymous_125)
+FN:746,(anonymous_126)
+FN:752,(anonymous_127)
+FN:756,(anonymous_128)
+FN:760,(anonymous_129)
+FN:763,(anonymous_130)
+FN:765,(anonymous_131)
+FN:777,(anonymous_132)
+FN:778,(anonymous_133)
+FN:786,(anonymous_134)
+FN:792,(anonymous_135)
+FN:793,(anonymous_136)
+FN:794,(anonymous_137)
+FN:800,(anonymous_138)
+FN:808,(anonymous_139)
+FN:810,(anonymous_140)
+FN:817,(anonymous_141)
+FN:819,(anonymous_142)
+FN:820,(anonymous_143)
+FN:824,(anonymous_144)
+FN:831,(anonymous_145)
+FN:833,(anonymous_146)
+FN:845,(anonymous_147)
+FN:846,(anonymous_148)
+FN:860,(anonymous_149)
+FN:862,(anonymous_150)
+FN:874,(anonymous_151)
+FN:875,(anonymous_152)
+FN:889,(anonymous_153)
+FN:896,_insert
+FN:905,(anonymous_155)
+FN:911,(anonymous_156)
+FN:939,(anonymous_157)
+FN:942,(anonymous_158)
+FN:946,(anonymous_159)
+FN:949,(anonymous_160)
+FN:956,(anonymous_161)
+FN:970,(anonymous_162)
+FN:973,(anonymous_163)
+FN:976,(anonymous_164)
+FN:979,(anonymous_165)
+FN:983,(anonymous_166)
+FN:997,(anonymous_167)
+FN:999,_compareTasks
+FN:1003,_binarySearch
+FN:1017,_insert
+FN:1026,(anonymous_171)
+FN:1032,(anonymous_172)
+FN:1052,(anonymous_173)
+FN:1062,(anonymous_174)
+FN:1073,(anonymous_175)
+FN:1077,(anonymous_176)
+FN:1089,process
+FN:1101,(anonymous_178)
+FN:1107,(anonymous_179)
+FN:1111,(anonymous_180)
+FN:1120,(anonymous_181)
+FN:1123,(anonymous_182)
+FN:1130,(anonymous_183)
+FN:1131,(anonymous_184)
+FN:1133,(anonymous_185)
+FN:1142,(anonymous_186)
+FN:1156,(anonymous_187)
+FN:1159,(anonymous_188)
+FN:1162,(anonymous_189)
+FN:1167,(anonymous_190)
+FN:1176,(anonymous_191)
+FN:1191,(anonymous_192)
+FN:1192,(anonymous_193)
+FN:1197,(anonymous_194)
+FN:1205,(anonymous_195)
+FN:1213,(anonymous_196)
+FN:1215,(anonymous_197)
+FN:1219,(anonymous_198)
+FN:1220,(anonymous_199)
+FN:1226,(anonymous_200)
+FN:1232,(anonymous_201)
+FN:1236,(anonymous_202)
+FN:1237,(anonymous_203)
+FN:1241,(anonymous_204)
+FN:1257,(anonymous_205)
+FN:1258,next
+FN:1276,(anonymous_207)
+FNF:207
+FNH:195
+FNDA:1,(anonymous_1)
+FNDA:27,(anonymous_2)
+FNDA:0,(anonymous_3)
+FNDA:162,only_once
+FNDA:162,(anonymous_5)
+FNDA:0,(anonymous_6)
+FNDA:249,(anonymous_7)
+FNDA:76,(anonymous_8)
+FNDA:54,(anonymous_9)
+FNDA:54,(anonymous_10)
+FNDA:4,(anonymous_11)
+FNDA:7,(anonymous_12)
+FNDA:0,(anonymous_13)
+FNDA:237,(anonymous_14)
+FNDA:0,(anonymous_15)
+FNDA:0,(anonymous_16)
+FNDA:219,(anonymous_17)
+FNDA:37,(anonymous_18)
+FNDA:99,(anonymous_19)
+FNDA:95,done
+FNDA:35,(anonymous_21)
+FNDA:79,(anonymous_22)
+FNDA:76,(anonymous_23)
+FNDA:9,(anonymous_24)
+FNDA:27,(anonymous_25)
+FNDA:22,(anonymous_26)
+FNDA:77,replenish
+FNDA:77,(anonymous_28)
+FNDA:5,(anonymous_29)
+FNDA:1,(anonymous_30)
+FNDA:7,(anonymous_31)
+FNDA:7,(anonymous_32)
+FNDA:1,(anonymous_33)
+FNDA:5,(anonymous_34)
+FNDA:1,(anonymous_35)
+FNDA:6,(anonymous_36)
+FNDA:6,(anonymous_37)
+FNDA:0,(anonymous_38)
+FNDA:9,(anonymous_39)
+FNDA:9,(anonymous_40)
+FNDA:9,(anonymous_41)
+FNDA:1,(anonymous_42)
+FNDA:20,replenish
+FNDA:20,(anonymous_44)
+FNDA:0,(anonymous_45)
+FNDA:6,(anonymous_46)
+FNDA:25,(anonymous_47)
+FNDA:13,(anonymous_48)
+FNDA:12,(anonymous_49)
+FNDA:6,(anonymous_50)
+FNDA:20,(anonymous_51)
+FNDA:40,(anonymous_52)
+FNDA:142,(anonymous_53)
+FNDA:3,(anonymous_54)
+FNDA:3,(anonymous_55)
+FNDA:99,(anonymous_56)
+FNDA:97,(anonymous_57)
+FNDA:39,(anonymous_58)
+FNDA:7,(anonymous_59)
+FNDA:13,(anonymous_60)
+FNDA:10,(anonymous_61)
+FNDA:24,(anonymous_62)
+FNDA:24,(anonymous_63)
+FNDA:10,(anonymous_64)
+FNDA:1,(anonymous_65)
+FNDA:3,(anonymous_66)
+FNDA:3,(anonymous_67)
+FNDA:9,(anonymous_68)
+FNDA:9,(anonymous_69)
+FNDA:9,(anonymous_70)
+FNDA:3,(anonymous_71)
+FNDA:3,(anonymous_72)
+FNDA:6,(anonymous_73)
+FNDA:3,(anonymous_74)
+FNDA:9,(anonymous_75)
+FNDA:9,(anonymous_76)
+FNDA:9,(anonymous_77)
+FNDA:3,(anonymous_78)
+FNDA:0,(anonymous_79)
+FNDA:3,(anonymous_80)
+FNDA:5,(anonymous_81)
+FNDA:15,(anonymous_82)
+FNDA:15,(anonymous_83)
+FNDA:0,(anonymous_84)
+FNDA:3,(anonymous_85)
+FNDA:9,(anonymous_86)
+FNDA:9,(anonymous_87)
+FNDA:3,(anonymous_88)
+FNDA:3,(anonymous_89)
+FNDA:9,(anonymous_90)
+FNDA:9,(anonymous_91)
+FNDA:3,(anonymous_92)
+FNDA:2,(anonymous_93)
+FNDA:6,(anonymous_94)
+FNDA:6,(anonymous_95)
+FNDA:2,(anonymous_96)
+FNDA:6,(anonymous_97)
+FNDA:6,(anonymous_98)
+FNDA:13,(anonymous_99)
+FNDA:27,(anonymous_100)
+FNDA:13,(anonymous_101)
+FNDA:25,(anonymous_102)
+FNDA:47,(anonymous_103)
+FNDA:25,(anonymous_104)
+FNDA:34,(anonymous_105)
+FNDA:28,(anonymous_106)
+FNDA:1,(anonymous_107)
+FNDA:54,(anonymous_108)
+FNDA:54,(anonymous_109)
+FNDA:22,(anonymous_110)
+FNDA:3,(anonymous_111)
+FNDA:3,(anonymous_112)
+FNDA:13,(anonymous_113)
+FNDA:7,(anonymous_114)
+FNDA:7,(anonymous_115)
+FNDA:3,(anonymous_116)
+FNDA:8,(anonymous_117)
+FNDA:18,(anonymous_118)
+FNDA:19,(anonymous_119)
+FNDA:18,(anonymous_120)
+FNDA:13,(anonymous_121)
+FNDA:21,(anonymous_122)
+FNDA:21,(anonymous_123)
+FNDA:6,(anonymous_124)
+FNDA:6,(anonymous_125)
+FNDA:2,(anonymous_126)
+FNDA:7,(anonymous_127)
+FNDA:6,(anonymous_128)
+FNDA:10,(anonymous_129)
+FNDA:18,(anonymous_130)
+FNDA:18,(anonymous_131)
+FNDA:3,(anonymous_132)
+FNDA:3,(anonymous_133)
+FNDA:1,(anonymous_134)
+FNDA:9,(anonymous_135)
+FNDA:38,(anonymous_136)
+FNDA:25,(anonymous_137)
+FNDA:46,(anonymous_138)
+FNDA:6,(anonymous_139)
+FNDA:6,(anonymous_140)
+FNDA:3,(anonymous_141)
+FNDA:9,(anonymous_142)
+FNDA:9,(anonymous_143)
+FNDA:3,(anonymous_144)
+FNDA:6,(anonymous_145)
+FNDA:5,(anonymous_146)
+FNDA:10,(anonymous_147)
+FNDA:10,(anonymous_148)
+FNDA:6,(anonymous_149)
+FNDA:5,(anonymous_150)
+FNDA:10,(anonymous_151)
+FNDA:10,(anonymous_152)
+FNDA:20,(anonymous_153)
+FNDA:45,_insert
+FNDA:2,(anonymous_155)
+FNDA:56,(anonymous_156)
+FNDA:37,(anonymous_157)
+FNDA:1,(anonymous_158)
+FNDA:8,(anonymous_159)
+FNDA:132,(anonymous_160)
+FNDA:63,(anonymous_161)
+FNDA:37,(anonymous_162)
+FNDA:4,(anonymous_163)
+FNDA:7,(anonymous_164)
+FNDA:3,(anonymous_165)
+FNDA:4,(anonymous_166)
+FNDA:2,(anonymous_167)
+FNDA:10,_compareTasks
+FNDA:8,_binarySearch
+FNDA:8,_insert
+FNDA:0,(anonymous_171)
+FNDA:8,(anonymous_172)
+FNDA:8,(anonymous_173)
+FNDA:5,(anonymous_174)
+FNDA:41,(anonymous_175)
+FNDA:44,(anonymous_176)
+FNDA:62,process
+FNDA:44,(anonymous_178)
+FNDA:21,(anonymous_179)
+FNDA:44,(anonymous_180)
+FNDA:10,(anonymous_181)
+FNDA:0,(anonymous_182)
+FNDA:2,(anonymous_183)
+FNDA:6,(anonymous_184)
+FNDA:6,(anonymous_185)
+FNDA:8,(anonymous_186)
+FNDA:7,(anonymous_187)
+FNDA:9,(anonymous_188)
+FNDA:11,(anonymous_189)
+FNDA:4,(anonymous_190)
+FNDA:6,(anonymous_191)
+FNDA:2,(anonymous_192)
+FNDA:4,(anonymous_193)
+FNDA:3,(anonymous_194)
+FNDA:2,(anonymous_195)
+FNDA:6,(anonymous_196)
+FNDA:6,(anonymous_197)
+FNDA:14,(anonymous_198)
+FNDA:14,(anonymous_199)
+FNDA:6,(anonymous_200)
+FNDA:3,(anonymous_201)
+FNDA:3,(anonymous_202)
+FNDA:3,(anonymous_203)
+FNDA:9,(anonymous_204)
+FNDA:1,(anonymous_205)
+FNDA:51,next
+FNDA:0,(anonymous_207)
+DA:8,1
+DA:10,1
+DA:11,1
+DA:14,1
+DA:16,1
+DA:17,0
+DA:19,1
+DA:20,1
+DA:23,0
+DA:26,1
+DA:27,1
+DA:30,1
+DA:31,0
+DA:32,0
+DA:35,1
+DA:36,162
+DA:37,162
+DA:38,162
+DA:39,158
+DA:40,158
+DA:46,1
+DA:48,1
+DA:49,0
+DA:52,1
+DA:53,249
+DA:56,249
+DA:57,402
+DA:61,1
+DA:62,76
+DA:66,76
+DA:67,222
+DA:69,76
+DA:72,1
+DA:73,54
+DA:74,54
+DA:76,54
+DA:79,1
+DA:80,4
+DA:81,7
+DA:85,1
+DA:86,0
+DA:87,0
+DA:88,0
+DA:89,0
+DA:92,0
+DA:95,1
+DA:96,237
+DA:97,237
+DA:98,237
+DA:100,237
+DA:101,148
+DA:102,148
+DA:104,237
+DA:106,237
+DA:107,360
+DA:109,237
+DA:117,1
+DA:118,1
+DA:119,1
+DA:122,1
+DA:123,0
+DA:124,0
+DA:126,0
+DA:128,0
+DA:131,0
+DA:132,0
+DA:134,0
+DA:138,1
+DA:139,1
+DA:140,1
+DA:142,219
+DA:146,0
+DA:150,1
+DA:151,37
+DA:152,37
+DA:153,3
+DA:155,34
+DA:156,34
+DA:157,99
+DA:159,1
+DA:160,95
+DA:161,14
+DA:162,14
+DA:165,81
+DA:166,81
+DA:167,27
+DA:172,1
+DA:174,1
+DA:175,35
+DA:176,35
+DA:177,2
+DA:179,33
+DA:180,33
+DA:181,79
+DA:182,76
+DA:183,10
+DA:184,10
+DA:187,66
+DA:188,66
+DA:189,20
+DA:192,46
+DA:197,33
+DA:199,1
+DA:202,1
+DA:203,9
+DA:204,9
+DA:206,1
+DA:208,1
+DA:210,27
+DA:211,22
+DA:212,22
+DA:213,5
+DA:215,17
+DA:216,17
+DA:217,17
+DA:218,17
+DA:220,17
+DA:221,77
+DA:222,0
+DA:225,77
+DA:226,81
+DA:227,81
+DA:228,81
+DA:229,77
+DA:230,6
+DA:231,6
+DA:232,6
+DA:235,71
+DA:236,71
+DA:237,71
+DA:238,11
+DA:241,60
+DA:252,1
+DA:253,5
+DA:254,5
+DA:255,5
+DA:256,5
+DA:257,1
+DA:259,4
+DA:260,7
+DA:261,7
+DA:262,2
+DA:263,2
+DA:265,5
+DA:266,5
+DA:267,3
+DA:274,1
+DA:275,5
+DA:276,5
+DA:277,5
+DA:278,5
+DA:279,1
+DA:281,4
+DA:282,4
+DA:283,6
+DA:284,6
+DA:285,6
+DA:286,6
+DA:287,1
+DA:288,1
+DA:291,5
+DA:292,5
+DA:293,3
+DA:296,2
+DA:297,0
+DA:300,2
+DA:305,6
+DA:307,4
+DA:312,1
+DA:313,9
+DA:316,1
+DA:318,9
+DA:319,9
+DA:320,9
+DA:321,9
+DA:322,9
+DA:323,2
+DA:325,7
+DA:326,7
+DA:327,7
+DA:329,7
+DA:330,20
+DA:331,0
+DA:334,20
+DA:335,22
+DA:336,22
+DA:337,22
+DA:338,22
+DA:339,20
+DA:340,1
+DA:341,1
+DA:344,19
+DA:345,19
+DA:346,19
+DA:347,6
+DA:350,13
+DA:360,1
+DA:361,6
+DA:362,25
+DA:363,25
+DA:366,1
+DA:367,13
+DA:368,12
+DA:369,12
+DA:372,1
+DA:373,6
+DA:374,20
+DA:375,20
+DA:380,1
+DA:381,40
+DA:382,142
+DA:384,40
+DA:385,1
+DA:386,3
+DA:387,3
+DA:391,39
+DA:392,39
+DA:393,99
+DA:394,97
+DA:395,97
+DA:398,39
+DA:402,1
+DA:403,1
+DA:404,1
+DA:405,7
+DA:408,1
+DA:409,13
+DA:414,1
+DA:415,10
+DA:416,24
+DA:417,24
+DA:418,24
+DA:421,10
+DA:425,1
+DA:427,1
+DA:429,1
+DA:430,1
+DA:431,3
+DA:433,1
+DA:436,1
+DA:438,1
+DA:439,3
+DA:440,3
+DA:441,9
+DA:443,3
+DA:444,9
+DA:445,9
+DA:446,6
+DA:448,9
+DA:451,3
+DA:452,3
+DA:454,6
+DA:458,1
+DA:459,1
+DA:461,1
+DA:462,1
+DA:464,1
+DA:465,3
+DA:466,3
+DA:467,9
+DA:469,3
+DA:470,9
+DA:471,9
+DA:472,3
+DA:474,9
+DA:477,3
+DA:478,0
+DA:480,3
+DA:484,1
+DA:485,1
+DA:487,1
+DA:488,5
+DA:489,15
+DA:490,15
+DA:491,7
+DA:492,7
+DA:495,8
+DA:499,0
+DA:502,1
+DA:503,1
+DA:505,1
+DA:506,3
+DA:507,9
+DA:508,9
+DA:509,2
+DA:510,2
+DA:512,9
+DA:515,3
+DA:519,1
+DA:521,1
+DA:522,3
+DA:523,9
+DA:524,9
+DA:525,3
+DA:526,3
+DA:528,9
+DA:531,3
+DA:535,1
+DA:537,1
+DA:538,2
+DA:539,6
+DA:540,6
+DA:541,0
+DA:544,6
+DA:548,2
+DA:549,0
+DA:552,2
+DA:553,6
+DA:554,6
+DA:556,2
+DA:557,6
+DA:563,1
+DA:564,13
+DA:565,13
+DA:566,13
+DA:567,13
+DA:568,1
+DA:571,12
+DA:573,12
+DA:574,12
+DA:575,27
+DA:577,12
+DA:578,13
+DA:579,19
+DA:580,13
+DA:581,13
+DA:585,12
+DA:586,25
+DA:587,25
+DA:588,47
+DA:592,12
+DA:593,25
+DA:594,7
+DA:596,7
+DA:598,7
+DA:602,12
+DA:603,34
+DA:604,34
+DA:605,28
+DA:606,28
+DA:607,27
+DA:609,28
+DA:610,3
+DA:611,3
+DA:612,1
+DA:614,3
+DA:615,3
+DA:617,3
+DA:620,25
+DA:621,25
+DA:624,34
+DA:626,34
+DA:627,34
+DA:628,34
+DA:629,23
+DA:630,1
+DA:632,22
+DA:633,1
+DA:636,32
+DA:637,54
+DA:638,54
+DA:641,32
+DA:642,17
+DA:645,15
+DA:646,22
+DA:647,13
+DA:648,13
+DA:651,15
+DA:656,1
+DA:657,3
+DA:658,3
+DA:660,3
+DA:661,2
+DA:662,2
+DA:663,2
+DA:666,3
+DA:667,3
+DA:668,3
+DA:669,13
+DA:670,7
+DA:671,7
+DA:675,3
+DA:676,13
+DA:678,3
+DA:679,3
+DA:680,3
+DA:684,3
+DA:687,1
+DA:688,8
+DA:689,8
+DA:690,1
+DA:691,1
+DA:693,7
+DA:694,1
+DA:696,6
+DA:697,18
+DA:698,19
+DA:699,1
+DA:700,1
+DA:703,18
+DA:704,18
+DA:705,18
+DA:706,12
+DA:709,6
+DA:711,18
+DA:712,18
+DA:717,6
+DA:720,1
+DA:721,13
+DA:722,13
+DA:723,11
+DA:724,21
+DA:725,21
+DA:726,21
+DA:727,21
+DA:728,19
+DA:730,21
+DA:736,2
+DA:737,2
+DA:738,6
+DA:739,6
+DA:740,6
+DA:741,4
+DA:743,6
+DA:744,6
+DA:747,2
+DA:752,1
+DA:753,7
+DA:756,1
+DA:757,6
+DA:760,1
+DA:761,10
+DA:762,10
+DA:763,9
+DA:764,18
+DA:765,18
+DA:766,18
+DA:767,18
+DA:768,17
+DA:770,18
+DA:776,1
+DA:777,1
+DA:778,3
+DA:779,3
+DA:780,3
+DA:781,2
+DA:783,3
+DA:784,3
+DA:787,1
+DA:792,1
+DA:793,9
+DA:794,38
+DA:795,25
+DA:796,24
+DA:798,25
+DA:800,38
+DA:801,46
+DA:803,38
+DA:805,9
+DA:808,1
+DA:809,6
+DA:810,6
+DA:811,6
+DA:817,1
+DA:818,3
+DA:819,3
+DA:820,9
+DA:821,9
+DA:822,9
+DA:825,3
+DA:828,1
+DA:829,1
+DA:831,1
+DA:832,6
+DA:833,5
+DA:834,5
+DA:835,0
+DA:837,5
+DA:841,1
+DA:845,1
+DA:846,10
+DA:847,10
+DA:848,0
+DA:850,10
+DA:851,10
+DA:852,8
+DA:855,2
+DA:860,1
+DA:861,6
+DA:862,5
+DA:863,5
+DA:864,0
+DA:866,5
+DA:870,1
+DA:874,1
+DA:875,10
+DA:876,10
+DA:877,0
+DA:879,10
+DA:880,10
+DA:881,8
+DA:884,2
+DA:889,1
+DA:890,20
+DA:891,3
+DA:893,17
+DA:894,1
+DA:896,1
+DA:897,45
+DA:898,17
+DA:900,45
+DA:901,39
+DA:903,45
+DA:905,2
+DA:906,2
+DA:907,1
+DA:911,43
+DA:912,56
+DA:917,56
+DA:918,8
+DA:920,48
+DA:923,56
+DA:924,2
+DA:926,56
+DA:930,19
+DA:931,19
+DA:940,37
+DA:943,1
+DA:944,1
+DA:947,8
+DA:950,132
+DA:951,63
+DA:952,63
+DA:953,1
+DA:955,63
+DA:956,63
+DA:957,63
+DA:958,63
+DA:959,31
+DA:961,63
+DA:962,9
+DA:964,63
+DA:966,63
+DA:967,63
+DA:971,37
+DA:974,4
+DA:977,7
+DA:980,3
+DA:981,3
+DA:984,4
+DA:985,3
+DA:986,3
+DA:989,3
+DA:990,5
+DA:994,19
+DA:997,1
+DA:999,1
+DA:1000,10
+DA:1003,1
+DA:1004,8
+DA:1006,8
+DA:1007,10
+DA:1008,10
+DA:1009,6
+DA:1011,4
+DA:1014,8
+DA:1017,1
+DA:1018,8
+DA:1019,2
+DA:1021,8
+DA:1022,8
+DA:1024,8
+DA:1026,0
+DA:1027,0
+DA:1028,0
+DA:1032,8
+DA:1033,8
+DA:1039,8
+DA:1041,8
+DA:1042,0
+DA:1044,8
+DA:1049,2
+DA:1052,2
+DA:1053,8
+DA:1057,2
+DA:1059,2
+DA:1062,1
+DA:1063,5
+DA:1066,5
+DA:1074,41
+DA:1075,40
+DA:1077,41
+DA:1078,44
+DA:1082,44
+DA:1083,44
+DA:1084,0
+DA:1087,41
+DA:1090,62
+DA:1091,54
+DA:1092,33
+DA:1093,33
+DA:1094,33
+DA:1097,21
+DA:1101,21
+DA:1102,44
+DA:1105,21
+DA:1106,21
+DA:1107,21
+DA:1108,21
+DA:1110,21
+DA:1111,21
+DA:1112,44
+DA:1113,9
+DA:1117,21
+DA:1121,10
+DA:1124,0
+DA:1127,5
+DA:1130,1
+DA:1131,2
+DA:1132,6
+DA:1133,6
+DA:1134,6
+DA:1135,6
+DA:1136,6
+DA:1137,2
+DA:1138,2
+DA:1141,4
+DA:1142,4
+DA:1143,8
+DA:1150,1
+DA:1151,1
+DA:1156,1
+DA:1157,7
+DA:1158,7
+DA:1159,7
+DA:1160,9
+DA:1162,7
+DA:1163,11
+DA:1164,11
+DA:1165,11
+DA:1166,11
+DA:1167,4
+DA:1168,4
+DA:1171,7
+DA:1172,1
+DA:1175,6
+DA:1176,6
+DA:1177,6
+DA:1178,6
+DA:1179,6
+DA:1180,6
+DA:1181,7
+DA:1186,7
+DA:1187,7
+DA:1188,7
+DA:1191,1
+DA:1192,2
+DA:1193,4
+DA:1197,1
+DA:1198,3
+DA:1199,3
+DA:1200,6
+DA:1202,3
+DA:1205,1
+DA:1206,2
+DA:1207,2
+DA:1208,10
+DA:1210,2
+DA:1213,1
+DA:1214,6
+DA:1215,6
+DA:1216,6
+DA:1217,6
+DA:1218,6
+DA:1219,6
+DA:1220,14
+DA:1221,14
+DA:1222,14
+DA:1223,14
+DA:1227,6
+DA:1232,1
+DA:1233,3
+DA:1236,1
+DA:1237,3
+DA:1238,3
+DA:1239,3
+DA:1240,3
+DA:1241,3
+DA:1242,9
+DA:1246,3
+DA:1247,2
+DA:1248,2
+DA:1251,1
+DA:1254,1
+DA:1255,1
+DA:1257,1
+DA:1258,1
+DA:1259,51
+DA:1260,1
+DA:1261,1
+DA:1263,0
+DA:1265,50
+DA:1267,1
+DA:1271,1
+DA:1272,1
+DA:1275,0
+DA:1276,0
+DA:1277,0
+DA:1282,0
+LF:709
+LH:669
+BRDA:16,1,0,0
+BRDA:16,1,1,1
+BRDA:16,2,0,1
+BRDA:16,2,1,0
+BRDA:19,3,0,1
+BRDA:19,3,1,0
+BRDA:19,4,0,1
+BRDA:19,4,1,1
+BRDA:26,5,0,1
+BRDA:26,5,1,0
+BRDA:38,6,0,4
+BRDA:38,6,1,158
+BRDA:48,7,0,1
+BRDA:48,7,1,0
+BRDA:85,8,0,1
+BRDA:85,8,1,0
+BRDA:88,9,0,0
+BRDA:88,9,1,0
+BRDA:96,10,0,237
+BRDA:96,10,1,89
+BRDA:100,11,0,148
+BRDA:100,11,1,89
+BRDA:102,12,0,42
+BRDA:102,12,1,106
+BRDA:118,13,0,1
+BRDA:118,13,1,0
+BRDA:122,14,0,0
+BRDA:122,14,1,1
+BRDA:122,15,0,1
+BRDA:122,15,1,1
+BRDA:123,16,0,0
+BRDA:123,16,1,0
+BRDA:139,17,0,1
+BRDA:139,17,1,0
+BRDA:151,18,0,37
+BRDA:151,18,1,3
+BRDA:152,19,0,3
+BRDA:152,19,1,34
+BRDA:160,20,0,14
+BRDA:160,20,1,81
+BRDA:166,21,0,27
+BRDA:166,21,1,54
+BRDA:175,22,0,35
+BRDA:175,22,1,1
+BRDA:176,23,0,2
+BRDA:176,23,1,33
+BRDA:182,24,0,10
+BRDA:182,24,1,66
+BRDA:188,25,0,20
+BRDA:188,25,1,46
+BRDA:211,26,0,22
+BRDA:211,26,1,1
+BRDA:212,27,0,5
+BRDA:212,27,1,17
+BRDA:212,28,0,22
+BRDA:212,28,1,19
+BRDA:221,29,0,0
+BRDA:221,29,1,77
+BRDA:225,30,0,158
+BRDA:225,30,1,135
+BRDA:225,30,2,87
+BRDA:229,31,0,6
+BRDA:229,31,1,71
+BRDA:237,32,0,11
+BRDA:237,32,1,60
+BRDA:253,33,0,5
+BRDA:253,33,1,1
+BRDA:254,34,0,5
+BRDA:254,34,1,4
+BRDA:256,35,0,1
+BRDA:256,35,1,4
+BRDA:261,36,0,2
+BRDA:261,36,1,5
+BRDA:266,37,0,3
+BRDA:266,37,1,2
+BRDA:275,38,0,5
+BRDA:275,38,1,1
+BRDA:278,39,0,1
+BRDA:278,39,1,4
+BRDA:286,40,0,1
+BRDA:286,40,1,5
+BRDA:292,41,0,3
+BRDA:292,41,1,2
+BRDA:296,42,0,0
+BRDA:296,42,1,2
+BRDA:319,43,0,9
+BRDA:319,43,1,1
+BRDA:322,44,0,2
+BRDA:322,44,1,7
+BRDA:322,45,0,9
+BRDA:322,45,1,8
+BRDA:330,46,0,0
+BRDA:330,46,1,20
+BRDA:334,47,0,42
+BRDA:334,47,1,35
+BRDA:339,48,0,1
+BRDA:339,48,1,19
+BRDA:346,49,0,6
+BRDA:346,49,1,13
+BRDA:384,50,0,1
+BRDA:384,50,1,39
+BRDA:421,51,0,10
+BRDA:421,51,1,7
+BRDA:445,52,0,6
+BRDA:445,52,1,3
+BRDA:471,53,0,3
+BRDA:471,53,1,6
+BRDA:490,54,0,7
+BRDA:490,54,1,8
+BRDA:508,55,0,2
+BRDA:508,55,1,7
+BRDA:524,56,0,3
+BRDA:524,56,1,6
+BRDA:540,57,0,0
+BRDA:540,57,1,6
+BRDA:548,58,0,0
+BRDA:548,58,1,2
+BRDA:554,59,0,3
+BRDA:554,59,1,3
+BRDA:554,60,0,3
+BRDA:554,60,1,0
+BRDA:564,61,0,13
+BRDA:564,61,1,4
+BRDA:567,62,0,1
+BRDA:567,62,1,12
+BRDA:579,63,0,13
+BRDA:579,63,1,6
+BRDA:593,64,0,7
+BRDA:593,64,1,18
+BRDA:603,65,0,20
+BRDA:603,65,1,14
+BRDA:606,66,0,27
+BRDA:606,66,1,1
+BRDA:609,67,0,3
+BRDA:609,67,1,25
+BRDA:624,68,0,34
+BRDA:624,68,1,0
+BRDA:629,69,0,1
+BRDA:629,69,1,22
+BRDA:632,70,0,1
+BRDA:632,70,1,21
+BRDA:632,71,0,22
+BRDA:632,71,1,5
+BRDA:637,72,0,54
+BRDA:637,72,1,30
+BRDA:638,73,0,54
+BRDA:638,73,1,43
+BRDA:641,74,0,17
+BRDA:641,74,1,15
+BRDA:646,75,0,13
+BRDA:646,75,1,9
+BRDA:660,76,0,2
+BRDA:660,76,1,1
+BRDA:666,77,0,3
+BRDA:666,77,1,0
+BRDA:671,78,0,7
+BRDA:671,78,1,5
+BRDA:680,79,0,3
+BRDA:680,79,1,2
+BRDA:684,80,0,2
+BRDA:684,80,1,1
+BRDA:688,81,0,8
+BRDA:688,81,1,3
+BRDA:689,82,0,1
+BRDA:689,82,1,7
+BRDA:693,83,0,1
+BRDA:693,83,1,6
+BRDA:698,84,0,1
+BRDA:698,84,1,18
+BRDA:705,85,0,12
+BRDA:705,85,1,6
+BRDA:721,86,0,13
+BRDA:721,86,1,2
+BRDA:722,87,0,11
+BRDA:722,87,1,2
+BRDA:724,88,0,21
+BRDA:724,88,1,0
+BRDA:727,89,0,19
+BRDA:727,89,1,2
+BRDA:740,90,0,4
+BRDA:740,90,1,2
+BRDA:761,91,0,10
+BRDA:761,91,1,1
+BRDA:762,92,0,9
+BRDA:762,92,1,1
+BRDA:764,93,0,18
+BRDA:764,93,1,0
+BRDA:767,94,0,17
+BRDA:767,94,1,1
+BRDA:780,95,0,2
+BRDA:780,95,1,1
+BRDA:795,96,0,24
+BRDA:795,96,1,1
+BRDA:801,97,0,29
+BRDA:801,97,1,17
+BRDA:821,98,0,9
+BRDA:821,98,1,3
+BRDA:832,99,0,5
+BRDA:832,99,1,1
+BRDA:834,100,0,0
+BRDA:834,100,1,5
+BRDA:847,101,0,0
+BRDA:847,101,1,10
+BRDA:851,102,0,8
+BRDA:851,102,1,2
+BRDA:861,103,0,5
+BRDA:861,103,1,1
+BRDA:863,104,0,0
+BRDA:863,104,1,5
+BRDA:876,105,0,0
+BRDA:876,105,1,10
+BRDA:880,106,0,8
+BRDA:880,106,1,2
+BRDA:890,107,0,3
+BRDA:890,107,1,17
+BRDA:893,108,0,1
+BRDA:893,108,1,16
+BRDA:897,109,0,17
+BRDA:897,109,1,28
+BRDA:900,110,0,39
+BRDA:900,110,1,6
+BRDA:903,111,0,2
+BRDA:903,111,1,43
+BRDA:906,112,0,1
+BRDA:906,112,1,1
+BRDA:914,113,0,23
+BRDA:914,113,1,33
+BRDA:917,114,0,8
+BRDA:917,114,1,48
+BRDA:923,115,0,2
+BRDA:923,115,1,54
+BRDA:923,116,0,56
+BRDA:923,116,1,9
+BRDA:950,117,0,63
+BRDA:950,117,1,69
+BRDA:950,118,0,132
+BRDA:950,118,1,125
+BRDA:950,118,2,103
+BRDA:952,119,0,1
+BRDA:952,119,1,62
+BRDA:952,120,0,63
+BRDA:952,120,1,5
+BRDA:958,121,0,31
+BRDA:958,121,1,32
+BRDA:961,122,0,9
+BRDA:961,122,1,54
+BRDA:961,123,0,63
+BRDA:961,123,1,34
+BRDA:980,124,0,0
+BRDA:980,124,1,3
+BRDA:984,125,0,1
+BRDA:984,125,1,3
+BRDA:1008,126,0,6
+BRDA:1008,126,1,4
+BRDA:1018,127,0,2
+BRDA:1018,127,1,6
+BRDA:1021,128,0,8
+BRDA:1021,128,1,0
+BRDA:1024,129,0,0
+BRDA:1024,129,1,8
+BRDA:1027,130,0,0
+BRDA:1027,130,1,0
+BRDA:1036,131,0,8
+BRDA:1036,131,1,0
+BRDA:1041,132,0,0
+BRDA:1041,132,1,8
+BRDA:1041,133,0,8
+BRDA:1041,133,1,0
+BRDA:1074,134,0,40
+BRDA:1074,134,1,1
+BRDA:1080,135,0,9
+BRDA:1080,135,1,35
+BRDA:1083,136,0,0
+BRDA:1083,136,1,44
+BRDA:1083,137,0,44
+BRDA:1083,137,1,0
+BRDA:1090,138,0,8
+BRDA:1090,138,1,54
+BRDA:1091,139,0,33
+BRDA:1091,139,1,21
+BRDA:1092,140,0,3
+BRDA:1092,140,1,30
+BRDA:1092,141,0,33
+BRDA:1092,141,1,30
+BRDA:1097,142,0,21
+BRDA:1097,142,1,0
+BRDA:1105,143,0,0
+BRDA:1105,143,1,21
+BRDA:1112,144,0,9
+BRDA:1112,144,1,35
+BRDA:1135,145,0,6
+BRDA:1135,145,1,0
+BRDA:1136,146,0,2
+BRDA:1136,146,1,4
+BRDA:1137,147,0,2
+BRDA:1137,147,1,0
+BRDA:1141,148,0,4
+BRDA:1141,148,1,0
+BRDA:1159,149,0,7
+BRDA:1159,149,1,6
+BRDA:1166,150,0,4
+BRDA:1166,150,1,7
+BRDA:1171,151,0,1
+BRDA:1171,151,1,6
+BRDA:1193,152,0,4
+BRDA:1193,152,1,1
+BRDA:1246,153,0,2
+BRDA:1246,153,1,1
+BRDA:1259,154,0,1
+BRDA:1259,154,1,50
+BRDA:1260,155,0,1
+BRDA:1260,155,1,0
+BRDA:1271,156,0,1
+BRDA:1271,156,1,0
+BRDA:1271,157,0,1
+BRDA:1271,157,1,1
+BRDA:1275,158,0,0
+BRDA:1275,158,1,0
+BRDA:1275,159,0,0
+BRDA:1275,159,1,0
+BRF:320
+BRH:272
+end_of_record
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lib/async.js.html b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lib/async.js.html
new file mode 100644
index 00000000000..d1ba21268b8
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lib/async.js.html
@@ -0,0 +1,3597 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <title>Code coverage report for lib/async.js</title>
+ <meta charset="utf-8">
+ <link rel="stylesheet" href="../prettify.css">
+ <link rel="stylesheet" href="../base.css">
+ <style type='text/css'>
+ div.coverage-summary .sorter {
+ background-image: url(../sort-arrow-sprite.png);
+ }
+ </style>
+</head>
+<body>
+<div class="header high">
+ <h1>Code coverage report for <span class="entity">lib/async.js</span></h1>
+ <h2>
+ Statements: <span class="metric">94.88% <small>(611 / 644)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
+ Branches: <span class="metric">86.91% <small>(239 / 275)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
+ Functions: <span class="metric">95.41% <small>(187 / 196)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
+ Lines: <span class="metric">94.85% <small>(608 / 641)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
+ Ignored: <span class="metric"><span class="ignore-none">none</span></span> &nbsp;&nbsp;&nbsp;&nbsp;
+ </h2>
+ <div class="path"><a href="../index.html">All files</a> &#187; <a href="index.html">lib/</a> &#187; async.js</div>
+</div>
+<div class="body">
+<pre><table class="coverage">
+<tr><td class="line-count">1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+994
+995
+996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185</td><td class="line-coverage"><span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">200</span>
+<span class="cline-any cline-yes">200</span>
+<span class="cline-any cline-yes">200</span>
+<span class="cline-any cline-yes">196</span>
+<span class="cline-any cline-yes">196</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">168</span>
+<span class="cline-any cline-yes">168</span>
+<span class="cline-any cline-yes">176</span>
+<span class="cline-any cline-yes">157</span>
+<span class="cline-any cline-yes">157</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">138</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">39</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">328</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">328</span>
+<span class="cline-any cline-yes">480</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">104</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">104</span>
+<span class="cline-any cline-yes">148</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">104</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">56</span>
+<span class="cline-any cline-yes">54</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">56</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">5</span>
+<span class="cline-any cline-yes">11</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">76</span>
+<span class="cline-any cline-yes">76</span>
+<span class="cline-any cline-yes">76</span>
+<span class="cline-any cline-yes">76</span>
+<span class="cline-any cline-yes">61</span>
+<span class="cline-any cline-yes">61</span>
+<span class="cline-any cline-yes">243</span>
+<span class="cline-any cline-yes">243</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">15</span>
+<span class="cline-any cline-yes">15</span>
+<span class="cline-any cline-yes">15</span>
+<span class="cline-any cline-yes">53</span>
+<span class="cline-any cline-yes">53</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">50259</span>
+<span class="cline-any cline-yes">50259</span>
+<span class="cline-any cline-yes">50259</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">50259</span>
+<span class="cline-any cline-yes">151</span>
+<span class="cline-any cline-yes">151</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">50259</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">50259</span>
+<span class="cline-any cline-yes">50299</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">50259</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">19</span>
+<span class="cline-any cline-yes">59</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">50236</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">5</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">5</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">45</span>
+<span class="cline-any cline-yes">45</span>
+<span class="cline-any cline-yes">45</span>
+<span class="cline-any cline-yes">45</span>
+<span class="cline-any cline-yes">45</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">39</span>
+<span class="cline-any cline-yes">109</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">105</span>
+<span class="cline-any cline-yes">16</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">89</span>
+<span class="cline-any cline-yes">89</span>
+<span class="cline-any cline-yes">31</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">44</span>
+<span class="cline-any cline-yes">44</span>
+<span class="cline-any cline-yes">44</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">123</span>
+<span class="cline-any cline-yes">123</span>
+<span class="cline-any cline-yes">123</span>
+<span class="cline-any cline-yes">29</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">94</span>
+<span class="cline-any cline-yes">90</span>
+<span class="cline-any cline-yes">11</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">79</span>
+<span class="cline-any cline-yes">20</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">59</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">94</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">44</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">32</span>
+<span class="cline-any cline-yes">32</span>
+<span class="cline-any cline-yes">32</span>
+<span class="cline-any cline-yes">32</span>
+<span class="cline-any cline-yes">32</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">29</span>
+<span class="cline-any cline-yes">29</span>
+<span class="cline-any cline-yes">29</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">29</span>
+<span class="cline-any cline-yes">119</span>
+<span class="cline-any cline-yes">12</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">107</span>
+<span class="cline-any cline-yes">173</span>
+<span class="cline-any cline-yes">173</span>
+<span class="cline-any cline-yes">71</span>
+<span class="cline-any cline-yes">71</span>
+<span class="cline-any cline-yes">17</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">71</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">102</span>
+<span class="cline-any cline-yes">102</span>
+<span class="cline-any cline-yes">97</span>
+<span class="cline-any cline-yes">97</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">90</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">5</span>
+<span class="cline-any cline-yes">19</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">5</span>
+<span class="cline-any cline-yes">12</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">25</span>
+<span class="cline-any cline-yes">25</span>
+<span class="cline-any cline-yes">25</span>
+<span class="cline-any cline-yes">69</span>
+<span class="cline-any cline-yes">67</span>
+<span class="cline-any cline-yes">67</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">25</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">11</span>
+<span class="cline-any cline-yes">26</span>
+<span class="cline-any cline-yes">25</span>
+<span class="cline-any cline-yes">25</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">10</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">5</span>
+<span class="cline-any cline-yes">15</span>
+<span class="cline-any cline-yes">15</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">14</span>
+<span class="cline-any cline-yes">14</span>
+<span class="cline-any cline-yes">14</span>
+<span class="cline-any cline-yes">14</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">13</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">13</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">28</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">13</span>
+<span class="cline-any cline-yes">19</span>
+<span class="cline-any cline-yes">13</span>
+<span class="cline-any cline-yes">13</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">25</span>
+<span class="cline-any cline-yes">25</span>
+<span class="cline-any cline-yes">47</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">13</span>
+<span class="cline-any cline-yes">25</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">13</span>
+<span class="cline-any cline-yes">36</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">30</span>
+<span class="cline-any cline-yes">30</span>
+<span class="cline-any cline-yes">29</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">30</span>
+<span class="cline-any cline-yes">5</span>
+<span class="cline-any cline-yes">5</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">5</span>
+<span class="cline-any cline-yes">5</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">25</span>
+<span class="cline-any cline-yes">25</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">36</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">36</span>
+<span class="cline-any cline-yes">36</span>
+<span class="cline-any cline-yes">36</span>
+<span class="cline-any cline-yes">23</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">22</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">56</span>
+<span class="cline-any cline-yes">54</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">34</span>
+<span class="cline-any cline-yes">19</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">15</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">22</span>
+<span class="cline-any cline-yes">13</span>
+<span class="cline-any cline-yes">13</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">13</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">13</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">18</span>
+<span class="cline-any cline-yes">19</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">18</span>
+<span class="cline-any cline-yes">18</span>
+<span class="cline-any cline-yes">18</span>
+<span class="cline-any cline-yes">12</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">18</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">13</span>
+<span class="cline-any cline-yes">13</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">13</span>
+<span class="cline-any cline-yes">27</span>
+<span class="cline-any cline-yes">27</span>
+<span class="cline-any cline-yes">27</span>
+<span class="cline-any cline-yes">23</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">27</span>
+<span class="cline-any cline-yes">27</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">13</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">10</span>
+<span class="cline-any cline-yes">10</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">10</span>
+<span class="cline-any cline-yes">21</span>
+<span class="cline-any cline-yes">21</span>
+<span class="cline-any cline-yes">21</span>
+<span class="cline-any cline-yes">19</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">21</span>
+<span class="cline-any cline-yes">21</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">10</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">25</span>
+<span class="cline-any cline-yes">24</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">25</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">38</span>
+<span class="cline-any cline-yes">46</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">38</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">5</span>
+<span class="cline-any cline-yes">5</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">5</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">10</span>
+<span class="cline-any cline-yes">10</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">10</span>
+<span class="cline-any cline-yes">10</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">5</span>
+<span class="cline-any cline-yes">5</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">5</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">10</span>
+<span class="cline-any cline-yes">10</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">10</span>
+<span class="cline-any cline-yes">10</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">27</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">24</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">92</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">91</span>
+<span class="cline-any cline-yes">91</span>
+<span class="cline-any cline-yes">84</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">91</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">89</span>
+<span class="cline-any cline-yes">105</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">105</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">97</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">105</span>
+<span class="cline-any cline-yes">28</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">105</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">26</span>
+<span class="cline-any cline-yes">26</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">84</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">207</span>
+<span class="cline-any cline-yes">89</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">89</span>
+<span class="cline-any cline-yes">112</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">89</span>
+<span class="cline-any cline-yes">30</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">89</span>
+<span class="cline-any cline-yes">89</span>
+<span class="cline-any cline-yes">89</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">89</span>
+<span class="cline-any cline-yes">89</span>
+<span class="cline-any cline-yes">89</span>
+<span class="cline-any cline-yes">112</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">89</span>
+<span class="cline-any cline-yes">27</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">89</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">50</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">5</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">4</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">5</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">26</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">21</span>
+<span class="cline-any cline-yes">63</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">20</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">10</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-yes">10</span>
+<span class="cline-any cline-yes">10</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">4</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">4</span>
+<span class="cline-any cline-yes">4</span>
+<span class="cline-any cline-yes">8</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">11</span>
+<span class="cline-any cline-yes">11</span>
+<span class="cline-any cline-yes">11</span>
+<span class="cline-any cline-yes">11</span>
+<span class="cline-any cline-yes">4</span>
+<span class="cline-any cline-yes">4</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-yes">4</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-yes">10</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">7</span>
+<span class="cline-any cline-yes">16</span>
+<span class="cline-any cline-yes">15</span>
+<span class="cline-any cline-yes">15</span>
+<span class="cline-any cline-yes">15</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">6</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">9</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">3</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">50052</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">50050</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">2</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">24</span>
+<span class="cline-any cline-yes">50072</span>
+<span class="cline-any cline-yes">50072</span>
+<span class="cline-any cline-yes">50072</span>
+<span class="cline-any cline-yes">50070</span>
+<span class="cline-any cline-yes">50070</span>
+<span class="cline-any cline-yes">50017</span>
+<span class="cline-any cline-yes">50017</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">53</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">50072</span>
+<span class="cline-any cline-yes">50072</span>
+<span class="cline-any cline-yes">50072</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-yes">1</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-no">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span>
+<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">/*!
+ * async
+ * https://github.com/caolan/async
+ *
+ * Copyright 2010-2014 Caolan McMahon
+ * Released under the MIT license
+ */
+(function () {
+&nbsp;
+ var async = {};
+ function noop() {}
+&nbsp;
+ // global on the server, window in the browser
+ var root, previous_async;
+&nbsp;
+ <span class="missing-if-branch" title="if path not taken" >I</span>if (typeof window == 'object' &amp;&amp; <span class="branch-1 cbranch-no" title="branch not covered" >this === window)</span> {
+<span class="cstat-no" title="statement not covered" > root = window;</span>
+ }
+ else <span class="missing-if-branch" title="else path not taken" >E</span>if (typeof global == 'object' &amp;&amp; this === global) {
+ root = global;
+ }
+ else {
+<span class="cstat-no" title="statement not covered" > root = this;</span>
+ }
+&nbsp;
+ <span class="missing-if-branch" title="else path not taken" >E</span>if (root != null) {
+ previous_async = root.async;
+ }
+&nbsp;
+ async.noConflict = <span class="fstat-no" title="function not covered" >function () {</span>
+<span class="cstat-no" title="statement not covered" > root.async = previous_async;</span>
+<span class="cstat-no" title="statement not covered" > return async;</span>
+ };
+&nbsp;
+ function only_once(fn) {
+ var called = false;
+ return function() {
+ if (called) throw new Error("Callback was already called.");
+ called = true;
+ fn.apply(this, arguments);
+ };
+ }
+&nbsp;
+ function _once(fn) {
+ var called = false;
+ return function() {
+ if (called) return;
+ called = true;
+ fn.apply(this, arguments);
+ };
+ }
+&nbsp;
+ //// cross-browser compatiblity functions ////
+&nbsp;
+ var _toString = Object.prototype.toString;
+&nbsp;
+ var _isArray = Array.isArray || <span class="fstat-no" title="function not covered" ><span class="branch-1 cbranch-no" title="branch not covered" >function (obj) {</span></span>
+<span class="cstat-no" title="statement not covered" > return _toString.call(obj) === '[object Array]';</span>
+ };
+&nbsp;
+ function _isArrayLike(arr) {
+ return _isArray(arr) || (
+ // has a positive integer length property
+ typeof arr.length === "number" &amp;&amp;
+ arr.length &gt;= 0 &amp;&amp;
+ arr.length % 1 === 0
+ );
+ }
+&nbsp;
+ function _each(coll, iterator) {
+ return _isArrayLike(coll) ?
+ _arrayEach(coll, iterator) :
+ _forEachOf(coll, iterator);
+ }
+&nbsp;
+ function _arrayEach(arr, iterator) {
+ var index = -1,
+ length = arr.length;
+&nbsp;
+ while (++index &lt; length) {
+ iterator(arr[index], index, arr);
+ }
+ }
+&nbsp;
+ function _map(arr, iterator) {
+ var index = -1,
+ length = arr.length,
+ result = Array(length);
+&nbsp;
+ while (++index &lt; length) {
+ result[index] = iterator(arr[index], index, arr);
+ }
+ return result;
+ }
+&nbsp;
+ function _reduce(arr, iterator, memo) {
+ _arrayEach(arr, function (x, i, a) {
+ memo = iterator(memo, x, i, a);
+ });
+ return memo;
+ }
+&nbsp;
+ function _forEachOf(object, iterator) {
+ _arrayEach(_keys(object), function (key) {
+ iterator(object[key], key);
+ });
+ }
+&nbsp;
+ var _keys = Object.keys || <span class="fstat-no" title="function not covered" ><span class="branch-1 cbranch-no" title="branch not covered" >function (obj) {</span></span>
+<span class="cstat-no" title="statement not covered" > var keys = [];</span>
+<span class="cstat-no" title="statement not covered" > for (var k in obj) {</span>
+<span class="cstat-no" title="statement not covered" > if (obj.hasOwnProperty(k)) {</span>
+<span class="cstat-no" title="statement not covered" > keys.push(k);</span>
+ }
+ }
+<span class="cstat-no" title="statement not covered" > return keys;</span>
+ };
+&nbsp;
+ function _keyIterator(coll) {
+ var i = -1;
+ var len;
+ var keys;
+ if (_isArrayLike(coll)) {
+ len = coll.length;
+ return function next() {
+ i++;
+ return i &lt; len ? i : null;
+ };
+ } else {
+ keys = _keys(coll);
+ len = keys.length;
+ return function next() {
+ i++;
+ return i &lt; len ? keys[i] : null;
+ };
+ }
+ }
+&nbsp;
+ function _baseSlice(arr, start) {
+ start = start || 0;
+ var index = -1;
+ var length = arr.length;
+&nbsp;
+ if (start) {
+ length -= start;
+ length = length &lt; 0 ? 0 : length;
+ }
+ var result = Array(length);
+&nbsp;
+ while (++index &lt; length) {
+ result[index] = arr[index + start];
+ }
+ return result;
+ }
+&nbsp;
+ function _withoutIndex(iterator) {
+ return function (value, index, callback) {
+ return iterator(value, callback);
+ };
+ }
+&nbsp;
+ //// exported async module functions ////
+&nbsp;
+ //// nextTick implementation with browser-compatible fallback ////
+&nbsp;
+ // capture the global reference to guard against fakeTimer mocks
+ var _setImmediate;
+ <span class="missing-if-branch" title="else path not taken" >E</span>if (typeof setImmediate === 'function') {
+ _setImmediate = setImmediate;
+ }
+&nbsp;
+ <span class="missing-if-branch" title="if path not taken" >I</span>if (typeof process === 'undefined' || !(process.nextTick)) {
+<span class="cstat-no" title="statement not covered" > if (_setImmediate) {</span>
+<span class="cstat-no" title="statement not covered" > async.nextTick = <span class="fstat-no" title="function not covered" >function (fn) {</span></span>
+ // not a direct alias for IE10 compatibility
+<span class="cstat-no" title="statement not covered" > _setImmediate(fn);</span>
+ };
+<span class="cstat-no" title="statement not covered" > async.setImmediate = async.nextTick;</span>
+ }
+ else {
+<span class="cstat-no" title="statement not covered" > async.nextTick = <span class="fstat-no" title="function not covered" >function (fn) {</span></span>
+<span class="cstat-no" title="statement not covered" > setTimeout(fn, 0);</span>
+ };
+<span class="cstat-no" title="statement not covered" > async.setImmediate = async.nextTick;</span>
+ }
+ }
+ else {
+ async.nextTick = process.nextTick;
+ <span class="missing-if-branch" title="else path not taken" >E</span>if (_setImmediate) {
+ async.setImmediate = function (fn) {
+ // not a direct alias for IE10 compatibility
+ _setImmediate(fn);
+ };
+ }
+ else {
+<span class="cstat-no" title="statement not covered" > async.setImmediate = async.nextTick;</span>
+ }
+ }
+&nbsp;
+ async.forEach =
+ async.each = function (arr, iterator, callback) {
+ return async.eachOf(arr, _withoutIndex(iterator), callback);
+ };
+&nbsp;
+ async.forEachSeries =
+ async.eachSeries = function (arr, iterator, callback) {
+ return async.eachOfSeries(arr, _withoutIndex(iterator), callback);
+ };
+&nbsp;
+&nbsp;
+ async.forEachLimit =
+ async.eachLimit = function (arr, limit, iterator, callback) {
+ return _eachOfLimit(limit)(arr, _withoutIndex(iterator), callback);
+ };
+&nbsp;
+ async.forEachOf =
+ async.eachOf = function (object, iterator, callback) {
+ callback = _once(callback || noop);
+ object = object || [];
+ var size = object.length || _keys(object).length;
+ var completed = 0;
+ if (!size) {
+ return callback(null);
+ }
+ _each(object, function (value, key) {
+ iterator(object[key], key, only_once(done));
+ });
+ function done(err) {
+ if (err) {
+ callback(err);
+ }
+ else {
+ completed += 1;
+ if (completed &gt;= size) {
+ callback(null);
+ }
+ }
+ }
+ };
+&nbsp;
+ async.forEachOfSeries =
+ async.eachOfSeries = function (obj, iterator, callback) {
+ callback = _once(callback || noop);
+ obj = obj || [];
+ var nextKey = _keyIterator(obj);
+ function iterate() {
+ var sync = true;
+ var key = nextKey();
+ if (key === null) {
+ return callback(null);
+ }
+ iterator(obj[key], key, function (err) {
+ if (err) {
+ callback(err);
+ }
+ else {
+ if (sync) {
+ async.nextTick(iterate);
+ }
+ else {
+ iterate();
+ }
+ }
+ });
+ sync = false;
+ }
+ iterate();
+ };
+&nbsp;
+&nbsp;
+&nbsp;
+ async.forEachOfLimit =
+ async.eachOfLimit = function (obj, limit, iterator, callback) {
+ _eachOfLimit(limit)(obj, iterator, callback);
+ };
+&nbsp;
+ function _eachOfLimit(limit) {
+&nbsp;
+ return function (obj, iterator, callback) {
+ callback = _once(callback || noop);
+ obj = obj || [];
+ var nextKey = _keyIterator(obj);
+ if (limit &lt;= 0) {
+ return callback(null);
+ }
+ var done = false;
+ var running = 0;
+ var errored = false;
+&nbsp;
+ (function replenish () {
+ if (done &amp;&amp; running &lt;= 0) {
+ return callback(null);
+ }
+&nbsp;
+ while (running &lt; limit &amp;&amp; !errored) {
+ var key = nextKey();
+ if (key === null) {
+ done = true;
+ if (running &lt;= 0) {
+ callback(null);
+ }
+ return;
+ }
+ running += 1;
+ iterator(obj[key], key, function (err) {
+ running -= 1;
+ if (err) {
+ callback(err);
+ errored = true;
+ }
+ else {
+ replenish();
+ }
+ });
+ }
+ })();
+ };
+ }
+&nbsp;
+&nbsp;
+ function doParallel(fn) {
+ return function (obj, iterator, callback) {
+ return fn(async.eachOf, obj, iterator, callback);
+ };
+ }
+ function doParallelLimit(limit, fn) {
+ return function (obj, iterator, callback) {
+ return fn(_eachOfLimit(limit), obj, iterator, callback);
+ };
+ }
+ function doSeries(fn) {
+ return function (obj, iterator, callback) {
+ return fn(async.eachOfSeries, obj, iterator, callback);
+ };
+ }
+&nbsp;
+ function _asyncMap(eachfn, arr, iterator, callback) {
+ callback = _once(callback || noop);
+ var results = [];
+ eachfn(arr, function (value, index, callback) {
+ iterator(value, function (err, v) {
+ results[index] = v;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, results);
+ });
+ }
+&nbsp;
+ async.map = doParallel(_asyncMap);
+ async.mapSeries = doSeries(_asyncMap);
+ async.mapLimit = function (arr, limit, iterator, callback) {
+ return _mapLimit(limit)(arr, iterator, callback);
+ };
+&nbsp;
+ function _mapLimit(limit) {
+ return doParallelLimit(limit, _asyncMap);
+ }
+&nbsp;
+ // reduce only has a series version, as doing reduce in parallel won't
+ // work in many situations.
+ async.inject =
+ async.foldl =
+ async.reduce = function (arr, memo, iterator, callback) {
+ async.eachOfSeries(arr, function (x, i, callback) {
+ iterator(memo, x, function (err, v) {
+ memo = v;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err || null, memo);
+ });
+ };
+&nbsp;
+ async.foldr =
+ async.reduceRight = function (arr, memo, iterator, callback) {
+ var reversed = _map(arr, function (x) {
+ return x;
+ }).reverse();
+ async.reduce(reversed, memo, iterator, callback);
+ };
+&nbsp;
+ function _filter(eachfn, arr, iterator, callback) {
+ var results = [];
+ arr = _map(arr, function (x, i) {
+ return {index: i, value: x};
+ });
+ eachfn(arr, function (x, index, callback) {
+ iterator(x.value, function (v) {
+ if (v) {
+ results.push(x);
+ }
+ callback();
+ });
+ }, function () {
+ callback(_map(results.sort(function (a, b) {
+ return a.index - b.index;
+ }), function (x) {
+ return x.value;
+ }));
+ });
+ }
+&nbsp;
+ async.select =
+ async.filter = doParallel(_filter);
+&nbsp;
+ async.selectSeries =
+ async.filterSeries = doSeries(_filter);
+&nbsp;
+ function _reject(eachfn, arr, iterator, callback) {
+ var results = [];
+ arr = _map(arr, function (x, i) {
+ return {index: i, value: x};
+ });
+ eachfn(arr, function (x, index, callback) {
+ iterator(x.value, function (v) {
+ if (!v) {
+ results.push(x);
+ }
+ callback();
+ });
+ }, function () {
+ callback(_map(results.sort(<span class="fstat-no" title="function not covered" >function (a, b) {</span>
+<span class="cstat-no" title="statement not covered" > return a.index - b.index;</span>
+ }), function (x) {
+ return x.value;
+ }));
+ });
+ }
+ async.reject = doParallel(_reject);
+ async.rejectSeries = doSeries(_reject);
+&nbsp;
+ function _detect(eachfn, arr, iterator, main_callback) {
+ eachfn(arr, function (x, index, callback) {
+ iterator(x, function (result) {
+ if (result) {
+ main_callback(x);
+ main_callback = noop;
+ }
+ else {
+ callback();
+ }
+ });
+ }, <span class="fstat-no" title="function not covered" >function () {</span>
+<span class="cstat-no" title="statement not covered" > main_callback();</span>
+ });
+ }
+ async.detect = doParallel(_detect);
+ async.detectSeries = doSeries(_detect);
+&nbsp;
+ async.any =
+ async.some = function (arr, iterator, main_callback) {
+ async.eachOf(arr, function (x, _, callback) {
+ iterator(x, function (v) {
+ if (v) {
+ main_callback(true);
+ main_callback = noop;
+ }
+ callback();
+ });
+ }, function () {
+ main_callback(false);
+ });
+ };
+&nbsp;
+ async.all =
+ async.every = function (arr, iterator, main_callback) {
+ async.eachOf(arr, function (x, _, callback) {
+ iterator(x, function (v) {
+ if (!v) {
+ main_callback(false);
+ main_callback = noop;
+ }
+ callback();
+ });
+ }, function () {
+ main_callback(true);
+ });
+ };
+&nbsp;
+ async.sortBy = function (arr, iterator, callback) {
+ async.map(arr, function (x, callback) {
+ iterator(x, function (err, criteria) {
+ <span class="missing-if-branch" title="if path not taken" >I</span>if (err) {
+<span class="cstat-no" title="statement not covered" > callback(err);</span>
+ }
+ else {
+ callback(null, {value: x, criteria: criteria});
+ }
+ });
+ }, function (err, results) {
+ <span class="missing-if-branch" title="if path not taken" >I</span>if (err) {
+<span class="cstat-no" title="statement not covered" > return callback(err);</span>
+ }
+ else {
+ callback(null, _map(results.sort(comparator), function (x) {
+ return x.value;
+ }));
+ }
+&nbsp;
+ });
+&nbsp;
+ function comparator(left, right) {
+ var a = left.criteria, b = right.criteria;
+ return a &lt; b ? -1 : a &gt; b ? 1 : <span class="branch-1 cbranch-no" title="branch not covered" >0;</span>
+ }
+ };
+&nbsp;
+ async.auto = function (tasks, callback) {
+ callback = _once(callback || noop);
+ var keys = _keys(tasks);
+ var remainingTasks = keys.length;
+ if (!remainingTasks) {
+ return callback(null);
+ }
+&nbsp;
+ var results = {};
+&nbsp;
+ var listeners = [];
+ function addListener(fn) {
+ listeners.unshift(fn);
+ }
+ function removeListener(fn) {
+ for (var i = 0; i &lt; listeners.length; i += 1) {
+ if (listeners[i] === fn) {
+ listeners.splice(i, 1);
+ return;
+ }
+ }
+ }
+ function taskComplete() {
+ remainingTasks--;
+ _arrayEach(listeners.slice(0), function (fn) {
+ fn();
+ });
+ }
+&nbsp;
+ addListener(function () {
+ if (!remainingTasks) {
+ callback(null, results);
+ }
+ });
+&nbsp;
+ _arrayEach(keys, function (k) {
+ var task = _isArray(tasks[k]) ? tasks[k]: [tasks[k]];
+ function taskCallback(err) {
+ var args = _baseSlice(arguments, 1);
+ if (args.length &lt;= 1) {
+ args = args[0];
+ }
+ if (err) {
+ var safeResults = {};
+ _arrayEach(_keys(results), function(rkey) {
+ safeResults[rkey] = results[rkey];
+ });
+ safeResults[k] = args;
+ callback(err, safeResults);
+ }
+ else {
+ results[k] = args;
+ async.setImmediate(taskComplete);
+ }
+ }
+ var requires = task.slice(0, Math.abs(task.length - 1)) || <span class="branch-1 cbranch-no" title="branch not covered" >[];</span>
+ // prevent dead-locks
+ var len = requires.length;
+ var dep;
+ while (len--) {
+ if (!(dep = tasks[requires[len]])) {
+ throw new Error('Has inexistant dependency');
+ }
+ if (_isArray(dep) &amp;&amp; !!~dep.indexOf(k)) {
+ throw new Error('Has cyclic dependencies');
+ }
+ }
+ function ready() {
+ return _reduce(requires, function (a, x) {
+ return (a &amp;&amp; results.hasOwnProperty(x));
+ }, true) &amp;&amp; !results.hasOwnProperty(k);
+ }
+ if (ready()) {
+ task[task.length - 1](taskCallback, results);
+ }
+ else {
+ addListener(listener);
+ }
+ function listener() {
+ if (ready()) {
+ removeListener(listener);
+ task[task.length - 1](taskCallback, results);
+ }
+ }
+ });
+ };
+&nbsp;
+ async.retry = function(times, task, callback) {
+ var DEFAULT_TIMES = 5;
+ var attempts = [];
+ // Use defaults if times not passed
+ if (typeof times === 'function') {
+ callback = task;
+ task = times;
+ times = DEFAULT_TIMES;
+ }
+ // Make sure times is a number
+ times = parseInt(times, 10) || <span class="branch-1 cbranch-no" title="branch not covered" >DEFAULT_TIMES;</span>
+&nbsp;
+ function wrappedTask(wrappedCallback, wrappedResults) {
+ function retryAttempt(task, finalAttempt) {
+ return function(seriesCallback) {
+ task(function(err, result){
+ seriesCallback(!err || finalAttempt, {err: err, result: result});
+ }, wrappedResults);
+ };
+ }
+&nbsp;
+ while (times) {
+ attempts.push(retryAttempt(task, !(times-=1)));
+ }
+ async.series(attempts, function(done, data){
+ data = data[data.length - 1];
+ (wrappedCallback || callback)(data.err, data.result);
+ });
+ }
+&nbsp;
+ // If a callback is passed, run this as a controll flow
+ return callback ? wrappedTask() : wrappedTask;
+ };
+&nbsp;
+ async.waterfall = function (tasks, callback) {
+ callback = _once(callback || noop);
+ if (!_isArray(tasks)) {
+ var err = new Error('First argument to waterfall must be an array of functions');
+ return callback(err);
+ }
+ if (!tasks.length) {
+ return callback();
+ }
+ function wrapIterator(iterator) {
+ return function (err) {
+ if (err) {
+ callback.apply(null, arguments);
+ }
+ else {
+ var args = _baseSlice(arguments, 1);
+ var next = iterator.next();
+ if (next) {
+ args.push(wrapIterator(next));
+ }
+ else {
+ args.push(callback);
+ }
+ ensureAsync(iterator).apply(null, args);
+ }
+ };
+ }
+ wrapIterator(async.iterator(tasks))();
+ };
+&nbsp;
+ function _parallel(eachfn, tasks, callback) {
+ callback = callback || noop;
+ var results = _isArrayLike(tasks) ? [] : {};
+&nbsp;
+ eachfn(tasks, function (task, key, callback) {
+ task(function (err) {
+ var args = _baseSlice(arguments, 1);
+ if (args.length &lt;= 1) {
+ args = args[0];
+ }
+ results[key] = args;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, results);
+ });
+ }
+&nbsp;
+ async.parallel = function (tasks, callback) {
+ _parallel(async.eachOf, tasks, callback);
+ };
+&nbsp;
+ async.parallelLimit = function(tasks, limit, callback) {
+ _parallel(_eachOfLimit(limit), tasks, callback);
+ };
+&nbsp;
+ async.series = function (tasks, callback) {
+ callback = callback || noop;
+ var results = _isArrayLike(tasks) ? [] : {};
+&nbsp;
+ async.eachOfSeries(tasks, function (task, key, callback) {
+ task(function (err) {
+ var args = _baseSlice(arguments, 1);
+ if (args.length &lt;= 1) {
+ args = args[0];
+ }
+ results[key] = args;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, results);
+ });
+ };
+&nbsp;
+ async.iterator = function (tasks) {
+ function makeCallback(index) {
+ function fn() {
+ if (tasks.length) {
+ tasks[index].apply(null, arguments);
+ }
+ return fn.next();
+ }
+ fn.next = function () {
+ return (index &lt; tasks.length - 1) ? makeCallback(index + 1): null;
+ };
+ return fn;
+ }
+ return makeCallback(0);
+ };
+&nbsp;
+ async.apply = function (fn) {
+ var args = _baseSlice(arguments, 1);
+ return function () {
+ return fn.apply(
+ null, args.concat(_baseSlice(arguments))
+ );
+ };
+ };
+&nbsp;
+ function _concat(eachfn, arr, fn, callback) {
+ var result = [];
+ eachfn(arr, function (x, index, cb) {
+ fn(x, function (err, y) {
+ result = result.concat(y || []);
+ cb(err);
+ });
+ }, function (err) {
+ callback(err, result);
+ });
+ }
+ async.concat = doParallel(_concat);
+ async.concatSeries = doSeries(_concat);
+&nbsp;
+ async.whilst = function (test, iterator, callback) {
+ if (test()) {
+ iterator(function (err) {
+ <span class="missing-if-branch" title="if path not taken" >I</span>if (err) {
+<span class="cstat-no" title="statement not covered" > return callback(err);</span>
+ }
+ async.whilst(test, iterator, callback);
+ });
+ }
+ else {
+ callback(null);
+ }
+ };
+&nbsp;
+ async.doWhilst = function (iterator, test, callback) {
+ iterator(function (err) {
+ <span class="missing-if-branch" title="if path not taken" >I</span>if (err) {
+<span class="cstat-no" title="statement not covered" > return callback(err);</span>
+ }
+ var args = _baseSlice(arguments, 1);
+ if (test.apply(null, args)) {
+ async.doWhilst(iterator, test, callback);
+ }
+ else {
+ callback(null);
+ }
+ });
+ };
+&nbsp;
+ async.until = function (test, iterator, callback) {
+ if (!test()) {
+ iterator(function (err) {
+ <span class="missing-if-branch" title="if path not taken" >I</span>if (err) {
+<span class="cstat-no" title="statement not covered" > return callback(err);</span>
+ }
+ async.until(test, iterator, callback);
+ });
+ }
+ else {
+ callback(null);
+ }
+ };
+&nbsp;
+ async.doUntil = function (iterator, test, callback) {
+ iterator(function (err) {
+ <span class="missing-if-branch" title="if path not taken" >I</span>if (err) {
+<span class="cstat-no" title="statement not covered" > return callback(err);</span>
+ }
+ var args = _baseSlice(arguments, 1);
+ if (!test.apply(null, args)) {
+ async.doUntil(iterator, test, callback);
+ }
+ else {
+ callback(null);
+ }
+ });
+ };
+&nbsp;
+ function _queue(worker, concurrency, payload) {
+ if (concurrency == null) {
+ concurrency = 1;
+ }
+ else if(concurrency === 0) {
+ throw new Error('Concurrency must not be zero');
+ }
+ function _insert(q, data, pos, callback) {
+ if (callback != null &amp;&amp; typeof callback !== "function") {
+ throw new Error("task callback must be a function");
+ }
+ q.started = true;
+ if (!_isArray(data)) {
+ data = [data];
+ }
+ if(data.length === 0 &amp;&amp; q.idle()) {
+ // call drain immediately if there are no tasks
+ return async.setImmediate(function() {
+ q.drain();
+ });
+ }
+ _arrayEach(data, function(task) {
+ var item = {
+ data: task,
+ callback: callback || noop
+ };
+&nbsp;
+ if (pos) {
+ q.tasks.unshift(item);
+ } else {
+ q.tasks.push(item);
+ }
+&nbsp;
+ if (q.tasks.length === q.concurrency) {
+ q.saturated();
+ }
+ async.setImmediate(q.process);
+ });
+ }
+&nbsp;
+ var workers = 0;
+ var q = {
+ tasks: [],
+ concurrency: concurrency,
+ saturated: noop,
+ empty: noop,
+ drain: noop,
+ started: false,
+ paused: false,
+ push: function (data, callback) {
+ _insert(q, data, false, callback);
+ },
+ kill: function () {
+ q.drain = noop;
+ q.tasks = [];
+ },
+ unshift: function (data, callback) {
+ _insert(q, data, true, callback);
+ },
+ process: function () {
+ if (!q.paused &amp;&amp; workers &lt; q.concurrency &amp;&amp; q.tasks.length) {
+ var tasks = payload ?
+ q.tasks.splice(0, payload) :
+<span class="branch-1 cbranch-no" title="branch not covered" > q.tasks.splice(0, q.tasks.length);</span>
+&nbsp;
+ var data = _map(tasks, function (task) {
+ return task.data;
+ });
+&nbsp;
+ if (q.tasks.length === 0) {
+ q.empty();
+ }
+ workers += 1;
+ var cb = only_once(next);
+ worker(data, cb);
+ }
+&nbsp;
+ function next() {
+ workers -= 1;
+ var args = arguments;
+ _arrayEach(tasks, function (task) {
+ task.callback.apply(task, args);
+ });
+ if (q.tasks.length + workers === 0) {
+ q.drain();
+ }
+ q.process();
+ }
+ },
+ length: function () {
+ return q.tasks.length;
+ },
+ running: function () {
+ return workers;
+ },
+ idle: function() {
+ return q.tasks.length + workers === 0;
+ },
+ pause: function () {
+ q.paused = true;
+ },
+ resume: function () {
+ if (q.paused === false) { return; }
+ q.paused = false;
+ var resumeCount = Math.min(q.concurrency, q.tasks.length);
+ // Need to call q.process once per concurrent
+ // worker to preserve full concurrency after pause
+ for (var w = 1; w &lt;= resumeCount; w++) {
+ async.setImmediate(q.process);
+ }
+ }
+ };
+ return q;
+ }
+&nbsp;
+ async.queue = function (worker, concurrency) {
+ var q = _queue(function (items, cb) {
+ worker(items[0], cb);
+ }, concurrency, 1);
+&nbsp;
+ return q;
+ };
+&nbsp;
+ async.priorityQueue = function (worker, concurrency) {
+&nbsp;
+ function _compareTasks(a, b){
+ return a.priority - b.priority;
+ }
+&nbsp;
+ function _binarySearch(sequence, item, compare) {
+ var beg = -1,
+ end = sequence.length - 1;
+ while (beg &lt; end) {
+ var mid = beg + ((end - beg + 1) &gt;&gt;&gt; 1);
+ if (compare(item, sequence[mid]) &gt;= 0) {
+ beg = mid;
+ } else {
+ end = mid - 1;
+ }
+ }
+ return beg;
+ }
+&nbsp;
+ function _insert(q, data, priority, callback) {
+ <span class="missing-if-branch" title="if path not taken" >I</span>if (callback != null &amp;&amp; typeof callback !== "function") {
+<span class="cstat-no" title="statement not covered" > throw new Error("task callback must be a function");</span>
+ }
+ q.started = true;
+ <span class="missing-if-branch" title="else path not taken" >E</span>if (!_isArray(data)) {
+ data = [data];
+ }
+ <span class="missing-if-branch" title="if path not taken" >I</span>if(data.length === 0) {
+ // call drain immediately if there are no tasks
+<span class="cstat-no" title="statement not covered" > return async.setImmediate(<span class="fstat-no" title="function not covered" >function() {</span></span>
+<span class="cstat-no" title="statement not covered" > q.drain();</span>
+ });
+ }
+ _arrayEach(data, function(task) {
+ var item = {
+ data: task,
+ priority: priority,
+ callback: typeof callback === 'function' ? callback : <span class="branch-1 cbranch-no" title="branch not covered" >noop</span>
+ };
+&nbsp;
+ q.tasks.splice(_binarySearch(q.tasks, item, _compareTasks) + 1, 0, item);
+&nbsp;
+ if (q.tasks.length === q.concurrency) {
+ q.saturated();
+ }
+ async.setImmediate(q.process);
+ });
+ }
+&nbsp;
+ // Start with a normal queue
+ var q = async.queue(worker, concurrency);
+&nbsp;
+ // Override push to accept second parameter representing priority
+ q.push = function (data, priority, callback) {
+ _insert(q, data, priority, callback);
+ };
+&nbsp;
+ // Remove unshift function
+ delete q.unshift;
+&nbsp;
+ return q;
+ };
+&nbsp;
+ async.cargo = function (worker, payload) {
+ return _queue(worker, 1, payload);
+ };
+&nbsp;
+ function _console_fn(name) {
+ return function (fn) {
+ var args = _baseSlice(arguments, 1);
+ fn.apply(null, args.concat([function (err) {
+ var args = _baseSlice(arguments, 1);
+ <span class="missing-if-branch" title="else path not taken" >E</span>if (typeof console !== 'undefined') {
+ if (err) {
+ <span class="missing-if-branch" title="else path not taken" >E</span>if (console.error) {
+ console.error(err);
+ }
+ }
+ else <span class="missing-if-branch" title="else path not taken" >E</span>if (console[name]) {
+ _arrayEach(args, function (x) {
+ console[name](x);
+ });
+ }
+ }
+ }]));
+ };
+ }
+ async.log = _console_fn('log');
+ async.dir = _console_fn('dir');
+ /*async.info = _console_fn('info');
+ async.warn = _console_fn('warn');
+ async.error = _console_fn('error');*/
+&nbsp;
+ async.memoize = function (fn, hasher) {
+ var memo = {};
+ var queues = {};
+ hasher = hasher || function (x) {
+ return x;
+ };
+ function memoized() {
+ var args = _baseSlice(arguments);
+ var callback = args.pop();
+ var key = hasher.apply(null, args);
+ if (key in memo) {
+ async.nextTick(function () {
+ callback.apply(null, memo[key]);
+ });
+ }
+ else if (key in queues) {
+ queues[key].push(callback);
+ }
+ else {
+ queues[key] = [callback];
+ fn.apply(null, args.concat([function () {
+ memo[key] = _baseSlice(arguments);
+ var q = queues[key];
+ delete queues[key];
+ for (var i = 0, l = q.length; i &lt; l; i++) {
+ q[i].apply(null, arguments);
+ }
+ }]));
+ }
+ }
+ memoized.memo = memo;
+ memoized.unmemoized = fn;
+ return memoized;
+ };
+&nbsp;
+ async.unmemoize = function (fn) {
+ return function () {
+ return (fn.unmemoized || fn).apply(null, arguments);
+ };
+ };
+&nbsp;
+ async.times = function (count, iterator, callback) {
+ var counter = [];
+ for (var i = 0; i &lt; count; i++) {
+ counter.push(i);
+ }
+ return async.map(counter, iterator, callback);
+ };
+&nbsp;
+ async.timesSeries = function (count, iterator, callback) {
+ var counter = [];
+ for (var i = 0; i &lt; count; i++) {
+ counter.push(i);
+ }
+ return async.mapSeries(counter, iterator, callback);
+ };
+&nbsp;
+ async.seq = function (/* functions... */) {
+ var fns = arguments;
+ return function () {
+ var that = this;
+ var args = _baseSlice(arguments);
+&nbsp;
+ var callback = args.slice(-1)[0];
+ if (typeof callback == 'function') {
+ args.pop();
+ } else {
+ callback = noop;
+ }
+&nbsp;
+ async.reduce(fns, args, function (newargs, fn, cb) {
+ fn.apply(that, newargs.concat([function () {
+ var err = arguments[0];
+ var nextargs = _baseSlice(arguments, 1);
+ cb(err, nextargs);
+ }]));
+ },
+ function (err, results) {
+ callback.apply(that, [err].concat(results));
+ });
+ };
+ };
+&nbsp;
+ async.compose = function (/* functions... */) {
+ return async.seq.apply(null, Array.prototype.reverse.call(arguments));
+ };
+&nbsp;
+&nbsp;
+ function _applyEach(eachfn, fns /*args...*/) {
+ function go() {
+ var that = this;
+ var args = _baseSlice(arguments);
+ var callback = args.pop();
+ return eachfn(fns, function (fn, _, cb) {
+ fn.apply(that, args.concat([cb]));
+ },
+ callback);
+ }
+ if (arguments.length &gt; 2) {
+ var args = _baseSlice(arguments, 2);
+ return go.apply(this, args);
+ }
+ else {
+ return go;
+ }
+ }
+&nbsp;
+ async.applyEach = function (/*fns, args...*/) {
+ var args = _baseSlice(arguments);
+ return _applyEach.apply(null, [async.eachOf].concat(args));
+ };
+ async.applyEachSeries = function (/*fns, args...*/) {
+ var args = _baseSlice(arguments);
+ return _applyEach.apply(null, [async.eachOfSeries].concat(args));
+ };
+&nbsp;
+&nbsp;
+ async.forever = function (fn, callback) {
+ var done = only_once(callback || <span class="branch-1 cbranch-no" title="branch not covered" >noop)</span>;
+ var task = ensureAsync(fn);
+ function next(err) {
+ if (err) {
+ return done(err);
+ }
+ task(next);
+ }
+ next();
+ };
+&nbsp;
+ function ensureAsync(fn) {
+ return function (/*...args, callback*/) {
+ var args = _baseSlice(arguments);
+ var callback = args.pop();
+ args.push(function () {
+ var innerArgs = arguments;
+ if (sync) {
+ async.setImmediate(function () {
+ callback.apply(null, innerArgs);
+ });
+ } else {
+ callback.apply(null, innerArgs);
+ }
+ });
+ var sync = true;
+ fn.apply(this, args);
+ sync = false;
+ };
+ }
+&nbsp;
+ async.ensureAsync = ensureAsync;
+&nbsp;
+ // Node.js
+ <span class="missing-if-branch" title="else path not taken" >E</span>if (typeof module !== 'undefined' &amp;&amp; module.exports) {
+ module.exports = async;
+ }
+ // AMD / RequireJS
+ else <span class="cstat-no" title="statement not covered" >if (typeof define !== 'undefined' &amp;&amp; define.amd) {</span>
+<span class="cstat-no" title="statement not covered" > define([], <span class="fstat-no" title="function not covered" >function () {</span></span>
+<span class="cstat-no" title="statement not covered" > return async;</span>
+ });
+ }
+ // included directly via &lt;script&gt; tag
+ else {
+<span class="cstat-no" title="statement not covered" > root.async = async;</span>
+ }
+&nbsp;
+}());
+&nbsp;</pre></td></tr>
+</table></pre>
+
+</div>
+<div class="footer">
+ <div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Mon Jun 01 2015 15:22:05 GMT-0700 (PDT)</div>
+</div>
+<script src="../prettify.js"></script>
+<script>
+window.onload = function () {
+ if (typeof prettyPrint === 'function') {
+ prettyPrint();
+ }
+};
+</script>
+<script src="../sorter.js"></script>
+</body>
+</html>
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lib/index.html b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lib/index.html
new file mode 100644
index 00000000000..c7eedeb3825
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/lib/index.html
@@ -0,0 +1,73 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <title>Code coverage report for lib/</title>
+ <meta charset="utf-8">
+ <link rel="stylesheet" href="../prettify.css">
+ <link rel="stylesheet" href="../base.css">
+ <style type='text/css'>
+ div.coverage-summary .sorter {
+ background-image: url(../sort-arrow-sprite.png);
+ }
+ </style>
+</head>
+<body>
+<div class="header high">
+ <h1>Code coverage report for <span class="entity">lib/</span></h1>
+ <h2>
+ Statements: <span class="metric">94.88% <small>(611 / 644)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
+ Branches: <span class="metric">86.91% <small>(239 / 275)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
+ Functions: <span class="metric">95.41% <small>(187 / 196)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
+ Lines: <span class="metric">94.85% <small>(608 / 641)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
+ Ignored: <span class="metric"><span class="ignore-none">none</span></span> &nbsp;&nbsp;&nbsp;&nbsp;
+ </h2>
+ <div class="path"><a href="../index.html">All files</a> &#187; lib/</div>
+</div>
+<div class="body">
+<div class="coverage-summary">
+<table>
+<thead>
+<tr>
+ <th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
+ <th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
+ <th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
+ <th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
+ <th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
+ <th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
+ <th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
+ <th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
+ <th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
+ <th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
+</tr>
+</thead>
+<tbody><tr>
+ <td class="file high" data-value="async.js"><a href="async.js.html">async.js</a></td>
+ <td data-value="94.88" class="pic high"><span class="cover-fill" style="width: 94px;"></span><span class="cover-empty" style="width:6px;"></span></td>
+ <td data-value="94.88" class="pct high">94.88%</td>
+ <td data-value="644" class="abs high">(611&nbsp;/&nbsp;644)</td>
+ <td data-value="86.91" class="pct high">86.91%</td>
+ <td data-value="275" class="abs high">(239&nbsp;/&nbsp;275)</td>
+ <td data-value="95.41" class="pct high">95.41%</td>
+ <td data-value="196" class="abs high">(187&nbsp;/&nbsp;196)</td>
+ <td data-value="94.85" class="pct high">94.85%</td>
+ <td data-value="641" class="abs high">(608&nbsp;/&nbsp;641)</td>
+ </tr>
+
+</tbody>
+</table>
+</div>
+</div>
+<div class="footer">
+ <div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Mon Jun 01 2015 15:22:05 GMT-0700 (PDT)</div>
+</div>
+<script src="../prettify.js"></script>
+<script>
+window.onload = function () {
+ if (typeof prettyPrint === 'function') {
+ prettyPrint();
+ }
+};
+</script>
+<script src="../sorter.js"></script>
+</body>
+</html>
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/prettify.css b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/prettify.css
new file mode 100644
index 00000000000..b317a7cda31
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/prettify.css
@@ -0,0 +1 @@
+.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/prettify.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/prettify.js
new file mode 100644
index 00000000000..ef51e038668
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/prettify.js
@@ -0,0 +1 @@
+window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V<U;++V){var ae=Z[V];if(ae.ignoreCase){ac=true}else{if(/[a-z]/i.test(ae.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){S=true;ac=false;break}}}var Y={b:8,t:9,n:10,v:11,f:12,r:13};function ab(ah){var ag=ah.charCodeAt(0);if(ag!==92){return ag}var af=ah.charAt(1);ag=Y[af];if(ag){return ag}else{if("0"<=af&&af<="7"){return parseInt(ah.substring(1),8)}else{if(af==="u"||af==="x"){return parseInt(ah.substring(2),16)}else{return ah.charCodeAt(1)}}}}function T(af){if(af<32){return(af<16?"\\x0":"\\x")+af.toString(16)}var ag=String.fromCharCode(af);if(ag==="\\"||ag==="-"||ag==="["||ag==="]"){ag="\\"+ag}return ag}function X(am){var aq=am.substring(1,am.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g"));var ak=[];var af=[];var ao=aq[0]==="^";for(var ar=ao?1:0,aj=aq.length;ar<aj;++ar){var ah=aq[ar];if(/\\[bdsw]/i.test(ah)){ak.push(ah)}else{var ag=ab(ah);var al;if(ar+2<aj&&"-"===aq[ar+1]){al=ab(aq[ar+2]);ar+=2}else{al=ag}af.push([ag,al]);if(!(al<65||ag>122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;ar<af.length;++ar){var at=af[ar];if(at[0]<=ap[1]+1){ap[1]=Math.max(ap[1],at[1])}else{ai.push(ap=at)}}var an=["["];if(ao){an.push("^")}an.push.apply(an,ak);for(var ar=0;ar<ai.length;++ar){var at=ai[ar];an.push(T(at[0]));if(at[1]>at[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak<ah;++ak){var ag=aj[ak];if(ag==="("){++am}else{if("\\"===ag.charAt(0)){var af=+ag.substring(1);if(af&&af<=am){an[af]=-1}}}}for(var ak=1;ak<an.length;++ak){if(-1===an[ak]){an[ak]=++ad}}for(var ak=0,am=0;ak<ah;++ak){var ag=aj[ak];if(ag==="("){++am;if(an[am]===undefined){aj[ak]="(?:"}}else{if("\\"===ag.charAt(0)){var af=+ag.substring(1);if(af&&af<=am){aj[ak]="\\"+an[am]}}}}for(var ak=0,am=0;ak<ah;++ak){if("^"===aj[ak]&&"^"!==aj[ak+1]){aj[ak]=""}}if(al.ignoreCase&&S){for(var ak=0;ak<ah;++ak){var ag=aj[ak];var ai=ag.charAt(0);if(ag.length>=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V<U;++V){var ae=Z[V];if(ae.global||ae.multiline){throw new Error(""+ae)}aa.push("(?:"+W(ae)+")")}return new RegExp(aa.join("|"),ac?"gi":"g")}function a(V){var U=/(?:^|\s)nocode(?:\s|$)/;var X=[];var T=0;var Z=[];var W=0;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=document.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Y=S&&"pre"===S.substring(0,3);function aa(ab){switch(ab.nodeType){case 1:if(U.test(ab.className)){return}for(var ae=ab.firstChild;ae;ae=ae.nextSibling){aa(ae)}var ad=ab.nodeName;if("BR"===ad||"LI"===ad){X[W]="\n";Z[W<<1]=T++;Z[(W++<<1)|1]=ab}break;case 3:case 4:var ac=ab.nodeValue;if(ac.length){if(!Y){ac=ac.replace(/[ \t\r\n]+/g," ")}else{ac=ac.replace(/\r\n?/g,"\n")}X[W]=ac;Z[W<<1]=T;T+=ac.length;Z[(W++<<1)|1]=ab}break}}aa(V);return{sourceCode:X.join("").replace(/\n$/,""),spans:Z}}function B(S,U,W,T){if(!U){return}var V={sourceCode:U,basePos:S};W(V);T.push.apply(T,V.decorations)}var v=/\S/;function o(S){var V=undefined;for(var U=S.firstChild;U;U=U.nextSibling){var T=U.nodeType;V=(T===1)?(V?S:U):(T===3)?(v.test(U.nodeValue)?S:V):V}return V===S?undefined:V}function g(U,T){var S={};var V;(function(){var ad=U.concat(T);var ah=[];var ag={};for(var ab=0,Z=ad.length;ab<Z;++ab){var Y=ad[ab];var ac=Y[3];if(ac){for(var ae=ac.length;--ae>=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae<aq;++ae){var ag=an[ae];var ap=aj[ag];var ai=void 0;var am;if(typeof ap==="string"){am=false}else{var aa=S[ag.charAt(0)];if(aa){ai=ag.match(aa[1]);ap=aa[0]}else{for(var ao=0;ao<X;++ao){aa=T[ao];ai=ag.match(aa[1]);if(ai){ap=aa[0];break}}if(!ai){ap=F}}am=ap.length>=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y<W.length;++Y){ae(W[Y])}if(ag===(ag|0)){W[0].setAttribute("value",ag)}var aa=ac.createElement("OL");aa.className="linenums";var X=Math.max(0,((ag-1))|0)||0;for(var Y=0,T=W.length;Y<T;++Y){af=W[Y];af.className="L"+((Y+X)%10);if(!af.firstChild){af.appendChild(ac.createTextNode("\xA0"))}aa.appendChild(af)}V.appendChild(aa)}function D(ac){var aj=/\bMSIE\b/.test(navigator.userAgent);var am=/\n/g;var al=ac.sourceCode;var an=al.length;var V=0;var aa=ac.spans;var T=aa.length;var ah=0;var X=ac.decorations;var Y=X.length;var Z=0;X[Y]=an;var ar,aq;for(aq=ar=0;aq<Y;){if(X[aq]!==X[aq+2]){X[ar++]=X[aq++];X[ar++]=X[aq++]}else{aq+=2}}Y=ar;for(aq=ar=0;aq<Y;){var at=X[aq];var ab=X[aq+1];var W=aq+2;while(W+2<=Y&&X[W+1]===ab){W+=2}X[ar++]=at;X[ar++]=ab;aq=W}Y=X.length=ar;var ae=null;while(ah<T){var af=aa[ah];var S=aa[ah+2]||an;var ag=X[Z];var ap=X[Z+2]||an;var W=Math.min(S,ap);var ak=aa[ah+1];var U;if(ak.nodeType!==1&&(U=al.substring(V,W))){if(aj){U=U.replace(am,"\r")}ak.nodeValue=U;var ai=ak.ownerDocument;var ao=ai.createElement("SPAN");ao.className=X[Z+1];var ad=ak.parentNode;ad.replaceChild(ao,ak);ao.appendChild(ak);if(V<S){aa[ah+1]=ak=ai.createTextNode(al.substring(W,S));ad.insertBefore(ak,ao.nextSibling)}}V=W;if(V>=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*</.test(S)?"default-markup":"default-code"}return t[T]}c(K,["default-code"]);c(g([],[[F,/^[^<?]+/],[E,/^<!\w[^>]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa<ac.length;++aa){for(var Z=0,V=ac[aa].length;Z<V;++Z){T.push(ac[aa][Z])}}ac=null;var W=Date;if(!W.now){W={now:function(){return +(new Date)}}}var X=0;var S;var ab=/\blang(?:uage)?-([\w.]+)(?!\S)/;var ae=/\bprettyprint\b/;function U(){var ag=(window.PR_SHOULD_USE_CONTINUATION?W.now()+250:Infinity);for(;X<T.length&&W.now()<ag;X++){var aj=T[X];var ai=aj.className;if(ai.indexOf("prettyprint")>=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X<T.length){setTimeout(U,250)}else{if(ad){ad()}}}U()}window.prettyPrintOne=y;window.prettyPrint=b;window.PR={createSimpleLexer:g,registerLangHandler:c,sourceDecorator:i,PR_ATTRIB_NAME:P,PR_ATTRIB_VALUE:n,PR_COMMENT:j,PR_DECLARATION:E,PR_KEYWORD:z,PR_LITERAL:G,PR_NOCODE:N,PR_PLAIN:F,PR_PUNCTUATION:L,PR_SOURCE:J,PR_STRING:C,PR_TAG:m,PR_TYPE:O}})();PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_DECLARATION,/^<!\w[^>]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^<script\b[^>]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:<!--|-->)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]);
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/sort-arrow-sprite.png b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/sort-arrow-sprite.png
new file mode 100644
index 00000000000..03f704a609c
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/sort-arrow-sprite.png
Binary files differ
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/sorter.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/sorter.js
new file mode 100644
index 00000000000..6afb736c39f
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/coverage/sorter.js
@@ -0,0 +1,156 @@
+var addSorting = (function () {
+ "use strict";
+ var cols,
+ currentSort = {
+ index: 0,
+ desc: false
+ };
+
+ // returns the summary table element
+ function getTable() { return document.querySelector('.coverage-summary table'); }
+ // returns the thead element of the summary table
+ function getTableHeader() { return getTable().querySelector('thead tr'); }
+ // returns the tbody element of the summary table
+ function getTableBody() { return getTable().querySelector('tbody'); }
+ // returns the th element for nth column
+ function getNthColumn(n) { return getTableHeader().querySelectorAll('th')[n]; }
+
+ // loads all columns
+ function loadColumns() {
+ var colNodes = getTableHeader().querySelectorAll('th'),
+ colNode,
+ cols = [],
+ col,
+ i;
+
+ for (i = 0; i < colNodes.length; i += 1) {
+ colNode = colNodes[i];
+ col = {
+ key: colNode.getAttribute('data-col'),
+ sortable: !colNode.getAttribute('data-nosort'),
+ type: colNode.getAttribute('data-type') || 'string'
+ };
+ cols.push(col);
+ if (col.sortable) {
+ col.defaultDescSort = col.type === 'number';
+ colNode.innerHTML = colNode.innerHTML + '<span class="sorter"></span>';
+ }
+ }
+ return cols;
+ }
+ // attaches a data attribute to every tr element with an object
+ // of data values keyed by column name
+ function loadRowData(tableRow) {
+ var tableCols = tableRow.querySelectorAll('td'),
+ colNode,
+ col,
+ data = {},
+ i,
+ val;
+ for (i = 0; i < tableCols.length; i += 1) {
+ colNode = tableCols[i];
+ col = cols[i];
+ val = colNode.getAttribute('data-value');
+ if (col.type === 'number') {
+ val = Number(val);
+ }
+ data[col.key] = val;
+ }
+ return data;
+ }
+ // loads all row data
+ function loadData() {
+ var rows = getTableBody().querySelectorAll('tr'),
+ i;
+
+ for (i = 0; i < rows.length; i += 1) {
+ rows[i].data = loadRowData(rows[i]);
+ }
+ }
+ // sorts the table using the data for the ith column
+ function sortByIndex(index, desc) {
+ var key = cols[index].key,
+ sorter = function (a, b) {
+ a = a.data[key];
+ b = b.data[key];
+ return a < b ? -1 : a > b ? 1 : 0;
+ },
+ finalSorter = sorter,
+ tableBody = document.querySelector('.coverage-summary tbody'),
+ rowNodes = tableBody.querySelectorAll('tr'),
+ rows = [],
+ i;
+
+ if (desc) {
+ finalSorter = function (a, b) {
+ return -1 * sorter(a, b);
+ };
+ }
+
+ for (i = 0; i < rowNodes.length; i += 1) {
+ rows.push(rowNodes[i]);
+ tableBody.removeChild(rowNodes[i]);
+ }
+
+ rows.sort(finalSorter);
+
+ for (i = 0; i < rows.length; i += 1) {
+ tableBody.appendChild(rows[i]);
+ }
+ }
+ // removes sort indicators for current column being sorted
+ function removeSortIndicators() {
+ var col = getNthColumn(currentSort.index),
+ cls = col.className;
+
+ cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, '');
+ col.className = cls;
+ }
+ // adds sort indicators for current column being sorted
+ function addSortIndicators() {
+ getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted';
+ }
+ // adds event listeners for all sorter widgets
+ function enableUI() {
+ var i,
+ el,
+ ithSorter = function ithSorter(i) {
+ var col = cols[i];
+
+ return function () {
+ var desc = col.defaultDescSort;
+
+ if (currentSort.index === i) {
+ desc = !currentSort.desc;
+ }
+ sortByIndex(i, desc);
+ removeSortIndicators();
+ currentSort.index = i;
+ currentSort.desc = desc;
+ addSortIndicators();
+ };
+ };
+ for (i =0 ; i < cols.length; i += 1) {
+ if (cols[i].sortable) {
+ el = getNthColumn(i).querySelector('.sorter');
+ if (el.addEventListener) {
+ el.addEventListener('click', ithSorter(i));
+ } else {
+ el.attachEvent('onclick', ithSorter(i));
+ }
+ }
+ }
+ }
+ // adds sorting functionality to the UI
+ return function () {
+ if (!getTable()) {
+ return;
+ }
+ cols = loadColumns();
+ loadData(cols);
+ addSortIndicators();
+ enableUI();
+ };
+})();
+
+window.addEventListener('load', addSorting);
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js
index 394c41cada0..07ffd84237c 100644
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js
@@ -5,16 +5,24 @@
* Copyright 2010-2014 Caolan McMahon
* Released under the MIT license
*/
-/*jshint onevar: false, indent:4 */
-/*global setImmediate: false, setTimeout: false, console: false */
(function () {
var async = {};
+ function noop() {}
// global on the server, window in the browser
var root, previous_async;
- root = this;
+ if (typeof window == 'object' && this === window) {
+ root = window;
+ }
+ else if (typeof global == 'object' && this === global) {
+ root = global;
+ }
+ else {
+ root = this;
+ }
+
if (root != null) {
previous_async = root.async;
}
@@ -29,8 +37,17 @@
return function() {
if (called) throw new Error("Callback was already called.");
called = true;
- fn.apply(root, arguments);
- }
+ fn.apply(this, arguments);
+ };
+ }
+
+ function _once(fn) {
+ var called = false;
+ return function() {
+ if (called) return;
+ called = true;
+ fn.apply(this, arguments);
+ };
}
//// cross-browser compatiblity functions ////
@@ -41,37 +58,59 @@
return _toString.call(obj) === '[object Array]';
};
- var _each = function (arr, iterator) {
- for (var i = 0; i < arr.length; i += 1) {
- iterator(arr[i], i, arr);
- }
- };
+ function _isArrayLike(arr) {
+ return _isArray(arr) || (
+ // has a positive integer length property
+ typeof arr.length === "number" &&
+ arr.length >= 0 &&
+ arr.length % 1 === 0
+ );
+ }
- var _map = function (arr, iterator) {
- if (arr.map) {
- return arr.map(iterator);
- }
- var results = [];
- _each(arr, function (x, i, a) {
- results.push(iterator(x, i, a));
- });
- return results;
- };
+ function _each(coll, iterator) {
+ return _isArrayLike(coll) ?
+ _arrayEach(coll, iterator) :
+ _forEachOf(coll, iterator);
+ }
- var _reduce = function (arr, iterator, memo) {
- if (arr.reduce) {
- return arr.reduce(iterator, memo);
- }
- _each(arr, function (x, i, a) {
+ function _arrayEach(arr, iterator) {
+ var index = -1,
+ length = arr.length;
+
+ while (++index < length) {
+ iterator(arr[index], index, arr);
+ }
+ }
+
+ function _map(arr, iterator) {
+ var index = -1,
+ length = arr.length,
+ result = Array(length);
+
+ while (++index < length) {
+ result[index] = iterator(arr[index], index, arr);
+ }
+ return result;
+ }
+
+ function _range(count) {
+ return _map(Array(count), function (v, i) { return i; });
+ }
+
+ function _reduce(arr, iterator, memo) {
+ _arrayEach(arr, function (x, i, a) {
memo = iterator(memo, x, i, a);
});
return memo;
- };
+ }
- var _keys = function (obj) {
- if (Object.keys) {
- return Object.keys(obj);
- }
+ function _forEachOf(object, iterator) {
+ _arrayEach(_keys(object), function (key) {
+ iterator(object[key], key);
+ });
+ }
+
+ var _keys = Object.keys || function (obj) {
var keys = [];
for (var k in obj) {
if (obj.hasOwnProperty(k)) {
@@ -81,14 +120,64 @@
return keys;
};
+ function _keyIterator(coll) {
+ var i = -1;
+ var len;
+ var keys;
+ if (_isArrayLike(coll)) {
+ len = coll.length;
+ return function next() {
+ i++;
+ return i < len ? i : null;
+ };
+ } else {
+ keys = _keys(coll);
+ len = keys.length;
+ return function next() {
+ i++;
+ return i < len ? keys[i] : null;
+ };
+ }
+ }
+
+ function _baseSlice(arr, start) {
+ start = start || 0;
+ var index = -1;
+ var length = arr.length;
+
+ if (start) {
+ length -= start;
+ length = length < 0 ? 0 : length;
+ }
+ var result = Array(length);
+
+ while (++index < length) {
+ result[index] = arr[index + start];
+ }
+ return result;
+ }
+
+ function _withoutIndex(iterator) {
+ return function (value, index, callback) {
+ return iterator(value, callback);
+ };
+ }
+
//// exported async module functions ////
//// nextTick implementation with browser-compatible fallback ////
+
+ // capture the global reference to guard against fakeTimer mocks
+ var _setImmediate;
+ if (typeof setImmediate === 'function') {
+ _setImmediate = setImmediate;
+ }
+
if (typeof process === 'undefined' || !(process.nextTick)) {
- if (typeof setImmediate === 'function') {
+ if (_setImmediate) {
async.nextTick = function (fn) {
// not a direct alias for IE10 compatibility
- setImmediate(fn);
+ _setImmediate(fn);
};
async.setImmediate = async.nextTick;
}
@@ -101,10 +190,10 @@
}
else {
async.nextTick = process.nextTick;
- if (typeof setImmediate !== 'undefined') {
+ if (_setImmediate) {
async.setImmediate = function (fn) {
// not a direct alias for IE10 compatibility
- setImmediate(fn);
+ _setImmediate(fn);
};
}
else {
@@ -112,280 +201,290 @@
}
}
+ async.forEach =
async.each = function (arr, iterator, callback) {
- callback = callback || function () {};
- if (!arr.length) {
- return callback();
- }
+ return async.eachOf(arr, _withoutIndex(iterator), callback);
+ };
+
+ async.forEachSeries =
+ async.eachSeries = function (arr, iterator, callback) {
+ return async.eachOfSeries(arr, _withoutIndex(iterator), callback);
+ };
+
+
+ async.forEachLimit =
+ async.eachLimit = function (arr, limit, iterator, callback) {
+ return _eachOfLimit(limit)(arr, _withoutIndex(iterator), callback);
+ };
+
+ async.forEachOf =
+ async.eachOf = function (object, iterator, callback) {
+ callback = _once(callback || noop);
+ object = object || [];
+ var size = _isArrayLike(object) ? object.length : _keys(object).length;
var completed = 0;
- _each(arr, function (x) {
- iterator(x, only_once(done) );
+ if (!size) {
+ return callback(null);
+ }
+ _each(object, function (value, key) {
+ iterator(object[key], key, only_once(done));
});
function done(err) {
if (err) {
callback(err);
- callback = function () {};
}
else {
completed += 1;
- if (completed >= arr.length) {
- callback();
+ if (completed >= size) {
+ callback(null);
}
}
}
};
- async.forEach = async.each;
- async.eachSeries = function (arr, iterator, callback) {
- callback = callback || function () {};
- if (!arr.length) {
- return callback();
- }
- var completed = 0;
- var iterate = function () {
- iterator(arr[completed], function (err) {
+ async.forEachOfSeries =
+ async.eachOfSeries = function (obj, iterator, callback) {
+ callback = _once(callback || noop);
+ obj = obj || [];
+ var nextKey = _keyIterator(obj);
+ var key = nextKey();
+ function iterate() {
+ var sync = true;
+ if (key === null) {
+ return callback(null);
+ }
+ iterator(obj[key], key, only_once(function (err) {
if (err) {
callback(err);
- callback = function () {};
}
else {
- completed += 1;
- if (completed >= arr.length) {
- callback();
- }
- else {
- iterate();
+ key = nextKey();
+ if (key === null) {
+ return callback(null);
+ } else {
+ if (sync) {
+ async.nextTick(iterate);
+ } else {
+ iterate();
+ }
}
}
- });
- };
+ }));
+ sync = false;
+ }
iterate();
};
- async.forEachSeries = async.eachSeries;
- async.eachLimit = function (arr, limit, iterator, callback) {
- var fn = _eachLimit(limit);
- fn.apply(null, [arr, iterator, callback]);
+
+
+ async.forEachOfLimit =
+ async.eachOfLimit = function (obj, limit, iterator, callback) {
+ _eachOfLimit(limit)(obj, iterator, callback);
};
- async.forEachLimit = async.eachLimit;
- var _eachLimit = function (limit) {
+ function _eachOfLimit(limit) {
- return function (arr, iterator, callback) {
- callback = callback || function () {};
- if (!arr.length || limit <= 0) {
- return callback();
+ return function (obj, iterator, callback) {
+ callback = _once(callback || noop);
+ obj = obj || [];
+ var nextKey = _keyIterator(obj);
+ if (limit <= 0) {
+ return callback(null);
}
- var completed = 0;
- var started = 0;
+ var done = false;
var running = 0;
+ var errored = false;
(function replenish () {
- if (completed >= arr.length) {
- return callback();
+ if (done && running <= 0) {
+ return callback(null);
}
- while (running < limit && started < arr.length) {
- started += 1;
+ while (running < limit && !errored) {
+ var key = nextKey();
+ if (key === null) {
+ done = true;
+ if (running <= 0) {
+ callback(null);
+ }
+ return;
+ }
running += 1;
- iterator(arr[started - 1], function (err) {
+ iterator(obj[key], key, only_once(function (err) {
+ running -= 1;
if (err) {
callback(err);
- callback = function () {};
+ errored = true;
}
else {
- completed += 1;
- running -= 1;
- if (completed >= arr.length) {
- callback();
- }
- else {
- replenish();
- }
+ replenish();
}
- });
+ }));
}
})();
};
- };
+ }
- var doParallel = function (fn) {
- return function () {
- var args = Array.prototype.slice.call(arguments);
- return fn.apply(null, [async.each].concat(args));
+ function doParallel(fn) {
+ return function (obj, iterator, callback) {
+ return fn(async.eachOf, obj, iterator, callback);
};
- };
- var doParallelLimit = function(limit, fn) {
- return function () {
- var args = Array.prototype.slice.call(arguments);
- return fn.apply(null, [_eachLimit(limit)].concat(args));
+ }
+ function doParallelLimit(limit, fn) {
+ return function (obj, iterator, callback) {
+ return fn(_eachOfLimit(limit), obj, iterator, callback);
};
- };
- var doSeries = function (fn) {
- return function () {
- var args = Array.prototype.slice.call(arguments);
- return fn.apply(null, [async.eachSeries].concat(args));
+ }
+ function doSeries(fn) {
+ return function (obj, iterator, callback) {
+ return fn(async.eachOfSeries, obj, iterator, callback);
};
- };
-
+ }
- var _asyncMap = function (eachfn, arr, iterator, callback) {
- arr = _map(arr, function (x, i) {
- return {index: i, value: x};
- });
- if (!callback) {
- eachfn(arr, function (x, callback) {
- iterator(x.value, function (err) {
- callback(err);
- });
- });
- } else {
- var results = [];
- eachfn(arr, function (x, callback) {
- iterator(x.value, function (err, v) {
- results[x.index] = v;
- callback(err);
- });
- }, function (err) {
- callback(err, results);
+ function _asyncMap(eachfn, arr, iterator, callback) {
+ callback = _once(callback || noop);
+ var results = [];
+ eachfn(arr, function (value, index, callback) {
+ iterator(value, function (err, v) {
+ results[index] = v;
+ callback(err);
});
- }
- };
+ }, function (err) {
+ callback(err, results);
+ });
+ }
+
async.map = doParallel(_asyncMap);
async.mapSeries = doSeries(_asyncMap);
async.mapLimit = function (arr, limit, iterator, callback) {
return _mapLimit(limit)(arr, iterator, callback);
};
- var _mapLimit = function(limit) {
+ function _mapLimit(limit) {
return doParallelLimit(limit, _asyncMap);
- };
+ }
// reduce only has a series version, as doing reduce in parallel won't
// work in many situations.
+ async.inject =
+ async.foldl =
async.reduce = function (arr, memo, iterator, callback) {
- async.eachSeries(arr, function (x, callback) {
+ async.eachOfSeries(arr, function (x, i, callback) {
iterator(memo, x, function (err, v) {
memo = v;
callback(err);
});
}, function (err) {
- callback(err, memo);
+ callback(err || null, memo);
});
};
- // inject alias
- async.inject = async.reduce;
- // foldl alias
- async.foldl = async.reduce;
+ async.foldr =
async.reduceRight = function (arr, memo, iterator, callback) {
var reversed = _map(arr, function (x) {
return x;
}).reverse();
async.reduce(reversed, memo, iterator, callback);
};
- // foldr alias
- async.foldr = async.reduceRight;
- var _filter = function (eachfn, arr, iterator, callback) {
+ function _filter(eachfn, arr, iterator, callback) {
var results = [];
arr = _map(arr, function (x, i) {
return {index: i, value: x};
});
- eachfn(arr, function (x, callback) {
+ eachfn(arr, function (x, index, callback) {
iterator(x.value, function (v) {
if (v) {
results.push(x);
}
callback();
});
- }, function (err) {
+ }, function () {
callback(_map(results.sort(function (a, b) {
return a.index - b.index;
}), function (x) {
return x.value;
}));
});
- };
+ }
+
+ async.select =
async.filter = doParallel(_filter);
+
+ async.selectSeries =
async.filterSeries = doSeries(_filter);
- // select alias
- async.select = async.filter;
- async.selectSeries = async.filterSeries;
- var _reject = function (eachfn, arr, iterator, callback) {
+ function _reject(eachfn, arr, iterator, callback) {
var results = [];
arr = _map(arr, function (x, i) {
return {index: i, value: x};
});
- eachfn(arr, function (x, callback) {
+ eachfn(arr, function (x, index, callback) {
iterator(x.value, function (v) {
if (!v) {
results.push(x);
}
callback();
});
- }, function (err) {
+ }, function () {
callback(_map(results.sort(function (a, b) {
return a.index - b.index;
}), function (x) {
return x.value;
}));
});
- };
+ }
async.reject = doParallel(_reject);
async.rejectSeries = doSeries(_reject);
- var _detect = function (eachfn, arr, iterator, main_callback) {
- eachfn(arr, function (x, callback) {
+ function _detect(eachfn, arr, iterator, main_callback) {
+ eachfn(arr, function (x, index, callback) {
iterator(x, function (result) {
if (result) {
main_callback(x);
- main_callback = function () {};
+ main_callback = noop;
}
else {
callback();
}
});
- }, function (err) {
+ }, function () {
main_callback();
});
- };
+ }
async.detect = doParallel(_detect);
async.detectSeries = doSeries(_detect);
+ async.any =
async.some = function (arr, iterator, main_callback) {
- async.each(arr, function (x, callback) {
+ async.eachOf(arr, function (x, _, callback) {
iterator(x, function (v) {
if (v) {
main_callback(true);
- main_callback = function () {};
+ main_callback = noop;
}
callback();
});
- }, function (err) {
+ }, function () {
main_callback(false);
});
};
- // any alias
- async.any = async.some;
+ async.all =
async.every = function (arr, iterator, main_callback) {
- async.each(arr, function (x, callback) {
+ async.eachOf(arr, function (x, _, callback) {
iterator(x, function (v) {
if (!v) {
main_callback(false);
- main_callback = function () {};
+ main_callback = noop;
}
callback();
});
- }, function (err) {
+ }, function () {
main_callback(true);
});
};
- // all alias
- async.all = async.every;
async.sortBy = function (arr, iterator, callback) {
async.map(arr, function (x, callback) {
@@ -402,96 +501,103 @@
return callback(err);
}
else {
- var fn = function (left, right) {
- var a = left.criteria, b = right.criteria;
- return a < b ? -1 : a > b ? 1 : 0;
- };
- callback(null, _map(results.sort(fn), function (x) {
+ callback(null, _map(results.sort(comparator), function (x) {
return x.value;
}));
}
+
});
+
+ function comparator(left, right) {
+ var a = left.criteria, b = right.criteria;
+ return a < b ? -1 : a > b ? 1 : 0;
+ }
};
async.auto = function (tasks, callback) {
- callback = callback || function () {};
+ callback = _once(callback || noop);
var keys = _keys(tasks);
- var remainingTasks = keys.length
+ var remainingTasks = keys.length;
if (!remainingTasks) {
- return callback();
+ return callback(null);
}
var results = {};
var listeners = [];
- var addListener = function (fn) {
+ function addListener(fn) {
listeners.unshift(fn);
- };
- var removeListener = function (fn) {
+ }
+ function removeListener(fn) {
for (var i = 0; i < listeners.length; i += 1) {
if (listeners[i] === fn) {
listeners.splice(i, 1);
return;
}
}
- };
- var taskComplete = function () {
- remainingTasks--
- _each(listeners.slice(0), function (fn) {
+ }
+ function taskComplete() {
+ remainingTasks--;
+ _arrayEach(listeners.slice(0), function (fn) {
fn();
});
- };
+ }
addListener(function () {
if (!remainingTasks) {
- var theCallback = callback;
- // prevent final callback from calling itself if it errors
- callback = function () {};
-
- theCallback(null, results);
+ callback(null, results);
}
});
- _each(keys, function (k) {
+ _arrayEach(keys, function (k) {
var task = _isArray(tasks[k]) ? tasks[k]: [tasks[k]];
- var taskCallback = function (err) {
- var args = Array.prototype.slice.call(arguments, 1);
+ function taskCallback(err) {
+ var args = _baseSlice(arguments, 1);
if (args.length <= 1) {
args = args[0];
}
if (err) {
var safeResults = {};
- _each(_keys(results), function(rkey) {
+ _arrayEach(_keys(results), function(rkey) {
safeResults[rkey] = results[rkey];
});
safeResults[k] = args;
callback(err, safeResults);
- // stop subsequent errors hitting callback multiple times
- callback = function () {};
}
else {
results[k] = args;
async.setImmediate(taskComplete);
}
- };
+ }
var requires = task.slice(0, Math.abs(task.length - 1)) || [];
- var ready = function () {
+ // prevent dead-locks
+ var len = requires.length;
+ var dep;
+ while (len--) {
+ if (!(dep = tasks[requires[len]])) {
+ throw new Error('Has inexistant dependency');
+ }
+ if (_isArray(dep) && !!~dep.indexOf(k)) {
+ throw new Error('Has cyclic dependencies');
+ }
+ }
+ function ready() {
return _reduce(requires, function (a, x) {
return (a && results.hasOwnProperty(x));
}, true) && !results.hasOwnProperty(k);
- };
+ }
if (ready()) {
task[task.length - 1](taskCallback, results);
}
else {
- var listener = function () {
- if (ready()) {
- removeListener(listener);
- task[task.length - 1](taskCallback, results);
- }
- };
addListener(listener);
}
+ function listener() {
+ if (ready()) {
+ removeListener(listener);
+ task[task.length - 1](taskCallback, results);
+ }
+ }
});
};
@@ -506,14 +612,16 @@
}
// Make sure times is a number
times = parseInt(times, 10) || DEFAULT_TIMES;
- var wrappedTask = function(wrappedCallback, wrappedResults) {
- var retryAttempt = function(task, finalAttempt) {
+
+ function wrappedTask(wrappedCallback, wrappedResults) {
+ function retryAttempt(task, finalAttempt) {
return function(seriesCallback) {
task(function(err, result){
seriesCallback(!err || finalAttempt, {err: err, result: result});
}, wrappedResults);
};
- };
+ }
+
while (times) {
attempts.push(retryAttempt(task, !(times-=1)));
}
@@ -522,12 +630,13 @@
(wrappedCallback || callback)(data.err, data.result);
});
}
+
// If a callback is passed, run this as a controll flow
- return callback ? wrappedTask() : wrappedTask
+ return callback ? wrappedTask() : wrappedTask;
};
async.waterfall = function (tasks, callback) {
- callback = callback || function () {};
+ callback = _once(callback || noop);
if (!_isArray(tasks)) {
var err = new Error('First argument to waterfall must be an array of functions');
return callback(err);
@@ -535,14 +644,13 @@
if (!tasks.length) {
return callback();
}
- var wrapIterator = function (iterator) {
+ function wrapIterator(iterator) {
return function (err) {
if (err) {
callback.apply(null, arguments);
- callback = function () {};
}
else {
- var args = Array.prototype.slice.call(arguments, 1);
+ var args = _baseSlice(arguments, 1);
var next = iterator.next();
if (next) {
args.push(wrapIterator(next));
@@ -550,123 +658,93 @@
else {
args.push(callback);
}
- async.setImmediate(function () {
- iterator.apply(null, args);
- });
+ ensureAsync(iterator).apply(null, args);
}
};
- };
+ }
wrapIterator(async.iterator(tasks))();
};
- var _parallel = function(eachfn, tasks, callback) {
- callback = callback || function () {};
- if (_isArray(tasks)) {
- eachfn.map(tasks, function (fn, callback) {
- if (fn) {
- fn(function (err) {
- var args = Array.prototype.slice.call(arguments, 1);
- if (args.length <= 1) {
- args = args[0];
- }
- callback.call(null, err, args);
- });
+ function _parallel(eachfn, tasks, callback) {
+ callback = callback || noop;
+ var results = _isArrayLike(tasks) ? [] : {};
+
+ eachfn(tasks, function (task, key, callback) {
+ task(function (err) {
+ var args = _baseSlice(arguments, 1);
+ if (args.length <= 1) {
+ args = args[0];
}
- }, callback);
- }
- else {
- var results = {};
- eachfn.each(_keys(tasks), function (k, callback) {
- tasks[k](function (err) {
- var args = Array.prototype.slice.call(arguments, 1);
- if (args.length <= 1) {
- args = args[0];
- }
- results[k] = args;
- callback(err);
- });
- }, function (err) {
- callback(err, results);
+ results[key] = args;
+ callback(err);
});
- }
- };
+ }, function (err) {
+ callback(err, results);
+ });
+ }
async.parallel = function (tasks, callback) {
- _parallel({ map: async.map, each: async.each }, tasks, callback);
+ _parallel(async.eachOf, tasks, callback);
};
async.parallelLimit = function(tasks, limit, callback) {
- _parallel({ map: _mapLimit(limit), each: _eachLimit(limit) }, tasks, callback);
+ _parallel(_eachOfLimit(limit), tasks, callback);
};
async.series = function (tasks, callback) {
- callback = callback || function () {};
- if (_isArray(tasks)) {
- async.mapSeries(tasks, function (fn, callback) {
- if (fn) {
- fn(function (err) {
- var args = Array.prototype.slice.call(arguments, 1);
- if (args.length <= 1) {
- args = args[0];
- }
- callback.call(null, err, args);
- });
+ callback = callback || noop;
+ var results = _isArrayLike(tasks) ? [] : {};
+
+ async.eachOfSeries(tasks, function (task, key, callback) {
+ task(function (err) {
+ var args = _baseSlice(arguments, 1);
+ if (args.length <= 1) {
+ args = args[0];
}
- }, callback);
- }
- else {
- var results = {};
- async.eachSeries(_keys(tasks), function (k, callback) {
- tasks[k](function (err) {
- var args = Array.prototype.slice.call(arguments, 1);
- if (args.length <= 1) {
- args = args[0];
- }
- results[k] = args;
- callback(err);
- });
- }, function (err) {
- callback(err, results);
+ results[key] = args;
+ callback(err);
});
- }
+ }, function (err) {
+ callback(err, results);
+ });
};
async.iterator = function (tasks) {
- var makeCallback = function (index) {
- var fn = function () {
+ function makeCallback(index) {
+ function fn() {
if (tasks.length) {
tasks[index].apply(null, arguments);
}
return fn.next();
- };
+ }
fn.next = function () {
return (index < tasks.length - 1) ? makeCallback(index + 1): null;
};
return fn;
- };
+ }
return makeCallback(0);
};
async.apply = function (fn) {
- var args = Array.prototype.slice.call(arguments, 1);
+ var args = _baseSlice(arguments, 1);
return function () {
return fn.apply(
- null, args.concat(Array.prototype.slice.call(arguments))
+ null, args.concat(_baseSlice(arguments))
);
};
};
- var _concat = function (eachfn, arr, fn, callback) {
- var r = [];
- eachfn(arr, function (x, cb) {
+ function _concat(eachfn, arr, fn, callback) {
+ var result = [];
+ eachfn(arr, function (x, index, cb) {
fn(x, function (err, y) {
- r = r.concat(y || []);
+ result = result.concat(y || []);
cb(err);
});
}, function (err) {
- callback(err, r);
+ callback(err, result);
});
- };
+ }
async.concat = doParallel(_concat);
async.concatSeries = doSeries(_concat);
@@ -680,7 +758,7 @@
});
}
else {
- callback();
+ callback(null);
}
};
@@ -689,12 +767,12 @@
if (err) {
return callback(err);
}
- var args = Array.prototype.slice.call(arguments, 1);
+ var args = _baseSlice(arguments, 1);
if (test.apply(null, args)) {
async.doWhilst(iterator, test, callback);
}
else {
- callback();
+ callback(null);
}
});
};
@@ -709,7 +787,7 @@
});
}
else {
- callback();
+ callback(null);
}
};
@@ -718,92 +796,106 @@
if (err) {
return callback(err);
}
- var args = Array.prototype.slice.call(arguments, 1);
+ var args = _baseSlice(arguments, 1);
if (!test.apply(null, args)) {
async.doUntil(iterator, test, callback);
}
else {
- callback();
+ callback(null);
}
});
};
- async.queue = function (worker, concurrency) {
- if (concurrency === undefined) {
+ function _queue(worker, concurrency, payload) {
+ if (concurrency == null) {
concurrency = 1;
}
+ else if(concurrency === 0) {
+ throw new Error('Concurrency must not be zero');
+ }
function _insert(q, data, pos, callback) {
- if (!q.started){
+ if (callback != null && typeof callback !== "function") {
+ throw new Error("task callback must be a function");
+ }
q.started = true;
- }
- if (!_isArray(data)) {
- data = [data];
- }
- if(data.length == 0) {
- // call drain immediately if there are no tasks
- return async.setImmediate(function() {
- if (q.drain) {
- q.drain();
- }
- });
- }
- _each(data, function(task) {
- var item = {
- data: task,
- callback: typeof callback === 'function' ? callback : null
- };
-
- if (pos) {
- q.tasks.unshift(item);
- } else {
- q.tasks.push(item);
- }
+ if (!_isArray(data)) {
+ data = [data];
+ }
+ if(data.length === 0 && q.idle()) {
+ // call drain immediately if there are no tasks
+ return async.setImmediate(function() {
+ q.drain();
+ });
+ }
+ _arrayEach(data, function(task) {
+ var item = {
+ data: task,
+ callback: callback || noop
+ };
- if (q.saturated && q.tasks.length === q.concurrency) {
- q.saturated();
- }
- async.setImmediate(q.process);
- });
+ if (pos) {
+ q.tasks.unshift(item);
+ } else {
+ q.tasks.push(item);
+ }
+
+ if (q.tasks.length === q.concurrency) {
+ q.saturated();
+ }
+ });
+ async.setImmediate(q.process);
+ }
+ function _next(q, tasks) {
+ return function(){
+ workers -= 1;
+ var args = arguments;
+ _arrayEach(tasks, function (task) {
+ task.callback.apply(task, args);
+ });
+ if (q.tasks.length + workers === 0) {
+ q.drain();
+ }
+ q.process();
+ };
}
var workers = 0;
var q = {
tasks: [],
concurrency: concurrency,
- saturated: null,
- empty: null,
- drain: null,
+ saturated: noop,
+ empty: noop,
+ drain: noop,
started: false,
paused: false,
push: function (data, callback) {
- _insert(q, data, false, callback);
+ _insert(q, data, false, callback);
},
kill: function () {
- q.drain = null;
- q.tasks = [];
+ q.drain = noop;
+ q.tasks = [];
},
unshift: function (data, callback) {
- _insert(q, data, true, callback);
+ _insert(q, data, true, callback);
},
process: function () {
if (!q.paused && workers < q.concurrency && q.tasks.length) {
- var task = q.tasks.shift();
- if (q.empty && q.tasks.length === 0) {
- q.empty();
- }
- workers += 1;
- var next = function () {
- workers -= 1;
- if (task.callback) {
- task.callback.apply(task, arguments);
- }
- if (q.drain && q.tasks.length + workers === 0) {
- q.drain();
+ while(workers < q.concurrency && q.tasks.length){
+ var tasks = payload ?
+ q.tasks.splice(0, payload) :
+ q.tasks.splice(0, q.tasks.length);
+
+ var data = _map(tasks, function (task) {
+ return task.data;
+ });
+
+ if (q.tasks.length === 0) {
+ q.empty();
}
- q.process();
- };
- var cb = only_once(next);
- worker(task.data, cb);
+ workers += 1;
+ var cb = only_once(_next(q, tasks));
+ worker(data, cb);
+ }
}
},
length: function () {
@@ -816,71 +908,78 @@
return q.tasks.length + workers === 0;
},
pause: function () {
- if (q.paused === true) { return; }
q.paused = true;
},
resume: function () {
if (q.paused === false) { return; }
q.paused = false;
+ var resumeCount = Math.min(q.concurrency, q.tasks.length);
// Need to call q.process once per concurrent
// worker to preserve full concurrency after pause
- for (var w = 1; w <= q.concurrency; w++) {
+ for (var w = 1; w <= resumeCount; w++) {
async.setImmediate(q.process);
}
}
};
return q;
+ }
+
+ async.queue = function (worker, concurrency) {
+ var q = _queue(function (items, cb) {
+ worker(items[0], cb);
+ }, concurrency, 1);
+
+ return q;
};
async.priorityQueue = function (worker, concurrency) {
function _compareTasks(a, b){
- return a.priority - b.priority;
- };
+ return a.priority - b.priority;
+ }
function _binarySearch(sequence, item, compare) {
var beg = -1,
end = sequence.length - 1;
while (beg < end) {
- var mid = beg + ((end - beg + 1) >>> 1);
- if (compare(item, sequence[mid]) >= 0) {
- beg = mid;
- } else {
- end = mid - 1;
- }
+ var mid = beg + ((end - beg + 1) >>> 1);
+ if (compare(item, sequence[mid]) >= 0) {
+ beg = mid;
+ } else {
+ end = mid - 1;
+ }
}
return beg;
}
function _insert(q, data, priority, callback) {
- if (!q.started){
+ if (callback != null && typeof callback !== "function") {
+ throw new Error("task callback must be a function");
+ }
q.started = true;
- }
- if (!_isArray(data)) {
- data = [data];
- }
- if(data.length == 0) {
- // call drain immediately if there are no tasks
- return async.setImmediate(function() {
- if (q.drain) {
- q.drain();
- }
- });
- }
- _each(data, function(task) {
- var item = {
- data: task,
- priority: priority,
- callback: typeof callback === 'function' ? callback : null
- };
+ if (!_isArray(data)) {
+ data = [data];
+ }
+ if(data.length === 0) {
+ // call drain immediately if there are no tasks
+ return async.setImmediate(function() {
+ q.drain();
+ });
+ }
+ _arrayEach(data, function(task) {
+ var item = {
+ data: task,
+ priority: priority,
+ callback: typeof callback === 'function' ? callback : noop
+ };
- q.tasks.splice(_binarySearch(q.tasks, item, _compareTasks) + 1, 0, item);
+ q.tasks.splice(_binarySearch(q.tasks, item, _compareTasks) + 1, 0, item);
- if (q.saturated && q.tasks.length === q.concurrency) {
- q.saturated();
- }
- async.setImmediate(q.process);
- });
+ if (q.tasks.length === q.concurrency) {
+ q.saturated();
+ }
+ async.setImmediate(q.process);
+ });
}
// Start with a normal queue
@@ -888,7 +987,7 @@
// Override push to accept second parameter representing priority
q.push = function (data, priority, callback) {
- _insert(q, data, priority, callback);
+ _insert(q, data, priority, callback);
};
// Remove unshift function
@@ -898,78 +997,14 @@
};
async.cargo = function (worker, payload) {
- var working = false,
- tasks = [];
-
- var cargo = {
- tasks: tasks,
- payload: payload,
- saturated: null,
- empty: null,
- drain: null,
- drained: true,
- push: function (data, callback) {
- if (!_isArray(data)) {
- data = [data];
- }
- _each(data, function(task) {
- tasks.push({
- data: task,
- callback: typeof callback === 'function' ? callback : null
- });
- cargo.drained = false;
- if (cargo.saturated && tasks.length === payload) {
- cargo.saturated();
- }
- });
- async.setImmediate(cargo.process);
- },
- process: function process() {
- if (working) return;
- if (tasks.length === 0) {
- if(cargo.drain && !cargo.drained) cargo.drain();
- cargo.drained = true;
- return;
- }
-
- var ts = typeof payload === 'number'
- ? tasks.splice(0, payload)
- : tasks.splice(0, tasks.length);
-
- var ds = _map(ts, function (task) {
- return task.data;
- });
-
- if(cargo.empty) cargo.empty();
- working = true;
- worker(ds, function () {
- working = false;
-
- var args = arguments;
- _each(ts, function (data) {
- if (data.callback) {
- data.callback.apply(null, args);
- }
- });
-
- process();
- });
- },
- length: function () {
- return tasks.length;
- },
- running: function () {
- return working;
- }
- };
- return cargo;
+ return _queue(worker, 1, payload);
};
- var _console_fn = function (name) {
+ function _console_fn(name) {
return function (fn) {
- var args = Array.prototype.slice.call(arguments, 1);
+ var args = _baseSlice(arguments, 1);
fn.apply(null, args.concat([function (err) {
- var args = Array.prototype.slice.call(arguments, 1);
+ var args = _baseSlice(arguments, 1);
if (typeof console !== 'undefined') {
if (err) {
if (console.error) {
@@ -977,14 +1012,14 @@
}
}
else if (console[name]) {
- _each(args, function (x) {
+ _arrayEach(args, function (x) {
console[name](x);
});
}
}
}]));
};
- };
+ }
async.log = _console_fn('log');
async.dir = _console_fn('dir');
/*async.info = _console_fn('info');
@@ -997,8 +1032,8 @@
hasher = hasher || function (x) {
return x;
};
- var memoized = function () {
- var args = Array.prototype.slice.call(arguments);
+ function memoized() {
+ var args = _baseSlice(arguments);
var callback = args.pop();
var key = hasher.apply(null, args);
if (key in memo) {
@@ -1012,7 +1047,7 @@
else {
queues[key] = [callback];
fn.apply(null, args.concat([function () {
- memo[key] = arguments;
+ memo[key] = _baseSlice(arguments);
var q = queues[key];
delete queues[key];
for (var i = 0, l = q.length; i < l; i++) {
@@ -1020,7 +1055,7 @@
}
}]));
}
- };
+ }
memoized.memo = memo;
memoized.unmemoized = fn;
return memoized;
@@ -1032,34 +1067,37 @@
};
};
- async.times = function (count, iterator, callback) {
- var counter = [];
- for (var i = 0; i < count; i++) {
- counter.push(i);
- }
- return async.map(counter, iterator, callback);
- };
+ function _times(mapper) {
+ return function (count, iterator, callback) {
+ mapper(_range(count), iterator, callback);
+ };
+ }
- async.timesSeries = function (count, iterator, callback) {
- var counter = [];
- for (var i = 0; i < count; i++) {
- counter.push(i);
- }
- return async.mapSeries(counter, iterator, callback);
+ async.times = _times(async.map);
+ async.timesSeries = _times(async.mapSeries);
+ async.timesLimit = function (count, limit, iterator, callback) {
+ return async.mapLimit(_range(count), limit, iterator, callback);
};
async.seq = function (/* functions... */) {
var fns = arguments;
return function () {
var that = this;
- var args = Array.prototype.slice.call(arguments);
- var callback = args.pop();
+ var args = _baseSlice(arguments);
+
+ var callback = args.slice(-1)[0];
+ if (typeof callback == 'function') {
+ args.pop();
+ } else {
+ callback = noop;
+ }
+
async.reduce(fns, args, function (newargs, fn, cb) {
fn.apply(that, newargs.concat([function () {
var err = arguments[0];
- var nextargs = Array.prototype.slice.call(arguments, 1);
+ var nextargs = _baseSlice(arguments, 1);
cb(err, nextargs);
- }]))
+ }]));
},
function (err, results) {
callback.apply(that, [err].concat(results));
@@ -1071,40 +1109,70 @@
return async.seq.apply(null, Array.prototype.reverse.call(arguments));
};
- var _applyEach = function (eachfn, fns /*args...*/) {
- var go = function () {
+
+ function _applyEach(eachfn, fns /*args...*/) {
+ function go() {
var that = this;
- var args = Array.prototype.slice.call(arguments);
+ var args = _baseSlice(arguments);
var callback = args.pop();
- return eachfn(fns, function (fn, cb) {
+ return eachfn(fns, function (fn, _, cb) {
fn.apply(that, args.concat([cb]));
},
callback);
- };
+ }
if (arguments.length > 2) {
- var args = Array.prototype.slice.call(arguments, 2);
+ var args = _baseSlice(arguments, 2);
return go.apply(this, args);
}
else {
return go;
}
+ }
+
+ async.applyEach = function (/*fns, args...*/) {
+ var args = _baseSlice(arguments);
+ return _applyEach.apply(null, [async.eachOf].concat(args));
+ };
+ async.applyEachSeries = function (/*fns, args...*/) {
+ var args = _baseSlice(arguments);
+ return _applyEach.apply(null, [async.eachOfSeries].concat(args));
};
- async.applyEach = doParallel(_applyEach);
- async.applyEachSeries = doSeries(_applyEach);
+
async.forever = function (fn, callback) {
+ var done = only_once(callback || noop);
+ var task = ensureAsync(fn);
function next(err) {
if (err) {
- if (callback) {
- return callback(err);
- }
- throw err;
+ return done(err);
}
- fn(next);
+ task(next);
}
next();
};
+ function ensureAsync(fn) {
+ return function (/*...args, callback*/) {
+ var args = _baseSlice(arguments);
+ var callback = args.pop();
+ args.push(function () {
+ var innerArgs = arguments;
+ if (sync) {
+ async.setImmediate(function () {
+ callback.apply(null, innerArgs);
+ });
+ } else {
+ callback.apply(null, innerArgs);
+ }
+ });
+ var sync = true;
+ fn.apply(this, args);
+ sync = false;
+ };
+ }
+
+ async.ensureAsync = ensureAsync;
+
// Node.js
if (typeof module !== 'undefined' && module.exports) {
module.exports = async;
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/nyc_output/5074.json b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/nyc_output/5074.json
new file mode 100644
index 00000000000..b01ba22c88c
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/nyc_output/5074.json
@@ -0,0 +1 @@
+{"./lib/async.js":{"path":"./lib/async.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":0,"7":1,"8":1,"9":0,"10":1,"11":1,"12":1,"13":0,"14":0,"15":1,"16":200,"17":200,"18":200,"19":4,"20":196,"21":196,"22":1,"23":168,"24":168,"25":176,"26":19,"27":157,"28":157,"29":1,"30":1,"31":0,"32":1,"33":138,"34":1,"35":39,"36":1,"37":328,"38":328,"39":480,"40":1,"41":104,"42":104,"43":148,"44":104,"45":1,"46":56,"47":54,"48":56,"49":1,"50":5,"51":11,"52":1,"53":0,"54":0,"55":0,"56":0,"57":0,"58":1,"59":76,"60":76,"61":76,"62":76,"63":61,"64":61,"65":243,"66":243,"67":15,"68":15,"69":15,"70":53,"71":53,"72":1,"73":50259,"74":50259,"75":50259,"76":50259,"77":151,"78":151,"79":50259,"80":50259,"81":50299,"82":50259,"83":1,"84":19,"85":59,"86":1,"87":1,"88":1,"89":1,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":1,"98":1,"99":1,"100":50236,"101":0,"102":1,"103":5,"104":1,"105":5,"106":1,"107":9,"108":1,"109":45,"110":45,"111":45,"112":45,"113":45,"114":6,"115":39,"116":109,"117":1,"118":105,"119":16,"120":89,"121":89,"122":31,"123":1,"124":44,"125":44,"126":44,"127":1,"128":123,"129":123,"130":123,"131":29,"132":94,"133":90,"134":11,"135":79,"136":20,"137":59,"138":94,"139":44,"140":1,"141":9,"142":1,"143":32,"144":32,"145":32,"146":32,"147":32,"148":3,"149":29,"150":29,"151":29,"152":29,"153":119,"154":12,"155":107,"156":173,"157":173,"158":71,"159":71,"160":17,"161":71,"162":102,"163":102,"164":97,"165":97,"166":7,"167":7,"168":90,"169":1,"170":5,"171":19,"172":1,"173":8,"174":8,"175":1,"176":5,"177":12,"178":1,"179":25,"180":25,"181":25,"182":69,"183":67,"184":67,"185":25,"186":1,"187":1,"188":1,"189":8,"190":1,"191":8,"192":1,"193":11,"194":26,"195":25,"196":25,"197":10,"198":1,"199":1,"200":3,"201":1,"202":1,"203":3,"204":3,"205":9,"206":3,"207":9,"208":9,"209":6,"210":9,"211":3,"212":3,"213":6,"214":1,"215":1,"216":1,"217":3,"218":3,"219":9,"220":3,"221":9,"222":9,"223":3,"224":9,"225":3,"226":0,"227":3,"228":1,"229":1,"230":1,"231":5,"232":15,"233":15,"234":7,"235":7,"236":8,"237":0,"238":1,"239":1,"240":1,"241":3,"242":9,"243":9,"244":2,"245":2,"246":9,"247":3,"248":1,"249":3,"250":9,"251":9,"252":3,"253":3,"254":9,"255":3,"256":1,"257":2,"258":6,"259":6,"260":0,"261":6,"262":2,"263":0,"264":2,"265":6,"266":1,"267":6,"268":6,"269":1,"270":14,"271":14,"272":14,"273":14,"274":1,"275":13,"276":13,"277":1,"278":28,"279":1,"280":13,"281":19,"282":13,"283":13,"284":1,"285":25,"286":25,"287":47,"288":13,"289":25,"290":7,"291":13,"292":36,"293":1,"294":30,"295":30,"296":29,"297":30,"298":5,"299":5,"300":1,"301":5,"302":5,"303":25,"304":25,"305":36,"306":36,"307":36,"308":36,"309":23,"310":1,"311":22,"312":1,"313":1,"314":56,"315":54,"316":34,"317":19,"318":15,"319":1,"320":22,"321":13,"322":13,"323":1,"324":3,"325":3,"326":3,"327":2,"328":2,"329":2,"330":3,"331":1,"332":1,"333":13,"334":7,"335":7,"336":3,"337":13,"338":3,"339":3,"340":3,"341":3,"342":1,"343":8,"344":8,"345":1,"346":1,"347":7,"348":1,"349":1,"350":18,"351":19,"352":1,"353":18,"354":18,"355":18,"356":12,"357":6,"358":18,"359":6,"360":1,"361":13,"362":13,"363":13,"364":27,"365":27,"366":27,"367":23,"368":27,"369":27,"370":13,"371":1,"372":7,"373":1,"374":6,"375":1,"376":10,"377":10,"378":10,"379":21,"380":21,"381":21,"382":19,"383":21,"384":21,"385":10,"386":1,"387":1,"388":1,"389":25,"390":24,"391":25,"392":38,"393":46,"394":38,"395":9,"396":1,"397":6,"398":6,"399":6,"400":1,"401":3,"402":3,"403":9,"404":9,"405":9,"406":3,"407":1,"408":1,"409":1,"410":6,"411":5,"412":5,"413":0,"414":5,"415":1,"416":1,"417":10,"418":10,"419":0,"420":10,"421":10,"422":8,"423":2,"424":1,"425":6,"426":5,"427":5,"428":0,"429":5,"430":1,"431":1,"432":10,"433":10,"434":0,"435":10,"436":10,"437":8,"438":2,"439":1,"440":27,"441":3,"442":24,"443":1,"444":1,"445":92,"446":1,"447":91,"448":91,"449":84,"450":91,"451":2,"452":2,"453":89,"454":105,"455":105,"456":8,"457":97,"458":105,"459":28,"460":105,"461":26,"462":26,"463":84,"464":1,"465":1,"466":8,"467":207,"468":89,"469":89,"470":112,"471":89,"472":30,"473":89,"474":89,"475":89,"476":1,"477":89,"478":89,"479":89,"480":112,"481":89,"482":27,"483":89,"484":50,"485":5,"486":9,"487":3,"488":4,"489":1,"490":3,"491":3,"492":3,"493":5,"494":26,"495":1,"496":21,"497":63,"498":20,"499":1,"500":1,"501":10,"502":1,"503":8,"504":8,"505":10,"506":10,"507":6,"508":4,"509":8,"510":1,"511":8,"512":0,"513":8,"514":8,"515":8,"516":8,"517":0,"518":0,"519":8,"520":8,"521":8,"522":8,"523":2,"524":8,"525":2,"526":2,"527":8,"528":2,"529":2,"530":1,"531":6,"532":1,"533":2,"534":6,"535":6,"536":6,"537":6,"538":6,"539":2,"540":2,"541":4,"542":4,"543":8,"544":1,"545":1,"546":1,"547":7,"548":7,"549":7,"550":9,"551":1,"552":11,"553":11,"554":11,"555":11,"556":4,"557":4,"558":7,"559":1,"560":6,"561":6,"562":6,"563":6,"564":6,"565":6,"566":7,"567":7,"568":7,"569":7,"570":1,"571":2,"572":4,"573":1,"574":3,"575":3,"576":6,"577":3,"578":1,"579":2,"580":2,"581":10,"582":2,"583":1,"584":7,"585":7,"586":7,"587":7,"588":7,"589":7,"590":6,"591":1,"592":7,"593":16,"594":15,"595":15,"596":15,"597":6,"598":1,"599":3,"600":1,"601":1,"602":3,"603":3,"604":3,"605":3,"606":9,"607":3,"608":2,"609":2,"610":1,"611":1,"612":2,"613":2,"614":1,"615":1,"616":1,"617":1,"618":2,"619":2,"620":1,"621":50052,"622":2,"623":50050,"624":2,"625":1,"626":24,"627":50072,"628":50072,"629":50072,"630":50070,"631":50070,"632":50017,"633":50017,"634":53,"635":50072,"636":50072,"637":50072,"638":1,"639":1,"640":1,"641":0,"642":0,"643":0,"644":0},"b":{"1":[0,1],"2":[1,0],"3":[1,0],"4":[1,1],"5":[1,0],"6":[4,196],"7":[19,157],"8":[1,0],"9":[138,30,7,7],"10":[34,5],"11":[1,0],"12":[0,0],"13":[61,15],"14":[164,79],"15":[32,21],"16":[50259,50108],"17":[151,50108],"18":[42,109],"19":[1,0],"20":[0,1],"21":[1,1],"22":[0,0],"23":[1,0],"24":[45,3],"25":[45,1],"26":[45,11],"27":[6,39],"28":[16,89],"29":[31,58],"30":[44,2],"31":[44,1],"32":[29,94],"33":[11,79],"34":[20,59],"35":[32,2],"36":[32,1],"37":[3,29],"38":[12,107],"39":[119,54],"40":[209,186],"41":[71,102],"42":[17,54],"43":[7,90],"44":[25,1],"45":[10,7],"46":[6,3],"47":[3,6],"48":[7,8],"49":[2,7],"50":[3,6],"51":[0,6],"52":[0,2],"53":[3,3],"54":[3,0],"55":[14,4],"56":[1,13],"57":[13,6],"58":[7,18],"59":[20,16],"60":[29,1],"61":[5,25],"62":[36,0],"63":[1,22],"64":[1,21],"65":[22,5],"66":[56,32],"67":[54,43],"68":[19,15],"69":[13,9],"70":[2,1],"71":[3,0],"72":[7,5],"73":[3,2],"74":[2,1],"75":[8,3],"76":[1,7],"77":[1,6],"78":[1,18],"79":[12,6],"80":[13,2],"81":[11,2],"82":[23,4],"83":[10,1],"84":[9,1],"85":[19,2],"86":[24,1],"87":[29,17],"88":[9,3],"89":[5,1],"90":[0,5],"91":[0,10],"92":[8,2],"93":[5,1],"94":[0,5],"95":[0,10],"96":[8,2],"97":[3,24],"98":[1,23],"99":[1,91],"100":[92,32],"101":[84,7],"102":[2,89],"103":[91,2],"104":[105,68],"105":[8,97],"106":[28,77],"107":[89,118],"108":[207,200,165],"109":[89,0],"110":[30,59],"111":[27,62],"112":[1,3],"113":[6,4],"114":[0,8],"115":[8,8],"116":[8,0],"117":[0,8],"118":[8,0],"119":[2,6],"120":[6,0],"121":[2,4],"122":[2,0],"123":[4,0],"124":[7,6],"125":[4,7],"126":[1,6],"127":[4,1],"128":[6,1],"129":[2,1],"130":[2,0],"131":[2,50050],"132":[50017,53],"133":[1,0],"134":[1,1],"135":[0,0],"136":[0,0]},"f":{"1":1,"2":157,"3":0,"4":200,"5":200,"6":168,"7":176,"8":0,"9":138,"10":39,"11":328,"12":104,"13":56,"14":54,"15":5,"16":11,"17":0,"18":76,"19":243,"20":53,"21":50259,"22":19,"23":59,"24":0,"25":0,"26":50236,"27":5,"28":5,"29":9,"30":45,"31":109,"32":105,"33":44,"34":123,"35":90,"36":9,"37":32,"38":32,"39":119,"40":97,"41":5,"42":19,"43":8,"44":8,"45":5,"46":12,"47":25,"48":69,"49":67,"50":25,"51":8,"52":8,"53":11,"54":26,"55":25,"56":10,"57":1,"58":3,"59":3,"60":9,"61":9,"62":9,"63":3,"64":3,"65":6,"66":3,"67":9,"68":9,"69":9,"70":3,"71":0,"72":3,"73":5,"74":15,"75":15,"76":0,"77":3,"78":9,"79":9,"80":3,"81":3,"82":9,"83":9,"84":3,"85":2,"86":6,"87":6,"88":2,"89":6,"90":6,"91":14,"92":28,"93":13,"94":25,"95":47,"96":25,"97":36,"98":30,"99":1,"100":56,"101":54,"102":22,"103":3,"104":3,"105":13,"106":7,"107":7,"108":3,"109":8,"110":18,"111":19,"112":13,"113":27,"114":27,"115":13,"116":7,"117":6,"118":10,"119":21,"120":21,"121":10,"122":9,"123":38,"124":25,"125":46,"126":6,"127":6,"128":3,"129":9,"130":9,"131":3,"132":6,"133":5,"134":10,"135":10,"136":6,"137":5,"138":10,"139":10,"140":27,"141":92,"142":2,"143":105,"144":84,"145":1,"146":8,"147":207,"148":112,"149":89,"150":112,"151":50,"152":5,"153":9,"154":3,"155":4,"156":21,"157":63,"158":2,"159":10,"160":8,"161":8,"162":0,"163":8,"164":8,"165":6,"166":2,"167":6,"168":6,"169":8,"170":7,"171":9,"172":11,"173":4,"174":6,"175":2,"176":4,"177":3,"178":2,"179":7,"180":7,"181":16,"182":15,"183":6,"184":3,"185":3,"186":3,"187":9,"188":2,"189":1,"190":2,"191":50052,"192":24,"193":50072,"194":50070,"195":50017,"196":0},"fnMap":{"1":{"name":"(anonymous_1)","line":8,"loc":{"start":{"line":8,"column":1},"end":{"line":8,"column":13}}},"2":{"name":"noop","line":11,"loc":{"start":{"line":11,"column":4},"end":{"line":11,"column":20}}},"3":{"name":"(anonymous_3)","line":30,"loc":{"start":{"line":30,"column":23},"end":{"line":30,"column":35}}},"4":{"name":"only_once","line":35,"loc":{"start":{"line":35,"column":4},"end":{"line":35,"column":27}}},"5":{"name":"(anonymous_5)","line":37,"loc":{"start":{"line":37,"column":15},"end":{"line":37,"column":26}}},"6":{"name":"_once","line":44,"loc":{"start":{"line":44,"column":4},"end":{"line":44,"column":23}}},"7":{"name":"(anonymous_7)","line":46,"loc":{"start":{"line":46,"column":15},"end":{"line":46,"column":26}}},"8":{"name":"(anonymous_8)","line":57,"loc":{"start":{"line":57,"column":36},"end":{"line":57,"column":51}}},"9":{"name":"_isArrayLike","line":61,"loc":{"start":{"line":61,"column":4},"end":{"line":61,"column":31}}},"10":{"name":"_each","line":70,"loc":{"start":{"line":70,"column":4},"end":{"line":70,"column":35}}},"11":{"name":"_arrayEach","line":76,"loc":{"start":{"line":76,"column":4},"end":{"line":76,"column":39}}},"12":{"name":"_map","line":85,"loc":{"start":{"line":85,"column":4},"end":{"line":85,"column":33}}},"13":{"name":"_reduce","line":96,"loc":{"start":{"line":96,"column":4},"end":{"line":96,"column":42}}},"14":{"name":"(anonymous_14)","line":97,"loc":{"start":{"line":97,"column":24},"end":{"line":97,"column":43}}},"15":{"name":"_forEachOf","line":103,"loc":{"start":{"line":103,"column":4},"end":{"line":103,"column":42}}},"16":{"name":"(anonymous_16)","line":104,"loc":{"start":{"line":104,"column":34},"end":{"line":104,"column":49}}},"17":{"name":"(anonymous_17)","line":109,"loc":{"start":{"line":109,"column":31},"end":{"line":109,"column":46}}},"18":{"name":"_keyIterator","line":119,"loc":{"start":{"line":119,"column":4},"end":{"line":119,"column":32}}},"19":{"name":"next","line":125,"loc":{"start":{"line":125,"column":19},"end":{"line":125,"column":35}}},"20":{"name":"next","line":132,"loc":{"start":{"line":132,"column":19},"end":{"line":132,"column":35}}},"21":{"name":"_baseSlice","line":139,"loc":{"start":{"line":139,"column":4},"end":{"line":139,"column":36}}},"22":{"name":"_withoutIndex","line":156,"loc":{"start":{"line":156,"column":4},"end":{"line":156,"column":37}}},"23":{"name":"(anonymous_23)","line":157,"loc":{"start":{"line":157,"column":15},"end":{"line":157,"column":49}}},"24":{"name":"(anonymous_24)","line":174,"loc":{"start":{"line":174,"column":29},"end":{"line":174,"column":43}}},"25":{"name":"(anonymous_25)","line":181,"loc":{"start":{"line":181,"column":29},"end":{"line":181,"column":43}}},"26":{"name":"(anonymous_26)","line":190,"loc":{"start":{"line":190,"column":33},"end":{"line":190,"column":47}}},"27":{"name":"(anonymous_27)","line":201,"loc":{"start":{"line":201,"column":17},"end":{"line":201,"column":52}}},"28":{"name":"(anonymous_28)","line":206,"loc":{"start":{"line":206,"column":23},"end":{"line":206,"column":58}}},"29":{"name":"(anonymous_29)","line":212,"loc":{"start":{"line":212,"column":22},"end":{"line":212,"column":64}}},"30":{"name":"(anonymous_30)","line":217,"loc":{"start":{"line":217,"column":19},"end":{"line":217,"column":57}}},"31":{"name":"(anonymous_31)","line":225,"loc":{"start":{"line":225,"column":22},"end":{"line":225,"column":44}}},"32":{"name":"done","line":228,"loc":{"start":{"line":228,"column":8},"end":{"line":228,"column":27}}},"33":{"name":"(anonymous_33)","line":242,"loc":{"start":{"line":242,"column":25},"end":{"line":242,"column":60}}},"34":{"name":"iterate","line":246,"loc":{"start":{"line":246,"column":8},"end":{"line":246,"column":27}}},"35":{"name":"(anonymous_35)","line":252,"loc":{"start":{"line":252,"column":36},"end":{"line":252,"column":51}}},"36":{"name":"(anonymous_36)","line":273,"loc":{"start":{"line":273,"column":24},"end":{"line":273,"column":66}}},"37":{"name":"_eachOfLimit","line":277,"loc":{"start":{"line":277,"column":4},"end":{"line":277,"column":33}}},"38":{"name":"(anonymous_38)","line":279,"loc":{"start":{"line":279,"column":15},"end":{"line":279,"column":50}}},"39":{"name":"replenish","line":290,"loc":{"start":{"line":290,"column":13},"end":{"line":290,"column":35}}},"40":{"name":"(anonymous_40)","line":305,"loc":{"start":{"line":305,"column":44},"end":{"line":305,"column":59}}},"41":{"name":"doParallel","line":321,"loc":{"start":{"line":321,"column":4},"end":{"line":321,"column":28}}},"42":{"name":"(anonymous_42)","line":322,"loc":{"start":{"line":322,"column":15},"end":{"line":322,"column":50}}},"43":{"name":"doParallelLimit","line":326,"loc":{"start":{"line":326,"column":4},"end":{"line":326,"column":40}}},"44":{"name":"(anonymous_44)","line":327,"loc":{"start":{"line":327,"column":15},"end":{"line":327,"column":50}}},"45":{"name":"doSeries","line":331,"loc":{"start":{"line":331,"column":4},"end":{"line":331,"column":26}}},"46":{"name":"(anonymous_46)","line":332,"loc":{"start":{"line":332,"column":15},"end":{"line":332,"column":50}}},"47":{"name":"_asyncMap","line":337,"loc":{"start":{"line":337,"column":4},"end":{"line":337,"column":56}}},"48":{"name":"(anonymous_48)","line":340,"loc":{"start":{"line":340,"column":20},"end":{"line":340,"column":54}}},"49":{"name":"(anonymous_49)","line":341,"loc":{"start":{"line":341,"column":28},"end":{"line":341,"column":46}}},"50":{"name":"(anonymous_50)","line":345,"loc":{"start":{"line":345,"column":11},"end":{"line":345,"column":26}}},"51":{"name":"(anonymous_51)","line":352,"loc":{"start":{"line":352,"column":21},"end":{"line":352,"column":63}}},"52":{"name":"_mapLimit","line":356,"loc":{"start":{"line":356,"column":4},"end":{"line":356,"column":30}}},"53":{"name":"(anonymous_53)","line":364,"loc":{"start":{"line":364,"column":19},"end":{"line":364,"column":60}}},"54":{"name":"(anonymous_54)","line":365,"loc":{"start":{"line":365,"column":32},"end":{"line":365,"column":58}}},"55":{"name":"(anonymous_55)","line":366,"loc":{"start":{"line":366,"column":30},"end":{"line":366,"column":48}}},"56":{"name":"(anonymous_56)","line":370,"loc":{"start":{"line":370,"column":11},"end":{"line":370,"column":26}}},"57":{"name":"(anonymous_57)","line":376,"loc":{"start":{"line":376,"column":24},"end":{"line":376,"column":65}}},"58":{"name":"(anonymous_58)","line":377,"loc":{"start":{"line":377,"column":33},"end":{"line":377,"column":46}}},"59":{"name":"_filter","line":383,"loc":{"start":{"line":383,"column":4},"end":{"line":383,"column":54}}},"60":{"name":"(anonymous_60)","line":385,"loc":{"start":{"line":385,"column":24},"end":{"line":385,"column":40}}},"61":{"name":"(anonymous_61)","line":388,"loc":{"start":{"line":388,"column":20},"end":{"line":388,"column":50}}},"62":{"name":"(anonymous_62)","line":389,"loc":{"start":{"line":389,"column":30},"end":{"line":389,"column":43}}},"63":{"name":"(anonymous_63)","line":395,"loc":{"start":{"line":395,"column":11},"end":{"line":395,"column":23}}},"64":{"name":"(anonymous_64)","line":396,"loc":{"start":{"line":396,"column":39},"end":{"line":396,"column":55}}},"65":{"name":"(anonymous_65)","line":398,"loc":{"start":{"line":398,"column":16},"end":{"line":398,"column":29}}},"66":{"name":"_reject","line":410,"loc":{"start":{"line":410,"column":4},"end":{"line":410,"column":54}}},"67":{"name":"(anonymous_67)","line":412,"loc":{"start":{"line":412,"column":24},"end":{"line":412,"column":40}}},"68":{"name":"(anonymous_68)","line":415,"loc":{"start":{"line":415,"column":20},"end":{"line":415,"column":50}}},"69":{"name":"(anonymous_69)","line":416,"loc":{"start":{"line":416,"column":30},"end":{"line":416,"column":43}}},"70":{"name":"(anonymous_70)","line":422,"loc":{"start":{"line":422,"column":11},"end":{"line":422,"column":23}}},"71":{"name":"(anonymous_71)","line":423,"loc":{"start":{"line":423,"column":39},"end":{"line":423,"column":55}}},"72":{"name":"(anonymous_72)","line":425,"loc":{"start":{"line":425,"column":16},"end":{"line":425,"column":29}}},"73":{"name":"_detect","line":433,"loc":{"start":{"line":433,"column":4},"end":{"line":433,"column":59}}},"74":{"name":"(anonymous_74)","line":434,"loc":{"start":{"line":434,"column":20},"end":{"line":434,"column":50}}},"75":{"name":"(anonymous_75)","line":435,"loc":{"start":{"line":435,"column":24},"end":{"line":435,"column":42}}},"76":{"name":"(anonymous_76)","line":444,"loc":{"start":{"line":444,"column":11},"end":{"line":444,"column":23}}},"77":{"name":"(anonymous_77)","line":452,"loc":{"start":{"line":452,"column":17},"end":{"line":452,"column":57}}},"78":{"name":"(anonymous_78)","line":453,"loc":{"start":{"line":453,"column":26},"end":{"line":453,"column":52}}},"79":{"name":"(anonymous_79)","line":454,"loc":{"start":{"line":454,"column":24},"end":{"line":454,"column":37}}},"80":{"name":"(anonymous_80)","line":461,"loc":{"start":{"line":461,"column":11},"end":{"line":461,"column":23}}},"81":{"name":"(anonymous_81)","line":467,"loc":{"start":{"line":467,"column":18},"end":{"line":467,"column":58}}},"82":{"name":"(anonymous_82)","line":468,"loc":{"start":{"line":468,"column":26},"end":{"line":468,"column":52}}},"83":{"name":"(anonymous_83)","line":469,"loc":{"start":{"line":469,"column":24},"end":{"line":469,"column":37}}},"84":{"name":"(anonymous_84)","line":476,"loc":{"start":{"line":476,"column":11},"end":{"line":476,"column":23}}},"85":{"name":"(anonymous_85)","line":481,"loc":{"start":{"line":481,"column":19},"end":{"line":481,"column":54}}},"86":{"name":"(anonymous_86)","line":482,"loc":{"start":{"line":482,"column":23},"end":{"line":482,"column":46}}},"87":{"name":"(anonymous_87)","line":483,"loc":{"start":{"line":483,"column":24},"end":{"line":483,"column":49}}},"88":{"name":"(anonymous_88)","line":491,"loc":{"start":{"line":491,"column":11},"end":{"line":491,"column":35}}},"89":{"name":"(anonymous_89)","line":496,"loc":{"start":{"line":496,"column":62},"end":{"line":496,"column":75}}},"90":{"name":"comparator","line":503,"loc":{"start":{"line":503,"column":8},"end":{"line":503,"column":41}}},"91":{"name":"(anonymous_91)","line":509,"loc":{"start":{"line":509,"column":17},"end":{"line":509,"column":44}}},"92":{"name":"addListener","line":520,"loc":{"start":{"line":520,"column":8},"end":{"line":520,"column":33}}},"93":{"name":"removeListener","line":523,"loc":{"start":{"line":523,"column":8},"end":{"line":523,"column":36}}},"94":{"name":"taskComplete","line":531,"loc":{"start":{"line":531,"column":8},"end":{"line":531,"column":32}}},"95":{"name":"(anonymous_95)","line":533,"loc":{"start":{"line":533,"column":43},"end":{"line":533,"column":57}}},"96":{"name":"(anonymous_96)","line":538,"loc":{"start":{"line":538,"column":20},"end":{"line":538,"column":32}}},"97":{"name":"(anonymous_97)","line":544,"loc":{"start":{"line":544,"column":25},"end":{"line":544,"column":38}}},"98":{"name":"taskCallback","line":546,"loc":{"start":{"line":546,"column":12},"end":{"line":546,"column":39}}},"99":{"name":"(anonymous_99)","line":553,"loc":{"start":{"line":553,"column":47},"end":{"line":553,"column":62}}},"100":{"name":"ready","line":576,"loc":{"start":{"line":576,"column":12},"end":{"line":576,"column":29}}},"101":{"name":"(anonymous_101)","line":577,"loc":{"start":{"line":577,"column":41},"end":{"line":577,"column":57}}},"102":{"name":"listener","line":587,"loc":{"start":{"line":587,"column":12},"end":{"line":587,"column":32}}},"103":{"name":"(anonymous_103)","line":596,"loc":{"start":{"line":596,"column":18},"end":{"line":596,"column":50}}},"104":{"name":"wrappedTask","line":608,"loc":{"start":{"line":608,"column":8},"end":{"line":608,"column":62}}},"105":{"name":"retryAttempt","line":609,"loc":{"start":{"line":609,"column":12},"end":{"line":609,"column":54}}},"106":{"name":"(anonymous_106)","line":610,"loc":{"start":{"line":610,"column":23},"end":{"line":610,"column":48}}},"107":{"name":"(anonymous_107)","line":611,"loc":{"start":{"line":611,"column":25},"end":{"line":611,"column":46}}},"108":{"name":"(anonymous_108)","line":620,"loc":{"start":{"line":620,"column":35},"end":{"line":620,"column":55}}},"109":{"name":"(anonymous_109)","line":630,"loc":{"start":{"line":630,"column":22},"end":{"line":630,"column":49}}},"110":{"name":"wrapIterator","line":639,"loc":{"start":{"line":639,"column":8},"end":{"line":639,"column":40}}},"111":{"name":"(anonymous_111)","line":640,"loc":{"start":{"line":640,"column":19},"end":{"line":640,"column":34}}},"112":{"name":"_parallel","line":660,"loc":{"start":{"line":660,"column":4},"end":{"line":660,"column":48}}},"113":{"name":"(anonymous_113)","line":664,"loc":{"start":{"line":664,"column":22},"end":{"line":664,"column":53}}},"114":{"name":"(anonymous_114)","line":665,"loc":{"start":{"line":665,"column":17},"end":{"line":665,"column":32}}},"115":{"name":"(anonymous_115)","line":673,"loc":{"start":{"line":673,"column":11},"end":{"line":673,"column":26}}},"116":{"name":"(anonymous_116)","line":678,"loc":{"start":{"line":678,"column":21},"end":{"line":678,"column":48}}},"117":{"name":"(anonymous_117)","line":682,"loc":{"start":{"line":682,"column":26},"end":{"line":682,"column":59}}},"118":{"name":"(anonymous_118)","line":686,"loc":{"start":{"line":686,"column":19},"end":{"line":686,"column":46}}},"119":{"name":"(anonymous_119)","line":690,"loc":{"start":{"line":690,"column":34},"end":{"line":690,"column":65}}},"120":{"name":"(anonymous_120)","line":691,"loc":{"start":{"line":691,"column":17},"end":{"line":691,"column":32}}},"121":{"name":"(anonymous_121)","line":699,"loc":{"start":{"line":699,"column":11},"end":{"line":699,"column":26}}},"122":{"name":"(anonymous_122)","line":704,"loc":{"start":{"line":704,"column":21},"end":{"line":704,"column":38}}},"123":{"name":"makeCallback","line":705,"loc":{"start":{"line":705,"column":8},"end":{"line":705,"column":37}}},"124":{"name":"fn","line":706,"loc":{"start":{"line":706,"column":12},"end":{"line":706,"column":26}}},"125":{"name":"(anonymous_125)","line":712,"loc":{"start":{"line":712,"column":22},"end":{"line":712,"column":34}}},"126":{"name":"(anonymous_126)","line":720,"loc":{"start":{"line":720,"column":18},"end":{"line":720,"column":32}}},"127":{"name":"(anonymous_127)","line":722,"loc":{"start":{"line":722,"column":15},"end":{"line":722,"column":27}}},"128":{"name":"_concat","line":729,"loc":{"start":{"line":729,"column":4},"end":{"line":729,"column":48}}},"129":{"name":"(anonymous_129)","line":731,"loc":{"start":{"line":731,"column":20},"end":{"line":731,"column":44}}},"130":{"name":"(anonymous_130)","line":732,"loc":{"start":{"line":732,"column":18},"end":{"line":732,"column":36}}},"131":{"name":"(anonymous_131)","line":736,"loc":{"start":{"line":736,"column":11},"end":{"line":736,"column":26}}},"132":{"name":"(anonymous_132)","line":743,"loc":{"start":{"line":743,"column":19},"end":{"line":743,"column":55}}},"133":{"name":"(anonymous_133)","line":745,"loc":{"start":{"line":745,"column":21},"end":{"line":745,"column":36}}},"134":{"name":"(anonymous_134)","line":757,"loc":{"start":{"line":757,"column":21},"end":{"line":757,"column":57}}},"135":{"name":"(anonymous_135)","line":758,"loc":{"start":{"line":758,"column":17},"end":{"line":758,"column":32}}},"136":{"name":"(anonymous_136)","line":772,"loc":{"start":{"line":772,"column":18},"end":{"line":772,"column":54}}},"137":{"name":"(anonymous_137)","line":774,"loc":{"start":{"line":774,"column":21},"end":{"line":774,"column":36}}},"138":{"name":"(anonymous_138)","line":786,"loc":{"start":{"line":786,"column":20},"end":{"line":786,"column":56}}},"139":{"name":"(anonymous_139)","line":787,"loc":{"start":{"line":787,"column":17},"end":{"line":787,"column":32}}},"140":{"name":"_queue","line":801,"loc":{"start":{"line":801,"column":4},"end":{"line":801,"column":50}}},"141":{"name":"_insert","line":808,"loc":{"start":{"line":808,"column":8},"end":{"line":808,"column":49}}},"142":{"name":"(anonymous_142)","line":818,"loc":{"start":{"line":818,"column":42},"end":{"line":818,"column":53}}},"143":{"name":"(anonymous_143)","line":822,"loc":{"start":{"line":822,"column":29},"end":{"line":822,"column":44}}},"144":{"name":"(anonymous_144)","line":850,"loc":{"start":{"line":850,"column":18},"end":{"line":850,"column":44}}},"145":{"name":"(anonymous_145)","line":853,"loc":{"start":{"line":853,"column":18},"end":{"line":853,"column":30}}},"146":{"name":"(anonymous_146)","line":857,"loc":{"start":{"line":857,"column":21},"end":{"line":857,"column":47}}},"147":{"name":"(anonymous_147)","line":860,"loc":{"start":{"line":860,"column":21},"end":{"line":860,"column":33}}},"148":{"name":"(anonymous_148)","line":866,"loc":{"start":{"line":866,"column":43},"end":{"line":866,"column":59}}},"149":{"name":"next","line":878,"loc":{"start":{"line":878,"column":16},"end":{"line":878,"column":32}}},"150":{"name":"(anonymous_150)","line":881,"loc":{"start":{"line":881,"column":38},"end":{"line":881,"column":54}}},"151":{"name":"(anonymous_151)","line":890,"loc":{"start":{"line":890,"column":20},"end":{"line":890,"column":32}}},"152":{"name":"(anonymous_152)","line":893,"loc":{"start":{"line":893,"column":21},"end":{"line":893,"column":33}}},"153":{"name":"(anonymous_153)","line":896,"loc":{"start":{"line":896,"column":18},"end":{"line":896,"column":29}}},"154":{"name":"(anonymous_154)","line":899,"loc":{"start":{"line":899,"column":19},"end":{"line":899,"column":31}}},"155":{"name":"(anonymous_155)","line":902,"loc":{"start":{"line":902,"column":20},"end":{"line":902,"column":32}}},"156":{"name":"(anonymous_156)","line":916,"loc":{"start":{"line":916,"column":18},"end":{"line":916,"column":49}}},"157":{"name":"(anonymous_157)","line":917,"loc":{"start":{"line":917,"column":23},"end":{"line":917,"column":44}}},"158":{"name":"(anonymous_158)","line":924,"loc":{"start":{"line":924,"column":26},"end":{"line":924,"column":57}}},"159":{"name":"_compareTasks","line":926,"loc":{"start":{"line":926,"column":8},"end":{"line":926,"column":36}}},"160":{"name":"_binarySearch","line":930,"loc":{"start":{"line":930,"column":8},"end":{"line":930,"column":56}}},"161":{"name":"_insert","line":944,"loc":{"start":{"line":944,"column":8},"end":{"line":944,"column":54}}},"162":{"name":"(anonymous_162)","line":954,"loc":{"start":{"line":954,"column":42},"end":{"line":954,"column":53}}},"163":{"name":"(anonymous_163)","line":958,"loc":{"start":{"line":958,"column":29},"end":{"line":958,"column":44}}},"164":{"name":"(anonymous_164)","line":978,"loc":{"start":{"line":978,"column":17},"end":{"line":978,"column":53}}},"165":{"name":"(anonymous_165)","line":988,"loc":{"start":{"line":988,"column":18},"end":{"line":988,"column":45}}},"166":{"name":"_console_fn","line":992,"loc":{"start":{"line":992,"column":4},"end":{"line":992,"column":31}}},"167":{"name":"(anonymous_167)","line":993,"loc":{"start":{"line":993,"column":15},"end":{"line":993,"column":29}}},"168":{"name":"(anonymous_168)","line":995,"loc":{"start":{"line":995,"column":40},"end":{"line":995,"column":55}}},"169":{"name":"(anonymous_169)","line":1004,"loc":{"start":{"line":1004,"column":41},"end":{"line":1004,"column":54}}},"170":{"name":"(anonymous_170)","line":1018,"loc":{"start":{"line":1018,"column":20},"end":{"line":1018,"column":42}}},"171":{"name":"(anonymous_171)","line":1021,"loc":{"start":{"line":1021,"column":27},"end":{"line":1021,"column":40}}},"172":{"name":"memoized","line":1024,"loc":{"start":{"line":1024,"column":8},"end":{"line":1024,"column":28}}},"173":{"name":"(anonymous_173)","line":1029,"loc":{"start":{"line":1029,"column":31},"end":{"line":1029,"column":43}}},"174":{"name":"(anonymous_174)","line":1038,"loc":{"start":{"line":1038,"column":44},"end":{"line":1038,"column":56}}},"175":{"name":"(anonymous_175)","line":1053,"loc":{"start":{"line":1053,"column":22},"end":{"line":1053,"column":36}}},"176":{"name":"(anonymous_176)","line":1054,"loc":{"start":{"line":1054,"column":13},"end":{"line":1054,"column":25}}},"177":{"name":"(anonymous_177)","line":1059,"loc":{"start":{"line":1059,"column":18},"end":{"line":1059,"column":55}}},"178":{"name":"(anonymous_178)","line":1067,"loc":{"start":{"line":1067,"column":24},"end":{"line":1067,"column":61}}},"179":{"name":"(anonymous_179)","line":1075,"loc":{"start":{"line":1075,"column":16},"end":{"line":1075,"column":46}}},"180":{"name":"(anonymous_180)","line":1077,"loc":{"start":{"line":1077,"column":15},"end":{"line":1077,"column":27}}},"181":{"name":"(anonymous_181)","line":1088,"loc":{"start":{"line":1088,"column":36},"end":{"line":1088,"column":63}}},"182":{"name":"(anonymous_182)","line":1089,"loc":{"start":{"line":1089,"column":47},"end":{"line":1089,"column":59}}},"183":{"name":"(anonymous_183)","line":1095,"loc":{"start":{"line":1095,"column":12},"end":{"line":1095,"column":36}}},"184":{"name":"(anonymous_184)","line":1101,"loc":{"start":{"line":1101,"column":20},"end":{"line":1101,"column":50}}},"185":{"name":"_applyEach","line":1106,"loc":{"start":{"line":1106,"column":4},"end":{"line":1106,"column":49}}},"186":{"name":"go","line":1107,"loc":{"start":{"line":1107,"column":8},"end":{"line":1107,"column":22}}},"187":{"name":"(anonymous_187)","line":1111,"loc":{"start":{"line":1111,"column":31},"end":{"line":1111,"column":52}}},"188":{"name":"(anonymous_188)","line":1125,"loc":{"start":{"line":1125,"column":22},"end":{"line":1125,"column":50}}},"189":{"name":"(anonymous_189)","line":1129,"loc":{"start":{"line":1129,"column":28},"end":{"line":1129,"column":56}}},"190":{"name":"(anonymous_190)","line":1135,"loc":{"start":{"line":1135,"column":20},"end":{"line":1135,"column":44}}},"191":{"name":"next","line":1138,"loc":{"start":{"line":1138,"column":8},"end":{"line":1138,"column":27}}},"192":{"name":"ensureAsync","line":1147,"loc":{"start":{"line":1147,"column":4},"end":{"line":1147,"column":29}}},"193":{"name":"(anonymous_193)","line":1148,"loc":{"start":{"line":1148,"column":15},"end":{"line":1148,"column":48}}},"194":{"name":"(anonymous_194)","line":1151,"loc":{"start":{"line":1151,"column":22},"end":{"line":1151,"column":34}}},"195":{"name":"(anonymous_195)","line":1154,"loc":{"start":{"line":1154,"column":39},"end":{"line":1154,"column":51}}},"196":{"name":"(anonymous_196)","line":1175,"loc":{"start":{"line":1175,"column":19},"end":{"line":1175,"column":31}}}},"statementMap":{"1":{"start":{"line":8,"column":0},"end":{"line":1184,"column":5}},"2":{"start":{"line":10,"column":4},"end":{"line":10,"column":19}},"3":{"start":{"line":11,"column":4},"end":{"line":11,"column":22}},"4":{"start":{"line":14,"column":4},"end":{"line":14,"column":29}},"5":{"start":{"line":16,"column":4},"end":{"line":24,"column":5}},"6":{"start":{"line":17,"column":8},"end":{"line":17,"column":22}},"7":{"start":{"line":19,"column":9},"end":{"line":24,"column":5}},"8":{"start":{"line":20,"column":8},"end":{"line":20,"column":22}},"9":{"start":{"line":23,"column":8},"end":{"line":23,"column":20}},"10":{"start":{"line":26,"column":4},"end":{"line":28,"column":5}},"11":{"start":{"line":27,"column":6},"end":{"line":27,"column":34}},"12":{"start":{"line":30,"column":4},"end":{"line":33,"column":6}},"13":{"start":{"line":31,"column":8},"end":{"line":31,"column":36}},"14":{"start":{"line":32,"column":8},"end":{"line":32,"column":21}},"15":{"start":{"line":35,"column":4},"end":{"line":42,"column":5}},"16":{"start":{"line":36,"column":8},"end":{"line":36,"column":27}},"17":{"start":{"line":37,"column":8},"end":{"line":41,"column":10}},"18":{"start":{"line":38,"column":12},"end":{"line":38,"column":72}},"19":{"start":{"line":38,"column":24},"end":{"line":38,"column":72}},"20":{"start":{"line":39,"column":12},"end":{"line":39,"column":26}},"21":{"start":{"line":40,"column":12},"end":{"line":40,"column":38}},"22":{"start":{"line":44,"column":4},"end":{"line":51,"column":5}},"23":{"start":{"line":45,"column":8},"end":{"line":45,"column":27}},"24":{"start":{"line":46,"column":8},"end":{"line":50,"column":10}},"25":{"start":{"line":47,"column":12},"end":{"line":47,"column":31}},"26":{"start":{"line":47,"column":24},"end":{"line":47,"column":31}},"27":{"start":{"line":48,"column":12},"end":{"line":48,"column":26}},"28":{"start":{"line":49,"column":12},"end":{"line":49,"column":38}},"29":{"start":{"line":55,"column":4},"end":{"line":55,"column":46}},"30":{"start":{"line":57,"column":4},"end":{"line":59,"column":6}},"31":{"start":{"line":58,"column":8},"end":{"line":58,"column":56}},"32":{"start":{"line":61,"column":4},"end":{"line":68,"column":5}},"33":{"start":{"line":62,"column":8},"end":{"line":67,"column":10}},"34":{"start":{"line":70,"column":4},"end":{"line":74,"column":5}},"35":{"start":{"line":71,"column":8},"end":{"line":73,"column":39}},"36":{"start":{"line":76,"column":4},"end":{"line":83,"column":5}},"37":{"start":{"line":77,"column":6},"end":{"line":78,"column":30}},"38":{"start":{"line":80,"column":6},"end":{"line":82,"column":7}},"39":{"start":{"line":81,"column":8},"end":{"line":81,"column":41}},"40":{"start":{"line":85,"column":4},"end":{"line":94,"column":5}},"41":{"start":{"line":86,"column":6},"end":{"line":88,"column":33}},"42":{"start":{"line":90,"column":6},"end":{"line":92,"column":7}},"43":{"start":{"line":91,"column":8},"end":{"line":91,"column":57}},"44":{"start":{"line":93,"column":6},"end":{"line":93,"column":20}},"45":{"start":{"line":96,"column":4},"end":{"line":101,"column":5}},"46":{"start":{"line":97,"column":8},"end":{"line":99,"column":11}},"47":{"start":{"line":98,"column":12},"end":{"line":98,"column":43}},"48":{"start":{"line":100,"column":8},"end":{"line":100,"column":20}},"49":{"start":{"line":103,"column":4},"end":{"line":107,"column":5}},"50":{"start":{"line":104,"column":8},"end":{"line":106,"column":11}},"51":{"start":{"line":105,"column":12},"end":{"line":105,"column":39}},"52":{"start":{"line":109,"column":4},"end":{"line":117,"column":6}},"53":{"start":{"line":110,"column":8},"end":{"line":110,"column":22}},"54":{"start":{"line":111,"column":8},"end":{"line":115,"column":9}},"55":{"start":{"line":112,"column":12},"end":{"line":114,"column":13}},"56":{"start":{"line":113,"column":16},"end":{"line":113,"column":29}},"57":{"start":{"line":116,"column":8},"end":{"line":116,"column":20}},"58":{"start":{"line":119,"column":4},"end":{"line":137,"column":5}},"59":{"start":{"line":120,"column":8},"end":{"line":120,"column":19}},"60":{"start":{"line":121,"column":8},"end":{"line":121,"column":16}},"61":{"start":{"line":122,"column":8},"end":{"line":122,"column":17}},"62":{"start":{"line":123,"column":8},"end":{"line":136,"column":9}},"63":{"start":{"line":124,"column":12},"end":{"line":124,"column":30}},"64":{"start":{"line":125,"column":12},"end":{"line":128,"column":14}},"65":{"start":{"line":126,"column":16},"end":{"line":126,"column":20}},"66":{"start":{"line":127,"column":16},"end":{"line":127,"column":42}},"67":{"start":{"line":130,"column":12},"end":{"line":130,"column":31}},"68":{"start":{"line":131,"column":12},"end":{"line":131,"column":30}},"69":{"start":{"line":132,"column":12},"end":{"line":135,"column":14}},"70":{"start":{"line":133,"column":16},"end":{"line":133,"column":20}},"71":{"start":{"line":134,"column":16},"end":{"line":134,"column":48}},"72":{"start":{"line":139,"column":4},"end":{"line":154,"column":5}},"73":{"start":{"line":140,"column":8},"end":{"line":140,"column":27}},"74":{"start":{"line":141,"column":8},"end":{"line":141,"column":23}},"75":{"start":{"line":142,"column":8},"end":{"line":142,"column":32}},"76":{"start":{"line":144,"column":8},"end":{"line":147,"column":9}},"77":{"start":{"line":145,"column":10},"end":{"line":145,"column":26}},"78":{"start":{"line":146,"column":10},"end":{"line":146,"column":43}},"79":{"start":{"line":148,"column":8},"end":{"line":148,"column":35}},"80":{"start":{"line":150,"column":8},"end":{"line":152,"column":9}},"81":{"start":{"line":151,"column":10},"end":{"line":151,"column":45}},"82":{"start":{"line":153,"column":8},"end":{"line":153,"column":22}},"83":{"start":{"line":156,"column":4},"end":{"line":160,"column":5}},"84":{"start":{"line":157,"column":8},"end":{"line":159,"column":10}},"85":{"start":{"line":158,"column":12},"end":{"line":158,"column":45}},"86":{"start":{"line":167,"column":4},"end":{"line":167,"column":22}},"87":{"start":{"line":168,"column":4},"end":{"line":170,"column":5}},"88":{"start":{"line":169,"column":8},"end":{"line":169,"column":37}},"89":{"start":{"line":172,"column":4},"end":{"line":198,"column":5}},"90":{"start":{"line":173,"column":8},"end":{"line":185,"column":9}},"91":{"start":{"line":174,"column":12},"end":{"line":177,"column":14}},"92":{"start":{"line":176,"column":16},"end":{"line":176,"column":34}},"93":{"start":{"line":178,"column":12},"end":{"line":178,"column":48}},"94":{"start":{"line":181,"column":12},"end":{"line":183,"column":14}},"95":{"start":{"line":182,"column":16},"end":{"line":182,"column":34}},"96":{"start":{"line":184,"column":12},"end":{"line":184,"column":48}},"97":{"start":{"line":188,"column":8},"end":{"line":188,"column":42}},"98":{"start":{"line":189,"column":8},"end":{"line":197,"column":9}},"99":{"start":{"line":190,"column":12},"end":{"line":193,"column":14}},"100":{"start":{"line":192,"column":14},"end":{"line":192,"column":32}},"101":{"start":{"line":196,"column":12},"end":{"line":196,"column":48}},"102":{"start":{"line":200,"column":4},"end":{"line":203,"column":6}},"103":{"start":{"line":202,"column":8},"end":{"line":202,"column":68}},"104":{"start":{"line":205,"column":4},"end":{"line":208,"column":6}},"105":{"start":{"line":207,"column":8},"end":{"line":207,"column":74}},"106":{"start":{"line":211,"column":4},"end":{"line":214,"column":6}},"107":{"start":{"line":213,"column":8},"end":{"line":213,"column":75}},"108":{"start":{"line":216,"column":4},"end":{"line":239,"column":6}},"109":{"start":{"line":218,"column":8},"end":{"line":218,"column":43}},"110":{"start":{"line":219,"column":8},"end":{"line":219,"column":30}},"111":{"start":{"line":220,"column":8},"end":{"line":220,"column":57}},"112":{"start":{"line":221,"column":8},"end":{"line":221,"column":26}},"113":{"start":{"line":222,"column":8},"end":{"line":224,"column":9}},"114":{"start":{"line":223,"column":12},"end":{"line":223,"column":34}},"115":{"start":{"line":225,"column":8},"end":{"line":227,"column":11}},"116":{"start":{"line":226,"column":12},"end":{"line":226,"column":56}},"117":{"start":{"line":228,"column":8},"end":{"line":238,"column":9}},"118":{"start":{"line":229,"column":10},"end":{"line":237,"column":11}},"119":{"start":{"line":230,"column":14},"end":{"line":230,"column":28}},"120":{"start":{"line":233,"column":14},"end":{"line":233,"column":29}},"121":{"start":{"line":234,"column":14},"end":{"line":236,"column":15}},"122":{"start":{"line":235,"column":18},"end":{"line":235,"column":33}},"123":{"start":{"line":241,"column":4},"end":{"line":268,"column":6}},"124":{"start":{"line":243,"column":8},"end":{"line":243,"column":43}},"125":{"start":{"line":244,"column":8},"end":{"line":244,"column":24}},"126":{"start":{"line":245,"column":8},"end":{"line":245,"column":40}},"127":{"start":{"line":246,"column":8},"end":{"line":266,"column":9}},"128":{"start":{"line":247,"column":12},"end":{"line":247,"column":28}},"129":{"start":{"line":248,"column":12},"end":{"line":248,"column":32}},"130":{"start":{"line":249,"column":12},"end":{"line":251,"column":13}},"131":{"start":{"line":250,"column":16},"end":{"line":250,"column":38}},"132":{"start":{"line":252,"column":12},"end":{"line":264,"column":15}},"133":{"start":{"line":253,"column":16},"end":{"line":263,"column":17}},"134":{"start":{"line":254,"column":20},"end":{"line":254,"column":34}},"135":{"start":{"line":257,"column":20},"end":{"line":262,"column":21}},"136":{"start":{"line":258,"column":24},"end":{"line":258,"column":48}},"137":{"start":{"line":261,"column":24},"end":{"line":261,"column":34}},"138":{"start":{"line":265,"column":12},"end":{"line":265,"column":25}},"139":{"start":{"line":267,"column":8},"end":{"line":267,"column":18}},"140":{"start":{"line":272,"column":4},"end":{"line":275,"column":6}},"141":{"start":{"line":274,"column":8},"end":{"line":274,"column":53}},"142":{"start":{"line":277,"column":4},"end":{"line":318,"column":5}},"143":{"start":{"line":279,"column":8},"end":{"line":317,"column":10}},"144":{"start":{"line":280,"column":12},"end":{"line":280,"column":47}},"145":{"start":{"line":281,"column":12},"end":{"line":281,"column":28}},"146":{"start":{"line":282,"column":12},"end":{"line":282,"column":44}},"147":{"start":{"line":283,"column":12},"end":{"line":285,"column":13}},"148":{"start":{"line":284,"column":16},"end":{"line":284,"column":38}},"149":{"start":{"line":286,"column":12},"end":{"line":286,"column":29}},"150":{"start":{"line":287,"column":12},"end":{"line":287,"column":28}},"151":{"start":{"line":288,"column":12},"end":{"line":288,"column":32}},"152":{"start":{"line":290,"column":12},"end":{"line":316,"column":17}},"153":{"start":{"line":291,"column":16},"end":{"line":293,"column":17}},"154":{"start":{"line":292,"column":20},"end":{"line":292,"column":42}},"155":{"start":{"line":295,"column":16},"end":{"line":315,"column":17}},"156":{"start":{"line":296,"column":20},"end":{"line":296,"column":40}},"157":{"start":{"line":297,"column":20},"end":{"line":303,"column":21}},"158":{"start":{"line":298,"column":24},"end":{"line":298,"column":36}},"159":{"start":{"line":299,"column":24},"end":{"line":301,"column":25}},"160":{"start":{"line":300,"column":28},"end":{"line":300,"column":43}},"161":{"start":{"line":302,"column":24},"end":{"line":302,"column":31}},"162":{"start":{"line":304,"column":20},"end":{"line":304,"column":33}},"163":{"start":{"line":305,"column":20},"end":{"line":314,"column":23}},"164":{"start":{"line":306,"column":24},"end":{"line":306,"column":37}},"165":{"start":{"line":307,"column":24},"end":{"line":313,"column":25}},"166":{"start":{"line":308,"column":28},"end":{"line":308,"column":42}},"167":{"start":{"line":309,"column":28},"end":{"line":309,"column":43}},"168":{"start":{"line":312,"column":28},"end":{"line":312,"column":40}},"169":{"start":{"line":321,"column":4},"end":{"line":325,"column":5}},"170":{"start":{"line":322,"column":8},"end":{"line":324,"column":10}},"171":{"start":{"line":323,"column":12},"end":{"line":323,"column":61}},"172":{"start":{"line":326,"column":4},"end":{"line":330,"column":5}},"173":{"start":{"line":327,"column":8},"end":{"line":329,"column":10}},"174":{"start":{"line":328,"column":12},"end":{"line":328,"column":68}},"175":{"start":{"line":331,"column":4},"end":{"line":335,"column":5}},"176":{"start":{"line":332,"column":8},"end":{"line":334,"column":10}},"177":{"start":{"line":333,"column":12},"end":{"line":333,"column":67}},"178":{"start":{"line":337,"column":4},"end":{"line":348,"column":5}},"179":{"start":{"line":338,"column":8},"end":{"line":338,"column":43}},"180":{"start":{"line":339,"column":8},"end":{"line":339,"column":25}},"181":{"start":{"line":340,"column":8},"end":{"line":347,"column":11}},"182":{"start":{"line":341,"column":12},"end":{"line":344,"column":15}},"183":{"start":{"line":342,"column":16},"end":{"line":342,"column":35}},"184":{"start":{"line":343,"column":16},"end":{"line":343,"column":30}},"185":{"start":{"line":346,"column":12},"end":{"line":346,"column":35}},"186":{"start":{"line":350,"column":4},"end":{"line":350,"column":38}},"187":{"start":{"line":351,"column":4},"end":{"line":351,"column":42}},"188":{"start":{"line":352,"column":4},"end":{"line":354,"column":6}},"189":{"start":{"line":353,"column":8},"end":{"line":353,"column":57}},"190":{"start":{"line":356,"column":4},"end":{"line":358,"column":5}},"191":{"start":{"line":357,"column":8},"end":{"line":357,"column":49}},"192":{"start":{"line":362,"column":4},"end":{"line":373,"column":6}},"193":{"start":{"line":365,"column":8},"end":{"line":372,"column":11}},"194":{"start":{"line":366,"column":12},"end":{"line":369,"column":15}},"195":{"start":{"line":367,"column":16},"end":{"line":367,"column":25}},"196":{"start":{"line":368,"column":16},"end":{"line":368,"column":30}},"197":{"start":{"line":371,"column":12},"end":{"line":371,"column":40}},"198":{"start":{"line":375,"column":4},"end":{"line":381,"column":6}},"199":{"start":{"line":377,"column":8},"end":{"line":379,"column":21}},"200":{"start":{"line":378,"column":12},"end":{"line":378,"column":21}},"201":{"start":{"line":380,"column":8},"end":{"line":380,"column":57}},"202":{"start":{"line":383,"column":4},"end":{"line":402,"column":5}},"203":{"start":{"line":384,"column":8},"end":{"line":384,"column":25}},"204":{"start":{"line":385,"column":8},"end":{"line":387,"column":11}},"205":{"start":{"line":386,"column":12},"end":{"line":386,"column":40}},"206":{"start":{"line":388,"column":8},"end":{"line":401,"column":11}},"207":{"start":{"line":389,"column":12},"end":{"line":394,"column":15}},"208":{"start":{"line":390,"column":16},"end":{"line":392,"column":17}},"209":{"start":{"line":391,"column":20},"end":{"line":391,"column":36}},"210":{"start":{"line":393,"column":16},"end":{"line":393,"column":27}},"211":{"start":{"line":396,"column":12},"end":{"line":400,"column":16}},"212":{"start":{"line":397,"column":16},"end":{"line":397,"column":41}},"213":{"start":{"line":399,"column":16},"end":{"line":399,"column":31}},"214":{"start":{"line":404,"column":4},"end":{"line":405,"column":39}},"215":{"start":{"line":407,"column":4},"end":{"line":408,"column":43}},"216":{"start":{"line":410,"column":4},"end":{"line":429,"column":5}},"217":{"start":{"line":411,"column":8},"end":{"line":411,"column":25}},"218":{"start":{"line":412,"column":8},"end":{"line":414,"column":11}},"219":{"start":{"line":413,"column":12},"end":{"line":413,"column":40}},"220":{"start":{"line":415,"column":8},"end":{"line":428,"column":11}},"221":{"start":{"line":416,"column":12},"end":{"line":421,"column":15}},"222":{"start":{"line":417,"column":16},"end":{"line":419,"column":17}},"223":{"start":{"line":418,"column":20},"end":{"line":418,"column":36}},"224":{"start":{"line":420,"column":16},"end":{"line":420,"column":27}},"225":{"start":{"line":423,"column":12},"end":{"line":427,"column":16}},"226":{"start":{"line":424,"column":16},"end":{"line":424,"column":41}},"227":{"start":{"line":426,"column":16},"end":{"line":426,"column":31}},"228":{"start":{"line":430,"column":4},"end":{"line":430,"column":39}},"229":{"start":{"line":431,"column":4},"end":{"line":431,"column":43}},"230":{"start":{"line":433,"column":4},"end":{"line":447,"column":5}},"231":{"start":{"line":434,"column":8},"end":{"line":446,"column":11}},"232":{"start":{"line":435,"column":12},"end":{"line":443,"column":15}},"233":{"start":{"line":436,"column":16},"end":{"line":442,"column":17}},"234":{"start":{"line":437,"column":20},"end":{"line":437,"column":37}},"235":{"start":{"line":438,"column":20},"end":{"line":438,"column":41}},"236":{"start":{"line":441,"column":20},"end":{"line":441,"column":31}},"237":{"start":{"line":445,"column":12},"end":{"line":445,"column":28}},"238":{"start":{"line":448,"column":4},"end":{"line":448,"column":39}},"239":{"start":{"line":449,"column":4},"end":{"line":449,"column":43}},"240":{"start":{"line":451,"column":4},"end":{"line":464,"column":6}},"241":{"start":{"line":453,"column":8},"end":{"line":463,"column":11}},"242":{"start":{"line":454,"column":12},"end":{"line":460,"column":15}},"243":{"start":{"line":455,"column":16},"end":{"line":458,"column":17}},"244":{"start":{"line":456,"column":20},"end":{"line":456,"column":40}},"245":{"start":{"line":457,"column":20},"end":{"line":457,"column":41}},"246":{"start":{"line":459,"column":16},"end":{"line":459,"column":27}},"247":{"start":{"line":462,"column":12},"end":{"line":462,"column":33}},"248":{"start":{"line":466,"column":4},"end":{"line":479,"column":6}},"249":{"start":{"line":468,"column":8},"end":{"line":478,"column":11}},"250":{"start":{"line":469,"column":12},"end":{"line":475,"column":15}},"251":{"start":{"line":470,"column":16},"end":{"line":473,"column":17}},"252":{"start":{"line":471,"column":20},"end":{"line":471,"column":41}},"253":{"start":{"line":472,"column":20},"end":{"line":472,"column":41}},"254":{"start":{"line":474,"column":16},"end":{"line":474,"column":27}},"255":{"start":{"line":477,"column":12},"end":{"line":477,"column":32}},"256":{"start":{"line":481,"column":4},"end":{"line":507,"column":6}},"257":{"start":{"line":482,"column":8},"end":{"line":501,"column":11}},"258":{"start":{"line":483,"column":12},"end":{"line":490,"column":15}},"259":{"start":{"line":484,"column":16},"end":{"line":489,"column":17}},"260":{"start":{"line":485,"column":20},"end":{"line":485,"column":34}},"261":{"start":{"line":488,"column":20},"end":{"line":488,"column":67}},"262":{"start":{"line":492,"column":12},"end":{"line":499,"column":13}},"263":{"start":{"line":493,"column":16},"end":{"line":493,"column":37}},"264":{"start":{"line":496,"column":16},"end":{"line":498,"column":20}},"265":{"start":{"line":497,"column":20},"end":{"line":497,"column":35}},"266":{"start":{"line":503,"column":8},"end":{"line":506,"column":9}},"267":{"start":{"line":504,"column":12},"end":{"line":504,"column":54}},"268":{"start":{"line":505,"column":12},"end":{"line":505,"column":46}},"269":{"start":{"line":509,"column":4},"end":{"line":594,"column":6}},"270":{"start":{"line":510,"column":8},"end":{"line":510,"column":43}},"271":{"start":{"line":511,"column":8},"end":{"line":511,"column":32}},"272":{"start":{"line":512,"column":8},"end":{"line":512,"column":41}},"273":{"start":{"line":513,"column":8},"end":{"line":515,"column":9}},"274":{"start":{"line":514,"column":12},"end":{"line":514,"column":34}},"275":{"start":{"line":517,"column":8},"end":{"line":517,"column":25}},"276":{"start":{"line":519,"column":8},"end":{"line":519,"column":27}},"277":{"start":{"line":520,"column":8},"end":{"line":522,"column":9}},"278":{"start":{"line":521,"column":12},"end":{"line":521,"column":34}},"279":{"start":{"line":523,"column":8},"end":{"line":530,"column":9}},"280":{"start":{"line":524,"column":12},"end":{"line":529,"column":13}},"281":{"start":{"line":525,"column":16},"end":{"line":528,"column":17}},"282":{"start":{"line":526,"column":20},"end":{"line":526,"column":43}},"283":{"start":{"line":527,"column":20},"end":{"line":527,"column":27}},"284":{"start":{"line":531,"column":8},"end":{"line":536,"column":9}},"285":{"start":{"line":532,"column":12},"end":{"line":532,"column":29}},"286":{"start":{"line":533,"column":12},"end":{"line":535,"column":15}},"287":{"start":{"line":534,"column":16},"end":{"line":534,"column":21}},"288":{"start":{"line":538,"column":8},"end":{"line":542,"column":11}},"289":{"start":{"line":539,"column":12},"end":{"line":541,"column":13}},"290":{"start":{"line":540,"column":16},"end":{"line":540,"column":40}},"291":{"start":{"line":544,"column":8},"end":{"line":593,"column":11}},"292":{"start":{"line":545,"column":12},"end":{"line":545,"column":65}},"293":{"start":{"line":546,"column":12},"end":{"line":563,"column":13}},"294":{"start":{"line":547,"column":16},"end":{"line":547,"column":52}},"295":{"start":{"line":548,"column":16},"end":{"line":550,"column":17}},"296":{"start":{"line":549,"column":20},"end":{"line":549,"column":35}},"297":{"start":{"line":551,"column":16},"end":{"line":562,"column":17}},"298":{"start":{"line":552,"column":20},"end":{"line":552,"column":41}},"299":{"start":{"line":553,"column":20},"end":{"line":555,"column":23}},"300":{"start":{"line":554,"column":24},"end":{"line":554,"column":58}},"301":{"start":{"line":556,"column":20},"end":{"line":556,"column":42}},"302":{"start":{"line":557,"column":20},"end":{"line":557,"column":47}},"303":{"start":{"line":560,"column":20},"end":{"line":560,"column":38}},"304":{"start":{"line":561,"column":20},"end":{"line":561,"column":53}},"305":{"start":{"line":564,"column":12},"end":{"line":564,"column":74}},"306":{"start":{"line":566,"column":12},"end":{"line":566,"column":38}},"307":{"start":{"line":567,"column":12},"end":{"line":567,"column":20}},"308":{"start":{"line":568,"column":12},"end":{"line":575,"column":13}},"309":{"start":{"line":569,"column":16},"end":{"line":571,"column":17}},"310":{"start":{"line":570,"column":20},"end":{"line":570,"column":65}},"311":{"start":{"line":572,"column":16},"end":{"line":574,"column":17}},"312":{"start":{"line":573,"column":20},"end":{"line":573,"column":63}},"313":{"start":{"line":576,"column":12},"end":{"line":580,"column":13}},"314":{"start":{"line":577,"column":16},"end":{"line":579,"column":55}},"315":{"start":{"line":578,"column":20},"end":{"line":578,"column":60}},"316":{"start":{"line":581,"column":12},"end":{"line":586,"column":13}},"317":{"start":{"line":582,"column":16},"end":{"line":582,"column":61}},"318":{"start":{"line":585,"column":16},"end":{"line":585,"column":38}},"319":{"start":{"line":587,"column":12},"end":{"line":592,"column":13}},"320":{"start":{"line":588,"column":16},"end":{"line":591,"column":17}},"321":{"start":{"line":589,"column":20},"end":{"line":589,"column":45}},"322":{"start":{"line":590,"column":20},"end":{"line":590,"column":65}},"323":{"start":{"line":596,"column":4},"end":{"line":628,"column":6}},"324":{"start":{"line":597,"column":8},"end":{"line":597,"column":30}},"325":{"start":{"line":598,"column":8},"end":{"line":598,"column":26}},"326":{"start":{"line":600,"column":8},"end":{"line":604,"column":9}},"327":{"start":{"line":601,"column":12},"end":{"line":601,"column":28}},"328":{"start":{"line":602,"column":12},"end":{"line":602,"column":25}},"329":{"start":{"line":603,"column":12},"end":{"line":603,"column":34}},"330":{"start":{"line":606,"column":8},"end":{"line":606,"column":53}},"331":{"start":{"line":608,"column":8},"end":{"line":624,"column":9}},"332":{"start":{"line":609,"column":12},"end":{"line":615,"column":13}},"333":{"start":{"line":610,"column":16},"end":{"line":614,"column":18}},"334":{"start":{"line":611,"column":20},"end":{"line":613,"column":39}},"335":{"start":{"line":612,"column":24},"end":{"line":612,"column":89}},"336":{"start":{"line":617,"column":12},"end":{"line":619,"column":13}},"337":{"start":{"line":618,"column":16},"end":{"line":618,"column":63}},"338":{"start":{"line":620,"column":12},"end":{"line":623,"column":15}},"339":{"start":{"line":621,"column":16},"end":{"line":621,"column":45}},"340":{"start":{"line":622,"column":16},"end":{"line":622,"column":69}},"341":{"start":{"line":627,"column":8},"end":{"line":627,"column":54}},"342":{"start":{"line":630,"column":4},"end":{"line":658,"column":6}},"343":{"start":{"line":631,"column":8},"end":{"line":631,"column":43}},"344":{"start":{"line":632,"column":8},"end":{"line":635,"column":9}},"345":{"start":{"line":633,"column":10},"end":{"line":633,"column":91}},"346":{"start":{"line":634,"column":10},"end":{"line":634,"column":31}},"347":{"start":{"line":636,"column":8},"end":{"line":638,"column":9}},"348":{"start":{"line":637,"column":12},"end":{"line":637,"column":30}},"349":{"start":{"line":639,"column":8},"end":{"line":656,"column":9}},"350":{"start":{"line":640,"column":12},"end":{"line":655,"column":14}},"351":{"start":{"line":641,"column":16},"end":{"line":654,"column":17}},"352":{"start":{"line":642,"column":20},"end":{"line":642,"column":52}},"353":{"start":{"line":645,"column":20},"end":{"line":645,"column":56}},"354":{"start":{"line":646,"column":20},"end":{"line":646,"column":47}},"355":{"start":{"line":647,"column":20},"end":{"line":652,"column":21}},"356":{"start":{"line":648,"column":24},"end":{"line":648,"column":54}},"357":{"start":{"line":651,"column":24},"end":{"line":651,"column":44}},"358":{"start":{"line":653,"column":20},"end":{"line":653,"column":60}},"359":{"start":{"line":657,"column":8},"end":{"line":657,"column":46}},"360":{"start":{"line":660,"column":4},"end":{"line":676,"column":5}},"361":{"start":{"line":661,"column":8},"end":{"line":661,"column":36}},"362":{"start":{"line":662,"column":8},"end":{"line":662,"column":52}},"363":{"start":{"line":664,"column":8},"end":{"line":675,"column":11}},"364":{"start":{"line":665,"column":12},"end":{"line":672,"column":15}},"365":{"start":{"line":666,"column":16},"end":{"line":666,"column":52}},"366":{"start":{"line":667,"column":16},"end":{"line":669,"column":17}},"367":{"start":{"line":668,"column":20},"end":{"line":668,"column":35}},"368":{"start":{"line":670,"column":16},"end":{"line":670,"column":36}},"369":{"start":{"line":671,"column":16},"end":{"line":671,"column":30}},"370":{"start":{"line":674,"column":12},"end":{"line":674,"column":35}},"371":{"start":{"line":678,"column":4},"end":{"line":680,"column":6}},"372":{"start":{"line":679,"column":8},"end":{"line":679,"column":49}},"373":{"start":{"line":682,"column":4},"end":{"line":684,"column":6}},"374":{"start":{"line":683,"column":8},"end":{"line":683,"column":56}},"375":{"start":{"line":686,"column":4},"end":{"line":702,"column":6}},"376":{"start":{"line":687,"column":8},"end":{"line":687,"column":36}},"377":{"start":{"line":688,"column":8},"end":{"line":688,"column":52}},"378":{"start":{"line":690,"column":8},"end":{"line":701,"column":11}},"379":{"start":{"line":691,"column":12},"end":{"line":698,"column":15}},"380":{"start":{"line":692,"column":16},"end":{"line":692,"column":52}},"381":{"start":{"line":693,"column":16},"end":{"line":695,"column":17}},"382":{"start":{"line":694,"column":20},"end":{"line":694,"column":35}},"383":{"start":{"line":696,"column":16},"end":{"line":696,"column":36}},"384":{"start":{"line":697,"column":16},"end":{"line":697,"column":30}},"385":{"start":{"line":700,"column":12},"end":{"line":700,"column":35}},"386":{"start":{"line":704,"column":4},"end":{"line":718,"column":6}},"387":{"start":{"line":705,"column":8},"end":{"line":716,"column":9}},"388":{"start":{"line":706,"column":12},"end":{"line":711,"column":13}},"389":{"start":{"line":707,"column":16},"end":{"line":709,"column":17}},"390":{"start":{"line":708,"column":20},"end":{"line":708,"column":56}},"391":{"start":{"line":710,"column":16},"end":{"line":710,"column":33}},"392":{"start":{"line":712,"column":12},"end":{"line":714,"column":14}},"393":{"start":{"line":713,"column":16},"end":{"line":713,"column":82}},"394":{"start":{"line":715,"column":12},"end":{"line":715,"column":22}},"395":{"start":{"line":717,"column":8},"end":{"line":717,"column":31}},"396":{"start":{"line":720,"column":4},"end":{"line":727,"column":6}},"397":{"start":{"line":721,"column":8},"end":{"line":721,"column":44}},"398":{"start":{"line":722,"column":8},"end":{"line":726,"column":10}},"399":{"start":{"line":723,"column":12},"end":{"line":725,"column":14}},"400":{"start":{"line":729,"column":4},"end":{"line":739,"column":5}},"401":{"start":{"line":730,"column":8},"end":{"line":730,"column":24}},"402":{"start":{"line":731,"column":8},"end":{"line":738,"column":11}},"403":{"start":{"line":732,"column":12},"end":{"line":735,"column":15}},"404":{"start":{"line":733,"column":16},"end":{"line":733,"column":48}},"405":{"start":{"line":734,"column":16},"end":{"line":734,"column":24}},"406":{"start":{"line":737,"column":12},"end":{"line":737,"column":34}},"407":{"start":{"line":740,"column":4},"end":{"line":740,"column":39}},"408":{"start":{"line":741,"column":4},"end":{"line":741,"column":43}},"409":{"start":{"line":743,"column":4},"end":{"line":755,"column":6}},"410":{"start":{"line":744,"column":8},"end":{"line":754,"column":9}},"411":{"start":{"line":745,"column":12},"end":{"line":750,"column":15}},"412":{"start":{"line":746,"column":16},"end":{"line":748,"column":17}},"413":{"start":{"line":747,"column":20},"end":{"line":747,"column":41}},"414":{"start":{"line":749,"column":16},"end":{"line":749,"column":55}},"415":{"start":{"line":753,"column":12},"end":{"line":753,"column":27}},"416":{"start":{"line":757,"column":4},"end":{"line":770,"column":6}},"417":{"start":{"line":758,"column":8},"end":{"line":769,"column":11}},"418":{"start":{"line":759,"column":12},"end":{"line":761,"column":13}},"419":{"start":{"line":760,"column":16},"end":{"line":760,"column":37}},"420":{"start":{"line":762,"column":12},"end":{"line":762,"column":48}},"421":{"start":{"line":763,"column":12},"end":{"line":768,"column":13}},"422":{"start":{"line":764,"column":16},"end":{"line":764,"column":57}},"423":{"start":{"line":767,"column":16},"end":{"line":767,"column":31}},"424":{"start":{"line":772,"column":4},"end":{"line":784,"column":6}},"425":{"start":{"line":773,"column":8},"end":{"line":783,"column":9}},"426":{"start":{"line":774,"column":12},"end":{"line":779,"column":15}},"427":{"start":{"line":775,"column":16},"end":{"line":777,"column":17}},"428":{"start":{"line":776,"column":20},"end":{"line":776,"column":41}},"429":{"start":{"line":778,"column":16},"end":{"line":778,"column":54}},"430":{"start":{"line":782,"column":12},"end":{"line":782,"column":27}},"431":{"start":{"line":786,"column":4},"end":{"line":799,"column":6}},"432":{"start":{"line":787,"column":8},"end":{"line":798,"column":11}},"433":{"start":{"line":788,"column":12},"end":{"line":790,"column":13}},"434":{"start":{"line":789,"column":16},"end":{"line":789,"column":37}},"435":{"start":{"line":791,"column":12},"end":{"line":791,"column":48}},"436":{"start":{"line":792,"column":12},"end":{"line":797,"column":13}},"437":{"start":{"line":793,"column":16},"end":{"line":793,"column":56}},"438":{"start":{"line":796,"column":16},"end":{"line":796,"column":31}},"439":{"start":{"line":801,"column":4},"end":{"line":914,"column":5}},"440":{"start":{"line":802,"column":8},"end":{"line":807,"column":9}},"441":{"start":{"line":803,"column":12},"end":{"line":803,"column":28}},"442":{"start":{"line":805,"column":13},"end":{"line":807,"column":9}},"443":{"start":{"line":806,"column":12},"end":{"line":806,"column":60}},"444":{"start":{"line":808,"column":8},"end":{"line":839,"column":9}},"445":{"start":{"line":809,"column":12},"end":{"line":811,"column":13}},"446":{"start":{"line":810,"column":16},"end":{"line":810,"column":68}},"447":{"start":{"line":812,"column":12},"end":{"line":812,"column":29}},"448":{"start":{"line":813,"column":12},"end":{"line":815,"column":13}},"449":{"start":{"line":814,"column":16},"end":{"line":814,"column":30}},"450":{"start":{"line":816,"column":12},"end":{"line":821,"column":13}},"451":{"start":{"line":818,"column":16},"end":{"line":820,"column":19}},"452":{"start":{"line":819,"column":19},"end":{"line":819,"column":29}},"453":{"start":{"line":822,"column":12},"end":{"line":838,"column":15}},"454":{"start":{"line":823,"column":16},"end":{"line":826,"column":18}},"455":{"start":{"line":828,"column":16},"end":{"line":832,"column":17}},"456":{"start":{"line":829,"column":18},"end":{"line":829,"column":40}},"457":{"start":{"line":831,"column":18},"end":{"line":831,"column":37}},"458":{"start":{"line":834,"column":16},"end":{"line":836,"column":17}},"459":{"start":{"line":835,"column":20},"end":{"line":835,"column":34}},"460":{"start":{"line":837,"column":16},"end":{"line":837,"column":46}},"461":{"start":{"line":841,"column":8},"end":{"line":841,"column":24}},"462":{"start":{"line":842,"column":8},"end":{"line":912,"column":10}},"463":{"start":{"line":851,"column":16},"end":{"line":851,"column":50}},"464":{"start":{"line":854,"column":16},"end":{"line":854,"column":31}},"465":{"start":{"line":855,"column":16},"end":{"line":855,"column":29}},"466":{"start":{"line":858,"column":16},"end":{"line":858,"column":49}},"467":{"start":{"line":861,"column":16},"end":{"line":876,"column":17}},"468":{"start":{"line":862,"column":20},"end":{"line":864,"column":58}},"469":{"start":{"line":866,"column":20},"end":{"line":868,"column":23}},"470":{"start":{"line":867,"column":24},"end":{"line":867,"column":41}},"471":{"start":{"line":870,"column":20},"end":{"line":872,"column":21}},"472":{"start":{"line":871,"column":24},"end":{"line":871,"column":34}},"473":{"start":{"line":873,"column":20},"end":{"line":873,"column":33}},"474":{"start":{"line":874,"column":20},"end":{"line":874,"column":45}},"475":{"start":{"line":875,"column":20},"end":{"line":875,"column":37}},"476":{"start":{"line":878,"column":16},"end":{"line":888,"column":17}},"477":{"start":{"line":879,"column":20},"end":{"line":879,"column":33}},"478":{"start":{"line":880,"column":20},"end":{"line":880,"column":41}},"479":{"start":{"line":881,"column":20},"end":{"line":883,"column":23}},"480":{"start":{"line":882,"column":24},"end":{"line":882,"column":56}},"481":{"start":{"line":884,"column":20},"end":{"line":886,"column":21}},"482":{"start":{"line":885,"column":24},"end":{"line":885,"column":34}},"483":{"start":{"line":887,"column":20},"end":{"line":887,"column":32}},"484":{"start":{"line":891,"column":16},"end":{"line":891,"column":38}},"485":{"start":{"line":894,"column":16},"end":{"line":894,"column":31}},"486":{"start":{"line":897,"column":16},"end":{"line":897,"column":54}},"487":{"start":{"line":900,"column":16},"end":{"line":900,"column":32}},"488":{"start":{"line":903,"column":16},"end":{"line":903,"column":51}},"489":{"start":{"line":903,"column":42},"end":{"line":903,"column":49}},"490":{"start":{"line":904,"column":16},"end":{"line":904,"column":33}},"491":{"start":{"line":905,"column":16},"end":{"line":905,"column":74}},"492":{"start":{"line":908,"column":16},"end":{"line":910,"column":17}},"493":{"start":{"line":909,"column":20},"end":{"line":909,"column":50}},"494":{"start":{"line":913,"column":8},"end":{"line":913,"column":17}},"495":{"start":{"line":916,"column":4},"end":{"line":922,"column":6}},"496":{"start":{"line":917,"column":8},"end":{"line":919,"column":27}},"497":{"start":{"line":918,"column":12},"end":{"line":918,"column":33}},"498":{"start":{"line":921,"column":8},"end":{"line":921,"column":17}},"499":{"start":{"line":924,"column":4},"end":{"line":986,"column":6}},"500":{"start":{"line":926,"column":8},"end":{"line":928,"column":9}},"501":{"start":{"line":927,"column":12},"end":{"line":927,"column":43}},"502":{"start":{"line":930,"column":8},"end":{"line":942,"column":9}},"503":{"start":{"line":931,"column":10},"end":{"line":932,"column":40}},"504":{"start":{"line":933,"column":10},"end":{"line":940,"column":11}},"505":{"start":{"line":934,"column":14},"end":{"line":934,"column":54}},"506":{"start":{"line":935,"column":14},"end":{"line":939,"column":15}},"507":{"start":{"line":936,"column":18},"end":{"line":936,"column":28}},"508":{"start":{"line":938,"column":18},"end":{"line":938,"column":32}},"509":{"start":{"line":941,"column":10},"end":{"line":941,"column":21}},"510":{"start":{"line":944,"column":8},"end":{"line":972,"column":9}},"511":{"start":{"line":945,"column":12},"end":{"line":947,"column":13}},"512":{"start":{"line":946,"column":16},"end":{"line":946,"column":68}},"513":{"start":{"line":948,"column":12},"end":{"line":948,"column":29}},"514":{"start":{"line":949,"column":12},"end":{"line":951,"column":13}},"515":{"start":{"line":950,"column":16},"end":{"line":950,"column":30}},"516":{"start":{"line":952,"column":12},"end":{"line":957,"column":13}},"517":{"start":{"line":954,"column":16},"end":{"line":956,"column":19}},"518":{"start":{"line":955,"column":20},"end":{"line":955,"column":30}},"519":{"start":{"line":958,"column":12},"end":{"line":971,"column":15}},"520":{"start":{"line":959,"column":16},"end":{"line":963,"column":18}},"521":{"start":{"line":965,"column":16},"end":{"line":965,"column":89}},"522":{"start":{"line":967,"column":16},"end":{"line":969,"column":17}},"523":{"start":{"line":968,"column":20},"end":{"line":968,"column":34}},"524":{"start":{"line":970,"column":16},"end":{"line":970,"column":46}},"525":{"start":{"line":975,"column":8},"end":{"line":975,"column":49}},"526":{"start":{"line":978,"column":8},"end":{"line":980,"column":10}},"527":{"start":{"line":979,"column":12},"end":{"line":979,"column":49}},"528":{"start":{"line":983,"column":8},"end":{"line":983,"column":25}},"529":{"start":{"line":985,"column":8},"end":{"line":985,"column":17}},"530":{"start":{"line":988,"column":4},"end":{"line":990,"column":6}},"531":{"start":{"line":989,"column":8},"end":{"line":989,"column":42}},"532":{"start":{"line":992,"column":4},"end":{"line":1011,"column":5}},"533":{"start":{"line":993,"column":8},"end":{"line":1010,"column":10}},"534":{"start":{"line":994,"column":12},"end":{"line":994,"column":48}},"535":{"start":{"line":995,"column":12},"end":{"line":1009,"column":17}},"536":{"start":{"line":996,"column":16},"end":{"line":996,"column":52}},"537":{"start":{"line":997,"column":16},"end":{"line":1008,"column":17}},"538":{"start":{"line":998,"column":20},"end":{"line":1007,"column":21}},"539":{"start":{"line":999,"column":24},"end":{"line":1001,"column":25}},"540":{"start":{"line":1000,"column":28},"end":{"line":1000,"column":47}},"541":{"start":{"line":1003,"column":25},"end":{"line":1007,"column":21}},"542":{"start":{"line":1004,"column":24},"end":{"line":1006,"column":27}},"543":{"start":{"line":1005,"column":28},"end":{"line":1005,"column":45}},"544":{"start":{"line":1012,"column":4},"end":{"line":1012,"column":35}},"545":{"start":{"line":1013,"column":4},"end":{"line":1013,"column":35}},"546":{"start":{"line":1018,"column":4},"end":{"line":1051,"column":6}},"547":{"start":{"line":1019,"column":8},"end":{"line":1019,"column":22}},"548":{"start":{"line":1020,"column":8},"end":{"line":1020,"column":24}},"549":{"start":{"line":1021,"column":8},"end":{"line":1023,"column":10}},"550":{"start":{"line":1022,"column":12},"end":{"line":1022,"column":21}},"551":{"start":{"line":1024,"column":8},"end":{"line":1047,"column":9}},"552":{"start":{"line":1025,"column":12},"end":{"line":1025,"column":45}},"553":{"start":{"line":1026,"column":12},"end":{"line":1026,"column":38}},"554":{"start":{"line":1027,"column":12},"end":{"line":1027,"column":47}},"555":{"start":{"line":1028,"column":12},"end":{"line":1046,"column":13}},"556":{"start":{"line":1029,"column":16},"end":{"line":1031,"column":19}},"557":{"start":{"line":1030,"column":20},"end":{"line":1030,"column":52}},"558":{"start":{"line":1033,"column":17},"end":{"line":1046,"column":13}},"559":{"start":{"line":1034,"column":16},"end":{"line":1034,"column":43}},"560":{"start":{"line":1037,"column":16},"end":{"line":1037,"column":41}},"561":{"start":{"line":1038,"column":16},"end":{"line":1045,"column":21}},"562":{"start":{"line":1039,"column":20},"end":{"line":1039,"column":54}},"563":{"start":{"line":1040,"column":20},"end":{"line":1040,"column":40}},"564":{"start":{"line":1041,"column":20},"end":{"line":1041,"column":39}},"565":{"start":{"line":1042,"column":20},"end":{"line":1044,"column":21}},"566":{"start":{"line":1043,"column":22},"end":{"line":1043,"column":50}},"567":{"start":{"line":1048,"column":8},"end":{"line":1048,"column":29}},"568":{"start":{"line":1049,"column":8},"end":{"line":1049,"column":33}},"569":{"start":{"line":1050,"column":8},"end":{"line":1050,"column":24}},"570":{"start":{"line":1053,"column":4},"end":{"line":1057,"column":6}},"571":{"start":{"line":1054,"column":6},"end":{"line":1056,"column":8}},"572":{"start":{"line":1055,"column":8},"end":{"line":1055,"column":60}},"573":{"start":{"line":1059,"column":4},"end":{"line":1065,"column":6}},"574":{"start":{"line":1060,"column":8},"end":{"line":1060,"column":25}},"575":{"start":{"line":1061,"column":8},"end":{"line":1063,"column":9}},"576":{"start":{"line":1062,"column":12},"end":{"line":1062,"column":28}},"577":{"start":{"line":1064,"column":8},"end":{"line":1064,"column":54}},"578":{"start":{"line":1067,"column":4},"end":{"line":1073,"column":6}},"579":{"start":{"line":1068,"column":8},"end":{"line":1068,"column":25}},"580":{"start":{"line":1069,"column":8},"end":{"line":1071,"column":9}},"581":{"start":{"line":1070,"column":12},"end":{"line":1070,"column":28}},"582":{"start":{"line":1072,"column":8},"end":{"line":1072,"column":60}},"583":{"start":{"line":1075,"column":4},"end":{"line":1099,"column":6}},"584":{"start":{"line":1076,"column":8},"end":{"line":1076,"column":28}},"585":{"start":{"line":1077,"column":8},"end":{"line":1098,"column":10}},"586":{"start":{"line":1078,"column":12},"end":{"line":1078,"column":28}},"587":{"start":{"line":1079,"column":12},"end":{"line":1079,"column":45}},"588":{"start":{"line":1081,"column":12},"end":{"line":1081,"column":45}},"589":{"start":{"line":1082,"column":12},"end":{"line":1086,"column":13}},"590":{"start":{"line":1083,"column":16},"end":{"line":1083,"column":27}},"591":{"start":{"line":1085,"column":16},"end":{"line":1085,"column":32}},"592":{"start":{"line":1088,"column":12},"end":{"line":1097,"column":15}},"593":{"start":{"line":1089,"column":16},"end":{"line":1093,"column":21}},"594":{"start":{"line":1090,"column":20},"end":{"line":1090,"column":43}},"595":{"start":{"line":1091,"column":20},"end":{"line":1091,"column":60}},"596":{"start":{"line":1092,"column":20},"end":{"line":1092,"column":38}},"597":{"start":{"line":1096,"column":16},"end":{"line":1096,"column":60}},"598":{"start":{"line":1101,"column":4},"end":{"line":1103,"column":6}},"599":{"start":{"line":1102,"column":6},"end":{"line":1102,"column":76}},"600":{"start":{"line":1106,"column":4},"end":{"line":1123,"column":5}},"601":{"start":{"line":1107,"column":8},"end":{"line":1115,"column":9}},"602":{"start":{"line":1108,"column":12},"end":{"line":1108,"column":28}},"603":{"start":{"line":1109,"column":12},"end":{"line":1109,"column":45}},"604":{"start":{"line":1110,"column":12},"end":{"line":1110,"column":38}},"605":{"start":{"line":1111,"column":12},"end":{"line":1114,"column":22}},"606":{"start":{"line":1112,"column":16},"end":{"line":1112,"column":50}},"607":{"start":{"line":1116,"column":8},"end":{"line":1122,"column":9}},"608":{"start":{"line":1117,"column":12},"end":{"line":1117,"column":48}},"609":{"start":{"line":1118,"column":12},"end":{"line":1118,"column":40}},"610":{"start":{"line":1121,"column":12},"end":{"line":1121,"column":22}},"611":{"start":{"line":1125,"column":4},"end":{"line":1128,"column":6}},"612":{"start":{"line":1126,"column":8},"end":{"line":1126,"column":41}},"613":{"start":{"line":1127,"column":8},"end":{"line":1127,"column":67}},"614":{"start":{"line":1129,"column":4},"end":{"line":1132,"column":6}},"615":{"start":{"line":1130,"column":8},"end":{"line":1130,"column":41}},"616":{"start":{"line":1131,"column":8},"end":{"line":1131,"column":73}},"617":{"start":{"line":1135,"column":4},"end":{"line":1145,"column":6}},"618":{"start":{"line":1136,"column":8},"end":{"line":1136,"column":47}},"619":{"start":{"line":1137,"column":8},"end":{"line":1137,"column":35}},"620":{"start":{"line":1138,"column":8},"end":{"line":1143,"column":9}},"621":{"start":{"line":1139,"column":12},"end":{"line":1141,"column":13}},"622":{"start":{"line":1140,"column":16},"end":{"line":1140,"column":33}},"623":{"start":{"line":1142,"column":12},"end":{"line":1142,"column":23}},"624":{"start":{"line":1144,"column":8},"end":{"line":1144,"column":15}},"625":{"start":{"line":1147,"column":4},"end":{"line":1165,"column":5}},"626":{"start":{"line":1148,"column":8},"end":{"line":1164,"column":10}},"627":{"start":{"line":1149,"column":12},"end":{"line":1149,"column":45}},"628":{"start":{"line":1150,"column":12},"end":{"line":1150,"column":38}},"629":{"start":{"line":1151,"column":12},"end":{"line":1160,"column":15}},"630":{"start":{"line":1152,"column":16},"end":{"line":1152,"column":42}},"631":{"start":{"line":1153,"column":16},"end":{"line":1159,"column":17}},"632":{"start":{"line":1154,"column":20},"end":{"line":1156,"column":23}},"633":{"start":{"line":1155,"column":24},"end":{"line":1155,"column":56}},"634":{"start":{"line":1158,"column":20},"end":{"line":1158,"column":52}},"635":{"start":{"line":1161,"column":12},"end":{"line":1161,"column":28}},"636":{"start":{"line":1162,"column":12},"end":{"line":1162,"column":33}},"637":{"start":{"line":1163,"column":12},"end":{"line":1163,"column":25}},"638":{"start":{"line":1167,"column":4},"end":{"line":1167,"column":36}},"639":{"start":{"line":1170,"column":4},"end":{"line":1182,"column":5}},"640":{"start":{"line":1171,"column":8},"end":{"line":1171,"column":31}},"641":{"start":{"line":1174,"column":9},"end":{"line":1182,"column":5}},"642":{"start":{"line":1175,"column":8},"end":{"line":1177,"column":11}},"643":{"start":{"line":1176,"column":12},"end":{"line":1176,"column":25}},"644":{"start":{"line":1181,"column":8},"end":{"line":1181,"column":27}}},"branchMap":{"1":{"line":16,"type":"if","locations":[{"start":{"line":16,"column":4},"end":{"line":16,"column":4}},{"start":{"line":16,"column":4},"end":{"line":16,"column":4}}]},"2":{"line":16,"type":"binary-expr","locations":[{"start":{"line":16,"column":8},"end":{"line":16,"column":33}},{"start":{"line":16,"column":37},"end":{"line":16,"column":52}}]},"3":{"line":19,"type":"if","locations":[{"start":{"line":19,"column":9},"end":{"line":19,"column":9}},{"start":{"line":19,"column":9},"end":{"line":19,"column":9}}]},"4":{"line":19,"type":"binary-expr","locations":[{"start":{"line":19,"column":13},"end":{"line":19,"column":38}},{"start":{"line":19,"column":42},"end":{"line":19,"column":57}}]},"5":{"line":26,"type":"if","locations":[{"start":{"line":26,"column":4},"end":{"line":26,"column":4}},{"start":{"line":26,"column":4},"end":{"line":26,"column":4}}]},"6":{"line":38,"type":"if","locations":[{"start":{"line":38,"column":12},"end":{"line":38,"column":12}},{"start":{"line":38,"column":12},"end":{"line":38,"column":12}}]},"7":{"line":47,"type":"if","locations":[{"start":{"line":47,"column":12},"end":{"line":47,"column":12}},{"start":{"line":47,"column":12},"end":{"line":47,"column":12}}]},"8":{"line":57,"type":"binary-expr","locations":[{"start":{"line":57,"column":19},"end":{"line":57,"column":32}},{"start":{"line":57,"column":36},"end":{"line":59,"column":5}}]},"9":{"line":62,"type":"binary-expr","locations":[{"start":{"line":62,"column":15},"end":{"line":62,"column":28}},{"start":{"line":64,"column":12},"end":{"line":64,"column":42}},{"start":{"line":65,"column":12},"end":{"line":65,"column":27}},{"start":{"line":66,"column":12},"end":{"line":66,"column":32}}]},"10":{"line":71,"type":"cond-expr","locations":[{"start":{"line":72,"column":12},"end":{"line":72,"column":38}},{"start":{"line":73,"column":12},"end":{"line":73,"column":38}}]},"11":{"line":109,"type":"binary-expr","locations":[{"start":{"line":109,"column":16},"end":{"line":109,"column":27}},{"start":{"line":109,"column":31},"end":{"line":117,"column":5}}]},"12":{"line":112,"type":"if","locations":[{"start":{"line":112,"column":12},"end":{"line":112,"column":12}},{"start":{"line":112,"column":12},"end":{"line":112,"column":12}}]},"13":{"line":123,"type":"if","locations":[{"start":{"line":123,"column":8},"end":{"line":123,"column":8}},{"start":{"line":123,"column":8},"end":{"line":123,"column":8}}]},"14":{"line":127,"type":"cond-expr","locations":[{"start":{"line":127,"column":33},"end":{"line":127,"column":34}},{"start":{"line":127,"column":37},"end":{"line":127,"column":41}}]},"15":{"line":134,"type":"cond-expr","locations":[{"start":{"line":134,"column":33},"end":{"line":134,"column":40}},{"start":{"line":134,"column":43},"end":{"line":134,"column":47}}]},"16":{"line":140,"type":"binary-expr","locations":[{"start":{"line":140,"column":16},"end":{"line":140,"column":21}},{"start":{"line":140,"column":25},"end":{"line":140,"column":26}}]},"17":{"line":144,"type":"if","locations":[{"start":{"line":144,"column":8},"end":{"line":144,"column":8}},{"start":{"line":144,"column":8},"end":{"line":144,"column":8}}]},"18":{"line":146,"type":"cond-expr","locations":[{"start":{"line":146,"column":32},"end":{"line":146,"column":33}},{"start":{"line":146,"column":36},"end":{"line":146,"column":42}}]},"19":{"line":168,"type":"if","locations":[{"start":{"line":168,"column":4},"end":{"line":168,"column":4}},{"start":{"line":168,"column":4},"end":{"line":168,"column":4}}]},"20":{"line":172,"type":"if","locations":[{"start":{"line":172,"column":4},"end":{"line":172,"column":4}},{"start":{"line":172,"column":4},"end":{"line":172,"column":4}}]},"21":{"line":172,"type":"binary-expr","locations":[{"start":{"line":172,"column":8},"end":{"line":172,"column":38}},{"start":{"line":172,"column":42},"end":{"line":172,"column":61}}]},"22":{"line":173,"type":"if","locations":[{"start":{"line":173,"column":8},"end":{"line":173,"column":8}},{"start":{"line":173,"column":8},"end":{"line":173,"column":8}}]},"23":{"line":189,"type":"if","locations":[{"start":{"line":189,"column":8},"end":{"line":189,"column":8}},{"start":{"line":189,"column":8},"end":{"line":189,"column":8}}]},"24":{"line":218,"type":"binary-expr","locations":[{"start":{"line":218,"column":25},"end":{"line":218,"column":33}},{"start":{"line":218,"column":37},"end":{"line":218,"column":41}}]},"25":{"line":219,"type":"binary-expr","locations":[{"start":{"line":219,"column":17},"end":{"line":219,"column":23}},{"start":{"line":219,"column":27},"end":{"line":219,"column":29}}]},"26":{"line":220,"type":"binary-expr","locations":[{"start":{"line":220,"column":19},"end":{"line":220,"column":32}},{"start":{"line":220,"column":36},"end":{"line":220,"column":56}}]},"27":{"line":222,"type":"if","locations":[{"start":{"line":222,"column":8},"end":{"line":222,"column":8}},{"start":{"line":222,"column":8},"end":{"line":222,"column":8}}]},"28":{"line":229,"type":"if","locations":[{"start":{"line":229,"column":10},"end":{"line":229,"column":10}},{"start":{"line":229,"column":10},"end":{"line":229,"column":10}}]},"29":{"line":234,"type":"if","locations":[{"start":{"line":234,"column":14},"end":{"line":234,"column":14}},{"start":{"line":234,"column":14},"end":{"line":234,"column":14}}]},"30":{"line":243,"type":"binary-expr","locations":[{"start":{"line":243,"column":25},"end":{"line":243,"column":33}},{"start":{"line":243,"column":37},"end":{"line":243,"column":41}}]},"31":{"line":244,"type":"binary-expr","locations":[{"start":{"line":244,"column":14},"end":{"line":244,"column":17}},{"start":{"line":244,"column":21},"end":{"line":244,"column":23}}]},"32":{"line":249,"type":"if","locations":[{"start":{"line":249,"column":12},"end":{"line":249,"column":12}},{"start":{"line":249,"column":12},"end":{"line":249,"column":12}}]},"33":{"line":253,"type":"if","locations":[{"start":{"line":253,"column":16},"end":{"line":253,"column":16}},{"start":{"line":253,"column":16},"end":{"line":253,"column":16}}]},"34":{"line":257,"type":"if","locations":[{"start":{"line":257,"column":20},"end":{"line":257,"column":20}},{"start":{"line":257,"column":20},"end":{"line":257,"column":20}}]},"35":{"line":280,"type":"binary-expr","locations":[{"start":{"line":280,"column":29},"end":{"line":280,"column":37}},{"start":{"line":280,"column":41},"end":{"line":280,"column":45}}]},"36":{"line":281,"type":"binary-expr","locations":[{"start":{"line":281,"column":18},"end":{"line":281,"column":21}},{"start":{"line":281,"column":25},"end":{"line":281,"column":27}}]},"37":{"line":283,"type":"if","locations":[{"start":{"line":283,"column":12},"end":{"line":283,"column":12}},{"start":{"line":283,"column":12},"end":{"line":283,"column":12}}]},"38":{"line":291,"type":"if","locations":[{"start":{"line":291,"column":16},"end":{"line":291,"column":16}},{"start":{"line":291,"column":16},"end":{"line":291,"column":16}}]},"39":{"line":291,"type":"binary-expr","locations":[{"start":{"line":291,"column":20},"end":{"line":291,"column":24}},{"start":{"line":291,"column":28},"end":{"line":291,"column":40}}]},"40":{"line":295,"type":"binary-expr","locations":[{"start":{"line":295,"column":23},"end":{"line":295,"column":38}},{"start":{"line":295,"column":42},"end":{"line":295,"column":50}}]},"41":{"line":297,"type":"if","locations":[{"start":{"line":297,"column":20},"end":{"line":297,"column":20}},{"start":{"line":297,"column":20},"end":{"line":297,"column":20}}]},"42":{"line":299,"type":"if","locations":[{"start":{"line":299,"column":24},"end":{"line":299,"column":24}},{"start":{"line":299,"column":24},"end":{"line":299,"column":24}}]},"43":{"line":307,"type":"if","locations":[{"start":{"line":307,"column":24},"end":{"line":307,"column":24}},{"start":{"line":307,"column":24},"end":{"line":307,"column":24}}]},"44":{"line":338,"type":"binary-expr","locations":[{"start":{"line":338,"column":25},"end":{"line":338,"column":33}},{"start":{"line":338,"column":37},"end":{"line":338,"column":41}}]},"45":{"line":371,"type":"binary-expr","locations":[{"start":{"line":371,"column":21},"end":{"line":371,"column":24}},{"start":{"line":371,"column":28},"end":{"line":371,"column":32}}]},"46":{"line":390,"type":"if","locations":[{"start":{"line":390,"column":16},"end":{"line":390,"column":16}},{"start":{"line":390,"column":16},"end":{"line":390,"column":16}}]},"47":{"line":417,"type":"if","locations":[{"start":{"line":417,"column":16},"end":{"line":417,"column":16}},{"start":{"line":417,"column":16},"end":{"line":417,"column":16}}]},"48":{"line":436,"type":"if","locations":[{"start":{"line":436,"column":16},"end":{"line":436,"column":16}},{"start":{"line":436,"column":16},"end":{"line":436,"column":16}}]},"49":{"line":455,"type":"if","locations":[{"start":{"line":455,"column":16},"end":{"line":455,"column":16}},{"start":{"line":455,"column":16},"end":{"line":455,"column":16}}]},"50":{"line":470,"type":"if","locations":[{"start":{"line":470,"column":16},"end":{"line":470,"column":16}},{"start":{"line":470,"column":16},"end":{"line":470,"column":16}}]},"51":{"line":484,"type":"if","locations":[{"start":{"line":484,"column":16},"end":{"line":484,"column":16}},{"start":{"line":484,"column":16},"end":{"line":484,"column":16}}]},"52":{"line":492,"type":"if","locations":[{"start":{"line":492,"column":12},"end":{"line":492,"column":12}},{"start":{"line":492,"column":12},"end":{"line":492,"column":12}}]},"53":{"line":505,"type":"cond-expr","locations":[{"start":{"line":505,"column":27},"end":{"line":505,"column":29}},{"start":{"line":505,"column":32},"end":{"line":505,"column":45}}]},"54":{"line":505,"type":"cond-expr","locations":[{"start":{"line":505,"column":40},"end":{"line":505,"column":41}},{"start":{"line":505,"column":44},"end":{"line":505,"column":45}}]},"55":{"line":510,"type":"binary-expr","locations":[{"start":{"line":510,"column":25},"end":{"line":510,"column":33}},{"start":{"line":510,"column":37},"end":{"line":510,"column":41}}]},"56":{"line":513,"type":"if","locations":[{"start":{"line":513,"column":8},"end":{"line":513,"column":8}},{"start":{"line":513,"column":8},"end":{"line":513,"column":8}}]},"57":{"line":525,"type":"if","locations":[{"start":{"line":525,"column":16},"end":{"line":525,"column":16}},{"start":{"line":525,"column":16},"end":{"line":525,"column":16}}]},"58":{"line":539,"type":"if","locations":[{"start":{"line":539,"column":12},"end":{"line":539,"column":12}},{"start":{"line":539,"column":12},"end":{"line":539,"column":12}}]},"59":{"line":545,"type":"cond-expr","locations":[{"start":{"line":545,"column":44},"end":{"line":545,"column":52}},{"start":{"line":545,"column":54},"end":{"line":545,"column":64}}]},"60":{"line":548,"type":"if","locations":[{"start":{"line":548,"column":16},"end":{"line":548,"column":16}},{"start":{"line":548,"column":16},"end":{"line":548,"column":16}}]},"61":{"line":551,"type":"if","locations":[{"start":{"line":551,"column":16},"end":{"line":551,"column":16}},{"start":{"line":551,"column":16},"end":{"line":551,"column":16}}]},"62":{"line":564,"type":"binary-expr","locations":[{"start":{"line":564,"column":27},"end":{"line":564,"column":67}},{"start":{"line":564,"column":71},"end":{"line":564,"column":73}}]},"63":{"line":569,"type":"if","locations":[{"start":{"line":569,"column":16},"end":{"line":569,"column":16}},{"start":{"line":569,"column":16},"end":{"line":569,"column":16}}]},"64":{"line":572,"type":"if","locations":[{"start":{"line":572,"column":16},"end":{"line":572,"column":16}},{"start":{"line":572,"column":16},"end":{"line":572,"column":16}}]},"65":{"line":572,"type":"binary-expr","locations":[{"start":{"line":572,"column":20},"end":{"line":572,"column":33}},{"start":{"line":572,"column":37},"end":{"line":572,"column":54}}]},"66":{"line":577,"type":"binary-expr","locations":[{"start":{"line":577,"column":23},"end":{"line":579,"column":24}},{"start":{"line":579,"column":28},"end":{"line":579,"column":54}}]},"67":{"line":578,"type":"binary-expr","locations":[{"start":{"line":578,"column":28},"end":{"line":578,"column":29}},{"start":{"line":578,"column":33},"end":{"line":578,"column":58}}]},"68":{"line":581,"type":"if","locations":[{"start":{"line":581,"column":12},"end":{"line":581,"column":12}},{"start":{"line":581,"column":12},"end":{"line":581,"column":12}}]},"69":{"line":588,"type":"if","locations":[{"start":{"line":588,"column":16},"end":{"line":588,"column":16}},{"start":{"line":588,"column":16},"end":{"line":588,"column":16}}]},"70":{"line":600,"type":"if","locations":[{"start":{"line":600,"column":8},"end":{"line":600,"column":8}},{"start":{"line":600,"column":8},"end":{"line":600,"column":8}}]},"71":{"line":606,"type":"binary-expr","locations":[{"start":{"line":606,"column":16},"end":{"line":606,"column":35}},{"start":{"line":606,"column":39},"end":{"line":606,"column":52}}]},"72":{"line":612,"type":"binary-expr","locations":[{"start":{"line":612,"column":39},"end":{"line":612,"column":43}},{"start":{"line":612,"column":47},"end":{"line":612,"column":59}}]},"73":{"line":622,"type":"binary-expr","locations":[{"start":{"line":622,"column":17},"end":{"line":622,"column":32}},{"start":{"line":622,"column":36},"end":{"line":622,"column":44}}]},"74":{"line":627,"type":"cond-expr","locations":[{"start":{"line":627,"column":26},"end":{"line":627,"column":39}},{"start":{"line":627,"column":42},"end":{"line":627,"column":53}}]},"75":{"line":631,"type":"binary-expr","locations":[{"start":{"line":631,"column":25},"end":{"line":631,"column":33}},{"start":{"line":631,"column":37},"end":{"line":631,"column":41}}]},"76":{"line":632,"type":"if","locations":[{"start":{"line":632,"column":8},"end":{"line":632,"column":8}},{"start":{"line":632,"column":8},"end":{"line":632,"column":8}}]},"77":{"line":636,"type":"if","locations":[{"start":{"line":636,"column":8},"end":{"line":636,"column":8}},{"start":{"line":636,"column":8},"end":{"line":636,"column":8}}]},"78":{"line":641,"type":"if","locations":[{"start":{"line":641,"column":16},"end":{"line":641,"column":16}},{"start":{"line":641,"column":16},"end":{"line":641,"column":16}}]},"79":{"line":647,"type":"if","locations":[{"start":{"line":647,"column":20},"end":{"line":647,"column":20}},{"start":{"line":647,"column":20},"end":{"line":647,"column":20}}]},"80":{"line":661,"type":"binary-expr","locations":[{"start":{"line":661,"column":19},"end":{"line":661,"column":27}},{"start":{"line":661,"column":31},"end":{"line":661,"column":35}}]},"81":{"line":662,"type":"cond-expr","locations":[{"start":{"line":662,"column":44},"end":{"line":662,"column":46}},{"start":{"line":662,"column":49},"end":{"line":662,"column":51}}]},"82":{"line":667,"type":"if","locations":[{"start":{"line":667,"column":16},"end":{"line":667,"column":16}},{"start":{"line":667,"column":16},"end":{"line":667,"column":16}}]},"83":{"line":687,"type":"binary-expr","locations":[{"start":{"line":687,"column":19},"end":{"line":687,"column":27}},{"start":{"line":687,"column":31},"end":{"line":687,"column":35}}]},"84":{"line":688,"type":"cond-expr","locations":[{"start":{"line":688,"column":44},"end":{"line":688,"column":46}},{"start":{"line":688,"column":49},"end":{"line":688,"column":51}}]},"85":{"line":693,"type":"if","locations":[{"start":{"line":693,"column":16},"end":{"line":693,"column":16}},{"start":{"line":693,"column":16},"end":{"line":693,"column":16}}]},"86":{"line":707,"type":"if","locations":[{"start":{"line":707,"column":16},"end":{"line":707,"column":16}},{"start":{"line":707,"column":16},"end":{"line":707,"column":16}}]},"87":{"line":713,"type":"cond-expr","locations":[{"start":{"line":713,"column":52},"end":{"line":713,"column":75}},{"start":{"line":713,"column":77},"end":{"line":713,"column":81}}]},"88":{"line":733,"type":"binary-expr","locations":[{"start":{"line":733,"column":39},"end":{"line":733,"column":40}},{"start":{"line":733,"column":44},"end":{"line":733,"column":46}}]},"89":{"line":744,"type":"if","locations":[{"start":{"line":744,"column":8},"end":{"line":744,"column":8}},{"start":{"line":744,"column":8},"end":{"line":744,"column":8}}]},"90":{"line":746,"type":"if","locations":[{"start":{"line":746,"column":16},"end":{"line":746,"column":16}},{"start":{"line":746,"column":16},"end":{"line":746,"column":16}}]},"91":{"line":759,"type":"if","locations":[{"start":{"line":759,"column":12},"end":{"line":759,"column":12}},{"start":{"line":759,"column":12},"end":{"line":759,"column":12}}]},"92":{"line":763,"type":"if","locations":[{"start":{"line":763,"column":12},"end":{"line":763,"column":12}},{"start":{"line":763,"column":12},"end":{"line":763,"column":12}}]},"93":{"line":773,"type":"if","locations":[{"start":{"line":773,"column":8},"end":{"line":773,"column":8}},{"start":{"line":773,"column":8},"end":{"line":773,"column":8}}]},"94":{"line":775,"type":"if","locations":[{"start":{"line":775,"column":16},"end":{"line":775,"column":16}},{"start":{"line":775,"column":16},"end":{"line":775,"column":16}}]},"95":{"line":788,"type":"if","locations":[{"start":{"line":788,"column":12},"end":{"line":788,"column":12}},{"start":{"line":788,"column":12},"end":{"line":788,"column":12}}]},"96":{"line":792,"type":"if","locations":[{"start":{"line":792,"column":12},"end":{"line":792,"column":12}},{"start":{"line":792,"column":12},"end":{"line":792,"column":12}}]},"97":{"line":802,"type":"if","locations":[{"start":{"line":802,"column":8},"end":{"line":802,"column":8}},{"start":{"line":802,"column":8},"end":{"line":802,"column":8}}]},"98":{"line":805,"type":"if","locations":[{"start":{"line":805,"column":13},"end":{"line":805,"column":13}},{"start":{"line":805,"column":13},"end":{"line":805,"column":13}}]},"99":{"line":809,"type":"if","locations":[{"start":{"line":809,"column":12},"end":{"line":809,"column":12}},{"start":{"line":809,"column":12},"end":{"line":809,"column":12}}]},"100":{"line":809,"type":"binary-expr","locations":[{"start":{"line":809,"column":16},"end":{"line":809,"column":32}},{"start":{"line":809,"column":36},"end":{"line":809,"column":66}}]},"101":{"line":813,"type":"if","locations":[{"start":{"line":813,"column":12},"end":{"line":813,"column":12}},{"start":{"line":813,"column":12},"end":{"line":813,"column":12}}]},"102":{"line":816,"type":"if","locations":[{"start":{"line":816,"column":12},"end":{"line":816,"column":12}},{"start":{"line":816,"column":12},"end":{"line":816,"column":12}}]},"103":{"line":816,"type":"binary-expr","locations":[{"start":{"line":816,"column":15},"end":{"line":816,"column":32}},{"start":{"line":816,"column":36},"end":{"line":816,"column":44}}]},"104":{"line":825,"type":"binary-expr","locations":[{"start":{"line":825,"column":30},"end":{"line":825,"column":38}},{"start":{"line":825,"column":42},"end":{"line":825,"column":46}}]},"105":{"line":828,"type":"if","locations":[{"start":{"line":828,"column":16},"end":{"line":828,"column":16}},{"start":{"line":828,"column":16},"end":{"line":828,"column":16}}]},"106":{"line":834,"type":"if","locations":[{"start":{"line":834,"column":16},"end":{"line":834,"column":16}},{"start":{"line":834,"column":16},"end":{"line":834,"column":16}}]},"107":{"line":861,"type":"if","locations":[{"start":{"line":861,"column":16},"end":{"line":861,"column":16}},{"start":{"line":861,"column":16},"end":{"line":861,"column":16}}]},"108":{"line":861,"type":"binary-expr","locations":[{"start":{"line":861,"column":20},"end":{"line":861,"column":29}},{"start":{"line":861,"column":33},"end":{"line":861,"column":56}},{"start":{"line":861,"column":60},"end":{"line":861,"column":74}}]},"109":{"line":862,"type":"cond-expr","locations":[{"start":{"line":863,"column":24},"end":{"line":863,"column":50}},{"start":{"line":864,"column":24},"end":{"line":864,"column":57}}]},"110":{"line":870,"type":"if","locations":[{"start":{"line":870,"column":20},"end":{"line":870,"column":20}},{"start":{"line":870,"column":20},"end":{"line":870,"column":20}}]},"111":{"line":884,"type":"if","locations":[{"start":{"line":884,"column":20},"end":{"line":884,"column":20}},{"start":{"line":884,"column":20},"end":{"line":884,"column":20}}]},"112":{"line":903,"type":"if","locations":[{"start":{"line":903,"column":16},"end":{"line":903,"column":16}},{"start":{"line":903,"column":16},"end":{"line":903,"column":16}}]},"113":{"line":935,"type":"if","locations":[{"start":{"line":935,"column":14},"end":{"line":935,"column":14}},{"start":{"line":935,"column":14},"end":{"line":935,"column":14}}]},"114":{"line":945,"type":"if","locations":[{"start":{"line":945,"column":12},"end":{"line":945,"column":12}},{"start":{"line":945,"column":12},"end":{"line":945,"column":12}}]},"115":{"line":945,"type":"binary-expr","locations":[{"start":{"line":945,"column":16},"end":{"line":945,"column":32}},{"start":{"line":945,"column":36},"end":{"line":945,"column":66}}]},"116":{"line":949,"type":"if","locations":[{"start":{"line":949,"column":12},"end":{"line":949,"column":12}},{"start":{"line":949,"column":12},"end":{"line":949,"column":12}}]},"117":{"line":952,"type":"if","locations":[{"start":{"line":952,"column":12},"end":{"line":952,"column":12}},{"start":{"line":952,"column":12},"end":{"line":952,"column":12}}]},"118":{"line":962,"type":"cond-expr","locations":[{"start":{"line":962,"column":63},"end":{"line":962,"column":71}},{"start":{"line":962,"column":74},"end":{"line":962,"column":78}}]},"119":{"line":967,"type":"if","locations":[{"start":{"line":967,"column":16},"end":{"line":967,"column":16}},{"start":{"line":967,"column":16},"end":{"line":967,"column":16}}]},"120":{"line":997,"type":"if","locations":[{"start":{"line":997,"column":16},"end":{"line":997,"column":16}},{"start":{"line":997,"column":16},"end":{"line":997,"column":16}}]},"121":{"line":998,"type":"if","locations":[{"start":{"line":998,"column":20},"end":{"line":998,"column":20}},{"start":{"line":998,"column":20},"end":{"line":998,"column":20}}]},"122":{"line":999,"type":"if","locations":[{"start":{"line":999,"column":24},"end":{"line":999,"column":24}},{"start":{"line":999,"column":24},"end":{"line":999,"column":24}}]},"123":{"line":1003,"type":"if","locations":[{"start":{"line":1003,"column":25},"end":{"line":1003,"column":25}},{"start":{"line":1003,"column":25},"end":{"line":1003,"column":25}}]},"124":{"line":1021,"type":"binary-expr","locations":[{"start":{"line":1021,"column":17},"end":{"line":1021,"column":23}},{"start":{"line":1021,"column":27},"end":{"line":1023,"column":9}}]},"125":{"line":1028,"type":"if","locations":[{"start":{"line":1028,"column":12},"end":{"line":1028,"column":12}},{"start":{"line":1028,"column":12},"end":{"line":1028,"column":12}}]},"126":{"line":1033,"type":"if","locations":[{"start":{"line":1033,"column":17},"end":{"line":1033,"column":17}},{"start":{"line":1033,"column":17},"end":{"line":1033,"column":17}}]},"127":{"line":1055,"type":"binary-expr","locations":[{"start":{"line":1055,"column":16},"end":{"line":1055,"column":29}},{"start":{"line":1055,"column":33},"end":{"line":1055,"column":35}}]},"128":{"line":1082,"type":"if","locations":[{"start":{"line":1082,"column":12},"end":{"line":1082,"column":12}},{"start":{"line":1082,"column":12},"end":{"line":1082,"column":12}}]},"129":{"line":1116,"type":"if","locations":[{"start":{"line":1116,"column":8},"end":{"line":1116,"column":8}},{"start":{"line":1116,"column":8},"end":{"line":1116,"column":8}}]},"130":{"line":1136,"type":"binary-expr","locations":[{"start":{"line":1136,"column":29},"end":{"line":1136,"column":37}},{"start":{"line":1136,"column":41},"end":{"line":1136,"column":45}}]},"131":{"line":1139,"type":"if","locations":[{"start":{"line":1139,"column":12},"end":{"line":1139,"column":12}},{"start":{"line":1139,"column":12},"end":{"line":1139,"column":12}}]},"132":{"line":1153,"type":"if","locations":[{"start":{"line":1153,"column":16},"end":{"line":1153,"column":16}},{"start":{"line":1153,"column":16},"end":{"line":1153,"column":16}}]},"133":{"line":1170,"type":"if","locations":[{"start":{"line":1170,"column":4},"end":{"line":1170,"column":4}},{"start":{"line":1170,"column":4},"end":{"line":1170,"column":4}}]},"134":{"line":1170,"type":"binary-expr","locations":[{"start":{"line":1170,"column":8},"end":{"line":1170,"column":37}},{"start":{"line":1170,"column":41},"end":{"line":1170,"column":55}}]},"135":{"line":1174,"type":"if","locations":[{"start":{"line":1174,"column":9},"end":{"line":1174,"column":9}},{"start":{"line":1174,"column":9},"end":{"line":1174,"column":9}}]},"136":{"line":1174,"type":"binary-expr","locations":[{"start":{"line":1174,"column":13},"end":{"line":1174,"column":42}},{"start":{"line":1174,"column":46},"end":{"line":1174,"column":56}}]}}}} \ No newline at end of file
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/package.json b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/package.json
index 98c2e0b4e40..a522a14e196 100644
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/package.json
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/package.json
@@ -5,7 +5,7 @@
"author": {
"name": "Caolan McMahon"
},
- "version": "0.9.2",
+ "version": "1.2.1",
"keywords": [
"async",
"callback",
@@ -21,10 +21,15 @@
},
"license": "MIT",
"devDependencies": {
+ "benchmark": "github:bestiejs/benchmark.js",
+ "coveralls": "^2.11.2",
+ "jshint": "~2.7.0",
+ "lodash": ">=2.4.1",
+ "mkdirp": "~0.5.1",
"nodeunit": ">0.0.0",
+ "nyc": "^2.1.0",
"uglify-js": "1.2.x",
- "nodelint": ">0.0.0",
- "lodash": ">=2.4.1"
+ "yargs": "~3.9.1"
},
"jam": {
"main": "lib/async.js",
@@ -38,7 +43,10 @@
]
},
"scripts": {
- "test": "nodeunit test/test-async.js"
+ "test": "npm run-script lint && nodeunit test/test-async.js",
+ "lint": "jshint lib/*.js test/*.js perf/*.js",
+ "coverage": "nyc npm test && nyc report",
+ "coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls"
},
"spm": {
"main": "lib/async.js"
@@ -53,16 +61,16 @@
"tests"
]
},
- "gitHead": "de3a16091d5125384eff4a54deb3998b13c3814c",
+ "gitHead": "b66e85d1cca8c8056313253f22d18f571e7001d2",
"homepage": "https://github.com/caolan/async#readme",
- "_id": "async@0.9.2",
- "_shasum": "aea74d5e61c1f899613bf64bda66d4c78f2fd17d",
- "_from": "async@>=0.9.0 <0.10.0",
+ "_id": "async@1.2.1",
+ "_shasum": "a4816a17cd5ff516dfa2c7698a453369b9790de0",
+ "_from": "async@>=1.2.1 <2.0.0",
"_npmVersion": "2.9.0",
- "_nodeVersion": "2.0.1",
+ "_nodeVersion": "2.0.2",
"_npmUser": {
- "name": "beaugunderson",
- "email": "beau@beaugunderson.com"
+ "name": "aearly",
+ "email": "alexander.early@gmail.com"
},
"maintainers": [
{
@@ -72,13 +80,16 @@
{
"name": "beaugunderson",
"email": "beau@beaugunderson.com"
+ },
+ {
+ "name": "aearly",
+ "email": "alexander.early@gmail.com"
}
],
"dist": {
- "shasum": "aea74d5e61c1f899613bf64bda66d4c78f2fd17d",
- "tarball": "http://registry.npmjs.org/async/-/async-0.9.2.tgz"
+ "shasum": "a4816a17cd5ff516dfa2c7698a453369b9790de0",
+ "tarball": "http://registry.npmjs.org/async/-/async-1.2.1.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz",
- "readme": "ERROR: No README data found!"
+ "_resolved": "https://registry.npmjs.org/async/-/async-1.2.1.tgz"
}
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/support/sync-package-managers.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/support/sync-package-managers.js
index 30cb7c2d0cf..5b261197a80 100755
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/support/sync-package-managers.js
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/support/sync-package-managers.js
@@ -43,7 +43,7 @@ var componentSpecific = {
};
var componentInclude = ['name', 'description', 'version', 'keywords',
- 'license'];
+ 'license', 'main'];
var bowerJson = _.merge({}, _.pick(packageJson, bowerInclude), bowerSpecific);
var componentJson = _.merge({}, _.pick(packageJson, componentInclude), componentSpecific);
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/Readme.md b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/Readme.md
deleted file mode 100644
index 8043cb48ab9..00000000000
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/Readme.md
+++ /dev/null
@@ -1,132 +0,0 @@
-# combined-stream [![Build Status](https://travis-ci.org/felixge/node-combined-stream.svg?branch=master)](https://travis-ci.org/felixge/node-combined-stream)
-
-A stream that emits multiple other streams one after another.
-
-## Installation
-
-``` bash
-npm install combined-stream
-```
-
-## Usage
-
-Here is a simple example that shows how you can use combined-stream to combine
-two files into one:
-
-``` javascript
-var CombinedStream = require('combined-stream');
-var fs = require('fs');
-
-var combinedStream = CombinedStream.create();
-combinedStream.append(fs.createReadStream('file1.txt'));
-combinedStream.append(fs.createReadStream('file2.txt'));
-
-combinedStream.pipe(fs.createWriteStream('combined.txt'));
-```
-
-While the example above works great, it will pause all source streams until
-they are needed. If you don't want that to happen, you can set `pauseStreams`
-to `false`:
-
-``` javascript
-var CombinedStream = require('combined-stream');
-var fs = require('fs');
-
-var combinedStream = CombinedStream.create({pauseStreams: false});
-combinedStream.append(fs.createReadStream('file1.txt'));
-combinedStream.append(fs.createReadStream('file2.txt'));
-
-combinedStream.pipe(fs.createWriteStream('combined.txt'));
-```
-
-However, what if you don't have all the source streams yet, or you don't want
-to allocate the resources (file descriptors, memory, etc.) for them right away?
-Well, in that case you can simply provide a callback that supplies the stream
-by calling a `next()` function:
-
-``` javascript
-var CombinedStream = require('combined-stream');
-var fs = require('fs');
-
-var combinedStream = CombinedStream.create();
-combinedStream.append(function(next) {
- next(fs.createReadStream('file1.txt'));
-});
-combinedStream.append(function(next) {
- next(fs.createReadStream('file2.txt'));
-});
-
-combinedStream.pipe(fs.createWriteStream('combined.txt'));
-```
-
-## API
-
-### CombinedStream.create([options])
-
-Returns a new combined stream object. Available options are:
-
-* `maxDataSize`
-* `pauseStreams`
-
-The effect of those options is described below.
-
-### combinedStream.pauseStreams = `true`
-
-Whether to apply back pressure to the underlaying streams. If set to `false`,
-the underlaying streams will never be paused. If set to `true`, the
-underlaying streams will be paused right after being appended, as well as when
-`delayedStream.pipe()` wants to throttle.
-
-### combinedStream.maxDataSize = `2 * 1024 * 1024`
-
-The maximum amount of bytes (or characters) to buffer for all source streams.
-If this value is exceeded, `combinedStream` emits an `'error'` event.
-
-### combinedStream.dataSize = `0`
-
-The amount of bytes (or characters) currently buffered by `combinedStream`.
-
-### combinedStream.append(stream)
-
-Appends the given `stream` to the combinedStream object. If `pauseStreams` is
-set to `true, this stream will also be paused right away.
-
-`streams` can also be a function that takes one parameter called `next`. `next`
-is a function that must be invoked in order to provide the `next` stream, see
-example above.
-
-Regardless of how the `stream` is appended, combined-stream always attaches an
-`'error'` listener to it, so you don't have to do that manually.
-
-Special case: `stream` can also be a String or Buffer.
-
-### combinedStream.write(data)
-
-You should not call this, `combinedStream` takes care of piping the appended
-streams into itself for you.
-
-### combinedStream.resume()
-
-Causes `combinedStream` to start drain the streams it manages. The function is
-idempotent, and also emits a `'resume'` event each time which usually goes to
-the stream that is currently being drained.
-
-### combinedStream.pause();
-
-If `combinedStream.pauseStreams` is set to `false`, this does nothing.
-Otherwise a `'pause'` event is emitted, this goes to the stream that is
-currently being drained, so you can use it to apply back pressure.
-
-### combinedStream.end();
-
-Sets `combinedStream.writable` to false, emits an `'end'` event, and removes
-all streams from the queue.
-
-### combinedStream.destroy();
-
-Same as `combinedStream.end()`, except it emits a `'close'` event instead of
-`'end'`.
-
-## License
-
-combined-stream is licensed under the MIT license.
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/lib/combined_stream.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/lib/combined_stream.js
deleted file mode 100644
index 6b5c21b6b42..00000000000
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/lib/combined_stream.js
+++ /dev/null
@@ -1,188 +0,0 @@
-var util = require('util');
-var Stream = require('stream').Stream;
-var DelayedStream = require('delayed-stream');
-
-module.exports = CombinedStream;
-function CombinedStream() {
- this.writable = false;
- this.readable = true;
- this.dataSize = 0;
- this.maxDataSize = 2 * 1024 * 1024;
- this.pauseStreams = true;
-
- this._released = false;
- this._streams = [];
- this._currentStream = null;
-}
-util.inherits(CombinedStream, Stream);
-
-CombinedStream.create = function(options) {
- var combinedStream = new this();
-
- options = options || {};
- for (var option in options) {
- combinedStream[option] = options[option];
- }
-
- return combinedStream;
-};
-
-CombinedStream.isStreamLike = function(stream) {
- return (typeof stream !== 'function')
- && (typeof stream !== 'string')
- && (typeof stream !== 'boolean')
- && (typeof stream !== 'number')
- && (!Buffer.isBuffer(stream));
-};
-
-CombinedStream.prototype.append = function(stream) {
- var isStreamLike = CombinedStream.isStreamLike(stream);
-
- if (isStreamLike) {
- if (!(stream instanceof DelayedStream)) {
- var newStream = DelayedStream.create(stream, {
- maxDataSize: Infinity,
- pauseStream: this.pauseStreams,
- });
- stream.on('data', this._checkDataSize.bind(this));
- stream = newStream;
- }
-
- this._handleErrors(stream);
-
- if (this.pauseStreams) {
- stream.pause();
- }
- }
-
- this._streams.push(stream);
- return this;
-};
-
-CombinedStream.prototype.pipe = function(dest, options) {
- Stream.prototype.pipe.call(this, dest, options);
- this.resume();
- return dest;
-};
-
-CombinedStream.prototype._getNext = function() {
- this._currentStream = null;
- var stream = this._streams.shift();
-
-
- if (typeof stream == 'undefined') {
- this.end();
- return;
- }
-
- if (typeof stream !== 'function') {
- this._pipeNext(stream);
- return;
- }
-
- var getStream = stream;
- getStream(function(stream) {
- var isStreamLike = CombinedStream.isStreamLike(stream);
- if (isStreamLike) {
- stream.on('data', this._checkDataSize.bind(this));
- this._handleErrors(stream);
- }
-
- this._pipeNext(stream);
- }.bind(this));
-};
-
-CombinedStream.prototype._pipeNext = function(stream) {
- this._currentStream = stream;
-
- var isStreamLike = CombinedStream.isStreamLike(stream);
- if (isStreamLike) {
- stream.on('end', this._getNext.bind(this));
- stream.pipe(this, {end: false});
- return;
- }
-
- var value = stream;
- this.write(value);
- this._getNext();
-};
-
-CombinedStream.prototype._handleErrors = function(stream) {
- var self = this;
- stream.on('error', function(err) {
- self._emitError(err);
- });
-};
-
-CombinedStream.prototype.write = function(data) {
- this.emit('data', data);
-};
-
-CombinedStream.prototype.pause = function() {
- if (!this.pauseStreams) {
- return;
- }
-
- if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause();
- this.emit('pause');
-};
-
-CombinedStream.prototype.resume = function() {
- if (!this._released) {
- this._released = true;
- this.writable = true;
- this._getNext();
- }
-
- if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume();
- this.emit('resume');
-};
-
-CombinedStream.prototype.end = function() {
- this._reset();
- this.emit('end');
-};
-
-CombinedStream.prototype.destroy = function() {
- this._reset();
- this.emit('close');
-};
-
-CombinedStream.prototype._reset = function() {
- this.writable = false;
- this._streams = [];
- this._currentStream = null;
-};
-
-CombinedStream.prototype._checkDataSize = function() {
- this._updateDataSize();
- if (this.dataSize <= this.maxDataSize) {
- return;
- }
-
- var message =
- 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.';
- this._emitError(new Error(message));
-};
-
-CombinedStream.prototype._updateDataSize = function() {
- this.dataSize = 0;
-
- var self = this;
- this._streams.forEach(function(stream) {
- if (!stream.dataSize) {
- return;
- }
-
- self.dataSize += stream.dataSize;
- });
-
- if (this._currentStream && this._currentStream.dataSize) {
- this.dataSize += this._currentStream.dataSize;
- }
-};
-
-CombinedStream.prototype._emitError = function(err) {
- this._reset();
- this.emit('error', err);
-};
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/.npmignore b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/.npmignore
deleted file mode 100644
index 2fedb26cce9..00000000000
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/.npmignore
+++ /dev/null
@@ -1,2 +0,0 @@
-*.un~
-/node_modules/*
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Makefile b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Makefile
deleted file mode 100644
index 2d7580746d0..00000000000
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-SHELL := /bin/bash
-
-test:
- @./test/run.js
-
-.PHONY: test
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Readme.md b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Readme.md
deleted file mode 100644
index 5cb5b35e5bb..00000000000
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Readme.md
+++ /dev/null
@@ -1,154 +0,0 @@
-# delayed-stream
-
-Buffers events from a stream until you are ready to handle them.
-
-## Installation
-
-``` bash
-npm install delayed-stream
-```
-
-## Usage
-
-The following example shows how to write a http echo server that delays its
-response by 1000 ms.
-
-``` javascript
-var DelayedStream = require('delayed-stream');
-var http = require('http');
-
-http.createServer(function(req, res) {
- var delayed = DelayedStream.create(req);
-
- setTimeout(function() {
- res.writeHead(200);
- delayed.pipe(res);
- }, 1000);
-});
-```
-
-If you are not using `Stream#pipe`, you can also manually release the buffered
-events by calling `delayedStream.resume()`:
-
-``` javascript
-var delayed = DelayedStream.create(req);
-
-setTimeout(function() {
- // Emit all buffered events and resume underlaying source
- delayed.resume();
-}, 1000);
-```
-
-## Implementation
-
-In order to use this meta stream properly, here are a few things you should
-know about the implementation.
-
-### Event Buffering / Proxying
-
-All events of the `source` stream are hijacked by overwriting the `source.emit`
-method. Until node implements a catch-all event listener, this is the only way.
-
-However, delayed-stream still continues to emit all events it captures on the
-`source`, regardless of whether you have released the delayed stream yet or
-not.
-
-Upon creation, delayed-stream captures all `source` events and stores them in
-an internal event buffer. Once `delayedStream.release()` is called, all
-buffered events are emitted on the `delayedStream`, and the event buffer is
-cleared. After that, delayed-stream merely acts as a proxy for the underlaying
-source.
-
-### Error handling
-
-Error events on `source` are buffered / proxied just like any other events.
-However, `delayedStream.create` attaches a no-op `'error'` listener to the
-`source`. This way you only have to handle errors on the `delayedStream`
-object, rather than in two places.
-
-### Buffer limits
-
-delayed-stream provides a `maxDataSize` property that can be used to limit
-the amount of data being buffered. In order to protect you from bad `source`
-streams that don't react to `source.pause()`, this feature is enabled by
-default.
-
-## API
-
-### DelayedStream.create(source, [options])
-
-Returns a new `delayedStream`. Available options are:
-
-* `pauseStream`
-* `maxDataSize`
-
-The description for those properties can be found below.
-
-### delayedStream.source
-
-The `source` stream managed by this object. This is useful if you are
-passing your `delayedStream` around, and you still want to access properties
-on the `source` object.
-
-### delayedStream.pauseStream = true
-
-Whether to pause the underlaying `source` when calling
-`DelayedStream.create()`. Modifying this property afterwards has no effect.
-
-### delayedStream.maxDataSize = 1024 * 1024
-
-The amount of data to buffer before emitting an `error`.
-
-If the underlaying source is emitting `Buffer` objects, the `maxDataSize`
-refers to bytes.
-
-If the underlaying source is emitting JavaScript strings, the size refers to
-characters.
-
-If you know what you are doing, you can set this property to `Infinity` to
-disable this feature. You can also modify this property during runtime.
-
-### delayedStream.maxDataSize = 1024 * 1024
-
-The amount of data to buffer before emitting an `error`.
-
-If the underlaying source is emitting `Buffer` objects, the `maxDataSize`
-refers to bytes.
-
-If the underlaying source is emitting JavaScript strings, the size refers to
-characters.
-
-If you know what you are doing, you can set this property to `Infinity` to
-disable this feature.
-
-### delayedStream.dataSize = 0
-
-The amount of data buffered so far.
-
-### delayedStream.readable
-
-An ECMA5 getter that returns the value of `source.readable`.
-
-### delayedStream.resume()
-
-If the `delayedStream` has not been released so far, `delayedStream.release()`
-is called.
-
-In either case, `source.resume()` is called.
-
-### delayedStream.pause()
-
-Calls `source.pause()`.
-
-### delayedStream.pipe(dest)
-
-Calls `delayedStream.resume()` and then proxies the arguments to `source.pipe`.
-
-### delayedStream.release()
-
-Emits and clears all events that have been buffered up so far. This does not
-resume the underlaying source, use `delayedStream.resume()` instead.
-
-## License
-
-delayed-stream is licensed under the MIT license.
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js
deleted file mode 100644
index 7c10d482531..00000000000
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js
+++ /dev/null
@@ -1,99 +0,0 @@
-var Stream = require('stream').Stream;
-var util = require('util');
-
-module.exports = DelayedStream;
-function DelayedStream() {
- this.source = null;
- this.dataSize = 0;
- this.maxDataSize = 1024 * 1024;
- this.pauseStream = true;
-
- this._maxDataSizeExceeded = false;
- this._released = false;
- this._bufferedEvents = [];
-}
-util.inherits(DelayedStream, Stream);
-
-DelayedStream.create = function(source, options) {
- var delayedStream = new this();
-
- options = options || {};
- for (var option in options) {
- delayedStream[option] = options[option];
- }
-
- delayedStream.source = source;
-
- var realEmit = source.emit;
- source.emit = function() {
- delayedStream._handleEmit(arguments);
- return realEmit.apply(source, arguments);
- };
-
- source.on('error', function() {});
- if (delayedStream.pauseStream) {
- source.pause();
- }
-
- return delayedStream;
-};
-
-DelayedStream.prototype.__defineGetter__('readable', function() {
- return this.source.readable;
-});
-
-DelayedStream.prototype.resume = function() {
- if (!this._released) {
- this.release();
- }
-
- this.source.resume();
-};
-
-DelayedStream.prototype.pause = function() {
- this.source.pause();
-};
-
-DelayedStream.prototype.release = function() {
- this._released = true;
-
- this._bufferedEvents.forEach(function(args) {
- this.emit.apply(this, args);
- }.bind(this));
- this._bufferedEvents = [];
-};
-
-DelayedStream.prototype.pipe = function() {
- var r = Stream.prototype.pipe.apply(this, arguments);
- this.resume();
- return r;
-};
-
-DelayedStream.prototype._handleEmit = function(args) {
- if (this._released) {
- this.emit.apply(this, args);
- return;
- }
-
- if (args[0] === 'data') {
- this.dataSize += args[1].length;
- this._checkIfMaxDataSizeExceeded();
- }
-
- this._bufferedEvents.push(args);
-};
-
-DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() {
- if (this._maxDataSizeExceeded) {
- return;
- }
-
- if (this.dataSize <= this.maxDataSize) {
- return;
- }
-
- this._maxDataSizeExceeded = true;
- var message =
- 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'
- this.emit('error', new Error(message));
-};
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/package.json b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/package.json
deleted file mode 100644
index 3324a13e97b..00000000000
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/package.json
+++ /dev/null
@@ -1,42 +0,0 @@
-{
- "author": {
- "name": "Felix Geisendörfer",
- "email": "felix@debuggable.com",
- "url": "http://debuggable.com/"
- },
- "name": "delayed-stream",
- "description": "Buffers events from a stream until you are ready to handle them.",
- "version": "0.0.5",
- "homepage": "https://github.com/felixge/node-delayed-stream",
- "repository": {
- "type": "git",
- "url": "git://github.com/felixge/node-delayed-stream.git"
- },
- "main": "./lib/delayed_stream",
- "engines": {
- "node": ">=0.4.0"
- },
- "dependencies": {},
- "devDependencies": {
- "fake": "0.2.0",
- "far": "0.0.1"
- },
- "_id": "delayed-stream@0.0.5",
- "_engineSupported": true,
- "_npmVersion": "1.0.3",
- "_nodeVersion": "v0.4.9-pre",
- "_defaultsLoaded": true,
- "dist": {
- "shasum": "d4b1f43a93e8296dfe02694f4680bc37a313c73f",
- "tarball": "http://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz"
- },
- "scripts": {},
- "directories": {},
- "_shasum": "d4b1f43a93e8296dfe02694f4680bc37a313c73f",
- "_resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz",
- "_from": "delayed-stream@0.0.5",
- "bugs": {
- "url": "https://github.com/felixge/node-delayed-stream/issues"
- },
- "readme": "ERROR: No README data found!"
-}
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/common.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/common.js
deleted file mode 100644
index 4d71b8a6471..00000000000
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/common.js
+++ /dev/null
@@ -1,6 +0,0 @@
-var common = module.exports;
-
-common.DelayedStream = require('..');
-common.assert = require('assert');
-common.fake = require('fake');
-common.PORT = 49252;
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js
deleted file mode 100644
index 787539606e6..00000000000
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js
+++ /dev/null
@@ -1,36 +0,0 @@
-var common = require('../common');
-var assert = common.assert;
-var DelayedStream = common.DelayedStream;
-var http = require('http');
-
-var UPLOAD = new Buffer(10 * 1024 * 1024);
-
-var server = http.createServer(function(req, res) {
- var delayed = DelayedStream.create(req, {maxDataSize: UPLOAD.length});
-
- setTimeout(function() {
- res.writeHead(200);
- delayed.pipe(res);
- }, 10);
-});
-server.listen(common.PORT, function() {
- var request = http.request({
- method: 'POST',
- port: common.PORT,
- });
-
- request.write(UPLOAD);
- request.end();
-
- request.on('response', function(res) {
- var received = 0;
- res
- .on('data', function(chunk) {
- received += chunk.length;
- })
- .on('end', function() {
- assert.equal(received, UPLOAD.length);
- server.close();
- });
- });
-});
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js
deleted file mode 100644
index 6f417f3e90f..00000000000
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js
+++ /dev/null
@@ -1,21 +0,0 @@
-var common = require('../common');
-var assert = common.assert;
-var fake = common.fake.create();
-var DelayedStream = common.DelayedStream;
-var Stream = require('stream').Stream;
-
-(function testAutoPause() {
- var source = new Stream();
-
- fake.expect(source, 'pause', 1);
- var delayedStream = DelayedStream.create(source);
- fake.verify();
-})();
-
-(function testDisableAutoPause() {
- var source = new Stream();
- fake.expect(source, 'pause', 0);
-
- var delayedStream = DelayedStream.create(source, {pauseStream: false});
- fake.verify();
-})();
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js
deleted file mode 100644
index b50c39783a0..00000000000
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js
+++ /dev/null
@@ -1,14 +0,0 @@
-var common = require('../common');
-var assert = common.assert;
-var fake = common.fake.create();
-var DelayedStream = common.DelayedStream;
-var Stream = require('stream').Stream;
-
-(function testDelayEventsUntilResume() {
- var source = new Stream();
- var delayedStream = DelayedStream.create(source, {pauseStream: false});
-
- fake.expect(source, 'pause');
- delayedStream.pause();
- fake.verify();
-})();
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js
deleted file mode 100644
index fc4047e08b2..00000000000
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js
+++ /dev/null
@@ -1,48 +0,0 @@
-var common = require('../common');
-var assert = common.assert;
-var fake = common.fake.create();
-var DelayedStream = common.DelayedStream;
-var Stream = require('stream').Stream;
-
-(function testDelayEventsUntilResume() {
- var source = new Stream();
- var delayedStream = DelayedStream.create(source, {pauseStream: false});
-
- // delayedStream must not emit until we resume
- fake.expect(delayedStream, 'emit', 0);
-
- // but our original source must emit
- var params = [];
- source.on('foo', function(param) {
- params.push(param);
- });
-
- source.emit('foo', 1);
- source.emit('foo', 2);
-
- // Make sure delayedStream did not emit, and source did
- assert.deepEqual(params, [1, 2]);
- fake.verify();
-
- // After resume, delayedStream must playback all events
- fake
- .stub(delayedStream, 'emit')
- .times(Infinity)
- .withArg(1, 'newListener');
- fake.expect(delayedStream, 'emit', ['foo', 1]);
- fake.expect(delayedStream, 'emit', ['foo', 2]);
- fake.expect(source, 'resume');
-
- delayedStream.resume();
- fake.verify();
-
- // Calling resume again will delegate to source
- fake.expect(source, 'resume');
- delayedStream.resume();
- fake.verify();
-
- // Emitting more events directly leads to them being emitted
- fake.expect(delayedStream, 'emit', ['foo', 3]);
- source.emit('foo', 3);
- fake.verify();
-})();
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js
deleted file mode 100644
index a9d35e72ca2..00000000000
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js
+++ /dev/null
@@ -1,15 +0,0 @@
-var common = require('../common');
-var assert = common.assert;
-var fake = common.fake.create();
-var DelayedStream = common.DelayedStream;
-var Stream = require('stream').Stream;
-
-(function testHandleSourceErrors() {
- var source = new Stream();
- var delayedStream = DelayedStream.create(source, {pauseStream: false});
-
- // We deal with this by attaching a no-op listener to 'error' on the source
- // when creating a new DelayedStream. This way error events on the source
- // won't throw.
- source.emit('error', new Error('something went wrong'));
-})();
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js
deleted file mode 100644
index 7638a2bf040..00000000000
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js
+++ /dev/null
@@ -1,18 +0,0 @@
-var common = require('../common');
-var assert = common.assert;
-var fake = common.fake.create();
-var DelayedStream = common.DelayedStream;
-var Stream = require('stream').Stream;
-
-(function testMaxDataSize() {
- var source = new Stream();
- var delayedStream = DelayedStream.create(source, {maxDataSize: 1024, pauseStream: false});
-
- source.emit('data', new Buffer(1024));
-
- fake
- .expect(delayedStream, 'emit')
- .withArg(1, 'error');
- source.emit('data', new Buffer(1));
- fake.verify();
-})();
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js
deleted file mode 100644
index 7d312ab1f88..00000000000
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js
+++ /dev/null
@@ -1,13 +0,0 @@
-var common = require('../common');
-var assert = common.assert;
-var fake = common.fake.create();
-var DelayedStream = common.DelayedStream;
-var Stream = require('stream').Stream;
-
-(function testPipeReleases() {
- var source = new Stream();
- var delayedStream = DelayedStream.create(source, {pauseStream: false});
-
- fake.expect(delayedStream, 'resume');
- delayedStream.pipe(new Stream());
-})();
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js
deleted file mode 100644
index d436163b7cd..00000000000
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js
+++ /dev/null
@@ -1,13 +0,0 @@
-var common = require('../common');
-var assert = common.assert;
-var fake = common.fake.create();
-var DelayedStream = common.DelayedStream;
-var Stream = require('stream').Stream;
-
-(function testProxyReadableProperty() {
- var source = new Stream();
- var delayedStream = DelayedStream.create(source, {pauseStream: false});
-
- source.readable = fake.value('source.readable');
- assert.strictEqual(delayedStream.readable, source.readable);
-})();
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/run.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/run.js
deleted file mode 100755
index 0bb8e822414..00000000000
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/run.js
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env node
-var far = require('far').create();
-
-far.add(__dirname);
-far.include(/test-.*\.js$/);
-
-far.execute();
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json
deleted file mode 100644
index 57c38da67df..00000000000
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json
+++ /dev/null
@@ -1,37 +0,0 @@
-{
- "author": {
- "name": "Felix Geisendörfer",
- "email": "felix@debuggable.com",
- "url": "http://debuggable.com/"
- },
- "name": "combined-stream",
- "description": "A stream that emits multiple other streams one after another.",
- "version": "0.0.7",
- "homepage": "https://github.com/felixge/node-combined-stream",
- "repository": {
- "type": "git",
- "url": "git://github.com/felixge/node-combined-stream.git"
- },
- "main": "./lib/combined_stream",
- "scripts": {
- "test": "node test/run.js"
- },
- "engines": {
- "node": ">= 0.8"
- },
- "dependencies": {
- "delayed-stream": "0.0.5"
- },
- "devDependencies": {
- "far": "~0.0.7"
- },
- "readme": "# combined-stream [![Build Status](https://travis-ci.org/felixge/node-combined-stream.svg?branch=master)](https://travis-ci.org/felixge/node-combined-stream)\n\nA stream that emits multiple other streams one after another.\n\n## Installation\n\n``` bash\nnpm install combined-stream\n```\n\n## Usage\n\nHere is a simple example that shows how you can use combined-stream to combine\ntwo files into one:\n\n``` javascript\nvar CombinedStream = require('combined-stream');\nvar fs = require('fs');\n\nvar combinedStream = CombinedStream.create();\ncombinedStream.append(fs.createReadStream('file1.txt'));\ncombinedStream.append(fs.createReadStream('file2.txt'));\n\ncombinedStream.pipe(fs.createWriteStream('combined.txt'));\n```\n\nWhile the example above works great, it will pause all source streams until\nthey are needed. If you don't want that to happen, you can set `pauseStreams`\nto `false`:\n\n``` javascript\nvar CombinedStream = require('combined-stream');\nvar fs = require('fs');\n\nvar combinedStream = CombinedStream.create({pauseStreams: false});\ncombinedStream.append(fs.createReadStream('file1.txt'));\ncombinedStream.append(fs.createReadStream('file2.txt'));\n\ncombinedStream.pipe(fs.createWriteStream('combined.txt'));\n```\n\nHowever, what if you don't have all the source streams yet, or you don't want\nto allocate the resources (file descriptors, memory, etc.) for them right away?\nWell, in that case you can simply provide a callback that supplies the stream\nby calling a `next()` function:\n\n``` javascript\nvar CombinedStream = require('combined-stream');\nvar fs = require('fs');\n\nvar combinedStream = CombinedStream.create();\ncombinedStream.append(function(next) {\n next(fs.createReadStream('file1.txt'));\n});\ncombinedStream.append(function(next) {\n next(fs.createReadStream('file2.txt'));\n});\n\ncombinedStream.pipe(fs.createWriteStream('combined.txt'));\n```\n\n## API\n\n### CombinedStream.create([options])\n\nReturns a new combined stream object. Available options are:\n\n* `maxDataSize`\n* `pauseStreams`\n\nThe effect of those options is described below.\n\n### combinedStream.pauseStreams = `true`\n\nWhether to apply back pressure to the underlaying streams. If set to `false`,\nthe underlaying streams will never be paused. If set to `true`, the\nunderlaying streams will be paused right after being appended, as well as when\n`delayedStream.pipe()` wants to throttle.\n\n### combinedStream.maxDataSize = `2 * 1024 * 1024`\n\nThe maximum amount of bytes (or characters) to buffer for all source streams.\nIf this value is exceeded, `combinedStream` emits an `'error'` event.\n\n### combinedStream.dataSize = `0`\n\nThe amount of bytes (or characters) currently buffered by `combinedStream`.\n\n### combinedStream.append(stream)\n\nAppends the given `stream` to the combinedStream object. If `pauseStreams` is\nset to `true, this stream will also be paused right away.\n\n`streams` can also be a function that takes one parameter called `next`. `next`\nis a function that must be invoked in order to provide the `next` stream, see\nexample above.\n\nRegardless of how the `stream` is appended, combined-stream always attaches an\n`'error'` listener to it, so you don't have to do that manually.\n\nSpecial case: `stream` can also be a String or Buffer.\n\n### combinedStream.write(data)\n\nYou should not call this, `combinedStream` takes care of piping the appended\nstreams into itself for you.\n\n### combinedStream.resume()\n\nCauses `combinedStream` to start drain the streams it manages. The function is\nidempotent, and also emits a `'resume'` event each time which usually goes to\nthe stream that is currently being drained.\n\n### combinedStream.pause();\n\nIf `combinedStream.pauseStreams` is set to `false`, this does nothing.\nOtherwise a `'pause'` event is emitted, this goes to the stream that is\ncurrently being drained, so you can use it to apply back pressure.\n\n### combinedStream.end();\n\nSets `combinedStream.writable` to false, emits an `'end'` event, and removes\nall streams from the queue.\n\n### combinedStream.destroy();\n\nSame as `combinedStream.end()`, except it emits a `'close'` event instead of\n`'end'`.\n\n## License\n\ncombined-stream is licensed under the MIT license.\n",
- "readmeFilename": "Readme.md",
- "bugs": {
- "url": "https://github.com/felixge/node-combined-stream/issues"
- },
- "_id": "combined-stream@0.0.7",
- "_shasum": "0137e657baa5a7541c57ac37ac5fc07d73b4dc1f",
- "_resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.7.tgz",
- "_from": "combined-stream@>=0.0.4 <0.1.0"
-}
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/HISTORY.md b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/HISTORY.md
new file mode 100644
index 00000000000..54689f9113f
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/HISTORY.md
@@ -0,0 +1,135 @@
+2.1.1 / 2015-06-08
+==================
+
+ * perf: fix deopt during mapping
+
+2.1.0 / 2015-06-07
+==================
+
+ * Fix incorrectly treating extension-less file name as extension
+ - i.e. `'path/to/json'` will no longer return `application/json`
+ * Fix `.charset(type)` to accept parameters
+ * Fix `.charset(type)` to match case-insensitive
+ * Improve generation of extension to MIME mapping
+ * Refactor internals for readability and no argument reassignment
+ * Prefer `application/*` MIME types from the same source
+ * Prefer any type over `application/octet-stream`
+ * deps: mime-db@~1.13.0
+ - Add nginx as a source
+ - Add new mime types
+
+2.0.14 / 2015-06-06
+===================
+
+ * deps: mime-db@~1.12.0
+ - Add new mime types
+
+2.0.13 / 2015-05-31
+===================
+
+ * deps: mime-db@~1.11.0
+ - Add new mime types
+
+2.0.12 / 2015-05-19
+===================
+
+ * deps: mime-db@~1.10.0
+ - Add new mime types
+
+2.0.11 / 2015-05-05
+===================
+
+ * deps: mime-db@~1.9.1
+ - Add new mime types
+
+2.0.10 / 2015-03-13
+===================
+
+ * deps: mime-db@~1.8.0
+ - Add new mime types
+
+2.0.9 / 2015-02-09
+==================
+
+ * deps: mime-db@~1.7.0
+ - Add new mime types
+ - Community extensions ownership transferred from `node-mime`
+
+2.0.8 / 2015-01-29
+==================
+
+ * deps: mime-db@~1.6.0
+ - Add new mime types
+
+2.0.7 / 2014-12-30
+==================
+
+ * deps: mime-db@~1.5.0
+ - Add new mime types
+ - Fix various invalid MIME type entries
+
+2.0.6 / 2014-12-30
+==================
+
+ * deps: mime-db@~1.4.0
+ - Add new mime types
+ - Fix various invalid MIME type entries
+ - Remove example template MIME types
+
+2.0.5 / 2014-12-29
+==================
+
+ * deps: mime-db@~1.3.1
+ - Fix missing extensions
+
+2.0.4 / 2014-12-10
+==================
+
+ * deps: mime-db@~1.3.0
+ - Add new mime types
+
+2.0.3 / 2014-11-09
+==================
+
+ * deps: mime-db@~1.2.0
+ - Add new mime types
+
+2.0.2 / 2014-09-28
+==================
+
+ * deps: mime-db@~1.1.0
+ - Add new mime types
+ - Add additional compressible
+ - Update charsets
+
+2.0.1 / 2014-09-07
+==================
+
+ * Support Node.js 0.6
+
+2.0.0 / 2014-09-02
+==================
+
+ * Use `mime-db`
+ * Remove `.define()`
+
+1.0.2 / 2014-08-04
+==================
+
+ * Set charset=utf-8 for `text/javascript`
+
+1.0.1 / 2014-06-24
+==================
+
+ * Add `text/jsx` type
+
+1.0.0 / 2014-05-12
+==================
+
+ * Return `false` for unknown types
+ * Set charset=utf-8 for `application/json`
+
+0.1.0 / 2014-05-02
+==================
+
+ * Initial release
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/LICENSE b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/LICENSE
new file mode 100644
index 00000000000..06166077be4
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/LICENSE
@@ -0,0 +1,23 @@
+(The MIT License)
+
+Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
+Copyright (c) 2015 Douglas Christopher Wilson <doug@somethingdoug.com>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/README.md b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/README.md
new file mode 100644
index 00000000000..e26295d0478
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/README.md
@@ -0,0 +1,103 @@
+# mime-types
+
+[![NPM Version][npm-image]][npm-url]
+[![NPM Downloads][downloads-image]][downloads-url]
+[![Node.js Version][node-version-image]][node-version-url]
+[![Build Status][travis-image]][travis-url]
+[![Test Coverage][coveralls-image]][coveralls-url]
+
+The ultimate javascript content-type utility.
+
+Similar to [node-mime](https://github.com/broofa/node-mime), except:
+
+- __No fallbacks.__ Instead of naively returning the first available type, `mime-types` simply returns `false`,
+ so do `var type = mime.lookup('unrecognized') || 'application/octet-stream'`.
+- No `new Mime()` business, so you could do `var lookup = require('mime-types').lookup`.
+- Additional mime types are added such as jade and stylus via [mime-db](https://github.com/jshttp/mime-db)
+- No `.define()` functionality
+
+Otherwise, the API is compatible.
+
+## Install
+
+```sh
+$ npm install mime-types
+```
+
+## Adding Types
+
+All mime types are based on [mime-db](https://github.com/jshttp/mime-db),
+so open a PR there if you'd like to add mime types.
+
+## API
+
+```js
+var mime = require('mime-types')
+```
+
+All functions return `false` if input is invalid or not found.
+
+### mime.lookup(path)
+
+Lookup the content-type associated with a file.
+
+```js
+mime.lookup('json') // 'application/json'
+mime.lookup('.md') // 'text/x-markdown'
+mime.lookup('file.html') // 'text/html'
+mime.lookup('folder/file.js') // 'application/javascript'
+mime.lookup('folder/.htaccess') // false
+
+mime.lookup('cats') // false
+```
+
+### mime.contentType(type)
+
+Create a full content-type header given a content-type or extension.
+
+```js
+mime.contentType('markdown') // 'text/x-markdown; charset=utf-8'
+mime.contentType('file.json') // 'application/json; charset=utf-8'
+
+// from a full path
+mime.contentType(path.extname('/path/to/file.json')) // 'application/json; charset=utf-8'
+```
+
+### mime.extension(type)
+
+Get the default extension for a content-type.
+
+```js
+mime.extension('application/octet-stream') // 'bin'
+```
+
+### mime.charset(type)
+
+Lookup the implied default charset of a content-type.
+
+```js
+mime.charset('text/x-markdown') // 'UTF-8'
+```
+
+### var type = mime.types[extension]
+
+A map of content-types by extension.
+
+### [extensions...] = mime.extensions[type]
+
+A map of extensions by content-type.
+
+## License
+
+[MIT](LICENSE)
+
+[npm-image]: https://img.shields.io/npm/v/mime-types.svg
+[npm-url]: https://npmjs.org/package/mime-types
+[node-version-image]: https://img.shields.io/node/v/mime-types.svg
+[node-version-url]: http://nodejs.org/download/
+[travis-image]: https://img.shields.io/travis/jshttp/mime-types/master.svg
+[travis-url]: https://travis-ci.org/jshttp/mime-types
+[coveralls-image]: https://img.shields.io/coveralls/jshttp/mime-types/master.svg
+[coveralls-url]: https://coveralls.io/r/jshttp/mime-types
+[downloads-image]: https://img.shields.io/npm/dm/mime-types.svg
+[downloads-url]: https://npmjs.org/package/mime-types
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/index.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/index.js
new file mode 100644
index 00000000000..9edf72b75e9
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/index.js
@@ -0,0 +1,188 @@
+/*!
+ * mime-types
+ * Copyright(c) 2014 Jonathan Ong
+ * Copyright(c) 2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module dependencies.
+ * @private
+ */
+
+var db = require('mime-db')
+var extname = require('path').extname
+
+/**
+ * Module variables.
+ * @private
+ */
+
+var extractTypeRegExp = /^\s*([^;\s]*)(?:;|\s|$)/
+var textTypeRegExp = /^text\//i
+
+/**
+ * Module exports.
+ * @public
+ */
+
+exports.charset = charset
+exports.charsets = { lookup: charset }
+exports.contentType = contentType
+exports.extension = extension
+exports.extensions = Object.create(null)
+exports.lookup = lookup
+exports.types = Object.create(null)
+
+// Populate the extensions/types maps
+populateMaps(exports.extensions, exports.types)
+
+/**
+ * Get the default charset for a MIME type.
+ *
+ * @param {string} type
+ * @return {boolean|string}
+ */
+
+function charset(type) {
+ if (!type || typeof type !== 'string') {
+ return false
+ }
+
+ // TODO: use media-typer
+ var match = extractTypeRegExp.exec(type)
+ var mime = match && db[match[1].toLowerCase()]
+
+ if (mime && mime.charset) {
+ return mime.charset
+ }
+
+ // default text/* to utf-8
+ if (match && textTypeRegExp.test(match[1])) {
+ return 'UTF-8'
+ }
+
+ return false
+}
+
+/**
+ * Create a full Content-Type header given a MIME type or extension.
+ *
+ * @param {string} str
+ * @return {boolean|string}
+ */
+
+function contentType(str) {
+ // TODO: should this even be in this module?
+ if (!str || typeof str !== 'string') {
+ return false
+ }
+
+ var mime = str.indexOf('/') === -1
+ ? exports.lookup(str)
+ : str
+
+ if (!mime) {
+ return false
+ }
+
+ // TODO: use content-type or other module
+ if (mime.indexOf('charset') === -1) {
+ var charset = exports.charset(mime)
+ if (charset) mime += '; charset=' + charset.toLowerCase()
+ }
+
+ return mime
+}
+
+/**
+ * Get the default extension for a MIME type.
+ *
+ * @param {string} type
+ * @return {boolean|string}
+ */
+
+function extension(type) {
+ if (!type || typeof type !== 'string') {
+ return false
+ }
+
+ // TODO: use media-typer
+ var match = extractTypeRegExp.exec(type)
+
+ // get extensions
+ var exts = match && exports.extensions[match[1].toLowerCase()]
+
+ if (!exts || !exts.length) {
+ return false
+ }
+
+ return exts[0]
+}
+
+/**
+ * Lookup the MIME type for a file path/extension.
+ *
+ * @param {string} path
+ * @return {boolean|string}
+ */
+
+function lookup(path) {
+ if (!path || typeof path !== 'string') {
+ return false
+ }
+
+ // get the extension ("ext" or ".ext" or full path)
+ var extension = extname('x.' + path)
+ .toLowerCase()
+ .substr(1)
+
+ if (!extension) {
+ return false
+ }
+
+ return exports.types[extension] || false
+}
+
+/**
+ * Populate the extensions and types maps.
+ * @private
+ */
+
+function populateMaps(extensions, types) {
+ // source preference (least -> most)
+ var preference = ['nginx', 'apache', undefined, 'iana']
+
+ Object.keys(db).forEach(function forEachMimeType(type) {
+ var mime = db[type]
+ var exts = mime.extensions
+
+ if (!exts || !exts.length) {
+ return
+ }
+
+ // mime -> extensions
+ extensions[type] = exts
+
+ // extension -> mime
+ for (var i = 0; i < exts.length; i++) {
+ var extension = exts[i]
+
+ if (types[extension]) {
+ var from = preference.indexOf(db[types[extension]].source)
+ var to = preference.indexOf(mime.source)
+
+ if (types[extension] !== 'application/octet-stream'
+ && from > to || (from === to && types[extension].substr(0, 12) === 'application/')) {
+ // skip the remapping
+ return
+ }
+ }
+
+ // set the extension -> mime
+ types[extension] = type
+ }
+ })
+}
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/HISTORY.md b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/HISTORY.md
new file mode 100644
index 00000000000..415a8cf6c6a
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/HISTORY.md
@@ -0,0 +1,228 @@
+1.13.0 / 2015-06-07
+===================
+
+ * Add nginx as a source
+ * Add `application/x-cocoa`
+ * Add `application/x-java-archive-diff`
+ * Add `application/x-makeself`
+ * Add `application/x-perl`
+ * Add `application/x-pilot`
+ * Add `application/x-redhat-package-manager`
+ * Add `application/x-sea`
+ * Add `audio/x-m4a`
+ * Add `audio/x-realaudio`
+ * Add `image/x-jng`
+ * Add `text/mathml`
+
+1.12.0 / 2015-06-05
+===================
+
+ * Add `application/bdoc`
+ * Add `application/vnd.hyperdrive+json`
+ * Add `application/x-bdoc`
+ * Add extension `.rtf` to `text/rtf`
+
+1.11.0 / 2015-05-31
+===================
+
+ * Add `audio/wav`
+ * Add `audio/wave`
+ * Add extension `.litcoffee` to `text/coffeescript`
+ * Add extension `.sfd-hdstx` to `application/vnd.hydrostatix.sof-data`
+ * Add extension `.n-gage` to `application/vnd.nokia.n-gage.symbian.install`
+
+1.10.0 / 2015-05-19
+===================
+
+ * Add `application/vnd.balsamiq.bmpr`
+ * Add `application/vnd.microsoft.portable-executable`
+ * Add `application/x-ns-proxy-autoconfig`
+
+1.9.1 / 2015-04-19
+==================
+
+ * Remove `.json` extension from `application/manifest+json`
+ - This is causing bugs downstream
+
+1.9.0 / 2015-04-19
+==================
+
+ * Add `application/manifest+json`
+ * Add `application/vnd.micro+json`
+ * Add `image/vnd.zbrush.pcx`
+ * Add `image/x-ms-bmp`
+
+1.8.0 / 2015-03-13
+==================
+
+ * Add `application/vnd.citationstyles.style+xml`
+ * Add `application/vnd.fastcopy-disk-image`
+ * Add `application/vnd.gov.sk.xmldatacontainer+xml`
+ * Add extension `.jsonld` to `application/ld+json`
+
+1.7.0 / 2015-02-08
+==================
+
+ * Add `application/vnd.gerber`
+ * Add `application/vnd.msa-disk-image`
+
+1.6.1 / 2015-02-05
+==================
+
+ * Community extensions ownership transferred from `node-mime`
+
+1.6.0 / 2015-01-29
+==================
+
+ * Add `application/jose`
+ * Add `application/jose+json`
+ * Add `application/json-seq`
+ * Add `application/jwk+json`
+ * Add `application/jwk-set+json`
+ * Add `application/jwt`
+ * Add `application/rdap+json`
+ * Add `application/vnd.gov.sk.e-form+xml`
+ * Add `application/vnd.ims.imsccv1p3`
+
+1.5.0 / 2014-12-30
+==================
+
+ * Add `application/vnd.oracle.resource+json`
+ * Fix various invalid MIME type entries
+ - `application/mbox+xml`
+ - `application/oscp-response`
+ - `application/vwg-multiplexed`
+ - `audio/g721`
+
+1.4.0 / 2014-12-21
+==================
+
+ * Add `application/vnd.ims.imsccv1p2`
+ * Fix various invalid MIME type entries
+ - `application/vnd-acucobol`
+ - `application/vnd-curl`
+ - `application/vnd-dart`
+ - `application/vnd-dxr`
+ - `application/vnd-fdf`
+ - `application/vnd-mif`
+ - `application/vnd-sema`
+ - `application/vnd-wap-wmlc`
+ - `application/vnd.adobe.flash-movie`
+ - `application/vnd.dece-zip`
+ - `application/vnd.dvb_service`
+ - `application/vnd.micrografx-igx`
+ - `application/vnd.sealed-doc`
+ - `application/vnd.sealed-eml`
+ - `application/vnd.sealed-mht`
+ - `application/vnd.sealed-ppt`
+ - `application/vnd.sealed-tiff`
+ - `application/vnd.sealed-xls`
+ - `application/vnd.sealedmedia.softseal-html`
+ - `application/vnd.sealedmedia.softseal-pdf`
+ - `application/vnd.wap-slc`
+ - `application/vnd.wap-wbxml`
+ - `audio/vnd.sealedmedia.softseal-mpeg`
+ - `image/vnd-djvu`
+ - `image/vnd-svf`
+ - `image/vnd-wap-wbmp`
+ - `image/vnd.sealed-png`
+ - `image/vnd.sealedmedia.softseal-gif`
+ - `image/vnd.sealedmedia.softseal-jpg`
+ - `model/vnd-dwf`
+ - `model/vnd.parasolid.transmit-binary`
+ - `model/vnd.parasolid.transmit-text`
+ - `text/vnd-a`
+ - `text/vnd-curl`
+ - `text/vnd.wap-wml`
+ * Remove example template MIME types
+ - `application/example`
+ - `audio/example`
+ - `image/example`
+ - `message/example`
+ - `model/example`
+ - `multipart/example`
+ - `text/example`
+ - `video/example`
+
+1.3.1 / 2014-12-16
+==================
+
+ * Fix missing extensions
+ - `application/json5`
+ - `text/hjson`
+
+1.3.0 / 2014-12-07
+==================
+
+ * Add `application/a2l`
+ * Add `application/aml`
+ * Add `application/atfx`
+ * Add `application/atxml`
+ * Add `application/cdfx+xml`
+ * Add `application/dii`
+ * Add `application/json5`
+ * Add `application/lxf`
+ * Add `application/mf4`
+ * Add `application/vnd.apache.thrift.compact`
+ * Add `application/vnd.apache.thrift.json`
+ * Add `application/vnd.coffeescript`
+ * Add `application/vnd.enphase.envoy`
+ * Add `application/vnd.ims.imsccv1p1`
+ * Add `text/csv-schema`
+ * Add `text/hjson`
+ * Add `text/markdown`
+ * Add `text/yaml`
+
+1.2.0 / 2014-11-09
+==================
+
+ * Add `application/cea`
+ * Add `application/dit`
+ * Add `application/vnd.gov.sk.e-form+zip`
+ * Add `application/vnd.tmd.mediaflex.api+xml`
+ * Type `application/epub+zip` is now IANA-registered
+
+1.1.2 / 2014-10-23
+==================
+
+ * Rebuild database for `application/x-www-form-urlencoded` change
+
+1.1.1 / 2014-10-20
+==================
+
+ * Mark `application/x-www-form-urlencoded` as compressible.
+
+1.1.0 / 2014-09-28
+==================
+
+ * Add `application/font-woff2`
+
+1.0.3 / 2014-09-25
+==================
+
+ * Fix engine requirement in package
+
+1.0.2 / 2014-09-25
+==================
+
+ * Add `application/coap-group+json`
+ * Add `application/dcd`
+ * Add `application/vnd.apache.thrift.binary`
+ * Add `image/vnd.tencent.tap`
+ * Mark all JSON-derived types as compressible
+ * Update `text/vtt` data
+
+1.0.1 / 2014-08-30
+==================
+
+ * Fix extension ordering
+
+1.0.0 / 2014-08-30
+==================
+
+ * Add `application/atf`
+ * Add `application/merge-patch+json`
+ * Add `multipart/x-mixed-replace`
+ * Add `source: 'apache'` metadata
+ * Add `source: 'iana'` metadata
+ * Remove badly-assumed charset data
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/LICENSE b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/LICENSE
new file mode 100644
index 00000000000..a7ae8ee9b8a
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/LICENSE
@@ -0,0 +1,22 @@
+
+The MIT License (MIT)
+
+Copyright (c) 2014 Jonathan Ong me@jongleberry.com
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/README.md b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/README.md
new file mode 100644
index 00000000000..faf387f962f
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/README.md
@@ -0,0 +1,82 @@
+# mime-db
+
+[![NPM Version][npm-version-image]][npm-url]
+[![NPM Downloads][npm-downloads-image]][npm-url]
+[![Node.js Version][node-image]][node-url]
+[![Build Status][travis-image]][travis-url]
+[![Coverage Status][coveralls-image]][coveralls-url]
+
+This is a database of all mime types.
+It consists of a single, public JSON file and does not include any logic,
+allowing it to remain as un-opinionated as possible with an API.
+It aggregates data from the following sources:
+
+- http://www.iana.org/assignments/media-types/media-types.xhtml
+- http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
+- http://hg.nginx.org/nginx/raw-file/default/conf/mime.types
+
+## Installation
+
+```bash
+npm install mime-db
+```
+
+### Database Download
+
+If you're crazy enough to use this in the browser, you can just grab the
+JSON file using [RawGit](https://rawgit.com/). It is recommended to replace
+`master` with [a release tag](https://github.com/jshttp/mime-db/tags) as the
+JSON format may change in the future.
+
+```
+https://cdn.rawgit.com/jshttp/mime-db/master/db.json
+```
+
+## Usage
+
+```js
+var db = require('mime-db');
+
+// grab data on .js files
+var data = db['application/javascript'];
+```
+
+## Data Structure
+
+The JSON file is a map lookup for lowercased mime types.
+Each mime type has the following properties:
+
+- `.source` - where the mime type is defined.
+ If not set, it's probably a custom media type.
+ - `apache` - [Apache common media types](http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types)
+ - `iana` - [IANA-defined media types](http://www.iana.org/assignments/media-types/media-types.xhtml)
+ - `nginx` - [nginx media types](http://hg.nginx.org/nginx/raw-file/default/conf/mime.types)
+- `.extensions[]` - known extensions associated with this mime type.
+- `.compressible` - whether a file of this type is can be gzipped.
+- `.charset` - the default charset associated with this type, if any.
+
+If unknown, every property could be `undefined`.
+
+## Contributing
+
+To edit the database, only make PRs against `src/custom.json` or
+`src/custom-suffix.json`.
+
+To update the build, run `npm run update`.
+
+## Adding Custom Media Types
+
+The best way to get new media types included in this library is to register
+them with the IANA. The community registration procedure is outlined in
+[RFC 6838 section 5](http://tools.ietf.org/html/rfc6838#section-5). Types
+registered with the IANA are automatically pulled into this library.
+
+[npm-version-image]: https://img.shields.io/npm/v/mime-db.svg
+[npm-downloads-image]: https://img.shields.io/npm/dm/mime-db.svg
+[npm-url]: https://npmjs.org/package/mime-db
+[travis-image]: https://img.shields.io/travis/jshttp/mime-db/master.svg
+[travis-url]: https://travis-ci.org/jshttp/mime-db
+[coveralls-image]: https://img.shields.io/coveralls/jshttp/mime-db/master.svg
+[coveralls-url]: https://coveralls.io/r/jshttp/mime-db?branch=master
+[node-image]: https://img.shields.io/node/v/mime-db.svg
+[node-url]: http://nodejs.org/download/
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/db.json b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/db.json
new file mode 100644
index 00000000000..27cb4a1b086
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/db.json
@@ -0,0 +1,6406 @@
+{
+ "application/1d-interleaved-parityfec": {
+ "source": "iana"
+ },
+ "application/3gpdash-qoe-report+xml": {
+ "source": "iana"
+ },
+ "application/3gpp-ims+xml": {
+ "source": "iana"
+ },
+ "application/a2l": {
+ "source": "iana"
+ },
+ "application/activemessage": {
+ "source": "iana"
+ },
+ "application/alto-costmap+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/alto-costmapfilter+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/alto-directory+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/alto-endpointcost+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/alto-endpointcostparams+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/alto-endpointprop+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/alto-endpointpropparams+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/alto-error+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/alto-networkmap+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/alto-networkmapfilter+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/aml": {
+ "source": "iana"
+ },
+ "application/andrew-inset": {
+ "source": "iana",
+ "extensions": ["ez"]
+ },
+ "application/applefile": {
+ "source": "iana"
+ },
+ "application/applixware": {
+ "source": "apache",
+ "extensions": ["aw"]
+ },
+ "application/atf": {
+ "source": "iana"
+ },
+ "application/atfx": {
+ "source": "iana"
+ },
+ "application/atom+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["atom"]
+ },
+ "application/atomcat+xml": {
+ "source": "iana",
+ "extensions": ["atomcat"]
+ },
+ "application/atomdeleted+xml": {
+ "source": "iana"
+ },
+ "application/atomicmail": {
+ "source": "iana"
+ },
+ "application/atomsvc+xml": {
+ "source": "iana",
+ "extensions": ["atomsvc"]
+ },
+ "application/atxml": {
+ "source": "iana"
+ },
+ "application/auth-policy+xml": {
+ "source": "iana"
+ },
+ "application/bacnet-xdd+zip": {
+ "source": "iana"
+ },
+ "application/batch-smtp": {
+ "source": "iana"
+ },
+ "application/bdoc": {
+ "compressible": false,
+ "extensions": ["bdoc"]
+ },
+ "application/beep+xml": {
+ "source": "iana"
+ },
+ "application/calendar+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/calendar+xml": {
+ "source": "iana"
+ },
+ "application/call-completion": {
+ "source": "iana"
+ },
+ "application/cals-1840": {
+ "source": "iana"
+ },
+ "application/cbor": {
+ "source": "iana"
+ },
+ "application/ccmp+xml": {
+ "source": "iana"
+ },
+ "application/ccxml+xml": {
+ "source": "iana",
+ "extensions": ["ccxml"]
+ },
+ "application/cdfx+xml": {
+ "source": "iana"
+ },
+ "application/cdmi-capability": {
+ "source": "iana",
+ "extensions": ["cdmia"]
+ },
+ "application/cdmi-container": {
+ "source": "iana",
+ "extensions": ["cdmic"]
+ },
+ "application/cdmi-domain": {
+ "source": "iana",
+ "extensions": ["cdmid"]
+ },
+ "application/cdmi-object": {
+ "source": "iana",
+ "extensions": ["cdmio"]
+ },
+ "application/cdmi-queue": {
+ "source": "iana",
+ "extensions": ["cdmiq"]
+ },
+ "application/cea": {
+ "source": "iana"
+ },
+ "application/cea-2018+xml": {
+ "source": "iana"
+ },
+ "application/cellml+xml": {
+ "source": "iana"
+ },
+ "application/cfw": {
+ "source": "iana"
+ },
+ "application/cms": {
+ "source": "iana"
+ },
+ "application/cnrp+xml": {
+ "source": "iana"
+ },
+ "application/coap-group+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/commonground": {
+ "source": "iana"
+ },
+ "application/conference-info+xml": {
+ "source": "iana"
+ },
+ "application/cpl+xml": {
+ "source": "iana"
+ },
+ "application/csrattrs": {
+ "source": "iana"
+ },
+ "application/csta+xml": {
+ "source": "iana"
+ },
+ "application/cstadata+xml": {
+ "source": "iana"
+ },
+ "application/cu-seeme": {
+ "source": "apache",
+ "extensions": ["cu"]
+ },
+ "application/cybercash": {
+ "source": "iana"
+ },
+ "application/dart": {
+ "compressible": true
+ },
+ "application/dash+xml": {
+ "source": "iana",
+ "extensions": ["mdp"]
+ },
+ "application/dashdelta": {
+ "source": "iana"
+ },
+ "application/davmount+xml": {
+ "source": "iana",
+ "extensions": ["davmount"]
+ },
+ "application/dca-rft": {
+ "source": "iana"
+ },
+ "application/dcd": {
+ "source": "iana"
+ },
+ "application/dec-dx": {
+ "source": "iana"
+ },
+ "application/dialog-info+xml": {
+ "source": "iana"
+ },
+ "application/dicom": {
+ "source": "iana"
+ },
+ "application/dii": {
+ "source": "iana"
+ },
+ "application/dit": {
+ "source": "iana"
+ },
+ "application/dns": {
+ "source": "iana"
+ },
+ "application/docbook+xml": {
+ "source": "apache",
+ "extensions": ["dbk"]
+ },
+ "application/dskpp+xml": {
+ "source": "iana"
+ },
+ "application/dssc+der": {
+ "source": "iana",
+ "extensions": ["dssc"]
+ },
+ "application/dssc+xml": {
+ "source": "iana",
+ "extensions": ["xdssc"]
+ },
+ "application/dvcs": {
+ "source": "iana"
+ },
+ "application/ecmascript": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["ecma"]
+ },
+ "application/edi-consent": {
+ "source": "iana"
+ },
+ "application/edi-x12": {
+ "source": "iana",
+ "compressible": false
+ },
+ "application/edifact": {
+ "source": "iana",
+ "compressible": false
+ },
+ "application/emma+xml": {
+ "source": "iana",
+ "extensions": ["emma"]
+ },
+ "application/emotionml+xml": {
+ "source": "iana"
+ },
+ "application/encaprtp": {
+ "source": "iana"
+ },
+ "application/epp+xml": {
+ "source": "iana"
+ },
+ "application/epub+zip": {
+ "source": "iana",
+ "extensions": ["epub"]
+ },
+ "application/eshop": {
+ "source": "iana"
+ },
+ "application/exi": {
+ "source": "iana",
+ "extensions": ["exi"]
+ },
+ "application/fastinfoset": {
+ "source": "iana"
+ },
+ "application/fastsoap": {
+ "source": "iana"
+ },
+ "application/fdt+xml": {
+ "source": "iana"
+ },
+ "application/fits": {
+ "source": "iana"
+ },
+ "application/font-sfnt": {
+ "source": "iana"
+ },
+ "application/font-tdpfr": {
+ "source": "iana",
+ "extensions": ["pfr"]
+ },
+ "application/font-woff": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["woff"]
+ },
+ "application/font-woff2": {
+ "compressible": false,
+ "extensions": ["woff2"]
+ },
+ "application/framework-attributes+xml": {
+ "source": "iana"
+ },
+ "application/gml+xml": {
+ "source": "apache",
+ "extensions": ["gml"]
+ },
+ "application/gpx+xml": {
+ "source": "apache",
+ "extensions": ["gpx"]
+ },
+ "application/gxf": {
+ "source": "apache",
+ "extensions": ["gxf"]
+ },
+ "application/gzip": {
+ "source": "iana",
+ "compressible": false
+ },
+ "application/h224": {
+ "source": "iana"
+ },
+ "application/held+xml": {
+ "source": "iana"
+ },
+ "application/http": {
+ "source": "iana"
+ },
+ "application/hyperstudio": {
+ "source": "iana",
+ "extensions": ["stk"]
+ },
+ "application/ibe-key-request+xml": {
+ "source": "iana"
+ },
+ "application/ibe-pkg-reply+xml": {
+ "source": "iana"
+ },
+ "application/ibe-pp-data": {
+ "source": "iana"
+ },
+ "application/iges": {
+ "source": "iana"
+ },
+ "application/im-iscomposing+xml": {
+ "source": "iana"
+ },
+ "application/index": {
+ "source": "iana"
+ },
+ "application/index.cmd": {
+ "source": "iana"
+ },
+ "application/index.obj": {
+ "source": "iana"
+ },
+ "application/index.response": {
+ "source": "iana"
+ },
+ "application/index.vnd": {
+ "source": "iana"
+ },
+ "application/inkml+xml": {
+ "source": "iana",
+ "extensions": ["ink","inkml"]
+ },
+ "application/iotp": {
+ "source": "iana"
+ },
+ "application/ipfix": {
+ "source": "iana",
+ "extensions": ["ipfix"]
+ },
+ "application/ipp": {
+ "source": "iana"
+ },
+ "application/isup": {
+ "source": "iana"
+ },
+ "application/its+xml": {
+ "source": "iana"
+ },
+ "application/java-archive": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["jar","war","ear"]
+ },
+ "application/java-serialized-object": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["ser"]
+ },
+ "application/java-vm": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["class"]
+ },
+ "application/javascript": {
+ "source": "iana",
+ "charset": "UTF-8",
+ "compressible": true,
+ "extensions": ["js"]
+ },
+ "application/jose": {
+ "source": "iana"
+ },
+ "application/jose+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/jrd+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/json": {
+ "source": "iana",
+ "charset": "UTF-8",
+ "compressible": true,
+ "extensions": ["json","map"]
+ },
+ "application/json-patch+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/json-seq": {
+ "source": "iana"
+ },
+ "application/json5": {
+ "extensions": ["json5"]
+ },
+ "application/jsonml+json": {
+ "source": "apache",
+ "compressible": true,
+ "extensions": ["jsonml"]
+ },
+ "application/jwk+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/jwk-set+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/jwt": {
+ "source": "iana"
+ },
+ "application/kpml-request+xml": {
+ "source": "iana"
+ },
+ "application/kpml-response+xml": {
+ "source": "iana"
+ },
+ "application/ld+json": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["jsonld"]
+ },
+ "application/link-format": {
+ "source": "iana"
+ },
+ "application/load-control+xml": {
+ "source": "iana"
+ },
+ "application/lost+xml": {
+ "source": "iana",
+ "extensions": ["lostxml"]
+ },
+ "application/lostsync+xml": {
+ "source": "iana"
+ },
+ "application/lxf": {
+ "source": "iana"
+ },
+ "application/mac-binhex40": {
+ "source": "iana",
+ "extensions": ["hqx"]
+ },
+ "application/mac-compactpro": {
+ "source": "apache",
+ "extensions": ["cpt"]
+ },
+ "application/macwriteii": {
+ "source": "iana"
+ },
+ "application/mads+xml": {
+ "source": "iana",
+ "extensions": ["mads"]
+ },
+ "application/manifest+json": {
+ "charset": "UTF-8",
+ "compressible": true,
+ "extensions": ["webmanifest"]
+ },
+ "application/marc": {
+ "source": "iana",
+ "extensions": ["mrc"]
+ },
+ "application/marcxml+xml": {
+ "source": "iana",
+ "extensions": ["mrcx"]
+ },
+ "application/mathematica": {
+ "source": "iana",
+ "extensions": ["ma","nb","mb"]
+ },
+ "application/mathml+xml": {
+ "source": "iana",
+ "extensions": ["mathml"]
+ },
+ "application/mathml-content+xml": {
+ "source": "iana"
+ },
+ "application/mathml-presentation+xml": {
+ "source": "iana"
+ },
+ "application/mbms-associated-procedure-description+xml": {
+ "source": "iana"
+ },
+ "application/mbms-deregister+xml": {
+ "source": "iana"
+ },
+ "application/mbms-envelope+xml": {
+ "source": "iana"
+ },
+ "application/mbms-msk+xml": {
+ "source": "iana"
+ },
+ "application/mbms-msk-response+xml": {
+ "source": "iana"
+ },
+ "application/mbms-protection-description+xml": {
+ "source": "iana"
+ },
+ "application/mbms-reception-report+xml": {
+ "source": "iana"
+ },
+ "application/mbms-register+xml": {
+ "source": "iana"
+ },
+ "application/mbms-register-response+xml": {
+ "source": "iana"
+ },
+ "application/mbms-schedule+xml": {
+ "source": "iana"
+ },
+ "application/mbms-user-service-description+xml": {
+ "source": "iana"
+ },
+ "application/mbox": {
+ "source": "iana",
+ "extensions": ["mbox"]
+ },
+ "application/media-policy-dataset+xml": {
+ "source": "iana"
+ },
+ "application/media_control+xml": {
+ "source": "iana"
+ },
+ "application/mediaservercontrol+xml": {
+ "source": "iana",
+ "extensions": ["mscml"]
+ },
+ "application/merge-patch+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/metalink+xml": {
+ "source": "apache",
+ "extensions": ["metalink"]
+ },
+ "application/metalink4+xml": {
+ "source": "iana",
+ "extensions": ["meta4"]
+ },
+ "application/mets+xml": {
+ "source": "iana",
+ "extensions": ["mets"]
+ },
+ "application/mf4": {
+ "source": "iana"
+ },
+ "application/mikey": {
+ "source": "iana"
+ },
+ "application/mods+xml": {
+ "source": "iana",
+ "extensions": ["mods"]
+ },
+ "application/moss-keys": {
+ "source": "iana"
+ },
+ "application/moss-signature": {
+ "source": "iana"
+ },
+ "application/mosskey-data": {
+ "source": "iana"
+ },
+ "application/mosskey-request": {
+ "source": "iana"
+ },
+ "application/mp21": {
+ "source": "iana",
+ "extensions": ["m21","mp21"]
+ },
+ "application/mp4": {
+ "source": "iana",
+ "extensions": ["mp4s","m4p"]
+ },
+ "application/mpeg4-generic": {
+ "source": "iana"
+ },
+ "application/mpeg4-iod": {
+ "source": "iana"
+ },
+ "application/mpeg4-iod-xmt": {
+ "source": "iana"
+ },
+ "application/mrb-consumer+xml": {
+ "source": "iana"
+ },
+ "application/mrb-publish+xml": {
+ "source": "iana"
+ },
+ "application/msc-ivr+xml": {
+ "source": "iana"
+ },
+ "application/msc-mixer+xml": {
+ "source": "iana"
+ },
+ "application/msword": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["doc","dot"]
+ },
+ "application/mxf": {
+ "source": "iana",
+ "extensions": ["mxf"]
+ },
+ "application/nasdata": {
+ "source": "iana"
+ },
+ "application/news-checkgroups": {
+ "source": "iana"
+ },
+ "application/news-groupinfo": {
+ "source": "iana"
+ },
+ "application/news-transmission": {
+ "source": "iana"
+ },
+ "application/nlsml+xml": {
+ "source": "iana"
+ },
+ "application/nss": {
+ "source": "iana"
+ },
+ "application/ocsp-request": {
+ "source": "iana"
+ },
+ "application/ocsp-response": {
+ "source": "iana"
+ },
+ "application/octet-stream": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]
+ },
+ "application/oda": {
+ "source": "iana",
+ "extensions": ["oda"]
+ },
+ "application/odx": {
+ "source": "iana"
+ },
+ "application/oebps-package+xml": {
+ "source": "iana",
+ "extensions": ["opf"]
+ },
+ "application/ogg": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["ogx"]
+ },
+ "application/omdoc+xml": {
+ "source": "apache",
+ "extensions": ["omdoc"]
+ },
+ "application/onenote": {
+ "source": "apache",
+ "extensions": ["onetoc","onetoc2","onetmp","onepkg"]
+ },
+ "application/oxps": {
+ "source": "iana",
+ "extensions": ["oxps"]
+ },
+ "application/p2p-overlay+xml": {
+ "source": "iana"
+ },
+ "application/parityfec": {
+ "source": "iana"
+ },
+ "application/patch-ops-error+xml": {
+ "source": "iana",
+ "extensions": ["xer"]
+ },
+ "application/pdf": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["pdf"]
+ },
+ "application/pdx": {
+ "source": "iana"
+ },
+ "application/pgp-encrypted": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["pgp"]
+ },
+ "application/pgp-keys": {
+ "source": "iana"
+ },
+ "application/pgp-signature": {
+ "source": "iana",
+ "extensions": ["asc","sig"]
+ },
+ "application/pics-rules": {
+ "source": "apache",
+ "extensions": ["prf"]
+ },
+ "application/pidf+xml": {
+ "source": "iana"
+ },
+ "application/pidf-diff+xml": {
+ "source": "iana"
+ },
+ "application/pkcs10": {
+ "source": "iana",
+ "extensions": ["p10"]
+ },
+ "application/pkcs7-mime": {
+ "source": "iana",
+ "extensions": ["p7m","p7c"]
+ },
+ "application/pkcs7-signature": {
+ "source": "iana",
+ "extensions": ["p7s"]
+ },
+ "application/pkcs8": {
+ "source": "iana",
+ "extensions": ["p8"]
+ },
+ "application/pkix-attr-cert": {
+ "source": "iana",
+ "extensions": ["ac"]
+ },
+ "application/pkix-cert": {
+ "source": "iana",
+ "extensions": ["cer"]
+ },
+ "application/pkix-crl": {
+ "source": "iana",
+ "extensions": ["crl"]
+ },
+ "application/pkix-pkipath": {
+ "source": "iana",
+ "extensions": ["pkipath"]
+ },
+ "application/pkixcmp": {
+ "source": "iana",
+ "extensions": ["pki"]
+ },
+ "application/pls+xml": {
+ "source": "iana",
+ "extensions": ["pls"]
+ },
+ "application/poc-settings+xml": {
+ "source": "iana"
+ },
+ "application/postscript": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["ai","eps","ps"]
+ },
+ "application/provenance+xml": {
+ "source": "iana"
+ },
+ "application/prs.alvestrand.titrax-sheet": {
+ "source": "iana"
+ },
+ "application/prs.cww": {
+ "source": "iana",
+ "extensions": ["cww"]
+ },
+ "application/prs.hpub+zip": {
+ "source": "iana"
+ },
+ "application/prs.nprend": {
+ "source": "iana"
+ },
+ "application/prs.plucker": {
+ "source": "iana"
+ },
+ "application/prs.rdf-xml-crypt": {
+ "source": "iana"
+ },
+ "application/prs.xsf+xml": {
+ "source": "iana"
+ },
+ "application/pskc+xml": {
+ "source": "iana",
+ "extensions": ["pskcxml"]
+ },
+ "application/qsig": {
+ "source": "iana"
+ },
+ "application/raptorfec": {
+ "source": "iana"
+ },
+ "application/rdap+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/rdf+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["rdf"]
+ },
+ "application/reginfo+xml": {
+ "source": "iana",
+ "extensions": ["rif"]
+ },
+ "application/relax-ng-compact-syntax": {
+ "source": "iana",
+ "extensions": ["rnc"]
+ },
+ "application/remote-printing": {
+ "source": "iana"
+ },
+ "application/reputon+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/resource-lists+xml": {
+ "source": "iana",
+ "extensions": ["rl"]
+ },
+ "application/resource-lists-diff+xml": {
+ "source": "iana",
+ "extensions": ["rld"]
+ },
+ "application/riscos": {
+ "source": "iana"
+ },
+ "application/rlmi+xml": {
+ "source": "iana"
+ },
+ "application/rls-services+xml": {
+ "source": "iana",
+ "extensions": ["rs"]
+ },
+ "application/rpki-ghostbusters": {
+ "source": "iana",
+ "extensions": ["gbr"]
+ },
+ "application/rpki-manifest": {
+ "source": "iana",
+ "extensions": ["mft"]
+ },
+ "application/rpki-roa": {
+ "source": "iana",
+ "extensions": ["roa"]
+ },
+ "application/rpki-updown": {
+ "source": "iana"
+ },
+ "application/rsd+xml": {
+ "source": "apache",
+ "extensions": ["rsd"]
+ },
+ "application/rss+xml": {
+ "source": "apache",
+ "compressible": true,
+ "extensions": ["rss"]
+ },
+ "application/rtf": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["rtf"]
+ },
+ "application/rtploopback": {
+ "source": "iana"
+ },
+ "application/rtx": {
+ "source": "iana"
+ },
+ "application/samlassertion+xml": {
+ "source": "iana"
+ },
+ "application/samlmetadata+xml": {
+ "source": "iana"
+ },
+ "application/sbml+xml": {
+ "source": "iana",
+ "extensions": ["sbml"]
+ },
+ "application/scaip+xml": {
+ "source": "iana"
+ },
+ "application/scvp-cv-request": {
+ "source": "iana",
+ "extensions": ["scq"]
+ },
+ "application/scvp-cv-response": {
+ "source": "iana",
+ "extensions": ["scs"]
+ },
+ "application/scvp-vp-request": {
+ "source": "iana",
+ "extensions": ["spq"]
+ },
+ "application/scvp-vp-response": {
+ "source": "iana",
+ "extensions": ["spp"]
+ },
+ "application/sdp": {
+ "source": "iana",
+ "extensions": ["sdp"]
+ },
+ "application/sep+xml": {
+ "source": "iana"
+ },
+ "application/sep-exi": {
+ "source": "iana"
+ },
+ "application/session-info": {
+ "source": "iana"
+ },
+ "application/set-payment": {
+ "source": "iana"
+ },
+ "application/set-payment-initiation": {
+ "source": "iana",
+ "extensions": ["setpay"]
+ },
+ "application/set-registration": {
+ "source": "iana"
+ },
+ "application/set-registration-initiation": {
+ "source": "iana",
+ "extensions": ["setreg"]
+ },
+ "application/sgml": {
+ "source": "iana"
+ },
+ "application/sgml-open-catalog": {
+ "source": "iana"
+ },
+ "application/shf+xml": {
+ "source": "iana",
+ "extensions": ["shf"]
+ },
+ "application/sieve": {
+ "source": "iana"
+ },
+ "application/simple-filter+xml": {
+ "source": "iana"
+ },
+ "application/simple-message-summary": {
+ "source": "iana"
+ },
+ "application/simplesymbolcontainer": {
+ "source": "iana"
+ },
+ "application/slate": {
+ "source": "iana"
+ },
+ "application/smil": {
+ "source": "iana"
+ },
+ "application/smil+xml": {
+ "source": "iana",
+ "extensions": ["smi","smil"]
+ },
+ "application/smpte336m": {
+ "source": "iana"
+ },
+ "application/soap+fastinfoset": {
+ "source": "iana"
+ },
+ "application/soap+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/sparql-query": {
+ "source": "iana",
+ "extensions": ["rq"]
+ },
+ "application/sparql-results+xml": {
+ "source": "iana",
+ "extensions": ["srx"]
+ },
+ "application/spirits-event+xml": {
+ "source": "iana"
+ },
+ "application/sql": {
+ "source": "iana"
+ },
+ "application/srgs": {
+ "source": "iana",
+ "extensions": ["gram"]
+ },
+ "application/srgs+xml": {
+ "source": "iana",
+ "extensions": ["grxml"]
+ },
+ "application/sru+xml": {
+ "source": "iana",
+ "extensions": ["sru"]
+ },
+ "application/ssdl+xml": {
+ "source": "apache",
+ "extensions": ["ssdl"]
+ },
+ "application/ssml+xml": {
+ "source": "iana",
+ "extensions": ["ssml"]
+ },
+ "application/tamp-apex-update": {
+ "source": "iana"
+ },
+ "application/tamp-apex-update-confirm": {
+ "source": "iana"
+ },
+ "application/tamp-community-update": {
+ "source": "iana"
+ },
+ "application/tamp-community-update-confirm": {
+ "source": "iana"
+ },
+ "application/tamp-error": {
+ "source": "iana"
+ },
+ "application/tamp-sequence-adjust": {
+ "source": "iana"
+ },
+ "application/tamp-sequence-adjust-confirm": {
+ "source": "iana"
+ },
+ "application/tamp-status-query": {
+ "source": "iana"
+ },
+ "application/tamp-status-response": {
+ "source": "iana"
+ },
+ "application/tamp-update": {
+ "source": "iana"
+ },
+ "application/tamp-update-confirm": {
+ "source": "iana"
+ },
+ "application/tar": {
+ "compressible": true
+ },
+ "application/tei+xml": {
+ "source": "iana",
+ "extensions": ["tei","teicorpus"]
+ },
+ "application/thraud+xml": {
+ "source": "iana",
+ "extensions": ["tfi"]
+ },
+ "application/timestamp-query": {
+ "source": "iana"
+ },
+ "application/timestamp-reply": {
+ "source": "iana"
+ },
+ "application/timestamped-data": {
+ "source": "iana",
+ "extensions": ["tsd"]
+ },
+ "application/ttml+xml": {
+ "source": "iana"
+ },
+ "application/tve-trigger": {
+ "source": "iana"
+ },
+ "application/ulpfec": {
+ "source": "iana"
+ },
+ "application/urc-grpsheet+xml": {
+ "source": "iana"
+ },
+ "application/urc-ressheet+xml": {
+ "source": "iana"
+ },
+ "application/urc-targetdesc+xml": {
+ "source": "iana"
+ },
+ "application/urc-uisocketdesc+xml": {
+ "source": "iana"
+ },
+ "application/vcard+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vcard+xml": {
+ "source": "iana"
+ },
+ "application/vemmi": {
+ "source": "iana"
+ },
+ "application/vividence.scriptfile": {
+ "source": "apache"
+ },
+ "application/vnd.3gpp.bsf+xml": {
+ "source": "iana"
+ },
+ "application/vnd.3gpp.pic-bw-large": {
+ "source": "iana",
+ "extensions": ["plb"]
+ },
+ "application/vnd.3gpp.pic-bw-small": {
+ "source": "iana",
+ "extensions": ["psb"]
+ },
+ "application/vnd.3gpp.pic-bw-var": {
+ "source": "iana",
+ "extensions": ["pvb"]
+ },
+ "application/vnd.3gpp.sms": {
+ "source": "iana"
+ },
+ "application/vnd.3gpp2.bcmcsinfo+xml": {
+ "source": "iana"
+ },
+ "application/vnd.3gpp2.sms": {
+ "source": "iana"
+ },
+ "application/vnd.3gpp2.tcap": {
+ "source": "iana",
+ "extensions": ["tcap"]
+ },
+ "application/vnd.3m.post-it-notes": {
+ "source": "iana",
+ "extensions": ["pwn"]
+ },
+ "application/vnd.accpac.simply.aso": {
+ "source": "iana",
+ "extensions": ["aso"]
+ },
+ "application/vnd.accpac.simply.imp": {
+ "source": "iana",
+ "extensions": ["imp"]
+ },
+ "application/vnd.acucobol": {
+ "source": "iana",
+ "extensions": ["acu"]
+ },
+ "application/vnd.acucorp": {
+ "source": "iana",
+ "extensions": ["atc","acutc"]
+ },
+ "application/vnd.adobe.air-application-installer-package+zip": {
+ "source": "apache",
+ "extensions": ["air"]
+ },
+ "application/vnd.adobe.flash.movie": {
+ "source": "iana"
+ },
+ "application/vnd.adobe.formscentral.fcdt": {
+ "source": "iana",
+ "extensions": ["fcdt"]
+ },
+ "application/vnd.adobe.fxp": {
+ "source": "iana",
+ "extensions": ["fxp","fxpl"]
+ },
+ "application/vnd.adobe.partial-upload": {
+ "source": "iana"
+ },
+ "application/vnd.adobe.xdp+xml": {
+ "source": "iana",
+ "extensions": ["xdp"]
+ },
+ "application/vnd.adobe.xfdf": {
+ "source": "iana",
+ "extensions": ["xfdf"]
+ },
+ "application/vnd.aether.imp": {
+ "source": "iana"
+ },
+ "application/vnd.ah-barcode": {
+ "source": "iana"
+ },
+ "application/vnd.ahead.space": {
+ "source": "iana",
+ "extensions": ["ahead"]
+ },
+ "application/vnd.airzip.filesecure.azf": {
+ "source": "iana",
+ "extensions": ["azf"]
+ },
+ "application/vnd.airzip.filesecure.azs": {
+ "source": "iana",
+ "extensions": ["azs"]
+ },
+ "application/vnd.amazon.ebook": {
+ "source": "apache",
+ "extensions": ["azw"]
+ },
+ "application/vnd.americandynamics.acc": {
+ "source": "iana",
+ "extensions": ["acc"]
+ },
+ "application/vnd.amiga.ami": {
+ "source": "iana",
+ "extensions": ["ami"]
+ },
+ "application/vnd.amundsen.maze+xml": {
+ "source": "iana"
+ },
+ "application/vnd.android.package-archive": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["apk"]
+ },
+ "application/vnd.anser-web-certificate-issue-initiation": {
+ "source": "iana",
+ "extensions": ["cii"]
+ },
+ "application/vnd.anser-web-funds-transfer-initiation": {
+ "source": "apache",
+ "extensions": ["fti"]
+ },
+ "application/vnd.antix.game-component": {
+ "source": "iana",
+ "extensions": ["atx"]
+ },
+ "application/vnd.apache.thrift.binary": {
+ "source": "iana"
+ },
+ "application/vnd.apache.thrift.compact": {
+ "source": "iana"
+ },
+ "application/vnd.apache.thrift.json": {
+ "source": "iana"
+ },
+ "application/vnd.api+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.apple.installer+xml": {
+ "source": "iana",
+ "extensions": ["mpkg"]
+ },
+ "application/vnd.apple.mpegurl": {
+ "source": "iana",
+ "extensions": ["m3u8"]
+ },
+ "application/vnd.arastra.swi": {
+ "source": "iana"
+ },
+ "application/vnd.aristanetworks.swi": {
+ "source": "iana",
+ "extensions": ["swi"]
+ },
+ "application/vnd.artsquare": {
+ "source": "iana"
+ },
+ "application/vnd.astraea-software.iota": {
+ "source": "iana",
+ "extensions": ["iota"]
+ },
+ "application/vnd.audiograph": {
+ "source": "iana",
+ "extensions": ["aep"]
+ },
+ "application/vnd.autopackage": {
+ "source": "iana"
+ },
+ "application/vnd.avistar+xml": {
+ "source": "iana"
+ },
+ "application/vnd.balsamiq.bmml+xml": {
+ "source": "iana"
+ },
+ "application/vnd.balsamiq.bmpr": {
+ "source": "iana"
+ },
+ "application/vnd.bekitzur-stech+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.blueice.multipass": {
+ "source": "iana",
+ "extensions": ["mpm"]
+ },
+ "application/vnd.bluetooth.ep.oob": {
+ "source": "iana"
+ },
+ "application/vnd.bluetooth.le.oob": {
+ "source": "iana"
+ },
+ "application/vnd.bmi": {
+ "source": "iana",
+ "extensions": ["bmi"]
+ },
+ "application/vnd.businessobjects": {
+ "source": "iana",
+ "extensions": ["rep"]
+ },
+ "application/vnd.cab-jscript": {
+ "source": "iana"
+ },
+ "application/vnd.canon-cpdl": {
+ "source": "iana"
+ },
+ "application/vnd.canon-lips": {
+ "source": "iana"
+ },
+ "application/vnd.cendio.thinlinc.clientconf": {
+ "source": "iana"
+ },
+ "application/vnd.century-systems.tcp_stream": {
+ "source": "iana"
+ },
+ "application/vnd.chemdraw+xml": {
+ "source": "iana",
+ "extensions": ["cdxml"]
+ },
+ "application/vnd.chipnuts.karaoke-mmd": {
+ "source": "iana",
+ "extensions": ["mmd"]
+ },
+ "application/vnd.cinderella": {
+ "source": "iana",
+ "extensions": ["cdy"]
+ },
+ "application/vnd.cirpack.isdn-ext": {
+ "source": "iana"
+ },
+ "application/vnd.citationstyles.style+xml": {
+ "source": "iana"
+ },
+ "application/vnd.claymore": {
+ "source": "iana",
+ "extensions": ["cla"]
+ },
+ "application/vnd.cloanto.rp9": {
+ "source": "iana",
+ "extensions": ["rp9"]
+ },
+ "application/vnd.clonk.c4group": {
+ "source": "iana",
+ "extensions": ["c4g","c4d","c4f","c4p","c4u"]
+ },
+ "application/vnd.cluetrust.cartomobile-config": {
+ "source": "iana",
+ "extensions": ["c11amc"]
+ },
+ "application/vnd.cluetrust.cartomobile-config-pkg": {
+ "source": "iana",
+ "extensions": ["c11amz"]
+ },
+ "application/vnd.coffeescript": {
+ "source": "iana"
+ },
+ "application/vnd.collection+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.collection.doc+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.collection.next+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.commerce-battelle": {
+ "source": "iana"
+ },
+ "application/vnd.commonspace": {
+ "source": "iana",
+ "extensions": ["csp"]
+ },
+ "application/vnd.contact.cmsg": {
+ "source": "iana",
+ "extensions": ["cdbcmsg"]
+ },
+ "application/vnd.cosmocaller": {
+ "source": "iana",
+ "extensions": ["cmc"]
+ },
+ "application/vnd.crick.clicker": {
+ "source": "iana",
+ "extensions": ["clkx"]
+ },
+ "application/vnd.crick.clicker.keyboard": {
+ "source": "iana",
+ "extensions": ["clkk"]
+ },
+ "application/vnd.crick.clicker.palette": {
+ "source": "iana",
+ "extensions": ["clkp"]
+ },
+ "application/vnd.crick.clicker.template": {
+ "source": "iana",
+ "extensions": ["clkt"]
+ },
+ "application/vnd.crick.clicker.wordbank": {
+ "source": "iana",
+ "extensions": ["clkw"]
+ },
+ "application/vnd.criticaltools.wbs+xml": {
+ "source": "iana",
+ "extensions": ["wbs"]
+ },
+ "application/vnd.ctc-posml": {
+ "source": "iana",
+ "extensions": ["pml"]
+ },
+ "application/vnd.ctct.ws+xml": {
+ "source": "iana"
+ },
+ "application/vnd.cups-pdf": {
+ "source": "iana"
+ },
+ "application/vnd.cups-postscript": {
+ "source": "iana"
+ },
+ "application/vnd.cups-ppd": {
+ "source": "iana",
+ "extensions": ["ppd"]
+ },
+ "application/vnd.cups-raster": {
+ "source": "iana"
+ },
+ "application/vnd.cups-raw": {
+ "source": "iana"
+ },
+ "application/vnd.curl": {
+ "source": "iana"
+ },
+ "application/vnd.curl.car": {
+ "source": "apache",
+ "extensions": ["car"]
+ },
+ "application/vnd.curl.pcurl": {
+ "source": "apache",
+ "extensions": ["pcurl"]
+ },
+ "application/vnd.cyan.dean.root+xml": {
+ "source": "iana"
+ },
+ "application/vnd.cybank": {
+ "source": "iana"
+ },
+ "application/vnd.dart": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["dart"]
+ },
+ "application/vnd.data-vision.rdz": {
+ "source": "iana",
+ "extensions": ["rdz"]
+ },
+ "application/vnd.debian.binary-package": {
+ "source": "iana"
+ },
+ "application/vnd.dece.data": {
+ "source": "iana",
+ "extensions": ["uvf","uvvf","uvd","uvvd"]
+ },
+ "application/vnd.dece.ttml+xml": {
+ "source": "iana",
+ "extensions": ["uvt","uvvt"]
+ },
+ "application/vnd.dece.unspecified": {
+ "source": "iana",
+ "extensions": ["uvx","uvvx"]
+ },
+ "application/vnd.dece.zip": {
+ "source": "iana",
+ "extensions": ["uvz","uvvz"]
+ },
+ "application/vnd.denovo.fcselayout-link": {
+ "source": "iana",
+ "extensions": ["fe_launch"]
+ },
+ "application/vnd.desmume-movie": {
+ "source": "iana"
+ },
+ "application/vnd.dir-bi.plate-dl-nosuffix": {
+ "source": "iana"
+ },
+ "application/vnd.dm.delegation+xml": {
+ "source": "iana"
+ },
+ "application/vnd.dna": {
+ "source": "iana",
+ "extensions": ["dna"]
+ },
+ "application/vnd.document+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.dolby.mlp": {
+ "source": "apache",
+ "extensions": ["mlp"]
+ },
+ "application/vnd.dolby.mobile.1": {
+ "source": "iana"
+ },
+ "application/vnd.dolby.mobile.2": {
+ "source": "iana"
+ },
+ "application/vnd.doremir.scorecloud-binary-document": {
+ "source": "iana"
+ },
+ "application/vnd.dpgraph": {
+ "source": "iana",
+ "extensions": ["dpg"]
+ },
+ "application/vnd.dreamfactory": {
+ "source": "iana",
+ "extensions": ["dfac"]
+ },
+ "application/vnd.ds-keypoint": {
+ "source": "apache",
+ "extensions": ["kpxx"]
+ },
+ "application/vnd.dtg.local": {
+ "source": "iana"
+ },
+ "application/vnd.dtg.local.flash": {
+ "source": "iana"
+ },
+ "application/vnd.dtg.local.html": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.ait": {
+ "source": "iana",
+ "extensions": ["ait"]
+ },
+ "application/vnd.dvb.dvbj": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.esgcontainer": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.ipdcdftnotifaccess": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.ipdcesgaccess": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.ipdcesgaccess2": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.ipdcesgpdd": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.ipdcroaming": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.iptv.alfec-base": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.iptv.alfec-enhancement": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.notif-aggregate-root+xml": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.notif-container+xml": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.notif-generic+xml": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.notif-ia-msglist+xml": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.notif-ia-registration-request+xml": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.notif-ia-registration-response+xml": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.notif-init+xml": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.pfr": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.service": {
+ "source": "iana",
+ "extensions": ["svc"]
+ },
+ "application/vnd.dxr": {
+ "source": "iana"
+ },
+ "application/vnd.dynageo": {
+ "source": "iana",
+ "extensions": ["geo"]
+ },
+ "application/vnd.dzr": {
+ "source": "iana"
+ },
+ "application/vnd.easykaraoke.cdgdownload": {
+ "source": "iana"
+ },
+ "application/vnd.ecdis-update": {
+ "source": "iana"
+ },
+ "application/vnd.ecowin.chart": {
+ "source": "iana",
+ "extensions": ["mag"]
+ },
+ "application/vnd.ecowin.filerequest": {
+ "source": "iana"
+ },
+ "application/vnd.ecowin.fileupdate": {
+ "source": "iana"
+ },
+ "application/vnd.ecowin.series": {
+ "source": "iana"
+ },
+ "application/vnd.ecowin.seriesrequest": {
+ "source": "iana"
+ },
+ "application/vnd.ecowin.seriesupdate": {
+ "source": "iana"
+ },
+ "application/vnd.emclient.accessrequest+xml": {
+ "source": "iana"
+ },
+ "application/vnd.enliven": {
+ "source": "iana",
+ "extensions": ["nml"]
+ },
+ "application/vnd.enphase.envoy": {
+ "source": "iana"
+ },
+ "application/vnd.eprints.data+xml": {
+ "source": "iana"
+ },
+ "application/vnd.epson.esf": {
+ "source": "iana",
+ "extensions": ["esf"]
+ },
+ "application/vnd.epson.msf": {
+ "source": "iana",
+ "extensions": ["msf"]
+ },
+ "application/vnd.epson.quickanime": {
+ "source": "iana",
+ "extensions": ["qam"]
+ },
+ "application/vnd.epson.salt": {
+ "source": "iana",
+ "extensions": ["slt"]
+ },
+ "application/vnd.epson.ssf": {
+ "source": "iana",
+ "extensions": ["ssf"]
+ },
+ "application/vnd.ericsson.quickcall": {
+ "source": "iana"
+ },
+ "application/vnd.eszigno3+xml": {
+ "source": "iana",
+ "extensions": ["es3","et3"]
+ },
+ "application/vnd.etsi.aoc+xml": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.asic-e+zip": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.asic-s+zip": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.cug+xml": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.iptvcommand+xml": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.iptvdiscovery+xml": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.iptvprofile+xml": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.iptvsad-bc+xml": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.iptvsad-cod+xml": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.iptvsad-npvr+xml": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.iptvservice+xml": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.iptvsync+xml": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.iptvueprofile+xml": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.mcid+xml": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.mheg5": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.overload-control-policy-dataset+xml": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.pstn+xml": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.sci+xml": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.simservs+xml": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.timestamp-token": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.tsl+xml": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.tsl.der": {
+ "source": "iana"
+ },
+ "application/vnd.eudora.data": {
+ "source": "iana"
+ },
+ "application/vnd.ezpix-album": {
+ "source": "iana",
+ "extensions": ["ez2"]
+ },
+ "application/vnd.ezpix-package": {
+ "source": "iana",
+ "extensions": ["ez3"]
+ },
+ "application/vnd.f-secure.mobile": {
+ "source": "iana"
+ },
+ "application/vnd.fastcopy-disk-image": {
+ "source": "iana"
+ },
+ "application/vnd.fdf": {
+ "source": "iana",
+ "extensions": ["fdf"]
+ },
+ "application/vnd.fdsn.mseed": {
+ "source": "iana",
+ "extensions": ["mseed"]
+ },
+ "application/vnd.fdsn.seed": {
+ "source": "iana",
+ "extensions": ["seed","dataless"]
+ },
+ "application/vnd.ffsns": {
+ "source": "iana"
+ },
+ "application/vnd.fints": {
+ "source": "iana"
+ },
+ "application/vnd.flographit": {
+ "source": "iana",
+ "extensions": ["gph"]
+ },
+ "application/vnd.fluxtime.clip": {
+ "source": "iana",
+ "extensions": ["ftc"]
+ },
+ "application/vnd.font-fontforge-sfd": {
+ "source": "iana"
+ },
+ "application/vnd.framemaker": {
+ "source": "iana",
+ "extensions": ["fm","frame","maker","book"]
+ },
+ "application/vnd.frogans.fnc": {
+ "source": "iana",
+ "extensions": ["fnc"]
+ },
+ "application/vnd.frogans.ltf": {
+ "source": "iana",
+ "extensions": ["ltf"]
+ },
+ "application/vnd.fsc.weblaunch": {
+ "source": "iana",
+ "extensions": ["fsc"]
+ },
+ "application/vnd.fujitsu.oasys": {
+ "source": "iana",
+ "extensions": ["oas"]
+ },
+ "application/vnd.fujitsu.oasys2": {
+ "source": "iana",
+ "extensions": ["oa2"]
+ },
+ "application/vnd.fujitsu.oasys3": {
+ "source": "iana",
+ "extensions": ["oa3"]
+ },
+ "application/vnd.fujitsu.oasysgp": {
+ "source": "iana",
+ "extensions": ["fg5"]
+ },
+ "application/vnd.fujitsu.oasysprs": {
+ "source": "iana",
+ "extensions": ["bh2"]
+ },
+ "application/vnd.fujixerox.art-ex": {
+ "source": "iana"
+ },
+ "application/vnd.fujixerox.art4": {
+ "source": "iana"
+ },
+ "application/vnd.fujixerox.ddd": {
+ "source": "iana",
+ "extensions": ["ddd"]
+ },
+ "application/vnd.fujixerox.docuworks": {
+ "source": "iana",
+ "extensions": ["xdw"]
+ },
+ "application/vnd.fujixerox.docuworks.binder": {
+ "source": "iana",
+ "extensions": ["xbd"]
+ },
+ "application/vnd.fujixerox.docuworks.container": {
+ "source": "iana"
+ },
+ "application/vnd.fujixerox.hbpl": {
+ "source": "iana"
+ },
+ "application/vnd.fut-misnet": {
+ "source": "iana"
+ },
+ "application/vnd.fuzzysheet": {
+ "source": "iana",
+ "extensions": ["fzs"]
+ },
+ "application/vnd.genomatix.tuxedo": {
+ "source": "iana",
+ "extensions": ["txd"]
+ },
+ "application/vnd.geo+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.geocube+xml": {
+ "source": "iana"
+ },
+ "application/vnd.geogebra.file": {
+ "source": "iana",
+ "extensions": ["ggb"]
+ },
+ "application/vnd.geogebra.tool": {
+ "source": "iana",
+ "extensions": ["ggt"]
+ },
+ "application/vnd.geometry-explorer": {
+ "source": "iana",
+ "extensions": ["gex","gre"]
+ },
+ "application/vnd.geonext": {
+ "source": "iana",
+ "extensions": ["gxt"]
+ },
+ "application/vnd.geoplan": {
+ "source": "iana",
+ "extensions": ["g2w"]
+ },
+ "application/vnd.geospace": {
+ "source": "iana",
+ "extensions": ["g3w"]
+ },
+ "application/vnd.gerber": {
+ "source": "iana"
+ },
+ "application/vnd.globalplatform.card-content-mgt": {
+ "source": "iana"
+ },
+ "application/vnd.globalplatform.card-content-mgt-response": {
+ "source": "iana"
+ },
+ "application/vnd.gmx": {
+ "source": "iana",
+ "extensions": ["gmx"]
+ },
+ "application/vnd.google-earth.kml+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["kml"]
+ },
+ "application/vnd.google-earth.kmz": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["kmz"]
+ },
+ "application/vnd.gov.sk.e-form+xml": {
+ "source": "iana"
+ },
+ "application/vnd.gov.sk.e-form+zip": {
+ "source": "iana"
+ },
+ "application/vnd.gov.sk.xmldatacontainer+xml": {
+ "source": "iana"
+ },
+ "application/vnd.grafeq": {
+ "source": "iana",
+ "extensions": ["gqf","gqs"]
+ },
+ "application/vnd.gridmp": {
+ "source": "iana"
+ },
+ "application/vnd.groove-account": {
+ "source": "iana",
+ "extensions": ["gac"]
+ },
+ "application/vnd.groove-help": {
+ "source": "iana",
+ "extensions": ["ghf"]
+ },
+ "application/vnd.groove-identity-message": {
+ "source": "iana",
+ "extensions": ["gim"]
+ },
+ "application/vnd.groove-injector": {
+ "source": "iana",
+ "extensions": ["grv"]
+ },
+ "application/vnd.groove-tool-message": {
+ "source": "iana",
+ "extensions": ["gtm"]
+ },
+ "application/vnd.groove-tool-template": {
+ "source": "iana",
+ "extensions": ["tpl"]
+ },
+ "application/vnd.groove-vcard": {
+ "source": "iana",
+ "extensions": ["vcg"]
+ },
+ "application/vnd.hal+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.hal+xml": {
+ "source": "iana",
+ "extensions": ["hal"]
+ },
+ "application/vnd.handheld-entertainment+xml": {
+ "source": "iana",
+ "extensions": ["zmm"]
+ },
+ "application/vnd.hbci": {
+ "source": "iana",
+ "extensions": ["hbci"]
+ },
+ "application/vnd.hcl-bireports": {
+ "source": "iana"
+ },
+ "application/vnd.heroku+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.hhe.lesson-player": {
+ "source": "iana",
+ "extensions": ["les"]
+ },
+ "application/vnd.hp-hpgl": {
+ "source": "iana",
+ "extensions": ["hpgl"]
+ },
+ "application/vnd.hp-hpid": {
+ "source": "iana",
+ "extensions": ["hpid"]
+ },
+ "application/vnd.hp-hps": {
+ "source": "iana",
+ "extensions": ["hps"]
+ },
+ "application/vnd.hp-jlyt": {
+ "source": "iana",
+ "extensions": ["jlt"]
+ },
+ "application/vnd.hp-pcl": {
+ "source": "iana",
+ "extensions": ["pcl"]
+ },
+ "application/vnd.hp-pclxl": {
+ "source": "iana",
+ "extensions": ["pclxl"]
+ },
+ "application/vnd.httphone": {
+ "source": "iana"
+ },
+ "application/vnd.hydrostatix.sof-data": {
+ "source": "iana",
+ "extensions": ["sfd-hdstx"]
+ },
+ "application/vnd.hyperdrive+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.hzn-3d-crossword": {
+ "source": "iana"
+ },
+ "application/vnd.ibm.afplinedata": {
+ "source": "iana"
+ },
+ "application/vnd.ibm.electronic-media": {
+ "source": "iana"
+ },
+ "application/vnd.ibm.minipay": {
+ "source": "iana",
+ "extensions": ["mpy"]
+ },
+ "application/vnd.ibm.modcap": {
+ "source": "iana",
+ "extensions": ["afp","listafp","list3820"]
+ },
+ "application/vnd.ibm.rights-management": {
+ "source": "iana",
+ "extensions": ["irm"]
+ },
+ "application/vnd.ibm.secure-container": {
+ "source": "iana",
+ "extensions": ["sc"]
+ },
+ "application/vnd.iccprofile": {
+ "source": "iana",
+ "extensions": ["icc","icm"]
+ },
+ "application/vnd.ieee.1905": {
+ "source": "iana"
+ },
+ "application/vnd.igloader": {
+ "source": "iana",
+ "extensions": ["igl"]
+ },
+ "application/vnd.immervision-ivp": {
+ "source": "iana",
+ "extensions": ["ivp"]
+ },
+ "application/vnd.immervision-ivu": {
+ "source": "iana",
+ "extensions": ["ivu"]
+ },
+ "application/vnd.ims.imsccv1p1": {
+ "source": "iana"
+ },
+ "application/vnd.ims.imsccv1p2": {
+ "source": "iana"
+ },
+ "application/vnd.ims.imsccv1p3": {
+ "source": "iana"
+ },
+ "application/vnd.ims.lis.v2.result+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.ims.lti.v2.toolconsumerprofile+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.ims.lti.v2.toolproxy+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.ims.lti.v2.toolproxy.id+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.ims.lti.v2.toolsettings+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.ims.lti.v2.toolsettings.simple+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.informedcontrol.rms+xml": {
+ "source": "iana"
+ },
+ "application/vnd.informix-visionary": {
+ "source": "iana"
+ },
+ "application/vnd.infotech.project": {
+ "source": "iana"
+ },
+ "application/vnd.infotech.project+xml": {
+ "source": "iana"
+ },
+ "application/vnd.innopath.wamp.notification": {
+ "source": "iana"
+ },
+ "application/vnd.insors.igm": {
+ "source": "iana",
+ "extensions": ["igm"]
+ },
+ "application/vnd.intercon.formnet": {
+ "source": "iana",
+ "extensions": ["xpw","xpx"]
+ },
+ "application/vnd.intergeo": {
+ "source": "iana",
+ "extensions": ["i2g"]
+ },
+ "application/vnd.intertrust.digibox": {
+ "source": "iana"
+ },
+ "application/vnd.intertrust.nncp": {
+ "source": "iana"
+ },
+ "application/vnd.intu.qbo": {
+ "source": "iana",
+ "extensions": ["qbo"]
+ },
+ "application/vnd.intu.qfx": {
+ "source": "iana",
+ "extensions": ["qfx"]
+ },
+ "application/vnd.iptc.g2.catalogitem+xml": {
+ "source": "iana"
+ },
+ "application/vnd.iptc.g2.conceptitem+xml": {
+ "source": "iana"
+ },
+ "application/vnd.iptc.g2.knowledgeitem+xml": {
+ "source": "iana"
+ },
+ "application/vnd.iptc.g2.newsitem+xml": {
+ "source": "iana"
+ },
+ "application/vnd.iptc.g2.newsmessage+xml": {
+ "source": "iana"
+ },
+ "application/vnd.iptc.g2.packageitem+xml": {
+ "source": "iana"
+ },
+ "application/vnd.iptc.g2.planningitem+xml": {
+ "source": "iana"
+ },
+ "application/vnd.ipunplugged.rcprofile": {
+ "source": "iana",
+ "extensions": ["rcprofile"]
+ },
+ "application/vnd.irepository.package+xml": {
+ "source": "iana",
+ "extensions": ["irp"]
+ },
+ "application/vnd.is-xpr": {
+ "source": "iana",
+ "extensions": ["xpr"]
+ },
+ "application/vnd.isac.fcs": {
+ "source": "iana",
+ "extensions": ["fcs"]
+ },
+ "application/vnd.jam": {
+ "source": "iana",
+ "extensions": ["jam"]
+ },
+ "application/vnd.japannet-directory-service": {
+ "source": "iana"
+ },
+ "application/vnd.japannet-jpnstore-wakeup": {
+ "source": "iana"
+ },
+ "application/vnd.japannet-payment-wakeup": {
+ "source": "iana"
+ },
+ "application/vnd.japannet-registration": {
+ "source": "iana"
+ },
+ "application/vnd.japannet-registration-wakeup": {
+ "source": "iana"
+ },
+ "application/vnd.japannet-setstore-wakeup": {
+ "source": "iana"
+ },
+ "application/vnd.japannet-verification": {
+ "source": "iana"
+ },
+ "application/vnd.japannet-verification-wakeup": {
+ "source": "iana"
+ },
+ "application/vnd.jcp.javame.midlet-rms": {
+ "source": "iana",
+ "extensions": ["rms"]
+ },
+ "application/vnd.jisp": {
+ "source": "iana",
+ "extensions": ["jisp"]
+ },
+ "application/vnd.joost.joda-archive": {
+ "source": "iana",
+ "extensions": ["joda"]
+ },
+ "application/vnd.jsk.isdn-ngn": {
+ "source": "iana"
+ },
+ "application/vnd.kahootz": {
+ "source": "iana",
+ "extensions": ["ktz","ktr"]
+ },
+ "application/vnd.kde.karbon": {
+ "source": "iana",
+ "extensions": ["karbon"]
+ },
+ "application/vnd.kde.kchart": {
+ "source": "iana",
+ "extensions": ["chrt"]
+ },
+ "application/vnd.kde.kformula": {
+ "source": "iana",
+ "extensions": ["kfo"]
+ },
+ "application/vnd.kde.kivio": {
+ "source": "iana",
+ "extensions": ["flw"]
+ },
+ "application/vnd.kde.kontour": {
+ "source": "iana",
+ "extensions": ["kon"]
+ },
+ "application/vnd.kde.kpresenter": {
+ "source": "iana",
+ "extensions": ["kpr","kpt"]
+ },
+ "application/vnd.kde.kspread": {
+ "source": "iana",
+ "extensions": ["ksp"]
+ },
+ "application/vnd.kde.kword": {
+ "source": "iana",
+ "extensions": ["kwd","kwt"]
+ },
+ "application/vnd.kenameaapp": {
+ "source": "iana",
+ "extensions": ["htke"]
+ },
+ "application/vnd.kidspiration": {
+ "source": "iana",
+ "extensions": ["kia"]
+ },
+ "application/vnd.kinar": {
+ "source": "iana",
+ "extensions": ["kne","knp"]
+ },
+ "application/vnd.koan": {
+ "source": "iana",
+ "extensions": ["skp","skd","skt","skm"]
+ },
+ "application/vnd.kodak-descriptor": {
+ "source": "iana",
+ "extensions": ["sse"]
+ },
+ "application/vnd.las.las+xml": {
+ "source": "iana",
+ "extensions": ["lasxml"]
+ },
+ "application/vnd.liberty-request+xml": {
+ "source": "iana"
+ },
+ "application/vnd.llamagraphics.life-balance.desktop": {
+ "source": "iana",
+ "extensions": ["lbd"]
+ },
+ "application/vnd.llamagraphics.life-balance.exchange+xml": {
+ "source": "iana",
+ "extensions": ["lbe"]
+ },
+ "application/vnd.lotus-1-2-3": {
+ "source": "iana",
+ "extensions": ["123"]
+ },
+ "application/vnd.lotus-approach": {
+ "source": "iana",
+ "extensions": ["apr"]
+ },
+ "application/vnd.lotus-freelance": {
+ "source": "iana",
+ "extensions": ["pre"]
+ },
+ "application/vnd.lotus-notes": {
+ "source": "iana",
+ "extensions": ["nsf"]
+ },
+ "application/vnd.lotus-organizer": {
+ "source": "iana",
+ "extensions": ["org"]
+ },
+ "application/vnd.lotus-screencam": {
+ "source": "iana",
+ "extensions": ["scm"]
+ },
+ "application/vnd.lotus-wordpro": {
+ "source": "iana",
+ "extensions": ["lwp"]
+ },
+ "application/vnd.macports.portpkg": {
+ "source": "iana",
+ "extensions": ["portpkg"]
+ },
+ "application/vnd.marlin.drm.actiontoken+xml": {
+ "source": "iana"
+ },
+ "application/vnd.marlin.drm.conftoken+xml": {
+ "source": "iana"
+ },
+ "application/vnd.marlin.drm.license+xml": {
+ "source": "iana"
+ },
+ "application/vnd.marlin.drm.mdcf": {
+ "source": "iana"
+ },
+ "application/vnd.mason+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.maxmind.maxmind-db": {
+ "source": "iana"
+ },
+ "application/vnd.mcd": {
+ "source": "iana",
+ "extensions": ["mcd"]
+ },
+ "application/vnd.medcalcdata": {
+ "source": "iana",
+ "extensions": ["mc1"]
+ },
+ "application/vnd.mediastation.cdkey": {
+ "source": "iana",
+ "extensions": ["cdkey"]
+ },
+ "application/vnd.meridian-slingshot": {
+ "source": "iana"
+ },
+ "application/vnd.mfer": {
+ "source": "iana",
+ "extensions": ["mwf"]
+ },
+ "application/vnd.mfmp": {
+ "source": "iana",
+ "extensions": ["mfm"]
+ },
+ "application/vnd.micro+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.micrografx.flo": {
+ "source": "iana",
+ "extensions": ["flo"]
+ },
+ "application/vnd.micrografx.igx": {
+ "source": "iana",
+ "extensions": ["igx"]
+ },
+ "application/vnd.microsoft.portable-executable": {
+ "source": "iana"
+ },
+ "application/vnd.miele+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.mif": {
+ "source": "iana",
+ "extensions": ["mif"]
+ },
+ "application/vnd.minisoft-hp3000-save": {
+ "source": "iana"
+ },
+ "application/vnd.mitsubishi.misty-guard.trustweb": {
+ "source": "iana"
+ },
+ "application/vnd.mobius.daf": {
+ "source": "iana",
+ "extensions": ["daf"]
+ },
+ "application/vnd.mobius.dis": {
+ "source": "iana",
+ "extensions": ["dis"]
+ },
+ "application/vnd.mobius.mbk": {
+ "source": "iana",
+ "extensions": ["mbk"]
+ },
+ "application/vnd.mobius.mqy": {
+ "source": "iana",
+ "extensions": ["mqy"]
+ },
+ "application/vnd.mobius.msl": {
+ "source": "iana",
+ "extensions": ["msl"]
+ },
+ "application/vnd.mobius.plc": {
+ "source": "iana",
+ "extensions": ["plc"]
+ },
+ "application/vnd.mobius.txf": {
+ "source": "iana",
+ "extensions": ["txf"]
+ },
+ "application/vnd.mophun.application": {
+ "source": "iana",
+ "extensions": ["mpn"]
+ },
+ "application/vnd.mophun.certificate": {
+ "source": "iana",
+ "extensions": ["mpc"]
+ },
+ "application/vnd.motorola.flexsuite": {
+ "source": "iana"
+ },
+ "application/vnd.motorola.flexsuite.adsi": {
+ "source": "iana"
+ },
+ "application/vnd.motorola.flexsuite.fis": {
+ "source": "iana"
+ },
+ "application/vnd.motorola.flexsuite.gotap": {
+ "source": "iana"
+ },
+ "application/vnd.motorola.flexsuite.kmr": {
+ "source": "iana"
+ },
+ "application/vnd.motorola.flexsuite.ttc": {
+ "source": "iana"
+ },
+ "application/vnd.motorola.flexsuite.wem": {
+ "source": "iana"
+ },
+ "application/vnd.motorola.iprm": {
+ "source": "iana"
+ },
+ "application/vnd.mozilla.xul+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["xul"]
+ },
+ "application/vnd.ms-3mfdocument": {
+ "source": "iana"
+ },
+ "application/vnd.ms-artgalry": {
+ "source": "iana",
+ "extensions": ["cil"]
+ },
+ "application/vnd.ms-asf": {
+ "source": "iana"
+ },
+ "application/vnd.ms-cab-compressed": {
+ "source": "iana",
+ "extensions": ["cab"]
+ },
+ "application/vnd.ms-color.iccprofile": {
+ "source": "apache"
+ },
+ "application/vnd.ms-excel": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["xls","xlm","xla","xlc","xlt","xlw"]
+ },
+ "application/vnd.ms-excel.addin.macroenabled.12": {
+ "source": "iana",
+ "extensions": ["xlam"]
+ },
+ "application/vnd.ms-excel.sheet.binary.macroenabled.12": {
+ "source": "iana",
+ "extensions": ["xlsb"]
+ },
+ "application/vnd.ms-excel.sheet.macroenabled.12": {
+ "source": "iana",
+ "extensions": ["xlsm"]
+ },
+ "application/vnd.ms-excel.template.macroenabled.12": {
+ "source": "iana",
+ "extensions": ["xltm"]
+ },
+ "application/vnd.ms-fontobject": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["eot"]
+ },
+ "application/vnd.ms-htmlhelp": {
+ "source": "iana",
+ "extensions": ["chm"]
+ },
+ "application/vnd.ms-ims": {
+ "source": "iana",
+ "extensions": ["ims"]
+ },
+ "application/vnd.ms-lrm": {
+ "source": "iana",
+ "extensions": ["lrm"]
+ },
+ "application/vnd.ms-office.activex+xml": {
+ "source": "iana"
+ },
+ "application/vnd.ms-officetheme": {
+ "source": "iana",
+ "extensions": ["thmx"]
+ },
+ "application/vnd.ms-opentype": {
+ "source": "apache",
+ "compressible": true
+ },
+ "application/vnd.ms-package.obfuscated-opentype": {
+ "source": "apache"
+ },
+ "application/vnd.ms-pki.seccat": {
+ "source": "apache",
+ "extensions": ["cat"]
+ },
+ "application/vnd.ms-pki.stl": {
+ "source": "apache",
+ "extensions": ["stl"]
+ },
+ "application/vnd.ms-playready.initiator+xml": {
+ "source": "iana"
+ },
+ "application/vnd.ms-powerpoint": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["ppt","pps","pot"]
+ },
+ "application/vnd.ms-powerpoint.addin.macroenabled.12": {
+ "source": "iana",
+ "extensions": ["ppam"]
+ },
+ "application/vnd.ms-powerpoint.presentation.macroenabled.12": {
+ "source": "iana",
+ "extensions": ["pptm"]
+ },
+ "application/vnd.ms-powerpoint.slide.macroenabled.12": {
+ "source": "iana",
+ "extensions": ["sldm"]
+ },
+ "application/vnd.ms-powerpoint.slideshow.macroenabled.12": {
+ "source": "iana",
+ "extensions": ["ppsm"]
+ },
+ "application/vnd.ms-powerpoint.template.macroenabled.12": {
+ "source": "iana",
+ "extensions": ["potm"]
+ },
+ "application/vnd.ms-printing.printticket+xml": {
+ "source": "apache"
+ },
+ "application/vnd.ms-project": {
+ "source": "iana",
+ "extensions": ["mpp","mpt"]
+ },
+ "application/vnd.ms-tnef": {
+ "source": "iana"
+ },
+ "application/vnd.ms-windows.printerpairing": {
+ "source": "iana"
+ },
+ "application/vnd.ms-wmdrm.lic-chlg-req": {
+ "source": "iana"
+ },
+ "application/vnd.ms-wmdrm.lic-resp": {
+ "source": "iana"
+ },
+ "application/vnd.ms-wmdrm.meter-chlg-req": {
+ "source": "iana"
+ },
+ "application/vnd.ms-wmdrm.meter-resp": {
+ "source": "iana"
+ },
+ "application/vnd.ms-word.document.macroenabled.12": {
+ "source": "iana",
+ "extensions": ["docm"]
+ },
+ "application/vnd.ms-word.template.macroenabled.12": {
+ "source": "iana",
+ "extensions": ["dotm"]
+ },
+ "application/vnd.ms-works": {
+ "source": "iana",
+ "extensions": ["wps","wks","wcm","wdb"]
+ },
+ "application/vnd.ms-wpl": {
+ "source": "iana",
+ "extensions": ["wpl"]
+ },
+ "application/vnd.ms-xpsdocument": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["xps"]
+ },
+ "application/vnd.msa-disk-image": {
+ "source": "iana"
+ },
+ "application/vnd.mseq": {
+ "source": "iana",
+ "extensions": ["mseq"]
+ },
+ "application/vnd.msign": {
+ "source": "iana"
+ },
+ "application/vnd.multiad.creator": {
+ "source": "iana"
+ },
+ "application/vnd.multiad.creator.cif": {
+ "source": "iana"
+ },
+ "application/vnd.music-niff": {
+ "source": "iana"
+ },
+ "application/vnd.musician": {
+ "source": "iana",
+ "extensions": ["mus"]
+ },
+ "application/vnd.muvee.style": {
+ "source": "iana",
+ "extensions": ["msty"]
+ },
+ "application/vnd.mynfc": {
+ "source": "iana",
+ "extensions": ["taglet"]
+ },
+ "application/vnd.ncd.control": {
+ "source": "iana"
+ },
+ "application/vnd.ncd.reference": {
+ "source": "iana"
+ },
+ "application/vnd.nervana": {
+ "source": "iana"
+ },
+ "application/vnd.netfpx": {
+ "source": "iana"
+ },
+ "application/vnd.neurolanguage.nlu": {
+ "source": "iana",
+ "extensions": ["nlu"]
+ },
+ "application/vnd.nintendo.nitro.rom": {
+ "source": "iana"
+ },
+ "application/vnd.nintendo.snes.rom": {
+ "source": "iana"
+ },
+ "application/vnd.nitf": {
+ "source": "iana",
+ "extensions": ["ntf","nitf"]
+ },
+ "application/vnd.noblenet-directory": {
+ "source": "iana",
+ "extensions": ["nnd"]
+ },
+ "application/vnd.noblenet-sealer": {
+ "source": "iana",
+ "extensions": ["nns"]
+ },
+ "application/vnd.noblenet-web": {
+ "source": "iana",
+ "extensions": ["nnw"]
+ },
+ "application/vnd.nokia.catalogs": {
+ "source": "iana"
+ },
+ "application/vnd.nokia.conml+wbxml": {
+ "source": "iana"
+ },
+ "application/vnd.nokia.conml+xml": {
+ "source": "iana"
+ },
+ "application/vnd.nokia.iptv.config+xml": {
+ "source": "iana"
+ },
+ "application/vnd.nokia.isds-radio-presets": {
+ "source": "iana"
+ },
+ "application/vnd.nokia.landmark+wbxml": {
+ "source": "iana"
+ },
+ "application/vnd.nokia.landmark+xml": {
+ "source": "iana"
+ },
+ "application/vnd.nokia.landmarkcollection+xml": {
+ "source": "iana"
+ },
+ "application/vnd.nokia.n-gage.ac+xml": {
+ "source": "iana"
+ },
+ "application/vnd.nokia.n-gage.data": {
+ "source": "iana",
+ "extensions": ["ngdat"]
+ },
+ "application/vnd.nokia.n-gage.symbian.install": {
+ "source": "iana",
+ "extensions": ["n-gage"]
+ },
+ "application/vnd.nokia.ncd": {
+ "source": "iana"
+ },
+ "application/vnd.nokia.pcd+wbxml": {
+ "source": "iana"
+ },
+ "application/vnd.nokia.pcd+xml": {
+ "source": "iana"
+ },
+ "application/vnd.nokia.radio-preset": {
+ "source": "iana",
+ "extensions": ["rpst"]
+ },
+ "application/vnd.nokia.radio-presets": {
+ "source": "iana",
+ "extensions": ["rpss"]
+ },
+ "application/vnd.novadigm.edm": {
+ "source": "iana",
+ "extensions": ["edm"]
+ },
+ "application/vnd.novadigm.edx": {
+ "source": "iana",
+ "extensions": ["edx"]
+ },
+ "application/vnd.novadigm.ext": {
+ "source": "iana",
+ "extensions": ["ext"]
+ },
+ "application/vnd.ntt-local.content-share": {
+ "source": "iana"
+ },
+ "application/vnd.ntt-local.file-transfer": {
+ "source": "iana"
+ },
+ "application/vnd.ntt-local.ogw_remote-access": {
+ "source": "iana"
+ },
+ "application/vnd.ntt-local.sip-ta_remote": {
+ "source": "iana"
+ },
+ "application/vnd.ntt-local.sip-ta_tcp_stream": {
+ "source": "iana"
+ },
+ "application/vnd.oasis.opendocument.chart": {
+ "source": "iana",
+ "extensions": ["odc"]
+ },
+ "application/vnd.oasis.opendocument.chart-template": {
+ "source": "iana",
+ "extensions": ["otc"]
+ },
+ "application/vnd.oasis.opendocument.database": {
+ "source": "iana",
+ "extensions": ["odb"]
+ },
+ "application/vnd.oasis.opendocument.formula": {
+ "source": "iana",
+ "extensions": ["odf"]
+ },
+ "application/vnd.oasis.opendocument.formula-template": {
+ "source": "iana",
+ "extensions": ["odft"]
+ },
+ "application/vnd.oasis.opendocument.graphics": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["odg"]
+ },
+ "application/vnd.oasis.opendocument.graphics-template": {
+ "source": "iana",
+ "extensions": ["otg"]
+ },
+ "application/vnd.oasis.opendocument.image": {
+ "source": "iana",
+ "extensions": ["odi"]
+ },
+ "application/vnd.oasis.opendocument.image-template": {
+ "source": "iana",
+ "extensions": ["oti"]
+ },
+ "application/vnd.oasis.opendocument.presentation": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["odp"]
+ },
+ "application/vnd.oasis.opendocument.presentation-template": {
+ "source": "iana",
+ "extensions": ["otp"]
+ },
+ "application/vnd.oasis.opendocument.spreadsheet": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["ods"]
+ },
+ "application/vnd.oasis.opendocument.spreadsheet-template": {
+ "source": "iana",
+ "extensions": ["ots"]
+ },
+ "application/vnd.oasis.opendocument.text": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["odt"]
+ },
+ "application/vnd.oasis.opendocument.text-master": {
+ "source": "iana",
+ "extensions": ["odm"]
+ },
+ "application/vnd.oasis.opendocument.text-template": {
+ "source": "iana",
+ "extensions": ["ott"]
+ },
+ "application/vnd.oasis.opendocument.text-web": {
+ "source": "iana",
+ "extensions": ["oth"]
+ },
+ "application/vnd.obn": {
+ "source": "iana"
+ },
+ "application/vnd.oftn.l10n+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.oipf.contentaccessdownload+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oipf.contentaccessstreaming+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oipf.cspg-hexbinary": {
+ "source": "iana"
+ },
+ "application/vnd.oipf.dae.svg+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oipf.dae.xhtml+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oipf.mippvcontrolmessage+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oipf.pae.gem": {
+ "source": "iana"
+ },
+ "application/vnd.oipf.spdiscovery+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oipf.spdlist+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oipf.ueprofile+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oipf.userprofile+xml": {
+ "source": "iana"
+ },
+ "application/vnd.olpc-sugar": {
+ "source": "iana",
+ "extensions": ["xo"]
+ },
+ "application/vnd.oma-scws-config": {
+ "source": "iana"
+ },
+ "application/vnd.oma-scws-http-request": {
+ "source": "iana"
+ },
+ "application/vnd.oma-scws-http-response": {
+ "source": "iana"
+ },
+ "application/vnd.oma.bcast.associated-procedure-parameter+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oma.bcast.drm-trigger+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oma.bcast.imd+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oma.bcast.ltkm": {
+ "source": "iana"
+ },
+ "application/vnd.oma.bcast.notification+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oma.bcast.provisioningtrigger": {
+ "source": "iana"
+ },
+ "application/vnd.oma.bcast.sgboot": {
+ "source": "iana"
+ },
+ "application/vnd.oma.bcast.sgdd+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oma.bcast.sgdu": {
+ "source": "iana"
+ },
+ "application/vnd.oma.bcast.simple-symbol-container": {
+ "source": "iana"
+ },
+ "application/vnd.oma.bcast.smartcard-trigger+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oma.bcast.sprov+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oma.bcast.stkm": {
+ "source": "iana"
+ },
+ "application/vnd.oma.cab-address-book+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oma.cab-feature-handler+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oma.cab-pcc+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oma.cab-subs-invite+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oma.cab-user-prefs+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oma.dcd": {
+ "source": "iana"
+ },
+ "application/vnd.oma.dcdc": {
+ "source": "iana"
+ },
+ "application/vnd.oma.dd2+xml": {
+ "source": "iana",
+ "extensions": ["dd2"]
+ },
+ "application/vnd.oma.drm.risd+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oma.group-usage-list+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oma.pal+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oma.poc.detailed-progress-report+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oma.poc.final-report+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oma.poc.groups+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oma.poc.invocation-descriptor+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oma.poc.optimized-progress-report+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oma.push": {
+ "source": "iana"
+ },
+ "application/vnd.oma.scidm.messages+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oma.xcap-directory+xml": {
+ "source": "iana"
+ },
+ "application/vnd.omads-email+xml": {
+ "source": "iana"
+ },
+ "application/vnd.omads-file+xml": {
+ "source": "iana"
+ },
+ "application/vnd.omads-folder+xml": {
+ "source": "iana"
+ },
+ "application/vnd.omaloc-supl-init": {
+ "source": "iana"
+ },
+ "application/vnd.openeye.oeb": {
+ "source": "iana"
+ },
+ "application/vnd.openofficeorg.extension": {
+ "source": "apache",
+ "extensions": ["oxt"]
+ },
+ "application/vnd.openxmlformats-officedocument.custom-properties+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.drawing+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.extended-properties+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml-template": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.presentation": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["pptx"]
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.slide": {
+ "source": "iana",
+ "extensions": ["sldx"]
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.slideshow": {
+ "source": "iana",
+ "extensions": ["ppsx"]
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.template": {
+ "source": "apache",
+ "extensions": ["potx"]
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml-template": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["xlsx"]
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.template": {
+ "source": "apache",
+ "extensions": ["xltx"]
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.theme+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.themeoverride+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.vmldrawing": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml-template": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["docx"]
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.template": {
+ "source": "apache",
+ "extensions": ["dotx"]
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-package.core-properties+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-package.relationships+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oracle.resource+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.orange.indata": {
+ "source": "iana"
+ },
+ "application/vnd.osa.netdeploy": {
+ "source": "iana"
+ },
+ "application/vnd.osgeo.mapguide.package": {
+ "source": "iana",
+ "extensions": ["mgp"]
+ },
+ "application/vnd.osgi.bundle": {
+ "source": "iana"
+ },
+ "application/vnd.osgi.dp": {
+ "source": "iana",
+ "extensions": ["dp"]
+ },
+ "application/vnd.osgi.subsystem": {
+ "source": "iana",
+ "extensions": ["esa"]
+ },
+ "application/vnd.otps.ct-kip+xml": {
+ "source": "iana"
+ },
+ "application/vnd.palm": {
+ "source": "iana",
+ "extensions": ["pdb","pqa","oprc"]
+ },
+ "application/vnd.panoply": {
+ "source": "iana"
+ },
+ "application/vnd.paos+xml": {
+ "source": "iana"
+ },
+ "application/vnd.paos.xml": {
+ "source": "apache"
+ },
+ "application/vnd.pawaafile": {
+ "source": "iana",
+ "extensions": ["paw"]
+ },
+ "application/vnd.pcos": {
+ "source": "iana"
+ },
+ "application/vnd.pg.format": {
+ "source": "iana",
+ "extensions": ["str"]
+ },
+ "application/vnd.pg.osasli": {
+ "source": "iana",
+ "extensions": ["ei6"]
+ },
+ "application/vnd.piaccess.application-licence": {
+ "source": "iana"
+ },
+ "application/vnd.picsel": {
+ "source": "iana",
+ "extensions": ["efif"]
+ },
+ "application/vnd.pmi.widget": {
+ "source": "iana",
+ "extensions": ["wg"]
+ },
+ "application/vnd.poc.group-advertisement+xml": {
+ "source": "iana"
+ },
+ "application/vnd.pocketlearn": {
+ "source": "iana",
+ "extensions": ["plf"]
+ },
+ "application/vnd.powerbuilder6": {
+ "source": "iana",
+ "extensions": ["pbd"]
+ },
+ "application/vnd.powerbuilder6-s": {
+ "source": "iana"
+ },
+ "application/vnd.powerbuilder7": {
+ "source": "iana"
+ },
+ "application/vnd.powerbuilder7-s": {
+ "source": "iana"
+ },
+ "application/vnd.powerbuilder75": {
+ "source": "iana"
+ },
+ "application/vnd.powerbuilder75-s": {
+ "source": "iana"
+ },
+ "application/vnd.preminet": {
+ "source": "iana"
+ },
+ "application/vnd.previewsystems.box": {
+ "source": "iana",
+ "extensions": ["box"]
+ },
+ "application/vnd.proteus.magazine": {
+ "source": "iana",
+ "extensions": ["mgz"]
+ },
+ "application/vnd.publishare-delta-tree": {
+ "source": "iana",
+ "extensions": ["qps"]
+ },
+ "application/vnd.pvi.ptid1": {
+ "source": "iana",
+ "extensions": ["ptid"]
+ },
+ "application/vnd.pwg-multiplexed": {
+ "source": "iana"
+ },
+ "application/vnd.pwg-xhtml-print+xml": {
+ "source": "iana"
+ },
+ "application/vnd.qualcomm.brew-app-res": {
+ "source": "iana"
+ },
+ "application/vnd.quark.quarkxpress": {
+ "source": "iana",
+ "extensions": ["qxd","qxt","qwd","qwt","qxl","qxb"]
+ },
+ "application/vnd.quobject-quoxdocument": {
+ "source": "iana"
+ },
+ "application/vnd.radisys.moml+xml": {
+ "source": "iana"
+ },
+ "application/vnd.radisys.msml+xml": {
+ "source": "iana"
+ },
+ "application/vnd.radisys.msml-audit+xml": {
+ "source": "iana"
+ },
+ "application/vnd.radisys.msml-audit-conf+xml": {
+ "source": "iana"
+ },
+ "application/vnd.radisys.msml-audit-conn+xml": {
+ "source": "iana"
+ },
+ "application/vnd.radisys.msml-audit-dialog+xml": {
+ "source": "iana"
+ },
+ "application/vnd.radisys.msml-audit-stream+xml": {
+ "source": "iana"
+ },
+ "application/vnd.radisys.msml-conf+xml": {
+ "source": "iana"
+ },
+ "application/vnd.radisys.msml-dialog+xml": {
+ "source": "iana"
+ },
+ "application/vnd.radisys.msml-dialog-base+xml": {
+ "source": "iana"
+ },
+ "application/vnd.radisys.msml-dialog-fax-detect+xml": {
+ "source": "iana"
+ },
+ "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": {
+ "source": "iana"
+ },
+ "application/vnd.radisys.msml-dialog-group+xml": {
+ "source": "iana"
+ },
+ "application/vnd.radisys.msml-dialog-speech+xml": {
+ "source": "iana"
+ },
+ "application/vnd.radisys.msml-dialog-transform+xml": {
+ "source": "iana"
+ },
+ "application/vnd.rainstor.data": {
+ "source": "iana"
+ },
+ "application/vnd.rapid": {
+ "source": "iana"
+ },
+ "application/vnd.realvnc.bed": {
+ "source": "iana",
+ "extensions": ["bed"]
+ },
+ "application/vnd.recordare.musicxml": {
+ "source": "iana",
+ "extensions": ["mxl"]
+ },
+ "application/vnd.recordare.musicxml+xml": {
+ "source": "iana",
+ "extensions": ["musicxml"]
+ },
+ "application/vnd.renlearn.rlprint": {
+ "source": "iana"
+ },
+ "application/vnd.rig.cryptonote": {
+ "source": "iana",
+ "extensions": ["cryptonote"]
+ },
+ "application/vnd.rim.cod": {
+ "source": "apache",
+ "extensions": ["cod"]
+ },
+ "application/vnd.rn-realmedia": {
+ "source": "apache",
+ "extensions": ["rm"]
+ },
+ "application/vnd.rn-realmedia-vbr": {
+ "source": "apache",
+ "extensions": ["rmvb"]
+ },
+ "application/vnd.route66.link66+xml": {
+ "source": "iana",
+ "extensions": ["link66"]
+ },
+ "application/vnd.rs-274x": {
+ "source": "iana"
+ },
+ "application/vnd.ruckus.download": {
+ "source": "iana"
+ },
+ "application/vnd.s3sms": {
+ "source": "iana"
+ },
+ "application/vnd.sailingtracker.track": {
+ "source": "iana",
+ "extensions": ["st"]
+ },
+ "application/vnd.sbm.cid": {
+ "source": "iana"
+ },
+ "application/vnd.sbm.mid2": {
+ "source": "iana"
+ },
+ "application/vnd.scribus": {
+ "source": "iana"
+ },
+ "application/vnd.sealed.3df": {
+ "source": "iana"
+ },
+ "application/vnd.sealed.csf": {
+ "source": "iana"
+ },
+ "application/vnd.sealed.doc": {
+ "source": "iana"
+ },
+ "application/vnd.sealed.eml": {
+ "source": "iana"
+ },
+ "application/vnd.sealed.mht": {
+ "source": "iana"
+ },
+ "application/vnd.sealed.net": {
+ "source": "iana"
+ },
+ "application/vnd.sealed.ppt": {
+ "source": "iana"
+ },
+ "application/vnd.sealed.tiff": {
+ "source": "iana"
+ },
+ "application/vnd.sealed.xls": {
+ "source": "iana"
+ },
+ "application/vnd.sealedmedia.softseal.html": {
+ "source": "iana"
+ },
+ "application/vnd.sealedmedia.softseal.pdf": {
+ "source": "iana"
+ },
+ "application/vnd.seemail": {
+ "source": "iana",
+ "extensions": ["see"]
+ },
+ "application/vnd.sema": {
+ "source": "iana",
+ "extensions": ["sema"]
+ },
+ "application/vnd.semd": {
+ "source": "iana",
+ "extensions": ["semd"]
+ },
+ "application/vnd.semf": {
+ "source": "iana",
+ "extensions": ["semf"]
+ },
+ "application/vnd.shana.informed.formdata": {
+ "source": "iana",
+ "extensions": ["ifm"]
+ },
+ "application/vnd.shana.informed.formtemplate": {
+ "source": "iana",
+ "extensions": ["itp"]
+ },
+ "application/vnd.shana.informed.interchange": {
+ "source": "iana",
+ "extensions": ["iif"]
+ },
+ "application/vnd.shana.informed.package": {
+ "source": "iana",
+ "extensions": ["ipk"]
+ },
+ "application/vnd.simtech-mindmapper": {
+ "source": "iana",
+ "extensions": ["twd","twds"]
+ },
+ "application/vnd.siren+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.smaf": {
+ "source": "iana",
+ "extensions": ["mmf"]
+ },
+ "application/vnd.smart.notebook": {
+ "source": "iana"
+ },
+ "application/vnd.smart.teacher": {
+ "source": "iana",
+ "extensions": ["teacher"]
+ },
+ "application/vnd.software602.filler.form+xml": {
+ "source": "iana"
+ },
+ "application/vnd.software602.filler.form-xml-zip": {
+ "source": "iana"
+ },
+ "application/vnd.solent.sdkm+xml": {
+ "source": "iana",
+ "extensions": ["sdkm","sdkd"]
+ },
+ "application/vnd.spotfire.dxp": {
+ "source": "iana",
+ "extensions": ["dxp"]
+ },
+ "application/vnd.spotfire.sfs": {
+ "source": "iana",
+ "extensions": ["sfs"]
+ },
+ "application/vnd.sss-cod": {
+ "source": "iana"
+ },
+ "application/vnd.sss-dtf": {
+ "source": "iana"
+ },
+ "application/vnd.sss-ntf": {
+ "source": "iana"
+ },
+ "application/vnd.stardivision.calc": {
+ "source": "apache",
+ "extensions": ["sdc"]
+ },
+ "application/vnd.stardivision.draw": {
+ "source": "apache",
+ "extensions": ["sda"]
+ },
+ "application/vnd.stardivision.impress": {
+ "source": "apache",
+ "extensions": ["sdd"]
+ },
+ "application/vnd.stardivision.math": {
+ "source": "apache",
+ "extensions": ["smf"]
+ },
+ "application/vnd.stardivision.writer": {
+ "source": "apache",
+ "extensions": ["sdw","vor"]
+ },
+ "application/vnd.stardivision.writer-global": {
+ "source": "apache",
+ "extensions": ["sgl"]
+ },
+ "application/vnd.stepmania.package": {
+ "source": "iana",
+ "extensions": ["smzip"]
+ },
+ "application/vnd.stepmania.stepchart": {
+ "source": "iana",
+ "extensions": ["sm"]
+ },
+ "application/vnd.street-stream": {
+ "source": "iana"
+ },
+ "application/vnd.sun.wadl+xml": {
+ "source": "iana"
+ },
+ "application/vnd.sun.xml.calc": {
+ "source": "apache",
+ "extensions": ["sxc"]
+ },
+ "application/vnd.sun.xml.calc.template": {
+ "source": "apache",
+ "extensions": ["stc"]
+ },
+ "application/vnd.sun.xml.draw": {
+ "source": "apache",
+ "extensions": ["sxd"]
+ },
+ "application/vnd.sun.xml.draw.template": {
+ "source": "apache",
+ "extensions": ["std"]
+ },
+ "application/vnd.sun.xml.impress": {
+ "source": "apache",
+ "extensions": ["sxi"]
+ },
+ "application/vnd.sun.xml.impress.template": {
+ "source": "apache",
+ "extensions": ["sti"]
+ },
+ "application/vnd.sun.xml.math": {
+ "source": "apache",
+ "extensions": ["sxm"]
+ },
+ "application/vnd.sun.xml.writer": {
+ "source": "apache",
+ "extensions": ["sxw"]
+ },
+ "application/vnd.sun.xml.writer.global": {
+ "source": "apache",
+ "extensions": ["sxg"]
+ },
+ "application/vnd.sun.xml.writer.template": {
+ "source": "apache",
+ "extensions": ["stw"]
+ },
+ "application/vnd.sus-calendar": {
+ "source": "iana",
+ "extensions": ["sus","susp"]
+ },
+ "application/vnd.svd": {
+ "source": "iana",
+ "extensions": ["svd"]
+ },
+ "application/vnd.swiftview-ics": {
+ "source": "iana"
+ },
+ "application/vnd.symbian.install": {
+ "source": "apache",
+ "extensions": ["sis","sisx"]
+ },
+ "application/vnd.syncml+xml": {
+ "source": "iana",
+ "extensions": ["xsm"]
+ },
+ "application/vnd.syncml.dm+wbxml": {
+ "source": "iana",
+ "extensions": ["bdm"]
+ },
+ "application/vnd.syncml.dm+xml": {
+ "source": "iana",
+ "extensions": ["xdm"]
+ },
+ "application/vnd.syncml.dm.notification": {
+ "source": "iana"
+ },
+ "application/vnd.syncml.dmddf+wbxml": {
+ "source": "iana"
+ },
+ "application/vnd.syncml.dmddf+xml": {
+ "source": "iana"
+ },
+ "application/vnd.syncml.dmtnds+wbxml": {
+ "source": "iana"
+ },
+ "application/vnd.syncml.dmtnds+xml": {
+ "source": "iana"
+ },
+ "application/vnd.syncml.ds.notification": {
+ "source": "iana"
+ },
+ "application/vnd.tao.intent-module-archive": {
+ "source": "iana",
+ "extensions": ["tao"]
+ },
+ "application/vnd.tcpdump.pcap": {
+ "source": "iana",
+ "extensions": ["pcap","cap","dmp"]
+ },
+ "application/vnd.tmd.mediaflex.api+xml": {
+ "source": "iana"
+ },
+ "application/vnd.tmobile-livetv": {
+ "source": "iana",
+ "extensions": ["tmo"]
+ },
+ "application/vnd.trid.tpt": {
+ "source": "iana",
+ "extensions": ["tpt"]
+ },
+ "application/vnd.triscape.mxs": {
+ "source": "iana",
+ "extensions": ["mxs"]
+ },
+ "application/vnd.trueapp": {
+ "source": "iana",
+ "extensions": ["tra"]
+ },
+ "application/vnd.truedoc": {
+ "source": "iana"
+ },
+ "application/vnd.ubisoft.webplayer": {
+ "source": "iana"
+ },
+ "application/vnd.ufdl": {
+ "source": "iana",
+ "extensions": ["ufd","ufdl"]
+ },
+ "application/vnd.uiq.theme": {
+ "source": "iana",
+ "extensions": ["utz"]
+ },
+ "application/vnd.umajin": {
+ "source": "iana",
+ "extensions": ["umj"]
+ },
+ "application/vnd.unity": {
+ "source": "iana",
+ "extensions": ["unityweb"]
+ },
+ "application/vnd.uoml+xml": {
+ "source": "iana",
+ "extensions": ["uoml"]
+ },
+ "application/vnd.uplanet.alert": {
+ "source": "iana"
+ },
+ "application/vnd.uplanet.alert-wbxml": {
+ "source": "iana"
+ },
+ "application/vnd.uplanet.bearer-choice": {
+ "source": "iana"
+ },
+ "application/vnd.uplanet.bearer-choice-wbxml": {
+ "source": "iana"
+ },
+ "application/vnd.uplanet.cacheop": {
+ "source": "iana"
+ },
+ "application/vnd.uplanet.cacheop-wbxml": {
+ "source": "iana"
+ },
+ "application/vnd.uplanet.channel": {
+ "source": "iana"
+ },
+ "application/vnd.uplanet.channel-wbxml": {
+ "source": "iana"
+ },
+ "application/vnd.uplanet.list": {
+ "source": "iana"
+ },
+ "application/vnd.uplanet.list-wbxml": {
+ "source": "iana"
+ },
+ "application/vnd.uplanet.listcmd": {
+ "source": "iana"
+ },
+ "application/vnd.uplanet.listcmd-wbxml": {
+ "source": "iana"
+ },
+ "application/vnd.uplanet.signal": {
+ "source": "iana"
+ },
+ "application/vnd.valve.source.material": {
+ "source": "iana"
+ },
+ "application/vnd.vcx": {
+ "source": "iana",
+ "extensions": ["vcx"]
+ },
+ "application/vnd.vd-study": {
+ "source": "iana"
+ },
+ "application/vnd.vectorworks": {
+ "source": "iana"
+ },
+ "application/vnd.verimatrix.vcas": {
+ "source": "iana"
+ },
+ "application/vnd.vidsoft.vidconference": {
+ "source": "iana"
+ },
+ "application/vnd.visio": {
+ "source": "iana",
+ "extensions": ["vsd","vst","vss","vsw"]
+ },
+ "application/vnd.visionary": {
+ "source": "iana",
+ "extensions": ["vis"]
+ },
+ "application/vnd.vividence.scriptfile": {
+ "source": "iana"
+ },
+ "application/vnd.vsf": {
+ "source": "iana",
+ "extensions": ["vsf"]
+ },
+ "application/vnd.wap.sic": {
+ "source": "iana"
+ },
+ "application/vnd.wap.slc": {
+ "source": "iana"
+ },
+ "application/vnd.wap.wbxml": {
+ "source": "iana",
+ "extensions": ["wbxml"]
+ },
+ "application/vnd.wap.wmlc": {
+ "source": "iana",
+ "extensions": ["wmlc"]
+ },
+ "application/vnd.wap.wmlscriptc": {
+ "source": "iana",
+ "extensions": ["wmlsc"]
+ },
+ "application/vnd.webturbo": {
+ "source": "iana",
+ "extensions": ["wtb"]
+ },
+ "application/vnd.wfa.p2p": {
+ "source": "iana"
+ },
+ "application/vnd.wfa.wsc": {
+ "source": "iana"
+ },
+ "application/vnd.windows.devicepairing": {
+ "source": "iana"
+ },
+ "application/vnd.wmc": {
+ "source": "iana"
+ },
+ "application/vnd.wmf.bootstrap": {
+ "source": "iana"
+ },
+ "application/vnd.wolfram.mathematica": {
+ "source": "iana"
+ },
+ "application/vnd.wolfram.mathematica.package": {
+ "source": "iana"
+ },
+ "application/vnd.wolfram.player": {
+ "source": "iana",
+ "extensions": ["nbp"]
+ },
+ "application/vnd.wordperfect": {
+ "source": "iana",
+ "extensions": ["wpd"]
+ },
+ "application/vnd.wqd": {
+ "source": "iana",
+ "extensions": ["wqd"]
+ },
+ "application/vnd.wrq-hp3000-labelled": {
+ "source": "iana"
+ },
+ "application/vnd.wt.stf": {
+ "source": "iana",
+ "extensions": ["stf"]
+ },
+ "application/vnd.wv.csp+wbxml": {
+ "source": "iana"
+ },
+ "application/vnd.wv.csp+xml": {
+ "source": "iana"
+ },
+ "application/vnd.wv.ssp+xml": {
+ "source": "iana"
+ },
+ "application/vnd.xacml+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.xara": {
+ "source": "iana",
+ "extensions": ["xar"]
+ },
+ "application/vnd.xfdl": {
+ "source": "iana",
+ "extensions": ["xfdl"]
+ },
+ "application/vnd.xfdl.webform": {
+ "source": "iana"
+ },
+ "application/vnd.xmi+xml": {
+ "source": "iana"
+ },
+ "application/vnd.xmpie.cpkg": {
+ "source": "iana"
+ },
+ "application/vnd.xmpie.dpkg": {
+ "source": "iana"
+ },
+ "application/vnd.xmpie.plan": {
+ "source": "iana"
+ },
+ "application/vnd.xmpie.ppkg": {
+ "source": "iana"
+ },
+ "application/vnd.xmpie.xlim": {
+ "source": "iana"
+ },
+ "application/vnd.yamaha.hv-dic": {
+ "source": "iana",
+ "extensions": ["hvd"]
+ },
+ "application/vnd.yamaha.hv-script": {
+ "source": "iana",
+ "extensions": ["hvs"]
+ },
+ "application/vnd.yamaha.hv-voice": {
+ "source": "iana",
+ "extensions": ["hvp"]
+ },
+ "application/vnd.yamaha.openscoreformat": {
+ "source": "iana",
+ "extensions": ["osf"]
+ },
+ "application/vnd.yamaha.openscoreformat.osfpvg+xml": {
+ "source": "iana",
+ "extensions": ["osfpvg"]
+ },
+ "application/vnd.yamaha.remote-setup": {
+ "source": "iana"
+ },
+ "application/vnd.yamaha.smaf-audio": {
+ "source": "iana",
+ "extensions": ["saf"]
+ },
+ "application/vnd.yamaha.smaf-phrase": {
+ "source": "iana",
+ "extensions": ["spf"]
+ },
+ "application/vnd.yamaha.through-ngn": {
+ "source": "iana"
+ },
+ "application/vnd.yamaha.tunnel-udpencap": {
+ "source": "iana"
+ },
+ "application/vnd.yaoweme": {
+ "source": "iana"
+ },
+ "application/vnd.yellowriver-custom-menu": {
+ "source": "iana",
+ "extensions": ["cmp"]
+ },
+ "application/vnd.zul": {
+ "source": "iana",
+ "extensions": ["zir","zirz"]
+ },
+ "application/vnd.zzazz.deck+xml": {
+ "source": "iana",
+ "extensions": ["zaz"]
+ },
+ "application/voicexml+xml": {
+ "source": "iana",
+ "extensions": ["vxml"]
+ },
+ "application/vq-rtcpxr": {
+ "source": "iana"
+ },
+ "application/watcherinfo+xml": {
+ "source": "iana"
+ },
+ "application/whoispp-query": {
+ "source": "iana"
+ },
+ "application/whoispp-response": {
+ "source": "iana"
+ },
+ "application/widget": {
+ "source": "iana",
+ "extensions": ["wgt"]
+ },
+ "application/winhlp": {
+ "source": "apache",
+ "extensions": ["hlp"]
+ },
+ "application/wita": {
+ "source": "iana"
+ },
+ "application/wordperfect5.1": {
+ "source": "iana"
+ },
+ "application/wsdl+xml": {
+ "source": "iana",
+ "extensions": ["wsdl"]
+ },
+ "application/wspolicy+xml": {
+ "source": "iana",
+ "extensions": ["wspolicy"]
+ },
+ "application/x-7z-compressed": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["7z"]
+ },
+ "application/x-abiword": {
+ "source": "apache",
+ "extensions": ["abw"]
+ },
+ "application/x-ace-compressed": {
+ "source": "apache",
+ "extensions": ["ace"]
+ },
+ "application/x-amf": {
+ "source": "apache"
+ },
+ "application/x-apple-diskimage": {
+ "source": "apache",
+ "extensions": ["dmg"]
+ },
+ "application/x-authorware-bin": {
+ "source": "apache",
+ "extensions": ["aab","x32","u32","vox"]
+ },
+ "application/x-authorware-map": {
+ "source": "apache",
+ "extensions": ["aam"]
+ },
+ "application/x-authorware-seg": {
+ "source": "apache",
+ "extensions": ["aas"]
+ },
+ "application/x-bcpio": {
+ "source": "apache",
+ "extensions": ["bcpio"]
+ },
+ "application/x-bdoc": {
+ "compressible": false,
+ "extensions": ["bdoc"]
+ },
+ "application/x-bittorrent": {
+ "source": "apache",
+ "extensions": ["torrent"]
+ },
+ "application/x-blorb": {
+ "source": "apache",
+ "extensions": ["blb","blorb"]
+ },
+ "application/x-bzip": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["bz"]
+ },
+ "application/x-bzip2": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["bz2","boz"]
+ },
+ "application/x-cbr": {
+ "source": "apache",
+ "extensions": ["cbr","cba","cbt","cbz","cb7"]
+ },
+ "application/x-cdlink": {
+ "source": "apache",
+ "extensions": ["vcd"]
+ },
+ "application/x-cfs-compressed": {
+ "source": "apache",
+ "extensions": ["cfs"]
+ },
+ "application/x-chat": {
+ "source": "apache",
+ "extensions": ["chat"]
+ },
+ "application/x-chess-pgn": {
+ "source": "apache",
+ "extensions": ["pgn"]
+ },
+ "application/x-chrome-extension": {
+ "extensions": ["crx"]
+ },
+ "application/x-cocoa": {
+ "source": "nginx",
+ "extensions": ["cco"]
+ },
+ "application/x-compress": {
+ "source": "apache"
+ },
+ "application/x-conference": {
+ "source": "apache",
+ "extensions": ["nsc"]
+ },
+ "application/x-cpio": {
+ "source": "apache",
+ "extensions": ["cpio"]
+ },
+ "application/x-csh": {
+ "source": "apache",
+ "extensions": ["csh"]
+ },
+ "application/x-deb": {
+ "compressible": false
+ },
+ "application/x-debian-package": {
+ "source": "apache",
+ "extensions": ["deb","udeb"]
+ },
+ "application/x-dgc-compressed": {
+ "source": "apache",
+ "extensions": ["dgc"]
+ },
+ "application/x-director": {
+ "source": "apache",
+ "extensions": ["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]
+ },
+ "application/x-doom": {
+ "source": "apache",
+ "extensions": ["wad"]
+ },
+ "application/x-dtbncx+xml": {
+ "source": "apache",
+ "extensions": ["ncx"]
+ },
+ "application/x-dtbook+xml": {
+ "source": "apache",
+ "extensions": ["dtb"]
+ },
+ "application/x-dtbresource+xml": {
+ "source": "apache",
+ "extensions": ["res"]
+ },
+ "application/x-dvi": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["dvi"]
+ },
+ "application/x-envoy": {
+ "source": "apache",
+ "extensions": ["evy"]
+ },
+ "application/x-eva": {
+ "source": "apache",
+ "extensions": ["eva"]
+ },
+ "application/x-font-bdf": {
+ "source": "apache",
+ "extensions": ["bdf"]
+ },
+ "application/x-font-dos": {
+ "source": "apache"
+ },
+ "application/x-font-framemaker": {
+ "source": "apache"
+ },
+ "application/x-font-ghostscript": {
+ "source": "apache",
+ "extensions": ["gsf"]
+ },
+ "application/x-font-libgrx": {
+ "source": "apache"
+ },
+ "application/x-font-linux-psf": {
+ "source": "apache",
+ "extensions": ["psf"]
+ },
+ "application/x-font-otf": {
+ "source": "apache",
+ "compressible": true,
+ "extensions": ["otf"]
+ },
+ "application/x-font-pcf": {
+ "source": "apache",
+ "extensions": ["pcf"]
+ },
+ "application/x-font-snf": {
+ "source": "apache",
+ "extensions": ["snf"]
+ },
+ "application/x-font-speedo": {
+ "source": "apache"
+ },
+ "application/x-font-sunos-news": {
+ "source": "apache"
+ },
+ "application/x-font-ttf": {
+ "source": "apache",
+ "compressible": true,
+ "extensions": ["ttf","ttc"]
+ },
+ "application/x-font-type1": {
+ "source": "apache",
+ "extensions": ["pfa","pfb","pfm","afm"]
+ },
+ "application/x-font-vfont": {
+ "source": "apache"
+ },
+ "application/x-freearc": {
+ "source": "apache",
+ "extensions": ["arc"]
+ },
+ "application/x-futuresplash": {
+ "source": "apache",
+ "extensions": ["spl"]
+ },
+ "application/x-gca-compressed": {
+ "source": "apache",
+ "extensions": ["gca"]
+ },
+ "application/x-glulx": {
+ "source": "apache",
+ "extensions": ["ulx"]
+ },
+ "application/x-gnumeric": {
+ "source": "apache",
+ "extensions": ["gnumeric"]
+ },
+ "application/x-gramps-xml": {
+ "source": "apache",
+ "extensions": ["gramps"]
+ },
+ "application/x-gtar": {
+ "source": "apache",
+ "extensions": ["gtar"]
+ },
+ "application/x-gzip": {
+ "source": "apache"
+ },
+ "application/x-hdf": {
+ "source": "apache",
+ "extensions": ["hdf"]
+ },
+ "application/x-install-instructions": {
+ "source": "apache",
+ "extensions": ["install"]
+ },
+ "application/x-iso9660-image": {
+ "source": "apache",
+ "extensions": ["iso"]
+ },
+ "application/x-java-archive-diff": {
+ "source": "nginx",
+ "extensions": ["jardiff"]
+ },
+ "application/x-java-jnlp-file": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["jnlp"]
+ },
+ "application/x-javascript": {
+ "compressible": true
+ },
+ "application/x-latex": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["latex"]
+ },
+ "application/x-lua-bytecode": {
+ "extensions": ["luac"]
+ },
+ "application/x-lzh-compressed": {
+ "source": "apache",
+ "extensions": ["lzh","lha"]
+ },
+ "application/x-makeself": {
+ "source": "nginx",
+ "extensions": ["run"]
+ },
+ "application/x-mie": {
+ "source": "apache",
+ "extensions": ["mie"]
+ },
+ "application/x-mobipocket-ebook": {
+ "source": "apache",
+ "extensions": ["prc","mobi"]
+ },
+ "application/x-mpegurl": {
+ "compressible": false
+ },
+ "application/x-ms-application": {
+ "source": "apache",
+ "extensions": ["application"]
+ },
+ "application/x-ms-shortcut": {
+ "source": "apache",
+ "extensions": ["lnk"]
+ },
+ "application/x-ms-wmd": {
+ "source": "apache",
+ "extensions": ["wmd"]
+ },
+ "application/x-ms-wmz": {
+ "source": "apache",
+ "extensions": ["wmz"]
+ },
+ "application/x-ms-xbap": {
+ "source": "apache",
+ "extensions": ["xbap"]
+ },
+ "application/x-msaccess": {
+ "source": "apache",
+ "extensions": ["mdb"]
+ },
+ "application/x-msbinder": {
+ "source": "apache",
+ "extensions": ["obd"]
+ },
+ "application/x-mscardfile": {
+ "source": "apache",
+ "extensions": ["crd"]
+ },
+ "application/x-msclip": {
+ "source": "apache",
+ "extensions": ["clp"]
+ },
+ "application/x-msdownload": {
+ "source": "apache",
+ "extensions": ["exe","dll","com","bat","msi"]
+ },
+ "application/x-msmediaview": {
+ "source": "apache",
+ "extensions": ["mvb","m13","m14"]
+ },
+ "application/x-msmetafile": {
+ "source": "apache",
+ "extensions": ["wmf","wmz","emf","emz"]
+ },
+ "application/x-msmoney": {
+ "source": "apache",
+ "extensions": ["mny"]
+ },
+ "application/x-mspublisher": {
+ "source": "apache",
+ "extensions": ["pub"]
+ },
+ "application/x-msschedule": {
+ "source": "apache",
+ "extensions": ["scd"]
+ },
+ "application/x-msterminal": {
+ "source": "apache",
+ "extensions": ["trm"]
+ },
+ "application/x-mswrite": {
+ "source": "apache",
+ "extensions": ["wri"]
+ },
+ "application/x-netcdf": {
+ "source": "apache",
+ "extensions": ["nc","cdf"]
+ },
+ "application/x-ns-proxy-autoconfig": {
+ "compressible": true,
+ "extensions": ["pac"]
+ },
+ "application/x-nzb": {
+ "source": "apache",
+ "extensions": ["nzb"]
+ },
+ "application/x-perl": {
+ "source": "nginx",
+ "extensions": ["pl","pm"]
+ },
+ "application/x-pilot": {
+ "source": "nginx",
+ "extensions": ["prc","pdb"]
+ },
+ "application/x-pkcs12": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["p12","pfx"]
+ },
+ "application/x-pkcs7-certificates": {
+ "source": "apache",
+ "extensions": ["p7b","spc"]
+ },
+ "application/x-pkcs7-certreqresp": {
+ "source": "apache",
+ "extensions": ["p7r"]
+ },
+ "application/x-rar-compressed": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["rar"]
+ },
+ "application/x-redhat-package-manager": {
+ "source": "nginx",
+ "extensions": ["rpm"]
+ },
+ "application/x-research-info-systems": {
+ "source": "apache",
+ "extensions": ["ris"]
+ },
+ "application/x-sea": {
+ "source": "nginx",
+ "extensions": ["sea"]
+ },
+ "application/x-sh": {
+ "source": "apache",
+ "compressible": true,
+ "extensions": ["sh"]
+ },
+ "application/x-shar": {
+ "source": "apache",
+ "extensions": ["shar"]
+ },
+ "application/x-shockwave-flash": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["swf"]
+ },
+ "application/x-silverlight-app": {
+ "source": "apache",
+ "extensions": ["xap"]
+ },
+ "application/x-sql": {
+ "source": "apache",
+ "extensions": ["sql"]
+ },
+ "application/x-stuffit": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["sit"]
+ },
+ "application/x-stuffitx": {
+ "source": "apache",
+ "extensions": ["sitx"]
+ },
+ "application/x-subrip": {
+ "source": "apache",
+ "extensions": ["srt"]
+ },
+ "application/x-sv4cpio": {
+ "source": "apache",
+ "extensions": ["sv4cpio"]
+ },
+ "application/x-sv4crc": {
+ "source": "apache",
+ "extensions": ["sv4crc"]
+ },
+ "application/x-t3vm-image": {
+ "source": "apache",
+ "extensions": ["t3"]
+ },
+ "application/x-tads": {
+ "source": "apache",
+ "extensions": ["gam"]
+ },
+ "application/x-tar": {
+ "source": "apache",
+ "compressible": true,
+ "extensions": ["tar"]
+ },
+ "application/x-tcl": {
+ "source": "apache",
+ "extensions": ["tcl","tk"]
+ },
+ "application/x-tex": {
+ "source": "apache",
+ "extensions": ["tex"]
+ },
+ "application/x-tex-tfm": {
+ "source": "apache",
+ "extensions": ["tfm"]
+ },
+ "application/x-texinfo": {
+ "source": "apache",
+ "extensions": ["texinfo","texi"]
+ },
+ "application/x-tgif": {
+ "source": "apache",
+ "extensions": ["obj"]
+ },
+ "application/x-ustar": {
+ "source": "apache",
+ "extensions": ["ustar"]
+ },
+ "application/x-wais-source": {
+ "source": "apache",
+ "extensions": ["src"]
+ },
+ "application/x-web-app-manifest+json": {
+ "compressible": true,
+ "extensions": ["webapp"]
+ },
+ "application/x-www-form-urlencoded": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/x-x509-ca-cert": {
+ "source": "apache",
+ "extensions": ["der","crt","pem"]
+ },
+ "application/x-xfig": {
+ "source": "apache",
+ "extensions": ["fig"]
+ },
+ "application/x-xliff+xml": {
+ "source": "apache",
+ "extensions": ["xlf"]
+ },
+ "application/x-xpinstall": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["xpi"]
+ },
+ "application/x-xz": {
+ "source": "apache",
+ "extensions": ["xz"]
+ },
+ "application/x-zmachine": {
+ "source": "apache",
+ "extensions": ["z1","z2","z3","z4","z5","z6","z7","z8"]
+ },
+ "application/x400-bp": {
+ "source": "iana"
+ },
+ "application/xacml+xml": {
+ "source": "iana"
+ },
+ "application/xaml+xml": {
+ "source": "apache",
+ "extensions": ["xaml"]
+ },
+ "application/xcap-att+xml": {
+ "source": "iana"
+ },
+ "application/xcap-caps+xml": {
+ "source": "iana"
+ },
+ "application/xcap-diff+xml": {
+ "source": "iana",
+ "extensions": ["xdf"]
+ },
+ "application/xcap-el+xml": {
+ "source": "iana"
+ },
+ "application/xcap-error+xml": {
+ "source": "iana"
+ },
+ "application/xcap-ns+xml": {
+ "source": "iana"
+ },
+ "application/xcon-conference-info+xml": {
+ "source": "iana"
+ },
+ "application/xcon-conference-info-diff+xml": {
+ "source": "iana"
+ },
+ "application/xenc+xml": {
+ "source": "iana",
+ "extensions": ["xenc"]
+ },
+ "application/xhtml+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["xhtml","xht"]
+ },
+ "application/xhtml-voice+xml": {
+ "source": "apache"
+ },
+ "application/xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["xml","xsl","xsd"]
+ },
+ "application/xml-dtd": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["dtd"]
+ },
+ "application/xml-external-parsed-entity": {
+ "source": "iana"
+ },
+ "application/xml-patch+xml": {
+ "source": "iana"
+ },
+ "application/xmpp+xml": {
+ "source": "iana"
+ },
+ "application/xop+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["xop"]
+ },
+ "application/xproc+xml": {
+ "source": "apache",
+ "extensions": ["xpl"]
+ },
+ "application/xslt+xml": {
+ "source": "iana",
+ "extensions": ["xslt"]
+ },
+ "application/xspf+xml": {
+ "source": "apache",
+ "extensions": ["xspf"]
+ },
+ "application/xv+xml": {
+ "source": "iana",
+ "extensions": ["mxml","xhvml","xvml","xvm"]
+ },
+ "application/yang": {
+ "source": "iana",
+ "extensions": ["yang"]
+ },
+ "application/yin+xml": {
+ "source": "iana",
+ "extensions": ["yin"]
+ },
+ "application/zip": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["zip"]
+ },
+ "application/zlib": {
+ "source": "iana"
+ },
+ "audio/1d-interleaved-parityfec": {
+ "source": "iana"
+ },
+ "audio/32kadpcm": {
+ "source": "iana"
+ },
+ "audio/3gpp": {
+ "source": "iana"
+ },
+ "audio/3gpp2": {
+ "source": "iana"
+ },
+ "audio/ac3": {
+ "source": "iana"
+ },
+ "audio/adpcm": {
+ "source": "apache",
+ "extensions": ["adp"]
+ },
+ "audio/amr": {
+ "source": "iana"
+ },
+ "audio/amr-wb": {
+ "source": "iana"
+ },
+ "audio/amr-wb+": {
+ "source": "iana"
+ },
+ "audio/aptx": {
+ "source": "iana"
+ },
+ "audio/asc": {
+ "source": "iana"
+ },
+ "audio/atrac-advanced-lossless": {
+ "source": "iana"
+ },
+ "audio/atrac-x": {
+ "source": "iana"
+ },
+ "audio/atrac3": {
+ "source": "iana"
+ },
+ "audio/basic": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["au","snd"]
+ },
+ "audio/bv16": {
+ "source": "iana"
+ },
+ "audio/bv32": {
+ "source": "iana"
+ },
+ "audio/clearmode": {
+ "source": "iana"
+ },
+ "audio/cn": {
+ "source": "iana"
+ },
+ "audio/dat12": {
+ "source": "iana"
+ },
+ "audio/dls": {
+ "source": "iana"
+ },
+ "audio/dsr-es201108": {
+ "source": "iana"
+ },
+ "audio/dsr-es202050": {
+ "source": "iana"
+ },
+ "audio/dsr-es202211": {
+ "source": "iana"
+ },
+ "audio/dsr-es202212": {
+ "source": "iana"
+ },
+ "audio/dv": {
+ "source": "iana"
+ },
+ "audio/dvi4": {
+ "source": "iana"
+ },
+ "audio/eac3": {
+ "source": "iana"
+ },
+ "audio/encaprtp": {
+ "source": "iana"
+ },
+ "audio/evrc": {
+ "source": "iana"
+ },
+ "audio/evrc-qcp": {
+ "source": "iana"
+ },
+ "audio/evrc0": {
+ "source": "iana"
+ },
+ "audio/evrc1": {
+ "source": "iana"
+ },
+ "audio/evrcb": {
+ "source": "iana"
+ },
+ "audio/evrcb0": {
+ "source": "iana"
+ },
+ "audio/evrcb1": {
+ "source": "iana"
+ },
+ "audio/evrcnw": {
+ "source": "iana"
+ },
+ "audio/evrcnw0": {
+ "source": "iana"
+ },
+ "audio/evrcnw1": {
+ "source": "iana"
+ },
+ "audio/evrcwb": {
+ "source": "iana"
+ },
+ "audio/evrcwb0": {
+ "source": "iana"
+ },
+ "audio/evrcwb1": {
+ "source": "iana"
+ },
+ "audio/fwdred": {
+ "source": "iana"
+ },
+ "audio/g719": {
+ "source": "iana"
+ },
+ "audio/g722": {
+ "source": "iana"
+ },
+ "audio/g7221": {
+ "source": "iana"
+ },
+ "audio/g723": {
+ "source": "iana"
+ },
+ "audio/g726-16": {
+ "source": "iana"
+ },
+ "audio/g726-24": {
+ "source": "iana"
+ },
+ "audio/g726-32": {
+ "source": "iana"
+ },
+ "audio/g726-40": {
+ "source": "iana"
+ },
+ "audio/g728": {
+ "source": "iana"
+ },
+ "audio/g729": {
+ "source": "iana"
+ },
+ "audio/g7291": {
+ "source": "iana"
+ },
+ "audio/g729d": {
+ "source": "iana"
+ },
+ "audio/g729e": {
+ "source": "iana"
+ },
+ "audio/gsm": {
+ "source": "iana"
+ },
+ "audio/gsm-efr": {
+ "source": "iana"
+ },
+ "audio/gsm-hr-08": {
+ "source": "iana"
+ },
+ "audio/ilbc": {
+ "source": "iana"
+ },
+ "audio/ip-mr_v2.5": {
+ "source": "iana"
+ },
+ "audio/isac": {
+ "source": "apache"
+ },
+ "audio/l16": {
+ "source": "iana"
+ },
+ "audio/l20": {
+ "source": "iana"
+ },
+ "audio/l24": {
+ "source": "iana",
+ "compressible": false
+ },
+ "audio/l8": {
+ "source": "iana"
+ },
+ "audio/lpc": {
+ "source": "iana"
+ },
+ "audio/midi": {
+ "source": "apache",
+ "extensions": ["mid","midi","kar","rmi"]
+ },
+ "audio/mobile-xmf": {
+ "source": "iana"
+ },
+ "audio/mp4": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["mp4a","m4a"]
+ },
+ "audio/mp4a-latm": {
+ "source": "iana"
+ },
+ "audio/mpa": {
+ "source": "iana"
+ },
+ "audio/mpa-robust": {
+ "source": "iana"
+ },
+ "audio/mpeg": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["mpga","mp2","mp2a","mp3","m2a","m3a"]
+ },
+ "audio/mpeg4-generic": {
+ "source": "iana"
+ },
+ "audio/musepack": {
+ "source": "apache"
+ },
+ "audio/ogg": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["oga","ogg","spx"]
+ },
+ "audio/opus": {
+ "source": "iana"
+ },
+ "audio/parityfec": {
+ "source": "iana"
+ },
+ "audio/pcma": {
+ "source": "iana"
+ },
+ "audio/pcma-wb": {
+ "source": "iana"
+ },
+ "audio/pcmu": {
+ "source": "iana"
+ },
+ "audio/pcmu-wb": {
+ "source": "iana"
+ },
+ "audio/prs.sid": {
+ "source": "iana"
+ },
+ "audio/qcelp": {
+ "source": "iana"
+ },
+ "audio/raptorfec": {
+ "source": "iana"
+ },
+ "audio/red": {
+ "source": "iana"
+ },
+ "audio/rtp-enc-aescm128": {
+ "source": "iana"
+ },
+ "audio/rtp-midi": {
+ "source": "iana"
+ },
+ "audio/rtploopback": {
+ "source": "iana"
+ },
+ "audio/rtx": {
+ "source": "iana"
+ },
+ "audio/s3m": {
+ "source": "apache",
+ "extensions": ["s3m"]
+ },
+ "audio/silk": {
+ "source": "apache",
+ "extensions": ["sil"]
+ },
+ "audio/smv": {
+ "source": "iana"
+ },
+ "audio/smv-qcp": {
+ "source": "iana"
+ },
+ "audio/smv0": {
+ "source": "iana"
+ },
+ "audio/sp-midi": {
+ "source": "iana"
+ },
+ "audio/speex": {
+ "source": "iana"
+ },
+ "audio/t140c": {
+ "source": "iana"
+ },
+ "audio/t38": {
+ "source": "iana"
+ },
+ "audio/telephone-event": {
+ "source": "iana"
+ },
+ "audio/tone": {
+ "source": "iana"
+ },
+ "audio/uemclip": {
+ "source": "iana"
+ },
+ "audio/ulpfec": {
+ "source": "iana"
+ },
+ "audio/vdvi": {
+ "source": "iana"
+ },
+ "audio/vmr-wb": {
+ "source": "iana"
+ },
+ "audio/vnd.3gpp.iufp": {
+ "source": "iana"
+ },
+ "audio/vnd.4sb": {
+ "source": "iana"
+ },
+ "audio/vnd.audiokoz": {
+ "source": "iana"
+ },
+ "audio/vnd.celp": {
+ "source": "iana"
+ },
+ "audio/vnd.cisco.nse": {
+ "source": "iana"
+ },
+ "audio/vnd.cmles.radio-events": {
+ "source": "iana"
+ },
+ "audio/vnd.cns.anp1": {
+ "source": "iana"
+ },
+ "audio/vnd.cns.inf1": {
+ "source": "iana"
+ },
+ "audio/vnd.dece.audio": {
+ "source": "iana",
+ "extensions": ["uva","uvva"]
+ },
+ "audio/vnd.digital-winds": {
+ "source": "iana",
+ "extensions": ["eol"]
+ },
+ "audio/vnd.dlna.adts": {
+ "source": "iana"
+ },
+ "audio/vnd.dolby.heaac.1": {
+ "source": "iana"
+ },
+ "audio/vnd.dolby.heaac.2": {
+ "source": "iana"
+ },
+ "audio/vnd.dolby.mlp": {
+ "source": "iana"
+ },
+ "audio/vnd.dolby.mps": {
+ "source": "iana"
+ },
+ "audio/vnd.dolby.pl2": {
+ "source": "iana"
+ },
+ "audio/vnd.dolby.pl2x": {
+ "source": "iana"
+ },
+ "audio/vnd.dolby.pl2z": {
+ "source": "iana"
+ },
+ "audio/vnd.dolby.pulse.1": {
+ "source": "iana"
+ },
+ "audio/vnd.dra": {
+ "source": "iana",
+ "extensions": ["dra"]
+ },
+ "audio/vnd.dts": {
+ "source": "iana",
+ "extensions": ["dts"]
+ },
+ "audio/vnd.dts.hd": {
+ "source": "iana",
+ "extensions": ["dtshd"]
+ },
+ "audio/vnd.dvb.file": {
+ "source": "iana"
+ },
+ "audio/vnd.everad.plj": {
+ "source": "iana"
+ },
+ "audio/vnd.hns.audio": {
+ "source": "iana"
+ },
+ "audio/vnd.lucent.voice": {
+ "source": "iana",
+ "extensions": ["lvp"]
+ },
+ "audio/vnd.ms-playready.media.pya": {
+ "source": "iana",
+ "extensions": ["pya"]
+ },
+ "audio/vnd.nokia.mobile-xmf": {
+ "source": "iana"
+ },
+ "audio/vnd.nortel.vbk": {
+ "source": "iana"
+ },
+ "audio/vnd.nuera.ecelp4800": {
+ "source": "iana",
+ "extensions": ["ecelp4800"]
+ },
+ "audio/vnd.nuera.ecelp7470": {
+ "source": "iana",
+ "extensions": ["ecelp7470"]
+ },
+ "audio/vnd.nuera.ecelp9600": {
+ "source": "iana",
+ "extensions": ["ecelp9600"]
+ },
+ "audio/vnd.octel.sbc": {
+ "source": "iana"
+ },
+ "audio/vnd.qcelp": {
+ "source": "iana"
+ },
+ "audio/vnd.rhetorex.32kadpcm": {
+ "source": "iana"
+ },
+ "audio/vnd.rip": {
+ "source": "iana",
+ "extensions": ["rip"]
+ },
+ "audio/vnd.rn-realaudio": {
+ "compressible": false
+ },
+ "audio/vnd.sealedmedia.softseal.mpeg": {
+ "source": "iana"
+ },
+ "audio/vnd.vmx.cvsd": {
+ "source": "iana"
+ },
+ "audio/vnd.wave": {
+ "compressible": false
+ },
+ "audio/vorbis": {
+ "source": "iana",
+ "compressible": false
+ },
+ "audio/vorbis-config": {
+ "source": "iana"
+ },
+ "audio/wav": {
+ "compressible": false,
+ "extensions": ["wav"]
+ },
+ "audio/wave": {
+ "compressible": false,
+ "extensions": ["wav"]
+ },
+ "audio/webm": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["weba"]
+ },
+ "audio/x-aac": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["aac"]
+ },
+ "audio/x-aiff": {
+ "source": "apache",
+ "extensions": ["aif","aiff","aifc"]
+ },
+ "audio/x-caf": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["caf"]
+ },
+ "audio/x-flac": {
+ "source": "apache",
+ "extensions": ["flac"]
+ },
+ "audio/x-m4a": {
+ "source": "nginx",
+ "extensions": ["m4a"]
+ },
+ "audio/x-matroska": {
+ "source": "apache",
+ "extensions": ["mka"]
+ },
+ "audio/x-mpegurl": {
+ "source": "apache",
+ "extensions": ["m3u"]
+ },
+ "audio/x-ms-wax": {
+ "source": "apache",
+ "extensions": ["wax"]
+ },
+ "audio/x-ms-wma": {
+ "source": "apache",
+ "extensions": ["wma"]
+ },
+ "audio/x-pn-realaudio": {
+ "source": "apache",
+ "extensions": ["ram","ra"]
+ },
+ "audio/x-pn-realaudio-plugin": {
+ "source": "apache",
+ "extensions": ["rmp"]
+ },
+ "audio/x-realaudio": {
+ "source": "nginx",
+ "extensions": ["ra"]
+ },
+ "audio/x-tta": {
+ "source": "apache"
+ },
+ "audio/x-wav": {
+ "source": "apache",
+ "extensions": ["wav"]
+ },
+ "audio/xm": {
+ "source": "apache",
+ "extensions": ["xm"]
+ },
+ "chemical/x-cdx": {
+ "source": "apache",
+ "extensions": ["cdx"]
+ },
+ "chemical/x-cif": {
+ "source": "apache",
+ "extensions": ["cif"]
+ },
+ "chemical/x-cmdf": {
+ "source": "apache",
+ "extensions": ["cmdf"]
+ },
+ "chemical/x-cml": {
+ "source": "apache",
+ "extensions": ["cml"]
+ },
+ "chemical/x-csml": {
+ "source": "apache",
+ "extensions": ["csml"]
+ },
+ "chemical/x-pdb": {
+ "source": "apache"
+ },
+ "chemical/x-xyz": {
+ "source": "apache",
+ "extensions": ["xyz"]
+ },
+ "font/opentype": {
+ "compressible": true,
+ "extensions": ["otf"]
+ },
+ "image/bmp": {
+ "source": "apache",
+ "compressible": true,
+ "extensions": ["bmp"]
+ },
+ "image/cgm": {
+ "source": "iana",
+ "extensions": ["cgm"]
+ },
+ "image/fits": {
+ "source": "iana"
+ },
+ "image/g3fax": {
+ "source": "iana",
+ "extensions": ["g3"]
+ },
+ "image/gif": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["gif"]
+ },
+ "image/ief": {
+ "source": "iana",
+ "extensions": ["ief"]
+ },
+ "image/jp2": {
+ "source": "iana"
+ },
+ "image/jpeg": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["jpeg","jpg","jpe"]
+ },
+ "image/jpm": {
+ "source": "iana"
+ },
+ "image/jpx": {
+ "source": "iana"
+ },
+ "image/ktx": {
+ "source": "iana",
+ "extensions": ["ktx"]
+ },
+ "image/naplps": {
+ "source": "iana"
+ },
+ "image/pjpeg": {
+ "compressible": false
+ },
+ "image/png": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["png"]
+ },
+ "image/prs.btif": {
+ "source": "iana",
+ "extensions": ["btif"]
+ },
+ "image/prs.pti": {
+ "source": "iana"
+ },
+ "image/pwg-raster": {
+ "source": "iana"
+ },
+ "image/sgi": {
+ "source": "apache",
+ "extensions": ["sgi"]
+ },
+ "image/svg+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["svg","svgz"]
+ },
+ "image/t38": {
+ "source": "iana"
+ },
+ "image/tiff": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["tiff","tif"]
+ },
+ "image/tiff-fx": {
+ "source": "iana"
+ },
+ "image/vnd.adobe.photoshop": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["psd"]
+ },
+ "image/vnd.airzip.accelerator.azv": {
+ "source": "iana"
+ },
+ "image/vnd.cns.inf2": {
+ "source": "iana"
+ },
+ "image/vnd.dece.graphic": {
+ "source": "iana",
+ "extensions": ["uvi","uvvi","uvg","uvvg"]
+ },
+ "image/vnd.djvu": {
+ "source": "iana",
+ "extensions": ["djvu","djv"]
+ },
+ "image/vnd.dvb.subtitle": {
+ "source": "iana",
+ "extensions": ["sub"]
+ },
+ "image/vnd.dwg": {
+ "source": "iana",
+ "extensions": ["dwg"]
+ },
+ "image/vnd.dxf": {
+ "source": "iana",
+ "extensions": ["dxf"]
+ },
+ "image/vnd.fastbidsheet": {
+ "source": "iana",
+ "extensions": ["fbs"]
+ },
+ "image/vnd.fpx": {
+ "source": "iana",
+ "extensions": ["fpx"]
+ },
+ "image/vnd.fst": {
+ "source": "iana",
+ "extensions": ["fst"]
+ },
+ "image/vnd.fujixerox.edmics-mmr": {
+ "source": "iana",
+ "extensions": ["mmr"]
+ },
+ "image/vnd.fujixerox.edmics-rlc": {
+ "source": "iana",
+ "extensions": ["rlc"]
+ },
+ "image/vnd.globalgraphics.pgb": {
+ "source": "iana"
+ },
+ "image/vnd.microsoft.icon": {
+ "source": "iana"
+ },
+ "image/vnd.mix": {
+ "source": "iana"
+ },
+ "image/vnd.ms-modi": {
+ "source": "iana",
+ "extensions": ["mdi"]
+ },
+ "image/vnd.ms-photo": {
+ "source": "apache",
+ "extensions": ["wdp"]
+ },
+ "image/vnd.net-fpx": {
+ "source": "iana",
+ "extensions": ["npx"]
+ },
+ "image/vnd.radiance": {
+ "source": "iana"
+ },
+ "image/vnd.sealed.png": {
+ "source": "iana"
+ },
+ "image/vnd.sealedmedia.softseal.gif": {
+ "source": "iana"
+ },
+ "image/vnd.sealedmedia.softseal.jpg": {
+ "source": "iana"
+ },
+ "image/vnd.svf": {
+ "source": "iana"
+ },
+ "image/vnd.tencent.tap": {
+ "source": "iana"
+ },
+ "image/vnd.valve.source.texture": {
+ "source": "iana"
+ },
+ "image/vnd.wap.wbmp": {
+ "source": "iana",
+ "extensions": ["wbmp"]
+ },
+ "image/vnd.xiff": {
+ "source": "iana",
+ "extensions": ["xif"]
+ },
+ "image/vnd.zbrush.pcx": {
+ "source": "iana"
+ },
+ "image/webp": {
+ "source": "apache",
+ "extensions": ["webp"]
+ },
+ "image/x-3ds": {
+ "source": "apache",
+ "extensions": ["3ds"]
+ },
+ "image/x-cmu-raster": {
+ "source": "apache",
+ "extensions": ["ras"]
+ },
+ "image/x-cmx": {
+ "source": "apache",
+ "extensions": ["cmx"]
+ },
+ "image/x-freehand": {
+ "source": "apache",
+ "extensions": ["fh","fhc","fh4","fh5","fh7"]
+ },
+ "image/x-icon": {
+ "source": "apache",
+ "compressible": true,
+ "extensions": ["ico"]
+ },
+ "image/x-jng": {
+ "source": "nginx",
+ "extensions": ["jng"]
+ },
+ "image/x-mrsid-image": {
+ "source": "apache",
+ "extensions": ["sid"]
+ },
+ "image/x-ms-bmp": {
+ "source": "nginx",
+ "compressible": true,
+ "extensions": ["bmp"]
+ },
+ "image/x-pcx": {
+ "source": "apache",
+ "extensions": ["pcx"]
+ },
+ "image/x-pict": {
+ "source": "apache",
+ "extensions": ["pic","pct"]
+ },
+ "image/x-portable-anymap": {
+ "source": "apache",
+ "extensions": ["pnm"]
+ },
+ "image/x-portable-bitmap": {
+ "source": "apache",
+ "extensions": ["pbm"]
+ },
+ "image/x-portable-graymap": {
+ "source": "apache",
+ "extensions": ["pgm"]
+ },
+ "image/x-portable-pixmap": {
+ "source": "apache",
+ "extensions": ["ppm"]
+ },
+ "image/x-rgb": {
+ "source": "apache",
+ "extensions": ["rgb"]
+ },
+ "image/x-tga": {
+ "source": "apache",
+ "extensions": ["tga"]
+ },
+ "image/x-xbitmap": {
+ "source": "apache",
+ "extensions": ["xbm"]
+ },
+ "image/x-xcf": {
+ "compressible": false
+ },
+ "image/x-xpixmap": {
+ "source": "apache",
+ "extensions": ["xpm"]
+ },
+ "image/x-xwindowdump": {
+ "source": "apache",
+ "extensions": ["xwd"]
+ },
+ "message/cpim": {
+ "source": "iana"
+ },
+ "message/delivery-status": {
+ "source": "iana"
+ },
+ "message/disposition-notification": {
+ "source": "iana"
+ },
+ "message/external-body": {
+ "source": "iana"
+ },
+ "message/feedback-report": {
+ "source": "iana"
+ },
+ "message/global": {
+ "source": "iana"
+ },
+ "message/global-delivery-status": {
+ "source": "iana"
+ },
+ "message/global-disposition-notification": {
+ "source": "iana"
+ },
+ "message/global-headers": {
+ "source": "iana"
+ },
+ "message/http": {
+ "source": "iana",
+ "compressible": false
+ },
+ "message/imdn+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "message/news": {
+ "source": "iana"
+ },
+ "message/partial": {
+ "source": "iana",
+ "compressible": false
+ },
+ "message/rfc822": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["eml","mime"]
+ },
+ "message/s-http": {
+ "source": "iana"
+ },
+ "message/sip": {
+ "source": "iana"
+ },
+ "message/sipfrag": {
+ "source": "iana"
+ },
+ "message/tracking-status": {
+ "source": "iana"
+ },
+ "message/vnd.si.simp": {
+ "source": "iana"
+ },
+ "message/vnd.wfa.wsc": {
+ "source": "iana"
+ },
+ "model/iges": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["igs","iges"]
+ },
+ "model/mesh": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["msh","mesh","silo"]
+ },
+ "model/vnd.collada+xml": {
+ "source": "iana",
+ "extensions": ["dae"]
+ },
+ "model/vnd.dwf": {
+ "source": "iana",
+ "extensions": ["dwf"]
+ },
+ "model/vnd.flatland.3dml": {
+ "source": "iana"
+ },
+ "model/vnd.gdl": {
+ "source": "iana",
+ "extensions": ["gdl"]
+ },
+ "model/vnd.gs-gdl": {
+ "source": "apache"
+ },
+ "model/vnd.gs.gdl": {
+ "source": "iana"
+ },
+ "model/vnd.gtw": {
+ "source": "iana",
+ "extensions": ["gtw"]
+ },
+ "model/vnd.moml+xml": {
+ "source": "iana"
+ },
+ "model/vnd.mts": {
+ "source": "iana",
+ "extensions": ["mts"]
+ },
+ "model/vnd.opengex": {
+ "source": "iana"
+ },
+ "model/vnd.parasolid.transmit.binary": {
+ "source": "iana"
+ },
+ "model/vnd.parasolid.transmit.text": {
+ "source": "iana"
+ },
+ "model/vnd.valve.source.compiled-map": {
+ "source": "iana"
+ },
+ "model/vnd.vtu": {
+ "source": "iana",
+ "extensions": ["vtu"]
+ },
+ "model/vrml": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["wrl","vrml"]
+ },
+ "model/x3d+binary": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["x3db","x3dbz"]
+ },
+ "model/x3d+fastinfoset": {
+ "source": "iana"
+ },
+ "model/x3d+vrml": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["x3dv","x3dvz"]
+ },
+ "model/x3d+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["x3d","x3dz"]
+ },
+ "model/x3d-vrml": {
+ "source": "iana"
+ },
+ "multipart/alternative": {
+ "source": "iana",
+ "compressible": false
+ },
+ "multipart/appledouble": {
+ "source": "iana"
+ },
+ "multipart/byteranges": {
+ "source": "iana"
+ },
+ "multipart/digest": {
+ "source": "iana"
+ },
+ "multipart/encrypted": {
+ "source": "iana",
+ "compressible": false
+ },
+ "multipart/form-data": {
+ "source": "iana",
+ "compressible": false
+ },
+ "multipart/header-set": {
+ "source": "iana"
+ },
+ "multipart/mixed": {
+ "source": "iana",
+ "compressible": false
+ },
+ "multipart/parallel": {
+ "source": "iana"
+ },
+ "multipart/related": {
+ "source": "iana",
+ "compressible": false
+ },
+ "multipart/report": {
+ "source": "iana"
+ },
+ "multipart/signed": {
+ "source": "iana",
+ "compressible": false
+ },
+ "multipart/voice-message": {
+ "source": "iana"
+ },
+ "multipart/x-mixed-replace": {
+ "source": "iana"
+ },
+ "text/1d-interleaved-parityfec": {
+ "source": "iana"
+ },
+ "text/cache-manifest": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["appcache","manifest"]
+ },
+ "text/calendar": {
+ "source": "iana",
+ "extensions": ["ics","ifb"]
+ },
+ "text/calender": {
+ "compressible": true
+ },
+ "text/cmd": {
+ "compressible": true
+ },
+ "text/coffeescript": {
+ "extensions": ["coffee","litcoffee"]
+ },
+ "text/css": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["css"]
+ },
+ "text/csv": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["csv"]
+ },
+ "text/csv-schema": {
+ "source": "iana"
+ },
+ "text/directory": {
+ "source": "iana"
+ },
+ "text/dns": {
+ "source": "iana"
+ },
+ "text/ecmascript": {
+ "source": "iana"
+ },
+ "text/encaprtp": {
+ "source": "iana"
+ },
+ "text/enriched": {
+ "source": "iana"
+ },
+ "text/fwdred": {
+ "source": "iana"
+ },
+ "text/grammar-ref-list": {
+ "source": "iana"
+ },
+ "text/hjson": {
+ "extensions": ["hjson"]
+ },
+ "text/html": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["html","htm","shtml"]
+ },
+ "text/jade": {
+ "extensions": ["jade"]
+ },
+ "text/javascript": {
+ "source": "iana",
+ "compressible": true
+ },
+ "text/jcr-cnd": {
+ "source": "iana"
+ },
+ "text/jsx": {
+ "compressible": true,
+ "extensions": ["jsx"]
+ },
+ "text/less": {
+ "extensions": ["less"]
+ },
+ "text/markdown": {
+ "source": "iana"
+ },
+ "text/mathml": {
+ "source": "nginx",
+ "extensions": ["mml"]
+ },
+ "text/mizar": {
+ "source": "iana"
+ },
+ "text/n3": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["n3"]
+ },
+ "text/parameters": {
+ "source": "iana"
+ },
+ "text/parityfec": {
+ "source": "iana"
+ },
+ "text/plain": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["txt","text","conf","def","list","log","in","ini"]
+ },
+ "text/provenance-notation": {
+ "source": "iana"
+ },
+ "text/prs.fallenstein.rst": {
+ "source": "iana"
+ },
+ "text/prs.lines.tag": {
+ "source": "iana",
+ "extensions": ["dsc"]
+ },
+ "text/raptorfec": {
+ "source": "iana"
+ },
+ "text/red": {
+ "source": "iana"
+ },
+ "text/rfc822-headers": {
+ "source": "iana"
+ },
+ "text/richtext": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["rtx"]
+ },
+ "text/rtf": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["rtf"]
+ },
+ "text/rtp-enc-aescm128": {
+ "source": "iana"
+ },
+ "text/rtploopback": {
+ "source": "iana"
+ },
+ "text/rtx": {
+ "source": "iana"
+ },
+ "text/sgml": {
+ "source": "iana",
+ "extensions": ["sgml","sgm"]
+ },
+ "text/stylus": {
+ "extensions": ["stylus","styl"]
+ },
+ "text/t140": {
+ "source": "iana"
+ },
+ "text/tab-separated-values": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["tsv"]
+ },
+ "text/troff": {
+ "source": "iana",
+ "extensions": ["t","tr","roff","man","me","ms"]
+ },
+ "text/turtle": {
+ "source": "iana",
+ "extensions": ["ttl"]
+ },
+ "text/ulpfec": {
+ "source": "iana"
+ },
+ "text/uri-list": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["uri","uris","urls"]
+ },
+ "text/vcard": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["vcard"]
+ },
+ "text/vnd.a": {
+ "source": "iana"
+ },
+ "text/vnd.abc": {
+ "source": "iana"
+ },
+ "text/vnd.curl": {
+ "source": "iana",
+ "extensions": ["curl"]
+ },
+ "text/vnd.curl.dcurl": {
+ "source": "apache",
+ "extensions": ["dcurl"]
+ },
+ "text/vnd.curl.mcurl": {
+ "source": "apache",
+ "extensions": ["mcurl"]
+ },
+ "text/vnd.curl.scurl": {
+ "source": "apache",
+ "extensions": ["scurl"]
+ },
+ "text/vnd.debian.copyright": {
+ "source": "iana"
+ },
+ "text/vnd.dmclientscript": {
+ "source": "iana"
+ },
+ "text/vnd.dvb.subtitle": {
+ "source": "iana",
+ "extensions": ["sub"]
+ },
+ "text/vnd.esmertec.theme-descriptor": {
+ "source": "iana"
+ },
+ "text/vnd.fly": {
+ "source": "iana",
+ "extensions": ["fly"]
+ },
+ "text/vnd.fmi.flexstor": {
+ "source": "iana",
+ "extensions": ["flx"]
+ },
+ "text/vnd.graphviz": {
+ "source": "iana",
+ "extensions": ["gv"]
+ },
+ "text/vnd.in3d.3dml": {
+ "source": "iana",
+ "extensions": ["3dml"]
+ },
+ "text/vnd.in3d.spot": {
+ "source": "iana",
+ "extensions": ["spot"]
+ },
+ "text/vnd.iptc.newsml": {
+ "source": "iana"
+ },
+ "text/vnd.iptc.nitf": {
+ "source": "iana"
+ },
+ "text/vnd.latex-z": {
+ "source": "iana"
+ },
+ "text/vnd.motorola.reflex": {
+ "source": "iana"
+ },
+ "text/vnd.ms-mediapackage": {
+ "source": "iana"
+ },
+ "text/vnd.net2phone.commcenter.command": {
+ "source": "iana"
+ },
+ "text/vnd.radisys.msml-basic-layout": {
+ "source": "iana"
+ },
+ "text/vnd.si.uricatalogue": {
+ "source": "iana"
+ },
+ "text/vnd.sun.j2me.app-descriptor": {
+ "source": "iana",
+ "extensions": ["jad"]
+ },
+ "text/vnd.trolltech.linguist": {
+ "source": "iana"
+ },
+ "text/vnd.wap.si": {
+ "source": "iana"
+ },
+ "text/vnd.wap.sl": {
+ "source": "iana"
+ },
+ "text/vnd.wap.wml": {
+ "source": "iana",
+ "extensions": ["wml"]
+ },
+ "text/vnd.wap.wmlscript": {
+ "source": "iana",
+ "extensions": ["wmls"]
+ },
+ "text/vtt": {
+ "charset": "UTF-8",
+ "compressible": true,
+ "extensions": ["vtt"]
+ },
+ "text/x-asm": {
+ "source": "apache",
+ "extensions": ["s","asm"]
+ },
+ "text/x-c": {
+ "source": "apache",
+ "extensions": ["c","cc","cxx","cpp","h","hh","dic"]
+ },
+ "text/x-component": {
+ "source": "nginx",
+ "extensions": ["htc"]
+ },
+ "text/x-fortran": {
+ "source": "apache",
+ "extensions": ["f","for","f77","f90"]
+ },
+ "text/x-gwt-rpc": {
+ "compressible": true
+ },
+ "text/x-handlebars-template": {
+ "extensions": ["hbs"]
+ },
+ "text/x-java-source": {
+ "source": "apache",
+ "extensions": ["java"]
+ },
+ "text/x-jquery-tmpl": {
+ "compressible": true
+ },
+ "text/x-lua": {
+ "extensions": ["lua"]
+ },
+ "text/x-markdown": {
+ "compressible": true,
+ "extensions": ["markdown","md","mkd"]
+ },
+ "text/x-nfo": {
+ "source": "apache",
+ "extensions": ["nfo"]
+ },
+ "text/x-opml": {
+ "source": "apache",
+ "extensions": ["opml"]
+ },
+ "text/x-pascal": {
+ "source": "apache",
+ "extensions": ["p","pas"]
+ },
+ "text/x-sass": {
+ "extensions": ["sass"]
+ },
+ "text/x-scss": {
+ "extensions": ["scss"]
+ },
+ "text/x-setext": {
+ "source": "apache",
+ "extensions": ["etx"]
+ },
+ "text/x-sfv": {
+ "source": "apache",
+ "extensions": ["sfv"]
+ },
+ "text/x-uuencode": {
+ "source": "apache",
+ "extensions": ["uu"]
+ },
+ "text/x-vcalendar": {
+ "source": "apache",
+ "extensions": ["vcs"]
+ },
+ "text/x-vcard": {
+ "source": "apache",
+ "extensions": ["vcf"]
+ },
+ "text/xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["xml"]
+ },
+ "text/xml-external-parsed-entity": {
+ "source": "iana"
+ },
+ "text/yaml": {
+ "extensions": ["yaml","yml"]
+ },
+ "video/1d-interleaved-parityfec": {
+ "source": "apache"
+ },
+ "video/3gpp": {
+ "source": "apache",
+ "extensions": ["3gp","3gpp"]
+ },
+ "video/3gpp-tt": {
+ "source": "apache"
+ },
+ "video/3gpp2": {
+ "source": "apache",
+ "extensions": ["3g2"]
+ },
+ "video/bmpeg": {
+ "source": "apache"
+ },
+ "video/bt656": {
+ "source": "apache"
+ },
+ "video/celb": {
+ "source": "apache"
+ },
+ "video/dv": {
+ "source": "apache"
+ },
+ "video/h261": {
+ "source": "apache",
+ "extensions": ["h261"]
+ },
+ "video/h263": {
+ "source": "apache",
+ "extensions": ["h263"]
+ },
+ "video/h263-1998": {
+ "source": "apache"
+ },
+ "video/h263-2000": {
+ "source": "apache"
+ },
+ "video/h264": {
+ "source": "apache",
+ "extensions": ["h264"]
+ },
+ "video/h264-rcdo": {
+ "source": "apache"
+ },
+ "video/h264-svc": {
+ "source": "apache"
+ },
+ "video/jpeg": {
+ "source": "apache",
+ "extensions": ["jpgv"]
+ },
+ "video/jpeg2000": {
+ "source": "apache"
+ },
+ "video/jpm": {
+ "source": "apache",
+ "extensions": ["jpm","jpgm"]
+ },
+ "video/mj2": {
+ "source": "apache",
+ "extensions": ["mj2","mjp2"]
+ },
+ "video/mp1s": {
+ "source": "apache"
+ },
+ "video/mp2p": {
+ "source": "apache"
+ },
+ "video/mp2t": {
+ "source": "apache",
+ "extensions": ["ts"]
+ },
+ "video/mp4": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["mp4","mp4v","mpg4"]
+ },
+ "video/mp4v-es": {
+ "source": "apache"
+ },
+ "video/mpeg": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["mpeg","mpg","mpe","m1v","m2v"]
+ },
+ "video/mpeg4-generic": {
+ "source": "apache"
+ },
+ "video/mpv": {
+ "source": "apache"
+ },
+ "video/nv": {
+ "source": "apache"
+ },
+ "video/ogg": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["ogv"]
+ },
+ "video/parityfec": {
+ "source": "apache"
+ },
+ "video/pointer": {
+ "source": "apache"
+ },
+ "video/quicktime": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["qt","mov"]
+ },
+ "video/raw": {
+ "source": "apache"
+ },
+ "video/rtp-enc-aescm128": {
+ "source": "apache"
+ },
+ "video/rtx": {
+ "source": "apache"
+ },
+ "video/smpte292m": {
+ "source": "apache"
+ },
+ "video/ulpfec": {
+ "source": "apache"
+ },
+ "video/vc1": {
+ "source": "apache"
+ },
+ "video/vnd.cctv": {
+ "source": "apache"
+ },
+ "video/vnd.dece.hd": {
+ "source": "apache",
+ "extensions": ["uvh","uvvh"]
+ },
+ "video/vnd.dece.mobile": {
+ "source": "apache",
+ "extensions": ["uvm","uvvm"]
+ },
+ "video/vnd.dece.mp4": {
+ "source": "apache"
+ },
+ "video/vnd.dece.pd": {
+ "source": "apache",
+ "extensions": ["uvp","uvvp"]
+ },
+ "video/vnd.dece.sd": {
+ "source": "apache",
+ "extensions": ["uvs","uvvs"]
+ },
+ "video/vnd.dece.video": {
+ "source": "apache",
+ "extensions": ["uvv","uvvv"]
+ },
+ "video/vnd.directv.mpeg": {
+ "source": "apache"
+ },
+ "video/vnd.directv.mpeg-tts": {
+ "source": "apache"
+ },
+ "video/vnd.dlna.mpeg-tts": {
+ "source": "apache"
+ },
+ "video/vnd.dvb.file": {
+ "source": "apache",
+ "extensions": ["dvb"]
+ },
+ "video/vnd.fvt": {
+ "source": "apache",
+ "extensions": ["fvt"]
+ },
+ "video/vnd.hns.video": {
+ "source": "apache"
+ },
+ "video/vnd.iptvforum.1dparityfec-1010": {
+ "source": "apache"
+ },
+ "video/vnd.iptvforum.1dparityfec-2005": {
+ "source": "apache"
+ },
+ "video/vnd.iptvforum.2dparityfec-1010": {
+ "source": "apache"
+ },
+ "video/vnd.iptvforum.2dparityfec-2005": {
+ "source": "apache"
+ },
+ "video/vnd.iptvforum.ttsavc": {
+ "source": "apache"
+ },
+ "video/vnd.iptvforum.ttsmpeg2": {
+ "source": "apache"
+ },
+ "video/vnd.motorola.video": {
+ "source": "apache"
+ },
+ "video/vnd.motorola.videop": {
+ "source": "apache"
+ },
+ "video/vnd.mpegurl": {
+ "source": "apache",
+ "extensions": ["mxu","m4u"]
+ },
+ "video/vnd.ms-playready.media.pyv": {
+ "source": "apache",
+ "extensions": ["pyv"]
+ },
+ "video/vnd.nokia.interleaved-multimedia": {
+ "source": "apache"
+ },
+ "video/vnd.nokia.videovoip": {
+ "source": "apache"
+ },
+ "video/vnd.objectvideo": {
+ "source": "apache"
+ },
+ "video/vnd.sealed.mpeg1": {
+ "source": "apache"
+ },
+ "video/vnd.sealed.mpeg4": {
+ "source": "apache"
+ },
+ "video/vnd.sealed.swf": {
+ "source": "apache"
+ },
+ "video/vnd.sealedmedia.softseal.mov": {
+ "source": "apache"
+ },
+ "video/vnd.uvvu.mp4": {
+ "source": "apache",
+ "extensions": ["uvu","uvvu"]
+ },
+ "video/vnd.vivo": {
+ "source": "apache",
+ "extensions": ["viv"]
+ },
+ "video/webm": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["webm"]
+ },
+ "video/x-f4v": {
+ "source": "apache",
+ "extensions": ["f4v"]
+ },
+ "video/x-fli": {
+ "source": "apache",
+ "extensions": ["fli"]
+ },
+ "video/x-flv": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["flv"]
+ },
+ "video/x-m4v": {
+ "source": "apache",
+ "extensions": ["m4v"]
+ },
+ "video/x-matroska": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["mkv","mk3d","mks"]
+ },
+ "video/x-mng": {
+ "source": "apache",
+ "extensions": ["mng"]
+ },
+ "video/x-ms-asf": {
+ "source": "apache",
+ "extensions": ["asf","asx"]
+ },
+ "video/x-ms-vob": {
+ "source": "apache",
+ "extensions": ["vob"]
+ },
+ "video/x-ms-wm": {
+ "source": "apache",
+ "extensions": ["wm"]
+ },
+ "video/x-ms-wmv": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["wmv"]
+ },
+ "video/x-ms-wmx": {
+ "source": "apache",
+ "extensions": ["wmx"]
+ },
+ "video/x-ms-wvx": {
+ "source": "apache",
+ "extensions": ["wvx"]
+ },
+ "video/x-msvideo": {
+ "source": "apache",
+ "extensions": ["avi"]
+ },
+ "video/x-sgi-movie": {
+ "source": "apache",
+ "extensions": ["movie"]
+ },
+ "video/x-smv": {
+ "source": "apache",
+ "extensions": ["smv"]
+ },
+ "x-conference/x-cooltalk": {
+ "source": "apache",
+ "extensions": ["ice"]
+ },
+ "x-shader/x-fragment": {
+ "compressible": true
+ },
+ "x-shader/x-vertex": {
+ "compressible": true
+ }
+}
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/index.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/index.js
new file mode 100644
index 00000000000..551031f690b
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/index.js
@@ -0,0 +1,11 @@
+/*!
+ * mime-db
+ * Copyright(c) 2014 Jonathan Ong
+ * MIT Licensed
+ */
+
+/**
+ * Module exports.
+ */
+
+module.exports = require('./db.json')
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/package.json b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/package.json
new file mode 100644
index 00000000000..6b320ab5583
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/package.json
@@ -0,0 +1,94 @@
+{
+ "name": "mime-db",
+ "description": "Media Type Database",
+ "version": "1.13.0",
+ "contributors": [
+ {
+ "name": "Douglas Christopher Wilson",
+ "email": "doug@somethingdoug.com"
+ },
+ {
+ "name": "Jonathan Ong",
+ "email": "me@jongleberry.com",
+ "url": "http://jongleberry.com"
+ },
+ {
+ "name": "Robert Kieffer",
+ "email": "robert@broofa.com",
+ "url": "http://github.com/broofa"
+ }
+ ],
+ "license": "MIT",
+ "keywords": [
+ "mime",
+ "db",
+ "type",
+ "types",
+ "database",
+ "charset",
+ "charsets"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/jshttp/mime-db.git"
+ },
+ "devDependencies": {
+ "bluebird": "2.9.27",
+ "co": "4.5.4",
+ "cogent": "1.0.1",
+ "csv-parse": "0.1.2",
+ "gnode": "0.1.1",
+ "istanbul": "0.3.14",
+ "mocha": "1.21.5",
+ "raw-body": "2.1.0",
+ "stream-to-array": "2"
+ },
+ "files": [
+ "HISTORY.md",
+ "LICENSE",
+ "README.md",
+ "db.json",
+ "index.js"
+ ],
+ "engines": {
+ "node": ">= 0.6"
+ },
+ "scripts": {
+ "build": "node scripts/build",
+ "fetch": "gnode scripts/fetch-apache && gnode scripts/fetch-iana && gnode scripts/fetch-nginx",
+ "test": "mocha --reporter spec --bail --check-leaks test/",
+ "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
+ "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/",
+ "update": "npm run fetch && npm run build"
+ },
+ "gitHead": "cd78635e4f8baf85d91b4edcd071f77f94a08c53",
+ "bugs": {
+ "url": "https://github.com/jshttp/mime-db/issues"
+ },
+ "homepage": "https://github.com/jshttp/mime-db",
+ "_id": "mime-db@1.13.0",
+ "_shasum": "fd6808168fe30835e7ea2205fc981d3b633e4e34",
+ "_from": "mime-db@>=1.13.0 <1.14.0",
+ "_npmVersion": "1.4.28",
+ "_npmUser": {
+ "name": "dougwilson",
+ "email": "doug@somethingdoug.com"
+ },
+ "maintainers": [
+ {
+ "name": "jongleberry",
+ "email": "jonathanrichardong@gmail.com"
+ },
+ {
+ "name": "dougwilson",
+ "email": "doug@somethingdoug.com"
+ }
+ ],
+ "dist": {
+ "shasum": "fd6808168fe30835e7ea2205fc981d3b633e4e34",
+ "tarball": "http://registry.npmjs.org/mime-db/-/mime-db-1.13.0.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.13.0.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/package.json b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/package.json
new file mode 100644
index 00000000000..512f5da3154
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/package.json
@@ -0,0 +1,84 @@
+{
+ "name": "mime-types",
+ "description": "The ultimate javascript content-type utility.",
+ "version": "2.1.1",
+ "contributors": [
+ {
+ "name": "Douglas Christopher Wilson",
+ "email": "doug@somethingdoug.com"
+ },
+ {
+ "name": "Jeremiah Senkpiel",
+ "email": "fishrock123@rocketmail.com",
+ "url": "https://searchbeam.jit.su"
+ },
+ {
+ "name": "Jonathan Ong",
+ "email": "me@jongleberry.com",
+ "url": "http://jongleberry.com"
+ }
+ ],
+ "license": "MIT",
+ "keywords": [
+ "mime",
+ "types"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/jshttp/mime-types.git"
+ },
+ "dependencies": {
+ "mime-db": "~1.13.0"
+ },
+ "devDependencies": {
+ "istanbul": "0.3.14",
+ "mocha": "~1.21.5"
+ },
+ "files": [
+ "HISTORY.md",
+ "LICENSE",
+ "index.js"
+ ],
+ "engines": {
+ "node": ">= 0.6"
+ },
+ "scripts": {
+ "test": "mocha --reporter spec test/test.js",
+ "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/test.js",
+ "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot test/test.js"
+ },
+ "gitHead": "c067c0b0d8a2e7df82c356dc295852688be1245c",
+ "bugs": {
+ "url": "https://github.com/jshttp/mime-types/issues"
+ },
+ "homepage": "https://github.com/jshttp/mime-types",
+ "_id": "mime-types@2.1.1",
+ "_shasum": "c7b692796d5166f4826d10b4675c8a916657d04e",
+ "_from": "mime-types@>=2.1.1 <3.0.0",
+ "_npmVersion": "1.4.28",
+ "_npmUser": {
+ "name": "dougwilson",
+ "email": "doug@somethingdoug.com"
+ },
+ "maintainers": [
+ {
+ "name": "jongleberry",
+ "email": "jonathanrichardong@gmail.com"
+ },
+ {
+ "name": "fishrock123",
+ "email": "fishrock123@rocketmail.com"
+ },
+ {
+ "name": "dougwilson",
+ "email": "doug@somethingdoug.com"
+ }
+ ],
+ "dist": {
+ "shasum": "c7b692796d5166f4826d10b4675c8a916657d04e",
+ "tarball": "http://registry.npmjs.org/mime-types/-/mime-types-2.1.1.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.1.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/deps/npm/node_modules/request/node_modules/form-data/package.json b/deps/npm/node_modules/request/node_modules/form-data/package.json
index 46ec26dff6d..50f6151ae7f 100644
--- a/deps/npm/node_modules/request/node_modules/form-data/package.json
+++ b/deps/npm/node_modules/request/node_modules/form-data/package.json
@@ -6,7 +6,7 @@
},
"name": "form-data",
"description": "A module to create readable \"multipart/form-data\" streams. Can be used to submit forms and file uploads to other web applications.",
- "version": "0.2.0",
+ "version": "1.0.0-rc1",
"repository": {
"type": "git",
"url": "git://github.com/felixge/node-form-data.git"
@@ -16,12 +16,12 @@
"test": "node test/run.js"
},
"engines": {
- "node": ">= 0.8"
+ "node": ">= 0.10"
},
"dependencies": {
- "async": "~0.9.0",
- "combined-stream": "~0.0.4",
- "mime-types": "~2.0.3"
+ "async": "^1.2.1",
+ "combined-stream": "^1.0.3",
+ "mime-types": "^2.1.1"
},
"licenses": [
{
@@ -30,19 +30,51 @@
}
],
"devDependencies": {
- "fake": "~0.2.2",
- "far": "~0.0.7",
- "formidable": "~1.0.14",
- "request": "~2.36.0"
+ "fake": "^0.2.2",
+ "far": "^0.0.7",
+ "formidable": "^1.0.17",
+ "request": "^2.57.0"
},
- "readme": "# Form-Data [![Build Status](https://travis-ci.org/felixge/node-form-data.png?branch=master)](https://travis-ci.org/felixge/node-form-data) [![Dependency Status](https://gemnasium.com/felixge/node-form-data.png)](https://gemnasium.com/felixge/node-form-data)\n\nA module to create readable ```\"multipart/form-data\"``` streams. Can be used to submit forms and file uploads to other web applications.\n\nThe API of this module is inspired by the [XMLHttpRequest-2 FormData Interface][xhr2-fd].\n\n[xhr2-fd]: http://dev.w3.org/2006/webapi/XMLHttpRequest-2/Overview.html#the-formdata-interface\n[streams2-thing]: http://nodejs.org/api/stream.html#stream_compatibility_with_older_node_versions\n\n## Install\n\n```\nnpm install form-data\n```\n\n## Usage\n\nIn this example we are constructing a form with 3 fields that contain a string,\na buffer and a file stream.\n\n``` javascript\nvar FormData = require('form-data');\nvar fs = require('fs');\n\nvar form = new FormData();\nform.append('my_field', 'my value');\nform.append('my_buffer', new Buffer(10));\nform.append('my_file', fs.createReadStream('/foo/bar.jpg'));\n```\n\nAlso you can use http-response stream:\n\n``` javascript\nvar FormData = require('form-data');\nvar http = require('http');\n\nvar form = new FormData();\n\nhttp.request('http://nodejs.org/images/logo.png', function(response) {\n form.append('my_field', 'my value');\n form.append('my_buffer', new Buffer(10));\n form.append('my_logo', response);\n});\n```\n\nOr @mikeal's request stream:\n\n``` javascript\nvar FormData = require('form-data');\nvar request = require('request');\n\nvar form = new FormData();\n\nform.append('my_field', 'my value');\nform.append('my_buffer', new Buffer(10));\nform.append('my_logo', request('http://nodejs.org/images/logo.png'));\n```\n\nIn order to submit this form to a web application, call ```submit(url, [callback])``` method:\n\n``` javascript\nform.submit('http://example.org/', function(err, res) {\n // res – response object (http.IncomingMessage) //\n res.resume(); // for node-0.10.x\n});\n\n```\n\nFor more advanced request manipulations ```submit()``` method returns ```http.ClientRequest``` object, or you can choose from one of the alternative submission methods.\n\n### Alternative submission methods\n\nYou can use node's http client interface:\n\n``` javascript\nvar http = require('http');\n\nvar request = http.request({\n method: 'post',\n host: 'example.org',\n path: '/upload',\n headers: form.getHeaders()\n});\n\nform.pipe(request);\n\nrequest.on('response', function(res) {\n console.log(res.statusCode);\n});\n```\n\nOr if you would prefer the `'Content-Length'` header to be set for you:\n\n``` javascript\nform.submit('example.org/upload', function(err, res) {\n console.log(res.statusCode);\n});\n```\n\nTo use custom headers and pre-known length in parts:\n\n``` javascript\nvar CRLF = '\\r\\n';\nvar form = new FormData();\n\nvar options = {\n header: CRLF + '--' + form.getBoundary() + CRLF + 'X-Custom-Header: 123' + CRLF + CRLF,\n knownLength: 1\n};\n\nform.append('my_buffer', buffer, options);\n\nform.submit('http://example.com/', function(err, res) {\n if (err) throw err;\n console.log('Done');\n});\n```\n\nForm-Data can recognize and fetch all the required information from common types of streams (```fs.readStream```, ```http.response``` and ```mikeal's request```), for some other types of streams you'd need to provide \"file\"-related information manually:\n\n``` javascript\nsomeModule.stream(function(err, stdout, stderr) {\n if (err) throw err;\n\n var form = new FormData();\n\n form.append('file', stdout, {\n filename: 'unicycle.jpg',\n contentType: 'image/jpg',\n knownLength: 19806\n });\n\n form.submit('http://example.com/', function(err, res) {\n if (err) throw err;\n console.log('Done');\n });\n});\n```\n\nFor edge cases, like POST request to URL with query string or to pass HTTP auth credentials, object can be passed to `form.submit()` as first parameter:\n\n``` javascript\nform.submit({\n host: 'example.com',\n path: '/probably.php?extra=params',\n auth: 'username:password'\n}, function(err, res) {\n console.log(res.statusCode);\n});\n```\n\nIn case you need to also send custom HTTP headers with the POST request, you can use the `headers` key in first parameter of `form.submit()`:\n\n``` javascript\nform.submit({\n host: 'example.com',\n path: '/surelynot.php',\n headers: {'x-test-header': 'test-header-value'}\n}, function(err, res) {\n console.log(res.statusCode);\n});\n```\n\n## Notes\n\n- ```getLengthSync()``` method DOESN'T calculate length for streams, use ```knownLength``` options as workaround.\n- If it feels like FormData hangs after submit and you're on ```node-0.10```, please check [Compatibility with Older Node Versions][streams2-thing]\n\n## TODO\n\n- Add new streams (0.10) support and try really hard not to break it for 0.8.x.\n\n## License\n\nForm-Data is licensed under the MIT license.\n",
- "readmeFilename": "Readme.md",
+ "gitHead": "e6650a4c078fd09c130ed712848d71d8609c6518",
"bugs": {
"url": "https://github.com/felixge/node-form-data/issues"
},
"homepage": "https://github.com/felixge/node-form-data#readme",
- "_id": "form-data@0.2.0",
- "_shasum": "26f8bc26da6440e299cbdcfb69035c4f77a6e466",
- "_resolved": "https://registry.npmjs.org/form-data/-/form-data-0.2.0.tgz",
- "_from": "form-data@>=0.2.0 <0.3.0"
+ "_id": "form-data@1.0.0-rc1",
+ "_shasum": "de5d87ff28439596f4f5500bff58d1244d54793a",
+ "_from": "form-data@>=1.0.0-rc1 <1.1.0",
+ "_npmVersion": "2.10.1",
+ "_nodeVersion": "0.12.4",
+ "_npmUser": {
+ "name": "alexindigo",
+ "email": "iam@alexindigo.com"
+ },
+ "dist": {
+ "shasum": "de5d87ff28439596f4f5500bff58d1244d54793a",
+ "tarball": "http://registry.npmjs.org/form-data/-/form-data-1.0.0-rc1.tgz"
+ },
+ "maintainers": [
+ {
+ "name": "felixge",
+ "email": "felix@debuggable.com"
+ },
+ {
+ "name": "idralyuk",
+ "email": "igor@buran.us"
+ },
+ {
+ "name": "alexindigo",
+ "email": "iam@alexindigo.com"
+ },
+ {
+ "name": "mikeal",
+ "email": "mikeal.rogers@gmail.com"
+ },
+ {
+ "name": "celer",
+ "email": "dtyree77@gmail.com"
+ }
+ ],
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/form-data/-/form-data-1.0.0-rc1.tgz"
}
diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/changelog.md b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/changelog.md
index aa145dcb270..0adfb384da0 100644
--- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/changelog.md
+++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/changelog.md
@@ -1,3 +1,22 @@
+## 2.9.30 (2015-06-14)
+
+Bugfixes:
+
+ - Fix regression with `promisifyAll` not promisifying certain methods
+
+## 2.9.29 (2015-06-14)
+
+Bugfixes:
+
+ - Improve `promisifyAll` detection of functions that are class constructors. Fixes mongodb 2.x promisification.
+
+## 2.9.28 (2015-06-14)
+
+Bugfixes:
+
+ - Fix handled rejection being reported as unhandled in certain scenarios when using [.all](.) or [Promise.join](.) ([#645](.))
+ - Fix custom scheduler not being called in Google Chrome when long stack traces are enabled ([#650](.))
+
## 2.9.27 (2015-05-30)
Bugfixes:
diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/browser/bluebird.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/browser/bluebird.js
index a529187a935..c3b7f608b7d 100644
--- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/browser/bluebird.js
+++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/browser/bluebird.js
@@ -23,7 +23,7 @@
*
*/
/**
- * bluebird build version 2.9.27
+ * bluebird build version 2.9.30
* Features enabled: core, race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, cancel, using, filter, any, each, timers
*/
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.Promise=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof _dereq_=="function"&&_dereq_;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof _dereq_=="function"&&_dereq_;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
@@ -184,13 +184,18 @@ if (!util.hasDevTools) {
Async.prototype.invoke = AsyncInvoke;
Async.prototype.settlePromises = AsyncSettlePromises;
} else {
+ if (schedule.isStatic) {
+ schedule = function(fn) { setTimeout(fn, 0); };
+ }
Async.prototype.invokeLater = function (fn, receiver, arg) {
if (this._trampolineEnabled) {
AsyncInvokeLater.call(this, fn, receiver, arg);
} else {
- setTimeout(function() {
- fn.call(receiver, arg);
- }, 100);
+ this._schedule(function() {
+ setTimeout(function() {
+ fn.call(receiver, arg);
+ }, 100);
+ });
}
};
@@ -198,9 +203,9 @@ if (!util.hasDevTools) {
if (this._trampolineEnabled) {
AsyncInvoke.call(this, fn, receiver, arg);
} else {
- setTimeout(function() {
+ this._schedule(function() {
fn.call(receiver, arg);
- }, 0);
+ });
}
};
@@ -208,9 +213,9 @@ if (!util.hasDevTools) {
if (this._trampolineEnabled) {
AsyncSettlePromises.call(this, promise);
} else {
- setTimeout(function() {
+ this._schedule(function() {
promise._settlePromises();
- }, 0);
+ });
}
};
}
@@ -1137,7 +1142,13 @@ if (debugging) {
async.disableTrampolineIfNecessary();
}
+Promise.prototype._ignoreRejections = function() {
+ this._unsetRejectionIsUnhandled();
+ this._bitField = this._bitField | 16777216;
+};
+
Promise.prototype._ensurePossibleRejectionHandled = function () {
+ if ((this._bitField & 16777216) !== 0) return;
this._setRejectionIsUnhandled();
async.invokeLater(this._notifyUnhandledRejection, this, undefined);
};
@@ -3006,7 +3017,7 @@ PromiseArray.prototype._init = function init(_, resolveValueIfEmpty) {
if (maybePromise instanceof Promise) {
maybePromise = maybePromise._target();
if (isResolved) {
- maybePromise._unsetRejectionIsUnhandled();
+ maybePromise._ignoreRejections();
} else if (maybePromise._isPending()) {
maybePromise._proxyPromiseArray(this, i);
} else if (maybePromise._isFulfilled()) {
@@ -3207,10 +3218,10 @@ var defaultSuffix = "Async";
var defaultPromisified = {__isPromisified__: true};
var noCopyPropsPattern =
/^(?:length|name|arguments|caller|callee|prototype|__isPromisified__)$/;
-var defaultFilter = function(name, func) {
+var defaultFilter = function(name) {
return util.isIdentifier(name) &&
name.charAt(0) !== "_" &&
- !util.isClass(func);
+ name !== "constructor";
};
function propsFilter(key) {
@@ -3255,6 +3266,7 @@ function promisifiableMethods(obj, suffix, suffixRegexp, filter) {
var passesDefaultFilter = filter === defaultFilter
? true : defaultFilter(key, value, obj);
if (typeof value === "function" &&
+ !util.isNativeFunctionMethod(value) &&
!isPromisified(value) &&
!hasPromisified(obj, key, suffix) &&
filter(key, value, obj, passesDefaultFilter)) {
@@ -3354,6 +3366,7 @@ function(callback, receiver, originalName, fn) {
"nodebackForPromise",
"tryCatch",
"errorObj",
+ "notEnumerableProp",
"INTERNAL","'use strict'; \n\
var ret = function (Parameters) { \n\
'use strict'; \n\
@@ -3371,7 +3384,7 @@ function(callback, receiver, originalName, fn) {
} \n\
return promise; \n\
}; \n\
- ret.__isPromisified__ = true; \n\
+ notEnumerableProp(ret, '__isPromisified__', true); \n\
return ret; \n\
"
.replace("Parameters", parameterDeclaration(newParameterCount))
@@ -3385,6 +3398,7 @@ function(callback, receiver, originalName, fn) {
nodebackForPromise,
util.tryCatch,
util.errorObj,
+ util.notEnumerableProp,
INTERNAL
);
};
@@ -3411,7 +3425,7 @@ function makeNodePromisifiedClosure(callback, receiver, _, fn) {
}
return promise;
}
- promisified.__isPromisified__ = true;
+ util.notEnumerableProp(promisified, "__isPromisified__", true);
return promisified;
}
@@ -4665,13 +4679,17 @@ var inheritedDataKeys = (function() {
})();
+var thisAssignmentPattern = /this\s*\.\s*\S+\s*=/;
function isClass(fn) {
try {
if (typeof fn === "function") {
var keys = es5.names(fn.prototype);
- if (es5.isES5) return keys.length > 1;
- return keys.length > 0 &&
- !(keys.length === 1 && keys[0] === "constructor");
+ if (((es5.isES5 && keys.length > 1) ||
+ (keys.length > 0 &&
+ !(keys.length === 1 && keys[0] === "constructor"))) ||
+ thisAssignmentPattern.test(fn + "")) {
+ return true;
+ }
}
return false;
} catch (e) {
@@ -4756,6 +4774,13 @@ function copyDescriptors(from, to, filter) {
}
}
+function isNativeFunctionMethod(fn) {
+ return fn === fn.call ||
+ fn === fn.toString ||
+ fn === fn.bind ||
+ fn === fn.apply;
+}
+
var ret = {
isClass: isClass,
isIdentifier: isIdentifier,
@@ -4786,7 +4811,8 @@ var ret = {
hasDevTools: typeof chrome !== "undefined" && chrome &&
typeof chrome.loadTimes === "function",
isNode: typeof process !== "undefined" &&
- classString(process).toLowerCase() === "[object process]"
+ classString(process).toLowerCase() === "[object process]",
+ isNativeFunctionMethod: isNativeFunctionMethod
};
ret.isRecentNode = ret.isNode && (function() {
var version = process.versions.node.split(".").map(Number);
diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/browser/bluebird.min.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/browser/bluebird.min.js
index bc182ffdd64..9b5474bb258 100644
--- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/browser/bluebird.min.js
+++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/browser/bluebird.min.js
@@ -23,9 +23,9 @@
*
*/
/**
- * bluebird build version 2.9.27
+ * bluebird build version 2.9.30
* Features enabled: core, race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, cancel, using, filter, any, each, timers
*/
-!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.Promise=t()}}(function(){var t,e,r;return function n(t,e,r){function i(s,a){if(!e[s]){if(!t[s]){var u="function"==typeof _dereq_&&_dereq_;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=e[s]={exports:{}};t[s][0].call(l.exports,function(e){var r=t[s][1][e];return i(r?r:e)},l,l.exports,n,t,e,r)}return e[s].exports}for(var o="function"==typeof _dereq_&&_dereq_,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(t,e){"use strict";e.exports=function(t){function e(t){var e=new r(t),n=e.promise();return e.setHowMany(1),e.setUnwrap(),e.init(),n}var r=t._SomePromiseArray;t.any=function(t){return e(t)},t.prototype.any=function(){return e(this)}}},{}],2:[function(t,e){"use strict";function r(){this._isTickUsed=!1,this._lateQueue=new c(16),this._normalQueue=new c(16),this._trampolineEnabled=!0;var t=this;this.drainQueues=function(){t._drainQueues()},this._schedule=u.isStatic?u(this.drainQueues):u}function n(t,e,r){var n=this._getDomain();void 0!==n&&(t=n.bind(t)),this._lateQueue.push(t,e,r),this._queueTick()}function i(t,e,r){var n=this._getDomain();void 0!==n&&(t=n.bind(t)),this._normalQueue.push(t,e,r),this._queueTick()}function o(t){var e=this._getDomain();if(void 0!==e){var r=e.bind(t._settlePromises);this._normalQueue.push(r,t,void 0)}else this._normalQueue._pushOne(t);this._queueTick()}var s;try{throw new Error}catch(a){s=a}var u=t("./schedule.js"),c=t("./queue.js"),l=t("./util.js");r.prototype.disableTrampolineIfNecessary=function(){l.hasDevTools&&(this._trampolineEnabled=!1)},r.prototype.enableTrampoline=function(){this._trampolineEnabled||(this._trampolineEnabled=!0,this._schedule=function(t){setTimeout(t,0)})},r.prototype.haveItemsQueued=function(){return this._normalQueue.length()>0},r.prototype.throwLater=function(t,e){1===arguments.length&&(e=t,t=function(){throw e});var r=this._getDomain();if(void 0!==r&&(t=r.bind(t)),"undefined"!=typeof setTimeout)setTimeout(function(){t(e)},0);else try{this._schedule(function(){t(e)})}catch(n){throw new Error("No async scheduler available\n\n See http://goo.gl/m3OTXk\n")}},r.prototype._getDomain=function(){};l.hasDevTools?(r.prototype.invokeLater=function(t,e,r){this._trampolineEnabled?n.call(this,t,e,r):setTimeout(function(){t.call(e,r)},100)},r.prototype.invoke=function(t,e,r){this._trampolineEnabled?i.call(this,t,e,r):setTimeout(function(){t.call(e,r)},0)},r.prototype.settlePromises=function(t){this._trampolineEnabled?o.call(this,t):setTimeout(function(){t._settlePromises()},0)}):(r.prototype.invokeLater=n,r.prototype.invoke=i,r.prototype.settlePromises=o),r.prototype.invokeFirst=function(t,e,r){var n=this._getDomain();void 0!==n&&(t=n.bind(t)),this._normalQueue.unshift(t,e,r),this._queueTick()},r.prototype._drainQueue=function(t){for(;t.length()>0;){var e=t.shift();if("function"==typeof e){var r=t.shift(),n=t.shift();e.call(r,n)}else e._settlePromises()}},r.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._drainQueue(this._lateQueue)},r.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},r.prototype._reset=function(){this._isTickUsed=!1},e.exports=new r,e.exports.firstLineError=s},{"./queue.js":28,"./schedule.js":31,"./util.js":38,events:39}],3:[function(t,e){"use strict";e.exports=function(t,e,r){var n=function(t,e){this._reject(e)},i=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(n,n,null,this,t)},o=function(t,e){this._setBoundTo(t),this._isPending()&&this._resolveCallback(e.target)},s=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(n){var a=r(n),u=new t(e);u._propagateFrom(this,1);var c=this._target();if(a instanceof t){var l={promiseRejectionQueued:!1,promise:u,target:c,bindingPromise:a};c._then(e,i,u._progress,u,l),a._then(o,s,u._progress,u,l)}else u._setBoundTo(n),u._resolveCallback(c);return u},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=131072|this._bitField,this._boundTo=t):this._bitField=-131073&this._bitField},t.prototype._isBound=function(){return 131072===(131072&this._bitField)},t.bind=function(n,i){var o=r(n),s=new t(e);return o instanceof t?o._then(function(t){s._setBoundTo(t),s._resolveCallback(i)},s._reject,s._progress,s,null):(s._setBoundTo(n),s._resolveCallback(i)),s}}},{}],4:[function(t,e){"use strict";function r(){try{Promise===i&&(Promise=n)}catch(t){}return i}var n;"undefined"!=typeof Promise&&(n=Promise);var i=t("./promise.js")();i.noConflict=r,e.exports=i},{"./promise.js":23}],5:[function(t,e){"use strict";var r=Object.create;if(r){var n=r(null),i=r(null);n[" size"]=i[" size"]=0}e.exports=function(e){function r(t,r){var n;if(null!=t&&(n=t[r]),"function"!=typeof n){var i="Object "+a.classString(t)+" has no method '"+a.toString(r)+"'";throw new e.TypeError(i)}return n}function n(t){var e=this.pop(),n=r(t,e);return n.apply(t,this)}function i(t){return t[this]}function o(t){var e=+this;return 0>e&&(e=Math.max(0,e+t.length)),t[e]}{var s,a=t("./util.js"),u=a.canEvaluate;a.isIdentifier}e.prototype.call=function(t){for(var e=arguments.length,r=new Array(e-1),i=1;e>i;++i)r[i-1]=arguments[i];return r.push(t),this._then(n,void 0,void 0,r,void 0)},e.prototype.get=function(t){var e,r="number"==typeof t;if(r)e=o;else if(u){var n=s(t);e=null!==n?n:i}else e=i;return this._then(e,void 0,void 0,t,void 0)}}},{"./util.js":38}],6:[function(t,e){"use strict";e.exports=function(e){var r=t("./errors.js"),n=t("./async.js"),i=r.CancellationError;e.prototype._cancel=function(t){if(!this.isCancellable())return this;for(var e,r=this;void 0!==(e=r._cancellationParent)&&e.isCancellable();)r=e;this._unsetCancellable(),r._target()._rejectCallback(t,!1,!0)},e.prototype.cancel=function(t){return this.isCancellable()?(void 0===t&&(t=new i),n.invokeLater(this._cancel,this,t),this):this},e.prototype.cancellable=function(){return this._cancellable()?this:(n.enableTrampoline(),this._setCancellable(),this._cancellationParent=void 0,this)},e.prototype.uncancellable=function(){var t=this.then();return t._unsetCancellable(),t},e.prototype.fork=function(t,e,r){var n=this._then(t,e,r,void 0,void 0);return n._setCancellable(),n._cancellationParent=void 0,n}}},{"./async.js":2,"./errors.js":13}],7:[function(t,e){"use strict";e.exports=function(){function e(t){this._parent=t;var r=this._length=1+(void 0===t?0:t._length);j(this,e),r>32&&this.uncycle()}function r(t,e){for(var r=0;r<e.length-1;++r)e[r].push("From previous event:"),e[r]=e[r].join("\n");return r<e.length&&(e[r]=e[r].join("\n")),t+"\n"+e.join("\n")}function n(t){for(var e=0;e<t.length;++e)(0===t[e].length||e+1<t.length&&t[e][0]===t[e+1][0])&&(t.splice(e,1),e--)}function i(t){for(var e=t[0],r=1;r<t.length;++r){for(var n=t[r],i=e.length-1,o=e[i],s=-1,a=n.length-1;a>=0;--a)if(n[a]===o){s=a;break}for(var a=s;a>=0;--a){var u=n[a];if(e[i]!==u)break;e.pop(),i--}e=n}}function o(t){for(var e=[],r=0;r<t.length;++r){var n=t[r],i=_.test(n)||" (No stack trace)"===n,o=i&&y(n);i&&!o&&(v&&" "!==n.charAt(0)&&(n=" "+n),e.push(n))}return e}function s(t){for(var e=t.stack.replace(/\s+$/g,"").split("\n"),r=0;r<e.length;++r){var n=e[r];if(" (No stack trace)"===n||_.test(n))break}return r>0&&(e=e.slice(r)),e}function a(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t.toString();var r=/\[object [a-zA-Z0-9$_]+\]/;if(r.test(e))try{var n=JSON.stringify(t);e=n}catch(i){}0===e.length&&(e="(empty array)")}return"(<"+u(e)+">, no stack trace)"}function u(t){var e=41;return t.length<e?t:t.substr(0,e-3)+"..."}function c(t){var e=t.match(g);return e?{fileName:e[1],line:parseInt(e[2],10)}:void 0}var l,h=t("./async.js"),p=t("./util.js"),f=/[\\\/]bluebird[\\\/]js[\\\/](main|debug|zalgo|instrumented)/,_=null,d=null,v=!1;p.inherits(e,Error),e.prototype.uncycle=function(){var t=this._length;if(!(2>t)){for(var e=[],r={},n=0,i=this;void 0!==i;++n)e.push(i),i=i._parent;t=this._length=n;for(var n=t-1;n>=0;--n){var o=e[n].stack;void 0===r[o]&&(r[o]=n)}for(var n=0;t>n;++n){var s=e[n].stack,a=r[s];if(void 0!==a&&a!==n){a>0&&(e[a-1]._parent=void 0,e[a-1]._length=1),e[n]._parent=void 0,e[n]._length=1;var u=n>0?e[n-1]:this;t-1>a?(u._parent=e[a+1],u._parent.uncycle(),u._length=u._parent._length+1):(u._parent=void 0,u._length=1);for(var c=u._length+1,l=n-2;l>=0;--l)e[l]._length=c,c++;return}}}},e.prototype.parent=function(){return this._parent},e.prototype.hasParent=function(){return void 0!==this._parent},e.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var s=e.parseStackAndMessage(t),a=s.message,u=[s.stack],c=this;void 0!==c;)u.push(o(c.stack.split("\n"))),c=c._parent;i(u),n(u),p.notEnumerableProp(t,"stack",r(a,u)),p.notEnumerableProp(t,"__stackCleaned__",!0)}},e.parseStackAndMessage=function(t){var e=t.stack,r=t.toString();return e="string"==typeof e&&e.length>0?s(t):[" (No stack trace)"],{message:r,stack:o(e)}},e.formatAndLogError=function(t,e){if("undefined"!=typeof console){var r;if("object"==typeof t||"function"==typeof t){var n=t.stack;r=e+d(n,t)}else r=e+String(t);"function"==typeof l?l(r):("function"==typeof console.log||"object"==typeof console.log)&&console.log(r)}},e.unhandledRejection=function(t){e.formatAndLogError(t,"^--- With additional stack trace: ")},e.isSupported=function(){return"function"==typeof j},e.fireRejectionEvent=function(t,r,n,i){var o=!1;try{"function"==typeof r&&(o=!0,"rejectionHandled"===t?r(i):r(n,i))}catch(s){h.throwLater(s)}var a=!1;try{a=b(t,n,i)}catch(s){a=!0,h.throwLater(s)}var u=!1;if(m)try{u=m(t.toLowerCase(),{reason:n,promise:i})}catch(s){u=!0,h.throwLater(s)}a||o||u||"unhandledRejection"!==t||e.formatAndLogError(n,"Unhandled rejection ")};var y=function(){return!1},g=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;e.setBounds=function(t,r){if(e.isSupported()){for(var n,i,o=t.stack.split("\n"),s=r.stack.split("\n"),a=-1,u=-1,l=0;l<o.length;++l){var h=c(o[l]);if(h){n=h.fileName,a=h.line;break}}for(var l=0;l<s.length;++l){var h=c(s[l]);if(h){i=h.fileName,u=h.line;break}}0>a||0>u||!n||!i||n!==i||a>=u||(y=function(t){if(f.test(t))return!0;var e=c(t);return e&&e.fileName===n&&a<=e.line&&e.line<=u?!0:!1})}};var m,j=function(){var t=/^\s*at\s*/,e=function(t,e){return"string"==typeof t?t:void 0!==e.name&&void 0!==e.message?e.toString():a(e)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit=Error.stackTraceLimit+6,_=t,d=e;var r=Error.captureStackTrace;return y=function(t){return f.test(t)},function(t,e){Error.stackTraceLimit=Error.stackTraceLimit+6,r(t,e),Error.stackTraceLimit=Error.stackTraceLimit-6}}var n=new Error;if("string"==typeof n.stack&&n.stack.split("\n")[0].indexOf("stackDetection@")>=0)return _=/@/,d=e,v=!0,function(t){t.stack=(new Error).stack};var i;try{throw new Error}catch(o){i="stack"in o}return"stack"in n||!i?(d=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?a(e):e.toString()},null):(_=t,d=e,function(t){Error.stackTraceLimit=Error.stackTraceLimit+6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit=Error.stackTraceLimit-6})}([]),b=function(){if(p.isNode)return function(t,e,r){return"rejectionHandled"===t?process.emit(t,r):process.emit(t,e,r)};var t=!1,e=!0;try{var r=new self.CustomEvent("test");t=r instanceof CustomEvent}catch(n){}if(!t)try{var i=document.createEvent("CustomEvent");i.initCustomEvent("testingtheevent",!1,!0,{}),self.dispatchEvent(i)}catch(n){e=!1}e&&(m=function(e,r){var n;return t?n=new self.CustomEvent(e,{detail:r,bubbles:!1,cancelable:!0}):self.dispatchEvent&&(n=document.createEvent("CustomEvent"),n.initCustomEvent(e,!1,!0,r)),n?!self.dispatchEvent(n):!1});var o={};return o.unhandledRejection="onunhandledRejection".toLowerCase(),o.rejectionHandled="onrejectionHandled".toLowerCase(),function(t,e,r){var n=o[t],i=self[n];return i?("rejectionHandled"===t?i.call(self,r):i.call(self,e,r),!0):!1}}();return"undefined"!=typeof console&&"undefined"!=typeof console.warn&&(l=function(t){console.warn(t)},p.isNode&&process.stderr.isTTY?l=function(t){process.stderr.write(""+t+"\n")}:p.isNode||"string"!=typeof(new Error).stack||(l=function(t){console.warn("%c"+t,"color: red")})),e}},{"./async.js":2,"./util.js":38}],8:[function(t,e){"use strict";e.exports=function(e){function r(t,e,r){this._instances=t,this._callback=e,this._promise=r}function n(t,e){var r={},n=s(t).call(r,e);if(n===a)return n;var i=u(r);return i.length?(a.e=new c("Catch filter must inherit from Error or be a simple predicate function\n\n See http://goo.gl/o84o68\n"),a):n}var i=t("./util.js"),o=t("./errors.js"),s=i.tryCatch,a=i.errorObj,u=t("./es5.js").keys,c=o.TypeError;return r.prototype.doFilter=function(t){for(var r=this._callback,i=this._promise,o=i._boundTo,u=0,c=this._instances.length;c>u;++u){var l=this._instances[u],h=l===Error||null!=l&&l.prototype instanceof Error;if(h&&t instanceof l){var p=s(r).call(o,t);return p===a?(e.e=p.e,e):p}if("function"==typeof l&&!h){var f=n(l,t);if(f===a){t=a.e;break}if(f){var p=s(r).call(o,t);return p===a?(e.e=p.e,e):p}}}return e.e=t,e},r}},{"./errors.js":13,"./es5.js":14,"./util.js":38}],9:[function(t,e){"use strict";e.exports=function(t,e,r){function n(){this._trace=new e(o())}function i(){return r()?new n:void 0}function o(){var t=s.length-1;return t>=0?s[t]:void 0}var s=[];return n.prototype._pushContext=function(){r()&&void 0!==this._trace&&s.push(this._trace)},n.prototype._popContext=function(){r()&&void 0!==this._trace&&s.pop()},t.prototype._peekContext=o,t.prototype._pushContext=n.prototype._pushContext,t.prototype._popContext=n.prototype._popContext,i}},{}],10:[function(t,e){"use strict";e.exports=function(e,r){var n,i,o=t("./async.js"),s=t("./errors.js").Warning,a=t("./util.js"),u=a.canAttachTrace,c=!1||a.isNode&&(!!process.env.BLUEBIRD_DEBUG||"development"===process.env.NODE_ENV);return c&&o.disableTrampolineIfNecessary(),e.prototype._ensurePossibleRejectionHandled=function(){this._setRejectionIsUnhandled(),o.invokeLater(this._notifyUnhandledRejection,this,void 0)},e.prototype._notifyUnhandledRejectionIsHandled=function(){r.fireRejectionEvent("rejectionHandled",n,void 0,this)},e.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._getCarriedStackTrace()||this._settledValue;this._setUnhandledRejectionIsNotified(),r.fireRejectionEvent("unhandledRejection",i,t,this)}},e.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=524288|this._bitField},e.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-524289&this._bitField},e.prototype._isUnhandledRejectionNotified=function(){return(524288&this._bitField)>0},e.prototype._setRejectionIsUnhandled=function(){this._bitField=2097152|this._bitField},e.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-2097153&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},e.prototype._isRejectionUnhandled=function(){return(2097152&this._bitField)>0},e.prototype._setCarriedStackTrace=function(t){this._bitField=1048576|this._bitField,this._fulfillmentHandler0=t},e.prototype._isCarryingStackTrace=function(){return(1048576&this._bitField)>0},e.prototype._getCarriedStackTrace=function(){return this._isCarryingStackTrace()?this._fulfillmentHandler0:void 0},e.prototype._captureStackTrace=function(){return c&&(this._trace=new r(this._peekContext())),this},e.prototype._attachExtraTrace=function(t,e){if(c&&u(t)){var n=this._trace;if(void 0!==n&&e&&(n=n._parent),void 0!==n)n.attachExtraTrace(t);else if(!t.__stackCleaned__){var i=r.parseStackAndMessage(t);a.notEnumerableProp(t,"stack",i.message+"\n"+i.stack.join("\n")),a.notEnumerableProp(t,"__stackCleaned__",!0)}}},e.prototype._warn=function(t){var e=new s(t),n=this._peekContext();if(n)n.attachExtraTrace(e);else{var i=r.parseStackAndMessage(e);e.stack=i.message+"\n"+i.stack.join("\n")}r.formatAndLogError(e,"")},e.onPossiblyUnhandledRejection=function(t){i="function"==typeof t?t:void 0},e.onUnhandledRejectionHandled=function(t){n="function"==typeof t?t:void 0},e.longStackTraces=function(){if(o.haveItemsQueued()&&c===!1)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/DT1qyG\n");c=r.isSupported(),c&&o.disableTrampolineIfNecessary()},e.hasLongStackTraces=function(){return c&&r.isSupported()},r.isSupported()||(e.longStackTraces=function(){},c=!1),function(){return c}}},{"./async.js":2,"./errors.js":13,"./util.js":38}],11:[function(t,e){"use strict";var r=t("./util.js"),n=r.isPrimitive,i=r.wrapsPrimitiveReceiver;e.exports=function(t){var e=function(){return this},r=function(){throw this},o=function(){},s=function(){throw void 0},a=function(t,e){return 1===e?function(){throw t}:2===e?function(){return t}:void 0};t.prototype["return"]=t.prototype.thenReturn=function(t){return void 0===t?this.then(o):i&&n(t)?this._then(a(t,2),void 0,void 0,void 0,void 0):this._then(e,void 0,void 0,t,void 0)},t.prototype["throw"]=t.prototype.thenThrow=function(t){return void 0===t?this.then(s):i&&n(t)?this._then(a(t,1),void 0,void 0,void 0,void 0):this._then(r,void 0,void 0,t,void 0)}}},{"./util.js":38}],12:[function(t,e){"use strict";e.exports=function(t,e){var r=t.reduce;t.prototype.each=function(t){return r(this,t,null,e)},t.each=function(t,n){return r(t,n,null,e)}}},{}],13:[function(t,e){"use strict";function r(t,e){function r(n){return this instanceof r?(l(this,"message","string"==typeof n?n:e),l(this,"name",t),void(Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this))):new r(n)}return c(r,Error),r}function n(t){return this instanceof n?(l(this,"name","OperationalError"),l(this,"message",t),this.cause=t,this.isOperational=!0,void(t instanceof Error?(l(this,"message",t.message),l(this,"stack",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor))):new n(t)}var i,o,s=t("./es5.js"),a=s.freeze,u=t("./util.js"),c=u.inherits,l=u.notEnumerableProp,h=r("Warning","warning"),p=r("CancellationError","cancellation error"),f=r("TimeoutError","timeout error"),_=r("AggregateError","aggregate error");try{i=TypeError,o=RangeError}catch(d){i=r("TypeError","type error"),o=r("RangeError","range error")}for(var v="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),y=0;y<v.length;++y)"function"==typeof Array.prototype[v[y]]&&(_.prototype[v[y]]=Array.prototype[v[y]]);s.defineProperty(_.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0}),_.prototype.isOperational=!0;var g=0;_.prototype.toString=function(){var t=Array(4*g+1).join(" "),e="\n"+t+"AggregateError of:\n";g++,t=Array(4*g+1).join(" ");for(var r=0;r<this.length;++r){for(var n=this[r]===this?"[Circular AggregateError]":this[r]+"",i=n.split("\n"),o=0;o<i.length;++o)i[o]=t+i[o];n=i.join("\n"),e+=n+"\n"}return g--,e},c(n,Error);var m=Error.__BluebirdErrorTypes__;m||(m=a({CancellationError:p,TimeoutError:f,OperationalError:n,RejectionError:n,AggregateError:_}),l(Error,"__BluebirdErrorTypes__",m)),e.exports={Error:Error,TypeError:i,RangeError:o,CancellationError:m.CancellationError,OperationalError:m.OperationalError,TimeoutError:m.TimeoutError,AggregateError:m.AggregateError,Warning:h}},{"./es5.js":14,"./util.js":38}],14:[function(t,e){var r=function(){"use strict";return void 0===this}();if(r)e.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:r,propertyIsWritable:function(t,e){var r=Object.getOwnPropertyDescriptor(t,e);return!(r&&!r.writable&&!r.set)}};else{var n={}.hasOwnProperty,i={}.toString,o={}.constructor.prototype,s=function(t){var e=[];for(var r in t)n.call(t,r)&&e.push(r);return e},a=function(t,e){return{value:t[e]}},u=function(t,e,r){return t[e]=r.value,t},c=function(t){return t},l=function(t){try{return Object(t).constructor.prototype}catch(e){return o}},h=function(t){try{return"[object Array]"===i.call(t)}catch(e){return!1}};e.exports={isArray:h,keys:s,names:s,defineProperty:u,getDescriptor:a,freeze:c,getPrototypeOf:l,isES5:r,propertyIsWritable:function(){return!0}}}},{}],15:[function(t,e){"use strict";e.exports=function(t,e){var r=t.map;t.prototype.filter=function(t,n){return r(this,t,n,e)},t.filter=function(t,n,i){return r(t,n,i,e)}}},{}],16:[function(t,e){"use strict";e.exports=function(e,r,n){function i(){return this}function o(){throw this}function s(t){return function(){return t}}function a(t){return function(){throw t}}function u(t,e,r){var n;return n=p&&f(e)?r?s(e):a(e):r?i:o,t._then(n,_,void 0,e,void 0)}function c(t){var i=this.promise,o=this.handler,s=i._isBound()?o.call(i._boundTo):o();if(void 0!==s){var a=n(s,i);if(a instanceof e)return a=a._target(),u(a,t,i.isFulfilled())}return i.isRejected()?(r.e=t,r):t}function l(t){var r=this.promise,i=this.handler,o=r._isBound()?i.call(r._boundTo,t):i(t);if(void 0!==o){var s=n(o,r);if(s instanceof e)return s=s._target(),u(s,t,!0)}return t}var h=t("./util.js"),p=h.wrapsPrimitiveReceiver,f=h.isPrimitive,_=h.thrower;e.prototype._passThroughHandler=function(t,e){if("function"!=typeof t)return this.then();var r={promise:this,handler:t};return this._then(e?c:l,e?c:void 0,void 0,r,void 0)},e.prototype.lastly=e.prototype["finally"]=function(t){return this._passThroughHandler(t,!0)},e.prototype.tap=function(t){return this._passThroughHandler(t,!1)}}},{"./util.js":38}],17:[function(t,e){"use strict";e.exports=function(e,r,n,i){function o(t,r,n){for(var o=0;o<r.length;++o){n._pushContext();var s=h(r[o])(t);if(n._popContext(),s===l){n._pushContext();var a=e.reject(l.e);return n._popContext(),a}var u=i(s,n);if(u instanceof e)return u}return null}function s(t,r,i,o){var s=this._promise=new e(n);s._captureStackTrace(),this._stack=o,this._generatorFunction=t,this._receiver=r,this._generator=void 0,this._yieldHandlers="function"==typeof i?[i].concat(p):p}var a=t("./errors.js"),u=a.TypeError,c=t("./util.js"),l=c.errorObj,h=c.tryCatch,p=[];s.prototype.promise=function(){return this._promise},s.prototype._run=function(){this._generator=this._generatorFunction.call(this._receiver),this._receiver=this._generatorFunction=void 0,this._next(void 0)},s.prototype._continue=function(t){if(t===l)return this._promise._rejectCallback(t.e,!1,!0);var r=t.value;if(t.done===!0)this._promise._resolveCallback(r);else{var n=i(r,this._promise);if(!(n instanceof e)&&(n=o(n,this._yieldHandlers,this._promise),null===n))return void this._throw(new u("A value %s was yielded that could not be treated as a promise\n\n See http://goo.gl/4Y4pDk\n\n".replace("%s",r)+"From coroutine:\n"+this._stack.split("\n").slice(1,-7).join("\n")));n._then(this._next,this._throw,void 0,this,null)}},s.prototype._throw=function(t){this._promise._attachExtraTrace(t),this._promise._pushContext();var e=h(this._generator["throw"]).call(this._generator,t);this._promise._popContext(),this._continue(e)},s.prototype._next=function(t){this._promise._pushContext();var e=h(this._generator.next).call(this._generator,t);this._promise._popContext(),this._continue(e)},e.coroutine=function(t,e){if("function"!=typeof t)throw new u("generatorFunction must be a function\n\n See http://goo.gl/6Vqhm0\n");var r=Object(e).yieldHandler,n=s,i=(new Error).stack;return function(){var e=t.apply(this,arguments),o=new n(void 0,void 0,r,i);return o._generator=e,o._next(void 0),o.promise()}},e.coroutine.addYieldHandler=function(t){if("function"!=typeof t)throw new u("fn must be a function\n\n See http://goo.gl/916lJJ\n");p.push(t)},e.spawn=function(t){if("function"!=typeof t)return r("generatorFunction must be a function\n\n See http://goo.gl/6Vqhm0\n");var n=new s(t,this),i=n.promise();return n._run(e.spawn),i}}},{"./errors.js":13,"./util.js":38}],18:[function(t,e){"use strict";e.exports=function(e,r,n,i){{var o=t("./util.js");o.canEvaluate,o.tryCatch,o.errorObj}e.join=function(){var t,e=arguments.length-1;if(e>0&&"function"==typeof arguments[e]){t=arguments[e];var n}for(var i=arguments.length,o=new Array(i),s=0;i>s;++s)o[s]=arguments[s];t&&o.pop();var n=new r(o).promise();return void 0!==t?n.spread(t):n}}},{"./util.js":38}],19:[function(t,e){"use strict";e.exports=function(e,r,n,i,o){function s(t,e,r,n){this.constructor$(t),this._promise._captureStackTrace(),this._callback=e,this._preservedValues=n===o?new Array(this.length()):null,this._limit=r,this._inFlight=0,this._queue=r>=1?[]:_,c.invoke(a,this,void 0)}function a(){this._init$(void 0,-2)}function u(t,e,r,n){var i="object"==typeof r&&null!==r?r.concurrency:0;return i="number"==typeof i&&isFinite(i)&&i>=1?i:0,new s(t,e,i,n)}var c=t("./async.js"),l=t("./util.js"),h=l.tryCatch,p=l.errorObj,f={},_=[];l.inherits(s,r),s.prototype._init=function(){},s.prototype._promiseFulfilled=function(t,r){var n=this._values,o=this.length(),s=this._preservedValues,a=this._limit;if(n[r]===f){if(n[r]=t,a>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return}else{if(a>=1&&this._inFlight>=a)return n[r]=t,void this._queue.push(r);null!==s&&(s[r]=t);var u=this._callback,c=this._promise._boundTo;this._promise._pushContext();var l=h(u).call(c,t,r,o);if(this._promise._popContext(),l===p)return this._reject(l.e);var _=i(l,this._promise);if(_ instanceof e){if(_=_._target(),_._isPending())return a>=1&&this._inFlight++,n[r]=f,_._proxyPromiseArray(this,r);if(!_._isFulfilled())return this._reject(_._reason());l=_._value()}n[r]=l}var d=++this._totalResolved;d>=o&&(null!==s?this._filter(n,s):this._resolve(n))},s.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,r=this._values;t.length>0&&this._inFlight<e;){if(this._isResolved())return;var n=t.pop();this._promiseFulfilled(r[n],n)}},s.prototype._filter=function(t,e){for(var r=e.length,n=new Array(r),i=0,o=0;r>o;++o)t[o]&&(n[i++]=e[o]);n.length=i,this._resolve(n)},s.prototype.preservedValues=function(){return this._preservedValues},e.prototype.map=function(t,e){return"function"!=typeof t?n("fn must be a function\n\n See http://goo.gl/916lJJ\n"):u(this,t,e,null).promise()},e.map=function(t,e,r,i){return"function"!=typeof e?n("fn must be a function\n\n See http://goo.gl/916lJJ\n"):u(t,e,r,i).promise()}}},{"./async.js":2,"./util.js":38}],20:[function(t,e){"use strict";e.exports=function(e,r,n,i){var o=t("./util.js"),s=o.tryCatch;e.method=function(t){if("function"!=typeof t)throw new e.TypeError("fn must be a function\n\n See http://goo.gl/916lJJ\n");return function(){var n=new e(r);n._captureStackTrace(),n._pushContext();var i=s(t).apply(this,arguments);return n._popContext(),n._resolveFromSyncValue(i),n}},e.attempt=e["try"]=function(t,n,a){if("function"!=typeof t)return i("fn must be a function\n\n See http://goo.gl/916lJJ\n");var u=new e(r);u._captureStackTrace(),u._pushContext();var c=o.isArray(n)?s(t).apply(a,n):s(t).call(a,n);return u._popContext(),u._resolveFromSyncValue(c),u},e.prototype._resolveFromSyncValue=function(t){t===o.errorObj?this._rejectCallback(t.e,!1,!0):this._resolveCallback(t,!0)}}},{"./util.js":38}],21:[function(t,e){"use strict";e.exports=function(e){function r(t,e){var r=this;if(!o.isArray(t))return n.call(r,t,e);var i=a(e).apply(r._boundTo,[null].concat(t));i===u&&s.throwLater(i.e)}function n(t,e){var r=this,n=r._boundTo,i=void 0===t?a(e).call(n,null):a(e).call(n,null,t);i===u&&s.throwLater(i.e)}function i(t,e){var r=this;if(!t){var n=r._target(),i=n._getCarriedStackTrace();i.cause=t,t=i}var o=a(e).call(r._boundTo,t);o===u&&s.throwLater(o.e)}var o=t("./util.js"),s=t("./async.js"),a=o.tryCatch,u=o.errorObj;e.prototype.asCallback=e.prototype.nodeify=function(t,e){if("function"==typeof t){var o=n;void 0!==e&&Object(e).spread&&(o=r),this._then(o,i,void 0,this,t)}return this}}},{"./async.js":2,"./util.js":38}],22:[function(t,e){"use strict";e.exports=function(e,r){var n=t("./util.js"),i=t("./async.js"),o=n.tryCatch,s=n.errorObj;e.prototype.progressed=function(t){return this._then(void 0,void 0,t,void 0,void 0)},e.prototype._progress=function(t){this._isFollowingOrFulfilledOrRejected()||this._target()._progressUnchecked(t)},e.prototype._progressHandlerAt=function(t){return 0===t?this._progressHandler0:this[(t<<2)+t-5+2]},e.prototype._doProgressWith=function(t){var r=t.value,i=t.handler,a=t.promise,u=t.receiver,c=o(i).call(u,r);if(c===s){if(null!=c.e&&"StopProgressPropagation"!==c.e.name){var l=n.canAttachTrace(c.e)?c.e:new Error(n.toString(c.e));a._attachExtraTrace(l),a._progress(c.e)}}else c instanceof e?c._then(a._progress,null,null,a,void 0):a._progress(c)},e.prototype._progressUnchecked=function(t){for(var n=this._length(),o=this._progress,s=0;n>s;s++){var a=this._progressHandlerAt(s),u=this._promiseAt(s);if(u instanceof e)"function"==typeof a?i.invoke(this._doProgressWith,this,{handler:a,promise:u,receiver:this._receiverAt(s),value:t}):i.invoke(o,u,t);else{var c=this._receiverAt(s);"function"==typeof a?a.call(c,t,u):c instanceof r&&!c._isResolved()&&c._promiseProgressed(t,u)}}}}},{"./async.js":2,"./util.js":38}],23:[function(t,e){"use strict";e.exports=function(){function e(t){if("function"!=typeof t)throw new c("the promise constructor requires a resolver function\n\n See http://goo.gl/EC22Yn\n");if(this.constructor!==e)throw new c("the promise constructor cannot be invoked directly\n\n See http://goo.gl/KsIlge\n");this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._progressHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,this._settledValue=void 0,t!==l&&this._resolveFromResolver(t)}function r(t){var r=new e(l);r._fulfillmentHandler0=t,r._rejectionHandler0=t,r._progressHandler0=t,r._promise0=t,r._receiver0=t,r._settledValue=t}var n=function(){return new c("circular promise resolution chain\n\n See http://goo.gl/LhFpo0\n")},i=function(){return new e.PromiseInspection(this._target())},o=function(t){return e.reject(new c(t))},s=t("./util.js"),a=t("./async.js"),u=t("./errors.js"),c=e.TypeError=u.TypeError;e.RangeError=u.RangeError,e.CancellationError=u.CancellationError,e.TimeoutError=u.TimeoutError,e.OperationalError=u.OperationalError,e.RejectionError=u.OperationalError,e.AggregateError=u.AggregateError;var l=function(){},h={},p={e:null},f=t("./thenables.js")(e,l),_=t("./promise_array.js")(e,l,f,o),d=t("./captured_trace.js")(),v=t("./debuggability.js")(e,d),y=t("./context.js")(e,d,v),g=t("./catch_filter.js")(p),m=t("./promise_resolver.js"),j=m._nodebackForPromise,b=s.errorObj,w=s.tryCatch;return e.prototype.toString=function(){return"[object Promise]"},e.prototype.caught=e.prototype["catch"]=function(t){var r=arguments.length;if(r>1){var n,i=new Array(r-1),o=0;for(n=0;r-1>n;++n){var s=arguments[n];if("function"!=typeof s)return e.reject(new c("Catch filter must inherit from Error or be a simple predicate function\n\n See http://goo.gl/o84o68\n"));i[o++]=s}i.length=o,t=arguments[n];var a=new g(i,t,this);return this._then(void 0,a.doFilter,void 0,a,void 0)}return this._then(void 0,t,void 0,void 0,void 0)},e.prototype.reflect=function(){return this._then(i,i,void 0,this,void 0)},e.prototype.then=function(t,e,r){if(v()&&arguments.length>0&&"function"!=typeof t&&"function"!=typeof e){var n=".then() only accepts functions but was passed: "+s.classString(t);arguments.length>1&&(n+=", "+s.classString(e)),this._warn(n)}return this._then(t,e,r,void 0,void 0)},e.prototype.done=function(t,e,r){var n=this._then(t,e,r,void 0,void 0);n._setIsFinal()},e.prototype.spread=function(t,e){return this.all()._then(t,e,void 0,h,void 0)},e.prototype.isCancellable=function(){return!this.isResolved()&&this._cancellable()
-},e.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},e.prototype.all=function(){return new _(this).promise()},e.prototype.error=function(t){return this.caught(s.originatesFromRejection,t)},e.is=function(t){return t instanceof e},e.fromNode=function(t){var r=new e(l),n=w(t)(j(r));return n===b&&r._rejectCallback(n.e,!0,!0),r},e.all=function(t){return new _(t).promise()},e.defer=e.pending=function(){var t=new e(l);return new m(t)},e.cast=function(t){var r=f(t);if(!(r instanceof e)){var n=r;r=new e(l),r._fulfillUnchecked(n)}return r},e.resolve=e.fulfilled=e.cast,e.reject=e.rejected=function(t){var r=new e(l);return r._captureStackTrace(),r._rejectCallback(t,!0),r},e.setScheduler=function(t){if("function"!=typeof t)throw new c("fn must be a function\n\n See http://goo.gl/916lJJ\n");var e=a._schedule;return a._schedule=t,e},e.prototype._then=function(t,r,n,i,o){var s=void 0!==o,u=s?o:new e(l);s||(u._propagateFrom(this,5),u._captureStackTrace());var c=this._target();c!==this&&(void 0===i&&(i=this._boundTo),s||u._setIsMigrated());var h=c._addCallbacks(t,r,n,u,i);return c._isResolved()&&!c._isSettlePromisesQueued()&&a.invoke(c._settlePromiseAtPostResolution,c,h),u},e.prototype._settlePromiseAtPostResolution=function(t){this._isRejectionUnhandled()&&this._unsetRejectionIsUnhandled(),this._settlePromiseAt(t)},e.prototype._length=function(){return 131071&this._bitField},e.prototype._isFollowingOrFulfilledOrRejected=function(){return(939524096&this._bitField)>0},e.prototype._isFollowing=function(){return 536870912===(536870912&this._bitField)},e.prototype._setLength=function(t){this._bitField=-131072&this._bitField|131071&t},e.prototype._setFulfilled=function(){this._bitField=268435456|this._bitField},e.prototype._setRejected=function(){this._bitField=134217728|this._bitField},e.prototype._setFollowing=function(){this._bitField=536870912|this._bitField},e.prototype._setIsFinal=function(){this._bitField=33554432|this._bitField},e.prototype._isFinal=function(){return(33554432&this._bitField)>0},e.prototype._cancellable=function(){return(67108864&this._bitField)>0},e.prototype._setCancellable=function(){this._bitField=67108864|this._bitField},e.prototype._unsetCancellable=function(){this._bitField=-67108865&this._bitField},e.prototype._setIsMigrated=function(){this._bitField=4194304|this._bitField},e.prototype._unsetIsMigrated=function(){this._bitField=-4194305&this._bitField},e.prototype._isMigrated=function(){return(4194304&this._bitField)>0},e.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[5*t-5+4];return void 0===e&&this._isBound()?this._boundTo:e},e.prototype._promiseAt=function(t){return 0===t?this._promise0:this[5*t-5+3]},e.prototype._fulfillmentHandlerAt=function(t){return 0===t?this._fulfillmentHandler0:this[5*t-5+0]},e.prototype._rejectionHandlerAt=function(t){return 0===t?this._rejectionHandler0:this[5*t-5+1]},e.prototype._migrateCallbacks=function(t,r){var n=t._fulfillmentHandlerAt(r),i=t._rejectionHandlerAt(r),o=t._progressHandlerAt(r),s=t._promiseAt(r),a=t._receiverAt(r);s instanceof e&&s._setIsMigrated(),this._addCallbacks(n,i,o,s,a)},e.prototype._addCallbacks=function(t,e,r,n,i){var o=this._length();if(o>=131066&&(o=0,this._setLength(0)),0===o)this._promise0=n,void 0!==i&&(this._receiver0=i),"function"!=typeof t||this._isCarryingStackTrace()||(this._fulfillmentHandler0=t),"function"==typeof e&&(this._rejectionHandler0=e),"function"==typeof r&&(this._progressHandler0=r);else{var s=5*o-5;this[s+3]=n,this[s+4]=i,"function"==typeof t&&(this[s+0]=t),"function"==typeof e&&(this[s+1]=e),"function"==typeof r&&(this[s+2]=r)}return this._setLength(o+1),o},e.prototype._setProxyHandlers=function(t,e){var r=this._length();if(r>=131066&&(r=0,this._setLength(0)),0===r)this._promise0=e,this._receiver0=t;else{var n=5*r-5;this[n+3]=e,this[n+4]=t}this._setLength(r+1)},e.prototype._proxyPromiseArray=function(t,e){this._setProxyHandlers(t,e)},e.prototype._resolveCallback=function(t,r){if(!this._isFollowingOrFulfilledOrRejected()){if(t===this)return this._rejectCallback(n(),!1,!0);var i=f(t,this);if(!(i instanceof e))return this._fulfill(t);var o=1|(r?4:0);this._propagateFrom(i,o);var s=i._target();if(s._isPending()){for(var a=this._length(),u=0;a>u;++u)s._migrateCallbacks(this,u);this._setFollowing(),this._setLength(0),this._setFollowee(s)}else s._isFulfilled()?this._fulfillUnchecked(s._value()):this._rejectUnchecked(s._reason(),s._getCarriedStackTrace())}},e.prototype._rejectCallback=function(t,e,r){r||s.markAsOriginatingFromRejection(t);var n=s.ensureErrorObject(t),i=n===t;this._attachExtraTrace(n,e?i:!1),this._reject(t,i?void 0:n)},e.prototype._resolveFromResolver=function(t){var e=this;this._captureStackTrace(),this._pushContext();var r=!0,n=w(t)(function(t){null!==e&&(e._resolveCallback(t),e=null)},function(t){null!==e&&(e._rejectCallback(t,r),e=null)});r=!1,this._popContext(),void 0!==n&&n===b&&null!==e&&(e._rejectCallback(n.e,!0,!0),e=null)},e.prototype._settlePromiseFromHandler=function(t,e,r,i){if(!i._isRejected()){i._pushContext();var o;if(o=e!==h||this._isRejected()?w(t).call(e,r):w(t).apply(this._boundTo,r),i._popContext(),o===b||o===i||o===p){var s=o===i?n():o.e;i._rejectCallback(s,!1,!0)}else i._resolveCallback(o)}},e.prototype._target=function(){for(var t=this;t._isFollowing();)t=t._followee();return t},e.prototype._followee=function(){return this._rejectionHandler0},e.prototype._setFollowee=function(t){this._rejectionHandler0=t},e.prototype._cleanValues=function(){this._cancellable()&&(this._cancellationParent=void 0)},e.prototype._propagateFrom=function(t,e){(1&e)>0&&t._cancellable()&&(this._setCancellable(),this._cancellationParent=t),(4&e)>0&&t._isBound()&&this._setBoundTo(t._boundTo)},e.prototype._fulfill=function(t){this._isFollowingOrFulfilledOrRejected()||this._fulfillUnchecked(t)},e.prototype._reject=function(t,e){this._isFollowingOrFulfilledOrRejected()||this._rejectUnchecked(t,e)},e.prototype._settlePromiseAt=function(t){var r=this._promiseAt(t),n=r instanceof e;if(n&&r._isMigrated())return r._unsetIsMigrated(),a.invoke(this._settlePromiseAt,this,t);var i=this._isFulfilled()?this._fulfillmentHandlerAt(t):this._rejectionHandlerAt(t),o=this._isCarryingStackTrace()?this._getCarriedStackTrace():void 0,s=this._settledValue,u=this._receiverAt(t);this._clearCallbackDataAtIndex(t),"function"==typeof i?n?this._settlePromiseFromHandler(i,u,s,r):i.call(u,s,r):u instanceof _?u._isResolved()||(this._isFulfilled()?u._promiseFulfilled(s,r):u._promiseRejected(s,r)):n&&(this._isFulfilled()?r._fulfill(s):r._reject(s,o)),t>=4&&4===(31&t)&&a.invokeLater(this._setLength,this,0)},e.prototype._clearCallbackDataAtIndex=function(t){if(0===t)this._isCarryingStackTrace()||(this._fulfillmentHandler0=void 0),this._rejectionHandler0=this._progressHandler0=this._receiver0=this._promise0=void 0;else{var e=5*t-5;this[e+3]=this[e+4]=this[e+0]=this[e+1]=this[e+2]=void 0}},e.prototype._isSettlePromisesQueued=function(){return-1073741824===(-1073741824&this._bitField)},e.prototype._setSettlePromisesQueued=function(){this._bitField=-1073741824|this._bitField},e.prototype._unsetSettlePromisesQueued=function(){this._bitField=1073741823&this._bitField},e.prototype._queueSettlePromises=function(){a.settlePromises(this),this._setSettlePromisesQueued()},e.prototype._fulfillUnchecked=function(t){if(t===this){var e=n();return this._attachExtraTrace(e),this._rejectUnchecked(e,void 0)}this._setFulfilled(),this._settledValue=t,this._cleanValues(),this._length()>0&&this._queueSettlePromises()},e.prototype._rejectUncheckedCheckError=function(t){var e=s.ensureErrorObject(t);this._rejectUnchecked(t,e===t?void 0:e)},e.prototype._rejectUnchecked=function(t,e){if(t===this){var r=n();return this._attachExtraTrace(r),this._rejectUnchecked(r)}return this._setRejected(),this._settledValue=t,this._cleanValues(),this._isFinal()?void a.throwLater(function(t){throw"stack"in t&&a.invokeFirst(d.unhandledRejection,void 0,t),t},void 0===e?t:e):(void 0!==e&&e!==t&&this._setCarriedStackTrace(e),void(this._length()>0?this._queueSettlePromises():this._ensurePossibleRejectionHandled()))},e.prototype._settlePromises=function(){this._unsetSettlePromisesQueued();for(var t=this._length(),e=0;t>e;e++)this._settlePromiseAt(e)},e._makeSelfResolutionError=n,t("./progress.js")(e,_),t("./method.js")(e,l,f,o),t("./bind.js")(e,l,f),t("./finally.js")(e,p,f),t("./direct_resolve.js")(e),t("./synchronous_inspection.js")(e),t("./join.js")(e,_,f,l),e.Promise=e,t("./map.js")(e,_,o,f,l),t("./cancel.js")(e),t("./using.js")(e,o,f,y),t("./generators.js")(e,o,l,f),t("./nodeify.js")(e),t("./call_get.js")(e),t("./props.js")(e,_,f,o),t("./race.js")(e,l,f,o),t("./reduce.js")(e,_,o,f,l),t("./settle.js")(e,_),t("./some.js")(e,_,o),t("./promisify.js")(e,l),t("./any.js")(e),t("./each.js")(e,l),t("./timers.js")(e,l),t("./filter.js")(e,l),s.toFastProperties(e),s.toFastProperties(e.prototype),r({a:1}),r({b:2}),r({c:3}),r(1),r(function(){}),r(void 0),r(!1),r(new e(l)),d.setBounds(a.firstLineError,s.lastLineError),e}},{"./any.js":1,"./async.js":2,"./bind.js":3,"./call_get.js":5,"./cancel.js":6,"./captured_trace.js":7,"./catch_filter.js":8,"./context.js":9,"./debuggability.js":10,"./direct_resolve.js":11,"./each.js":12,"./errors.js":13,"./filter.js":15,"./finally.js":16,"./generators.js":17,"./join.js":18,"./map.js":19,"./method.js":20,"./nodeify.js":21,"./progress.js":22,"./promise_array.js":24,"./promise_resolver.js":25,"./promisify.js":26,"./props.js":27,"./race.js":29,"./reduce.js":30,"./settle.js":32,"./some.js":33,"./synchronous_inspection.js":34,"./thenables.js":35,"./timers.js":36,"./using.js":37,"./util.js":38}],24:[function(t,e){"use strict";e.exports=function(e,r,n,i){function o(t){switch(t){case-2:return[];case-3:return{}}}function s(t){var n,i=this._promise=new e(r);t instanceof e&&(n=t,i._propagateFrom(n,5)),this._values=t,this._length=0,this._totalResolved=0,this._init(void 0,-2)}var a=t("./util.js"),u=a.isArray;return s.prototype.length=function(){return this._length},s.prototype.promise=function(){return this._promise},s.prototype._init=function c(t,r){var s=n(this._values,this._promise);if(s instanceof e){if(s=s._target(),this._values=s,!s._isFulfilled())return s._isPending()?void s._then(c,this._reject,void 0,this,r):void this._reject(s._reason());if(s=s._value(),!u(s)){var a=new e.TypeError("expecting an array, a promise or a thenable\n\n See http://goo.gl/s8MMhc\n");return void this.__hardReject__(a)}}else if(!u(s))return void this._promise._reject(i("expecting an array, a promise or a thenable\n\n See http://goo.gl/s8MMhc\n")._reason());if(0===s.length)return void(-5===r?this._resolveEmptyArray():this._resolve(o(r)));var l=this.getActualLength(s.length);this._length=l,this._values=this.shouldCopyValues()?new Array(l):this._values;for(var h=this._promise,p=0;l>p;++p){var f=this._isResolved(),_=n(s[p],h);_ instanceof e?(_=_._target(),f?_._unsetRejectionIsUnhandled():_._isPending()?_._proxyPromiseArray(this,p):_._isFulfilled()?this._promiseFulfilled(_._value(),p):this._promiseRejected(_._reason(),p)):f||this._promiseFulfilled(_,p)}},s.prototype._isResolved=function(){return null===this._values},s.prototype._resolve=function(t){this._values=null,this._promise._fulfill(t)},s.prototype.__hardReject__=s.prototype._reject=function(t){this._values=null,this._promise._rejectCallback(t,!1,!0)},s.prototype._promiseProgressed=function(t,e){this._promise._progress({index:e,value:t})},s.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var r=++this._totalResolved;r>=this._length&&this._resolve(this._values)},s.prototype._promiseRejected=function(t){this._totalResolved++,this._reject(t)},s.prototype.shouldCopyValues=function(){return!0},s.prototype.getActualLength=function(t){return t},s}},{"./util.js":38}],25:[function(t,e){"use strict";function r(t){return t instanceof Error&&p.getPrototypeOf(t)===Error.prototype}function n(t){var e;if(r(t)){e=new l(t),e.name=t.name,e.message=t.message,e.stack=t.stack;for(var n=p.keys(t),i=0;i<n.length;++i){var o=n[i];f.test(o)||(e[o]=t[o])}return e}return s.markAsOriginatingFromRejection(t),t}function i(t){return function(e,r){if(null!==t){if(e){var i=n(a(e));t._attachExtraTrace(i),t._reject(i)}else if(arguments.length>2){for(var o=arguments.length,s=new Array(o-1),u=1;o>u;++u)s[u-1]=arguments[u];t._fulfill(s)}else t._fulfill(r);t=null}}}var o,s=t("./util.js"),a=s.maybeWrapAsError,u=t("./errors.js"),c=u.TimeoutError,l=u.OperationalError,h=s.haveGetters,p=t("./es5.js"),f=/^(?:name|message|stack|cause)$/;if(o=h?function(t){this.promise=t}:function(t){this.promise=t,this.asCallback=i(t),this.callback=this.asCallback},h){var _={get:function(){return i(this.promise)}};p.defineProperty(o.prototype,"asCallback",_),p.defineProperty(o.prototype,"callback",_)}o._nodebackForPromise=i,o.prototype.toString=function(){return"[object PromiseResolver]"},o.prototype.resolve=o.prototype.fulfill=function(t){if(!(this instanceof o))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n");this.promise._resolveCallback(t)},o.prototype.reject=function(t){if(!(this instanceof o))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n");this.promise._rejectCallback(t)},o.prototype.progress=function(t){if(!(this instanceof o))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n");this.promise._progress(t)},o.prototype.cancel=function(t){this.promise.cancel(t)},o.prototype.timeout=function(){this.reject(new c("timeout"))},o.prototype.isResolved=function(){return this.promise.isResolved()},o.prototype.toJSON=function(){return this.promise.toJSON()},e.exports=o},{"./errors.js":13,"./es5.js":14,"./util.js":38}],26:[function(t,e){"use strict";e.exports=function(e,r){function n(t){return!b.test(t)}function i(t){try{return t.__isPromisified__===!0}catch(e){return!1}}function o(t,e,r){var n=f.getDataPropertyOrDefault(t,e+r,j);return n?i(n):!1}function s(t,e,r){for(var n=0;n<t.length;n+=2){var i=t[n];if(r.test(i))for(var o=i.replace(r,""),s=0;s<t.length;s+=2)if(t[s]===o)throw new g("Cannot promisify an API that has normal methods with '%s'-suffix\n\n See http://goo.gl/iWrZbw\n".replace("%s",e))}}function a(t,e,r,n){for(var a=f.inheritedDataKeys(t),u=[],c=0;c<a.length;++c){var l=a[c],h=t[l],p=n===w?!0:w(l,h,t);"function"!=typeof h||i(h)||o(t,l,e)||!n(l,h,t,p)||u.push(l,h)}return s(u,e,r),u}function u(t,n,i,o){function s(){var i=n;n===p&&(i=this);var o=new e(r);o._captureStackTrace();var s="string"==typeof u&&this!==a?this[u]:t,c=_(o);try{s.apply(i,d(arguments,c))}catch(l){o._rejectCallback(v(l),!0,!0)}return o}var a=function(){return this}(),u=t;return"string"==typeof u&&(t=o),s.__isPromisified__=!0,s}function c(t,e,r,n){for(var i=new RegExp(k(e)+"$"),o=a(t,e,i,r),s=0,u=o.length;u>s;s+=2){var c=o[s],l=o[s+1],h=c+e;t[h]=n===E?E(c,p,c,l,e):n(l,function(){return E(c,p,c,l,e)})}return f.toFastProperties(t),t}function l(t,e){return E(t,e,void 0,t)}var h,p={},f=t("./util.js"),_=t("./promise_resolver.js")._nodebackForPromise,d=f.withAppended,v=f.maybeWrapAsError,y=f.canEvaluate,g=t("./errors").TypeError,m="Async",j={__isPromisified__:!0},b=/^(?:length|name|arguments|caller|callee|prototype|__isPromisified__)$/,w=function(t,e){return f.isIdentifier(t)&&"_"!==t.charAt(0)&&!f.isClass(e)},k=function(t){return t.replace(/([$])/,"\\$")},E=y?h:u;e.promisify=function(t,e){if("function"!=typeof t)throw new g("fn must be a function\n\n See http://goo.gl/916lJJ\n");if(i(t))return t;var r=l(t,arguments.length<2?p:e);return f.copyDescriptors(t,r,n),r},e.promisifyAll=function(t,e){if("function"!=typeof t&&"object"!=typeof t)throw new g("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/9ITlV0\n");e=Object(e);var r=e.suffix;"string"!=typeof r&&(r=m);var n=e.filter;"function"!=typeof n&&(n=w);var i=e.promisifier;if("function"!=typeof i&&(i=E),!f.isIdentifier(r))throw new RangeError("suffix must be a valid identifier\n\n See http://goo.gl/8FZo5V\n");for(var o=f.inheritedDataKeys(t),s=0;s<o.length;++s){var a=t[o[s]];"constructor"!==o[s]&&f.isClass(a)&&(c(a.prototype,r,n,i),c(a,r,n,i))}return c(t,r,n,i)}}},{"./errors":13,"./promise_resolver.js":25,"./util.js":38}],27:[function(t,e){"use strict";e.exports=function(e,r,n,i){function o(t){for(var e=c.keys(t),r=e.length,n=new Array(2*r),i=0;r>i;++i){var o=e[i];n[i]=t[o],n[i+r]=o}this.constructor$(n)}function s(t){var r,s=n(t);return u(s)?(r=s instanceof e?s._then(e.props,void 0,void 0,void 0,void 0):new o(s).promise(),s instanceof e&&r._propagateFrom(s,4),r):i("cannot await properties of a non-object\n\n See http://goo.gl/OsFKC8\n")}var a=t("./util.js"),u=a.isObject,c=t("./es5.js");a.inherits(o,r),o.prototype._init=function(){this._init$(void 0,-3)},o.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var r=++this._totalResolved;if(r>=this._length){for(var n={},i=this.length(),o=0,s=this.length();s>o;++o)n[this._values[o+i]]=this._values[o];this._resolve(n)}},o.prototype._promiseProgressed=function(t,e){this._promise._progress({key:this._values[e+this.length()],value:t})},o.prototype.shouldCopyValues=function(){return!1},o.prototype.getActualLength=function(t){return t>>1},e.prototype.props=function(){return s(this)},e.props=function(t){return s(t)}}},{"./es5.js":14,"./util.js":38}],28:[function(t,e){"use strict";function r(t,e,r,n,i){for(var o=0;i>o;++o)r[o+n]=t[o+e],t[o+e]=void 0}function n(t){this._capacity=t,this._length=0,this._front=0}n.prototype._willBeOverCapacity=function(t){return this._capacity<t},n.prototype._pushOne=function(t){var e=this.length();this._checkCapacity(e+1);var r=this._front+e&this._capacity-1;this[r]=t,this._length=e+1},n.prototype._unshiftOne=function(t){var e=this._capacity;this._checkCapacity(this.length()+1);var r=this._front,n=(r-1&e-1^e)-e;this[n]=t,this._front=n,this._length=this.length()+1},n.prototype.unshift=function(t,e,r){this._unshiftOne(r),this._unshiftOne(e),this._unshiftOne(t)},n.prototype.push=function(t,e,r){var n=this.length()+3;if(this._willBeOverCapacity(n))return this._pushOne(t),this._pushOne(e),void this._pushOne(r);var i=this._front+n-3;this._checkCapacity(n);var o=this._capacity-1;this[i+0&o]=t,this[i+1&o]=e,this[i+2&o]=r,this._length=n},n.prototype.shift=function(){var t=this._front,e=this[t];return this[t]=void 0,this._front=t+1&this._capacity-1,this._length--,e},n.prototype.length=function(){return this._length},n.prototype._checkCapacity=function(t){this._capacity<t&&this._resizeTo(this._capacity<<1)},n.prototype._resizeTo=function(t){var e=this._capacity;this._capacity=t;var n=this._front,i=this._length,o=n+i&e-1;r(this,0,this,e,o)},e.exports=n},{}],29:[function(t,e){"use strict";e.exports=function(e,r,n,i){function o(t,o){var u=n(t);if(u instanceof e)return a(u);if(!s(t))return i("expecting an array, a promise or a thenable\n\n See http://goo.gl/s8MMhc\n");var c=new e(r);void 0!==o&&c._propagateFrom(o,5);for(var l=c._fulfill,h=c._reject,p=0,f=t.length;f>p;++p){var _=t[p];(void 0!==_||p in t)&&e.cast(_)._then(l,h,void 0,c,null)}return c}var s=t("./util.js").isArray,a=function(t){return t.then(function(e){return o(e,t)})};e.race=function(t){return o(t,void 0)},e.prototype.race=function(){return o(this,void 0)}}},{"./util.js":38}],30:[function(t,e){"use strict";e.exports=function(e,r,n,i,o){function s(t,r,n,s){this.constructor$(t),this._promise._captureStackTrace(),this._preservedValues=s===o?[]:null,this._zerothIsAccum=void 0===n,this._gotAccum=!1,this._reducingIndex=this._zerothIsAccum?1:0,this._valuesPhase=void 0;var u=i(n,this._promise),l=!1,h=u instanceof e;h&&(u=u._target(),u._isPending()?u._proxyPromiseArray(this,-1):u._isFulfilled()?(n=u._value(),this._gotAccum=!0):(this._reject(u._reason()),l=!0)),h||this._zerothIsAccum||(this._gotAccum=!0),this._callback=r,this._accum=n,l||c.invoke(a,this,void 0)}function a(){this._init$(void 0,-5)}function u(t,e,r,i){if("function"!=typeof e)return n("fn must be a function\n\n See http://goo.gl/916lJJ\n");var o=new s(t,e,r,i);return o.promise()}var c=t("./async.js"),l=t("./util.js"),h=l.tryCatch,p=l.errorObj;l.inherits(s,r),s.prototype._init=function(){},s.prototype._resolveEmptyArray=function(){(this._gotAccum||this._zerothIsAccum)&&this._resolve(null!==this._preservedValues?[]:this._accum)},s.prototype._promiseFulfilled=function(t,r){var n=this._values;n[r]=t;var o,s=this.length(),a=this._preservedValues,u=null!==a,c=this._gotAccum,l=this._valuesPhase;if(!l)for(l=this._valuesPhase=new Array(s),o=0;s>o;++o)l[o]=0;if(o=l[r],0===r&&this._zerothIsAccum?(this._accum=t,this._gotAccum=c=!0,l[r]=0===o?1:2):-1===r?(this._accum=t,this._gotAccum=c=!0):0===o?l[r]=1:(l[r]=2,this._accum=t),c){for(var f,_=this._callback,d=this._promise._boundTo,v=this._reducingIndex;s>v;++v)if(o=l[v],2!==o){if(1!==o)return;if(t=n[v],this._promise._pushContext(),u?(a.push(t),f=h(_).call(d,t,v,s)):f=h(_).call(d,this._accum,t,v,s),this._promise._popContext(),f===p)return this._reject(f.e);var y=i(f,this._promise);if(y instanceof e){if(y=y._target(),y._isPending())return l[v]=4,y._proxyPromiseArray(this,v);if(!y._isFulfilled())return this._reject(y._reason());f=y._value()}this._reducingIndex=v+1,this._accum=f}else this._reducingIndex=v+1;this._resolve(u?a:this._accum)}},e.prototype.reduce=function(t,e){return u(this,t,e,null)},e.reduce=function(t,e,r,n){return u(t,e,r,n)}}},{"./async.js":2,"./util.js":38}],31:[function(t,e){"use strict";var r,n=t("./util"),i=function(){throw new Error("No async scheduler available\n\n See http://goo.gl/m3OTXk\n")};if(n.isNode&&"undefined"==typeof MutationObserver){var o=global.setImmediate,s=process.nextTick;r=n.isRecentNode?function(t){o.call(global,t)}:function(t){s.call(process,t)}}else"undefined"!=typeof MutationObserver?(r=function(t){var e=document.createElement("div"),r=new MutationObserver(t);return r.observe(e,{attributes:!0}),function(){e.classList.toggle("foo")}},r.isStatic=!0):r="undefined"!=typeof setImmediate?function(t){setImmediate(t)}:"undefined"!=typeof setTimeout?function(t){setTimeout(t,0)}:i;e.exports=r},{"./util":38}],32:[function(t,e){"use strict";e.exports=function(e,r){function n(t){this.constructor$(t)}var i=e.PromiseInspection,o=t("./util.js");o.inherits(n,r),n.prototype._promiseResolved=function(t,e){this._values[t]=e;var r=++this._totalResolved;r>=this._length&&this._resolve(this._values)},n.prototype._promiseFulfilled=function(t,e){var r=new i;r._bitField=268435456,r._settledValue=t,this._promiseResolved(e,r)},n.prototype._promiseRejected=function(t,e){var r=new i;r._bitField=134217728,r._settledValue=t,this._promiseResolved(e,r)},e.settle=function(t){return new n(t).promise()},e.prototype.settle=function(){return new n(this).promise()}}},{"./util.js":38}],33:[function(t,e){"use strict";e.exports=function(e,r,n){function i(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1}function o(t,e){if((0|e)!==e||0>e)return n("expecting a positive integer\n\n See http://goo.gl/1wAmHx\n");var r=new i(t),o=r.promise();return r.setHowMany(e),r.init(),o}var s=t("./util.js"),a=t("./errors.js").RangeError,u=t("./errors.js").AggregateError,c=s.isArray;s.inherits(i,r),i.prototype._init=function(){if(this._initialized){if(0===this._howMany)return void this._resolve([]);this._init$(void 0,-5);var t=c(this._values);!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}},i.prototype.init=function(){this._initialized=!0,this._init()},i.prototype.setUnwrap=function(){this._unwrap=!0},i.prototype.howMany=function(){return this._howMany},i.prototype.setHowMany=function(t){this._howMany=t},i.prototype._promiseFulfilled=function(t){this._addFulfilled(t),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),this._resolve(1===this.howMany()&&this._unwrap?this._values[0]:this._values))},i.prototype._promiseRejected=function(t){if(this._addRejected(t),this.howMany()>this._canPossiblyFulfill()){for(var e=new u,r=this.length();r<this._values.length;++r)e.push(this._values[r]);this._reject(e)}},i.prototype._fulfilled=function(){return this._totalResolved},i.prototype._rejected=function(){return this._values.length-this.length()},i.prototype._addRejected=function(t){this._values.push(t)},i.prototype._addFulfilled=function(t){this._values[this._totalResolved++]=t},i.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},i.prototype._getRangeError=function(t){var e="Input array must contain at least "+this._howMany+" items but contains only "+t+" items";return new a(e)},i.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},e.some=function(t,e){return o(t,e)},e.prototype.some=function(t){return o(this,t)},e._SomePromiseArray=i}},{"./errors.js":13,"./util.js":38}],34:[function(t,e){"use strict";e.exports=function(t){function e(t){void 0!==t?(t=t._target(),this._bitField=t._bitField,this._settledValue=t._settledValue):(this._bitField=0,this._settledValue=void 0)}e.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/hc1DLj\n");return this._settledValue},e.prototype.error=e.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/hPuiwB\n");return this._settledValue},e.prototype.isFulfilled=t.prototype._isFulfilled=function(){return(268435456&this._bitField)>0},e.prototype.isRejected=t.prototype._isRejected=function(){return(134217728&this._bitField)>0},e.prototype.isPending=t.prototype._isPending=function(){return 0===(402653184&this._bitField)},e.prototype.isResolved=t.prototype._isResolved=function(){return(402653184&this._bitField)>0},t.prototype.isPending=function(){return this._target()._isPending()},t.prototype.isRejected=function(){return this._target()._isRejected()},t.prototype.isFulfilled=function(){return this._target()._isFulfilled()},t.prototype.isResolved=function(){return this._target()._isResolved()},t.prototype._value=function(){return this._settledValue},t.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue},t.prototype.value=function(){var t=this._target();if(!t.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/hc1DLj\n");return t._settledValue},t.prototype.reason=function(){var t=this._target();if(!t.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/hPuiwB\n");return t._unsetRejectionIsUnhandled(),t._settledValue},t.PromiseInspection=e}},{}],35:[function(t,e){"use strict";e.exports=function(e,r){function n(t,n){if(c(t)){if(t instanceof e)return t;if(o(t)){var l=new e(r);return t._then(l._fulfillUnchecked,l._rejectUncheckedCheckError,l._progressUnchecked,l,null),l}var h=a.tryCatch(i)(t);if(h===u){n&&n._pushContext();var l=e.reject(h.e);return n&&n._popContext(),l}if("function"==typeof h)return s(t,h,n)}return t}function i(t){return t.then}function o(t){return l.call(t,"_promise0")}function s(t,n,i){function o(r){l&&(t===r?l._rejectCallback(e._makeSelfResolutionError(),!1,!0):l._resolveCallback(r),l=null)}function s(t){l&&(l._rejectCallback(t,p,!0),l=null)}function c(t){l&&"function"==typeof l._progress&&l._progress(t)}var l=new e(r),h=l;i&&i._pushContext(),l._captureStackTrace(),i&&i._popContext();var p=!0,f=a.tryCatch(n).call(t,o,s,c);return p=!1,l&&f===u&&(l._rejectCallback(f.e,!0,!0),l=null),h}var a=t("./util.js"),u=a.errorObj,c=a.isObject,l={}.hasOwnProperty;return n}},{"./util.js":38}],36:[function(t,e){"use strict";e.exports=function(e,r){function n(t){var e=this;return e instanceof Number&&(e=+e),clearTimeout(e),t}function i(t){var e=this;throw e instanceof Number&&(e=+e),clearTimeout(e),t}var o=t("./util.js"),s=e.TimeoutError,a=function(t,e){if(t.isPending()){"string"!=typeof e&&(e="operation timed out");var r=new s(e);o.markAsOriginatingFromRejection(r),t._attachExtraTrace(r),t._cancel(r)}},u=function(t){return c(+this).thenReturn(t)},c=e.delay=function(t,n){if(void 0===n){n=t,t=void 0;var i=new e(r);return setTimeout(function(){i._fulfill()},n),i}return n=+n,e.resolve(t)._then(u,null,null,n,void 0)};e.prototype.delay=function(t){return c(this,t)},e.prototype.timeout=function(t,e){t=+t;var r=this.then().cancellable();r._cancellationParent=this;var o=setTimeout(function(){a(r,e)},t);return r._then(n,i,void 0,o,void 0)}}},{"./util.js":38}],37:[function(t,e){"use strict";e.exports=function(e,r,n,i){function o(t){for(var r=t.length,n=0;r>n;++n){var i=t[n];if(i.isRejected())return e.reject(i.error());t[n]=i._settledValue}return t}function s(t){setTimeout(function(){throw t},0)}function a(t){var e=n(t);return e!==t&&"function"==typeof t._isDisposable&&"function"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e}function u(t,r){function i(){if(o>=u)return c.resolve();var l=a(t[o++]);if(l instanceof e&&l._isDisposable()){try{l=n(l._getDisposer().tryDispose(r),t.promise)}catch(h){return s(h)}if(l instanceof e)return l._then(i,s,null,null,null)}i()}var o=0,u=t.length,c=e.defer();return i(),c.promise}function c(t){var e=new v;return e._settledValue=t,e._bitField=268435456,u(this,e).thenReturn(t)}function l(t){var e=new v;return e._settledValue=t,e._bitField=134217728,u(this,e).thenThrow(t)}function h(t,e,r){this._data=t,this._promise=e,this._context=r}function p(t,e,r){this.constructor$(t,e,r)}function f(t){return h.isDisposer(t)?(this.resources[this.index]._setDisposable(t),t.promise()):t}var _=t("./errors.js").TypeError,d=t("./util.js").inherits,v=e.PromiseInspection;h.prototype.data=function(){return this._data},h.prototype.promise=function(){return this._promise},h.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():null},h.prototype.tryDispose=function(t){var e=this.resource(),r=this._context;void 0!==r&&r._pushContext();var n=null!==e?this.doDispose(e,t):null;return void 0!==r&&r._popContext(),this._promise._unsetDisposable(),this._data=null,n},h.isDisposer=function(t){return null!=t&&"function"==typeof t.resource&&"function"==typeof t.tryDispose},d(p,h),p.prototype.doDispose=function(t,e){var r=this.data();return r.call(t,t,e)},e.using=function(){var t=arguments.length;if(2>t)return r("you must pass at least 2 arguments to Promise.using");var i=arguments[t-1];if("function"!=typeof i)return r("fn must be a function\n\n See http://goo.gl/916lJJ\n");t--;for(var s=new Array(t),a=0;t>a;++a){var u=arguments[a];if(h.isDisposer(u)){var p=u;u=u.promise(),u._setDisposable(p)}else{var _=n(u);_ instanceof e&&(u=_._then(f,null,null,{resources:s,index:a},void 0))}s[a]=u}var d=e.settle(s).then(o).then(function(t){d._pushContext();var e;try{e=i.apply(void 0,t)}finally{d._popContext()}return e})._then(c,l,void 0,s,void 0);return s.promise=d,d},e.prototype._setDisposable=function(t){this._bitField=262144|this._bitField,this._disposer=t},e.prototype._isDisposable=function(){return(262144&this._bitField)>0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=-262145&this._bitField,this._disposer=void 0},e.prototype.disposer=function(t){if("function"==typeof t)return new p(t,this,i());throw new _}}},{"./errors.js":13,"./util.js":38}],38:[function(t,e,r){"use strict";function n(){try{return C.apply(this,arguments)}catch(t){return F.e=t,F
-}}function i(t){return C=t,n}function o(t){return null==t||t===!0||t===!1||"string"==typeof t||"number"==typeof t}function s(t){return!o(t)}function a(t){return o(t)?new Error(v(t)):t}function u(t,e){var r,n=t.length,i=new Array(n+1);for(r=0;n>r;++r)i[r]=t[r];return i[r]=e,i}function c(t,e,r){if(!w.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void 0;var n=Object.getOwnPropertyDescriptor(t,e);return null!=n?null==n.get&&null==n.set?n.value:r:void 0}function l(t,e,r){if(o(t))return t;var n={value:r,configurable:!0,enumerable:!1,writable:!0};return w.defineProperty(t,e,n),t}function h(t){throw t}function p(t){try{if("function"==typeof t){var e=w.names(t.prototype);return w.isES5?e.length>1:e.length>0&&!(1===e.length&&"constructor"===e[0])}return!1}catch(r){return!1}}function f(t){function e(){}e.prototype=t;for(var r=8;r--;)new e;return t}function _(t){return R.test(t)}function d(t,e,r){for(var n=new Array(t),i=0;t>i;++i)n[i]=e+i+r;return n}function v(t){try{return t+""}catch(e){return"[no string representation]"}}function y(t){try{l(t,"isOperational",!0)}catch(e){}}function g(t){return null==t?!1:t instanceof Error.__BluebirdErrorTypes__.OperationalError||t.isOperational===!0}function m(t){return t instanceof Error&&w.propertyIsWritable(t,"stack")}function j(t){return{}.toString.call(t)}function b(t,e,r){for(var n=w.names(t),i=0;i<n.length;++i){var o=n[i];r(o)&&w.defineProperty(e,o,w.getDescriptor(t,o))}}var w=t("./es5.js"),k="undefined"==typeof navigator,E=function(){try{var t={};return w.defineProperty(t,"f",{get:function(){return 3}}),3===t.f}catch(e){return!1}}(),F={e:{}},C,T=function(t,e){function r(){this.constructor=t,this.constructor$=e;for(var r in e.prototype)n.call(e.prototype,r)&&"$"!==r.charAt(r.length-1)&&(this[r+"$"]=e.prototype[r])}var n={}.hasOwnProperty;return r.prototype=e.prototype,t.prototype=new r,t.prototype},x=function(){return"string"!==this}.call("string"),P=function(){if(w.isES5){var t=Object.prototype,e=Object.getOwnPropertyNames;return function(r){for(var n=[],i=Object.create(null);null!=r&&r!==t;){var o;try{o=e(r)}catch(s){return n}for(var a=0;a<o.length;++a){var u=o[a];if(!i[u]){i[u]=!0;var c=Object.getOwnPropertyDescriptor(r,u);null!=c&&null==c.get&&null==c.set&&n.push(u)}}r=w.getPrototypeOf(r)}return n}}return function(t){var e=[];for(var r in t)e.push(r);return e}}(),R=/^[a-z$_][a-z$_0-9]*$/i,A=function(){return"stack"in new Error?function(t){return m(t)?t:new Error(v(t))}:function(t){if(m(t))return t;try{throw new Error(v(t))}catch(e){return e}}}(),S={isClass:p,isIdentifier:_,inheritedDataKeys:P,getDataPropertyOrDefault:c,thrower:h,isArray:w.isArray,haveGetters:E,notEnumerableProp:l,isPrimitive:o,isObject:s,canEvaluate:k,errorObj:F,tryCatch:i,inherits:T,withAppended:u,maybeWrapAsError:a,wrapsPrimitiveReceiver:x,toFastProperties:f,filledRange:d,toString:v,canAttachTrace:m,ensureErrorObject:A,originatesFromRejection:g,markAsOriginatingFromRejection:y,classString:j,copyDescriptors:b,hasDevTools:"undefined"!=typeof chrome&&chrome&&"function"==typeof chrome.loadTimes,isNode:"undefined"!=typeof process&&"[object process]"===j(process).toLowerCase()};S.isRecentNode=S.isNode&&function(){var t=process.versions.node.split(".").map(Number);return 0===t[0]&&t[1]>10||t[0]>0}();try{throw new Error}catch(O){S.lastLineError=O}e.exports=S},{"./es5.js":14}],39:[function(t,e){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(t){return"function"==typeof t}function i(t){return"number"==typeof t}function o(t){return"object"==typeof t&&null!==t}function s(t){return void 0===t}e.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(t){if(!i(t)||0>t||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},r.prototype.emit=function(t){var e,r,i,a,u,c;if(this._events||(this._events={}),"error"===t&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if(e=arguments[1],e instanceof Error)throw e;throw TypeError('Uncaught, unspecified "error" event.')}if(r=this._events[t],s(r))return!1;if(n(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:for(i=arguments.length,a=new Array(i-1),u=1;i>u;u++)a[u-1]=arguments[u];r.apply(this,a)}else if(o(r)){for(i=arguments.length,a=new Array(i-1),u=1;i>u;u++)a[u-1]=arguments[u];for(c=r.slice(),i=c.length,u=0;i>u;u++)c[u].apply(this,a)}return!0},r.prototype.addListener=function(t,e){var i;if(!n(e))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,n(e.listener)?e.listener:e),this._events[t]?o(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,o(this._events[t])&&!this._events[t].warned){var i;i=s(this._maxListeners)?r.defaultMaxListeners:this._maxListeners,i&&i>0&&this._events[t].length>i&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace())}return this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(t,e){function r(){this.removeListener(t,r),i||(i=!0,e.apply(this,arguments))}if(!n(e))throw TypeError("listener must be a function");var i=!1;return r.listener=e,this.on(t,r),this},r.prototype.removeListener=function(t,e){var r,i,s,a;if(!n(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],s=r.length,i=-1,r===e||n(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(r)){for(a=s;a-->0;)if(r[a]===e||r[a].listener&&r[a].listener===e){i=a;break}if(0>i)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(i,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},r.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[t],n(r))this.removeListener(t,r);else for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},r.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?n(this._events[t])?[this._events[t]]:this._events[t].slice():[]},r.listenerCount=function(t,e){var r;return r=t._events&&t._events[e]?n(t._events[e])?1:t._events[e].length:0}},{}]},{},[4])(4)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise); \ No newline at end of file
+!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.Promise=t()}}(function(){var t,e,r;return function n(t,e,r){function i(s,a){if(!e[s]){if(!t[s]){var u="function"==typeof _dereq_&&_dereq_;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=e[s]={exports:{}};t[s][0].call(l.exports,function(e){var r=t[s][1][e];return i(r?r:e)},l,l.exports,n,t,e,r)}return e[s].exports}for(var o="function"==typeof _dereq_&&_dereq_,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(t,e){"use strict";e.exports=function(t){function e(t){var e=new r(t),n=e.promise();return e.setHowMany(1),e.setUnwrap(),e.init(),n}var r=t._SomePromiseArray;t.any=function(t){return e(t)},t.prototype.any=function(){return e(this)}}},{}],2:[function(t,e){"use strict";function r(){this._isTickUsed=!1,this._lateQueue=new c(16),this._normalQueue=new c(16),this._trampolineEnabled=!0;var t=this;this.drainQueues=function(){t._drainQueues()},this._schedule=u.isStatic?u(this.drainQueues):u}function n(t,e,r){var n=this._getDomain();void 0!==n&&(t=n.bind(t)),this._lateQueue.push(t,e,r),this._queueTick()}function i(t,e,r){var n=this._getDomain();void 0!==n&&(t=n.bind(t)),this._normalQueue.push(t,e,r),this._queueTick()}function o(t){var e=this._getDomain();if(void 0!==e){var r=e.bind(t._settlePromises);this._normalQueue.push(r,t,void 0)}else this._normalQueue._pushOne(t);this._queueTick()}var s;try{throw new Error}catch(a){s=a}var u=t("./schedule.js"),c=t("./queue.js"),l=t("./util.js");r.prototype.disableTrampolineIfNecessary=function(){l.hasDevTools&&(this._trampolineEnabled=!1)},r.prototype.enableTrampoline=function(){this._trampolineEnabled||(this._trampolineEnabled=!0,this._schedule=function(t){setTimeout(t,0)})},r.prototype.haveItemsQueued=function(){return this._normalQueue.length()>0},r.prototype.throwLater=function(t,e){1===arguments.length&&(e=t,t=function(){throw e});var r=this._getDomain();if(void 0!==r&&(t=r.bind(t)),"undefined"!=typeof setTimeout)setTimeout(function(){t(e)},0);else try{this._schedule(function(){t(e)})}catch(n){throw new Error("No async scheduler available\n\n See http://goo.gl/m3OTXk\n")}},r.prototype._getDomain=function(){};l.hasDevTools?(u.isStatic&&(u=function(t){setTimeout(t,0)}),r.prototype.invokeLater=function(t,e,r){this._trampolineEnabled?n.call(this,t,e,r):this._schedule(function(){setTimeout(function(){t.call(e,r)},100)})},r.prototype.invoke=function(t,e,r){this._trampolineEnabled?i.call(this,t,e,r):this._schedule(function(){t.call(e,r)})},r.prototype.settlePromises=function(t){this._trampolineEnabled?o.call(this,t):this._schedule(function(){t._settlePromises()})}):(r.prototype.invokeLater=n,r.prototype.invoke=i,r.prototype.settlePromises=o),r.prototype.invokeFirst=function(t,e,r){var n=this._getDomain();void 0!==n&&(t=n.bind(t)),this._normalQueue.unshift(t,e,r),this._queueTick()},r.prototype._drainQueue=function(t){for(;t.length()>0;){var e=t.shift();if("function"==typeof e){var r=t.shift(),n=t.shift();e.call(r,n)}else e._settlePromises()}},r.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._drainQueue(this._lateQueue)},r.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},r.prototype._reset=function(){this._isTickUsed=!1},e.exports=new r,e.exports.firstLineError=s},{"./queue.js":28,"./schedule.js":31,"./util.js":38,events:39}],3:[function(t,e){"use strict";e.exports=function(t,e,r){var n=function(t,e){this._reject(e)},i=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(n,n,null,this,t)},o=function(t,e){this._setBoundTo(t),this._isPending()&&this._resolveCallback(e.target)},s=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(n){var a=r(n),u=new t(e);u._propagateFrom(this,1);var c=this._target();if(a instanceof t){var l={promiseRejectionQueued:!1,promise:u,target:c,bindingPromise:a};c._then(e,i,u._progress,u,l),a._then(o,s,u._progress,u,l)}else u._setBoundTo(n),u._resolveCallback(c);return u},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=131072|this._bitField,this._boundTo=t):this._bitField=-131073&this._bitField},t.prototype._isBound=function(){return 131072===(131072&this._bitField)},t.bind=function(n,i){var o=r(n),s=new t(e);return o instanceof t?o._then(function(t){s._setBoundTo(t),s._resolveCallback(i)},s._reject,s._progress,s,null):(s._setBoundTo(n),s._resolveCallback(i)),s}}},{}],4:[function(t,e){"use strict";function r(){try{Promise===i&&(Promise=n)}catch(t){}return i}var n;"undefined"!=typeof Promise&&(n=Promise);var i=t("./promise.js")();i.noConflict=r,e.exports=i},{"./promise.js":23}],5:[function(t,e){"use strict";var r=Object.create;if(r){var n=r(null),i=r(null);n[" size"]=i[" size"]=0}e.exports=function(e){function r(t,r){var n;if(null!=t&&(n=t[r]),"function"!=typeof n){var i="Object "+a.classString(t)+" has no method '"+a.toString(r)+"'";throw new e.TypeError(i)}return n}function n(t){var e=this.pop(),n=r(t,e);return n.apply(t,this)}function i(t){return t[this]}function o(t){var e=+this;return 0>e&&(e=Math.max(0,e+t.length)),t[e]}{var s,a=t("./util.js"),u=a.canEvaluate;a.isIdentifier}e.prototype.call=function(t){for(var e=arguments.length,r=new Array(e-1),i=1;e>i;++i)r[i-1]=arguments[i];return r.push(t),this._then(n,void 0,void 0,r,void 0)},e.prototype.get=function(t){var e,r="number"==typeof t;if(r)e=o;else if(u){var n=s(t);e=null!==n?n:i}else e=i;return this._then(e,void 0,void 0,t,void 0)}}},{"./util.js":38}],6:[function(t,e){"use strict";e.exports=function(e){var r=t("./errors.js"),n=t("./async.js"),i=r.CancellationError;e.prototype._cancel=function(t){if(!this.isCancellable())return this;for(var e,r=this;void 0!==(e=r._cancellationParent)&&e.isCancellable();)r=e;this._unsetCancellable(),r._target()._rejectCallback(t,!1,!0)},e.prototype.cancel=function(t){return this.isCancellable()?(void 0===t&&(t=new i),n.invokeLater(this._cancel,this,t),this):this},e.prototype.cancellable=function(){return this._cancellable()?this:(n.enableTrampoline(),this._setCancellable(),this._cancellationParent=void 0,this)},e.prototype.uncancellable=function(){var t=this.then();return t._unsetCancellable(),t},e.prototype.fork=function(t,e,r){var n=this._then(t,e,r,void 0,void 0);return n._setCancellable(),n._cancellationParent=void 0,n}}},{"./async.js":2,"./errors.js":13}],7:[function(t,e){"use strict";e.exports=function(){function e(t){this._parent=t;var r=this._length=1+(void 0===t?0:t._length);j(this,e),r>32&&this.uncycle()}function r(t,e){for(var r=0;r<e.length-1;++r)e[r].push("From previous event:"),e[r]=e[r].join("\n");return r<e.length&&(e[r]=e[r].join("\n")),t+"\n"+e.join("\n")}function n(t){for(var e=0;e<t.length;++e)(0===t[e].length||e+1<t.length&&t[e][0]===t[e+1][0])&&(t.splice(e,1),e--)}function i(t){for(var e=t[0],r=1;r<t.length;++r){for(var n=t[r],i=e.length-1,o=e[i],s=-1,a=n.length-1;a>=0;--a)if(n[a]===o){s=a;break}for(var a=s;a>=0;--a){var u=n[a];if(e[i]!==u)break;e.pop(),i--}e=n}}function o(t){for(var e=[],r=0;r<t.length;++r){var n=t[r],i=_.test(n)||" (No stack trace)"===n,o=i&&y(n);i&&!o&&(v&&" "!==n.charAt(0)&&(n=" "+n),e.push(n))}return e}function s(t){for(var e=t.stack.replace(/\s+$/g,"").split("\n"),r=0;r<e.length;++r){var n=e[r];if(" (No stack trace)"===n||_.test(n))break}return r>0&&(e=e.slice(r)),e}function a(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t.toString();var r=/\[object [a-zA-Z0-9$_]+\]/;if(r.test(e))try{var n=JSON.stringify(t);e=n}catch(i){}0===e.length&&(e="(empty array)")}return"(<"+u(e)+">, no stack trace)"}function u(t){var e=41;return t.length<e?t:t.substr(0,e-3)+"..."}function c(t){var e=t.match(g);return e?{fileName:e[1],line:parseInt(e[2],10)}:void 0}var l,h=t("./async.js"),p=t("./util.js"),f=/[\\\/]bluebird[\\\/]js[\\\/](main|debug|zalgo|instrumented)/,_=null,d=null,v=!1;p.inherits(e,Error),e.prototype.uncycle=function(){var t=this._length;if(!(2>t)){for(var e=[],r={},n=0,i=this;void 0!==i;++n)e.push(i),i=i._parent;t=this._length=n;for(var n=t-1;n>=0;--n){var o=e[n].stack;void 0===r[o]&&(r[o]=n)}for(var n=0;t>n;++n){var s=e[n].stack,a=r[s];if(void 0!==a&&a!==n){a>0&&(e[a-1]._parent=void 0,e[a-1]._length=1),e[n]._parent=void 0,e[n]._length=1;var u=n>0?e[n-1]:this;t-1>a?(u._parent=e[a+1],u._parent.uncycle(),u._length=u._parent._length+1):(u._parent=void 0,u._length=1);for(var c=u._length+1,l=n-2;l>=0;--l)e[l]._length=c,c++;return}}}},e.prototype.parent=function(){return this._parent},e.prototype.hasParent=function(){return void 0!==this._parent},e.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var s=e.parseStackAndMessage(t),a=s.message,u=[s.stack],c=this;void 0!==c;)u.push(o(c.stack.split("\n"))),c=c._parent;i(u),n(u),p.notEnumerableProp(t,"stack",r(a,u)),p.notEnumerableProp(t,"__stackCleaned__",!0)}},e.parseStackAndMessage=function(t){var e=t.stack,r=t.toString();return e="string"==typeof e&&e.length>0?s(t):[" (No stack trace)"],{message:r,stack:o(e)}},e.formatAndLogError=function(t,e){if("undefined"!=typeof console){var r;if("object"==typeof t||"function"==typeof t){var n=t.stack;r=e+d(n,t)}else r=e+String(t);"function"==typeof l?l(r):("function"==typeof console.log||"object"==typeof console.log)&&console.log(r)}},e.unhandledRejection=function(t){e.formatAndLogError(t,"^--- With additional stack trace: ")},e.isSupported=function(){return"function"==typeof j},e.fireRejectionEvent=function(t,r,n,i){var o=!1;try{"function"==typeof r&&(o=!0,"rejectionHandled"===t?r(i):r(n,i))}catch(s){h.throwLater(s)}var a=!1;try{a=b(t,n,i)}catch(s){a=!0,h.throwLater(s)}var u=!1;if(m)try{u=m(t.toLowerCase(),{reason:n,promise:i})}catch(s){u=!0,h.throwLater(s)}a||o||u||"unhandledRejection"!==t||e.formatAndLogError(n,"Unhandled rejection ")};var y=function(){return!1},g=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;e.setBounds=function(t,r){if(e.isSupported()){for(var n,i,o=t.stack.split("\n"),s=r.stack.split("\n"),a=-1,u=-1,l=0;l<o.length;++l){var h=c(o[l]);if(h){n=h.fileName,a=h.line;break}}for(var l=0;l<s.length;++l){var h=c(s[l]);if(h){i=h.fileName,u=h.line;break}}0>a||0>u||!n||!i||n!==i||a>=u||(y=function(t){if(f.test(t))return!0;var e=c(t);return e&&e.fileName===n&&a<=e.line&&e.line<=u?!0:!1})}};var m,j=function(){var t=/^\s*at\s*/,e=function(t,e){return"string"==typeof t?t:void 0!==e.name&&void 0!==e.message?e.toString():a(e)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit=Error.stackTraceLimit+6,_=t,d=e;var r=Error.captureStackTrace;return y=function(t){return f.test(t)},function(t,e){Error.stackTraceLimit=Error.stackTraceLimit+6,r(t,e),Error.stackTraceLimit=Error.stackTraceLimit-6}}var n=new Error;if("string"==typeof n.stack&&n.stack.split("\n")[0].indexOf("stackDetection@")>=0)return _=/@/,d=e,v=!0,function(t){t.stack=(new Error).stack};var i;try{throw new Error}catch(o){i="stack"in o}return"stack"in n||!i?(d=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?a(e):e.toString()},null):(_=t,d=e,function(t){Error.stackTraceLimit=Error.stackTraceLimit+6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit=Error.stackTraceLimit-6})}([]),b=function(){if(p.isNode)return function(t,e,r){return"rejectionHandled"===t?process.emit(t,r):process.emit(t,e,r)};var t=!1,e=!0;try{var r=new self.CustomEvent("test");t=r instanceof CustomEvent}catch(n){}if(!t)try{var i=document.createEvent("CustomEvent");i.initCustomEvent("testingtheevent",!1,!0,{}),self.dispatchEvent(i)}catch(n){e=!1}e&&(m=function(e,r){var n;return t?n=new self.CustomEvent(e,{detail:r,bubbles:!1,cancelable:!0}):self.dispatchEvent&&(n=document.createEvent("CustomEvent"),n.initCustomEvent(e,!1,!0,r)),n?!self.dispatchEvent(n):!1});var o={};return o.unhandledRejection="onunhandledRejection".toLowerCase(),o.rejectionHandled="onrejectionHandled".toLowerCase(),function(t,e,r){var n=o[t],i=self[n];return i?("rejectionHandled"===t?i.call(self,r):i.call(self,e,r),!0):!1}}();return"undefined"!=typeof console&&"undefined"!=typeof console.warn&&(l=function(t){console.warn(t)},p.isNode&&process.stderr.isTTY?l=function(t){process.stderr.write(""+t+"\n")}:p.isNode||"string"!=typeof(new Error).stack||(l=function(t){console.warn("%c"+t,"color: red")})),e}},{"./async.js":2,"./util.js":38}],8:[function(t,e){"use strict";e.exports=function(e){function r(t,e,r){this._instances=t,this._callback=e,this._promise=r}function n(t,e){var r={},n=s(t).call(r,e);if(n===a)return n;var i=u(r);return i.length?(a.e=new c("Catch filter must inherit from Error or be a simple predicate function\n\n See http://goo.gl/o84o68\n"),a):n}var i=t("./util.js"),o=t("./errors.js"),s=i.tryCatch,a=i.errorObj,u=t("./es5.js").keys,c=o.TypeError;return r.prototype.doFilter=function(t){for(var r=this._callback,i=this._promise,o=i._boundTo,u=0,c=this._instances.length;c>u;++u){var l=this._instances[u],h=l===Error||null!=l&&l.prototype instanceof Error;if(h&&t instanceof l){var p=s(r).call(o,t);return p===a?(e.e=p.e,e):p}if("function"==typeof l&&!h){var f=n(l,t);if(f===a){t=a.e;break}if(f){var p=s(r).call(o,t);return p===a?(e.e=p.e,e):p}}}return e.e=t,e},r}},{"./errors.js":13,"./es5.js":14,"./util.js":38}],9:[function(t,e){"use strict";e.exports=function(t,e,r){function n(){this._trace=new e(o())}function i(){return r()?new n:void 0}function o(){var t=s.length-1;return t>=0?s[t]:void 0}var s=[];return n.prototype._pushContext=function(){r()&&void 0!==this._trace&&s.push(this._trace)},n.prototype._popContext=function(){r()&&void 0!==this._trace&&s.pop()},t.prototype._peekContext=o,t.prototype._pushContext=n.prototype._pushContext,t.prototype._popContext=n.prototype._popContext,i}},{}],10:[function(t,e){"use strict";e.exports=function(e,r){var n,i,o=t("./async.js"),s=t("./errors.js").Warning,a=t("./util.js"),u=a.canAttachTrace,c=!1||a.isNode&&(!!process.env.BLUEBIRD_DEBUG||"development"===process.env.NODE_ENV);return c&&o.disableTrampolineIfNecessary(),e.prototype._ignoreRejections=function(){this._unsetRejectionIsUnhandled(),this._bitField=16777216|this._bitField},e.prototype._ensurePossibleRejectionHandled=function(){0===(16777216&this._bitField)&&(this._setRejectionIsUnhandled(),o.invokeLater(this._notifyUnhandledRejection,this,void 0))},e.prototype._notifyUnhandledRejectionIsHandled=function(){r.fireRejectionEvent("rejectionHandled",n,void 0,this)},e.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._getCarriedStackTrace()||this._settledValue;this._setUnhandledRejectionIsNotified(),r.fireRejectionEvent("unhandledRejection",i,t,this)}},e.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=524288|this._bitField},e.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-524289&this._bitField},e.prototype._isUnhandledRejectionNotified=function(){return(524288&this._bitField)>0},e.prototype._setRejectionIsUnhandled=function(){this._bitField=2097152|this._bitField},e.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-2097153&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},e.prototype._isRejectionUnhandled=function(){return(2097152&this._bitField)>0},e.prototype._setCarriedStackTrace=function(t){this._bitField=1048576|this._bitField,this._fulfillmentHandler0=t},e.prototype._isCarryingStackTrace=function(){return(1048576&this._bitField)>0},e.prototype._getCarriedStackTrace=function(){return this._isCarryingStackTrace()?this._fulfillmentHandler0:void 0},e.prototype._captureStackTrace=function(){return c&&(this._trace=new r(this._peekContext())),this},e.prototype._attachExtraTrace=function(t,e){if(c&&u(t)){var n=this._trace;if(void 0!==n&&e&&(n=n._parent),void 0!==n)n.attachExtraTrace(t);else if(!t.__stackCleaned__){var i=r.parseStackAndMessage(t);a.notEnumerableProp(t,"stack",i.message+"\n"+i.stack.join("\n")),a.notEnumerableProp(t,"__stackCleaned__",!0)}}},e.prototype._warn=function(t){var e=new s(t),n=this._peekContext();if(n)n.attachExtraTrace(e);else{var i=r.parseStackAndMessage(e);e.stack=i.message+"\n"+i.stack.join("\n")}r.formatAndLogError(e,"")},e.onPossiblyUnhandledRejection=function(t){i="function"==typeof t?t:void 0},e.onUnhandledRejectionHandled=function(t){n="function"==typeof t?t:void 0},e.longStackTraces=function(){if(o.haveItemsQueued()&&c===!1)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/DT1qyG\n");c=r.isSupported(),c&&o.disableTrampolineIfNecessary()},e.hasLongStackTraces=function(){return c&&r.isSupported()},r.isSupported()||(e.longStackTraces=function(){},c=!1),function(){return c}}},{"./async.js":2,"./errors.js":13,"./util.js":38}],11:[function(t,e){"use strict";var r=t("./util.js"),n=r.isPrimitive,i=r.wrapsPrimitiveReceiver;e.exports=function(t){var e=function(){return this},r=function(){throw this},o=function(){},s=function(){throw void 0},a=function(t,e){return 1===e?function(){throw t}:2===e?function(){return t}:void 0};t.prototype["return"]=t.prototype.thenReturn=function(t){return void 0===t?this.then(o):i&&n(t)?this._then(a(t,2),void 0,void 0,void 0,void 0):this._then(e,void 0,void 0,t,void 0)},t.prototype["throw"]=t.prototype.thenThrow=function(t){return void 0===t?this.then(s):i&&n(t)?this._then(a(t,1),void 0,void 0,void 0,void 0):this._then(r,void 0,void 0,t,void 0)}}},{"./util.js":38}],12:[function(t,e){"use strict";e.exports=function(t,e){var r=t.reduce;t.prototype.each=function(t){return r(this,t,null,e)},t.each=function(t,n){return r(t,n,null,e)}}},{}],13:[function(t,e){"use strict";function r(t,e){function r(n){return this instanceof r?(l(this,"message","string"==typeof n?n:e),l(this,"name",t),void(Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this))):new r(n)}return c(r,Error),r}function n(t){return this instanceof n?(l(this,"name","OperationalError"),l(this,"message",t),this.cause=t,this.isOperational=!0,void(t instanceof Error?(l(this,"message",t.message),l(this,"stack",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor))):new n(t)}var i,o,s=t("./es5.js"),a=s.freeze,u=t("./util.js"),c=u.inherits,l=u.notEnumerableProp,h=r("Warning","warning"),p=r("CancellationError","cancellation error"),f=r("TimeoutError","timeout error"),_=r("AggregateError","aggregate error");try{i=TypeError,o=RangeError}catch(d){i=r("TypeError","type error"),o=r("RangeError","range error")}for(var v="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),y=0;y<v.length;++y)"function"==typeof Array.prototype[v[y]]&&(_.prototype[v[y]]=Array.prototype[v[y]]);s.defineProperty(_.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0}),_.prototype.isOperational=!0;var g=0;_.prototype.toString=function(){var t=Array(4*g+1).join(" "),e="\n"+t+"AggregateError of:\n";g++,t=Array(4*g+1).join(" ");for(var r=0;r<this.length;++r){for(var n=this[r]===this?"[Circular AggregateError]":this[r]+"",i=n.split("\n"),o=0;o<i.length;++o)i[o]=t+i[o];n=i.join("\n"),e+=n+"\n"}return g--,e},c(n,Error);var m=Error.__BluebirdErrorTypes__;m||(m=a({CancellationError:p,TimeoutError:f,OperationalError:n,RejectionError:n,AggregateError:_}),l(Error,"__BluebirdErrorTypes__",m)),e.exports={Error:Error,TypeError:i,RangeError:o,CancellationError:m.CancellationError,OperationalError:m.OperationalError,TimeoutError:m.TimeoutError,AggregateError:m.AggregateError,Warning:h}},{"./es5.js":14,"./util.js":38}],14:[function(t,e){var r=function(){"use strict";return void 0===this}();if(r)e.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:r,propertyIsWritable:function(t,e){var r=Object.getOwnPropertyDescriptor(t,e);return!(r&&!r.writable&&!r.set)}};else{var n={}.hasOwnProperty,i={}.toString,o={}.constructor.prototype,s=function(t){var e=[];for(var r in t)n.call(t,r)&&e.push(r);return e},a=function(t,e){return{value:t[e]}},u=function(t,e,r){return t[e]=r.value,t},c=function(t){return t},l=function(t){try{return Object(t).constructor.prototype}catch(e){return o}},h=function(t){try{return"[object Array]"===i.call(t)}catch(e){return!1}};e.exports={isArray:h,keys:s,names:s,defineProperty:u,getDescriptor:a,freeze:c,getPrototypeOf:l,isES5:r,propertyIsWritable:function(){return!0}}}},{}],15:[function(t,e){"use strict";e.exports=function(t,e){var r=t.map;t.prototype.filter=function(t,n){return r(this,t,n,e)},t.filter=function(t,n,i){return r(t,n,i,e)}}},{}],16:[function(t,e){"use strict";e.exports=function(e,r,n){function i(){return this}function o(){throw this}function s(t){return function(){return t}}function a(t){return function(){throw t}}function u(t,e,r){var n;return n=p&&f(e)?r?s(e):a(e):r?i:o,t._then(n,_,void 0,e,void 0)}function c(t){var i=this.promise,o=this.handler,s=i._isBound()?o.call(i._boundTo):o();if(void 0!==s){var a=n(s,i);if(a instanceof e)return a=a._target(),u(a,t,i.isFulfilled())}return i.isRejected()?(r.e=t,r):t}function l(t){var r=this.promise,i=this.handler,o=r._isBound()?i.call(r._boundTo,t):i(t);if(void 0!==o){var s=n(o,r);if(s instanceof e)return s=s._target(),u(s,t,!0)}return t}var h=t("./util.js"),p=h.wrapsPrimitiveReceiver,f=h.isPrimitive,_=h.thrower;e.prototype._passThroughHandler=function(t,e){if("function"!=typeof t)return this.then();var r={promise:this,handler:t};return this._then(e?c:l,e?c:void 0,void 0,r,void 0)},e.prototype.lastly=e.prototype["finally"]=function(t){return this._passThroughHandler(t,!0)},e.prototype.tap=function(t){return this._passThroughHandler(t,!1)}}},{"./util.js":38}],17:[function(t,e){"use strict";e.exports=function(e,r,n,i){function o(t,r,n){for(var o=0;o<r.length;++o){n._pushContext();var s=h(r[o])(t);if(n._popContext(),s===l){n._pushContext();var a=e.reject(l.e);return n._popContext(),a}var u=i(s,n);if(u instanceof e)return u}return null}function s(t,r,i,o){var s=this._promise=new e(n);s._captureStackTrace(),this._stack=o,this._generatorFunction=t,this._receiver=r,this._generator=void 0,this._yieldHandlers="function"==typeof i?[i].concat(p):p}var a=t("./errors.js"),u=a.TypeError,c=t("./util.js"),l=c.errorObj,h=c.tryCatch,p=[];s.prototype.promise=function(){return this._promise},s.prototype._run=function(){this._generator=this._generatorFunction.call(this._receiver),this._receiver=this._generatorFunction=void 0,this._next(void 0)},s.prototype._continue=function(t){if(t===l)return this._promise._rejectCallback(t.e,!1,!0);var r=t.value;if(t.done===!0)this._promise._resolveCallback(r);else{var n=i(r,this._promise);if(!(n instanceof e)&&(n=o(n,this._yieldHandlers,this._promise),null===n))return void this._throw(new u("A value %s was yielded that could not be treated as a promise\n\n See http://goo.gl/4Y4pDk\n\n".replace("%s",r)+"From coroutine:\n"+this._stack.split("\n").slice(1,-7).join("\n")));n._then(this._next,this._throw,void 0,this,null)}},s.prototype._throw=function(t){this._promise._attachExtraTrace(t),this._promise._pushContext();var e=h(this._generator["throw"]).call(this._generator,t);this._promise._popContext(),this._continue(e)},s.prototype._next=function(t){this._promise._pushContext();var e=h(this._generator.next).call(this._generator,t);this._promise._popContext(),this._continue(e)},e.coroutine=function(t,e){if("function"!=typeof t)throw new u("generatorFunction must be a function\n\n See http://goo.gl/6Vqhm0\n");var r=Object(e).yieldHandler,n=s,i=(new Error).stack;return function(){var e=t.apply(this,arguments),o=new n(void 0,void 0,r,i);return o._generator=e,o._next(void 0),o.promise()}},e.coroutine.addYieldHandler=function(t){if("function"!=typeof t)throw new u("fn must be a function\n\n See http://goo.gl/916lJJ\n");p.push(t)},e.spawn=function(t){if("function"!=typeof t)return r("generatorFunction must be a function\n\n See http://goo.gl/6Vqhm0\n");var n=new s(t,this),i=n.promise();return n._run(e.spawn),i}}},{"./errors.js":13,"./util.js":38}],18:[function(t,e){"use strict";e.exports=function(e,r,n,i){{var o=t("./util.js");o.canEvaluate,o.tryCatch,o.errorObj}e.join=function(){var t,e=arguments.length-1;if(e>0&&"function"==typeof arguments[e]){t=arguments[e];var n}for(var i=arguments.length,o=new Array(i),s=0;i>s;++s)o[s]=arguments[s];t&&o.pop();var n=new r(o).promise();return void 0!==t?n.spread(t):n}}},{"./util.js":38}],19:[function(t,e){"use strict";e.exports=function(e,r,n,i,o){function s(t,e,r,n){this.constructor$(t),this._promise._captureStackTrace(),this._callback=e,this._preservedValues=n===o?new Array(this.length()):null,this._limit=r,this._inFlight=0,this._queue=r>=1?[]:_,c.invoke(a,this,void 0)}function a(){this._init$(void 0,-2)}function u(t,e,r,n){var i="object"==typeof r&&null!==r?r.concurrency:0;return i="number"==typeof i&&isFinite(i)&&i>=1?i:0,new s(t,e,i,n)}var c=t("./async.js"),l=t("./util.js"),h=l.tryCatch,p=l.errorObj,f={},_=[];l.inherits(s,r),s.prototype._init=function(){},s.prototype._promiseFulfilled=function(t,r){var n=this._values,o=this.length(),s=this._preservedValues,a=this._limit;if(n[r]===f){if(n[r]=t,a>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return}else{if(a>=1&&this._inFlight>=a)return n[r]=t,void this._queue.push(r);null!==s&&(s[r]=t);var u=this._callback,c=this._promise._boundTo;this._promise._pushContext();var l=h(u).call(c,t,r,o);if(this._promise._popContext(),l===p)return this._reject(l.e);var _=i(l,this._promise);if(_ instanceof e){if(_=_._target(),_._isPending())return a>=1&&this._inFlight++,n[r]=f,_._proxyPromiseArray(this,r);if(!_._isFulfilled())return this._reject(_._reason());l=_._value()}n[r]=l}var d=++this._totalResolved;d>=o&&(null!==s?this._filter(n,s):this._resolve(n))},s.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,r=this._values;t.length>0&&this._inFlight<e;){if(this._isResolved())return;var n=t.pop();this._promiseFulfilled(r[n],n)}},s.prototype._filter=function(t,e){for(var r=e.length,n=new Array(r),i=0,o=0;r>o;++o)t[o]&&(n[i++]=e[o]);n.length=i,this._resolve(n)},s.prototype.preservedValues=function(){return this._preservedValues},e.prototype.map=function(t,e){return"function"!=typeof t?n("fn must be a function\n\n See http://goo.gl/916lJJ\n"):u(this,t,e,null).promise()},e.map=function(t,e,r,i){return"function"!=typeof e?n("fn must be a function\n\n See http://goo.gl/916lJJ\n"):u(t,e,r,i).promise()}}},{"./async.js":2,"./util.js":38}],20:[function(t,e){"use strict";e.exports=function(e,r,n,i){var o=t("./util.js"),s=o.tryCatch;e.method=function(t){if("function"!=typeof t)throw new e.TypeError("fn must be a function\n\n See http://goo.gl/916lJJ\n");return function(){var n=new e(r);n._captureStackTrace(),n._pushContext();var i=s(t).apply(this,arguments);return n._popContext(),n._resolveFromSyncValue(i),n}},e.attempt=e["try"]=function(t,n,a){if("function"!=typeof t)return i("fn must be a function\n\n See http://goo.gl/916lJJ\n");var u=new e(r);u._captureStackTrace(),u._pushContext();var c=o.isArray(n)?s(t).apply(a,n):s(t).call(a,n);return u._popContext(),u._resolveFromSyncValue(c),u},e.prototype._resolveFromSyncValue=function(t){t===o.errorObj?this._rejectCallback(t.e,!1,!0):this._resolveCallback(t,!0)}}},{"./util.js":38}],21:[function(t,e){"use strict";e.exports=function(e){function r(t,e){var r=this;if(!o.isArray(t))return n.call(r,t,e);var i=a(e).apply(r._boundTo,[null].concat(t));i===u&&s.throwLater(i.e)}function n(t,e){var r=this,n=r._boundTo,i=void 0===t?a(e).call(n,null):a(e).call(n,null,t);i===u&&s.throwLater(i.e)}function i(t,e){var r=this;if(!t){var n=r._target(),i=n._getCarriedStackTrace();i.cause=t,t=i}var o=a(e).call(r._boundTo,t);o===u&&s.throwLater(o.e)}var o=t("./util.js"),s=t("./async.js"),a=o.tryCatch,u=o.errorObj;e.prototype.asCallback=e.prototype.nodeify=function(t,e){if("function"==typeof t){var o=n;void 0!==e&&Object(e).spread&&(o=r),this._then(o,i,void 0,this,t)}return this}}},{"./async.js":2,"./util.js":38}],22:[function(t,e){"use strict";e.exports=function(e,r){var n=t("./util.js"),i=t("./async.js"),o=n.tryCatch,s=n.errorObj;e.prototype.progressed=function(t){return this._then(void 0,void 0,t,void 0,void 0)},e.prototype._progress=function(t){this._isFollowingOrFulfilledOrRejected()||this._target()._progressUnchecked(t)},e.prototype._progressHandlerAt=function(t){return 0===t?this._progressHandler0:this[(t<<2)+t-5+2]},e.prototype._doProgressWith=function(t){var r=t.value,i=t.handler,a=t.promise,u=t.receiver,c=o(i).call(u,r);if(c===s){if(null!=c.e&&"StopProgressPropagation"!==c.e.name){var l=n.canAttachTrace(c.e)?c.e:new Error(n.toString(c.e));a._attachExtraTrace(l),a._progress(c.e)}}else c instanceof e?c._then(a._progress,null,null,a,void 0):a._progress(c)},e.prototype._progressUnchecked=function(t){for(var n=this._length(),o=this._progress,s=0;n>s;s++){var a=this._progressHandlerAt(s),u=this._promiseAt(s);if(u instanceof e)"function"==typeof a?i.invoke(this._doProgressWith,this,{handler:a,promise:u,receiver:this._receiverAt(s),value:t}):i.invoke(o,u,t);else{var c=this._receiverAt(s);"function"==typeof a?a.call(c,t,u):c instanceof r&&!c._isResolved()&&c._promiseProgressed(t,u)}}}}},{"./async.js":2,"./util.js":38}],23:[function(t,e){"use strict";e.exports=function(){function e(t){if("function"!=typeof t)throw new c("the promise constructor requires a resolver function\n\n See http://goo.gl/EC22Yn\n");if(this.constructor!==e)throw new c("the promise constructor cannot be invoked directly\n\n See http://goo.gl/KsIlge\n");this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._progressHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,this._settledValue=void 0,t!==l&&this._resolveFromResolver(t)}function r(t){var r=new e(l);r._fulfillmentHandler0=t,r._rejectionHandler0=t,r._progressHandler0=t,r._promise0=t,r._receiver0=t,r._settledValue=t}var n=function(){return new c("circular promise resolution chain\n\n See http://goo.gl/LhFpo0\n")},i=function(){return new e.PromiseInspection(this._target())},o=function(t){return e.reject(new c(t))},s=t("./util.js"),a=t("./async.js"),u=t("./errors.js"),c=e.TypeError=u.TypeError;e.RangeError=u.RangeError,e.CancellationError=u.CancellationError,e.TimeoutError=u.TimeoutError,e.OperationalError=u.OperationalError,e.RejectionError=u.OperationalError,e.AggregateError=u.AggregateError;var l=function(){},h={},p={e:null},f=t("./thenables.js")(e,l),_=t("./promise_array.js")(e,l,f,o),d=t("./captured_trace.js")(),v=t("./debuggability.js")(e,d),y=t("./context.js")(e,d,v),g=t("./catch_filter.js")(p),m=t("./promise_resolver.js"),j=m._nodebackForPromise,b=s.errorObj,w=s.tryCatch;return e.prototype.toString=function(){return"[object Promise]"},e.prototype.caught=e.prototype["catch"]=function(t){var r=arguments.length;if(r>1){var n,i=new Array(r-1),o=0;for(n=0;r-1>n;++n){var s=arguments[n];if("function"!=typeof s)return e.reject(new c("Catch filter must inherit from Error or be a simple predicate function\n\n See http://goo.gl/o84o68\n"));i[o++]=s}i.length=o,t=arguments[n];var a=new g(i,t,this);return this._then(void 0,a.doFilter,void 0,a,void 0)}return this._then(void 0,t,void 0,void 0,void 0)},e.prototype.reflect=function(){return this._then(i,i,void 0,this,void 0)},e.prototype.then=function(t,e,r){if(v()&&arguments.length>0&&"function"!=typeof t&&"function"!=typeof e){var n=".then() only accepts functions but was passed: "+s.classString(t);arguments.length>1&&(n+=", "+s.classString(e)),this._warn(n)}return this._then(t,e,r,void 0,void 0)
+},e.prototype.done=function(t,e,r){var n=this._then(t,e,r,void 0,void 0);n._setIsFinal()},e.prototype.spread=function(t,e){return this.all()._then(t,e,void 0,h,void 0)},e.prototype.isCancellable=function(){return!this.isResolved()&&this._cancellable()},e.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},e.prototype.all=function(){return new _(this).promise()},e.prototype.error=function(t){return this.caught(s.originatesFromRejection,t)},e.is=function(t){return t instanceof e},e.fromNode=function(t){var r=new e(l),n=w(t)(j(r));return n===b&&r._rejectCallback(n.e,!0,!0),r},e.all=function(t){return new _(t).promise()},e.defer=e.pending=function(){var t=new e(l);return new m(t)},e.cast=function(t){var r=f(t);if(!(r instanceof e)){var n=r;r=new e(l),r._fulfillUnchecked(n)}return r},e.resolve=e.fulfilled=e.cast,e.reject=e.rejected=function(t){var r=new e(l);return r._captureStackTrace(),r._rejectCallback(t,!0),r},e.setScheduler=function(t){if("function"!=typeof t)throw new c("fn must be a function\n\n See http://goo.gl/916lJJ\n");var e=a._schedule;return a._schedule=t,e},e.prototype._then=function(t,r,n,i,o){var s=void 0!==o,u=s?o:new e(l);s||(u._propagateFrom(this,5),u._captureStackTrace());var c=this._target();c!==this&&(void 0===i&&(i=this._boundTo),s||u._setIsMigrated());var h=c._addCallbacks(t,r,n,u,i);return c._isResolved()&&!c._isSettlePromisesQueued()&&a.invoke(c._settlePromiseAtPostResolution,c,h),u},e.prototype._settlePromiseAtPostResolution=function(t){this._isRejectionUnhandled()&&this._unsetRejectionIsUnhandled(),this._settlePromiseAt(t)},e.prototype._length=function(){return 131071&this._bitField},e.prototype._isFollowingOrFulfilledOrRejected=function(){return(939524096&this._bitField)>0},e.prototype._isFollowing=function(){return 536870912===(536870912&this._bitField)},e.prototype._setLength=function(t){this._bitField=-131072&this._bitField|131071&t},e.prototype._setFulfilled=function(){this._bitField=268435456|this._bitField},e.prototype._setRejected=function(){this._bitField=134217728|this._bitField},e.prototype._setFollowing=function(){this._bitField=536870912|this._bitField},e.prototype._setIsFinal=function(){this._bitField=33554432|this._bitField},e.prototype._isFinal=function(){return(33554432&this._bitField)>0},e.prototype._cancellable=function(){return(67108864&this._bitField)>0},e.prototype._setCancellable=function(){this._bitField=67108864|this._bitField},e.prototype._unsetCancellable=function(){this._bitField=-67108865&this._bitField},e.prototype._setIsMigrated=function(){this._bitField=4194304|this._bitField},e.prototype._unsetIsMigrated=function(){this._bitField=-4194305&this._bitField},e.prototype._isMigrated=function(){return(4194304&this._bitField)>0},e.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[5*t-5+4];return void 0===e&&this._isBound()?this._boundTo:e},e.prototype._promiseAt=function(t){return 0===t?this._promise0:this[5*t-5+3]},e.prototype._fulfillmentHandlerAt=function(t){return 0===t?this._fulfillmentHandler0:this[5*t-5+0]},e.prototype._rejectionHandlerAt=function(t){return 0===t?this._rejectionHandler0:this[5*t-5+1]},e.prototype._migrateCallbacks=function(t,r){var n=t._fulfillmentHandlerAt(r),i=t._rejectionHandlerAt(r),o=t._progressHandlerAt(r),s=t._promiseAt(r),a=t._receiverAt(r);s instanceof e&&s._setIsMigrated(),this._addCallbacks(n,i,o,s,a)},e.prototype._addCallbacks=function(t,e,r,n,i){var o=this._length();if(o>=131066&&(o=0,this._setLength(0)),0===o)this._promise0=n,void 0!==i&&(this._receiver0=i),"function"!=typeof t||this._isCarryingStackTrace()||(this._fulfillmentHandler0=t),"function"==typeof e&&(this._rejectionHandler0=e),"function"==typeof r&&(this._progressHandler0=r);else{var s=5*o-5;this[s+3]=n,this[s+4]=i,"function"==typeof t&&(this[s+0]=t),"function"==typeof e&&(this[s+1]=e),"function"==typeof r&&(this[s+2]=r)}return this._setLength(o+1),o},e.prototype._setProxyHandlers=function(t,e){var r=this._length();if(r>=131066&&(r=0,this._setLength(0)),0===r)this._promise0=e,this._receiver0=t;else{var n=5*r-5;this[n+3]=e,this[n+4]=t}this._setLength(r+1)},e.prototype._proxyPromiseArray=function(t,e){this._setProxyHandlers(t,e)},e.prototype._resolveCallback=function(t,r){if(!this._isFollowingOrFulfilledOrRejected()){if(t===this)return this._rejectCallback(n(),!1,!0);var i=f(t,this);if(!(i instanceof e))return this._fulfill(t);var o=1|(r?4:0);this._propagateFrom(i,o);var s=i._target();if(s._isPending()){for(var a=this._length(),u=0;a>u;++u)s._migrateCallbacks(this,u);this._setFollowing(),this._setLength(0),this._setFollowee(s)}else s._isFulfilled()?this._fulfillUnchecked(s._value()):this._rejectUnchecked(s._reason(),s._getCarriedStackTrace())}},e.prototype._rejectCallback=function(t,e,r){r||s.markAsOriginatingFromRejection(t);var n=s.ensureErrorObject(t),i=n===t;this._attachExtraTrace(n,e?i:!1),this._reject(t,i?void 0:n)},e.prototype._resolveFromResolver=function(t){var e=this;this._captureStackTrace(),this._pushContext();var r=!0,n=w(t)(function(t){null!==e&&(e._resolveCallback(t),e=null)},function(t){null!==e&&(e._rejectCallback(t,r),e=null)});r=!1,this._popContext(),void 0!==n&&n===b&&null!==e&&(e._rejectCallback(n.e,!0,!0),e=null)},e.prototype._settlePromiseFromHandler=function(t,e,r,i){if(!i._isRejected()){i._pushContext();var o;if(o=e!==h||this._isRejected()?w(t).call(e,r):w(t).apply(this._boundTo,r),i._popContext(),o===b||o===i||o===p){var s=o===i?n():o.e;i._rejectCallback(s,!1,!0)}else i._resolveCallback(o)}},e.prototype._target=function(){for(var t=this;t._isFollowing();)t=t._followee();return t},e.prototype._followee=function(){return this._rejectionHandler0},e.prototype._setFollowee=function(t){this._rejectionHandler0=t},e.prototype._cleanValues=function(){this._cancellable()&&(this._cancellationParent=void 0)},e.prototype._propagateFrom=function(t,e){(1&e)>0&&t._cancellable()&&(this._setCancellable(),this._cancellationParent=t),(4&e)>0&&t._isBound()&&this._setBoundTo(t._boundTo)},e.prototype._fulfill=function(t){this._isFollowingOrFulfilledOrRejected()||this._fulfillUnchecked(t)},e.prototype._reject=function(t,e){this._isFollowingOrFulfilledOrRejected()||this._rejectUnchecked(t,e)},e.prototype._settlePromiseAt=function(t){var r=this._promiseAt(t),n=r instanceof e;if(n&&r._isMigrated())return r._unsetIsMigrated(),a.invoke(this._settlePromiseAt,this,t);var i=this._isFulfilled()?this._fulfillmentHandlerAt(t):this._rejectionHandlerAt(t),o=this._isCarryingStackTrace()?this._getCarriedStackTrace():void 0,s=this._settledValue,u=this._receiverAt(t);this._clearCallbackDataAtIndex(t),"function"==typeof i?n?this._settlePromiseFromHandler(i,u,s,r):i.call(u,s,r):u instanceof _?u._isResolved()||(this._isFulfilled()?u._promiseFulfilled(s,r):u._promiseRejected(s,r)):n&&(this._isFulfilled()?r._fulfill(s):r._reject(s,o)),t>=4&&4===(31&t)&&a.invokeLater(this._setLength,this,0)},e.prototype._clearCallbackDataAtIndex=function(t){if(0===t)this._isCarryingStackTrace()||(this._fulfillmentHandler0=void 0),this._rejectionHandler0=this._progressHandler0=this._receiver0=this._promise0=void 0;else{var e=5*t-5;this[e+3]=this[e+4]=this[e+0]=this[e+1]=this[e+2]=void 0}},e.prototype._isSettlePromisesQueued=function(){return-1073741824===(-1073741824&this._bitField)},e.prototype._setSettlePromisesQueued=function(){this._bitField=-1073741824|this._bitField},e.prototype._unsetSettlePromisesQueued=function(){this._bitField=1073741823&this._bitField},e.prototype._queueSettlePromises=function(){a.settlePromises(this),this._setSettlePromisesQueued()},e.prototype._fulfillUnchecked=function(t){if(t===this){var e=n();return this._attachExtraTrace(e),this._rejectUnchecked(e,void 0)}this._setFulfilled(),this._settledValue=t,this._cleanValues(),this._length()>0&&this._queueSettlePromises()},e.prototype._rejectUncheckedCheckError=function(t){var e=s.ensureErrorObject(t);this._rejectUnchecked(t,e===t?void 0:e)},e.prototype._rejectUnchecked=function(t,e){if(t===this){var r=n();return this._attachExtraTrace(r),this._rejectUnchecked(r)}return this._setRejected(),this._settledValue=t,this._cleanValues(),this._isFinal()?void a.throwLater(function(t){throw"stack"in t&&a.invokeFirst(d.unhandledRejection,void 0,t),t},void 0===e?t:e):(void 0!==e&&e!==t&&this._setCarriedStackTrace(e),void(this._length()>0?this._queueSettlePromises():this._ensurePossibleRejectionHandled()))},e.prototype._settlePromises=function(){this._unsetSettlePromisesQueued();for(var t=this._length(),e=0;t>e;e++)this._settlePromiseAt(e)},e._makeSelfResolutionError=n,t("./progress.js")(e,_),t("./method.js")(e,l,f,o),t("./bind.js")(e,l,f),t("./finally.js")(e,p,f),t("./direct_resolve.js")(e),t("./synchronous_inspection.js")(e),t("./join.js")(e,_,f,l),e.Promise=e,t("./map.js")(e,_,o,f,l),t("./cancel.js")(e),t("./using.js")(e,o,f,y),t("./generators.js")(e,o,l,f),t("./nodeify.js")(e),t("./call_get.js")(e),t("./props.js")(e,_,f,o),t("./race.js")(e,l,f,o),t("./reduce.js")(e,_,o,f,l),t("./settle.js")(e,_),t("./some.js")(e,_,o),t("./promisify.js")(e,l),t("./any.js")(e),t("./each.js")(e,l),t("./timers.js")(e,l),t("./filter.js")(e,l),s.toFastProperties(e),s.toFastProperties(e.prototype),r({a:1}),r({b:2}),r({c:3}),r(1),r(function(){}),r(void 0),r(!1),r(new e(l)),d.setBounds(a.firstLineError,s.lastLineError),e}},{"./any.js":1,"./async.js":2,"./bind.js":3,"./call_get.js":5,"./cancel.js":6,"./captured_trace.js":7,"./catch_filter.js":8,"./context.js":9,"./debuggability.js":10,"./direct_resolve.js":11,"./each.js":12,"./errors.js":13,"./filter.js":15,"./finally.js":16,"./generators.js":17,"./join.js":18,"./map.js":19,"./method.js":20,"./nodeify.js":21,"./progress.js":22,"./promise_array.js":24,"./promise_resolver.js":25,"./promisify.js":26,"./props.js":27,"./race.js":29,"./reduce.js":30,"./settle.js":32,"./some.js":33,"./synchronous_inspection.js":34,"./thenables.js":35,"./timers.js":36,"./using.js":37,"./util.js":38}],24:[function(t,e){"use strict";e.exports=function(e,r,n,i){function o(t){switch(t){case-2:return[];case-3:return{}}}function s(t){var n,i=this._promise=new e(r);t instanceof e&&(n=t,i._propagateFrom(n,5)),this._values=t,this._length=0,this._totalResolved=0,this._init(void 0,-2)}var a=t("./util.js"),u=a.isArray;return s.prototype.length=function(){return this._length},s.prototype.promise=function(){return this._promise},s.prototype._init=function c(t,r){var s=n(this._values,this._promise);if(s instanceof e){if(s=s._target(),this._values=s,!s._isFulfilled())return s._isPending()?void s._then(c,this._reject,void 0,this,r):void this._reject(s._reason());if(s=s._value(),!u(s)){var a=new e.TypeError("expecting an array, a promise or a thenable\n\n See http://goo.gl/s8MMhc\n");return void this.__hardReject__(a)}}else if(!u(s))return void this._promise._reject(i("expecting an array, a promise or a thenable\n\n See http://goo.gl/s8MMhc\n")._reason());if(0===s.length)return void(-5===r?this._resolveEmptyArray():this._resolve(o(r)));var l=this.getActualLength(s.length);this._length=l,this._values=this.shouldCopyValues()?new Array(l):this._values;for(var h=this._promise,p=0;l>p;++p){var f=this._isResolved(),_=n(s[p],h);_ instanceof e?(_=_._target(),f?_._ignoreRejections():_._isPending()?_._proxyPromiseArray(this,p):_._isFulfilled()?this._promiseFulfilled(_._value(),p):this._promiseRejected(_._reason(),p)):f||this._promiseFulfilled(_,p)}},s.prototype._isResolved=function(){return null===this._values},s.prototype._resolve=function(t){this._values=null,this._promise._fulfill(t)},s.prototype.__hardReject__=s.prototype._reject=function(t){this._values=null,this._promise._rejectCallback(t,!1,!0)},s.prototype._promiseProgressed=function(t,e){this._promise._progress({index:e,value:t})},s.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var r=++this._totalResolved;r>=this._length&&this._resolve(this._values)},s.prototype._promiseRejected=function(t){this._totalResolved++,this._reject(t)},s.prototype.shouldCopyValues=function(){return!0},s.prototype.getActualLength=function(t){return t},s}},{"./util.js":38}],25:[function(t,e){"use strict";function r(t){return t instanceof Error&&p.getPrototypeOf(t)===Error.prototype}function n(t){var e;if(r(t)){e=new l(t),e.name=t.name,e.message=t.message,e.stack=t.stack;for(var n=p.keys(t),i=0;i<n.length;++i){var o=n[i];f.test(o)||(e[o]=t[o])}return e}return s.markAsOriginatingFromRejection(t),t}function i(t){return function(e,r){if(null!==t){if(e){var i=n(a(e));t._attachExtraTrace(i),t._reject(i)}else if(arguments.length>2){for(var o=arguments.length,s=new Array(o-1),u=1;o>u;++u)s[u-1]=arguments[u];t._fulfill(s)}else t._fulfill(r);t=null}}}var o,s=t("./util.js"),a=s.maybeWrapAsError,u=t("./errors.js"),c=u.TimeoutError,l=u.OperationalError,h=s.haveGetters,p=t("./es5.js"),f=/^(?:name|message|stack|cause)$/;if(o=h?function(t){this.promise=t}:function(t){this.promise=t,this.asCallback=i(t),this.callback=this.asCallback},h){var _={get:function(){return i(this.promise)}};p.defineProperty(o.prototype,"asCallback",_),p.defineProperty(o.prototype,"callback",_)}o._nodebackForPromise=i,o.prototype.toString=function(){return"[object PromiseResolver]"},o.prototype.resolve=o.prototype.fulfill=function(t){if(!(this instanceof o))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n");this.promise._resolveCallback(t)},o.prototype.reject=function(t){if(!(this instanceof o))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n");this.promise._rejectCallback(t)},o.prototype.progress=function(t){if(!(this instanceof o))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n");this.promise._progress(t)},o.prototype.cancel=function(t){this.promise.cancel(t)},o.prototype.timeout=function(){this.reject(new c("timeout"))},o.prototype.isResolved=function(){return this.promise.isResolved()},o.prototype.toJSON=function(){return this.promise.toJSON()},e.exports=o},{"./errors.js":13,"./es5.js":14,"./util.js":38}],26:[function(t,e){"use strict";e.exports=function(e,r){function n(t){return!b.test(t)}function i(t){try{return t.__isPromisified__===!0}catch(e){return!1}}function o(t,e,r){var n=f.getDataPropertyOrDefault(t,e+r,j);return n?i(n):!1}function s(t,e,r){for(var n=0;n<t.length;n+=2){var i=t[n];if(r.test(i))for(var o=i.replace(r,""),s=0;s<t.length;s+=2)if(t[s]===o)throw new g("Cannot promisify an API that has normal methods with '%s'-suffix\n\n See http://goo.gl/iWrZbw\n".replace("%s",e))}}function a(t,e,r,n){for(var a=f.inheritedDataKeys(t),u=[],c=0;c<a.length;++c){var l=a[c],h=t[l],p=n===w?!0:w(l,h,t);"function"!=typeof h||f.isNativeFunctionMethod(h)||i(h)||o(t,l,e)||!n(l,h,t,p)||u.push(l,h)}return s(u,e,r),u}function u(t,n,i,o){function s(){var i=n;n===p&&(i=this);var o=new e(r);o._captureStackTrace();var s="string"==typeof u&&this!==a?this[u]:t,c=_(o);try{s.apply(i,d(arguments,c))}catch(l){o._rejectCallback(v(l),!0,!0)}return o}var a=function(){return this}(),u=t;return"string"==typeof u&&(t=o),f.notEnumerableProp(s,"__isPromisified__",!0),s}function c(t,e,r,n){for(var i=new RegExp(k(e)+"$"),o=a(t,e,i,r),s=0,u=o.length;u>s;s+=2){var c=o[s],l=o[s+1],h=c+e;t[h]=n===E?E(c,p,c,l,e):n(l,function(){return E(c,p,c,l,e)})}return f.toFastProperties(t),t}function l(t,e){return E(t,e,void 0,t)}var h,p={},f=t("./util.js"),_=t("./promise_resolver.js")._nodebackForPromise,d=f.withAppended,v=f.maybeWrapAsError,y=f.canEvaluate,g=t("./errors").TypeError,m="Async",j={__isPromisified__:!0},b=/^(?:length|name|arguments|caller|callee|prototype|__isPromisified__)$/,w=function(t){return f.isIdentifier(t)&&"_"!==t.charAt(0)&&"constructor"!==t},k=function(t){return t.replace(/([$])/,"\\$")},E=y?h:u;e.promisify=function(t,e){if("function"!=typeof t)throw new g("fn must be a function\n\n See http://goo.gl/916lJJ\n");if(i(t))return t;var r=l(t,arguments.length<2?p:e);return f.copyDescriptors(t,r,n),r},e.promisifyAll=function(t,e){if("function"!=typeof t&&"object"!=typeof t)throw new g("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/9ITlV0\n");e=Object(e);var r=e.suffix;"string"!=typeof r&&(r=m);var n=e.filter;"function"!=typeof n&&(n=w);var i=e.promisifier;if("function"!=typeof i&&(i=E),!f.isIdentifier(r))throw new RangeError("suffix must be a valid identifier\n\n See http://goo.gl/8FZo5V\n");for(var o=f.inheritedDataKeys(t),s=0;s<o.length;++s){var a=t[o[s]];"constructor"!==o[s]&&f.isClass(a)&&(c(a.prototype,r,n,i),c(a,r,n,i))}return c(t,r,n,i)}}},{"./errors":13,"./promise_resolver.js":25,"./util.js":38}],27:[function(t,e){"use strict";e.exports=function(e,r,n,i){function o(t){for(var e=c.keys(t),r=e.length,n=new Array(2*r),i=0;r>i;++i){var o=e[i];n[i]=t[o],n[i+r]=o}this.constructor$(n)}function s(t){var r,s=n(t);return u(s)?(r=s instanceof e?s._then(e.props,void 0,void 0,void 0,void 0):new o(s).promise(),s instanceof e&&r._propagateFrom(s,4),r):i("cannot await properties of a non-object\n\n See http://goo.gl/OsFKC8\n")}var a=t("./util.js"),u=a.isObject,c=t("./es5.js");a.inherits(o,r),o.prototype._init=function(){this._init$(void 0,-3)},o.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var r=++this._totalResolved;if(r>=this._length){for(var n={},i=this.length(),o=0,s=this.length();s>o;++o)n[this._values[o+i]]=this._values[o];this._resolve(n)}},o.prototype._promiseProgressed=function(t,e){this._promise._progress({key:this._values[e+this.length()],value:t})},o.prototype.shouldCopyValues=function(){return!1},o.prototype.getActualLength=function(t){return t>>1},e.prototype.props=function(){return s(this)},e.props=function(t){return s(t)}}},{"./es5.js":14,"./util.js":38}],28:[function(t,e){"use strict";function r(t,e,r,n,i){for(var o=0;i>o;++o)r[o+n]=t[o+e],t[o+e]=void 0}function n(t){this._capacity=t,this._length=0,this._front=0}n.prototype._willBeOverCapacity=function(t){return this._capacity<t},n.prototype._pushOne=function(t){var e=this.length();this._checkCapacity(e+1);var r=this._front+e&this._capacity-1;this[r]=t,this._length=e+1},n.prototype._unshiftOne=function(t){var e=this._capacity;this._checkCapacity(this.length()+1);var r=this._front,n=(r-1&e-1^e)-e;this[n]=t,this._front=n,this._length=this.length()+1},n.prototype.unshift=function(t,e,r){this._unshiftOne(r),this._unshiftOne(e),this._unshiftOne(t)},n.prototype.push=function(t,e,r){var n=this.length()+3;if(this._willBeOverCapacity(n))return this._pushOne(t),this._pushOne(e),void this._pushOne(r);var i=this._front+n-3;this._checkCapacity(n);var o=this._capacity-1;this[i+0&o]=t,this[i+1&o]=e,this[i+2&o]=r,this._length=n},n.prototype.shift=function(){var t=this._front,e=this[t];return this[t]=void 0,this._front=t+1&this._capacity-1,this._length--,e},n.prototype.length=function(){return this._length},n.prototype._checkCapacity=function(t){this._capacity<t&&this._resizeTo(this._capacity<<1)},n.prototype._resizeTo=function(t){var e=this._capacity;this._capacity=t;var n=this._front,i=this._length,o=n+i&e-1;r(this,0,this,e,o)},e.exports=n},{}],29:[function(t,e){"use strict";e.exports=function(e,r,n,i){function o(t,o){var u=n(t);if(u instanceof e)return a(u);if(!s(t))return i("expecting an array, a promise or a thenable\n\n See http://goo.gl/s8MMhc\n");var c=new e(r);void 0!==o&&c._propagateFrom(o,5);for(var l=c._fulfill,h=c._reject,p=0,f=t.length;f>p;++p){var _=t[p];(void 0!==_||p in t)&&e.cast(_)._then(l,h,void 0,c,null)}return c}var s=t("./util.js").isArray,a=function(t){return t.then(function(e){return o(e,t)})};e.race=function(t){return o(t,void 0)},e.prototype.race=function(){return o(this,void 0)}}},{"./util.js":38}],30:[function(t,e){"use strict";e.exports=function(e,r,n,i,o){function s(t,r,n,s){this.constructor$(t),this._promise._captureStackTrace(),this._preservedValues=s===o?[]:null,this._zerothIsAccum=void 0===n,this._gotAccum=!1,this._reducingIndex=this._zerothIsAccum?1:0,this._valuesPhase=void 0;var u=i(n,this._promise),l=!1,h=u instanceof e;h&&(u=u._target(),u._isPending()?u._proxyPromiseArray(this,-1):u._isFulfilled()?(n=u._value(),this._gotAccum=!0):(this._reject(u._reason()),l=!0)),h||this._zerothIsAccum||(this._gotAccum=!0),this._callback=r,this._accum=n,l||c.invoke(a,this,void 0)}function a(){this._init$(void 0,-5)}function u(t,e,r,i){if("function"!=typeof e)return n("fn must be a function\n\n See http://goo.gl/916lJJ\n");var o=new s(t,e,r,i);return o.promise()}var c=t("./async.js"),l=t("./util.js"),h=l.tryCatch,p=l.errorObj;l.inherits(s,r),s.prototype._init=function(){},s.prototype._resolveEmptyArray=function(){(this._gotAccum||this._zerothIsAccum)&&this._resolve(null!==this._preservedValues?[]:this._accum)},s.prototype._promiseFulfilled=function(t,r){var n=this._values;n[r]=t;var o,s=this.length(),a=this._preservedValues,u=null!==a,c=this._gotAccum,l=this._valuesPhase;if(!l)for(l=this._valuesPhase=new Array(s),o=0;s>o;++o)l[o]=0;if(o=l[r],0===r&&this._zerothIsAccum?(this._accum=t,this._gotAccum=c=!0,l[r]=0===o?1:2):-1===r?(this._accum=t,this._gotAccum=c=!0):0===o?l[r]=1:(l[r]=2,this._accum=t),c){for(var f,_=this._callback,d=this._promise._boundTo,v=this._reducingIndex;s>v;++v)if(o=l[v],2!==o){if(1!==o)return;if(t=n[v],this._promise._pushContext(),u?(a.push(t),f=h(_).call(d,t,v,s)):f=h(_).call(d,this._accum,t,v,s),this._promise._popContext(),f===p)return this._reject(f.e);var y=i(f,this._promise);if(y instanceof e){if(y=y._target(),y._isPending())return l[v]=4,y._proxyPromiseArray(this,v);if(!y._isFulfilled())return this._reject(y._reason());f=y._value()}this._reducingIndex=v+1,this._accum=f}else this._reducingIndex=v+1;this._resolve(u?a:this._accum)}},e.prototype.reduce=function(t,e){return u(this,t,e,null)},e.reduce=function(t,e,r,n){return u(t,e,r,n)}}},{"./async.js":2,"./util.js":38}],31:[function(t,e){"use strict";var r,n=t("./util"),i=function(){throw new Error("No async scheduler available\n\n See http://goo.gl/m3OTXk\n")};if(n.isNode&&"undefined"==typeof MutationObserver){var o=global.setImmediate,s=process.nextTick;r=n.isRecentNode?function(t){o.call(global,t)}:function(t){s.call(process,t)}}else"undefined"!=typeof MutationObserver?(r=function(t){var e=document.createElement("div"),r=new MutationObserver(t);return r.observe(e,{attributes:!0}),function(){e.classList.toggle("foo")}},r.isStatic=!0):r="undefined"!=typeof setImmediate?function(t){setImmediate(t)}:"undefined"!=typeof setTimeout?function(t){setTimeout(t,0)}:i;e.exports=r},{"./util":38}],32:[function(t,e){"use strict";e.exports=function(e,r){function n(t){this.constructor$(t)}var i=e.PromiseInspection,o=t("./util.js");o.inherits(n,r),n.prototype._promiseResolved=function(t,e){this._values[t]=e;var r=++this._totalResolved;r>=this._length&&this._resolve(this._values)},n.prototype._promiseFulfilled=function(t,e){var r=new i;r._bitField=268435456,r._settledValue=t,this._promiseResolved(e,r)},n.prototype._promiseRejected=function(t,e){var r=new i;r._bitField=134217728,r._settledValue=t,this._promiseResolved(e,r)},e.settle=function(t){return new n(t).promise()},e.prototype.settle=function(){return new n(this).promise()}}},{"./util.js":38}],33:[function(t,e){"use strict";e.exports=function(e,r,n){function i(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1}function o(t,e){if((0|e)!==e||0>e)return n("expecting a positive integer\n\n See http://goo.gl/1wAmHx\n");var r=new i(t),o=r.promise();return r.setHowMany(e),r.init(),o}var s=t("./util.js"),a=t("./errors.js").RangeError,u=t("./errors.js").AggregateError,c=s.isArray;s.inherits(i,r),i.prototype._init=function(){if(this._initialized){if(0===this._howMany)return void this._resolve([]);this._init$(void 0,-5);var t=c(this._values);!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}},i.prototype.init=function(){this._initialized=!0,this._init()},i.prototype.setUnwrap=function(){this._unwrap=!0},i.prototype.howMany=function(){return this._howMany},i.prototype.setHowMany=function(t){this._howMany=t},i.prototype._promiseFulfilled=function(t){this._addFulfilled(t),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),this._resolve(1===this.howMany()&&this._unwrap?this._values[0]:this._values))},i.prototype._promiseRejected=function(t){if(this._addRejected(t),this.howMany()>this._canPossiblyFulfill()){for(var e=new u,r=this.length();r<this._values.length;++r)e.push(this._values[r]);this._reject(e)}},i.prototype._fulfilled=function(){return this._totalResolved},i.prototype._rejected=function(){return this._values.length-this.length()},i.prototype._addRejected=function(t){this._values.push(t)},i.prototype._addFulfilled=function(t){this._values[this._totalResolved++]=t},i.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},i.prototype._getRangeError=function(t){var e="Input array must contain at least "+this._howMany+" items but contains only "+t+" items";return new a(e)},i.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},e.some=function(t,e){return o(t,e)},e.prototype.some=function(t){return o(this,t)},e._SomePromiseArray=i}},{"./errors.js":13,"./util.js":38}],34:[function(t,e){"use strict";e.exports=function(t){function e(t){void 0!==t?(t=t._target(),this._bitField=t._bitField,this._settledValue=t._settledValue):(this._bitField=0,this._settledValue=void 0)}e.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/hc1DLj\n");return this._settledValue},e.prototype.error=e.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/hPuiwB\n");return this._settledValue},e.prototype.isFulfilled=t.prototype._isFulfilled=function(){return(268435456&this._bitField)>0},e.prototype.isRejected=t.prototype._isRejected=function(){return(134217728&this._bitField)>0},e.prototype.isPending=t.prototype._isPending=function(){return 0===(402653184&this._bitField)},e.prototype.isResolved=t.prototype._isResolved=function(){return(402653184&this._bitField)>0},t.prototype.isPending=function(){return this._target()._isPending()},t.prototype.isRejected=function(){return this._target()._isRejected()},t.prototype.isFulfilled=function(){return this._target()._isFulfilled()},t.prototype.isResolved=function(){return this._target()._isResolved()},t.prototype._value=function(){return this._settledValue},t.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue},t.prototype.value=function(){var t=this._target();if(!t.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/hc1DLj\n");return t._settledValue},t.prototype.reason=function(){var t=this._target();if(!t.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/hPuiwB\n");return t._unsetRejectionIsUnhandled(),t._settledValue},t.PromiseInspection=e}},{}],35:[function(t,e){"use strict";e.exports=function(e,r){function n(t,n){if(c(t)){if(t instanceof e)return t;if(o(t)){var l=new e(r);return t._then(l._fulfillUnchecked,l._rejectUncheckedCheckError,l._progressUnchecked,l,null),l}var h=a.tryCatch(i)(t);if(h===u){n&&n._pushContext();var l=e.reject(h.e);return n&&n._popContext(),l}if("function"==typeof h)return s(t,h,n)}return t}function i(t){return t.then}function o(t){return l.call(t,"_promise0")}function s(t,n,i){function o(r){l&&(t===r?l._rejectCallback(e._makeSelfResolutionError(),!1,!0):l._resolveCallback(r),l=null)}function s(t){l&&(l._rejectCallback(t,p,!0),l=null)}function c(t){l&&"function"==typeof l._progress&&l._progress(t)}var l=new e(r),h=l;i&&i._pushContext(),l._captureStackTrace(),i&&i._popContext();var p=!0,f=a.tryCatch(n).call(t,o,s,c);return p=!1,l&&f===u&&(l._rejectCallback(f.e,!0,!0),l=null),h}var a=t("./util.js"),u=a.errorObj,c=a.isObject,l={}.hasOwnProperty;return n}},{"./util.js":38}],36:[function(t,e){"use strict";e.exports=function(e,r){function n(t){var e=this;return e instanceof Number&&(e=+e),clearTimeout(e),t}function i(t){var e=this;throw e instanceof Number&&(e=+e),clearTimeout(e),t}var o=t("./util.js"),s=e.TimeoutError,a=function(t,e){if(t.isPending()){"string"!=typeof e&&(e="operation timed out");var r=new s(e);o.markAsOriginatingFromRejection(r),t._attachExtraTrace(r),t._cancel(r)}},u=function(t){return c(+this).thenReturn(t)},c=e.delay=function(t,n){if(void 0===n){n=t,t=void 0;var i=new e(r);return setTimeout(function(){i._fulfill()},n),i}return n=+n,e.resolve(t)._then(u,null,null,n,void 0)};e.prototype.delay=function(t){return c(this,t)},e.prototype.timeout=function(t,e){t=+t;var r=this.then().cancellable();r._cancellationParent=this;var o=setTimeout(function(){a(r,e)},t);return r._then(n,i,void 0,o,void 0)}}},{"./util.js":38}],37:[function(t,e){"use strict";e.exports=function(e,r,n,i){function o(t){for(var r=t.length,n=0;r>n;++n){var i=t[n];if(i.isRejected())return e.reject(i.error());t[n]=i._settledValue}return t}function s(t){setTimeout(function(){throw t},0)}function a(t){var e=n(t);return e!==t&&"function"==typeof t._isDisposable&&"function"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e}function u(t,r){function i(){if(o>=u)return c.resolve();var l=a(t[o++]);if(l instanceof e&&l._isDisposable()){try{l=n(l._getDisposer().tryDispose(r),t.promise)}catch(h){return s(h)}if(l instanceof e)return l._then(i,s,null,null,null)}i()}var o=0,u=t.length,c=e.defer();return i(),c.promise}function c(t){var e=new v;return e._settledValue=t,e._bitField=268435456,u(this,e).thenReturn(t)}function l(t){var e=new v;return e._settledValue=t,e._bitField=134217728,u(this,e).thenThrow(t)}function h(t,e,r){this._data=t,this._promise=e,this._context=r}function p(t,e,r){this.constructor$(t,e,r)}function f(t){return h.isDisposer(t)?(this.resources[this.index]._setDisposable(t),t.promise()):t}var _=t("./errors.js").TypeError,d=t("./util.js").inherits,v=e.PromiseInspection;h.prototype.data=function(){return this._data},h.prototype.promise=function(){return this._promise},h.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():null},h.prototype.tryDispose=function(t){var e=this.resource(),r=this._context;void 0!==r&&r._pushContext();var n=null!==e?this.doDispose(e,t):null;return void 0!==r&&r._popContext(),this._promise._unsetDisposable(),this._data=null,n},h.isDisposer=function(t){return null!=t&&"function"==typeof t.resource&&"function"==typeof t.tryDispose},d(p,h),p.prototype.doDispose=function(t,e){var r=this.data();return r.call(t,t,e)},e.using=function(){var t=arguments.length;if(2>t)return r("you must pass at least 2 arguments to Promise.using");var i=arguments[t-1];if("function"!=typeof i)return r("fn must be a function\n\n See http://goo.gl/916lJJ\n");t--;for(var s=new Array(t),a=0;t>a;++a){var u=arguments[a];if(h.isDisposer(u)){var p=u;u=u.promise(),u._setDisposable(p)}else{var _=n(u);_ instanceof e&&(u=_._then(f,null,null,{resources:s,index:a},void 0))}s[a]=u}var d=e.settle(s).then(o).then(function(t){d._pushContext();var e;try{e=i.apply(void 0,t)}finally{d._popContext()}return e})._then(c,l,void 0,s,void 0);return s.promise=d,d},e.prototype._setDisposable=function(t){this._bitField=262144|this._bitField,this._disposer=t},e.prototype._isDisposable=function(){return(262144&this._bitField)>0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=-262145&this._bitField,this._disposer=void 0
+},e.prototype.disposer=function(t){if("function"==typeof t)return new p(t,this,i());throw new _}}},{"./errors.js":13,"./util.js":38}],38:[function(t,e,r){"use strict";function n(){try{return T.apply(this,arguments)}catch(t){return C.e=t,C}}function i(t){return T=t,n}function o(t){return null==t||t===!0||t===!1||"string"==typeof t||"number"==typeof t}function s(t){return!o(t)}function a(t){return o(t)?new Error(v(t)):t}function u(t,e){var r,n=t.length,i=new Array(n+1);for(r=0;n>r;++r)i[r]=t[r];return i[r]=e,i}function c(t,e,r){if(!k.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void 0;var n=Object.getOwnPropertyDescriptor(t,e);return null!=n?null==n.get&&null==n.set?n.value:r:void 0}function l(t,e,r){if(o(t))return t;var n={value:r,configurable:!0,enumerable:!1,writable:!0};return k.defineProperty(t,e,n),t}function h(t){throw t}function p(t){try{if("function"==typeof t){var e=k.names(t.prototype);if(k.isES5&&e.length>1||e.length>0&&(1!==e.length||"constructor"!==e[0])||S.test(t+""))return!0}return!1}catch(r){return!1}}function f(t){function e(){}e.prototype=t;for(var r=8;r--;)new e;return t}function _(t){return A.test(t)}function d(t,e,r){for(var n=new Array(t),i=0;t>i;++i)n[i]=e+i+r;return n}function v(t){try{return t+""}catch(e){return"[no string representation]"}}function y(t){try{l(t,"isOperational",!0)}catch(e){}}function g(t){return null==t?!1:t instanceof Error.__BluebirdErrorTypes__.OperationalError||t.isOperational===!0}function m(t){return t instanceof Error&&k.propertyIsWritable(t,"stack")}function j(t){return{}.toString.call(t)}function b(t,e,r){for(var n=k.names(t),i=0;i<n.length;++i){var o=n[i];r(o)&&k.defineProperty(e,o,k.getDescriptor(t,o))}}function w(t){return t===t.call||t===t.toString||t===t.bind||t===t.apply}var k=t("./es5.js"),E="undefined"==typeof navigator,F=function(){try{var t={};return k.defineProperty(t,"f",{get:function(){return 3}}),3===t.f}catch(e){return!1}}(),C={e:{}},T,x=function(t,e){function r(){this.constructor=t,this.constructor$=e;for(var r in e.prototype)n.call(e.prototype,r)&&"$"!==r.charAt(r.length-1)&&(this[r+"$"]=e.prototype[r])}var n={}.hasOwnProperty;return r.prototype=e.prototype,t.prototype=new r,t.prototype},P=function(){return"string"!==this}.call("string"),R=function(){if(k.isES5){var t=Object.prototype,e=Object.getOwnPropertyNames;return function(r){for(var n=[],i=Object.create(null);null!=r&&r!==t;){var o;try{o=e(r)}catch(s){return n}for(var a=0;a<o.length;++a){var u=o[a];if(!i[u]){i[u]=!0;var c=Object.getOwnPropertyDescriptor(r,u);null!=c&&null==c.get&&null==c.set&&n.push(u)}}r=k.getPrototypeOf(r)}return n}}return function(t){var e=[];for(var r in t)e.push(r);return e}}(),S=/this\s*\.\s*\S+\s*=/,A=/^[a-z$_][a-z$_0-9]*$/i,O=function(){return"stack"in new Error?function(t){return m(t)?t:new Error(v(t))}:function(t){if(m(t))return t;try{throw new Error(v(t))}catch(e){return e}}}(),L={isClass:p,isIdentifier:_,inheritedDataKeys:R,getDataPropertyOrDefault:c,thrower:h,isArray:k.isArray,haveGetters:F,notEnumerableProp:l,isPrimitive:o,isObject:s,canEvaluate:E,errorObj:C,tryCatch:i,inherits:x,withAppended:u,maybeWrapAsError:a,wrapsPrimitiveReceiver:P,toFastProperties:f,filledRange:d,toString:v,canAttachTrace:m,ensureErrorObject:O,originatesFromRejection:g,markAsOriginatingFromRejection:y,classString:j,copyDescriptors:b,hasDevTools:"undefined"!=typeof chrome&&chrome&&"function"==typeof chrome.loadTimes,isNode:"undefined"!=typeof process&&"[object process]"===j(process).toLowerCase(),isNativeFunctionMethod:w};L.isRecentNode=L.isNode&&function(){var t=process.versions.node.split(".").map(Number);return 0===t[0]&&t[1]>10||t[0]>0}();try{throw new Error}catch(I){L.lastLineError=I}e.exports=L},{"./es5.js":14}],39:[function(t,e){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(t){return"function"==typeof t}function i(t){return"number"==typeof t}function o(t){return"object"==typeof t&&null!==t}function s(t){return void 0===t}e.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(t){if(!i(t)||0>t||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},r.prototype.emit=function(t){var e,r,i,a,u,c;if(this._events||(this._events={}),"error"===t&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if(e=arguments[1],e instanceof Error)throw e;throw TypeError('Uncaught, unspecified "error" event.')}if(r=this._events[t],s(r))return!1;if(n(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:for(i=arguments.length,a=new Array(i-1),u=1;i>u;u++)a[u-1]=arguments[u];r.apply(this,a)}else if(o(r)){for(i=arguments.length,a=new Array(i-1),u=1;i>u;u++)a[u-1]=arguments[u];for(c=r.slice(),i=c.length,u=0;i>u;u++)c[u].apply(this,a)}return!0},r.prototype.addListener=function(t,e){var i;if(!n(e))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,n(e.listener)?e.listener:e),this._events[t]?o(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,o(this._events[t])&&!this._events[t].warned){var i;i=s(this._maxListeners)?r.defaultMaxListeners:this._maxListeners,i&&i>0&&this._events[t].length>i&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace())}return this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(t,e){function r(){this.removeListener(t,r),i||(i=!0,e.apply(this,arguments))}if(!n(e))throw TypeError("listener must be a function");var i=!1;return r.listener=e,this.on(t,r),this},r.prototype.removeListener=function(t,e){var r,i,s,a;if(!n(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],s=r.length,i=-1,r===e||n(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(r)){for(a=s;a-->0;)if(r[a]===e||r[a].listener&&r[a].listener===e){i=a;break}if(0>i)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(i,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},r.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[t],n(r))this.removeListener(t,r);else for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},r.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?n(this._events[t])?[this._events[t]]:this._events[t].slice():[]},r.listenerCount=function(t,e){var r;return r=t._events&&t._events[e]?n(t._events[e])?1:t._events[e].length:0}},{}]},{},[4])(4)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise); \ No newline at end of file
diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/async.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/async.js
index 3b5f828ce9e..917e321ff1a 100644
--- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/async.js
+++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/async.js
@@ -132,13 +132,18 @@ if (!util.hasDevTools) {
Async.prototype.invoke = AsyncInvoke;
Async.prototype.settlePromises = AsyncSettlePromises;
} else {
+ if (schedule.isStatic) {
+ schedule = function(fn) { setTimeout(fn, 0); };
+ }
Async.prototype.invokeLater = function (fn, receiver, arg) {
if (this._trampolineEnabled) {
AsyncInvokeLater.call(this, fn, receiver, arg);
} else {
- setTimeout(function() {
- fn.call(receiver, arg);
- }, 100);
+ this._schedule(function() {
+ setTimeout(function() {
+ fn.call(receiver, arg);
+ }, 100);
+ });
}
};
@@ -146,9 +151,9 @@ if (!util.hasDevTools) {
if (this._trampolineEnabled) {
AsyncInvoke.call(this, fn, receiver, arg);
} else {
- setTimeout(function() {
+ this._schedule(function() {
fn.call(receiver, arg);
- }, 0);
+ });
}
};
@@ -156,9 +161,9 @@ if (!util.hasDevTools) {
if (this._trampolineEnabled) {
AsyncSettlePromises.call(this, promise);
} else {
- setTimeout(function() {
+ this._schedule(function() {
promise._settlePromises();
- }, 0);
+ });
}
};
}
diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/debuggability.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/debuggability.js
index 5ac176705f2..347476d8658 100644
--- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/debuggability.js
+++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/debuggability.js
@@ -14,7 +14,13 @@ if (debugging) {
async.disableTrampolineIfNecessary();
}
+Promise.prototype._ignoreRejections = function() {
+ this._unsetRejectionIsUnhandled();
+ this._bitField = this._bitField | 16777216;
+};
+
Promise.prototype._ensurePossibleRejectionHandled = function () {
+ if ((this._bitField & 16777216) !== 0) return;
this._setRejectionIsUnhandled();
async.invokeLater(this._notifyUnhandledRejection, this, undefined);
};
diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/promise_array.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/promise_array.js
index 6dac86640a9..b2e8f1cc580 100644
--- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/promise_array.js
+++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/promise_array.js
@@ -80,7 +80,7 @@ PromiseArray.prototype._init = function init(_, resolveValueIfEmpty) {
if (maybePromise instanceof Promise) {
maybePromise = maybePromise._target();
if (isResolved) {
- maybePromise._unsetRejectionIsUnhandled();
+ maybePromise._ignoreRejections();
} else if (maybePromise._isPending()) {
maybePromise._proxyPromiseArray(this, i);
} else if (maybePromise._isFulfilled()) {
diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/promisify.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/promisify.js
index 035534459bb..0b335422228 100644
--- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/promisify.js
+++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/promisify.js
@@ -12,10 +12,10 @@ var defaultSuffix = "Async";
var defaultPromisified = {__isPromisified__: true};
var noCopyPropsPattern =
/^(?:length|name|arguments|caller|callee|prototype|__isPromisified__)$/;
-var defaultFilter = function(name, func) {
+var defaultFilter = function(name) {
return util.isIdentifier(name) &&
name.charAt(0) !== "_" &&
- !util.isClass(func);
+ name !== "constructor";
};
function propsFilter(key) {
@@ -60,6 +60,7 @@ function promisifiableMethods(obj, suffix, suffixRegexp, filter) {
var passesDefaultFilter = filter === defaultFilter
? true : defaultFilter(key, value, obj);
if (typeof value === "function" &&
+ !util.isNativeFunctionMethod(value) &&
!isPromisified(value) &&
!hasPromisified(obj, key, suffix) &&
filter(key, value, obj, passesDefaultFilter)) {
@@ -159,6 +160,7 @@ function(callback, receiver, originalName, fn) {
"nodebackForPromise",
"tryCatch",
"errorObj",
+ "notEnumerableProp",
"INTERNAL","'use strict'; \n\
var ret = function (Parameters) { \n\
'use strict'; \n\
@@ -176,7 +178,7 @@ function(callback, receiver, originalName, fn) {
} \n\
return promise; \n\
}; \n\
- ret.__isPromisified__ = true; \n\
+ notEnumerableProp(ret, '__isPromisified__', true); \n\
return ret; \n\
"
.replace("Parameters", parameterDeclaration(newParameterCount))
@@ -190,6 +192,7 @@ function(callback, receiver, originalName, fn) {
nodebackForPromise,
util.tryCatch,
util.errorObj,
+ util.notEnumerableProp,
INTERNAL
);
};
@@ -216,7 +219,7 @@ function makeNodePromisifiedClosure(callback, receiver, _, fn) {
}
return promise;
}
- promisified.__isPromisified__ = true;
+ util.notEnumerableProp(promisified, "__isPromisified__", true);
return promisified;
}
diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/util.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/util.js
index ab67f8759de..fdb7416f9ec 100644
--- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/util.js
+++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/util.js
@@ -153,13 +153,17 @@ var inheritedDataKeys = (function() {
})();
+var thisAssignmentPattern = /this\s*\.\s*\S+\s*=/;
function isClass(fn) {
try {
if (typeof fn === "function") {
var keys = es5.names(fn.prototype);
- if (es5.isES5) return keys.length > 1;
- return keys.length > 0 &&
- !(keys.length === 1 && keys[0] === "constructor");
+ if (((es5.isES5 && keys.length > 1) ||
+ (keys.length > 0 &&
+ !(keys.length === 1 && keys[0] === "constructor"))) ||
+ thisAssignmentPattern.test(fn + "")) {
+ return true;
+ }
}
return false;
} catch (e) {
@@ -244,6 +248,13 @@ function copyDescriptors(from, to, filter) {
}
}
+function isNativeFunctionMethod(fn) {
+ return fn === fn.call ||
+ fn === fn.toString ||
+ fn === fn.bind ||
+ fn === fn.apply;
+}
+
var ret = {
isClass: isClass,
isIdentifier: isIdentifier,
@@ -274,7 +285,8 @@ var ret = {
hasDevTools: typeof chrome !== "undefined" && chrome &&
typeof chrome.loadTimes === "function",
isNode: typeof process !== "undefined" &&
- classString(process).toLowerCase() === "[object process]"
+ classString(process).toLowerCase() === "[object process]",
+ isNativeFunctionMethod: isNativeFunctionMethod
};
ret.isRecentNode = ret.isNode && (function() {
var version = process.versions.node.split(".").map(Number);
diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/package.json
index 2bb86a9a1fa..3b4c5ea88ec 100644
--- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/package.json
+++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/package.json
@@ -1,7 +1,7 @@
{
"name": "bluebird",
"description": "Full featured Promises/A+ implementation with exceptionally good performance",
- "version": "2.9.27",
+ "version": "2.9.30",
"keywords": [
"promise",
"performance",
@@ -72,12 +72,12 @@
"LICENSE",
"zalgo.js"
],
- "gitHead": "634af0e27ff4faab62c6c5bfd105527abcf8b06e",
- "_id": "bluebird@2.9.27",
- "_shasum": "8eab7da1e866998f9f71c209b9875f9949a7adca",
+ "gitHead": "808ad89efab27c6eb3d63dcb4198c5732ab51c29",
+ "_id": "bluebird@2.9.30",
+ "_shasum": "edda875ec9aad1f29cf1f56d6e82fbab2b0df556",
"_from": "bluebird@>=2.9.26 <3.0.0",
- "_npmVersion": "2.7.1",
- "_nodeVersion": "1.6.2",
+ "_npmVersion": "2.11.1",
+ "_nodeVersion": "2.3.0",
"_npmUser": {
"name": "esailija",
"email": "petka_antonov@hotmail.com"
@@ -89,10 +89,9 @@
}
],
"dist": {
- "shasum": "8eab7da1e866998f9f71c209b9875f9949a7adca",
- "tarball": "http://registry.npmjs.org/bluebird/-/bluebird-2.9.27.tgz"
+ "shasum": "edda875ec9aad1f29cf1f56d6e82fbab2b0df556",
+ "tarball": "http://registry.npmjs.org/bluebird/-/bluebird-2.9.30.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.9.27.tgz",
- "readme": "ERROR: No README data found!"
+ "_resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.9.30.tgz"
}
diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/README.md b/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/README.md
index 43f15626f10..cb1e9089ff2 100755
--- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/README.md
+++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/README.md
@@ -82,7 +82,12 @@ Returns a 401 Unauthorized error where:
- `scheme` can be one of the following:
- an authentication scheme name
- an array of string values. These values will be separated by ', ' and set to the 'WWW-Authenticate' header.
-- `attributes` - an object of values to use while setting the 'WWW-Authenticate' header. This value is only used when `schema` is a string, otherwise it is ignored. Every key/value pair will be included in the 'WWW-Authenticate' in the format of 'key="value"'. `null` and `undefined` will be replaced with an empty string. If `attributes` is set, `message` will be used as the 'error' segment of the 'WWW-Authenticate' header. If `message` is unset, the 'error' segment of the header will not be present and `isMissing` will be true on the error object.
+- `attributes` - an object of values to use while setting the 'WWW-Authenticate' header. This value is only used
+ when `schema` is a string, otherwise it is ignored. Every key/value pair will be included in the
+ 'WWW-Authenticate' in the format of 'key="value"' as well as in the response payload under the `attributes` key.
+ `null` and `undefined` will be replaced with an empty string. If `attributes` is set, `message` will be used as
+ the 'error' segment of the 'WWW-Authenticate' header. If `message` is unset, the 'error' segment of the header
+ will not be present and `isMissing` will be true on the error object.
If either `scheme` or `attributes` are set, the resultant `Boom` object will have the 'WWW-Authenticate' header set for the response.
@@ -111,7 +116,10 @@ Generates the following response:
"payload": {
"statusCode": 401,
"error": "Unauthorized",
- "message": "invalid password"
+ "message": "invalid password",
+ "attributes": {
+ "error": "invalid password"
+ }
},
"headers" {
"WWW-Authenticate": "sample error=\"invalid password\""
@@ -128,7 +136,13 @@ Generates the following response:
"payload": {
"statusCode": 401,
"error": "Unauthorized",
- "message": "invalid password"
+ "message": "invalid password",
+ "attributes": {
+ "error": "invalid password",
+ "ttl": 0,
+ "cache": "",
+ "foo": "bar"
+ }
},
"headers" {
"WWW-Authenticate": "sample ttl=\"0\", cache=\"\", foo=\"bar\", error=\"invalid password\""
diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/index.js b/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/index.js
deleted file mode 100755
index 4cc88b35877..00000000000
--- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/index.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./lib'); \ No newline at end of file
diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js b/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js
index 256bf3222ef..fb6564a4b20 100755
--- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js
+++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js
@@ -99,20 +99,27 @@ exports.unauthorized = function (message, scheme, attributes) { // Or f
// function (message, scheme, attributes)
wwwAuthenticate = scheme;
+
+ if (attributes || message) {
+ err.output.payload.attributes = {};
+ }
+
if (attributes) {
var names = Object.keys(attributes);
for (i = 0, il = names.length; i < il; ++i) {
+ var name = names[i];
if (i) {
wwwAuthenticate += ',';
}
- var value = attributes[names[i]];
+ var value = attributes[name];
if (value === null ||
value === undefined) { // Value can be zero
value = '';
}
- wwwAuthenticate += ' ' + names[i] + '="' + Hoek.escapeHeaderAttribute(value.toString()) + '"';
+ wwwAuthenticate += ' ' + name + '="' + Hoek.escapeHeaderAttribute(value.toString()) + '"';
+ err.output.payload.attributes[name] = value;
}
}
@@ -121,6 +128,7 @@ exports.unauthorized = function (message, scheme, attributes) { // Or f
wwwAuthenticate += ',';
}
wwwAuthenticate += ' error="' + Hoek.escapeHeaderAttribute(message) + '"';
+ err.output.payload.attributes.error = message;
}
else {
err.isMissing = true;
diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/package.json b/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/package.json
index 08663ad9e33..15dff84aedd 100644
--- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/package.json
+++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/package.json
@@ -1,12 +1,12 @@
{
"name": "boom",
"description": "HTTP-friendly error objects",
- "version": "2.7.2",
+ "version": "2.8.0",
"repository": {
"type": "git",
"url": "git://github.com/hapijs/boom.git"
},
- "main": "index",
+ "main": "lib/index.js",
"keywords": [
"error",
"http"
@@ -26,15 +26,15 @@
"test-cov-html": "lab -a code -r html -o coverage.html"
},
"license": "BSD-3-Clause",
- "gitHead": "29be188e9ecfce3a2e090b8714dec2b6e0791724",
+ "gitHead": "43f13bf2d336b35ccbb062b32ba2a17259f6d24c",
"bugs": {
"url": "https://github.com/hapijs/boom/issues"
},
- "homepage": "https://github.com/hapijs/boom",
- "_id": "boom@2.7.2",
- "_shasum": "dad628d897f7fd2e32cc82197f13307971cf8354",
+ "homepage": "https://github.com/hapijs/boom#readme",
+ "_id": "boom@2.8.0",
+ "_shasum": "317bdfd47018fe7dd79b0e9da73efe244119fdf1",
"_from": "boom@>=2.0.0 <3.0.0",
- "_npmVersion": "2.7.0",
+ "_npmVersion": "2.11.1",
"_nodeVersion": "0.10.38",
"_npmUser": {
"name": "arb",
@@ -55,10 +55,9 @@
}
],
"dist": {
- "shasum": "dad628d897f7fd2e32cc82197f13307971cf8354",
- "tarball": "http://registry.npmjs.org/boom/-/boom-2.7.2.tgz"
+ "shasum": "317bdfd47018fe7dd79b0e9da73efe244119fdf1",
+ "tarball": "http://registry.npmjs.org/boom/-/boom-2.8.0.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/boom/-/boom-2.7.2.tgz",
- "readme": "ERROR: No README data found!"
+ "_resolved": "https://registry.npmjs.org/boom/-/boom-2.8.0.tgz"
}
diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/test/index.js b/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/test/index.js
index a0db4dff69a..489f77c61de 100755
--- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/test/index.js
+++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/test/index.js
@@ -200,6 +200,7 @@ describe('unauthorized()', function () {
var err = Boom.unauthorized('boom', 'Test', { a: 1, b: 'something', c: null, d: 0 });
expect(err.output.statusCode).to.equal(401);
expect(err.output.headers['WWW-Authenticate']).to.equal('Test a="1", b="something", c="", d="0", error="boom"');
+ expect(err.output.payload.attributes).to.deep.equal({ a: 1, b: 'something', c: '', d: 0, error: 'boom' });
done();
});
diff --git a/deps/npm/node_modules/request/node_modules/isstream/.jshintrc b/deps/npm/node_modules/request/node_modules/isstream/.jshintrc
deleted file mode 100644
index c8ef3ca4097..00000000000
--- a/deps/npm/node_modules/request/node_modules/isstream/.jshintrc
+++ /dev/null
@@ -1,59 +0,0 @@
-{
- "predef": [ ]
- , "bitwise": false
- , "camelcase": false
- , "curly": false
- , "eqeqeq": false
- , "forin": false
- , "immed": false
- , "latedef": false
- , "noarg": true
- , "noempty": true
- , "nonew": true
- , "plusplus": false
- , "quotmark": true
- , "regexp": false
- , "undef": true
- , "unused": true
- , "strict": false
- , "trailing": true
- , "maxlen": 120
- , "asi": true
- , "boss": true
- , "debug": true
- , "eqnull": true
- , "esnext": true
- , "evil": true
- , "expr": true
- , "funcscope": false
- , "globalstrict": false
- , "iterator": false
- , "lastsemic": true
- , "laxbreak": true
- , "laxcomma": true
- , "loopfunc": true
- , "multistr": false
- , "onecase": false
- , "proto": false
- , "regexdash": false
- , "scripturl": true
- , "smarttabs": false
- , "shadow": false
- , "sub": true
- , "supernew": false
- , "validthis": true
- , "browser": true
- , "couch": false
- , "devel": false
- , "dojo": false
- , "mootools": false
- , "node": true
- , "nonstandard": true
- , "prototypejs": false
- , "rhino": false
- , "worker": true
- , "wsh": false
- , "nomen": false
- , "onevar": false
- , "passfail": false
-} \ No newline at end of file
diff --git a/deps/npm/node_modules/request/node_modules/mime-types/HISTORY.md b/deps/npm/node_modules/request/node_modules/mime-types/HISTORY.md
index 3f4ebe9a4ad..fb90c271c78 100644
--- a/deps/npm/node_modules/request/node_modules/mime-types/HISTORY.md
+++ b/deps/npm/node_modules/request/node_modules/mime-types/HISTORY.md
@@ -1,3 +1,15 @@
+2.0.14 / 2015-06-06
+===================
+
+ * deps: mime-db@~1.12.0
+ - Add new mime types
+
+2.0.13 / 2015-05-31
+===================
+
+ * deps: mime-db@~1.11.0
+ - Add new mime types
+
2.0.12 / 2015-05-19
===================
diff --git a/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md b/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md
index f24590ebd9e..d559c260d30 100644
--- a/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md
+++ b/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md
@@ -1,3 +1,20 @@
+1.12.0 / 2015-06-05
+===================
+
+ * Add `application/bdoc`
+ * Add `application/vnd.hyperdrive+json`
+ * Add `application/x-bdoc`
+ * Add extension `.rtf` to `text/rtf`
+
+1.11.0 / 2015-05-31
+===================
+
+ * Add `audio/wav`
+ * Add `audio/wave`
+ * Add extension `.litcoffee` to `text/coffeescript`
+ * Add extension `.sfd-hdstx` to `application/vnd.hydrostatix.sof-data`
+ * Add extension `.n-gage` to `application/vnd.nokia.n-gage.symbian.install`
+
1.10.0 / 2015-05-19
===================
diff --git a/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json b/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json
index d5aa7878292..5f111bea4d3 100644
--- a/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json
+++ b/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json
@@ -105,6 +105,10 @@
"application/batch-smtp": {
"source": "iana"
},
+ "application/bdoc": {
+ "compressible": false,
+ "extensions": ["bdoc"]
+ },
"application/beep+xml": {
"source": "iana"
},
@@ -2037,7 +2041,12 @@
"source": "iana"
},
"application/vnd.hydrostatix.sof-data": {
- "source": "iana"
+ "source": "iana",
+ "extensions": ["sfd-hdstx"]
+ },
+ "application/vnd.hyperdrive+json": {
+ "source": "iana",
+ "compressible": true
},
"application/vnd.hzn-3d-crossword": {
"source": "iana"
@@ -2728,7 +2737,8 @@
"extensions": ["ngdat"]
},
"application/vnd.nokia.n-gage.symbian.install": {
- "source": "iana"
+ "source": "iana",
+ "extensions": ["n-gage"]
},
"application/vnd.nokia.ncd": {
"source": "iana"
@@ -4083,6 +4093,10 @@
"source": "apache",
"extensions": ["bcpio"]
},
+ "application/x-bdoc": {
+ "compressible": false,
+ "extensions": ["bdoc"]
+ },
"application/x-bittorrent": {
"source": "apache",
"extensions": ["torrent"]
@@ -5100,6 +5114,14 @@
"audio/vorbis-config": {
"source": "iana"
},
+ "audio/wav": {
+ "compressible": false,
+ "extensions": ["wav"]
+ },
+ "audio/wave": {
+ "compressible": false,
+ "extensions": ["wav"]
+ },
"audio/webm": {
"source": "apache",
"compressible": false,
@@ -5673,7 +5695,7 @@
"compressible": true
},
"text/coffeescript": {
- "extensions": ["coffee"]
+ "extensions": ["coffee","litcoffee"]
},
"text/css": {
"source": "iana",
@@ -5781,7 +5803,9 @@
"extensions": ["rtx"]
},
"text/rtf": {
- "source": "iana"
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["rtf"]
},
"text/rtp-enc-aescm128": {
"source": "iana"
diff --git a/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json b/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json
index 6ac498a5136..616172299f0 100644
--- a/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json
+++ b/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json
@@ -1,7 +1,7 @@
{
"name": "mime-db",
"description": "Media Type Database",
- "version": "1.10.0",
+ "version": "1.12.0",
"contributors": [
{
"name": "Douglas Christopher Wilson",
@@ -33,14 +33,14 @@
"url": "git+https://github.com/jshttp/mime-db.git"
},
"devDependencies": {
- "bluebird": "~2.9.20",
+ "bluebird": "2.9.27",
"co": "4.5.4",
"cogent": "1.0.1",
- "csv-parse": "0.1.1",
+ "csv-parse": "0.1.2",
"gnode": "0.1.1",
"istanbul": "0.3.9",
"mocha": "1.21.5",
- "raw-body": "2.0.1",
+ "raw-body": "2.1.0",
"stream-to-array": "2"
},
"files": [
@@ -61,14 +61,14 @@
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/",
"update": "npm run fetch && npm run build"
},
- "gitHead": "260552f9177fe78986b92699999f81999c7fe43c",
+ "gitHead": "cf35cbba6b22f4a3b3eef9a32129ea5b7f0f91ee",
"bugs": {
"url": "https://github.com/jshttp/mime-db/issues"
},
"homepage": "https://github.com/jshttp/mime-db",
- "_id": "mime-db@1.10.0",
- "_shasum": "e6308063c758ebd12837874c3d1ea9170766b03b",
- "_from": "mime-db@>=1.10.0 <1.11.0",
+ "_id": "mime-db@1.12.0",
+ "_shasum": "3d0c63180f458eb10d325aaa37d7c58ae312e9d7",
+ "_from": "mime-db@>=1.12.0 <1.13.0",
"_npmVersion": "1.4.28",
"_npmUser": {
"name": "dougwilson",
@@ -85,10 +85,10 @@
}
],
"dist": {
- "shasum": "e6308063c758ebd12837874c3d1ea9170766b03b",
- "tarball": "http://registry.npmjs.org/mime-db/-/mime-db-1.10.0.tgz"
+ "shasum": "3d0c63180f458eb10d325aaa37d7c58ae312e9d7",
+ "tarball": "http://registry.npmjs.org/mime-db/-/mime-db-1.12.0.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.10.0.tgz",
+ "_resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.12.0.tgz",
"readme": "ERROR: No README data found!"
}
diff --git a/deps/npm/node_modules/request/node_modules/mime-types/package.json b/deps/npm/node_modules/request/node_modules/mime-types/package.json
index 1db9255bdde..23060b775dd 100644
--- a/deps/npm/node_modules/request/node_modules/mime-types/package.json
+++ b/deps/npm/node_modules/request/node_modules/mime-types/package.json
@@ -1,7 +1,7 @@
{
"name": "mime-types",
"description": "The ultimate javascript content-type utility.",
- "version": "2.0.12",
+ "version": "2.0.14",
"contributors": [
{
"name": "Douglas Christopher Wilson",
@@ -28,7 +28,7 @@
"url": "git+https://github.com/jshttp/mime-types.git"
},
"dependencies": {
- "mime-db": "~1.10.0"
+ "mime-db": "~1.12.0"
},
"devDependencies": {
"istanbul": "0.3.9",
@@ -47,13 +47,13 @@
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/test.js",
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot test/test.js"
},
- "gitHead": "a1e3c4b6bbb6afb615c8a058481d58cb57a4cb95",
+ "gitHead": "7d53a3351581eb3d7ae1e846ea860037bce6fe3f",
"bugs": {
"url": "https://github.com/jshttp/mime-types/issues"
},
"homepage": "https://github.com/jshttp/mime-types",
- "_id": "mime-types@2.0.12",
- "_shasum": "87ae9f124e94f8e440c93d1a72d0dccecdb71135",
+ "_id": "mime-types@2.0.14",
+ "_shasum": "310e159db23e077f8bb22b748dabfa4957140aa6",
"_from": "mime-types@>=2.0.1 <2.1.0",
"_npmVersion": "1.4.28",
"_npmUser": {
@@ -75,10 +75,10 @@
}
],
"dist": {
- "shasum": "87ae9f124e94f8e440c93d1a72d0dccecdb71135",
- "tarball": "http://registry.npmjs.org/mime-types/-/mime-types-2.0.12.tgz"
+ "shasum": "310e159db23e077f8bb22b748dabfa4957140aa6",
+ "tarball": "http://registry.npmjs.org/mime-types/-/mime-types-2.0.14.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.0.12.tgz",
+ "_resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.0.14.tgz",
"readme": "ERROR: No README data found!"
}
diff --git a/deps/npm/node_modules/request/node_modules/qs/.jshintrc b/deps/npm/node_modules/request/node_modules/qs/.jshintrc
deleted file mode 100644
index 997b3f7d45e..00000000000
--- a/deps/npm/node_modules/request/node_modules/qs/.jshintrc
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "node": true,
-
- "curly": true,
- "latedef": true,
- "quotmark": true,
- "undef": true,
- "unused": true,
- "trailing": true
-}
diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/README.md b/deps/npm/node_modules/request/node_modules/tough-cookie/README.md
index f56d153f115..419dd48d580 100644
--- a/deps/npm/node_modules/request/node_modules/tough-cookie/README.md
+++ b/deps/npm/node_modules/request/node_modules/tough-cookie/README.md
@@ -8,7 +8,7 @@
# Synopsis
``` javascript
-var tough = require('tough-cookie'); // note: not 'cookie', 'cookies' or 'node-cookie'
+var tough = require('tough-cookie');
var Cookie = tough.Cookie;
var cookie = Cookie.parse(header);
cookie.value = 'somethingdifferent';
@@ -32,61 +32,51 @@ Why the name? NPM modules `cookie`, `cookies` and `cookiejar` were already take
# API
-tough
-=====
+## tough
Functions on the module you get from `require('tough-cookie')`. All can be used as pure functions and don't need to be "bound".
**Note**: prior to 1.0.x, several of these functions took a `strict` parameter. This has since been removed from the API as it was no longer necessary.
-parseDate(string)
------------------
+### `parseDate(string)`
Parse a cookie date string into a `Date`. Parses according to RFC6265 Section 5.1.1, not `Date.parse()`.
-formatDate(date)
-----------------
+### `formatDate(date)`
Format a Date into a RFC1123 string (the RFC6265-recommended format).
-canonicalDomain(str)
---------------------
+### `canonicalDomain(str)`
Transforms a domain-name into a canonical domain-name. The canonical domain-name is a trimmed, lowercased, stripped-of-leading-dot and optionally punycode-encoded domain-name (Section 5.1.2 of RFC6265). For the most part, this function is idempotent (can be run again on its output without ill effects).
-domainMatch(str,domStr[,canonicalize=true])
--------------------------------------------
+### `domainMatch(str,domStr[,canonicalize=true])`
Answers "does this real domain match the domain in a cookie?". The `str` is the "current" domain-name and the `domStr` is the "cookie" domain-name. Matches according to RFC6265 Section 5.1.3, but it helps to think of it as a "suffix match".
The `canonicalize` parameter will run the other two paramters through `canonicalDomain` or not.
-defaultPath(path)
------------------
+### `defaultPath(path)`
Given a current request/response path, gives the Path apropriate for storing in a cookie. This is basically the "directory" of a "file" in the path, but is specified by Section 5.1.4 of the RFC.
The `path` parameter MUST be _only_ the pathname part of a URI (i.e. excludes the hostname, query, fragment, etc.). This is the `.pathname` property of node's `uri.parse()` output.
-pathMatch(reqPath,cookiePath)
------------------------------
+### `pathMatch(reqPath,cookiePath)`
Answers "does the request-path path-match a given cookie-path?" as per RFC6265 Section 5.1.4. Returns a boolean.
This is essentially a prefix-match where `cookiePath` is a prefix of `reqPath`.
-parse(header)
-----------------------------
+### `parse(header)`
alias for `Cookie.parse(header)`
-fromJSON(string)
-----------------
+### `fromJSON(string)`
alias for `Cookie.fromJSON(string)`
-getPublicSuffix(hostname)
--------------------------
+### `getPublicSuffix(hostname)`
Returns the public suffix of this hostname. The public suffix is the shortest domain-name upon which a cookie can be set. Returns `null` if the hostname cannot have cookies set for it.
@@ -94,32 +84,35 @@ For example: `www.example.com` and `www.subdomain.example.com` both have public
For further information, see http://publicsuffix.org/. This module derives its list from that site.
-cookieCompare(a,b)
-------------------
+### `cookieCompare(a,b)`
-For use with `.sort()`, sorts a list of cookies into the recommended order given in the RFC (Section 5.4 step 2). Longest `.path`s go first, then sorted oldest to youngest.
+For use with `.sort()`, sorts a list of cookies into the recommended order given in the RFC (Section 5.4 step 2). The sort algorithm is, in order of precedence:
+
+* Longest `.path`
+* oldest `.creation` (which has a 1ms precision, same as `Date`)
+* lowest `.creationIndex` (to get beyond the 1ms precision)
``` javascript
var cookies = [ /* unsorted array of Cookie objects */ ];
cookies = cookies.sort(cookieCompare);
```
-permuteDomain(domain)
----------------------
+**Note**: Since JavaScript's `Date` is limited to a 1ms precision, cookies within the same milisecond are entirely possible. This is especially true when using the `now` option to `.setCookie()`. The `.creationIndex` property is a per-process global counter, assigned during construction with `new Cookie()`. This preserves the spirit of the RFC sorting: older cookies go first. This works great for `MemoryCookieStore`, since `Set-Cookie` headers are parsed in order, but may not be so great for distributed systems. Sophisticated `Store`s may wish to set this to some other _logical clock_ such that if cookies A and B are created in the same millisecond, but cookie A is created before cookie B, then `A.creationIndex < B.creationIndex`. If you want to alter the global counter, which you probably _shouldn't_ do, it's stored in `Cookie.cookiesCreated`.
-Generates a list of all possible domains that `domainMatch()` the parameter. May be handy for implementing cookie stores.
+### `permuteDomain(domain)`
+Generates a list of all possible domains that `domainMatch()` the parameter. May be handy for implementing cookie stores.
-permutePath(path)
------------------
+### `permutePath(path)`
Generates a list of all possible paths that `pathMatch()` the parameter. May be handy for implementing cookie stores.
-Cookie
-======
-Cookie.parse(header)
------------------------------------
+## Cookie
+
+Exported via `tough.Cookie`.
+
+### `Cookie.parse(header)`
Parses a single Cookie or Set-Cookie HTTP header into a `Cookie` object. Returns `undefined` if the string can't be parsed.
@@ -132,13 +125,9 @@ else
cookies = [Cookie.parse(res.headers['set-cookie'])];
```
-Cookie.fromJSON(string)
------------------------
-
-Convert a JSON string to a `Cookie` object. Does a `JSON.parse()` and converts the `.created`, `.lastAccessed` and `.expires` properties into `Date` objects.
+### Properties
-Properties
-==========
+Cookie object properties:
* _key_ - string - the name or key of the cookie (default "")
* _value_ - string - the value of the cookie (default "")
@@ -149,70 +138,81 @@ Properties
* _secure_ - boolean - the `Secure` cookie flag
* _httpOnly_ - boolean - the `HttpOnly` cookie flag
* _extensions_ - `Array` - any unrecognized cookie attributes as strings (even if equal-signs inside)
+ * _creation_ - `Date` - when this cookie was constructed
+ * _creationIndex_ - number - set at construction, used to provide greater sort precision (please see `cookieCompare(a,b)` for a full explanation)
After a cookie has been passed through `CookieJar.setCookie()` it will have the following additional attributes:
* _hostOnly_ - boolean - is this a host-only cookie (i.e. no Domain field was set, but was instead implied)
* _pathIsDefault_ - boolean - if true, there was no Path field on the cookie and `defaultPath()` was used to derive one.
- * _created_ - `Date` - when this cookie was added to the jar
+ * _creation_ - `Date` - **modified** from construction to when the cookie was added to the jar
* _lastAccessed_ - `Date` - last time the cookie got accessed. Will affect cookie cleaning once implemented. Using `cookiejar.getCookies(...)` will update this attribute.
-Construction([{options}])
-------------
+### `Cookie([{properties}])`
-Receives an options object that can contain any Cookie properties, uses the default for unspecified properties.
+Receives an options object that can contain any of the above Cookie properties, uses the default for unspecified properties.
-.toString()
------------
+### `.toString()`
encode to a Set-Cookie header value. The Expires cookie field is set using `formatDate()`, but is omitted entirely if `.expires` is `Infinity`.
-.cookieString()
----------------
+### `.cookieString()`
encode to a Cookie header value (i.e. the `.key` and `.value` properties joined with '=').
-.setExpires(String)
--------------------
+### `.setExpires(String)`
sets the expiry based on a date-string passed through `parseDate()`. If parseDate returns `null` (i.e. can't parse this date string), `.expires` is set to `"Infinity"` (a string) is set.
-.setMaxAge(number)
--------------------
+### `.setMaxAge(number)`
sets the maxAge in seconds. Coerces `-Infinity` to `"-Infinity"` and `Infinity` to `"Infinity"` so it JSON serializes correctly.
-.expiryTime([now=Date.now()])
------------------------------
+### `.expiryTime([now=Date.now()])`
-.expiryDate([now=Date.now()])
------------------------------
+### `.expiryDate([now=Date.now()])`
expiryTime() Computes the absolute unix-epoch milliseconds that this cookie expires. expiryDate() works similarly, except it returns a `Date` object. Note that in both cases the `now` parameter should be milliseconds.
-Max-Age takes precedence over Expires (as per the RFC). The `.created` attribute -- or, by default, the `now` paramter -- is used to offset the `.maxAge` attribute.
+Max-Age takes precedence over Expires (as per the RFC). The `.creation` attribute -- or, by default, the `now` paramter -- is used to offset the `.maxAge` attribute.
If Expires (`.expires`) is set, that's returned.
Otherwise, `expiryTime()` returns `Infinity` and `expiryDate()` returns a `Date` object for "Tue, 19 Jan 2038 03:14:07 GMT" (latest date that can be expressed by a 32-bit `time_t`; the common limit for most user-agents).
-.TTL([now=Date.now()])
----------
+### `.TTL([now=Date.now()])`
compute the TTL relative to `now` (milliseconds). The same precedence rules as for `expiryTime`/`expiryDate` apply.
The "number" `Infinity` is returned for cookies without an explicit expiry and `0` is returned if the cookie is expired. Otherwise a time-to-live in milliseconds is returned.
-.canonicalizedDoman()
----------------------
+### `.canonicalizedDoman()`
-.cdomain()
-----------
+### `.cdomain()`
return the canonicalized `.domain` field. This is lower-cased and punycode (RFC3490) encoded if the domain has any non-ASCII characters.
-.validate()
------------
+### `.toJSON()`
+
+For convenience in using `JSON.serialize(cookie)`. Returns a plain-old `Object` that can be JSON-serialized.
+
+Any `Date` properties (i.e., `.expires`, `.creation`, and `.lastAccessed`) are exported in ISO format (`.toISOString()`).
+
+**NOTE**: Custom `Cookie` properties will be discarded. In tough-cookie 1.x, since there was no `.toJSON` method explicitly defined, all enumerable properties were captured. If you want a property to be serialized, add the property name to the `Cookie.serializableProperties` Array.
+
+### `Cookie.fromJSON(strOrObj)`
+
+Does the reverse of `cookie.toJSON()`. If passed a string, will `JSON.parse()` that first.
+
+Any `Date` properties (i.e., `.expires`, `.creation`, and `.lastAccessed`) are parsed via `Date.parse()`, not the tough-cookie `parseDate`, since it's JavaScript/JSON-y timestamps being handled at this layer.
+
+Returns `null` upon JSON parsing error.
+
+### `.clone()`
+
+Does a deep clone of this cookie, exactly implemented as `Cookie.fromJSON(cookie.toJSON())`.
+
+### `.validate()`
Status: *IN PROGRESS*. Works for a few things, but is by no means comprehensive.
@@ -226,48 +226,41 @@ if (cookie.validate() === true) {
}
```
-CookieJar
-=========
-Construction([store = new MemoryCookieStore()][, rejectPublicSuffixes])
-------------
+## CookieJar
+
+Exported via `tough.CookieJar`.
+
+### `CookieJar([store],[rejectPublicSuffixes])`
Simply use `new CookieJar()`. If you'd like to use a custom store, pass that to the constructor otherwise a `MemoryCookieStore` will be created and used.
+### Properties
-Attributes
-----------
+CookieJar object properties:
* _rejectPublicSuffixes_ - boolean - reject cookies with domains like "com" and "co.uk" (default: `true`)
Since eventually this module would like to support database/remote/etc. CookieJars, continuation passing style is used for CookieJar methods.
-.setCookie(cookieOrString, currentUrl, [{options},] cb(err,cookie))
--------------------------------------------------------------------
+### `.setCookie(cookieOrString, currentUrl, [{options},] cb(err,cookie))`
-Attempt to set the cookie in the cookie jar. If the operation fails, an error will be given to the callback `cb`, otherwise the cookie is passed through. The cookie will have updated `.created`, `.lastAccessed` and `.hostOnly` properties.
+Attempt to set the cookie in the cookie jar. If the operation fails, an error will be given to the callback `cb`, otherwise the cookie is passed through. The cookie will have updated `.creation`, `.lastAccessed` and `.hostOnly` properties.
The `options` object can be omitted and can have the following properties:
* _http_ - boolean - default `true` - indicates if this is an HTTP or non-HTTP API. Affects HttpOnly cookies.
* _secure_ - boolean - autodetect from url - indicates if this is a "Secure" API. If the currentUrl starts with `https:` or `wss:` then this is defaulted to `true`, otherwise `false`.
* _now_ - Date - default `new Date()` - what to use for the creation/access time of cookies
- * _ignoreError_ - boolean - default `false` - silently ignore things like parse errors and invalid domains. CookieStore errors aren't ignored by this option.
+ * _ignoreError_ - boolean - default `false` - silently ignore things like parse errors and invalid domains. `Store` errors aren't ignored by this option.
As per the RFC, the `.hostOnly` property is set if there was no "Domain=" parameter in the cookie string (or `.domain` was null on the Cookie object). The `.domain` property is set to the fully-qualified hostname of `currentUrl` in this case. Matching this cookie requires an exact hostname match (not a `domainMatch` as per usual).
-.setCookieSync(cookieOrString, currentUrl, [{options}])
--------------------------------------------------------
+### `.setCookieSync(cookieOrString, currentUrl, [{options}])`
Synchronous version of `setCookie`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).
-.storeCookie(cookie, [{options},] cb(err,cookie))
--------------------------------------------------
-
-__REMOVED__ removed in lieu of the CookieStore API below
-
-.getCookies(currentUrl, [{options},] cb(err,cookies))
------------------------------------------------------
+### `.getCookies(currentUrl, [{options},] cb(err,cookies))`
Retrieve the list of cookies that can be sent in a Cookie header for the current url.
@@ -279,59 +272,99 @@ The `options` object can be omitted and can have the following properties:
* _secure_ - boolean - autodetect from url - indicates if this is a "Secure" API. If the currentUrl starts with `https:` or `wss:` then this is defaulted to `true`, otherwise `false`.
* _now_ - Date - default `new Date()` - what to use for the creation/access time of cookies
* _expire_ - boolean - default `true` - perform expiry-time checking of cookies and asynchronously remove expired cookies from the store. Using `false` will return expired cookies and **not** remove them from the store (which is useful for replaying Set-Cookie headers, potentially).
- * _allPaths_ - boolean - default `false` - if `true`, do not scope cookies by path. The default uses RFC-compliant path scoping. **Note**: may not be supported by the CookieStore `fetchCookies` function (the default MemoryCookieStore supports it).
+ * _allPaths_ - boolean - default `false` - if `true`, do not scope cookies by path. The default uses RFC-compliant path scoping. **Note**: may not be supported by the underlying store (the default `MemoryCookieStore` supports it).
The `.lastAccessed` property of the returned cookies will have been updated.
-.getCookiesSync(currentUrl, [{options}])
-----------------------------------------
+### `.getCookiesSync(currentUrl, [{options}])`
Synchronous version of `getCookies`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).
-.getCookieString(...)
----------------------
+### `.getCookieString(...)`
Accepts the same options as `.getCookies()` but passes a string suitable for a Cookie header rather than an array to the callback. Simply maps the `Cookie` array via `.cookieString()`.
-.getCookieStringSync(...)
--------------------------
+### `.getCookieStringSync(...)`
Synchronous version of `getCookieString`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).
-.getSetCookieStrings(...)
--------------------------
+### `.getSetCookieStrings(...)`
Returns an array of strings suitable for **Set-Cookie** headers. Accepts the same options as `.getCookies()`. Simply maps the cookie array via `.toString()`.
-.getSetCookieStringsSync(...)
------------------------------
+### `.getSetCookieStringsSync(...)`
Synchronous version of `getSetCookieStrings`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).
-Store
-=====
+### `.serialize(cb(err,serializedObject))`
+
+Serialize the Jar if the underlying store supports `.getAllCookies`.
+
+**NOTE**: Custom `Cookie` properties will be discarded. If you want a property to be serialized, add the property name to the `Cookie.serializableProperties` Array.
+
+See [Serialization Format].
+
+### `.serializeSync()`
+
+Sync version of .serialize
+
+### `.toJSON()`
+
+Alias of .serializeSync() for the convenience of `JSON.stringify(cookiejar)`.
+
+### `CookieJar.deserialize(serialized, [store], cb(err,object))`
-Base class for CookieJar stores.
+A new Jar is created and the serialized Cookies are added to the underlying store. Each `Cookie` is added via `store.putCookie` in the order in which they appear in the serialization.
-# CookieStore API
+The `store` argument is optional, but should be an instance of `Store`. By default, a new instance of `MemoryCookieStore` is created.
+
+As a convenience, if `serialized` is a string, it is passed through `JSON.parse` first. If that throws an error, this is passed to the callback.
+
+### `CookieJar.deserializeSync(serialized, [store])`
+
+Sync version of `.deserialize`. _Note_ that the `store` must be synchronous for this to work.
+
+### `CookieJar.fromJSON(string)`
+
+Alias of `.deserializeSync` to provide consistency with `Cookie.fromJSON()`.
+
+### `.clone([store,]cb(err,newJar))`
+
+Produces a deep clone of this jar. Modifications to the original won't affect the clone, and vice versa.
+
+The `store` argument is optional, but should be an instance of `Store`. By default, a new instance of `MemoryCookieStore` is created. Transferring between store types is supported so long as the source implements `.getAllCookies()` and the destination implements `.putCookie()`.
+
+### `.cloneSync([store])`
+
+Synchronous version of `.clone`, returning a new `CookieJar` instance.
+
+The `store` argument is optional, but must be a _synchronous_ `Store` instance if specified. If not passed, a new instance of `MemoryCookieStore` is used.
+
+The _source_ and _destination_ must both be synchronous `Store`s. If one or both stores are asynchronous, use `.clone` instead. Recall that `MemoryCookieStore` supports both synchronous and asynchronous API calls.
+
+## Store
+
+Base class for CookieJar stores. Available as `tough.Store`.
+
+## Store API
The storage model for each `CookieJar` instance can be replaced with a custom implementation. The default is `MemoryCookieStore` which can be found in the `lib/memstore.js` file. The API uses continuation-passing-style to allow for asynchronous stores.
-Stores should inherit from the base `Store` class, which is available as `require('tough-cookie').Store`. Stores are asynchronous by default, but if `store.synchronous` is set, then the `*Sync` methods on the CookieJar can be used.
+Stores should inherit from the base `Store` class, which is available as `require('tough-cookie').Store`.
+
+Stores are asynchronous by default, but if `store.synchronous` is set to `true`, then the `*Sync` methods on the of the containing `CookieJar` can be used (however, the continuation-passing style
All `domain` parameters will have been normalized before calling.
The Cookie store must have all of the following methods.
-store.findCookie(domain, path, key, cb(err,cookie))
----------------------------------------------------
+### `store.findCookie(domain, path, key, cb(err,cookie))`
Retrieve a cookie with the given domain, path and key (a.k.a. name). The RFC maintains that exactly one of these cookies should exist in a store. If the store is using versioning, this means that the latest/newest such cookie should be returned.
Callback takes an error and the resulting `Cookie` object. If no cookie is found then `null` MUST be passed instead (i.e. not an error).
-store.findCookies(domain, path, cb(err,cookies))
-------------------------------------------------
+### `store.findCookies(domain, path, cb(err,cookies))`
Locates cookies matching the given domain and path. This is most often called in the context of `cookiejar.getCookies()` above.
@@ -341,8 +374,7 @@ The resulting list will be checked for applicability to the current request acco
As of version 0.9.12, the `allPaths` option to `cookiejar.getCookies()` above will cause the path here to be `null`. If the path is `null`, path-matching MUST NOT be performed (i.e. domain-matching only).
-store.putCookie(cookie, cb(err))
---------------------------------
+### `store.putCookie(cookie, cb(err))`
Adds a new cookie to the store. The implementation SHOULD replace any existing cookie with the same `.domain`, `.path`, and `.key` properties -- depending on the nature of the implementation, it's possible that between the call to `fetchCookie` and `putCookie` that a duplicate `putCookie` can occur.
@@ -350,12 +382,11 @@ The `cookie` object MUST NOT be modified; the caller will have already updated t
Pass an error if the cookie cannot be stored.
-store.updateCookie(oldCookie, newCookie, cb(err))
--------------------------------------------------
+### `store.updateCookie(oldCookie, newCookie, cb(err))`
Update an existing cookie. The implementation MUST update the `.value` for a cookie with the same `domain`, `.path` and `.key`. The implementation SHOULD check that the old value in the store is equivalent to `oldCookie` - how the conflict is resolved is up to the store.
-The `.lastAccessed` property will always be different between the two objects and `.created` will always be the same. Stores MAY ignore or defer the `.lastAccessed` change at the cost of affecting how cookies are sorted (or selected for deletion).
+The `.lastAccessed` property will always be different between the two objects (to the precision possible via JavaScript's clock). Both `.creation` and `.creationIndex` are guaranteed to be the same. Stores MAY ignore or defer the `.lastAccessed` change at the cost of affecting how cookies are selected for automatic deletion (e.g., least-recently-used, which is up to the store to implement).
Stores may wish to optimize changing the `.value` of the cookie in the store versus storing a new cookie. If the implementation doesn't define this method a stub that calls `putCookie(newCookie,cb)` will be added to the store object.
@@ -363,26 +394,59 @@ The `newCookie` and `oldCookie` objects MUST NOT be modified.
Pass an error if the newCookie cannot be stored.
-store.removeCookie(domain, path, key, cb(err))
-----------------------------------------------
+### `store.removeCookie(domain, path, key, cb(err))`
Remove a cookie from the store (see notes on `findCookie` about the uniqueness constraint).
The implementation MUST NOT pass an error if the cookie doesn't exist; only pass an error due to the failure to remove an existing cookie.
-store.removeCookies(domain, path, cb(err))
-------------------------------------------
+### `store.removeCookies(domain, path, cb(err))`
Removes matching cookies from the store. The `path` parameter is optional, and if missing means all paths in a domain should be removed.
Pass an error ONLY if removing any existing cookies failed.
-MemoryCookieStore
-=================
+### `store.getAllCookies(cb(err, cookies))`
+
+Produces an `Array` of all cookies during `jar.serialize()`. The items in the array can be true `Cookie` objects or generic `Object`s with the [Serialization Format] data structure.
+
+Cookies SHOULD be returned in creation order to preserve sorting via `compareCookies()`. For reference, `MemoryCookieStore` will sort by `.creationIndex` since it uses true `Cookie` objects internally. If you don't return the cookies in creation order, they'll still be sorted by creation time, but this only has a precision of 1ms. See `compareCookies` for more detail.
+
+Pass an error if retrieval fails.
+
+## MemoryCookieStore
+
+Inherits from `Store`.
-Inherits from Store.
+A just-in-memory CookieJar synchronous store implementation, used by default. Despite being a synchronous implementation, it's usable with both the synchronous and asynchronous forms of the `CookieJar` API.
-Just-in-memory CookieJar synchronous store implementation, used by default.
+# Serialization Format
+
+**NOTE**: if you want to have custom `Cookie` properties serialized, add the property name to `Cookie.serializableProperties`.
+
+```js
+ {
+ // The version of tough-cookie that serialized this jar.
+ version: 'tough-cookie@1.x.y',
+
+ // add the store type, to make humans happy:
+ storeType: 'MemoryCookieStore',
+
+ // CookieJar configuration:
+ rejectPublicSuffixes: true,
+ // ... future items go here
+
+ // Gets filled from jar.store.getAllCookies():
+ cookies: [
+ {
+ key: 'string',
+ value: 'string',
+ // ...
+ /* other Cookie.serializableProperties go here */
+ }
+ ]
+ }
+```
# Copyright and License
diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/lib/cookie.js b/deps/npm/node_modules/request/node_modules/tough-cookie/lib/cookie.js
index bec7f90b141..4f677c38787 100644
--- a/deps/npm/node_modules/request/node_modules/tough-cookie/lib/cookie.js
+++ b/deps/npm/node_modules/request/node_modules/tough-cookie/lib/cookie.js
@@ -35,6 +35,7 @@ var pubsuffix = require('./pubsuffix');
var Store = require('./store').Store;
var MemoryCookieStore = require('./memstore').MemoryCookieStore;
var pathMatch = require('./pathMatch').pathMatch;
+var VERSION = require('../package.json').version;
var punycode;
try {
@@ -84,8 +85,6 @@ var YEAR = /^(\d{2}|\d{4})$/; // 2 to 4 digits
var MAX_TIME = 2147483647000; // 31-bit max
var MIN_TIME = 0; // 31-bit min
-var cookiesCreated = 0; // Number of cookies created in runtime
-
// RFC6265 S5.1.1 date parser:
function parseDate(str) {
@@ -458,47 +457,60 @@ function parse(str) {
}
}
- // ensure a default date for sorting:
- c.creation = new Date();
- //NOTE: add runtime index for the cookieCompare() to resolve the situation when Date's precision is not enough .
- //Store initial UTC time as well, so we will be able to determine if we need to fallback to the Date object.
- c._creationRuntimeIdx = ++cookiesCreated;
- c._initialCreationTime = c.creation.getTime();
return c;
}
+// avoid the V8 deoptimization monster!
+function jsonParse(str) {
+ var obj;
+ try {
+ obj = JSON.parse(str);
+ } catch (e) {
+ return e;
+ }
+ return obj;
+}
+
function fromJSON(str) {
if (!str) {
return null;
}
var obj;
- try {
- obj = JSON.parse(str);
- } catch (e) {
- return null;
+ if (typeof str === 'string') {
+ obj = jsonParse(str);
+ if (obj instanceof Error) {
+ return null;
+ }
+ } else {
+ // assume it's an Object
+ obj = str;
}
var c = new Cookie();
- for (var i=0; i<numCookieProperties; i++) {
- var prop = cookieProperties[i];
- if (obj[prop] == null) {
- continue;
+ for (var i=0; i<Cookie.serializableProperties.length; i++) {
+ var prop = Cookie.serializableProperties[i];
+ if (obj[prop] === undefined ||
+ obj[prop] === Cookie.prototype[prop])
+ {
+ continue; // leave as prototype default
}
+
if (prop === 'expires' ||
prop === 'creation' ||
prop === 'lastAccessed')
{
- c[prop] = obj[prop] == "Infinity" ? "Infinity" : new Date(obj[prop]);
+ if (obj[prop] === null) {
+ c[prop] = null;
+ } else {
+ c[prop] = obj[prop] == "Infinity" ?
+ "Infinity" : new Date(obj[prop]);
+ }
} else {
c[prop] = obj[prop];
}
}
-
- // ensure a default date for sorting:
- c.creation = c.creation || new Date();
-
return c;
}
@@ -512,23 +524,28 @@ function fromJSON(str) {
*/
function cookieCompare(a,b) {
+ var cmp = 0;
+
// descending for length: b CMP a
- var deltaLen = (b.path ? b.path.length : 0) - (a.path ? a.path.length : 0);
- if (deltaLen !== 0) {
- return deltaLen;
+ var aPathLen = a.path ? a.path.length : 0;
+ var bPathLen = b.path ? b.path.length : 0;
+ cmp = bPathLen - aPathLen;
+ if (cmp !== 0) {
+ return cmp;
}
+ // ascending for time: a CMP b
var aTime = a.creation ? a.creation.getTime() : MAX_TIME;
var bTime = b.creation ? b.creation.getTime() : MAX_TIME;
-
- // NOTE: if creation dates are equal and they were not modified from the outside,
- // then use _creationRuntimeIdx for the comparison.
- if(aTime === bTime && aTime === a._initialCreationTime && bTime === b._initialCreationTime) {
- return a._creationRuntimeIdx - b._creationRuntimeIdx;
+ cmp = aTime - bTime;
+ if (cmp !== 0) {
+ return cmp;
}
- // ascending for time: a CMP b
- return aTime - bTime;
+ // break ties for the same millisecond (precision of JavaScript's clock)
+ cmp = a.creationIndex - b.creationIndex;
+
+ return cmp;
}
// Gives the permutation of all possible pathMatch()es of a given path. The
@@ -569,17 +586,31 @@ function getCookieContext(url) {
return urlParse(url);
}
-function Cookie (opts) {
- if (typeof opts !== "object") {
- return;
- }
- Object.keys(opts).forEach(function (key) {
- if (Cookie.prototype.hasOwnProperty(key)) {
- this[key] = opts[key] || Cookie.prototype[key];
+function Cookie(opts) {
+ opts = opts || {};
+
+ Object.keys(opts).forEach(function(prop) {
+ if (Cookie.prototype.hasOwnProperty(prop) &&
+ Cookie.prototype[prop] !== opts[prop] &&
+ prop.substr(0,1) !== '_')
+ {
+ this[prop] = opts[prop];
}
- }.bind(this));
+ }, this);
+
+ this.creation = this.creation || new Date();
+
+ // used to break creation ties in cookieCompare():
+ Object.defineProperty(this, 'creationIndex', {
+ configurable: false,
+ enumerable: false, // important for assert.deepEqual checks
+ writable: true,
+ value: ++Cookie.cookiesCreated
+ });
}
+Cookie.cookiesCreated = 0; // incremented each time a cookie is created
+
Cookie.parse = parse;
Cookie.fromJSON = fromJSON;
@@ -599,17 +630,22 @@ Cookie.prototype.extensions = null;
Cookie.prototype.hostOnly = null; // boolean when set
Cookie.prototype.pathIsDefault = null; // boolean when set
Cookie.prototype.creation = null; // Date when set; defaulted by Cookie.parse
-Cookie.prototype._initialCreationTime = null; // Used to determine if cookie.creation was modified
-Cookie.prototype._creationRuntimeIdx = null; // Runtime index of the created cookie, used in cookieCompare()
Cookie.prototype.lastAccessed = null; // Date when set
+Object.defineProperty(Cookie.prototype, 'creationIndex', {
+ configurable: true,
+ enumerable: false,
+ writable: true,
+ value: 0
+});
-var cookieProperties = Object.freeze(Object.keys(Cookie.prototype).map(function(p) {
- if (p instanceof Function) {
- return;
- }
- return p;
-}));
-var numCookieProperties = cookieProperties.length;
+Cookie.serializableProperties = Object.keys(Cookie.prototype)
+ .filter(function(prop) {
+ return !(
+ Cookie.prototype[prop] instanceof Function ||
+ prop === 'creationIndex' ||
+ prop.substr(0,1) === '_'
+ );
+ });
Cookie.prototype.inspect = function inspect() {
var now = Date.now();
@@ -620,6 +656,46 @@ Cookie.prototype.inspect = function inspect() {
'"';
};
+Cookie.prototype.toJSON = function() {
+ var obj = {};
+
+ var props = Cookie.serializableProperties;
+ for (var i=0; i<props.length; i++) {
+ var prop = props[i];
+ if (this[prop] === Cookie.prototype[prop]) {
+ continue; // leave as prototype default
+ }
+
+ if (prop === 'expires' ||
+ prop === 'creation' ||
+ prop === 'lastAccessed')
+ {
+ if (this[prop] === null) {
+ obj[prop] = null;
+ } else {
+ obj[prop] = this[prop] == "Infinity" ? // intentionally not ===
+ "Infinity" : this[prop].toISOString();
+ }
+ } else if (prop === 'maxAge') {
+ if (this[prop] !== null) {
+ // again, intentionally not ===
+ obj[prop] = (this[prop] == Infinity || this[prop] == -Infinity) ?
+ this[prop].toString() : this[prop];
+ }
+ } else {
+ if (this[prop] !== Cookie.prototype[prop]) {
+ obj[prop] = this[prop];
+ }
+ }
+ }
+
+ return obj;
+};
+
+Cookie.prototype.clone = function() {
+ return fromJSON(this.toJSON());
+};
+
Cookie.prototype.validate = function validate() {
if (!COOKIE_OCTETS.test(this.value)) {
return false;
@@ -744,7 +820,7 @@ Cookie.prototype.TTL = function TTL(now) {
// elsewhere)
Cookie.prototype.expiryTime = function expiryTime(now) {
if (this.maxAge != null) {
- var relativeTo = this.creation || now || new Date();
+ var relativeTo = now || this.creation || new Date();
var age = (this.maxAge <= 0) ? -Infinity : this.maxAge*1000;
return relativeTo.getTime() + age;
}
@@ -782,7 +858,6 @@ Cookie.prototype.canonicalizedDomain = function canonicalizedDomain() {
return canonicalDomain(this.domain);
};
-
function CookieJar(store, rejectPublicSuffixes) {
if (rejectPublicSuffixes != null) {
this.rejectPublicSuffixes = rejectPublicSuffixes;
@@ -895,6 +970,7 @@ CookieJar.prototype.setCookie = function(cookie, url, options, cb) {
return cb(options.ignoreError ? null : err);
}
cookie.creation = oldCookie.creation; // step 11.3
+ cookie.creationIndex = oldCookie.creationIndex; // preserve tie-breaker
cookie.lastAccessed = now;
// Step 11.4 (delete cookie) is implied by just setting the new one:
store.updateCookie(oldCookie, cookie, next); // step 12
@@ -1041,6 +1117,151 @@ CookieJar.prototype.getSetCookieStrings = function(/*..., cb*/) {
this.getCookies.apply(this,args);
};
+CAN_BE_SYNC.push('serialize');
+CookieJar.prototype.serialize = function(cb) {
+ var type = this.store.constructor.name;
+ if (type === 'Object') {
+ type = null;
+ }
+
+ // update README.md "Serialization Format" if you change this, please!
+ var serialized = {
+ // The version of tough-cookie that serialized this jar. Generally a good
+ // practice since future versions can make data import decisions based on
+ // known past behavior. When/if this matters, use `semver`.
+ version: 'tough-cookie@'+VERSION,
+
+ // add the store type, to make humans happy:
+ storeType: type,
+
+ // CookieJar configuration:
+ rejectPublicSuffixes: !!this.rejectPublicSuffixes,
+
+ // this gets filled from getAllCookies:
+ cookies: []
+ };
+
+ if (!(this.store.getAllCookies &&
+ typeof this.store.getAllCookies === 'function'))
+ {
+ return cb(new Error('store does not support getAllCookies and cannot be serialized'));
+ }
+
+ this.store.getAllCookies(function(err,cookies) {
+ if (err) {
+ return cb(err);
+ }
+
+ serialized.cookies = cookies.map(function(cookie) {
+ // convert to serialized 'raw' cookies
+ cookie = (cookie instanceof Cookie) ? cookie.toJSON() : cookie;
+
+ // Remove the index so new ones get assigned during deserialization
+ delete cookie.creationIndex;
+
+ return cookie;
+ });
+
+ return cb(null, serialized);
+ });
+};
+
+// well-known name that JSON.stringify calls
+CookieJar.prototype.toJSON = function() {
+ return this.serializeSync();
+};
+
+// use the class method CookieJar.deserialize instead of calling this directly
+CAN_BE_SYNC.push('_importCookies');
+CookieJar.prototype._importCookies = function(serialized, cb) {
+ var jar = this;
+ var cookies = serialized.cookies;
+ if (!cookies || !Array.isArray(cookies)) {
+ return cb(new Error('serialized jar has no cookies array'));
+ }
+
+ function putNext(err) {
+ if (err) {
+ return cb(err);
+ }
+
+ if (!cookies.length) {
+ return cb(err, jar);
+ }
+
+ var cookie;
+ try {
+ cookie = fromJSON(cookies.shift());
+ } catch (e) {
+ return cb(e);
+ }
+
+ if (cookie === null) {
+ return putNext(null); // skip this cookie
+ }
+
+ jar.store.putCookie(cookie, putNext);
+ }
+
+ putNext();
+};
+
+CookieJar.deserialize = function(strOrObj, store, cb) {
+ if (arguments.length !== 3) {
+ // store is optional
+ cb = store;
+ store = null;
+ }
+
+ var serialized;
+ if (typeof strOrObj === 'string') {
+ serialized = jsonParse(strOrObj);
+ if (serialized instanceof Error) {
+ return cb(serialized);
+ }
+ } else {
+ serialized = strOrObj;
+ }
+
+ var jar = new CookieJar(store, serialized.rejectPublicSuffixes);
+ jar._importCookies(serialized, function(err) {
+ if (err) {
+ return cb(err);
+ }
+ cb(null, jar);
+ });
+};
+
+CookieJar.fromJSON = CookieJar.deserializeSync;
+CookieJar.deserializeSync = function(strOrObj, store) {
+ var serialized = typeof strOrObj === 'string' ?
+ JSON.parse(strOrObj) : strOrObj;
+ var jar = new CookieJar(store, serialized.rejectPublicSuffixes);
+
+ // catch this mistake early:
+ if (!jar.store.synchronous) {
+ throw new Error('CookieJar store is not synchronous; use async API instead.');
+ }
+
+ jar._importCookiesSync(serialized);
+ return jar;
+};
+
+CAN_BE_SYNC.push('clone');
+CookieJar.prototype.clone = function(newStore, cb) {
+ if (arguments.length === 1) {
+ cb = newStore;
+ newStore = null;
+ }
+
+ this.serialize(function(err,serialized) {
+ if (err) {
+ return cb(err);
+ }
+ CookieJar.deserialize(newStore, serialized, cb);
+ });
+};
+
// Use a closure to provide a true imperative API for synchronous stores.
function syncWrap(method) {
return function() {
diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/lib/memstore.js b/deps/npm/node_modules/request/node_modules/tough-cookie/lib/memstore.js
index a9ddc6f4c56..89ceb690004 100644
--- a/deps/npm/node_modules/request/node_modules/tough-cookie/lib/memstore.js
+++ b/deps/npm/node_modules/request/node_modules/tough-cookie/lib/memstore.js
@@ -41,6 +41,8 @@ function MemoryCookieStore() {
util.inherits(MemoryCookieStore, Store);
exports.MemoryCookieStore = MemoryCookieStore;
MemoryCookieStore.prototype.idx = null;
+
+// Since it's just a struct in RAM, this Store is synchronous
MemoryCookieStore.prototype.synchronous = true;
// force a default depth:
@@ -116,21 +118,21 @@ MemoryCookieStore.prototype.putCookie = function(cookie, cb) {
cb(null);
};
-MemoryCookieStore.prototype.updateCookie = function updateCookie(oldCookie, newCookie, cb) {
+MemoryCookieStore.prototype.updateCookie = function(oldCookie, newCookie, cb) {
// updateCookie() may avoid updating cookies that are identical. For example,
// lastAccessed may not be important to some stores and an equality
// comparison could exclude that field.
this.putCookie(newCookie,cb);
};
-MemoryCookieStore.prototype.removeCookie = function removeCookie(domain, path, key, cb) {
+MemoryCookieStore.prototype.removeCookie = function(domain, path, key, cb) {
if (this.idx[domain] && this.idx[domain][path] && this.idx[domain][path][key]) {
delete this.idx[domain][path][key];
}
cb(null);
};
-MemoryCookieStore.prototype.removeCookies = function removeCookies(domain, path, cb) {
+MemoryCookieStore.prototype.removeCookies = function(domain, path, cb) {
if (this.idx[domain]) {
if (path) {
delete this.idx[domain][path];
@@ -140,3 +142,29 @@ MemoryCookieStore.prototype.removeCookies = function removeCookies(domain, path,
}
return cb(null);
};
+
+MemoryCookieStore.prototype.getAllCookies = function(cb) {
+ var cookies = [];
+ var idx = this.idx;
+
+ var domains = Object.keys(idx);
+ domains.forEach(function(domain) {
+ var paths = Object.keys(idx[domain]);
+ paths.forEach(function(path) {
+ var keys = Object.keys(idx[domain][path]);
+ keys.forEach(function(key) {
+ if (key !== null) {
+ cookies.push(idx[domain][path][key]);
+ }
+ });
+ });
+ });
+
+ // Sort by creationIndex so deserializing retains the creation order.
+ // When implementing your own store, this SHOULD retain the order too
+ cookies.sort(function(a,b) {
+ return (a.creationIndex||0) - (b.creationIndex||0);
+ });
+
+ cb(null, cookies);
+};
diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/lib/store.js b/deps/npm/node_modules/request/node_modules/tough-cookie/lib/store.js
index ad69c14d3ad..bce52925db1 100644
--- a/deps/npm/node_modules/request/node_modules/tough-cookie/lib/store.js
+++ b/deps/npm/node_modules/request/node_modules/tough-cookie/lib/store.js
@@ -62,6 +62,10 @@ Store.prototype.removeCookie = function(domain, path, key, cb) {
throw new Error('removeCookie is not implemented');
};
-Store.prototype.removeCookies = function removeCookies(domain, path, cb) {
+Store.prototype.removeCookies = function(domain, path, cb) {
throw new Error('removeCookies is not implemented');
};
+
+Store.prototype.getAllCookies = function(cb) {
+ throw new Error('getAllCookies is not implemented (therefore jar cannot be serialized)');
+};
diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/package.json b/deps/npm/node_modules/request/node_modules/tough-cookie/package.json
index 96d8d1d161f..55605b3ee68 100644
--- a/deps/npm/node_modules/request/node_modules/tough-cookie/package.json
+++ b/deps/npm/node_modules/request/node_modules/tough-cookie/package.json
@@ -16,7 +16,7 @@
"RFC6265",
"RFC2965"
],
- "version": "1.2.0",
+ "version": "2.0.0",
"homepage": "https://github.com/SalesforceEng/tough-cookie",
"repository": {
"type": "git",
@@ -36,9 +36,9 @@
"vows": "0.7.0",
"async": ">=0.1.12"
},
- "gitHead": "74e59de50b719bb9a1b01c8c9db57fa31401ed1a",
- "_id": "tough-cookie@1.2.0",
- "_shasum": "9b7e9d98e769e80b5aa899d944fe44e02ebf82ad",
+ "gitHead": "a3af6104da7787c23bb98910109b0e0e8a10153c",
+ "_id": "tough-cookie@2.0.0",
+ "_shasum": "41ce08720b35cf90beb044dd2609fb19e928718f",
"_from": "tough-cookie@>=0.12.0",
"_npmVersion": "2.7.4",
"_nodeVersion": "0.12.2",
@@ -47,8 +47,8 @@
"email": "jstash@gmail.com"
},
"dist": {
- "shasum": "9b7e9d98e769e80b5aa899d944fe44e02ebf82ad",
- "tarball": "http://registry.npmjs.org/tough-cookie/-/tough-cookie-1.2.0.tgz"
+ "shasum": "41ce08720b35cf90beb044dd2609fb19e928718f",
+ "tarball": "http://registry.npmjs.org/tough-cookie/-/tough-cookie-2.0.0.tgz"
},
"maintainers": [
{
@@ -61,6 +61,6 @@
}
],
"directories": {},
- "_resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-1.2.0.tgz",
+ "_resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.0.0.tgz",
"readme": "ERROR: No README data found!"
}
diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/public-suffix.txt b/deps/npm/node_modules/request/node_modules/tough-cookie/public-suffix.txt
index f8941f7ac9c..d5c9924ed54 100644
--- a/deps/npm/node_modules/request/node_modules/tough-cookie/public-suffix.txt
+++ b/deps/npm/node_modules/request/node_modules/tough-cookie/public-suffix.txt
@@ -826,6 +826,7 @@ edu.et
biz.et
name.et
info.et
+net.et
// eu : http://en.wikipedia.org/wiki/.eu
eu
@@ -932,6 +933,11 @@ org.gi
// gl : http://en.wikipedia.org/wiki/.gl
// http://nic.gl
gl
+co.gl
+com.gl
+edu.gl
+net.gl
+org.gl
// gm : http://www.nic.gm/htmlpages%5Cgm-policy.htm
gm
@@ -3571,6 +3577,7 @@ ltd.lk
assn.lk
grp.lk
hotel.lk
+ac.lk
// lr : http://psg.com/dns/lr/lr.txt
// Submitted by registry <randy@psg.com> 2008-06-17
@@ -4412,9 +4419,9 @@ mobi.ng
// ni : http://www.nic.ni/dominios.htm
*.ni
-// nl : http://www.domain-registry.nl/ace.php/c,728,122,,,,Home.html
-// Confirmed by registry <Antoin.Verschuren@sidn.nl> (with technical
-// reservations) 2008-06-08
+// nl : http://en.wikipedia.org/wiki/.nl
+// https://www.sidn.nl/
+// ccTLD for the Netherlands
nl
// BV.nl will be a registry for dutch BV's (besloten vennootschap)
@@ -5304,14 +5311,11 @@ gos.pk
info.pk
// pl http://www.dns.pl/english/index.html
-// confirmed on 26.09.2014 from Bogna Tchórzewska <partner@dns.pl>
+// updated by .PL registry on 2015-04-28
pl
com.pl
net.pl
org.pl
-info.pl
-waw.pl
-gov.pl
// pl functional domains (http://www.dns.pl/english/index.html)
aid.pl
agro.pl
@@ -5321,6 +5325,7 @@ biz.pl
edu.pl
gmina.pl
gsm.pl
+info.pl
mail.pl
miasta.pl
media.pl
@@ -5342,16 +5347,55 @@ tm.pl
tourism.pl
travel.pl
turystyka.pl
-// Government domains (administred by ippt.gov.pl)
-uw.gov.pl
-um.gov.pl
+// Government domains
+gov.pl
+ap.gov.pl
+ic.gov.pl
+is.gov.pl
+us.gov.pl
+kmpsp.gov.pl
+kppsp.gov.pl
+kwpsp.gov.pl
+psp.gov.pl
+wskr.gov.pl
+kwp.gov.pl
+mw.gov.pl
ug.gov.pl
+um.gov.pl
+umig.gov.pl
+ugim.gov.pl
upow.gov.pl
+uw.gov.pl
starostwo.gov.pl
+pa.gov.pl
+po.gov.pl
+psse.gov.pl
+pup.gov.pl
+rzgw.gov.pl
+sa.gov.pl
so.gov.pl
sr.gov.pl
-po.gov.pl
-pa.gov.pl
+wsa.gov.pl
+sko.gov.pl
+uzs.gov.pl
+wiih.gov.pl
+winb.gov.pl
+pinb.gov.pl
+wios.gov.pl
+witd.gov.pl
+wzmiuw.gov.pl
+piw.gov.pl
+wiw.gov.pl
+griw.gov.pl
+wif.gov.pl
+oum.gov.pl
+sdn.gov.pl
+zp.gov.pl
+uppo.gov.pl
+mup.gov.pl
+wuoz.gov.pl
+konsulat.gov.pl
+oirm.gov.pl
// pl regional domains (http://www.dns.pl/english/index.html)
augustow.pl
babia-gora.pl
@@ -5459,6 +5503,7 @@ ustka.pl
walbrzych.pl
warmia.pl
warszawa.pl
+waw.pl
wegrow.pl
wielun.pl
wlocl.pl
@@ -6621,114 +6666,147 @@ edu.ws
yt
// IDN ccTLDs
-// Please sort by ISO 3166 ccTLD, then punicode string
-// when submitting patches and follow this format:
-// <Punicode> ("<english word>" <language>) : <ISO 3166 ccTLD>
-// [optional sponsoring org]
-// <URL>
+// When submitting patches, please maintain a sort by ISO 3166 ccTLD, then
+// U-label, and follow this format:
+// // A-Label ("<Latin renderings>", <language name>[, variant info]) : <ISO 3166 ccTLD>
+// // [sponsoring org]
+// U-Label
-// xn--mgbaam7a8h ("Emerat" Arabic) : AE
+// xn--mgbaam7a8h ("Emerat", Arabic) : AE
// http://nic.ae/english/arabicdomain/rules.jsp
امارات
-// xn--54b7fta0cc ("Bangla" Bangla) : BD
+// xn--y9a3aq ("hye", Armenian) : AM
+// ISOC AM (operated by .am Registry)
+հայ
+
+// xn--54b7fta0cc ("Bangla", Bangla) : BD
বাংলা
-// xn--fiqs8s ("China" Chinese-Han-Simplified <.Zhongguo>) : CN
+// xn--90ais ("bel", Belarusian/Russian Cyrillic) : BY
+// Operated by .by registry
+бел
+
+// xn--fiqs8s ("Zhongguo/China", Chinese, Simplified) : CN
// CNNIC
// http://cnnic.cn/html/Dir/2005/10/11/3218.htm
中国
-// xn--fiqz9s ("China" Chinese-Han-Traditional <.Zhongguo>) : CN
+// xn--fiqz9s ("Zhongguo/China", Chinese, Traditional) : CN
// CNNIC
// http://cnnic.cn/html/Dir/2005/10/11/3218.htm
中國
-// xn--lgbbat1ad8j ("Algeria / Al Jazair" Arabic) : DZ
+// xn--lgbbat1ad8j ("Algeria/Al Jazair", Arabic) : DZ
الجزائر
-// xn--wgbh1c ("Egypt" Arabic .masr) : EG
+// xn--wgbh1c ("Egypt/Masr", Arabic) : EG
// http://www.dotmasr.eg/
مصر
-// xn--node ("ge" Georgian (Mkhedruli)) : GE
+// xn--node ("ge", Georgian Mkhedruli) : GE
გე
-// xn--j6w193g ("Hong Kong" Chinese-Han) : HK
+// xn--qxam ("el", Greek) : GR
+// Hellenic Ministry of Infrastructure, Transport, and Networks
+ελ
+
+// xn--j6w193g ("Hong Kong", Chinese) : HK
// https://www2.hkirc.hk/register/rules.jsp
香港
-// xn--h2brj9c ("Bharat" Devanagari) : IN
+// xn--h2brj9c ("Bharat", Devanagari) : IN
// India
भारत
-// xn--mgbbh1a71e ("Bharat" Arabic) : IN
+// xn--mgbbh1a71e ("Bharat", Arabic) : IN
// India
بھارت
-// xn--fpcrj9c3d ("Bharat" Telugu) : IN
+// xn--fpcrj9c3d ("Bharat", Telugu) : IN
// India
భారత్
-// xn--gecrj9c ("Bharat" Gujarati) : IN
+// xn--gecrj9c ("Bharat", Gujarati) : IN
// India
ભારત
-// xn--s9brj9c ("Bharat" Gurmukhi) : IN
+// xn--s9brj9c ("Bharat", Gurmukhi) : IN
// India
ਭਾਰਤ
-// xn--45brj9c ("Bharat" Bengali) : IN
+// xn--45brj9c ("Bharat", Bengali) : IN
// India
ভারত
-// xn--xkc2dl3a5ee0h ("India" Tamil) : IN
+// xn--xkc2dl3a5ee0h ("India", Tamil) : IN
// India
இந்தியா
-// xn--mgba3a4f16a ("Iran" Persian) : IR
+// xn--mgba3a4f16a ("Iran", Persian) : IR
ایران
-// xn--mgba3a4fra ("Iran" Arabic) : IR
+// xn--mgba3a4fra ("Iran", Arabic) : IR
ايران
-// xn--mgbayh7gpa ("al-Ordon" Arabic) : JO
+// xn--mgbtx2b ("Iraq", Arabic) : IQ
+// Communications and Media Commission
+عراق
+
+// xn--mgbayh7gpa ("al-Ordon", Arabic) : JO
// National Information Technology Center (NITC)
// Royal Scientific Society, Al-Jubeiha
الاردن
-// xn--3e0b707e ("Republic of Korea" Hangul) : KR
+// xn--3e0b707e ("Republic of Korea", Hangul) : KR
한국
-// xn--80ao21a ("Kaz" Kazakh) : KZ
+// xn--80ao21a ("Kaz", Kazakh) : KZ
қаз
-// xn--fzc2c9e2c ("Lanka" Sinhalese-Sinhala) : LK
+// xn--fzc2c9e2c ("Lanka", Sinhalese-Sinhala) : LK
// http://nic.lk
ලංකා
-// xn--xkc2al3hye2a ("Ilangai" Tamil) : LK
+// xn--xkc2al3hye2a ("Ilangai", Tamil) : LK
// http://nic.lk
இலங்கை
-// xn--mgbc0a9azcg ("Morocco / al-Maghrib" Arabic) : MA
+// xn--mgbc0a9azcg ("Morocco/al-Maghrib", Arabic) : MA
المغرب
-// xn--l1acc ("mon" Mongolian) : MN
+// xn--d1alf ("mkd", Macedonian) : MK
+// MARnet
+мкд
+
+// xn--l1acc ("mon", Mongolian) : MN
мон
-// xn--mgbx4cd0ab ("Malaysia" Malay) : MY
+// xn--mix891f ("Macao", Chinese, Traditional) : MO
+// MONIC / HNET Asia (Registry Operator for .mo)
+澳門
+
+// xn--mix082f ("Macao", Chinese, Simplified) : MO
+澳门
+
+// xn--mgbx4cd0ab ("Malaysia", Malay) : MY
مليسيا
-// xn--mgb9awbf ("Oman" Arabic) : OM
+// xn--mgb9awbf ("Oman", Arabic) : OM
عمان
-// xn--ygbi2ammx ("Falasteen" Arabic) : PS
+// xn--mgbai9azgqp6j ("Pakistan", Urdu/Arabic) : PK
+پاکستان
+
+// xn--mgbai9a5eva00b ("Pakistan", Urdu/Arabic, variant) : PK
+پاكستان
+
+// xn--ygbi2ammx ("Falasteen", Arabic) : PS
// The Palestinian National Internet Naming Authority (PNINA)
// http://www.pnina.ps
فلسطين
-// xn--90a3ac ("srb" Cyrillic) : RS
+// xn--90a3ac ("srb", Cyrillic) : RS
// http://www.rnids.rs/en/the-.срб-domain
срб
пр.срб
@@ -6738,62 +6816,66 @@ yt
упр.срб
ак.срб
-// xn--p1ai ("rf" Russian-Cyrillic) : RU
+// xn--p1ai ("rf", Russian-Cyrillic) : RU
// http://www.cctld.ru/en/docs/rulesrf.php
рф
-// xn--wgbl6a ("Qatar" Arabic) : QA
+// xn--wgbl6a ("Qatar", Arabic) : QA
// http://www.ict.gov.qa/
قطر
-// xn--mgberp4a5d4ar ("AlSaudiah" Arabic) : SA
+// xn--mgberp4a5d4ar ("AlSaudiah", Arabic) : SA
// http://www.nic.net.sa/
السعودية
-// xn--mgberp4a5d4a87g ("AlSaudiah" Arabic) variant : SA
+// xn--mgberp4a5d4a87g ("AlSaudiah", Arabic, variant) : SA
السعودیة
-// xn--mgbqly7c0a67fbc ("AlSaudiah" Arabic) variant : SA
+// xn--mgbqly7c0a67fbc ("AlSaudiah", Arabic, variant) : SA
السعودیۃ
-// xn--mgbqly7cvafr ("AlSaudiah" Arabic) variant : SA
+// xn--mgbqly7cvafr ("AlSaudiah", Arabic, variant) : SA
السعوديه
-// xn--ogbpf8fl ("Syria" Arabic) : SY
-سورية
-
-// xn--mgbtf8fl ("Syria" Arabic) variant : SY
-سوريا
+// xn--mgbpl2fh ("sudan", Arabic) : SD
+// Operated by .sd registry
+سودان
-// xn--yfro4i67o Singapore ("Singapore" Chinese-Han) : SG
+// xn--yfro4i67o Singapore ("Singapore", Chinese) : SG
新加坡
-// xn--clchc0ea0b2g2a9gcd ("Singapore" Tamil) : SG
+// xn--clchc0ea0b2g2a9gcd ("Singapore", Tamil) : SG
சிங்கப்பூர்
-// xn--o3cw4h ("Thai" Thai) : TH
+// xn--ogbpf8fl ("Syria", Arabic) : SY
+سورية
+
+// xn--mgbtf8fl ("Syria", Arabic, variant) : SY
+سوريا
+
+// xn--o3cw4h ("Thai", Thai) : TH
// http://www.thnic.co.th
ไทย
-// xn--pgbs0dh ("Tunis") : TN
+// xn--pgbs0dh ("Tunisia", Arabic) : TN
// http://nic.tn
تونس
-// xn--kpry57d ("Taiwan" Chinese-Han-Traditional) : TW
+// xn--kpry57d ("Taiwan", Chinese, Traditional) : TW
// http://www.twnic.net/english/dn/dn_07a.htm
台灣
-// xn--kprw13d ("Taiwan" Chinese-Han-Simplified) : TW
+// xn--kprw13d ("Taiwan", Chinese, Simplified) : TW
// http://www.twnic.net/english/dn/dn_07a.htm
台湾
-// xn--nnx388a ("Taiwan") variant : TW
+// xn--nnx388a ("Taiwan", Chinese, variant) : TW
臺灣
-// xn--j1amh ("ukr" Cyrillic) : UA
+// xn--j1amh ("ukr", Cyrillic) : UA
укр
-// xn--mgb2ddes ("AlYemen" Arabic) : YE
+// xn--mgb2ddes ("AlYemen", Arabic) : YE
اليمن
// xxx : http://icmregistry.com
@@ -6812,7 +6894,7 @@ xxx
*.zw
-// List of new gTLDs imported from https://newgtlds.icann.org/newgtlds.csv on 2015-04-07T06:02:08Z
+// List of new gTLDs imported from https://newgtlds.icann.org/newgtlds.csv on 2015-05-06T09:31:08Z
// aaa : 2015-02-26 American Automobile Association, Inc.
aaa
@@ -6865,6 +6947,9 @@ africa
// africamagic : 2015-03-05 Electronic Media Network (Pty) Ltd
africamagic
+// agakhan : 2015-04-23 Fondation Aga Khan (Aga Khan Foundation)
+agakhan
+
// agency : 2013-11-14 Steel Falls, LLC
agency
@@ -6877,6 +6962,9 @@ airforce
// airtel : 2014-10-24 Bharti Airtel Limited
airtel
+// akdn : 2015-04-23 Fondation Aga Khan (Aga Khan Foundation)
+akdn
+
// alibaba : 2015-01-15 Alibaba Group Holding Limited
alibaba
@@ -6949,6 +7037,9 @@ axa
// azure : 2014-12-18 Microsoft Corporation
azure
+// baby : 2015-04-09 Johnson & Johnson Services, Inc.
+baby
+
// baidu : 2015-01-08 Baidu, Inc.
baidu
@@ -7180,13 +7271,16 @@ cba
// cbn : 2014-08-22 The Christian Broadcasting Network, Inc.
cbn
+// ceb : 2015-04-09 The Corporate Executive Board Company
+ceb
+
// center : 2013-11-07 Tin Mill, LLC
center
// ceo : 2013-11-07 CEOTLD Pty Ltd
ceo
-// cern : 2014-06-05 European Organization for Nuclear Research (\
+// cern : 2014-06-05 European Organization for Nuclear Research ("CERN")
cern
// cfa : 2014-08-28 CFA Institute
@@ -7195,9 +7289,15 @@ cfa
// cfd : 2014-12-11 IG Group Holdings PLC
cfd
+// chanel : 2015-04-09 Chanel International B.V.
+chanel
+
// channel : 2014-05-08 Charleston Road Registry Inc.
channel
+// chase : 2015-04-30 JPMorgan Chase & Co.
+chase
+
// chat : 2014-12-04 Sand Fields, LLC
chat
@@ -7249,6 +7349,9 @@ clinic
// clothing : 2013-08-27 Steel Lake, LLC
clothing
+// cloud : 2015-04-16 ARUBA S.p.A.
+cloud
+
// club : 2013-11-08 .CLUB DOMAINS, LLC
club
@@ -7675,7 +7778,7 @@ garden
// gbiz : 2014-07-17 Charleston Road Registry Inc.
gbiz
-// gdn : 2014-07-31 Joint Stock Company \
+// gdn : 2014-07-31 Joint Stock Company "Navigation-information systems"
gdn
// gea : 2014-12-04 GEA Group Aktiengesellschaft
@@ -7945,6 +8048,9 @@ java
// jcb : 2014-11-20 JCB Co., Ltd.
jcb
+// jcp : 2015-04-23 JCP Media, Inc.
+jcp
+
// jetzt : 2014-01-09 New TLD Company AB
jetzt
@@ -7972,6 +8078,9 @@ jot
// joy : 2014-12-18 Amazon EU S.à r.l.
joy
+// jpmorgan : 2015-04-30 JPMorgan Chase & Co.
+jpmorgan
+
// jprs : 2014-09-18 Japan Registry Services Co., Ltd.
jprs
@@ -7984,6 +8093,15 @@ kaufen
// kddi : 2014-09-12 KDDI CORPORATION
kddi
+// kerryhotels : 2015-04-30 Kerry Trading Co. Limited
+kerryhotels
+
+// kerrylogistics : 2015-04-09 Kerry Trading Co. Limited
+kerrylogistics
+
+// kerryproperties : 2015-04-09 Kerry Trading Co. Limited
+kerryproperties
+
// kfh : 2014-12-04 Kuwait Finance House
kfh
@@ -8005,6 +8123,9 @@ koeln
// komatsu : 2015-01-08 Komatsu Ltd.
komatsu
+// kpmg : 2015-04-23 KPMG International Cooperative (KPMG International Genossenschaft)
+kpmg
+
// kpn : 2015-01-08 Koninklijke KPN N.V.
kpn
@@ -8014,6 +8135,9 @@ krd
// kred : 2013-12-19 KredTLD Pty Ltd
kred
+// kuokgroup : 2015-04-09 Kerry Trading Co. Limited
+kuokgroup
+
// kyknet : 2015-03-05 Electronic Media Network (Pty) Ltd
kyknet
@@ -8047,7 +8171,7 @@ law
// lawyer : 2014-03-20
lawyer
-// lds : 2014-03-20 IRI Domain Management, LLC (\
+// lds : 2014-03-20 IRI Domain Management, LLC ("Applicant")
lds
// lease : 2014-03-06 Victor Trail, LLC
@@ -8059,6 +8183,9 @@ leclerc
// legal : 2014-10-16 Blue Falls, LLC
legal
+// lexus : 2015-04-23 TOYOTA MOTOR CORPORATION
+lexus
+
// lgbt : 2014-05-08 Afilias Limited
lgbt
@@ -8209,6 +8336,9 @@ microsoft
// mini : 2014-01-09 Bayerische Motoren Werke Aktiengesellschaft
mini
+// mls : 2015-04-23 The Canadian Real Estate Association
+mls
+
// mma : 2014-11-07 MMA IARD
mma
@@ -8227,6 +8357,9 @@ moe
// moi : 2014-12-18 Amazon EU S.à r.l.
moi
+// mom : 2015-04-16 Uniregistry, Corp.
+mom
+
// monash : 2013-09-30 Monash University
monash
@@ -8236,7 +8369,7 @@ money
// montblanc : 2014-06-23 Richemont DNS Inc.
montblanc
-// mormon : 2013-12-05 IRI Domain Management, LLC (\
+// mormon : 2013-12-05 IRI Domain Management, LLC ("Applicant")
mormon
// mortgage : 2014-03-20
@@ -8350,6 +8483,9 @@ nyc
// obi : 2014-09-25 OBI Group Holding SE & Co. KGaA
obi
+// observer : 2015-04-30 Guardian News and Media Limited
+observer
+
// office : 2015-03-12 Microsoft Corporation
office
@@ -8512,6 +8648,9 @@ properties
// property : 2014-05-22 Uniregistry, Corp.
property
+// protection : 2015-04-23 Symantec Corporation
+protection
+
// pub : 2013-12-12 United TLD Holdco Ltd.
pub
@@ -8689,7 +8828,7 @@ sbs
// sca : 2014-03-13 SVENSKA CELLULOSA AKTIEBOLAGET SCA (publ)
sca
-// scb : 2014-02-20 The Siam Commercial Bank Public Company Limited (\
+// scb : 2014-02-20 The Siam Commercial Bank Public Company Limited ("SCB")
scb
// schmidt : 2014-04-03 SALM S.A.S.
@@ -8740,6 +8879,9 @@ sexy
// sharp : 2014-05-01 Sharp Corporation
sharp
+// shaw : 2015-04-23 Shaw Cablesystems G.P.
+shaw
+
// shia : 2014-09-04 Asia Green IT System Bilgisayar San. ve Tic. Ltd. Sti.
shia
@@ -8767,6 +8909,9 @@ singles
// site : 2015-01-15 DotSite Inc.
site
+// ski : 2015-04-09 STARTING DOT LIMITED
+ski
+
// skin : 2015-01-15 L'Oréal
skin
@@ -8848,6 +8993,9 @@ stockholm
// storage : 2014-12-22 Self Storage Company LLC
storage
+// store : 2015-04-09 DotStore Inc.
+store
+
// studio : 2015-02-11 Spring Goodbye, LLC
studio
@@ -8902,13 +9050,16 @@ tab
// taipei : 2014-07-10 Taipei City Government
taipei
+// talk : 2015-04-09 Amazon EU S.à r.l.
+talk
+
// taobao : 2015-01-15 Alibaba Group Holding Limited
taobao
// tatamotors : 2015-03-12 Tata Motors Ltd
tatamotors
-// tatar : 2014-04-24 Limited Liability Company \
+// tatar : 2014-04-24 Limited Liability Company "Coordination Center of Regional Domain of Tatarstan Republic"
tatar
// tattoo : 2013-08-30 Uniregistry, Corp.
@@ -8950,6 +9101,9 @@ thd
// theater : 2015-03-19 Blue Tigers, LLC
theater
+// theguardian : 2015-04-30 Guardian News and Media Limited
+theguardian
+
// tickets : 2015-02-05 Accent Media Limited
tickets
@@ -8995,6 +9149,9 @@ tours
// town : 2014-03-06 Koko Moon, LLC
town
+// toyota : 2015-04-23 TOYOTA MOTOR CORPORATION
+toyota
+
// toys : 2014-03-06 Pioneer Orchard, LLC
toys
@@ -9307,6 +9464,9 @@ xin
// xn--estv75g : 2015-02-19 Industrial and Commercial Bank of China Limited
工行
+// xn--fct429k : 2015-04-09 Amazon EU S.à r.l.
+家電
+
// xn--fhbei : 2015-01-15 VeriSign Sarl
كوم
@@ -9436,6 +9596,9 @@ vermögensberatung
// xn--vuq861b : 2014-10-16 Beijing Tele-info Network Technology Co., Ltd.
信息
+// xn--w4r85el8fhu5dnra : 2015-04-30 Kerry Trading Co. Limited
+嘉里大酒店
+
// xn--xhq521b : 2013-11-14 Guangzhou YU Wei Information Technology Co., Ltd.
广东
@@ -9466,6 +9629,9 @@ yoga
// yokohama : 2013-12-12 GMO Registry, Inc.
yokohama
+// you : 2015-04-09 Amazon EU S.à r.l.
+you
+
// youtube : 2014-05-01 Charleston Road Registry Inc.
youtube
@@ -9908,6 +10074,66 @@ webhop.org
worse-than.tv
writesthisblog.com
+// EU.org https://eu.org/
+// Submitted by Pierre Beyssac <hostmaster@eu.org> 2015-04-17
+
+eu.org
+al.eu.org
+asso.eu.org
+at.eu.org
+au.eu.org
+be.eu.org
+bg.eu.org
+ca.eu.org
+cd.eu.org
+ch.eu.org
+cn.eu.org
+cy.eu.org
+cz.eu.org
+de.eu.org
+dk.eu.org
+edu.eu.org
+ee.eu.org
+es.eu.org
+fi.eu.org
+fr.eu.org
+gr.eu.org
+hr.eu.org
+hu.eu.org
+ie.eu.org
+il.eu.org
+in.eu.org
+int.eu.org
+is.eu.org
+it.eu.org
+jp.eu.org
+kr.eu.org
+lt.eu.org
+lu.eu.org
+lv.eu.org
+mc.eu.org
+me.eu.org
+mk.eu.org
+mt.eu.org
+my.eu.org
+net.eu.org
+ng.eu.org
+nl.eu.org
+no.eu.org
+nz.eu.org
+paris.eu.org
+pl.eu.org
+pt.eu.org
+q-a.eu.org
+ro.eu.org
+ru.eu.org
+se.eu.org
+si.eu.org
+sk.eu.org
+tr.eu.org
+uk.eu.org
+us.eu.org
+
// Fastly Inc. http://www.fastly.com/
// Submitted by Vladimir Vuksan <vladimir@fastly.com> 2013-05-31
a.ssl.fastly.net
@@ -10011,6 +10237,10 @@ azurewebsites.net
azure-mobile.net
cloudapp.net
+// Neustar Inc.
+// Submitted by Trung Tran <Trung.Tran@neustar.biz> 2015-04-23
+4u.com
+
// NFSN, Inc. : https://www.NearlyFreeSpeech.NET/
// Submitted by Jeff Wheelhouse <support@nearlyfreespeech.net> 2014-02-02
nfshost.com
diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/test/cookie_sorting_test.js b/deps/npm/node_modules/request/node_modules/tough-cookie/test/cookie_sorting_test.js
index 8cc98427231..826562a2b26 100644
--- a/deps/npm/node_modules/request/node_modules/tough-cookie/test/cookie_sorting_test.js
+++ b/deps/npm/node_modules/request/node_modules/tough-cookie/test/cookie_sorting_test.js
@@ -33,6 +33,7 @@ var vows = require('vows');
var assert = require('assert');
var tough = require('../lib/cookie');
var Cookie = tough.Cookie;
+var CookieJar = tough.CookieJar;
function toKeyArray(cookies) {
return cookies.map(function (c) {
@@ -43,6 +44,71 @@ function toKeyArray(cookies) {
vows
.describe('Cookie sorting')
.addBatch({
+ "Assumptions:": {
+ ".creationIndex is set during construction": function() {
+ var now = new Date();
+ var c1 = new Cookie();
+ var c2 = new Cookie();
+ assert.isNumber(c1.creationIndex);
+ assert.isNumber(c2.creationIndex);
+ assert(c1.creationIndex < c2.creationIndex,
+ 'creationIndex should increase with each construction');
+ },
+
+ ".creationIndex is set during construction (forced ctime)": function() {
+ var now = new Date();
+ var c1 = new Cookie({creation: now});
+ var c2 = new Cookie({creation: now});
+ assert.strictEqual(c1.creation, c2.creation);
+ assert.isNumber(c1.creationIndex);
+ assert.isNumber(c2.creationIndex);
+ assert(c1.creationIndex < c2.creationIndex,
+ 'creationIndex should increase with each construction');
+ },
+
+ ".creationIndex is left alone during new setCookie": function() {
+ var jar = new CookieJar();
+ var c = new Cookie({key:'k', value:'v', domain:'example.com'});
+ var now = new Date();
+ var beforeDate = c.creation;
+ assert.instanceOf(beforeDate, Date);
+ assert.notStrictEqual(now, beforeDate);
+ var beforeIndex = c.creationIndex;
+ assert.isNumber(c.creationIndex);
+
+ jar.setCookieSync(c, 'http://example.com/', {now: now});
+
+ assert.strictEqual(c.creation, now);
+ assert.strictEqual(c.creationIndex, beforeIndex);
+ },
+
+ ".creationIndex is preserved during update setCookie": function() {
+ var jar = new CookieJar();
+
+ var thisMs = Date.now();
+ var t1 = new Date(thisMs);
+ var t2 = new Date(thisMs);
+ assert.notStrictEqual(t1, t2); // Date objects are distinct
+
+ var c = new Cookie({key:'k', value:'v1', domain:'example.com'});
+ jar.setCookieSync(c, 'http://example.com/', {now: t1});
+ var originalIndex = c.creationIndex;
+
+ assert.strictEqual(c.creation, t1);
+ assert.strictEqual(c.lastAccessed, t1);
+
+ c = new Cookie({key:'k', value:'v2', domain:'example.com'});
+ assert.notStrictEqual(c.creation, t1); // new timestamp assigned
+
+ jar.setCookieSync(c, 'http://example.com/', {now: t2});
+
+ assert.strictEqual(c.creation, t1); // retained
+ assert.strictEqual(c.lastAccessed, t2); // updated
+ assert.strictEqual(c.creationIndex, originalIndex); // retained
+ },
+ }
+ })
+ .addBatch({
"Cookie Sorting": {
topic: function () {
var cookies = [];
diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/test/cookie_to_json_test.js b/deps/npm/node_modules/request/node_modules/tough-cookie/test/cookie_to_json_test.js
index cc3f1fc859f..94a23d46eb1 100644
--- a/deps/npm/node_modules/request/node_modules/tough-cookie/test/cookie_to_json_test.js
+++ b/deps/npm/node_modules/request/node_modules/tough-cookie/test/cookie_to_json_test.js
@@ -123,8 +123,8 @@ vows
},
"null": {
topic: function(f) { return f(null) },
- "looks good": function(str) {
- assert.match(str, /"maxAge":null/);
+ "absent": function(str) {
+ assert.match(str, /(?!"maxAge":null)/); // NB: negative RegExp
}
}
},
diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/test/ietf_test.js b/deps/npm/node_modules/request/node_modules/tough-cookie/test/ietf_test.js
index fac2e3eff44..8bd41dd6542 100644
--- a/deps/npm/node_modules/request/node_modules/tough-cookie/test/ietf_test.js
+++ b/deps/npm/node_modules/request/node_modules/tough-cookie/test/ietf_test.js
@@ -61,8 +61,7 @@ function setGetCookieVows() {
jar.setCookieSync(cookieStr, sentFrom, {ignoreError: true});
});
- var actual = jar.getCookiesSync(sentTo);
- actual = actual.sort(tough.cookieCompare);
+ var actual = jar.getCookiesSync(sentTo,{sort:true});
assert.strictEqual(actual.length, expected.length);
diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/test/jar_serialization_test.js b/deps/npm/node_modules/request/node_modules/tough-cookie/test/jar_serialization_test.js
new file mode 100644
index 00000000000..277c90c8f49
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/tough-cookie/test/jar_serialization_test.js
@@ -0,0 +1,348 @@
+/*!
+ * Copyright (c) 2015, Salesforce.com, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. Neither the name of Salesforce.com nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+'use strict';
+var vows = require('vows');
+var assert = require('assert');
+var tough = require('../lib/cookie');
+var Cookie = tough.Cookie;
+var CookieJar = tough.CookieJar;
+var Store = tough.Store;
+var MemoryCookieStore = tough.MemoryCookieStore;
+var VERSION = require('../package.json').version;
+
+var domains = ['example.com','www.example.com','example.net'];
+var paths = ['/','/foo','/foo/bar'];
+
+var isInteger = Number.isInteger || function(value) {
+ // Node 0.10 (still supported) doesn't have Number.isInteger
+ // from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger
+ return typeof value === "number" &&
+ isFinite(value) &&
+ Math.floor(value) === value;
+};
+
+function setUp(context) {
+ context.now = new Date();
+ context.nowISO = context.now.toISOString();
+ context.expires = new Date(context.now.getTime() + 86400000);
+
+ var c, domain;
+ context.jar = new CookieJar();
+
+ context.totalCookies = 0;
+
+ // Do paths first since the MemoryCookieStore index is domain at the top
+ // level. This should cause the preservation of creation order in
+ // getAllCookies to be exercised.
+ for (var i = 0; i<paths.length; i++) {
+ var path = paths[i];
+ for (var j = 0; j<domains.length; j++) {
+ domain = domains[j];
+ c = new Cookie({
+ expires: context.expires,
+ domain: domain,
+ path: path,
+ key: 'key',
+ value: 'value'+j+i
+ });
+ context.jar.setCookieSync(c, 'http://'+domain+'/', {now: context.now});
+ context.totalCookies++;
+ }
+ }
+
+ // corner cases
+ domain = 'example.com';
+ var cornerCases = [
+ { expires: 'Infinity', key: 'infExp', value: 'infExp' },
+ { maxAge: 3600, key: 'max', value: 'max' },
+ { expires: context.expires, key: 'flags', value: 'flags',
+ secure: true, httpOnly: true },
+ { expires: context.expires, key: 'honly', value: 'honly',
+ hostOnly: true, domain: 'www.example.org' },
+ ];
+
+ for (var i = 0; i<cornerCases.length; i++) {
+ cornerCases[i].domain = cornerCases[i].domain || 'example.org';
+ cornerCases[i].path = '/';
+ c = new Cookie(cornerCases[i]);
+ context.jar.setCookieSync(c, 'https://www.example.org/', {now: context.now});
+ context.totalCookies++;
+ }
+}
+
+function checkMetadata(serialized) {
+ assert.notEqual(serialized, null);
+ assert.isObject(serialized);
+ assert.equal(serialized.version, 'tough-cookie@'+VERSION);
+ assert.equal(serialized.storeType, 'MemoryCookieStore');
+ assert.typeOf(serialized.rejectPublicSuffixes, 'boolean');
+ assert.isArray(serialized.cookies);
+}
+
+var serializedCookiePropTypes = {
+ 'key': 'string',
+ 'value': 'string',
+ 'expires': 'isoDate', // if "Infinity" it's supposed to be missing
+ 'maxAge': 'intOrInf',
+ 'domain': 'string',
+ 'path': 'string',
+ 'secure': 'boolean',
+ 'httpOnly': 'boolean',
+ 'extensions': 'array', // of strings, technically
+ 'hostOnly': 'boolean',
+ 'pathIsDefault': 'boolean',
+ 'creation': 'isoDate',
+ 'lastAccessed': 'isoDate'
+};
+
+function validateSerializedCookie(cookie) {
+ assert.isObject(cookie);
+ assert.isFalse(cookie instanceof Cookie);
+
+ Object.keys(cookie).forEach(function(prop) {
+ var type = serializedCookiePropTypes[prop];
+ switch(type) {
+ case 'string':
+ case 'boolean':
+ case 'array':
+ case 'number':
+ assert.typeOf(cookie[prop], type);
+ break;
+
+ case 'intOrInf':
+ if (cookie[prop] === 'Infinity' || cookie[prop] === '-Infinity') {
+ assert(true);
+ } else {
+ assert(isInteger(cookie[prop]),
+ "serialized property isn't integer: "+prop);
+ }
+ break;
+
+ case 'isoDate':
+ // rather than a regexp, assert it's parsable and equal
+ var parsed = Date.parse(cookie[prop]);
+ assert(parsed, 'could not parse serialized date property');
+ // assert.equals(cookie[prop], parsed.toISOString());
+ break;
+
+ default:
+ assert.fail("unexpected serialized property: "+prop);
+ }
+ });
+
+}
+
+vows
+ .describe('CookieJar serialization')
+ .addBatch({
+ "Assumptions:": {
+ "serializableProperties all accounted for": function() {
+ var actualKeys = Cookie.serializableProperties.concat([]); // copy
+ actualKeys.sort();
+ var expectedKeys = Object.keys(serializedCookiePropTypes);
+ expectedKeys.sort();
+ assert.deepEqual(actualKeys, expectedKeys);
+ }
+ }
+ })
+ .addBatch({
+ "For Stores without getAllCookies": {
+ topic: function() {
+ var store = new Store();
+ store.synchronous = true;
+ var jar = new CookieJar(store);
+ return jar;
+ },
+ "Cannot call toJSON": function(jar) {
+ assert.throws(function() {
+ jar.toJSON();
+ }, 'getAllCookies is not implemented (therefore jar cannot be serialized)');
+ }
+ }
+ })
+ .addBatch({
+ "For async stores": {
+ topic: function() {
+ var store = new MemoryCookieStore();
+ store.synchronous = false; // pretend it's async
+ var jar = new CookieJar(store);
+ return jar;
+ },
+ "Cannot call toJSON": function(jar) {
+ assert.throws(function() {
+ jar.toJSON();
+ }, 'CookieJar store is not synchronous; use async API instead.');
+ }
+ }
+ })
+ .addBatch({
+ "With a small store": {
+ topic: function() {
+ var now = this.now = new Date();
+ this.jar = new CookieJar();
+ // domain cookie with custom extension
+ var cookie = Cookie.parse('sid=one; domain=example.com; path=/; fubar');
+ this.jar.setCookieSync(cookie, 'http://example.com/', {now: this.now});
+
+ cookie = Cookie.parse('sid=two; domain=example.net; path=/; fubar');
+ this.jar.setCookieSync(cookie, 'http://example.net/', {now: this.now});
+
+ return this.jar;
+ },
+
+ "serialize synchronously": {
+ topic: function(jar) {
+ return jar.serializeSync();
+ },
+ "it gives a serialization with the two cookies": function(data) {
+ checkMetadata(data);
+ assert.equal(data.cookies.length, 2);
+ data.cookies.forEach(function(cookie) {
+ validateSerializedCookie(cookie);
+ });
+ },
+ "then deserialize": {
+ topic: function(data) {
+ return CookieJar.deserializeSync(data);
+ },
+ "memstores are identical": function(newJar) {
+ assert.deepEqual(this.jar.store, newJar.store);
+ }
+ }
+ },
+
+ "serialize asynchronously": {
+ topic: function(jar) {
+ jar.serialize(this.callback);
+ },
+ "it gives a serialization with the two cookies": function(data) {
+ checkMetadata(data);
+ assert.equal(data.cookies.length, 2);
+ data.cookies.forEach(function(cookie) {
+ validateSerializedCookie(cookie);
+ });
+ },
+ "then deserialize": {
+ topic: function(data) {
+ CookieJar.deserialize(data, this.callback);
+ },
+ "memstores are identical": function(newJar) {
+ assert.deepEqual(this.jar.store, newJar.store);
+ }
+ }
+ }
+ }
+ })
+ .addBatch({
+ "With a moderately-sized store": {
+ topic: function() {
+ setUp(this);
+ this.jar.serialize(this.callback);
+ },
+ "has expected metadata": function(err,jsonObj) {
+ assert.isNull(err);
+ assert.equal(jsonObj.version, 'tough-cookie@'+VERSION);
+ assert.isTrue(jsonObj.rejectPublicSuffixes);
+ assert.equal(jsonObj.storeType, 'MemoryCookieStore');
+ },
+ "has a bunch of objects as 'raw' cookies": function(jsonObj) {
+ assert.isArray(jsonObj.cookies);
+ assert.equal(jsonObj.cookies.length, this.totalCookies);
+
+ jsonObj.cookies.forEach(function(cookie) {
+ validateSerializedCookie(cookie);
+
+ if (cookie.key === 'key') {
+ assert.match(cookie.value, /^value\d\d/);
+ }
+
+ if (cookie.key === 'infExp' || cookie.key === 'max') {
+ assert.isUndefined(cookie.expires);
+ } else {
+ assert.strictEqual(cookie.expires, this.expires.toISOString())
+ }
+
+ if (cookie.key === 'max') {
+ assert.strictEqual(cookie.maxAge, 3600);
+ } else {
+ assert.isUndefined(cookie.maxAge);
+ }
+
+ assert.equal(cookie.hostOnly, cookie.key === 'honly');
+
+ if (cookie.key === 'flags') {
+ assert.isTrue(cookie.secure);
+ assert.isTrue(cookie.httpOnly);
+ } else {
+ assert.isUndefined(cookie.secure);
+ assert.isUndefined(cookie.httpOnly);
+ }
+
+ assert.strictEqual(cookie.creation, this.nowISO);
+ assert.strictEqual(cookie.lastAccessed, this.nowISO);
+
+ }, this);
+ },
+
+ "then taking it for a round-trip": {
+ topic: function(jsonObj) {
+ CookieJar.deserialize(jsonObj, this.callback);
+ },
+ "memstore index is identical": function(err,newJar) {
+ assert.deepEqual(newJar.store.idx, this.jar.store.idx);
+ },
+ "then spot-check retrieval": {
+ topic: function(newJar) {
+ newJar.getCookies('http://example.org/', this.callback);
+ },
+ "gets expected cookies": function(results) {
+ assert.isArray(results);
+ assert.equal(results.length, 2);
+
+ results.forEach(function(cookie) {
+ assert.instanceOf(cookie, Cookie);
+
+ if (cookie.key === 'infExp') {
+ assert.strictEqual(cookie.expires, "Infinity");
+ assert.strictEqual(cookie.TTL(this.now), Infinity);
+ } else if (cookie.key === 'max') {
+ assert.strictEqual(cookie.TTL(this.now), 3600*1000);
+ } else {
+ assert.fail('Unexpected cookie key: '+cookie.key);
+ }
+ }.bind(this));
+ }
+ }
+ }
+ }
+ })
+ .export(module);
diff --git a/deps/npm/node_modules/request/node_modules/tunnel-agent/.jshintrc b/deps/npm/node_modules/request/node_modules/tunnel-agent/.jshintrc
deleted file mode 100644
index 4c1c8d49723..00000000000
--- a/deps/npm/node_modules/request/node_modules/tunnel-agent/.jshintrc
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "node": true,
- "asi": true,
- "laxcomma": true
-}
diff --git a/deps/npm/node_modules/request/package.json b/deps/npm/node_modules/request/package.json
index a2f119a5cae..b934c5e8c3b 100644
--- a/deps/npm/node_modules/request/package.json
+++ b/deps/npm/node_modules/request/package.json
@@ -7,7 +7,7 @@
"util",
"utility"
],
- "version": "2.57.0",
+ "version": "2.58.0",
"author": {
"name": "Mikeal Rogers",
"email": "mikeal.rogers@gmail.com"
@@ -27,8 +27,9 @@
"dependencies": {
"bl": "~0.9.0",
"caseless": "~0.10.0",
+ "extend": "~2.0.1",
"forever-agent": "~0.6.0",
- "form-data": "~0.2.0",
+ "form-data": "~1.0.0-rc1",
"json-stringify-safe": "~5.0.0",
"mime-types": "~2.0.1",
"node-uuid": "~1.4.0",
@@ -45,14 +46,17 @@
"har-validator": "^1.6.1"
},
"scripts": {
- "test": "npm run lint && node node_modules/.bin/taper tests/test-*.js && npm run test-browser",
+ "test": "npm run lint && npm run test-ci && npm run test-browser",
+ "test-ci": "taper tests/test-*.js",
+ "test-cov": "istanbul cover tape tests/test-*.js",
"test-browser": "node tests/browser/start.js",
- "lint": "node node_modules/.bin/eslint lib/ *.js tests/ && echo Lint passed."
+ "lint": "eslint lib/ *.js tests/ && echo Lint passed."
},
"devDependencies": {
"browserify": "~5.9.1",
"browserify-istanbul": "~0.1.3",
"buffer-equal": "0.0.1",
+ "codecov.io": "~0.1.2",
"coveralls": "~2.11.2",
"eslint": "0.18.0",
"function-bind": "~1.0.0",
@@ -69,11 +73,11 @@
"taper": "~0.4.0",
"bluebird": "~2.9.21"
},
- "gitHead": "1fafe0dc387e5efa9ae95b40aa80c43e83e1b98f",
+ "gitHead": "ab40f9e61f813f9cc68257c17621b7879561486c",
"homepage": "https://github.com/request/request#readme",
- "_id": "request@2.57.0",
- "_shasum": "d445105a42d009b9d724289633b449a6d723d989",
- "_from": "request@2.57.0",
+ "_id": "request@2.58.0",
+ "_shasum": "b5f49c0b94aab7fad388612a1fb6ad03b6cc1580",
+ "_from": "request@2.58.0",
"_npmVersion": "2.10.1",
"_nodeVersion": "0.12.4",
"_npmUser": {
@@ -99,9 +103,9 @@
}
],
"dist": {
- "shasum": "d445105a42d009b9d724289633b449a6d723d989",
- "tarball": "http://registry.npmjs.org/request/-/request-2.57.0.tgz"
+ "shasum": "b5f49c0b94aab7fad388612a1fb6ad03b6cc1580",
+ "tarball": "http://registry.npmjs.org/request/-/request-2.58.0.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/request/-/request-2.57.0.tgz"
+ "_resolved": "https://registry.npmjs.org/request/-/request-2.58.0.tgz"
}
diff --git a/deps/npm/node_modules/request/request.js b/deps/npm/node_modules/request/request.js
index 21b4f529496..c032ea8f602 100644
--- a/deps/npm/node_modules/request/request.js
+++ b/deps/npm/node_modules/request/request.js
@@ -6,19 +6,17 @@ var http = require('http')
, util = require('util')
, stream = require('stream')
, zlib = require('zlib')
- , helpers = require('./lib/helpers')
, bl = require('bl')
, hawk = require('hawk')
, aws = require('aws-sign2')
, httpSignature = require('http-signature')
, mime = require('mime-types')
- , tunnel = require('tunnel-agent')
, stringstream = require('stringstream')
, caseless = require('caseless')
, ForeverAgent = require('forever-agent')
, FormData = require('form-data')
+ , helpers = require('./lib/helpers')
, cookies = require('./lib/cookies')
- , copy = require('./lib/copy')
, getProxyFromURI = require('./lib/getProxyFromURI')
, Querystring = require('./lib/querystring').Querystring
, Har = require('./lib/har').Har
@@ -26,46 +24,18 @@ var http = require('http')
, OAuth = require('./lib/oauth').OAuth
, Multipart = require('./lib/multipart').Multipart
, Redirect = require('./lib/redirect').Redirect
+ , Tunnel = require('./lib/tunnel').Tunnel
var safeStringify = helpers.safeStringify
, isReadStream = helpers.isReadStream
, toBase64 = helpers.toBase64
, defer = helpers.defer
+ , copy = helpers.copy
, globalCookieJar = cookies.jar()
var globalPool = {}
-var defaultProxyHeaderWhiteList = [
- 'accept',
- 'accept-charset',
- 'accept-encoding',
- 'accept-language',
- 'accept-ranges',
- 'cache-control',
- 'content-encoding',
- 'content-language',
- 'content-length',
- 'content-location',
- 'content-md5',
- 'content-range',
- 'content-type',
- 'connection',
- 'date',
- 'expect',
- 'max-forwards',
- 'pragma',
- 'referer',
- 'te',
- 'transfer-encoding',
- 'user-agent',
- 'via'
-]
-
-var defaultProxyHeaderExclusiveList = [
- 'proxy-authorization'
-]
-
function filterForNonReserved(reserved, options) {
// Filter out properties that are not reserved.
// Reserved values are passed in at call site.
@@ -96,103 +66,6 @@ function filterOutReservedFunctions(reserved, options) {
}
-function constructProxyHost(uriObject) {
- var port = uriObject.portA
- , protocol = uriObject.protocol
- , proxyHost = uriObject.hostname + ':'
-
- if (port) {
- proxyHost += port
- } else if (protocol === 'https:') {
- proxyHost += '443'
- } else {
- proxyHost += '80'
- }
-
- return proxyHost
-}
-
-function constructProxyHeaderWhiteList(headers, proxyHeaderWhiteList) {
- var whiteList = proxyHeaderWhiteList
- .reduce(function (set, header) {
- set[header.toLowerCase()] = true
- return set
- }, {})
-
- return Object.keys(headers)
- .filter(function (header) {
- return whiteList[header.toLowerCase()]
- })
- .reduce(function (set, header) {
- set[header] = headers[header]
- return set
- }, {})
-}
-
-function getTunnelOption(self, options) {
- // Tunnel HTTPS by default, or if a previous request in the redirect chain
- // was tunneled. Allow the user to override this setting.
-
- // If self.tunnel is already set (because this is a redirect), use the
- // existing value.
- if (typeof self.tunnel !== 'undefined') {
- return self.tunnel
- }
-
- // If options.tunnel is set (the user specified a value), use it.
- if (typeof options.tunnel !== 'undefined') {
- return options.tunnel
- }
-
- // If the destination is HTTPS, tunnel.
- if (self.uri.protocol === 'https:') {
- return true
- }
-
- // Otherwise, leave tunnel unset, because if a later request in the redirect
- // chain is HTTPS then that request (and any subsequent ones) should be
- // tunneled.
- return undefined
-}
-
-function constructTunnelOptions(request) {
- var proxy = request.proxy
-
- var tunnelOptions = {
- proxy : {
- host : proxy.hostname,
- port : +proxy.port,
- proxyAuth : proxy.auth,
- headers : request.proxyHeaders
- },
- headers : request.headers,
- ca : request.ca,
- cert : request.cert,
- key : request.key,
- passphrase : request.passphrase,
- pfx : request.pfx,
- ciphers : request.ciphers,
- rejectUnauthorized : request.rejectUnauthorized,
- secureOptions : request.secureOptions,
- secureProtocol : request.secureProtocol
- }
-
- return tunnelOptions
-}
-
-function constructTunnelFnName(uri, proxy) {
- var uriProtocol = (uri.protocol === 'https:' ? 'https' : 'http')
- var proxyProtocol = (proxy.protocol === 'https:' ? 'Https' : 'Http')
- return [uriProtocol, proxyProtocol].join('Over')
-}
-
-function getTunnelFn(request) {
- var uri = request.uri
- var proxy = request.proxy
- var tunnelFnName = constructTunnelFnName(uri, proxy)
- return tunnel[tunnelFnName]
-}
-
// Function for properly handling a connection error
function connectionErrorHandler(error) {
var socket = this
@@ -262,6 +135,7 @@ function Request (options) {
self._oauth = new OAuth(self)
self._multipart = new Multipart(self)
self._redirect = new Redirect(self)
+ self._tunnel = new Tunnel(self)
self.init(options)
}
@@ -276,37 +150,6 @@ function debug() {
}
Request.prototype.debug = debug
-Request.prototype.setupTunnel = function () {
- var self = this
-
- if (typeof self.proxy === 'string') {
- self.proxy = url.parse(self.proxy)
- }
-
- if (!self.proxy || !self.tunnel) {
- return false
- }
-
- // Setup Proxy Header Exclusive List and White List
- self.proxyHeaderExclusiveList = self.proxyHeaderExclusiveList || []
- self.proxyHeaderWhiteList = self.proxyHeaderWhiteList || defaultProxyHeaderWhiteList
- var proxyHeaderExclusiveList = self.proxyHeaderExclusiveList.concat(defaultProxyHeaderExclusiveList)
- var proxyHeaderWhiteList = self.proxyHeaderWhiteList.concat(proxyHeaderExclusiveList)
-
- // Setup Proxy Headers and Proxy Headers Host
- // Only send the Proxy White Listed Header names
- self.proxyHeaders = constructProxyHeaderWhiteList(self.headers, proxyHeaderWhiteList)
- self.proxyHeaders.host = constructProxyHost(self.uri)
- proxyHeaderExclusiveList.forEach(self.removeHeader, self)
-
- // Set Agent from Tunnel Data
- var tunnelFn = getTunnelFn(self)
- var tunnelOptions = constructTunnelOptions(self)
- self.agent = tunnelFn(tunnelOptions)
-
- return true
-}
-
Request.prototype.init = function (options) {
// init() contains all the code to setup the request object.
// the actual outgoing request is not started until start() is called
@@ -450,9 +293,9 @@ Request.prototype.init = function (options) {
self.proxy = getProxyFromURI(self.uri)
}
- self.tunnel = getTunnelOption(self, options)
+ self.tunnel = self._tunnel.isEnabled(options)
if (self.proxy) {
- self.setupTunnel()
+ self._tunnel.setup(options)
}
self._redirect.onRequest(options)
@@ -750,7 +593,7 @@ Request.prototype._updateProtocol = function () {
// previously was doing http, now doing https
// if it's https, then we might need to tunnel now.
if (self.proxy) {
- if (self.setupTunnel()) {
+ if (self._tunnel.setup()) {
return
}
}
@@ -1545,10 +1388,10 @@ Request.prototype.destroy = function () {
}
Request.defaultProxyHeaderWhiteList =
- defaultProxyHeaderWhiteList.slice()
+ Tunnel.defaultProxyHeaderWhiteList.slice()
Request.defaultProxyHeaderExclusiveList =
- defaultProxyHeaderExclusiveList.slice()
+ Tunnel.defaultProxyHeaderExclusiveList.slice()
// Exports
diff --git a/deps/npm/node_modules/validate-npm-package-license/LICENSE b/deps/npm/node_modules/validate-npm-package-license/LICENSE
new file mode 100644
index 00000000000..17de51c642a
--- /dev/null
+++ b/deps/npm/node_modules/validate-npm-package-license/LICENSE
@@ -0,0 +1,174 @@
+SPDX:Apache-2.0
+
+Apache License
+
+Version 2.0, January 2004
+
+http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and
+distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the
+copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other
+entities that control, are controlled by, or are under common control
+with that entity. For the purposes of this definition, "control" means
+(i) the power, direct or indirect, to cause the direction or management
+of such entity, whether by contract or otherwise, or (ii) ownership of
+fifty percent (50%) or more of the outstanding shares, or (iii)
+beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising
+permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications,
+including but not limited to software source code, documentation source,
+and configuration files.
+
+"Object" form shall mean any form resulting from mechanical
+transformation or translation of a Source form, including but not
+limited to compiled object code, generated documentation, and
+conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object
+form, made available under the License, as indicated by a copyright
+notice that is included in or attached to the work (an example is
+provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object
+form, that is based on (or derived from) the Work and for which the
+editorial revisions, annotations, elaborations, or other modifications
+represent, as a whole, an original work of authorship. For the purposes
+of this License, Derivative Works shall not include works that remain
+separable from, or merely link (or bind by name) to the interfaces of,
+the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original
+version of the Work and any modifications or additions to that Work or
+Derivative Works thereof, that is intentionally submitted to Licensor
+for inclusion in the Work by the copyright owner or by an individual or
+Legal Entity authorized to submit on behalf of the copyright owner. For
+the purposes of this definition, "submitted" means any form of
+electronic, verbal, or written communication sent to the Licensor or its
+representatives, including but not limited to communication on
+electronic mailing lists, source code control systems, and issue
+tracking systems that are managed by, or on behalf of, the Licensor for
+the purpose of discussing and improving the Work, but excluding
+communication that is conspicuously marked or otherwise designated in
+writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on
+behalf of whom a Contribution has been received by Licensor and
+subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+this License, each Contributor hereby grants to You a perpetual,
+worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright
+license to reproduce, prepare Derivative Works of, publicly display,
+publicly perform, sublicense, and distribute the Work and such
+Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of this
+License, each Contributor hereby grants to You a perpetual, worldwide,
+non-exclusive, no-charge, royalty-free, irrevocable (except as stated in
+this section) patent license to make, have made, use, offer to sell,
+sell, import, and otherwise transfer the Work, where such license
+applies only to those patent claims licensable by such Contributor that
+are necessarily infringed by their Contribution(s) alone or by
+combination of their Contribution(s) with the Work to which such
+Contribution(s) was submitted. If You institute patent litigation
+against any entity (including a cross-claim or counterclaim in a
+lawsuit) alleging that the Work or a Contribution incorporated within
+the Work constitutes direct or contributory patent infringement, then
+any patent licenses granted to You under this License for that Work
+shall terminate as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the Work
+or Derivative Works thereof in any medium, with or without
+modifications, and in Source or Object form, provided that You meet the
+following conditions:
+
+(a) You must give any other recipients of the Work or Derivative Works a
+copy of this License; and
+
+(b) You must cause any modified files to carry prominent notices stating
+that You changed the files; and
+
+(c) You must retain, in the Source form of any Derivative Works that You
+distribute, all copyright, patent, trademark, and attribution notices
+from the Source form of the Work, excluding those notices that do not
+pertain to any part of the Derivative Works; and
+
+(d) If the Work includes a "NOTICE" text file as part of its
+distribution, then any Derivative Works that You distribute must include
+a readable copy of the attribution notices contained within such NOTICE
+file, excluding those notices that do not pertain to any part of the
+Derivative Works, in at least one of the following places: within a
+NOTICE text file distributed as part of the Derivative Works; within the
+Source form or documentation, if provided along with the Derivative
+Works; or, within a display generated by the Derivative Works, if and
+wherever such third-party notices normally appear. The contents of the
+NOTICE file are for informational purposes only and do not modify the
+License. You may add Your own attribution notices within Derivative
+Works that You distribute, alongside or as an addendum to the NOTICE
+text from the Work, provided that such additional attribution notices
+cannot be construed as modifying the License.
+
+You may add Your own copyright statement to Your modifications and may
+provide additional or different license terms and conditions for use,
+reproduction, or distribution of Your modifications, or for any such
+Derivative Works as a whole, provided Your use, reproduction, and
+distribution of the Work otherwise complies with the conditions stated
+in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+any Contribution intentionally submitted for inclusion in the Work by
+You to the Licensor shall be under the terms and conditions of this
+License, without any additional terms or conditions. Notwithstanding the
+above, nothing herein shall supersede or modify the terms of any
+separate license agreement you may have executed with Licensor regarding
+such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+names, trademarks, service marks, or product names of the Licensor,
+except as required for reasonable and customary use in describing the
+origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or agreed
+to in writing, Licensor provides the Work (and each Contributor provides
+its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+OF ANY KIND, either express or implied, including, without limitation,
+any warranties or conditions of TITLE, NON-INFRINGEMENT,
+MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely
+responsible for determining the appropriateness of using or
+redistributing the Work and assume any risks associated with Your
+exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+whether in tort (including negligence), contract, or otherwise, unless
+required by applicable law (such as deliberate and grossly negligent
+acts) or agreed to in writing, shall any Contributor be liable to You
+for damages, including any direct, indirect, special, incidental, or
+consequential damages of any character arising as a result of this
+License or out of the use or inability to use the Work (including but
+not limited to damages for loss of goodwill, work stoppage, computer
+failure or malfunction, or any and all other commercial damages or
+losses), even if such Contributor has been advised of the possibility of
+such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing the
+Work or Derivative Works thereof, You may choose to offer, and charge a
+fee for, acceptance of support, warranty, indemnity, or other liability
+obligations and/or rights consistent with this License. However, in
+accepting such obligations, You may act only on Your own behalf and on
+Your sole responsibility, not on behalf of any other Contributor, and
+only if You agree to indemnify, defend, and hold each Contributor
+harmless for any liability incurred by, or claims asserted against, such
+Contributor by reason of your accepting any such warranty or additional
+liability.
diff --git a/deps/npm/node_modules/validate-npm-package-license/README.md b/deps/npm/node_modules/validate-npm-package-license/README.md
new file mode 100644
index 00000000000..2c51c8e640d
--- /dev/null
+++ b/deps/npm/node_modules/validate-npm-package-license/README.md
@@ -0,0 +1,61 @@
+validate-npm-package-license
+============================
+
+Give me a string and I'll tell you if it's a valid npm package license string.
+
+<!-- js var valid = require('./'); -->
+
+```js
+var noWarnings = {
+ validForNewPackages: true,
+ validForOldPackages: true
+};
+
+// SPDX license identifier for common open-source licenses
+valid('MIT'); // => noWarnings
+valid('BSD-2-Clause'); // => noWarnings
+valid('Apache-2.0'); // => noWarnings
+valid('ISC'); // => noWarnings
+
+// Simple SPDX license expression for dual licensing
+valid('(GPL-3.0 OR BSD-2-Clause)'); // => noWarnings
+
+// Refer to a non-standard license found in the package
+valid('SEE LICENSE IN LICENSE.txt'); // => noWarnings
+valid('SEE LICENSE IN license.md'); // => noWarnings
+
+// No license
+valid('UNLICENSED'); // => noWarnings
+valid('UNLICENCED'); // => noWarnings
+
+var warningsWithSuggestion = {
+ validForOldPackages: false,
+ validForNewPackages: false,
+ warnings: [
+ 'license should be ' +
+ 'a valid SPDX license expression without "LicenseRef", ' +
+ '"UNLICENSED", or ' +
+ '"SEE LICENSE IN <filename>"',
+ 'license is similar to the valid expression "Apache-2.0"'
+ ]
+};
+
+// Almost a valid SPDX license identifier
+valid('Apache 2.0'); // => warningsWithSuggestion
+
+var warningAboutLicenseRef = {
+ validForOldPackages: false,
+ validForNewPackages: false,
+ warnings: [
+ 'license should be ' +
+ 'a valid SPDX license expression without "LicenseRef", ' +
+ '"UNLICENSED", or ' +
+ '"SEE LICENSE IN <filename>"',
+ ]
+};
+
+// LicenseRef-* identifiers are valid SPDX expressions,
+// but not valid in package.json
+valid('LicenseRef-Made-Up'); // => warningAboutLicenseRef
+valid('(MIT OR LicenseRef-Made-Up)'); // => warningAboutLicenseRef
+```
diff --git a/deps/npm/node_modules/validate-npm-package-license/index.js b/deps/npm/node_modules/validate-npm-package-license/index.js
new file mode 100644
index 00000000000..adf58d6751b
--- /dev/null
+++ b/deps/npm/node_modules/validate-npm-package-license/index.js
@@ -0,0 +1,74 @@
+var spdx = require('spdx');
+var correct = require('spdx-correct');
+
+var validResult = {
+ validForNewPackages: true,
+ validForOldPackages: true
+};
+
+var genericWarning = (
+ 'license should be ' +
+ 'a valid SPDX license expression without "LicenseRef", ' +
+ '"UNLICENSED", or ' +
+ '"SEE LICENSE IN <filename>"'
+);
+
+var fileReferenceRE = /^SEE LICEN[CS]E IN (.+)$/;
+
+function startsWith(prefix, string) {
+ return string.slice(0, prefix.length) === prefix;
+}
+
+function usesLicenseRef(ast) {
+ if (ast.hasOwnProperty('license')) {
+ var license = ast.license;
+ return (
+ startsWith('LicenseRef', license) ||
+ startsWith('DocumentRef', license)
+ );
+ } else {
+ return (
+ usesLicenseRef(ast.left) ||
+ usesLicenseRef(ast.right)
+ );
+ }
+}
+
+module.exports = function(argument) {
+ var ast;
+
+ try {
+ ast = spdx.parse(argument);
+ } catch (e) {
+ if (
+ argument === 'UNLICENSED' ||
+ argument === 'UNLICENCED' ||
+ fileReferenceRE.test(argument)
+ ) {
+ return validResult;
+ } else {
+ var result = {
+ validForOldPackages: false,
+ validForNewPackages: false,
+ warnings: [genericWarning]
+ };
+ var corrected = correct(argument);
+ if (corrected) {
+ result.warnings.push(
+ 'license is similar to the valid expression "' + corrected + '"'
+ );
+ }
+ return result;
+ }
+ }
+
+ if (usesLicenseRef(ast)) {
+ return {
+ validForNewPackages: false,
+ validForOldPackages: false,
+ warnings: [genericWarning]
+ };
+ } else {
+ return validResult;
+ }
+};
diff --git a/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/LICENSE b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/LICENSE
new file mode 100644
index 00000000000..17de51c642a
--- /dev/null
+++ b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/LICENSE
@@ -0,0 +1,174 @@
+SPDX:Apache-2.0
+
+Apache License
+
+Version 2.0, January 2004
+
+http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and
+distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the
+copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other
+entities that control, are controlled by, or are under common control
+with that entity. For the purposes of this definition, "control" means
+(i) the power, direct or indirect, to cause the direction or management
+of such entity, whether by contract or otherwise, or (ii) ownership of
+fifty percent (50%) or more of the outstanding shares, or (iii)
+beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising
+permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications,
+including but not limited to software source code, documentation source,
+and configuration files.
+
+"Object" form shall mean any form resulting from mechanical
+transformation or translation of a Source form, including but not
+limited to compiled object code, generated documentation, and
+conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object
+form, made available under the License, as indicated by a copyright
+notice that is included in or attached to the work (an example is
+provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object
+form, that is based on (or derived from) the Work and for which the
+editorial revisions, annotations, elaborations, or other modifications
+represent, as a whole, an original work of authorship. For the purposes
+of this License, Derivative Works shall not include works that remain
+separable from, or merely link (or bind by name) to the interfaces of,
+the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original
+version of the Work and any modifications or additions to that Work or
+Derivative Works thereof, that is intentionally submitted to Licensor
+for inclusion in the Work by the copyright owner or by an individual or
+Legal Entity authorized to submit on behalf of the copyright owner. For
+the purposes of this definition, "submitted" means any form of
+electronic, verbal, or written communication sent to the Licensor or its
+representatives, including but not limited to communication on
+electronic mailing lists, source code control systems, and issue
+tracking systems that are managed by, or on behalf of, the Licensor for
+the purpose of discussing and improving the Work, but excluding
+communication that is conspicuously marked or otherwise designated in
+writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on
+behalf of whom a Contribution has been received by Licensor and
+subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+this License, each Contributor hereby grants to You a perpetual,
+worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright
+license to reproduce, prepare Derivative Works of, publicly display,
+publicly perform, sublicense, and distribute the Work and such
+Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of this
+License, each Contributor hereby grants to You a perpetual, worldwide,
+non-exclusive, no-charge, royalty-free, irrevocable (except as stated in
+this section) patent license to make, have made, use, offer to sell,
+sell, import, and otherwise transfer the Work, where such license
+applies only to those patent claims licensable by such Contributor that
+are necessarily infringed by their Contribution(s) alone or by
+combination of their Contribution(s) with the Work to which such
+Contribution(s) was submitted. If You institute patent litigation
+against any entity (including a cross-claim or counterclaim in a
+lawsuit) alleging that the Work or a Contribution incorporated within
+the Work constitutes direct or contributory patent infringement, then
+any patent licenses granted to You under this License for that Work
+shall terminate as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the Work
+or Derivative Works thereof in any medium, with or without
+modifications, and in Source or Object form, provided that You meet the
+following conditions:
+
+(a) You must give any other recipients of the Work or Derivative Works a
+copy of this License; and
+
+(b) You must cause any modified files to carry prominent notices stating
+that You changed the files; and
+
+(c) You must retain, in the Source form of any Derivative Works that You
+distribute, all copyright, patent, trademark, and attribution notices
+from the Source form of the Work, excluding those notices that do not
+pertain to any part of the Derivative Works; and
+
+(d) If the Work includes a "NOTICE" text file as part of its
+distribution, then any Derivative Works that You distribute must include
+a readable copy of the attribution notices contained within such NOTICE
+file, excluding those notices that do not pertain to any part of the
+Derivative Works, in at least one of the following places: within a
+NOTICE text file distributed as part of the Derivative Works; within the
+Source form or documentation, if provided along with the Derivative
+Works; or, within a display generated by the Derivative Works, if and
+wherever such third-party notices normally appear. The contents of the
+NOTICE file are for informational purposes only and do not modify the
+License. You may add Your own attribution notices within Derivative
+Works that You distribute, alongside or as an addendum to the NOTICE
+text from the Work, provided that such additional attribution notices
+cannot be construed as modifying the License.
+
+You may add Your own copyright statement to Your modifications and may
+provide additional or different license terms and conditions for use,
+reproduction, or distribution of Your modifications, or for any such
+Derivative Works as a whole, provided Your use, reproduction, and
+distribution of the Work otherwise complies with the conditions stated
+in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+any Contribution intentionally submitted for inclusion in the Work by
+You to the Licensor shall be under the terms and conditions of this
+License, without any additional terms or conditions. Notwithstanding the
+above, nothing herein shall supersede or modify the terms of any
+separate license agreement you may have executed with Licensor regarding
+such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+names, trademarks, service marks, or product names of the Licensor,
+except as required for reasonable and customary use in describing the
+origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or agreed
+to in writing, Licensor provides the Work (and each Contributor provides
+its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+OF ANY KIND, either express or implied, including, without limitation,
+any warranties or conditions of TITLE, NON-INFRINGEMENT,
+MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely
+responsible for determining the appropriateness of using or
+redistributing the Work and assume any risks associated with Your
+exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+whether in tort (including negligence), contract, or otherwise, unless
+required by applicable law (such as deliberate and grossly negligent
+acts) or agreed to in writing, shall any Contributor be liable to You
+for damages, including any direct, indirect, special, incidental, or
+consequential damages of any character arising as a result of this
+License or out of the use or inability to use the Work (including but
+not limited to damages for loss of goodwill, work stoppage, computer
+failure or malfunction, or any and all other commercial damages or
+losses), even if such Contributor has been advised of the possibility of
+such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing the
+Work or Derivative Works thereof, You may choose to offer, and charge a
+fee for, acceptance of support, warranty, indemnity, or other liability
+obligations and/or rights consistent with this License. However, in
+accepting such obligations, You may act only on Your own behalf and on
+Your sole responsibility, not on behalf of any other Contributor, and
+only if You agree to indemnify, defend, and hold each Contributor
+harmless for any liability incurred by, or claims asserted against, such
+Contributor by reason of your accepting any such warranty or additional
+liability.
diff --git a/deps/npm/node_modules/init-package-json/node_modules/validate-npm-package-license/node_modules/spdx-correct/README.md b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/README.md
index 05cd9947d22..05cd9947d22 100644
--- a/deps/npm/node_modules/init-package-json/node_modules/validate-npm-package-license/node_modules/spdx-correct/README.md
+++ b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/README.md
diff --git a/deps/npm/node_modules/init-package-json/node_modules/validate-npm-package-license/node_modules/spdx-correct/package.json b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/package.json
index 79b09062aef..d0946e3e25a 100644
--- a/deps/npm/node_modules/init-package-json/node_modules/validate-npm-package-license/node_modules/spdx-correct/package.json
+++ b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/package.json
@@ -1,25 +1,25 @@
{
"name": "spdx-correct",
"description": "correct invalid SPDX identifiers",
- "version": "1.0.0-prerelease-3",
+ "version": "1.0.0",
"author": {
- "name": "Kyle Mitchell",
+ "name": "Kyle E. Mitchell",
"email": "kyle@kemitchell.com",
"url": "http://kemitchell.com"
},
"bugs": {
- "url": "https://github.com/kemitchell/spdx-correct/issues"
+ "url": "https://github.com/kemitchell/spdx-correct.js/issues"
},
"dependencies": {
"spdx": "^0.4.0"
},
"devDependencies": {
- "jscs": "^1.13.0",
- "jshint": "^2.7.0",
- "jsmd": "^0.3.0",
- "tap": "^0.7.1"
+ "jscs": "~1.13.1",
+ "jshint": "~2.8.0",
+ "jsmd": "~0.3.0",
+ "tape": "~4.0.0"
},
- "homepage": "https://github.com/kemitchell/spdx-correct",
+ "homepage": "https://github.com/kemitchell/spdx-correct.js",
"keywords": [
"SPDX",
"law",
@@ -31,18 +31,19 @@
"main": "spdx-correct.js",
"repository": {
"type": "git",
- "url": "https://github.com/kemitchell/spdx-correct"
+ "url": "git+https://github.com/kemitchell/spdx-correct.js.git"
},
"scripts": {
"lint": "jshint spdx-correct.js test && jscs spdx-correct.js test",
"precommit": "npm run lint && npm run test",
- "test": "jsmd README.md && tap test"
+ "test": "jsmd README.md && tape test/*.test.js"
},
- "gitHead": "0289b9068391d4a1db571137083e0beb18a2faef",
- "_id": "spdx-correct@1.0.0-prerelease-3",
- "_shasum": "5706cc6ce05b928a65564c76e1d6809ba033ac7e",
- "_from": "spdx-correct@1.0.0-prerelease-3",
- "_npmVersion": "1.4.28",
+ "gitHead": "eab00824e5a1281fd7c522f33f0498c7d1cedd13",
+ "_id": "spdx-correct@1.0.0",
+ "_shasum": "c2a8654a5a56d8b2d44ee82dfdfc24aaec6b702c",
+ "_from": "spdx-correct@>=1.0.0 <1.1.0",
+ "_npmVersion": "2.11.0",
+ "_nodeVersion": "2.2.1",
"_npmUser": {
"name": "kemitchell",
"email": "kyle@kemitchell.com"
@@ -54,10 +55,10 @@
}
],
"dist": {
- "shasum": "5706cc6ce05b928a65564c76e1d6809ba033ac7e",
- "tarball": "http://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.0-prerelease-3.tgz"
+ "shasum": "c2a8654a5a56d8b2d44ee82dfdfc24aaec6b702c",
+ "tarball": "http://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.0.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.0-prerelease-3.tgz",
+ "_resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.0.tgz",
"readme": "ERROR: No README data found!"
}
diff --git a/deps/npm/node_modules/init-package-json/node_modules/validate-npm-package-license/node_modules/spdx-correct/spdx-correct.js b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/spdx-correct.js
index 094712d6236..094712d6236 100644
--- a/deps/npm/node_modules/init-package-json/node_modules/validate-npm-package-license/node_modules/spdx-correct/spdx-correct.js
+++ b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/spdx-correct.js
diff --git a/deps/npm/node_modules/init-package-json/node_modules/validate-npm-package-license/package.json b/deps/npm/node_modules/validate-npm-package-license/package.json
index 4483ede9e36..beb00f8bf68 100644
--- a/deps/npm/node_modules/init-package-json/node_modules/validate-npm-package-license/package.json
+++ b/deps/npm/node_modules/validate-npm-package-license/package.json
@@ -1,23 +1,23 @@
{
"name": "validate-npm-package-license",
- "description": "Give me a string and I'll tell you if it's a valid npm package license",
- "version": "1.0.0-prerelease-2",
+ "description": "Give me a string and I'll tell you if it's a valid npm package license string",
+ "version": "2.0.0",
"author": {
"name": "Kyle E. Mitchell",
"email": "kyle@kemitchell.com",
"url": "http://kemitchell.com"
},
"bugs": {
- "url": "https://github.com/kemitchell/npm-valid-package-license/issues"
+ "url": "https://github.com/kemitchell/validate-npm-package-license.js/issues"
},
"dependencies": {
- "spdx": "^0.4.0",
- "spdx-correct": "1.0.0-prerelease-3"
+ "spdx": "~0.4.0",
+ "spdx-correct": "~1.0.0"
},
"devDependencies": {
- "jsmd": "^0.3.0"
+ "jsmd": "~0.3.0"
},
- "homepage": "https://github.com/kemitchell/npm-valid-package-license",
+ "homepage": "https://github.com/kemitchell/validate-npm-package-license.js",
"keywords": [
"license",
"npm",
@@ -28,17 +28,18 @@
"main": "index.js",
"repository": {
"type": "git",
- "url": "https://github.com/kemitchell/npm-valid-package-license"
+ "url": "git+https://github.com/kemitchell/validate-npm-package-license.js.git"
},
"scripts": {
"precommit": "npm run test",
"test": "jsmd README.md"
},
- "gitHead": "d6043c5bf03a71409daae8d584ba74281e3c55c3",
- "_id": "validate-npm-package-license@1.0.0-prerelease-2",
- "_shasum": "0f45adce1728091b289597035c1ad25a5ba549be",
- "_from": "validate-npm-package-license@1.0.0-prerelease-2",
- "_npmVersion": "1.4.28",
+ "gitHead": "24544d4688f7cc9ed9685a3f9f90bd3f3bed58c0",
+ "_id": "validate-npm-package-license@2.0.0",
+ "_shasum": "ce0a29300edfa07e6ac6ad52eed8d6dfd194e42b",
+ "_from": "validate-npm-package-license@2.0.0",
+ "_npmVersion": "2.11.1",
+ "_nodeVersion": "2.3.0",
"_npmUser": {
"name": "kemitchell",
"email": "kyle@kemitchell.com"
@@ -47,13 +48,17 @@
{
"name": "kemitchell",
"email": "kyle@kemitchell.com"
+ },
+ {
+ "name": "othiym23",
+ "email": "ogd@aoaioxxysz.net"
}
],
"dist": {
- "shasum": "0f45adce1728091b289597035c1ad25a5ba549be",
- "tarball": "http://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-1.0.0-prerelease-2.tgz"
+ "shasum": "ce0a29300edfa07e6ac6ad52eed8d6dfd194e42b",
+ "tarball": "http://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-2.0.0.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-1.0.0-prerelease-2.tgz",
+ "_resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-2.0.0.tgz",
"readme": "ERROR: No README data found!"
}
diff --git a/deps/npm/package.json b/deps/npm/package.json
index f66c064c03b..a1b8de6a65c 100644
--- a/deps/npm/package.json
+++ b/deps/npm/package.json
@@ -1,5 +1,5 @@
{
- "version": "2.11.3",
+ "version": "2.12.1",
"name": "npm",
"description": "a package manager for JavaScript",
"keywords": [
@@ -44,12 +44,12 @@
"cmd-shim": "~2.0.1",
"columnify": "~1.5.1",
"config-chain": "~1.1.9",
- "dezalgo": "~1.0.2",
+ "dezalgo": "~1.0.3",
"editor": "~1.0.0",
"fs-vacuum": "~1.2.6",
"fs-write-stream-atomic": "~1.0.3",
- "fstream": "~1.0.6",
- "fstream-npm": "~1.0.2",
+ "fstream": "~1.0.7",
+ "fstream-npm": "~1.0.3",
"github-url-from-git": "~1.4.0",
"github-url-from-username-repo": "~1.0.2",
"glob": "~5.0.10",
@@ -58,15 +58,15 @@
"inflight": "~1.0.4",
"inherits": "~2.0.1",
"ini": "~1.3.4",
- "init-package-json": "~1.6.0",
+ "init-package-json": "~1.7.0",
"lockfile": "~1.0.1",
"lru-cache": "~2.6.4",
"minimatch": "~2.0.8",
"mkdirp": "~0.5.1",
"node-gyp": "~2.0.1",
- "nopt": "~3.0.2",
- "normalize-git-url": "~1.0.1",
- "normalize-package-data": "~2.2.1",
+ "nopt": "~3.0.3",
+ "normalize-git-url": "~2.0.0",
+ "normalize-package-data": "~2.3.0",
"npm-cache-filename": "~1.0.1",
"npm-install-checks": "~1.0.5",
"npm-package-arg": "~4.0.1",
@@ -78,11 +78,11 @@
"osenv": "~0.1.2",
"path-is-inside": "~1.0.0",
"read": "~1.0.6",
- "read-installed": "~4.0.0",
+ "read-installed": "~4.0.1",
"read-package-json": "~2.0.0",
"readable-stream": "~1.1.13",
"realize-package-specifier": "~3.0.1",
- "request": "~2.57.0",
+ "request": "~2.58.0",
"retry": "~0.6.1",
"rimraf": "~2.4.0",
"semver": "~4.3.6",
@@ -166,6 +166,7 @@
"text-table",
"uid-number",
"umask",
+ "validate-npm-package-license",
"validate-npm-package-name",
"which",
"wrappy",
@@ -175,12 +176,12 @@
"deep-equal": "~1.0.0",
"marked": "~0.3.3",
"marked-man": "~0.1.4",
- "nock": "~2.5.0",
+ "nock": "~2.6.0",
"npm-registry-couchapp": "~2.6.7",
"npm-registry-mock": "~1.0.0",
"require-inject": "~1.2.0",
"sprintf-js": "~1.0.2",
- "tap": "~1.2.0"
+ "tap": "~1.3.1"
},
"scripts": {
"test-legacy": "node ./test/run.js",
diff --git a/deps/npm/test/fixtures/config/userconfig-with-gc b/deps/npm/test/fixtures/config/userconfig-with-gc
index 7268fcb3c61..62ad80be113 100644
--- a/deps/npm/test/fixtures/config/userconfig-with-gc
+++ b/deps/npm/test/fixtures/config/userconfig-with-gc
@@ -1,4 +1,4 @@
-globalconfig=/Users/ogd/Documents/projects/npm/npm/test/fixtures/config/globalconfig
+globalconfig=/Users/zkat/Documents/code/npm/test/fixtures/config/globalconfig
email=i@izs.me
env-thing=asdf
init.author.name=Isaac Z. Schlueter
diff --git a/deps/npm/test/tap/add-remote-git-get-resolved.js b/deps/npm/test/tap/add-remote-git-get-resolved.js
index 4a4f0a5fe52..d66929b658b 100644
--- a/deps/npm/test/tap/add-remote-git-get-resolved.js
+++ b/deps/npm/test/tap/add-remote-git-get-resolved.js
@@ -74,9 +74,16 @@ test('add-remote-git#get-resolved HTTPS', function (t) {
test('add-remote-git#get-resolved edge cases', function (t) {
var getResolved = require('../../lib/cache/add-remote-git.js').getResolved
- t.notOk(
- getResolved('git@bananaboat.com:galbi.git', 'decadacefadabade'),
- 'non-hosted Git SSH non-URI strings are invalid'
+ t.equal(
+ getResolved('git+ssh://user@bananaboat.com:galbi/blah.git', 'decadacefadabade'),
+ 'git+ssh://user@bananaboat.com:galbi/blah.git#decadacefadabade',
+ 'don\'t break non-hosted scp-style locations'
+ )
+
+ t.equal(
+ getResolved('git+ssh://bananaboat:galbi/blah', 'decadacefadabade'),
+ 'git+ssh://bananaboat:galbi/blah#decadacefadabade',
+ 'don\'t break non-hosted scp-style locations'
)
t.equal(
@@ -86,16 +93,16 @@ test('add-remote-git#get-resolved edge cases', function (t) {
)
t.equal(
+ getResolved('git+ssh://git.bananaboat.net:/foo', 'decadacefadabade'),
+ 'git+ssh://git.bananaboat.net:/foo#decadacefadabade',
+ 'don\'t break non-hosted SSH URLs'
+ )
+
+ t.equal(
getResolved('git://gitbub.com/foo/bar.git', 'decadacefadabade'),
'git://gitbub.com/foo/bar.git#decadacefadabade',
'don\'t break non-hosted git: URLs'
)
- t.comment('test for https://github.com/npm/npm/issues/3224')
- t.equal(
- getResolved('git+ssh://git@git.example.com:my-repo.git#9abe82cb339a70065e75300f62b742622774693c', 'decadacefadabade'),
- 'git+ssh://git@git.example.com:my-repo.git#decadacefadabade',
- 'preserve weird colon in semi-standard ssh:// URLs'
- )
t.end()
})
diff --git a/deps/openssl/config/archs/BSD-x86/opensslconf.h b/deps/openssl/config/archs/BSD-x86/opensslconf.h
index 7d6da359436..d93c0bfbb5a 100644
--- a/deps/openssl/config/archs/BSD-x86/opensslconf.h
+++ b/deps/openssl/config/archs/BSD-x86/opensslconf.h
@@ -202,7 +202,7 @@ extern "C" {
#endif
#if defined(DES_RISC1) && defined(DES_RISC2)
-YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
+#error YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
#endif
/* Unroll the inner loop, this sometimes helps, sometimes hinders.
@@ -220,7 +220,7 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
even newer MIPS CPU's, but at the moment one size fits all for
optimization options. Older Sparc's work better with only UNROLL, but
there's no way to tell at compile time what it is you're running on */
-
+
#if defined( sun ) /* Newer Sparc's */
# define DES_PTR
# define DES_RISC1
diff --git a/deps/openssl/config/archs/BSD-x86_64/opensslconf.h b/deps/openssl/config/archs/BSD-x86_64/opensslconf.h
index 9089fde3c7f..ee73a6de4e7 100644
--- a/deps/openssl/config/archs/BSD-x86_64/opensslconf.h
+++ b/deps/openssl/config/archs/BSD-x86_64/opensslconf.h
@@ -202,7 +202,7 @@ extern "C" {
#endif
#if defined(DES_RISC1) && defined(DES_RISC2)
-YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
+#error YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
#endif
/* Unroll the inner loop, this sometimes helps, sometimes hinders.
@@ -220,7 +220,7 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
even newer MIPS CPU's, but at the moment one size fits all for
optimization options. Older Sparc's work better with only UNROLL, but
there's no way to tell at compile time what it is you're running on */
-
+
#if defined( sun ) /* Newer Sparc's */
# define DES_PTR
# define DES_RISC1
diff --git a/deps/openssl/config/archs/VC-WIN32/opensslconf.h b/deps/openssl/config/archs/VC-WIN32/opensslconf.h
index 5f76519d82a..515a5157412 100644
--- a/deps/openssl/config/archs/VC-WIN32/opensslconf.h
+++ b/deps/openssl/config/archs/VC-WIN32/opensslconf.h
@@ -203,7 +203,7 @@ extern "C" {
#endif
#if defined(DES_RISC1) && defined(DES_RISC2)
-YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
+#error YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
#endif
/* Unroll the inner loop, this sometimes helps, sometimes hinders.
@@ -221,7 +221,7 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
even newer MIPS CPU's, but at the moment one size fits all for
optimization options. Older Sparc's work better with only UNROLL, but
there's no way to tell at compile time what it is you're running on */
-
+
#if defined( sun ) /* Newer Sparc's */
# define DES_PTR
# define DES_RISC1
diff --git a/deps/openssl/config/archs/VC-WIN64A/opensslconf.h b/deps/openssl/config/archs/VC-WIN64A/opensslconf.h
index d7f955829ad..902fa56aca0 100644
--- a/deps/openssl/config/archs/VC-WIN64A/opensslconf.h
+++ b/deps/openssl/config/archs/VC-WIN64A/opensslconf.h
@@ -203,7 +203,7 @@ extern "C" {
#endif
#if defined(DES_RISC1) && defined(DES_RISC2)
-YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
+#error YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
#endif
/* Unroll the inner loop, this sometimes helps, sometimes hinders.
@@ -221,7 +221,7 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
even newer MIPS CPU's, but at the moment one size fits all for
optimization options. Older Sparc's work better with only UNROLL, but
there's no way to tell at compile time what it is you're running on */
-
+
#if defined( sun ) /* Newer Sparc's */
# define DES_PTR
# define DES_RISC1
diff --git a/deps/openssl/config/archs/darwin-i386-cc/opensslconf.h b/deps/openssl/config/archs/darwin-i386-cc/opensslconf.h
index bf1488fc9d5..4dedfacceea 100644
--- a/deps/openssl/config/archs/darwin-i386-cc/opensslconf.h
+++ b/deps/openssl/config/archs/darwin-i386-cc/opensslconf.h
@@ -205,7 +205,7 @@ extern "C" {
#endif
#if defined(DES_RISC1) && defined(DES_RISC2)
-YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
+#error YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
#endif
/* Unroll the inner loop, this sometimes helps, sometimes hinders.
@@ -223,7 +223,7 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
even newer MIPS CPU's, but at the moment one size fits all for
optimization options. Older Sparc's work better with only UNROLL, but
there's no way to tell at compile time what it is you're running on */
-
+
#if defined( sun ) /* Newer Sparc's */
# define DES_PTR
# define DES_RISC1
diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/opensslconf.h b/deps/openssl/config/archs/darwin64-x86_64-cc/opensslconf.h
index 3debaa4f064..1667b0a9d7a 100644
--- a/deps/openssl/config/archs/darwin64-x86_64-cc/opensslconf.h
+++ b/deps/openssl/config/archs/darwin64-x86_64-cc/opensslconf.h
@@ -205,7 +205,7 @@ extern "C" {
#endif
#if defined(DES_RISC1) && defined(DES_RISC2)
-YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
+#error YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
#endif
/* Unroll the inner loop, this sometimes helps, sometimes hinders.
@@ -223,7 +223,7 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
even newer MIPS CPU's, but at the moment one size fits all for
optimization options. Older Sparc's work better with only UNROLL, but
there's no way to tell at compile time what it is you're running on */
-
+
#if defined( sun ) /* Newer Sparc's */
# define DES_PTR
# define DES_RISC1
diff --git a/deps/openssl/config/archs/linux-aarch64/opensslconf.h b/deps/openssl/config/archs/linux-aarch64/opensslconf.h
index bcd99db15a5..4bf4588b624 100644
--- a/deps/openssl/config/archs/linux-aarch64/opensslconf.h
+++ b/deps/openssl/config/archs/linux-aarch64/opensslconf.h
@@ -202,7 +202,7 @@ extern "C" {
#endif
#if defined(DES_RISC1) && defined(DES_RISC2)
-YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
+#error YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
#endif
/* Unroll the inner loop, this sometimes helps, sometimes hinders.
@@ -220,7 +220,7 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
even newer MIPS CPU's, but at the moment one size fits all for
optimization options. Older Sparc's work better with only UNROLL, but
there's no way to tell at compile time what it is you're running on */
-
+
#if defined( sun ) /* Newer Sparc's */
# define DES_PTR
# define DES_RISC1
diff --git a/deps/openssl/config/archs/linux-armv4/opensslconf.h b/deps/openssl/config/archs/linux-armv4/opensslconf.h
index 8ecefd4682f..731af2f8eca 100644
--- a/deps/openssl/config/archs/linux-armv4/opensslconf.h
+++ b/deps/openssl/config/archs/linux-armv4/opensslconf.h
@@ -202,7 +202,7 @@ extern "C" {
#endif
#if defined(DES_RISC1) && defined(DES_RISC2)
-YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
+#error YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
#endif
/* Unroll the inner loop, this sometimes helps, sometimes hinders.
@@ -220,7 +220,7 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
even newer MIPS CPU's, but at the moment one size fits all for
optimization options. Older Sparc's work better with only UNROLL, but
there's no way to tell at compile time what it is you're running on */
-
+
#if defined( sun ) /* Newer Sparc's */
# define DES_PTR
# define DES_RISC1
diff --git a/deps/openssl/config/archs/linux-elf/opensslconf.h b/deps/openssl/config/archs/linux-elf/opensslconf.h
index 7d6da359436..d93c0bfbb5a 100644
--- a/deps/openssl/config/archs/linux-elf/opensslconf.h
+++ b/deps/openssl/config/archs/linux-elf/opensslconf.h
@@ -202,7 +202,7 @@ extern "C" {
#endif
#if defined(DES_RISC1) && defined(DES_RISC2)
-YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
+#error YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
#endif
/* Unroll the inner loop, this sometimes helps, sometimes hinders.
@@ -220,7 +220,7 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
even newer MIPS CPU's, but at the moment one size fits all for
optimization options. Older Sparc's work better with only UNROLL, but
there's no way to tell at compile time what it is you're running on */
-
+
#if defined( sun ) /* Newer Sparc's */
# define DES_PTR
# define DES_RISC1
diff --git a/deps/openssl/config/archs/linux-x32/opensslconf.h b/deps/openssl/config/archs/linux-x32/opensslconf.h
index 26a7e8197b2..ad4d1e9dfa3 100644
--- a/deps/openssl/config/archs/linux-x32/opensslconf.h
+++ b/deps/openssl/config/archs/linux-x32/opensslconf.h
@@ -202,7 +202,7 @@ extern "C" {
#endif
#if defined(DES_RISC1) && defined(DES_RISC2)
-YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
+#error YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
#endif
/* Unroll the inner loop, this sometimes helps, sometimes hinders.
@@ -220,7 +220,7 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
even newer MIPS CPU's, but at the moment one size fits all for
optimization options. Older Sparc's work better with only UNROLL, but
there's no way to tell at compile time what it is you're running on */
-
+
#if defined( sun ) /* Newer Sparc's */
# define DES_PTR
# define DES_RISC1
diff --git a/deps/openssl/config/archs/linux-x86_64/opensslconf.h b/deps/openssl/config/archs/linux-x86_64/opensslconf.h
index 9089fde3c7f..ee73a6de4e7 100644
--- a/deps/openssl/config/archs/linux-x86_64/opensslconf.h
+++ b/deps/openssl/config/archs/linux-x86_64/opensslconf.h
@@ -202,7 +202,7 @@ extern "C" {
#endif
#if defined(DES_RISC1) && defined(DES_RISC2)
-YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
+#error YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
#endif
/* Unroll the inner loop, this sometimes helps, sometimes hinders.
@@ -220,7 +220,7 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
even newer MIPS CPU's, but at the moment one size fits all for
optimization options. Older Sparc's work better with only UNROLL, but
there's no way to tell at compile time what it is you're running on */
-
+
#if defined( sun ) /* Newer Sparc's */
# define DES_PTR
# define DES_RISC1
diff --git a/deps/openssl/config/archs/solaris-x86-gcc/opensslconf.h b/deps/openssl/config/archs/solaris-x86-gcc/opensslconf.h
index 7d6da359436..d93c0bfbb5a 100644
--- a/deps/openssl/config/archs/solaris-x86-gcc/opensslconf.h
+++ b/deps/openssl/config/archs/solaris-x86-gcc/opensslconf.h
@@ -202,7 +202,7 @@ extern "C" {
#endif
#if defined(DES_RISC1) && defined(DES_RISC2)
-YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
+#error YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
#endif
/* Unroll the inner loop, this sometimes helps, sometimes hinders.
@@ -220,7 +220,7 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
even newer MIPS CPU's, but at the moment one size fits all for
optimization options. Older Sparc's work better with only UNROLL, but
there's no way to tell at compile time what it is you're running on */
-
+
#if defined( sun ) /* Newer Sparc's */
# define DES_PTR
# define DES_RISC1
diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/opensslconf.h b/deps/openssl/config/archs/solaris64-x86_64-gcc/opensslconf.h
index 9089fde3c7f..ee73a6de4e7 100644
--- a/deps/openssl/config/archs/solaris64-x86_64-gcc/opensslconf.h
+++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/opensslconf.h
@@ -202,7 +202,7 @@ extern "C" {
#endif
#if defined(DES_RISC1) && defined(DES_RISC2)
-YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
+#error YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
#endif
/* Unroll the inner loop, this sometimes helps, sometimes hinders.
@@ -220,7 +220,7 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
even newer MIPS CPU's, but at the moment one size fits all for
optimization options. Older Sparc's work better with only UNROLL, but
there's no way to tell at compile time what it is you're running on */
-
+
#if defined( sun ) /* Newer Sparc's */
# define DES_PTR
# define DES_RISC1
diff --git a/deps/openssl/doc/UPGRADING.md b/deps/openssl/doc/UPGRADING.md
index 54940425ac2..f795621644d 100644
--- a/deps/openssl/doc/UPGRADING.md
+++ b/deps/openssl/doc/UPGRADING.md
@@ -115,11 +115,10 @@ There are three kinds of private patches to be applied in openssl-1.0.2c.
### 3. Replace openssl header files in `deps/openssl/openssl/include/openssl`
all header files in `deps/openssl/openssl/include/openssl/*.h` are
symbolic links in the distributed release tar.gz. They cause issues in
-Windows. They are replaced into the files to include a real header
-file such as
-````
-#include "../../crypto/aes/aes.h"
-````
+Windows. They are copied from the real files of symlink origin into
+the include directory. During installation, they also copied into
+`PREFIX/node/include` by tools/install.py.
+
### 4. Change `opensslconf.h` so as to fit each platform.
No change.
diff --git a/deps/openssl/openssl/CHANGES b/deps/openssl/openssl/CHANGES
index 4cbf61ddf6b..5d4c234363f 100644
--- a/deps/openssl/openssl/CHANGES
+++ b/deps/openssl/openssl/CHANGES
@@ -2,6 +2,21 @@
OpenSSL CHANGES
_______________
+ Changes between 1.0.2c and 1.0.2d [9 Jul 2015]
+
+ *) Alternate chains certificate forgery
+
+ During certificate verfification, OpenSSL will attempt to find an
+ alternative certificate chain if the first attempt to build such a chain
+ fails. An error in the implementation of this logic can mean that an
+ attacker could cause certain checks on untrusted certificates to be
+ bypassed, such as the CA flag, enabling them to use a valid leaf
+ certificate to act as a CA and "issue" an invalid certificate.
+
+ This issue was reported to OpenSSL by Adam Langley/David Benjamin
+ (Google/BoringSSL).
+ [Matt Caswell]
+
Changes between 1.0.2b and 1.0.2c [12 Jun 2015]
*) Fix HMAC ABI incompatibility. The previous version introduced an ABI
diff --git a/deps/openssl/openssl/Makefile b/deps/openssl/openssl/Makefile
index 56b43c600e0..f36147287f5 100644
--- a/deps/openssl/openssl/Makefile
+++ b/deps/openssl/openssl/Makefile
@@ -4,7 +4,7 @@
## Makefile for OpenSSL
##
-VERSION=1.0.2c
+VERSION=1.0.2d
MAJOR=1
MINOR=0.2
SHLIB_VERSION_NUMBER=1.0.0
@@ -271,6 +271,7 @@ reflect:
@[ -n "$(THIS)" ] && $(CLEARENV) && $(MAKE) $(THIS) -e $(BUILDENV)
sub_all: build_all
+
build_all: build_libs build_apps build_tests build_tools
build_libs: build_libcrypto build_libssl openssl.pc
@@ -280,15 +281,15 @@ build_libssl: build_ssl libssl.pc
build_crypto:
@dir=crypto; target=all; $(BUILD_ONE_CMD)
-build_ssl:
+build_ssl: build_crypto
@dir=ssl; target=all; $(BUILD_ONE_CMD)
-build_engines:
+build_engines: build_crypto
@dir=engines; target=all; $(BUILD_ONE_CMD)
-build_apps:
+build_apps: build_libs
@dir=apps; target=all; $(BUILD_ONE_CMD)
-build_tests:
+build_tests: build_libs
@dir=test; target=all; $(BUILD_ONE_CMD)
-build_tools:
+build_tools: build_libs
@dir=tools; target=all; $(BUILD_ONE_CMD)
all_testapps: build_libs build_testapps
diff --git a/deps/openssl/openssl/Makefile.bak b/deps/openssl/openssl/Makefile.bak
index 8f9fd251aa3..9a3e50df601 100644
--- a/deps/openssl/openssl/Makefile.bak
+++ b/deps/openssl/openssl/Makefile.bak
@@ -4,7 +4,7 @@
## Makefile for OpenSSL
##
-VERSION=1.0.2c-dev
+VERSION=1.0.2d-dev
MAJOR=1
MINOR=0.2
SHLIB_VERSION_NUMBER=1.0.0
@@ -271,6 +271,7 @@ reflect:
@[ -n "$(THIS)" ] && $(CLEARENV) && $(MAKE) $(THIS) -e $(BUILDENV)
sub_all: build_all
+
build_all: build_libs build_apps build_tests build_tools
build_libs: build_libcrypto build_libssl openssl.pc
@@ -280,15 +281,15 @@ build_libssl: build_ssl libssl.pc
build_crypto:
@dir=crypto; target=all; $(BUILD_ONE_CMD)
-build_ssl:
+build_ssl: build_crypto
@dir=ssl; target=all; $(BUILD_ONE_CMD)
-build_engines:
+build_engines: build_crypto
@dir=engines; target=all; $(BUILD_ONE_CMD)
-build_apps:
+build_apps: build_libs
@dir=apps; target=all; $(BUILD_ONE_CMD)
-build_tests:
+build_tests: build_libs
@dir=test; target=all; $(BUILD_ONE_CMD)
-build_tools:
+build_tools: build_libs
@dir=tools; target=all; $(BUILD_ONE_CMD)
all_testapps: build_libs build_testapps
diff --git a/deps/openssl/openssl/Makefile.org b/deps/openssl/openssl/Makefile.org
index 9f4faae2df9..d77e2649588 100644
--- a/deps/openssl/openssl/Makefile.org
+++ b/deps/openssl/openssl/Makefile.org
@@ -269,6 +269,7 @@ reflect:
@[ -n "$(THIS)" ] && $(CLEARENV) && $(MAKE) $(THIS) -e $(BUILDENV)
sub_all: build_all
+
build_all: build_libs build_apps build_tests build_tools
build_libs: build_libcrypto build_libssl openssl.pc
@@ -278,15 +279,15 @@ build_libssl: build_ssl libssl.pc
build_crypto:
@dir=crypto; target=all; $(BUILD_ONE_CMD)
-build_ssl:
+build_ssl: build_crypto
@dir=ssl; target=all; $(BUILD_ONE_CMD)
-build_engines:
+build_engines: build_crypto
@dir=engines; target=all; $(BUILD_ONE_CMD)
-build_apps:
+build_apps: build_libs
@dir=apps; target=all; $(BUILD_ONE_CMD)
-build_tests:
+build_tests: build_libs
@dir=test; target=all; $(BUILD_ONE_CMD)
-build_tools:
+build_tools: build_libs
@dir=tools; target=all; $(BUILD_ONE_CMD)
all_testapps: build_libs build_testapps
diff --git a/deps/openssl/openssl/NEWS b/deps/openssl/openssl/NEWS
index f3574cf4c40..29e48053efe 100644
--- a/deps/openssl/openssl/NEWS
+++ b/deps/openssl/openssl/NEWS
@@ -5,6 +5,10 @@
This file gives a brief overview of the major changes between each OpenSSL
release. For more details please read the CHANGES file.
+ Major changes between OpenSSL 1.0.2c and OpenSSL 1.0.2d [9 Jul 2015]
+
+ o Alternate chains certificate forgery (CVE-2015-1793)
+
Major changes between OpenSSL 1.0.2b and OpenSSL 1.0.2c [12 Jun 2015]
o Fix HMAC ABI incompatibility
diff --git a/deps/openssl/openssl/README b/deps/openssl/openssl/README
index ae0443199c9..493141b69ca 100644
--- a/deps/openssl/openssl/README
+++ b/deps/openssl/openssl/README
@@ -1,5 +1,5 @@
- OpenSSL 1.0.2c 12 Jun 2015
+ OpenSSL 1.0.2d 9 Jul 2015
Copyright (c) 1998-2011 The OpenSSL Project
Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
diff --git a/deps/openssl/openssl/apps/ocsp.c b/deps/openssl/openssl/apps/ocsp.c
index b858b8d3ee0..926083dd1b5 100644
--- a/deps/openssl/openssl/apps/ocsp.c
+++ b/deps/openssl/openssl/apps/ocsp.c
@@ -209,6 +209,7 @@ int MAIN(int argc, char **argv)
OPENSSL_free(tport);
if (tpath)
OPENSSL_free(tpath);
+ thost = tport = tpath = NULL;
if (args[1]) {
args++;
if (!OCSP_parse_url(*args, &host, &port, &path, &use_ssl)) {
diff --git a/deps/openssl/openssl/crypto/bio/bio.h b/deps/openssl/openssl/crypto/bio/bio.h
index 7878fb1984f..f78796b069f 100644
--- a/deps/openssl/openssl/crypto/bio/bio.h
+++ b/deps/openssl/openssl/crypto/bio/bio.h
@@ -291,7 +291,7 @@ void BIO_clear_flags(BIO *b, int flags);
* BIO_CB_RETURN flag indicates if it is after the call
*/
# define BIO_CB_RETURN 0x80
-# define BIO_CB_return(a) ((a)|BIO_CB_RETURN))
+# define BIO_CB_return(a) ((a)|BIO_CB_RETURN)
# define BIO_cb_pre(a) (!((a)&BIO_CB_RETURN))
# define BIO_cb_post(a) ((a)&BIO_CB_RETURN)
diff --git a/deps/openssl/openssl/crypto/bn/Makefile b/deps/openssl/openssl/crypto/bn/Makefile
index 61dce05ad71..215855ecae9 100644
--- a/deps/openssl/openssl/crypto/bn/Makefile
+++ b/deps/openssl/openssl/crypto/bn/Makefile
@@ -253,6 +253,7 @@ bn_exp.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
bn_exp.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
bn_exp.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
bn_exp.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_exp.c bn_lcl.h
+bn_exp.o: rsaz_exp.h
bn_exp2.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h
bn_exp2.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
bn_exp2.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
diff --git a/deps/openssl/openssl/crypto/bn/bn_exp.c b/deps/openssl/openssl/crypto/bn/bn_exp.c
index 8c46e50bdcc..24afdd60a22 100644
--- a/deps/openssl/openssl/crypto/bn/bn_exp.c
+++ b/deps/openssl/openssl/crypto/bn/bn_exp.c
@@ -126,13 +126,7 @@
# include <alloca.h>
#endif
-#undef RSAZ_ENABLED
-#if defined(OPENSSL_BN_ASM_MONT) && \
- (defined(__x86_64) || defined(__x86_64__) || \
- defined(_M_AMD64) || defined(_M_X64))
-# include "rsaz_exp.h"
-# define RSAZ_ENABLED
-#endif
+#include "rsaz_exp.h"
#undef SPARC_T4_MONT
#if defined(OPENSSL_BN_ASM_MONT) && (defined(__sparc__) || defined(__sparc))
diff --git a/deps/openssl/openssl/crypto/bn/bntest.c b/deps/openssl/openssl/crypto/bn/bntest.c
index 06662c58b32..470d5dabf1e 100644
--- a/deps/openssl/openssl/crypto/bn/bntest.c
+++ b/deps/openssl/openssl/crypto/bn/bntest.c
@@ -1042,7 +1042,6 @@ int test_mod_exp_mont_consttime(BIO *bp, BN_CTX *ctx)
int test_mod_exp_mont5(BIO *bp, BN_CTX *ctx)
{
BIGNUM *a, *p, *m, *d, *e;
-
BN_MONT_CTX *mont;
a = BN_new();
@@ -1050,7 +1049,6 @@ int test_mod_exp_mont5(BIO *bp, BN_CTX *ctx)
m = BN_new();
d = BN_new();
e = BN_new();
-
mont = BN_MONT_CTX_new();
BN_bntest_rand(m, 1024, 0, 1); /* must be odd for montgomery */
@@ -1099,6 +1097,7 @@ int test_mod_exp_mont5(BIO *bp, BN_CTX *ctx)
fprintf(stderr, "Modular exponentiation test failed!\n");
return 0;
}
+ BN_MONT_CTX_free(mont);
BN_free(a);
BN_free(p);
BN_free(m);
diff --git a/deps/openssl/openssl/crypto/bn/rsaz_exp.c b/deps/openssl/openssl/crypto/bn/rsaz_exp.c
index a486b154c2e..c54c6feb51b 100644
--- a/deps/openssl/openssl/crypto/bn/rsaz_exp.c
+++ b/deps/openssl/openssl/crypto/bn/rsaz_exp.c
@@ -42,6 +42,8 @@
#include "rsaz_exp.h"
+#ifdef RSAZ_ENABLED
+
/*
* See crypto/bn/asm/rsaz-avx2.pl for further details.
*/
@@ -334,3 +336,11 @@ void RSAZ_512_mod_exp(BN_ULONG result[8],
OPENSSL_cleanse(storage, sizeof(storage));
}
+
+#else
+
+# if defined(PEDANTIC) || defined(__DECC) || defined(__clang__)
+static void *dummy = &dummy;
+# endif
+
+#endif
diff --git a/deps/openssl/openssl/crypto/bn/rsaz_exp.h b/deps/openssl/openssl/crypto/bn/rsaz_exp.h
index bb71fb1e197..33361de9957 100644
--- a/deps/openssl/openssl/crypto/bn/rsaz_exp.h
+++ b/deps/openssl/openssl/crypto/bn/rsaz_exp.h
@@ -31,7 +31,13 @@
#ifndef RSAZ_EXP_H
# define RSAZ_EXP_H
-# include <openssl/bn.h>
+# undef RSAZ_ENABLED
+# if defined(OPENSSL_BN_ASM_MONT) && \
+ (defined(__x86_64) || defined(__x86_64__) || \
+ defined(_M_AMD64) || defined(_M_X64))
+# define RSAZ_ENABLED
+
+# include <openssl/bn.h>
void RSAZ_1024_mod_exp_avx2(BN_ULONG result[16],
const BN_ULONG base_norm[16],
@@ -44,4 +50,7 @@ void RSAZ_512_mod_exp(BN_ULONG result[8],
const BN_ULONG base_norm[8], const BN_ULONG exponent[8],
const BN_ULONG m_norm[8], BN_ULONG k0,
const BN_ULONG RR[8]);
+
+# endif
+
#endif
diff --git a/deps/openssl/openssl/crypto/cms/cms_smime.c b/deps/openssl/openssl/crypto/cms/cms_smime.c
index b39ed489989..5522a376acb 100644
--- a/deps/openssl/openssl/crypto/cms/cms_smime.c
+++ b/deps/openssl/openssl/crypto/cms/cms_smime.c
@@ -374,7 +374,7 @@ int CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs,
tmpin = BIO_new_mem_buf(ptr, len);
if (tmpin == NULL) {
CMSerr(CMS_F_CMS_VERIFY, ERR_R_MALLOC_FAILURE);
- return 0;
+ goto err2;
}
} else
tmpin = dcont;
@@ -405,6 +405,7 @@ int CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs,
else
BIO_free_all(cmsbio);
+ err2:
if (cms_certs)
sk_X509_pop_free(cms_certs, X509_free);
if (crls)
diff --git a/deps/openssl/openssl/crypto/evp/e_aes.c b/deps/openssl/openssl/crypto/evp/e_aes.c
index 33cbed87f47..1734a823c1e 100644
--- a/deps/openssl/openssl/crypto/evp/e_aes.c
+++ b/deps/openssl/openssl/crypto/evp/e_aes.c
@@ -1771,7 +1771,7 @@ static int aes_ccm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
case EVP_CTRL_CCM_SET_TAG:
if ((arg & 1) || arg < 4 || arg > 16)
return 0;
- if ((c->encrypt && ptr) || (!c->encrypt && !ptr))
+ if (c->encrypt && ptr)
return 0;
if (ptr) {
cctx->tag_set = 1;
diff --git a/deps/openssl/openssl/crypto/hmac/hmactest.c b/deps/openssl/openssl/crypto/hmac/hmactest.c
index 271d0ebf264..5a573950a45 100644
--- a/deps/openssl/openssl/crypto/hmac/hmactest.c
+++ b/deps/openssl/openssl/crypto/hmac/hmactest.c
@@ -195,6 +195,7 @@ int main(int argc, char *argv[])
}
printf("test 4 ok\n");
test5:
+ HMAC_CTX_cleanup(&ctx);
HMAC_CTX_init(&ctx);
if (HMAC_Init_ex(&ctx, test[4].key, test[4].key_len, NULL, NULL)) {
printf("Should fail to initialise HMAC with empty MD (test 5)\n");
@@ -284,6 +285,7 @@ test5:
printf("test 5 ok\n");
}
test6:
+ HMAC_CTX_cleanup(&ctx);
HMAC_CTX_init(&ctx);
if (!HMAC_Init_ex(&ctx, test[7].key, test[7].key_len, EVP_sha1(), NULL)) {
printf("Failed to initialise HMAC (test 6)\n");
@@ -314,6 +316,7 @@ test6:
printf("test 6 ok\n");
}
end:
+ HMAC_CTX_cleanup(&ctx);
EXIT(err);
return (0);
}
diff --git a/deps/openssl/openssl/crypto/opensslconf.h.in b/deps/openssl/openssl/crypto/opensslconf.h.in
index 97e37455634..814309becb6 100644
--- a/deps/openssl/openssl/crypto/opensslconf.h.in
+++ b/deps/openssl/openssl/crypto/opensslconf.h.in
@@ -101,7 +101,7 @@
#endif
#if defined(DES_RISC1) && defined(DES_RISC2)
-YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
+#error YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
#endif
/* Unroll the inner loop, this sometimes helps, sometimes hinders.
diff --git a/deps/openssl/openssl/crypto/opensslv.h b/deps/openssl/openssl/crypto/opensslv.h
index 7cc19dc5106..c06b13ac6b0 100644
--- a/deps/openssl/openssl/crypto/opensslv.h
+++ b/deps/openssl/openssl/crypto/opensslv.h
@@ -30,11 +30,11 @@ extern "C" {
* (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for
* major minor fix final patch/beta)
*/
-# define OPENSSL_VERSION_NUMBER 0x1000203fL
+# define OPENSSL_VERSION_NUMBER 0x1000204fL
# ifdef OPENSSL_FIPS
-# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2c-fips 12 Jun 2015"
+# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2d-fips 9 Jul 2015"
# else
-# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2c 12 Jun 2015"
+# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2d 9 Jul 2015"
# endif
# define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT
diff --git a/deps/openssl/openssl/crypto/pkcs12/p12_kiss.c b/deps/openssl/openssl/crypto/pkcs12/p12_kiss.c
index ee476c38f4a..9aa3c90c4e5 100644
--- a/deps/openssl/openssl/crypto/pkcs12/p12_kiss.c
+++ b/deps/openssl/openssl/crypto/pkcs12/p12_kiss.c
@@ -135,10 +135,12 @@ int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert,
while ((x = sk_X509_pop(ocerts))) {
if (pkey && *pkey && cert && !*cert) {
+ ERR_set_mark();
if (X509_check_private_key(x, *pkey)) {
*cert = x;
x = NULL;
}
+ ERR_pop_to_mark();
}
if (ca && x) {
diff --git a/deps/openssl/openssl/crypto/srp/srptest.c b/deps/openssl/openssl/crypto/srp/srptest.c
index 451c70e40f5..00e001bd6b8 100644
--- a/deps/openssl/openssl/crypto/srp/srptest.c
+++ b/deps/openssl/openssl/crypto/srp/srptest.c
@@ -148,6 +148,7 @@ int main(int argc, char **argv)
ERR_remove_thread_state(NULL);
ERR_free_strings();
CRYPTO_mem_leaks(bio_err);
+ BIO_free(bio_err);
return 0;
}
diff --git a/deps/openssl/openssl/crypto/threads/mttest.c b/deps/openssl/openssl/crypto/threads/mttest.c
index 8f67db6ee3c..dbff4a69f3a 100644
--- a/deps/openssl/openssl/crypto/threads/mttest.c
+++ b/deps/openssl/openssl/crypto/threads/mttest.c
@@ -56,7 +56,6 @@
* [including the GNU Public Licence.]
*/
-#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
@@ -86,17 +85,11 @@
#include <openssl/lhash.h>
#include <openssl/crypto.h>
#include <openssl/buffer.h>
-#include "../../e_os.h"
#include <openssl/x509.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
#include <openssl/rand.h>
-#ifdef OPENSSL_NO_FP_API
-# define APPS_WIN16
-# include "../buffer/bss_file.c"
-#endif
-
#ifdef OPENSSL_SYS_NETWARE
# define TEST_SERVER_CERT "/openssl/apps/server.pem"
# define TEST_CLIENT_CERT "/openssl/apps/client.pem"
@@ -107,23 +100,23 @@
#define MAX_THREAD_NUMBER 100
-int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *xs);
+int verify_callback(int ok, X509_STORE_CTX *xs);
void thread_setup(void);
void thread_cleanup(void);
void do_threads(SSL_CTX *s_ctx, SSL_CTX *c_ctx);
-void irix_locking_callback(int mode, int type, char *file, int line);
-void solaris_locking_callback(int mode, int type, char *file, int line);
-void win32_locking_callback(int mode, int type, char *file, int line);
-void pthreads_locking_callback(int mode, int type, char *file, int line);
-void netware_locking_callback(int mode, int type, char *file, int line);
+void irix_locking_callback(int mode, int type, const char *file, int line);
+void solaris_locking_callback(int mode, int type, const char *file, int line);
+void win32_locking_callback(int mode, int type, const char *file, int line);
+void pthreads_locking_callback(int mode, int type, const char *file, int line);
+void netware_locking_callback(int mode, int type, const char *file, int line);
void beos_locking_callback(int mode, int type, const char *file, int line);
-unsigned long irix_thread_id(void);
-unsigned long solaris_thread_id(void);
-unsigned long pthreads_thread_id(void);
-unsigned long netware_thread_id(void);
-unsigned long beos_thread_id(void);
+void irix_thread_id(CRYPTO_THREADID *tid);
+void solaris_thread_id(CRYPTO_THREADID *tid);
+void pthreads_thread_id(CRYPTO_THREADID *tid);
+void netware_thread_id(CRYPTO_THREADID *tid);
+void beos_thread_id(CRYPTO_THREADID *tid);
#if defined(OPENSSL_SYS_NETWARE)
static MPKMutex *lock_cs;
@@ -149,39 +142,39 @@ static const char rnd_seed[] =
"string to make the random number generator think it has entropy";
int doit(char *ctx[4]);
-static void print_stats(FILE *fp, SSL_CTX *ctx)
+static void print_stats(BIO *bio, SSL_CTX *ctx)
{
- fprintf(fp, "%4ld items in the session cache\n",
- SSL_CTX_sess_number(ctx));
- fprintf(fp, "%4d client connects (SSL_connect())\n",
- SSL_CTX_sess_connect(ctx));
- fprintf(fp, "%4d client connects that finished\n",
- SSL_CTX_sess_connect_good(ctx));
- fprintf(fp, "%4d server connects (SSL_accept())\n",
- SSL_CTX_sess_accept(ctx));
- fprintf(fp, "%4d server connects that finished\n",
- SSL_CTX_sess_accept_good(ctx));
- fprintf(fp, "%4d session cache hits\n", SSL_CTX_sess_hits(ctx));
- fprintf(fp, "%4d session cache misses\n", SSL_CTX_sess_misses(ctx));
- fprintf(fp, "%4d session cache timeouts\n", SSL_CTX_sess_timeouts(ctx));
+ BIO_printf(bio, "%4ld items in the session cache\n",
+ SSL_CTX_sess_number(ctx));
+ BIO_printf(bio, "%4d client connects (SSL_connect())\n",
+ SSL_CTX_sess_connect(ctx));
+ BIO_printf(bio, "%4d client connects that finished\n",
+ SSL_CTX_sess_connect_good(ctx));
+ BIO_printf(bio, "%4d server connects (SSL_accept())\n",
+ SSL_CTX_sess_accept(ctx));
+ BIO_printf(bio, "%4d server connects that finished\n",
+ SSL_CTX_sess_accept_good(ctx));
+ BIO_printf(bio, "%4d session cache hits\n", SSL_CTX_sess_hits(ctx));
+ BIO_printf(bio, "%4d session cache misses\n", SSL_CTX_sess_misses(ctx));
+ BIO_printf(bio, "%4d session cache timeouts\n", SSL_CTX_sess_timeouts(ctx));
}
static void sv_usage(void)
{
- fprintf(stderr, "usage: ssltest [args ...]\n");
- fprintf(stderr, "\n");
- fprintf(stderr, " -server_auth - check server certificate\n");
- fprintf(stderr, " -client_auth - do client authentication\n");
- fprintf(stderr, " -v - more output\n");
- fprintf(stderr, " -CApath arg - PEM format directory of CA's\n");
- fprintf(stderr, " -CAfile arg - PEM format file of CA's\n");
- fprintf(stderr, " -threads arg - number of threads\n");
- fprintf(stderr, " -loops arg - number of 'connections', per thread\n");
- fprintf(stderr, " -reconnect - reuse session-id's\n");
- fprintf(stderr, " -stats - server session-id cache stats\n");
- fprintf(stderr, " -cert arg - server certificate/key\n");
- fprintf(stderr, " -ccert arg - client certificate/key\n");
- fprintf(stderr, " -ssl3 - just SSLv3n\n");
+ BIO_printf(bio_err, "usage: ssltest [args ...]\n");
+ BIO_printf(bio_err, "\n");
+ BIO_printf(bio_err, " -server_auth - check server certificate\n");
+ BIO_printf(bio_err, " -client_auth - do client authentication\n");
+ BIO_printf(bio_err, " -v - more output\n");
+ BIO_printf(bio_err, " -CApath arg - PEM format directory of CA's\n");
+ BIO_printf(bio_err, " -CAfile arg - PEM format file of CA's\n");
+ BIO_printf(bio_err, " -threads arg - number of threads\n");
+ BIO_printf(bio_err, " -loops arg - number of 'connections', per thread\n");
+ BIO_printf(bio_err, " -reconnect - reuse session-id's\n");
+ BIO_printf(bio_err, " -stats - server session-id cache stats\n");
+ BIO_printf(bio_err, " -cert arg - server certificate/key\n");
+ BIO_printf(bio_err, " -ccert arg - client certificate/key\n");
+ BIO_printf(bio_err, " -ssl3 - just SSLv3n\n");
}
int main(int argc, char *argv[])
@@ -195,14 +188,14 @@ int main(int argc, char *argv[])
SSL_CTX *c_ctx = NULL;
char *scert = TEST_SERVER_CERT;
char *ccert = TEST_CLIENT_CERT;
- SSL_METHOD *ssl_method = SSLv23_method();
+ const SSL_METHOD *ssl_method = SSLv23_method();
RAND_seed(rnd_seed, sizeof rnd_seed);
if (bio_err == NULL)
- bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
+ bio_err = BIO_new_fd(2, BIO_NOCLOSE);
if (bio_stdout == NULL)
- bio_stdout = BIO_new_fp(stdout, BIO_NOCLOSE);
+ bio_stdout = BIO_new_fd(1, BIO_NOCLOSE);
argc--;
argv++;
@@ -250,7 +243,7 @@ int main(int argc, char *argv[])
if (number_of_loops == 0)
number_of_loops = 1;
} else {
- fprintf(stderr, "unknown option %s\n", *argv);
+ BIO_printf(bio_err, "unknown option %s\n", *argv);
badop = 1;
break;
}
@@ -284,9 +277,12 @@ int main(int argc, char *argv[])
SSL_SESS_CACHE_SERVER);
if (!SSL_CTX_use_certificate_file(s_ctx, scert, SSL_FILETYPE_PEM)) {
+ BIO_printf(bio_err, "SSL_CTX_use_certificate_file (%s)\n", scert);
ERR_print_errors(bio_err);
+ goto end;
} else
if (!SSL_CTX_use_RSAPrivateKey_file(s_ctx, scert, SSL_FILETYPE_PEM)) {
+ BIO_printf(bio_err, "SSL_CTX_use_RSAPrivateKey_file (%s)\n", scert);
ERR_print_errors(bio_err);
goto end;
}
@@ -300,19 +296,19 @@ int main(int argc, char *argv[])
(!SSL_CTX_set_default_verify_paths(s_ctx)) ||
(!SSL_CTX_load_verify_locations(c_ctx, CAfile, CApath)) ||
(!SSL_CTX_set_default_verify_paths(c_ctx))) {
- fprintf(stderr, "SSL_load_verify_locations\n");
+ BIO_printf(bio_err, "SSL_load_verify_locations\n");
ERR_print_errors(bio_err);
goto end;
}
if (client_auth) {
- fprintf(stderr, "client authentication\n");
+ BIO_printf(bio_err, "client authentication\n");
SSL_CTX_set_verify(s_ctx,
SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT,
verify_callback);
}
if (server_auth) {
- fprintf(stderr, "server authentication\n");
+ BIO_printf(bio_err, "server authentication\n");
SSL_CTX_set_verify(c_ctx, SSL_VERIFY_PEER, verify_callback);
}
@@ -322,24 +318,24 @@ int main(int argc, char *argv[])
end:
if (c_ctx != NULL) {
- fprintf(stderr, "Client SSL_CTX stats then free it\n");
- print_stats(stderr, c_ctx);
+ BIO_printf(bio_err, "Client SSL_CTX stats then free it\n");
+ print_stats(bio_err, c_ctx);
SSL_CTX_free(c_ctx);
}
if (s_ctx != NULL) {
- fprintf(stderr, "Server SSL_CTX stats then free it\n");
- print_stats(stderr, s_ctx);
+ BIO_printf(bio_err, "Server SSL_CTX stats then free it\n");
+ print_stats(bio_err, s_ctx);
if (cache_stats) {
- fprintf(stderr, "-----\n");
- lh_stats(SSL_CTX_sessions(s_ctx), stderr);
- fprintf(stderr, "-----\n");
- /*- lh_node_stats(SSL_CTX_sessions(s_ctx),stderr);
- fprintf(stderr,"-----\n"); */
- lh_node_usage_stats(SSL_CTX_sessions(s_ctx), stderr);
- fprintf(stderr, "-----\n");
+ BIO_printf(bio_err, "-----\n");
+ lh_SSL_SESSION_stats_bio(SSL_CTX_sessions(s_ctx), bio_err);
+ BIO_printf(bio_err, "-----\n");
+ /*- lh_SSL_SESSION_node_stats_bio(SSL_CTX_sessions(s_ctx),bio_err);
+ BIO_printf(bio_err,"-----\n"); */
+ lh_SSL_SESSION_node_usage_stats_bio(SSL_CTX_sessions(s_ctx), bio_err);
+ BIO_printf(bio_err, "-----\n");
}
SSL_CTX_free(s_ctx);
- fprintf(stderr, "done free\n");
+ BIO_printf(bio_err, "done free\n");
}
exit(ret);
return (0);
@@ -355,6 +351,7 @@ int ndoit(SSL_CTX *ssl_ctx[2])
int i;
int ret;
char *ctx[4];
+ CRYPTO_THREADID thread_id;
ctx[0] = (char *)ssl_ctx[0];
ctx[1] = (char *)ssl_ctx[1];
@@ -367,22 +364,24 @@ int ndoit(SSL_CTX *ssl_ctx[2])
ctx[3] = NULL;
}
- fprintf(stdout, "started thread %lu\n", CRYPTO_thread_id());
+ CRYPTO_THREADID_current(&thread_id);
+ BIO_printf(bio_stdout, "started thread %lu\n",
+ CRYPTO_THREADID_hash(&thread_id));
for (i = 0; i < number_of_loops; i++) {
-/*- fprintf(stderr,"%4d %2d ctx->ref (%3d,%3d)\n",
- CRYPTO_thread_id(),i,
- ssl_ctx[0]->references,
- ssl_ctx[1]->references); */
+/*- BIO_printf(bio_err,"%4d %2d ctx->ref (%3d,%3d)\n",
+ CRYPTO_THREADID_hash(&thread_id),i,
+ ssl_ctx[0]->references,
+ ssl_ctx[1]->references); */
/* pthread_delay_np(&tm); */
ret = doit(ctx);
if (ret != 0) {
- fprintf(stdout, "error[%d] %lu - %d\n",
- i, CRYPTO_thread_id(), ret);
+ BIO_printf(bio_stdout, "error[%d] %lu - %d\n",
+ i, CRYPTO_THREADID_hash(&thread_id), ret);
return (ret);
}
}
- fprintf(stdout, "DONE %lu\n", CRYPTO_thread_id());
+ BIO_printf(bio_stdout, "DONE %lu\n", CRYPTO_THREADID_hash(&thread_id));
if (reconnect) {
SSL_free((SSL *)ctx[2]);
SSL_free((SSL *)ctx[3]);
@@ -467,26 +466,26 @@ int doit(char *ctx[4])
if (do_server && verbose) {
if (SSL_in_init(s_ssl))
- printf("server waiting in SSL_accept - %s\n",
- SSL_state_string_long(s_ssl));
+ BIO_printf(bio_stdout, "server waiting in SSL_accept - %s\n",
+ SSL_state_string_long(s_ssl));
else if (s_write)
- printf("server:SSL_write()\n");
+ BIO_printf(bio_stdout, "server:SSL_write()\n");
else
- printf("server:SSL_read()\n");
+ BIO_printf(bio_stdout, "server:SSL_read()\n");
}
if (do_client && verbose) {
if (SSL_in_init(c_ssl))
- printf("client waiting in SSL_connect - %s\n",
- SSL_state_string_long(c_ssl));
+ BIO_printf(bio_stdout, "client waiting in SSL_connect - %s\n",
+ SSL_state_string_long(c_ssl));
else if (c_write)
- printf("client:SSL_write()\n");
+ BIO_printf(bio_stdout, "client:SSL_write()\n");
else
- printf("client:SSL_read()\n");
+ BIO_printf(bio_stdout, "client:SSL_read()\n");
}
if (!do_client && !do_server) {
- fprintf(stdout, "ERROR IN STARTUP\n");
+ BIO_printf(bio_stdout, "ERROR IN STARTUP\n");
break;
}
if (do_client && !(done & C_DONE)) {
@@ -501,12 +500,12 @@ int doit(char *ctx[4])
if (BIO_should_write(c_bio))
c_w = 1;
} else {
- fprintf(stderr, "ERROR in CLIENT\n");
+ BIO_printf(bio_err, "ERROR in CLIENT\n");
ERR_print_errors_fp(stderr);
return (1);
}
} else if (i == 0) {
- fprintf(stderr, "SSL CLIENT STARTUP FAILED\n");
+ BIO_printf(bio_err, "SSL CLIENT STARTUP FAILED\n");
return (1);
} else {
/* ok */
@@ -523,19 +522,19 @@ int doit(char *ctx[4])
if (BIO_should_write(c_bio))
c_w = 1;
} else {
- fprintf(stderr, "ERROR in CLIENT\n");
+ BIO_printf(bio_err, "ERROR in CLIENT\n");
ERR_print_errors_fp(stderr);
return (1);
}
} else if (i == 0) {
- fprintf(stderr, "SSL CLIENT STARTUP FAILED\n");
+ BIO_printf(bio_err, "SSL CLIENT STARTUP FAILED\n");
return (1);
} else {
done |= C_DONE;
#ifdef undef
- fprintf(stdout, "CLIENT:from server:");
- fwrite(cbuf, 1, i, stdout);
- fflush(stdout);
+ BIO_printf(bio_stdout, "CLIENT:from server:");
+ BIO_write(bio_stdout, cbuf, i);
+ BIO_flush(bio_stdout);
#endif
}
}
@@ -553,20 +552,20 @@ int doit(char *ctx[4])
if (BIO_should_write(s_bio))
s_w = 1;
} else {
- fprintf(stderr, "ERROR in SERVER\n");
+ BIO_printf(bio_err, "ERROR in SERVER\n");
ERR_print_errors_fp(stderr);
return (1);
}
} else if (i == 0) {
- fprintf(stderr, "SSL SERVER STARTUP FAILED\n");
+ BIO_printf(bio_err, "SSL SERVER STARTUP FAILED\n");
return (1);
} else {
s_write = 1;
s_w = 1;
#ifdef undef
- fprintf(stdout, "SERVER:from client:");
- fwrite(sbuf, 1, i, stdout);
- fflush(stdout);
+ BIO_printf(bio_stdout, "SERVER:from client:");
+ BIO_write(bio_stdout, sbuf, i);
+ BIO_flush(bio_stdout);
#endif
}
} else {
@@ -580,12 +579,12 @@ int doit(char *ctx[4])
if (BIO_should_write(s_bio))
s_w = 1;
} else {
- fprintf(stderr, "ERROR in SERVER\n");
+ BIO_printf(bio_err, "ERROR in SERVER\n");
ERR_print_errors_fp(stderr);
return (1);
}
} else if (i == 0) {
- fprintf(stderr, "SSL SERVER STARTUP FAILED\n");
+ BIO_printf(bio_err, "SSL SERVER STARTUP FAILED\n");
return (1);
} else {
s_write = 0;
@@ -606,7 +605,7 @@ int doit(char *ctx[4])
SSL_set_shutdown(s_ssl, SSL_SENT_SHUTDOWN | SSL_RECEIVED_SHUTDOWN);
#ifdef undef
- fprintf(stdout, "DONE\n");
+ BIO_printf(bio_stdout, "DONE\n");
#endif
err:
/*
@@ -640,7 +639,7 @@ int doit(char *ctx[4])
return (0);
}
-int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx)
+int verify_callback(int ok, X509_STORE_CTX *ctx)
{
char *s, buf[256];
@@ -649,9 +648,9 @@ int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx)
buf, 256);
if (s != NULL) {
if (ok)
- fprintf(stderr, "depth=%d %s\n", ctx->error_depth, buf);
+ BIO_printf(bio_err, "depth=%d %s\n", ctx->error_depth, buf);
else
- fprintf(stderr, "depth=%d error=%d %s\n",
+ BIO_printf(bio_err, "depth=%d error=%d %s\n",
ctx->error_depth, ctx->error, buf);
}
}
@@ -688,7 +687,7 @@ void thread_cleanup(void)
OPENSSL_free(lock_cs);
}
-void win32_locking_callback(int mode, int type, char *file, int line)
+void win32_locking_callback(int mode, int type, const char *file, int line)
{
if (mode & CRYPTO_LOCK) {
WaitForSingleObject(lock_cs[type], INFINITE);
@@ -717,7 +716,7 @@ void do_threads(SSL_CTX *s_ctx, SSL_CTX *c_ctx)
(void *)ssl_ctx, 0L, &(thread_id[i]));
}
- printf("reaping\n");
+ BIO_printf(bio_stdout, "reaping\n");
for (i = 0; i < thread_number; i += 50) {
int j;
@@ -727,7 +726,7 @@ void do_threads(SSL_CTX *s_ctx, SSL_CTX *c_ctx)
(CONST HANDLE *) & (thread_handle[i]),
TRUE, INFINITE)
== WAIT_FAILED) {
- fprintf(stderr, "WaitForMultipleObjects failed:%d\n",
+ BIO_printf(bio_err, "WaitForMultipleObjects failed:%d\n",
GetLastError());
exit(1);
}
@@ -743,7 +742,7 @@ void do_threads(SSL_CTX *s_ctx, SSL_CTX *c_ctx)
ret = (ret + end.wSecond - start.wSecond);
ret += (end.wMilliseconds - start.wMilliseconds) / 1000.0;
- printf("win32 threads done - %.3f seconds\n", ret);
+ BIO_printf(bio_stdout, "win32 threads done - %.3f seconds\n", ret);
}
#endif /* OPENSSL_SYS_WIN32 */
@@ -768,8 +767,8 @@ void thread_setup(void)
mutex_init(&(lock_cs[i]), USYNC_THREAD, NULL);
}
- CRYPTO_set_id_callback((unsigned long (*)())solaris_thread_id);
- CRYPTO_set_locking_callback((void (*)())solaris_locking_callback);
+ CRYPTO_set_id_callback(solaris_thread_id);
+ CRYPTO_set_locking_callback(solaris_locking_callback);
}
void thread_cleanup(void)
@@ -778,34 +777,34 @@ void thread_cleanup(void)
CRYPTO_set_locking_callback(NULL);
- fprintf(stderr, "cleanup\n");
+ BIO_printf(bio_err, "cleanup\n");
for (i = 0; i < CRYPTO_num_locks(); i++) {
/* rwlock_destroy(&(lock_cs[i])); */
mutex_destroy(&(lock_cs[i]));
- fprintf(stderr, "%8ld:%s\n", lock_count[i], CRYPTO_get_lock_name(i));
+ BIO_printf(bio_err, "%8ld:%s\n", lock_count[i], CRYPTO_get_lock_name(i));
}
OPENSSL_free(lock_cs);
OPENSSL_free(lock_count);
- fprintf(stderr, "done cleanup\n");
+ BIO_printf(bio_err, "done cleanup\n");
}
-void solaris_locking_callback(int mode, int type, char *file, int line)
+void solaris_locking_callback(int mode, int type, const char *file, int line)
{
# ifdef undef
- fprintf(stderr, "thread=%4d mode=%s lock=%s %s:%d\n",
- CRYPTO_thread_id(),
- (mode & CRYPTO_LOCK) ? "l" : "u",
- (type & CRYPTO_READ) ? "r" : "w", file, line);
+ BIO_printf(bio_err, "thread=%4d mode=%s lock=%s %s:%d\n",
+ CRYPTO_thread_id(),
+ (mode & CRYPTO_LOCK) ? "l" : "u",
+ (type & CRYPTO_READ) ? "r" : "w", file, line);
# endif
/*-
if (CRYPTO_LOCK_SSL_CERT == type)
- fprintf(stderr,"(t,m,f,l) %ld %d %s %d\n",
- CRYPTO_thread_id(),
- mode,file,line);
+ BIO_printf(bio_err,"(t,m,f,l) %ld %d %s %d\n",
+ CRYPTO_thread_id(),
+ mode,file,line);
*/
if (mode & CRYPTO_LOCK) {
/*-
@@ -837,21 +836,22 @@ void do_threads(SSL_CTX *s_ctx, SSL_CTX *c_ctx)
(void *(*)())ndoit, (void *)ssl_ctx, 0L, &(thread_ctx[i]));
}
- printf("reaping\n");
+ BIO_printf(bio_stdout, "reaping\n");
for (i = 0; i < thread_number; i++) {
thr_join(thread_ctx[i], NULL, NULL);
}
- printf("solaris threads done (%d,%d)\n",
- s_ctx->references, c_ctx->references);
+#if 0 /* We can't currently find out the reference amount */
+ BIO_printf(bio_stdout, "solaris threads done (%d,%d)\n",
+ s_ctx->references, c_ctx->references);
+#else
+ BIO_printf(bio_stdout, "solaris threads done\n");
+#endif
}
-unsigned long solaris_thread_id(void)
+void solaris_thread_id(CRYPTO_THREADID *tid)
{
- unsigned long ret;
-
- ret = (unsigned long)thr_self();
- return (ret);
+ CRYPTO_THREADID_set_numeric((unsigned long)thr_self());
}
#endif /* SOLARIS */
@@ -880,8 +880,8 @@ void thread_setup(void)
lock_cs[i] = usnewsema(arena, 1);
}
- CRYPTO_set_id_callback((unsigned long (*)())irix_thread_id);
- CRYPTO_set_locking_callback((void (*)())irix_locking_callback);
+ CRYPTO_set_id_callback(irix_thread_id);
+ CRYPTO_set_locking_callback(irix_locking_callback);
}
void thread_cleanup(void)
@@ -899,13 +899,13 @@ void thread_cleanup(void)
OPENSSL_free(lock_cs);
}
-void irix_locking_callback(int mode, int type, char *file, int line)
+void irix_locking_callback(int mode, int type, const char *file, int line)
{
if (mode & CRYPTO_LOCK) {
- printf("lock %d\n", type);
+ BIO_printf(bio_stdout, "lock %d\n", type);
uspsema(lock_cs[type]);
} else {
- printf("unlock %d\n", type);
+ BIO_printf(bio_stdout, "unlock %d\n", type);
usvsema(lock_cs[type]);
}
}
@@ -924,21 +924,22 @@ void do_threads(SSL_CTX *s_ctx, SSL_CTX *c_ctx)
PR_SADDR | PR_SFDS, (void *)ssl_ctx);
}
- printf("reaping\n");
+ BIO_printf(bio_stdout, "reaping\n");
for (i = 0; i < thread_number; i++) {
wait(NULL);
}
- printf("irix threads done (%d,%d)\n",
- s_ctx->references, c_ctx->references);
+#if 0 /* We can't currently find out the reference amount */
+ BIO_printf(bio_stdout, "irix threads done (%d,%d)\n",
+ s_ctx->references, c_ctx->references);
+#else
+ BIO_printf(bio_stdout, "irix threads done\n");
+#endif
}
unsigned long irix_thread_id(void)
{
- unsigned long ret;
-
- ret = (unsigned long)getpid();
- return (ret);
+ CRYPTO_THREADID_set_numeric((unsigned long)getpid());
}
#endif /* IRIX */
@@ -958,8 +959,8 @@ void thread_setup(void)
pthread_mutex_init(&(lock_cs[i]), NULL);
}
- CRYPTO_set_id_callback((unsigned long (*)())pthreads_thread_id);
- CRYPTO_set_locking_callback((void (*)())pthreads_locking_callback);
+ CRYPTO_THREADID_set_callback(pthreads_thread_id);
+ CRYPTO_set_locking_callback(pthreads_locking_callback);
}
void thread_cleanup(void)
@@ -967,30 +968,30 @@ void thread_cleanup(void)
int i;
CRYPTO_set_locking_callback(NULL);
- fprintf(stderr, "cleanup\n");
+ BIO_printf(bio_err, "cleanup\n");
for (i = 0; i < CRYPTO_num_locks(); i++) {
pthread_mutex_destroy(&(lock_cs[i]));
- fprintf(stderr, "%8ld:%s\n", lock_count[i], CRYPTO_get_lock_name(i));
+ BIO_printf(bio_err, "%8ld:%s\n", lock_count[i], CRYPTO_get_lock_name(i));
}
OPENSSL_free(lock_cs);
OPENSSL_free(lock_count);
- fprintf(stderr, "done cleanup\n");
+ BIO_printf(bio_err, "done cleanup\n");
}
-void pthreads_locking_callback(int mode, int type, char *file, int line)
+void pthreads_locking_callback(int mode, int type, const char *file, int line)
{
# ifdef undef
- fprintf(stderr, "thread=%4d mode=%s lock=%s %s:%d\n",
- CRYPTO_thread_id(),
- (mode & CRYPTO_LOCK) ? "l" : "u",
- (type & CRYPTO_READ) ? "r" : "w", file, line);
+ BIO_printf(bio_err, "thread=%4d mode=%s lock=%s %s:%d\n",
+ CRYPTO_thread_id(),
+ (mode & CRYPTO_LOCK) ? "l" : "u",
+ (type & CRYPTO_READ) ? "r" : "w", file, line);
# endif
/*-
if (CRYPTO_LOCK_SSL_CERT == type)
- fprintf(stderr,"(t,m,f,l) %ld %d %s %d\n",
- CRYPTO_thread_id(),
- mode,file,line);
+ BIO_printf(bio_err,"(t,m,f,l) %ld %d %s %d\n",
+ CRYPTO_thread_id(),
+ mode,file,line);
*/
if (mode & CRYPTO_LOCK) {
pthread_mutex_lock(&(lock_cs[type]));
@@ -1017,21 +1018,22 @@ void do_threads(SSL_CTX *s_ctx, SSL_CTX *c_ctx)
(void *(*)())ndoit, (void *)ssl_ctx);
}
- printf("reaping\n");
+ BIO_printf(bio_stdout, "reaping\n");
for (i = 0; i < thread_number; i++) {
pthread_join(thread_ctx[i], NULL);
}
- printf("pthreads threads done (%d,%d)\n",
- s_ctx->references, c_ctx->references);
+#if 0 /* We can't currently find out the reference amount */
+ BIO_printf(bio_stdout, "pthreads threads done (%d,%d)\n",
+ s_ctx->references, c_ctx->references);
+#else
+ BIO_printf(bio_stdout, "pthreads threads done\n");
+#endif
}
-unsigned long pthreads_thread_id(void)
+void pthreads_thread_id(CRYPTO_THREADID *tid)
{
- unsigned long ret;
-
- ret = (unsigned long)pthread_self();
- return (ret);
+ CRYPTO_THREADID_set_numeric(tid, (unsigned long)pthread_self());
}
#endif /* PTHREADS */
@@ -1051,8 +1053,8 @@ void thread_setup(void)
ThreadSem = MPKSemaphoreAlloc("OpenSSL mttest semaphore", 0);
- CRYPTO_set_id_callback((unsigned long (*)())netware_thread_id);
- CRYPTO_set_locking_callback((void (*)())netware_locking_callback);
+ CRYPTO_set_id_callback(netware_thread_id);
+ CRYPTO_set_locking_callback(netware_locking_callback);
}
void thread_cleanup(void)
@@ -1061,21 +1063,21 @@ void thread_cleanup(void)
CRYPTO_set_locking_callback(NULL);
- fprintf(stdout, "thread_cleanup\n");
+ BIO_printf(bio_stdout, "thread_cleanup\n");
for (i = 0; i < CRYPTO_num_locks(); i++) {
MPKMutexFree(lock_cs[i]);
- fprintf(stdout, "%8ld:%s\n", lock_count[i], CRYPTO_get_lock_name(i));
+ BIO_printf(bio_stdout, "%8ld:%s\n", lock_count[i], CRYPTO_get_lock_name(i));
}
OPENSSL_free(lock_cs);
OPENSSL_free(lock_count);
MPKSemaphoreFree(ThreadSem);
- fprintf(stdout, "done cleanup\n");
+ BIO_printf(bio_stdout, "done cleanup\n");
}
-void netware_locking_callback(int mode, int type, char *file, int line)
+void netware_locking_callback(int mode, int type, const char *file, int line)
{
if (mode & CRYPTO_LOCK) {
MPKMutexLock(lock_cs[type]);
@@ -1097,22 +1099,23 @@ void do_threads(SSL_CTX *s_ctx, SSL_CTX *c_ctx)
ThreadSwitchWithDelay();
}
- printf("reaping\n");
+ BIO_printf(bio_stdout, "reaping\n");
/* loop until all threads have signaled the semaphore */
for (i = 0; i < thread_number; i++) {
MPKSemaphoreWait(ThreadSem);
}
- printf("netware threads done (%d,%d)\n",
- s_ctx->references, c_ctx->references);
+#if 0 /* We can't currently find out the reference amount */
+ BIO_printf(bio_stdout, "netware threads done (%d,%d)\n",
+ s_ctx->references, c_ctx->references);
+#else
+ BIO_printf(bio_stdout, "netware threads done\n");
+#endif
}
unsigned long netware_thread_id(void)
{
- unsigned long ret;
-
- ret = (unsigned long)GetThreadID();
- return (ret);
+ CRYPTO_THREADID_set_numeric((unsigned long)GetThreadID());
}
#endif /* NETWARE */
@@ -1144,24 +1147,24 @@ void thread_cleanup(void)
int i;
CRYPTO_set_locking_callback(NULL);
- fprintf(stderr, "cleanup\n");
+ BIO_printf(bio_err, "cleanup\n");
for (i = 0; i < CRYPTO_num_locks(); i++) {
delete lock_cs[i];
- fprintf(stderr, "%8ld:%s\n", lock_count[i], CRYPTO_get_lock_name(i));
+ BIO_printf(bio_err, "%8ld:%s\n", lock_count[i], CRYPTO_get_lock_name(i));
}
OPENSSL_free(lock_cs);
OPENSSL_free(lock_count);
- fprintf(stderr, "done cleanup\n");
+ BIO_printf(bio_err, "done cleanup\n");
}
void beos_locking_callback(int mode, int type, const char *file, int line)
{
# if 0
- fprintf(stderr, "thread=%4d mode=%s lock=%s %s:%d\n",
- CRYPTO_thread_id(),
- (mode & CRYPTO_LOCK) ? "l" : "u",
- (type & CRYPTO_READ) ? "r" : "w", file, line);
+ BIO_printf(bio_err, "thread=%4d mode=%s lock=%s %s:%d\n",
+ CRYPTO_thread_id(),
+ (mode & CRYPTO_LOCK) ? "l" : "u",
+ (type & CRYPTO_READ) ? "r" : "w", file, line);
# endif
if (mode & CRYPTO_LOCK) {
lock_cs[type]->Lock();
@@ -1187,14 +1190,14 @@ void do_threads(SSL_CTX *s_ctx, SSL_CTX *c_ctx)
resume_thread(thread_ctx[i]);
}
- printf("waiting...\n");
+ BIO_printf(bio_stdout, "waiting...\n");
for (i = 0; i < thread_number; i++) {
status_t result;
wait_for_thread(thread_ctx[i], &result);
}
- printf("beos threads done (%d,%d)\n",
- s_ctx->references, c_ctx->references);
+ BIO_printf(bio_stdout, "beos threads done (%d,%d)\n",
+ s_ctx->references, c_ctx->references);
}
unsigned long beos_thread_id(void)
diff --git a/deps/openssl/openssl/crypto/threads/pthread2.sh b/deps/openssl/openssl/crypto/threads/pthread2.sh
index 41264c6a504..ec945c451b9 100755
--- a/deps/openssl/openssl/crypto/threads/pthread2.sh
+++ b/deps/openssl/openssl/crypto/threads/pthread2.sh
@@ -3,5 +3,4 @@
# build using pthreads where it's already built into the system
#
/bin/rm -f mttest
-gcc -DPTHREADS -I../../include -g mttest.c -o mttest -L../.. -lssl -lcrypto -lpthread
-
+gcc -DPTHREADS -I../../include -g mttest.c -o mttest -L../.. -lssl -lcrypto -lpthread -ldl
diff --git a/deps/openssl/openssl/crypto/x509/Makefile b/deps/openssl/openssl/crypto/x509/Makefile
index 01aa3bf3854..bf197a1d932 100644
--- a/deps/openssl/openssl/crypto/x509/Makefile
+++ b/deps/openssl/openssl/crypto/x509/Makefile
@@ -13,7 +13,7 @@ AR= ar r
CFLAGS= $(INCLUDES) $(CFLAG)
GENERAL=Makefile README
-TEST=
+TEST=verify_extra_test.c
APPS=
LIB=$(TOP)/libcrypto.a
diff --git a/deps/openssl/openssl/crypto/x509/verify_extra_test.c b/deps/openssl/openssl/crypto/x509/verify_extra_test.c
new file mode 100644
index 00000000000..08509f01319
--- /dev/null
+++ b/deps/openssl/openssl/crypto/x509/verify_extra_test.c
@@ -0,0 +1,208 @@
+/*
+ * Written by Matt Caswell for the OpenSSL project.
+ */
+/* ====================================================================
+ * Copyright (c) 1998-2015 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+#include <stdio.h>
+#include <openssl/crypto.h>
+#include <openssl/bio.h>
+#include <openssl/x509.h>
+#include <openssl/pem.h>
+#include <openssl/err.h>
+
+static STACK_OF(X509) *load_certs_from_file(const char *filename)
+{
+ STACK_OF(X509) *certs;
+ BIO *bio;
+ X509 *x;
+
+ bio = BIO_new_file(filename, "r");
+
+ if (bio == NULL) {
+ return NULL;
+ }
+
+ certs = sk_X509_new_null();
+ if (certs == NULL) {
+ BIO_free(bio);
+ return NULL;
+ }
+
+ ERR_set_mark();
+ do {
+ x = PEM_read_bio_X509(bio, NULL, 0, NULL);
+ if (x != NULL && !sk_X509_push(certs, x)) {
+ sk_X509_pop_free(certs, X509_free);
+ BIO_free(bio);
+ return NULL;
+ } else if (x == NULL) {
+ /*
+ * We probably just ran out of certs, so ignore any errors
+ * generated
+ */
+ ERR_pop_to_mark();
+ }
+ } while (x != NULL);
+
+ BIO_free(bio);
+
+ return certs;
+}
+
+/*
+ * Test for CVE-2015-1793 (Alternate Chains Certificate Forgery)
+ *
+ * Chain is as follows:
+ *
+ * rootCA (self-signed)
+ * |
+ * interCA
+ * |
+ * subinterCA subinterCA (self-signed)
+ * | |
+ * leaf ------------------
+ * |
+ * bad
+ *
+ * rootCA, interCA, subinterCA, subinterCA (ss) all have CA=TRUE
+ * leaf and bad have CA=FALSE
+ *
+ * subinterCA and subinterCA (ss) have the same subject name and keys
+ *
+ * interCA (but not rootCA) and subinterCA (ss) are in the trusted store
+ * (roots.pem)
+ * leaf and subinterCA are in the untrusted list (untrusted.pem)
+ * bad is the certificate being verified (bad.pem)
+ *
+ * Versions vulnerable to CVE-2015-1793 will fail to detect that leaf has
+ * CA=FALSE, and will therefore incorrectly verify bad
+ *
+ */
+static int test_alt_chains_cert_forgery(void)
+{
+ int ret = 0;
+ int i;
+ X509 *x = NULL;
+ STACK_OF(X509) *untrusted = NULL;
+ BIO *bio = NULL;
+ X509_STORE_CTX *sctx = NULL;
+ X509_STORE *store = NULL;
+ X509_LOOKUP *lookup = NULL;
+
+ store = X509_STORE_new();
+ if (store == NULL)
+ goto err;
+
+ lookup = X509_STORE_add_lookup(store, X509_LOOKUP_file());
+ if (lookup == NULL)
+ goto err;
+ if(!X509_LOOKUP_load_file(lookup, "certs/roots.pem", X509_FILETYPE_PEM))
+ goto err;
+
+ untrusted = load_certs_from_file("certs/untrusted.pem");
+
+ if ((bio = BIO_new_file("certs/bad.pem", "r")) == NULL)
+ goto err;
+
+ if((x = PEM_read_bio_X509(bio, NULL, 0, NULL)) == NULL)
+ goto err;
+
+ sctx = X509_STORE_CTX_new();
+ if (sctx == NULL)
+ goto err;
+
+ if (!X509_STORE_CTX_init(sctx, store, x, untrusted))
+ goto err;
+
+ i = X509_verify_cert(sctx);
+
+ if(i == 0 && X509_STORE_CTX_get_error(sctx) == X509_V_ERR_INVALID_CA) {
+ /* This is the result we were expecting: Test passed */
+ ret = 1;
+ }
+ err:
+ X509_STORE_CTX_free(sctx);
+ X509_free(x);
+ BIO_free(bio);
+ sk_X509_pop_free(untrusted, X509_free);
+ X509_STORE_free(store);
+ if (ret != 1)
+ ERR_print_errors_fp(stderr);
+ return ret;
+}
+
+int main(void)
+{
+ CRYPTO_malloc_debug_init();
+ CRYPTO_set_mem_debug_options(V_CRYPTO_MDEBUG_ALL);
+ CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
+
+ ERR_load_crypto_strings();
+ OpenSSL_add_all_digests();
+
+ if (!test_alt_chains_cert_forgery()) {
+ fprintf(stderr, "Test alt chains cert forgery failed\n");
+ return 1;
+ }
+
+ EVP_cleanup();
+ CRYPTO_cleanup_all_ex_data();
+ ERR_remove_thread_state(NULL);
+ ERR_free_strings();
+ CRYPTO_mem_leaks_fp(stderr);
+
+ printf("PASS\n");
+ return 0;
+}
diff --git a/deps/openssl/openssl/crypto/x509/x509_vfy.c b/deps/openssl/openssl/crypto/x509/x509_vfy.c
index 8ce41f9c9a8..a2f1dbefe35 100644
--- a/deps/openssl/openssl/crypto/x509/x509_vfy.c
+++ b/deps/openssl/openssl/crypto/x509/x509_vfy.c
@@ -198,6 +198,14 @@ int X509_verify_cert(X509_STORE_CTX *ctx)
X509err(X509_F_X509_VERIFY_CERT, X509_R_NO_CERT_SET_FOR_US_TO_VERIFY);
return -1;
}
+ if (ctx->chain != NULL) {
+ /*
+ * This X509_STORE_CTX has already been used to verify a cert. We
+ * cannot do another one.
+ */
+ X509err(X509_F_X509_VERIFY_CERT, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
+ return -1;
+ }
cb = ctx->verify_cb;
@@ -205,15 +213,13 @@ int X509_verify_cert(X509_STORE_CTX *ctx)
* first we make sure the chain we are going to build is present and that
* the first entry is in place
*/
- if (ctx->chain == NULL) {
- if (((ctx->chain = sk_X509_new_null()) == NULL) ||
- (!sk_X509_push(ctx->chain, ctx->cert))) {
- X509err(X509_F_X509_VERIFY_CERT, ERR_R_MALLOC_FAILURE);
- goto end;
- }
- CRYPTO_add(&ctx->cert->references, 1, CRYPTO_LOCK_X509);
- ctx->last_untrusted = 1;
+ if (((ctx->chain = sk_X509_new_null()) == NULL) ||
+ (!sk_X509_push(ctx->chain, ctx->cert))) {
+ X509err(X509_F_X509_VERIFY_CERT, ERR_R_MALLOC_FAILURE);
+ goto end;
}
+ CRYPTO_add(&ctx->cert->references, 1, CRYPTO_LOCK_X509);
+ ctx->last_untrusted = 1;
/* We use a temporary STACK so we can chop and hack at it */
if (ctx->untrusted != NULL
@@ -389,8 +395,8 @@ int X509_verify_cert(X509_STORE_CTX *ctx)
xtmp = sk_X509_pop(ctx->chain);
X509_free(xtmp);
num--;
- ctx->last_untrusted--;
}
+ ctx->last_untrusted = sk_X509_num(ctx->chain);
retry = 1;
break;
}
diff --git a/deps/openssl/openssl/doc/apps/verify.pod b/deps/openssl/openssl/doc/apps/verify.pod
index df1b86dfe54..bffa6c0ec40 100644
--- a/deps/openssl/openssl/doc/apps/verify.pod
+++ b/deps/openssl/openssl/doc/apps/verify.pod
@@ -15,6 +15,7 @@ B<openssl> B<verify>
[B<-attime timestamp>]
[B<-check_ss_sig>]
[B<-crlfile file>]
+[B<-crl_download>]
[B<-crl_check>]
[B<-crl_check_all>]
[B<-policy_check>]
@@ -29,6 +30,7 @@ B<openssl> B<verify>
[B<-untrusted file>]
[B<-help>]
[B<-issuer_checks>]
+[B<-trusted file>]
[B<-verbose>]
[B<->]
[certificates]
@@ -69,6 +71,10 @@ because it doesn't add any security.
File containing one or more CRL's (in PEM format) to load.
+=item B<-crl_download>
+
+Attempt to download CRL information for this certificate.
+
=item B<-crl_check>
Checks end entity certificate validity by attempting to look up a valid CRL.
@@ -133,6 +139,11 @@ be found that is trusted. With this option that behaviour is suppressed so that
only the first chain found is ever used. Using this option will force the
behaviour to match that of previous OpenSSL versions.
+=item B<-trusted file>
+
+A file of additional trusted certificates. The file should contain multiple
+certificates in PEM format concatenated together.
+
=item B<-policy_print>
Print out diagnostics related to policy processing.
diff --git a/deps/openssl/openssl/doc/crypto/X509_NAME_get_index_by_NID.pod b/deps/openssl/openssl/doc/crypto/X509_NAME_get_index_by_NID.pod
index c8a81287956..109f5613249 100644
--- a/deps/openssl/openssl/doc/crypto/X509_NAME_get_index_by_NID.pod
+++ b/deps/openssl/openssl/doc/crypto/X509_NAME_get_index_by_NID.pod
@@ -29,6 +29,7 @@ and issuer names.
X509_NAME_get_index_by_NID() and X509_NAME_get_index_by_OBJ() retrieve
the next index matching B<nid> or B<obj> after B<lastpos>. B<lastpos>
should initially be set to -1. If there are no more entries -1 is returned.
+If B<nid> is invalid (doesn't correspond to a valid OID) then -2 is returned.
X509_NAME_entry_count() returns the total number of entries in B<name>.
@@ -63,6 +64,10 @@ The list of all relevant B<NID_*> and B<OBJ_* codes> can be found in
the source code header files E<lt>openssl/obj_mac.hE<gt> and/or
E<lt>openssl/objects.hE<gt>.
+Applications which could pass invalid NIDs to X509_NAME_get_index_by_NID()
+should check for the return value of -2. Alternatively the NID validity
+can be determined first by checking OBJ_nid2obj(nid) is not NULL.
+
=head1 EXAMPLES
Process all entries:
@@ -95,6 +100,8 @@ Process all commonName entries:
X509_NAME_get_index_by_NID() and X509_NAME_get_index_by_OBJ()
return the index of the next matching entry or -1 if not found.
+X509_NAME_get_index_by_NID() can also return -2 if the supplied
+NID is invalid.
X509_NAME_entry_count() returns the total number of entries.
diff --git a/deps/openssl/openssl/doc/crypto/X509_STORE_CTX_new.pod b/deps/openssl/openssl/doc/crypto/X509_STORE_CTX_new.pod
index b17888f149e..eb38b0a1090 100644
--- a/deps/openssl/openssl/doc/crypto/X509_STORE_CTX_new.pod
+++ b/deps/openssl/openssl/doc/crypto/X509_STORE_CTX_new.pod
@@ -39,10 +39,15 @@ X509_STORE_CTX_free() completely frees up B<ctx>. After this call B<ctx>
is no longer valid.
X509_STORE_CTX_init() sets up B<ctx> for a subsequent verification operation.
-The trusted certificate store is set to B<store>, the end entity certificate
-to be verified is set to B<x509> and a set of additional certificates (which
-will be untrusted but may be used to build the chain) in B<chain>. Any or
-all of the B<store>, B<x509> and B<chain> parameters can be B<NULL>.
+It must be called before each call to X509_verify_cert(), i.e. a B<ctx> is only
+good for one call to X509_verify_cert(); if you want to verify a second
+certificate with the same B<ctx> then you must call X509_XTORE_CTX_cleanup()
+and then X509_STORE_CTX_init() again before the second call to
+X509_verify_cert(). The trusted certificate store is set to B<store>, the end
+entity certificate to be verified is set to B<x509> and a set of additional
+certificates (which will be untrusted but may be used to build the chain) in
+B<chain>. Any or all of the B<store>, B<x509> and B<chain> parameters can be
+B<NULL>.
X509_STORE_CTX_trusted_stack() sets the set of trusted certificates of B<ctx>
to B<sk>. This is an alternative way of specifying trusted certificates
diff --git a/deps/openssl/openssl/doc/crypto/X509_verify_cert.pod b/deps/openssl/openssl/doc/crypto/X509_verify_cert.pod
index 5253bdcd707..a22e44118cf 100644
--- a/deps/openssl/openssl/doc/crypto/X509_verify_cert.pod
+++ b/deps/openssl/openssl/doc/crypto/X509_verify_cert.pod
@@ -32,7 +32,8 @@ OpenSSL internally for certificate validation, in both the S/MIME and
SSL/TLS code.
The negative return value from X509_verify_cert() can only occur if no
-certificate is set in B<ctx> (due to a programming error) or if a retry
+certificate is set in B<ctx> (due to a programming error); if X509_verify_cert()
+twice without reinitialising B<ctx> in between; or if a retry
operation is requested during internal lookups (which never happens with
standard lookup methods). It is however recommended that application check
for <= 0 return value on error.
diff --git a/deps/openssl/openssl/doc/ssl/SSL_CTX_get0_param.pod b/deps/openssl/openssl/doc/ssl/SSL_CTX_get0_param.pod
new file mode 100644
index 00000000000..332f181187a
--- /dev/null
+++ b/deps/openssl/openssl/doc/ssl/SSL_CTX_get0_param.pod
@@ -0,0 +1,55 @@
+=pod
+
+=head1 NAME
+
+SSL_CTX_get0_param, SSL_get0_param, SSL_CTX_set1_param, SSL_set1_param -
+get and set verification parameters
+
+=head1 SYNOPSIS
+
+ #include <openssl/ssl.h>
+
+ X509_VERIFY_PARAM *SSL_CTX_get0_param(SSL_CTX *ctx)
+ X509_VERIFY_PARAM *SSL_get0_param(SSL *ssl)
+ int SSL_CTX_set1_param(SSL_CTX *ctx, X509_VERIFY_PARAM *vpm)
+ int SSL_set1_param(SSL *ssl, X509_VERIFY_PARAM *vpm)
+
+=head1 DESCRIPTION
+
+SSL_CTX_get0_param() and SSL_get0_param() retrieve an internal pointer to
+the verification parameters for B<ctx> or B<ssl> respectively. The returned
+pointer must not be freed by the calling application.
+
+SSL_CTX_set1_param() and SSL_set1_param() set the verification parameters
+to B<vpm> for B<ctx> or B<ssl>.
+
+=head1 NOTES
+
+Typically parameters are retrieved from an B<SSL_CTX> or B<SSL> structure
+using SSL_CTX_get0_param() or SSL_get0_param() and an application modifies
+them to suit its needs: for example to add a hostname check.
+
+=head1 EXAMPLE
+
+Check hostname matches "www.foo.com" in peer certificate:
+
+ X509_VERIFY_PARAM *vpm = SSL_get0_param(ssl);
+ X509_VERIFY_PARAM_set1_host(vpm, "www.foo.com");
+
+=head1 RETURN VALUES
+
+SSL_CTX_get0_param() and SSL_get0_param() return a pointer to an
+B<X509_VERIFY_PARAM> structure.
+
+SSL_CTX_set1_param() and SSL_set1_param() return 1 for success and 0
+for failure.
+
+=head1 SEE ALSO
+
+L<X509_VERIFY_PARAM_set_flags(3)|X509_VERIFY_PARAM_set_flags(3)>
+
+=head1 HISTORY
+
+These functions were first added to OpenSSL 1.0.2.
+
+=cut
diff --git a/deps/openssl/openssl/doc/ssl/SSL_CTX_use_serverinfo.pod b/deps/openssl/openssl/doc/ssl/SSL_CTX_use_serverinfo.pod
index da7935c83d0..318e052e2b2 100644
--- a/deps/openssl/openssl/doc/ssl/SSL_CTX_use_serverinfo.pod
+++ b/deps/openssl/openssl/doc/ssl/SSL_CTX_use_serverinfo.pod
@@ -2,7 +2,7 @@
=head1 NAME
-SSL_CTX_use_serverinfo, SSL_CTX_use_serverinfo_file
+SSL_CTX_use_serverinfo, SSL_CTX_use_serverinfo_file - use serverinfo extension
=head1 SYNOPSIS
diff --git a/deps/openssl/openssl/include/openssl/aes.h b/deps/openssl/openssl/include/openssl/aes.h
index f646d41f060..87bf60f6f2b 100644
--- a/deps/openssl/openssl/include/openssl/aes.h
+++ b/deps/openssl/openssl/include/openssl/aes.h
@@ -1 +1,149 @@
-#include "../../crypto/aes/aes.h"
+/* crypto/aes/aes.h -*- mode:C; c-file-style: "eay" -*- */
+/* ====================================================================
+ * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ */
+
+#ifndef HEADER_AES_H
+# define HEADER_AES_H
+
+# include <openssl/opensslconf.h>
+
+# ifdef OPENSSL_NO_AES
+# error AES is disabled.
+# endif
+
+# include <stddef.h>
+
+# define AES_ENCRYPT 1
+# define AES_DECRYPT 0
+
+/*
+ * Because array size can't be a const in C, the following two are macros.
+ * Both sizes are in bytes.
+ */
+# define AES_MAXNR 14
+# define AES_BLOCK_SIZE 16
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* This should be a hidden type, but EVP requires that the size be known */
+struct aes_key_st {
+# ifdef AES_LONG
+ unsigned long rd_key[4 * (AES_MAXNR + 1)];
+# else
+ unsigned int rd_key[4 * (AES_MAXNR + 1)];
+# endif
+ int rounds;
+};
+typedef struct aes_key_st AES_KEY;
+
+const char *AES_options(void);
+
+int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
+ AES_KEY *key);
+int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
+ AES_KEY *key);
+
+int private_AES_set_encrypt_key(const unsigned char *userKey, const int bits,
+ AES_KEY *key);
+int private_AES_set_decrypt_key(const unsigned char *userKey, const int bits,
+ AES_KEY *key);
+
+void AES_encrypt(const unsigned char *in, unsigned char *out,
+ const AES_KEY *key);
+void AES_decrypt(const unsigned char *in, unsigned char *out,
+ const AES_KEY *key);
+
+void AES_ecb_encrypt(const unsigned char *in, unsigned char *out,
+ const AES_KEY *key, const int enc);
+void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const AES_KEY *key,
+ unsigned char *ivec, const int enc);
+void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const AES_KEY *key,
+ unsigned char *ivec, int *num, const int enc);
+void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const AES_KEY *key,
+ unsigned char *ivec, int *num, const int enc);
+void AES_cfb8_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const AES_KEY *key,
+ unsigned char *ivec, int *num, const int enc);
+void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const AES_KEY *key,
+ unsigned char *ivec, int *num);
+void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const AES_KEY *key,
+ unsigned char ivec[AES_BLOCK_SIZE],
+ unsigned char ecount_buf[AES_BLOCK_SIZE],
+ unsigned int *num);
+/* NB: the IV is _two_ blocks long */
+void AES_ige_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const AES_KEY *key,
+ unsigned char *ivec, const int enc);
+/* NB: the IV is _four_ blocks long */
+void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const AES_KEY *key,
+ const AES_KEY *key2, const unsigned char *ivec,
+ const int enc);
+
+int AES_wrap_key(AES_KEY *key, const unsigned char *iv,
+ unsigned char *out,
+ const unsigned char *in, unsigned int inlen);
+int AES_unwrap_key(AES_KEY *key, const unsigned char *iv,
+ unsigned char *out,
+ const unsigned char *in, unsigned int inlen);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !HEADER_AES_H */
diff --git a/deps/openssl/openssl/include/openssl/asn1.h b/deps/openssl/openssl/include/openssl/asn1.h
index 5432ed8dc83..68e791fcdbe 100644
--- a/deps/openssl/openssl/include/openssl/asn1.h
+++ b/deps/openssl/openssl/include/openssl/asn1.h
@@ -1 +1,1419 @@
-#include "../../crypto/asn1/asn1.h"
+/* crypto/asn1/asn1.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_ASN1_H
+# define HEADER_ASN1_H
+
+# include <time.h>
+# include <openssl/e_os2.h>
+# ifndef OPENSSL_NO_BIO
+# include <openssl/bio.h>
+# endif
+# include <openssl/stack.h>
+# include <openssl/safestack.h>
+
+# include <openssl/symhacks.h>
+
+# include <openssl/ossl_typ.h>
+# ifndef OPENSSL_NO_DEPRECATED
+# include <openssl/bn.h>
+# endif
+
+# ifdef OPENSSL_BUILD_SHLIBCRYPTO
+# undef OPENSSL_EXTERN
+# define OPENSSL_EXTERN OPENSSL_EXPORT
+# endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# define V_ASN1_UNIVERSAL 0x00
+# define V_ASN1_APPLICATION 0x40
+# define V_ASN1_CONTEXT_SPECIFIC 0x80
+# define V_ASN1_PRIVATE 0xc0
+
+# define V_ASN1_CONSTRUCTED 0x20
+# define V_ASN1_PRIMITIVE_TAG 0x1f
+# define V_ASN1_PRIMATIVE_TAG 0x1f
+
+# define V_ASN1_APP_CHOOSE -2/* let the recipient choose */
+# define V_ASN1_OTHER -3/* used in ASN1_TYPE */
+# define V_ASN1_ANY -4/* used in ASN1 template code */
+
+# define V_ASN1_NEG 0x100/* negative flag */
+
+# define V_ASN1_UNDEF -1
+# define V_ASN1_EOC 0
+# define V_ASN1_BOOLEAN 1 /**/
+# define V_ASN1_INTEGER 2
+# define V_ASN1_NEG_INTEGER (2 | V_ASN1_NEG)
+# define V_ASN1_BIT_STRING 3
+# define V_ASN1_OCTET_STRING 4
+# define V_ASN1_NULL 5
+# define V_ASN1_OBJECT 6
+# define V_ASN1_OBJECT_DESCRIPTOR 7
+# define V_ASN1_EXTERNAL 8
+# define V_ASN1_REAL 9
+# define V_ASN1_ENUMERATED 10
+# define V_ASN1_NEG_ENUMERATED (10 | V_ASN1_NEG)
+# define V_ASN1_UTF8STRING 12
+# define V_ASN1_SEQUENCE 16
+# define V_ASN1_SET 17
+# define V_ASN1_NUMERICSTRING 18 /**/
+# define V_ASN1_PRINTABLESTRING 19
+# define V_ASN1_T61STRING 20
+# define V_ASN1_TELETEXSTRING 20/* alias */
+# define V_ASN1_VIDEOTEXSTRING 21 /**/
+# define V_ASN1_IA5STRING 22
+# define V_ASN1_UTCTIME 23
+# define V_ASN1_GENERALIZEDTIME 24 /**/
+# define V_ASN1_GRAPHICSTRING 25 /**/
+# define V_ASN1_ISO64STRING 26 /**/
+# define V_ASN1_VISIBLESTRING 26/* alias */
+# define V_ASN1_GENERALSTRING 27 /**/
+# define V_ASN1_UNIVERSALSTRING 28 /**/
+# define V_ASN1_BMPSTRING 30
+/* For use with d2i_ASN1_type_bytes() */
+# define B_ASN1_NUMERICSTRING 0x0001
+# define B_ASN1_PRINTABLESTRING 0x0002
+# define B_ASN1_T61STRING 0x0004
+# define B_ASN1_TELETEXSTRING 0x0004
+# define B_ASN1_VIDEOTEXSTRING 0x0008
+# define B_ASN1_IA5STRING 0x0010
+# define B_ASN1_GRAPHICSTRING 0x0020
+# define B_ASN1_ISO64STRING 0x0040
+# define B_ASN1_VISIBLESTRING 0x0040
+# define B_ASN1_GENERALSTRING 0x0080
+# define B_ASN1_UNIVERSALSTRING 0x0100
+# define B_ASN1_OCTET_STRING 0x0200
+# define B_ASN1_BIT_STRING 0x0400
+# define B_ASN1_BMPSTRING 0x0800
+# define B_ASN1_UNKNOWN 0x1000
+# define B_ASN1_UTF8STRING 0x2000
+# define B_ASN1_UTCTIME 0x4000
+# define B_ASN1_GENERALIZEDTIME 0x8000
+# define B_ASN1_SEQUENCE 0x10000
+/* For use with ASN1_mbstring_copy() */
+# define MBSTRING_FLAG 0x1000
+# define MBSTRING_UTF8 (MBSTRING_FLAG)
+# define MBSTRING_ASC (MBSTRING_FLAG|1)
+# define MBSTRING_BMP (MBSTRING_FLAG|2)
+# define MBSTRING_UNIV (MBSTRING_FLAG|4)
+# define SMIME_OLDMIME 0x400
+# define SMIME_CRLFEOL 0x800
+# define SMIME_STREAM 0x1000
+ struct X509_algor_st;
+DECLARE_STACK_OF(X509_ALGOR)
+
+# define DECLARE_ASN1_SET_OF(type)/* filled in by mkstack.pl */
+# define IMPLEMENT_ASN1_SET_OF(type)/* nothing, no longer needed */
+
+/*
+ * We MUST make sure that, except for constness, asn1_ctx_st and
+ * asn1_const_ctx are exactly the same. Fortunately, as soon as the old ASN1
+ * parsing macros are gone, we can throw this away as well...
+ */
+typedef struct asn1_ctx_st {
+ unsigned char *p; /* work char pointer */
+ int eos; /* end of sequence read for indefinite
+ * encoding */
+ int error; /* error code to use when returning an error */
+ int inf; /* constructed if 0x20, indefinite is 0x21 */
+ int tag; /* tag from last 'get object' */
+ int xclass; /* class from last 'get object' */
+ long slen; /* length of last 'get object' */
+ unsigned char *max; /* largest value of p allowed */
+ unsigned char *q; /* temporary variable */
+ unsigned char **pp; /* variable */
+ int line; /* used in error processing */
+} ASN1_CTX;
+
+typedef struct asn1_const_ctx_st {
+ const unsigned char *p; /* work char pointer */
+ int eos; /* end of sequence read for indefinite
+ * encoding */
+ int error; /* error code to use when returning an error */
+ int inf; /* constructed if 0x20, indefinite is 0x21 */
+ int tag; /* tag from last 'get object' */
+ int xclass; /* class from last 'get object' */
+ long slen; /* length of last 'get object' */
+ const unsigned char *max; /* largest value of p allowed */
+ const unsigned char *q; /* temporary variable */
+ const unsigned char **pp; /* variable */
+ int line; /* used in error processing */
+} ASN1_const_CTX;
+
+/*
+ * These are used internally in the ASN1_OBJECT to keep track of whether the
+ * names and data need to be free()ed
+ */
+# define ASN1_OBJECT_FLAG_DYNAMIC 0x01/* internal use */
+# define ASN1_OBJECT_FLAG_CRITICAL 0x02/* critical x509v3 object id */
+# define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04/* internal use */
+# define ASN1_OBJECT_FLAG_DYNAMIC_DATA 0x08/* internal use */
+struct asn1_object_st {
+ const char *sn, *ln;
+ int nid;
+ int length;
+ const unsigned char *data; /* data remains const after init */
+ int flags; /* Should we free this one */
+};
+
+# define ASN1_STRING_FLAG_BITS_LEFT 0x08/* Set if 0x07 has bits left value */
+/*
+ * This indicates that the ASN1_STRING is not a real value but just a place
+ * holder for the location where indefinite length constructed data should be
+ * inserted in the memory buffer
+ */
+# define ASN1_STRING_FLAG_NDEF 0x010
+
+/*
+ * This flag is used by the CMS code to indicate that a string is not
+ * complete and is a place holder for content when it had all been accessed.
+ * The flag will be reset when content has been written to it.
+ */
+
+# define ASN1_STRING_FLAG_CONT 0x020
+/*
+ * This flag is used by ASN1 code to indicate an ASN1_STRING is an MSTRING
+ * type.
+ */
+# define ASN1_STRING_FLAG_MSTRING 0x040
+/* This is the base type that holds just about everything :-) */
+struct asn1_string_st {
+ int length;
+ int type;
+ unsigned char *data;
+ /*
+ * The value of the following field depends on the type being held. It
+ * is mostly being used for BIT_STRING so if the input data has a
+ * non-zero 'unused bits' value, it will be handled correctly
+ */
+ long flags;
+};
+
+/*
+ * ASN1_ENCODING structure: this is used to save the received encoding of an
+ * ASN1 type. This is useful to get round problems with invalid encodings
+ * which can break signatures.
+ */
+
+typedef struct ASN1_ENCODING_st {
+ unsigned char *enc; /* DER encoding */
+ long len; /* Length of encoding */
+ int modified; /* set to 1 if 'enc' is invalid */
+} ASN1_ENCODING;
+
+/* Used with ASN1 LONG type: if a long is set to this it is omitted */
+# define ASN1_LONG_UNDEF 0x7fffffffL
+
+# define STABLE_FLAGS_MALLOC 0x01
+# define STABLE_NO_MASK 0x02
+# define DIRSTRING_TYPE \
+ (B_ASN1_PRINTABLESTRING|B_ASN1_T61STRING|B_ASN1_BMPSTRING|B_ASN1_UTF8STRING)
+# define PKCS9STRING_TYPE (DIRSTRING_TYPE|B_ASN1_IA5STRING)
+
+typedef struct asn1_string_table_st {
+ int nid;
+ long minsize;
+ long maxsize;
+ unsigned long mask;
+ unsigned long flags;
+} ASN1_STRING_TABLE;
+
+DECLARE_STACK_OF(ASN1_STRING_TABLE)
+
+/* size limits: this stuff is taken straight from RFC2459 */
+
+# define ub_name 32768
+# define ub_common_name 64
+# define ub_locality_name 128
+# define ub_state_name 128
+# define ub_organization_name 64
+# define ub_organization_unit_name 64
+# define ub_title 64
+# define ub_email_address 128
+
+/*
+ * Declarations for template structures: for full definitions see asn1t.h
+ */
+typedef struct ASN1_TEMPLATE_st ASN1_TEMPLATE;
+typedef struct ASN1_TLC_st ASN1_TLC;
+/* This is just an opaque pointer */
+typedef struct ASN1_VALUE_st ASN1_VALUE;
+
+/* Declare ASN1 functions: the implement macro in in asn1t.h */
+
+# define DECLARE_ASN1_FUNCTIONS(type) DECLARE_ASN1_FUNCTIONS_name(type, type)
+
+# define DECLARE_ASN1_ALLOC_FUNCTIONS(type) \
+ DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, type)
+
+# define DECLARE_ASN1_FUNCTIONS_name(type, name) \
+ DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \
+ DECLARE_ASN1_ENCODE_FUNCTIONS(type, name, name)
+
+# define DECLARE_ASN1_FUNCTIONS_fname(type, itname, name) \
+ DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \
+ DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name)
+
+# define DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) \
+ type *d2i_##name(type **a, const unsigned char **in, long len); \
+ int i2d_##name(type *a, unsigned char **out); \
+ DECLARE_ASN1_ITEM(itname)
+
+# define DECLARE_ASN1_ENCODE_FUNCTIONS_const(type, name) \
+ type *d2i_##name(type **a, const unsigned char **in, long len); \
+ int i2d_##name(const type *a, unsigned char **out); \
+ DECLARE_ASN1_ITEM(name)
+
+# define DECLARE_ASN1_NDEF_FUNCTION(name) \
+ int i2d_##name##_NDEF(name *a, unsigned char **out);
+
+# define DECLARE_ASN1_FUNCTIONS_const(name) \
+ DECLARE_ASN1_ALLOC_FUNCTIONS(name) \
+ DECLARE_ASN1_ENCODE_FUNCTIONS_const(name, name)
+
+# define DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \
+ type *name##_new(void); \
+ void name##_free(type *a);
+
+# define DECLARE_ASN1_PRINT_FUNCTION(stname) \
+ DECLARE_ASN1_PRINT_FUNCTION_fname(stname, stname)
+
+# define DECLARE_ASN1_PRINT_FUNCTION_fname(stname, fname) \
+ int fname##_print_ctx(BIO *out, stname *x, int indent, \
+ const ASN1_PCTX *pctx);
+
+# define D2I_OF(type) type *(*)(type **,const unsigned char **,long)
+# define I2D_OF(type) int (*)(type *,unsigned char **)
+# define I2D_OF_const(type) int (*)(const type *,unsigned char **)
+
+# define CHECKED_D2I_OF(type, d2i) \
+ ((d2i_of_void*) (1 ? d2i : ((D2I_OF(type))0)))
+# define CHECKED_I2D_OF(type, i2d) \
+ ((i2d_of_void*) (1 ? i2d : ((I2D_OF(type))0)))
+# define CHECKED_NEW_OF(type, xnew) \
+ ((void *(*)(void)) (1 ? xnew : ((type *(*)(void))0)))
+# define CHECKED_PTR_OF(type, p) \
+ ((void*) (1 ? p : (type*)0))
+# define CHECKED_PPTR_OF(type, p) \
+ ((void**) (1 ? p : (type**)0))
+
+# define TYPEDEF_D2I_OF(type) typedef type *d2i_of_##type(type **,const unsigned char **,long)
+# define TYPEDEF_I2D_OF(type) typedef int i2d_of_##type(type *,unsigned char **)
+# define TYPEDEF_D2I2D_OF(type) TYPEDEF_D2I_OF(type); TYPEDEF_I2D_OF(type)
+
+TYPEDEF_D2I2D_OF(void);
+
+/*-
+ * The following macros and typedefs allow an ASN1_ITEM
+ * to be embedded in a structure and referenced. Since
+ * the ASN1_ITEM pointers need to be globally accessible
+ * (possibly from shared libraries) they may exist in
+ * different forms. On platforms that support it the
+ * ASN1_ITEM structure itself will be globally exported.
+ * Other platforms will export a function that returns
+ * an ASN1_ITEM pointer.
+ *
+ * To handle both cases transparently the macros below
+ * should be used instead of hard coding an ASN1_ITEM
+ * pointer in a structure.
+ *
+ * The structure will look like this:
+ *
+ * typedef struct SOMETHING_st {
+ * ...
+ * ASN1_ITEM_EXP *iptr;
+ * ...
+ * } SOMETHING;
+ *
+ * It would be initialised as e.g.:
+ *
+ * SOMETHING somevar = {...,ASN1_ITEM_ref(X509),...};
+ *
+ * and the actual pointer extracted with:
+ *
+ * const ASN1_ITEM *it = ASN1_ITEM_ptr(somevar.iptr);
+ *
+ * Finally an ASN1_ITEM pointer can be extracted from an
+ * appropriate reference with: ASN1_ITEM_rptr(X509). This
+ * would be used when a function takes an ASN1_ITEM * argument.
+ *
+ */
+
+# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION
+
+/* ASN1_ITEM pointer exported type */
+typedef const ASN1_ITEM ASN1_ITEM_EXP;
+
+/* Macro to obtain ASN1_ITEM pointer from exported type */
+# define ASN1_ITEM_ptr(iptr) (iptr)
+
+/* Macro to include ASN1_ITEM pointer from base type */
+# define ASN1_ITEM_ref(iptr) (&(iptr##_it))
+
+# define ASN1_ITEM_rptr(ref) (&(ref##_it))
+
+# define DECLARE_ASN1_ITEM(name) \
+ OPENSSL_EXTERN const ASN1_ITEM name##_it;
+
+# else
+
+/*
+ * Platforms that can't easily handle shared global variables are declared as
+ * functions returning ASN1_ITEM pointers.
+ */
+
+/* ASN1_ITEM pointer exported type */
+typedef const ASN1_ITEM *ASN1_ITEM_EXP (void);
+
+/* Macro to obtain ASN1_ITEM pointer from exported type */
+# define ASN1_ITEM_ptr(iptr) (iptr())
+
+/* Macro to include ASN1_ITEM pointer from base type */
+# define ASN1_ITEM_ref(iptr) (iptr##_it)
+
+# define ASN1_ITEM_rptr(ref) (ref##_it())
+
+# define DECLARE_ASN1_ITEM(name) \
+ const ASN1_ITEM * name##_it(void);
+
+# endif
+
+/* Parameters used by ASN1_STRING_print_ex() */
+
+/*
+ * These determine which characters to escape: RFC2253 special characters,
+ * control characters and MSB set characters
+ */
+
+# define ASN1_STRFLGS_ESC_2253 1
+# define ASN1_STRFLGS_ESC_CTRL 2
+# define ASN1_STRFLGS_ESC_MSB 4
+
+/*
+ * This flag determines how we do escaping: normally RC2253 backslash only,
+ * set this to use backslash and quote.
+ */
+
+# define ASN1_STRFLGS_ESC_QUOTE 8
+
+/* These three flags are internal use only. */
+
+/* Character is a valid PrintableString character */
+# define CHARTYPE_PRINTABLESTRING 0x10
+/* Character needs escaping if it is the first character */
+# define CHARTYPE_FIRST_ESC_2253 0x20
+/* Character needs escaping if it is the last character */
+# define CHARTYPE_LAST_ESC_2253 0x40
+
+/*
+ * NB the internal flags are safely reused below by flags handled at the top
+ * level.
+ */
+
+/*
+ * If this is set we convert all character strings to UTF8 first
+ */
+
+# define ASN1_STRFLGS_UTF8_CONVERT 0x10
+
+/*
+ * If this is set we don't attempt to interpret content: just assume all
+ * strings are 1 byte per character. This will produce some pretty odd
+ * looking output!
+ */
+
+# define ASN1_STRFLGS_IGNORE_TYPE 0x20
+
+/* If this is set we include the string type in the output */
+# define ASN1_STRFLGS_SHOW_TYPE 0x40
+
+/*
+ * This determines which strings to display and which to 'dump' (hex dump of
+ * content octets or DER encoding). We can only dump non character strings or
+ * everything. If we don't dump 'unknown' they are interpreted as character
+ * strings with 1 octet per character and are subject to the usual escaping
+ * options.
+ */
+
+# define ASN1_STRFLGS_DUMP_ALL 0x80
+# define ASN1_STRFLGS_DUMP_UNKNOWN 0x100
+
+/*
+ * These determine what 'dumping' does, we can dump the content octets or the
+ * DER encoding: both use the RFC2253 #XXXXX notation.
+ */
+
+# define ASN1_STRFLGS_DUMP_DER 0x200
+
+/*
+ * All the string flags consistent with RFC2253, escaping control characters
+ * isn't essential in RFC2253 but it is advisable anyway.
+ */
+
+# define ASN1_STRFLGS_RFC2253 (ASN1_STRFLGS_ESC_2253 | \
+ ASN1_STRFLGS_ESC_CTRL | \
+ ASN1_STRFLGS_ESC_MSB | \
+ ASN1_STRFLGS_UTF8_CONVERT | \
+ ASN1_STRFLGS_DUMP_UNKNOWN | \
+ ASN1_STRFLGS_DUMP_DER)
+
+DECLARE_STACK_OF(ASN1_INTEGER)
+DECLARE_ASN1_SET_OF(ASN1_INTEGER)
+
+DECLARE_STACK_OF(ASN1_GENERALSTRING)
+
+typedef struct asn1_type_st {
+ int type;
+ union {
+ char *ptr;
+ ASN1_BOOLEAN boolean;
+ ASN1_STRING *asn1_string;
+ ASN1_OBJECT *object;
+ ASN1_INTEGER *integer;
+ ASN1_ENUMERATED *enumerated;
+ ASN1_BIT_STRING *bit_string;
+ ASN1_OCTET_STRING *octet_string;
+ ASN1_PRINTABLESTRING *printablestring;
+ ASN1_T61STRING *t61string;
+ ASN1_IA5STRING *ia5string;
+ ASN1_GENERALSTRING *generalstring;
+ ASN1_BMPSTRING *bmpstring;
+ ASN1_UNIVERSALSTRING *universalstring;
+ ASN1_UTCTIME *utctime;
+ ASN1_GENERALIZEDTIME *generalizedtime;
+ ASN1_VISIBLESTRING *visiblestring;
+ ASN1_UTF8STRING *utf8string;
+ /*
+ * set and sequence are left complete and still contain the set or
+ * sequence bytes
+ */
+ ASN1_STRING *set;
+ ASN1_STRING *sequence;
+ ASN1_VALUE *asn1_value;
+ } value;
+} ASN1_TYPE;
+
+DECLARE_STACK_OF(ASN1_TYPE)
+DECLARE_ASN1_SET_OF(ASN1_TYPE)
+
+typedef STACK_OF(ASN1_TYPE) ASN1_SEQUENCE_ANY;
+
+DECLARE_ASN1_ENCODE_FUNCTIONS_const(ASN1_SEQUENCE_ANY, ASN1_SEQUENCE_ANY)
+DECLARE_ASN1_ENCODE_FUNCTIONS_const(ASN1_SEQUENCE_ANY, ASN1_SET_ANY)
+
+typedef struct NETSCAPE_X509_st {
+ ASN1_OCTET_STRING *header;
+ X509 *cert;
+} NETSCAPE_X509;
+
+/* This is used to contain a list of bit names */
+typedef struct BIT_STRING_BITNAME_st {
+ int bitnum;
+ const char *lname;
+ const char *sname;
+} BIT_STRING_BITNAME;
+
+# define M_ASN1_STRING_length(x) ((x)->length)
+# define M_ASN1_STRING_length_set(x, n) ((x)->length = (n))
+# define M_ASN1_STRING_type(x) ((x)->type)
+# define M_ASN1_STRING_data(x) ((x)->data)
+
+/* Macros for string operations */
+# define M_ASN1_BIT_STRING_new() (ASN1_BIT_STRING *)\
+ ASN1_STRING_type_new(V_ASN1_BIT_STRING)
+# define M_ASN1_BIT_STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+# define M_ASN1_BIT_STRING_dup(a) (ASN1_BIT_STRING *)\
+ ASN1_STRING_dup((const ASN1_STRING *)a)
+# define M_ASN1_BIT_STRING_cmp(a,b) ASN1_STRING_cmp(\
+ (const ASN1_STRING *)a,(const ASN1_STRING *)b)
+# define M_ASN1_BIT_STRING_set(a,b,c) ASN1_STRING_set((ASN1_STRING *)a,b,c)
+
+# define M_ASN1_INTEGER_new() (ASN1_INTEGER *)\
+ ASN1_STRING_type_new(V_ASN1_INTEGER)
+# define M_ASN1_INTEGER_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+# define M_ASN1_INTEGER_dup(a) (ASN1_INTEGER *)\
+ ASN1_STRING_dup((const ASN1_STRING *)a)
+# define M_ASN1_INTEGER_cmp(a,b) ASN1_STRING_cmp(\
+ (const ASN1_STRING *)a,(const ASN1_STRING *)b)
+
+# define M_ASN1_ENUMERATED_new() (ASN1_ENUMERATED *)\
+ ASN1_STRING_type_new(V_ASN1_ENUMERATED)
+# define M_ASN1_ENUMERATED_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+# define M_ASN1_ENUMERATED_dup(a) (ASN1_ENUMERATED *)\
+ ASN1_STRING_dup((const ASN1_STRING *)a)
+# define M_ASN1_ENUMERATED_cmp(a,b) ASN1_STRING_cmp(\
+ (const ASN1_STRING *)a,(const ASN1_STRING *)b)
+
+# define M_ASN1_OCTET_STRING_new() (ASN1_OCTET_STRING *)\
+ ASN1_STRING_type_new(V_ASN1_OCTET_STRING)
+# define M_ASN1_OCTET_STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+# define M_ASN1_OCTET_STRING_dup(a) (ASN1_OCTET_STRING *)\
+ ASN1_STRING_dup((const ASN1_STRING *)a)
+# define M_ASN1_OCTET_STRING_cmp(a,b) ASN1_STRING_cmp(\
+ (const ASN1_STRING *)a,(const ASN1_STRING *)b)
+# define M_ASN1_OCTET_STRING_set(a,b,c) ASN1_STRING_set((ASN1_STRING *)a,b,c)
+# define M_ASN1_OCTET_STRING_print(a,b) ASN1_STRING_print(a,(ASN1_STRING *)b)
+# define M_i2d_ASN1_OCTET_STRING(a,pp) \
+ i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_OCTET_STRING,\
+ V_ASN1_UNIVERSAL)
+
+# define B_ASN1_TIME \
+ B_ASN1_UTCTIME | \
+ B_ASN1_GENERALIZEDTIME
+
+# define B_ASN1_PRINTABLE \
+ B_ASN1_NUMERICSTRING| \
+ B_ASN1_PRINTABLESTRING| \
+ B_ASN1_T61STRING| \
+ B_ASN1_IA5STRING| \
+ B_ASN1_BIT_STRING| \
+ B_ASN1_UNIVERSALSTRING|\
+ B_ASN1_BMPSTRING|\
+ B_ASN1_UTF8STRING|\
+ B_ASN1_SEQUENCE|\
+ B_ASN1_UNKNOWN
+
+# define B_ASN1_DIRECTORYSTRING \
+ B_ASN1_PRINTABLESTRING| \
+ B_ASN1_TELETEXSTRING|\
+ B_ASN1_BMPSTRING|\
+ B_ASN1_UNIVERSALSTRING|\
+ B_ASN1_UTF8STRING
+
+# define B_ASN1_DISPLAYTEXT \
+ B_ASN1_IA5STRING| \
+ B_ASN1_VISIBLESTRING| \
+ B_ASN1_BMPSTRING|\
+ B_ASN1_UTF8STRING
+
+# define M_ASN1_PRINTABLE_new() ASN1_STRING_type_new(V_ASN1_T61STRING)
+# define M_ASN1_PRINTABLE_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+# define M_i2d_ASN1_PRINTABLE(a,pp) i2d_ASN1_bytes((ASN1_STRING *)a,\
+ pp,a->type,V_ASN1_UNIVERSAL)
+# define M_d2i_ASN1_PRINTABLE(a,pp,l) \
+ d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \
+ B_ASN1_PRINTABLE)
+
+# define M_DIRECTORYSTRING_new() ASN1_STRING_type_new(V_ASN1_PRINTABLESTRING)
+# define M_DIRECTORYSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+# define M_i2d_DIRECTORYSTRING(a,pp) i2d_ASN1_bytes((ASN1_STRING *)a,\
+ pp,a->type,V_ASN1_UNIVERSAL)
+# define M_d2i_DIRECTORYSTRING(a,pp,l) \
+ d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \
+ B_ASN1_DIRECTORYSTRING)
+
+# define M_DISPLAYTEXT_new() ASN1_STRING_type_new(V_ASN1_VISIBLESTRING)
+# define M_DISPLAYTEXT_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+# define M_i2d_DISPLAYTEXT(a,pp) i2d_ASN1_bytes((ASN1_STRING *)a,\
+ pp,a->type,V_ASN1_UNIVERSAL)
+# define M_d2i_DISPLAYTEXT(a,pp,l) \
+ d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \
+ B_ASN1_DISPLAYTEXT)
+
+# define M_ASN1_PRINTABLESTRING_new() (ASN1_PRINTABLESTRING *)\
+ ASN1_STRING_type_new(V_ASN1_PRINTABLESTRING)
+# define M_ASN1_PRINTABLESTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+# define M_i2d_ASN1_PRINTABLESTRING(a,pp) \
+ i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_PRINTABLESTRING,\
+ V_ASN1_UNIVERSAL)
+# define M_d2i_ASN1_PRINTABLESTRING(a,pp,l) \
+ (ASN1_PRINTABLESTRING *)d2i_ASN1_type_bytes\
+ ((ASN1_STRING **)a,pp,l,B_ASN1_PRINTABLESTRING)
+
+# define M_ASN1_T61STRING_new() (ASN1_T61STRING *)\
+ ASN1_STRING_type_new(V_ASN1_T61STRING)
+# define M_ASN1_T61STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+# define M_i2d_ASN1_T61STRING(a,pp) \
+ i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_T61STRING,\
+ V_ASN1_UNIVERSAL)
+# define M_d2i_ASN1_T61STRING(a,pp,l) \
+ (ASN1_T61STRING *)d2i_ASN1_type_bytes\
+ ((ASN1_STRING **)a,pp,l,B_ASN1_T61STRING)
+
+# define M_ASN1_IA5STRING_new() (ASN1_IA5STRING *)\
+ ASN1_STRING_type_new(V_ASN1_IA5STRING)
+# define M_ASN1_IA5STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+# define M_ASN1_IA5STRING_dup(a) \
+ (ASN1_IA5STRING *)ASN1_STRING_dup((const ASN1_STRING *)a)
+# define M_i2d_ASN1_IA5STRING(a,pp) \
+ i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_IA5STRING,\
+ V_ASN1_UNIVERSAL)
+# define M_d2i_ASN1_IA5STRING(a,pp,l) \
+ (ASN1_IA5STRING *)d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l,\
+ B_ASN1_IA5STRING)
+
+# define M_ASN1_UTCTIME_new() (ASN1_UTCTIME *)\
+ ASN1_STRING_type_new(V_ASN1_UTCTIME)
+# define M_ASN1_UTCTIME_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+# define M_ASN1_UTCTIME_dup(a) (ASN1_UTCTIME *)\
+ ASN1_STRING_dup((const ASN1_STRING *)a)
+
+# define M_ASN1_GENERALIZEDTIME_new() (ASN1_GENERALIZEDTIME *)\
+ ASN1_STRING_type_new(V_ASN1_GENERALIZEDTIME)
+# define M_ASN1_GENERALIZEDTIME_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+# define M_ASN1_GENERALIZEDTIME_dup(a) (ASN1_GENERALIZEDTIME *)ASN1_STRING_dup(\
+ (const ASN1_STRING *)a)
+
+# define M_ASN1_TIME_new() (ASN1_TIME *)\
+ ASN1_STRING_type_new(V_ASN1_UTCTIME)
+# define M_ASN1_TIME_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+# define M_ASN1_TIME_dup(a) (ASN1_TIME *)\
+ ASN1_STRING_dup((const ASN1_STRING *)a)
+
+# define M_ASN1_GENERALSTRING_new() (ASN1_GENERALSTRING *)\
+ ASN1_STRING_type_new(V_ASN1_GENERALSTRING)
+# define M_ASN1_GENERALSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+# define M_i2d_ASN1_GENERALSTRING(a,pp) \
+ i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_GENERALSTRING,\
+ V_ASN1_UNIVERSAL)
+# define M_d2i_ASN1_GENERALSTRING(a,pp,l) \
+ (ASN1_GENERALSTRING *)d2i_ASN1_type_bytes\
+ ((ASN1_STRING **)a,pp,l,B_ASN1_GENERALSTRING)
+
+# define M_ASN1_UNIVERSALSTRING_new() (ASN1_UNIVERSALSTRING *)\
+ ASN1_STRING_type_new(V_ASN1_UNIVERSALSTRING)
+# define M_ASN1_UNIVERSALSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+# define M_i2d_ASN1_UNIVERSALSTRING(a,pp) \
+ i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_UNIVERSALSTRING,\
+ V_ASN1_UNIVERSAL)
+# define M_d2i_ASN1_UNIVERSALSTRING(a,pp,l) \
+ (ASN1_UNIVERSALSTRING *)d2i_ASN1_type_bytes\
+ ((ASN1_STRING **)a,pp,l,B_ASN1_UNIVERSALSTRING)
+
+# define M_ASN1_BMPSTRING_new() (ASN1_BMPSTRING *)\
+ ASN1_STRING_type_new(V_ASN1_BMPSTRING)
+# define M_ASN1_BMPSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+# define M_i2d_ASN1_BMPSTRING(a,pp) \
+ i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_BMPSTRING,\
+ V_ASN1_UNIVERSAL)
+# define M_d2i_ASN1_BMPSTRING(a,pp,l) \
+ (ASN1_BMPSTRING *)d2i_ASN1_type_bytes\
+ ((ASN1_STRING **)a,pp,l,B_ASN1_BMPSTRING)
+
+# define M_ASN1_VISIBLESTRING_new() (ASN1_VISIBLESTRING *)\
+ ASN1_STRING_type_new(V_ASN1_VISIBLESTRING)
+# define M_ASN1_VISIBLESTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+# define M_i2d_ASN1_VISIBLESTRING(a,pp) \
+ i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_VISIBLESTRING,\
+ V_ASN1_UNIVERSAL)
+# define M_d2i_ASN1_VISIBLESTRING(a,pp,l) \
+ (ASN1_VISIBLESTRING *)d2i_ASN1_type_bytes\
+ ((ASN1_STRING **)a,pp,l,B_ASN1_VISIBLESTRING)
+
+# define M_ASN1_UTF8STRING_new() (ASN1_UTF8STRING *)\
+ ASN1_STRING_type_new(V_ASN1_UTF8STRING)
+# define M_ASN1_UTF8STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
+# define M_i2d_ASN1_UTF8STRING(a,pp) \
+ i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_UTF8STRING,\
+ V_ASN1_UNIVERSAL)
+# define M_d2i_ASN1_UTF8STRING(a,pp,l) \
+ (ASN1_UTF8STRING *)d2i_ASN1_type_bytes\
+ ((ASN1_STRING **)a,pp,l,B_ASN1_UTF8STRING)
+
+ /* for the is_set parameter to i2d_ASN1_SET */
+# define IS_SEQUENCE 0
+# define IS_SET 1
+
+DECLARE_ASN1_FUNCTIONS_fname(ASN1_TYPE, ASN1_ANY, ASN1_TYPE)
+
+int ASN1_TYPE_get(ASN1_TYPE *a);
+void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value);
+int ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value);
+int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b);
+
+ASN1_OBJECT *ASN1_OBJECT_new(void);
+void ASN1_OBJECT_free(ASN1_OBJECT *a);
+int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp);
+ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp,
+ long length);
+ASN1_OBJECT *d2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp,
+ long length);
+
+DECLARE_ASN1_ITEM(ASN1_OBJECT)
+
+DECLARE_STACK_OF(ASN1_OBJECT)
+DECLARE_ASN1_SET_OF(ASN1_OBJECT)
+
+ASN1_STRING *ASN1_STRING_new(void);
+void ASN1_STRING_free(ASN1_STRING *a);
+void ASN1_STRING_clear_free(ASN1_STRING *a);
+int ASN1_STRING_copy(ASN1_STRING *dst, const ASN1_STRING *str);
+ASN1_STRING *ASN1_STRING_dup(const ASN1_STRING *a);
+ASN1_STRING *ASN1_STRING_type_new(int type);
+int ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b);
+ /*
+ * Since this is used to store all sorts of things, via macros, for now,
+ * make its data void *
+ */
+int ASN1_STRING_set(ASN1_STRING *str, const void *data, int len);
+void ASN1_STRING_set0(ASN1_STRING *str, void *data, int len);
+int ASN1_STRING_length(const ASN1_STRING *x);
+void ASN1_STRING_length_set(ASN1_STRING *x, int n);
+int ASN1_STRING_type(ASN1_STRING *x);
+unsigned char *ASN1_STRING_data(ASN1_STRING *x);
+
+DECLARE_ASN1_FUNCTIONS(ASN1_BIT_STRING)
+int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp);
+ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a,
+ const unsigned char **pp, long length);
+int ASN1_BIT_STRING_set(ASN1_BIT_STRING *a, unsigned char *d, int length);
+int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value);
+int ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n);
+int ASN1_BIT_STRING_check(ASN1_BIT_STRING *a,
+ unsigned char *flags, int flags_len);
+
+# ifndef OPENSSL_NO_BIO
+int ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs,
+ BIT_STRING_BITNAME *tbl, int indent);
+# endif
+int ASN1_BIT_STRING_num_asc(char *name, BIT_STRING_BITNAME *tbl);
+int ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, char *name, int value,
+ BIT_STRING_BITNAME *tbl);
+
+int i2d_ASN1_BOOLEAN(int a, unsigned char **pp);
+int d2i_ASN1_BOOLEAN(int *a, const unsigned char **pp, long length);
+
+DECLARE_ASN1_FUNCTIONS(ASN1_INTEGER)
+int i2c_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp);
+ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **pp,
+ long length);
+ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp,
+ long length);
+ASN1_INTEGER *ASN1_INTEGER_dup(const ASN1_INTEGER *x);
+int ASN1_INTEGER_cmp(const ASN1_INTEGER *x, const ASN1_INTEGER *y);
+
+DECLARE_ASN1_FUNCTIONS(ASN1_ENUMERATED)
+
+int ASN1_UTCTIME_check(const ASN1_UTCTIME *a);
+ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t);
+ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t,
+ int offset_day, long offset_sec);
+int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str);
+int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t);
+# if 0
+time_t ASN1_UTCTIME_get(const ASN1_UTCTIME *s);
+# endif
+
+int ASN1_GENERALIZEDTIME_check(const ASN1_GENERALIZEDTIME *a);
+ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,
+ time_t t);
+ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s,
+ time_t t, int offset_day,
+ long offset_sec);
+int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str);
+int ASN1_TIME_diff(int *pday, int *psec,
+ const ASN1_TIME *from, const ASN1_TIME *to);
+
+DECLARE_ASN1_FUNCTIONS(ASN1_OCTET_STRING)
+ASN1_OCTET_STRING *ASN1_OCTET_STRING_dup(const ASN1_OCTET_STRING *a);
+int ASN1_OCTET_STRING_cmp(const ASN1_OCTET_STRING *a,
+ const ASN1_OCTET_STRING *b);
+int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *str, const unsigned char *data,
+ int len);
+
+DECLARE_ASN1_FUNCTIONS(ASN1_VISIBLESTRING)
+DECLARE_ASN1_FUNCTIONS(ASN1_UNIVERSALSTRING)
+DECLARE_ASN1_FUNCTIONS(ASN1_UTF8STRING)
+DECLARE_ASN1_FUNCTIONS(ASN1_NULL)
+DECLARE_ASN1_FUNCTIONS(ASN1_BMPSTRING)
+
+int UTF8_getc(const unsigned char *str, int len, unsigned long *val);
+int UTF8_putc(unsigned char *str, int len, unsigned long value);
+
+DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, ASN1_PRINTABLE)
+
+DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DIRECTORYSTRING)
+DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DISPLAYTEXT)
+DECLARE_ASN1_FUNCTIONS(ASN1_PRINTABLESTRING)
+DECLARE_ASN1_FUNCTIONS(ASN1_T61STRING)
+DECLARE_ASN1_FUNCTIONS(ASN1_IA5STRING)
+DECLARE_ASN1_FUNCTIONS(ASN1_GENERALSTRING)
+DECLARE_ASN1_FUNCTIONS(ASN1_UTCTIME)
+DECLARE_ASN1_FUNCTIONS(ASN1_GENERALIZEDTIME)
+DECLARE_ASN1_FUNCTIONS(ASN1_TIME)
+
+DECLARE_ASN1_ITEM(ASN1_OCTET_STRING_NDEF)
+
+ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t);
+ASN1_TIME *ASN1_TIME_adj(ASN1_TIME *s, time_t t,
+ int offset_day, long offset_sec);
+int ASN1_TIME_check(ASN1_TIME *t);
+ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, ASN1_GENERALIZEDTIME
+ **out);
+int ASN1_TIME_set_string(ASN1_TIME *s, const char *str);
+
+int i2d_ASN1_SET(STACK_OF(OPENSSL_BLOCK) *a, unsigned char **pp,
+ i2d_of_void *i2d, int ex_tag, int ex_class, int is_set);
+STACK_OF(OPENSSL_BLOCK) *d2i_ASN1_SET(STACK_OF(OPENSSL_BLOCK) **a,
+ const unsigned char **pp,
+ long length, d2i_of_void *d2i,
+ void (*free_func) (OPENSSL_BLOCK),
+ int ex_tag, int ex_class);
+
+# ifndef OPENSSL_NO_BIO
+int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a);
+int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size);
+int i2a_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *a);
+int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size);
+int i2a_ASN1_OBJECT(BIO *bp, ASN1_OBJECT *a);
+int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size);
+int i2a_ASN1_STRING(BIO *bp, ASN1_STRING *a, int type);
+# endif
+int i2t_ASN1_OBJECT(char *buf, int buf_len, ASN1_OBJECT *a);
+
+int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num);
+ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data, int len,
+ const char *sn, const char *ln);
+
+int ASN1_INTEGER_set(ASN1_INTEGER *a, long v);
+long ASN1_INTEGER_get(const ASN1_INTEGER *a);
+ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai);
+BIGNUM *ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai, BIGNUM *bn);
+
+int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v);
+long ASN1_ENUMERATED_get(ASN1_ENUMERATED *a);
+ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai);
+BIGNUM *ASN1_ENUMERATED_to_BN(ASN1_ENUMERATED *ai, BIGNUM *bn);
+
+/* General */
+/* given a string, return the correct type, max is the maximum length */
+int ASN1_PRINTABLE_type(const unsigned char *s, int max);
+
+int i2d_ASN1_bytes(ASN1_STRING *a, unsigned char **pp, int tag, int xclass);
+ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, const unsigned char **pp,
+ long length, int Ptag, int Pclass);
+unsigned long ASN1_tag2bit(int tag);
+/* type is one or more of the B_ASN1_ values. */
+ASN1_STRING *d2i_ASN1_type_bytes(ASN1_STRING **a, const unsigned char **pp,
+ long length, int type);
+
+/* PARSING */
+int asn1_Finish(ASN1_CTX *c);
+int asn1_const_Finish(ASN1_const_CTX *c);
+
+/* SPECIALS */
+int ASN1_get_object(const unsigned char **pp, long *plength, int *ptag,
+ int *pclass, long omax);
+int ASN1_check_infinite_end(unsigned char **p, long len);
+int ASN1_const_check_infinite_end(const unsigned char **p, long len);
+void ASN1_put_object(unsigned char **pp, int constructed, int length,
+ int tag, int xclass);
+int ASN1_put_eoc(unsigned char **pp);
+int ASN1_object_size(int constructed, int length, int tag);
+
+/* Used to implement other functions */
+void *ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, void *x);
+
+# define ASN1_dup_of(type,i2d,d2i,x) \
+ ((type*)ASN1_dup(CHECKED_I2D_OF(type, i2d), \
+ CHECKED_D2I_OF(type, d2i), \
+ CHECKED_PTR_OF(type, x)))
+
+# define ASN1_dup_of_const(type,i2d,d2i,x) \
+ ((type*)ASN1_dup(CHECKED_I2D_OF(const type, i2d), \
+ CHECKED_D2I_OF(type, d2i), \
+ CHECKED_PTR_OF(const type, x)))
+
+void *ASN1_item_dup(const ASN1_ITEM *it, void *x);
+
+/* ASN1 alloc/free macros for when a type is only used internally */
+
+# define M_ASN1_new_of(type) (type *)ASN1_item_new(ASN1_ITEM_rptr(type))
+# define M_ASN1_free_of(x, type) \
+ ASN1_item_free(CHECKED_PTR_OF(type, x), ASN1_ITEM_rptr(type))
+
+# ifndef OPENSSL_NO_FP_API
+void *ASN1_d2i_fp(void *(*xnew) (void), d2i_of_void *d2i, FILE *in, void **x);
+
+# define ASN1_d2i_fp_of(type,xnew,d2i,in,x) \
+ ((type*)ASN1_d2i_fp(CHECKED_NEW_OF(type, xnew), \
+ CHECKED_D2I_OF(type, d2i), \
+ in, \
+ CHECKED_PPTR_OF(type, x)))
+
+void *ASN1_item_d2i_fp(const ASN1_ITEM *it, FILE *in, void *x);
+int ASN1_i2d_fp(i2d_of_void *i2d, FILE *out, void *x);
+
+# define ASN1_i2d_fp_of(type,i2d,out,x) \
+ (ASN1_i2d_fp(CHECKED_I2D_OF(type, i2d), \
+ out, \
+ CHECKED_PTR_OF(type, x)))
+
+# define ASN1_i2d_fp_of_const(type,i2d,out,x) \
+ (ASN1_i2d_fp(CHECKED_I2D_OF(const type, i2d), \
+ out, \
+ CHECKED_PTR_OF(const type, x)))
+
+int ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, void *x);
+int ASN1_STRING_print_ex_fp(FILE *fp, ASN1_STRING *str, unsigned long flags);
+# endif
+
+int ASN1_STRING_to_UTF8(unsigned char **out, ASN1_STRING *in);
+
+# ifndef OPENSSL_NO_BIO
+void *ASN1_d2i_bio(void *(*xnew) (void), d2i_of_void *d2i, BIO *in, void **x);
+
+# define ASN1_d2i_bio_of(type,xnew,d2i,in,x) \
+ ((type*)ASN1_d2i_bio( CHECKED_NEW_OF(type, xnew), \
+ CHECKED_D2I_OF(type, d2i), \
+ in, \
+ CHECKED_PPTR_OF(type, x)))
+
+void *ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *x);
+int ASN1_i2d_bio(i2d_of_void *i2d, BIO *out, unsigned char *x);
+
+# define ASN1_i2d_bio_of(type,i2d,out,x) \
+ (ASN1_i2d_bio(CHECKED_I2D_OF(type, i2d), \
+ out, \
+ CHECKED_PTR_OF(type, x)))
+
+# define ASN1_i2d_bio_of_const(type,i2d,out,x) \
+ (ASN1_i2d_bio(CHECKED_I2D_OF(const type, i2d), \
+ out, \
+ CHECKED_PTR_OF(const type, x)))
+
+int ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, void *x);
+int ASN1_UTCTIME_print(BIO *fp, const ASN1_UTCTIME *a);
+int ASN1_GENERALIZEDTIME_print(BIO *fp, const ASN1_GENERALIZEDTIME *a);
+int ASN1_TIME_print(BIO *fp, const ASN1_TIME *a);
+int ASN1_STRING_print(BIO *bp, const ASN1_STRING *v);
+int ASN1_STRING_print_ex(BIO *out, ASN1_STRING *str, unsigned long flags);
+int ASN1_bn_print(BIO *bp, const char *number, const BIGNUM *num,
+ unsigned char *buf, int off);
+int ASN1_parse(BIO *bp, const unsigned char *pp, long len, int indent);
+int ASN1_parse_dump(BIO *bp, const unsigned char *pp, long len, int indent,
+ int dump);
+# endif
+const char *ASN1_tag2str(int tag);
+
+/* Used to load and write netscape format cert */
+
+DECLARE_ASN1_FUNCTIONS(NETSCAPE_X509)
+
+int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s);
+
+int ASN1_TYPE_set_octetstring(ASN1_TYPE *a, unsigned char *data, int len);
+int ASN1_TYPE_get_octetstring(ASN1_TYPE *a, unsigned char *data, int max_len);
+int ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num,
+ unsigned char *data, int len);
+int ASN1_TYPE_get_int_octetstring(ASN1_TYPE *a, long *num,
+ unsigned char *data, int max_len);
+
+STACK_OF(OPENSSL_BLOCK) *ASN1_seq_unpack(const unsigned char *buf, int len,
+ d2i_of_void *d2i,
+ void (*free_func) (OPENSSL_BLOCK));
+unsigned char *ASN1_seq_pack(STACK_OF(OPENSSL_BLOCK) *safes, i2d_of_void *i2d,
+ unsigned char **buf, int *len);
+void *ASN1_unpack_string(ASN1_STRING *oct, d2i_of_void *d2i);
+void *ASN1_item_unpack(ASN1_STRING *oct, const ASN1_ITEM *it);
+ASN1_STRING *ASN1_pack_string(void *obj, i2d_of_void *i2d,
+ ASN1_OCTET_STRING **oct);
+
+# define ASN1_pack_string_of(type,obj,i2d,oct) \
+ (ASN1_pack_string(CHECKED_PTR_OF(type, obj), \
+ CHECKED_I2D_OF(type, i2d), \
+ oct))
+
+ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it,
+ ASN1_OCTET_STRING **oct);
+
+void ASN1_STRING_set_default_mask(unsigned long mask);
+int ASN1_STRING_set_default_mask_asc(const char *p);
+unsigned long ASN1_STRING_get_default_mask(void);
+int ASN1_mbstring_copy(ASN1_STRING **out, const unsigned char *in, int len,
+ int inform, unsigned long mask);
+int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len,
+ int inform, unsigned long mask,
+ long minsize, long maxsize);
+
+ASN1_STRING *ASN1_STRING_set_by_NID(ASN1_STRING **out,
+ const unsigned char *in, int inlen,
+ int inform, int nid);
+ASN1_STRING_TABLE *ASN1_STRING_TABLE_get(int nid);
+int ASN1_STRING_TABLE_add(int, long, long, unsigned long, unsigned long);
+void ASN1_STRING_TABLE_cleanup(void);
+
+/* ASN1 template functions */
+
+/* Old API compatible functions */
+ASN1_VALUE *ASN1_item_new(const ASN1_ITEM *it);
+void ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it);
+ASN1_VALUE *ASN1_item_d2i(ASN1_VALUE **val, const unsigned char **in,
+ long len, const ASN1_ITEM *it);
+int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it);
+int ASN1_item_ndef_i2d(ASN1_VALUE *val, unsigned char **out,
+ const ASN1_ITEM *it);
+
+void ASN1_add_oid_module(void);
+
+ASN1_TYPE *ASN1_generate_nconf(char *str, CONF *nconf);
+ASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf);
+
+/* ASN1 Print flags */
+
+/* Indicate missing OPTIONAL fields */
+# define ASN1_PCTX_FLAGS_SHOW_ABSENT 0x001
+/* Mark start and end of SEQUENCE */
+# define ASN1_PCTX_FLAGS_SHOW_SEQUENCE 0x002
+/* Mark start and end of SEQUENCE/SET OF */
+# define ASN1_PCTX_FLAGS_SHOW_SSOF 0x004
+/* Show the ASN1 type of primitives */
+# define ASN1_PCTX_FLAGS_SHOW_TYPE 0x008
+/* Don't show ASN1 type of ANY */
+# define ASN1_PCTX_FLAGS_NO_ANY_TYPE 0x010
+/* Don't show ASN1 type of MSTRINGs */
+# define ASN1_PCTX_FLAGS_NO_MSTRING_TYPE 0x020
+/* Don't show field names in SEQUENCE */
+# define ASN1_PCTX_FLAGS_NO_FIELD_NAME 0x040
+/* Show structure names of each SEQUENCE field */
+# define ASN1_PCTX_FLAGS_SHOW_FIELD_STRUCT_NAME 0x080
+/* Don't show structure name even at top level */
+# define ASN1_PCTX_FLAGS_NO_STRUCT_NAME 0x100
+
+int ASN1_item_print(BIO *out, ASN1_VALUE *ifld, int indent,
+ const ASN1_ITEM *it, const ASN1_PCTX *pctx);
+ASN1_PCTX *ASN1_PCTX_new(void);
+void ASN1_PCTX_free(ASN1_PCTX *p);
+unsigned long ASN1_PCTX_get_flags(ASN1_PCTX *p);
+void ASN1_PCTX_set_flags(ASN1_PCTX *p, unsigned long flags);
+unsigned long ASN1_PCTX_get_nm_flags(ASN1_PCTX *p);
+void ASN1_PCTX_set_nm_flags(ASN1_PCTX *p, unsigned long flags);
+unsigned long ASN1_PCTX_get_cert_flags(ASN1_PCTX *p);
+void ASN1_PCTX_set_cert_flags(ASN1_PCTX *p, unsigned long flags);
+unsigned long ASN1_PCTX_get_oid_flags(ASN1_PCTX *p);
+void ASN1_PCTX_set_oid_flags(ASN1_PCTX *p, unsigned long flags);
+unsigned long ASN1_PCTX_get_str_flags(ASN1_PCTX *p);
+void ASN1_PCTX_set_str_flags(ASN1_PCTX *p, unsigned long flags);
+
+BIO_METHOD *BIO_f_asn1(void);
+
+BIO *BIO_new_NDEF(BIO *out, ASN1_VALUE *val, const ASN1_ITEM *it);
+
+int i2d_ASN1_bio_stream(BIO *out, ASN1_VALUE *val, BIO *in, int flags,
+ const ASN1_ITEM *it);
+int PEM_write_bio_ASN1_stream(BIO *out, ASN1_VALUE *val, BIO *in, int flags,
+ const char *hdr, const ASN1_ITEM *it);
+int SMIME_write_ASN1(BIO *bio, ASN1_VALUE *val, BIO *data, int flags,
+ int ctype_nid, int econt_nid,
+ STACK_OF(X509_ALGOR) *mdalgs, const ASN1_ITEM *it);
+ASN1_VALUE *SMIME_read_ASN1(BIO *bio, BIO **bcont, const ASN1_ITEM *it);
+int SMIME_crlf_copy(BIO *in, BIO *out, int flags);
+int SMIME_text(BIO *in, BIO *out);
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_ASN1_strings(void);
+
+/* Error codes for the ASN1 functions. */
+
+/* Function codes. */
+# define ASN1_F_A2D_ASN1_OBJECT 100
+# define ASN1_F_A2I_ASN1_ENUMERATED 101
+# define ASN1_F_A2I_ASN1_INTEGER 102
+# define ASN1_F_A2I_ASN1_STRING 103
+# define ASN1_F_APPEND_EXP 176
+# define ASN1_F_ASN1_BIT_STRING_SET_BIT 183
+# define ASN1_F_ASN1_CB 177
+# define ASN1_F_ASN1_CHECK_TLEN 104
+# define ASN1_F_ASN1_COLLATE_PRIMITIVE 105
+# define ASN1_F_ASN1_COLLECT 106
+# define ASN1_F_ASN1_D2I_EX_PRIMITIVE 108
+# define ASN1_F_ASN1_D2I_FP 109
+# define ASN1_F_ASN1_D2I_READ_BIO 107
+# define ASN1_F_ASN1_DIGEST 184
+# define ASN1_F_ASN1_DO_ADB 110
+# define ASN1_F_ASN1_DUP 111
+# define ASN1_F_ASN1_ENUMERATED_SET 112
+# define ASN1_F_ASN1_ENUMERATED_TO_BN 113
+# define ASN1_F_ASN1_EX_C2I 204
+# define ASN1_F_ASN1_FIND_END 190
+# define ASN1_F_ASN1_GENERALIZEDTIME_ADJ 216
+# define ASN1_F_ASN1_GENERALIZEDTIME_SET 185
+# define ASN1_F_ASN1_GENERATE_V3 178
+# define ASN1_F_ASN1_GET_OBJECT 114
+# define ASN1_F_ASN1_HEADER_NEW 115
+# define ASN1_F_ASN1_I2D_BIO 116
+# define ASN1_F_ASN1_I2D_FP 117
+# define ASN1_F_ASN1_INTEGER_SET 118
+# define ASN1_F_ASN1_INTEGER_TO_BN 119
+# define ASN1_F_ASN1_ITEM_D2I_FP 206
+# define ASN1_F_ASN1_ITEM_DUP 191
+# define ASN1_F_ASN1_ITEM_EX_COMBINE_NEW 121
+# define ASN1_F_ASN1_ITEM_EX_D2I 120
+# define ASN1_F_ASN1_ITEM_I2D_BIO 192
+# define ASN1_F_ASN1_ITEM_I2D_FP 193
+# define ASN1_F_ASN1_ITEM_PACK 198
+# define ASN1_F_ASN1_ITEM_SIGN 195
+# define ASN1_F_ASN1_ITEM_SIGN_CTX 220
+# define ASN1_F_ASN1_ITEM_UNPACK 199
+# define ASN1_F_ASN1_ITEM_VERIFY 197
+# define ASN1_F_ASN1_MBSTRING_NCOPY 122
+# define ASN1_F_ASN1_OBJECT_NEW 123
+# define ASN1_F_ASN1_OUTPUT_DATA 214
+# define ASN1_F_ASN1_PACK_STRING 124
+# define ASN1_F_ASN1_PCTX_NEW 205
+# define ASN1_F_ASN1_PKCS5_PBE_SET 125
+# define ASN1_F_ASN1_SEQ_PACK 126
+# define ASN1_F_ASN1_SEQ_UNPACK 127
+# define ASN1_F_ASN1_SIGN 128
+# define ASN1_F_ASN1_STR2TYPE 179
+# define ASN1_F_ASN1_STRING_SET 186
+# define ASN1_F_ASN1_STRING_TABLE_ADD 129
+# define ASN1_F_ASN1_STRING_TYPE_NEW 130
+# define ASN1_F_ASN1_TEMPLATE_EX_D2I 132
+# define ASN1_F_ASN1_TEMPLATE_NEW 133
+# define ASN1_F_ASN1_TEMPLATE_NOEXP_D2I 131
+# define ASN1_F_ASN1_TIME_ADJ 217
+# define ASN1_F_ASN1_TIME_SET 175
+# define ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING 134
+# define ASN1_F_ASN1_TYPE_GET_OCTETSTRING 135
+# define ASN1_F_ASN1_UNPACK_STRING 136
+# define ASN1_F_ASN1_UTCTIME_ADJ 218
+# define ASN1_F_ASN1_UTCTIME_SET 187
+# define ASN1_F_ASN1_VERIFY 137
+# define ASN1_F_B64_READ_ASN1 209
+# define ASN1_F_B64_WRITE_ASN1 210
+# define ASN1_F_BIO_NEW_NDEF 208
+# define ASN1_F_BITSTR_CB 180
+# define ASN1_F_BN_TO_ASN1_ENUMERATED 138
+# define ASN1_F_BN_TO_ASN1_INTEGER 139
+# define ASN1_F_C2I_ASN1_BIT_STRING 189
+# define ASN1_F_C2I_ASN1_INTEGER 194
+# define ASN1_F_C2I_ASN1_OBJECT 196
+# define ASN1_F_COLLECT_DATA 140
+# define ASN1_F_D2I_ASN1_BIT_STRING 141
+# define ASN1_F_D2I_ASN1_BOOLEAN 142
+# define ASN1_F_D2I_ASN1_BYTES 143
+# define ASN1_F_D2I_ASN1_GENERALIZEDTIME 144
+# define ASN1_F_D2I_ASN1_HEADER 145
+# define ASN1_F_D2I_ASN1_INTEGER 146
+# define ASN1_F_D2I_ASN1_OBJECT 147
+# define ASN1_F_D2I_ASN1_SET 148
+# define ASN1_F_D2I_ASN1_TYPE_BYTES 149
+# define ASN1_F_D2I_ASN1_UINTEGER 150
+# define ASN1_F_D2I_ASN1_UTCTIME 151
+# define ASN1_F_D2I_AUTOPRIVATEKEY 207
+# define ASN1_F_D2I_NETSCAPE_RSA 152
+# define ASN1_F_D2I_NETSCAPE_RSA_2 153
+# define ASN1_F_D2I_PRIVATEKEY 154
+# define ASN1_F_D2I_PUBLICKEY 155
+# define ASN1_F_D2I_RSA_NET 200
+# define ASN1_F_D2I_RSA_NET_2 201
+# define ASN1_F_D2I_X509 156
+# define ASN1_F_D2I_X509_CINF 157
+# define ASN1_F_D2I_X509_PKEY 159
+# define ASN1_F_I2D_ASN1_BIO_STREAM 211
+# define ASN1_F_I2D_ASN1_SET 188
+# define ASN1_F_I2D_ASN1_TIME 160
+# define ASN1_F_I2D_DSA_PUBKEY 161
+# define ASN1_F_I2D_EC_PUBKEY 181
+# define ASN1_F_I2D_PRIVATEKEY 163
+# define ASN1_F_I2D_PUBLICKEY 164
+# define ASN1_F_I2D_RSA_NET 162
+# define ASN1_F_I2D_RSA_PUBKEY 165
+# define ASN1_F_LONG_C2I 166
+# define ASN1_F_OID_MODULE_INIT 174
+# define ASN1_F_PARSE_TAGGING 182
+# define ASN1_F_PKCS5_PBE2_SET_IV 167
+# define ASN1_F_PKCS5_PBE_SET 202
+# define ASN1_F_PKCS5_PBE_SET0_ALGOR 215
+# define ASN1_F_PKCS5_PBKDF2_SET 219
+# define ASN1_F_SMIME_READ_ASN1 212
+# define ASN1_F_SMIME_TEXT 213
+# define ASN1_F_X509_CINF_NEW 168
+# define ASN1_F_X509_CRL_ADD0_REVOKED 169
+# define ASN1_F_X509_INFO_NEW 170
+# define ASN1_F_X509_NAME_ENCODE 203
+# define ASN1_F_X509_NAME_EX_D2I 158
+# define ASN1_F_X509_NAME_EX_NEW 171
+# define ASN1_F_X509_NEW 172
+# define ASN1_F_X509_PKEY_NEW 173
+
+/* Reason codes. */
+# define ASN1_R_ADDING_OBJECT 171
+# define ASN1_R_ASN1_PARSE_ERROR 203
+# define ASN1_R_ASN1_SIG_PARSE_ERROR 204
+# define ASN1_R_AUX_ERROR 100
+# define ASN1_R_BAD_CLASS 101
+# define ASN1_R_BAD_OBJECT_HEADER 102
+# define ASN1_R_BAD_PASSWORD_READ 103
+# define ASN1_R_BAD_TAG 104
+# define ASN1_R_BMPSTRING_IS_WRONG_LENGTH 214
+# define ASN1_R_BN_LIB 105
+# define ASN1_R_BOOLEAN_IS_WRONG_LENGTH 106
+# define ASN1_R_BUFFER_TOO_SMALL 107
+# define ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER 108
+# define ASN1_R_CONTEXT_NOT_INITIALISED 217
+# define ASN1_R_DATA_IS_WRONG 109
+# define ASN1_R_DECODE_ERROR 110
+# define ASN1_R_DECODING_ERROR 111
+# define ASN1_R_DEPTH_EXCEEDED 174
+# define ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED 198
+# define ASN1_R_ENCODE_ERROR 112
+# define ASN1_R_ERROR_GETTING_TIME 173
+# define ASN1_R_ERROR_LOADING_SECTION 172
+# define ASN1_R_ERROR_PARSING_SET_ELEMENT 113
+# define ASN1_R_ERROR_SETTING_CIPHER_PARAMS 114
+# define ASN1_R_EXPECTING_AN_INTEGER 115
+# define ASN1_R_EXPECTING_AN_OBJECT 116
+# define ASN1_R_EXPECTING_A_BOOLEAN 117
+# define ASN1_R_EXPECTING_A_TIME 118
+# define ASN1_R_EXPLICIT_LENGTH_MISMATCH 119
+# define ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED 120
+# define ASN1_R_FIELD_MISSING 121
+# define ASN1_R_FIRST_NUM_TOO_LARGE 122
+# define ASN1_R_HEADER_TOO_LONG 123
+# define ASN1_R_ILLEGAL_BITSTRING_FORMAT 175
+# define ASN1_R_ILLEGAL_BOOLEAN 176
+# define ASN1_R_ILLEGAL_CHARACTERS 124
+# define ASN1_R_ILLEGAL_FORMAT 177
+# define ASN1_R_ILLEGAL_HEX 178
+# define ASN1_R_ILLEGAL_IMPLICIT_TAG 179
+# define ASN1_R_ILLEGAL_INTEGER 180
+# define ASN1_R_ILLEGAL_NESTED_TAGGING 181
+# define ASN1_R_ILLEGAL_NULL 125
+# define ASN1_R_ILLEGAL_NULL_VALUE 182
+# define ASN1_R_ILLEGAL_OBJECT 183
+# define ASN1_R_ILLEGAL_OPTIONAL_ANY 126
+# define ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE 170
+# define ASN1_R_ILLEGAL_TAGGED_ANY 127
+# define ASN1_R_ILLEGAL_TIME_VALUE 184
+# define ASN1_R_INTEGER_NOT_ASCII_FORMAT 185
+# define ASN1_R_INTEGER_TOO_LARGE_FOR_LONG 128
+# define ASN1_R_INVALID_BIT_STRING_BITS_LEFT 220
+# define ASN1_R_INVALID_BMPSTRING_LENGTH 129
+# define ASN1_R_INVALID_DIGIT 130
+# define ASN1_R_INVALID_MIME_TYPE 205
+# define ASN1_R_INVALID_MODIFIER 186
+# define ASN1_R_INVALID_NUMBER 187
+# define ASN1_R_INVALID_OBJECT_ENCODING 216
+# define ASN1_R_INVALID_SEPARATOR 131
+# define ASN1_R_INVALID_TIME_FORMAT 132
+# define ASN1_R_INVALID_UNIVERSALSTRING_LENGTH 133
+# define ASN1_R_INVALID_UTF8STRING 134
+# define ASN1_R_IV_TOO_LARGE 135
+# define ASN1_R_LENGTH_ERROR 136
+# define ASN1_R_LIST_ERROR 188
+# define ASN1_R_MIME_NO_CONTENT_TYPE 206
+# define ASN1_R_MIME_PARSE_ERROR 207
+# define ASN1_R_MIME_SIG_PARSE_ERROR 208
+# define ASN1_R_MISSING_EOC 137
+# define ASN1_R_MISSING_SECOND_NUMBER 138
+# define ASN1_R_MISSING_VALUE 189
+# define ASN1_R_MSTRING_NOT_UNIVERSAL 139
+# define ASN1_R_MSTRING_WRONG_TAG 140
+# define ASN1_R_NESTED_ASN1_STRING 197
+# define ASN1_R_NON_HEX_CHARACTERS 141
+# define ASN1_R_NOT_ASCII_FORMAT 190
+# define ASN1_R_NOT_ENOUGH_DATA 142
+# define ASN1_R_NO_CONTENT_TYPE 209
+# define ASN1_R_NO_DEFAULT_DIGEST 201
+# define ASN1_R_NO_MATCHING_CHOICE_TYPE 143
+# define ASN1_R_NO_MULTIPART_BODY_FAILURE 210
+# define ASN1_R_NO_MULTIPART_BOUNDARY 211
+# define ASN1_R_NO_SIG_CONTENT_TYPE 212
+# define ASN1_R_NULL_IS_WRONG_LENGTH 144
+# define ASN1_R_OBJECT_NOT_ASCII_FORMAT 191
+# define ASN1_R_ODD_NUMBER_OF_CHARS 145
+# define ASN1_R_PRIVATE_KEY_HEADER_MISSING 146
+# define ASN1_R_SECOND_NUMBER_TOO_LARGE 147
+# define ASN1_R_SEQUENCE_LENGTH_MISMATCH 148
+# define ASN1_R_SEQUENCE_NOT_CONSTRUCTED 149
+# define ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG 192
+# define ASN1_R_SHORT_LINE 150
+# define ASN1_R_SIG_INVALID_MIME_TYPE 213
+# define ASN1_R_STREAMING_NOT_SUPPORTED 202
+# define ASN1_R_STRING_TOO_LONG 151
+# define ASN1_R_STRING_TOO_SHORT 152
+# define ASN1_R_TAG_VALUE_TOO_HIGH 153
+# define ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 154
+# define ASN1_R_TIME_NOT_ASCII_FORMAT 193
+# define ASN1_R_TOO_LONG 155
+# define ASN1_R_TYPE_NOT_CONSTRUCTED 156
+# define ASN1_R_TYPE_NOT_PRIMITIVE 218
+# define ASN1_R_UNABLE_TO_DECODE_RSA_KEY 157
+# define ASN1_R_UNABLE_TO_DECODE_RSA_PRIVATE_KEY 158
+# define ASN1_R_UNEXPECTED_EOC 159
+# define ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH 215
+# define ASN1_R_UNKNOWN_FORMAT 160
+# define ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM 161
+# define ASN1_R_UNKNOWN_OBJECT_TYPE 162
+# define ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE 163
+# define ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM 199
+# define ASN1_R_UNKNOWN_TAG 194
+# define ASN1_R_UNKOWN_FORMAT 195
+# define ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE 164
+# define ASN1_R_UNSUPPORTED_CIPHER 165
+# define ASN1_R_UNSUPPORTED_ENCRYPTION_ALGORITHM 166
+# define ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE 167
+# define ASN1_R_UNSUPPORTED_TYPE 196
+# define ASN1_R_WRONG_PUBLIC_KEY_TYPE 200
+# define ASN1_R_WRONG_TAG 168
+# define ASN1_R_WRONG_TYPE 169
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/deps/openssl/openssl/include/openssl/asn1_mac.h b/deps/openssl/openssl/include/openssl/asn1_mac.h
index 214787c4774..abc6dc35ca4 100644
--- a/deps/openssl/openssl/include/openssl/asn1_mac.h
+++ b/deps/openssl/openssl/include/openssl/asn1_mac.h
@@ -1 +1,579 @@
-#include "../../crypto/asn1/asn1_mac.h"
+/* crypto/asn1/asn1_mac.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_ASN1_MAC_H
+# define HEADER_ASN1_MAC_H
+
+# include <openssl/asn1.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# ifndef ASN1_MAC_ERR_LIB
+# define ASN1_MAC_ERR_LIB ERR_LIB_ASN1
+# endif
+
+# define ASN1_MAC_H_err(f,r,line) \
+ ERR_PUT_error(ASN1_MAC_ERR_LIB,(f),(r),__FILE__,(line))
+
+# define M_ASN1_D2I_vars(a,type,func) \
+ ASN1_const_CTX c; \
+ type ret=NULL; \
+ \
+ c.pp=(const unsigned char **)pp; \
+ c.q= *(const unsigned char **)pp; \
+ c.error=ERR_R_NESTED_ASN1_ERROR; \
+ if ((a == NULL) || ((*a) == NULL)) \
+ { if ((ret=(type)func()) == NULL) \
+ { c.line=__LINE__; goto err; } } \
+ else ret=(*a);
+
+# define M_ASN1_D2I_Init() \
+ c.p= *(const unsigned char **)pp; \
+ c.max=(length == 0)?0:(c.p+length);
+
+# define M_ASN1_D2I_Finish_2(a) \
+ if (!asn1_const_Finish(&c)) \
+ { c.line=__LINE__; goto err; } \
+ *(const unsigned char **)pp=c.p; \
+ if (a != NULL) (*a)=ret; \
+ return(ret);
+
+# define M_ASN1_D2I_Finish(a,func,e) \
+ M_ASN1_D2I_Finish_2(a); \
+err:\
+ ASN1_MAC_H_err((e),c.error,c.line); \
+ asn1_add_error(*(const unsigned char **)pp,(int)(c.q- *pp)); \
+ if ((ret != NULL) && ((a == NULL) || (*a != ret))) func(ret); \
+ return(NULL)
+
+# define M_ASN1_D2I_start_sequence() \
+ if (!asn1_GetSequence(&c,&length)) \
+ { c.line=__LINE__; goto err; }
+/* Begin reading ASN1 without a surrounding sequence */
+# define M_ASN1_D2I_begin() \
+ c.slen = length;
+
+/* End reading ASN1 with no check on length */
+# define M_ASN1_D2I_Finish_nolen(a, func, e) \
+ *pp=c.p; \
+ if (a != NULL) (*a)=ret; \
+ return(ret); \
+err:\
+ ASN1_MAC_H_err((e),c.error,c.line); \
+ asn1_add_error(*pp,(int)(c.q- *pp)); \
+ if ((ret != NULL) && ((a == NULL) || (*a != ret))) func(ret); \
+ return(NULL)
+
+# define M_ASN1_D2I_end_sequence() \
+ (((c.inf&1) == 0)?(c.slen <= 0): \
+ (c.eos=ASN1_const_check_infinite_end(&c.p,c.slen)))
+
+/* Don't use this with d2i_ASN1_BOOLEAN() */
+# define M_ASN1_D2I_get(b, func) \
+ c.q=c.p; \
+ if (func(&(b),&c.p,c.slen) == NULL) \
+ {c.line=__LINE__; goto err; } \
+ c.slen-=(c.p-c.q);
+
+/* Don't use this with d2i_ASN1_BOOLEAN() */
+# define M_ASN1_D2I_get_x(type,b,func) \
+ c.q=c.p; \
+ if (((D2I_OF(type))func)(&(b),&c.p,c.slen) == NULL) \
+ {c.line=__LINE__; goto err; } \
+ c.slen-=(c.p-c.q);
+
+/* use this instead () */
+# define M_ASN1_D2I_get_int(b,func) \
+ c.q=c.p; \
+ if (func(&(b),&c.p,c.slen) < 0) \
+ {c.line=__LINE__; goto err; } \
+ c.slen-=(c.p-c.q);
+
+# define M_ASN1_D2I_get_opt(b,func,type) \
+ if ((c.slen != 0) && ((M_ASN1_next & (~V_ASN1_CONSTRUCTED)) \
+ == (V_ASN1_UNIVERSAL|(type)))) \
+ { \
+ M_ASN1_D2I_get(b,func); \
+ }
+
+# define M_ASN1_D2I_get_int_opt(b,func,type) \
+ if ((c.slen != 0) && ((M_ASN1_next & (~V_ASN1_CONSTRUCTED)) \
+ == (V_ASN1_UNIVERSAL|(type)))) \
+ { \
+ M_ASN1_D2I_get_int(b,func); \
+ }
+
+# define M_ASN1_D2I_get_imp(b,func, type) \
+ M_ASN1_next=(_tmp& V_ASN1_CONSTRUCTED)|type; \
+ c.q=c.p; \
+ if (func(&(b),&c.p,c.slen) == NULL) \
+ {c.line=__LINE__; M_ASN1_next_prev = _tmp; goto err; } \
+ c.slen-=(c.p-c.q);\
+ M_ASN1_next_prev=_tmp;
+
+# define M_ASN1_D2I_get_IMP_opt(b,func,tag,type) \
+ if ((c.slen != 0) && ((M_ASN1_next & (~V_ASN1_CONSTRUCTED)) == \
+ (V_ASN1_CONTEXT_SPECIFIC|(tag)))) \
+ { \
+ unsigned char _tmp = M_ASN1_next; \
+ M_ASN1_D2I_get_imp(b,func, type);\
+ }
+
+# define M_ASN1_D2I_get_set(r,func,free_func) \
+ M_ASN1_D2I_get_imp_set(r,func,free_func, \
+ V_ASN1_SET,V_ASN1_UNIVERSAL);
+
+# define M_ASN1_D2I_get_set_type(type,r,func,free_func) \
+ M_ASN1_D2I_get_imp_set_type(type,r,func,free_func, \
+ V_ASN1_SET,V_ASN1_UNIVERSAL);
+
+# define M_ASN1_D2I_get_set_opt(r,func,free_func) \
+ if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \
+ V_ASN1_CONSTRUCTED|V_ASN1_SET)))\
+ { M_ASN1_D2I_get_set(r,func,free_func); }
+
+# define M_ASN1_D2I_get_set_opt_type(type,r,func,free_func) \
+ if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \
+ V_ASN1_CONSTRUCTED|V_ASN1_SET)))\
+ { M_ASN1_D2I_get_set_type(type,r,func,free_func); }
+
+# define M_ASN1_I2D_len_SET_opt(a,f) \
+ if ((a != NULL) && (sk_num(a) != 0)) \
+ M_ASN1_I2D_len_SET(a,f);
+
+# define M_ASN1_I2D_put_SET_opt(a,f) \
+ if ((a != NULL) && (sk_num(a) != 0)) \
+ M_ASN1_I2D_put_SET(a,f);
+
+# define M_ASN1_I2D_put_SEQUENCE_opt(a,f) \
+ if ((a != NULL) && (sk_num(a) != 0)) \
+ M_ASN1_I2D_put_SEQUENCE(a,f);
+
+# define M_ASN1_I2D_put_SEQUENCE_opt_type(type,a,f) \
+ if ((a != NULL) && (sk_##type##_num(a) != 0)) \
+ M_ASN1_I2D_put_SEQUENCE_type(type,a,f);
+
+# define M_ASN1_D2I_get_IMP_set_opt(b,func,free_func,tag) \
+ if ((c.slen != 0) && \
+ (M_ASN1_next == \
+ (V_ASN1_CONTEXT_SPECIFIC|V_ASN1_CONSTRUCTED|(tag))))\
+ { \
+ M_ASN1_D2I_get_imp_set(b,func,free_func,\
+ tag,V_ASN1_CONTEXT_SPECIFIC); \
+ }
+
+# define M_ASN1_D2I_get_IMP_set_opt_type(type,b,func,free_func,tag) \
+ if ((c.slen != 0) && \
+ (M_ASN1_next == \
+ (V_ASN1_CONTEXT_SPECIFIC|V_ASN1_CONSTRUCTED|(tag))))\
+ { \
+ M_ASN1_D2I_get_imp_set_type(type,b,func,free_func,\
+ tag,V_ASN1_CONTEXT_SPECIFIC); \
+ }
+
+# define M_ASN1_D2I_get_seq(r,func,free_func) \
+ M_ASN1_D2I_get_imp_set(r,func,free_func,\
+ V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL);
+
+# define M_ASN1_D2I_get_seq_type(type,r,func,free_func) \
+ M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,\
+ V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL)
+
+# define M_ASN1_D2I_get_seq_opt(r,func,free_func) \
+ if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \
+ V_ASN1_CONSTRUCTED|V_ASN1_SEQUENCE)))\
+ { M_ASN1_D2I_get_seq(r,func,free_func); }
+
+# define M_ASN1_D2I_get_seq_opt_type(type,r,func,free_func) \
+ if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \
+ V_ASN1_CONSTRUCTED|V_ASN1_SEQUENCE)))\
+ { M_ASN1_D2I_get_seq_type(type,r,func,free_func); }
+
+# define M_ASN1_D2I_get_IMP_set(r,func,free_func,x) \
+ M_ASN1_D2I_get_imp_set(r,func,free_func,\
+ x,V_ASN1_CONTEXT_SPECIFIC);
+
+# define M_ASN1_D2I_get_IMP_set_type(type,r,func,free_func,x) \
+ M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,\
+ x,V_ASN1_CONTEXT_SPECIFIC);
+
+# define M_ASN1_D2I_get_imp_set(r,func,free_func,a,b) \
+ c.q=c.p; \
+ if (d2i_ASN1_SET(&(r),&c.p,c.slen,(char *(*)())func,\
+ (void (*)())free_func,a,b) == NULL) \
+ { c.line=__LINE__; goto err; } \
+ c.slen-=(c.p-c.q);
+
+# define M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,a,b) \
+ c.q=c.p; \
+ if (d2i_ASN1_SET_OF_##type(&(r),&c.p,c.slen,func,\
+ free_func,a,b) == NULL) \
+ { c.line=__LINE__; goto err; } \
+ c.slen-=(c.p-c.q);
+
+# define M_ASN1_D2I_get_set_strings(r,func,a,b) \
+ c.q=c.p; \
+ if (d2i_ASN1_STRING_SET(&(r),&c.p,c.slen,a,b) == NULL) \
+ { c.line=__LINE__; goto err; } \
+ c.slen-=(c.p-c.q);
+
+# define M_ASN1_D2I_get_EXP_opt(r,func,tag) \
+ if ((c.slen != 0L) && (M_ASN1_next == \
+ (V_ASN1_CONSTRUCTED|V_ASN1_CONTEXT_SPECIFIC|tag))) \
+ { \
+ int Tinf,Ttag,Tclass; \
+ long Tlen; \
+ \
+ c.q=c.p; \
+ Tinf=ASN1_get_object(&c.p,&Tlen,&Ttag,&Tclass,c.slen); \
+ if (Tinf & 0x80) \
+ { c.error=ERR_R_BAD_ASN1_OBJECT_HEADER; \
+ c.line=__LINE__; goto err; } \
+ if (Tinf == (V_ASN1_CONSTRUCTED+1)) \
+ Tlen = c.slen - (c.p - c.q) - 2; \
+ if (func(&(r),&c.p,Tlen) == NULL) \
+ { c.line=__LINE__; goto err; } \
+ if (Tinf == (V_ASN1_CONSTRUCTED+1)) { \
+ Tlen = c.slen - (c.p - c.q); \
+ if(!ASN1_const_check_infinite_end(&c.p, Tlen)) \
+ { c.error=ERR_R_MISSING_ASN1_EOS; \
+ c.line=__LINE__; goto err; } \
+ }\
+ c.slen-=(c.p-c.q); \
+ }
+
+# define M_ASN1_D2I_get_EXP_set_opt(r,func,free_func,tag,b) \
+ if ((c.slen != 0) && (M_ASN1_next == \
+ (V_ASN1_CONSTRUCTED|V_ASN1_CONTEXT_SPECIFIC|tag))) \
+ { \
+ int Tinf,Ttag,Tclass; \
+ long Tlen; \
+ \
+ c.q=c.p; \
+ Tinf=ASN1_get_object(&c.p,&Tlen,&Ttag,&Tclass,c.slen); \
+ if (Tinf & 0x80) \
+ { c.error=ERR_R_BAD_ASN1_OBJECT_HEADER; \
+ c.line=__LINE__; goto err; } \
+ if (Tinf == (V_ASN1_CONSTRUCTED+1)) \
+ Tlen = c.slen - (c.p - c.q) - 2; \
+ if (d2i_ASN1_SET(&(r),&c.p,Tlen,(char *(*)())func, \
+ (void (*)())free_func, \
+ b,V_ASN1_UNIVERSAL) == NULL) \
+ { c.line=__LINE__; goto err; } \
+ if (Tinf == (V_ASN1_CONSTRUCTED+1)) { \
+ Tlen = c.slen - (c.p - c.q); \
+ if(!ASN1_check_infinite_end(&c.p, Tlen)) \
+ { c.error=ERR_R_MISSING_ASN1_EOS; \
+ c.line=__LINE__; goto err; } \
+ }\
+ c.slen-=(c.p-c.q); \
+ }
+
+# define M_ASN1_D2I_get_EXP_set_opt_type(type,r,func,free_func,tag,b) \
+ if ((c.slen != 0) && (M_ASN1_next == \
+ (V_ASN1_CONSTRUCTED|V_ASN1_CONTEXT_SPECIFIC|tag))) \
+ { \
+ int Tinf,Ttag,Tclass; \
+ long Tlen; \
+ \
+ c.q=c.p; \
+ Tinf=ASN1_get_object(&c.p,&Tlen,&Ttag,&Tclass,c.slen); \
+ if (Tinf & 0x80) \
+ { c.error=ERR_R_BAD_ASN1_OBJECT_HEADER; \
+ c.line=__LINE__; goto err; } \
+ if (Tinf == (V_ASN1_CONSTRUCTED+1)) \
+ Tlen = c.slen - (c.p - c.q) - 2; \
+ if (d2i_ASN1_SET_OF_##type(&(r),&c.p,Tlen,func, \
+ free_func,b,V_ASN1_UNIVERSAL) == NULL) \
+ { c.line=__LINE__; goto err; } \
+ if (Tinf == (V_ASN1_CONSTRUCTED+1)) { \
+ Tlen = c.slen - (c.p - c.q); \
+ if(!ASN1_check_infinite_end(&c.p, Tlen)) \
+ { c.error=ERR_R_MISSING_ASN1_EOS; \
+ c.line=__LINE__; goto err; } \
+ }\
+ c.slen-=(c.p-c.q); \
+ }
+
+/* New macros */
+# define M_ASN1_New_Malloc(ret,type) \
+ if ((ret=(type *)OPENSSL_malloc(sizeof(type))) == NULL) \
+ { c.line=__LINE__; goto err2; }
+
+# define M_ASN1_New(arg,func) \
+ if (((arg)=func()) == NULL) return(NULL)
+
+# define M_ASN1_New_Error(a) \
+/*- err: ASN1_MAC_H_err((a),ERR_R_NESTED_ASN1_ERROR,c.line); \
+ return(NULL);*/ \
+ err2: ASN1_MAC_H_err((a),ERR_R_MALLOC_FAILURE,c.line); \
+ return(NULL)
+
+/*
+ * BIG UGLY WARNING! This is so damn ugly I wanna puke. Unfortunately, some
+ * macros that use ASN1_const_CTX still insist on writing in the input
+ * stream. ARGH! ARGH! ARGH! Let's get rid of this macro package. Please? --
+ * Richard Levitte
+ */
+# define M_ASN1_next (*((unsigned char *)(c.p)))
+# define M_ASN1_next_prev (*((unsigned char *)(c.q)))
+
+/*************************************************/
+
+# define M_ASN1_I2D_vars(a) int r=0,ret=0; \
+ unsigned char *p; \
+ if (a == NULL) return(0)
+
+/* Length Macros */
+# define M_ASN1_I2D_len(a,f) ret+=f(a,NULL)
+# define M_ASN1_I2D_len_IMP_opt(a,f) if (a != NULL) M_ASN1_I2D_len(a,f)
+
+# define M_ASN1_I2D_len_SET(a,f) \
+ ret+=i2d_ASN1_SET(a,NULL,f,V_ASN1_SET,V_ASN1_UNIVERSAL,IS_SET);
+
+# define M_ASN1_I2D_len_SET_type(type,a,f) \
+ ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,V_ASN1_SET, \
+ V_ASN1_UNIVERSAL,IS_SET);
+
+# define M_ASN1_I2D_len_SEQUENCE(a,f) \
+ ret+=i2d_ASN1_SET(a,NULL,f,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL, \
+ IS_SEQUENCE);
+
+# define M_ASN1_I2D_len_SEQUENCE_type(type,a,f) \
+ ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,V_ASN1_SEQUENCE, \
+ V_ASN1_UNIVERSAL,IS_SEQUENCE)
+
+# define M_ASN1_I2D_len_SEQUENCE_opt(a,f) \
+ if ((a != NULL) && (sk_num(a) != 0)) \
+ M_ASN1_I2D_len_SEQUENCE(a,f);
+
+# define M_ASN1_I2D_len_SEQUENCE_opt_type(type,a,f) \
+ if ((a != NULL) && (sk_##type##_num(a) != 0)) \
+ M_ASN1_I2D_len_SEQUENCE_type(type,a,f);
+
+# define M_ASN1_I2D_len_IMP_SET(a,f,x) \
+ ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC,IS_SET);
+
+# define M_ASN1_I2D_len_IMP_SET_type(type,a,f,x) \
+ ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,x, \
+ V_ASN1_CONTEXT_SPECIFIC,IS_SET);
+
+# define M_ASN1_I2D_len_IMP_SET_opt(a,f,x) \
+ if ((a != NULL) && (sk_num(a) != 0)) \
+ ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC, \
+ IS_SET);
+
+# define M_ASN1_I2D_len_IMP_SET_opt_type(type,a,f,x) \
+ if ((a != NULL) && (sk_##type##_num(a) != 0)) \
+ ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,x, \
+ V_ASN1_CONTEXT_SPECIFIC,IS_SET);
+
+# define M_ASN1_I2D_len_IMP_SEQUENCE(a,f,x) \
+ ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC, \
+ IS_SEQUENCE);
+
+# define M_ASN1_I2D_len_IMP_SEQUENCE_opt(a,f,x) \
+ if ((a != NULL) && (sk_num(a) != 0)) \
+ ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC, \
+ IS_SEQUENCE);
+
+# define M_ASN1_I2D_len_IMP_SEQUENCE_opt_type(type,a,f,x) \
+ if ((a != NULL) && (sk_##type##_num(a) != 0)) \
+ ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,x, \
+ V_ASN1_CONTEXT_SPECIFIC, \
+ IS_SEQUENCE);
+
+# define M_ASN1_I2D_len_EXP_opt(a,f,mtag,v) \
+ if (a != NULL)\
+ { \
+ v=f(a,NULL); \
+ ret+=ASN1_object_size(1,v,mtag); \
+ }
+
+# define M_ASN1_I2D_len_EXP_SET_opt(a,f,mtag,tag,v) \
+ if ((a != NULL) && (sk_num(a) != 0))\
+ { \
+ v=i2d_ASN1_SET(a,NULL,f,tag,V_ASN1_UNIVERSAL,IS_SET); \
+ ret+=ASN1_object_size(1,v,mtag); \
+ }
+
+# define M_ASN1_I2D_len_EXP_SEQUENCE_opt(a,f,mtag,tag,v) \
+ if ((a != NULL) && (sk_num(a) != 0))\
+ { \
+ v=i2d_ASN1_SET(a,NULL,f,tag,V_ASN1_UNIVERSAL, \
+ IS_SEQUENCE); \
+ ret+=ASN1_object_size(1,v,mtag); \
+ }
+
+# define M_ASN1_I2D_len_EXP_SEQUENCE_opt_type(type,a,f,mtag,tag,v) \
+ if ((a != NULL) && (sk_##type##_num(a) != 0))\
+ { \
+ v=i2d_ASN1_SET_OF_##type(a,NULL,f,tag, \
+ V_ASN1_UNIVERSAL, \
+ IS_SEQUENCE); \
+ ret+=ASN1_object_size(1,v,mtag); \
+ }
+
+/* Put Macros */
+# define M_ASN1_I2D_put(a,f) f(a,&p)
+
+# define M_ASN1_I2D_put_IMP_opt(a,f,t) \
+ if (a != NULL) \
+ { \
+ unsigned char *q=p; \
+ f(a,&p); \
+ *q=(V_ASN1_CONTEXT_SPECIFIC|t|(*q&V_ASN1_CONSTRUCTED));\
+ }
+
+# define M_ASN1_I2D_put_SET(a,f) i2d_ASN1_SET(a,&p,f,V_ASN1_SET,\
+ V_ASN1_UNIVERSAL,IS_SET)
+# define M_ASN1_I2D_put_SET_type(type,a,f) \
+ i2d_ASN1_SET_OF_##type(a,&p,f,V_ASN1_SET,V_ASN1_UNIVERSAL,IS_SET)
+# define M_ASN1_I2D_put_IMP_SET(a,f,x) i2d_ASN1_SET(a,&p,f,x,\
+ V_ASN1_CONTEXT_SPECIFIC,IS_SET)
+# define M_ASN1_I2D_put_IMP_SET_type(type,a,f,x) \
+ i2d_ASN1_SET_OF_##type(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC,IS_SET)
+# define M_ASN1_I2D_put_IMP_SEQUENCE(a,f,x) i2d_ASN1_SET(a,&p,f,x,\
+ V_ASN1_CONTEXT_SPECIFIC,IS_SEQUENCE)
+
+# define M_ASN1_I2D_put_SEQUENCE(a,f) i2d_ASN1_SET(a,&p,f,V_ASN1_SEQUENCE,\
+ V_ASN1_UNIVERSAL,IS_SEQUENCE)
+
+# define M_ASN1_I2D_put_SEQUENCE_type(type,a,f) \
+ i2d_ASN1_SET_OF_##type(a,&p,f,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL, \
+ IS_SEQUENCE)
+
+# define M_ASN1_I2D_put_SEQUENCE_opt(a,f) \
+ if ((a != NULL) && (sk_num(a) != 0)) \
+ M_ASN1_I2D_put_SEQUENCE(a,f);
+
+# define M_ASN1_I2D_put_IMP_SET_opt(a,f,x) \
+ if ((a != NULL) && (sk_num(a) != 0)) \
+ { i2d_ASN1_SET(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC, \
+ IS_SET); }
+
+# define M_ASN1_I2D_put_IMP_SET_opt_type(type,a,f,x) \
+ if ((a != NULL) && (sk_##type##_num(a) != 0)) \
+ { i2d_ASN1_SET_OF_##type(a,&p,f,x, \
+ V_ASN1_CONTEXT_SPECIFIC, \
+ IS_SET); }
+
+# define M_ASN1_I2D_put_IMP_SEQUENCE_opt(a,f,x) \
+ if ((a != NULL) && (sk_num(a) != 0)) \
+ { i2d_ASN1_SET(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC, \
+ IS_SEQUENCE); }
+
+# define M_ASN1_I2D_put_IMP_SEQUENCE_opt_type(type,a,f,x) \
+ if ((a != NULL) && (sk_##type##_num(a) != 0)) \
+ { i2d_ASN1_SET_OF_##type(a,&p,f,x, \
+ V_ASN1_CONTEXT_SPECIFIC, \
+ IS_SEQUENCE); }
+
+# define M_ASN1_I2D_put_EXP_opt(a,f,tag,v) \
+ if (a != NULL) \
+ { \
+ ASN1_put_object(&p,1,v,tag,V_ASN1_CONTEXT_SPECIFIC); \
+ f(a,&p); \
+ }
+
+# define M_ASN1_I2D_put_EXP_SET_opt(a,f,mtag,tag,v) \
+ if ((a != NULL) && (sk_num(a) != 0)) \
+ { \
+ ASN1_put_object(&p,1,v,mtag,V_ASN1_CONTEXT_SPECIFIC); \
+ i2d_ASN1_SET(a,&p,f,tag,V_ASN1_UNIVERSAL,IS_SET); \
+ }
+
+# define M_ASN1_I2D_put_EXP_SEQUENCE_opt(a,f,mtag,tag,v) \
+ if ((a != NULL) && (sk_num(a) != 0)) \
+ { \
+ ASN1_put_object(&p,1,v,mtag,V_ASN1_CONTEXT_SPECIFIC); \
+ i2d_ASN1_SET(a,&p,f,tag,V_ASN1_UNIVERSAL,IS_SEQUENCE); \
+ }
+
+# define M_ASN1_I2D_put_EXP_SEQUENCE_opt_type(type,a,f,mtag,tag,v) \
+ if ((a != NULL) && (sk_##type##_num(a) != 0)) \
+ { \
+ ASN1_put_object(&p,1,v,mtag,V_ASN1_CONTEXT_SPECIFIC); \
+ i2d_ASN1_SET_OF_##type(a,&p,f,tag,V_ASN1_UNIVERSAL, \
+ IS_SEQUENCE); \
+ }
+
+# define M_ASN1_I2D_seq_total() \
+ r=ASN1_object_size(1,ret,V_ASN1_SEQUENCE); \
+ if (pp == NULL) return(r); \
+ p= *pp; \
+ ASN1_put_object(&p,1,ret,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL)
+
+# define M_ASN1_I2D_INF_seq_start(tag,ctx) \
+ *(p++)=(V_ASN1_CONSTRUCTED|(tag)|(ctx)); \
+ *(p++)=0x80
+
+# define M_ASN1_I2D_INF_seq_end() *(p++)=0x00; *(p++)=0x00
+
+# define M_ASN1_I2D_finish() *pp=p; \
+ return(r);
+
+int asn1_GetSequence(ASN1_const_CTX *c, long *length);
+void asn1_add_error(const unsigned char *address, int offset);
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/deps/openssl/openssl/include/openssl/asn1t.h b/deps/openssl/openssl/include/openssl/asn1t.h
index 4de87a9c610..99bc0eecf32 100644
--- a/deps/openssl/openssl/include/openssl/asn1t.h
+++ b/deps/openssl/openssl/include/openssl/asn1t.h
@@ -1 +1,973 @@
-#include "../../crypto/asn1/asn1t.h"
+/* asn1t.h */
+/*
+ * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project
+ * 2000.
+ */
+/* ====================================================================
+ * Copyright (c) 2000-2005 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * licensing@OpenSSL.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+#ifndef HEADER_ASN1T_H
+# define HEADER_ASN1T_H
+
+# include <stddef.h>
+# include <openssl/e_os2.h>
+# include <openssl/asn1.h>
+
+# ifdef OPENSSL_BUILD_SHLIBCRYPTO
+# undef OPENSSL_EXTERN
+# define OPENSSL_EXTERN OPENSSL_EXPORT
+# endif
+
+/* ASN1 template defines, structures and functions */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION
+
+/* Macro to obtain ASN1_ADB pointer from a type (only used internally) */
+# define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)(iptr))
+
+/* Macros for start and end of ASN1_ITEM definition */
+
+# define ASN1_ITEM_start(itname) \
+ OPENSSL_GLOBAL const ASN1_ITEM itname##_it = {
+
+# define ASN1_ITEM_end(itname) \
+ };
+
+# else
+
+/* Macro to obtain ASN1_ADB pointer from a type (only used internally) */
+# define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)(iptr()))
+
+/* Macros for start and end of ASN1_ITEM definition */
+
+# define ASN1_ITEM_start(itname) \
+ const ASN1_ITEM * itname##_it(void) \
+ { \
+ static const ASN1_ITEM local_it = {
+
+# define ASN1_ITEM_end(itname) \
+ }; \
+ return &local_it; \
+ }
+
+# endif
+
+/* Macros to aid ASN1 template writing */
+
+# define ASN1_ITEM_TEMPLATE(tname) \
+ static const ASN1_TEMPLATE tname##_item_tt
+
+# define ASN1_ITEM_TEMPLATE_END(tname) \
+ ;\
+ ASN1_ITEM_start(tname) \
+ ASN1_ITYPE_PRIMITIVE,\
+ -1,\
+ &tname##_item_tt,\
+ 0,\
+ NULL,\
+ 0,\
+ #tname \
+ ASN1_ITEM_end(tname)
+
+/* This is a ASN1 type which just embeds a template */
+
+/*-
+ * This pair helps declare a SEQUENCE. We can do:
+ *
+ * ASN1_SEQUENCE(stname) = {
+ * ... SEQUENCE components ...
+ * } ASN1_SEQUENCE_END(stname)
+ *
+ * This will produce an ASN1_ITEM called stname_it
+ * for a structure called stname.
+ *
+ * If you want the same structure but a different
+ * name then use:
+ *
+ * ASN1_SEQUENCE(itname) = {
+ * ... SEQUENCE components ...
+ * } ASN1_SEQUENCE_END_name(stname, itname)
+ *
+ * This will create an item called itname_it using
+ * a structure called stname.
+ */
+
+# define ASN1_SEQUENCE(tname) \
+ static const ASN1_TEMPLATE tname##_seq_tt[]
+
+# define ASN1_SEQUENCE_END(stname) ASN1_SEQUENCE_END_name(stname, stname)
+
+# define ASN1_SEQUENCE_END_name(stname, tname) \
+ ;\
+ ASN1_ITEM_start(tname) \
+ ASN1_ITYPE_SEQUENCE,\
+ V_ASN1_SEQUENCE,\
+ tname##_seq_tt,\
+ sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
+ NULL,\
+ sizeof(stname),\
+ #stname \
+ ASN1_ITEM_end(tname)
+
+# define ASN1_NDEF_SEQUENCE(tname) \
+ ASN1_SEQUENCE(tname)
+
+# define ASN1_NDEF_SEQUENCE_cb(tname, cb) \
+ ASN1_SEQUENCE_cb(tname, cb)
+
+# define ASN1_SEQUENCE_cb(tname, cb) \
+ static const ASN1_AUX tname##_aux = {NULL, 0, 0, 0, cb, 0}; \
+ ASN1_SEQUENCE(tname)
+
+# define ASN1_BROKEN_SEQUENCE(tname) \
+ static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_BROKEN, 0, 0, 0, 0}; \
+ ASN1_SEQUENCE(tname)
+
+# define ASN1_SEQUENCE_ref(tname, cb, lck) \
+ static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_REFCOUNT, offsetof(tname, references), lck, cb, 0}; \
+ ASN1_SEQUENCE(tname)
+
+# define ASN1_SEQUENCE_enc(tname, enc, cb) \
+ static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_ENCODING, 0, 0, cb, offsetof(tname, enc)}; \
+ ASN1_SEQUENCE(tname)
+
+# define ASN1_NDEF_SEQUENCE_END(tname) \
+ ;\
+ ASN1_ITEM_start(tname) \
+ ASN1_ITYPE_NDEF_SEQUENCE,\
+ V_ASN1_SEQUENCE,\
+ tname##_seq_tt,\
+ sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
+ NULL,\
+ sizeof(tname),\
+ #tname \
+ ASN1_ITEM_end(tname)
+
+# define ASN1_BROKEN_SEQUENCE_END(stname) ASN1_SEQUENCE_END_ref(stname, stname)
+
+# define ASN1_SEQUENCE_END_enc(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname)
+
+# define ASN1_SEQUENCE_END_cb(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname)
+
+# define ASN1_SEQUENCE_END_ref(stname, tname) \
+ ;\
+ ASN1_ITEM_start(tname) \
+ ASN1_ITYPE_SEQUENCE,\
+ V_ASN1_SEQUENCE,\
+ tname##_seq_tt,\
+ sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
+ &tname##_aux,\
+ sizeof(stname),\
+ #stname \
+ ASN1_ITEM_end(tname)
+
+# define ASN1_NDEF_SEQUENCE_END_cb(stname, tname) \
+ ;\
+ ASN1_ITEM_start(tname) \
+ ASN1_ITYPE_NDEF_SEQUENCE,\
+ V_ASN1_SEQUENCE,\
+ tname##_seq_tt,\
+ sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
+ &tname##_aux,\
+ sizeof(stname),\
+ #stname \
+ ASN1_ITEM_end(tname)
+
+/*-
+ * This pair helps declare a CHOICE type. We can do:
+ *
+ * ASN1_CHOICE(chname) = {
+ * ... CHOICE options ...
+ * ASN1_CHOICE_END(chname)
+ *
+ * This will produce an ASN1_ITEM called chname_it
+ * for a structure called chname. The structure
+ * definition must look like this:
+ * typedef struct {
+ * int type;
+ * union {
+ * ASN1_SOMETHING *opt1;
+ * ASN1_SOMEOTHER *opt2;
+ * } value;
+ * } chname;
+ *
+ * the name of the selector must be 'type'.
+ * to use an alternative selector name use the
+ * ASN1_CHOICE_END_selector() version.
+ */
+
+# define ASN1_CHOICE(tname) \
+ static const ASN1_TEMPLATE tname##_ch_tt[]
+
+# define ASN1_CHOICE_cb(tname, cb) \
+ static const ASN1_AUX tname##_aux = {NULL, 0, 0, 0, cb, 0}; \
+ ASN1_CHOICE(tname)
+
+# define ASN1_CHOICE_END(stname) ASN1_CHOICE_END_name(stname, stname)
+
+# define ASN1_CHOICE_END_name(stname, tname) ASN1_CHOICE_END_selector(stname, tname, type)
+
+# define ASN1_CHOICE_END_selector(stname, tname, selname) \
+ ;\
+ ASN1_ITEM_start(tname) \
+ ASN1_ITYPE_CHOICE,\
+ offsetof(stname,selname) ,\
+ tname##_ch_tt,\
+ sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
+ NULL,\
+ sizeof(stname),\
+ #stname \
+ ASN1_ITEM_end(tname)
+
+# define ASN1_CHOICE_END_cb(stname, tname, selname) \
+ ;\
+ ASN1_ITEM_start(tname) \
+ ASN1_ITYPE_CHOICE,\
+ offsetof(stname,selname) ,\
+ tname##_ch_tt,\
+ sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
+ &tname##_aux,\
+ sizeof(stname),\
+ #stname \
+ ASN1_ITEM_end(tname)
+
+/* This helps with the template wrapper form of ASN1_ITEM */
+
+# define ASN1_EX_TEMPLATE_TYPE(flags, tag, name, type) { \
+ (flags), (tag), 0,\
+ #name, ASN1_ITEM_ref(type) }
+
+/* These help with SEQUENCE or CHOICE components */
+
+/* used to declare other types */
+
+# define ASN1_EX_TYPE(flags, tag, stname, field, type) { \
+ (flags), (tag), offsetof(stname, field),\
+ #field, ASN1_ITEM_ref(type) }
+
+/* used when the structure is combined with the parent */
+
+# define ASN1_EX_COMBINE(flags, tag, type) { \
+ (flags)|ASN1_TFLG_COMBINE, (tag), 0, NULL, ASN1_ITEM_ref(type) }
+
+/* implicit and explicit helper macros */
+
+# define ASN1_IMP_EX(stname, field, type, tag, ex) \
+ ASN1_EX_TYPE(ASN1_TFLG_IMPLICIT | ex, tag, stname, field, type)
+
+# define ASN1_EXP_EX(stname, field, type, tag, ex) \
+ ASN1_EX_TYPE(ASN1_TFLG_EXPLICIT | ex, tag, stname, field, type)
+
+/* Any defined by macros: the field used is in the table itself */
+
+# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION
+# define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, (const ASN1_ITEM *)&(tblname##_adb) }
+# define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, (const ASN1_ITEM *)&(tblname##_adb) }
+# else
+# define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, tblname##_adb }
+# define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, tblname##_adb }
+# endif
+/* Plain simple type */
+# define ASN1_SIMPLE(stname, field, type) ASN1_EX_TYPE(0,0, stname, field, type)
+
+/* OPTIONAL simple type */
+# define ASN1_OPT(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_OPTIONAL, 0, stname, field, type)
+
+/* IMPLICIT tagged simple type */
+# define ASN1_IMP(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, 0)
+
+/* IMPLICIT tagged OPTIONAL simple type */
+# define ASN1_IMP_OPT(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL)
+
+/* Same as above but EXPLICIT */
+
+# define ASN1_EXP(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, 0)
+# define ASN1_EXP_OPT(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL)
+
+/* SEQUENCE OF type */
+# define ASN1_SEQUENCE_OF(stname, field, type) \
+ ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, stname, field, type)
+
+/* OPTIONAL SEQUENCE OF */
+# define ASN1_SEQUENCE_OF_OPT(stname, field, type) \
+ ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL, 0, stname, field, type)
+
+/* Same as above but for SET OF */
+
+# define ASN1_SET_OF(stname, field, type) \
+ ASN1_EX_TYPE(ASN1_TFLG_SET_OF, 0, stname, field, type)
+
+# define ASN1_SET_OF_OPT(stname, field, type) \
+ ASN1_EX_TYPE(ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL, 0, stname, field, type)
+
+/* Finally compound types of SEQUENCE, SET, IMPLICIT, EXPLICIT and OPTIONAL */
+
+# define ASN1_IMP_SET_OF(stname, field, type, tag) \
+ ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF)
+
+# define ASN1_EXP_SET_OF(stname, field, type, tag) \
+ ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF)
+
+# define ASN1_IMP_SET_OF_OPT(stname, field, type, tag) \
+ ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL)
+
+# define ASN1_EXP_SET_OF_OPT(stname, field, type, tag) \
+ ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL)
+
+# define ASN1_IMP_SEQUENCE_OF(stname, field, type, tag) \
+ ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF)
+
+# define ASN1_IMP_SEQUENCE_OF_OPT(stname, field, type, tag) \
+ ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL)
+
+# define ASN1_EXP_SEQUENCE_OF(stname, field, type, tag) \
+ ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF)
+
+# define ASN1_EXP_SEQUENCE_OF_OPT(stname, field, type, tag) \
+ ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL)
+
+/* EXPLICIT using indefinite length constructed form */
+# define ASN1_NDEF_EXP(stname, field, type, tag) \
+ ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_NDEF)
+
+/* EXPLICIT OPTIONAL using indefinite length constructed form */
+# define ASN1_NDEF_EXP_OPT(stname, field, type, tag) \
+ ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_NDEF)
+
+/* Macros for the ASN1_ADB structure */
+
+# define ASN1_ADB(name) \
+ static const ASN1_ADB_TABLE name##_adbtbl[]
+
+# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION
+
+# define ASN1_ADB_END(name, flags, field, app_table, def, none) \
+ ;\
+ static const ASN1_ADB name##_adb = {\
+ flags,\
+ offsetof(name, field),\
+ app_table,\
+ name##_adbtbl,\
+ sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
+ def,\
+ none\
+ }
+
+# else
+
+# define ASN1_ADB_END(name, flags, field, app_table, def, none) \
+ ;\
+ static const ASN1_ITEM *name##_adb(void) \
+ { \
+ static const ASN1_ADB internal_adb = \
+ {\
+ flags,\
+ offsetof(name, field),\
+ app_table,\
+ name##_adbtbl,\
+ sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
+ def,\
+ none\
+ }; \
+ return (const ASN1_ITEM *) &internal_adb; \
+ } \
+ void dummy_function(void)
+
+# endif
+
+# define ADB_ENTRY(val, template) {val, template}
+
+# define ASN1_ADB_TEMPLATE(name) \
+ static const ASN1_TEMPLATE name##_tt
+
+/*
+ * This is the ASN1 template structure that defines a wrapper round the
+ * actual type. It determines the actual position of the field in the value
+ * structure, various flags such as OPTIONAL and the field name.
+ */
+
+struct ASN1_TEMPLATE_st {
+ unsigned long flags; /* Various flags */
+ long tag; /* tag, not used if no tagging */
+ unsigned long offset; /* Offset of this field in structure */
+# ifndef NO_ASN1_FIELD_NAMES
+ const char *field_name; /* Field name */
+# endif
+ ASN1_ITEM_EXP *item; /* Relevant ASN1_ITEM or ASN1_ADB */
+};
+
+/* Macro to extract ASN1_ITEM and ASN1_ADB pointer from ASN1_TEMPLATE */
+
+# define ASN1_TEMPLATE_item(t) (t->item_ptr)
+# define ASN1_TEMPLATE_adb(t) (t->item_ptr)
+
+typedef struct ASN1_ADB_TABLE_st ASN1_ADB_TABLE;
+typedef struct ASN1_ADB_st ASN1_ADB;
+
+struct ASN1_ADB_st {
+ unsigned long flags; /* Various flags */
+ unsigned long offset; /* Offset of selector field */
+ STACK_OF(ASN1_ADB_TABLE) **app_items; /* Application defined items */
+ const ASN1_ADB_TABLE *tbl; /* Table of possible types */
+ long tblcount; /* Number of entries in tbl */
+ const ASN1_TEMPLATE *default_tt; /* Type to use if no match */
+ const ASN1_TEMPLATE *null_tt; /* Type to use if selector is NULL */
+};
+
+struct ASN1_ADB_TABLE_st {
+ long value; /* NID for an object or value for an int */
+ const ASN1_TEMPLATE tt; /* item for this value */
+};
+
+/* template flags */
+
+/* Field is optional */
+# define ASN1_TFLG_OPTIONAL (0x1)
+
+/* Field is a SET OF */
+# define ASN1_TFLG_SET_OF (0x1 << 1)
+
+/* Field is a SEQUENCE OF */
+# define ASN1_TFLG_SEQUENCE_OF (0x2 << 1)
+
+/*
+ * Special case: this refers to a SET OF that will be sorted into DER order
+ * when encoded *and* the corresponding STACK will be modified to match the
+ * new order.
+ */
+# define ASN1_TFLG_SET_ORDER (0x3 << 1)
+
+/* Mask for SET OF or SEQUENCE OF */
+# define ASN1_TFLG_SK_MASK (0x3 << 1)
+
+/*
+ * These flags mean the tag should be taken from the tag field. If EXPLICIT
+ * then the underlying type is used for the inner tag.
+ */
+
+/* IMPLICIT tagging */
+# define ASN1_TFLG_IMPTAG (0x1 << 3)
+
+/* EXPLICIT tagging, inner tag from underlying type */
+# define ASN1_TFLG_EXPTAG (0x2 << 3)
+
+# define ASN1_TFLG_TAG_MASK (0x3 << 3)
+
+/* context specific IMPLICIT */
+# define ASN1_TFLG_IMPLICIT ASN1_TFLG_IMPTAG|ASN1_TFLG_CONTEXT
+
+/* context specific EXPLICIT */
+# define ASN1_TFLG_EXPLICIT ASN1_TFLG_EXPTAG|ASN1_TFLG_CONTEXT
+
+/*
+ * If tagging is in force these determine the type of tag to use. Otherwise
+ * the tag is determined by the underlying type. These values reflect the
+ * actual octet format.
+ */
+
+/* Universal tag */
+# define ASN1_TFLG_UNIVERSAL (0x0<<6)
+/* Application tag */
+# define ASN1_TFLG_APPLICATION (0x1<<6)
+/* Context specific tag */
+# define ASN1_TFLG_CONTEXT (0x2<<6)
+/* Private tag */
+# define ASN1_TFLG_PRIVATE (0x3<<6)
+
+# define ASN1_TFLG_TAG_CLASS (0x3<<6)
+
+/*
+ * These are for ANY DEFINED BY type. In this case the 'item' field points to
+ * an ASN1_ADB structure which contains a table of values to decode the
+ * relevant type
+ */
+
+# define ASN1_TFLG_ADB_MASK (0x3<<8)
+
+# define ASN1_TFLG_ADB_OID (0x1<<8)
+
+# define ASN1_TFLG_ADB_INT (0x1<<9)
+
+/*
+ * This flag means a parent structure is passed instead of the field: this is
+ * useful is a SEQUENCE is being combined with a CHOICE for example. Since
+ * this means the structure and item name will differ we need to use the
+ * ASN1_CHOICE_END_name() macro for example.
+ */
+
+# define ASN1_TFLG_COMBINE (0x1<<10)
+
+/*
+ * This flag when present in a SEQUENCE OF, SET OF or EXPLICIT causes
+ * indefinite length constructed encoding to be used if required.
+ */
+
+# define ASN1_TFLG_NDEF (0x1<<11)
+
+/* This is the actual ASN1 item itself */
+
+struct ASN1_ITEM_st {
+ char itype; /* The item type, primitive, SEQUENCE, CHOICE
+ * or extern */
+ long utype; /* underlying type */
+ const ASN1_TEMPLATE *templates; /* If SEQUENCE or CHOICE this contains
+ * the contents */
+ long tcount; /* Number of templates if SEQUENCE or CHOICE */
+ const void *funcs; /* functions that handle this type */
+ long size; /* Structure size (usually) */
+# ifndef NO_ASN1_FIELD_NAMES
+ const char *sname; /* Structure name */
+# endif
+};
+
+/*-
+ * These are values for the itype field and
+ * determine how the type is interpreted.
+ *
+ * For PRIMITIVE types the underlying type
+ * determines the behaviour if items is NULL.
+ *
+ * Otherwise templates must contain a single
+ * template and the type is treated in the
+ * same way as the type specified in the template.
+ *
+ * For SEQUENCE types the templates field points
+ * to the members, the size field is the
+ * structure size.
+ *
+ * For CHOICE types the templates field points
+ * to each possible member (typically a union)
+ * and the 'size' field is the offset of the
+ * selector.
+ *
+ * The 'funcs' field is used for application
+ * specific functions.
+ *
+ * For COMPAT types the funcs field gives a
+ * set of functions that handle this type, this
+ * supports the old d2i, i2d convention.
+ *
+ * The EXTERN type uses a new style d2i/i2d.
+ * The new style should be used where possible
+ * because it avoids things like the d2i IMPLICIT
+ * hack.
+ *
+ * MSTRING is a multiple string type, it is used
+ * for a CHOICE of character strings where the
+ * actual strings all occupy an ASN1_STRING
+ * structure. In this case the 'utype' field
+ * has a special meaning, it is used as a mask
+ * of acceptable types using the B_ASN1 constants.
+ *
+ * NDEF_SEQUENCE is the same as SEQUENCE except
+ * that it will use indefinite length constructed
+ * encoding if requested.
+ *
+ */
+
+# define ASN1_ITYPE_PRIMITIVE 0x0
+
+# define ASN1_ITYPE_SEQUENCE 0x1
+
+# define ASN1_ITYPE_CHOICE 0x2
+
+# define ASN1_ITYPE_COMPAT 0x3
+
+# define ASN1_ITYPE_EXTERN 0x4
+
+# define ASN1_ITYPE_MSTRING 0x5
+
+# define ASN1_ITYPE_NDEF_SEQUENCE 0x6
+
+/*
+ * Cache for ASN1 tag and length, so we don't keep re-reading it for things
+ * like CHOICE
+ */
+
+struct ASN1_TLC_st {
+ char valid; /* Values below are valid */
+ int ret; /* return value */
+ long plen; /* length */
+ int ptag; /* class value */
+ int pclass; /* class value */
+ int hdrlen; /* header length */
+};
+
+/* Typedefs for ASN1 function pointers */
+
+typedef ASN1_VALUE *ASN1_new_func(void);
+typedef void ASN1_free_func(ASN1_VALUE *a);
+typedef ASN1_VALUE *ASN1_d2i_func(ASN1_VALUE **a, const unsigned char **in,
+ long length);
+typedef int ASN1_i2d_func(ASN1_VALUE *a, unsigned char **in);
+
+typedef int ASN1_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
+ const ASN1_ITEM *it, int tag, int aclass, char opt,
+ ASN1_TLC *ctx);
+
+typedef int ASN1_ex_i2d(ASN1_VALUE **pval, unsigned char **out,
+ const ASN1_ITEM *it, int tag, int aclass);
+typedef int ASN1_ex_new_func(ASN1_VALUE **pval, const ASN1_ITEM *it);
+typedef void ASN1_ex_free_func(ASN1_VALUE **pval, const ASN1_ITEM *it);
+
+typedef int ASN1_ex_print_func(BIO *out, ASN1_VALUE **pval,
+ int indent, const char *fname,
+ const ASN1_PCTX *pctx);
+
+typedef int ASN1_primitive_i2c(ASN1_VALUE **pval, unsigned char *cont,
+ int *putype, const ASN1_ITEM *it);
+typedef int ASN1_primitive_c2i(ASN1_VALUE **pval, const unsigned char *cont,
+ int len, int utype, char *free_cont,
+ const ASN1_ITEM *it);
+typedef int ASN1_primitive_print(BIO *out, ASN1_VALUE **pval,
+ const ASN1_ITEM *it, int indent,
+ const ASN1_PCTX *pctx);
+
+typedef struct ASN1_COMPAT_FUNCS_st {
+ ASN1_new_func *asn1_new;
+ ASN1_free_func *asn1_free;
+ ASN1_d2i_func *asn1_d2i;
+ ASN1_i2d_func *asn1_i2d;
+} ASN1_COMPAT_FUNCS;
+
+typedef struct ASN1_EXTERN_FUNCS_st {
+ void *app_data;
+ ASN1_ex_new_func *asn1_ex_new;
+ ASN1_ex_free_func *asn1_ex_free;
+ ASN1_ex_free_func *asn1_ex_clear;
+ ASN1_ex_d2i *asn1_ex_d2i;
+ ASN1_ex_i2d *asn1_ex_i2d;
+ ASN1_ex_print_func *asn1_ex_print;
+} ASN1_EXTERN_FUNCS;
+
+typedef struct ASN1_PRIMITIVE_FUNCS_st {
+ void *app_data;
+ unsigned long flags;
+ ASN1_ex_new_func *prim_new;
+ ASN1_ex_free_func *prim_free;
+ ASN1_ex_free_func *prim_clear;
+ ASN1_primitive_c2i *prim_c2i;
+ ASN1_primitive_i2c *prim_i2c;
+ ASN1_primitive_print *prim_print;
+} ASN1_PRIMITIVE_FUNCS;
+
+/*
+ * This is the ASN1_AUX structure: it handles various miscellaneous
+ * requirements. For example the use of reference counts and an informational
+ * callback. The "informational callback" is called at various points during
+ * the ASN1 encoding and decoding. It can be used to provide minor
+ * customisation of the structures used. This is most useful where the
+ * supplied routines *almost* do the right thing but need some extra help at
+ * a few points. If the callback returns zero then it is assumed a fatal
+ * error has occurred and the main operation should be abandoned. If major
+ * changes in the default behaviour are required then an external type is
+ * more appropriate.
+ */
+
+typedef int ASN1_aux_cb(int operation, ASN1_VALUE **in, const ASN1_ITEM *it,
+ void *exarg);
+
+typedef struct ASN1_AUX_st {
+ void *app_data;
+ int flags;
+ int ref_offset; /* Offset of reference value */
+ int ref_lock; /* Lock type to use */
+ ASN1_aux_cb *asn1_cb;
+ int enc_offset; /* Offset of ASN1_ENCODING structure */
+} ASN1_AUX;
+
+/* For print related callbacks exarg points to this structure */
+typedef struct ASN1_PRINT_ARG_st {
+ BIO *out;
+ int indent;
+ const ASN1_PCTX *pctx;
+} ASN1_PRINT_ARG;
+
+/* For streaming related callbacks exarg points to this structure */
+typedef struct ASN1_STREAM_ARG_st {
+ /* BIO to stream through */
+ BIO *out;
+ /* BIO with filters appended */
+ BIO *ndef_bio;
+ /* Streaming I/O boundary */
+ unsigned char **boundary;
+} ASN1_STREAM_ARG;
+
+/* Flags in ASN1_AUX */
+
+/* Use a reference count */
+# define ASN1_AFLG_REFCOUNT 1
+/* Save the encoding of structure (useful for signatures) */
+# define ASN1_AFLG_ENCODING 2
+/* The Sequence length is invalid */
+# define ASN1_AFLG_BROKEN 4
+
+/* operation values for asn1_cb */
+
+# define ASN1_OP_NEW_PRE 0
+# define ASN1_OP_NEW_POST 1
+# define ASN1_OP_FREE_PRE 2
+# define ASN1_OP_FREE_POST 3
+# define ASN1_OP_D2I_PRE 4
+# define ASN1_OP_D2I_POST 5
+# define ASN1_OP_I2D_PRE 6
+# define ASN1_OP_I2D_POST 7
+# define ASN1_OP_PRINT_PRE 8
+# define ASN1_OP_PRINT_POST 9
+# define ASN1_OP_STREAM_PRE 10
+# define ASN1_OP_STREAM_POST 11
+# define ASN1_OP_DETACHED_PRE 12
+# define ASN1_OP_DETACHED_POST 13
+
+/* Macro to implement a primitive type */
+# define IMPLEMENT_ASN1_TYPE(stname) IMPLEMENT_ASN1_TYPE_ex(stname, stname, 0)
+# define IMPLEMENT_ASN1_TYPE_ex(itname, vname, ex) \
+ ASN1_ITEM_start(itname) \
+ ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
+ ASN1_ITEM_end(itname)
+
+/* Macro to implement a multi string type */
+# define IMPLEMENT_ASN1_MSTRING(itname, mask) \
+ ASN1_ITEM_start(itname) \
+ ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \
+ ASN1_ITEM_end(itname)
+
+/* Macro to implement an ASN1_ITEM in terms of old style funcs */
+
+# define IMPLEMENT_COMPAT_ASN1(sname) IMPLEMENT_COMPAT_ASN1_type(sname, V_ASN1_SEQUENCE)
+
+# define IMPLEMENT_COMPAT_ASN1_type(sname, tag) \
+ static const ASN1_COMPAT_FUNCS sname##_ff = { \
+ (ASN1_new_func *)sname##_new, \
+ (ASN1_free_func *)sname##_free, \
+ (ASN1_d2i_func *)d2i_##sname, \
+ (ASN1_i2d_func *)i2d_##sname, \
+ }; \
+ ASN1_ITEM_start(sname) \
+ ASN1_ITYPE_COMPAT, \
+ tag, \
+ NULL, \
+ 0, \
+ &sname##_ff, \
+ 0, \
+ #sname \
+ ASN1_ITEM_end(sname)
+
+# define IMPLEMENT_EXTERN_ASN1(sname, tag, fptrs) \
+ ASN1_ITEM_start(sname) \
+ ASN1_ITYPE_EXTERN, \
+ tag, \
+ NULL, \
+ 0, \
+ &fptrs, \
+ 0, \
+ #sname \
+ ASN1_ITEM_end(sname)
+
+/* Macro to implement standard functions in terms of ASN1_ITEM structures */
+
+# define IMPLEMENT_ASN1_FUNCTIONS(stname) IMPLEMENT_ASN1_FUNCTIONS_fname(stname, stname, stname)
+
+# define IMPLEMENT_ASN1_FUNCTIONS_name(stname, itname) IMPLEMENT_ASN1_FUNCTIONS_fname(stname, itname, itname)
+
+# define IMPLEMENT_ASN1_FUNCTIONS_ENCODE_name(stname, itname) \
+ IMPLEMENT_ASN1_FUNCTIONS_ENCODE_fname(stname, itname, itname)
+
+# define IMPLEMENT_STATIC_ASN1_ALLOC_FUNCTIONS(stname) \
+ IMPLEMENT_ASN1_ALLOC_FUNCTIONS_pfname(static, stname, stname, stname)
+
+# define IMPLEMENT_ASN1_ALLOC_FUNCTIONS(stname) \
+ IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, stname, stname)
+
+# define IMPLEMENT_ASN1_ALLOC_FUNCTIONS_pfname(pre, stname, itname, fname) \
+ pre stname *fname##_new(void) \
+ { \
+ return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
+ } \
+ pre void fname##_free(stname *a) \
+ { \
+ ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
+ }
+
+# define IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname) \
+ stname *fname##_new(void) \
+ { \
+ return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
+ } \
+ void fname##_free(stname *a) \
+ { \
+ ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
+ }
+
+# define IMPLEMENT_ASN1_FUNCTIONS_fname(stname, itname, fname) \
+ IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname) \
+ IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname)
+
+# define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname) \
+ stname *d2i_##fname(stname **a, const unsigned char **in, long len) \
+ { \
+ return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
+ } \
+ int i2d_##fname(stname *a, unsigned char **out) \
+ { \
+ return ASN1_item_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
+ }
+
+# define IMPLEMENT_ASN1_NDEF_FUNCTION(stname) \
+ int i2d_##stname##_NDEF(stname *a, unsigned char **out) \
+ { \
+ return ASN1_item_ndef_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(stname));\
+ }
+
+/*
+ * This includes evil casts to remove const: they will go away when full ASN1
+ * constification is done.
+ */
+# define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(stname, itname, fname) \
+ stname *d2i_##fname(stname **a, const unsigned char **in, long len) \
+ { \
+ return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
+ } \
+ int i2d_##fname(const stname *a, unsigned char **out) \
+ { \
+ return ASN1_item_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
+ }
+
+# define IMPLEMENT_ASN1_DUP_FUNCTION(stname) \
+ stname * stname##_dup(stname *x) \
+ { \
+ return ASN1_item_dup(ASN1_ITEM_rptr(stname), x); \
+ }
+
+# define IMPLEMENT_ASN1_PRINT_FUNCTION(stname) \
+ IMPLEMENT_ASN1_PRINT_FUNCTION_fname(stname, stname, stname)
+
+# define IMPLEMENT_ASN1_PRINT_FUNCTION_fname(stname, itname, fname) \
+ int fname##_print_ctx(BIO *out, stname *x, int indent, \
+ const ASN1_PCTX *pctx) \
+ { \
+ return ASN1_item_print(out, (ASN1_VALUE *)x, indent, \
+ ASN1_ITEM_rptr(itname), pctx); \
+ }
+
+# define IMPLEMENT_ASN1_FUNCTIONS_const(name) \
+ IMPLEMENT_ASN1_FUNCTIONS_const_fname(name, name, name)
+
+# define IMPLEMENT_ASN1_FUNCTIONS_const_fname(stname, itname, fname) \
+ IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(stname, itname, fname) \
+ IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname)
+
+/* external definitions for primitive types */
+
+DECLARE_ASN1_ITEM(ASN1_BOOLEAN)
+DECLARE_ASN1_ITEM(ASN1_TBOOLEAN)
+DECLARE_ASN1_ITEM(ASN1_FBOOLEAN)
+DECLARE_ASN1_ITEM(ASN1_SEQUENCE)
+DECLARE_ASN1_ITEM(CBIGNUM)
+DECLARE_ASN1_ITEM(BIGNUM)
+DECLARE_ASN1_ITEM(LONG)
+DECLARE_ASN1_ITEM(ZLONG)
+
+DECLARE_STACK_OF(ASN1_VALUE)
+
+/* Functions used internally by the ASN1 code */
+
+int ASN1_item_ex_new(ASN1_VALUE **pval, const ASN1_ITEM *it);
+void ASN1_item_ex_free(ASN1_VALUE **pval, const ASN1_ITEM *it);
+int ASN1_template_new(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt);
+int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it);
+
+void ASN1_template_free(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt);
+int ASN1_template_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
+ const ASN1_TEMPLATE *tt);
+int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
+ const ASN1_ITEM *it, int tag, int aclass, char opt,
+ ASN1_TLC *ctx);
+
+int ASN1_item_ex_i2d(ASN1_VALUE **pval, unsigned char **out,
+ const ASN1_ITEM *it, int tag, int aclass);
+int ASN1_template_i2d(ASN1_VALUE **pval, unsigned char **out,
+ const ASN1_TEMPLATE *tt);
+void ASN1_primitive_free(ASN1_VALUE **pval, const ASN1_ITEM *it);
+
+int asn1_ex_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype,
+ const ASN1_ITEM *it);
+int asn1_ex_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len,
+ int utype, char *free_cont, const ASN1_ITEM *it);
+
+int asn1_get_choice_selector(ASN1_VALUE **pval, const ASN1_ITEM *it);
+int asn1_set_choice_selector(ASN1_VALUE **pval, int value,
+ const ASN1_ITEM *it);
+
+ASN1_VALUE **asn1_get_field_ptr(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt);
+
+const ASN1_TEMPLATE *asn1_do_adb(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt,
+ int nullerr);
+
+int asn1_do_lock(ASN1_VALUE **pval, int op, const ASN1_ITEM *it);
+
+void asn1_enc_init(ASN1_VALUE **pval, const ASN1_ITEM *it);
+void asn1_enc_free(ASN1_VALUE **pval, const ASN1_ITEM *it);
+int asn1_enc_restore(int *len, unsigned char **out, ASN1_VALUE **pval,
+ const ASN1_ITEM *it);
+int asn1_enc_save(ASN1_VALUE **pval, const unsigned char *in, int inlen,
+ const ASN1_ITEM *it);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/deps/openssl/openssl/include/openssl/bio.h b/deps/openssl/openssl/include/openssl/bio.h
index 34f8a2df07e..f78796b069f 100644
--- a/deps/openssl/openssl/include/openssl/bio.h
+++ b/deps/openssl/openssl/include/openssl/bio.h
@@ -1 +1,879 @@
-#include "../../crypto/bio/bio.h"
+/* crypto/bio/bio.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_BIO_H
+# define HEADER_BIO_H
+
+# include <openssl/e_os2.h>
+
+# ifndef OPENSSL_NO_FP_API
+# include <stdio.h>
+# endif
+# include <stdarg.h>
+
+# include <openssl/crypto.h>
+
+# ifndef OPENSSL_NO_SCTP
+# ifndef OPENSSL_SYS_VMS
+# include <stdint.h>
+# else
+# include <inttypes.h>
+# endif
+# endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* These are the 'types' of BIOs */
+# define BIO_TYPE_NONE 0
+# define BIO_TYPE_MEM (1|0x0400)
+# define BIO_TYPE_FILE (2|0x0400)
+
+# define BIO_TYPE_FD (4|0x0400|0x0100)
+# define BIO_TYPE_SOCKET (5|0x0400|0x0100)
+# define BIO_TYPE_NULL (6|0x0400)
+# define BIO_TYPE_SSL (7|0x0200)
+# define BIO_TYPE_MD (8|0x0200)/* passive filter */
+# define BIO_TYPE_BUFFER (9|0x0200)/* filter */
+# define BIO_TYPE_CIPHER (10|0x0200)/* filter */
+# define BIO_TYPE_BASE64 (11|0x0200)/* filter */
+# define BIO_TYPE_CONNECT (12|0x0400|0x0100)/* socket - connect */
+# define BIO_TYPE_ACCEPT (13|0x0400|0x0100)/* socket for accept */
+# define BIO_TYPE_PROXY_CLIENT (14|0x0200)/* client proxy BIO */
+# define BIO_TYPE_PROXY_SERVER (15|0x0200)/* server proxy BIO */
+# define BIO_TYPE_NBIO_TEST (16|0x0200)/* server proxy BIO */
+# define BIO_TYPE_NULL_FILTER (17|0x0200)
+# define BIO_TYPE_BER (18|0x0200)/* BER -> bin filter */
+# define BIO_TYPE_BIO (19|0x0400)/* (half a) BIO pair */
+# define BIO_TYPE_LINEBUFFER (20|0x0200)/* filter */
+# define BIO_TYPE_DGRAM (21|0x0400|0x0100)
+# ifndef OPENSSL_NO_SCTP
+# define BIO_TYPE_DGRAM_SCTP (24|0x0400|0x0100)
+# endif
+# define BIO_TYPE_ASN1 (22|0x0200)/* filter */
+# define BIO_TYPE_COMP (23|0x0200)/* filter */
+
+# define BIO_TYPE_DESCRIPTOR 0x0100/* socket, fd, connect or accept */
+# define BIO_TYPE_FILTER 0x0200
+# define BIO_TYPE_SOURCE_SINK 0x0400
+
+/*
+ * BIO_FILENAME_READ|BIO_CLOSE to open or close on free.
+ * BIO_set_fp(in,stdin,BIO_NOCLOSE);
+ */
+# define BIO_NOCLOSE 0x00
+# define BIO_CLOSE 0x01
+
+/*
+ * These are used in the following macros and are passed to BIO_ctrl()
+ */
+# define BIO_CTRL_RESET 1/* opt - rewind/zero etc */
+# define BIO_CTRL_EOF 2/* opt - are we at the eof */
+# define BIO_CTRL_INFO 3/* opt - extra tit-bits */
+# define BIO_CTRL_SET 4/* man - set the 'IO' type */
+# define BIO_CTRL_GET 5/* man - get the 'IO' type */
+# define BIO_CTRL_PUSH 6/* opt - internal, used to signify change */
+# define BIO_CTRL_POP 7/* opt - internal, used to signify change */
+# define BIO_CTRL_GET_CLOSE 8/* man - set the 'close' on free */
+# define BIO_CTRL_SET_CLOSE 9/* man - set the 'close' on free */
+# define BIO_CTRL_PENDING 10/* opt - is their more data buffered */
+# define BIO_CTRL_FLUSH 11/* opt - 'flush' buffered output */
+# define BIO_CTRL_DUP 12/* man - extra stuff for 'duped' BIO */
+# define BIO_CTRL_WPENDING 13/* opt - number of bytes still to write */
+/* callback is int cb(BIO *bio,state,ret); */
+# define BIO_CTRL_SET_CALLBACK 14/* opt - set callback function */
+# define BIO_CTRL_GET_CALLBACK 15/* opt - set callback function */
+
+# define BIO_CTRL_SET_FILENAME 30/* BIO_s_file special */
+
+/* dgram BIO stuff */
+# define BIO_CTRL_DGRAM_CONNECT 31/* BIO dgram special */
+# define BIO_CTRL_DGRAM_SET_CONNECTED 32/* allow for an externally connected
+ * socket to be passed in */
+# define BIO_CTRL_DGRAM_SET_RECV_TIMEOUT 33/* setsockopt, essentially */
+# define BIO_CTRL_DGRAM_GET_RECV_TIMEOUT 34/* getsockopt, essentially */
+# define BIO_CTRL_DGRAM_SET_SEND_TIMEOUT 35/* setsockopt, essentially */
+# define BIO_CTRL_DGRAM_GET_SEND_TIMEOUT 36/* getsockopt, essentially */
+
+# define BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP 37/* flag whether the last */
+# define BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP 38/* I/O operation tiemd out */
+
+/* #ifdef IP_MTU_DISCOVER */
+# define BIO_CTRL_DGRAM_MTU_DISCOVER 39/* set DF bit on egress packets */
+/* #endif */
+
+# define BIO_CTRL_DGRAM_QUERY_MTU 40/* as kernel for current MTU */
+# define BIO_CTRL_DGRAM_GET_FALLBACK_MTU 47
+# define BIO_CTRL_DGRAM_GET_MTU 41/* get cached value for MTU */
+# define BIO_CTRL_DGRAM_SET_MTU 42/* set cached value for MTU.
+ * want to use this if asking
+ * the kernel fails */
+
+# define BIO_CTRL_DGRAM_MTU_EXCEEDED 43/* check whether the MTU was
+ * exceed in the previous write
+ * operation */
+
+# define BIO_CTRL_DGRAM_GET_PEER 46
+# define BIO_CTRL_DGRAM_SET_PEER 44/* Destination for the data */
+
+# define BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT 45/* Next DTLS handshake timeout
+ * to adjust socket timeouts */
+# define BIO_CTRL_DGRAM_SET_DONT_FRAG 48
+
+# define BIO_CTRL_DGRAM_GET_MTU_OVERHEAD 49
+
+# ifndef OPENSSL_NO_SCTP
+/* SCTP stuff */
+# define BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE 50
+# define BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY 51
+# define BIO_CTRL_DGRAM_SCTP_NEXT_AUTH_KEY 52
+# define BIO_CTRL_DGRAM_SCTP_AUTH_CCS_RCVD 53
+# define BIO_CTRL_DGRAM_SCTP_GET_SNDINFO 60
+# define BIO_CTRL_DGRAM_SCTP_SET_SNDINFO 61
+# define BIO_CTRL_DGRAM_SCTP_GET_RCVINFO 62
+# define BIO_CTRL_DGRAM_SCTP_SET_RCVINFO 63
+# define BIO_CTRL_DGRAM_SCTP_GET_PRINFO 64
+# define BIO_CTRL_DGRAM_SCTP_SET_PRINFO 65
+# define BIO_CTRL_DGRAM_SCTP_SAVE_SHUTDOWN 70
+# endif
+
+/* modifiers */
+# define BIO_FP_READ 0x02
+# define BIO_FP_WRITE 0x04
+# define BIO_FP_APPEND 0x08
+# define BIO_FP_TEXT 0x10
+
+# define BIO_FLAGS_READ 0x01
+# define BIO_FLAGS_WRITE 0x02
+# define BIO_FLAGS_IO_SPECIAL 0x04
+# define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
+# define BIO_FLAGS_SHOULD_RETRY 0x08
+# ifndef BIO_FLAGS_UPLINK
+/*
+ * "UPLINK" flag denotes file descriptors provided by application. It
+ * defaults to 0, as most platforms don't require UPLINK interface.
+ */
+# define BIO_FLAGS_UPLINK 0
+# endif
+
+/* Used in BIO_gethostbyname() */
+# define BIO_GHBN_CTRL_HITS 1
+# define BIO_GHBN_CTRL_MISSES 2
+# define BIO_GHBN_CTRL_CACHE_SIZE 3
+# define BIO_GHBN_CTRL_GET_ENTRY 4
+# define BIO_GHBN_CTRL_FLUSH 5
+
+/* Mostly used in the SSL BIO */
+/*-
+ * Not used anymore
+ * #define BIO_FLAGS_PROTOCOL_DELAYED_READ 0x10
+ * #define BIO_FLAGS_PROTOCOL_DELAYED_WRITE 0x20
+ * #define BIO_FLAGS_PROTOCOL_STARTUP 0x40
+ */
+
+# define BIO_FLAGS_BASE64_NO_NL 0x100
+
+/*
+ * This is used with memory BIOs: it means we shouldn't free up or change the
+ * data in any way.
+ */
+# define BIO_FLAGS_MEM_RDONLY 0x200
+
+typedef struct bio_st BIO;
+
+void BIO_set_flags(BIO *b, int flags);
+int BIO_test_flags(const BIO *b, int flags);
+void BIO_clear_flags(BIO *b, int flags);
+
+# define BIO_get_flags(b) BIO_test_flags(b, ~(0x0))
+# define BIO_set_retry_special(b) \
+ BIO_set_flags(b, (BIO_FLAGS_IO_SPECIAL|BIO_FLAGS_SHOULD_RETRY))
+# define BIO_set_retry_read(b) \
+ BIO_set_flags(b, (BIO_FLAGS_READ|BIO_FLAGS_SHOULD_RETRY))
+# define BIO_set_retry_write(b) \
+ BIO_set_flags(b, (BIO_FLAGS_WRITE|BIO_FLAGS_SHOULD_RETRY))
+
+/* These are normally used internally in BIOs */
+# define BIO_clear_retry_flags(b) \
+ BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
+# define BIO_get_retry_flags(b) \
+ BIO_test_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))
+
+/* These should be used by the application to tell why we should retry */
+# define BIO_should_read(a) BIO_test_flags(a, BIO_FLAGS_READ)
+# define BIO_should_write(a) BIO_test_flags(a, BIO_FLAGS_WRITE)
+# define BIO_should_io_special(a) BIO_test_flags(a, BIO_FLAGS_IO_SPECIAL)
+# define BIO_retry_type(a) BIO_test_flags(a, BIO_FLAGS_RWS)
+# define BIO_should_retry(a) BIO_test_flags(a, BIO_FLAGS_SHOULD_RETRY)
+
+/*
+ * The next three are used in conjunction with the BIO_should_io_special()
+ * condition. After this returns true, BIO *BIO_get_retry_BIO(BIO *bio, int
+ * *reason); will walk the BIO stack and return the 'reason' for the special
+ * and the offending BIO. Given a BIO, BIO_get_retry_reason(bio) will return
+ * the code.
+ */
+/*
+ * Returned from the SSL bio when the certificate retrieval code had an error
+ */
+# define BIO_RR_SSL_X509_LOOKUP 0x01
+/* Returned from the connect BIO when a connect would have blocked */
+# define BIO_RR_CONNECT 0x02
+/* Returned from the accept BIO when an accept would have blocked */
+# define BIO_RR_ACCEPT 0x03
+
+/* These are passed by the BIO callback */
+# define BIO_CB_FREE 0x01
+# define BIO_CB_READ 0x02
+# define BIO_CB_WRITE 0x03
+# define BIO_CB_PUTS 0x04
+# define BIO_CB_GETS 0x05
+# define BIO_CB_CTRL 0x06
+
+/*
+ * The callback is called before and after the underling operation, The
+ * BIO_CB_RETURN flag indicates if it is after the call
+ */
+# define BIO_CB_RETURN 0x80
+# define BIO_CB_return(a) ((a)|BIO_CB_RETURN)
+# define BIO_cb_pre(a) (!((a)&BIO_CB_RETURN))
+# define BIO_cb_post(a) ((a)&BIO_CB_RETURN)
+
+long (*BIO_get_callback(const BIO *b)) (struct bio_st *, int, const char *,
+ int, long, long);
+void BIO_set_callback(BIO *b,
+ long (*callback) (struct bio_st *, int, const char *,
+ int, long, long));
+char *BIO_get_callback_arg(const BIO *b);
+void BIO_set_callback_arg(BIO *b, char *arg);
+
+const char *BIO_method_name(const BIO *b);
+int BIO_method_type(const BIO *b);
+
+typedef void bio_info_cb (struct bio_st *, int, const char *, int, long,
+ long);
+
+typedef struct bio_method_st {
+ int type;
+ const char *name;
+ int (*bwrite) (BIO *, const char *, int);
+ int (*bread) (BIO *, char *, int);
+ int (*bputs) (BIO *, const char *);
+ int (*bgets) (BIO *, char *, int);
+ long (*ctrl) (BIO *, int, long, void *);
+ int (*create) (BIO *);
+ int (*destroy) (BIO *);
+ long (*callback_ctrl) (BIO *, int, bio_info_cb *);
+} BIO_METHOD;
+
+struct bio_st {
+ BIO_METHOD *method;
+ /* bio, mode, argp, argi, argl, ret */
+ long (*callback) (struct bio_st *, int, const char *, int, long, long);
+ char *cb_arg; /* first argument for the callback */
+ int init;
+ int shutdown;
+ int flags; /* extra storage */
+ int retry_reason;
+ int num;
+ void *ptr;
+ struct bio_st *next_bio; /* used by filter BIOs */
+ struct bio_st *prev_bio; /* used by filter BIOs */
+ int references;
+ unsigned long num_read;
+ unsigned long num_write;
+ CRYPTO_EX_DATA ex_data;
+};
+
+DECLARE_STACK_OF(BIO)
+
+typedef struct bio_f_buffer_ctx_struct {
+ /*-
+ * Buffers are setup like this:
+ *
+ * <---------------------- size ----------------------->
+ * +---------------------------------------------------+
+ * | consumed | remaining | free space |
+ * +---------------------------------------------------+
+ * <-- off --><------- len ------->
+ */
+ /*- BIO *bio; *//*
+ * this is now in the BIO struct
+ */
+ int ibuf_size; /* how big is the input buffer */
+ int obuf_size; /* how big is the output buffer */
+ char *ibuf; /* the char array */
+ int ibuf_len; /* how many bytes are in it */
+ int ibuf_off; /* write/read offset */
+ char *obuf; /* the char array */
+ int obuf_len; /* how many bytes are in it */
+ int obuf_off; /* write/read offset */
+} BIO_F_BUFFER_CTX;
+
+/* Prefix and suffix callback in ASN1 BIO */
+typedef int asn1_ps_func (BIO *b, unsigned char **pbuf, int *plen,
+ void *parg);
+
+# ifndef OPENSSL_NO_SCTP
+/* SCTP parameter structs */
+struct bio_dgram_sctp_sndinfo {
+ uint16_t snd_sid;
+ uint16_t snd_flags;
+ uint32_t snd_ppid;
+ uint32_t snd_context;
+};
+
+struct bio_dgram_sctp_rcvinfo {
+ uint16_t rcv_sid;
+ uint16_t rcv_ssn;
+ uint16_t rcv_flags;
+ uint32_t rcv_ppid;
+ uint32_t rcv_tsn;
+ uint32_t rcv_cumtsn;
+ uint32_t rcv_context;
+};
+
+struct bio_dgram_sctp_prinfo {
+ uint16_t pr_policy;
+ uint32_t pr_value;
+};
+# endif
+
+/* connect BIO stuff */
+# define BIO_CONN_S_BEFORE 1
+# define BIO_CONN_S_GET_IP 2
+# define BIO_CONN_S_GET_PORT 3
+# define BIO_CONN_S_CREATE_SOCKET 4
+# define BIO_CONN_S_CONNECT 5
+# define BIO_CONN_S_OK 6
+# define BIO_CONN_S_BLOCKED_CONNECT 7
+# define BIO_CONN_S_NBIO 8
+/*
+ * #define BIO_CONN_get_param_hostname BIO_ctrl
+ */
+
+# define BIO_C_SET_CONNECT 100
+# define BIO_C_DO_STATE_MACHINE 101
+# define BIO_C_SET_NBIO 102
+# define BIO_C_SET_PROXY_PARAM 103
+# define BIO_C_SET_FD 104
+# define BIO_C_GET_FD 105
+# define BIO_C_SET_FILE_PTR 106
+# define BIO_C_GET_FILE_PTR 107
+# define BIO_C_SET_FILENAME 108
+# define BIO_C_SET_SSL 109
+# define BIO_C_GET_SSL 110
+# define BIO_C_SET_MD 111
+# define BIO_C_GET_MD 112
+# define BIO_C_GET_CIPHER_STATUS 113
+# define BIO_C_SET_BUF_MEM 114
+# define BIO_C_GET_BUF_MEM_PTR 115
+# define BIO_C_GET_BUFF_NUM_LINES 116
+# define BIO_C_SET_BUFF_SIZE 117
+# define BIO_C_SET_ACCEPT 118
+# define BIO_C_SSL_MODE 119
+# define BIO_C_GET_MD_CTX 120
+# define BIO_C_GET_PROXY_PARAM 121
+# define BIO_C_SET_BUFF_READ_DATA 122/* data to read first */
+# define BIO_C_GET_CONNECT 123
+# define BIO_C_GET_ACCEPT 124
+# define BIO_C_SET_SSL_RENEGOTIATE_BYTES 125
+# define BIO_C_GET_SSL_NUM_RENEGOTIATES 126
+# define BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT 127
+# define BIO_C_FILE_SEEK 128
+# define BIO_C_GET_CIPHER_CTX 129
+# define BIO_C_SET_BUF_MEM_EOF_RETURN 130/* return end of input
+ * value */
+# define BIO_C_SET_BIND_MODE 131
+# define BIO_C_GET_BIND_MODE 132
+# define BIO_C_FILE_TELL 133
+# define BIO_C_GET_SOCKS 134
+# define BIO_C_SET_SOCKS 135
+
+# define BIO_C_SET_WRITE_BUF_SIZE 136/* for BIO_s_bio */
+# define BIO_C_GET_WRITE_BUF_SIZE 137
+# define BIO_C_MAKE_BIO_PAIR 138
+# define BIO_C_DESTROY_BIO_PAIR 139
+# define BIO_C_GET_WRITE_GUARANTEE 140
+# define BIO_C_GET_READ_REQUEST 141
+# define BIO_C_SHUTDOWN_WR 142
+# define BIO_C_NREAD0 143
+# define BIO_C_NREAD 144
+# define BIO_C_NWRITE0 145
+# define BIO_C_NWRITE 146
+# define BIO_C_RESET_READ_REQUEST 147
+# define BIO_C_SET_MD_CTX 148
+
+# define BIO_C_SET_PREFIX 149
+# define BIO_C_GET_PREFIX 150
+# define BIO_C_SET_SUFFIX 151
+# define BIO_C_GET_SUFFIX 152
+
+# define BIO_C_SET_EX_ARG 153
+# define BIO_C_GET_EX_ARG 154
+
+# define BIO_set_app_data(s,arg) BIO_set_ex_data(s,0,arg)
+# define BIO_get_app_data(s) BIO_get_ex_data(s,0)
+
+/* BIO_s_connect() and BIO_s_socks4a_connect() */
+# define BIO_set_conn_hostname(b,name) BIO_ctrl(b,BIO_C_SET_CONNECT,0,(char *)name)
+# define BIO_set_conn_port(b,port) BIO_ctrl(b,BIO_C_SET_CONNECT,1,(char *)port)
+# define BIO_set_conn_ip(b,ip) BIO_ctrl(b,BIO_C_SET_CONNECT,2,(char *)ip)
+# define BIO_set_conn_int_port(b,port) BIO_ctrl(b,BIO_C_SET_CONNECT,3,(char *)port)
+# define BIO_get_conn_hostname(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,0)
+# define BIO_get_conn_port(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,1)
+# define BIO_get_conn_ip(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,2)
+# define BIO_get_conn_int_port(b) BIO_int_ctrl(b,BIO_C_GET_CONNECT,3,0)
+
+# define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL)
+
+/* BIO_s_accept_socket() */
+# define BIO_set_accept_port(b,name) BIO_ctrl(b,BIO_C_SET_ACCEPT,0,(char *)name)
+# define BIO_get_accept_port(b) BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,0)
+/* #define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL) */
+# define BIO_set_nbio_accept(b,n) BIO_ctrl(b,BIO_C_SET_ACCEPT,1,(n)?(void *)"a":NULL)
+# define BIO_set_accept_bios(b,bio) BIO_ctrl(b,BIO_C_SET_ACCEPT,2,(char *)bio)
+
+# define BIO_BIND_NORMAL 0
+# define BIO_BIND_REUSEADDR_IF_UNUSED 1
+# define BIO_BIND_REUSEADDR 2
+# define BIO_set_bind_mode(b,mode) BIO_ctrl(b,BIO_C_SET_BIND_MODE,mode,NULL)
+# define BIO_get_bind_mode(b,mode) BIO_ctrl(b,BIO_C_GET_BIND_MODE,0,NULL)
+
+# define BIO_do_connect(b) BIO_do_handshake(b)
+# define BIO_do_accept(b) BIO_do_handshake(b)
+# define BIO_do_handshake(b) BIO_ctrl(b,BIO_C_DO_STATE_MACHINE,0,NULL)
+
+/* BIO_s_proxy_client() */
+# define BIO_set_url(b,url) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,0,(char *)(url))
+# define BIO_set_proxies(b,p) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,1,(char *)(p))
+/* BIO_set_nbio(b,n) */
+# define BIO_set_filter_bio(b,s) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,2,(char *)(s))
+/* BIO *BIO_get_filter_bio(BIO *bio); */
+# define BIO_set_proxy_cb(b,cb) BIO_callback_ctrl(b,BIO_C_SET_PROXY_PARAM,3,(void *(*cb)()))
+# define BIO_set_proxy_header(b,sk) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,4,(char *)sk)
+# define BIO_set_no_connect_return(b,bool) BIO_int_ctrl(b,BIO_C_SET_PROXY_PARAM,5,bool)
+
+# define BIO_get_proxy_header(b,skp) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,0,(char *)skp)
+# define BIO_get_proxies(b,pxy_p) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,1,(char *)(pxy_p))
+# define BIO_get_url(b,url) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,2,(char *)(url))
+# define BIO_get_no_connect_return(b) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,5,NULL)
+
+# define BIO_set_fd(b,fd,c) BIO_int_ctrl(b,BIO_C_SET_FD,c,fd)
+# define BIO_get_fd(b,c) BIO_ctrl(b,BIO_C_GET_FD,0,(char *)c)
+
+# define BIO_set_fp(b,fp,c) BIO_ctrl(b,BIO_C_SET_FILE_PTR,c,(char *)fp)
+# define BIO_get_fp(b,fpp) BIO_ctrl(b,BIO_C_GET_FILE_PTR,0,(char *)fpp)
+
+# define BIO_seek(b,ofs) (int)BIO_ctrl(b,BIO_C_FILE_SEEK,ofs,NULL)
+# define BIO_tell(b) (int)BIO_ctrl(b,BIO_C_FILE_TELL,0,NULL)
+
+/*
+ * name is cast to lose const, but might be better to route through a
+ * function so we can do it safely
+ */
+# ifdef CONST_STRICT
+/*
+ * If you are wondering why this isn't defined, its because CONST_STRICT is
+ * purely a compile-time kludge to allow const to be checked.
+ */
+int BIO_read_filename(BIO *b, const char *name);
+# else
+# define BIO_read_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \
+ BIO_CLOSE|BIO_FP_READ,(char *)name)
+# endif
+# define BIO_write_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \
+ BIO_CLOSE|BIO_FP_WRITE,name)
+# define BIO_append_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \
+ BIO_CLOSE|BIO_FP_APPEND,name)
+# define BIO_rw_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \
+ BIO_CLOSE|BIO_FP_READ|BIO_FP_WRITE,name)
+
+/*
+ * WARNING WARNING, this ups the reference count on the read bio of the SSL
+ * structure. This is because the ssl read BIO is now pointed to by the
+ * next_bio field in the bio. So when you free the BIO, make sure you are
+ * doing a BIO_free_all() to catch the underlying BIO.
+ */
+# define BIO_set_ssl(b,ssl,c) BIO_ctrl(b,BIO_C_SET_SSL,c,(char *)ssl)
+# define BIO_get_ssl(b,sslp) BIO_ctrl(b,BIO_C_GET_SSL,0,(char *)sslp)
+# define BIO_set_ssl_mode(b,client) BIO_ctrl(b,BIO_C_SSL_MODE,client,NULL)
+# define BIO_set_ssl_renegotiate_bytes(b,num) \
+ BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_BYTES,num,NULL);
+# define BIO_get_num_renegotiates(b) \
+ BIO_ctrl(b,BIO_C_GET_SSL_NUM_RENEGOTIATES,0,NULL);
+# define BIO_set_ssl_renegotiate_timeout(b,seconds) \
+ BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT,seconds,NULL);
+
+/* defined in evp.h */
+/* #define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,1,(char *)md) */
+
+# define BIO_get_mem_data(b,pp) BIO_ctrl(b,BIO_CTRL_INFO,0,(char *)pp)
+# define BIO_set_mem_buf(b,bm,c) BIO_ctrl(b,BIO_C_SET_BUF_MEM,c,(char *)bm)
+# define BIO_get_mem_ptr(b,pp) BIO_ctrl(b,BIO_C_GET_BUF_MEM_PTR,0,(char *)pp)
+# define BIO_set_mem_eof_return(b,v) \
+ BIO_ctrl(b,BIO_C_SET_BUF_MEM_EOF_RETURN,v,NULL)
+
+/* For the BIO_f_buffer() type */
+# define BIO_get_buffer_num_lines(b) BIO_ctrl(b,BIO_C_GET_BUFF_NUM_LINES,0,NULL)
+# define BIO_set_buffer_size(b,size) BIO_ctrl(b,BIO_C_SET_BUFF_SIZE,size,NULL)
+# define BIO_set_read_buffer_size(b,size) BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,0)
+# define BIO_set_write_buffer_size(b,size) BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,1)
+# define BIO_set_buffer_read_data(b,buf,num) BIO_ctrl(b,BIO_C_SET_BUFF_READ_DATA,num,buf)
+
+/* Don't use the next one unless you know what you are doing :-) */
+# define BIO_dup_state(b,ret) BIO_ctrl(b,BIO_CTRL_DUP,0,(char *)(ret))
+
+# define BIO_reset(b) (int)BIO_ctrl(b,BIO_CTRL_RESET,0,NULL)
+# define BIO_eof(b) (int)BIO_ctrl(b,BIO_CTRL_EOF,0,NULL)
+# define BIO_set_close(b,c) (int)BIO_ctrl(b,BIO_CTRL_SET_CLOSE,(c),NULL)
+# define BIO_get_close(b) (int)BIO_ctrl(b,BIO_CTRL_GET_CLOSE,0,NULL)
+# define BIO_pending(b) (int)BIO_ctrl(b,BIO_CTRL_PENDING,0,NULL)
+# define BIO_wpending(b) (int)BIO_ctrl(b,BIO_CTRL_WPENDING,0,NULL)
+/* ...pending macros have inappropriate return type */
+size_t BIO_ctrl_pending(BIO *b);
+size_t BIO_ctrl_wpending(BIO *b);
+# define BIO_flush(b) (int)BIO_ctrl(b,BIO_CTRL_FLUSH,0,NULL)
+# define BIO_get_info_callback(b,cbp) (int)BIO_ctrl(b,BIO_CTRL_GET_CALLBACK,0, \
+ cbp)
+# define BIO_set_info_callback(b,cb) (int)BIO_callback_ctrl(b,BIO_CTRL_SET_CALLBACK,cb)
+
+/* For the BIO_f_buffer() type */
+# define BIO_buffer_get_num_lines(b) BIO_ctrl(b,BIO_CTRL_GET,0,NULL)
+
+/* For BIO_s_bio() */
+# define BIO_set_write_buf_size(b,size) (int)BIO_ctrl(b,BIO_C_SET_WRITE_BUF_SIZE,size,NULL)
+# define BIO_get_write_buf_size(b,size) (size_t)BIO_ctrl(b,BIO_C_GET_WRITE_BUF_SIZE,size,NULL)
+# define BIO_make_bio_pair(b1,b2) (int)BIO_ctrl(b1,BIO_C_MAKE_BIO_PAIR,0,b2)
+# define BIO_destroy_bio_pair(b) (int)BIO_ctrl(b,BIO_C_DESTROY_BIO_PAIR,0,NULL)
+# define BIO_shutdown_wr(b) (int)BIO_ctrl(b, BIO_C_SHUTDOWN_WR, 0, NULL)
+/* macros with inappropriate type -- but ...pending macros use int too: */
+# define BIO_get_write_guarantee(b) (int)BIO_ctrl(b,BIO_C_GET_WRITE_GUARANTEE,0,NULL)
+# define BIO_get_read_request(b) (int)BIO_ctrl(b,BIO_C_GET_READ_REQUEST,0,NULL)
+size_t BIO_ctrl_get_write_guarantee(BIO *b);
+size_t BIO_ctrl_get_read_request(BIO *b);
+int BIO_ctrl_reset_read_request(BIO *b);
+
+/* ctrl macros for dgram */
+# define BIO_ctrl_dgram_connect(b,peer) \
+ (int)BIO_ctrl(b,BIO_CTRL_DGRAM_CONNECT,0, (char *)peer)
+# define BIO_ctrl_set_connected(b, state, peer) \
+ (int)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_CONNECTED, state, (char *)peer)
+# define BIO_dgram_recv_timedout(b) \
+ (int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP, 0, NULL)
+# define BIO_dgram_send_timedout(b) \
+ (int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP, 0, NULL)
+# define BIO_dgram_get_peer(b,peer) \
+ (int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_PEER, 0, (char *)peer)
+# define BIO_dgram_set_peer(b,peer) \
+ (int)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_PEER, 0, (char *)peer)
+# define BIO_dgram_get_mtu_overhead(b) \
+ (unsigned int)BIO_ctrl((b), BIO_CTRL_DGRAM_GET_MTU_OVERHEAD, 0, NULL)
+
+/* These two aren't currently implemented */
+/* int BIO_get_ex_num(BIO *bio); */
+/* void BIO_set_ex_free_func(BIO *bio,int idx,void (*cb)()); */
+int BIO_set_ex_data(BIO *bio, int idx, void *data);
+void *BIO_get_ex_data(BIO *bio, int idx);
+int BIO_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
+ CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
+unsigned long BIO_number_read(BIO *bio);
+unsigned long BIO_number_written(BIO *bio);
+
+/* For BIO_f_asn1() */
+int BIO_asn1_set_prefix(BIO *b, asn1_ps_func *prefix,
+ asn1_ps_func *prefix_free);
+int BIO_asn1_get_prefix(BIO *b, asn1_ps_func **pprefix,
+ asn1_ps_func **pprefix_free);
+int BIO_asn1_set_suffix(BIO *b, asn1_ps_func *suffix,
+ asn1_ps_func *suffix_free);
+int BIO_asn1_get_suffix(BIO *b, asn1_ps_func **psuffix,
+ asn1_ps_func **psuffix_free);
+
+# ifndef OPENSSL_NO_FP_API
+BIO_METHOD *BIO_s_file(void);
+BIO *BIO_new_file(const char *filename, const char *mode);
+BIO *BIO_new_fp(FILE *stream, int close_flag);
+# define BIO_s_file_internal BIO_s_file
+# endif
+BIO *BIO_new(BIO_METHOD *type);
+int BIO_set(BIO *a, BIO_METHOD *type);
+int BIO_free(BIO *a);
+void BIO_vfree(BIO *a);
+int BIO_read(BIO *b, void *data, int len);
+int BIO_gets(BIO *bp, char *buf, int size);
+int BIO_write(BIO *b, const void *data, int len);
+int BIO_puts(BIO *bp, const char *buf);
+int BIO_indent(BIO *b, int indent, int max);
+long BIO_ctrl(BIO *bp, int cmd, long larg, void *parg);
+long BIO_callback_ctrl(BIO *b, int cmd,
+ void (*fp) (struct bio_st *, int, const char *, int,
+ long, long));
+char *BIO_ptr_ctrl(BIO *bp, int cmd, long larg);
+long BIO_int_ctrl(BIO *bp, int cmd, long larg, int iarg);
+BIO *BIO_push(BIO *b, BIO *append);
+BIO *BIO_pop(BIO *b);
+void BIO_free_all(BIO *a);
+BIO *BIO_find_type(BIO *b, int bio_type);
+BIO *BIO_next(BIO *b);
+BIO *BIO_get_retry_BIO(BIO *bio, int *reason);
+int BIO_get_retry_reason(BIO *bio);
+BIO *BIO_dup_chain(BIO *in);
+
+int BIO_nread0(BIO *bio, char **buf);
+int BIO_nread(BIO *bio, char **buf, int num);
+int BIO_nwrite0(BIO *bio, char **buf);
+int BIO_nwrite(BIO *bio, char **buf, int num);
+
+long BIO_debug_callback(BIO *bio, int cmd, const char *argp, int argi,
+ long argl, long ret);
+
+BIO_METHOD *BIO_s_mem(void);
+BIO *BIO_new_mem_buf(void *buf, int len);
+BIO_METHOD *BIO_s_socket(void);
+BIO_METHOD *BIO_s_connect(void);
+BIO_METHOD *BIO_s_accept(void);
+BIO_METHOD *BIO_s_fd(void);
+# ifndef OPENSSL_SYS_OS2
+BIO_METHOD *BIO_s_log(void);
+# endif
+BIO_METHOD *BIO_s_bio(void);
+BIO_METHOD *BIO_s_null(void);
+BIO_METHOD *BIO_f_null(void);
+BIO_METHOD *BIO_f_buffer(void);
+# ifdef OPENSSL_SYS_VMS
+BIO_METHOD *BIO_f_linebuffer(void);
+# endif
+BIO_METHOD *BIO_f_nbio_test(void);
+# ifndef OPENSSL_NO_DGRAM
+BIO_METHOD *BIO_s_datagram(void);
+# ifndef OPENSSL_NO_SCTP
+BIO_METHOD *BIO_s_datagram_sctp(void);
+# endif
+# endif
+
+/* BIO_METHOD *BIO_f_ber(void); */
+
+int BIO_sock_should_retry(int i);
+int BIO_sock_non_fatal_error(int error);
+int BIO_dgram_non_fatal_error(int error);
+
+int BIO_fd_should_retry(int i);
+int BIO_fd_non_fatal_error(int error);
+int BIO_dump_cb(int (*cb) (const void *data, size_t len, void *u),
+ void *u, const char *s, int len);
+int BIO_dump_indent_cb(int (*cb) (const void *data, size_t len, void *u),
+ void *u, const char *s, int len, int indent);
+int BIO_dump(BIO *b, const char *bytes, int len);
+int BIO_dump_indent(BIO *b, const char *bytes, int len, int indent);
+# ifndef OPENSSL_NO_FP_API
+int BIO_dump_fp(FILE *fp, const char *s, int len);
+int BIO_dump_indent_fp(FILE *fp, const char *s, int len, int indent);
+# endif
+int BIO_hex_string(BIO *out, int indent, int width, unsigned char *data,
+ int datalen);
+
+struct hostent *BIO_gethostbyname(const char *name);
+/*-
+ * We might want a thread-safe interface too:
+ * struct hostent *BIO_gethostbyname_r(const char *name,
+ * struct hostent *result, void *buffer, size_t buflen);
+ * or something similar (caller allocates a struct hostent,
+ * pointed to by "result", and additional buffer space for the various
+ * substructures; if the buffer does not suffice, NULL is returned
+ * and an appropriate error code is set).
+ */
+int BIO_sock_error(int sock);
+int BIO_socket_ioctl(int fd, long type, void *arg);
+int BIO_socket_nbio(int fd, int mode);
+int BIO_get_port(const char *str, unsigned short *port_ptr);
+int BIO_get_host_ip(const char *str, unsigned char *ip);
+int BIO_get_accept_socket(char *host_port, int mode);
+int BIO_accept(int sock, char **ip_port);
+int BIO_sock_init(void);
+void BIO_sock_cleanup(void);
+int BIO_set_tcp_ndelay(int sock, int turn_on);
+
+BIO *BIO_new_socket(int sock, int close_flag);
+BIO *BIO_new_dgram(int fd, int close_flag);
+# ifndef OPENSSL_NO_SCTP
+BIO *BIO_new_dgram_sctp(int fd, int close_flag);
+int BIO_dgram_is_sctp(BIO *bio);
+int BIO_dgram_sctp_notification_cb(BIO *b,
+ void (*handle_notifications) (BIO *bio,
+ void
+ *context,
+ void *buf),
+ void *context);
+int BIO_dgram_sctp_wait_for_dry(BIO *b);
+int BIO_dgram_sctp_msg_waiting(BIO *b);
+# endif
+BIO *BIO_new_fd(int fd, int close_flag);
+BIO *BIO_new_connect(const char *host_port);
+BIO *BIO_new_accept(const char *host_port);
+
+int BIO_new_bio_pair(BIO **bio1, size_t writebuf1,
+ BIO **bio2, size_t writebuf2);
+/*
+ * If successful, returns 1 and in *bio1, *bio2 two BIO pair endpoints.
+ * Otherwise returns 0 and sets *bio1 and *bio2 to NULL. Size 0 uses default
+ * value.
+ */
+
+void BIO_copy_next_retry(BIO *b);
+
+/*
+ * long BIO_ghbn_ctrl(int cmd,int iarg,char *parg);
+ */
+
+# ifdef __GNUC__
+# define __bio_h__attr__ __attribute__
+# else
+# define __bio_h__attr__(x)
+# endif
+int BIO_printf(BIO *bio, const char *format, ...)
+__bio_h__attr__((__format__(__printf__, 2, 3)));
+int BIO_vprintf(BIO *bio, const char *format, va_list args)
+__bio_h__attr__((__format__(__printf__, 2, 0)));
+int BIO_snprintf(char *buf, size_t n, const char *format, ...)
+__bio_h__attr__((__format__(__printf__, 3, 4)));
+int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args)
+__bio_h__attr__((__format__(__printf__, 3, 0)));
+# undef __bio_h__attr__
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_BIO_strings(void);
+
+/* Error codes for the BIO functions. */
+
+/* Function codes. */
+# define BIO_F_ACPT_STATE 100
+# define BIO_F_BIO_ACCEPT 101
+# define BIO_F_BIO_BER_GET_HEADER 102
+# define BIO_F_BIO_CALLBACK_CTRL 131
+# define BIO_F_BIO_CTRL 103
+# define BIO_F_BIO_GETHOSTBYNAME 120
+# define BIO_F_BIO_GETS 104
+# define BIO_F_BIO_GET_ACCEPT_SOCKET 105
+# define BIO_F_BIO_GET_HOST_IP 106
+# define BIO_F_BIO_GET_PORT 107
+# define BIO_F_BIO_MAKE_PAIR 121
+# define BIO_F_BIO_NEW 108
+# define BIO_F_BIO_NEW_FILE 109
+# define BIO_F_BIO_NEW_MEM_BUF 126
+# define BIO_F_BIO_NREAD 123
+# define BIO_F_BIO_NREAD0 124
+# define BIO_F_BIO_NWRITE 125
+# define BIO_F_BIO_NWRITE0 122
+# define BIO_F_BIO_PUTS 110
+# define BIO_F_BIO_READ 111
+# define BIO_F_BIO_SOCK_INIT 112
+# define BIO_F_BIO_WRITE 113
+# define BIO_F_BUFFER_CTRL 114
+# define BIO_F_CONN_CTRL 127
+# define BIO_F_CONN_STATE 115
+# define BIO_F_DGRAM_SCTP_READ 132
+# define BIO_F_DGRAM_SCTP_WRITE 133
+# define BIO_F_FILE_CTRL 116
+# define BIO_F_FILE_READ 130
+# define BIO_F_LINEBUFFER_CTRL 129
+# define BIO_F_MEM_READ 128
+# define BIO_F_MEM_WRITE 117
+# define BIO_F_SSL_NEW 118
+# define BIO_F_WSASTARTUP 119
+
+/* Reason codes. */
+# define BIO_R_ACCEPT_ERROR 100
+# define BIO_R_BAD_FOPEN_MODE 101
+# define BIO_R_BAD_HOSTNAME_LOOKUP 102
+# define BIO_R_BROKEN_PIPE 124
+# define BIO_R_CONNECT_ERROR 103
+# define BIO_R_EOF_ON_MEMORY_BIO 127
+# define BIO_R_ERROR_SETTING_NBIO 104
+# define BIO_R_ERROR_SETTING_NBIO_ON_ACCEPTED_SOCKET 105
+# define BIO_R_ERROR_SETTING_NBIO_ON_ACCEPT_SOCKET 106
+# define BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET 107
+# define BIO_R_INVALID_ARGUMENT 125
+# define BIO_R_INVALID_IP_ADDRESS 108
+# define BIO_R_IN_USE 123
+# define BIO_R_KEEPALIVE 109
+# define BIO_R_NBIO_CONNECT_ERROR 110
+# define BIO_R_NO_ACCEPT_PORT_SPECIFIED 111
+# define BIO_R_NO_HOSTNAME_SPECIFIED 112
+# define BIO_R_NO_PORT_DEFINED 113
+# define BIO_R_NO_PORT_SPECIFIED 114
+# define BIO_R_NO_SUCH_FILE 128
+# define BIO_R_NULL_PARAMETER 115
+# define BIO_R_TAG_MISMATCH 116
+# define BIO_R_UNABLE_TO_BIND_SOCKET 117
+# define BIO_R_UNABLE_TO_CREATE_SOCKET 118
+# define BIO_R_UNABLE_TO_LISTEN_SOCKET 119
+# define BIO_R_UNINITIALIZED 120
+# define BIO_R_UNSUPPORTED_METHOD 121
+# define BIO_R_WRITE_TO_READ_ONLY_BIO 126
+# define BIO_R_WSASTARTUP 122
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/deps/openssl/openssl/include/openssl/blowfish.h b/deps/openssl/openssl/include/openssl/blowfish.h
index 8d515feb058..832930272cf 100644
--- a/deps/openssl/openssl/include/openssl/blowfish.h
+++ b/deps/openssl/openssl/include/openssl/blowfish.h
@@ -1 +1,130 @@
-#include "../../crypto/bf/blowfish.h"
+/* crypto/bf/blowfish.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_BLOWFISH_H
+# define HEADER_BLOWFISH_H
+
+# include <openssl/e_os2.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# ifdef OPENSSL_NO_BF
+# error BF is disabled.
+# endif
+
+# define BF_ENCRYPT 1
+# define BF_DECRYPT 0
+
+/*-
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ * ! BF_LONG has to be at least 32 bits wide. If it's wider, then !
+ * ! BF_LONG_LOG2 has to be defined along. !
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ */
+
+# if defined(__LP32__)
+# define BF_LONG unsigned long
+# elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__)
+# define BF_LONG unsigned long
+# define BF_LONG_LOG2 3
+/*
+ * _CRAY note. I could declare short, but I have no idea what impact
+ * does it have on performance on none-T3E machines. I could declare
+ * int, but at least on C90 sizeof(int) can be chosen at compile time.
+ * So I've chosen long...
+ * <appro@fy.chalmers.se>
+ */
+# else
+# define BF_LONG unsigned int
+# endif
+
+# define BF_ROUNDS 16
+# define BF_BLOCK 8
+
+typedef struct bf_key_st {
+ BF_LONG P[BF_ROUNDS + 2];
+ BF_LONG S[4 * 256];
+} BF_KEY;
+
+# ifdef OPENSSL_FIPS
+void private_BF_set_key(BF_KEY *key, int len, const unsigned char *data);
+# endif
+void BF_set_key(BF_KEY *key, int len, const unsigned char *data);
+
+void BF_encrypt(BF_LONG *data, const BF_KEY *key);
+void BF_decrypt(BF_LONG *data, const BF_KEY *key);
+
+void BF_ecb_encrypt(const unsigned char *in, unsigned char *out,
+ const BF_KEY *key, int enc);
+void BF_cbc_encrypt(const unsigned char *in, unsigned char *out, long length,
+ const BF_KEY *schedule, unsigned char *ivec, int enc);
+void BF_cfb64_encrypt(const unsigned char *in, unsigned char *out,
+ long length, const BF_KEY *schedule,
+ unsigned char *ivec, int *num, int enc);
+void BF_ofb64_encrypt(const unsigned char *in, unsigned char *out,
+ long length, const BF_KEY *schedule,
+ unsigned char *ivec, int *num);
+const char *BF_options(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/deps/openssl/openssl/include/openssl/bn.h b/deps/openssl/openssl/include/openssl/bn.h
index f47d65a93f4..5696965e9a0 100644
--- a/deps/openssl/openssl/include/openssl/bn.h
+++ b/deps/openssl/openssl/include/openssl/bn.h
@@ -1 +1,939 @@
-#include "../../crypto/bn/bn.h"
+/* crypto/bn/bn.h */
+/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+/* ====================================================================
+ * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+/* ====================================================================
+ * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
+ *
+ * Portions of the attached software ("Contribution") are developed by
+ * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project.
+ *
+ * The Contribution is licensed pursuant to the Eric Young open source
+ * license provided above.
+ *
+ * The binary polynomial arithmetic software is originally written by
+ * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems Laboratories.
+ *
+ */
+
+#ifndef HEADER_BN_H
+# define HEADER_BN_H
+
+# include <openssl/e_os2.h>
+# ifndef OPENSSL_NO_FP_API
+# include <stdio.h> /* FILE */
+# endif
+# include <openssl/ossl_typ.h>
+# include <openssl/crypto.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * These preprocessor symbols control various aspects of the bignum headers
+ * and library code. They're not defined by any "normal" configuration, as
+ * they are intended for development and testing purposes. NB: defining all
+ * three can be useful for debugging application code as well as openssl
+ * itself. BN_DEBUG - turn on various debugging alterations to the bignum
+ * code BN_DEBUG_RAND - uses random poisoning of unused words to trip up
+ * mismanagement of bignum internals. You must also define BN_DEBUG.
+ */
+/* #define BN_DEBUG */
+/* #define BN_DEBUG_RAND */
+
+# ifndef OPENSSL_SMALL_FOOTPRINT
+# define BN_MUL_COMBA
+# define BN_SQR_COMBA
+# define BN_RECURSION
+# endif
+
+/*
+ * This next option uses the C libraries (2 word)/(1 word) function. If it is
+ * not defined, I use my C version (which is slower). The reason for this
+ * flag is that when the particular C compiler library routine is used, and
+ * the library is linked with a different compiler, the library is missing.
+ * This mostly happens when the library is built with gcc and then linked
+ * using normal cc. This would be a common occurrence because gcc normally
+ * produces code that is 2 times faster than system compilers for the big
+ * number stuff. For machines with only one compiler (or shared libraries),
+ * this should be on. Again this in only really a problem on machines using
+ * "long long's", are 32bit, and are not using my assembler code.
+ */
+# if defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_WINDOWS) || \
+ defined(OPENSSL_SYS_WIN32) || defined(linux)
+# ifndef BN_DIV2W
+# define BN_DIV2W
+# endif
+# endif
+
+/*
+ * assuming long is 64bit - this is the DEC Alpha unsigned long long is only
+ * 64 bits :-(, don't define BN_LLONG for the DEC Alpha
+ */
+# ifdef SIXTY_FOUR_BIT_LONG
+# define BN_ULLONG unsigned long long
+# define BN_ULONG unsigned long
+# define BN_LONG long
+# define BN_BITS 128
+# define BN_BYTES 8
+# define BN_BITS2 64
+# define BN_BITS4 32
+# define BN_MASK (0xffffffffffffffffffffffffffffffffLL)
+# define BN_MASK2 (0xffffffffffffffffL)
+# define BN_MASK2l (0xffffffffL)
+# define BN_MASK2h (0xffffffff00000000L)
+# define BN_MASK2h1 (0xffffffff80000000L)
+# define BN_TBIT (0x8000000000000000L)
+# define BN_DEC_CONV (10000000000000000000UL)
+# define BN_DEC_FMT1 "%lu"
+# define BN_DEC_FMT2 "%019lu"
+# define BN_DEC_NUM 19
+# define BN_HEX_FMT1 "%lX"
+# define BN_HEX_FMT2 "%016lX"
+# endif
+
+/*
+ * This is where the long long data type is 64 bits, but long is 32. For
+ * machines where there are 64bit registers, this is the mode to use. IRIX,
+ * on R4000 and above should use this mode, along with the relevant assembler
+ * code :-). Do NOT define BN_LLONG.
+ */
+# ifdef SIXTY_FOUR_BIT
+# undef BN_LLONG
+# undef BN_ULLONG
+# define BN_ULONG unsigned long long
+# define BN_LONG long long
+# define BN_BITS 128
+# define BN_BYTES 8
+# define BN_BITS2 64
+# define BN_BITS4 32
+# define BN_MASK2 (0xffffffffffffffffLL)
+# define BN_MASK2l (0xffffffffL)
+# define BN_MASK2h (0xffffffff00000000LL)
+# define BN_MASK2h1 (0xffffffff80000000LL)
+# define BN_TBIT (0x8000000000000000LL)
+# define BN_DEC_CONV (10000000000000000000ULL)
+# define BN_DEC_FMT1 "%llu"
+# define BN_DEC_FMT2 "%019llu"
+# define BN_DEC_NUM 19
+# define BN_HEX_FMT1 "%llX"
+# define BN_HEX_FMT2 "%016llX"
+# endif
+
+# ifdef THIRTY_TWO_BIT
+# ifdef BN_LLONG
+# if defined(_WIN32) && !defined(__GNUC__)
+# define BN_ULLONG unsigned __int64
+# define BN_MASK (0xffffffffffffffffI64)
+# else
+# define BN_ULLONG unsigned long long
+# define BN_MASK (0xffffffffffffffffLL)
+# endif
+# endif
+# define BN_ULONG unsigned int
+# define BN_LONG int
+# define BN_BITS 64
+# define BN_BYTES 4
+# define BN_BITS2 32
+# define BN_BITS4 16
+# define BN_MASK2 (0xffffffffL)
+# define BN_MASK2l (0xffff)
+# define BN_MASK2h1 (0xffff8000L)
+# define BN_MASK2h (0xffff0000L)
+# define BN_TBIT (0x80000000L)
+# define BN_DEC_CONV (1000000000L)
+# define BN_DEC_FMT1 "%u"
+# define BN_DEC_FMT2 "%09u"
+# define BN_DEC_NUM 9
+# define BN_HEX_FMT1 "%X"
+# define BN_HEX_FMT2 "%08X"
+# endif
+
+# define BN_DEFAULT_BITS 1280
+
+# define BN_FLG_MALLOCED 0x01
+# define BN_FLG_STATIC_DATA 0x02
+
+/*
+ * avoid leaking exponent information through timing,
+ * BN_mod_exp_mont() will call BN_mod_exp_mont_consttime,
+ * BN_div() will call BN_div_no_branch,
+ * BN_mod_inverse() will call BN_mod_inverse_no_branch.
+ */
+# define BN_FLG_CONSTTIME 0x04
+
+# ifdef OPENSSL_NO_DEPRECATED
+/* deprecated name for the flag */
+# define BN_FLG_EXP_CONSTTIME BN_FLG_CONSTTIME
+/*
+ * avoid leaking exponent information through timings
+ * (BN_mod_exp_mont() will call BN_mod_exp_mont_consttime)
+ */
+# endif
+
+# ifndef OPENSSL_NO_DEPRECATED
+# define BN_FLG_FREE 0x8000
+ /* used for debuging */
+# endif
+# define BN_set_flags(b,n) ((b)->flags|=(n))
+# define BN_get_flags(b,n) ((b)->flags&(n))
+
+/*
+ * get a clone of a BIGNUM with changed flags, for *temporary* use only (the
+ * two BIGNUMs cannot not be used in parallel!)
+ */
+# define BN_with_flags(dest,b,n) ((dest)->d=(b)->d, \
+ (dest)->top=(b)->top, \
+ (dest)->dmax=(b)->dmax, \
+ (dest)->neg=(b)->neg, \
+ (dest)->flags=(((dest)->flags & BN_FLG_MALLOCED) \
+ | ((b)->flags & ~BN_FLG_MALLOCED) \
+ | BN_FLG_STATIC_DATA \
+ | (n)))
+
+/* Already declared in ossl_typ.h */
+# if 0
+typedef struct bignum_st BIGNUM;
+/* Used for temp variables (declaration hidden in bn_lcl.h) */
+typedef struct bignum_ctx BN_CTX;
+typedef struct bn_blinding_st BN_BLINDING;
+typedef struct bn_mont_ctx_st BN_MONT_CTX;
+typedef struct bn_recp_ctx_st BN_RECP_CTX;
+typedef struct bn_gencb_st BN_GENCB;
+# endif
+
+struct bignum_st {
+ BN_ULONG *d; /* Pointer to an array of 'BN_BITS2' bit
+ * chunks. */
+ int top; /* Index of last used d +1. */
+ /* The next are internal book keeping for bn_expand. */
+ int dmax; /* Size of the d array. */
+ int neg; /* one if the number is negative */
+ int flags;
+};
+
+/* Used for montgomery multiplication */
+struct bn_mont_ctx_st {
+ int ri; /* number of bits in R */
+ BIGNUM RR; /* used to convert to montgomery form */
+ BIGNUM N; /* The modulus */
+ BIGNUM Ni; /* R*(1/R mod N) - N*Ni = 1 (Ni is only
+ * stored for bignum algorithm) */
+ BN_ULONG n0[2]; /* least significant word(s) of Ni; (type
+ * changed with 0.9.9, was "BN_ULONG n0;"
+ * before) */
+ int flags;
+};
+
+/*
+ * Used for reciprocal division/mod functions It cannot be shared between
+ * threads
+ */
+struct bn_recp_ctx_st {
+ BIGNUM N; /* the divisor */
+ BIGNUM Nr; /* the reciprocal */
+ int num_bits;
+ int shift;
+ int flags;
+};
+
+/* Used for slow "generation" functions. */
+struct bn_gencb_st {
+ unsigned int ver; /* To handle binary (in)compatibility */
+ void *arg; /* callback-specific data */
+ union {
+ /* if(ver==1) - handles old style callbacks */
+ void (*cb_1) (int, int, void *);
+ /* if(ver==2) - new callback style */
+ int (*cb_2) (int, int, BN_GENCB *);
+ } cb;
+};
+/* Wrapper function to make using BN_GENCB easier, */
+int BN_GENCB_call(BN_GENCB *cb, int a, int b);
+/* Macro to populate a BN_GENCB structure with an "old"-style callback */
+# define BN_GENCB_set_old(gencb, callback, cb_arg) { \
+ BN_GENCB *tmp_gencb = (gencb); \
+ tmp_gencb->ver = 1; \
+ tmp_gencb->arg = (cb_arg); \
+ tmp_gencb->cb.cb_1 = (callback); }
+/* Macro to populate a BN_GENCB structure with a "new"-style callback */
+# define BN_GENCB_set(gencb, callback, cb_arg) { \
+ BN_GENCB *tmp_gencb = (gencb); \
+ tmp_gencb->ver = 2; \
+ tmp_gencb->arg = (cb_arg); \
+ tmp_gencb->cb.cb_2 = (callback); }
+
+# define BN_prime_checks 0 /* default: select number of iterations based
+ * on the size of the number */
+
+/*
+ * number of Miller-Rabin iterations for an error rate of less than 2^-80 for
+ * random 'b'-bit input, b >= 100 (taken from table 4.4 in the Handbook of
+ * Applied Cryptography [Menezes, van Oorschot, Vanstone; CRC Press 1996];
+ * original paper: Damgaard, Landrock, Pomerance: Average case error
+ * estimates for the strong probable prime test. -- Math. Comp. 61 (1993)
+ * 177-194)
+ */
+# define BN_prime_checks_for_size(b) ((b) >= 1300 ? 2 : \
+ (b) >= 850 ? 3 : \
+ (b) >= 650 ? 4 : \
+ (b) >= 550 ? 5 : \
+ (b) >= 450 ? 6 : \
+ (b) >= 400 ? 7 : \
+ (b) >= 350 ? 8 : \
+ (b) >= 300 ? 9 : \
+ (b) >= 250 ? 12 : \
+ (b) >= 200 ? 15 : \
+ (b) >= 150 ? 18 : \
+ /* b >= 100 */ 27)
+
+# define BN_num_bytes(a) ((BN_num_bits(a)+7)/8)
+
+/* Note that BN_abs_is_word didn't work reliably for w == 0 until 0.9.8 */
+# define BN_abs_is_word(a,w) ((((a)->top == 1) && ((a)->d[0] == (BN_ULONG)(w))) || \
+ (((w) == 0) && ((a)->top == 0)))
+# define BN_is_zero(a) ((a)->top == 0)
+# define BN_is_one(a) (BN_abs_is_word((a),1) && !(a)->neg)
+# define BN_is_word(a,w) (BN_abs_is_word((a),(w)) && (!(w) || !(a)->neg))
+# define BN_is_odd(a) (((a)->top > 0) && ((a)->d[0] & 1))
+
+# define BN_one(a) (BN_set_word((a),1))
+# define BN_zero_ex(a) \
+ do { \
+ BIGNUM *_tmp_bn = (a); \
+ _tmp_bn->top = 0; \
+ _tmp_bn->neg = 0; \
+ } while(0)
+# ifdef OPENSSL_NO_DEPRECATED
+# define BN_zero(a) BN_zero_ex(a)
+# else
+# define BN_zero(a) (BN_set_word((a),0))
+# endif
+
+const BIGNUM *BN_value_one(void);
+char *BN_options(void);
+BN_CTX *BN_CTX_new(void);
+# ifndef OPENSSL_NO_DEPRECATED
+void BN_CTX_init(BN_CTX *c);
+# endif
+void BN_CTX_free(BN_CTX *c);
+void BN_CTX_start(BN_CTX *ctx);
+BIGNUM *BN_CTX_get(BN_CTX *ctx);
+void BN_CTX_end(BN_CTX *ctx);
+int BN_rand(BIGNUM *rnd, int bits, int top, int bottom);
+int BN_pseudo_rand(BIGNUM *rnd, int bits, int top, int bottom);
+int BN_rand_range(BIGNUM *rnd, const BIGNUM *range);
+int BN_pseudo_rand_range(BIGNUM *rnd, const BIGNUM *range);
+int BN_num_bits(const BIGNUM *a);
+int BN_num_bits_word(BN_ULONG);
+BIGNUM *BN_new(void);
+void BN_init(BIGNUM *);
+void BN_clear_free(BIGNUM *a);
+BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b);
+void BN_swap(BIGNUM *a, BIGNUM *b);
+BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret);
+int BN_bn2bin(const BIGNUM *a, unsigned char *to);
+BIGNUM *BN_mpi2bn(const unsigned char *s, int len, BIGNUM *ret);
+int BN_bn2mpi(const BIGNUM *a, unsigned char *to);
+int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
+int BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
+int BN_uadd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
+int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
+int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
+int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx);
+/** BN_set_negative sets sign of a BIGNUM
+ * \param b pointer to the BIGNUM object
+ * \param n 0 if the BIGNUM b should be positive and a value != 0 otherwise
+ */
+void BN_set_negative(BIGNUM *b, int n);
+/** BN_is_negative returns 1 if the BIGNUM is negative
+ * \param a pointer to the BIGNUM object
+ * \return 1 if a < 0 and 0 otherwise
+ */
+# define BN_is_negative(a) ((a)->neg != 0)
+
+int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d,
+ BN_CTX *ctx);
+# define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx))
+int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx);
+int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m,
+ BN_CTX *ctx);
+int BN_mod_add_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
+ const BIGNUM *m);
+int BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m,
+ BN_CTX *ctx);
+int BN_mod_sub_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
+ const BIGNUM *m);
+int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m,
+ BN_CTX *ctx);
+int BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx);
+int BN_mod_lshift1(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx);
+int BN_mod_lshift1_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *m);
+int BN_mod_lshift(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m,
+ BN_CTX *ctx);
+int BN_mod_lshift_quick(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m);
+
+BN_ULONG BN_mod_word(const BIGNUM *a, BN_ULONG w);
+BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w);
+int BN_mul_word(BIGNUM *a, BN_ULONG w);
+int BN_add_word(BIGNUM *a, BN_ULONG w);
+int BN_sub_word(BIGNUM *a, BN_ULONG w);
+int BN_set_word(BIGNUM *a, BN_ULONG w);
+BN_ULONG BN_get_word(const BIGNUM *a);
+
+int BN_cmp(const BIGNUM *a, const BIGNUM *b);
+void BN_free(BIGNUM *a);
+int BN_is_bit_set(const BIGNUM *a, int n);
+int BN_lshift(BIGNUM *r, const BIGNUM *a, int n);
+int BN_lshift1(BIGNUM *r, const BIGNUM *a);
+int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
+
+int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
+ const BIGNUM *m, BN_CTX *ctx);
+int BN_mod_exp_mont(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
+ const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
+int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
+ const BIGNUM *m, BN_CTX *ctx,
+ BN_MONT_CTX *in_mont);
+int BN_mod_exp_mont_word(BIGNUM *r, BN_ULONG a, const BIGNUM *p,
+ const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
+int BN_mod_exp2_mont(BIGNUM *r, const BIGNUM *a1, const BIGNUM *p1,
+ const BIGNUM *a2, const BIGNUM *p2, const BIGNUM *m,
+ BN_CTX *ctx, BN_MONT_CTX *m_ctx);
+int BN_mod_exp_simple(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
+ const BIGNUM *m, BN_CTX *ctx);
+
+int BN_mask_bits(BIGNUM *a, int n);
+# ifndef OPENSSL_NO_FP_API
+int BN_print_fp(FILE *fp, const BIGNUM *a);
+# endif
+# ifdef HEADER_BIO_H
+int BN_print(BIO *fp, const BIGNUM *a);
+# else
+int BN_print(void *fp, const BIGNUM *a);
+# endif
+int BN_reciprocal(BIGNUM *r, const BIGNUM *m, int len, BN_CTX *ctx);
+int BN_rshift(BIGNUM *r, const BIGNUM *a, int n);
+int BN_rshift1(BIGNUM *r, const BIGNUM *a);
+void BN_clear(BIGNUM *a);
+BIGNUM *BN_dup(const BIGNUM *a);
+int BN_ucmp(const BIGNUM *a, const BIGNUM *b);
+int BN_set_bit(BIGNUM *a, int n);
+int BN_clear_bit(BIGNUM *a, int n);
+char *BN_bn2hex(const BIGNUM *a);
+char *BN_bn2dec(const BIGNUM *a);
+int BN_hex2bn(BIGNUM **a, const char *str);
+int BN_dec2bn(BIGNUM **a, const char *str);
+int BN_asc2bn(BIGNUM **a, const char *str);
+int BN_gcd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
+int BN_kronecker(const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); /* returns
+ * -2 for
+ * error */
+BIGNUM *BN_mod_inverse(BIGNUM *ret,
+ const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx);
+BIGNUM *BN_mod_sqrt(BIGNUM *ret,
+ const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx);
+
+void BN_consttime_swap(BN_ULONG swap, BIGNUM *a, BIGNUM *b, int nwords);
+
+/* Deprecated versions */
+# ifndef OPENSSL_NO_DEPRECATED
+BIGNUM *BN_generate_prime(BIGNUM *ret, int bits, int safe,
+ const BIGNUM *add, const BIGNUM *rem,
+ void (*callback) (int, int, void *), void *cb_arg);
+int BN_is_prime(const BIGNUM *p, int nchecks,
+ void (*callback) (int, int, void *),
+ BN_CTX *ctx, void *cb_arg);
+int BN_is_prime_fasttest(const BIGNUM *p, int nchecks,
+ void (*callback) (int, int, void *), BN_CTX *ctx,
+ void *cb_arg, int do_trial_division);
+# endif /* !defined(OPENSSL_NO_DEPRECATED) */
+
+/* Newer versions */
+int BN_generate_prime_ex(BIGNUM *ret, int bits, int safe, const BIGNUM *add,
+ const BIGNUM *rem, BN_GENCB *cb);
+int BN_is_prime_ex(const BIGNUM *p, int nchecks, BN_CTX *ctx, BN_GENCB *cb);
+int BN_is_prime_fasttest_ex(const BIGNUM *p, int nchecks, BN_CTX *ctx,
+ int do_trial_division, BN_GENCB *cb);
+
+int BN_X931_generate_Xpq(BIGNUM *Xp, BIGNUM *Xq, int nbits, BN_CTX *ctx);
+
+int BN_X931_derive_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2,
+ const BIGNUM *Xp, const BIGNUM *Xp1,
+ const BIGNUM *Xp2, const BIGNUM *e, BN_CTX *ctx,
+ BN_GENCB *cb);
+int BN_X931_generate_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2, BIGNUM *Xp1,
+ BIGNUM *Xp2, const BIGNUM *Xp, const BIGNUM *e,
+ BN_CTX *ctx, BN_GENCB *cb);
+
+BN_MONT_CTX *BN_MONT_CTX_new(void);
+void BN_MONT_CTX_init(BN_MONT_CTX *ctx);
+int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
+ BN_MONT_CTX *mont, BN_CTX *ctx);
+# define BN_to_montgomery(r,a,mont,ctx) BN_mod_mul_montgomery(\
+ (r),(a),&((mont)->RR),(mont),(ctx))
+int BN_from_montgomery(BIGNUM *r, const BIGNUM *a,
+ BN_MONT_CTX *mont, BN_CTX *ctx);
+void BN_MONT_CTX_free(BN_MONT_CTX *mont);
+int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx);
+BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to, BN_MONT_CTX *from);
+BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, int lock,
+ const BIGNUM *mod, BN_CTX *ctx);
+
+/* BN_BLINDING flags */
+# define BN_BLINDING_NO_UPDATE 0x00000001
+# define BN_BLINDING_NO_RECREATE 0x00000002
+
+BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, BIGNUM *mod);
+void BN_BLINDING_free(BN_BLINDING *b);
+int BN_BLINDING_update(BN_BLINDING *b, BN_CTX *ctx);
+int BN_BLINDING_convert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx);
+int BN_BLINDING_invert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx);
+int BN_BLINDING_convert_ex(BIGNUM *n, BIGNUM *r, BN_BLINDING *b, BN_CTX *);
+int BN_BLINDING_invert_ex(BIGNUM *n, const BIGNUM *r, BN_BLINDING *b,
+ BN_CTX *);
+# ifndef OPENSSL_NO_DEPRECATED
+unsigned long BN_BLINDING_get_thread_id(const BN_BLINDING *);
+void BN_BLINDING_set_thread_id(BN_BLINDING *, unsigned long);
+# endif
+CRYPTO_THREADID *BN_BLINDING_thread_id(BN_BLINDING *);
+unsigned long BN_BLINDING_get_flags(const BN_BLINDING *);
+void BN_BLINDING_set_flags(BN_BLINDING *, unsigned long);
+BN_BLINDING *BN_BLINDING_create_param(BN_BLINDING *b,
+ const BIGNUM *e, BIGNUM *m, BN_CTX *ctx,
+ int (*bn_mod_exp) (BIGNUM *r,
+ const BIGNUM *a,
+ const BIGNUM *p,
+ const BIGNUM *m,
+ BN_CTX *ctx,
+ BN_MONT_CTX *m_ctx),
+ BN_MONT_CTX *m_ctx);
+
+# ifndef OPENSSL_NO_DEPRECATED
+void BN_set_params(int mul, int high, int low, int mont);
+int BN_get_params(int which); /* 0, mul, 1 high, 2 low, 3 mont */
+# endif
+
+void BN_RECP_CTX_init(BN_RECP_CTX *recp);
+BN_RECP_CTX *BN_RECP_CTX_new(void);
+void BN_RECP_CTX_free(BN_RECP_CTX *recp);
+int BN_RECP_CTX_set(BN_RECP_CTX *recp, const BIGNUM *rdiv, BN_CTX *ctx);
+int BN_mod_mul_reciprocal(BIGNUM *r, const BIGNUM *x, const BIGNUM *y,
+ BN_RECP_CTX *recp, BN_CTX *ctx);
+int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
+ const BIGNUM *m, BN_CTX *ctx);
+int BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m,
+ BN_RECP_CTX *recp, BN_CTX *ctx);
+
+# ifndef OPENSSL_NO_EC2M
+
+/*
+ * Functions for arithmetic over binary polynomials represented by BIGNUMs.
+ * The BIGNUM::neg property of BIGNUMs representing binary polynomials is
+ * ignored. Note that input arguments are not const so that their bit arrays
+ * can be expanded to the appropriate size if needed.
+ */
+
+/*
+ * r = a + b
+ */
+int BN_GF2m_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
+# define BN_GF2m_sub(r, a, b) BN_GF2m_add(r, a, b)
+/*
+ * r=a mod p
+ */
+int BN_GF2m_mod(BIGNUM *r, const BIGNUM *a, const BIGNUM *p);
+/* r = (a * b) mod p */
+int BN_GF2m_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
+ const BIGNUM *p, BN_CTX *ctx);
+/* r = (a * a) mod p */
+int BN_GF2m_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
+/* r = (1 / b) mod p */
+int BN_GF2m_mod_inv(BIGNUM *r, const BIGNUM *b, const BIGNUM *p, BN_CTX *ctx);
+/* r = (a / b) mod p */
+int BN_GF2m_mod_div(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
+ const BIGNUM *p, BN_CTX *ctx);
+/* r = (a ^ b) mod p */
+int BN_GF2m_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
+ const BIGNUM *p, BN_CTX *ctx);
+/* r = sqrt(a) mod p */
+int BN_GF2m_mod_sqrt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
+ BN_CTX *ctx);
+/* r^2 + r = a mod p */
+int BN_GF2m_mod_solve_quad(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
+ BN_CTX *ctx);
+# define BN_GF2m_cmp(a, b) BN_ucmp((a), (b))
+/*-
+ * Some functions allow for representation of the irreducible polynomials
+ * as an unsigned int[], say p. The irreducible f(t) is then of the form:
+ * t^p[0] + t^p[1] + ... + t^p[k]
+ * where m = p[0] > p[1] > ... > p[k] = 0.
+ */
+/* r = a mod p */
+int BN_GF2m_mod_arr(BIGNUM *r, const BIGNUM *a, const int p[]);
+/* r = (a * b) mod p */
+int BN_GF2m_mod_mul_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
+ const int p[], BN_CTX *ctx);
+/* r = (a * a) mod p */
+int BN_GF2m_mod_sqr_arr(BIGNUM *r, const BIGNUM *a, const int p[],
+ BN_CTX *ctx);
+/* r = (1 / b) mod p */
+int BN_GF2m_mod_inv_arr(BIGNUM *r, const BIGNUM *b, const int p[],
+ BN_CTX *ctx);
+/* r = (a / b) mod p */
+int BN_GF2m_mod_div_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
+ const int p[], BN_CTX *ctx);
+/* r = (a ^ b) mod p */
+int BN_GF2m_mod_exp_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
+ const int p[], BN_CTX *ctx);
+/* r = sqrt(a) mod p */
+int BN_GF2m_mod_sqrt_arr(BIGNUM *r, const BIGNUM *a,
+ const int p[], BN_CTX *ctx);
+/* r^2 + r = a mod p */
+int BN_GF2m_mod_solve_quad_arr(BIGNUM *r, const BIGNUM *a,
+ const int p[], BN_CTX *ctx);
+int BN_GF2m_poly2arr(const BIGNUM *a, int p[], int max);
+int BN_GF2m_arr2poly(const int p[], BIGNUM *a);
+
+# endif
+
+/*
+ * faster mod functions for the 'NIST primes' 0 <= a < p^2
+ */
+int BN_nist_mod_192(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
+int BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
+int BN_nist_mod_256(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
+int BN_nist_mod_384(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
+int BN_nist_mod_521(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
+
+const BIGNUM *BN_get0_nist_prime_192(void);
+const BIGNUM *BN_get0_nist_prime_224(void);
+const BIGNUM *BN_get0_nist_prime_256(void);
+const BIGNUM *BN_get0_nist_prime_384(void);
+const BIGNUM *BN_get0_nist_prime_521(void);
+
+/* library internal functions */
+
+# define bn_expand(a,bits) ((((((bits+BN_BITS2-1))/BN_BITS2)) <= (a)->dmax)?\
+ (a):bn_expand2((a),(bits+BN_BITS2-1)/BN_BITS2))
+# define bn_wexpand(a,words) (((words) <= (a)->dmax)?(a):bn_expand2((a),(words)))
+BIGNUM *bn_expand2(BIGNUM *a, int words);
+# ifndef OPENSSL_NO_DEPRECATED
+BIGNUM *bn_dup_expand(const BIGNUM *a, int words); /* unused */
+# endif
+
+/*-
+ * Bignum consistency macros
+ * There is one "API" macro, bn_fix_top(), for stripping leading zeroes from
+ * bignum data after direct manipulations on the data. There is also an
+ * "internal" macro, bn_check_top(), for verifying that there are no leading
+ * zeroes. Unfortunately, some auditing is required due to the fact that
+ * bn_fix_top() has become an overabused duct-tape because bignum data is
+ * occasionally passed around in an inconsistent state. So the following
+ * changes have been made to sort this out;
+ * - bn_fix_top()s implementation has been moved to bn_correct_top()
+ * - if BN_DEBUG isn't defined, bn_fix_top() maps to bn_correct_top(), and
+ * bn_check_top() is as before.
+ * - if BN_DEBUG *is* defined;
+ * - bn_check_top() tries to pollute unused words even if the bignum 'top' is
+ * consistent. (ed: only if BN_DEBUG_RAND is defined)
+ * - bn_fix_top() maps to bn_check_top() rather than "fixing" anything.
+ * The idea is to have debug builds flag up inconsistent bignums when they
+ * occur. If that occurs in a bn_fix_top(), we examine the code in question; if
+ * the use of bn_fix_top() was appropriate (ie. it follows directly after code
+ * that manipulates the bignum) it is converted to bn_correct_top(), and if it
+ * was not appropriate, we convert it permanently to bn_check_top() and track
+ * down the cause of the bug. Eventually, no internal code should be using the
+ * bn_fix_top() macro. External applications and libraries should try this with
+ * their own code too, both in terms of building against the openssl headers
+ * with BN_DEBUG defined *and* linking with a version of OpenSSL built with it
+ * defined. This not only improves external code, it provides more test
+ * coverage for openssl's own code.
+ */
+
+# ifdef BN_DEBUG
+
+/* We only need assert() when debugging */
+# include <assert.h>
+
+# ifdef BN_DEBUG_RAND
+/* To avoid "make update" cvs wars due to BN_DEBUG, use some tricks */
+# ifndef RAND_pseudo_bytes
+int RAND_pseudo_bytes(unsigned char *buf, int num);
+# define BN_DEBUG_TRIX
+# endif
+# define bn_pollute(a) \
+ do { \
+ const BIGNUM *_bnum1 = (a); \
+ if(_bnum1->top < _bnum1->dmax) { \
+ unsigned char _tmp_char; \
+ /* We cast away const without the compiler knowing, any \
+ * *genuinely* constant variables that aren't mutable \
+ * wouldn't be constructed with top!=dmax. */ \
+ BN_ULONG *_not_const; \
+ memcpy(&_not_const, &_bnum1->d, sizeof(BN_ULONG*)); \
+ /* Debug only - safe to ignore error return */ \
+ RAND_pseudo_bytes(&_tmp_char, 1); \
+ memset((unsigned char *)(_not_const + _bnum1->top), _tmp_char, \
+ (_bnum1->dmax - _bnum1->top) * sizeof(BN_ULONG)); \
+ } \
+ } while(0)
+# ifdef BN_DEBUG_TRIX
+# undef RAND_pseudo_bytes
+# endif
+# else
+# define bn_pollute(a)
+# endif
+# define bn_check_top(a) \
+ do { \
+ const BIGNUM *_bnum2 = (a); \
+ if (_bnum2 != NULL) { \
+ assert((_bnum2->top == 0) || \
+ (_bnum2->d[_bnum2->top - 1] != 0)); \
+ bn_pollute(_bnum2); \
+ } \
+ } while(0)
+
+# define bn_fix_top(a) bn_check_top(a)
+
+# define bn_check_size(bn, bits) bn_wcheck_size(bn, ((bits+BN_BITS2-1))/BN_BITS2)
+# define bn_wcheck_size(bn, words) \
+ do { \
+ const BIGNUM *_bnum2 = (bn); \
+ assert((words) <= (_bnum2)->dmax && (words) >= (_bnum2)->top); \
+ /* avoid unused variable warning with NDEBUG */ \
+ (void)(_bnum2); \
+ } while(0)
+
+# else /* !BN_DEBUG */
+
+# define bn_pollute(a)
+# define bn_check_top(a)
+# define bn_fix_top(a) bn_correct_top(a)
+# define bn_check_size(bn, bits)
+# define bn_wcheck_size(bn, words)
+
+# endif
+
+# define bn_correct_top(a) \
+ { \
+ BN_ULONG *ftl; \
+ int tmp_top = (a)->top; \
+ if (tmp_top > 0) \
+ { \
+ for (ftl= &((a)->d[tmp_top-1]); tmp_top > 0; tmp_top--) \
+ if (*(ftl--)) break; \
+ (a)->top = tmp_top; \
+ } \
+ bn_pollute(a); \
+ }
+
+BN_ULONG bn_mul_add_words(BN_ULONG *rp, const BN_ULONG *ap, int num,
+ BN_ULONG w);
+BN_ULONG bn_mul_words(BN_ULONG *rp, const BN_ULONG *ap, int num, BN_ULONG w);
+void bn_sqr_words(BN_ULONG *rp, const BN_ULONG *ap, int num);
+BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d);
+BN_ULONG bn_add_words(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,
+ int num);
+BN_ULONG bn_sub_words(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,
+ int num);
+
+/* Primes from RFC 2409 */
+BIGNUM *get_rfc2409_prime_768(BIGNUM *bn);
+BIGNUM *get_rfc2409_prime_1024(BIGNUM *bn);
+
+/* Primes from RFC 3526 */
+BIGNUM *get_rfc3526_prime_1536(BIGNUM *bn);
+BIGNUM *get_rfc3526_prime_2048(BIGNUM *bn);
+BIGNUM *get_rfc3526_prime_3072(BIGNUM *bn);
+BIGNUM *get_rfc3526_prime_4096(BIGNUM *bn);
+BIGNUM *get_rfc3526_prime_6144(BIGNUM *bn);
+BIGNUM *get_rfc3526_prime_8192(BIGNUM *bn);
+
+int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom);
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_BN_strings(void);
+
+/* Error codes for the BN functions. */
+
+/* Function codes. */
+# define BN_F_BNRAND 127
+# define BN_F_BN_BLINDING_CONVERT_EX 100
+# define BN_F_BN_BLINDING_CREATE_PARAM 128
+# define BN_F_BN_BLINDING_INVERT_EX 101
+# define BN_F_BN_BLINDING_NEW 102
+# define BN_F_BN_BLINDING_UPDATE 103
+# define BN_F_BN_BN2DEC 104
+# define BN_F_BN_BN2HEX 105
+# define BN_F_BN_CTX_GET 116
+# define BN_F_BN_CTX_NEW 106
+# define BN_F_BN_CTX_START 129
+# define BN_F_BN_DIV 107
+# define BN_F_BN_DIV_NO_BRANCH 138
+# define BN_F_BN_DIV_RECP 130
+# define BN_F_BN_EXP 123
+# define BN_F_BN_EXPAND2 108
+# define BN_F_BN_EXPAND_INTERNAL 120
+# define BN_F_BN_GF2M_MOD 131
+# define BN_F_BN_GF2M_MOD_EXP 132
+# define BN_F_BN_GF2M_MOD_MUL 133
+# define BN_F_BN_GF2M_MOD_SOLVE_QUAD 134
+# define BN_F_BN_GF2M_MOD_SOLVE_QUAD_ARR 135
+# define BN_F_BN_GF2M_MOD_SQR 136
+# define BN_F_BN_GF2M_MOD_SQRT 137
+# define BN_F_BN_LSHIFT 145
+# define BN_F_BN_MOD_EXP2_MONT 118
+# define BN_F_BN_MOD_EXP_MONT 109
+# define BN_F_BN_MOD_EXP_MONT_CONSTTIME 124
+# define BN_F_BN_MOD_EXP_MONT_WORD 117
+# define BN_F_BN_MOD_EXP_RECP 125
+# define BN_F_BN_MOD_EXP_SIMPLE 126
+# define BN_F_BN_MOD_INVERSE 110
+# define BN_F_BN_MOD_INVERSE_NO_BRANCH 139
+# define BN_F_BN_MOD_LSHIFT_QUICK 119
+# define BN_F_BN_MOD_MUL_RECIPROCAL 111
+# define BN_F_BN_MOD_SQRT 121
+# define BN_F_BN_MPI2BN 112
+# define BN_F_BN_NEW 113
+# define BN_F_BN_RAND 114
+# define BN_F_BN_RAND_RANGE 122
+# define BN_F_BN_RSHIFT 146
+# define BN_F_BN_USUB 115
+
+/* Reason codes. */
+# define BN_R_ARG2_LT_ARG3 100
+# define BN_R_BAD_RECIPROCAL 101
+# define BN_R_BIGNUM_TOO_LONG 114
+# define BN_R_BITS_TOO_SMALL 118
+# define BN_R_CALLED_WITH_EVEN_MODULUS 102
+# define BN_R_DIV_BY_ZERO 103
+# define BN_R_ENCODING_ERROR 104
+# define BN_R_EXPAND_ON_STATIC_BIGNUM_DATA 105
+# define BN_R_INPUT_NOT_REDUCED 110
+# define BN_R_INVALID_LENGTH 106
+# define BN_R_INVALID_RANGE 115
+# define BN_R_INVALID_SHIFT 119
+# define BN_R_NOT_A_SQUARE 111
+# define BN_R_NOT_INITIALIZED 107
+# define BN_R_NO_INVERSE 108
+# define BN_R_NO_SOLUTION 116
+# define BN_R_P_IS_NOT_PRIME 112
+# define BN_R_TOO_MANY_ITERATIONS 113
+# define BN_R_TOO_MANY_TEMPORARY_VARIABLES 109
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/deps/openssl/openssl/include/openssl/buffer.h b/deps/openssl/openssl/include/openssl/buffer.h
index 1d2c2a2ec1b..c343dd772f1 100644
--- a/deps/openssl/openssl/include/openssl/buffer.h
+++ b/deps/openssl/openssl/include/openssl/buffer.h
@@ -1 +1,119 @@
-#include "../../crypto/buffer/buffer.h"
+/* crypto/buffer/buffer.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_BUFFER_H
+# define HEADER_BUFFER_H
+
+# include <openssl/ossl_typ.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# include <stddef.h>
+
+# if !defined(NO_SYS_TYPES_H)
+# include <sys/types.h>
+# endif
+
+/* Already declared in ossl_typ.h */
+/* typedef struct buf_mem_st BUF_MEM; */
+
+struct buf_mem_st {
+ size_t length; /* current number of bytes */
+ char *data;
+ size_t max; /* size of buffer */
+};
+
+BUF_MEM *BUF_MEM_new(void);
+void BUF_MEM_free(BUF_MEM *a);
+int BUF_MEM_grow(BUF_MEM *str, size_t len);
+int BUF_MEM_grow_clean(BUF_MEM *str, size_t len);
+size_t BUF_strnlen(const char *str, size_t maxlen);
+char *BUF_strdup(const char *str);
+char *BUF_strndup(const char *str, size_t siz);
+void *BUF_memdup(const void *data, size_t siz);
+void BUF_reverse(unsigned char *out, const unsigned char *in, size_t siz);
+
+/* safe string functions */
+size_t BUF_strlcpy(char *dst, const char *src, size_t siz);
+size_t BUF_strlcat(char *dst, const char *src, size_t siz);
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_BUF_strings(void);
+
+/* Error codes for the BUF functions. */
+
+/* Function codes. */
+# define BUF_F_BUF_MEMDUP 103
+# define BUF_F_BUF_MEM_GROW 100
+# define BUF_F_BUF_MEM_GROW_CLEAN 105
+# define BUF_F_BUF_MEM_NEW 101
+# define BUF_F_BUF_STRDUP 102
+# define BUF_F_BUF_STRNDUP 104
+
+/* Reason codes. */
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/deps/openssl/openssl/include/openssl/camellia.h b/deps/openssl/openssl/include/openssl/camellia.h
index 5a0a141eed5..9be7c0fd999 100644
--- a/deps/openssl/openssl/include/openssl/camellia.h
+++ b/deps/openssl/openssl/include/openssl/camellia.h
@@ -1 +1,132 @@
-#include "../../crypto/camellia/camellia.h"
+/* crypto/camellia/camellia.h -*- mode:C; c-file-style: "eay" -*- */
+/* ====================================================================
+ * Copyright (c) 2006 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ */
+
+#ifndef HEADER_CAMELLIA_H
+# define HEADER_CAMELLIA_H
+
+# include <openssl/opensslconf.h>
+
+# ifdef OPENSSL_NO_CAMELLIA
+# error CAMELLIA is disabled.
+# endif
+
+# include <stddef.h>
+
+# define CAMELLIA_ENCRYPT 1
+# define CAMELLIA_DECRYPT 0
+
+/*
+ * Because array size can't be a const in C, the following two are macros.
+ * Both sizes are in bytes.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* This should be a hidden type, but EVP requires that the size be known */
+
+# define CAMELLIA_BLOCK_SIZE 16
+# define CAMELLIA_TABLE_BYTE_LEN 272
+# define CAMELLIA_TABLE_WORD_LEN (CAMELLIA_TABLE_BYTE_LEN / 4)
+
+typedef unsigned int KEY_TABLE_TYPE[CAMELLIA_TABLE_WORD_LEN]; /* to match
+ * with WORD */
+
+struct camellia_key_st {
+ union {
+ double d; /* ensures 64-bit align */
+ KEY_TABLE_TYPE rd_key;
+ } u;
+ int grand_rounds;
+};
+typedef struct camellia_key_st CAMELLIA_KEY;
+
+# ifdef OPENSSL_FIPS
+int private_Camellia_set_key(const unsigned char *userKey, const int bits,
+ CAMELLIA_KEY *key);
+# endif
+int Camellia_set_key(const unsigned char *userKey, const int bits,
+ CAMELLIA_KEY *key);
+
+void Camellia_encrypt(const unsigned char *in, unsigned char *out,
+ const CAMELLIA_KEY *key);
+void Camellia_decrypt(const unsigned char *in, unsigned char *out,
+ const CAMELLIA_KEY *key);
+
+void Camellia_ecb_encrypt(const unsigned char *in, unsigned char *out,
+ const CAMELLIA_KEY *key, const int enc);
+void Camellia_cbc_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const CAMELLIA_KEY *key,
+ unsigned char *ivec, const int enc);
+void Camellia_cfb128_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const CAMELLIA_KEY *key,
+ unsigned char *ivec, int *num, const int enc);
+void Camellia_cfb1_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const CAMELLIA_KEY *key,
+ unsigned char *ivec, int *num, const int enc);
+void Camellia_cfb8_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const CAMELLIA_KEY *key,
+ unsigned char *ivec, int *num, const int enc);
+void Camellia_ofb128_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const CAMELLIA_KEY *key,
+ unsigned char *ivec, int *num);
+void Camellia_ctr128_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const CAMELLIA_KEY *key,
+ unsigned char ivec[CAMELLIA_BLOCK_SIZE],
+ unsigned char ecount_buf[CAMELLIA_BLOCK_SIZE],
+ unsigned int *num);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !HEADER_Camellia_H */
diff --git a/deps/openssl/openssl/include/openssl/cast.h b/deps/openssl/openssl/include/openssl/cast.h
index 12cf92c4a9b..0003ec9c7c0 100644
--- a/deps/openssl/openssl/include/openssl/cast.h
+++ b/deps/openssl/openssl/include/openssl/cast.h
@@ -1 +1,107 @@
-#include "../../crypto/cast/cast.h"
+/* crypto/cast/cast.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_CAST_H
+# define HEADER_CAST_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# include <openssl/opensslconf.h>
+
+# ifdef OPENSSL_NO_CAST
+# error CAST is disabled.
+# endif
+
+# define CAST_ENCRYPT 1
+# define CAST_DECRYPT 0
+
+# define CAST_LONG unsigned int
+
+# define CAST_BLOCK 8
+# define CAST_KEY_LENGTH 16
+
+typedef struct cast_key_st {
+ CAST_LONG data[32];
+ int short_key; /* Use reduced rounds for short key */
+} CAST_KEY;
+
+# ifdef OPENSSL_FIPS
+void private_CAST_set_key(CAST_KEY *key, int len, const unsigned char *data);
+# endif
+void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data);
+void CAST_ecb_encrypt(const unsigned char *in, unsigned char *out,
+ const CAST_KEY *key, int enc);
+void CAST_encrypt(CAST_LONG *data, const CAST_KEY *key);
+void CAST_decrypt(CAST_LONG *data, const CAST_KEY *key);
+void CAST_cbc_encrypt(const unsigned char *in, unsigned char *out,
+ long length, const CAST_KEY *ks, unsigned char *iv,
+ int enc);
+void CAST_cfb64_encrypt(const unsigned char *in, unsigned char *out,
+ long length, const CAST_KEY *schedule,
+ unsigned char *ivec, int *num, int enc);
+void CAST_ofb64_encrypt(const unsigned char *in, unsigned char *out,
+ long length, const CAST_KEY *schedule,
+ unsigned char *ivec, int *num);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/deps/openssl/openssl/include/openssl/cmac.h b/deps/openssl/openssl/include/openssl/cmac.h
index a7579aeabdd..175be8348ab 100644
--- a/deps/openssl/openssl/include/openssl/cmac.h
+++ b/deps/openssl/openssl/include/openssl/cmac.h
@@ -1 +1,82 @@
-#include "../../crypto/cmac/cmac.h"
+/* crypto/cmac/cmac.h */
+/*
+ * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
+ * project.
+ */
+/* ====================================================================
+ * Copyright (c) 2010 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * licensing@OpenSSL.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ */
+
+#ifndef HEADER_CMAC_H
+# define HEADER_CMAC_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# include <openssl/evp.h>
+
+/* Opaque */
+typedef struct CMAC_CTX_st CMAC_CTX;
+
+CMAC_CTX *CMAC_CTX_new(void);
+void CMAC_CTX_cleanup(CMAC_CTX *ctx);
+void CMAC_CTX_free(CMAC_CTX *ctx);
+EVP_CIPHER_CTX *CMAC_CTX_get0_cipher_ctx(CMAC_CTX *ctx);
+int CMAC_CTX_copy(CMAC_CTX *out, const CMAC_CTX *in);
+
+int CMAC_Init(CMAC_CTX *ctx, const void *key, size_t keylen,
+ const EVP_CIPHER *cipher, ENGINE *impl);
+int CMAC_Update(CMAC_CTX *ctx, const void *data, size_t dlen);
+int CMAC_Final(CMAC_CTX *ctx, unsigned char *out, size_t *poutlen);
+int CMAC_resume(CMAC_CTX *ctx);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/deps/openssl/openssl/include/openssl/cms.h b/deps/openssl/openssl/include/openssl/cms.h
index 8687c7fe467..e6c7f964bf4 100644
--- a/deps/openssl/openssl/include/openssl/cms.h
+++ b/deps/openssl/openssl/include/openssl/cms.h
@@ -1 +1,555 @@
-#include "../../crypto/cms/cms.h"
+/* crypto/cms/cms.h */
+/*
+ * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
+ * project.
+ */
+/* ====================================================================
+ * Copyright (c) 2008 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * licensing@OpenSSL.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ */
+
+#ifndef HEADER_CMS_H
+# define HEADER_CMS_H
+
+# include <openssl/x509.h>
+
+# ifdef OPENSSL_NO_CMS
+# error CMS is disabled.
+# endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct CMS_ContentInfo_st CMS_ContentInfo;
+typedef struct CMS_SignerInfo_st CMS_SignerInfo;
+typedef struct CMS_CertificateChoices CMS_CertificateChoices;
+typedef struct CMS_RevocationInfoChoice_st CMS_RevocationInfoChoice;
+typedef struct CMS_RecipientInfo_st CMS_RecipientInfo;
+typedef struct CMS_ReceiptRequest_st CMS_ReceiptRequest;
+typedef struct CMS_Receipt_st CMS_Receipt;
+typedef struct CMS_RecipientEncryptedKey_st CMS_RecipientEncryptedKey;
+typedef struct CMS_OtherKeyAttribute_st CMS_OtherKeyAttribute;
+
+DECLARE_STACK_OF(CMS_SignerInfo)
+DECLARE_STACK_OF(GENERAL_NAMES)
+DECLARE_STACK_OF(CMS_RecipientEncryptedKey)
+DECLARE_ASN1_FUNCTIONS(CMS_ContentInfo)
+DECLARE_ASN1_FUNCTIONS(CMS_ReceiptRequest)
+DECLARE_ASN1_PRINT_FUNCTION(CMS_ContentInfo)
+
+# define CMS_SIGNERINFO_ISSUER_SERIAL 0
+# define CMS_SIGNERINFO_KEYIDENTIFIER 1
+
+# define CMS_RECIPINFO_NONE -1
+# define CMS_RECIPINFO_TRANS 0
+# define CMS_RECIPINFO_AGREE 1
+# define CMS_RECIPINFO_KEK 2
+# define CMS_RECIPINFO_PASS 3
+# define CMS_RECIPINFO_OTHER 4
+
+/* S/MIME related flags */
+
+# define CMS_TEXT 0x1
+# define CMS_NOCERTS 0x2
+# define CMS_NO_CONTENT_VERIFY 0x4
+# define CMS_NO_ATTR_VERIFY 0x8
+# define CMS_NOSIGS \
+ (CMS_NO_CONTENT_VERIFY|CMS_NO_ATTR_VERIFY)
+# define CMS_NOINTERN 0x10
+# define CMS_NO_SIGNER_CERT_VERIFY 0x20
+# define CMS_NOVERIFY 0x20
+# define CMS_DETACHED 0x40
+# define CMS_BINARY 0x80
+# define CMS_NOATTR 0x100
+# define CMS_NOSMIMECAP 0x200
+# define CMS_NOOLDMIMETYPE 0x400
+# define CMS_CRLFEOL 0x800
+# define CMS_STREAM 0x1000
+# define CMS_NOCRL 0x2000
+# define CMS_PARTIAL 0x4000
+# define CMS_REUSE_DIGEST 0x8000
+# define CMS_USE_KEYID 0x10000
+# define CMS_DEBUG_DECRYPT 0x20000
+# define CMS_KEY_PARAM 0x40000
+
+const ASN1_OBJECT *CMS_get0_type(CMS_ContentInfo *cms);
+
+BIO *CMS_dataInit(CMS_ContentInfo *cms, BIO *icont);
+int CMS_dataFinal(CMS_ContentInfo *cms, BIO *bio);
+
+ASN1_OCTET_STRING **CMS_get0_content(CMS_ContentInfo *cms);
+int CMS_is_detached(CMS_ContentInfo *cms);
+int CMS_set_detached(CMS_ContentInfo *cms, int detached);
+
+# ifdef HEADER_PEM_H
+DECLARE_PEM_rw_const(CMS, CMS_ContentInfo)
+# endif
+int CMS_stream(unsigned char ***boundary, CMS_ContentInfo *cms);
+CMS_ContentInfo *d2i_CMS_bio(BIO *bp, CMS_ContentInfo **cms);
+int i2d_CMS_bio(BIO *bp, CMS_ContentInfo *cms);
+
+BIO *BIO_new_CMS(BIO *out, CMS_ContentInfo *cms);
+int i2d_CMS_bio_stream(BIO *out, CMS_ContentInfo *cms, BIO *in, int flags);
+int PEM_write_bio_CMS_stream(BIO *out, CMS_ContentInfo *cms, BIO *in,
+ int flags);
+CMS_ContentInfo *SMIME_read_CMS(BIO *bio, BIO **bcont);
+int SMIME_write_CMS(BIO *bio, CMS_ContentInfo *cms, BIO *data, int flags);
+
+int CMS_final(CMS_ContentInfo *cms, BIO *data, BIO *dcont,
+ unsigned int flags);
+
+CMS_ContentInfo *CMS_sign(X509 *signcert, EVP_PKEY *pkey,
+ STACK_OF(X509) *certs, BIO *data,
+ unsigned int flags);
+
+CMS_ContentInfo *CMS_sign_receipt(CMS_SignerInfo *si,
+ X509 *signcert, EVP_PKEY *pkey,
+ STACK_OF(X509) *certs, unsigned int flags);
+
+int CMS_data(CMS_ContentInfo *cms, BIO *out, unsigned int flags);
+CMS_ContentInfo *CMS_data_create(BIO *in, unsigned int flags);
+
+int CMS_digest_verify(CMS_ContentInfo *cms, BIO *dcont, BIO *out,
+ unsigned int flags);
+CMS_ContentInfo *CMS_digest_create(BIO *in, const EVP_MD *md,
+ unsigned int flags);
+
+int CMS_EncryptedData_decrypt(CMS_ContentInfo *cms,
+ const unsigned char *key, size_t keylen,
+ BIO *dcont, BIO *out, unsigned int flags);
+
+CMS_ContentInfo *CMS_EncryptedData_encrypt(BIO *in, const EVP_CIPHER *cipher,
+ const unsigned char *key,
+ size_t keylen, unsigned int flags);
+
+int CMS_EncryptedData_set1_key(CMS_ContentInfo *cms, const EVP_CIPHER *ciph,
+ const unsigned char *key, size_t keylen);
+
+int CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs,
+ X509_STORE *store, BIO *dcont, BIO *out, unsigned int flags);
+
+int CMS_verify_receipt(CMS_ContentInfo *rcms, CMS_ContentInfo *ocms,
+ STACK_OF(X509) *certs,
+ X509_STORE *store, unsigned int flags);
+
+STACK_OF(X509) *CMS_get0_signers(CMS_ContentInfo *cms);
+
+CMS_ContentInfo *CMS_encrypt(STACK_OF(X509) *certs, BIO *in,
+ const EVP_CIPHER *cipher, unsigned int flags);
+
+int CMS_decrypt(CMS_ContentInfo *cms, EVP_PKEY *pkey, X509 *cert,
+ BIO *dcont, BIO *out, unsigned int flags);
+
+int CMS_decrypt_set1_pkey(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert);
+int CMS_decrypt_set1_key(CMS_ContentInfo *cms,
+ unsigned char *key, size_t keylen,
+ unsigned char *id, size_t idlen);
+int CMS_decrypt_set1_password(CMS_ContentInfo *cms,
+ unsigned char *pass, ossl_ssize_t passlen);
+
+STACK_OF(CMS_RecipientInfo) *CMS_get0_RecipientInfos(CMS_ContentInfo *cms);
+int CMS_RecipientInfo_type(CMS_RecipientInfo *ri);
+EVP_PKEY_CTX *CMS_RecipientInfo_get0_pkey_ctx(CMS_RecipientInfo *ri);
+CMS_ContentInfo *CMS_EnvelopedData_create(const EVP_CIPHER *cipher);
+CMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms,
+ X509 *recip, unsigned int flags);
+int CMS_RecipientInfo_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pkey);
+int CMS_RecipientInfo_ktri_cert_cmp(CMS_RecipientInfo *ri, X509 *cert);
+int CMS_RecipientInfo_ktri_get0_algs(CMS_RecipientInfo *ri,
+ EVP_PKEY **pk, X509 **recip,
+ X509_ALGOR **palg);
+int CMS_RecipientInfo_ktri_get0_signer_id(CMS_RecipientInfo *ri,
+ ASN1_OCTET_STRING **keyid,
+ X509_NAME **issuer,
+ ASN1_INTEGER **sno);
+
+CMS_RecipientInfo *CMS_add0_recipient_key(CMS_ContentInfo *cms, int nid,
+ unsigned char *key, size_t keylen,
+ unsigned char *id, size_t idlen,
+ ASN1_GENERALIZEDTIME *date,
+ ASN1_OBJECT *otherTypeId,
+ ASN1_TYPE *otherType);
+
+int CMS_RecipientInfo_kekri_get0_id(CMS_RecipientInfo *ri,
+ X509_ALGOR **palg,
+ ASN1_OCTET_STRING **pid,
+ ASN1_GENERALIZEDTIME **pdate,
+ ASN1_OBJECT **potherid,
+ ASN1_TYPE **pothertype);
+
+int CMS_RecipientInfo_set0_key(CMS_RecipientInfo *ri,
+ unsigned char *key, size_t keylen);
+
+int CMS_RecipientInfo_kekri_id_cmp(CMS_RecipientInfo *ri,
+ const unsigned char *id, size_t idlen);
+
+int CMS_RecipientInfo_set0_password(CMS_RecipientInfo *ri,
+ unsigned char *pass,
+ ossl_ssize_t passlen);
+
+CMS_RecipientInfo *CMS_add0_recipient_password(CMS_ContentInfo *cms,
+ int iter, int wrap_nid,
+ int pbe_nid,
+ unsigned char *pass,
+ ossl_ssize_t passlen,
+ const EVP_CIPHER *kekciph);
+
+int CMS_RecipientInfo_decrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri);
+int CMS_RecipientInfo_encrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri);
+
+int CMS_uncompress(CMS_ContentInfo *cms, BIO *dcont, BIO *out,
+ unsigned int flags);
+CMS_ContentInfo *CMS_compress(BIO *in, int comp_nid, unsigned int flags);
+
+int CMS_set1_eContentType(CMS_ContentInfo *cms, const ASN1_OBJECT *oid);
+const ASN1_OBJECT *CMS_get0_eContentType(CMS_ContentInfo *cms);
+
+CMS_CertificateChoices *CMS_add0_CertificateChoices(CMS_ContentInfo *cms);
+int CMS_add0_cert(CMS_ContentInfo *cms, X509 *cert);
+int CMS_add1_cert(CMS_ContentInfo *cms, X509 *cert);
+STACK_OF(X509) *CMS_get1_certs(CMS_ContentInfo *cms);
+
+CMS_RevocationInfoChoice *CMS_add0_RevocationInfoChoice(CMS_ContentInfo *cms);
+int CMS_add0_crl(CMS_ContentInfo *cms, X509_CRL *crl);
+int CMS_add1_crl(CMS_ContentInfo *cms, X509_CRL *crl);
+STACK_OF(X509_CRL) *CMS_get1_crls(CMS_ContentInfo *cms);
+
+int CMS_SignedData_init(CMS_ContentInfo *cms);
+CMS_SignerInfo *CMS_add1_signer(CMS_ContentInfo *cms,
+ X509 *signer, EVP_PKEY *pk, const EVP_MD *md,
+ unsigned int flags);
+EVP_PKEY_CTX *CMS_SignerInfo_get0_pkey_ctx(CMS_SignerInfo *si);
+EVP_MD_CTX *CMS_SignerInfo_get0_md_ctx(CMS_SignerInfo *si);
+STACK_OF(CMS_SignerInfo) *CMS_get0_SignerInfos(CMS_ContentInfo *cms);
+
+void CMS_SignerInfo_set1_signer_cert(CMS_SignerInfo *si, X509 *signer);
+int CMS_SignerInfo_get0_signer_id(CMS_SignerInfo *si,
+ ASN1_OCTET_STRING **keyid,
+ X509_NAME **issuer, ASN1_INTEGER **sno);
+int CMS_SignerInfo_cert_cmp(CMS_SignerInfo *si, X509 *cert);
+int CMS_set1_signers_certs(CMS_ContentInfo *cms, STACK_OF(X509) *certs,
+ unsigned int flags);
+void CMS_SignerInfo_get0_algs(CMS_SignerInfo *si, EVP_PKEY **pk,
+ X509 **signer, X509_ALGOR **pdig,
+ X509_ALGOR **psig);
+ASN1_OCTET_STRING *CMS_SignerInfo_get0_signature(CMS_SignerInfo *si);
+int CMS_SignerInfo_sign(CMS_SignerInfo *si);
+int CMS_SignerInfo_verify(CMS_SignerInfo *si);
+int CMS_SignerInfo_verify_content(CMS_SignerInfo *si, BIO *chain);
+
+int CMS_add_smimecap(CMS_SignerInfo *si, STACK_OF(X509_ALGOR) *algs);
+int CMS_add_simple_smimecap(STACK_OF(X509_ALGOR) **algs,
+ int algnid, int keysize);
+int CMS_add_standard_smimecap(STACK_OF(X509_ALGOR) **smcap);
+
+int CMS_signed_get_attr_count(const CMS_SignerInfo *si);
+int CMS_signed_get_attr_by_NID(const CMS_SignerInfo *si, int nid,
+ int lastpos);
+int CMS_signed_get_attr_by_OBJ(const CMS_SignerInfo *si, ASN1_OBJECT *obj,
+ int lastpos);
+X509_ATTRIBUTE *CMS_signed_get_attr(const CMS_SignerInfo *si, int loc);
+X509_ATTRIBUTE *CMS_signed_delete_attr(CMS_SignerInfo *si, int loc);
+int CMS_signed_add1_attr(CMS_SignerInfo *si, X509_ATTRIBUTE *attr);
+int CMS_signed_add1_attr_by_OBJ(CMS_SignerInfo *si,
+ const ASN1_OBJECT *obj, int type,
+ const void *bytes, int len);
+int CMS_signed_add1_attr_by_NID(CMS_SignerInfo *si,
+ int nid, int type,
+ const void *bytes, int len);
+int CMS_signed_add1_attr_by_txt(CMS_SignerInfo *si,
+ const char *attrname, int type,
+ const void *bytes, int len);
+void *CMS_signed_get0_data_by_OBJ(CMS_SignerInfo *si, ASN1_OBJECT *oid,
+ int lastpos, int type);
+
+int CMS_unsigned_get_attr_count(const CMS_SignerInfo *si);
+int CMS_unsigned_get_attr_by_NID(const CMS_SignerInfo *si, int nid,
+ int lastpos);
+int CMS_unsigned_get_attr_by_OBJ(const CMS_SignerInfo *si, ASN1_OBJECT *obj,
+ int lastpos);
+X509_ATTRIBUTE *CMS_unsigned_get_attr(const CMS_SignerInfo *si, int loc);
+X509_ATTRIBUTE *CMS_unsigned_delete_attr(CMS_SignerInfo *si, int loc);
+int CMS_unsigned_add1_attr(CMS_SignerInfo *si, X509_ATTRIBUTE *attr);
+int CMS_unsigned_add1_attr_by_OBJ(CMS_SignerInfo *si,
+ const ASN1_OBJECT *obj, int type,
+ const void *bytes, int len);
+int CMS_unsigned_add1_attr_by_NID(CMS_SignerInfo *si,
+ int nid, int type,
+ const void *bytes, int len);
+int CMS_unsigned_add1_attr_by_txt(CMS_SignerInfo *si,
+ const char *attrname, int type,
+ const void *bytes, int len);
+void *CMS_unsigned_get0_data_by_OBJ(CMS_SignerInfo *si, ASN1_OBJECT *oid,
+ int lastpos, int type);
+
+# ifdef HEADER_X509V3_H
+
+int CMS_get1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest **prr);
+CMS_ReceiptRequest *CMS_ReceiptRequest_create0(unsigned char *id, int idlen,
+ int allorfirst,
+ STACK_OF(GENERAL_NAMES)
+ *receiptList, STACK_OF(GENERAL_NAMES)
+ *receiptsTo);
+int CMS_add1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest *rr);
+void CMS_ReceiptRequest_get0_values(CMS_ReceiptRequest *rr,
+ ASN1_STRING **pcid,
+ int *pallorfirst,
+ STACK_OF(GENERAL_NAMES) **plist,
+ STACK_OF(GENERAL_NAMES) **prto);
+# endif
+int CMS_RecipientInfo_kari_get0_alg(CMS_RecipientInfo *ri,
+ X509_ALGOR **palg,
+ ASN1_OCTET_STRING **pukm);
+STACK_OF(CMS_RecipientEncryptedKey)
+*CMS_RecipientInfo_kari_get0_reks(CMS_RecipientInfo *ri);
+
+int CMS_RecipientInfo_kari_get0_orig_id(CMS_RecipientInfo *ri,
+ X509_ALGOR **pubalg,
+ ASN1_BIT_STRING **pubkey,
+ ASN1_OCTET_STRING **keyid,
+ X509_NAME **issuer,
+ ASN1_INTEGER **sno);
+
+int CMS_RecipientInfo_kari_orig_id_cmp(CMS_RecipientInfo *ri, X509 *cert);
+
+int CMS_RecipientEncryptedKey_get0_id(CMS_RecipientEncryptedKey *rek,
+ ASN1_OCTET_STRING **keyid,
+ ASN1_GENERALIZEDTIME **tm,
+ CMS_OtherKeyAttribute **other,
+ X509_NAME **issuer, ASN1_INTEGER **sno);
+int CMS_RecipientEncryptedKey_cert_cmp(CMS_RecipientEncryptedKey *rek,
+ X509 *cert);
+int CMS_RecipientInfo_kari_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pk);
+EVP_CIPHER_CTX *CMS_RecipientInfo_kari_get0_ctx(CMS_RecipientInfo *ri);
+int CMS_RecipientInfo_kari_decrypt(CMS_ContentInfo *cms,
+ CMS_RecipientInfo *ri,
+ CMS_RecipientEncryptedKey *rek);
+
+int CMS_SharedInfo_encode(unsigned char **pder, X509_ALGOR *kekalg,
+ ASN1_OCTET_STRING *ukm, int keylen);
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_CMS_strings(void);
+
+/* Error codes for the CMS functions. */
+
+/* Function codes. */
+# define CMS_F_CHECK_CONTENT 99
+# define CMS_F_CMS_ADD0_CERT 164
+# define CMS_F_CMS_ADD0_RECIPIENT_KEY 100
+# define CMS_F_CMS_ADD0_RECIPIENT_PASSWORD 165
+# define CMS_F_CMS_ADD1_RECEIPTREQUEST 158
+# define CMS_F_CMS_ADD1_RECIPIENT_CERT 101
+# define CMS_F_CMS_ADD1_SIGNER 102
+# define CMS_F_CMS_ADD1_SIGNINGTIME 103
+# define CMS_F_CMS_COMPRESS 104
+# define CMS_F_CMS_COMPRESSEDDATA_CREATE 105
+# define CMS_F_CMS_COMPRESSEDDATA_INIT_BIO 106
+# define CMS_F_CMS_COPY_CONTENT 107
+# define CMS_F_CMS_COPY_MESSAGEDIGEST 108
+# define CMS_F_CMS_DATA 109
+# define CMS_F_CMS_DATAFINAL 110
+# define CMS_F_CMS_DATAINIT 111
+# define CMS_F_CMS_DECRYPT 112
+# define CMS_F_CMS_DECRYPT_SET1_KEY 113
+# define CMS_F_CMS_DECRYPT_SET1_PASSWORD 166
+# define CMS_F_CMS_DECRYPT_SET1_PKEY 114
+# define CMS_F_CMS_DIGESTALGORITHM_FIND_CTX 115
+# define CMS_F_CMS_DIGESTALGORITHM_INIT_BIO 116
+# define CMS_F_CMS_DIGESTEDDATA_DO_FINAL 117
+# define CMS_F_CMS_DIGEST_VERIFY 118
+# define CMS_F_CMS_ENCODE_RECEIPT 161
+# define CMS_F_CMS_ENCRYPT 119
+# define CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO 120
+# define CMS_F_CMS_ENCRYPTEDDATA_DECRYPT 121
+# define CMS_F_CMS_ENCRYPTEDDATA_ENCRYPT 122
+# define CMS_F_CMS_ENCRYPTEDDATA_SET1_KEY 123
+# define CMS_F_CMS_ENVELOPEDDATA_CREATE 124
+# define CMS_F_CMS_ENVELOPEDDATA_INIT_BIO 125
+# define CMS_F_CMS_ENVELOPED_DATA_INIT 126
+# define CMS_F_CMS_ENV_ASN1_CTRL 171
+# define CMS_F_CMS_FINAL 127
+# define CMS_F_CMS_GET0_CERTIFICATE_CHOICES 128
+# define CMS_F_CMS_GET0_CONTENT 129
+# define CMS_F_CMS_GET0_ECONTENT_TYPE 130
+# define CMS_F_CMS_GET0_ENVELOPED 131
+# define CMS_F_CMS_GET0_REVOCATION_CHOICES 132
+# define CMS_F_CMS_GET0_SIGNED 133
+# define CMS_F_CMS_MSGSIGDIGEST_ADD1 162
+# define CMS_F_CMS_RECEIPTREQUEST_CREATE0 159
+# define CMS_F_CMS_RECEIPT_VERIFY 160
+# define CMS_F_CMS_RECIPIENTINFO_DECRYPT 134
+# define CMS_F_CMS_RECIPIENTINFO_ENCRYPT 169
+# define CMS_F_CMS_RECIPIENTINFO_KARI_ENCRYPT 178
+# define CMS_F_CMS_RECIPIENTINFO_KARI_GET0_ALG 175
+# define CMS_F_CMS_RECIPIENTINFO_KARI_GET0_ORIG_ID 173
+# define CMS_F_CMS_RECIPIENTINFO_KARI_GET0_REKS 172
+# define CMS_F_CMS_RECIPIENTINFO_KARI_ORIG_ID_CMP 174
+# define CMS_F_CMS_RECIPIENTINFO_KEKRI_DECRYPT 135
+# define CMS_F_CMS_RECIPIENTINFO_KEKRI_ENCRYPT 136
+# define CMS_F_CMS_RECIPIENTINFO_KEKRI_GET0_ID 137
+# define CMS_F_CMS_RECIPIENTINFO_KEKRI_ID_CMP 138
+# define CMS_F_CMS_RECIPIENTINFO_KTRI_CERT_CMP 139
+# define CMS_F_CMS_RECIPIENTINFO_KTRI_DECRYPT 140
+# define CMS_F_CMS_RECIPIENTINFO_KTRI_ENCRYPT 141
+# define CMS_F_CMS_RECIPIENTINFO_KTRI_GET0_ALGS 142
+# define CMS_F_CMS_RECIPIENTINFO_KTRI_GET0_SIGNER_ID 143
+# define CMS_F_CMS_RECIPIENTINFO_PWRI_CRYPT 167
+# define CMS_F_CMS_RECIPIENTINFO_SET0_KEY 144
+# define CMS_F_CMS_RECIPIENTINFO_SET0_PASSWORD 168
+# define CMS_F_CMS_RECIPIENTINFO_SET0_PKEY 145
+# define CMS_F_CMS_SD_ASN1_CTRL 170
+# define CMS_F_CMS_SET1_IAS 176
+# define CMS_F_CMS_SET1_KEYID 177
+# define CMS_F_CMS_SET1_SIGNERIDENTIFIER 146
+# define CMS_F_CMS_SET_DETACHED 147
+# define CMS_F_CMS_SIGN 148
+# define CMS_F_CMS_SIGNED_DATA_INIT 149
+# define CMS_F_CMS_SIGNERINFO_CONTENT_SIGN 150
+# define CMS_F_CMS_SIGNERINFO_SIGN 151
+# define CMS_F_CMS_SIGNERINFO_VERIFY 152
+# define CMS_F_CMS_SIGNERINFO_VERIFY_CERT 153
+# define CMS_F_CMS_SIGNERINFO_VERIFY_CONTENT 154
+# define CMS_F_CMS_SIGN_RECEIPT 163
+# define CMS_F_CMS_STREAM 155
+# define CMS_F_CMS_UNCOMPRESS 156
+# define CMS_F_CMS_VERIFY 157
+
+/* Reason codes. */
+# define CMS_R_ADD_SIGNER_ERROR 99
+# define CMS_R_CERTIFICATE_ALREADY_PRESENT 175
+# define CMS_R_CERTIFICATE_HAS_NO_KEYID 160
+# define CMS_R_CERTIFICATE_VERIFY_ERROR 100
+# define CMS_R_CIPHER_INITIALISATION_ERROR 101
+# define CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR 102
+# define CMS_R_CMS_DATAFINAL_ERROR 103
+# define CMS_R_CMS_LIB 104
+# define CMS_R_CONTENTIDENTIFIER_MISMATCH 170
+# define CMS_R_CONTENT_NOT_FOUND 105
+# define CMS_R_CONTENT_TYPE_MISMATCH 171
+# define CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA 106
+# define CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA 107
+# define CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA 108
+# define CMS_R_CONTENT_VERIFY_ERROR 109
+# define CMS_R_CTRL_ERROR 110
+# define CMS_R_CTRL_FAILURE 111
+# define CMS_R_DECRYPT_ERROR 112
+# define CMS_R_DIGEST_ERROR 161
+# define CMS_R_ERROR_GETTING_PUBLIC_KEY 113
+# define CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE 114
+# define CMS_R_ERROR_SETTING_KEY 115
+# define CMS_R_ERROR_SETTING_RECIPIENTINFO 116
+# define CMS_R_INVALID_ENCRYPTED_KEY_LENGTH 117
+# define CMS_R_INVALID_KEY_ENCRYPTION_PARAMETER 176
+# define CMS_R_INVALID_KEY_LENGTH 118
+# define CMS_R_MD_BIO_INIT_ERROR 119
+# define CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH 120
+# define CMS_R_MESSAGEDIGEST_WRONG_LENGTH 121
+# define CMS_R_MSGSIGDIGEST_ERROR 172
+# define CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE 162
+# define CMS_R_MSGSIGDIGEST_WRONG_LENGTH 163
+# define CMS_R_NEED_ONE_SIGNER 164
+# define CMS_R_NOT_A_SIGNED_RECEIPT 165
+# define CMS_R_NOT_ENCRYPTED_DATA 122
+# define CMS_R_NOT_KEK 123
+# define CMS_R_NOT_KEY_AGREEMENT 181
+# define CMS_R_NOT_KEY_TRANSPORT 124
+# define CMS_R_NOT_PWRI 177
+# define CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 125
+# define CMS_R_NO_CIPHER 126
+# define CMS_R_NO_CONTENT 127
+# define CMS_R_NO_CONTENT_TYPE 173
+# define CMS_R_NO_DEFAULT_DIGEST 128
+# define CMS_R_NO_DIGEST_SET 129
+# define CMS_R_NO_KEY 130
+# define CMS_R_NO_KEY_OR_CERT 174
+# define CMS_R_NO_MATCHING_DIGEST 131
+# define CMS_R_NO_MATCHING_RECIPIENT 132
+# define CMS_R_NO_MATCHING_SIGNATURE 166
+# define CMS_R_NO_MSGSIGDIGEST 167
+# define CMS_R_NO_PASSWORD 178
+# define CMS_R_NO_PRIVATE_KEY 133
+# define CMS_R_NO_PUBLIC_KEY 134
+# define CMS_R_NO_RECEIPT_REQUEST 168
+# define CMS_R_NO_SIGNERS 135
+# define CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 136
+# define CMS_R_RECEIPT_DECODE_ERROR 169
+# define CMS_R_RECIPIENT_ERROR 137
+# define CMS_R_SIGNER_CERTIFICATE_NOT_FOUND 138
+# define CMS_R_SIGNFINAL_ERROR 139
+# define CMS_R_SMIME_TEXT_ERROR 140
+# define CMS_R_STORE_INIT_ERROR 141
+# define CMS_R_TYPE_NOT_COMPRESSED_DATA 142
+# define CMS_R_TYPE_NOT_DATA 143
+# define CMS_R_TYPE_NOT_DIGESTED_DATA 144
+# define CMS_R_TYPE_NOT_ENCRYPTED_DATA 145
+# define CMS_R_TYPE_NOT_ENVELOPED_DATA 146
+# define CMS_R_UNABLE_TO_FINALIZE_CONTEXT 147
+# define CMS_R_UNKNOWN_CIPHER 148
+# define CMS_R_UNKNOWN_DIGEST_ALGORIHM 149
+# define CMS_R_UNKNOWN_ID 150
+# define CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM 151
+# define CMS_R_UNSUPPORTED_CONTENT_TYPE 152
+# define CMS_R_UNSUPPORTED_KEK_ALGORITHM 153
+# define CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM 179
+# define CMS_R_UNSUPPORTED_RECIPIENT_TYPE 154
+# define CMS_R_UNSUPPORTED_RECPIENTINFO_TYPE 155
+# define CMS_R_UNSUPPORTED_TYPE 156
+# define CMS_R_UNWRAP_ERROR 157
+# define CMS_R_UNWRAP_FAILURE 180
+# define CMS_R_VERIFICATION_FAILURE 158
+# define CMS_R_WRAP_ERROR 159
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/deps/openssl/openssl/include/openssl/comp.h b/deps/openssl/openssl/include/openssl/comp.h
index d14e36cc36b..406c428aaee 100644
--- a/deps/openssl/openssl/include/openssl/comp.h
+++ b/deps/openssl/openssl/include/openssl/comp.h
@@ -1 +1,79 @@
-#include "../../crypto/comp/comp.h"
+
+#ifndef HEADER_COMP_H
+# define HEADER_COMP_H
+
+# include <openssl/crypto.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct comp_ctx_st COMP_CTX;
+
+typedef struct comp_method_st {
+ int type; /* NID for compression library */
+ const char *name; /* A text string to identify the library */
+ int (*init) (COMP_CTX *ctx);
+ void (*finish) (COMP_CTX *ctx);
+ int (*compress) (COMP_CTX *ctx,
+ unsigned char *out, unsigned int olen,
+ unsigned char *in, unsigned int ilen);
+ int (*expand) (COMP_CTX *ctx,
+ unsigned char *out, unsigned int olen,
+ unsigned char *in, unsigned int ilen);
+ /*
+ * The following two do NOTHING, but are kept for backward compatibility
+ */
+ long (*ctrl) (void);
+ long (*callback_ctrl) (void);
+} COMP_METHOD;
+
+struct comp_ctx_st {
+ COMP_METHOD *meth;
+ unsigned long compress_in;
+ unsigned long compress_out;
+ unsigned long expand_in;
+ unsigned long expand_out;
+ CRYPTO_EX_DATA ex_data;
+};
+
+COMP_CTX *COMP_CTX_new(COMP_METHOD *meth);
+void COMP_CTX_free(COMP_CTX *ctx);
+int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen,
+ unsigned char *in, int ilen);
+int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen,
+ unsigned char *in, int ilen);
+COMP_METHOD *COMP_rle(void);
+COMP_METHOD *COMP_zlib(void);
+void COMP_zlib_cleanup(void);
+
+# ifdef HEADER_BIO_H
+# ifdef ZLIB
+BIO_METHOD *BIO_f_zlib(void);
+# endif
+# endif
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_COMP_strings(void);
+
+/* Error codes for the COMP functions. */
+
+/* Function codes. */
+# define COMP_F_BIO_ZLIB_FLUSH 99
+# define COMP_F_BIO_ZLIB_NEW 100
+# define COMP_F_BIO_ZLIB_READ 101
+# define COMP_F_BIO_ZLIB_WRITE 102
+
+/* Reason codes. */
+# define COMP_R_ZLIB_DEFLATE_ERROR 99
+# define COMP_R_ZLIB_INFLATE_ERROR 100
+# define COMP_R_ZLIB_NOT_SUPPORTED 101
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/deps/openssl/openssl/include/openssl/conf.h b/deps/openssl/openssl/include/openssl/conf.h
index 3882c82f8d0..8d926d5d826 100644
--- a/deps/openssl/openssl/include/openssl/conf.h
+++ b/deps/openssl/openssl/include/openssl/conf.h
@@ -1 +1,267 @@
-#include "../../crypto/conf/conf.h"
+/* crypto/conf/conf.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_CONF_H
+# define HEADER_CONF_H
+
+# include <openssl/bio.h>
+# include <openssl/lhash.h>
+# include <openssl/stack.h>
+# include <openssl/safestack.h>
+# include <openssl/e_os2.h>
+
+# include <openssl/ossl_typ.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct {
+ char *section;
+ char *name;
+ char *value;
+} CONF_VALUE;
+
+DECLARE_STACK_OF(CONF_VALUE)
+DECLARE_LHASH_OF(CONF_VALUE);
+
+struct conf_st;
+struct conf_method_st;
+typedef struct conf_method_st CONF_METHOD;
+
+struct conf_method_st {
+ const char *name;
+ CONF *(*create) (CONF_METHOD *meth);
+ int (*init) (CONF *conf);
+ int (*destroy) (CONF *conf);
+ int (*destroy_data) (CONF *conf);
+ int (*load_bio) (CONF *conf, BIO *bp, long *eline);
+ int (*dump) (const CONF *conf, BIO *bp);
+ int (*is_number) (const CONF *conf, char c);
+ int (*to_int) (const CONF *conf, char c);
+ int (*load) (CONF *conf, const char *name, long *eline);
+};
+
+/* Module definitions */
+
+typedef struct conf_imodule_st CONF_IMODULE;
+typedef struct conf_module_st CONF_MODULE;
+
+DECLARE_STACK_OF(CONF_MODULE)
+DECLARE_STACK_OF(CONF_IMODULE)
+
+/* DSO module function typedefs */
+typedef int conf_init_func (CONF_IMODULE *md, const CONF *cnf);
+typedef void conf_finish_func (CONF_IMODULE *md);
+
+# define CONF_MFLAGS_IGNORE_ERRORS 0x1
+# define CONF_MFLAGS_IGNORE_RETURN_CODES 0x2
+# define CONF_MFLAGS_SILENT 0x4
+# define CONF_MFLAGS_NO_DSO 0x8
+# define CONF_MFLAGS_IGNORE_MISSING_FILE 0x10
+# define CONF_MFLAGS_DEFAULT_SECTION 0x20
+
+int CONF_set_default_method(CONF_METHOD *meth);
+void CONF_set_nconf(CONF *conf, LHASH_OF(CONF_VALUE) *hash);
+LHASH_OF(CONF_VALUE) *CONF_load(LHASH_OF(CONF_VALUE) *conf, const char *file,
+ long *eline);
+# ifndef OPENSSL_NO_FP_API
+LHASH_OF(CONF_VALUE) *CONF_load_fp(LHASH_OF(CONF_VALUE) *conf, FILE *fp,
+ long *eline);
+# endif
+LHASH_OF(CONF_VALUE) *CONF_load_bio(LHASH_OF(CONF_VALUE) *conf, BIO *bp,
+ long *eline);
+STACK_OF(CONF_VALUE) *CONF_get_section(LHASH_OF(CONF_VALUE) *conf,
+ const char *section);
+char *CONF_get_string(LHASH_OF(CONF_VALUE) *conf, const char *group,
+ const char *name);
+long CONF_get_number(LHASH_OF(CONF_VALUE) *conf, const char *group,
+ const char *name);
+void CONF_free(LHASH_OF(CONF_VALUE) *conf);
+int CONF_dump_fp(LHASH_OF(CONF_VALUE) *conf, FILE *out);
+int CONF_dump_bio(LHASH_OF(CONF_VALUE) *conf, BIO *out);
+
+void OPENSSL_config(const char *config_name);
+void OPENSSL_no_config(void);
+
+/*
+ * New conf code. The semantics are different from the functions above. If
+ * that wasn't the case, the above functions would have been replaced
+ */
+
+struct conf_st {
+ CONF_METHOD *meth;
+ void *meth_data;
+ LHASH_OF(CONF_VALUE) *data;
+};
+
+CONF *NCONF_new(CONF_METHOD *meth);
+CONF_METHOD *NCONF_default(void);
+CONF_METHOD *NCONF_WIN32(void);
+# if 0 /* Just to give you an idea of what I have in
+ * mind */
+CONF_METHOD *NCONF_XML(void);
+# endif
+void NCONF_free(CONF *conf);
+void NCONF_free_data(CONF *conf);
+
+int NCONF_load(CONF *conf, const char *file, long *eline);
+# ifndef OPENSSL_NO_FP_API
+int NCONF_load_fp(CONF *conf, FILE *fp, long *eline);
+# endif
+int NCONF_load_bio(CONF *conf, BIO *bp, long *eline);
+STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf,
+ const char *section);
+char *NCONF_get_string(const CONF *conf, const char *group, const char *name);
+int NCONF_get_number_e(const CONF *conf, const char *group, const char *name,
+ long *result);
+int NCONF_dump_fp(const CONF *conf, FILE *out);
+int NCONF_dump_bio(const CONF *conf, BIO *out);
+
+# if 0 /* The following function has no error
+ * checking, and should therefore be avoided */
+long NCONF_get_number(CONF *conf, char *group, char *name);
+# else
+# define NCONF_get_number(c,g,n,r) NCONF_get_number_e(c,g,n,r)
+# endif
+
+/* Module functions */
+
+int CONF_modules_load(const CONF *cnf, const char *appname,
+ unsigned long flags);
+int CONF_modules_load_file(const char *filename, const char *appname,
+ unsigned long flags);
+void CONF_modules_unload(int all);
+void CONF_modules_finish(void);
+void CONF_modules_free(void);
+int CONF_module_add(const char *name, conf_init_func *ifunc,
+ conf_finish_func *ffunc);
+
+const char *CONF_imodule_get_name(const CONF_IMODULE *md);
+const char *CONF_imodule_get_value(const CONF_IMODULE *md);
+void *CONF_imodule_get_usr_data(const CONF_IMODULE *md);
+void CONF_imodule_set_usr_data(CONF_IMODULE *md, void *usr_data);
+CONF_MODULE *CONF_imodule_get_module(const CONF_IMODULE *md);
+unsigned long CONF_imodule_get_flags(const CONF_IMODULE *md);
+void CONF_imodule_set_flags(CONF_IMODULE *md, unsigned long flags);
+void *CONF_module_get_usr_data(CONF_MODULE *pmod);
+void CONF_module_set_usr_data(CONF_MODULE *pmod, void *usr_data);
+
+char *CONF_get1_default_config_file(void);
+
+int CONF_parse_list(const char *list, int sep, int nospc,
+ int (*list_cb) (const char *elem, int len, void *usr),
+ void *arg);
+
+void OPENSSL_load_builtin_modules(void);
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_CONF_strings(void);
+
+/* Error codes for the CONF functions. */
+
+/* Function codes. */
+# define CONF_F_CONF_DUMP_FP 104
+# define CONF_F_CONF_LOAD 100
+# define CONF_F_CONF_LOAD_BIO 102
+# define CONF_F_CONF_LOAD_FP 103
+# define CONF_F_CONF_MODULES_LOAD 116
+# define CONF_F_CONF_PARSE_LIST 119
+# define CONF_F_DEF_LOAD 120
+# define CONF_F_DEF_LOAD_BIO 121
+# define CONF_F_MODULE_INIT 115
+# define CONF_F_MODULE_LOAD_DSO 117
+# define CONF_F_MODULE_RUN 118
+# define CONF_F_NCONF_DUMP_BIO 105
+# define CONF_F_NCONF_DUMP_FP 106
+# define CONF_F_NCONF_GET_NUMBER 107
+# define CONF_F_NCONF_GET_NUMBER_E 112
+# define CONF_F_NCONF_GET_SECTION 108
+# define CONF_F_NCONF_GET_STRING 109
+# define CONF_F_NCONF_LOAD 113
+# define CONF_F_NCONF_LOAD_BIO 110
+# define CONF_F_NCONF_LOAD_FP 114
+# define CONF_F_NCONF_NEW 111
+# define CONF_F_STR_COPY 101
+
+/* Reason codes. */
+# define CONF_R_ERROR_LOADING_DSO 110
+# define CONF_R_LIST_CANNOT_BE_NULL 115
+# define CONF_R_MISSING_CLOSE_SQUARE_BRACKET 100
+# define CONF_R_MISSING_EQUAL_SIGN 101
+# define CONF_R_MISSING_FINISH_FUNCTION 111
+# define CONF_R_MISSING_INIT_FUNCTION 112
+# define CONF_R_MODULE_INITIALIZATION_ERROR 109
+# define CONF_R_NO_CLOSE_BRACE 102
+# define CONF_R_NO_CONF 105
+# define CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE 106
+# define CONF_R_NO_SECTION 107
+# define CONF_R_NO_SUCH_FILE 114
+# define CONF_R_NO_VALUE 108
+# define CONF_R_UNABLE_TO_CREATE_NEW_SECTION 103
+# define CONF_R_UNKNOWN_MODULE_NAME 113
+# define CONF_R_VARIABLE_HAS_NO_VALUE 104
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/deps/openssl/openssl/include/openssl/conf_api.h b/deps/openssl/openssl/include/openssl/conf_api.h
index 03933578574..e478f7df4b1 100644
--- a/deps/openssl/openssl/include/openssl/conf_api.h
+++ b/deps/openssl/openssl/include/openssl/conf_api.h
@@ -1 +1,89 @@
-#include "../../crypto/conf/conf_api.h"
+/* conf_api.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_CONF_API_H
+# define HEADER_CONF_API_H
+
+# include <openssl/lhash.h>
+# include <openssl/conf.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Up until OpenSSL 0.9.5a, this was new_section */
+CONF_VALUE *_CONF_new_section(CONF *conf, const char *section);
+/* Up until OpenSSL 0.9.5a, this was get_section */
+CONF_VALUE *_CONF_get_section(const CONF *conf, const char *section);
+/* Up until OpenSSL 0.9.5a, this was CONF_get_section */
+STACK_OF(CONF_VALUE) *_CONF_get_section_values(const CONF *conf,
+ const char *section);
+
+int _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value);
+char *_CONF_get_string(const CONF *conf, const char *section,
+ const char *name);
+long _CONF_get_number(const CONF *conf, const char *section,
+ const char *name);
+
+int _CONF_new_data(CONF *conf);
+void _CONF_free_data(CONF *conf);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/deps/openssl/openssl/include/openssl/crypto.h b/deps/openssl/openssl/include/openssl/crypto.h
index 7e3d91e42f0..c450d7a3c37 100644
--- a/deps/openssl/openssl/include/openssl/crypto.h
+++ b/deps/openssl/openssl/include/openssl/crypto.h
@@ -1 +1,661 @@
-#include "../../crypto/crypto.h"
+/* crypto/crypto.h */
+/* ====================================================================
+ * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+/* ====================================================================
+ * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
+ * ECDH support in OpenSSL originally developed by
+ * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
+ */
+
+#ifndef HEADER_CRYPTO_H
+# define HEADER_CRYPTO_H
+
+# include <stdlib.h>
+
+# include <openssl/e_os2.h>
+
+# ifndef OPENSSL_NO_FP_API
+# include <stdio.h>
+# endif
+
+# include <openssl/stack.h>
+# include <openssl/safestack.h>
+# include <openssl/opensslv.h>
+# include <openssl/ossl_typ.h>
+
+# ifdef CHARSET_EBCDIC
+# include <openssl/ebcdic.h>
+# endif
+
+/*
+ * Resolve problems on some operating systems with symbol names that clash
+ * one way or another
+ */
+# include <openssl/symhacks.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Backward compatibility to SSLeay */
+/*
+ * This is more to be used to check the correct DLL is being used in the MS
+ * world.
+ */
+# define SSLEAY_VERSION_NUMBER OPENSSL_VERSION_NUMBER
+# define SSLEAY_VERSION 0
+/* #define SSLEAY_OPTIONS 1 no longer supported */
+# define SSLEAY_CFLAGS 2
+# define SSLEAY_BUILT_ON 3
+# define SSLEAY_PLATFORM 4
+# define SSLEAY_DIR 5
+
+/* Already declared in ossl_typ.h */
+# if 0
+typedef struct crypto_ex_data_st CRYPTO_EX_DATA;
+/* Called when a new object is created */
+typedef int CRYPTO_EX_new (void *parent, void *ptr, CRYPTO_EX_DATA *ad,
+ int idx, long argl, void *argp);
+/* Called when an object is free()ed */
+typedef void CRYPTO_EX_free (void *parent, void *ptr, CRYPTO_EX_DATA *ad,
+ int idx, long argl, void *argp);
+/* Called when we need to dup an object */
+typedef int CRYPTO_EX_dup (CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from,
+ void *from_d, int idx, long argl, void *argp);
+# endif
+
+/* A generic structure to pass assorted data in a expandable way */
+typedef struct openssl_item_st {
+ int code;
+ void *value; /* Not used for flag attributes */
+ size_t value_size; /* Max size of value for output, length for
+ * input */
+ size_t *value_length; /* Returned length of value for output */
+} OPENSSL_ITEM;
+
+/*
+ * When changing the CRYPTO_LOCK_* list, be sure to maintin the text lock
+ * names in cryptlib.c
+ */
+
+# define CRYPTO_LOCK_ERR 1
+# define CRYPTO_LOCK_EX_DATA 2
+# define CRYPTO_LOCK_X509 3
+# define CRYPTO_LOCK_X509_INFO 4
+# define CRYPTO_LOCK_X509_PKEY 5
+# define CRYPTO_LOCK_X509_CRL 6
+# define CRYPTO_LOCK_X509_REQ 7
+# define CRYPTO_LOCK_DSA 8
+# define CRYPTO_LOCK_RSA 9
+# define CRYPTO_LOCK_EVP_PKEY 10
+# define CRYPTO_LOCK_X509_STORE 11
+# define CRYPTO_LOCK_SSL_CTX 12
+# define CRYPTO_LOCK_SSL_CERT 13
+# define CRYPTO_LOCK_SSL_SESSION 14
+# define CRYPTO_LOCK_SSL_SESS_CERT 15
+# define CRYPTO_LOCK_SSL 16
+# define CRYPTO_LOCK_SSL_METHOD 17
+# define CRYPTO_LOCK_RAND 18
+# define CRYPTO_LOCK_RAND2 19
+# define CRYPTO_LOCK_MALLOC 20
+# define CRYPTO_LOCK_BIO 21
+# define CRYPTO_LOCK_GETHOSTBYNAME 22
+# define CRYPTO_LOCK_GETSERVBYNAME 23
+# define CRYPTO_LOCK_READDIR 24
+# define CRYPTO_LOCK_RSA_BLINDING 25
+# define CRYPTO_LOCK_DH 26
+# define CRYPTO_LOCK_MALLOC2 27
+# define CRYPTO_LOCK_DSO 28
+# define CRYPTO_LOCK_DYNLOCK 29
+# define CRYPTO_LOCK_ENGINE 30
+# define CRYPTO_LOCK_UI 31
+# define CRYPTO_LOCK_ECDSA 32
+# define CRYPTO_LOCK_EC 33
+# define CRYPTO_LOCK_ECDH 34
+# define CRYPTO_LOCK_BN 35
+# define CRYPTO_LOCK_EC_PRE_COMP 36
+# define CRYPTO_LOCK_STORE 37
+# define CRYPTO_LOCK_COMP 38
+# define CRYPTO_LOCK_FIPS 39
+# define CRYPTO_LOCK_FIPS2 40
+# define CRYPTO_NUM_LOCKS 41
+
+# define CRYPTO_LOCK 1
+# define CRYPTO_UNLOCK 2
+# define CRYPTO_READ 4
+# define CRYPTO_WRITE 8
+
+# ifndef OPENSSL_NO_LOCKING
+# ifndef CRYPTO_w_lock
+# define CRYPTO_w_lock(type) \
+ CRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE,type,__FILE__,__LINE__)
+# define CRYPTO_w_unlock(type) \
+ CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_WRITE,type,__FILE__,__LINE__)
+# define CRYPTO_r_lock(type) \
+ CRYPTO_lock(CRYPTO_LOCK|CRYPTO_READ,type,__FILE__,__LINE__)
+# define CRYPTO_r_unlock(type) \
+ CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_READ,type,__FILE__,__LINE__)
+# define CRYPTO_add(addr,amount,type) \
+ CRYPTO_add_lock(addr,amount,type,__FILE__,__LINE__)
+# endif
+# else
+# define CRYPTO_w_lock(a)
+# define CRYPTO_w_unlock(a)
+# define CRYPTO_r_lock(a)
+# define CRYPTO_r_unlock(a)
+# define CRYPTO_add(a,b,c) ((*(a))+=(b))
+# endif
+
+/*
+ * Some applications as well as some parts of OpenSSL need to allocate and
+ * deallocate locks in a dynamic fashion. The following typedef makes this
+ * possible in a type-safe manner.
+ */
+/* struct CRYPTO_dynlock_value has to be defined by the application. */
+typedef struct {
+ int references;
+ struct CRYPTO_dynlock_value *data;
+} CRYPTO_dynlock;
+
+/*
+ * The following can be used to detect memory leaks in the SSLeay library. It
+ * used, it turns on malloc checking
+ */
+
+# define CRYPTO_MEM_CHECK_OFF 0x0/* an enume */
+# define CRYPTO_MEM_CHECK_ON 0x1/* a bit */
+# define CRYPTO_MEM_CHECK_ENABLE 0x2/* a bit */
+# define CRYPTO_MEM_CHECK_DISABLE 0x3/* an enume */
+
+/*
+ * The following are bit values to turn on or off options connected to the
+ * malloc checking functionality
+ */
+
+/* Adds time to the memory checking information */
+# define V_CRYPTO_MDEBUG_TIME 0x1/* a bit */
+/* Adds thread number to the memory checking information */
+# define V_CRYPTO_MDEBUG_THREAD 0x2/* a bit */
+
+# define V_CRYPTO_MDEBUG_ALL (V_CRYPTO_MDEBUG_TIME | V_CRYPTO_MDEBUG_THREAD)
+
+/* predec of the BIO type */
+typedef struct bio_st BIO_dummy;
+
+struct crypto_ex_data_st {
+ STACK_OF(void) *sk;
+ /* gcc is screwing up this data structure :-( */
+ int dummy;
+};
+DECLARE_STACK_OF(void)
+
+/*
+ * This stuff is basically class callback functions The current classes are
+ * SSL_CTX, SSL, SSL_SESSION, and a few more
+ */
+
+typedef struct crypto_ex_data_func_st {
+ long argl; /* Arbitary long */
+ void *argp; /* Arbitary void * */
+ CRYPTO_EX_new *new_func;
+ CRYPTO_EX_free *free_func;
+ CRYPTO_EX_dup *dup_func;
+} CRYPTO_EX_DATA_FUNCS;
+
+DECLARE_STACK_OF(CRYPTO_EX_DATA_FUNCS)
+
+/*
+ * Per class, we have a STACK of CRYPTO_EX_DATA_FUNCS for each CRYPTO_EX_DATA
+ * entry.
+ */
+
+# define CRYPTO_EX_INDEX_BIO 0
+# define CRYPTO_EX_INDEX_SSL 1
+# define CRYPTO_EX_INDEX_SSL_CTX 2
+# define CRYPTO_EX_INDEX_SSL_SESSION 3
+# define CRYPTO_EX_INDEX_X509_STORE 4
+# define CRYPTO_EX_INDEX_X509_STORE_CTX 5
+# define CRYPTO_EX_INDEX_RSA 6
+# define CRYPTO_EX_INDEX_DSA 7
+# define CRYPTO_EX_INDEX_DH 8
+# define CRYPTO_EX_INDEX_ENGINE 9
+# define CRYPTO_EX_INDEX_X509 10
+# define CRYPTO_EX_INDEX_UI 11
+# define CRYPTO_EX_INDEX_ECDSA 12
+# define CRYPTO_EX_INDEX_ECDH 13
+# define CRYPTO_EX_INDEX_COMP 14
+# define CRYPTO_EX_INDEX_STORE 15
+
+/*
+ * Dynamically assigned indexes start from this value (don't use directly,
+ * use via CRYPTO_ex_data_new_class).
+ */
+# define CRYPTO_EX_INDEX_USER 100
+
+/*
+ * This is the default callbacks, but we can have others as well: this is
+ * needed in Win32 where the application malloc and the library malloc may
+ * not be the same.
+ */
+# define CRYPTO_malloc_init() CRYPTO_set_mem_functions(\
+ malloc, realloc, free)
+
+# if defined CRYPTO_MDEBUG_ALL || defined CRYPTO_MDEBUG_TIME || defined CRYPTO_MDEBUG_THREAD
+# ifndef CRYPTO_MDEBUG /* avoid duplicate #define */
+# define CRYPTO_MDEBUG
+# endif
+# endif
+
+/*
+ * Set standard debugging functions (not done by default unless CRYPTO_MDEBUG
+ * is defined)
+ */
+# define CRYPTO_malloc_debug_init() do {\
+ CRYPTO_set_mem_debug_functions(\
+ CRYPTO_dbg_malloc,\
+ CRYPTO_dbg_realloc,\
+ CRYPTO_dbg_free,\
+ CRYPTO_dbg_set_options,\
+ CRYPTO_dbg_get_options);\
+ } while(0)
+
+int CRYPTO_mem_ctrl(int mode);
+int CRYPTO_is_mem_check_on(void);
+
+/* for applications */
+# define MemCheck_start() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON)
+# define MemCheck_stop() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_OFF)
+
+/* for library-internal use */
+# define MemCheck_on() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE)
+# define MemCheck_off() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE)
+# define is_MemCheck_on() CRYPTO_is_mem_check_on()
+
+# define OPENSSL_malloc(num) CRYPTO_malloc((int)num,__FILE__,__LINE__)
+# define OPENSSL_strdup(str) CRYPTO_strdup((str),__FILE__,__LINE__)
+# define OPENSSL_realloc(addr,num) \
+ CRYPTO_realloc((char *)addr,(int)num,__FILE__,__LINE__)
+# define OPENSSL_realloc_clean(addr,old_num,num) \
+ CRYPTO_realloc_clean(addr,old_num,num,__FILE__,__LINE__)
+# define OPENSSL_remalloc(addr,num) \
+ CRYPTO_remalloc((char **)addr,(int)num,__FILE__,__LINE__)
+# define OPENSSL_freeFunc CRYPTO_free
+# define OPENSSL_free(addr) CRYPTO_free(addr)
+
+# define OPENSSL_malloc_locked(num) \
+ CRYPTO_malloc_locked((int)num,__FILE__,__LINE__)
+# define OPENSSL_free_locked(addr) CRYPTO_free_locked(addr)
+
+const char *SSLeay_version(int type);
+unsigned long SSLeay(void);
+
+int OPENSSL_issetugid(void);
+
+/* An opaque type representing an implementation of "ex_data" support */
+typedef struct st_CRYPTO_EX_DATA_IMPL CRYPTO_EX_DATA_IMPL;
+/* Return an opaque pointer to the current "ex_data" implementation */
+const CRYPTO_EX_DATA_IMPL *CRYPTO_get_ex_data_implementation(void);
+/* Sets the "ex_data" implementation to be used (if it's not too late) */
+int CRYPTO_set_ex_data_implementation(const CRYPTO_EX_DATA_IMPL *i);
+/* Get a new "ex_data" class, and return the corresponding "class_index" */
+int CRYPTO_ex_data_new_class(void);
+/* Within a given class, get/register a new index */
+int CRYPTO_get_ex_new_index(int class_index, long argl, void *argp,
+ CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func,
+ CRYPTO_EX_free *free_func);
+/*
+ * Initialise/duplicate/free CRYPTO_EX_DATA variables corresponding to a
+ * given class (invokes whatever per-class callbacks are applicable)
+ */
+int CRYPTO_new_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad);
+int CRYPTO_dup_ex_data(int class_index, CRYPTO_EX_DATA *to,
+ CRYPTO_EX_DATA *from);
+void CRYPTO_free_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad);
+/*
+ * Get/set data in a CRYPTO_EX_DATA variable corresponding to a particular
+ * index (relative to the class type involved)
+ */
+int CRYPTO_set_ex_data(CRYPTO_EX_DATA *ad, int idx, void *val);
+void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx);
+/*
+ * This function cleans up all "ex_data" state. It mustn't be called under
+ * potential race-conditions.
+ */
+void CRYPTO_cleanup_all_ex_data(void);
+
+int CRYPTO_get_new_lockid(char *name);
+
+int CRYPTO_num_locks(void); /* return CRYPTO_NUM_LOCKS (shared libs!) */
+void CRYPTO_lock(int mode, int type, const char *file, int line);
+void CRYPTO_set_locking_callback(void (*func) (int mode, int type,
+ const char *file, int line));
+void (*CRYPTO_get_locking_callback(void)) (int mode, int type,
+ const char *file, int line);
+void CRYPTO_set_add_lock_callback(int (*func)
+ (int *num, int mount, int type,
+ const char *file, int line));
+int (*CRYPTO_get_add_lock_callback(void)) (int *num, int mount, int type,
+ const char *file, int line);
+
+/* Don't use this structure directly. */
+typedef struct crypto_threadid_st {
+ void *ptr;
+ unsigned long val;
+} CRYPTO_THREADID;
+/* Only use CRYPTO_THREADID_set_[numeric|pointer]() within callbacks */
+void CRYPTO_THREADID_set_numeric(CRYPTO_THREADID *id, unsigned long val);
+void CRYPTO_THREADID_set_pointer(CRYPTO_THREADID *id, void *ptr);
+int CRYPTO_THREADID_set_callback(void (*threadid_func) (CRYPTO_THREADID *));
+void (*CRYPTO_THREADID_get_callback(void)) (CRYPTO_THREADID *);
+void CRYPTO_THREADID_current(CRYPTO_THREADID *id);
+int CRYPTO_THREADID_cmp(const CRYPTO_THREADID *a, const CRYPTO_THREADID *b);
+void CRYPTO_THREADID_cpy(CRYPTO_THREADID *dest, const CRYPTO_THREADID *src);
+unsigned long CRYPTO_THREADID_hash(const CRYPTO_THREADID *id);
+# ifndef OPENSSL_NO_DEPRECATED
+void CRYPTO_set_id_callback(unsigned long (*func) (void));
+unsigned long (*CRYPTO_get_id_callback(void)) (void);
+unsigned long CRYPTO_thread_id(void);
+# endif
+
+const char *CRYPTO_get_lock_name(int type);
+int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,
+ int line);
+
+int CRYPTO_get_new_dynlockid(void);
+void CRYPTO_destroy_dynlockid(int i);
+struct CRYPTO_dynlock_value *CRYPTO_get_dynlock_value(int i);
+void CRYPTO_set_dynlock_create_callback(struct CRYPTO_dynlock_value
+ *(*dyn_create_function) (const char
+ *file,
+ int line));
+void CRYPTO_set_dynlock_lock_callback(void (*dyn_lock_function)
+ (int mode,
+ struct CRYPTO_dynlock_value *l,
+ const char *file, int line));
+void CRYPTO_set_dynlock_destroy_callback(void (*dyn_destroy_function)
+ (struct CRYPTO_dynlock_value *l,
+ const char *file, int line));
+struct CRYPTO_dynlock_value
+*(*CRYPTO_get_dynlock_create_callback(void)) (const char *file, int line);
+void (*CRYPTO_get_dynlock_lock_callback(void)) (int mode,
+ struct CRYPTO_dynlock_value
+ *l, const char *file,
+ int line);
+void (*CRYPTO_get_dynlock_destroy_callback(void)) (struct CRYPTO_dynlock_value
+ *l, const char *file,
+ int line);
+
+/*
+ * CRYPTO_set_mem_functions includes CRYPTO_set_locked_mem_functions -- call
+ * the latter last if you need different functions
+ */
+int CRYPTO_set_mem_functions(void *(*m) (size_t), void *(*r) (void *, size_t),
+ void (*f) (void *));
+int CRYPTO_set_locked_mem_functions(void *(*m) (size_t),
+ void (*free_func) (void *));
+int CRYPTO_set_mem_ex_functions(void *(*m) (size_t, const char *, int),
+ void *(*r) (void *, size_t, const char *,
+ int), void (*f) (void *));
+int CRYPTO_set_locked_mem_ex_functions(void *(*m) (size_t, const char *, int),
+ void (*free_func) (void *));
+int CRYPTO_set_mem_debug_functions(void (*m)
+ (void *, int, const char *, int, int),
+ void (*r) (void *, void *, int,
+ const char *, int, int),
+ void (*f) (void *, int), void (*so) (long),
+ long (*go) (void));
+void CRYPTO_get_mem_functions(void *(**m) (size_t),
+ void *(**r) (void *, size_t),
+ void (**f) (void *));
+void CRYPTO_get_locked_mem_functions(void *(**m) (size_t),
+ void (**f) (void *));
+void CRYPTO_get_mem_ex_functions(void *(**m) (size_t, const char *, int),
+ void *(**r) (void *, size_t, const char *,
+ int), void (**f) (void *));
+void CRYPTO_get_locked_mem_ex_functions(void
+ *(**m) (size_t, const char *, int),
+ void (**f) (void *));
+void CRYPTO_get_mem_debug_functions(void (**m)
+ (void *, int, const char *, int, int),
+ void (**r) (void *, void *, int,
+ const char *, int, int),
+ void (**f) (void *, int),
+ void (**so) (long), long (**go) (void));
+
+void *CRYPTO_malloc_locked(int num, const char *file, int line);
+void CRYPTO_free_locked(void *ptr);
+void *CRYPTO_malloc(int num, const char *file, int line);
+char *CRYPTO_strdup(const char *str, const char *file, int line);
+void CRYPTO_free(void *ptr);
+void *CRYPTO_realloc(void *addr, int num, const char *file, int line);
+void *CRYPTO_realloc_clean(void *addr, int old_num, int num, const char *file,
+ int line);
+void *CRYPTO_remalloc(void *addr, int num, const char *file, int line);
+
+void OPENSSL_cleanse(void *ptr, size_t len);
+
+void CRYPTO_set_mem_debug_options(long bits);
+long CRYPTO_get_mem_debug_options(void);
+
+# define CRYPTO_push_info(info) \
+ CRYPTO_push_info_(info, __FILE__, __LINE__);
+int CRYPTO_push_info_(const char *info, const char *file, int line);
+int CRYPTO_pop_info(void);
+int CRYPTO_remove_all_info(void);
+
+/*
+ * Default debugging functions (enabled by CRYPTO_malloc_debug_init() macro;
+ * used as default in CRYPTO_MDEBUG compilations):
+ */
+/*-
+ * The last argument has the following significance:
+ *
+ * 0: called before the actual memory allocation has taken place
+ * 1: called after the actual memory allocation has taken place
+ */
+void CRYPTO_dbg_malloc(void *addr, int num, const char *file, int line,
+ int before_p);
+void CRYPTO_dbg_realloc(void *addr1, void *addr2, int num, const char *file,
+ int line, int before_p);
+void CRYPTO_dbg_free(void *addr, int before_p);
+/*-
+ * Tell the debugging code about options. By default, the following values
+ * apply:
+ *
+ * 0: Clear all options.
+ * V_CRYPTO_MDEBUG_TIME (1): Set the "Show Time" option.
+ * V_CRYPTO_MDEBUG_THREAD (2): Set the "Show Thread Number" option.
+ * V_CRYPTO_MDEBUG_ALL (3): 1 + 2
+ */
+void CRYPTO_dbg_set_options(long bits);
+long CRYPTO_dbg_get_options(void);
+
+# ifndef OPENSSL_NO_FP_API
+void CRYPTO_mem_leaks_fp(FILE *);
+# endif
+void CRYPTO_mem_leaks(struct bio_st *bio);
+/* unsigned long order, char *file, int line, int num_bytes, char *addr */
+typedef void *CRYPTO_MEM_LEAK_CB (unsigned long, const char *, int, int,
+ void *);
+void CRYPTO_mem_leaks_cb(CRYPTO_MEM_LEAK_CB *cb);
+
+/* die if we have to */
+void OpenSSLDie(const char *file, int line, const char *assertion);
+# define OPENSSL_assert(e) (void)((e) ? 0 : (OpenSSLDie(__FILE__, __LINE__, #e),1))
+
+unsigned long *OPENSSL_ia32cap_loc(void);
+# define OPENSSL_ia32cap (*(OPENSSL_ia32cap_loc()))
+int OPENSSL_isservice(void);
+
+int FIPS_mode(void);
+int FIPS_mode_set(int r);
+
+void OPENSSL_init(void);
+
+# define fips_md_init(alg) fips_md_init_ctx(alg, alg)
+
+# ifdef OPENSSL_FIPS
+# define fips_md_init_ctx(alg, cx) \
+ int alg##_Init(cx##_CTX *c) \
+ { \
+ if (FIPS_mode()) OpenSSLDie(__FILE__, __LINE__, \
+ "Low level API call to digest " #alg " forbidden in FIPS mode!"); \
+ return private_##alg##_Init(c); \
+ } \
+ int private_##alg##_Init(cx##_CTX *c)
+
+# define fips_cipher_abort(alg) \
+ if (FIPS_mode()) OpenSSLDie(__FILE__, __LINE__, \
+ "Low level API call to cipher " #alg " forbidden in FIPS mode!")
+
+# else
+# define fips_md_init_ctx(alg, cx) \
+ int alg##_Init(cx##_CTX *c)
+# define fips_cipher_abort(alg) while(0)
+# endif
+
+/*
+ * CRYPTO_memcmp returns zero iff the |len| bytes at |a| and |b| are equal.
+ * It takes an amount of time dependent on |len|, but independent of the
+ * contents of |a| and |b|. Unlike memcmp, it cannot be used to put elements
+ * into a defined order as the return value when a != b is undefined, other
+ * than to be non-zero.
+ */
+int CRYPTO_memcmp(const void *a, const void *b, size_t len);
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_CRYPTO_strings(void);
+
+/* Error codes for the CRYPTO functions. */
+
+/* Function codes. */
+# define CRYPTO_F_CRYPTO_GET_EX_NEW_INDEX 100
+# define CRYPTO_F_CRYPTO_GET_NEW_DYNLOCKID 103
+# define CRYPTO_F_CRYPTO_GET_NEW_LOCKID 101
+# define CRYPTO_F_CRYPTO_SET_EX_DATA 102
+# define CRYPTO_F_DEF_ADD_INDEX 104
+# define CRYPTO_F_DEF_GET_CLASS 105
+# define CRYPTO_F_FIPS_MODE_SET 109
+# define CRYPTO_F_INT_DUP_EX_DATA 106
+# define CRYPTO_F_INT_FREE_EX_DATA 107
+# define CRYPTO_F_INT_NEW_EX_DATA 108
+
+/* Reason codes. */
+# define CRYPTO_R_FIPS_MODE_NOT_SUPPORTED 101
+# define CRYPTO_R_NO_DYNLOCK_CREATE_CALLBACK 100
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/deps/openssl/openssl/include/openssl/des.h b/deps/openssl/openssl/include/openssl/des.h
index 1d6631e9b6a..1b40144e1b3 100644
--- a/deps/openssl/openssl/include/openssl/des.h
+++ b/deps/openssl/openssl/include/openssl/des.h
@@ -1 +1,257 @@
-#include "../../crypto/des/des.h"
+/* crypto/des/des.h */
+/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_NEW_DES_H
+# define HEADER_NEW_DES_H
+
+# include <openssl/e_os2.h> /* OPENSSL_EXTERN, OPENSSL_NO_DES, DES_LONG
+ * (via openssl/opensslconf.h */
+
+# ifdef OPENSSL_NO_DES
+# error DES is disabled.
+# endif
+
+# ifdef OPENSSL_BUILD_SHLIBCRYPTO
+# undef OPENSSL_EXTERN
+# define OPENSSL_EXTERN OPENSSL_EXPORT
+# endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef unsigned char DES_cblock[8];
+typedef /* const */ unsigned char const_DES_cblock[8];
+/*
+ * With "const", gcc 2.8.1 on Solaris thinks that DES_cblock * and
+ * const_DES_cblock * are incompatible pointer types.
+ */
+
+typedef struct DES_ks {
+ union {
+ DES_cblock cblock;
+ /*
+ * make sure things are correct size on machines with 8 byte longs
+ */
+ DES_LONG deslong[2];
+ } ks[16];
+} DES_key_schedule;
+
+# ifndef OPENSSL_DISABLE_OLD_DES_SUPPORT
+# ifndef OPENSSL_ENABLE_OLD_DES_SUPPORT
+# define OPENSSL_ENABLE_OLD_DES_SUPPORT
+# endif
+# endif
+
+# ifdef OPENSSL_ENABLE_OLD_DES_SUPPORT
+# include <openssl/des_old.h>
+# endif
+
+# define DES_KEY_SZ (sizeof(DES_cblock))
+# define DES_SCHEDULE_SZ (sizeof(DES_key_schedule))
+
+# define DES_ENCRYPT 1
+# define DES_DECRYPT 0
+
+# define DES_CBC_MODE 0
+# define DES_PCBC_MODE 1
+
+# define DES_ecb2_encrypt(i,o,k1,k2,e) \
+ DES_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e))
+
+# define DES_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \
+ DES_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e))
+
+# define DES_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \
+ DES_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e))
+
+# define DES_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \
+ DES_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n))
+
+OPENSSL_DECLARE_GLOBAL(int, DES_check_key); /* defaults to false */
+# define DES_check_key OPENSSL_GLOBAL_REF(DES_check_key)
+OPENSSL_DECLARE_GLOBAL(int, DES_rw_mode); /* defaults to DES_PCBC_MODE */
+# define DES_rw_mode OPENSSL_GLOBAL_REF(DES_rw_mode)
+
+const char *DES_options(void);
+void DES_ecb3_encrypt(const_DES_cblock *input, DES_cblock *output,
+ DES_key_schedule *ks1, DES_key_schedule *ks2,
+ DES_key_schedule *ks3, int enc);
+DES_LONG DES_cbc_cksum(const unsigned char *input, DES_cblock *output,
+ long length, DES_key_schedule *schedule,
+ const_DES_cblock *ivec);
+/* DES_cbc_encrypt does not update the IV! Use DES_ncbc_encrypt instead. */
+void DES_cbc_encrypt(const unsigned char *input, unsigned char *output,
+ long length, DES_key_schedule *schedule,
+ DES_cblock *ivec, int enc);
+void DES_ncbc_encrypt(const unsigned char *input, unsigned char *output,
+ long length, DES_key_schedule *schedule,
+ DES_cblock *ivec, int enc);
+void DES_xcbc_encrypt(const unsigned char *input, unsigned char *output,
+ long length, DES_key_schedule *schedule,
+ DES_cblock *ivec, const_DES_cblock *inw,
+ const_DES_cblock *outw, int enc);
+void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits,
+ long length, DES_key_schedule *schedule,
+ DES_cblock *ivec, int enc);
+void DES_ecb_encrypt(const_DES_cblock *input, DES_cblock *output,
+ DES_key_schedule *ks, int enc);
+
+/*
+ * This is the DES encryption function that gets called by just about every
+ * other DES routine in the library. You should not use this function except
+ * to implement 'modes' of DES. I say this because the functions that call
+ * this routine do the conversion from 'char *' to long, and this needs to be
+ * done to make sure 'non-aligned' memory access do not occur. The
+ * characters are loaded 'little endian'. Data is a pointer to 2 unsigned
+ * long's and ks is the DES_key_schedule to use. enc, is non zero specifies
+ * encryption, zero if decryption.
+ */
+void DES_encrypt1(DES_LONG *data, DES_key_schedule *ks, int enc);
+
+/*
+ * This functions is the same as DES_encrypt1() except that the DES initial
+ * permutation (IP) and final permutation (FP) have been left out. As for
+ * DES_encrypt1(), you should not use this function. It is used by the
+ * routines in the library that implement triple DES. IP() DES_encrypt2()
+ * DES_encrypt2() DES_encrypt2() FP() is the same as DES_encrypt1()
+ * DES_encrypt1() DES_encrypt1() except faster :-).
+ */
+void DES_encrypt2(DES_LONG *data, DES_key_schedule *ks, int enc);
+
+void DES_encrypt3(DES_LONG *data, DES_key_schedule *ks1,
+ DES_key_schedule *ks2, DES_key_schedule *ks3);
+void DES_decrypt3(DES_LONG *data, DES_key_schedule *ks1,
+ DES_key_schedule *ks2, DES_key_schedule *ks3);
+void DES_ede3_cbc_encrypt(const unsigned char *input, unsigned char *output,
+ long length,
+ DES_key_schedule *ks1, DES_key_schedule *ks2,
+ DES_key_schedule *ks3, DES_cblock *ivec, int enc);
+void DES_ede3_cbcm_encrypt(const unsigned char *in, unsigned char *out,
+ long length,
+ DES_key_schedule *ks1, DES_key_schedule *ks2,
+ DES_key_schedule *ks3,
+ DES_cblock *ivec1, DES_cblock *ivec2, int enc);
+void DES_ede3_cfb64_encrypt(const unsigned char *in, unsigned char *out,
+ long length, DES_key_schedule *ks1,
+ DES_key_schedule *ks2, DES_key_schedule *ks3,
+ DES_cblock *ivec, int *num, int enc);
+void DES_ede3_cfb_encrypt(const unsigned char *in, unsigned char *out,
+ int numbits, long length, DES_key_schedule *ks1,
+ DES_key_schedule *ks2, DES_key_schedule *ks3,
+ DES_cblock *ivec, int enc);
+void DES_ede3_ofb64_encrypt(const unsigned char *in, unsigned char *out,
+ long length, DES_key_schedule *ks1,
+ DES_key_schedule *ks2, DES_key_schedule *ks3,
+ DES_cblock *ivec, int *num);
+# if 0
+void DES_xwhite_in2out(const_DES_cblock *DES_key, const_DES_cblock *in_white,
+ DES_cblock *out_white);
+# endif
+
+int DES_enc_read(int fd, void *buf, int len, DES_key_schedule *sched,
+ DES_cblock *iv);
+int DES_enc_write(int fd, const void *buf, int len, DES_key_schedule *sched,
+ DES_cblock *iv);
+char *DES_fcrypt(const char *buf, const char *salt, char *ret);
+char *DES_crypt(const char *buf, const char *salt);
+void DES_ofb_encrypt(const unsigned char *in, unsigned char *out, int numbits,
+ long length, DES_key_schedule *schedule,
+ DES_cblock *ivec);
+void DES_pcbc_encrypt(const unsigned char *input, unsigned char *output,
+ long length, DES_key_schedule *schedule,
+ DES_cblock *ivec, int enc);
+DES_LONG DES_quad_cksum(const unsigned char *input, DES_cblock output[],
+ long length, int out_count, DES_cblock *seed);
+int DES_random_key(DES_cblock *ret);
+void DES_set_odd_parity(DES_cblock *key);
+int DES_check_key_parity(const_DES_cblock *key);
+int DES_is_weak_key(const_DES_cblock *key);
+/*
+ * DES_set_key (= set_key = DES_key_sched = key_sched) calls
+ * DES_set_key_checked if global variable DES_check_key is set,
+ * DES_set_key_unchecked otherwise.
+ */
+int DES_set_key(const_DES_cblock *key, DES_key_schedule *schedule);
+int DES_key_sched(const_DES_cblock *key, DES_key_schedule *schedule);
+int DES_set_key_checked(const_DES_cblock *key, DES_key_schedule *schedule);
+void DES_set_key_unchecked(const_DES_cblock *key, DES_key_schedule *schedule);
+# ifdef OPENSSL_FIPS
+void private_DES_set_key_unchecked(const_DES_cblock *key,
+ DES_key_schedule *schedule);
+# endif
+void DES_string_to_key(const char *str, DES_cblock *key);
+void DES_string_to_2keys(const char *str, DES_cblock *key1, DES_cblock *key2);
+void DES_cfb64_encrypt(const unsigned char *in, unsigned char *out,
+ long length, DES_key_schedule *schedule,
+ DES_cblock *ivec, int *num, int enc);
+void DES_ofb64_encrypt(const unsigned char *in, unsigned char *out,
+ long length, DES_key_schedule *schedule,
+ DES_cblock *ivec, int *num);
+
+int DES_read_password(DES_cblock *key, const char *prompt, int verify);
+int DES_read_2passwords(DES_cblock *key1, DES_cblock *key2,
+ const char *prompt, int verify);
+
+# define DES_fixup_key_parity DES_set_odd_parity
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/deps/openssl/openssl/include/openssl/des_old.h b/deps/openssl/openssl/include/openssl/des_old.h
index e5828733cca..f1e1e2cb09c 100644
--- a/deps/openssl/openssl/include/openssl/des_old.h
+++ b/deps/openssl/openssl/include/openssl/des_old.h
@@ -1 +1,497 @@
-#include "../../crypto/des/des_old.h"
+/* crypto/des/des_old.h -*- mode:C; c-file-style: "eay" -*- */
+
+/*-
+ * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
+ *
+ * The function names in here are deprecated and are only present to
+ * provide an interface compatible with openssl 0.9.6 and older as
+ * well as libdes. OpenSSL now provides functions where "des_" has
+ * been replaced with "DES_" in the names, to make it possible to
+ * make incompatible changes that are needed for C type security and
+ * other stuff.
+ *
+ * This include files has two compatibility modes:
+ *
+ * - If OPENSSL_DES_LIBDES_COMPATIBILITY is defined, you get an API
+ * that is compatible with libdes and SSLeay.
+ * - If OPENSSL_DES_LIBDES_COMPATIBILITY isn't defined, you get an
+ * API that is compatible with OpenSSL 0.9.5x to 0.9.6x.
+ *
+ * Note that these modes break earlier snapshots of OpenSSL, where
+ * libdes compatibility was the only available mode or (later on) the
+ * prefered compatibility mode. However, after much consideration
+ * (and more or less violent discussions with external parties), it
+ * was concluded that OpenSSL should be compatible with earlier versions
+ * of itself before anything else. Also, in all honesty, libdes is
+ * an old beast that shouldn't really be used any more.
+ *
+ * Please consider starting to use the DES_ functions rather than the
+ * des_ ones. The des_ functions will disappear completely before
+ * OpenSSL 1.0!
+ *
+ * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
+ */
+
+/*
+ * Written by Richard Levitte (richard@levitte.org) for the OpenSSL project
+ * 2001.
+ */
+/* ====================================================================
+ * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+#ifndef HEADER_DES_H
+# define HEADER_DES_H
+
+# include <openssl/e_os2.h> /* OPENSSL_EXTERN, OPENSSL_NO_DES, DES_LONG */
+
+# ifdef OPENSSL_NO_DES
+# error DES is disabled.
+# endif
+
+# ifndef HEADER_NEW_DES_H
+# error You must include des.h, not des_old.h directly.
+# endif
+
+# ifdef _KERBEROS_DES_H
+# error <openssl/des_old.h> replaces <kerberos/des.h>.
+# endif
+
+# include <openssl/symhacks.h>
+
+# ifdef OPENSSL_BUILD_SHLIBCRYPTO
+# undef OPENSSL_EXTERN
+# define OPENSSL_EXTERN OPENSSL_EXPORT
+# endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# ifdef _
+# undef _
+# endif
+
+typedef unsigned char _ossl_old_des_cblock[8];
+typedef struct _ossl_old_des_ks_struct {
+ union {
+ _ossl_old_des_cblock _;
+ /*
+ * make sure things are correct size on machines with 8 byte longs
+ */
+ DES_LONG pad[2];
+ } ks;
+} _ossl_old_des_key_schedule[16];
+
+# ifndef OPENSSL_DES_LIBDES_COMPATIBILITY
+# define des_cblock DES_cblock
+# define const_des_cblock const_DES_cblock
+# define des_key_schedule DES_key_schedule
+# define des_ecb3_encrypt(i,o,k1,k2,k3,e)\
+ DES_ecb3_encrypt((i),(o),&(k1),&(k2),&(k3),(e))
+# define des_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e)\
+ DES_ede3_cbc_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(e))
+# define des_ede3_cbcm_encrypt(i,o,l,k1,k2,k3,iv1,iv2,e)\
+ DES_ede3_cbcm_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv1),(iv2),(e))
+# define des_ede3_cfb64_encrypt(i,o,l,k1,k2,k3,iv,n,e)\
+ DES_ede3_cfb64_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(n),(e))
+# define des_ede3_ofb64_encrypt(i,o,l,k1,k2,k3,iv,n)\
+ DES_ede3_ofb64_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(n))
+# define des_options()\
+ DES_options()
+# define des_cbc_cksum(i,o,l,k,iv)\
+ DES_cbc_cksum((i),(o),(l),&(k),(iv))
+# define des_cbc_encrypt(i,o,l,k,iv,e)\
+ DES_cbc_encrypt((i),(o),(l),&(k),(iv),(e))
+# define des_ncbc_encrypt(i,o,l,k,iv,e)\
+ DES_ncbc_encrypt((i),(o),(l),&(k),(iv),(e))
+# define des_xcbc_encrypt(i,o,l,k,iv,inw,outw,e)\
+ DES_xcbc_encrypt((i),(o),(l),&(k),(iv),(inw),(outw),(e))
+# define des_cfb_encrypt(i,o,n,l,k,iv,e)\
+ DES_cfb_encrypt((i),(o),(n),(l),&(k),(iv),(e))
+# define des_ecb_encrypt(i,o,k,e)\
+ DES_ecb_encrypt((i),(o),&(k),(e))
+# define des_encrypt1(d,k,e)\
+ DES_encrypt1((d),&(k),(e))
+# define des_encrypt2(d,k,e)\
+ DES_encrypt2((d),&(k),(e))
+# define des_encrypt3(d,k1,k2,k3)\
+ DES_encrypt3((d),&(k1),&(k2),&(k3))
+# define des_decrypt3(d,k1,k2,k3)\
+ DES_decrypt3((d),&(k1),&(k2),&(k3))
+# define des_xwhite_in2out(k,i,o)\
+ DES_xwhite_in2out((k),(i),(o))
+# define des_enc_read(f,b,l,k,iv)\
+ DES_enc_read((f),(b),(l),&(k),(iv))
+# define des_enc_write(f,b,l,k,iv)\
+ DES_enc_write((f),(b),(l),&(k),(iv))
+# define des_fcrypt(b,s,r)\
+ DES_fcrypt((b),(s),(r))
+# if 0
+# define des_crypt(b,s)\
+ DES_crypt((b),(s))
+# if !defined(PERL5) && !defined(__FreeBSD__) && !defined(NeXT) && !defined(__OpenBSD__)
+# define crypt(b,s)\
+ DES_crypt((b),(s))
+# endif
+# endif
+# define des_ofb_encrypt(i,o,n,l,k,iv)\
+ DES_ofb_encrypt((i),(o),(n),(l),&(k),(iv))
+# define des_pcbc_encrypt(i,o,l,k,iv,e)\
+ DES_pcbc_encrypt((i),(o),(l),&(k),(iv),(e))
+# define des_quad_cksum(i,o,l,c,s)\
+ DES_quad_cksum((i),(o),(l),(c),(s))
+# define des_random_seed(k)\
+ _ossl_096_des_random_seed((k))
+# define des_random_key(r)\
+ DES_random_key((r))
+# define des_read_password(k,p,v) \
+ DES_read_password((k),(p),(v))
+# define des_read_2passwords(k1,k2,p,v) \
+ DES_read_2passwords((k1),(k2),(p),(v))
+# define des_set_odd_parity(k)\
+ DES_set_odd_parity((k))
+# define des_check_key_parity(k)\
+ DES_check_key_parity((k))
+# define des_is_weak_key(k)\
+ DES_is_weak_key((k))
+# define des_set_key(k,ks)\
+ DES_set_key((k),&(ks))
+# define des_key_sched(k,ks)\
+ DES_key_sched((k),&(ks))
+# define des_set_key_checked(k,ks)\
+ DES_set_key_checked((k),&(ks))
+# define des_set_key_unchecked(k,ks)\
+ DES_set_key_unchecked((k),&(ks))
+# define des_string_to_key(s,k)\
+ DES_string_to_key((s),(k))
+# define des_string_to_2keys(s,k1,k2)\
+ DES_string_to_2keys((s),(k1),(k2))
+# define des_cfb64_encrypt(i,o,l,ks,iv,n,e)\
+ DES_cfb64_encrypt((i),(o),(l),&(ks),(iv),(n),(e))
+# define des_ofb64_encrypt(i,o,l,ks,iv,n)\
+ DES_ofb64_encrypt((i),(o),(l),&(ks),(iv),(n))
+
+# define des_ecb2_encrypt(i,o,k1,k2,e) \
+ des_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e))
+
+# define des_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \
+ des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e))
+
+# define des_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \
+ des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e))
+
+# define des_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \
+ des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n))
+
+# define des_check_key DES_check_key
+# define des_rw_mode DES_rw_mode
+# else /* libdes compatibility */
+/*
+ * Map all symbol names to _ossl_old_des_* form, so we avoid all clashes with
+ * libdes
+ */
+# define des_cblock _ossl_old_des_cblock
+# define des_key_schedule _ossl_old_des_key_schedule
+# define des_ecb3_encrypt(i,o,k1,k2,k3,e)\
+ _ossl_old_des_ecb3_encrypt((i),(o),(k1),(k2),(k3),(e))
+# define des_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e)\
+ _ossl_old_des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(e))
+# define des_ede3_cfb64_encrypt(i,o,l,k1,k2,k3,iv,n,e)\
+ _ossl_old_des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(n),(e))
+# define des_ede3_ofb64_encrypt(i,o,l,k1,k2,k3,iv,n)\
+ _ossl_old_des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(n))
+# define des_options()\
+ _ossl_old_des_options()
+# define des_cbc_cksum(i,o,l,k,iv)\
+ _ossl_old_des_cbc_cksum((i),(o),(l),(k),(iv))
+# define des_cbc_encrypt(i,o,l,k,iv,e)\
+ _ossl_old_des_cbc_encrypt((i),(o),(l),(k),(iv),(e))
+# define des_ncbc_encrypt(i,o,l,k,iv,e)\
+ _ossl_old_des_ncbc_encrypt((i),(o),(l),(k),(iv),(e))
+# define des_xcbc_encrypt(i,o,l,k,iv,inw,outw,e)\
+ _ossl_old_des_xcbc_encrypt((i),(o),(l),(k),(iv),(inw),(outw),(e))
+# define des_cfb_encrypt(i,o,n,l,k,iv,e)\
+ _ossl_old_des_cfb_encrypt((i),(o),(n),(l),(k),(iv),(e))
+# define des_ecb_encrypt(i,o,k,e)\
+ _ossl_old_des_ecb_encrypt((i),(o),(k),(e))
+# define des_encrypt(d,k,e)\
+ _ossl_old_des_encrypt((d),(k),(e))
+# define des_encrypt2(d,k,e)\
+ _ossl_old_des_encrypt2((d),(k),(e))
+# define des_encrypt3(d,k1,k2,k3)\
+ _ossl_old_des_encrypt3((d),(k1),(k2),(k3))
+# define des_decrypt3(d,k1,k2,k3)\
+ _ossl_old_des_decrypt3((d),(k1),(k2),(k3))
+# define des_xwhite_in2out(k,i,o)\
+ _ossl_old_des_xwhite_in2out((k),(i),(o))
+# define des_enc_read(f,b,l,k,iv)\
+ _ossl_old_des_enc_read((f),(b),(l),(k),(iv))
+# define des_enc_write(f,b,l,k,iv)\
+ _ossl_old_des_enc_write((f),(b),(l),(k),(iv))
+# define des_fcrypt(b,s,r)\
+ _ossl_old_des_fcrypt((b),(s),(r))
+# define des_crypt(b,s)\
+ _ossl_old_des_crypt((b),(s))
+# if 0
+# define crypt(b,s)\
+ _ossl_old_crypt((b),(s))
+# endif
+# define des_ofb_encrypt(i,o,n,l,k,iv)\
+ _ossl_old_des_ofb_encrypt((i),(o),(n),(l),(k),(iv))
+# define des_pcbc_encrypt(i,o,l,k,iv,e)\
+ _ossl_old_des_pcbc_encrypt((i),(o),(l),(k),(iv),(e))
+# define des_quad_cksum(i,o,l,c,s)\
+ _ossl_old_des_quad_cksum((i),(o),(l),(c),(s))
+# define des_random_seed(k)\
+ _ossl_old_des_random_seed((k))
+# define des_random_key(r)\
+ _ossl_old_des_random_key((r))
+# define des_read_password(k,p,v) \
+ _ossl_old_des_read_password((k),(p),(v))
+# define des_read_2passwords(k1,k2,p,v) \
+ _ossl_old_des_read_2passwords((k1),(k2),(p),(v))
+# define des_set_odd_parity(k)\
+ _ossl_old_des_set_odd_parity((k))
+# define des_is_weak_key(k)\
+ _ossl_old_des_is_weak_key((k))
+# define des_set_key(k,ks)\
+ _ossl_old_des_set_key((k),(ks))
+# define des_key_sched(k,ks)\
+ _ossl_old_des_key_sched((k),(ks))
+# define des_string_to_key(s,k)\
+ _ossl_old_des_string_to_key((s),(k))
+# define des_string_to_2keys(s,k1,k2)\
+ _ossl_old_des_string_to_2keys((s),(k1),(k2))
+# define des_cfb64_encrypt(i,o,l,ks,iv,n,e)\
+ _ossl_old_des_cfb64_encrypt((i),(o),(l),(ks),(iv),(n),(e))
+# define des_ofb64_encrypt(i,o,l,ks,iv,n)\
+ _ossl_old_des_ofb64_encrypt((i),(o),(l),(ks),(iv),(n))
+
+# define des_ecb2_encrypt(i,o,k1,k2,e) \
+ des_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e))
+
+# define des_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \
+ des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e))
+
+# define des_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \
+ des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e))
+
+# define des_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \
+ des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n))
+
+# define des_check_key DES_check_key
+# define des_rw_mode DES_rw_mode
+# endif
+
+const char *_ossl_old_des_options(void);
+void _ossl_old_des_ecb3_encrypt(_ossl_old_des_cblock *input,
+ _ossl_old_des_cblock *output,
+ _ossl_old_des_key_schedule ks1,
+ _ossl_old_des_key_schedule ks2,
+ _ossl_old_des_key_schedule ks3, int enc);
+DES_LONG _ossl_old_des_cbc_cksum(_ossl_old_des_cblock *input,
+ _ossl_old_des_cblock *output, long length,
+ _ossl_old_des_key_schedule schedule,
+ _ossl_old_des_cblock *ivec);
+void _ossl_old_des_cbc_encrypt(_ossl_old_des_cblock *input,
+ _ossl_old_des_cblock *output, long length,
+ _ossl_old_des_key_schedule schedule,
+ _ossl_old_des_cblock *ivec, int enc);
+void _ossl_old_des_ncbc_encrypt(_ossl_old_des_cblock *input,
+ _ossl_old_des_cblock *output, long length,
+ _ossl_old_des_key_schedule schedule,
+ _ossl_old_des_cblock *ivec, int enc);
+void _ossl_old_des_xcbc_encrypt(_ossl_old_des_cblock *input,
+ _ossl_old_des_cblock *output, long length,
+ _ossl_old_des_key_schedule schedule,
+ _ossl_old_des_cblock *ivec,
+ _ossl_old_des_cblock *inw,
+ _ossl_old_des_cblock *outw, int enc);
+void _ossl_old_des_cfb_encrypt(unsigned char *in, unsigned char *out,
+ int numbits, long length,
+ _ossl_old_des_key_schedule schedule,
+ _ossl_old_des_cblock *ivec, int enc);
+void _ossl_old_des_ecb_encrypt(_ossl_old_des_cblock *input,
+ _ossl_old_des_cblock *output,
+ _ossl_old_des_key_schedule ks, int enc);
+void _ossl_old_des_encrypt(DES_LONG *data, _ossl_old_des_key_schedule ks,
+ int enc);
+void _ossl_old_des_encrypt2(DES_LONG *data, _ossl_old_des_key_schedule ks,
+ int enc);
+void _ossl_old_des_encrypt3(DES_LONG *data, _ossl_old_des_key_schedule ks1,
+ _ossl_old_des_key_schedule ks2,
+ _ossl_old_des_key_schedule ks3);
+void _ossl_old_des_decrypt3(DES_LONG *data, _ossl_old_des_key_schedule ks1,
+ _ossl_old_des_key_schedule ks2,
+ _ossl_old_des_key_schedule ks3);
+void _ossl_old_des_ede3_cbc_encrypt(_ossl_old_des_cblock *input,
+ _ossl_old_des_cblock *output, long length,
+ _ossl_old_des_key_schedule ks1,
+ _ossl_old_des_key_schedule ks2,
+ _ossl_old_des_key_schedule ks3,
+ _ossl_old_des_cblock *ivec, int enc);
+void _ossl_old_des_ede3_cfb64_encrypt(unsigned char *in, unsigned char *out,
+ long length,
+ _ossl_old_des_key_schedule ks1,
+ _ossl_old_des_key_schedule ks2,
+ _ossl_old_des_key_schedule ks3,
+ _ossl_old_des_cblock *ivec, int *num,
+ int enc);
+void _ossl_old_des_ede3_ofb64_encrypt(unsigned char *in, unsigned char *out,
+ long length,
+ _ossl_old_des_key_schedule ks1,
+ _ossl_old_des_key_schedule ks2,
+ _ossl_old_des_key_schedule ks3,
+ _ossl_old_des_cblock *ivec, int *num);
+# if 0
+void _ossl_old_des_xwhite_in2out(_ossl_old_des_cblock (*des_key),
+ _ossl_old_des_cblock (*in_white),
+ _ossl_old_des_cblock (*out_white));
+# endif
+
+int _ossl_old_des_enc_read(int fd, char *buf, int len,
+ _ossl_old_des_key_schedule sched,
+ _ossl_old_des_cblock *iv);
+int _ossl_old_des_enc_write(int fd, char *buf, int len,
+ _ossl_old_des_key_schedule sched,
+ _ossl_old_des_cblock *iv);
+char *_ossl_old_des_fcrypt(const char *buf, const char *salt, char *ret);
+char *_ossl_old_des_crypt(const char *buf, const char *salt);
+# if !defined(PERL5) && !defined(NeXT)
+char *_ossl_old_crypt(const char *buf, const char *salt);
+# endif
+void _ossl_old_des_ofb_encrypt(unsigned char *in, unsigned char *out,
+ int numbits, long length,
+ _ossl_old_des_key_schedule schedule,
+ _ossl_old_des_cblock *ivec);
+void _ossl_old_des_pcbc_encrypt(_ossl_old_des_cblock *input,
+ _ossl_old_des_cblock *output, long length,
+ _ossl_old_des_key_schedule schedule,
+ _ossl_old_des_cblock *ivec, int enc);
+DES_LONG _ossl_old_des_quad_cksum(_ossl_old_des_cblock *input,
+ _ossl_old_des_cblock *output, long length,
+ int out_count, _ossl_old_des_cblock *seed);
+void _ossl_old_des_random_seed(_ossl_old_des_cblock key);
+void _ossl_old_des_random_key(_ossl_old_des_cblock ret);
+int _ossl_old_des_read_password(_ossl_old_des_cblock *key, const char *prompt,
+ int verify);
+int _ossl_old_des_read_2passwords(_ossl_old_des_cblock *key1,
+ _ossl_old_des_cblock *key2,
+ const char *prompt, int verify);
+void _ossl_old_des_set_odd_parity(_ossl_old_des_cblock *key);
+int _ossl_old_des_is_weak_key(_ossl_old_des_cblock *key);
+int _ossl_old_des_set_key(_ossl_old_des_cblock *key,
+ _ossl_old_des_key_schedule schedule);
+int _ossl_old_des_key_sched(_ossl_old_des_cblock *key,
+ _ossl_old_des_key_schedule schedule);
+void _ossl_old_des_string_to_key(char *str, _ossl_old_des_cblock *key);
+void _ossl_old_des_string_to_2keys(char *str, _ossl_old_des_cblock *key1,
+ _ossl_old_des_cblock *key2);
+void _ossl_old_des_cfb64_encrypt(unsigned char *in, unsigned char *out,
+ long length,
+ _ossl_old_des_key_schedule schedule,
+ _ossl_old_des_cblock *ivec, int *num,
+ int enc);
+void _ossl_old_des_ofb64_encrypt(unsigned char *in, unsigned char *out,
+ long length,
+ _ossl_old_des_key_schedule schedule,
+ _ossl_old_des_cblock *ivec, int *num);
+
+void _ossl_096_des_random_seed(des_cblock *key);
+
+/*
+ * The following definitions provide compatibility with the MIT Kerberos
+ * library. The _ossl_old_des_key_schedule structure is not binary
+ * compatible.
+ */
+
+# define _KERBEROS_DES_H
+
+# define KRBDES_ENCRYPT DES_ENCRYPT
+# define KRBDES_DECRYPT DES_DECRYPT
+
+# ifdef KERBEROS
+# define ENCRYPT DES_ENCRYPT
+# define DECRYPT DES_DECRYPT
+# endif
+
+# ifndef NCOMPAT
+# define C_Block des_cblock
+# define Key_schedule des_key_schedule
+# define KEY_SZ DES_KEY_SZ
+# define string_to_key des_string_to_key
+# define read_pw_string des_read_pw_string
+# define random_key des_random_key
+# define pcbc_encrypt des_pcbc_encrypt
+# define set_key des_set_key
+# define key_sched des_key_sched
+# define ecb_encrypt des_ecb_encrypt
+# define cbc_encrypt des_cbc_encrypt
+# define ncbc_encrypt des_ncbc_encrypt
+# define xcbc_encrypt des_xcbc_encrypt
+# define cbc_cksum des_cbc_cksum
+# define quad_cksum des_quad_cksum
+# define check_parity des_check_key_parity
+# endif
+
+# define des_fixup_key_parity DES_fixup_key_parity
+
+#ifdef __cplusplus
+}
+#endif
+
+/* for DES_read_pw_string et al */
+# include <openssl/ui_compat.h>
+
+#endif
diff --git a/deps/openssl/openssl/include/openssl/dh.h b/deps/openssl/openssl/include/openssl/dh.h
index f70a767ac90..0502f1a9cc1 100644
--- a/deps/openssl/openssl/include/openssl/dh.h
+++ b/deps/openssl/openssl/include/openssl/dh.h
@@ -1 +1,392 @@
-#include "../../crypto/dh/dh.h"
+/* crypto/dh/dh.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_DH_H
+# define HEADER_DH_H
+
+# include <openssl/e_os2.h>
+
+# ifdef OPENSSL_NO_DH
+# error DH is disabled.
+# endif
+
+# ifndef OPENSSL_NO_BIO
+# include <openssl/bio.h>
+# endif
+# include <openssl/ossl_typ.h>
+# ifndef OPENSSL_NO_DEPRECATED
+# include <openssl/bn.h>
+# endif
+
+# ifndef OPENSSL_DH_MAX_MODULUS_BITS
+# define OPENSSL_DH_MAX_MODULUS_BITS 10000
+# endif
+
+# define DH_FLAG_CACHE_MONT_P 0x01
+
+/*
+ * new with 0.9.7h; the built-in DH
+ * implementation now uses constant time
+ * modular exponentiation for secret exponents
+ * by default. This flag causes the
+ * faster variable sliding window method to
+ * be used for all exponents.
+ */
+# define DH_FLAG_NO_EXP_CONSTTIME 0x02
+
+/*
+ * If this flag is set the DH method is FIPS compliant and can be used in
+ * FIPS mode. This is set in the validated module method. If an application
+ * sets this flag in its own methods it is its reposibility to ensure the
+ * result is compliant.
+ */
+
+# define DH_FLAG_FIPS_METHOD 0x0400
+
+/*
+ * If this flag is set the operations normally disabled in FIPS mode are
+ * permitted it is then the applications responsibility to ensure that the
+ * usage is compliant.
+ */
+
+# define DH_FLAG_NON_FIPS_ALLOW 0x0400
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Already defined in ossl_typ.h */
+/* typedef struct dh_st DH; */
+/* typedef struct dh_method DH_METHOD; */
+
+struct dh_method {
+ const char *name;
+ /* Methods here */
+ int (*generate_key) (DH *dh);
+ int (*compute_key) (unsigned char *key, const BIGNUM *pub_key, DH *dh);
+ /* Can be null */
+ int (*bn_mod_exp) (const DH *dh, BIGNUM *r, const BIGNUM *a,
+ const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx,
+ BN_MONT_CTX *m_ctx);
+ int (*init) (DH *dh);
+ int (*finish) (DH *dh);
+ int flags;
+ char *app_data;
+ /* If this is non-NULL, it will be used to generate parameters */
+ int (*generate_params) (DH *dh, int prime_len, int generator,
+ BN_GENCB *cb);
+};
+
+struct dh_st {
+ /*
+ * This first argument is used to pick up errors when a DH is passed
+ * instead of a EVP_PKEY
+ */
+ int pad;
+ int version;
+ BIGNUM *p;
+ BIGNUM *g;
+ long length; /* optional */
+ BIGNUM *pub_key; /* g^x */
+ BIGNUM *priv_key; /* x */
+ int flags;
+ BN_MONT_CTX *method_mont_p;
+ /* Place holders if we want to do X9.42 DH */
+ BIGNUM *q;
+ BIGNUM *j;
+ unsigned char *seed;
+ int seedlen;
+ BIGNUM *counter;
+ int references;
+ CRYPTO_EX_DATA ex_data;
+ const DH_METHOD *meth;
+ ENGINE *engine;
+};
+
+# define DH_GENERATOR_2 2
+/* #define DH_GENERATOR_3 3 */
+# define DH_GENERATOR_5 5
+
+/* DH_check error codes */
+# define DH_CHECK_P_NOT_PRIME 0x01
+# define DH_CHECK_P_NOT_SAFE_PRIME 0x02
+# define DH_UNABLE_TO_CHECK_GENERATOR 0x04
+# define DH_NOT_SUITABLE_GENERATOR 0x08
+# define DH_CHECK_Q_NOT_PRIME 0x10
+# define DH_CHECK_INVALID_Q_VALUE 0x20
+# define DH_CHECK_INVALID_J_VALUE 0x40
+
+/* DH_check_pub_key error codes */
+# define DH_CHECK_PUBKEY_TOO_SMALL 0x01
+# define DH_CHECK_PUBKEY_TOO_LARGE 0x02
+
+/*
+ * primes p where (p-1)/2 is prime too are called "safe"; we define this for
+ * backward compatibility:
+ */
+# define DH_CHECK_P_NOT_STRONG_PRIME DH_CHECK_P_NOT_SAFE_PRIME
+
+# define d2i_DHparams_fp(fp,x) (DH *)ASN1_d2i_fp((char *(*)())DH_new, \
+ (char *(*)())d2i_DHparams,(fp),(unsigned char **)(x))
+# define i2d_DHparams_fp(fp,x) ASN1_i2d_fp(i2d_DHparams,(fp), \
+ (unsigned char *)(x))
+# define d2i_DHparams_bio(bp,x) ASN1_d2i_bio_of(DH,DH_new,d2i_DHparams,bp,x)
+# define i2d_DHparams_bio(bp,x) ASN1_i2d_bio_of_const(DH,i2d_DHparams,bp,x)
+
+DH *DHparams_dup(DH *);
+
+const DH_METHOD *DH_OpenSSL(void);
+
+void DH_set_default_method(const DH_METHOD *meth);
+const DH_METHOD *DH_get_default_method(void);
+int DH_set_method(DH *dh, const DH_METHOD *meth);
+DH *DH_new_method(ENGINE *engine);
+
+DH *DH_new(void);
+void DH_free(DH *dh);
+int DH_up_ref(DH *dh);
+int DH_size(const DH *dh);
+int DH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
+ CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
+int DH_set_ex_data(DH *d, int idx, void *arg);
+void *DH_get_ex_data(DH *d, int idx);
+
+/* Deprecated version */
+# ifndef OPENSSL_NO_DEPRECATED
+DH *DH_generate_parameters(int prime_len, int generator,
+ void (*callback) (int, int, void *), void *cb_arg);
+# endif /* !defined(OPENSSL_NO_DEPRECATED) */
+
+/* New version */
+int DH_generate_parameters_ex(DH *dh, int prime_len, int generator,
+ BN_GENCB *cb);
+
+int DH_check(const DH *dh, int *codes);
+int DH_check_pub_key(const DH *dh, const BIGNUM *pub_key, int *codes);
+int DH_generate_key(DH *dh);
+int DH_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh);
+int DH_compute_key_padded(unsigned char *key, const BIGNUM *pub_key, DH *dh);
+DH *d2i_DHparams(DH **a, const unsigned char **pp, long length);
+int i2d_DHparams(const DH *a, unsigned char **pp);
+DH *d2i_DHxparams(DH **a, const unsigned char **pp, long length);
+int i2d_DHxparams(const DH *a, unsigned char **pp);
+# ifndef OPENSSL_NO_FP_API
+int DHparams_print_fp(FILE *fp, const DH *x);
+# endif
+# ifndef OPENSSL_NO_BIO
+int DHparams_print(BIO *bp, const DH *x);
+# else
+int DHparams_print(char *bp, const DH *x);
+# endif
+
+/* RFC 5114 parameters */
+DH *DH_get_1024_160(void);
+DH *DH_get_2048_224(void);
+DH *DH_get_2048_256(void);
+
+/* RFC2631 KDF */
+int DH_KDF_X9_42(unsigned char *out, size_t outlen,
+ const unsigned char *Z, size_t Zlen,
+ ASN1_OBJECT *key_oid,
+ const unsigned char *ukm, size_t ukmlen, const EVP_MD *md);
+
+# define EVP_PKEY_CTX_set_dh_paramgen_prime_len(ctx, len) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \
+ EVP_PKEY_CTRL_DH_PARAMGEN_PRIME_LEN, len, NULL)
+
+# define EVP_PKEY_CTX_set_dh_paramgen_subprime_len(ctx, len) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \
+ EVP_PKEY_CTRL_DH_PARAMGEN_SUBPRIME_LEN, len, NULL)
+
+# define EVP_PKEY_CTX_set_dh_paramgen_type(ctx, typ) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \
+ EVP_PKEY_CTRL_DH_PARAMGEN_TYPE, typ, NULL)
+
+# define EVP_PKEY_CTX_set_dh_paramgen_generator(ctx, gen) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \
+ EVP_PKEY_CTRL_DH_PARAMGEN_GENERATOR, gen, NULL)
+
+# define EVP_PKEY_CTX_set_dh_rfc5114(ctx, gen) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, EVP_PKEY_OP_PARAMGEN, \
+ EVP_PKEY_CTRL_DH_RFC5114, gen, NULL)
+
+# define EVP_PKEY_CTX_set_dhx_rfc5114(ctx, gen) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, EVP_PKEY_OP_PARAMGEN, \
+ EVP_PKEY_CTRL_DH_RFC5114, gen, NULL)
+
+# define EVP_PKEY_CTX_set_dh_kdf_type(ctx, kdf) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
+ EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_DH_KDF_TYPE, kdf, NULL)
+
+# define EVP_PKEY_CTX_get_dh_kdf_type(ctx) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
+ EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_DH_KDF_TYPE, -2, NULL)
+
+# define EVP_PKEY_CTX_set0_dh_kdf_oid(ctx, oid) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
+ EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_DH_KDF_OID, 0, (void *)oid)
+
+# define EVP_PKEY_CTX_get0_dh_kdf_oid(ctx, poid) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
+ EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_GET_DH_KDF_OID, 0, (void *)poid)
+
+# define EVP_PKEY_CTX_set_dh_kdf_md(ctx, md) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
+ EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_DH_KDF_MD, 0, (void *)md)
+
+# define EVP_PKEY_CTX_get_dh_kdf_md(ctx, pmd) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
+ EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_GET_DH_KDF_MD, 0, (void *)pmd)
+
+# define EVP_PKEY_CTX_set_dh_kdf_outlen(ctx, len) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
+ EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_DH_KDF_OUTLEN, len, NULL)
+
+# define EVP_PKEY_CTX_get_dh_kdf_outlen(ctx, plen) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
+ EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_GET_DH_KDF_OUTLEN, 0, (void *)plen)
+
+# define EVP_PKEY_CTX_set0_dh_kdf_ukm(ctx, p, plen) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
+ EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_DH_KDF_UKM, plen, (void *)p)
+
+# define EVP_PKEY_CTX_get0_dh_kdf_ukm(ctx, p) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
+ EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_GET_DH_KDF_UKM, 0, (void *)p)
+
+# define EVP_PKEY_CTRL_DH_PARAMGEN_PRIME_LEN (EVP_PKEY_ALG_CTRL + 1)
+# define EVP_PKEY_CTRL_DH_PARAMGEN_GENERATOR (EVP_PKEY_ALG_CTRL + 2)
+# define EVP_PKEY_CTRL_DH_RFC5114 (EVP_PKEY_ALG_CTRL + 3)
+# define EVP_PKEY_CTRL_DH_PARAMGEN_SUBPRIME_LEN (EVP_PKEY_ALG_CTRL + 4)
+# define EVP_PKEY_CTRL_DH_PARAMGEN_TYPE (EVP_PKEY_ALG_CTRL + 5)
+# define EVP_PKEY_CTRL_DH_KDF_TYPE (EVP_PKEY_ALG_CTRL + 6)
+# define EVP_PKEY_CTRL_DH_KDF_MD (EVP_PKEY_ALG_CTRL + 7)
+# define EVP_PKEY_CTRL_GET_DH_KDF_MD (EVP_PKEY_ALG_CTRL + 8)
+# define EVP_PKEY_CTRL_DH_KDF_OUTLEN (EVP_PKEY_ALG_CTRL + 9)
+# define EVP_PKEY_CTRL_GET_DH_KDF_OUTLEN (EVP_PKEY_ALG_CTRL + 10)
+# define EVP_PKEY_CTRL_DH_KDF_UKM (EVP_PKEY_ALG_CTRL + 11)
+# define EVP_PKEY_CTRL_GET_DH_KDF_UKM (EVP_PKEY_ALG_CTRL + 12)
+# define EVP_PKEY_CTRL_DH_KDF_OID (EVP_PKEY_ALG_CTRL + 13)
+# define EVP_PKEY_CTRL_GET_DH_KDF_OID (EVP_PKEY_ALG_CTRL + 14)
+
+/* KDF types */
+# define EVP_PKEY_DH_KDF_NONE 1
+# define EVP_PKEY_DH_KDF_X9_42 2
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_DH_strings(void);
+
+/* Error codes for the DH functions. */
+
+/* Function codes. */
+# define DH_F_COMPUTE_KEY 102
+# define DH_F_DHPARAMS_PRINT_FP 101
+# define DH_F_DH_BUILTIN_GENPARAMS 106
+# define DH_F_DH_CMS_DECRYPT 117
+# define DH_F_DH_CMS_SET_PEERKEY 118
+# define DH_F_DH_CMS_SET_SHARED_INFO 119
+# define DH_F_DH_COMPUTE_KEY 114
+# define DH_F_DH_GENERATE_KEY 115
+# define DH_F_DH_GENERATE_PARAMETERS_EX 116
+# define DH_F_DH_NEW_METHOD 105
+# define DH_F_DH_PARAM_DECODE 107
+# define DH_F_DH_PRIV_DECODE 110
+# define DH_F_DH_PRIV_ENCODE 111
+# define DH_F_DH_PUB_DECODE 108
+# define DH_F_DH_PUB_ENCODE 109
+# define DH_F_DO_DH_PRINT 100
+# define DH_F_GENERATE_KEY 103
+# define DH_F_GENERATE_PARAMETERS 104
+# define DH_F_PKEY_DH_DERIVE 112
+# define DH_F_PKEY_DH_KEYGEN 113
+
+/* Reason codes. */
+# define DH_R_BAD_GENERATOR 101
+# define DH_R_BN_DECODE_ERROR 109
+# define DH_R_BN_ERROR 106
+# define DH_R_DECODE_ERROR 104
+# define DH_R_INVALID_PUBKEY 102
+# define DH_R_KDF_PARAMETER_ERROR 112
+# define DH_R_KEYS_NOT_SET 108
+# define DH_R_KEY_SIZE_TOO_SMALL 110
+# define DH_R_MODULUS_TOO_LARGE 103
+# define DH_R_NON_FIPS_METHOD 111
+# define DH_R_NO_PARAMETERS_SET 107
+# define DH_R_NO_PRIVATE_VALUE 100
+# define DH_R_PARAMETER_ENCODING_ERROR 105
+# define DH_R_PEER_KEY_ERROR 113
+# define DH_R_SHARED_INFO_ERROR 114
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/deps/openssl/openssl/include/openssl/dsa.h b/deps/openssl/openssl/include/openssl/dsa.h
index 0365acfe665..545358fd02b 100644
--- a/deps/openssl/openssl/include/openssl/dsa.h
+++ b/deps/openssl/openssl/include/openssl/dsa.h
@@ -1 +1,332 @@
-#include "../../crypto/dsa/dsa.h"
+/* crypto/dsa/dsa.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+/*
+ * The DSS routines are based on patches supplied by
+ * Steven Schoch <schoch@sheba.arc.nasa.gov>. He basically did the
+ * work and I have just tweaked them a little to fit into my
+ * stylistic vision for SSLeay :-) */
+
+#ifndef HEADER_DSA_H
+# define HEADER_DSA_H
+
+# include <openssl/e_os2.h>
+
+# ifdef OPENSSL_NO_DSA
+# error DSA is disabled.
+# endif
+
+# ifndef OPENSSL_NO_BIO
+# include <openssl/bio.h>
+# endif
+# include <openssl/crypto.h>
+# include <openssl/ossl_typ.h>
+
+# ifndef OPENSSL_NO_DEPRECATED
+# include <openssl/bn.h>
+# ifndef OPENSSL_NO_DH
+# include <openssl/dh.h>
+# endif
+# endif
+
+# ifndef OPENSSL_DSA_MAX_MODULUS_BITS
+# define OPENSSL_DSA_MAX_MODULUS_BITS 10000
+# endif
+
+# define DSA_FLAG_CACHE_MONT_P 0x01
+/*
+ * new with 0.9.7h; the built-in DSA implementation now uses constant time
+ * modular exponentiation for secret exponents by default. This flag causes
+ * the faster variable sliding window method to be used for all exponents.
+ */
+# define DSA_FLAG_NO_EXP_CONSTTIME 0x02
+
+/*
+ * If this flag is set the DSA method is FIPS compliant and can be used in
+ * FIPS mode. This is set in the validated module method. If an application
+ * sets this flag in its own methods it is its reposibility to ensure the
+ * result is compliant.
+ */
+
+# define DSA_FLAG_FIPS_METHOD 0x0400
+
+/*
+ * If this flag is set the operations normally disabled in FIPS mode are
+ * permitted it is then the applications responsibility to ensure that the
+ * usage is compliant.
+ */
+
+# define DSA_FLAG_NON_FIPS_ALLOW 0x0400
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Already defined in ossl_typ.h */
+/* typedef struct dsa_st DSA; */
+/* typedef struct dsa_method DSA_METHOD; */
+
+typedef struct DSA_SIG_st {
+ BIGNUM *r;
+ BIGNUM *s;
+} DSA_SIG;
+
+struct dsa_method {
+ const char *name;
+ DSA_SIG *(*dsa_do_sign) (const unsigned char *dgst, int dlen, DSA *dsa);
+ int (*dsa_sign_setup) (DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp,
+ BIGNUM **rp);
+ int (*dsa_do_verify) (const unsigned char *dgst, int dgst_len,
+ DSA_SIG *sig, DSA *dsa);
+ int (*dsa_mod_exp) (DSA *dsa, BIGNUM *rr, BIGNUM *a1, BIGNUM *p1,
+ BIGNUM *a2, BIGNUM *p2, BIGNUM *m, BN_CTX *ctx,
+ BN_MONT_CTX *in_mont);
+ /* Can be null */
+ int (*bn_mod_exp) (DSA *dsa, BIGNUM *r, BIGNUM *a, const BIGNUM *p,
+ const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
+ int (*init) (DSA *dsa);
+ int (*finish) (DSA *dsa);
+ int flags;
+ char *app_data;
+ /* If this is non-NULL, it is used to generate DSA parameters */
+ int (*dsa_paramgen) (DSA *dsa, int bits,
+ const unsigned char *seed, int seed_len,
+ int *counter_ret, unsigned long *h_ret,
+ BN_GENCB *cb);
+ /* If this is non-NULL, it is used to generate DSA keys */
+ int (*dsa_keygen) (DSA *dsa);
+};
+
+struct dsa_st {
+ /*
+ * This first variable is used to pick up errors where a DSA is passed
+ * instead of of a EVP_PKEY
+ */
+ int pad;
+ long version;
+ int write_params;
+ BIGNUM *p;
+ BIGNUM *q; /* == 20 */
+ BIGNUM *g;
+ BIGNUM *pub_key; /* y public key */
+ BIGNUM *priv_key; /* x private key */
+ BIGNUM *kinv; /* Signing pre-calc */
+ BIGNUM *r; /* Signing pre-calc */
+ int flags;
+ /* Normally used to cache montgomery values */
+ BN_MONT_CTX *method_mont_p;
+ int references;
+ CRYPTO_EX_DATA ex_data;
+ const DSA_METHOD *meth;
+ /* functional reference if 'meth' is ENGINE-provided */
+ ENGINE *engine;
+};
+
+# define d2i_DSAparams_fp(fp,x) (DSA *)ASN1_d2i_fp((char *(*)())DSA_new, \
+ (char *(*)())d2i_DSAparams,(fp),(unsigned char **)(x))
+# define i2d_DSAparams_fp(fp,x) ASN1_i2d_fp(i2d_DSAparams,(fp), \
+ (unsigned char *)(x))
+# define d2i_DSAparams_bio(bp,x) ASN1_d2i_bio_of(DSA,DSA_new,d2i_DSAparams,bp,x)
+# define i2d_DSAparams_bio(bp,x) ASN1_i2d_bio_of_const(DSA,i2d_DSAparams,bp,x)
+
+DSA *DSAparams_dup(DSA *x);
+DSA_SIG *DSA_SIG_new(void);
+void DSA_SIG_free(DSA_SIG *a);
+int i2d_DSA_SIG(const DSA_SIG *a, unsigned char **pp);
+DSA_SIG *d2i_DSA_SIG(DSA_SIG **v, const unsigned char **pp, long length);
+
+DSA_SIG *DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa);
+int DSA_do_verify(const unsigned char *dgst, int dgst_len,
+ DSA_SIG *sig, DSA *dsa);
+
+const DSA_METHOD *DSA_OpenSSL(void);
+
+void DSA_set_default_method(const DSA_METHOD *);
+const DSA_METHOD *DSA_get_default_method(void);
+int DSA_set_method(DSA *dsa, const DSA_METHOD *);
+
+DSA *DSA_new(void);
+DSA *DSA_new_method(ENGINE *engine);
+void DSA_free(DSA *r);
+/* "up" the DSA object's reference count */
+int DSA_up_ref(DSA *r);
+int DSA_size(const DSA *);
+ /* next 4 return -1 on error */
+int DSA_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp);
+int DSA_sign(int type, const unsigned char *dgst, int dlen,
+ unsigned char *sig, unsigned int *siglen, DSA *dsa);
+int DSA_verify(int type, const unsigned char *dgst, int dgst_len,
+ const unsigned char *sigbuf, int siglen, DSA *dsa);
+int DSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
+ CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
+int DSA_set_ex_data(DSA *d, int idx, void *arg);
+void *DSA_get_ex_data(DSA *d, int idx);
+
+DSA *d2i_DSAPublicKey(DSA **a, const unsigned char **pp, long length);
+DSA *d2i_DSAPrivateKey(DSA **a, const unsigned char **pp, long length);
+DSA *d2i_DSAparams(DSA **a, const unsigned char **pp, long length);
+
+/* Deprecated version */
+# ifndef OPENSSL_NO_DEPRECATED
+DSA *DSA_generate_parameters(int bits,
+ unsigned char *seed, int seed_len,
+ int *counter_ret, unsigned long *h_ret, void
+ (*callback) (int, int, void *), void *cb_arg);
+# endif /* !defined(OPENSSL_NO_DEPRECATED) */
+
+/* New version */
+int DSA_generate_parameters_ex(DSA *dsa, int bits,
+ const unsigned char *seed, int seed_len,
+ int *counter_ret, unsigned long *h_ret,
+ BN_GENCB *cb);
+
+int DSA_generate_key(DSA *a);
+int i2d_DSAPublicKey(const DSA *a, unsigned char **pp);
+int i2d_DSAPrivateKey(const DSA *a, unsigned char **pp);
+int i2d_DSAparams(const DSA *a, unsigned char **pp);
+
+# ifndef OPENSSL_NO_BIO
+int DSAparams_print(BIO *bp, const DSA *x);
+int DSA_print(BIO *bp, const DSA *x, int off);
+# endif
+# ifndef OPENSSL_NO_FP_API
+int DSAparams_print_fp(FILE *fp, const DSA *x);
+int DSA_print_fp(FILE *bp, const DSA *x, int off);
+# endif
+
+# define DSS_prime_checks 50
+/*
+ * Primality test according to FIPS PUB 186[-1], Appendix 2.1: 50 rounds of
+ * Rabin-Miller
+ */
+# define DSA_is_prime(n, callback, cb_arg) \
+ BN_is_prime(n, DSS_prime_checks, callback, NULL, cb_arg)
+
+# ifndef OPENSSL_NO_DH
+/*
+ * Convert DSA structure (key or just parameters) into DH structure (be
+ * careful to avoid small subgroup attacks when using this!)
+ */
+DH *DSA_dup_DH(const DSA *r);
+# endif
+
+# define EVP_PKEY_CTX_set_dsa_paramgen_bits(ctx, nbits) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DSA, EVP_PKEY_OP_PARAMGEN, \
+ EVP_PKEY_CTRL_DSA_PARAMGEN_BITS, nbits, NULL)
+
+# define EVP_PKEY_CTRL_DSA_PARAMGEN_BITS (EVP_PKEY_ALG_CTRL + 1)
+# define EVP_PKEY_CTRL_DSA_PARAMGEN_Q_BITS (EVP_PKEY_ALG_CTRL + 2)
+# define EVP_PKEY_CTRL_DSA_PARAMGEN_MD (EVP_PKEY_ALG_CTRL + 3)
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_DSA_strings(void);
+
+/* Error codes for the DSA functions. */
+
+/* Function codes. */
+# define DSA_F_D2I_DSA_SIG 110
+# define DSA_F_DO_DSA_PRINT 104
+# define DSA_F_DSAPARAMS_PRINT 100
+# define DSA_F_DSAPARAMS_PRINT_FP 101
+# define DSA_F_DSA_BUILTIN_PARAMGEN2 126
+# define DSA_F_DSA_DO_SIGN 112
+# define DSA_F_DSA_DO_VERIFY 113
+# define DSA_F_DSA_GENERATE_KEY 124
+# define DSA_F_DSA_GENERATE_PARAMETERS_EX 123
+# define DSA_F_DSA_NEW_METHOD 103
+# define DSA_F_DSA_PARAM_DECODE 119
+# define DSA_F_DSA_PRINT_FP 105
+# define DSA_F_DSA_PRIV_DECODE 115
+# define DSA_F_DSA_PRIV_ENCODE 116
+# define DSA_F_DSA_PUB_DECODE 117
+# define DSA_F_DSA_PUB_ENCODE 118
+# define DSA_F_DSA_SIGN 106
+# define DSA_F_DSA_SIGN_SETUP 107
+# define DSA_F_DSA_SIG_NEW 109
+# define DSA_F_DSA_SIG_PRINT 125
+# define DSA_F_DSA_VERIFY 108
+# define DSA_F_I2D_DSA_SIG 111
+# define DSA_F_OLD_DSA_PRIV_DECODE 122
+# define DSA_F_PKEY_DSA_CTRL 120
+# define DSA_F_PKEY_DSA_KEYGEN 121
+# define DSA_F_SIG_CB 114
+
+/* Reason codes. */
+# define DSA_R_BAD_Q_VALUE 102
+# define DSA_R_BN_DECODE_ERROR 108
+# define DSA_R_BN_ERROR 109
+# define DSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 100
+# define DSA_R_DECODE_ERROR 104
+# define DSA_R_INVALID_DIGEST_TYPE 106
+# define DSA_R_INVALID_PARAMETERS 112
+# define DSA_R_MISSING_PARAMETERS 101
+# define DSA_R_MODULUS_TOO_LARGE 103
+# define DSA_R_NEED_NEW_SETUP_VALUES 110
+# define DSA_R_NON_FIPS_DSA_METHOD 111
+# define DSA_R_NO_PARAMETERS_SET 107
+# define DSA_R_PARAMETER_ENCODING_ERROR 105
+# define DSA_R_Q_NOT_PRIME 113
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/deps/openssl/openssl/include/openssl/dso.h b/deps/openssl/openssl/include/openssl/dso.h
index f3c8de23065..7c4a1dc4a62 100644
--- a/deps/openssl/openssl/include/openssl/dso.h
+++ b/deps/openssl/openssl/include/openssl/dso.h
@@ -1 +1,451 @@
-#include "../../crypto/dso/dso.h"
+/* dso.h -*- mode:C; c-file-style: "eay" -*- */
+/*
+ * Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL project
+ * 2000.
+ */
+/* ====================================================================
+ * Copyright (c) 2000 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * licensing@OpenSSL.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+#ifndef HEADER_DSO_H
+# define HEADER_DSO_H
+
+# include <openssl/crypto.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* These values are used as commands to DSO_ctrl() */
+# define DSO_CTRL_GET_FLAGS 1
+# define DSO_CTRL_SET_FLAGS 2
+# define DSO_CTRL_OR_FLAGS 3
+
+/*
+ * By default, DSO_load() will translate the provided filename into a form
+ * typical for the platform (more specifically the DSO_METHOD) using the
+ * dso_name_converter function of the method. Eg. win32 will transform "blah"
+ * into "blah.dll", and dlfcn will transform it into "libblah.so". The
+ * behaviour can be overriden by setting the name_converter callback in the
+ * DSO object (using DSO_set_name_converter()). This callback could even
+ * utilise the DSO_METHOD's converter too if it only wants to override
+ * behaviour for one or two possible DSO methods. However, the following flag
+ * can be set in a DSO to prevent *any* native name-translation at all - eg.
+ * if the caller has prompted the user for a path to a driver library so the
+ * filename should be interpreted as-is.
+ */
+# define DSO_FLAG_NO_NAME_TRANSLATION 0x01
+/*
+ * An extra flag to give if only the extension should be added as
+ * translation. This is obviously only of importance on Unix and other
+ * operating systems where the translation also may prefix the name with
+ * something, like 'lib', and ignored everywhere else. This flag is also
+ * ignored if DSO_FLAG_NO_NAME_TRANSLATION is used at the same time.
+ */
+# define DSO_FLAG_NAME_TRANSLATION_EXT_ONLY 0x02
+
+/*
+ * The following flag controls the translation of symbol names to upper case.
+ * This is currently only being implemented for OpenVMS.
+ */
+# define DSO_FLAG_UPCASE_SYMBOL 0x10
+
+/*
+ * This flag loads the library with public symbols. Meaning: The exported
+ * symbols of this library are public to all libraries loaded after this
+ * library. At the moment only implemented in unix.
+ */
+# define DSO_FLAG_GLOBAL_SYMBOLS 0x20
+
+typedef void (*DSO_FUNC_TYPE) (void);
+
+typedef struct dso_st DSO;
+
+/*
+ * The function prototype used for method functions (or caller-provided
+ * callbacks) that transform filenames. They are passed a DSO structure
+ * pointer (or NULL if they are to be used independantly of a DSO object) and
+ * a filename to transform. They should either return NULL (if there is an
+ * error condition) or a newly allocated string containing the transformed
+ * form that the caller will need to free with OPENSSL_free() when done.
+ */
+typedef char *(*DSO_NAME_CONVERTER_FUNC)(DSO *, const char *);
+/*
+ * The function prototype used for method functions (or caller-provided
+ * callbacks) that merge two file specifications. They are passed a DSO
+ * structure pointer (or NULL if they are to be used independantly of a DSO
+ * object) and two file specifications to merge. They should either return
+ * NULL (if there is an error condition) or a newly allocated string
+ * containing the result of merging that the caller will need to free with
+ * OPENSSL_free() when done. Here, merging means that bits and pieces are
+ * taken from each of the file specifications and added together in whatever
+ * fashion that is sensible for the DSO method in question. The only rule
+ * that really applies is that if the two specification contain pieces of the
+ * same type, the copy from the first string takes priority. One could see
+ * it as the first specification is the one given by the user and the second
+ * being a bunch of defaults to add on if they're missing in the first.
+ */
+typedef char *(*DSO_MERGER_FUNC)(DSO *, const char *, const char *);
+
+typedef struct dso_meth_st {
+ const char *name;
+ /*
+ * Loads a shared library, NB: new DSO_METHODs must ensure that a
+ * successful load populates the loaded_filename field, and likewise a
+ * successful unload OPENSSL_frees and NULLs it out.
+ */
+ int (*dso_load) (DSO *dso);
+ /* Unloads a shared library */
+ int (*dso_unload) (DSO *dso);
+ /* Binds a variable */
+ void *(*dso_bind_var) (DSO *dso, const char *symname);
+ /*
+ * Binds a function - assumes a return type of DSO_FUNC_TYPE. This should
+ * be cast to the real function prototype by the caller. Platforms that
+ * don't have compatible representations for different prototypes (this
+ * is possible within ANSI C) are highly unlikely to have shared
+ * libraries at all, let alone a DSO_METHOD implemented for them.
+ */
+ DSO_FUNC_TYPE (*dso_bind_func) (DSO *dso, const char *symname);
+/* I don't think this would actually be used in any circumstances. */
+# if 0
+ /* Unbinds a variable */
+ int (*dso_unbind_var) (DSO *dso, char *symname, void *symptr);
+ /* Unbinds a function */
+ int (*dso_unbind_func) (DSO *dso, char *symname, DSO_FUNC_TYPE symptr);
+# endif
+ /*
+ * The generic (yuck) "ctrl()" function. NB: Negative return values
+ * (rather than zero) indicate errors.
+ */
+ long (*dso_ctrl) (DSO *dso, int cmd, long larg, void *parg);
+ /*
+ * The default DSO_METHOD-specific function for converting filenames to a
+ * canonical native form.
+ */
+ DSO_NAME_CONVERTER_FUNC dso_name_converter;
+ /*
+ * The default DSO_METHOD-specific function for converting filenames to a
+ * canonical native form.
+ */
+ DSO_MERGER_FUNC dso_merger;
+ /* [De]Initialisation handlers. */
+ int (*init) (DSO *dso);
+ int (*finish) (DSO *dso);
+ /* Return pathname of the module containing location */
+ int (*pathbyaddr) (void *addr, char *path, int sz);
+ /* Perform global symbol lookup, i.e. among *all* modules */
+ void *(*globallookup) (const char *symname);
+} DSO_METHOD;
+
+/**********************************************************************/
+/* The low-level handle type used to refer to a loaded shared library */
+
+struct dso_st {
+ DSO_METHOD *meth;
+ /*
+ * Standard dlopen uses a (void *). Win32 uses a HANDLE. VMS doesn't use
+ * anything but will need to cache the filename for use in the dso_bind
+ * handler. All in all, let each method control its own destiny.
+ * "Handles" and such go in a STACK.
+ */
+ STACK_OF(void) *meth_data;
+ int references;
+ int flags;
+ /*
+ * For use by applications etc ... use this for your bits'n'pieces, don't
+ * touch meth_data!
+ */
+ CRYPTO_EX_DATA ex_data;
+ /*
+ * If this callback function pointer is set to non-NULL, then it will be
+ * used in DSO_load() in place of meth->dso_name_converter. NB: This
+ * should normally set using DSO_set_name_converter().
+ */
+ DSO_NAME_CONVERTER_FUNC name_converter;
+ /*
+ * If this callback function pointer is set to non-NULL, then it will be
+ * used in DSO_load() in place of meth->dso_merger. NB: This should
+ * normally set using DSO_set_merger().
+ */
+ DSO_MERGER_FUNC merger;
+ /*
+ * This is populated with (a copy of) the platform-independant filename
+ * used for this DSO.
+ */
+ char *filename;
+ /*
+ * This is populated with (a copy of) the translated filename by which
+ * the DSO was actually loaded. It is NULL iff the DSO is not currently
+ * loaded. NB: This is here because the filename translation process may
+ * involve a callback being invoked more than once not only to convert to
+ * a platform-specific form, but also to try different filenames in the
+ * process of trying to perform a load. As such, this variable can be
+ * used to indicate (a) whether this DSO structure corresponds to a
+ * loaded library or not, and (b) the filename with which it was actually
+ * loaded.
+ */
+ char *loaded_filename;
+};
+
+DSO *DSO_new(void);
+DSO *DSO_new_method(DSO_METHOD *method);
+int DSO_free(DSO *dso);
+int DSO_flags(DSO *dso);
+int DSO_up_ref(DSO *dso);
+long DSO_ctrl(DSO *dso, int cmd, long larg, void *parg);
+
+/*
+ * This function sets the DSO's name_converter callback. If it is non-NULL,
+ * then it will be used instead of the associated DSO_METHOD's function. If
+ * oldcb is non-NULL then it is set to the function pointer value being
+ * replaced. Return value is non-zero for success.
+ */
+int DSO_set_name_converter(DSO *dso, DSO_NAME_CONVERTER_FUNC cb,
+ DSO_NAME_CONVERTER_FUNC *oldcb);
+/*
+ * These functions can be used to get/set the platform-independant filename
+ * used for a DSO. NB: set will fail if the DSO is already loaded.
+ */
+const char *DSO_get_filename(DSO *dso);
+int DSO_set_filename(DSO *dso, const char *filename);
+/*
+ * This function will invoke the DSO's name_converter callback to translate a
+ * filename, or if the callback isn't set it will instead use the DSO_METHOD's
+ * converter. If "filename" is NULL, the "filename" in the DSO itself will be
+ * used. If the DSO_FLAG_NO_NAME_TRANSLATION flag is set, then the filename is
+ * simply duplicated. NB: This function is usually called from within a
+ * DSO_METHOD during the processing of a DSO_load() call, and is exposed so
+ * that caller-created DSO_METHODs can do the same thing. A non-NULL return
+ * value will need to be OPENSSL_free()'d.
+ */
+char *DSO_convert_filename(DSO *dso, const char *filename);
+/*
+ * This function will invoke the DSO's merger callback to merge two file
+ * specifications, or if the callback isn't set it will instead use the
+ * DSO_METHOD's merger. A non-NULL return value will need to be
+ * OPENSSL_free()'d.
+ */
+char *DSO_merge(DSO *dso, const char *filespec1, const char *filespec2);
+/*
+ * If the DSO is currently loaded, this returns the filename that it was
+ * loaded under, otherwise it returns NULL. So it is also useful as a test as
+ * to whether the DSO is currently loaded. NB: This will not necessarily
+ * return the same value as DSO_convert_filename(dso, dso->filename), because
+ * the DSO_METHOD's load function may have tried a variety of filenames (with
+ * and/or without the aid of the converters) before settling on the one it
+ * actually loaded.
+ */
+const char *DSO_get_loaded_filename(DSO *dso);
+
+void DSO_set_default_method(DSO_METHOD *meth);
+DSO_METHOD *DSO_get_default_method(void);
+DSO_METHOD *DSO_get_method(DSO *dso);
+DSO_METHOD *DSO_set_method(DSO *dso, DSO_METHOD *meth);
+
+/*
+ * The all-singing all-dancing load function, you normally pass NULL for the
+ * first and third parameters. Use DSO_up and DSO_free for subsequent
+ * reference count handling. Any flags passed in will be set in the
+ * constructed DSO after its init() function but before the load operation.
+ * If 'dso' is non-NULL, 'flags' is ignored.
+ */
+DSO *DSO_load(DSO *dso, const char *filename, DSO_METHOD *meth, int flags);
+
+/* This function binds to a variable inside a shared library. */
+void *DSO_bind_var(DSO *dso, const char *symname);
+
+/* This function binds to a function inside a shared library. */
+DSO_FUNC_TYPE DSO_bind_func(DSO *dso, const char *symname);
+
+/*
+ * This method is the default, but will beg, borrow, or steal whatever method
+ * should be the default on any particular platform (including
+ * DSO_METH_null() if necessary).
+ */
+DSO_METHOD *DSO_METHOD_openssl(void);
+
+/*
+ * This method is defined for all platforms - if a platform has no DSO
+ * support then this will be the only method!
+ */
+DSO_METHOD *DSO_METHOD_null(void);
+
+/*
+ * If DSO_DLFCN is defined, the standard dlfcn.h-style functions (dlopen,
+ * dlclose, dlsym, etc) will be used and incorporated into this method. If
+ * not, this method will return NULL.
+ */
+DSO_METHOD *DSO_METHOD_dlfcn(void);
+
+/*
+ * If DSO_DL is defined, the standard dl.h-style functions (shl_load,
+ * shl_unload, shl_findsym, etc) will be used and incorporated into this
+ * method. If not, this method will return NULL.
+ */
+DSO_METHOD *DSO_METHOD_dl(void);
+
+/* If WIN32 is defined, use DLLs. If not, return NULL. */
+DSO_METHOD *DSO_METHOD_win32(void);
+
+/* If VMS is defined, use shared images. If not, return NULL. */
+DSO_METHOD *DSO_METHOD_vms(void);
+
+/*
+ * This function writes null-terminated pathname of DSO module containing
+ * 'addr' into 'sz' large caller-provided 'path' and returns the number of
+ * characters [including trailing zero] written to it. If 'sz' is 0 or
+ * negative, 'path' is ignored and required amount of charachers [including
+ * trailing zero] to accomodate pathname is returned. If 'addr' is NULL, then
+ * pathname of cryptolib itself is returned. Negative or zero return value
+ * denotes error.
+ */
+int DSO_pathbyaddr(void *addr, char *path, int sz);
+
+/*
+ * This function should be used with caution! It looks up symbols in *all*
+ * loaded modules and if module gets unloaded by somebody else attempt to
+ * dereference the pointer is doomed to have fatal consequences. Primary
+ * usage for this function is to probe *core* system functionality, e.g.
+ * check if getnameinfo(3) is available at run-time without bothering about
+ * OS-specific details such as libc.so.versioning or where does it actually
+ * reside: in libc itself or libsocket.
+ */
+void *DSO_global_lookup(const char *name);
+
+/* If BeOS is defined, use shared images. If not, return NULL. */
+DSO_METHOD *DSO_METHOD_beos(void);
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_DSO_strings(void);
+
+/* Error codes for the DSO functions. */
+
+/* Function codes. */
+# define DSO_F_BEOS_BIND_FUNC 144
+# define DSO_F_BEOS_BIND_VAR 145
+# define DSO_F_BEOS_LOAD 146
+# define DSO_F_BEOS_NAME_CONVERTER 147
+# define DSO_F_BEOS_UNLOAD 148
+# define DSO_F_DLFCN_BIND_FUNC 100
+# define DSO_F_DLFCN_BIND_VAR 101
+# define DSO_F_DLFCN_LOAD 102
+# define DSO_F_DLFCN_MERGER 130
+# define DSO_F_DLFCN_NAME_CONVERTER 123
+# define DSO_F_DLFCN_UNLOAD 103
+# define DSO_F_DL_BIND_FUNC 104
+# define DSO_F_DL_BIND_VAR 105
+# define DSO_F_DL_LOAD 106
+# define DSO_F_DL_MERGER 131
+# define DSO_F_DL_NAME_CONVERTER 124
+# define DSO_F_DL_UNLOAD 107
+# define DSO_F_DSO_BIND_FUNC 108
+# define DSO_F_DSO_BIND_VAR 109
+# define DSO_F_DSO_CONVERT_FILENAME 126
+# define DSO_F_DSO_CTRL 110
+# define DSO_F_DSO_FREE 111
+# define DSO_F_DSO_GET_FILENAME 127
+# define DSO_F_DSO_GET_LOADED_FILENAME 128
+# define DSO_F_DSO_GLOBAL_LOOKUP 139
+# define DSO_F_DSO_LOAD 112
+# define DSO_F_DSO_MERGE 132
+# define DSO_F_DSO_NEW_METHOD 113
+# define DSO_F_DSO_PATHBYADDR 140
+# define DSO_F_DSO_SET_FILENAME 129
+# define DSO_F_DSO_SET_NAME_CONVERTER 122
+# define DSO_F_DSO_UP_REF 114
+# define DSO_F_GLOBAL_LOOKUP_FUNC 138
+# define DSO_F_PATHBYADDR 137
+# define DSO_F_VMS_BIND_SYM 115
+# define DSO_F_VMS_LOAD 116
+# define DSO_F_VMS_MERGER 133
+# define DSO_F_VMS_UNLOAD 117
+# define DSO_F_WIN32_BIND_FUNC 118
+# define DSO_F_WIN32_BIND_VAR 119
+# define DSO_F_WIN32_GLOBALLOOKUP 142
+# define DSO_F_WIN32_GLOBALLOOKUP_FUNC 143
+# define DSO_F_WIN32_JOINER 135
+# define DSO_F_WIN32_LOAD 120
+# define DSO_F_WIN32_MERGER 134
+# define DSO_F_WIN32_NAME_CONVERTER 125
+# define DSO_F_WIN32_PATHBYADDR 141
+# define DSO_F_WIN32_SPLITTER 136
+# define DSO_F_WIN32_UNLOAD 121
+
+/* Reason codes. */
+# define DSO_R_CTRL_FAILED 100
+# define DSO_R_DSO_ALREADY_LOADED 110
+# define DSO_R_EMPTY_FILE_STRUCTURE 113
+# define DSO_R_FAILURE 114
+# define DSO_R_FILENAME_TOO_BIG 101
+# define DSO_R_FINISH_FAILED 102
+# define DSO_R_INCORRECT_FILE_SYNTAX 115
+# define DSO_R_LOAD_FAILED 103
+# define DSO_R_NAME_TRANSLATION_FAILED 109
+# define DSO_R_NO_FILENAME 111
+# define DSO_R_NO_FILE_SPECIFICATION 116
+# define DSO_R_NULL_HANDLE 104
+# define DSO_R_SET_FILENAME_FAILED 112
+# define DSO_R_STACK_ERROR 105
+# define DSO_R_SYM_FAILURE 106
+# define DSO_R_UNLOAD_FAILED 107
+# define DSO_R_UNSUPPORTED 108
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/deps/openssl/openssl/include/openssl/dtls1.h b/deps/openssl/openssl/include/openssl/dtls1.h
index ac8ab57453c..30bbcf278a4 100644
--- a/deps/openssl/openssl/include/openssl/dtls1.h
+++ b/deps/openssl/openssl/include/openssl/dtls1.h
@@ -1 +1,272 @@
-#include "../../ssl/dtls1.h"
+/* ssl/dtls1.h */
+/*
+ * DTLS implementation written by Nagendra Modadugu
+ * (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
+ */
+/* ====================================================================
+ * Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@OpenSSL.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+#ifndef HEADER_DTLS1_H
+# define HEADER_DTLS1_H
+
+# include <openssl/buffer.h>
+# include <openssl/pqueue.h>
+# ifdef OPENSSL_SYS_VMS
+# include <resource.h>
+# include <sys/timeb.h>
+# endif
+# ifdef OPENSSL_SYS_WIN32
+/* Needed for struct timeval */
+# include <winsock.h>
+# elif defined(OPENSSL_SYS_NETWARE) && !defined(_WINSOCK2API_)
+# include <sys/timeval.h>
+# else
+# if defined(OPENSSL_SYS_VXWORKS)
+# include <sys/times.h>
+# else
+# include <sys/time.h>
+# endif
+# endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# define DTLS1_VERSION 0xFEFF
+# define DTLS1_2_VERSION 0xFEFD
+# define DTLS_MAX_VERSION DTLS1_2_VERSION
+# define DTLS1_VERSION_MAJOR 0xFE
+
+# define DTLS1_BAD_VER 0x0100
+
+/* Special value for method supporting multiple versions */
+# define DTLS_ANY_VERSION 0x1FFFF
+
+# if 0
+/* this alert description is not specified anywhere... */
+# define DTLS1_AD_MISSING_HANDSHAKE_MESSAGE 110
+# endif
+
+/* lengths of messages */
+# define DTLS1_COOKIE_LENGTH 256
+
+# define DTLS1_RT_HEADER_LENGTH 13
+
+# define DTLS1_HM_HEADER_LENGTH 12
+
+# define DTLS1_HM_BAD_FRAGMENT -2
+# define DTLS1_HM_FRAGMENT_RETRY -3
+
+# define DTLS1_CCS_HEADER_LENGTH 1
+
+# ifdef DTLS1_AD_MISSING_HANDSHAKE_MESSAGE
+# define DTLS1_AL_HEADER_LENGTH 7
+# else
+# define DTLS1_AL_HEADER_LENGTH 2
+# endif
+
+# ifndef OPENSSL_NO_SSL_INTERN
+
+# ifndef OPENSSL_NO_SCTP
+# define DTLS1_SCTP_AUTH_LABEL "EXPORTER_DTLS_OVER_SCTP"
+# endif
+
+/* Max MTU overhead we know about so far is 40 for IPv6 + 8 for UDP */
+# define DTLS1_MAX_MTU_OVERHEAD 48
+
+typedef struct dtls1_bitmap_st {
+ unsigned long map; /* track 32 packets on 32-bit systems and 64
+ * - on 64-bit systems */
+ unsigned char max_seq_num[8]; /* max record number seen so far, 64-bit
+ * value in big-endian encoding */
+} DTLS1_BITMAP;
+
+struct dtls1_retransmit_state {
+ EVP_CIPHER_CTX *enc_write_ctx; /* cryptographic state */
+ EVP_MD_CTX *write_hash; /* used for mac generation */
+# ifndef OPENSSL_NO_COMP
+ COMP_CTX *compress; /* compression */
+# else
+ char *compress;
+# endif
+ SSL_SESSION *session;
+ unsigned short epoch;
+};
+
+struct hm_header_st {
+ unsigned char type;
+ unsigned long msg_len;
+ unsigned short seq;
+ unsigned long frag_off;
+ unsigned long frag_len;
+ unsigned int is_ccs;
+ struct dtls1_retransmit_state saved_retransmit_state;
+};
+
+struct ccs_header_st {
+ unsigned char type;
+ unsigned short seq;
+};
+
+struct dtls1_timeout_st {
+ /* Number of read timeouts so far */
+ unsigned int read_timeouts;
+ /* Number of write timeouts so far */
+ unsigned int write_timeouts;
+ /* Number of alerts received so far */
+ unsigned int num_alerts;
+};
+
+typedef struct record_pqueue_st {
+ unsigned short epoch;
+ pqueue q;
+} record_pqueue;
+
+typedef struct hm_fragment_st {
+ struct hm_header_st msg_header;
+ unsigned char *fragment;
+ unsigned char *reassembly;
+} hm_fragment;
+
+typedef struct dtls1_state_st {
+ unsigned int send_cookie;
+ unsigned char cookie[DTLS1_COOKIE_LENGTH];
+ unsigned char rcvd_cookie[DTLS1_COOKIE_LENGTH];
+ unsigned int cookie_len;
+ /*
+ * The current data and handshake epoch. This is initially
+ * undefined, and starts at zero once the initial handshake is
+ * completed
+ */
+ unsigned short r_epoch;
+ unsigned short w_epoch;
+ /* records being received in the current epoch */
+ DTLS1_BITMAP bitmap;
+ /* renegotiation starts a new set of sequence numbers */
+ DTLS1_BITMAP next_bitmap;
+ /* handshake message numbers */
+ unsigned short handshake_write_seq;
+ unsigned short next_handshake_write_seq;
+ unsigned short handshake_read_seq;
+ /* save last sequence number for retransmissions */
+ unsigned char last_write_sequence[8];
+ /* Received handshake records (processed and unprocessed) */
+ record_pqueue unprocessed_rcds;
+ record_pqueue processed_rcds;
+ /* Buffered handshake messages */
+ pqueue buffered_messages;
+ /* Buffered (sent) handshake records */
+ pqueue sent_messages;
+ /*
+ * Buffered application records. Only for records between CCS and
+ * Finished to prevent either protocol violation or unnecessary message
+ * loss.
+ */
+ record_pqueue buffered_app_data;
+ /* Is set when listening for new connections with dtls1_listen() */
+ unsigned int listen;
+ unsigned int link_mtu; /* max on-the-wire DTLS packet size */
+ unsigned int mtu; /* max DTLS packet size */
+ struct hm_header_st w_msg_hdr;
+ struct hm_header_st r_msg_hdr;
+ struct dtls1_timeout_st timeout;
+ /*
+ * Indicates when the last handshake msg or heartbeat sent will timeout
+ */
+ struct timeval next_timeout;
+ /* Timeout duration */
+ unsigned short timeout_duration;
+ /*
+ * storage for Alert/Handshake protocol data received but not yet
+ * processed by ssl3_read_bytes:
+ */
+ unsigned char alert_fragment[DTLS1_AL_HEADER_LENGTH];
+ unsigned int alert_fragment_len;
+ unsigned char handshake_fragment[DTLS1_HM_HEADER_LENGTH];
+ unsigned int handshake_fragment_len;
+ unsigned int retransmitting;
+ /*
+ * Set when the handshake is ready to process peer's ChangeCipherSpec message.
+ * Cleared after the message has been processed.
+ */
+ unsigned int change_cipher_spec_ok;
+# ifndef OPENSSL_NO_SCTP
+ /* used when SSL_ST_XX_FLUSH is entered */
+ int next_state;
+ int shutdown_received;
+# endif
+} DTLS1_STATE;
+
+typedef struct dtls1_record_data_st {
+ unsigned char *packet;
+ unsigned int packet_length;
+ SSL3_BUFFER rbuf;
+ SSL3_RECORD rrec;
+# ifndef OPENSSL_NO_SCTP
+ struct bio_dgram_sctp_rcvinfo recordinfo;
+# endif
+} DTLS1_RECORD_DATA;
+
+# endif
+
+/* Timeout multipliers (timeout slice is defined in apps/timeouts.h */
+# define DTLS1_TMO_READ_COUNT 2
+# define DTLS1_TMO_WRITE_COUNT 2
+
+# define DTLS1_TMO_ALERT_COUNT 12
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/deps/openssl/openssl/include/openssl/e_os2.h b/deps/openssl/openssl/include/openssl/e_os2.h
index ab3f1ee44f4..7be9989ac3a 100644
--- a/deps/openssl/openssl/include/openssl/e_os2.h
+++ b/deps/openssl/openssl/include/openssl/e_os2.h
@@ -1 +1,328 @@
-#include "../../e_os2.h"
+/* e_os2.h */
+/* ====================================================================
+ * Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+#include <openssl/opensslconf.h>
+
+#ifndef HEADER_E_OS2_H
+# define HEADER_E_OS2_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/******************************************************************************
+ * Detect operating systems. This probably needs completing.
+ * The result is that at least one OPENSSL_SYS_os macro should be defined.
+ * However, if none is defined, Unix is assumed.
+ **/
+
+# define OPENSSL_SYS_UNIX
+
+/* ---------------------- Macintosh, before MacOS X ----------------------- */
+# if defined(__MWERKS__) && defined(macintosh) || defined(OPENSSL_SYSNAME_MAC)
+# undef OPENSSL_SYS_UNIX
+# define OPENSSL_SYS_MACINTOSH_CLASSIC
+# endif
+
+/* ---------------------- NetWare ----------------------------------------- */
+# if defined(NETWARE) || defined(OPENSSL_SYSNAME_NETWARE)
+# undef OPENSSL_SYS_UNIX
+# define OPENSSL_SYS_NETWARE
+# endif
+
+/* --------------------- Microsoft operating systems ---------------------- */
+
+/*
+ * Note that MSDOS actually denotes 32-bit environments running on top of
+ * MS-DOS, such as DJGPP one.
+ */
+# if defined(OPENSSL_SYSNAME_MSDOS)
+# undef OPENSSL_SYS_UNIX
+# define OPENSSL_SYS_MSDOS
+# endif
+
+/*
+ * For 32 bit environment, there seems to be the CygWin environment and then
+ * all the others that try to do the same thing Microsoft does...
+ */
+# if defined(OPENSSL_SYSNAME_UWIN)
+# undef OPENSSL_SYS_UNIX
+# define OPENSSL_SYS_WIN32_UWIN
+# else
+# if defined(__CYGWIN__) || defined(OPENSSL_SYSNAME_CYGWIN)
+# undef OPENSSL_SYS_UNIX
+# define OPENSSL_SYS_WIN32_CYGWIN
+# else
+# if defined(_WIN32) || defined(OPENSSL_SYSNAME_WIN32)
+# undef OPENSSL_SYS_UNIX
+# define OPENSSL_SYS_WIN32
+# endif
+# if defined(_WIN64) || defined(OPENSSL_SYSNAME_WIN64)
+# undef OPENSSL_SYS_UNIX
+# if !defined(OPENSSL_SYS_WIN64)
+# define OPENSSL_SYS_WIN64
+# endif
+# endif
+# if defined(OPENSSL_SYSNAME_WINNT)
+# undef OPENSSL_SYS_UNIX
+# define OPENSSL_SYS_WINNT
+# endif
+# if defined(OPENSSL_SYSNAME_WINCE)
+# undef OPENSSL_SYS_UNIX
+# define OPENSSL_SYS_WINCE
+# endif
+# endif
+# endif
+
+/* Anything that tries to look like Microsoft is "Windows" */
+# if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WIN64) || defined(OPENSSL_SYS_WINNT) || defined(OPENSSL_SYS_WINCE)
+# undef OPENSSL_SYS_UNIX
+# define OPENSSL_SYS_WINDOWS
+# ifndef OPENSSL_SYS_MSDOS
+# define OPENSSL_SYS_MSDOS
+# endif
+# endif
+
+/*
+ * DLL settings. This part is a bit tough, because it's up to the
+ * application implementor how he or she will link the application, so it
+ * requires some macro to be used.
+ */
+# ifdef OPENSSL_SYS_WINDOWS
+# ifndef OPENSSL_OPT_WINDLL
+# if defined(_WINDLL) /* This is used when building OpenSSL to
+ * indicate that DLL linkage should be used */
+# define OPENSSL_OPT_WINDLL
+# endif
+# endif
+# endif
+
+/* ------------------------------- OpenVMS -------------------------------- */
+# if defined(__VMS) || defined(VMS) || defined(OPENSSL_SYSNAME_VMS)
+# undef OPENSSL_SYS_UNIX
+# define OPENSSL_SYS_VMS
+# if defined(__DECC)
+# define OPENSSL_SYS_VMS_DECC
+# elif defined(__DECCXX)
+# define OPENSSL_SYS_VMS_DECC
+# define OPENSSL_SYS_VMS_DECCXX
+# else
+# define OPENSSL_SYS_VMS_NODECC
+# endif
+# endif
+
+/* -------------------------------- OS/2 ---------------------------------- */
+# if defined(__EMX__) || defined(__OS2__)
+# undef OPENSSL_SYS_UNIX
+# define OPENSSL_SYS_OS2
+# endif
+
+/* -------------------------------- Unix ---------------------------------- */
+# ifdef OPENSSL_SYS_UNIX
+# if defined(linux) || defined(__linux__) || defined(OPENSSL_SYSNAME_LINUX)
+# define OPENSSL_SYS_LINUX
+# endif
+# ifdef OPENSSL_SYSNAME_MPE
+# define OPENSSL_SYS_MPE
+# endif
+# ifdef OPENSSL_SYSNAME_SNI
+# define OPENSSL_SYS_SNI
+# endif
+# ifdef OPENSSL_SYSNAME_ULTRASPARC
+# define OPENSSL_SYS_ULTRASPARC
+# endif
+# ifdef OPENSSL_SYSNAME_NEWS4
+# define OPENSSL_SYS_NEWS4
+# endif
+# ifdef OPENSSL_SYSNAME_MACOSX
+# define OPENSSL_SYS_MACOSX
+# endif
+# ifdef OPENSSL_SYSNAME_MACOSX_RHAPSODY
+# define OPENSSL_SYS_MACOSX_RHAPSODY
+# define OPENSSL_SYS_MACOSX
+# endif
+# ifdef OPENSSL_SYSNAME_SUNOS
+# define OPENSSL_SYS_SUNOS
+# endif
+# if defined(_CRAY) || defined(OPENSSL_SYSNAME_CRAY)
+# define OPENSSL_SYS_CRAY
+# endif
+# if defined(_AIX) || defined(OPENSSL_SYSNAME_AIX)
+# define OPENSSL_SYS_AIX
+# endif
+# endif
+
+/* -------------------------------- VOS ----------------------------------- */
+# if defined(__VOS__) || defined(OPENSSL_SYSNAME_VOS)
+# define OPENSSL_SYS_VOS
+# ifdef __HPPA__
+# define OPENSSL_SYS_VOS_HPPA
+# endif
+# ifdef __IA32__
+# define OPENSSL_SYS_VOS_IA32
+# endif
+# endif
+
+/* ------------------------------ VxWorks --------------------------------- */
+# ifdef OPENSSL_SYSNAME_VXWORKS
+# define OPENSSL_SYS_VXWORKS
+# endif
+
+/* -------------------------------- BeOS ---------------------------------- */
+# if defined(__BEOS__)
+# define OPENSSL_SYS_BEOS
+# include <sys/socket.h>
+# if defined(BONE_VERSION)
+# define OPENSSL_SYS_BEOS_BONE
+# else
+# define OPENSSL_SYS_BEOS_R5
+# endif
+# endif
+
+/**
+ * That's it for OS-specific stuff
+ *****************************************************************************/
+
+/* Specials for I/O an exit */
+# ifdef OPENSSL_SYS_MSDOS
+# define OPENSSL_UNISTD_IO <io.h>
+# define OPENSSL_DECLARE_EXIT extern void exit(int);
+# else
+# define OPENSSL_UNISTD_IO OPENSSL_UNISTD
+# define OPENSSL_DECLARE_EXIT /* declared in unistd.h */
+# endif
+
+/*-
+ * Definitions of OPENSSL_GLOBAL and OPENSSL_EXTERN, to define and declare
+ * certain global symbols that, with some compilers under VMS, have to be
+ * defined and declared explicitely with globaldef and globalref.
+ * Definitions of OPENSSL_EXPORT and OPENSSL_IMPORT, to define and declare
+ * DLL exports and imports for compilers under Win32. These are a little
+ * more complicated to use. Basically, for any library that exports some
+ * global variables, the following code must be present in the header file
+ * that declares them, before OPENSSL_EXTERN is used:
+ *
+ * #ifdef SOME_BUILD_FLAG_MACRO
+ * # undef OPENSSL_EXTERN
+ * # define OPENSSL_EXTERN OPENSSL_EXPORT
+ * #endif
+ *
+ * The default is to have OPENSSL_EXPORT, OPENSSL_IMPORT and OPENSSL_GLOBAL
+ * have some generally sensible values, and for OPENSSL_EXTERN to have the
+ * value OPENSSL_IMPORT.
+ */
+
+# if defined(OPENSSL_SYS_VMS_NODECC)
+# define OPENSSL_EXPORT globalref
+# define OPENSSL_IMPORT globalref
+# define OPENSSL_GLOBAL globaldef
+# elif defined(OPENSSL_SYS_WINDOWS) && defined(OPENSSL_OPT_WINDLL)
+# define OPENSSL_EXPORT extern __declspec(dllexport)
+# define OPENSSL_IMPORT extern __declspec(dllimport)
+# define OPENSSL_GLOBAL
+# else
+# define OPENSSL_EXPORT extern
+# define OPENSSL_IMPORT extern
+# define OPENSSL_GLOBAL
+# endif
+# define OPENSSL_EXTERN OPENSSL_IMPORT
+
+/*-
+ * Macros to allow global variables to be reached through function calls when
+ * required (if a shared library version requires it, for example.
+ * The way it's done allows definitions like this:
+ *
+ * // in foobar.c
+ * OPENSSL_IMPLEMENT_GLOBAL(int,foobar,0)
+ * // in foobar.h
+ * OPENSSL_DECLARE_GLOBAL(int,foobar);
+ * #define foobar OPENSSL_GLOBAL_REF(foobar)
+ */
+# ifdef OPENSSL_EXPORT_VAR_AS_FUNCTION
+# define OPENSSL_IMPLEMENT_GLOBAL(type,name,value) \
+ type *_shadow_##name(void) \
+ { static type _hide_##name=value; return &_hide_##name; }
+# define OPENSSL_DECLARE_GLOBAL(type,name) type *_shadow_##name(void)
+# define OPENSSL_GLOBAL_REF(name) (*(_shadow_##name()))
+# else
+# define OPENSSL_IMPLEMENT_GLOBAL(type,name,value) OPENSSL_GLOBAL type _shadow_##name=value;
+# define OPENSSL_DECLARE_GLOBAL(type,name) OPENSSL_EXPORT type _shadow_##name
+# define OPENSSL_GLOBAL_REF(name) _shadow_##name
+# endif
+
+# if defined(OPENSSL_SYS_MACINTOSH_CLASSIC) && macintosh==1 && !defined(MAC_OS_GUSI_SOURCE)
+# define ossl_ssize_t long
+# endif
+
+# ifdef OPENSSL_SYS_MSDOS
+# define ossl_ssize_t long
+# endif
+
+# if defined(NeXT) || defined(OPENSSL_SYS_NEWS4) || defined(OPENSSL_SYS_SUNOS)
+# define ssize_t int
+# endif
+
+# if defined(__ultrix) && !defined(ssize_t)
+# define ossl_ssize_t int
+# endif
+
+# ifndef ossl_ssize_t
+# define ossl_ssize_t ssize_t
+# endif
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/deps/openssl/openssl/include/openssl/ebcdic.h b/deps/openssl/openssl/include/openssl/ebcdic.h
index 6dedc7051d2..4cbdfeb7aed 100644
--- a/deps/openssl/openssl/include/openssl/ebcdic.h
+++ b/deps/openssl/openssl/include/openssl/ebcdic.h
@@ -1 +1,26 @@
-#include "../../crypto/ebcdic.h"
+/* crypto/ebcdic.h */
+
+#ifndef HEADER_EBCDIC_H
+# define HEADER_EBCDIC_H
+
+# include <sys/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Avoid name clashes with other applications */
+# define os_toascii _openssl_os_toascii
+# define os_toebcdic _openssl_os_toebcdic
+# define ebcdic2ascii _openssl_ebcdic2ascii
+# define ascii2ebcdic _openssl_ascii2ebcdic
+
+extern const unsigned char os_toascii[256];
+extern const unsigned char os_toebcdic[256];
+void *ebcdic2ascii(void *dest, const void *srce, size_t count);
+void *ascii2ebcdic(void *dest, const void *srce, size_t count);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/deps/openssl/openssl/include/openssl/ec.h b/deps/openssl/openssl/include/openssl/ec.h
index 7d206145260..6d3178f609f 100644
--- a/deps/openssl/openssl/include/openssl/ec.h
+++ b/deps/openssl/openssl/include/openssl/ec.h
@@ -1 +1,1282 @@
-#include "../../crypto/ec/ec.h"
+/* crypto/ec/ec.h */
+/*
+ * Originally written by Bodo Moeller for the OpenSSL project.
+ */
+/**
+ * \file crypto/ec/ec.h Include file for the OpenSSL EC functions
+ * \author Originally written by Bodo Moeller for the OpenSSL project
+ */
+/* ====================================================================
+ * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+/* ====================================================================
+ * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
+ *
+ * Portions of the attached software ("Contribution") are developed by
+ * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project.
+ *
+ * The Contribution is licensed pursuant to the OpenSSL open source
+ * license provided above.
+ *
+ * The elliptic curve binary polynomial software is originally written by
+ * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems Laboratories.
+ *
+ */
+
+#ifndef HEADER_EC_H
+# define HEADER_EC_H
+
+# include <openssl/opensslconf.h>
+
+# ifdef OPENSSL_NO_EC
+# error EC is disabled.
+# endif
+
+# include <openssl/asn1.h>
+# include <openssl/symhacks.h>
+# ifndef OPENSSL_NO_DEPRECATED
+# include <openssl/bn.h>
+# endif
+
+# ifdef __cplusplus
+extern "C" {
+# elif defined(__SUNPRO_C)
+# if __SUNPRO_C >= 0x520
+# pragma error_messages (off,E_ARRAY_OF_INCOMPLETE_NONAME,E_ARRAY_OF_INCOMPLETE)
+# endif
+# endif
+
+# ifndef OPENSSL_ECC_MAX_FIELD_BITS
+# define OPENSSL_ECC_MAX_FIELD_BITS 661
+# endif
+
+/** Enum for the point conversion form as defined in X9.62 (ECDSA)
+ * for the encoding of a elliptic curve point (x,y) */
+typedef enum {
+ /** the point is encoded as z||x, where the octet z specifies
+ * which solution of the quadratic equation y is */
+ POINT_CONVERSION_COMPRESSED = 2,
+ /** the point is encoded as z||x||y, where z is the octet 0x02 */
+ POINT_CONVERSION_UNCOMPRESSED = 4,
+ /** the point is encoded as z||x||y, where the octet z specifies
+ * which solution of the quadratic equation y is */
+ POINT_CONVERSION_HYBRID = 6
+} point_conversion_form_t;
+
+typedef struct ec_method_st EC_METHOD;
+
+typedef struct ec_group_st
+ /*-
+ EC_METHOD *meth;
+ -- field definition
+ -- curve coefficients
+ -- optional generator with associated information (order, cofactor)
+ -- optional extra data (precomputed table for fast computation of multiples of generator)
+ -- ASN1 stuff
+ */
+ EC_GROUP;
+
+typedef struct ec_point_st EC_POINT;
+
+/********************************************************************/
+/* EC_METHODs for curves over GF(p) */
+/********************************************************************/
+
+/** Returns the basic GFp ec methods which provides the basis for the
+ * optimized methods.
+ * \return EC_METHOD object
+ */
+const EC_METHOD *EC_GFp_simple_method(void);
+
+/** Returns GFp methods using montgomery multiplication.
+ * \return EC_METHOD object
+ */
+const EC_METHOD *EC_GFp_mont_method(void);
+
+/** Returns GFp methods using optimized methods for NIST recommended curves
+ * \return EC_METHOD object
+ */
+const EC_METHOD *EC_GFp_nist_method(void);
+
+# ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
+/** Returns 64-bit optimized methods for nistp224
+ * \return EC_METHOD object
+ */
+const EC_METHOD *EC_GFp_nistp224_method(void);
+
+/** Returns 64-bit optimized methods for nistp256
+ * \return EC_METHOD object
+ */
+const EC_METHOD *EC_GFp_nistp256_method(void);
+
+/** Returns 64-bit optimized methods for nistp521
+ * \return EC_METHOD object
+ */
+const EC_METHOD *EC_GFp_nistp521_method(void);
+# endif
+
+# ifndef OPENSSL_NO_EC2M
+/********************************************************************/
+/* EC_METHOD for curves over GF(2^m) */
+/********************************************************************/
+
+/** Returns the basic GF2m ec method
+ * \return EC_METHOD object
+ */
+const EC_METHOD *EC_GF2m_simple_method(void);
+
+# endif
+
+/********************************************************************/
+/* EC_GROUP functions */
+/********************************************************************/
+
+/** Creates a new EC_GROUP object
+ * \param meth EC_METHOD to use
+ * \return newly created EC_GROUP object or NULL in case of an error.
+ */
+EC_GROUP *EC_GROUP_new(const EC_METHOD *meth);
+
+/** Frees a EC_GROUP object
+ * \param group EC_GROUP object to be freed.
+ */
+void EC_GROUP_free(EC_GROUP *group);
+
+/** Clears and frees a EC_GROUP object
+ * \param group EC_GROUP object to be cleared and freed.
+ */
+void EC_GROUP_clear_free(EC_GROUP *group);
+
+/** Copies EC_GROUP objects. Note: both EC_GROUPs must use the same EC_METHOD.
+ * \param dst destination EC_GROUP object
+ * \param src source EC_GROUP object
+ * \return 1 on success and 0 if an error occurred.
+ */
+int EC_GROUP_copy(EC_GROUP *dst, const EC_GROUP *src);
+
+/** Creates a new EC_GROUP object and copies the copies the content
+ * form src to the newly created EC_KEY object
+ * \param src source EC_GROUP object
+ * \return newly created EC_GROUP object or NULL in case of an error.
+ */
+EC_GROUP *EC_GROUP_dup(const EC_GROUP *src);
+
+/** Returns the EC_METHOD of the EC_GROUP object.
+ * \param group EC_GROUP object
+ * \return EC_METHOD used in this EC_GROUP object.
+ */
+const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *group);
+
+/** Returns the field type of the EC_METHOD.
+ * \param meth EC_METHOD object
+ * \return NID of the underlying field type OID.
+ */
+int EC_METHOD_get_field_type(const EC_METHOD *meth);
+
+/** Sets the generator and it's order/cofactor of a EC_GROUP object.
+ * \param group EC_GROUP object
+ * \param generator EC_POINT object with the generator.
+ * \param order the order of the group generated by the generator.
+ * \param cofactor the index of the sub-group generated by the generator
+ * in the group of all points on the elliptic curve.
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator,
+ const BIGNUM *order, const BIGNUM *cofactor);
+
+/** Returns the generator of a EC_GROUP object.
+ * \param group EC_GROUP object
+ * \return the currently used generator (possibly NULL).
+ */
+const EC_POINT *EC_GROUP_get0_generator(const EC_GROUP *group);
+
+/** Returns the montgomery data for order(Generator)
+ * \param group EC_GROUP object
+ * \return the currently used generator (possibly NULL).
+*/
+BN_MONT_CTX *EC_GROUP_get_mont_data(const EC_GROUP *group);
+
+/** Gets the order of a EC_GROUP
+ * \param group EC_GROUP object
+ * \param order BIGNUM to which the order is copied
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx);
+
+/** Gets the cofactor of a EC_GROUP
+ * \param group EC_GROUP object
+ * \param cofactor BIGNUM to which the cofactor is copied
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor,
+ BN_CTX *ctx);
+
+/** Sets the name of a EC_GROUP object
+ * \param group EC_GROUP object
+ * \param nid NID of the curve name OID
+ */
+void EC_GROUP_set_curve_name(EC_GROUP *group, int nid);
+
+/** Returns the curve name of a EC_GROUP object
+ * \param group EC_GROUP object
+ * \return NID of the curve name OID or 0 if not set.
+ */
+int EC_GROUP_get_curve_name(const EC_GROUP *group);
+
+void EC_GROUP_set_asn1_flag(EC_GROUP *group, int flag);
+int EC_GROUP_get_asn1_flag(const EC_GROUP *group);
+
+void EC_GROUP_set_point_conversion_form(EC_GROUP *group,
+ point_conversion_form_t form);
+point_conversion_form_t EC_GROUP_get_point_conversion_form(const EC_GROUP *);
+
+unsigned char *EC_GROUP_get0_seed(const EC_GROUP *x);
+size_t EC_GROUP_get_seed_len(const EC_GROUP *);
+size_t EC_GROUP_set_seed(EC_GROUP *, const unsigned char *, size_t len);
+
+/** Sets the parameter of a ec over GFp defined by y^2 = x^3 + a*x + b
+ * \param group EC_GROUP object
+ * \param p BIGNUM with the prime number
+ * \param a BIGNUM with parameter a of the equation
+ * \param b BIGNUM with parameter b of the equation
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_GROUP_set_curve_GFp(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a,
+ const BIGNUM *b, BN_CTX *ctx);
+
+/** Gets the parameter of the ec over GFp defined by y^2 = x^3 + a*x + b
+ * \param group EC_GROUP object
+ * \param p BIGNUM for the prime number
+ * \param a BIGNUM for parameter a of the equation
+ * \param b BIGNUM for parameter b of the equation
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_GROUP_get_curve_GFp(const EC_GROUP *group, BIGNUM *p, BIGNUM *a,
+ BIGNUM *b, BN_CTX *ctx);
+
+# ifndef OPENSSL_NO_EC2M
+/** Sets the parameter of a ec over GF2m defined by y^2 + x*y = x^3 + a*x^2 + b
+ * \param group EC_GROUP object
+ * \param p BIGNUM with the polynomial defining the underlying field
+ * \param a BIGNUM with parameter a of the equation
+ * \param b BIGNUM with parameter b of the equation
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_GROUP_set_curve_GF2m(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a,
+ const BIGNUM *b, BN_CTX *ctx);
+
+/** Gets the parameter of the ec over GF2m defined by y^2 + x*y = x^3 + a*x^2 + b
+ * \param group EC_GROUP object
+ * \param p BIGNUM for the polynomial defining the underlying field
+ * \param a BIGNUM for parameter a of the equation
+ * \param b BIGNUM for parameter b of the equation
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_GROUP_get_curve_GF2m(const EC_GROUP *group, BIGNUM *p, BIGNUM *a,
+ BIGNUM *b, BN_CTX *ctx);
+# endif
+/** Returns the number of bits needed to represent a field element
+ * \param group EC_GROUP object
+ * \return number of bits needed to represent a field element
+ */
+int EC_GROUP_get_degree(const EC_GROUP *group);
+
+/** Checks whether the parameter in the EC_GROUP define a valid ec group
+ * \param group EC_GROUP object
+ * \param ctx BN_CTX object (optional)
+ * \return 1 if group is a valid ec group and 0 otherwise
+ */
+int EC_GROUP_check(const EC_GROUP *group, BN_CTX *ctx);
+
+/** Checks whether the discriminant of the elliptic curve is zero or not
+ * \param group EC_GROUP object
+ * \param ctx BN_CTX object (optional)
+ * \return 1 if the discriminant is not zero and 0 otherwise
+ */
+int EC_GROUP_check_discriminant(const EC_GROUP *group, BN_CTX *ctx);
+
+/** Compares two EC_GROUP objects
+ * \param a first EC_GROUP object
+ * \param b second EC_GROUP object
+ * \param ctx BN_CTX object (optional)
+ * \return 0 if both groups are equal and 1 otherwise
+ */
+int EC_GROUP_cmp(const EC_GROUP *a, const EC_GROUP *b, BN_CTX *ctx);
+
+/*
+ * EC_GROUP_new_GF*() calls EC_GROUP_new() and EC_GROUP_set_GF*() after
+ * choosing an appropriate EC_METHOD
+ */
+
+/** Creates a new EC_GROUP object with the specified parameters defined
+ * over GFp (defined by the equation y^2 = x^3 + a*x + b)
+ * \param p BIGNUM with the prime number
+ * \param a BIGNUM with the parameter a of the equation
+ * \param b BIGNUM with the parameter b of the equation
+ * \param ctx BN_CTX object (optional)
+ * \return newly created EC_GROUP object with the specified parameters
+ */
+EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a,
+ const BIGNUM *b, BN_CTX *ctx);
+# ifndef OPENSSL_NO_EC2M
+/** Creates a new EC_GROUP object with the specified parameters defined
+ * over GF2m (defined by the equation y^2 + x*y = x^3 + a*x^2 + b)
+ * \param p BIGNUM with the polynomial defining the underlying field
+ * \param a BIGNUM with the parameter a of the equation
+ * \param b BIGNUM with the parameter b of the equation
+ * \param ctx BN_CTX object (optional)
+ * \return newly created EC_GROUP object with the specified parameters
+ */
+EC_GROUP *EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM *a,
+ const BIGNUM *b, BN_CTX *ctx);
+# endif
+/** Creates a EC_GROUP object with a curve specified by a NID
+ * \param nid NID of the OID of the curve name
+ * \return newly created EC_GROUP object with specified curve or NULL
+ * if an error occurred
+ */
+EC_GROUP *EC_GROUP_new_by_curve_name(int nid);
+
+/********************************************************************/
+/* handling of internal curves */
+/********************************************************************/
+
+typedef struct {
+ int nid;
+ const char *comment;
+} EC_builtin_curve;
+
+/*
+ * EC_builtin_curves(EC_builtin_curve *r, size_t size) returns number of all
+ * available curves or zero if a error occurred. In case r ist not zero
+ * nitems EC_builtin_curve structures are filled with the data of the first
+ * nitems internal groups
+ */
+size_t EC_get_builtin_curves(EC_builtin_curve *r, size_t nitems);
+
+const char *EC_curve_nid2nist(int nid);
+int EC_curve_nist2nid(const char *name);
+
+/********************************************************************/
+/* EC_POINT functions */
+/********************************************************************/
+
+/** Creates a new EC_POINT object for the specified EC_GROUP
+ * \param group EC_GROUP the underlying EC_GROUP object
+ * \return newly created EC_POINT object or NULL if an error occurred
+ */
+EC_POINT *EC_POINT_new(const EC_GROUP *group);
+
+/** Frees a EC_POINT object
+ * \param point EC_POINT object to be freed
+ */
+void EC_POINT_free(EC_POINT *point);
+
+/** Clears and frees a EC_POINT object
+ * \param point EC_POINT object to be cleared and freed
+ */
+void EC_POINT_clear_free(EC_POINT *point);
+
+/** Copies EC_POINT object
+ * \param dst destination EC_POINT object
+ * \param src source EC_POINT object
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_POINT_copy(EC_POINT *dst, const EC_POINT *src);
+
+/** Creates a new EC_POINT object and copies the content of the supplied
+ * EC_POINT
+ * \param src source EC_POINT object
+ * \param group underlying the EC_GROUP object
+ * \return newly created EC_POINT object or NULL if an error occurred
+ */
+EC_POINT *EC_POINT_dup(const EC_POINT *src, const EC_GROUP *group);
+
+/** Returns the EC_METHOD used in EC_POINT object
+ * \param point EC_POINT object
+ * \return the EC_METHOD used
+ */
+const EC_METHOD *EC_POINT_method_of(const EC_POINT *point);
+
+/** Sets a point to infinity (neutral element)
+ * \param group underlying EC_GROUP object
+ * \param point EC_POINT to set to infinity
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_POINT_set_to_infinity(const EC_GROUP *group, EC_POINT *point);
+
+/** Sets the jacobian projective coordinates of a EC_POINT over GFp
+ * \param group underlying EC_GROUP object
+ * \param p EC_POINT object
+ * \param x BIGNUM with the x-coordinate
+ * \param y BIGNUM with the y-coordinate
+ * \param z BIGNUM with the z-coordinate
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_POINT_set_Jprojective_coordinates_GFp(const EC_GROUP *group,
+ EC_POINT *p, const BIGNUM *x,
+ const BIGNUM *y, const BIGNUM *z,
+ BN_CTX *ctx);
+
+/** Gets the jacobian projective coordinates of a EC_POINT over GFp
+ * \param group underlying EC_GROUP object
+ * \param p EC_POINT object
+ * \param x BIGNUM for the x-coordinate
+ * \param y BIGNUM for the y-coordinate
+ * \param z BIGNUM for the z-coordinate
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_POINT_get_Jprojective_coordinates_GFp(const EC_GROUP *group,
+ const EC_POINT *p, BIGNUM *x,
+ BIGNUM *y, BIGNUM *z,
+ BN_CTX *ctx);
+
+/** Sets the affine coordinates of a EC_POINT over GFp
+ * \param group underlying EC_GROUP object
+ * \param p EC_POINT object
+ * \param x BIGNUM with the x-coordinate
+ * \param y BIGNUM with the y-coordinate
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *group, EC_POINT *p,
+ const BIGNUM *x, const BIGNUM *y,
+ BN_CTX *ctx);
+
+/** Gets the affine coordinates of a EC_POINT over GFp
+ * \param group underlying EC_GROUP object
+ * \param p EC_POINT object
+ * \param x BIGNUM for the x-coordinate
+ * \param y BIGNUM for the y-coordinate
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group,
+ const EC_POINT *p, BIGNUM *x,
+ BIGNUM *y, BN_CTX *ctx);
+
+/** Sets the x9.62 compressed coordinates of a EC_POINT over GFp
+ * \param group underlying EC_GROUP object
+ * \param p EC_POINT object
+ * \param x BIGNUM with x-coordinate
+ * \param y_bit integer with the y-Bit (either 0 or 1)
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group,
+ EC_POINT *p, const BIGNUM *x,
+ int y_bit, BN_CTX *ctx);
+# ifndef OPENSSL_NO_EC2M
+/** Sets the affine coordinates of a EC_POINT over GF2m
+ * \param group underlying EC_GROUP object
+ * \param p EC_POINT object
+ * \param x BIGNUM with the x-coordinate
+ * \param y BIGNUM with the y-coordinate
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_POINT_set_affine_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p,
+ const BIGNUM *x, const BIGNUM *y,
+ BN_CTX *ctx);
+
+/** Gets the affine coordinates of a EC_POINT over GF2m
+ * \param group underlying EC_GROUP object
+ * \param p EC_POINT object
+ * \param x BIGNUM for the x-coordinate
+ * \param y BIGNUM for the y-coordinate
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *group,
+ const EC_POINT *p, BIGNUM *x,
+ BIGNUM *y, BN_CTX *ctx);
+
+/** Sets the x9.62 compressed coordinates of a EC_POINT over GF2m
+ * \param group underlying EC_GROUP object
+ * \param p EC_POINT object
+ * \param x BIGNUM with x-coordinate
+ * \param y_bit integer with the y-Bit (either 0 or 1)
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_POINT_set_compressed_coordinates_GF2m(const EC_GROUP *group,
+ EC_POINT *p, const BIGNUM *x,
+ int y_bit, BN_CTX *ctx);
+# endif
+/** Encodes a EC_POINT object to a octet string
+ * \param group underlying EC_GROUP object
+ * \param p EC_POINT object
+ * \param form point conversion form
+ * \param buf memory buffer for the result. If NULL the function returns
+ * required buffer size.
+ * \param len length of the memory buffer
+ * \param ctx BN_CTX object (optional)
+ * \return the length of the encoded octet string or 0 if an error occurred
+ */
+size_t EC_POINT_point2oct(const EC_GROUP *group, const EC_POINT *p,
+ point_conversion_form_t form,
+ unsigned char *buf, size_t len, BN_CTX *ctx);
+
+/** Decodes a EC_POINT from a octet string
+ * \param group underlying EC_GROUP object
+ * \param p EC_POINT object
+ * \param buf memory buffer with the encoded ec point
+ * \param len length of the encoded ec point
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_POINT_oct2point(const EC_GROUP *group, EC_POINT *p,
+ const unsigned char *buf, size_t len, BN_CTX *ctx);
+
+/* other interfaces to point2oct/oct2point: */
+BIGNUM *EC_POINT_point2bn(const EC_GROUP *, const EC_POINT *,
+ point_conversion_form_t form, BIGNUM *, BN_CTX *);
+EC_POINT *EC_POINT_bn2point(const EC_GROUP *, const BIGNUM *,
+ EC_POINT *, BN_CTX *);
+char *EC_POINT_point2hex(const EC_GROUP *, const EC_POINT *,
+ point_conversion_form_t form, BN_CTX *);
+EC_POINT *EC_POINT_hex2point(const EC_GROUP *, const char *,
+ EC_POINT *, BN_CTX *);
+
+/********************************************************************/
+/* functions for doing EC_POINT arithmetic */
+/********************************************************************/
+
+/** Computes the sum of two EC_POINT
+ * \param group underlying EC_GROUP object
+ * \param r EC_POINT object for the result (r = a + b)
+ * \param a EC_POINT object with the first summand
+ * \param b EC_POINT object with the second summand
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_POINT_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a,
+ const EC_POINT *b, BN_CTX *ctx);
+
+/** Computes the double of a EC_POINT
+ * \param group underlying EC_GROUP object
+ * \param r EC_POINT object for the result (r = 2 * a)
+ * \param a EC_POINT object
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_POINT_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a,
+ BN_CTX *ctx);
+
+/** Computes the inverse of a EC_POINT
+ * \param group underlying EC_GROUP object
+ * \param a EC_POINT object to be inverted (it's used for the result as well)
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_POINT_invert(const EC_GROUP *group, EC_POINT *a, BN_CTX *ctx);
+
+/** Checks whether the point is the neutral element of the group
+ * \param group the underlying EC_GROUP object
+ * \param p EC_POINT object
+ * \return 1 if the point is the neutral element and 0 otherwise
+ */
+int EC_POINT_is_at_infinity(const EC_GROUP *group, const EC_POINT *p);
+
+/** Checks whether the point is on the curve
+ * \param group underlying EC_GROUP object
+ * \param point EC_POINT object to check
+ * \param ctx BN_CTX object (optional)
+ * \return 1 if point if on the curve and 0 otherwise
+ */
+int EC_POINT_is_on_curve(const EC_GROUP *group, const EC_POINT *point,
+ BN_CTX *ctx);
+
+/** Compares two EC_POINTs
+ * \param group underlying EC_GROUP object
+ * \param a first EC_POINT object
+ * \param b second EC_POINT object
+ * \param ctx BN_CTX object (optional)
+ * \return 0 if both points are equal and a value != 0 otherwise
+ */
+int EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b,
+ BN_CTX *ctx);
+
+int EC_POINT_make_affine(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx);
+int EC_POINTs_make_affine(const EC_GROUP *group, size_t num,
+ EC_POINT *points[], BN_CTX *ctx);
+
+/** Computes r = generator * n sum_{i=0}^{num-1} p[i] * m[i]
+ * \param group underlying EC_GROUP object
+ * \param r EC_POINT object for the result
+ * \param n BIGNUM with the multiplier for the group generator (optional)
+ * \param num number futher summands
+ * \param p array of size num of EC_POINT objects
+ * \param m array of size num of BIGNUM objects
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n,
+ size_t num, const EC_POINT *p[], const BIGNUM *m[],
+ BN_CTX *ctx);
+
+/** Computes r = generator * n + q * m
+ * \param group underlying EC_GROUP object
+ * \param r EC_POINT object for the result
+ * \param n BIGNUM with the multiplier for the group generator (optional)
+ * \param q EC_POINT object with the first factor of the second summand
+ * \param m BIGNUM with the second factor of the second summand
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n,
+ const EC_POINT *q, const BIGNUM *m, BN_CTX *ctx);
+
+/** Stores multiples of generator for faster point multiplication
+ * \param group EC_GROUP object
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occured
+ */
+int EC_GROUP_precompute_mult(EC_GROUP *group, BN_CTX *ctx);
+
+/** Reports whether a precomputation has been done
+ * \param group EC_GROUP object
+ * \return 1 if a pre-computation has been done and 0 otherwise
+ */
+int EC_GROUP_have_precompute_mult(const EC_GROUP *group);
+
+/********************************************************************/
+/* ASN1 stuff */
+/********************************************************************/
+
+/*
+ * EC_GROUP_get_basis_type() returns the NID of the basis type used to
+ * represent the field elements
+ */
+int EC_GROUP_get_basis_type(const EC_GROUP *);
+# ifndef OPENSSL_NO_EC2M
+int EC_GROUP_get_trinomial_basis(const EC_GROUP *, unsigned int *k);
+int EC_GROUP_get_pentanomial_basis(const EC_GROUP *, unsigned int *k1,
+ unsigned int *k2, unsigned int *k3);
+# endif
+
+# define OPENSSL_EC_NAMED_CURVE 0x001
+
+typedef struct ecpk_parameters_st ECPKPARAMETERS;
+
+EC_GROUP *d2i_ECPKParameters(EC_GROUP **, const unsigned char **in, long len);
+int i2d_ECPKParameters(const EC_GROUP *, unsigned char **out);
+
+# define d2i_ECPKParameters_bio(bp,x) ASN1_d2i_bio_of(EC_GROUP,NULL,d2i_ECPKParameters,bp,x)
+# define i2d_ECPKParameters_bio(bp,x) ASN1_i2d_bio_of_const(EC_GROUP,i2d_ECPKParameters,bp,x)
+# define d2i_ECPKParameters_fp(fp,x) (EC_GROUP *)ASN1_d2i_fp(NULL, \
+ (char *(*)())d2i_ECPKParameters,(fp),(unsigned char **)(x))
+# define i2d_ECPKParameters_fp(fp,x) ASN1_i2d_fp(i2d_ECPKParameters,(fp), \
+ (unsigned char *)(x))
+
+# ifndef OPENSSL_NO_BIO
+int ECPKParameters_print(BIO *bp, const EC_GROUP *x, int off);
+# endif
+# ifndef OPENSSL_NO_FP_API
+int ECPKParameters_print_fp(FILE *fp, const EC_GROUP *x, int off);
+# endif
+
+/********************************************************************/
+/* EC_KEY functions */
+/********************************************************************/
+
+typedef struct ec_key_st EC_KEY;
+
+/* some values for the encoding_flag */
+# define EC_PKEY_NO_PARAMETERS 0x001
+# define EC_PKEY_NO_PUBKEY 0x002
+
+/* some values for the flags field */
+# define EC_FLAG_NON_FIPS_ALLOW 0x1
+# define EC_FLAG_FIPS_CHECKED 0x2
+
+/** Creates a new EC_KEY object.
+ * \return EC_KEY object or NULL if an error occurred.
+ */
+EC_KEY *EC_KEY_new(void);
+
+int EC_KEY_get_flags(const EC_KEY *key);
+
+void EC_KEY_set_flags(EC_KEY *key, int flags);
+
+void EC_KEY_clear_flags(EC_KEY *key, int flags);
+
+/** Creates a new EC_KEY object using a named curve as underlying
+ * EC_GROUP object.
+ * \param nid NID of the named curve.
+ * \return EC_KEY object or NULL if an error occurred.
+ */
+EC_KEY *EC_KEY_new_by_curve_name(int nid);
+
+/** Frees a EC_KEY object.
+ * \param key EC_KEY object to be freed.
+ */
+void EC_KEY_free(EC_KEY *key);
+
+/** Copies a EC_KEY object.
+ * \param dst destination EC_KEY object
+ * \param src src EC_KEY object
+ * \return dst or NULL if an error occurred.
+ */
+EC_KEY *EC_KEY_copy(EC_KEY *dst, const EC_KEY *src);
+
+/** Creates a new EC_KEY object and copies the content from src to it.
+ * \param src the source EC_KEY object
+ * \return newly created EC_KEY object or NULL if an error occurred.
+ */
+EC_KEY *EC_KEY_dup(const EC_KEY *src);
+
+/** Increases the internal reference count of a EC_KEY object.
+ * \param key EC_KEY object
+ * \return 1 on success and 0 if an error occurred.
+ */
+int EC_KEY_up_ref(EC_KEY *key);
+
+/** Returns the EC_GROUP object of a EC_KEY object
+ * \param key EC_KEY object
+ * \return the EC_GROUP object (possibly NULL).
+ */
+const EC_GROUP *EC_KEY_get0_group(const EC_KEY *key);
+
+/** Sets the EC_GROUP of a EC_KEY object.
+ * \param key EC_KEY object
+ * \param group EC_GROUP to use in the EC_KEY object (note: the EC_KEY
+ * object will use an own copy of the EC_GROUP).
+ * \return 1 on success and 0 if an error occurred.
+ */
+int EC_KEY_set_group(EC_KEY *key, const EC_GROUP *group);
+
+/** Returns the private key of a EC_KEY object.
+ * \param key EC_KEY object
+ * \return a BIGNUM with the private key (possibly NULL).
+ */
+const BIGNUM *EC_KEY_get0_private_key(const EC_KEY *key);
+
+/** Sets the private key of a EC_KEY object.
+ * \param key EC_KEY object
+ * \param prv BIGNUM with the private key (note: the EC_KEY object
+ * will use an own copy of the BIGNUM).
+ * \return 1 on success and 0 if an error occurred.
+ */
+int EC_KEY_set_private_key(EC_KEY *key, const BIGNUM *prv);
+
+/** Returns the public key of a EC_KEY object.
+ * \param key the EC_KEY object
+ * \return a EC_POINT object with the public key (possibly NULL)
+ */
+const EC_POINT *EC_KEY_get0_public_key(const EC_KEY *key);
+
+/** Sets the public key of a EC_KEY object.
+ * \param key EC_KEY object
+ * \param pub EC_POINT object with the public key (note: the EC_KEY object
+ * will use an own copy of the EC_POINT object).
+ * \return 1 on success and 0 if an error occurred.
+ */
+int EC_KEY_set_public_key(EC_KEY *key, const EC_POINT *pub);
+
+unsigned EC_KEY_get_enc_flags(const EC_KEY *key);
+void EC_KEY_set_enc_flags(EC_KEY *eckey, unsigned int flags);
+point_conversion_form_t EC_KEY_get_conv_form(const EC_KEY *key);
+void EC_KEY_set_conv_form(EC_KEY *eckey, point_conversion_form_t cform);
+/* functions to set/get method specific data */
+void *EC_KEY_get_key_method_data(EC_KEY *key,
+ void *(*dup_func) (void *),
+ void (*free_func) (void *),
+ void (*clear_free_func) (void *));
+/** Sets the key method data of an EC_KEY object, if none has yet been set.
+ * \param key EC_KEY object
+ * \param data opaque data to install.
+ * \param dup_func a function that duplicates |data|.
+ * \param free_func a function that frees |data|.
+ * \param clear_free_func a function that wipes and frees |data|.
+ * \return the previously set data pointer, or NULL if |data| was inserted.
+ */
+void *EC_KEY_insert_key_method_data(EC_KEY *key, void *data,
+ void *(*dup_func) (void *),
+ void (*free_func) (void *),
+ void (*clear_free_func) (void *));
+/* wrapper functions for the underlying EC_GROUP object */
+void EC_KEY_set_asn1_flag(EC_KEY *eckey, int asn1_flag);
+
+/** Creates a table of pre-computed multiples of the generator to
+ * accelerate further EC_KEY operations.
+ * \param key EC_KEY object
+ * \param ctx BN_CTX object (optional)
+ * \return 1 on success and 0 if an error occurred.
+ */
+int EC_KEY_precompute_mult(EC_KEY *key, BN_CTX *ctx);
+
+/** Creates a new ec private (and optional a new public) key.
+ * \param key EC_KEY object
+ * \return 1 on success and 0 if an error occurred.
+ */
+int EC_KEY_generate_key(EC_KEY *key);
+
+/** Verifies that a private and/or public key is valid.
+ * \param key the EC_KEY object
+ * \return 1 on success and 0 otherwise.
+ */
+int EC_KEY_check_key(const EC_KEY *key);
+
+/** Sets a public key from affine coordindates performing
+ * neccessary NIST PKV tests.
+ * \param key the EC_KEY object
+ * \param x public key x coordinate
+ * \param y public key y coordinate
+ * \return 1 on success and 0 otherwise.
+ */
+int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x,
+ BIGNUM *y);
+
+/********************************************************************/
+/* de- and encoding functions for SEC1 ECPrivateKey */
+/********************************************************************/
+
+/** Decodes a private key from a memory buffer.
+ * \param key a pointer to a EC_KEY object which should be used (or NULL)
+ * \param in pointer to memory with the DER encoded private key
+ * \param len length of the DER encoded private key
+ * \return the decoded private key or NULL if an error occurred.
+ */
+EC_KEY *d2i_ECPrivateKey(EC_KEY **key, const unsigned char **in, long len);
+
+/** Encodes a private key object and stores the result in a buffer.
+ * \param key the EC_KEY object to encode
+ * \param out the buffer for the result (if NULL the function returns number
+ * of bytes needed).
+ * \return 1 on success and 0 if an error occurred.
+ */
+int i2d_ECPrivateKey(EC_KEY *key, unsigned char **out);
+
+/********************************************************************/
+/* de- and encoding functions for EC parameters */
+/********************************************************************/
+
+/** Decodes ec parameter from a memory buffer.
+ * \param key a pointer to a EC_KEY object which should be used (or NULL)
+ * \param in pointer to memory with the DER encoded ec parameters
+ * \param len length of the DER encoded ec parameters
+ * \return a EC_KEY object with the decoded parameters or NULL if an error
+ * occurred.
+ */
+EC_KEY *d2i_ECParameters(EC_KEY **key, const unsigned char **in, long len);
+
+/** Encodes ec parameter and stores the result in a buffer.
+ * \param key the EC_KEY object with ec paramters to encode
+ * \param out the buffer for the result (if NULL the function returns number
+ * of bytes needed).
+ * \return 1 on success and 0 if an error occurred.
+ */
+int i2d_ECParameters(EC_KEY *key, unsigned char **out);
+
+/********************************************************************/
+/* de- and encoding functions for EC public key */
+/* (octet string, not DER -- hence 'o2i' and 'i2o') */
+/********************************************************************/
+
+/** Decodes a ec public key from a octet string.
+ * \param key a pointer to a EC_KEY object which should be used
+ * \param in memory buffer with the encoded public key
+ * \param len length of the encoded public key
+ * \return EC_KEY object with decoded public key or NULL if an error
+ * occurred.
+ */
+EC_KEY *o2i_ECPublicKey(EC_KEY **key, const unsigned char **in, long len);
+
+/** Encodes a ec public key in an octet string.
+ * \param key the EC_KEY object with the public key
+ * \param out the buffer for the result (if NULL the function returns number
+ * of bytes needed).
+ * \return 1 on success and 0 if an error occurred
+ */
+int i2o_ECPublicKey(EC_KEY *key, unsigned char **out);
+
+# ifndef OPENSSL_NO_BIO
+/** Prints out the ec parameters on human readable form.
+ * \param bp BIO object to which the information is printed
+ * \param key EC_KEY object
+ * \return 1 on success and 0 if an error occurred
+ */
+int ECParameters_print(BIO *bp, const EC_KEY *key);
+
+/** Prints out the contents of a EC_KEY object
+ * \param bp BIO object to which the information is printed
+ * \param key EC_KEY object
+ * \param off line offset
+ * \return 1 on success and 0 if an error occurred
+ */
+int EC_KEY_print(BIO *bp, const EC_KEY *key, int off);
+
+# endif
+# ifndef OPENSSL_NO_FP_API
+/** Prints out the ec parameters on human readable form.
+ * \param fp file descriptor to which the information is printed
+ * \param key EC_KEY object
+ * \return 1 on success and 0 if an error occurred
+ */
+int ECParameters_print_fp(FILE *fp, const EC_KEY *key);
+
+/** Prints out the contents of a EC_KEY object
+ * \param fp file descriptor to which the information is printed
+ * \param key EC_KEY object
+ * \param off line offset
+ * \return 1 on success and 0 if an error occurred
+ */
+int EC_KEY_print_fp(FILE *fp, const EC_KEY *key, int off);
+
+# endif
+
+# define ECParameters_dup(x) ASN1_dup_of(EC_KEY,i2d_ECParameters,d2i_ECParameters,x)
+
+# ifndef __cplusplus
+# if defined(__SUNPRO_C)
+# if __SUNPRO_C >= 0x520
+# pragma error_messages (default,E_ARRAY_OF_INCOMPLETE_NONAME,E_ARRAY_OF_INCOMPLETE)
+# endif
+# endif
+# endif
+
+# define EVP_PKEY_CTX_set_ec_paramgen_curve_nid(ctx, nid) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \
+ EVP_PKEY_OP_PARAMGEN|EVP_PKEY_OP_KEYGEN, \
+ EVP_PKEY_CTRL_EC_PARAMGEN_CURVE_NID, nid, NULL)
+
+# define EVP_PKEY_CTX_set_ec_param_enc(ctx, flag) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \
+ EVP_PKEY_OP_PARAMGEN|EVP_PKEY_OP_KEYGEN, \
+ EVP_PKEY_CTRL_EC_PARAM_ENC, flag, NULL)
+
+# define EVP_PKEY_CTX_set_ecdh_cofactor_mode(ctx, flag) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \
+ EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_EC_ECDH_COFACTOR, flag, NULL)
+
+# define EVP_PKEY_CTX_get_ecdh_cofactor_mode(ctx) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \
+ EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_EC_ECDH_COFACTOR, -2, NULL)
+
+# define EVP_PKEY_CTX_set_ecdh_kdf_type(ctx, kdf) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \
+ EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_EC_KDF_TYPE, kdf, NULL)
+
+# define EVP_PKEY_CTX_get_ecdh_kdf_type(ctx) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \
+ EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_EC_KDF_TYPE, -2, NULL)
+
+# define EVP_PKEY_CTX_set_ecdh_kdf_md(ctx, md) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \
+ EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_EC_KDF_MD, 0, (void *)md)
+
+# define EVP_PKEY_CTX_get_ecdh_kdf_md(ctx, pmd) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \
+ EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_GET_EC_KDF_MD, 0, (void *)pmd)
+
+# define EVP_PKEY_CTX_set_ecdh_kdf_outlen(ctx, len) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \
+ EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_EC_KDF_OUTLEN, len, NULL)
+
+# define EVP_PKEY_CTX_get_ecdh_kdf_outlen(ctx, plen) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \
+ EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_GET_EC_KDF_OUTLEN, 0, (void *)plen)
+
+# define EVP_PKEY_CTX_set0_ecdh_kdf_ukm(ctx, p, plen) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \
+ EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_EC_KDF_UKM, plen, (void *)p)
+
+# define EVP_PKEY_CTX_get0_ecdh_kdf_ukm(ctx, p) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \
+ EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_GET_EC_KDF_UKM, 0, (void *)p)
+
+# define EVP_PKEY_CTRL_EC_PARAMGEN_CURVE_NID (EVP_PKEY_ALG_CTRL + 1)
+# define EVP_PKEY_CTRL_EC_PARAM_ENC (EVP_PKEY_ALG_CTRL + 2)
+# define EVP_PKEY_CTRL_EC_ECDH_COFACTOR (EVP_PKEY_ALG_CTRL + 3)
+# define EVP_PKEY_CTRL_EC_KDF_TYPE (EVP_PKEY_ALG_CTRL + 4)
+# define EVP_PKEY_CTRL_EC_KDF_MD (EVP_PKEY_ALG_CTRL + 5)
+# define EVP_PKEY_CTRL_GET_EC_KDF_MD (EVP_PKEY_ALG_CTRL + 6)
+# define EVP_PKEY_CTRL_EC_KDF_OUTLEN (EVP_PKEY_ALG_CTRL + 7)
+# define EVP_PKEY_CTRL_GET_EC_KDF_OUTLEN (EVP_PKEY_ALG_CTRL + 8)
+# define EVP_PKEY_CTRL_EC_KDF_UKM (EVP_PKEY_ALG_CTRL + 9)
+# define EVP_PKEY_CTRL_GET_EC_KDF_UKM (EVP_PKEY_ALG_CTRL + 10)
+/* KDF types */
+# define EVP_PKEY_ECDH_KDF_NONE 1
+# define EVP_PKEY_ECDH_KDF_X9_62 2
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_EC_strings(void);
+
+/* Error codes for the EC functions. */
+
+/* Function codes. */
+# define EC_F_BN_TO_FELEM 224
+# define EC_F_COMPUTE_WNAF 143
+# define EC_F_D2I_ECPARAMETERS 144
+# define EC_F_D2I_ECPKPARAMETERS 145
+# define EC_F_D2I_ECPRIVATEKEY 146
+# define EC_F_DO_EC_KEY_PRINT 221
+# define EC_F_ECDH_CMS_DECRYPT 238
+# define EC_F_ECDH_CMS_SET_SHARED_INFO 239
+# define EC_F_ECKEY_PARAM2TYPE 223
+# define EC_F_ECKEY_PARAM_DECODE 212
+# define EC_F_ECKEY_PRIV_DECODE 213
+# define EC_F_ECKEY_PRIV_ENCODE 214
+# define EC_F_ECKEY_PUB_DECODE 215
+# define EC_F_ECKEY_PUB_ENCODE 216
+# define EC_F_ECKEY_TYPE2PARAM 220
+# define EC_F_ECPARAMETERS_PRINT 147
+# define EC_F_ECPARAMETERS_PRINT_FP 148
+# define EC_F_ECPKPARAMETERS_PRINT 149
+# define EC_F_ECPKPARAMETERS_PRINT_FP 150
+# define EC_F_ECP_NISTZ256_GET_AFFINE 240
+# define EC_F_ECP_NISTZ256_MULT_PRECOMPUTE 243
+# define EC_F_ECP_NISTZ256_POINTS_MUL 241
+# define EC_F_ECP_NISTZ256_PRE_COMP_NEW 244
+# define EC_F_ECP_NISTZ256_SET_WORDS 245
+# define EC_F_ECP_NISTZ256_WINDOWED_MUL 242
+# define EC_F_ECP_NIST_MOD_192 203
+# define EC_F_ECP_NIST_MOD_224 204
+# define EC_F_ECP_NIST_MOD_256 205
+# define EC_F_ECP_NIST_MOD_521 206
+# define EC_F_EC_ASN1_GROUP2CURVE 153
+# define EC_F_EC_ASN1_GROUP2FIELDID 154
+# define EC_F_EC_ASN1_GROUP2PARAMETERS 155
+# define EC_F_EC_ASN1_GROUP2PKPARAMETERS 156
+# define EC_F_EC_ASN1_PARAMETERS2GROUP 157
+# define EC_F_EC_ASN1_PKPARAMETERS2GROUP 158
+# define EC_F_EC_EX_DATA_SET_DATA 211
+# define EC_F_EC_GF2M_MONTGOMERY_POINT_MULTIPLY 208
+# define EC_F_EC_GF2M_SIMPLE_GROUP_CHECK_DISCRIMINANT 159
+# define EC_F_EC_GF2M_SIMPLE_GROUP_SET_CURVE 195
+# define EC_F_EC_GF2M_SIMPLE_OCT2POINT 160
+# define EC_F_EC_GF2M_SIMPLE_POINT2OCT 161
+# define EC_F_EC_GF2M_SIMPLE_POINT_GET_AFFINE_COORDINATES 162
+# define EC_F_EC_GF2M_SIMPLE_POINT_SET_AFFINE_COORDINATES 163
+# define EC_F_EC_GF2M_SIMPLE_SET_COMPRESSED_COORDINATES 164
+# define EC_F_EC_GFP_MONT_FIELD_DECODE 133
+# define EC_F_EC_GFP_MONT_FIELD_ENCODE 134
+# define EC_F_EC_GFP_MONT_FIELD_MUL 131
+# define EC_F_EC_GFP_MONT_FIELD_SET_TO_ONE 209
+# define EC_F_EC_GFP_MONT_FIELD_SQR 132
+# define EC_F_EC_GFP_MONT_GROUP_SET_CURVE 189
+# define EC_F_EC_GFP_MONT_GROUP_SET_CURVE_GFP 135
+# define EC_F_EC_GFP_NISTP224_GROUP_SET_CURVE 225
+# define EC_F_EC_GFP_NISTP224_POINTS_MUL 228
+# define EC_F_EC_GFP_NISTP224_POINT_GET_AFFINE_COORDINATES 226
+# define EC_F_EC_GFP_NISTP256_GROUP_SET_CURVE 230
+# define EC_F_EC_GFP_NISTP256_POINTS_MUL 231
+# define EC_F_EC_GFP_NISTP256_POINT_GET_AFFINE_COORDINATES 232
+# define EC_F_EC_GFP_NISTP521_GROUP_SET_CURVE 233
+# define EC_F_EC_GFP_NISTP521_POINTS_MUL 234
+# define EC_F_EC_GFP_NISTP521_POINT_GET_AFFINE_COORDINATES 235
+# define EC_F_EC_GFP_NIST_FIELD_MUL 200
+# define EC_F_EC_GFP_NIST_FIELD_SQR 201
+# define EC_F_EC_GFP_NIST_GROUP_SET_CURVE 202
+# define EC_F_EC_GFP_SIMPLE_GROUP_CHECK_DISCRIMINANT 165
+# define EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE 166
+# define EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE_GFP 100
+# define EC_F_EC_GFP_SIMPLE_GROUP_SET_GENERATOR 101
+# define EC_F_EC_GFP_SIMPLE_MAKE_AFFINE 102
+# define EC_F_EC_GFP_SIMPLE_OCT2POINT 103
+# define EC_F_EC_GFP_SIMPLE_POINT2OCT 104
+# define EC_F_EC_GFP_SIMPLE_POINTS_MAKE_AFFINE 137
+# define EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES 167
+# define EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES_GFP 105
+# define EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES 168
+# define EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES_GFP 128
+# define EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES 169
+# define EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES_GFP 129
+# define EC_F_EC_GROUP_CHECK 170
+# define EC_F_EC_GROUP_CHECK_DISCRIMINANT 171
+# define EC_F_EC_GROUP_COPY 106
+# define EC_F_EC_GROUP_GET0_GENERATOR 139
+# define EC_F_EC_GROUP_GET_COFACTOR 140
+# define EC_F_EC_GROUP_GET_CURVE_GF2M 172
+# define EC_F_EC_GROUP_GET_CURVE_GFP 130
+# define EC_F_EC_GROUP_GET_DEGREE 173
+# define EC_F_EC_GROUP_GET_ORDER 141
+# define EC_F_EC_GROUP_GET_PENTANOMIAL_BASIS 193
+# define EC_F_EC_GROUP_GET_TRINOMIAL_BASIS 194
+# define EC_F_EC_GROUP_NEW 108
+# define EC_F_EC_GROUP_NEW_BY_CURVE_NAME 174
+# define EC_F_EC_GROUP_NEW_FROM_DATA 175
+# define EC_F_EC_GROUP_PRECOMPUTE_MULT 142
+# define EC_F_EC_GROUP_SET_CURVE_GF2M 176
+# define EC_F_EC_GROUP_SET_CURVE_GFP 109
+# define EC_F_EC_GROUP_SET_EXTRA_DATA 110
+# define EC_F_EC_GROUP_SET_GENERATOR 111
+# define EC_F_EC_KEY_CHECK_KEY 177
+# define EC_F_EC_KEY_COPY 178
+# define EC_F_EC_KEY_GENERATE_KEY 179
+# define EC_F_EC_KEY_NEW 182
+# define EC_F_EC_KEY_PRINT 180
+# define EC_F_EC_KEY_PRINT_FP 181
+# define EC_F_EC_KEY_SET_PUBLIC_KEY_AFFINE_COORDINATES 229
+# define EC_F_EC_POINTS_MAKE_AFFINE 136
+# define EC_F_EC_POINT_ADD 112
+# define EC_F_EC_POINT_CMP 113
+# define EC_F_EC_POINT_COPY 114
+# define EC_F_EC_POINT_DBL 115
+# define EC_F_EC_POINT_GET_AFFINE_COORDINATES_GF2M 183
+# define EC_F_EC_POINT_GET_AFFINE_COORDINATES_GFP 116
+# define EC_F_EC_POINT_GET_JPROJECTIVE_COORDINATES_GFP 117
+# define EC_F_EC_POINT_INVERT 210
+# define EC_F_EC_POINT_IS_AT_INFINITY 118
+# define EC_F_EC_POINT_IS_ON_CURVE 119
+# define EC_F_EC_POINT_MAKE_AFFINE 120
+# define EC_F_EC_POINT_MUL 184
+# define EC_F_EC_POINT_NEW 121
+# define EC_F_EC_POINT_OCT2POINT 122
+# define EC_F_EC_POINT_POINT2OCT 123
+# define EC_F_EC_POINT_SET_AFFINE_COORDINATES_GF2M 185
+# define EC_F_EC_POINT_SET_AFFINE_COORDINATES_GFP 124
+# define EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GF2M 186
+# define EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GFP 125
+# define EC_F_EC_POINT_SET_JPROJECTIVE_COORDINATES_GFP 126
+# define EC_F_EC_POINT_SET_TO_INFINITY 127
+# define EC_F_EC_PRE_COMP_DUP 207
+# define EC_F_EC_PRE_COMP_NEW 196
+# define EC_F_EC_WNAF_MUL 187
+# define EC_F_EC_WNAF_PRECOMPUTE_MULT 188
+# define EC_F_I2D_ECPARAMETERS 190
+# define EC_F_I2D_ECPKPARAMETERS 191
+# define EC_F_I2D_ECPRIVATEKEY 192
+# define EC_F_I2O_ECPUBLICKEY 151
+# define EC_F_NISTP224_PRE_COMP_NEW 227
+# define EC_F_NISTP256_PRE_COMP_NEW 236
+# define EC_F_NISTP521_PRE_COMP_NEW 237
+# define EC_F_O2I_ECPUBLICKEY 152
+# define EC_F_OLD_EC_PRIV_DECODE 222
+# define EC_F_PKEY_EC_CTRL 197
+# define EC_F_PKEY_EC_CTRL_STR 198
+# define EC_F_PKEY_EC_DERIVE 217
+# define EC_F_PKEY_EC_KEYGEN 199
+# define EC_F_PKEY_EC_PARAMGEN 219
+# define EC_F_PKEY_EC_SIGN 218
+
+/* Reason codes. */
+# define EC_R_ASN1_ERROR 115
+# define EC_R_ASN1_UNKNOWN_FIELD 116
+# define EC_R_BIGNUM_OUT_OF_RANGE 144
+# define EC_R_BUFFER_TOO_SMALL 100
+# define EC_R_COORDINATES_OUT_OF_RANGE 146
+# define EC_R_D2I_ECPKPARAMETERS_FAILURE 117
+# define EC_R_DECODE_ERROR 142
+# define EC_R_DISCRIMINANT_IS_ZERO 118
+# define EC_R_EC_GROUP_NEW_BY_NAME_FAILURE 119
+# define EC_R_FIELD_TOO_LARGE 143
+# define EC_R_GF2M_NOT_SUPPORTED 147
+# define EC_R_GROUP2PKPARAMETERS_FAILURE 120
+# define EC_R_I2D_ECPKPARAMETERS_FAILURE 121
+# define EC_R_INCOMPATIBLE_OBJECTS 101
+# define EC_R_INVALID_ARGUMENT 112
+# define EC_R_INVALID_COMPRESSED_POINT 110
+# define EC_R_INVALID_COMPRESSION_BIT 109
+# define EC_R_INVALID_CURVE 141
+# define EC_R_INVALID_DIGEST 151
+# define EC_R_INVALID_DIGEST_TYPE 138
+# define EC_R_INVALID_ENCODING 102
+# define EC_R_INVALID_FIELD 103
+# define EC_R_INVALID_FORM 104
+# define EC_R_INVALID_GROUP_ORDER 122
+# define EC_R_INVALID_PENTANOMIAL_BASIS 132
+# define EC_R_INVALID_PRIVATE_KEY 123
+# define EC_R_INVALID_TRINOMIAL_BASIS 137
+# define EC_R_KDF_PARAMETER_ERROR 148
+# define EC_R_KEYS_NOT_SET 140
+# define EC_R_MISSING_PARAMETERS 124
+# define EC_R_MISSING_PRIVATE_KEY 125
+# define EC_R_NOT_A_NIST_PRIME 135
+# define EC_R_NOT_A_SUPPORTED_NIST_PRIME 136
+# define EC_R_NOT_IMPLEMENTED 126
+# define EC_R_NOT_INITIALIZED 111
+# define EC_R_NO_FIELD_MOD 133
+# define EC_R_NO_PARAMETERS_SET 139
+# define EC_R_PASSED_NULL_PARAMETER 134
+# define EC_R_PEER_KEY_ERROR 149
+# define EC_R_PKPARAMETERS2GROUP_FAILURE 127
+# define EC_R_POINT_AT_INFINITY 106
+# define EC_R_POINT_IS_NOT_ON_CURVE 107
+# define EC_R_SHARED_INFO_ERROR 150
+# define EC_R_SLOT_FULL 108
+# define EC_R_UNDEFINED_GENERATOR 113
+# define EC_R_UNDEFINED_ORDER 128
+# define EC_R_UNKNOWN_GROUP 129
+# define EC_R_UNKNOWN_ORDER 114
+# define EC_R_UNSUPPORTED_FIELD 131
+# define EC_R_WRONG_CURVE_PARAMETERS 145
+# define EC_R_WRONG_ORDER 130
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/deps/openssl/openssl/include/openssl/ecdh.h b/deps/openssl/openssl/include/openssl/ecdh.h
index ad6e3dc9c7e..25348b30fe7 100644
--- a/deps/openssl/openssl/include/openssl/ecdh.h
+++ b/deps/openssl/openssl/include/openssl/ecdh.h
@@ -1 +1,134 @@
-#include "../../crypto/ecdh/ecdh.h"
+/* crypto/ecdh/ecdh.h */
+/* ====================================================================
+ * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
+ *
+ * The Elliptic Curve Public-Key Crypto Library (ECC Code) included
+ * herein is developed by SUN MICROSYSTEMS, INC., and is contributed
+ * to the OpenSSL project.
+ *
+ * The ECC Code is licensed pursuant to the OpenSSL open source
+ * license provided below.
+ *
+ * The ECDH software is originally written by Douglas Stebila of
+ * Sun Microsystems Laboratories.
+ *
+ */
+/* ====================================================================
+ * Copyright (c) 2000-2002 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * licensing@OpenSSL.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+#ifndef HEADER_ECDH_H
+# define HEADER_ECDH_H
+
+# include <openssl/opensslconf.h>
+
+# ifdef OPENSSL_NO_ECDH
+# error ECDH is disabled.
+# endif
+
+# include <openssl/ec.h>
+# include <openssl/ossl_typ.h>
+# ifndef OPENSSL_NO_DEPRECATED
+# include <openssl/bn.h>
+# endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# define EC_FLAG_COFACTOR_ECDH 0x1000
+
+const ECDH_METHOD *ECDH_OpenSSL(void);
+
+void ECDH_set_default_method(const ECDH_METHOD *);
+const ECDH_METHOD *ECDH_get_default_method(void);
+int ECDH_set_method(EC_KEY *, const ECDH_METHOD *);
+
+int ECDH_compute_key(void *out, size_t outlen, const EC_POINT *pub_key,
+ EC_KEY *ecdh, void *(*KDF) (const void *in, size_t inlen,
+ void *out, size_t *outlen));
+
+int ECDH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new
+ *new_func, CRYPTO_EX_dup *dup_func,
+ CRYPTO_EX_free *free_func);
+int ECDH_set_ex_data(EC_KEY *d, int idx, void *arg);
+void *ECDH_get_ex_data(EC_KEY *d, int idx);
+
+int ECDH_KDF_X9_62(unsigned char *out, size_t outlen,
+ const unsigned char *Z, size_t Zlen,
+ const unsigned char *sinfo, size_t sinfolen,
+ const EVP_MD *md);
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_ECDH_strings(void);
+
+/* Error codes for the ECDH functions. */
+
+/* Function codes. */
+# define ECDH_F_ECDH_CHECK 102
+# define ECDH_F_ECDH_COMPUTE_KEY 100
+# define ECDH_F_ECDH_DATA_NEW_METHOD 101
+
+/* Reason codes. */
+# define ECDH_R_KDF_FAILED 102
+# define ECDH_R_NON_FIPS_METHOD 103
+# define ECDH_R_NO_PRIVATE_VALUE 100
+# define ECDH_R_POINT_ARITHMETIC_FAILURE 101
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/deps/openssl/openssl/include/openssl/ecdsa.h b/deps/openssl/openssl/include/openssl/ecdsa.h
index da451230932..c4016ac3e19 100644
--- a/deps/openssl/openssl/include/openssl/ecdsa.h
+++ b/deps/openssl/openssl/include/openssl/ecdsa.h
@@ -1 +1,335 @@
-#include "../../crypto/ecdsa/ecdsa.h"
+/* crypto/ecdsa/ecdsa.h */
+/**
+ * \file crypto/ecdsa/ecdsa.h Include file for the OpenSSL ECDSA functions
+ * \author Written by Nils Larsch for the OpenSSL project
+ */
+/* ====================================================================
+ * Copyright (c) 2000-2005 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * licensing@OpenSSL.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+#ifndef HEADER_ECDSA_H
+# define HEADER_ECDSA_H
+
+# include <openssl/opensslconf.h>
+
+# ifdef OPENSSL_NO_ECDSA
+# error ECDSA is disabled.
+# endif
+
+# include <openssl/ec.h>
+# include <openssl/ossl_typ.h>
+# ifndef OPENSSL_NO_DEPRECATED
+# include <openssl/bn.h>
+# endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct ECDSA_SIG_st {
+ BIGNUM *r;
+ BIGNUM *s;
+} ECDSA_SIG;
+
+/** Allocates and initialize a ECDSA_SIG structure
+ * \return pointer to a ECDSA_SIG structure or NULL if an error occurred
+ */
+ECDSA_SIG *ECDSA_SIG_new(void);
+
+/** frees a ECDSA_SIG structure
+ * \param sig pointer to the ECDSA_SIG structure
+ */
+void ECDSA_SIG_free(ECDSA_SIG *sig);
+
+/** DER encode content of ECDSA_SIG object (note: this function modifies *pp
+ * (*pp += length of the DER encoded signature)).
+ * \param sig pointer to the ECDSA_SIG object
+ * \param pp pointer to a unsigned char pointer for the output or NULL
+ * \return the length of the DER encoded ECDSA_SIG object or 0
+ */
+int i2d_ECDSA_SIG(const ECDSA_SIG *sig, unsigned char **pp);
+
+/** Decodes a DER encoded ECDSA signature (note: this function changes *pp
+ * (*pp += len)).
+ * \param sig pointer to ECDSA_SIG pointer (may be NULL)
+ * \param pp memory buffer with the DER encoded signature
+ * \param len length of the buffer
+ * \return pointer to the decoded ECDSA_SIG structure (or NULL)
+ */
+ECDSA_SIG *d2i_ECDSA_SIG(ECDSA_SIG **sig, const unsigned char **pp, long len);
+
+/** Computes the ECDSA signature of the given hash value using
+ * the supplied private key and returns the created signature.
+ * \param dgst pointer to the hash value
+ * \param dgst_len length of the hash value
+ * \param eckey EC_KEY object containing a private EC key
+ * \return pointer to a ECDSA_SIG structure or NULL if an error occurred
+ */
+ECDSA_SIG *ECDSA_do_sign(const unsigned char *dgst, int dgst_len,
+ EC_KEY *eckey);
+
+/** Computes ECDSA signature of a given hash value using the supplied
+ * private key (note: sig must point to ECDSA_size(eckey) bytes of memory).
+ * \param dgst pointer to the hash value to sign
+ * \param dgstlen length of the hash value
+ * \param kinv BIGNUM with a pre-computed inverse k (optional)
+ * \param rp BIGNUM with a pre-computed rp value (optioanl),
+ * see ECDSA_sign_setup
+ * \param eckey EC_KEY object containing a private EC key
+ * \return pointer to a ECDSA_SIG structure or NULL if an error occurred
+ */
+ECDSA_SIG *ECDSA_do_sign_ex(const unsigned char *dgst, int dgstlen,
+ const BIGNUM *kinv, const BIGNUM *rp,
+ EC_KEY *eckey);
+
+/** Verifies that the supplied signature is a valid ECDSA
+ * signature of the supplied hash value using the supplied public key.
+ * \param dgst pointer to the hash value
+ * \param dgst_len length of the hash value
+ * \param sig ECDSA_SIG structure
+ * \param eckey EC_KEY object containing a public EC key
+ * \return 1 if the signature is valid, 0 if the signature is invalid
+ * and -1 on error
+ */
+int ECDSA_do_verify(const unsigned char *dgst, int dgst_len,
+ const ECDSA_SIG *sig, EC_KEY *eckey);
+
+const ECDSA_METHOD *ECDSA_OpenSSL(void);
+
+/** Sets the default ECDSA method
+ * \param meth new default ECDSA_METHOD
+ */
+void ECDSA_set_default_method(const ECDSA_METHOD *meth);
+
+/** Returns the default ECDSA method
+ * \return pointer to ECDSA_METHOD structure containing the default method
+ */
+const ECDSA_METHOD *ECDSA_get_default_method(void);
+
+/** Sets method to be used for the ECDSA operations
+ * \param eckey EC_KEY object
+ * \param meth new method
+ * \return 1 on success and 0 otherwise
+ */
+int ECDSA_set_method(EC_KEY *eckey, const ECDSA_METHOD *meth);
+
+/** Returns the maximum length of the DER encoded signature
+ * \param eckey EC_KEY object
+ * \return numbers of bytes required for the DER encoded signature
+ */
+int ECDSA_size(const EC_KEY *eckey);
+
+/** Precompute parts of the signing operation
+ * \param eckey EC_KEY object containing a private EC key
+ * \param ctx BN_CTX object (optional)
+ * \param kinv BIGNUM pointer for the inverse of k
+ * \param rp BIGNUM pointer for x coordinate of k * generator
+ * \return 1 on success and 0 otherwise
+ */
+int ECDSA_sign_setup(EC_KEY *eckey, BN_CTX *ctx, BIGNUM **kinv, BIGNUM **rp);
+
+/** Computes ECDSA signature of a given hash value using the supplied
+ * private key (note: sig must point to ECDSA_size(eckey) bytes of memory).
+ * \param type this parameter is ignored
+ * \param dgst pointer to the hash value to sign
+ * \param dgstlen length of the hash value
+ * \param sig memory for the DER encoded created signature
+ * \param siglen pointer to the length of the returned signature
+ * \param eckey EC_KEY object containing a private EC key
+ * \return 1 on success and 0 otherwise
+ */
+int ECDSA_sign(int type, const unsigned char *dgst, int dgstlen,
+ unsigned char *sig, unsigned int *siglen, EC_KEY *eckey);
+
+/** Computes ECDSA signature of a given hash value using the supplied
+ * private key (note: sig must point to ECDSA_size(eckey) bytes of memory).
+ * \param type this parameter is ignored
+ * \param dgst pointer to the hash value to sign
+ * \param dgstlen length of the hash value
+ * \param sig buffer to hold the DER encoded signature
+ * \param siglen pointer to the length of the returned signature
+ * \param kinv BIGNUM with a pre-computed inverse k (optional)
+ * \param rp BIGNUM with a pre-computed rp value (optioanl),
+ * see ECDSA_sign_setup
+ * \param eckey EC_KEY object containing a private EC key
+ * \return 1 on success and 0 otherwise
+ */
+int ECDSA_sign_ex(int type, const unsigned char *dgst, int dgstlen,
+ unsigned char *sig, unsigned int *siglen,
+ const BIGNUM *kinv, const BIGNUM *rp, EC_KEY *eckey);
+
+/** Verifies that the given signature is valid ECDSA signature
+ * of the supplied hash value using the specified public key.
+ * \param type this parameter is ignored
+ * \param dgst pointer to the hash value
+ * \param dgstlen length of the hash value
+ * \param sig pointer to the DER encoded signature
+ * \param siglen length of the DER encoded signature
+ * \param eckey EC_KEY object containing a public EC key
+ * \return 1 if the signature is valid, 0 if the signature is invalid
+ * and -1 on error
+ */
+int ECDSA_verify(int type, const unsigned char *dgst, int dgstlen,
+ const unsigned char *sig, int siglen, EC_KEY *eckey);
+
+/* the standard ex_data functions */
+int ECDSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new
+ *new_func, CRYPTO_EX_dup *dup_func,
+ CRYPTO_EX_free *free_func);
+int ECDSA_set_ex_data(EC_KEY *d, int idx, void *arg);
+void *ECDSA_get_ex_data(EC_KEY *d, int idx);
+
+/** Allocates and initialize a ECDSA_METHOD structure
+ * \param ecdsa_method pointer to ECDSA_METHOD to copy. (May be NULL)
+ * \return pointer to a ECDSA_METHOD structure or NULL if an error occurred
+ */
+
+ECDSA_METHOD *ECDSA_METHOD_new(ECDSA_METHOD *ecdsa_method);
+
+/** frees a ECDSA_METHOD structure
+ * \param ecdsa_method pointer to the ECDSA_METHOD structure
+ */
+void ECDSA_METHOD_free(ECDSA_METHOD *ecdsa_method);
+
+/** Sets application specific data in the ECDSA_METHOD
+ * \param ecdsa_method pointer to existing ECDSA_METHOD
+ * \param app application specific data to set
+ */
+
+void ECDSA_METHOD_set_app_data(ECDSA_METHOD *ecdsa_method, void *app);
+
+/** Returns application specific data from a ECDSA_METHOD structure
+ * \param ecdsa_method pointer to ECDSA_METHOD structure
+ * \return pointer to application specific data.
+ */
+
+void *ECDSA_METHOD_get_app_data(ECDSA_METHOD *ecdsa_method);
+
+/** Set the ECDSA_do_sign function in the ECDSA_METHOD
+ * \param ecdsa_method pointer to existing ECDSA_METHOD
+ * \param ecdsa_do_sign a funtion of type ECDSA_do_sign
+ */
+
+void ECDSA_METHOD_set_sign(ECDSA_METHOD *ecdsa_method,
+ ECDSA_SIG *(*ecdsa_do_sign) (const unsigned char
+ *dgst, int dgst_len,
+ const BIGNUM *inv,
+ const BIGNUM *rp,
+ EC_KEY *eckey));
+
+/** Set the ECDSA_sign_setup function in the ECDSA_METHOD
+ * \param ecdsa_method pointer to existing ECDSA_METHOD
+ * \param ecdsa_sign_setup a funtion of type ECDSA_sign_setup
+ */
+
+void ECDSA_METHOD_set_sign_setup(ECDSA_METHOD *ecdsa_method,
+ int (*ecdsa_sign_setup) (EC_KEY *eckey,
+ BN_CTX *ctx,
+ BIGNUM **kinv,
+ BIGNUM **r));
+
+/** Set the ECDSA_do_verify function in the ECDSA_METHOD
+ * \param ecdsa_method pointer to existing ECDSA_METHOD
+ * \param ecdsa_do_verify a funtion of type ECDSA_do_verify
+ */
+
+void ECDSA_METHOD_set_verify(ECDSA_METHOD *ecdsa_method,
+ int (*ecdsa_do_verify) (const unsigned char
+ *dgst, int dgst_len,
+ const ECDSA_SIG *sig,
+ EC_KEY *eckey));
+
+void ECDSA_METHOD_set_flags(ECDSA_METHOD *ecdsa_method, int flags);
+
+/** Set the flags field in the ECDSA_METHOD
+ * \param ecdsa_method pointer to existing ECDSA_METHOD
+ * \param flags flags value to set
+ */
+
+void ECDSA_METHOD_set_name(ECDSA_METHOD *ecdsa_method, char *name);
+
+/** Set the name field in the ECDSA_METHOD
+ * \param ecdsa_method pointer to existing ECDSA_METHOD
+ * \param name name to set
+ */
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_ECDSA_strings(void);
+
+/* Error codes for the ECDSA functions. */
+
+/* Function codes. */
+# define ECDSA_F_ECDSA_CHECK 104
+# define ECDSA_F_ECDSA_DATA_NEW_METHOD 100
+# define ECDSA_F_ECDSA_DO_SIGN 101
+# define ECDSA_F_ECDSA_DO_VERIFY 102
+# define ECDSA_F_ECDSA_METHOD_NEW 105
+# define ECDSA_F_ECDSA_SIGN_SETUP 103
+
+/* Reason codes. */
+# define ECDSA_R_BAD_SIGNATURE 100
+# define ECDSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 101
+# define ECDSA_R_ERR_EC_LIB 102
+# define ECDSA_R_MISSING_PARAMETERS 103
+# define ECDSA_R_NEED_NEW_SETUP_VALUES 106
+# define ECDSA_R_NON_FIPS_METHOD 107
+# define ECDSA_R_RANDOM_NUMBER_GENERATION_FAILED 104
+# define ECDSA_R_SIGNATURE_MALLOC_FAILED 105
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/deps/openssl/openssl/include/openssl/engine.h b/deps/openssl/openssl/include/openssl/engine.h
index 2dceaac6c78..bd7b591447d 100644
--- a/deps/openssl/openssl/include/openssl/engine.h
+++ b/deps/openssl/openssl/include/openssl/engine.h
@@ -1 +1,960 @@
-#include "../../crypto/engine/engine.h"
+/* openssl/engine.h */
+/*
+ * Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL project
+ * 2000.
+ */
+/* ====================================================================
+ * Copyright (c) 1999-2004 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * licensing@OpenSSL.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+/* ====================================================================
+ * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
+ * ECDH support in OpenSSL originally developed by
+ * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
+ */
+
+#ifndef HEADER_ENGINE_H
+# define HEADER_ENGINE_H
+
+# include <openssl/opensslconf.h>
+
+# ifdef OPENSSL_NO_ENGINE
+# error ENGINE is disabled.
+# endif
+
+# ifndef OPENSSL_NO_DEPRECATED
+# include <openssl/bn.h>
+# ifndef OPENSSL_NO_RSA
+# include <openssl/rsa.h>
+# endif
+# ifndef OPENSSL_NO_DSA
+# include <openssl/dsa.h>
+# endif
+# ifndef OPENSSL_NO_DH
+# include <openssl/dh.h>
+# endif
+# ifndef OPENSSL_NO_ECDH
+# include <openssl/ecdh.h>
+# endif
+# ifndef OPENSSL_NO_ECDSA
+# include <openssl/ecdsa.h>
+# endif
+# include <openssl/rand.h>
+# include <openssl/ui.h>
+# include <openssl/err.h>
+# endif
+
+# include <openssl/ossl_typ.h>
+# include <openssl/symhacks.h>
+
+# include <openssl/x509.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * These flags are used to control combinations of algorithm (methods) by
+ * bitwise "OR"ing.
+ */
+# define ENGINE_METHOD_RSA (unsigned int)0x0001
+# define ENGINE_METHOD_DSA (unsigned int)0x0002
+# define ENGINE_METHOD_DH (unsigned int)0x0004
+# define ENGINE_METHOD_RAND (unsigned int)0x0008
+# define ENGINE_METHOD_ECDH (unsigned int)0x0010
+# define ENGINE_METHOD_ECDSA (unsigned int)0x0020
+# define ENGINE_METHOD_CIPHERS (unsigned int)0x0040
+# define ENGINE_METHOD_DIGESTS (unsigned int)0x0080
+# define ENGINE_METHOD_STORE (unsigned int)0x0100
+# define ENGINE_METHOD_PKEY_METHS (unsigned int)0x0200
+# define ENGINE_METHOD_PKEY_ASN1_METHS (unsigned int)0x0400
+/* Obvious all-or-nothing cases. */
+# define ENGINE_METHOD_ALL (unsigned int)0xFFFF
+# define ENGINE_METHOD_NONE (unsigned int)0x0000
+
+/*
+ * This(ese) flag(s) controls behaviour of the ENGINE_TABLE mechanism used
+ * internally to control registration of ENGINE implementations, and can be
+ * set by ENGINE_set_table_flags(). The "NOINIT" flag prevents attempts to
+ * initialise registered ENGINEs if they are not already initialised.
+ */
+# define ENGINE_TABLE_FLAG_NOINIT (unsigned int)0x0001
+
+/* ENGINE flags that can be set by ENGINE_set_flags(). */
+/* Not used */
+/* #define ENGINE_FLAGS_MALLOCED 0x0001 */
+
+/*
+ * This flag is for ENGINEs that wish to handle the various 'CMD'-related
+ * control commands on their own. Without this flag, ENGINE_ctrl() handles
+ * these control commands on behalf of the ENGINE using their "cmd_defns"
+ * data.
+ */
+# define ENGINE_FLAGS_MANUAL_CMD_CTRL (int)0x0002
+
+/*
+ * This flag is for ENGINEs who return new duplicate structures when found
+ * via "ENGINE_by_id()". When an ENGINE must store state (eg. if
+ * ENGINE_ctrl() commands are called in sequence as part of some stateful
+ * process like key-generation setup and execution), it can set this flag -
+ * then each attempt to obtain the ENGINE will result in it being copied into
+ * a new structure. Normally, ENGINEs don't declare this flag so
+ * ENGINE_by_id() just increments the existing ENGINE's structural reference
+ * count.
+ */
+# define ENGINE_FLAGS_BY_ID_COPY (int)0x0004
+
+/*
+ * This flag if for an ENGINE that does not want its methods registered as
+ * part of ENGINE_register_all_complete() for example if the methods are not
+ * usable as default methods.
+ */
+
+# define ENGINE_FLAGS_NO_REGISTER_ALL (int)0x0008
+
+/*
+ * ENGINEs can support their own command types, and these flags are used in
+ * ENGINE_CTRL_GET_CMD_FLAGS to indicate to the caller what kind of input
+ * each command expects. Currently only numeric and string input is
+ * supported. If a control command supports none of the _NUMERIC, _STRING, or
+ * _NO_INPUT options, then it is regarded as an "internal" control command -
+ * and not for use in config setting situations. As such, they're not
+ * available to the ENGINE_ctrl_cmd_string() function, only raw ENGINE_ctrl()
+ * access. Changes to this list of 'command types' should be reflected
+ * carefully in ENGINE_cmd_is_executable() and ENGINE_ctrl_cmd_string().
+ */
+
+/* accepts a 'long' input value (3rd parameter to ENGINE_ctrl) */
+# define ENGINE_CMD_FLAG_NUMERIC (unsigned int)0x0001
+/*
+ * accepts string input (cast from 'void*' to 'const char *', 4th parameter
+ * to ENGINE_ctrl)
+ */
+# define ENGINE_CMD_FLAG_STRING (unsigned int)0x0002
+/*
+ * Indicates that the control command takes *no* input. Ie. the control
+ * command is unparameterised.
+ */
+# define ENGINE_CMD_FLAG_NO_INPUT (unsigned int)0x0004
+/*
+ * Indicates that the control command is internal. This control command won't
+ * be shown in any output, and is only usable through the ENGINE_ctrl_cmd()
+ * function.
+ */
+# define ENGINE_CMD_FLAG_INTERNAL (unsigned int)0x0008
+
+/*
+ * NB: These 3 control commands are deprecated and should not be used.
+ * ENGINEs relying on these commands should compile conditional support for
+ * compatibility (eg. if these symbols are defined) but should also migrate
+ * the same functionality to their own ENGINE-specific control functions that
+ * can be "discovered" by calling applications. The fact these control
+ * commands wouldn't be "executable" (ie. usable by text-based config)
+ * doesn't change the fact that application code can find and use them
+ * without requiring per-ENGINE hacking.
+ */
+
+/*
+ * These flags are used to tell the ctrl function what should be done. All
+ * command numbers are shared between all engines, even if some don't make
+ * sense to some engines. In such a case, they do nothing but return the
+ * error ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED.
+ */
+# define ENGINE_CTRL_SET_LOGSTREAM 1
+# define ENGINE_CTRL_SET_PASSWORD_CALLBACK 2
+# define ENGINE_CTRL_HUP 3/* Close and reinitialise
+ * any handles/connections
+ * etc. */
+# define ENGINE_CTRL_SET_USER_INTERFACE 4/* Alternative to callback */
+# define ENGINE_CTRL_SET_CALLBACK_DATA 5/* User-specific data, used
+ * when calling the password
+ * callback and the user
+ * interface */
+# define ENGINE_CTRL_LOAD_CONFIGURATION 6/* Load a configuration,
+ * given a string that
+ * represents a file name
+ * or so */
+# define ENGINE_CTRL_LOAD_SECTION 7/* Load data from a given
+ * section in the already
+ * loaded configuration */
+
+/*
+ * These control commands allow an application to deal with an arbitrary
+ * engine in a dynamic way. Warn: Negative return values indicate errors FOR
+ * THESE COMMANDS because zero is used to indicate 'end-of-list'. Other
+ * commands, including ENGINE-specific command types, return zero for an
+ * error. An ENGINE can choose to implement these ctrl functions, and can
+ * internally manage things however it chooses - it does so by setting the
+ * ENGINE_FLAGS_MANUAL_CMD_CTRL flag (using ENGINE_set_flags()). Otherwise
+ * the ENGINE_ctrl() code handles this on the ENGINE's behalf using the
+ * cmd_defns data (set using ENGINE_set_cmd_defns()). This means an ENGINE's
+ * ctrl() handler need only implement its own commands - the above "meta"
+ * commands will be taken care of.
+ */
+
+/*
+ * Returns non-zero if the supplied ENGINE has a ctrl() handler. If "not",
+ * then all the remaining control commands will return failure, so it is
+ * worth checking this first if the caller is trying to "discover" the
+ * engine's capabilities and doesn't want errors generated unnecessarily.
+ */
+# define ENGINE_CTRL_HAS_CTRL_FUNCTION 10
+/*
+ * Returns a positive command number for the first command supported by the
+ * engine. Returns zero if no ctrl commands are supported.
+ */
+# define ENGINE_CTRL_GET_FIRST_CMD_TYPE 11
+/*
+ * The 'long' argument specifies a command implemented by the engine, and the
+ * return value is the next command supported, or zero if there are no more.
+ */
+# define ENGINE_CTRL_GET_NEXT_CMD_TYPE 12
+/*
+ * The 'void*' argument is a command name (cast from 'const char *'), and the
+ * return value is the command that corresponds to it.
+ */
+# define ENGINE_CTRL_GET_CMD_FROM_NAME 13
+/*
+ * The next two allow a command to be converted into its corresponding string
+ * form. In each case, the 'long' argument supplies the command. In the
+ * NAME_LEN case, the return value is the length of the command name (not
+ * counting a trailing EOL). In the NAME case, the 'void*' argument must be a
+ * string buffer large enough, and it will be populated with the name of the
+ * command (WITH a trailing EOL).
+ */
+# define ENGINE_CTRL_GET_NAME_LEN_FROM_CMD 14
+# define ENGINE_CTRL_GET_NAME_FROM_CMD 15
+/* The next two are similar but give a "short description" of a command. */
+# define ENGINE_CTRL_GET_DESC_LEN_FROM_CMD 16
+# define ENGINE_CTRL_GET_DESC_FROM_CMD 17
+/*
+ * With this command, the return value is the OR'd combination of
+ * ENGINE_CMD_FLAG_*** values that indicate what kind of input a given
+ * engine-specific ctrl command expects.
+ */
+# define ENGINE_CTRL_GET_CMD_FLAGS 18
+
+/*
+ * ENGINE implementations should start the numbering of their own control
+ * commands from this value. (ie. ENGINE_CMD_BASE, ENGINE_CMD_BASE + 1, etc).
+ */
+# define ENGINE_CMD_BASE 200
+
+/*
+ * NB: These 2 nCipher "chil" control commands are deprecated, and their
+ * functionality is now available through ENGINE-specific control commands
+ * (exposed through the above-mentioned 'CMD'-handling). Code using these 2
+ * commands should be migrated to the more general command handling before
+ * these are removed.
+ */
+
+/* Flags specific to the nCipher "chil" engine */
+# define ENGINE_CTRL_CHIL_SET_FORKCHECK 100
+ /*
+ * Depending on the value of the (long)i argument, this sets or
+ * unsets the SimpleForkCheck flag in the CHIL API to enable or
+ * disable checking and workarounds for applications that fork().
+ */
+# define ENGINE_CTRL_CHIL_NO_LOCKING 101
+ /*
+ * This prevents the initialisation function from providing mutex
+ * callbacks to the nCipher library.
+ */
+
+/*
+ * If an ENGINE supports its own specific control commands and wishes the
+ * framework to handle the above 'ENGINE_CMD_***'-manipulation commands on
+ * its behalf, it should supply a null-terminated array of ENGINE_CMD_DEFN
+ * entries to ENGINE_set_cmd_defns(). It should also implement a ctrl()
+ * handler that supports the stated commands (ie. the "cmd_num" entries as
+ * described by the array). NB: The array must be ordered in increasing order
+ * of cmd_num. "null-terminated" means that the last ENGINE_CMD_DEFN element
+ * has cmd_num set to zero and/or cmd_name set to NULL.
+ */
+typedef struct ENGINE_CMD_DEFN_st {
+ unsigned int cmd_num; /* The command number */
+ const char *cmd_name; /* The command name itself */
+ const char *cmd_desc; /* A short description of the command */
+ unsigned int cmd_flags; /* The input the command expects */
+} ENGINE_CMD_DEFN;
+
+/* Generic function pointer */
+typedef int (*ENGINE_GEN_FUNC_PTR) (void);
+/* Generic function pointer taking no arguments */
+typedef int (*ENGINE_GEN_INT_FUNC_PTR) (ENGINE *);
+/* Specific control function pointer */
+typedef int (*ENGINE_CTRL_FUNC_PTR) (ENGINE *, int, long, void *,
+ void (*f) (void));
+/* Generic load_key function pointer */
+typedef EVP_PKEY *(*ENGINE_LOAD_KEY_PTR)(ENGINE *, const char *,
+ UI_METHOD *ui_method,
+ void *callback_data);
+typedef int (*ENGINE_SSL_CLIENT_CERT_PTR) (ENGINE *, SSL *ssl,
+ STACK_OF(X509_NAME) *ca_dn,
+ X509 **pcert, EVP_PKEY **pkey,
+ STACK_OF(X509) **pother,
+ UI_METHOD *ui_method,
+ void *callback_data);
+/*-
+ * These callback types are for an ENGINE's handler for cipher and digest logic.
+ * These handlers have these prototypes;
+ * int foo(ENGINE *e, const EVP_CIPHER **cipher, const int **nids, int nid);
+ * int foo(ENGINE *e, const EVP_MD **digest, const int **nids, int nid);
+ * Looking at how to implement these handlers in the case of cipher support, if
+ * the framework wants the EVP_CIPHER for 'nid', it will call;
+ * foo(e, &p_evp_cipher, NULL, nid); (return zero for failure)
+ * If the framework wants a list of supported 'nid's, it will call;
+ * foo(e, NULL, &p_nids, 0); (returns number of 'nids' or -1 for error)
+ */
+/*
+ * Returns to a pointer to the array of supported cipher 'nid's. If the
+ * second parameter is non-NULL it is set to the size of the returned array.
+ */
+typedef int (*ENGINE_CIPHERS_PTR) (ENGINE *, const EVP_CIPHER **,
+ const int **, int);
+typedef int (*ENGINE_DIGESTS_PTR) (ENGINE *, const EVP_MD **, const int **,
+ int);
+typedef int (*ENGINE_PKEY_METHS_PTR) (ENGINE *, EVP_PKEY_METHOD **,
+ const int **, int);
+typedef int (*ENGINE_PKEY_ASN1_METHS_PTR) (ENGINE *, EVP_PKEY_ASN1_METHOD **,
+ const int **, int);
+/*
+ * STRUCTURE functions ... all of these functions deal with pointers to
+ * ENGINE structures where the pointers have a "structural reference". This
+ * means that their reference is to allowed access to the structure but it
+ * does not imply that the structure is functional. To simply increment or
+ * decrement the structural reference count, use ENGINE_by_id and
+ * ENGINE_free. NB: This is not required when iterating using ENGINE_get_next
+ * as it will automatically decrement the structural reference count of the
+ * "current" ENGINE and increment the structural reference count of the
+ * ENGINE it returns (unless it is NULL).
+ */
+
+/* Get the first/last "ENGINE" type available. */
+ENGINE *ENGINE_get_first(void);
+ENGINE *ENGINE_get_last(void);
+/* Iterate to the next/previous "ENGINE" type (NULL = end of the list). */
+ENGINE *ENGINE_get_next(ENGINE *e);
+ENGINE *ENGINE_get_prev(ENGINE *e);
+/* Add another "ENGINE" type into the array. */
+int ENGINE_add(ENGINE *e);
+/* Remove an existing "ENGINE" type from the array. */
+int ENGINE_remove(ENGINE *e);
+/* Retrieve an engine from the list by its unique "id" value. */
+ENGINE *ENGINE_by_id(const char *id);
+/* Add all the built-in engines. */
+void ENGINE_load_openssl(void);
+void ENGINE_load_dynamic(void);
+# ifndef OPENSSL_NO_STATIC_ENGINE
+void ENGINE_load_4758cca(void);
+void ENGINE_load_aep(void);
+void ENGINE_load_atalla(void);
+void ENGINE_load_chil(void);
+void ENGINE_load_cswift(void);
+void ENGINE_load_nuron(void);
+void ENGINE_load_sureware(void);
+void ENGINE_load_ubsec(void);
+void ENGINE_load_padlock(void);
+void ENGINE_load_capi(void);
+# ifndef OPENSSL_NO_GMP
+void ENGINE_load_gmp(void);
+# endif
+# ifndef OPENSSL_NO_GOST
+void ENGINE_load_gost(void);
+# endif
+# endif
+void ENGINE_load_cryptodev(void);
+void ENGINE_load_rdrand(void);
+void ENGINE_load_builtin_engines(void);
+
+/*
+ * Get and set global flags (ENGINE_TABLE_FLAG_***) for the implementation
+ * "registry" handling.
+ */
+unsigned int ENGINE_get_table_flags(void);
+void ENGINE_set_table_flags(unsigned int flags);
+
+/*- Manage registration of ENGINEs per "table". For each type, there are 3
+ * functions;
+ * ENGINE_register_***(e) - registers the implementation from 'e' (if it has one)
+ * ENGINE_unregister_***(e) - unregister the implementation from 'e'
+ * ENGINE_register_all_***() - call ENGINE_register_***() for each 'e' in the list
+ * Cleanup is automatically registered from each table when required, so
+ * ENGINE_cleanup() will reverse any "register" operations.
+ */
+
+int ENGINE_register_RSA(ENGINE *e);
+void ENGINE_unregister_RSA(ENGINE *e);
+void ENGINE_register_all_RSA(void);
+
+int ENGINE_register_DSA(ENGINE *e);
+void ENGINE_unregister_DSA(ENGINE *e);
+void ENGINE_register_all_DSA(void);
+
+int ENGINE_register_ECDH(ENGINE *e);
+void ENGINE_unregister_ECDH(ENGINE *e);
+void ENGINE_register_all_ECDH(void);
+
+int ENGINE_register_ECDSA(ENGINE *e);
+void ENGINE_unregister_ECDSA(ENGINE *e);
+void ENGINE_register_all_ECDSA(void);
+
+int ENGINE_register_DH(ENGINE *e);
+void ENGINE_unregister_DH(ENGINE *e);
+void ENGINE_register_all_DH(void);
+
+int ENGINE_register_RAND(ENGINE *e);
+void ENGINE_unregister_RAND(ENGINE *e);
+void ENGINE_register_all_RAND(void);
+
+int ENGINE_register_STORE(ENGINE *e);
+void ENGINE_unregister_STORE(ENGINE *e);
+void ENGINE_register_all_STORE(void);
+
+int ENGINE_register_ciphers(ENGINE *e);
+void ENGINE_unregister_ciphers(ENGINE *e);
+void ENGINE_register_all_ciphers(void);
+
+int ENGINE_register_digests(ENGINE *e);
+void ENGINE_unregister_digests(ENGINE *e);
+void ENGINE_register_all_digests(void);
+
+int ENGINE_register_pkey_meths(ENGINE *e);
+void ENGINE_unregister_pkey_meths(ENGINE *e);
+void ENGINE_register_all_pkey_meths(void);
+
+int ENGINE_register_pkey_asn1_meths(ENGINE *e);
+void ENGINE_unregister_pkey_asn1_meths(ENGINE *e);
+void ENGINE_register_all_pkey_asn1_meths(void);
+
+/*
+ * These functions register all support from the above categories. Note, use
+ * of these functions can result in static linkage of code your application
+ * may not need. If you only need a subset of functionality, consider using
+ * more selective initialisation.
+ */
+int ENGINE_register_complete(ENGINE *e);
+int ENGINE_register_all_complete(void);
+
+/*
+ * Send parametrised control commands to the engine. The possibilities to
+ * send down an integer, a pointer to data or a function pointer are
+ * provided. Any of the parameters may or may not be NULL, depending on the
+ * command number. In actuality, this function only requires a structural
+ * (rather than functional) reference to an engine, but many control commands
+ * may require the engine be functional. The caller should be aware of trying
+ * commands that require an operational ENGINE, and only use functional
+ * references in such situations.
+ */
+int ENGINE_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f) (void));
+
+/*
+ * This function tests if an ENGINE-specific command is usable as a
+ * "setting". Eg. in an application's config file that gets processed through
+ * ENGINE_ctrl_cmd_string(). If this returns zero, it is not available to
+ * ENGINE_ctrl_cmd_string(), only ENGINE_ctrl().
+ */
+int ENGINE_cmd_is_executable(ENGINE *e, int cmd);
+
+/*
+ * This function works like ENGINE_ctrl() with the exception of taking a
+ * command name instead of a command number, and can handle optional
+ * commands. See the comment on ENGINE_ctrl_cmd_string() for an explanation
+ * on how to use the cmd_name and cmd_optional.
+ */
+int ENGINE_ctrl_cmd(ENGINE *e, const char *cmd_name,
+ long i, void *p, void (*f) (void), int cmd_optional);
+
+/*
+ * This function passes a command-name and argument to an ENGINE. The
+ * cmd_name is converted to a command number and the control command is
+ * called using 'arg' as an argument (unless the ENGINE doesn't support such
+ * a command, in which case no control command is called). The command is
+ * checked for input flags, and if necessary the argument will be converted
+ * to a numeric value. If cmd_optional is non-zero, then if the ENGINE
+ * doesn't support the given cmd_name the return value will be success
+ * anyway. This function is intended for applications to use so that users
+ * (or config files) can supply engine-specific config data to the ENGINE at
+ * run-time to control behaviour of specific engines. As such, it shouldn't
+ * be used for calling ENGINE_ctrl() functions that return data, deal with
+ * binary data, or that are otherwise supposed to be used directly through
+ * ENGINE_ctrl() in application code. Any "return" data from an ENGINE_ctrl()
+ * operation in this function will be lost - the return value is interpreted
+ * as failure if the return value is zero, success otherwise, and this
+ * function returns a boolean value as a result. In other words, vendors of
+ * 'ENGINE'-enabled devices should write ENGINE implementations with
+ * parameterisations that work in this scheme, so that compliant ENGINE-based
+ * applications can work consistently with the same configuration for the
+ * same ENGINE-enabled devices, across applications.
+ */
+int ENGINE_ctrl_cmd_string(ENGINE *e, const char *cmd_name, const char *arg,
+ int cmd_optional);
+
+/*
+ * These functions are useful for manufacturing new ENGINE structures. They
+ * don't address reference counting at all - one uses them to populate an
+ * ENGINE structure with personalised implementations of things prior to
+ * using it directly or adding it to the builtin ENGINE list in OpenSSL.
+ * These are also here so that the ENGINE structure doesn't have to be
+ * exposed and break binary compatibility!
+ */
+ENGINE *ENGINE_new(void);
+int ENGINE_free(ENGINE *e);
+int ENGINE_up_ref(ENGINE *e);
+int ENGINE_set_id(ENGINE *e, const char *id);
+int ENGINE_set_name(ENGINE *e, const char *name);
+int ENGINE_set_RSA(ENGINE *e, const RSA_METHOD *rsa_meth);
+int ENGINE_set_DSA(ENGINE *e, const DSA_METHOD *dsa_meth);
+int ENGINE_set_ECDH(ENGINE *e, const ECDH_METHOD *ecdh_meth);
+int ENGINE_set_ECDSA(ENGINE *e, const ECDSA_METHOD *ecdsa_meth);
+int ENGINE_set_DH(ENGINE *e, const DH_METHOD *dh_meth);
+int ENGINE_set_RAND(ENGINE *e, const RAND_METHOD *rand_meth);
+int ENGINE_set_STORE(ENGINE *e, const STORE_METHOD *store_meth);
+int ENGINE_set_destroy_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR destroy_f);
+int ENGINE_set_init_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR init_f);
+int ENGINE_set_finish_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR finish_f);
+int ENGINE_set_ctrl_function(ENGINE *e, ENGINE_CTRL_FUNC_PTR ctrl_f);
+int ENGINE_set_load_privkey_function(ENGINE *e,
+ ENGINE_LOAD_KEY_PTR loadpriv_f);
+int ENGINE_set_load_pubkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpub_f);
+int ENGINE_set_load_ssl_client_cert_function(ENGINE *e,
+ ENGINE_SSL_CLIENT_CERT_PTR
+ loadssl_f);
+int ENGINE_set_ciphers(ENGINE *e, ENGINE_CIPHERS_PTR f);
+int ENGINE_set_digests(ENGINE *e, ENGINE_DIGESTS_PTR f);
+int ENGINE_set_pkey_meths(ENGINE *e, ENGINE_PKEY_METHS_PTR f);
+int ENGINE_set_pkey_asn1_meths(ENGINE *e, ENGINE_PKEY_ASN1_METHS_PTR f);
+int ENGINE_set_flags(ENGINE *e, int flags);
+int ENGINE_set_cmd_defns(ENGINE *e, const ENGINE_CMD_DEFN *defns);
+/* These functions allow control over any per-structure ENGINE data. */
+int ENGINE_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
+ CRYPTO_EX_dup *dup_func,
+ CRYPTO_EX_free *free_func);
+int ENGINE_set_ex_data(ENGINE *e, int idx, void *arg);
+void *ENGINE_get_ex_data(const ENGINE *e, int idx);
+
+/*
+ * This function cleans up anything that needs it. Eg. the ENGINE_add()
+ * function automatically ensures the list cleanup function is registered to
+ * be called from ENGINE_cleanup(). Similarly, all ENGINE_register_***
+ * functions ensure ENGINE_cleanup() will clean up after them.
+ */
+void ENGINE_cleanup(void);
+
+/*
+ * These return values from within the ENGINE structure. These can be useful
+ * with functional references as well as structural references - it depends
+ * which you obtained. Using the result for functional purposes if you only
+ * obtained a structural reference may be problematic!
+ */
+const char *ENGINE_get_id(const ENGINE *e);
+const char *ENGINE_get_name(const ENGINE *e);
+const RSA_METHOD *ENGINE_get_RSA(const ENGINE *e);
+const DSA_METHOD *ENGINE_get_DSA(const ENGINE *e);
+const ECDH_METHOD *ENGINE_get_ECDH(const ENGINE *e);
+const ECDSA_METHOD *ENGINE_get_ECDSA(const ENGINE *e);
+const DH_METHOD *ENGINE_get_DH(const ENGINE *e);
+const RAND_METHOD *ENGINE_get_RAND(const ENGINE *e);
+const STORE_METHOD *ENGINE_get_STORE(const ENGINE *e);
+ENGINE_GEN_INT_FUNC_PTR ENGINE_get_destroy_function(const ENGINE *e);
+ENGINE_GEN_INT_FUNC_PTR ENGINE_get_init_function(const ENGINE *e);
+ENGINE_GEN_INT_FUNC_PTR ENGINE_get_finish_function(const ENGINE *e);
+ENGINE_CTRL_FUNC_PTR ENGINE_get_ctrl_function(const ENGINE *e);
+ENGINE_LOAD_KEY_PTR ENGINE_get_load_privkey_function(const ENGINE *e);
+ENGINE_LOAD_KEY_PTR ENGINE_get_load_pubkey_function(const ENGINE *e);
+ENGINE_SSL_CLIENT_CERT_PTR ENGINE_get_ssl_client_cert_function(const ENGINE
+ *e);
+ENGINE_CIPHERS_PTR ENGINE_get_ciphers(const ENGINE *e);
+ENGINE_DIGESTS_PTR ENGINE_get_digests(const ENGINE *e);
+ENGINE_PKEY_METHS_PTR ENGINE_get_pkey_meths(const ENGINE *e);
+ENGINE_PKEY_ASN1_METHS_PTR ENGINE_get_pkey_asn1_meths(const ENGINE *e);
+const EVP_CIPHER *ENGINE_get_cipher(ENGINE *e, int nid);
+const EVP_MD *ENGINE_get_digest(ENGINE *e, int nid);
+const EVP_PKEY_METHOD *ENGINE_get_pkey_meth(ENGINE *e, int nid);
+const EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth(ENGINE *e, int nid);
+const EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth_str(ENGINE *e,
+ const char *str,
+ int len);
+const EVP_PKEY_ASN1_METHOD *ENGINE_pkey_asn1_find_str(ENGINE **pe,
+ const char *str,
+ int len);
+const ENGINE_CMD_DEFN *ENGINE_get_cmd_defns(const ENGINE *e);
+int ENGINE_get_flags(const ENGINE *e);
+
+/*
+ * FUNCTIONAL functions. These functions deal with ENGINE structures that
+ * have (or will) be initialised for use. Broadly speaking, the structural
+ * functions are useful for iterating the list of available engine types,
+ * creating new engine types, and other "list" operations. These functions
+ * actually deal with ENGINEs that are to be used. As such these functions
+ * can fail (if applicable) when particular engines are unavailable - eg. if
+ * a hardware accelerator is not attached or not functioning correctly. Each
+ * ENGINE has 2 reference counts; structural and functional. Every time a
+ * functional reference is obtained or released, a corresponding structural
+ * reference is automatically obtained or released too.
+ */
+
+/*
+ * Initialise a engine type for use (or up its reference count if it's
+ * already in use). This will fail if the engine is not currently operational
+ * and cannot initialise.
+ */
+int ENGINE_init(ENGINE *e);
+/*
+ * Free a functional reference to a engine type. This does not require a
+ * corresponding call to ENGINE_free as it also releases a structural
+ * reference.
+ */
+int ENGINE_finish(ENGINE *e);
+
+/*
+ * The following functions handle keys that are stored in some secondary
+ * location, handled by the engine. The storage may be on a card or
+ * whatever.
+ */
+EVP_PKEY *ENGINE_load_private_key(ENGINE *e, const char *key_id,
+ UI_METHOD *ui_method, void *callback_data);
+EVP_PKEY *ENGINE_load_public_key(ENGINE *e, const char *key_id,
+ UI_METHOD *ui_method, void *callback_data);
+int ENGINE_load_ssl_client_cert(ENGINE *e, SSL *s,
+ STACK_OF(X509_NAME) *ca_dn, X509 **pcert,
+ EVP_PKEY **ppkey, STACK_OF(X509) **pother,
+ UI_METHOD *ui_method, void *callback_data);
+
+/*
+ * This returns a pointer for the current ENGINE structure that is (by
+ * default) performing any RSA operations. The value returned is an
+ * incremented reference, so it should be free'd (ENGINE_finish) before it is
+ * discarded.
+ */
+ENGINE *ENGINE_get_default_RSA(void);
+/* Same for the other "methods" */
+ENGINE *ENGINE_get_default_DSA(void);
+ENGINE *ENGINE_get_default_ECDH(void);
+ENGINE *ENGINE_get_default_ECDSA(void);
+ENGINE *ENGINE_get_default_DH(void);
+ENGINE *ENGINE_get_default_RAND(void);
+/*
+ * These functions can be used to get a functional reference to perform
+ * ciphering or digesting corresponding to "nid".
+ */
+ENGINE *ENGINE_get_cipher_engine(int nid);
+ENGINE *ENGINE_get_digest_engine(int nid);
+ENGINE *ENGINE_get_pkey_meth_engine(int nid);
+ENGINE *ENGINE_get_pkey_asn1_meth_engine(int nid);
+
+/*
+ * This sets a new default ENGINE structure for performing RSA operations. If
+ * the result is non-zero (success) then the ENGINE structure will have had
+ * its reference count up'd so the caller should still free their own
+ * reference 'e'.
+ */
+int ENGINE_set_default_RSA(ENGINE *e);
+int ENGINE_set_default_string(ENGINE *e, const char *def_list);
+/* Same for the other "methods" */
+int ENGINE_set_default_DSA(ENGINE *e);
+int ENGINE_set_default_ECDH(ENGINE *e);
+int ENGINE_set_default_ECDSA(ENGINE *e);
+int ENGINE_set_default_DH(ENGINE *e);
+int ENGINE_set_default_RAND(ENGINE *e);
+int ENGINE_set_default_ciphers(ENGINE *e);
+int ENGINE_set_default_digests(ENGINE *e);
+int ENGINE_set_default_pkey_meths(ENGINE *e);
+int ENGINE_set_default_pkey_asn1_meths(ENGINE *e);
+
+/*
+ * The combination "set" - the flags are bitwise "OR"d from the
+ * ENGINE_METHOD_*** defines above. As with the "ENGINE_register_complete()"
+ * function, this function can result in unnecessary static linkage. If your
+ * application requires only specific functionality, consider using more
+ * selective functions.
+ */
+int ENGINE_set_default(ENGINE *e, unsigned int flags);
+
+void ENGINE_add_conf_module(void);
+
+/* Deprecated functions ... */
+/* int ENGINE_clear_defaults(void); */
+
+/**************************/
+/* DYNAMIC ENGINE SUPPORT */
+/**************************/
+
+/* Binary/behaviour compatibility levels */
+# define OSSL_DYNAMIC_VERSION (unsigned long)0x00020000
+/*
+ * Binary versions older than this are too old for us (whether we're a loader
+ * or a loadee)
+ */
+# define OSSL_DYNAMIC_OLDEST (unsigned long)0x00020000
+
+/*
+ * When compiling an ENGINE entirely as an external shared library, loadable
+ * by the "dynamic" ENGINE, these types are needed. The 'dynamic_fns'
+ * structure type provides the calling application's (or library's) error
+ * functionality and memory management function pointers to the loaded
+ * library. These should be used/set in the loaded library code so that the
+ * loading application's 'state' will be used/changed in all operations. The
+ * 'static_state' pointer allows the loaded library to know if it shares the
+ * same static data as the calling application (or library), and thus whether
+ * these callbacks need to be set or not.
+ */
+typedef void *(*dyn_MEM_malloc_cb) (size_t);
+typedef void *(*dyn_MEM_realloc_cb) (void *, size_t);
+typedef void (*dyn_MEM_free_cb) (void *);
+typedef struct st_dynamic_MEM_fns {
+ dyn_MEM_malloc_cb malloc_cb;
+ dyn_MEM_realloc_cb realloc_cb;
+ dyn_MEM_free_cb free_cb;
+} dynamic_MEM_fns;
+/*
+ * FIXME: Perhaps the memory and locking code (crypto.h) should declare and
+ * use these types so we (and any other dependant code) can simplify a bit??
+ */
+typedef void (*dyn_lock_locking_cb) (int, int, const char *, int);
+typedef int (*dyn_lock_add_lock_cb) (int *, int, int, const char *, int);
+typedef struct CRYPTO_dynlock_value *(*dyn_dynlock_create_cb) (const char *,
+ int);
+typedef void (*dyn_dynlock_lock_cb) (int, struct CRYPTO_dynlock_value *,
+ const char *, int);
+typedef void (*dyn_dynlock_destroy_cb) (struct CRYPTO_dynlock_value *,
+ const char *, int);
+typedef struct st_dynamic_LOCK_fns {
+ dyn_lock_locking_cb lock_locking_cb;
+ dyn_lock_add_lock_cb lock_add_lock_cb;
+ dyn_dynlock_create_cb dynlock_create_cb;
+ dyn_dynlock_lock_cb dynlock_lock_cb;
+ dyn_dynlock_destroy_cb dynlock_destroy_cb;
+} dynamic_LOCK_fns;
+/* The top-level structure */
+typedef struct st_dynamic_fns {
+ void *static_state;
+ const ERR_FNS *err_fns;
+ const CRYPTO_EX_DATA_IMPL *ex_data_fns;
+ dynamic_MEM_fns mem_fns;
+ dynamic_LOCK_fns lock_fns;
+} dynamic_fns;
+
+/*
+ * The version checking function should be of this prototype. NB: The
+ * ossl_version value passed in is the OSSL_DYNAMIC_VERSION of the loading
+ * code. If this function returns zero, it indicates a (potential) version
+ * incompatibility and the loaded library doesn't believe it can proceed.
+ * Otherwise, the returned value is the (latest) version supported by the
+ * loading library. The loader may still decide that the loaded code's
+ * version is unsatisfactory and could veto the load. The function is
+ * expected to be implemented with the symbol name "v_check", and a default
+ * implementation can be fully instantiated with
+ * IMPLEMENT_DYNAMIC_CHECK_FN().
+ */
+typedef unsigned long (*dynamic_v_check_fn) (unsigned long ossl_version);
+# define IMPLEMENT_DYNAMIC_CHECK_FN() \
+ OPENSSL_EXPORT unsigned long v_check(unsigned long v); \
+ OPENSSL_EXPORT unsigned long v_check(unsigned long v) { \
+ if(v >= OSSL_DYNAMIC_OLDEST) return OSSL_DYNAMIC_VERSION; \
+ return 0; }
+
+/*
+ * This function is passed the ENGINE structure to initialise with its own
+ * function and command settings. It should not adjust the structural or
+ * functional reference counts. If this function returns zero, (a) the load
+ * will be aborted, (b) the previous ENGINE state will be memcpy'd back onto
+ * the structure, and (c) the shared library will be unloaded. So
+ * implementations should do their own internal cleanup in failure
+ * circumstances otherwise they could leak. The 'id' parameter, if non-NULL,
+ * represents the ENGINE id that the loader is looking for. If this is NULL,
+ * the shared library can choose to return failure or to initialise a
+ * 'default' ENGINE. If non-NULL, the shared library must initialise only an
+ * ENGINE matching the passed 'id'. The function is expected to be
+ * implemented with the symbol name "bind_engine". A standard implementation
+ * can be instantiated with IMPLEMENT_DYNAMIC_BIND_FN(fn) where the parameter
+ * 'fn' is a callback function that populates the ENGINE structure and
+ * returns an int value (zero for failure). 'fn' should have prototype;
+ * [static] int fn(ENGINE *e, const char *id);
+ */
+typedef int (*dynamic_bind_engine) (ENGINE *e, const char *id,
+ const dynamic_fns *fns);
+# define IMPLEMENT_DYNAMIC_BIND_FN(fn) \
+ OPENSSL_EXPORT \
+ int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns); \
+ OPENSSL_EXPORT \
+ int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns) { \
+ if(ENGINE_get_static_state() == fns->static_state) goto skip_cbs; \
+ if(!CRYPTO_set_mem_functions(fns->mem_fns.malloc_cb, \
+ fns->mem_fns.realloc_cb, fns->mem_fns.free_cb)) \
+ return 0; \
+ CRYPTO_set_locking_callback(fns->lock_fns.lock_locking_cb); \
+ CRYPTO_set_add_lock_callback(fns->lock_fns.lock_add_lock_cb); \
+ CRYPTO_set_dynlock_create_callback(fns->lock_fns.dynlock_create_cb); \
+ CRYPTO_set_dynlock_lock_callback(fns->lock_fns.dynlock_lock_cb); \
+ CRYPTO_set_dynlock_destroy_callback(fns->lock_fns.dynlock_destroy_cb); \
+ if(!CRYPTO_set_ex_data_implementation(fns->ex_data_fns)) \
+ return 0; \
+ if(!ERR_set_implementation(fns->err_fns)) return 0; \
+ skip_cbs: \
+ if(!fn(e,id)) return 0; \
+ return 1; }
+
+/*
+ * If the loading application (or library) and the loaded ENGINE library
+ * share the same static data (eg. they're both dynamically linked to the
+ * same libcrypto.so) we need a way to avoid trying to set system callbacks -
+ * this would fail, and for the same reason that it's unnecessary to try. If
+ * the loaded ENGINE has (or gets from through the loader) its own copy of
+ * the libcrypto static data, we will need to set the callbacks. The easiest
+ * way to detect this is to have a function that returns a pointer to some
+ * static data and let the loading application and loaded ENGINE compare
+ * their respective values.
+ */
+void *ENGINE_get_static_state(void);
+
+# if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(HAVE_CRYPTODEV)
+void ENGINE_setup_bsd_cryptodev(void);
+# endif
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_ENGINE_strings(void);
+
+/* Error codes for the ENGINE functions. */
+
+/* Function codes. */
+# define ENGINE_F_DYNAMIC_CTRL 180
+# define ENGINE_F_DYNAMIC_GET_DATA_CTX 181
+# define ENGINE_F_DYNAMIC_LOAD 182
+# define ENGINE_F_DYNAMIC_SET_DATA_CTX 183
+# define ENGINE_F_ENGINE_ADD 105
+# define ENGINE_F_ENGINE_BY_ID 106
+# define ENGINE_F_ENGINE_CMD_IS_EXECUTABLE 170
+# define ENGINE_F_ENGINE_CTRL 142
+# define ENGINE_F_ENGINE_CTRL_CMD 178
+# define ENGINE_F_ENGINE_CTRL_CMD_STRING 171
+# define ENGINE_F_ENGINE_FINISH 107
+# define ENGINE_F_ENGINE_FREE_UTIL 108
+# define ENGINE_F_ENGINE_GET_CIPHER 185
+# define ENGINE_F_ENGINE_GET_DEFAULT_TYPE 177
+# define ENGINE_F_ENGINE_GET_DIGEST 186
+# define ENGINE_F_ENGINE_GET_NEXT 115
+# define ENGINE_F_ENGINE_GET_PKEY_ASN1_METH 193
+# define ENGINE_F_ENGINE_GET_PKEY_METH 192
+# define ENGINE_F_ENGINE_GET_PREV 116
+# define ENGINE_F_ENGINE_INIT 119
+# define ENGINE_F_ENGINE_LIST_ADD 120
+# define ENGINE_F_ENGINE_LIST_REMOVE 121
+# define ENGINE_F_ENGINE_LOAD_PRIVATE_KEY 150
+# define ENGINE_F_ENGINE_LOAD_PUBLIC_KEY 151
+# define ENGINE_F_ENGINE_LOAD_SSL_CLIENT_CERT 194
+# define ENGINE_F_ENGINE_NEW 122
+# define ENGINE_F_ENGINE_REMOVE 123
+# define ENGINE_F_ENGINE_SET_DEFAULT_STRING 189
+# define ENGINE_F_ENGINE_SET_DEFAULT_TYPE 126
+# define ENGINE_F_ENGINE_SET_ID 129
+# define ENGINE_F_ENGINE_SET_NAME 130
+# define ENGINE_F_ENGINE_TABLE_REGISTER 184
+# define ENGINE_F_ENGINE_UNLOAD_KEY 152
+# define ENGINE_F_ENGINE_UNLOCKED_FINISH 191
+# define ENGINE_F_ENGINE_UP_REF 190
+# define ENGINE_F_INT_CTRL_HELPER 172
+# define ENGINE_F_INT_ENGINE_CONFIGURE 188
+# define ENGINE_F_INT_ENGINE_MODULE_INIT 187
+# define ENGINE_F_LOG_MESSAGE 141
+
+/* Reason codes. */
+# define ENGINE_R_ALREADY_LOADED 100
+# define ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER 133
+# define ENGINE_R_CMD_NOT_EXECUTABLE 134
+# define ENGINE_R_COMMAND_TAKES_INPUT 135
+# define ENGINE_R_COMMAND_TAKES_NO_INPUT 136
+# define ENGINE_R_CONFLICTING_ENGINE_ID 103
+# define ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED 119
+# define ENGINE_R_DH_NOT_IMPLEMENTED 139
+# define ENGINE_R_DSA_NOT_IMPLEMENTED 140
+# define ENGINE_R_DSO_FAILURE 104
+# define ENGINE_R_DSO_NOT_FOUND 132
+# define ENGINE_R_ENGINES_SECTION_ERROR 148
+# define ENGINE_R_ENGINE_CONFIGURATION_ERROR 102
+# define ENGINE_R_ENGINE_IS_NOT_IN_LIST 105
+# define ENGINE_R_ENGINE_SECTION_ERROR 149
+# define ENGINE_R_FAILED_LOADING_PRIVATE_KEY 128
+# define ENGINE_R_FAILED_LOADING_PUBLIC_KEY 129
+# define ENGINE_R_FINISH_FAILED 106
+# define ENGINE_R_GET_HANDLE_FAILED 107
+# define ENGINE_R_ID_OR_NAME_MISSING 108
+# define ENGINE_R_INIT_FAILED 109
+# define ENGINE_R_INTERNAL_LIST_ERROR 110
+# define ENGINE_R_INVALID_ARGUMENT 143
+# define ENGINE_R_INVALID_CMD_NAME 137
+# define ENGINE_R_INVALID_CMD_NUMBER 138
+# define ENGINE_R_INVALID_INIT_VALUE 151
+# define ENGINE_R_INVALID_STRING 150
+# define ENGINE_R_NOT_INITIALISED 117
+# define ENGINE_R_NOT_LOADED 112
+# define ENGINE_R_NO_CONTROL_FUNCTION 120
+# define ENGINE_R_NO_INDEX 144
+# define ENGINE_R_NO_LOAD_FUNCTION 125
+# define ENGINE_R_NO_REFERENCE 130
+# define ENGINE_R_NO_SUCH_ENGINE 116
+# define ENGINE_R_NO_UNLOAD_FUNCTION 126
+# define ENGINE_R_PROVIDE_PARAMETERS 113
+# define ENGINE_R_RSA_NOT_IMPLEMENTED 141
+# define ENGINE_R_UNIMPLEMENTED_CIPHER 146
+# define ENGINE_R_UNIMPLEMENTED_DIGEST 147
+# define ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD 101
+# define ENGINE_R_VERSION_INCOMPATIBILITY 145
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/deps/openssl/openssl/include/openssl/err.h b/deps/openssl/openssl/include/openssl/err.h
index caf89a936cd..585aa8ba3df 100644
--- a/deps/openssl/openssl/include/openssl/err.h
+++ b/deps/openssl/openssl/include/openssl/err.h
@@ -1 +1,389 @@
-#include "../../crypto/err/err.h"
+/* crypto/err/err.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+/* ====================================================================
+ * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+#ifndef HEADER_ERR_H
+# define HEADER_ERR_H
+
+# include <openssl/e_os2.h>
+
+# ifndef OPENSSL_NO_FP_API
+# include <stdio.h>
+# include <stdlib.h>
+# endif
+
+# include <openssl/ossl_typ.h>
+# ifndef OPENSSL_NO_BIO
+# include <openssl/bio.h>
+# endif
+# ifndef OPENSSL_NO_LHASH
+# include <openssl/lhash.h>
+# endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# ifndef OPENSSL_NO_ERR
+# define ERR_PUT_error(a,b,c,d,e) ERR_put_error(a,b,c,d,e)
+# else
+# define ERR_PUT_error(a,b,c,d,e) ERR_put_error(a,b,c,NULL,0)
+# endif
+
+# include <errno.h>
+
+# define ERR_TXT_MALLOCED 0x01
+# define ERR_TXT_STRING 0x02
+
+# define ERR_FLAG_MARK 0x01
+
+# define ERR_NUM_ERRORS 16
+typedef struct err_state_st {
+ CRYPTO_THREADID tid;
+ int err_flags[ERR_NUM_ERRORS];
+ unsigned long err_buffer[ERR_NUM_ERRORS];
+ char *err_data[ERR_NUM_ERRORS];
+ int err_data_flags[ERR_NUM_ERRORS];
+ const char *err_file[ERR_NUM_ERRORS];
+ int err_line[ERR_NUM_ERRORS];
+ int top, bottom;
+} ERR_STATE;
+
+/* library */
+# define ERR_LIB_NONE 1
+# define ERR_LIB_SYS 2
+# define ERR_LIB_BN 3
+# define ERR_LIB_RSA 4
+# define ERR_LIB_DH 5
+# define ERR_LIB_EVP 6
+# define ERR_LIB_BUF 7
+# define ERR_LIB_OBJ 8
+# define ERR_LIB_PEM 9
+# define ERR_LIB_DSA 10
+# define ERR_LIB_X509 11
+/* #define ERR_LIB_METH 12 */
+# define ERR_LIB_ASN1 13
+# define ERR_LIB_CONF 14
+# define ERR_LIB_CRYPTO 15
+# define ERR_LIB_EC 16
+# define ERR_LIB_SSL 20
+/* #define ERR_LIB_SSL23 21 */
+/* #define ERR_LIB_SSL2 22 */
+/* #define ERR_LIB_SSL3 23 */
+/* #define ERR_LIB_RSAREF 30 */
+/* #define ERR_LIB_PROXY 31 */
+# define ERR_LIB_BIO 32
+# define ERR_LIB_PKCS7 33
+# define ERR_LIB_X509V3 34
+# define ERR_LIB_PKCS12 35
+# define ERR_LIB_RAND 36
+# define ERR_LIB_DSO 37
+# define ERR_LIB_ENGINE 38
+# define ERR_LIB_OCSP 39
+# define ERR_LIB_UI 40
+# define ERR_LIB_COMP 41
+# define ERR_LIB_ECDSA 42
+# define ERR_LIB_ECDH 43
+# define ERR_LIB_STORE 44
+# define ERR_LIB_FIPS 45
+# define ERR_LIB_CMS 46
+# define ERR_LIB_TS 47
+# define ERR_LIB_HMAC 48
+# define ERR_LIB_JPAKE 49
+
+# define ERR_LIB_USER 128
+
+# define SYSerr(f,r) ERR_PUT_error(ERR_LIB_SYS,(f),(r),__FILE__,__LINE__)
+# define BNerr(f,r) ERR_PUT_error(ERR_LIB_BN,(f),(r),__FILE__,__LINE__)
+# define RSAerr(f,r) ERR_PUT_error(ERR_LIB_RSA,(f),(r),__FILE__,__LINE__)
+# define DHerr(f,r) ERR_PUT_error(ERR_LIB_DH,(f),(r),__FILE__,__LINE__)
+# define EVPerr(f,r) ERR_PUT_error(ERR_LIB_EVP,(f),(r),__FILE__,__LINE__)
+# define BUFerr(f,r) ERR_PUT_error(ERR_LIB_BUF,(f),(r),__FILE__,__LINE__)
+# define OBJerr(f,r) ERR_PUT_error(ERR_LIB_OBJ,(f),(r),__FILE__,__LINE__)
+# define PEMerr(f,r) ERR_PUT_error(ERR_LIB_PEM,(f),(r),__FILE__,__LINE__)
+# define DSAerr(f,r) ERR_PUT_error(ERR_LIB_DSA,(f),(r),__FILE__,__LINE__)
+# define X509err(f,r) ERR_PUT_error(ERR_LIB_X509,(f),(r),__FILE__,__LINE__)
+# define ASN1err(f,r) ERR_PUT_error(ERR_LIB_ASN1,(f),(r),__FILE__,__LINE__)
+# define CONFerr(f,r) ERR_PUT_error(ERR_LIB_CONF,(f),(r),__FILE__,__LINE__)
+# define CRYPTOerr(f,r) ERR_PUT_error(ERR_LIB_CRYPTO,(f),(r),__FILE__,__LINE__)
+# define ECerr(f,r) ERR_PUT_error(ERR_LIB_EC,(f),(r),__FILE__,__LINE__)
+# define SSLerr(f,r) ERR_PUT_error(ERR_LIB_SSL,(f),(r),__FILE__,__LINE__)
+# define BIOerr(f,r) ERR_PUT_error(ERR_LIB_BIO,(f),(r),__FILE__,__LINE__)
+# define PKCS7err(f,r) ERR_PUT_error(ERR_LIB_PKCS7,(f),(r),__FILE__,__LINE__)
+# define X509V3err(f,r) ERR_PUT_error(ERR_LIB_X509V3,(f),(r),__FILE__,__LINE__)
+# define PKCS12err(f,r) ERR_PUT_error(ERR_LIB_PKCS12,(f),(r),__FILE__,__LINE__)
+# define RANDerr(f,r) ERR_PUT_error(ERR_LIB_RAND,(f),(r),__FILE__,__LINE__)
+# define DSOerr(f,r) ERR_PUT_error(ERR_LIB_DSO,(f),(r),__FILE__,__LINE__)
+# define ENGINEerr(f,r) ERR_PUT_error(ERR_LIB_ENGINE,(f),(r),__FILE__,__LINE__)
+# define OCSPerr(f,r) ERR_PUT_error(ERR_LIB_OCSP,(f),(r),__FILE__,__LINE__)
+# define UIerr(f,r) ERR_PUT_error(ERR_LIB_UI,(f),(r),__FILE__,__LINE__)
+# define COMPerr(f,r) ERR_PUT_error(ERR_LIB_COMP,(f),(r),__FILE__,__LINE__)
+# define ECDSAerr(f,r) ERR_PUT_error(ERR_LIB_ECDSA,(f),(r),__FILE__,__LINE__)
+# define ECDHerr(f,r) ERR_PUT_error(ERR_LIB_ECDH,(f),(r),__FILE__,__LINE__)
+# define STOREerr(f,r) ERR_PUT_error(ERR_LIB_STORE,(f),(r),__FILE__,__LINE__)
+# define FIPSerr(f,r) ERR_PUT_error(ERR_LIB_FIPS,(f),(r),__FILE__,__LINE__)
+# define CMSerr(f,r) ERR_PUT_error(ERR_LIB_CMS,(f),(r),__FILE__,__LINE__)
+# define TSerr(f,r) ERR_PUT_error(ERR_LIB_TS,(f),(r),__FILE__,__LINE__)
+# define HMACerr(f,r) ERR_PUT_error(ERR_LIB_HMAC,(f),(r),__FILE__,__LINE__)
+# define JPAKEerr(f,r) ERR_PUT_error(ERR_LIB_JPAKE,(f),(r),__FILE__,__LINE__)
+
+/*
+ * Borland C seems too stupid to be able to shift and do longs in the
+ * pre-processor :-(
+ */
+# define ERR_PACK(l,f,r) (((((unsigned long)l)&0xffL)*0x1000000)| \
+ ((((unsigned long)f)&0xfffL)*0x1000)| \
+ ((((unsigned long)r)&0xfffL)))
+# define ERR_GET_LIB(l) (int)((((unsigned long)l)>>24L)&0xffL)
+# define ERR_GET_FUNC(l) (int)((((unsigned long)l)>>12L)&0xfffL)
+# define ERR_GET_REASON(l) (int)((l)&0xfffL)
+# define ERR_FATAL_ERROR(l) (int)((l)&ERR_R_FATAL)
+
+/* OS functions */
+# define SYS_F_FOPEN 1
+# define SYS_F_CONNECT 2
+# define SYS_F_GETSERVBYNAME 3
+# define SYS_F_SOCKET 4
+# define SYS_F_IOCTLSOCKET 5
+# define SYS_F_BIND 6
+# define SYS_F_LISTEN 7
+# define SYS_F_ACCEPT 8
+# define SYS_F_WSASTARTUP 9/* Winsock stuff */
+# define SYS_F_OPENDIR 10
+# define SYS_F_FREAD 11
+
+/* reasons */
+# define ERR_R_SYS_LIB ERR_LIB_SYS/* 2 */
+# define ERR_R_BN_LIB ERR_LIB_BN/* 3 */
+# define ERR_R_RSA_LIB ERR_LIB_RSA/* 4 */
+# define ERR_R_DH_LIB ERR_LIB_DH/* 5 */
+# define ERR_R_EVP_LIB ERR_LIB_EVP/* 6 */
+# define ERR_R_BUF_LIB ERR_LIB_BUF/* 7 */
+# define ERR_R_OBJ_LIB ERR_LIB_OBJ/* 8 */
+# define ERR_R_PEM_LIB ERR_LIB_PEM/* 9 */
+# define ERR_R_DSA_LIB ERR_LIB_DSA/* 10 */
+# define ERR_R_X509_LIB ERR_LIB_X509/* 11 */
+# define ERR_R_ASN1_LIB ERR_LIB_ASN1/* 13 */
+# define ERR_R_CONF_LIB ERR_LIB_CONF/* 14 */
+# define ERR_R_CRYPTO_LIB ERR_LIB_CRYPTO/* 15 */
+# define ERR_R_EC_LIB ERR_LIB_EC/* 16 */
+# define ERR_R_SSL_LIB ERR_LIB_SSL/* 20 */
+# define ERR_R_BIO_LIB ERR_LIB_BIO/* 32 */
+# define ERR_R_PKCS7_LIB ERR_LIB_PKCS7/* 33 */
+# define ERR_R_X509V3_LIB ERR_LIB_X509V3/* 34 */
+# define ERR_R_PKCS12_LIB ERR_LIB_PKCS12/* 35 */
+# define ERR_R_RAND_LIB ERR_LIB_RAND/* 36 */
+# define ERR_R_DSO_LIB ERR_LIB_DSO/* 37 */
+# define ERR_R_ENGINE_LIB ERR_LIB_ENGINE/* 38 */
+# define ERR_R_OCSP_LIB ERR_LIB_OCSP/* 39 */
+# define ERR_R_UI_LIB ERR_LIB_UI/* 40 */
+# define ERR_R_COMP_LIB ERR_LIB_COMP/* 41 */
+# define ERR_R_ECDSA_LIB ERR_LIB_ECDSA/* 42 */
+# define ERR_R_ECDH_LIB ERR_LIB_ECDH/* 43 */
+# define ERR_R_STORE_LIB ERR_LIB_STORE/* 44 */
+# define ERR_R_TS_LIB ERR_LIB_TS/* 45 */
+
+# define ERR_R_NESTED_ASN1_ERROR 58
+# define ERR_R_BAD_ASN1_OBJECT_HEADER 59
+# define ERR_R_BAD_GET_ASN1_OBJECT_CALL 60
+# define ERR_R_EXPECTING_AN_ASN1_SEQUENCE 61
+# define ERR_R_ASN1_LENGTH_MISMATCH 62
+# define ERR_R_MISSING_ASN1_EOS 63
+
+/* fatal error */
+# define ERR_R_FATAL 64
+# define ERR_R_MALLOC_FAILURE (1|ERR_R_FATAL)
+# define ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED (2|ERR_R_FATAL)
+# define ERR_R_PASSED_NULL_PARAMETER (3|ERR_R_FATAL)
+# define ERR_R_INTERNAL_ERROR (4|ERR_R_FATAL)
+# define ERR_R_DISABLED (5|ERR_R_FATAL)
+
+/*
+ * 99 is the maximum possible ERR_R_... code, higher values are reserved for
+ * the individual libraries
+ */
+
+typedef struct ERR_string_data_st {
+ unsigned long error;
+ const char *string;
+} ERR_STRING_DATA;
+
+void ERR_put_error(int lib, int func, int reason, const char *file, int line);
+void ERR_set_error_data(char *data, int flags);
+
+unsigned long ERR_get_error(void);
+unsigned long ERR_get_error_line(const char **file, int *line);
+unsigned long ERR_get_error_line_data(const char **file, int *line,
+ const char **data, int *flags);
+unsigned long ERR_peek_error(void);
+unsigned long ERR_peek_error_line(const char **file, int *line);
+unsigned long ERR_peek_error_line_data(const char **file, int *line,
+ const char **data, int *flags);
+unsigned long ERR_peek_last_error(void);
+unsigned long ERR_peek_last_error_line(const char **file, int *line);
+unsigned long ERR_peek_last_error_line_data(const char **file, int *line,
+ const char **data, int *flags);
+void ERR_clear_error(void);
+char *ERR_error_string(unsigned long e, char *buf);
+void ERR_error_string_n(unsigned long e, char *buf, size_t len);
+const char *ERR_lib_error_string(unsigned long e);
+const char *ERR_func_error_string(unsigned long e);
+const char *ERR_reason_error_string(unsigned long e);
+void ERR_print_errors_cb(int (*cb) (const char *str, size_t len, void *u),
+ void *u);
+# ifndef OPENSSL_NO_FP_API
+void ERR_print_errors_fp(FILE *fp);
+# endif
+# ifndef OPENSSL_NO_BIO
+void ERR_print_errors(BIO *bp);
+# endif
+void ERR_add_error_data(int num, ...);
+void ERR_add_error_vdata(int num, va_list args);
+void ERR_load_strings(int lib, ERR_STRING_DATA str[]);
+void ERR_unload_strings(int lib, ERR_STRING_DATA str[]);
+void ERR_load_ERR_strings(void);
+void ERR_load_crypto_strings(void);
+void ERR_free_strings(void);
+
+void ERR_remove_thread_state(const CRYPTO_THREADID *tid);
+# ifndef OPENSSL_NO_DEPRECATED
+void ERR_remove_state(unsigned long pid); /* if zero we look it up */
+# endif
+ERR_STATE *ERR_get_state(void);
+
+# ifndef OPENSSL_NO_LHASH
+LHASH_OF(ERR_STRING_DATA) *ERR_get_string_table(void);
+LHASH_OF(ERR_STATE) *ERR_get_err_state_table(void);
+void ERR_release_err_state_table(LHASH_OF(ERR_STATE) **hash);
+# endif
+
+int ERR_get_next_error_library(void);
+
+int ERR_set_mark(void);
+int ERR_pop_to_mark(void);
+
+/* Already defined in ossl_typ.h */
+/* typedef struct st_ERR_FNS ERR_FNS; */
+/*
+ * An application can use this function and provide the return value to
+ * loaded modules that should use the application's ERR state/functionality
+ */
+const ERR_FNS *ERR_get_implementation(void);
+/*
+ * A loaded module should call this function prior to any ERR operations
+ * using the application's "ERR_FNS".
+ */
+int ERR_set_implementation(const ERR_FNS *fns);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/deps/openssl/openssl/include/openssl/evp.h b/deps/openssl/openssl/include/openssl/evp.h
index dd7bcda8f3c..39ab7937d25 100644
--- a/deps/openssl/openssl/include/openssl/evp.h
+++ b/deps/openssl/openssl/include/openssl/evp.h
@@ -1 +1,1534 @@
-#include "../../crypto/evp/evp.h"
+/* crypto/evp/evp.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_ENVELOPE_H
+# define HEADER_ENVELOPE_H
+
+# ifdef OPENSSL_ALGORITHM_DEFINES
+# include <openssl/opensslconf.h>
+# else
+# define OPENSSL_ALGORITHM_DEFINES
+# include <openssl/opensslconf.h>
+# undef OPENSSL_ALGORITHM_DEFINES
+# endif
+
+# include <openssl/ossl_typ.h>
+
+# include <openssl/symhacks.h>
+
+# ifndef OPENSSL_NO_BIO
+# include <openssl/bio.h>
+# endif
+
+/*-
+#define EVP_RC2_KEY_SIZE 16
+#define EVP_RC4_KEY_SIZE 16
+#define EVP_BLOWFISH_KEY_SIZE 16
+#define EVP_CAST5_KEY_SIZE 16
+#define EVP_RC5_32_12_16_KEY_SIZE 16
+*/
+# define EVP_MAX_MD_SIZE 64/* longest known is SHA512 */
+# define EVP_MAX_KEY_LENGTH 64
+# define EVP_MAX_IV_LENGTH 16
+# define EVP_MAX_BLOCK_LENGTH 32
+
+# define PKCS5_SALT_LEN 8
+/* Default PKCS#5 iteration count */
+# define PKCS5_DEFAULT_ITER 2048
+
+# include <openssl/objects.h>
+
+# define EVP_PK_RSA 0x0001
+# define EVP_PK_DSA 0x0002
+# define EVP_PK_DH 0x0004
+# define EVP_PK_EC 0x0008
+# define EVP_PKT_SIGN 0x0010
+# define EVP_PKT_ENC 0x0020
+# define EVP_PKT_EXCH 0x0040
+# define EVP_PKS_RSA 0x0100
+# define EVP_PKS_DSA 0x0200
+# define EVP_PKS_EC 0x0400
+
+# define EVP_PKEY_NONE NID_undef
+# define EVP_PKEY_RSA NID_rsaEncryption
+# define EVP_PKEY_RSA2 NID_rsa
+# define EVP_PKEY_DSA NID_dsa
+# define EVP_PKEY_DSA1 NID_dsa_2
+# define EVP_PKEY_DSA2 NID_dsaWithSHA
+# define EVP_PKEY_DSA3 NID_dsaWithSHA1
+# define EVP_PKEY_DSA4 NID_dsaWithSHA1_2
+# define EVP_PKEY_DH NID_dhKeyAgreement
+# define EVP_PKEY_DHX NID_dhpublicnumber
+# define EVP_PKEY_EC NID_X9_62_id_ecPublicKey
+# define EVP_PKEY_HMAC NID_hmac
+# define EVP_PKEY_CMAC NID_cmac
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Type needs to be a bit field Sub-type needs to be for variations on the
+ * method, as in, can it do arbitrary encryption....
+ */
+struct evp_pkey_st {
+ int type;
+ int save_type;
+ int references;
+ const EVP_PKEY_ASN1_METHOD *ameth;
+ ENGINE *engine;
+ union {
+ char *ptr;
+# ifndef OPENSSL_NO_RSA
+ struct rsa_st *rsa; /* RSA */
+# endif
+# ifndef OPENSSL_NO_DSA
+ struct dsa_st *dsa; /* DSA */
+# endif
+# ifndef OPENSSL_NO_DH
+ struct dh_st *dh; /* DH */
+# endif
+# ifndef OPENSSL_NO_EC
+ struct ec_key_st *ec; /* ECC */
+# endif
+ } pkey;
+ int save_parameters;
+ STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */
+} /* EVP_PKEY */ ;
+
+# define EVP_PKEY_MO_SIGN 0x0001
+# define EVP_PKEY_MO_VERIFY 0x0002
+# define EVP_PKEY_MO_ENCRYPT 0x0004
+# define EVP_PKEY_MO_DECRYPT 0x0008
+
+# ifndef EVP_MD
+struct env_md_st {
+ int type;
+ int pkey_type;
+ int md_size;
+ unsigned long flags;
+ int (*init) (EVP_MD_CTX *ctx);
+ int (*update) (EVP_MD_CTX *ctx, const void *data, size_t count);
+ int (*final) (EVP_MD_CTX *ctx, unsigned char *md);
+ int (*copy) (EVP_MD_CTX *to, const EVP_MD_CTX *from);
+ int (*cleanup) (EVP_MD_CTX *ctx);
+ /* FIXME: prototype these some day */
+ int (*sign) (int type, const unsigned char *m, unsigned int m_length,
+ unsigned char *sigret, unsigned int *siglen, void *key);
+ int (*verify) (int type, const unsigned char *m, unsigned int m_length,
+ const unsigned char *sigbuf, unsigned int siglen,
+ void *key);
+ int required_pkey_type[5]; /* EVP_PKEY_xxx */
+ int block_size;
+ int ctx_size; /* how big does the ctx->md_data need to be */
+ /* control function */
+ int (*md_ctrl) (EVP_MD_CTX *ctx, int cmd, int p1, void *p2);
+} /* EVP_MD */ ;
+
+typedef int evp_sign_method(int type, const unsigned char *m,
+ unsigned int m_length, unsigned char *sigret,
+ unsigned int *siglen, void *key);
+typedef int evp_verify_method(int type, const unsigned char *m,
+ unsigned int m_length,
+ const unsigned char *sigbuf,
+ unsigned int siglen, void *key);
+
+/* digest can only handle a single block */
+# define EVP_MD_FLAG_ONESHOT 0x0001
+
+/*
+ * digest is a "clone" digest used
+ * which is a copy of an existing
+ * one for a specific public key type.
+ * EVP_dss1() etc
+ */
+# define EVP_MD_FLAG_PKEY_DIGEST 0x0002
+
+/* Digest uses EVP_PKEY_METHOD for signing instead of MD specific signing */
+
+# define EVP_MD_FLAG_PKEY_METHOD_SIGNATURE 0x0004
+
+/* DigestAlgorithmIdentifier flags... */
+
+# define EVP_MD_FLAG_DIGALGID_MASK 0x0018
+
+/* NULL or absent parameter accepted. Use NULL */
+
+# define EVP_MD_FLAG_DIGALGID_NULL 0x0000
+
+/* NULL or absent parameter accepted. Use NULL for PKCS#1 otherwise absent */
+
+# define EVP_MD_FLAG_DIGALGID_ABSENT 0x0008
+
+/* Custom handling via ctrl */
+
+# define EVP_MD_FLAG_DIGALGID_CUSTOM 0x0018
+
+/* Note if suitable for use in FIPS mode */
+# define EVP_MD_FLAG_FIPS 0x0400
+
+/* Digest ctrls */
+
+# define EVP_MD_CTRL_DIGALGID 0x1
+# define EVP_MD_CTRL_MICALG 0x2
+
+/* Minimum Algorithm specific ctrl value */
+
+# define EVP_MD_CTRL_ALG_CTRL 0x1000
+
+# define EVP_PKEY_NULL_method NULL,NULL,{0,0,0,0}
+
+# ifndef OPENSSL_NO_DSA
+# define EVP_PKEY_DSA_method (evp_sign_method *)DSA_sign, \
+ (evp_verify_method *)DSA_verify, \
+ {EVP_PKEY_DSA,EVP_PKEY_DSA2,EVP_PKEY_DSA3, \
+ EVP_PKEY_DSA4,0}
+# else
+# define EVP_PKEY_DSA_method EVP_PKEY_NULL_method
+# endif
+
+# ifndef OPENSSL_NO_ECDSA
+# define EVP_PKEY_ECDSA_method (evp_sign_method *)ECDSA_sign, \
+ (evp_verify_method *)ECDSA_verify, \
+ {EVP_PKEY_EC,0,0,0}
+# else
+# define EVP_PKEY_ECDSA_method EVP_PKEY_NULL_method
+# endif
+
+# ifndef OPENSSL_NO_RSA
+# define EVP_PKEY_RSA_method (evp_sign_method *)RSA_sign, \
+ (evp_verify_method *)RSA_verify, \
+ {EVP_PKEY_RSA,EVP_PKEY_RSA2,0,0}
+# define EVP_PKEY_RSA_ASN1_OCTET_STRING_method \
+ (evp_sign_method *)RSA_sign_ASN1_OCTET_STRING, \
+ (evp_verify_method *)RSA_verify_ASN1_OCTET_STRING, \
+ {EVP_PKEY_RSA,EVP_PKEY_RSA2,0,0}
+# else
+# define EVP_PKEY_RSA_method EVP_PKEY_NULL_method
+# define EVP_PKEY_RSA_ASN1_OCTET_STRING_method EVP_PKEY_NULL_method
+# endif
+
+# endif /* !EVP_MD */
+
+struct env_md_ctx_st {
+ const EVP_MD *digest;
+ ENGINE *engine; /* functional reference if 'digest' is
+ * ENGINE-provided */
+ unsigned long flags;
+ void *md_data;
+ /* Public key context for sign/verify */
+ EVP_PKEY_CTX *pctx;
+ /* Update function: usually copied from EVP_MD */
+ int (*update) (EVP_MD_CTX *ctx, const void *data, size_t count);
+} /* EVP_MD_CTX */ ;
+
+/* values for EVP_MD_CTX flags */
+
+# define EVP_MD_CTX_FLAG_ONESHOT 0x0001/* digest update will be
+ * called once only */
+# define EVP_MD_CTX_FLAG_CLEANED 0x0002/* context has already been
+ * cleaned */
+# define EVP_MD_CTX_FLAG_REUSE 0x0004/* Don't free up ctx->md_data
+ * in EVP_MD_CTX_cleanup */
+/*
+ * FIPS and pad options are ignored in 1.0.0, definitions are here so we
+ * don't accidentally reuse the values for other purposes.
+ */
+
+# define EVP_MD_CTX_FLAG_NON_FIPS_ALLOW 0x0008/* Allow use of non FIPS
+ * digest in FIPS mode */
+
+/*
+ * The following PAD options are also currently ignored in 1.0.0, digest
+ * parameters are handled through EVP_DigestSign*() and EVP_DigestVerify*()
+ * instead.
+ */
+# define EVP_MD_CTX_FLAG_PAD_MASK 0xF0/* RSA mode to use */
+# define EVP_MD_CTX_FLAG_PAD_PKCS1 0x00/* PKCS#1 v1.5 mode */
+# define EVP_MD_CTX_FLAG_PAD_X931 0x10/* X9.31 mode */
+# define EVP_MD_CTX_FLAG_PAD_PSS 0x20/* PSS mode */
+
+# define EVP_MD_CTX_FLAG_NO_INIT 0x0100/* Don't initialize md_data */
+
+struct evp_cipher_st {
+ int nid;
+ int block_size;
+ /* Default value for variable length ciphers */
+ int key_len;
+ int iv_len;
+ /* Various flags */
+ unsigned long flags;
+ /* init key */
+ int (*init) (EVP_CIPHER_CTX *ctx, const unsigned char *key,
+ const unsigned char *iv, int enc);
+ /* encrypt/decrypt data */
+ int (*do_cipher) (EVP_CIPHER_CTX *ctx, unsigned char *out,
+ const unsigned char *in, size_t inl);
+ /* cleanup ctx */
+ int (*cleanup) (EVP_CIPHER_CTX *);
+ /* how big ctx->cipher_data needs to be */
+ int ctx_size;
+ /* Populate a ASN1_TYPE with parameters */
+ int (*set_asn1_parameters) (EVP_CIPHER_CTX *, ASN1_TYPE *);
+ /* Get parameters from a ASN1_TYPE */
+ int (*get_asn1_parameters) (EVP_CIPHER_CTX *, ASN1_TYPE *);
+ /* Miscellaneous operations */
+ int (*ctrl) (EVP_CIPHER_CTX *, int type, int arg, void *ptr);
+ /* Application data */
+ void *app_data;
+} /* EVP_CIPHER */ ;
+
+/* Values for cipher flags */
+
+/* Modes for ciphers */
+
+# define EVP_CIPH_STREAM_CIPHER 0x0
+# define EVP_CIPH_ECB_MODE 0x1
+# define EVP_CIPH_CBC_MODE 0x2
+# define EVP_CIPH_CFB_MODE 0x3
+# define EVP_CIPH_OFB_MODE 0x4
+# define EVP_CIPH_CTR_MODE 0x5
+# define EVP_CIPH_GCM_MODE 0x6
+# define EVP_CIPH_CCM_MODE 0x7
+# define EVP_CIPH_XTS_MODE 0x10001
+# define EVP_CIPH_WRAP_MODE 0x10002
+# define EVP_CIPH_MODE 0xF0007
+/* Set if variable length cipher */
+# define EVP_CIPH_VARIABLE_LENGTH 0x8
+/* Set if the iv handling should be done by the cipher itself */
+# define EVP_CIPH_CUSTOM_IV 0x10
+/* Set if the cipher's init() function should be called if key is NULL */
+# define EVP_CIPH_ALWAYS_CALL_INIT 0x20
+/* Call ctrl() to init cipher parameters */
+# define EVP_CIPH_CTRL_INIT 0x40
+/* Don't use standard key length function */
+# define EVP_CIPH_CUSTOM_KEY_LENGTH 0x80
+/* Don't use standard block padding */
+# define EVP_CIPH_NO_PADDING 0x100
+/* cipher handles random key generation */
+# define EVP_CIPH_RAND_KEY 0x200
+/* cipher has its own additional copying logic */
+# define EVP_CIPH_CUSTOM_COPY 0x400
+/* Allow use default ASN1 get/set iv */
+# define EVP_CIPH_FLAG_DEFAULT_ASN1 0x1000
+/* Buffer length in bits not bytes: CFB1 mode only */
+# define EVP_CIPH_FLAG_LENGTH_BITS 0x2000
+/* Note if suitable for use in FIPS mode */
+# define EVP_CIPH_FLAG_FIPS 0x4000
+/* Allow non FIPS cipher in FIPS mode */
+# define EVP_CIPH_FLAG_NON_FIPS_ALLOW 0x8000
+/*
+ * Cipher handles any and all padding logic as well as finalisation.
+ */
+# define EVP_CIPH_FLAG_CUSTOM_CIPHER 0x100000
+# define EVP_CIPH_FLAG_AEAD_CIPHER 0x200000
+# define EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK 0x400000
+
+/*
+ * Cipher context flag to indicate we can handle wrap mode: if allowed in
+ * older applications it could overflow buffers.
+ */
+
+# define EVP_CIPHER_CTX_FLAG_WRAP_ALLOW 0x1
+
+/* ctrl() values */
+
+# define EVP_CTRL_INIT 0x0
+# define EVP_CTRL_SET_KEY_LENGTH 0x1
+# define EVP_CTRL_GET_RC2_KEY_BITS 0x2
+# define EVP_CTRL_SET_RC2_KEY_BITS 0x3
+# define EVP_CTRL_GET_RC5_ROUNDS 0x4
+# define EVP_CTRL_SET_RC5_ROUNDS 0x5
+# define EVP_CTRL_RAND_KEY 0x6
+# define EVP_CTRL_PBE_PRF_NID 0x7
+# define EVP_CTRL_COPY 0x8
+# define EVP_CTRL_GCM_SET_IVLEN 0x9
+# define EVP_CTRL_GCM_GET_TAG 0x10
+# define EVP_CTRL_GCM_SET_TAG 0x11
+# define EVP_CTRL_GCM_SET_IV_FIXED 0x12
+# define EVP_CTRL_GCM_IV_GEN 0x13
+# define EVP_CTRL_CCM_SET_IVLEN EVP_CTRL_GCM_SET_IVLEN
+# define EVP_CTRL_CCM_GET_TAG EVP_CTRL_GCM_GET_TAG
+# define EVP_CTRL_CCM_SET_TAG EVP_CTRL_GCM_SET_TAG
+# define EVP_CTRL_CCM_SET_L 0x14
+# define EVP_CTRL_CCM_SET_MSGLEN 0x15
+/*
+ * AEAD cipher deduces payload length and returns number of bytes required to
+ * store MAC and eventual padding. Subsequent call to EVP_Cipher even
+ * appends/verifies MAC.
+ */
+# define EVP_CTRL_AEAD_TLS1_AAD 0x16
+/* Used by composite AEAD ciphers, no-op in GCM, CCM... */
+# define EVP_CTRL_AEAD_SET_MAC_KEY 0x17
+/* Set the GCM invocation field, decrypt only */
+# define EVP_CTRL_GCM_SET_IV_INV 0x18
+
+# define EVP_CTRL_TLS1_1_MULTIBLOCK_AAD 0x19
+# define EVP_CTRL_TLS1_1_MULTIBLOCK_ENCRYPT 0x1a
+# define EVP_CTRL_TLS1_1_MULTIBLOCK_DECRYPT 0x1b
+# define EVP_CTRL_TLS1_1_MULTIBLOCK_MAX_BUFSIZE 0x1c
+
+/* RFC 5246 defines additional data to be 13 bytes in length */
+# define EVP_AEAD_TLS1_AAD_LEN 13
+
+typedef struct {
+ unsigned char *out;
+ const unsigned char *inp;
+ size_t len;
+ unsigned int interleave;
+} EVP_CTRL_TLS1_1_MULTIBLOCK_PARAM;
+
+/* GCM TLS constants */
+/* Length of fixed part of IV derived from PRF */
+# define EVP_GCM_TLS_FIXED_IV_LEN 4
+/* Length of explicit part of IV part of TLS records */
+# define EVP_GCM_TLS_EXPLICIT_IV_LEN 8
+/* Length of tag for TLS */
+# define EVP_GCM_TLS_TAG_LEN 16
+
+typedef struct evp_cipher_info_st {
+ const EVP_CIPHER *cipher;
+ unsigned char iv[EVP_MAX_IV_LENGTH];
+} EVP_CIPHER_INFO;
+
+struct evp_cipher_ctx_st {
+ const EVP_CIPHER *cipher;
+ ENGINE *engine; /* functional reference if 'cipher' is
+ * ENGINE-provided */
+ int encrypt; /* encrypt or decrypt */
+ int buf_len; /* number we have left */
+ unsigned char oiv[EVP_MAX_IV_LENGTH]; /* original iv */
+ unsigned char iv[EVP_MAX_IV_LENGTH]; /* working iv */
+ unsigned char buf[EVP_MAX_BLOCK_LENGTH]; /* saved partial block */
+ int num; /* used by cfb/ofb/ctr mode */
+ void *app_data; /* application stuff */
+ int key_len; /* May change for variable length cipher */
+ unsigned long flags; /* Various flags */
+ void *cipher_data; /* per EVP data */
+ int final_used;
+ int block_mask;
+ unsigned char final[EVP_MAX_BLOCK_LENGTH]; /* possible final block */
+} /* EVP_CIPHER_CTX */ ;
+
+typedef struct evp_Encode_Ctx_st {
+ /* number saved in a partial encode/decode */
+ int num;
+ /*
+ * The length is either the output line length (in input bytes) or the
+ * shortest input line length that is ok. Once decoding begins, the
+ * length is adjusted up each time a longer line is decoded
+ */
+ int length;
+ /* data to encode */
+ unsigned char enc_data[80];
+ /* number read on current line */
+ int line_num;
+ int expect_nl;
+} EVP_ENCODE_CTX;
+
+/* Password based encryption function */
+typedef int (EVP_PBE_KEYGEN) (EVP_CIPHER_CTX *ctx, const char *pass,
+ int passlen, ASN1_TYPE *param,
+ const EVP_CIPHER *cipher, const EVP_MD *md,
+ int en_de);
+
+# ifndef OPENSSL_NO_RSA
+# define EVP_PKEY_assign_RSA(pkey,rsa) EVP_PKEY_assign((pkey),EVP_PKEY_RSA,\
+ (char *)(rsa))
+# endif
+
+# ifndef OPENSSL_NO_DSA
+# define EVP_PKEY_assign_DSA(pkey,dsa) EVP_PKEY_assign((pkey),EVP_PKEY_DSA,\
+ (char *)(dsa))
+# endif
+
+# ifndef OPENSSL_NO_DH
+# define EVP_PKEY_assign_DH(pkey,dh) EVP_PKEY_assign((pkey),EVP_PKEY_DH,\
+ (char *)(dh))
+# endif
+
+# ifndef OPENSSL_NO_EC
+# define EVP_PKEY_assign_EC_KEY(pkey,eckey) EVP_PKEY_assign((pkey),EVP_PKEY_EC,\
+ (char *)(eckey))
+# endif
+
+/* Add some extra combinations */
+# define EVP_get_digestbynid(a) EVP_get_digestbyname(OBJ_nid2sn(a))
+# define EVP_get_digestbyobj(a) EVP_get_digestbynid(OBJ_obj2nid(a))
+# define EVP_get_cipherbynid(a) EVP_get_cipherbyname(OBJ_nid2sn(a))
+# define EVP_get_cipherbyobj(a) EVP_get_cipherbynid(OBJ_obj2nid(a))
+
+int EVP_MD_type(const EVP_MD *md);
+# define EVP_MD_nid(e) EVP_MD_type(e)
+# define EVP_MD_name(e) OBJ_nid2sn(EVP_MD_nid(e))
+int EVP_MD_pkey_type(const EVP_MD *md);
+int EVP_MD_size(const EVP_MD *md);
+int EVP_MD_block_size(const EVP_MD *md);
+unsigned long EVP_MD_flags(const EVP_MD *md);
+
+const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx);
+# define EVP_MD_CTX_size(e) EVP_MD_size(EVP_MD_CTX_md(e))
+# define EVP_MD_CTX_block_size(e) EVP_MD_block_size(EVP_MD_CTX_md(e))
+# define EVP_MD_CTX_type(e) EVP_MD_type(EVP_MD_CTX_md(e))
+
+int EVP_CIPHER_nid(const EVP_CIPHER *cipher);
+# define EVP_CIPHER_name(e) OBJ_nid2sn(EVP_CIPHER_nid(e))
+int EVP_CIPHER_block_size(const EVP_CIPHER *cipher);
+int EVP_CIPHER_key_length(const EVP_CIPHER *cipher);
+int EVP_CIPHER_iv_length(const EVP_CIPHER *cipher);
+unsigned long EVP_CIPHER_flags(const EVP_CIPHER *cipher);
+# define EVP_CIPHER_mode(e) (EVP_CIPHER_flags(e) & EVP_CIPH_MODE)
+
+const EVP_CIPHER *EVP_CIPHER_CTX_cipher(const EVP_CIPHER_CTX *ctx);
+int EVP_CIPHER_CTX_nid(const EVP_CIPHER_CTX *ctx);
+int EVP_CIPHER_CTX_block_size(const EVP_CIPHER_CTX *ctx);
+int EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx);
+int EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx);
+int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in);
+void *EVP_CIPHER_CTX_get_app_data(const EVP_CIPHER_CTX *ctx);
+void EVP_CIPHER_CTX_set_app_data(EVP_CIPHER_CTX *ctx, void *data);
+# define EVP_CIPHER_CTX_type(c) EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c))
+unsigned long EVP_CIPHER_CTX_flags(const EVP_CIPHER_CTX *ctx);
+# define EVP_CIPHER_CTX_mode(e) (EVP_CIPHER_CTX_flags(e) & EVP_CIPH_MODE)
+
+# define EVP_ENCODE_LENGTH(l) (((l+2)/3*4)+(l/48+1)*2+80)
+# define EVP_DECODE_LENGTH(l) ((l+3)/4*3+80)
+
+# define EVP_SignInit_ex(a,b,c) EVP_DigestInit_ex(a,b,c)
+# define EVP_SignInit(a,b) EVP_DigestInit(a,b)
+# define EVP_SignUpdate(a,b,c) EVP_DigestUpdate(a,b,c)
+# define EVP_VerifyInit_ex(a,b,c) EVP_DigestInit_ex(a,b,c)
+# define EVP_VerifyInit(a,b) EVP_DigestInit(a,b)
+# define EVP_VerifyUpdate(a,b,c) EVP_DigestUpdate(a,b,c)
+# define EVP_OpenUpdate(a,b,c,d,e) EVP_DecryptUpdate(a,b,c,d,e)
+# define EVP_SealUpdate(a,b,c,d,e) EVP_EncryptUpdate(a,b,c,d,e)
+# define EVP_DigestSignUpdate(a,b,c) EVP_DigestUpdate(a,b,c)
+# define EVP_DigestVerifyUpdate(a,b,c) EVP_DigestUpdate(a,b,c)
+
+# ifdef CONST_STRICT
+void BIO_set_md(BIO *, const EVP_MD *md);
+# else
+# define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,0,(char *)md)
+# endif
+# define BIO_get_md(b,mdp) BIO_ctrl(b,BIO_C_GET_MD,0,(char *)mdp)
+# define BIO_get_md_ctx(b,mdcp) BIO_ctrl(b,BIO_C_GET_MD_CTX,0,(char *)mdcp)
+# define BIO_set_md_ctx(b,mdcp) BIO_ctrl(b,BIO_C_SET_MD_CTX,0,(char *)mdcp)
+# define BIO_get_cipher_status(b) BIO_ctrl(b,BIO_C_GET_CIPHER_STATUS,0,NULL)
+# define BIO_get_cipher_ctx(b,c_pp) BIO_ctrl(b,BIO_C_GET_CIPHER_CTX,0,(char *)c_pp)
+
+int EVP_Cipher(EVP_CIPHER_CTX *c,
+ unsigned char *out, const unsigned char *in, unsigned int inl);
+
+# define EVP_add_cipher_alias(n,alias) \
+ OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
+# define EVP_add_digest_alias(n,alias) \
+ OBJ_NAME_add((alias),OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS,(n))
+# define EVP_delete_cipher_alias(alias) \
+ OBJ_NAME_remove(alias,OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS);
+# define EVP_delete_digest_alias(alias) \
+ OBJ_NAME_remove(alias,OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS);
+
+void EVP_MD_CTX_init(EVP_MD_CTX *ctx);
+int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx);
+EVP_MD_CTX *EVP_MD_CTX_create(void);
+void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx);
+int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in);
+void EVP_MD_CTX_set_flags(EVP_MD_CTX *ctx, int flags);
+void EVP_MD_CTX_clear_flags(EVP_MD_CTX *ctx, int flags);
+int EVP_MD_CTX_test_flags(const EVP_MD_CTX *ctx, int flags);
+int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl);
+int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *d, size_t cnt);
+int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *s);
+int EVP_Digest(const void *data, size_t count,
+ unsigned char *md, unsigned int *size, const EVP_MD *type,
+ ENGINE *impl);
+
+int EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in);
+int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type);
+int EVP_DigestFinal(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *s);
+
+int EVP_read_pw_string(char *buf, int length, const char *prompt, int verify);
+int EVP_read_pw_string_min(char *buf, int minlen, int maxlen,
+ const char *prompt, int verify);
+void EVP_set_pw_prompt(const char *prompt);
+char *EVP_get_pw_prompt(void);
+
+int EVP_BytesToKey(const EVP_CIPHER *type, const EVP_MD *md,
+ const unsigned char *salt, const unsigned char *data,
+ int datal, int count, unsigned char *key,
+ unsigned char *iv);
+
+void EVP_CIPHER_CTX_set_flags(EVP_CIPHER_CTX *ctx, int flags);
+void EVP_CIPHER_CTX_clear_flags(EVP_CIPHER_CTX *ctx, int flags);
+int EVP_CIPHER_CTX_test_flags(const EVP_CIPHER_CTX *ctx, int flags);
+
+int EVP_EncryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
+ const unsigned char *key, const unsigned char *iv);
+int EVP_EncryptInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
+ ENGINE *impl, const unsigned char *key,
+ const unsigned char *iv);
+int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
+ const unsigned char *in, int inl);
+int EVP_EncryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl);
+int EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl);
+
+int EVP_DecryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
+ const unsigned char *key, const unsigned char *iv);
+int EVP_DecryptInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
+ ENGINE *impl, const unsigned char *key,
+ const unsigned char *iv);
+int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
+ const unsigned char *in, int inl);
+int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl);
+int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl);
+
+int EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
+ const unsigned char *key, const unsigned char *iv,
+ int enc);
+int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
+ ENGINE *impl, const unsigned char *key,
+ const unsigned char *iv, int enc);
+int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
+ const unsigned char *in, int inl);
+int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl);
+int EVP_CipherFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl);
+
+int EVP_SignFinal(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *s,
+ EVP_PKEY *pkey);
+
+int EVP_VerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sigbuf,
+ unsigned int siglen, EVP_PKEY *pkey);
+
+int EVP_DigestSignInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
+ const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey);
+int EVP_DigestSignFinal(EVP_MD_CTX *ctx,
+ unsigned char *sigret, size_t *siglen);
+
+int EVP_DigestVerifyInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
+ const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey);
+int EVP_DigestVerifyFinal(EVP_MD_CTX *ctx,
+ const unsigned char *sig, size_t siglen);
+
+int EVP_OpenInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,
+ const unsigned char *ek, int ekl, const unsigned char *iv,
+ EVP_PKEY *priv);
+int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl);
+
+int EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,
+ unsigned char **ek, int *ekl, unsigned char *iv,
+ EVP_PKEY **pubk, int npubk);
+int EVP_SealFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl);
+
+void EVP_EncodeInit(EVP_ENCODE_CTX *ctx);
+void EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,
+ const unsigned char *in, int inl);
+void EVP_EncodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl);
+int EVP_EncodeBlock(unsigned char *t, const unsigned char *f, int n);
+
+void EVP_DecodeInit(EVP_ENCODE_CTX *ctx);
+int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,
+ const unsigned char *in, int inl);
+int EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, unsigned
+ char *out, int *outl);
+int EVP_DecodeBlock(unsigned char *t, const unsigned char *f, int n);
+
+void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *a);
+int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *a);
+EVP_CIPHER_CTX *EVP_CIPHER_CTX_new(void);
+void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *a);
+int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *x, int keylen);
+int EVP_CIPHER_CTX_set_padding(EVP_CIPHER_CTX *c, int pad);
+int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr);
+int EVP_CIPHER_CTX_rand_key(EVP_CIPHER_CTX *ctx, unsigned char *key);
+
+# ifndef OPENSSL_NO_BIO
+BIO_METHOD *BIO_f_md(void);
+BIO_METHOD *BIO_f_base64(void);
+BIO_METHOD *BIO_f_cipher(void);
+BIO_METHOD *BIO_f_reliable(void);
+void BIO_set_cipher(BIO *b, const EVP_CIPHER *c, const unsigned char *k,
+ const unsigned char *i, int enc);
+# endif
+
+const EVP_MD *EVP_md_null(void);
+# ifndef OPENSSL_NO_MD2
+const EVP_MD *EVP_md2(void);
+# endif
+# ifndef OPENSSL_NO_MD4
+const EVP_MD *EVP_md4(void);
+# endif
+# ifndef OPENSSL_NO_MD5
+const EVP_MD *EVP_md5(void);
+# endif
+# ifndef OPENSSL_NO_SHA
+const EVP_MD *EVP_sha(void);
+const EVP_MD *EVP_sha1(void);
+const EVP_MD *EVP_dss(void);
+const EVP_MD *EVP_dss1(void);
+const EVP_MD *EVP_ecdsa(void);
+# endif
+# ifndef OPENSSL_NO_SHA256
+const EVP_MD *EVP_sha224(void);
+const EVP_MD *EVP_sha256(void);
+# endif
+# ifndef OPENSSL_NO_SHA512
+const EVP_MD *EVP_sha384(void);
+const EVP_MD *EVP_sha512(void);
+# endif
+# ifndef OPENSSL_NO_MDC2
+const EVP_MD *EVP_mdc2(void);
+# endif
+# ifndef OPENSSL_NO_RIPEMD
+const EVP_MD *EVP_ripemd160(void);
+# endif
+# ifndef OPENSSL_NO_WHIRLPOOL
+const EVP_MD *EVP_whirlpool(void);
+# endif
+const EVP_CIPHER *EVP_enc_null(void); /* does nothing :-) */
+# ifndef OPENSSL_NO_DES
+const EVP_CIPHER *EVP_des_ecb(void);
+const EVP_CIPHER *EVP_des_ede(void);
+const EVP_CIPHER *EVP_des_ede3(void);
+const EVP_CIPHER *EVP_des_ede_ecb(void);
+const EVP_CIPHER *EVP_des_ede3_ecb(void);
+const EVP_CIPHER *EVP_des_cfb64(void);
+# define EVP_des_cfb EVP_des_cfb64
+const EVP_CIPHER *EVP_des_cfb1(void);
+const EVP_CIPHER *EVP_des_cfb8(void);
+const EVP_CIPHER *EVP_des_ede_cfb64(void);
+# define EVP_des_ede_cfb EVP_des_ede_cfb64
+# if 0
+const EVP_CIPHER *EVP_des_ede_cfb1(void);
+const EVP_CIPHER *EVP_des_ede_cfb8(void);
+# endif
+const EVP_CIPHER *EVP_des_ede3_cfb64(void);
+# define EVP_des_ede3_cfb EVP_des_ede3_cfb64
+const EVP_CIPHER *EVP_des_ede3_cfb1(void);
+const EVP_CIPHER *EVP_des_ede3_cfb8(void);
+const EVP_CIPHER *EVP_des_ofb(void);
+const EVP_CIPHER *EVP_des_ede_ofb(void);
+const EVP_CIPHER *EVP_des_ede3_ofb(void);
+const EVP_CIPHER *EVP_des_cbc(void);
+const EVP_CIPHER *EVP_des_ede_cbc(void);
+const EVP_CIPHER *EVP_des_ede3_cbc(void);
+const EVP_CIPHER *EVP_desx_cbc(void);
+const EVP_CIPHER *EVP_des_ede3_wrap(void);
+/*
+ * This should now be supported through the dev_crypto ENGINE. But also, why
+ * are rc4 and md5 declarations made here inside a "NO_DES" precompiler
+ * branch?
+ */
+# if 0
+# ifdef OPENSSL_OPENBSD_DEV_CRYPTO
+const EVP_CIPHER *EVP_dev_crypto_des_ede3_cbc(void);
+const EVP_CIPHER *EVP_dev_crypto_rc4(void);
+const EVP_MD *EVP_dev_crypto_md5(void);
+# endif
+# endif
+# endif
+# ifndef OPENSSL_NO_RC4
+const EVP_CIPHER *EVP_rc4(void);
+const EVP_CIPHER *EVP_rc4_40(void);
+# ifndef OPENSSL_NO_MD5
+const EVP_CIPHER *EVP_rc4_hmac_md5(void);
+# endif
+# endif
+# ifndef OPENSSL_NO_IDEA
+const EVP_CIPHER *EVP_idea_ecb(void);
+const EVP_CIPHER *EVP_idea_cfb64(void);
+# define EVP_idea_cfb EVP_idea_cfb64
+const EVP_CIPHER *EVP_idea_ofb(void);
+const EVP_CIPHER *EVP_idea_cbc(void);
+# endif
+# ifndef OPENSSL_NO_RC2
+const EVP_CIPHER *EVP_rc2_ecb(void);
+const EVP_CIPHER *EVP_rc2_cbc(void);
+const EVP_CIPHER *EVP_rc2_40_cbc(void);
+const EVP_CIPHER *EVP_rc2_64_cbc(void);
+const EVP_CIPHER *EVP_rc2_cfb64(void);
+# define EVP_rc2_cfb EVP_rc2_cfb64
+const EVP_CIPHER *EVP_rc2_ofb(void);
+# endif
+# ifndef OPENSSL_NO_BF
+const EVP_CIPHER *EVP_bf_ecb(void);
+const EVP_CIPHER *EVP_bf_cbc(void);
+const EVP_CIPHER *EVP_bf_cfb64(void);
+# define EVP_bf_cfb EVP_bf_cfb64
+const EVP_CIPHER *EVP_bf_ofb(void);
+# endif
+# ifndef OPENSSL_NO_CAST
+const EVP_CIPHER *EVP_cast5_ecb(void);
+const EVP_CIPHER *EVP_cast5_cbc(void);
+const EVP_CIPHER *EVP_cast5_cfb64(void);
+# define EVP_cast5_cfb EVP_cast5_cfb64
+const EVP_CIPHER *EVP_cast5_ofb(void);
+# endif
+# ifndef OPENSSL_NO_RC5
+const EVP_CIPHER *EVP_rc5_32_12_16_cbc(void);
+const EVP_CIPHER *EVP_rc5_32_12_16_ecb(void);
+const EVP_CIPHER *EVP_rc5_32_12_16_cfb64(void);
+# define EVP_rc5_32_12_16_cfb EVP_rc5_32_12_16_cfb64
+const EVP_CIPHER *EVP_rc5_32_12_16_ofb(void);
+# endif
+# ifndef OPENSSL_NO_AES
+const EVP_CIPHER *EVP_aes_128_ecb(void);
+const EVP_CIPHER *EVP_aes_128_cbc(void);
+const EVP_CIPHER *EVP_aes_128_cfb1(void);
+const EVP_CIPHER *EVP_aes_128_cfb8(void);
+const EVP_CIPHER *EVP_aes_128_cfb128(void);
+# define EVP_aes_128_cfb EVP_aes_128_cfb128
+const EVP_CIPHER *EVP_aes_128_ofb(void);
+const EVP_CIPHER *EVP_aes_128_ctr(void);
+const EVP_CIPHER *EVP_aes_128_ccm(void);
+const EVP_CIPHER *EVP_aes_128_gcm(void);
+const EVP_CIPHER *EVP_aes_128_xts(void);
+const EVP_CIPHER *EVP_aes_128_wrap(void);
+const EVP_CIPHER *EVP_aes_192_ecb(void);
+const EVP_CIPHER *EVP_aes_192_cbc(void);
+const EVP_CIPHER *EVP_aes_192_cfb1(void);
+const EVP_CIPHER *EVP_aes_192_cfb8(void);
+const EVP_CIPHER *EVP_aes_192_cfb128(void);
+# define EVP_aes_192_cfb EVP_aes_192_cfb128
+const EVP_CIPHER *EVP_aes_192_ofb(void);
+const EVP_CIPHER *EVP_aes_192_ctr(void);
+const EVP_CIPHER *EVP_aes_192_ccm(void);
+const EVP_CIPHER *EVP_aes_192_gcm(void);
+const EVP_CIPHER *EVP_aes_192_wrap(void);
+const EVP_CIPHER *EVP_aes_256_ecb(void);
+const EVP_CIPHER *EVP_aes_256_cbc(void);
+const EVP_CIPHER *EVP_aes_256_cfb1(void);
+const EVP_CIPHER *EVP_aes_256_cfb8(void);
+const EVP_CIPHER *EVP_aes_256_cfb128(void);
+# define EVP_aes_256_cfb EVP_aes_256_cfb128
+const EVP_CIPHER *EVP_aes_256_ofb(void);
+const EVP_CIPHER *EVP_aes_256_ctr(void);
+const EVP_CIPHER *EVP_aes_256_ccm(void);
+const EVP_CIPHER *EVP_aes_256_gcm(void);
+const EVP_CIPHER *EVP_aes_256_xts(void);
+const EVP_CIPHER *EVP_aes_256_wrap(void);
+# if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA1)
+const EVP_CIPHER *EVP_aes_128_cbc_hmac_sha1(void);
+const EVP_CIPHER *EVP_aes_256_cbc_hmac_sha1(void);
+# endif
+# ifndef OPENSSL_NO_SHA256
+const EVP_CIPHER *EVP_aes_128_cbc_hmac_sha256(void);
+const EVP_CIPHER *EVP_aes_256_cbc_hmac_sha256(void);
+# endif
+# endif
+# ifndef OPENSSL_NO_CAMELLIA
+const EVP_CIPHER *EVP_camellia_128_ecb(void);
+const EVP_CIPHER *EVP_camellia_128_cbc(void);
+const EVP_CIPHER *EVP_camellia_128_cfb1(void);
+const EVP_CIPHER *EVP_camellia_128_cfb8(void);
+const EVP_CIPHER *EVP_camellia_128_cfb128(void);
+# define EVP_camellia_128_cfb EVP_camellia_128_cfb128
+const EVP_CIPHER *EVP_camellia_128_ofb(void);
+const EVP_CIPHER *EVP_camellia_192_ecb(void);
+const EVP_CIPHER *EVP_camellia_192_cbc(void);
+const EVP_CIPHER *EVP_camellia_192_cfb1(void);
+const EVP_CIPHER *EVP_camellia_192_cfb8(void);
+const EVP_CIPHER *EVP_camellia_192_cfb128(void);
+# define EVP_camellia_192_cfb EVP_camellia_192_cfb128
+const EVP_CIPHER *EVP_camellia_192_ofb(void);
+const EVP_CIPHER *EVP_camellia_256_ecb(void);
+const EVP_CIPHER *EVP_camellia_256_cbc(void);
+const EVP_CIPHER *EVP_camellia_256_cfb1(void);
+const EVP_CIPHER *EVP_camellia_256_cfb8(void);
+const EVP_CIPHER *EVP_camellia_256_cfb128(void);
+# define EVP_camellia_256_cfb EVP_camellia_256_cfb128
+const EVP_CIPHER *EVP_camellia_256_ofb(void);
+# endif
+
+# ifndef OPENSSL_NO_SEED
+const EVP_CIPHER *EVP_seed_ecb(void);
+const EVP_CIPHER *EVP_seed_cbc(void);
+const EVP_CIPHER *EVP_seed_cfb128(void);
+# define EVP_seed_cfb EVP_seed_cfb128
+const EVP_CIPHER *EVP_seed_ofb(void);
+# endif
+
+void OPENSSL_add_all_algorithms_noconf(void);
+void OPENSSL_add_all_algorithms_conf(void);
+
+# ifdef OPENSSL_LOAD_CONF
+# define OpenSSL_add_all_algorithms() \
+ OPENSSL_add_all_algorithms_conf()
+# else
+# define OpenSSL_add_all_algorithms() \
+ OPENSSL_add_all_algorithms_noconf()
+# endif
+
+void OpenSSL_add_all_ciphers(void);
+void OpenSSL_add_all_digests(void);
+# define SSLeay_add_all_algorithms() OpenSSL_add_all_algorithms()
+# define SSLeay_add_all_ciphers() OpenSSL_add_all_ciphers()
+# define SSLeay_add_all_digests() OpenSSL_add_all_digests()
+
+int EVP_add_cipher(const EVP_CIPHER *cipher);
+int EVP_add_digest(const EVP_MD *digest);
+
+const EVP_CIPHER *EVP_get_cipherbyname(const char *name);
+const EVP_MD *EVP_get_digestbyname(const char *name);
+void EVP_cleanup(void);
+
+void EVP_CIPHER_do_all(void (*fn) (const EVP_CIPHER *ciph,
+ const char *from, const char *to, void *x),
+ void *arg);
+void EVP_CIPHER_do_all_sorted(void (*fn)
+ (const EVP_CIPHER *ciph, const char *from,
+ const char *to, void *x), void *arg);
+
+void EVP_MD_do_all(void (*fn) (const EVP_MD *ciph,
+ const char *from, const char *to, void *x),
+ void *arg);
+void EVP_MD_do_all_sorted(void (*fn)
+ (const EVP_MD *ciph, const char *from,
+ const char *to, void *x), void *arg);
+
+int EVP_PKEY_decrypt_old(unsigned char *dec_key,
+ const unsigned char *enc_key, int enc_key_len,
+ EVP_PKEY *private_key);
+int EVP_PKEY_encrypt_old(unsigned char *enc_key,
+ const unsigned char *key, int key_len,
+ EVP_PKEY *pub_key);
+int EVP_PKEY_type(int type);
+int EVP_PKEY_id(const EVP_PKEY *pkey);
+int EVP_PKEY_base_id(const EVP_PKEY *pkey);
+int EVP_PKEY_bits(EVP_PKEY *pkey);
+int EVP_PKEY_size(EVP_PKEY *pkey);
+int EVP_PKEY_set_type(EVP_PKEY *pkey, int type);
+int EVP_PKEY_set_type_str(EVP_PKEY *pkey, const char *str, int len);
+int EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key);
+void *EVP_PKEY_get0(EVP_PKEY *pkey);
+
+# ifndef OPENSSL_NO_RSA
+struct rsa_st;
+int EVP_PKEY_set1_RSA(EVP_PKEY *pkey, struct rsa_st *key);
+struct rsa_st *EVP_PKEY_get1_RSA(EVP_PKEY *pkey);
+# endif
+# ifndef OPENSSL_NO_DSA
+struct dsa_st;
+int EVP_PKEY_set1_DSA(EVP_PKEY *pkey, struct dsa_st *key);
+struct dsa_st *EVP_PKEY_get1_DSA(EVP_PKEY *pkey);
+# endif
+# ifndef OPENSSL_NO_DH
+struct dh_st;
+int EVP_PKEY_set1_DH(EVP_PKEY *pkey, struct dh_st *key);
+struct dh_st *EVP_PKEY_get1_DH(EVP_PKEY *pkey);
+# endif
+# ifndef OPENSSL_NO_EC
+struct ec_key_st;
+int EVP_PKEY_set1_EC_KEY(EVP_PKEY *pkey, struct ec_key_st *key);
+struct ec_key_st *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey);
+# endif
+
+EVP_PKEY *EVP_PKEY_new(void);
+void EVP_PKEY_free(EVP_PKEY *pkey);
+
+EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp,
+ long length);
+int i2d_PublicKey(EVP_PKEY *a, unsigned char **pp);
+
+EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, const unsigned char **pp,
+ long length);
+EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp,
+ long length);
+int i2d_PrivateKey(EVP_PKEY *a, unsigned char **pp);
+
+int EVP_PKEY_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from);
+int EVP_PKEY_missing_parameters(const EVP_PKEY *pkey);
+int EVP_PKEY_save_parameters(EVP_PKEY *pkey, int mode);
+int EVP_PKEY_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b);
+
+int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b);
+
+int EVP_PKEY_print_public(BIO *out, const EVP_PKEY *pkey,
+ int indent, ASN1_PCTX *pctx);
+int EVP_PKEY_print_private(BIO *out, const EVP_PKEY *pkey,
+ int indent, ASN1_PCTX *pctx);
+int EVP_PKEY_print_params(BIO *out, const EVP_PKEY *pkey,
+ int indent, ASN1_PCTX *pctx);
+
+int EVP_PKEY_get_default_digest_nid(EVP_PKEY *pkey, int *pnid);
+
+int EVP_CIPHER_type(const EVP_CIPHER *ctx);
+
+/* calls methods */
+int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
+int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
+
+/* These are used by EVP_CIPHER methods */
+int EVP_CIPHER_set_asn1_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
+int EVP_CIPHER_get_asn1_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
+
+/* PKCS5 password based encryption */
+int PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
+ ASN1_TYPE *param, const EVP_CIPHER *cipher,
+ const EVP_MD *md, int en_de);
+int PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen,
+ const unsigned char *salt, int saltlen, int iter,
+ int keylen, unsigned char *out);
+int PKCS5_PBKDF2_HMAC(const char *pass, int passlen,
+ const unsigned char *salt, int saltlen, int iter,
+ const EVP_MD *digest, int keylen, unsigned char *out);
+int PKCS5_v2_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
+ ASN1_TYPE *param, const EVP_CIPHER *cipher,
+ const EVP_MD *md, int en_de);
+
+void PKCS5_PBE_add(void);
+
+int EVP_PBE_CipherInit(ASN1_OBJECT *pbe_obj, const char *pass, int passlen,
+ ASN1_TYPE *param, EVP_CIPHER_CTX *ctx, int en_de);
+
+/* PBE type */
+
+/* Can appear as the outermost AlgorithmIdentifier */
+# define EVP_PBE_TYPE_OUTER 0x0
+/* Is an PRF type OID */
+# define EVP_PBE_TYPE_PRF 0x1
+
+int EVP_PBE_alg_add_type(int pbe_type, int pbe_nid, int cipher_nid,
+ int md_nid, EVP_PBE_KEYGEN *keygen);
+int EVP_PBE_alg_add(int nid, const EVP_CIPHER *cipher, const EVP_MD *md,
+ EVP_PBE_KEYGEN *keygen);
+int EVP_PBE_find(int type, int pbe_nid, int *pcnid, int *pmnid,
+ EVP_PBE_KEYGEN **pkeygen);
+void EVP_PBE_cleanup(void);
+
+# define ASN1_PKEY_ALIAS 0x1
+# define ASN1_PKEY_DYNAMIC 0x2
+# define ASN1_PKEY_SIGPARAM_NULL 0x4
+
+# define ASN1_PKEY_CTRL_PKCS7_SIGN 0x1
+# define ASN1_PKEY_CTRL_PKCS7_ENCRYPT 0x2
+# define ASN1_PKEY_CTRL_DEFAULT_MD_NID 0x3
+# define ASN1_PKEY_CTRL_CMS_SIGN 0x5
+# define ASN1_PKEY_CTRL_CMS_ENVELOPE 0x7
+# define ASN1_PKEY_CTRL_CMS_RI_TYPE 0x8
+
+int EVP_PKEY_asn1_get_count(void);
+const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_get0(int idx);
+const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find(ENGINE **pe, int type);
+const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find_str(ENGINE **pe,
+ const char *str, int len);
+int EVP_PKEY_asn1_add0(const EVP_PKEY_ASN1_METHOD *ameth);
+int EVP_PKEY_asn1_add_alias(int to, int from);
+int EVP_PKEY_asn1_get0_info(int *ppkey_id, int *pkey_base_id,
+ int *ppkey_flags, const char **pinfo,
+ const char **ppem_str,
+ const EVP_PKEY_ASN1_METHOD *ameth);
+
+const EVP_PKEY_ASN1_METHOD *EVP_PKEY_get0_asn1(EVP_PKEY *pkey);
+EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_new(int id, int flags,
+ const char *pem_str,
+ const char *info);
+void EVP_PKEY_asn1_copy(EVP_PKEY_ASN1_METHOD *dst,
+ const EVP_PKEY_ASN1_METHOD *src);
+void EVP_PKEY_asn1_free(EVP_PKEY_ASN1_METHOD *ameth);
+void EVP_PKEY_asn1_set_public(EVP_PKEY_ASN1_METHOD *ameth,
+ int (*pub_decode) (EVP_PKEY *pk,
+ X509_PUBKEY *pub),
+ int (*pub_encode) (X509_PUBKEY *pub,
+ const EVP_PKEY *pk),
+ int (*pub_cmp) (const EVP_PKEY *a,
+ const EVP_PKEY *b),
+ int (*pub_print) (BIO *out,
+ const EVP_PKEY *pkey,
+ int indent, ASN1_PCTX *pctx),
+ int (*pkey_size) (const EVP_PKEY *pk),
+ int (*pkey_bits) (const EVP_PKEY *pk));
+void EVP_PKEY_asn1_set_private(EVP_PKEY_ASN1_METHOD *ameth,
+ int (*priv_decode) (EVP_PKEY *pk,
+ PKCS8_PRIV_KEY_INFO
+ *p8inf),
+ int (*priv_encode) (PKCS8_PRIV_KEY_INFO *p8,
+ const EVP_PKEY *pk),
+ int (*priv_print) (BIO *out,
+ const EVP_PKEY *pkey,
+ int indent,
+ ASN1_PCTX *pctx));
+void EVP_PKEY_asn1_set_param(EVP_PKEY_ASN1_METHOD *ameth,
+ int (*param_decode) (EVP_PKEY *pkey,
+ const unsigned char **pder,
+ int derlen),
+ int (*param_encode) (const EVP_PKEY *pkey,
+ unsigned char **pder),
+ int (*param_missing) (const EVP_PKEY *pk),
+ int (*param_copy) (EVP_PKEY *to,
+ const EVP_PKEY *from),
+ int (*param_cmp) (const EVP_PKEY *a,
+ const EVP_PKEY *b),
+ int (*param_print) (BIO *out,
+ const EVP_PKEY *pkey,
+ int indent,
+ ASN1_PCTX *pctx));
+
+void EVP_PKEY_asn1_set_free(EVP_PKEY_ASN1_METHOD *ameth,
+ void (*pkey_free) (EVP_PKEY *pkey));
+void EVP_PKEY_asn1_set_ctrl(EVP_PKEY_ASN1_METHOD *ameth,
+ int (*pkey_ctrl) (EVP_PKEY *pkey, int op,
+ long arg1, void *arg2));
+void EVP_PKEY_asn1_set_item(EVP_PKEY_ASN1_METHOD *ameth,
+ int (*item_verify) (EVP_MD_CTX *ctx,
+ const ASN1_ITEM *it,
+ void *asn,
+ X509_ALGOR *a,
+ ASN1_BIT_STRING *sig,
+ EVP_PKEY *pkey),
+ int (*item_sign) (EVP_MD_CTX *ctx,
+ const ASN1_ITEM *it,
+ void *asn,
+ X509_ALGOR *alg1,
+ X509_ALGOR *alg2,
+ ASN1_BIT_STRING *sig));
+
+# define EVP_PKEY_OP_UNDEFINED 0
+# define EVP_PKEY_OP_PARAMGEN (1<<1)
+# define EVP_PKEY_OP_KEYGEN (1<<2)
+# define EVP_PKEY_OP_SIGN (1<<3)
+# define EVP_PKEY_OP_VERIFY (1<<4)
+# define EVP_PKEY_OP_VERIFYRECOVER (1<<5)
+# define EVP_PKEY_OP_SIGNCTX (1<<6)
+# define EVP_PKEY_OP_VERIFYCTX (1<<7)
+# define EVP_PKEY_OP_ENCRYPT (1<<8)
+# define EVP_PKEY_OP_DECRYPT (1<<9)
+# define EVP_PKEY_OP_DERIVE (1<<10)
+
+# define EVP_PKEY_OP_TYPE_SIG \
+ (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYRECOVER \
+ | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)
+
+# define EVP_PKEY_OP_TYPE_CRYPT \
+ (EVP_PKEY_OP_ENCRYPT | EVP_PKEY_OP_DECRYPT)
+
+# define EVP_PKEY_OP_TYPE_NOGEN \
+ (EVP_PKEY_OP_SIG | EVP_PKEY_OP_CRYPT | EVP_PKEY_OP_DERIVE)
+
+# define EVP_PKEY_OP_TYPE_GEN \
+ (EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN)
+
+# define EVP_PKEY_CTX_set_signature_md(ctx, md) \
+ EVP_PKEY_CTX_ctrl(ctx, -1, EVP_PKEY_OP_TYPE_SIG, \
+ EVP_PKEY_CTRL_MD, 0, (void *)md)
+
+# define EVP_PKEY_CTX_get_signature_md(ctx, pmd) \
+ EVP_PKEY_CTX_ctrl(ctx, -1, EVP_PKEY_OP_TYPE_SIG, \
+ EVP_PKEY_CTRL_GET_MD, 0, (void *)pmd)
+
+# define EVP_PKEY_CTRL_MD 1
+# define EVP_PKEY_CTRL_PEER_KEY 2
+
+# define EVP_PKEY_CTRL_PKCS7_ENCRYPT 3
+# define EVP_PKEY_CTRL_PKCS7_DECRYPT 4
+
+# define EVP_PKEY_CTRL_PKCS7_SIGN 5
+
+# define EVP_PKEY_CTRL_SET_MAC_KEY 6
+
+# define EVP_PKEY_CTRL_DIGESTINIT 7
+
+/* Used by GOST key encryption in TLS */
+# define EVP_PKEY_CTRL_SET_IV 8
+
+# define EVP_PKEY_CTRL_CMS_ENCRYPT 9
+# define EVP_PKEY_CTRL_CMS_DECRYPT 10
+# define EVP_PKEY_CTRL_CMS_SIGN 11
+
+# define EVP_PKEY_CTRL_CIPHER 12
+
+# define EVP_PKEY_CTRL_GET_MD 13
+
+# define EVP_PKEY_ALG_CTRL 0x1000
+
+# define EVP_PKEY_FLAG_AUTOARGLEN 2
+/*
+ * Method handles all operations: don't assume any digest related defaults.
+ */
+# define EVP_PKEY_FLAG_SIGCTX_CUSTOM 4
+
+const EVP_PKEY_METHOD *EVP_PKEY_meth_find(int type);
+EVP_PKEY_METHOD *EVP_PKEY_meth_new(int id, int flags);
+void EVP_PKEY_meth_get0_info(int *ppkey_id, int *pflags,
+ const EVP_PKEY_METHOD *meth);
+void EVP_PKEY_meth_copy(EVP_PKEY_METHOD *dst, const EVP_PKEY_METHOD *src);
+void EVP_PKEY_meth_free(EVP_PKEY_METHOD *pmeth);
+int EVP_PKEY_meth_add0(const EVP_PKEY_METHOD *pmeth);
+
+EVP_PKEY_CTX *EVP_PKEY_CTX_new(EVP_PKEY *pkey, ENGINE *e);
+EVP_PKEY_CTX *EVP_PKEY_CTX_new_id(int id, ENGINE *e);
+EVP_PKEY_CTX *EVP_PKEY_CTX_dup(EVP_PKEY_CTX *ctx);
+void EVP_PKEY_CTX_free(EVP_PKEY_CTX *ctx);
+
+int EVP_PKEY_CTX_ctrl(EVP_PKEY_CTX *ctx, int keytype, int optype,
+ int cmd, int p1, void *p2);
+int EVP_PKEY_CTX_ctrl_str(EVP_PKEY_CTX *ctx, const char *type,
+ const char *value);
+
+int EVP_PKEY_CTX_get_operation(EVP_PKEY_CTX *ctx);
+void EVP_PKEY_CTX_set0_keygen_info(EVP_PKEY_CTX *ctx, int *dat, int datlen);
+
+EVP_PKEY *EVP_PKEY_new_mac_key(int type, ENGINE *e,
+ const unsigned char *key, int keylen);
+
+void EVP_PKEY_CTX_set_data(EVP_PKEY_CTX *ctx, void *data);
+void *EVP_PKEY_CTX_get_data(EVP_PKEY_CTX *ctx);
+EVP_PKEY *EVP_PKEY_CTX_get0_pkey(EVP_PKEY_CTX *ctx);
+
+EVP_PKEY *EVP_PKEY_CTX_get0_peerkey(EVP_PKEY_CTX *ctx);
+
+void EVP_PKEY_CTX_set_app_data(EVP_PKEY_CTX *ctx, void *data);
+void *EVP_PKEY_CTX_get_app_data(EVP_PKEY_CTX *ctx);
+
+int EVP_PKEY_sign_init(EVP_PKEY_CTX *ctx);
+int EVP_PKEY_sign(EVP_PKEY_CTX *ctx,
+ unsigned char *sig, size_t *siglen,
+ const unsigned char *tbs, size_t tbslen);
+int EVP_PKEY_verify_init(EVP_PKEY_CTX *ctx);
+int EVP_PKEY_verify(EVP_PKEY_CTX *ctx,
+ const unsigned char *sig, size_t siglen,
+ const unsigned char *tbs, size_t tbslen);
+int EVP_PKEY_verify_recover_init(EVP_PKEY_CTX *ctx);
+int EVP_PKEY_verify_recover(EVP_PKEY_CTX *ctx,
+ unsigned char *rout, size_t *routlen,
+ const unsigned char *sig, size_t siglen);
+int EVP_PKEY_encrypt_init(EVP_PKEY_CTX *ctx);
+int EVP_PKEY_encrypt(EVP_PKEY_CTX *ctx,
+ unsigned char *out, size_t *outlen,
+ const unsigned char *in, size_t inlen);
+int EVP_PKEY_decrypt_init(EVP_PKEY_CTX *ctx);
+int EVP_PKEY_decrypt(EVP_PKEY_CTX *ctx,
+ unsigned char *out, size_t *outlen,
+ const unsigned char *in, size_t inlen);
+
+int EVP_PKEY_derive_init(EVP_PKEY_CTX *ctx);
+int EVP_PKEY_derive_set_peer(EVP_PKEY_CTX *ctx, EVP_PKEY *peer);
+int EVP_PKEY_derive(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen);
+
+typedef int EVP_PKEY_gen_cb (EVP_PKEY_CTX *ctx);
+
+int EVP_PKEY_paramgen_init(EVP_PKEY_CTX *ctx);
+int EVP_PKEY_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey);
+int EVP_PKEY_keygen_init(EVP_PKEY_CTX *ctx);
+int EVP_PKEY_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey);
+
+void EVP_PKEY_CTX_set_cb(EVP_PKEY_CTX *ctx, EVP_PKEY_gen_cb *cb);
+EVP_PKEY_gen_cb *EVP_PKEY_CTX_get_cb(EVP_PKEY_CTX *ctx);
+
+int EVP_PKEY_CTX_get_keygen_info(EVP_PKEY_CTX *ctx, int idx);
+
+void EVP_PKEY_meth_set_init(EVP_PKEY_METHOD *pmeth,
+ int (*init) (EVP_PKEY_CTX *ctx));
+
+void EVP_PKEY_meth_set_copy(EVP_PKEY_METHOD *pmeth,
+ int (*copy) (EVP_PKEY_CTX *dst,
+ EVP_PKEY_CTX *src));
+
+void EVP_PKEY_meth_set_cleanup(EVP_PKEY_METHOD *pmeth,
+ void (*cleanup) (EVP_PKEY_CTX *ctx));
+
+void EVP_PKEY_meth_set_paramgen(EVP_PKEY_METHOD *pmeth,
+ int (*paramgen_init) (EVP_PKEY_CTX *ctx),
+ int (*paramgen) (EVP_PKEY_CTX *ctx,
+ EVP_PKEY *pkey));
+
+void EVP_PKEY_meth_set_keygen(EVP_PKEY_METHOD *pmeth,
+ int (*keygen_init) (EVP_PKEY_CTX *ctx),
+ int (*keygen) (EVP_PKEY_CTX *ctx,
+ EVP_PKEY *pkey));
+
+void EVP_PKEY_meth_set_sign(EVP_PKEY_METHOD *pmeth,
+ int (*sign_init) (EVP_PKEY_CTX *ctx),
+ int (*sign) (EVP_PKEY_CTX *ctx,
+ unsigned char *sig, size_t *siglen,
+ const unsigned char *tbs,
+ size_t tbslen));
+
+void EVP_PKEY_meth_set_verify(EVP_PKEY_METHOD *pmeth,
+ int (*verify_init) (EVP_PKEY_CTX *ctx),
+ int (*verify) (EVP_PKEY_CTX *ctx,
+ const unsigned char *sig,
+ size_t siglen,
+ const unsigned char *tbs,
+ size_t tbslen));
+
+void EVP_PKEY_meth_set_verify_recover(EVP_PKEY_METHOD *pmeth,
+ int (*verify_recover_init) (EVP_PKEY_CTX
+ *ctx),
+ int (*verify_recover) (EVP_PKEY_CTX
+ *ctx,
+ unsigned char
+ *sig,
+ size_t *siglen,
+ const unsigned
+ char *tbs,
+ size_t tbslen));
+
+void EVP_PKEY_meth_set_signctx(EVP_PKEY_METHOD *pmeth,
+ int (*signctx_init) (EVP_PKEY_CTX *ctx,
+ EVP_MD_CTX *mctx),
+ int (*signctx) (EVP_PKEY_CTX *ctx,
+ unsigned char *sig,
+ size_t *siglen,
+ EVP_MD_CTX *mctx));
+
+void EVP_PKEY_meth_set_verifyctx(EVP_PKEY_METHOD *pmeth,
+ int (*verifyctx_init) (EVP_PKEY_CTX *ctx,
+ EVP_MD_CTX *mctx),
+ int (*verifyctx) (EVP_PKEY_CTX *ctx,
+ const unsigned char *sig,
+ int siglen,
+ EVP_MD_CTX *mctx));
+
+void EVP_PKEY_meth_set_encrypt(EVP_PKEY_METHOD *pmeth,
+ int (*encrypt_init) (EVP_PKEY_CTX *ctx),
+ int (*encryptfn) (EVP_PKEY_CTX *ctx,
+ unsigned char *out,
+ size_t *outlen,
+ const unsigned char *in,
+ size_t inlen));
+
+void EVP_PKEY_meth_set_decrypt(EVP_PKEY_METHOD *pmeth,
+ int (*decrypt_init) (EVP_PKEY_CTX *ctx),
+ int (*decrypt) (EVP_PKEY_CTX *ctx,
+ unsigned char *out,
+ size_t *outlen,
+ const unsigned char *in,
+ size_t inlen));
+
+void EVP_PKEY_meth_set_derive(EVP_PKEY_METHOD *pmeth,
+ int (*derive_init) (EVP_PKEY_CTX *ctx),
+ int (*derive) (EVP_PKEY_CTX *ctx,
+ unsigned char *key,
+ size_t *keylen));
+
+void EVP_PKEY_meth_set_ctrl(EVP_PKEY_METHOD *pmeth,
+ int (*ctrl) (EVP_PKEY_CTX *ctx, int type, int p1,
+ void *p2),
+ int (*ctrl_str) (EVP_PKEY_CTX *ctx,
+ const char *type,
+ const char *value));
+
+void EVP_add_alg_module(void);
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_EVP_strings(void);
+
+/* Error codes for the EVP functions. */
+
+/* Function codes. */
+# define EVP_F_AESNI_INIT_KEY 165
+# define EVP_F_AESNI_XTS_CIPHER 176
+# define EVP_F_AES_INIT_KEY 133
+# define EVP_F_AES_T4_INIT_KEY 178
+# define EVP_F_AES_XTS 172
+# define EVP_F_AES_XTS_CIPHER 175
+# define EVP_F_ALG_MODULE_INIT 177
+# define EVP_F_CAMELLIA_INIT_KEY 159
+# define EVP_F_CMAC_INIT 173
+# define EVP_F_CMLL_T4_INIT_KEY 179
+# define EVP_F_D2I_PKEY 100
+# define EVP_F_DO_SIGVER_INIT 161
+# define EVP_F_DSAPKEY2PKCS8 134
+# define EVP_F_DSA_PKEY2PKCS8 135
+# define EVP_F_ECDSA_PKEY2PKCS8 129
+# define EVP_F_ECKEY_PKEY2PKCS8 132
+# define EVP_F_EVP_CIPHERINIT_EX 123
+# define EVP_F_EVP_CIPHER_CTX_COPY 163
+# define EVP_F_EVP_CIPHER_CTX_CTRL 124
+# define EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH 122
+# define EVP_F_EVP_DECRYPTFINAL_EX 101
+# define EVP_F_EVP_DIGESTINIT_EX 128
+# define EVP_F_EVP_ENCRYPTFINAL_EX 127
+# define EVP_F_EVP_MD_CTX_COPY_EX 110
+# define EVP_F_EVP_MD_SIZE 162
+# define EVP_F_EVP_OPENINIT 102
+# define EVP_F_EVP_PBE_ALG_ADD 115
+# define EVP_F_EVP_PBE_ALG_ADD_TYPE 160
+# define EVP_F_EVP_PBE_CIPHERINIT 116
+# define EVP_F_EVP_PKCS82PKEY 111
+# define EVP_F_EVP_PKCS82PKEY_BROKEN 136
+# define EVP_F_EVP_PKEY2PKCS8_BROKEN 113
+# define EVP_F_EVP_PKEY_COPY_PARAMETERS 103
+# define EVP_F_EVP_PKEY_CTX_CTRL 137
+# define EVP_F_EVP_PKEY_CTX_CTRL_STR 150
+# define EVP_F_EVP_PKEY_CTX_DUP 156
+# define EVP_F_EVP_PKEY_DECRYPT 104
+# define EVP_F_EVP_PKEY_DECRYPT_INIT 138
+# define EVP_F_EVP_PKEY_DECRYPT_OLD 151
+# define EVP_F_EVP_PKEY_DERIVE 153
+# define EVP_F_EVP_PKEY_DERIVE_INIT 154
+# define EVP_F_EVP_PKEY_DERIVE_SET_PEER 155
+# define EVP_F_EVP_PKEY_ENCRYPT 105
+# define EVP_F_EVP_PKEY_ENCRYPT_INIT 139
+# define EVP_F_EVP_PKEY_ENCRYPT_OLD 152
+# define EVP_F_EVP_PKEY_GET1_DH 119
+# define EVP_F_EVP_PKEY_GET1_DSA 120
+# define EVP_F_EVP_PKEY_GET1_ECDSA 130
+# define EVP_F_EVP_PKEY_GET1_EC_KEY 131
+# define EVP_F_EVP_PKEY_GET1_RSA 121
+# define EVP_F_EVP_PKEY_KEYGEN 146
+# define EVP_F_EVP_PKEY_KEYGEN_INIT 147
+# define EVP_F_EVP_PKEY_NEW 106
+# define EVP_F_EVP_PKEY_PARAMGEN 148
+# define EVP_F_EVP_PKEY_PARAMGEN_INIT 149
+# define EVP_F_EVP_PKEY_SIGN 140
+# define EVP_F_EVP_PKEY_SIGN_INIT 141
+# define EVP_F_EVP_PKEY_VERIFY 142
+# define EVP_F_EVP_PKEY_VERIFY_INIT 143
+# define EVP_F_EVP_PKEY_VERIFY_RECOVER 144
+# define EVP_F_EVP_PKEY_VERIFY_RECOVER_INIT 145
+# define EVP_F_EVP_RIJNDAEL 126
+# define EVP_F_EVP_SIGNFINAL 107
+# define EVP_F_EVP_VERIFYFINAL 108
+# define EVP_F_FIPS_CIPHERINIT 166
+# define EVP_F_FIPS_CIPHER_CTX_COPY 170
+# define EVP_F_FIPS_CIPHER_CTX_CTRL 167
+# define EVP_F_FIPS_CIPHER_CTX_SET_KEY_LENGTH 171
+# define EVP_F_FIPS_DIGESTINIT 168
+# define EVP_F_FIPS_MD_CTX_COPY 169
+# define EVP_F_HMAC_INIT_EX 174
+# define EVP_F_INT_CTX_NEW 157
+# define EVP_F_PKCS5_PBE_KEYIVGEN 117
+# define EVP_F_PKCS5_V2_PBE_KEYIVGEN 118
+# define EVP_F_PKCS5_V2_PBKDF2_KEYIVGEN 164
+# define EVP_F_PKCS8_SET_BROKEN 112
+# define EVP_F_PKEY_SET_TYPE 158
+# define EVP_F_RC2_MAGIC_TO_METH 109
+# define EVP_F_RC5_CTRL 125
+
+/* Reason codes. */
+# define EVP_R_AES_IV_SETUP_FAILED 162
+# define EVP_R_AES_KEY_SETUP_FAILED 143
+# define EVP_R_ASN1_LIB 140
+# define EVP_R_BAD_BLOCK_LENGTH 136
+# define EVP_R_BAD_DECRYPT 100
+# define EVP_R_BAD_KEY_LENGTH 137
+# define EVP_R_BN_DECODE_ERROR 112
+# define EVP_R_BN_PUBKEY_ERROR 113
+# define EVP_R_BUFFER_TOO_SMALL 155
+# define EVP_R_CAMELLIA_KEY_SETUP_FAILED 157
+# define EVP_R_CIPHER_PARAMETER_ERROR 122
+# define EVP_R_COMMAND_NOT_SUPPORTED 147
+# define EVP_R_CTRL_NOT_IMPLEMENTED 132
+# define EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED 133
+# define EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH 138
+# define EVP_R_DECODE_ERROR 114
+# define EVP_R_DIFFERENT_KEY_TYPES 101
+# define EVP_R_DIFFERENT_PARAMETERS 153
+# define EVP_R_DISABLED_FOR_FIPS 163
+# define EVP_R_ENCODE_ERROR 115
+# define EVP_R_ERROR_LOADING_SECTION 165
+# define EVP_R_ERROR_SETTING_FIPS_MODE 166
+# define EVP_R_EVP_PBE_CIPHERINIT_ERROR 119
+# define EVP_R_EXPECTING_AN_RSA_KEY 127
+# define EVP_R_EXPECTING_A_DH_KEY 128
+# define EVP_R_EXPECTING_A_DSA_KEY 129
+# define EVP_R_EXPECTING_A_ECDSA_KEY 141
+# define EVP_R_EXPECTING_A_EC_KEY 142
+# define EVP_R_FIPS_MODE_NOT_SUPPORTED 167
+# define EVP_R_INITIALIZATION_ERROR 134
+# define EVP_R_INPUT_NOT_INITIALIZED 111
+# define EVP_R_INVALID_DIGEST 152
+# define EVP_R_INVALID_FIPS_MODE 168
+# define EVP_R_INVALID_KEY_LENGTH 130
+# define EVP_R_INVALID_OPERATION 148
+# define EVP_R_IV_TOO_LARGE 102
+# define EVP_R_KEYGEN_FAILURE 120
+# define EVP_R_MESSAGE_DIGEST_IS_NULL 159
+# define EVP_R_METHOD_NOT_SUPPORTED 144
+# define EVP_R_MISSING_PARAMETERS 103
+# define EVP_R_NO_CIPHER_SET 131
+# define EVP_R_NO_DEFAULT_DIGEST 158
+# define EVP_R_NO_DIGEST_SET 139
+# define EVP_R_NO_DSA_PARAMETERS 116
+# define EVP_R_NO_KEY_SET 154
+# define EVP_R_NO_OPERATION_SET 149
+# define EVP_R_NO_SIGN_FUNCTION_CONFIGURED 104
+# define EVP_R_NO_VERIFY_FUNCTION_CONFIGURED 105
+# define EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 150
+# define EVP_R_OPERATON_NOT_INITIALIZED 151
+# define EVP_R_PKCS8_UNKNOWN_BROKEN_TYPE 117
+# define EVP_R_PRIVATE_KEY_DECODE_ERROR 145
+# define EVP_R_PRIVATE_KEY_ENCODE_ERROR 146
+# define EVP_R_PUBLIC_KEY_NOT_RSA 106
+# define EVP_R_TOO_LARGE 164
+# define EVP_R_UNKNOWN_CIPHER 160
+# define EVP_R_UNKNOWN_DIGEST 161
+# define EVP_R_UNKNOWN_OPTION 169
+# define EVP_R_UNKNOWN_PBE_ALGORITHM 121
+# define EVP_R_UNSUPORTED_NUMBER_OF_ROUNDS 135
+# define EVP_R_UNSUPPORTED_ALGORITHM 156
+# define EVP_R_UNSUPPORTED_CIPHER 107
+# define EVP_R_UNSUPPORTED_KEYLENGTH 123
+# define EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION 124
+# define EVP_R_UNSUPPORTED_KEY_SIZE 108
+# define EVP_R_UNSUPPORTED_PRF 125
+# define EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM 118
+# define EVP_R_UNSUPPORTED_SALT_TYPE 126
+# define EVP_R_WRAP_MODE_NOT_ALLOWED 170
+# define EVP_R_WRONG_FINAL_BLOCK_LENGTH 109
+# define EVP_R_WRONG_PUBLIC_KEY_TYPE 110
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/deps/openssl/openssl/include/openssl/hmac.h b/deps/openssl/openssl/include/openssl/hmac.h
index 202128bf52c..b8b55cda7d7 100644
--- a/deps/openssl/openssl/include/openssl/hmac.h
+++ b/deps/openssl/openssl/include/openssl/hmac.h
@@ -1 +1,109 @@
-#include "../../crypto/hmac/hmac.h"
+/* crypto/hmac/hmac.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+#ifndef HEADER_HMAC_H
+# define HEADER_HMAC_H
+
+# include <openssl/opensslconf.h>
+
+# ifdef OPENSSL_NO_HMAC
+# error HMAC is disabled.
+# endif
+
+# include <openssl/evp.h>
+
+# define HMAC_MAX_MD_CBLOCK 128/* largest known is SHA512 */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct hmac_ctx_st {
+ const EVP_MD *md;
+ EVP_MD_CTX md_ctx;
+ EVP_MD_CTX i_ctx;
+ EVP_MD_CTX o_ctx;
+ unsigned int key_length;
+ unsigned char key[HMAC_MAX_MD_CBLOCK];
+} HMAC_CTX;
+
+# define HMAC_size(e) (EVP_MD_size((e)->md))
+
+void HMAC_CTX_init(HMAC_CTX *ctx);
+void HMAC_CTX_cleanup(HMAC_CTX *ctx);
+
+/* deprecated */
+# define HMAC_cleanup(ctx) HMAC_CTX_cleanup(ctx)
+
+/* deprecated */
+int HMAC_Init(HMAC_CTX *ctx, const void *key, int len, const EVP_MD *md);
+int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
+ const EVP_MD *md, ENGINE *impl);
+int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, size_t len);
+int HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len);
+unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len,
+ const unsigned char *d, size_t n, unsigned char *md,
+ unsigned int *md_len);
+int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx);
+
+void HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/deps/openssl/openssl/include/openssl/idea.h b/deps/openssl/openssl/include/openssl/idea.h
index bdf697d6805..60759840397 100644
--- a/deps/openssl/openssl/include/openssl/idea.h
+++ b/deps/openssl/openssl/include/openssl/idea.h
@@ -1 +1,105 @@
-#include "../../crypto/idea/idea.h"
+/* crypto/idea/idea.h */
+/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_IDEA_H
+# define HEADER_IDEA_H
+
+# include <openssl/opensslconf.h>/* IDEA_INT, OPENSSL_NO_IDEA */
+
+# ifdef OPENSSL_NO_IDEA
+# error IDEA is disabled.
+# endif
+
+# define IDEA_ENCRYPT 1
+# define IDEA_DECRYPT 0
+
+# define IDEA_BLOCK 8
+# define IDEA_KEY_LENGTH 16
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct idea_key_st {
+ IDEA_INT data[9][6];
+} IDEA_KEY_SCHEDULE;
+
+const char *idea_options(void);
+void idea_ecb_encrypt(const unsigned char *in, unsigned char *out,
+ IDEA_KEY_SCHEDULE *ks);
+# ifdef OPENSSL_FIPS
+void private_idea_set_encrypt_key(const unsigned char *key,
+ IDEA_KEY_SCHEDULE *ks);
+# endif
+void idea_set_encrypt_key(const unsigned char *key, IDEA_KEY_SCHEDULE *ks);
+void idea_set_decrypt_key(IDEA_KEY_SCHEDULE *ek, IDEA_KEY_SCHEDULE *dk);
+void idea_cbc_encrypt(const unsigned char *in, unsigned char *out,
+ long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv,
+ int enc);
+void idea_cfb64_encrypt(const unsigned char *in, unsigned char *out,
+ long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv,
+ int *num, int enc);
+void idea_ofb64_encrypt(const unsigned char *in, unsigned char *out,
+ long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv,
+ int *num);
+void idea_encrypt(unsigned long *in, IDEA_KEY_SCHEDULE *ks);
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/deps/openssl/openssl/include/openssl/krb5_asn.h b/deps/openssl/openssl/include/openssl/krb5_asn.h
index 0d3feea281f..9cf5a26dd81 100644
--- a/deps/openssl/openssl/include/openssl/krb5_asn.h
+++ b/deps/openssl/openssl/include/openssl/krb5_asn.h
@@ -1 +1,240 @@
-#include "../../crypto/krb5/krb5_asn.h"
+/* krb5_asn.h */
+/*
+ * Written by Vern Staats <staatsvr@asc.hpc.mil> for the OpenSSL project, **
+ * using ocsp/{*.h,*asn*.c} as a starting point
+ */
+
+/* ====================================================================
+ * Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+#ifndef HEADER_KRB5_ASN_H
+# define HEADER_KRB5_ASN_H
+
+/*
+ * #include <krb5.h>
+ */
+# include <openssl/safestack.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * ASN.1 from Kerberos RFC 1510
+ */
+
+/*- EncryptedData ::= SEQUENCE {
+ * etype[0] INTEGER, -- EncryptionType
+ * kvno[1] INTEGER OPTIONAL,
+ * cipher[2] OCTET STRING -- ciphertext
+ * }
+ */
+typedef struct krb5_encdata_st {
+ ASN1_INTEGER *etype;
+ ASN1_INTEGER *kvno;
+ ASN1_OCTET_STRING *cipher;
+} KRB5_ENCDATA;
+
+DECLARE_STACK_OF(KRB5_ENCDATA)
+
+/*- PrincipalName ::= SEQUENCE {
+ * name-type[0] INTEGER,
+ * name-string[1] SEQUENCE OF GeneralString
+ * }
+ */
+typedef struct krb5_princname_st {
+ ASN1_INTEGER *nametype;
+ STACK_OF(ASN1_GENERALSTRING) *namestring;
+} KRB5_PRINCNAME;
+
+DECLARE_STACK_OF(KRB5_PRINCNAME)
+
+/*- Ticket ::= [APPLICATION 1] SEQUENCE {
+ * tkt-vno[0] INTEGER,
+ * realm[1] Realm,
+ * sname[2] PrincipalName,
+ * enc-part[3] EncryptedData
+ * }
+ */
+typedef struct krb5_tktbody_st {
+ ASN1_INTEGER *tktvno;
+ ASN1_GENERALSTRING *realm;
+ KRB5_PRINCNAME *sname;
+ KRB5_ENCDATA *encdata;
+} KRB5_TKTBODY;
+
+typedef STACK_OF(KRB5_TKTBODY) KRB5_TICKET;
+DECLARE_STACK_OF(KRB5_TKTBODY)
+
+/*- AP-REQ ::= [APPLICATION 14] SEQUENCE {
+ * pvno[0] INTEGER,
+ * msg-type[1] INTEGER,
+ * ap-options[2] APOptions,
+ * ticket[3] Ticket,
+ * authenticator[4] EncryptedData
+ * }
+ *
+ * APOptions ::= BIT STRING {
+ * reserved(0), use-session-key(1), mutual-required(2) }
+ */
+typedef struct krb5_ap_req_st {
+ ASN1_INTEGER *pvno;
+ ASN1_INTEGER *msgtype;
+ ASN1_BIT_STRING *apoptions;
+ KRB5_TICKET *ticket;
+ KRB5_ENCDATA *authenticator;
+} KRB5_APREQBODY;
+
+typedef STACK_OF(KRB5_APREQBODY) KRB5_APREQ;
+DECLARE_STACK_OF(KRB5_APREQBODY)
+
+/* Authenticator Stuff */
+
+/*- Checksum ::= SEQUENCE {
+ * cksumtype[0] INTEGER,
+ * checksum[1] OCTET STRING
+ * }
+ */
+typedef struct krb5_checksum_st {
+ ASN1_INTEGER *ctype;
+ ASN1_OCTET_STRING *checksum;
+} KRB5_CHECKSUM;
+
+DECLARE_STACK_OF(KRB5_CHECKSUM)
+
+/*- EncryptionKey ::= SEQUENCE {
+ * keytype[0] INTEGER,
+ * keyvalue[1] OCTET STRING
+ * }
+ */
+typedef struct krb5_encryptionkey_st {
+ ASN1_INTEGER *ktype;
+ ASN1_OCTET_STRING *keyvalue;
+} KRB5_ENCKEY;
+
+DECLARE_STACK_OF(KRB5_ENCKEY)
+
+/*- AuthorizationData ::= SEQUENCE OF SEQUENCE {
+ * ad-type[0] INTEGER,
+ * ad-data[1] OCTET STRING
+ * }
+ */
+typedef struct krb5_authorization_st {
+ ASN1_INTEGER *adtype;
+ ASN1_OCTET_STRING *addata;
+} KRB5_AUTHDATA;
+
+DECLARE_STACK_OF(KRB5_AUTHDATA)
+
+/*- -- Unencrypted authenticator
+ * Authenticator ::= [APPLICATION 2] SEQUENCE {
+ * authenticator-vno[0] INTEGER,
+ * crealm[1] Realm,
+ * cname[2] PrincipalName,
+ * cksum[3] Checksum OPTIONAL,
+ * cusec[4] INTEGER,
+ * ctime[5] KerberosTime,
+ * subkey[6] EncryptionKey OPTIONAL,
+ * seq-number[7] INTEGER OPTIONAL,
+ * authorization-data[8] AuthorizationData OPTIONAL
+ * }
+ */
+typedef struct krb5_authenticator_st {
+ ASN1_INTEGER *avno;
+ ASN1_GENERALSTRING *crealm;
+ KRB5_PRINCNAME *cname;
+ KRB5_CHECKSUM *cksum;
+ ASN1_INTEGER *cusec;
+ ASN1_GENERALIZEDTIME *ctime;
+ KRB5_ENCKEY *subkey;
+ ASN1_INTEGER *seqnum;
+ KRB5_AUTHDATA *authorization;
+} KRB5_AUTHENTBODY;
+
+typedef STACK_OF(KRB5_AUTHENTBODY) KRB5_AUTHENT;
+DECLARE_STACK_OF(KRB5_AUTHENTBODY)
+
+/*- DECLARE_ASN1_FUNCTIONS(type) = DECLARE_ASN1_FUNCTIONS_name(type, type) =
+ * type *name##_new(void);
+ * void name##_free(type *a);
+ * DECLARE_ASN1_ENCODE_FUNCTIONS(type, name, name) =
+ * DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) =
+ * type *d2i_##name(type **a, const unsigned char **in, long len);
+ * int i2d_##name(type *a, unsigned char **out);
+ * DECLARE_ASN1_ITEM(itname) = OPENSSL_EXTERN const ASN1_ITEM itname##_it
+ */
+
+DECLARE_ASN1_FUNCTIONS(KRB5_ENCDATA)
+DECLARE_ASN1_FUNCTIONS(KRB5_PRINCNAME)
+DECLARE_ASN1_FUNCTIONS(KRB5_TKTBODY)
+DECLARE_ASN1_FUNCTIONS(KRB5_APREQBODY)
+DECLARE_ASN1_FUNCTIONS(KRB5_TICKET)
+DECLARE_ASN1_FUNCTIONS(KRB5_APREQ)
+
+DECLARE_ASN1_FUNCTIONS(KRB5_CHECKSUM)
+DECLARE_ASN1_FUNCTIONS(KRB5_ENCKEY)
+DECLARE_ASN1_FUNCTIONS(KRB5_AUTHDATA)
+DECLARE_ASN1_FUNCTIONS(KRB5_AUTHENTBODY)
+DECLARE_ASN1_FUNCTIONS(KRB5_AUTHENT)
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/deps/openssl/openssl/include/openssl/kssl.h b/deps/openssl/openssl/include/openssl/kssl.h
index 719634aad90..9a576728015 100644
--- a/deps/openssl/openssl/include/openssl/kssl.h
+++ b/deps/openssl/openssl/include/openssl/kssl.h
@@ -1 +1,197 @@
-#include "../../ssl/kssl.h"
+/* ssl/kssl.h -*- mode: C; c-file-style: "eay" -*- */
+/*
+ * Written by Vern Staats <staatsvr@asc.hpc.mil> for the OpenSSL project
+ * 2000. project 2000.
+ */
+/* ====================================================================
+ * Copyright (c) 2000 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * licensing@OpenSSL.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+/*
+ ** 19990701 VRS Started.
+ */
+
+#ifndef KSSL_H
+# define KSSL_H
+
+# include <openssl/opensslconf.h>
+
+# ifndef OPENSSL_NO_KRB5
+
+# include <stdio.h>
+# include <ctype.h>
+# include <krb5.h>
+# ifdef OPENSSL_SYS_WIN32
+/*
+ * These can sometimes get redefined indirectly by krb5 header files after
+ * they get undefed in ossl_typ.h
+ */
+# undef X509_NAME
+# undef X509_EXTENSIONS
+# undef OCSP_REQUEST
+# undef OCSP_RESPONSE
+# endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Depending on which KRB5 implementation used, some types from
+ * the other may be missing. Resolve that here and now
+ */
+# ifdef KRB5_HEIMDAL
+typedef unsigned char krb5_octet;
+# define FAR
+# else
+
+# ifndef FAR
+# define FAR
+# endif
+
+# endif
+
+/*-
+ * Uncomment this to debug kssl problems or
+ * to trace usage of the Kerberos session key
+ *
+ * #define KSSL_DEBUG
+ */
+
+# ifndef KRB5SVC
+# define KRB5SVC "host"
+# endif
+
+# ifndef KRB5KEYTAB
+# define KRB5KEYTAB "/etc/krb5.keytab"
+# endif
+
+# ifndef KRB5SENDAUTH
+# define KRB5SENDAUTH 1
+# endif
+
+# ifndef KRB5CHECKAUTH
+# define KRB5CHECKAUTH 1
+# endif
+
+# ifndef KSSL_CLOCKSKEW
+# define KSSL_CLOCKSKEW 300;
+# endif
+
+# define KSSL_ERR_MAX 255
+typedef struct kssl_err_st {
+ int reason;
+ char text[KSSL_ERR_MAX + 1];
+} KSSL_ERR;
+
+/*- Context for passing
+ * (1) Kerberos session key to SSL, and
+ * (2) Config data between application and SSL lib
+ */
+typedef struct kssl_ctx_st {
+ /* used by: disposition: */
+ char *service_name; /* C,S default ok (kssl) */
+ char *service_host; /* C input, REQUIRED */
+ char *client_princ; /* S output from krb5 ticket */
+ char *keytab_file; /* S NULL (/etc/krb5.keytab) */
+ char *cred_cache; /* C NULL (default) */
+ krb5_enctype enctype;
+ int length;
+ krb5_octet FAR *key;
+} KSSL_CTX;
+
+# define KSSL_CLIENT 1
+# define KSSL_SERVER 2
+# define KSSL_SERVICE 3
+# define KSSL_KEYTAB 4
+
+# define KSSL_CTX_OK 0
+# define KSSL_CTX_ERR 1
+# define KSSL_NOMEM 2
+
+/* Public (for use by applications that use OpenSSL with Kerberos 5 support */
+krb5_error_code kssl_ctx_setstring(KSSL_CTX *kssl_ctx, int which, char *text);
+KSSL_CTX *kssl_ctx_new(void);
+KSSL_CTX *kssl_ctx_free(KSSL_CTX *kssl_ctx);
+void kssl_ctx_show(KSSL_CTX *kssl_ctx);
+krb5_error_code kssl_ctx_setprinc(KSSL_CTX *kssl_ctx, int which,
+ krb5_data *realm, krb5_data *entity,
+ int nentities);
+krb5_error_code kssl_cget_tkt(KSSL_CTX *kssl_ctx, krb5_data **enc_tktp,
+ krb5_data *authenp, KSSL_ERR *kssl_err);
+krb5_error_code kssl_sget_tkt(KSSL_CTX *kssl_ctx, krb5_data *indata,
+ krb5_ticket_times *ttimes, KSSL_ERR *kssl_err);
+krb5_error_code kssl_ctx_setkey(KSSL_CTX *kssl_ctx, krb5_keyblock *session);
+void kssl_err_set(KSSL_ERR *kssl_err, int reason, char *text);
+void kssl_krb5_free_data_contents(krb5_context context, krb5_data *data);
+krb5_error_code kssl_build_principal_2(krb5_context context,
+ krb5_principal *princ, int rlen,
+ const char *realm, int slen,
+ const char *svc, int hlen,
+ const char *host);
+krb5_error_code kssl_validate_times(krb5_timestamp atime,
+ krb5_ticket_times *ttimes);
+krb5_error_code kssl_check_authent(KSSL_CTX *kssl_ctx, krb5_data *authentp,
+ krb5_timestamp *atimep,
+ KSSL_ERR *kssl_err);
+unsigned char *kssl_skip_confound(krb5_enctype enctype, unsigned char *authn);
+
+void SSL_set0_kssl_ctx(SSL *s, KSSL_CTX *kctx);
+KSSL_CTX *SSL_get0_kssl_ctx(SSL *s);
+char *kssl_ctx_get0_client_princ(KSSL_CTX *kctx);
+
+#ifdef __cplusplus
+}
+#endif
+# endif /* OPENSSL_NO_KRB5 */
+#endif /* KSSL_H */
diff --git a/deps/openssl/openssl/include/openssl/lhash.h b/deps/openssl/openssl/include/openssl/lhash.h
index 2d3db87cd5d..b6c328bffbb 100644
--- a/deps/openssl/openssl/include/openssl/lhash.h
+++ b/deps/openssl/openssl/include/openssl/lhash.h
@@ -1 +1,240 @@
-#include "../../crypto/lhash/lhash.h"
+/* crypto/lhash/lhash.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+/*
+ * Header for dynamic hash table routines Author - Eric Young
+ */
+
+#ifndef HEADER_LHASH_H
+# define HEADER_LHASH_H
+
+# include <openssl/e_os2.h>
+# ifndef OPENSSL_NO_FP_API
+# include <stdio.h>
+# endif
+
+# ifndef OPENSSL_NO_BIO
+# include <openssl/bio.h>
+# endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct lhash_node_st {
+ void *data;
+ struct lhash_node_st *next;
+# ifndef OPENSSL_NO_HASH_COMP
+ unsigned long hash;
+# endif
+} LHASH_NODE;
+
+typedef int (*LHASH_COMP_FN_TYPE) (const void *, const void *);
+typedef unsigned long (*LHASH_HASH_FN_TYPE) (const void *);
+typedef void (*LHASH_DOALL_FN_TYPE) (void *);
+typedef void (*LHASH_DOALL_ARG_FN_TYPE) (void *, void *);
+
+/*
+ * Macros for declaring and implementing type-safe wrappers for LHASH
+ * callbacks. This way, callbacks can be provided to LHASH structures without
+ * function pointer casting and the macro-defined callbacks provide
+ * per-variable casting before deferring to the underlying type-specific
+ * callbacks. NB: It is possible to place a "static" in front of both the
+ * DECLARE and IMPLEMENT macros if the functions are strictly internal.
+ */
+
+/* First: "hash" functions */
+# define DECLARE_LHASH_HASH_FN(name, o_type) \
+ unsigned long name##_LHASH_HASH(const void *);
+# define IMPLEMENT_LHASH_HASH_FN(name, o_type) \
+ unsigned long name##_LHASH_HASH(const void *arg) { \
+ const o_type *a = arg; \
+ return name##_hash(a); }
+# define LHASH_HASH_FN(name) name##_LHASH_HASH
+
+/* Second: "compare" functions */
+# define DECLARE_LHASH_COMP_FN(name, o_type) \
+ int name##_LHASH_COMP(const void *, const void *);
+# define IMPLEMENT_LHASH_COMP_FN(name, o_type) \
+ int name##_LHASH_COMP(const void *arg1, const void *arg2) { \
+ const o_type *a = arg1; \
+ const o_type *b = arg2; \
+ return name##_cmp(a,b); }
+# define LHASH_COMP_FN(name) name##_LHASH_COMP
+
+/* Third: "doall" functions */
+# define DECLARE_LHASH_DOALL_FN(name, o_type) \
+ void name##_LHASH_DOALL(void *);
+# define IMPLEMENT_LHASH_DOALL_FN(name, o_type) \
+ void name##_LHASH_DOALL(void *arg) { \
+ o_type *a = arg; \
+ name##_doall(a); }
+# define LHASH_DOALL_FN(name) name##_LHASH_DOALL
+
+/* Fourth: "doall_arg" functions */
+# define DECLARE_LHASH_DOALL_ARG_FN(name, o_type, a_type) \
+ void name##_LHASH_DOALL_ARG(void *, void *);
+# define IMPLEMENT_LHASH_DOALL_ARG_FN(name, o_type, a_type) \
+ void name##_LHASH_DOALL_ARG(void *arg1, void *arg2) { \
+ o_type *a = arg1; \
+ a_type *b = arg2; \
+ name##_doall_arg(a, b); }
+# define LHASH_DOALL_ARG_FN(name) name##_LHASH_DOALL_ARG
+
+typedef struct lhash_st {
+ LHASH_NODE **b;
+ LHASH_COMP_FN_TYPE comp;
+ LHASH_HASH_FN_TYPE hash;
+ unsigned int num_nodes;
+ unsigned int num_alloc_nodes;
+ unsigned int p;
+ unsigned int pmax;
+ unsigned long up_load; /* load times 256 */
+ unsigned long down_load; /* load times 256 */
+ unsigned long num_items;
+ unsigned long num_expands;
+ unsigned long num_expand_reallocs;
+ unsigned long num_contracts;
+ unsigned long num_contract_reallocs;
+ unsigned long num_hash_calls;
+ unsigned long num_comp_calls;
+ unsigned long num_insert;
+ unsigned long num_replace;
+ unsigned long num_delete;
+ unsigned long num_no_delete;
+ unsigned long num_retrieve;
+ unsigned long num_retrieve_miss;
+ unsigned long num_hash_comps;
+ int error;
+} _LHASH; /* Do not use _LHASH directly, use LHASH_OF
+ * and friends */
+
+# define LH_LOAD_MULT 256
+
+/*
+ * Indicates a malloc() error in the last call, this is only bad in
+ * lh_insert().
+ */
+# define lh_error(lh) ((lh)->error)
+
+_LHASH *lh_new(LHASH_HASH_FN_TYPE h, LHASH_COMP_FN_TYPE c);
+void lh_free(_LHASH *lh);
+void *lh_insert(_LHASH *lh, void *data);
+void *lh_delete(_LHASH *lh, const void *data);
+void *lh_retrieve(_LHASH *lh, const void *data);
+void lh_doall(_LHASH *lh, LHASH_DOALL_FN_TYPE func);
+void lh_doall_arg(_LHASH *lh, LHASH_DOALL_ARG_FN_TYPE func, void *arg);
+unsigned long lh_strhash(const char *c);
+unsigned long lh_num_items(const _LHASH *lh);
+
+# ifndef OPENSSL_NO_FP_API
+void lh_stats(const _LHASH *lh, FILE *out);
+void lh_node_stats(const _LHASH *lh, FILE *out);
+void lh_node_usage_stats(const _LHASH *lh, FILE *out);
+# endif
+
+# ifndef OPENSSL_NO_BIO
+void lh_stats_bio(const _LHASH *lh, BIO *out);
+void lh_node_stats_bio(const _LHASH *lh, BIO *out);
+void lh_node_usage_stats_bio(const _LHASH *lh, BIO *out);
+# endif
+
+/* Type checking... */
+
+# define LHASH_OF(type) struct lhash_st_##type
+
+# define DECLARE_LHASH_OF(type) LHASH_OF(type) { int dummy; }
+
+# define CHECKED_LHASH_OF(type,lh) \
+ ((_LHASH *)CHECKED_PTR_OF(LHASH_OF(type),lh))
+
+/* Define wrapper functions. */
+# define LHM_lh_new(type, name) \
+ ((LHASH_OF(type) *)lh_new(LHASH_HASH_FN(name), LHASH_COMP_FN(name)))
+# define LHM_lh_error(type, lh) \
+ lh_error(CHECKED_LHASH_OF(type,lh))
+# define LHM_lh_insert(type, lh, inst) \
+ ((type *)lh_insert(CHECKED_LHASH_OF(type, lh), \
+ CHECKED_PTR_OF(type, inst)))
+# define LHM_lh_retrieve(type, lh, inst) \
+ ((type *)lh_retrieve(CHECKED_LHASH_OF(type, lh), \
+ CHECKED_PTR_OF(type, inst)))
+# define LHM_lh_delete(type, lh, inst) \
+ ((type *)lh_delete(CHECKED_LHASH_OF(type, lh), \
+ CHECKED_PTR_OF(type, inst)))
+# define LHM_lh_doall(type, lh,fn) lh_doall(CHECKED_LHASH_OF(type, lh), fn)
+# define LHM_lh_doall_arg(type, lh, fn, arg_type, arg) \
+ lh_doall_arg(CHECKED_LHASH_OF(type, lh), fn, CHECKED_PTR_OF(arg_type, arg))
+# define LHM_lh_num_items(type, lh) lh_num_items(CHECKED_LHASH_OF(type, lh))
+# define LHM_lh_down_load(type, lh) (CHECKED_LHASH_OF(type, lh)->down_load)
+# define LHM_lh_node_stats_bio(type, lh, out) \
+ lh_node_stats_bio(CHECKED_LHASH_OF(type, lh), out)
+# define LHM_lh_node_usage_stats_bio(type, lh, out) \
+ lh_node_usage_stats_bio(CHECKED_LHASH_OF(type, lh), out)
+# define LHM_lh_stats_bio(type, lh, out) \
+ lh_stats_bio(CHECKED_LHASH_OF(type, lh), out)
+# define LHM_lh_free(type, lh) lh_free(CHECKED_LHASH_OF(type, lh))
+
+DECLARE_LHASH_OF(OPENSSL_STRING);
+DECLARE_LHASH_OF(OPENSSL_CSTRING);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/deps/openssl/openssl/include/openssl/md4.h b/deps/openssl/openssl/include/openssl/md4.h
index 611806e5eaf..11fd71295b5 100644
--- a/deps/openssl/openssl/include/openssl/md4.h
+++ b/deps/openssl/openssl/include/openssl/md4.h
@@ -1 +1,119 @@
-#include "../../crypto/md4/md4.h"
+/* crypto/md4/md4.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_MD4_H
+# define HEADER_MD4_H
+
+# include <openssl/e_os2.h>
+# include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# ifdef OPENSSL_NO_MD4
+# error MD4 is disabled.
+# endif
+
+/*-
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ * ! MD4_LONG has to be at least 32 bits wide. If it's wider, then !
+ * ! MD4_LONG_LOG2 has to be defined along. !
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ */
+
+# if defined(__LP32__)
+# define MD4_LONG unsigned long
+# elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__)
+# define MD4_LONG unsigned long
+# define MD4_LONG_LOG2 3
+/*
+ * _CRAY note. I could declare short, but I have no idea what impact
+ * does it have on performance on none-T3E machines. I could declare
+ * int, but at least on C90 sizeof(int) can be chosen at compile time.
+ * So I've chosen long...
+ * <appro@fy.chalmers.se>
+ */
+# else
+# define MD4_LONG unsigned int
+# endif
+
+# define MD4_CBLOCK 64
+# define MD4_LBLOCK (MD4_CBLOCK/4)
+# define MD4_DIGEST_LENGTH 16
+
+typedef struct MD4state_st {
+ MD4_LONG A, B, C, D;
+ MD4_LONG Nl, Nh;
+ MD4_LONG data[MD4_LBLOCK];
+ unsigned int num;
+} MD4_CTX;
+
+# ifdef OPENSSL_FIPS
+int private_MD4_Init(MD4_CTX *c);
+# endif
+int MD4_Init(MD4_CTX *c);
+int MD4_Update(MD4_CTX *c, const void *data, size_t len);
+int MD4_Final(unsigned char *md, MD4_CTX *c);
+unsigned char *MD4(const unsigned char *d, size_t n, unsigned char *md);
+void MD4_Transform(MD4_CTX *c, const unsigned char *b);
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/deps/openssl/openssl/include/openssl/md5.h b/deps/openssl/openssl/include/openssl/md5.h
index aa8cd0bf863..2659038abd2 100644
--- a/deps/openssl/openssl/include/openssl/md5.h
+++ b/deps/openssl/openssl/include/openssl/md5.h
@@ -1 +1,119 @@
-#include "../../crypto/md5/md5.h"
+/* crypto/md5/md5.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_MD5_H
+# define HEADER_MD5_H
+
+# include <openssl/e_os2.h>
+# include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# ifdef OPENSSL_NO_MD5
+# error MD5 is disabled.
+# endif
+
+/*
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ * ! MD5_LONG has to be at least 32 bits wide. If it's wider, then !
+ * ! MD5_LONG_LOG2 has to be defined along. !
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ */
+
+# if defined(__LP32__)
+# define MD5_LONG unsigned long
+# elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__)
+# define MD5_LONG unsigned long
+# define MD5_LONG_LOG2 3
+/*
+ * _CRAY note. I could declare short, but I have no idea what impact
+ * does it have on performance on none-T3E machines. I could declare
+ * int, but at least on C90 sizeof(int) can be chosen at compile time.
+ * So I've chosen long...
+ * <appro@fy.chalmers.se>
+ */
+# else
+# define MD5_LONG unsigned int
+# endif
+
+# define MD5_CBLOCK 64
+# define MD5_LBLOCK (MD5_CBLOCK/4)
+# define MD5_DIGEST_LENGTH 16
+
+typedef struct MD5state_st {
+ MD5_LONG A, B, C, D;
+ MD5_LONG Nl, Nh;
+ MD5_LONG data[MD5_LBLOCK];
+ unsigned int num;
+} MD5_CTX;
+
+# ifdef OPENSSL_FIPS
+int private_MD5_Init(MD5_CTX *c);
+# endif
+int MD5_Init(MD5_CTX *c);
+int MD5_Update(MD5_CTX *c, const void *data, size_t len);
+int MD5_Final(unsigned char *md, MD5_CTX *c);
+unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md);
+void MD5_Transform(MD5_CTX *c, const unsigned char *b);
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/deps/openssl/openssl/include/openssl/mdc2.h b/deps/openssl/openssl/include/openssl/mdc2.h
index ac284a179a0..7efe53bc294 100644
--- a/deps/openssl/openssl/include/openssl/mdc2.h
+++ b/deps/openssl/openssl/include/openssl/mdc2.h
@@ -1 +1,94 @@
-#include "../../crypto/mdc2/mdc2.h"
+/* crypto/mdc2/mdc2.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_MDC2_H
+# define HEADER_MDC2_H
+
+# include <openssl/des.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# ifdef OPENSSL_NO_MDC2
+# error MDC2 is disabled.
+# endif
+
+# define MDC2_BLOCK 8
+# define MDC2_DIGEST_LENGTH 16
+
+typedef struct mdc2_ctx_st {
+ unsigned int num;
+ unsigned char data[MDC2_BLOCK];
+ DES_cblock h, hh;
+ int pad_type; /* either 1 or 2, default 1 */
+} MDC2_CTX;
+
+# ifdef OPENSSL_FIPS
+int private_MDC2_Init(MDC2_CTX *c);
+# endif
+int MDC2_Init(MDC2_CTX *c);
+int MDC2_Update(MDC2_CTX *c, const unsigned char *data, size_t len);
+int MDC2_Final(unsigned char *md, MDC2_CTX *c);
+unsigned char *MDC2(const unsigned char *d, size_t n, unsigned char *md);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/deps/openssl/openssl/include/openssl/modes.h b/deps/openssl/openssl/include/openssl/modes.h
index f57fcfea800..fd488499a0b 100644
--- a/deps/openssl/openssl/include/openssl/modes.h
+++ b/deps/openssl/openssl/include/openssl/modes.h
@@ -1 +1,163 @@
-#include "../../crypto/modes/modes.h"
+/* ====================================================================
+ * Copyright (c) 2008 The OpenSSL Project. All rights reserved.
+ *
+ * Rights for redistribution and usage in source and binary
+ * forms are granted according to the OpenSSL license.
+ */
+
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+typedef void (*block128_f) (const unsigned char in[16],
+ unsigned char out[16], const void *key);
+
+typedef void (*cbc128_f) (const unsigned char *in, unsigned char *out,
+ size_t len, const void *key,
+ unsigned char ivec[16], int enc);
+
+typedef void (*ctr128_f) (const unsigned char *in, unsigned char *out,
+ size_t blocks, const void *key,
+ const unsigned char ivec[16]);
+
+typedef void (*ccm128_f) (const unsigned char *in, unsigned char *out,
+ size_t blocks, const void *key,
+ const unsigned char ivec[16],
+ unsigned char cmac[16]);
+
+void CRYPTO_cbc128_encrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const void *key,
+ unsigned char ivec[16], block128_f block);
+void CRYPTO_cbc128_decrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const void *key,
+ unsigned char ivec[16], block128_f block);
+
+void CRYPTO_ctr128_encrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const void *key,
+ unsigned char ivec[16],
+ unsigned char ecount_buf[16], unsigned int *num,
+ block128_f block);
+
+void CRYPTO_ctr128_encrypt_ctr32(const unsigned char *in, unsigned char *out,
+ size_t len, const void *key,
+ unsigned char ivec[16],
+ unsigned char ecount_buf[16],
+ unsigned int *num, ctr128_f ctr);
+
+void CRYPTO_ofb128_encrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const void *key,
+ unsigned char ivec[16], int *num,
+ block128_f block);
+
+void CRYPTO_cfb128_encrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const void *key,
+ unsigned char ivec[16], int *num,
+ int enc, block128_f block);
+void CRYPTO_cfb128_8_encrypt(const unsigned char *in, unsigned char *out,
+ size_t length, const void *key,
+ unsigned char ivec[16], int *num,
+ int enc, block128_f block);
+void CRYPTO_cfb128_1_encrypt(const unsigned char *in, unsigned char *out,
+ size_t bits, const void *key,
+ unsigned char ivec[16], int *num,
+ int enc, block128_f block);
+
+size_t CRYPTO_cts128_encrypt_block(const unsigned char *in,
+ unsigned char *out, size_t len,
+ const void *key, unsigned char ivec[16],
+ block128_f block);
+size_t CRYPTO_cts128_encrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const void *key,
+ unsigned char ivec[16], cbc128_f cbc);
+size_t CRYPTO_cts128_decrypt_block(const unsigned char *in,
+ unsigned char *out, size_t len,
+ const void *key, unsigned char ivec[16],
+ block128_f block);
+size_t CRYPTO_cts128_decrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const void *key,
+ unsigned char ivec[16], cbc128_f cbc);
+
+size_t CRYPTO_nistcts128_encrypt_block(const unsigned char *in,
+ unsigned char *out, size_t len,
+ const void *key,
+ unsigned char ivec[16],
+ block128_f block);
+size_t CRYPTO_nistcts128_encrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const void *key,
+ unsigned char ivec[16], cbc128_f cbc);
+size_t CRYPTO_nistcts128_decrypt_block(const unsigned char *in,
+ unsigned char *out, size_t len,
+ const void *key,
+ unsigned char ivec[16],
+ block128_f block);
+size_t CRYPTO_nistcts128_decrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const void *key,
+ unsigned char ivec[16], cbc128_f cbc);
+
+typedef struct gcm128_context GCM128_CONTEXT;
+
+GCM128_CONTEXT *CRYPTO_gcm128_new(void *key, block128_f block);
+void CRYPTO_gcm128_init(GCM128_CONTEXT *ctx, void *key, block128_f block);
+void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx, const unsigned char *iv,
+ size_t len);
+int CRYPTO_gcm128_aad(GCM128_CONTEXT *ctx, const unsigned char *aad,
+ size_t len);
+int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx,
+ const unsigned char *in, unsigned char *out,
+ size_t len);
+int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx,
+ const unsigned char *in, unsigned char *out,
+ size_t len);
+int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx,
+ const unsigned char *in, unsigned char *out,
+ size_t len, ctr128_f stream);
+int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx,
+ const unsigned char *in, unsigned char *out,
+ size_t len, ctr128_f stream);
+int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx, const unsigned char *tag,
+ size_t len);
+void CRYPTO_gcm128_tag(GCM128_CONTEXT *ctx, unsigned char *tag, size_t len);
+void CRYPTO_gcm128_release(GCM128_CONTEXT *ctx);
+
+typedef struct ccm128_context CCM128_CONTEXT;
+
+void CRYPTO_ccm128_init(CCM128_CONTEXT *ctx,
+ unsigned int M, unsigned int L, void *key,
+ block128_f block);
+int CRYPTO_ccm128_setiv(CCM128_CONTEXT *ctx, const unsigned char *nonce,
+ size_t nlen, size_t mlen);
+void CRYPTO_ccm128_aad(CCM128_CONTEXT *ctx, const unsigned char *aad,
+ size_t alen);
+int CRYPTO_ccm128_encrypt(CCM128_CONTEXT *ctx, const unsigned char *inp,
+ unsigned char *out, size_t len);
+int CRYPTO_ccm128_decrypt(CCM128_CONTEXT *ctx, const unsigned char *inp,
+ unsigned char *out, size_t len);
+int CRYPTO_ccm128_encrypt_ccm64(CCM128_CONTEXT *ctx, const unsigned char *inp,
+ unsigned char *out, size_t len,
+ ccm128_f stream);
+int CRYPTO_ccm128_decrypt_ccm64(CCM128_CONTEXT *ctx, const unsigned char *inp,
+ unsigned char *out, size_t len,
+ ccm128_f stream);
+size_t CRYPTO_ccm128_tag(CCM128_CONTEXT *ctx, unsigned char *tag, size_t len);
+
+typedef struct xts128_context XTS128_CONTEXT;
+
+int CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx,
+ const unsigned char iv[16],
+ const unsigned char *inp, unsigned char *out,
+ size_t len, int enc);
+
+size_t CRYPTO_128_wrap(void *key, const unsigned char *iv,
+ unsigned char *out,
+ const unsigned char *in, size_t inlen,
+ block128_f block);
+
+size_t CRYPTO_128_unwrap(void *key, const unsigned char *iv,
+ unsigned char *out,
+ const unsigned char *in, size_t inlen,
+ block128_f block);
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/deps/openssl/openssl/include/openssl/obj_mac.h b/deps/openssl/openssl/include/openssl/obj_mac.h
index 3890fa9bc41..779c309b869 100644
--- a/deps/openssl/openssl/include/openssl/obj_mac.h
+++ b/deps/openssl/openssl/include/openssl/obj_mac.h
@@ -1 +1,4194 @@
-#include "../../crypto/objects/obj_mac.h"
+/* crypto/objects/obj_mac.h */
+
+/*
+ * THIS FILE IS GENERATED FROM objects.txt by objects.pl via the following
+ * command: perl objects.pl objects.txt obj_mac.num obj_mac.h
+ */
+
+/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#define SN_undef "UNDEF"
+#define LN_undef "undefined"
+#define NID_undef 0
+#define OBJ_undef 0L
+
+#define SN_itu_t "ITU-T"
+#define LN_itu_t "itu-t"
+#define NID_itu_t 645
+#define OBJ_itu_t 0L
+
+#define NID_ccitt 404
+#define OBJ_ccitt OBJ_itu_t
+
+#define SN_iso "ISO"
+#define LN_iso "iso"
+#define NID_iso 181
+#define OBJ_iso 1L
+
+#define SN_joint_iso_itu_t "JOINT-ISO-ITU-T"
+#define LN_joint_iso_itu_t "joint-iso-itu-t"
+#define NID_joint_iso_itu_t 646
+#define OBJ_joint_iso_itu_t 2L
+
+#define NID_joint_iso_ccitt 393
+#define OBJ_joint_iso_ccitt OBJ_joint_iso_itu_t
+
+#define SN_member_body "member-body"
+#define LN_member_body "ISO Member Body"
+#define NID_member_body 182
+#define OBJ_member_body OBJ_iso,2L
+
+#define SN_identified_organization "identified-organization"
+#define NID_identified_organization 676
+#define OBJ_identified_organization OBJ_iso,3L
+
+#define SN_hmac_md5 "HMAC-MD5"
+#define LN_hmac_md5 "hmac-md5"
+#define NID_hmac_md5 780
+#define OBJ_hmac_md5 OBJ_identified_organization,6L,1L,5L,5L,8L,1L,1L
+
+#define SN_hmac_sha1 "HMAC-SHA1"
+#define LN_hmac_sha1 "hmac-sha1"
+#define NID_hmac_sha1 781
+#define OBJ_hmac_sha1 OBJ_identified_organization,6L,1L,5L,5L,8L,1L,2L
+
+#define SN_certicom_arc "certicom-arc"
+#define NID_certicom_arc 677
+#define OBJ_certicom_arc OBJ_identified_organization,132L
+
+#define SN_international_organizations "international-organizations"
+#define LN_international_organizations "International Organizations"
+#define NID_international_organizations 647
+#define OBJ_international_organizations OBJ_joint_iso_itu_t,23L
+
+#define SN_wap "wap"
+#define NID_wap 678
+#define OBJ_wap OBJ_international_organizations,43L
+
+#define SN_wap_wsg "wap-wsg"
+#define NID_wap_wsg 679
+#define OBJ_wap_wsg OBJ_wap,1L
+
+#define SN_selected_attribute_types "selected-attribute-types"
+#define LN_selected_attribute_types "Selected Attribute Types"
+#define NID_selected_attribute_types 394
+#define OBJ_selected_attribute_types OBJ_joint_iso_itu_t,5L,1L,5L
+
+#define SN_clearance "clearance"
+#define NID_clearance 395
+#define OBJ_clearance OBJ_selected_attribute_types,55L
+
+#define SN_ISO_US "ISO-US"
+#define LN_ISO_US "ISO US Member Body"
+#define NID_ISO_US 183
+#define OBJ_ISO_US OBJ_member_body,840L
+
+#define SN_X9_57 "X9-57"
+#define LN_X9_57 "X9.57"
+#define NID_X9_57 184
+#define OBJ_X9_57 OBJ_ISO_US,10040L
+
+#define SN_X9cm "X9cm"
+#define LN_X9cm "X9.57 CM ?"
+#define NID_X9cm 185
+#define OBJ_X9cm OBJ_X9_57,4L
+
+#define SN_dsa "DSA"
+#define LN_dsa "dsaEncryption"
+#define NID_dsa 116
+#define OBJ_dsa OBJ_X9cm,1L
+
+#define SN_dsaWithSHA1 "DSA-SHA1"
+#define LN_dsaWithSHA1 "dsaWithSHA1"
+#define NID_dsaWithSHA1 113
+#define OBJ_dsaWithSHA1 OBJ_X9cm,3L
+
+#define SN_ansi_X9_62 "ansi-X9-62"
+#define LN_ansi_X9_62 "ANSI X9.62"
+#define NID_ansi_X9_62 405
+#define OBJ_ansi_X9_62 OBJ_ISO_US,10045L
+
+#define OBJ_X9_62_id_fieldType OBJ_ansi_X9_62,1L
+
+#define SN_X9_62_prime_field "prime-field"
+#define NID_X9_62_prime_field 406
+#define OBJ_X9_62_prime_field OBJ_X9_62_id_fieldType,1L
+
+#define SN_X9_62_characteristic_two_field "characteristic-two-field"
+#define NID_X9_62_characteristic_two_field 407
+#define OBJ_X9_62_characteristic_two_field OBJ_X9_62_id_fieldType,2L
+
+#define SN_X9_62_id_characteristic_two_basis "id-characteristic-two-basis"
+#define NID_X9_62_id_characteristic_two_basis 680
+#define OBJ_X9_62_id_characteristic_two_basis OBJ_X9_62_characteristic_two_field,3L
+
+#define SN_X9_62_onBasis "onBasis"
+#define NID_X9_62_onBasis 681
+#define OBJ_X9_62_onBasis OBJ_X9_62_id_characteristic_two_basis,1L
+
+#define SN_X9_62_tpBasis "tpBasis"
+#define NID_X9_62_tpBasis 682
+#define OBJ_X9_62_tpBasis OBJ_X9_62_id_characteristic_two_basis,2L
+
+#define SN_X9_62_ppBasis "ppBasis"
+#define NID_X9_62_ppBasis 683
+#define OBJ_X9_62_ppBasis OBJ_X9_62_id_characteristic_two_basis,3L
+
+#define OBJ_X9_62_id_publicKeyType OBJ_ansi_X9_62,2L
+
+#define SN_X9_62_id_ecPublicKey "id-ecPublicKey"
+#define NID_X9_62_id_ecPublicKey 408
+#define OBJ_X9_62_id_ecPublicKey OBJ_X9_62_id_publicKeyType,1L
+
+#define OBJ_X9_62_ellipticCurve OBJ_ansi_X9_62,3L
+
+#define OBJ_X9_62_c_TwoCurve OBJ_X9_62_ellipticCurve,0L
+
+#define SN_X9_62_c2pnb163v1 "c2pnb163v1"
+#define NID_X9_62_c2pnb163v1 684
+#define OBJ_X9_62_c2pnb163v1 OBJ_X9_62_c_TwoCurve,1L
+
+#define SN_X9_62_c2pnb163v2 "c2pnb163v2"
+#define NID_X9_62_c2pnb163v2 685
+#define OBJ_X9_62_c2pnb163v2 OBJ_X9_62_c_TwoCurve,2L
+
+#define SN_X9_62_c2pnb163v3 "c2pnb163v3"
+#define NID_X9_62_c2pnb163v3 686
+#define OBJ_X9_62_c2pnb163v3 OBJ_X9_62_c_TwoCurve,3L
+
+#define SN_X9_62_c2pnb176v1 "c2pnb176v1"
+#define NID_X9_62_c2pnb176v1 687
+#define OBJ_X9_62_c2pnb176v1 OBJ_X9_62_c_TwoCurve,4L
+
+#define SN_X9_62_c2tnb191v1 "c2tnb191v1"
+#define NID_X9_62_c2tnb191v1 688
+#define OBJ_X9_62_c2tnb191v1 OBJ_X9_62_c_TwoCurve,5L
+
+#define SN_X9_62_c2tnb191v2 "c2tnb191v2"
+#define NID_X9_62_c2tnb191v2 689
+#define OBJ_X9_62_c2tnb191v2 OBJ_X9_62_c_TwoCurve,6L
+
+#define SN_X9_62_c2tnb191v3 "c2tnb191v3"
+#define NID_X9_62_c2tnb191v3 690
+#define OBJ_X9_62_c2tnb191v3 OBJ_X9_62_c_TwoCurve,7L
+
+#define SN_X9_62_c2onb191v4 "c2onb191v4"
+#define NID_X9_62_c2onb191v4 691
+#define OBJ_X9_62_c2onb191v4 OBJ_X9_62_c_TwoCurve,8L
+
+#define SN_X9_62_c2onb191v5 "c2onb191v5"
+#define NID_X9_62_c2onb191v5 692
+#define OBJ_X9_62_c2onb191v5 OBJ_X9_62_c_TwoCurve,9L
+
+#define SN_X9_62_c2pnb208w1 "c2pnb208w1"
+#define NID_X9_62_c2pnb208w1 693
+#define OBJ_X9_62_c2pnb208w1 OBJ_X9_62_c_TwoCurve,10L
+
+#define SN_X9_62_c2tnb239v1 "c2tnb239v1"
+#define NID_X9_62_c2tnb239v1 694
+#define OBJ_X9_62_c2tnb239v1 OBJ_X9_62_c_TwoCurve,11L
+
+#define SN_X9_62_c2tnb239v2 "c2tnb239v2"
+#define NID_X9_62_c2tnb239v2 695
+#define OBJ_X9_62_c2tnb239v2 OBJ_X9_62_c_TwoCurve,12L
+
+#define SN_X9_62_c2tnb239v3 "c2tnb239v3"
+#define NID_X9_62_c2tnb239v3 696
+#define OBJ_X9_62_c2tnb239v3 OBJ_X9_62_c_TwoCurve,13L
+
+#define SN_X9_62_c2onb239v4 "c2onb239v4"
+#define NID_X9_62_c2onb239v4 697
+#define OBJ_X9_62_c2onb239v4 OBJ_X9_62_c_TwoCurve,14L
+
+#define SN_X9_62_c2onb239v5 "c2onb239v5"
+#define NID_X9_62_c2onb239v5 698
+#define OBJ_X9_62_c2onb239v5 OBJ_X9_62_c_TwoCurve,15L
+
+#define SN_X9_62_c2pnb272w1 "c2pnb272w1"
+#define NID_X9_62_c2pnb272w1 699
+#define OBJ_X9_62_c2pnb272w1 OBJ_X9_62_c_TwoCurve,16L
+
+#define SN_X9_62_c2pnb304w1 "c2pnb304w1"
+#define NID_X9_62_c2pnb304w1 700
+#define OBJ_X9_62_c2pnb304w1 OBJ_X9_62_c_TwoCurve,17L
+
+#define SN_X9_62_c2tnb359v1 "c2tnb359v1"
+#define NID_X9_62_c2tnb359v1 701
+#define OBJ_X9_62_c2tnb359v1 OBJ_X9_62_c_TwoCurve,18L
+
+#define SN_X9_62_c2pnb368w1 "c2pnb368w1"
+#define NID_X9_62_c2pnb368w1 702
+#define OBJ_X9_62_c2pnb368w1 OBJ_X9_62_c_TwoCurve,19L
+
+#define SN_X9_62_c2tnb431r1 "c2tnb431r1"
+#define NID_X9_62_c2tnb431r1 703
+#define OBJ_X9_62_c2tnb431r1 OBJ_X9_62_c_TwoCurve,20L
+
+#define OBJ_X9_62_primeCurve OBJ_X9_62_ellipticCurve,1L
+
+#define SN_X9_62_prime192v1 "prime192v1"
+#define NID_X9_62_prime192v1 409
+#define OBJ_X9_62_prime192v1 OBJ_X9_62_primeCurve,1L
+
+#define SN_X9_62_prime192v2 "prime192v2"
+#define NID_X9_62_prime192v2 410
+#define OBJ_X9_62_prime192v2 OBJ_X9_62_primeCurve,2L
+
+#define SN_X9_62_prime192v3 "prime192v3"
+#define NID_X9_62_prime192v3 411
+#define OBJ_X9_62_prime192v3 OBJ_X9_62_primeCurve,3L
+
+#define SN_X9_62_prime239v1 "prime239v1"
+#define NID_X9_62_prime239v1 412
+#define OBJ_X9_62_prime239v1 OBJ_X9_62_primeCurve,4L
+
+#define SN_X9_62_prime239v2 "prime239v2"
+#define NID_X9_62_prime239v2 413
+#define OBJ_X9_62_prime239v2 OBJ_X9_62_primeCurve,5L
+
+#define SN_X9_62_prime239v3 "prime239v3"
+#define NID_X9_62_prime239v3 414
+#define OBJ_X9_62_prime239v3 OBJ_X9_62_primeCurve,6L
+
+#define SN_X9_62_prime256v1 "prime256v1"
+#define NID_X9_62_prime256v1 415
+#define OBJ_X9_62_prime256v1 OBJ_X9_62_primeCurve,7L
+
+#define OBJ_X9_62_id_ecSigType OBJ_ansi_X9_62,4L
+
+#define SN_ecdsa_with_SHA1 "ecdsa-with-SHA1"
+#define NID_ecdsa_with_SHA1 416
+#define OBJ_ecdsa_with_SHA1 OBJ_X9_62_id_ecSigType,1L
+
+#define SN_ecdsa_with_Recommended "ecdsa-with-Recommended"
+#define NID_ecdsa_with_Recommended 791
+#define OBJ_ecdsa_with_Recommended OBJ_X9_62_id_ecSigType,2L
+
+#define SN_ecdsa_with_Specified "ecdsa-with-Specified"
+#define NID_ecdsa_with_Specified 792
+#define OBJ_ecdsa_with_Specified OBJ_X9_62_id_ecSigType,3L
+
+#define SN_ecdsa_with_SHA224 "ecdsa-with-SHA224"
+#define NID_ecdsa_with_SHA224 793
+#define OBJ_ecdsa_with_SHA224 OBJ_ecdsa_with_Specified,1L
+
+#define SN_ecdsa_with_SHA256 "ecdsa-with-SHA256"
+#define NID_ecdsa_with_SHA256 794
+#define OBJ_ecdsa_with_SHA256 OBJ_ecdsa_with_Specified,2L
+
+#define SN_ecdsa_with_SHA384 "ecdsa-with-SHA384"
+#define NID_ecdsa_with_SHA384 795
+#define OBJ_ecdsa_with_SHA384 OBJ_ecdsa_with_Specified,3L
+
+#define SN_ecdsa_with_SHA512 "ecdsa-with-SHA512"
+#define NID_ecdsa_with_SHA512 796
+#define OBJ_ecdsa_with_SHA512 OBJ_ecdsa_with_Specified,4L
+
+#define OBJ_secg_ellipticCurve OBJ_certicom_arc,0L
+
+#define SN_secp112r1 "secp112r1"
+#define NID_secp112r1 704
+#define OBJ_secp112r1 OBJ_secg_ellipticCurve,6L
+
+#define SN_secp112r2 "secp112r2"
+#define NID_secp112r2 705
+#define OBJ_secp112r2 OBJ_secg_ellipticCurve,7L
+
+#define SN_secp128r1 "secp128r1"
+#define NID_secp128r1 706
+#define OBJ_secp128r1 OBJ_secg_ellipticCurve,28L
+
+#define SN_secp128r2 "secp128r2"
+#define NID_secp128r2 707
+#define OBJ_secp128r2 OBJ_secg_ellipticCurve,29L
+
+#define SN_secp160k1 "secp160k1"
+#define NID_secp160k1 708
+#define OBJ_secp160k1 OBJ_secg_ellipticCurve,9L
+
+#define SN_secp160r1 "secp160r1"
+#define NID_secp160r1 709
+#define OBJ_secp160r1 OBJ_secg_ellipticCurve,8L
+
+#define SN_secp160r2 "secp160r2"
+#define NID_secp160r2 710
+#define OBJ_secp160r2 OBJ_secg_ellipticCurve,30L
+
+#define SN_secp192k1 "secp192k1"
+#define NID_secp192k1 711
+#define OBJ_secp192k1 OBJ_secg_ellipticCurve,31L
+
+#define SN_secp224k1 "secp224k1"
+#define NID_secp224k1 712
+#define OBJ_secp224k1 OBJ_secg_ellipticCurve,32L
+
+#define SN_secp224r1 "secp224r1"
+#define NID_secp224r1 713
+#define OBJ_secp224r1 OBJ_secg_ellipticCurve,33L
+
+#define SN_secp256k1 "secp256k1"
+#define NID_secp256k1 714
+#define OBJ_secp256k1 OBJ_secg_ellipticCurve,10L
+
+#define SN_secp384r1 "secp384r1"
+#define NID_secp384r1 715
+#define OBJ_secp384r1 OBJ_secg_ellipticCurve,34L
+
+#define SN_secp521r1 "secp521r1"
+#define NID_secp521r1 716
+#define OBJ_secp521r1 OBJ_secg_ellipticCurve,35L
+
+#define SN_sect113r1 "sect113r1"
+#define NID_sect113r1 717
+#define OBJ_sect113r1 OBJ_secg_ellipticCurve,4L
+
+#define SN_sect113r2 "sect113r2"
+#define NID_sect113r2 718
+#define OBJ_sect113r2 OBJ_secg_ellipticCurve,5L
+
+#define SN_sect131r1 "sect131r1"
+#define NID_sect131r1 719
+#define OBJ_sect131r1 OBJ_secg_ellipticCurve,22L
+
+#define SN_sect131r2 "sect131r2"
+#define NID_sect131r2 720
+#define OBJ_sect131r2 OBJ_secg_ellipticCurve,23L
+
+#define SN_sect163k1 "sect163k1"
+#define NID_sect163k1 721
+#define OBJ_sect163k1 OBJ_secg_ellipticCurve,1L
+
+#define SN_sect163r1 "sect163r1"
+#define NID_sect163r1 722
+#define OBJ_sect163r1 OBJ_secg_ellipticCurve,2L
+
+#define SN_sect163r2 "sect163r2"
+#define NID_sect163r2 723
+#define OBJ_sect163r2 OBJ_secg_ellipticCurve,15L
+
+#define SN_sect193r1 "sect193r1"
+#define NID_sect193r1 724
+#define OBJ_sect193r1 OBJ_secg_ellipticCurve,24L
+
+#define SN_sect193r2 "sect193r2"
+#define NID_sect193r2 725
+#define OBJ_sect193r2 OBJ_secg_ellipticCurve,25L
+
+#define SN_sect233k1 "sect233k1"
+#define NID_sect233k1 726
+#define OBJ_sect233k1 OBJ_secg_ellipticCurve,26L
+
+#define SN_sect233r1 "sect233r1"
+#define NID_sect233r1 727
+#define OBJ_sect233r1 OBJ_secg_ellipticCurve,27L
+
+#define SN_sect239k1 "sect239k1"
+#define NID_sect239k1 728
+#define OBJ_sect239k1 OBJ_secg_ellipticCurve,3L
+
+#define SN_sect283k1 "sect283k1"
+#define NID_sect283k1 729
+#define OBJ_sect283k1 OBJ_secg_ellipticCurve,16L
+
+#define SN_sect283r1 "sect283r1"
+#define NID_sect283r1 730
+#define OBJ_sect283r1 OBJ_secg_ellipticCurve,17L
+
+#define SN_sect409k1 "sect409k1"
+#define NID_sect409k1 731
+#define OBJ_sect409k1 OBJ_secg_ellipticCurve,36L
+
+#define SN_sect409r1 "sect409r1"
+#define NID_sect409r1 732
+#define OBJ_sect409r1 OBJ_secg_ellipticCurve,37L
+
+#define SN_sect571k1 "sect571k1"
+#define NID_sect571k1 733
+#define OBJ_sect571k1 OBJ_secg_ellipticCurve,38L
+
+#define SN_sect571r1 "sect571r1"
+#define NID_sect571r1 734
+#define OBJ_sect571r1 OBJ_secg_ellipticCurve,39L
+
+#define OBJ_wap_wsg_idm_ecid OBJ_wap_wsg,4L
+
+#define SN_wap_wsg_idm_ecid_wtls1 "wap-wsg-idm-ecid-wtls1"
+#define NID_wap_wsg_idm_ecid_wtls1 735
+#define OBJ_wap_wsg_idm_ecid_wtls1 OBJ_wap_wsg_idm_ecid,1L
+
+#define SN_wap_wsg_idm_ecid_wtls3 "wap-wsg-idm-ecid-wtls3"
+#define NID_wap_wsg_idm_ecid_wtls3 736
+#define OBJ_wap_wsg_idm_ecid_wtls3 OBJ_wap_wsg_idm_ecid,3L
+
+#define SN_wap_wsg_idm_ecid_wtls4 "wap-wsg-idm-ecid-wtls4"
+#define NID_wap_wsg_idm_ecid_wtls4 737
+#define OBJ_wap_wsg_idm_ecid_wtls4 OBJ_wap_wsg_idm_ecid,4L
+
+#define SN_wap_wsg_idm_ecid_wtls5 "wap-wsg-idm-ecid-wtls5"
+#define NID_wap_wsg_idm_ecid_wtls5 738
+#define OBJ_wap_wsg_idm_ecid_wtls5 OBJ_wap_wsg_idm_ecid,5L
+
+#define SN_wap_wsg_idm_ecid_wtls6 "wap-wsg-idm-ecid-wtls6"
+#define NID_wap_wsg_idm_ecid_wtls6 739
+#define OBJ_wap_wsg_idm_ecid_wtls6 OBJ_wap_wsg_idm_ecid,6L
+
+#define SN_wap_wsg_idm_ecid_wtls7 "wap-wsg-idm-ecid-wtls7"
+#define NID_wap_wsg_idm_ecid_wtls7 740
+#define OBJ_wap_wsg_idm_ecid_wtls7 OBJ_wap_wsg_idm_ecid,7L
+
+#define SN_wap_wsg_idm_ecid_wtls8 "wap-wsg-idm-ecid-wtls8"
+#define NID_wap_wsg_idm_ecid_wtls8 741
+#define OBJ_wap_wsg_idm_ecid_wtls8 OBJ_wap_wsg_idm_ecid,8L
+
+#define SN_wap_wsg_idm_ecid_wtls9 "wap-wsg-idm-ecid-wtls9"
+#define NID_wap_wsg_idm_ecid_wtls9 742
+#define OBJ_wap_wsg_idm_ecid_wtls9 OBJ_wap_wsg_idm_ecid,9L
+
+#define SN_wap_wsg_idm_ecid_wtls10 "wap-wsg-idm-ecid-wtls10"
+#define NID_wap_wsg_idm_ecid_wtls10 743
+#define OBJ_wap_wsg_idm_ecid_wtls10 OBJ_wap_wsg_idm_ecid,10L
+
+#define SN_wap_wsg_idm_ecid_wtls11 "wap-wsg-idm-ecid-wtls11"
+#define NID_wap_wsg_idm_ecid_wtls11 744
+#define OBJ_wap_wsg_idm_ecid_wtls11 OBJ_wap_wsg_idm_ecid,11L
+
+#define SN_wap_wsg_idm_ecid_wtls12 "wap-wsg-idm-ecid-wtls12"
+#define NID_wap_wsg_idm_ecid_wtls12 745
+#define OBJ_wap_wsg_idm_ecid_wtls12 OBJ_wap_wsg_idm_ecid,12L
+
+#define SN_cast5_cbc "CAST5-CBC"
+#define LN_cast5_cbc "cast5-cbc"
+#define NID_cast5_cbc 108
+#define OBJ_cast5_cbc OBJ_ISO_US,113533L,7L,66L,10L
+
+#define SN_cast5_ecb "CAST5-ECB"
+#define LN_cast5_ecb "cast5-ecb"
+#define NID_cast5_ecb 109
+
+#define SN_cast5_cfb64 "CAST5-CFB"
+#define LN_cast5_cfb64 "cast5-cfb"
+#define NID_cast5_cfb64 110
+
+#define SN_cast5_ofb64 "CAST5-OFB"
+#define LN_cast5_ofb64 "cast5-ofb"
+#define NID_cast5_ofb64 111
+
+#define LN_pbeWithMD5AndCast5_CBC "pbeWithMD5AndCast5CBC"
+#define NID_pbeWithMD5AndCast5_CBC 112
+#define OBJ_pbeWithMD5AndCast5_CBC OBJ_ISO_US,113533L,7L,66L,12L
+
+#define SN_id_PasswordBasedMAC "id-PasswordBasedMAC"
+#define LN_id_PasswordBasedMAC "password based MAC"
+#define NID_id_PasswordBasedMAC 782
+#define OBJ_id_PasswordBasedMAC OBJ_ISO_US,113533L,7L,66L,13L
+
+#define SN_id_DHBasedMac "id-DHBasedMac"
+#define LN_id_DHBasedMac "Diffie-Hellman based MAC"
+#define NID_id_DHBasedMac 783
+#define OBJ_id_DHBasedMac OBJ_ISO_US,113533L,7L,66L,30L
+
+#define SN_rsadsi "rsadsi"
+#define LN_rsadsi "RSA Data Security, Inc."
+#define NID_rsadsi 1
+#define OBJ_rsadsi OBJ_ISO_US,113549L
+
+#define SN_pkcs "pkcs"
+#define LN_pkcs "RSA Data Security, Inc. PKCS"
+#define NID_pkcs 2
+#define OBJ_pkcs OBJ_rsadsi,1L
+
+#define SN_pkcs1 "pkcs1"
+#define NID_pkcs1 186
+#define OBJ_pkcs1 OBJ_pkcs,1L
+
+#define LN_rsaEncryption "rsaEncryption"
+#define NID_rsaEncryption 6
+#define OBJ_rsaEncryption OBJ_pkcs1,1L
+
+#define SN_md2WithRSAEncryption "RSA-MD2"
+#define LN_md2WithRSAEncryption "md2WithRSAEncryption"
+#define NID_md2WithRSAEncryption 7
+#define OBJ_md2WithRSAEncryption OBJ_pkcs1,2L
+
+#define SN_md4WithRSAEncryption "RSA-MD4"
+#define LN_md4WithRSAEncryption "md4WithRSAEncryption"
+#define NID_md4WithRSAEncryption 396
+#define OBJ_md4WithRSAEncryption OBJ_pkcs1,3L
+
+#define SN_md5WithRSAEncryption "RSA-MD5"
+#define LN_md5WithRSAEncryption "md5WithRSAEncryption"
+#define NID_md5WithRSAEncryption 8
+#define OBJ_md5WithRSAEncryption OBJ_pkcs1,4L
+
+#define SN_sha1WithRSAEncryption "RSA-SHA1"
+#define LN_sha1WithRSAEncryption "sha1WithRSAEncryption"
+#define NID_sha1WithRSAEncryption 65
+#define OBJ_sha1WithRSAEncryption OBJ_pkcs1,5L
+
+#define SN_rsaesOaep "RSAES-OAEP"
+#define LN_rsaesOaep "rsaesOaep"
+#define NID_rsaesOaep 919
+#define OBJ_rsaesOaep OBJ_pkcs1,7L
+
+#define SN_mgf1 "MGF1"
+#define LN_mgf1 "mgf1"
+#define NID_mgf1 911
+#define OBJ_mgf1 OBJ_pkcs1,8L
+
+#define SN_pSpecified "PSPECIFIED"
+#define LN_pSpecified "pSpecified"
+#define NID_pSpecified 935
+#define OBJ_pSpecified OBJ_pkcs1,9L
+
+#define SN_rsassaPss "RSASSA-PSS"
+#define LN_rsassaPss "rsassaPss"
+#define NID_rsassaPss 912
+#define OBJ_rsassaPss OBJ_pkcs1,10L
+
+#define SN_sha256WithRSAEncryption "RSA-SHA256"
+#define LN_sha256WithRSAEncryption "sha256WithRSAEncryption"
+#define NID_sha256WithRSAEncryption 668
+#define OBJ_sha256WithRSAEncryption OBJ_pkcs1,11L
+
+#define SN_sha384WithRSAEncryption "RSA-SHA384"
+#define LN_sha384WithRSAEncryption "sha384WithRSAEncryption"
+#define NID_sha384WithRSAEncryption 669
+#define OBJ_sha384WithRSAEncryption OBJ_pkcs1,12L
+
+#define SN_sha512WithRSAEncryption "RSA-SHA512"
+#define LN_sha512WithRSAEncryption "sha512WithRSAEncryption"
+#define NID_sha512WithRSAEncryption 670
+#define OBJ_sha512WithRSAEncryption OBJ_pkcs1,13L
+
+#define SN_sha224WithRSAEncryption "RSA-SHA224"
+#define LN_sha224WithRSAEncryption "sha224WithRSAEncryption"
+#define NID_sha224WithRSAEncryption 671
+#define OBJ_sha224WithRSAEncryption OBJ_pkcs1,14L
+
+#define SN_pkcs3 "pkcs3"
+#define NID_pkcs3 27
+#define OBJ_pkcs3 OBJ_pkcs,3L
+
+#define LN_dhKeyAgreement "dhKeyAgreement"
+#define NID_dhKeyAgreement 28
+#define OBJ_dhKeyAgreement OBJ_pkcs3,1L
+
+#define SN_pkcs5 "pkcs5"
+#define NID_pkcs5 187
+#define OBJ_pkcs5 OBJ_pkcs,5L
+
+#define SN_pbeWithMD2AndDES_CBC "PBE-MD2-DES"
+#define LN_pbeWithMD2AndDES_CBC "pbeWithMD2AndDES-CBC"
+#define NID_pbeWithMD2AndDES_CBC 9
+#define OBJ_pbeWithMD2AndDES_CBC OBJ_pkcs5,1L
+
+#define SN_pbeWithMD5AndDES_CBC "PBE-MD5-DES"
+#define LN_pbeWithMD5AndDES_CBC "pbeWithMD5AndDES-CBC"
+#define NID_pbeWithMD5AndDES_CBC 10
+#define OBJ_pbeWithMD5AndDES_CBC OBJ_pkcs5,3L
+
+#define SN_pbeWithMD2AndRC2_CBC "PBE-MD2-RC2-64"
+#define LN_pbeWithMD2AndRC2_CBC "pbeWithMD2AndRC2-CBC"
+#define NID_pbeWithMD2AndRC2_CBC 168
+#define OBJ_pbeWithMD2AndRC2_CBC OBJ_pkcs5,4L
+
+#define SN_pbeWithMD5AndRC2_CBC "PBE-MD5-RC2-64"
+#define LN_pbeWithMD5AndRC2_CBC "pbeWithMD5AndRC2-CBC"
+#define NID_pbeWithMD5AndRC2_CBC 169
+#define OBJ_pbeWithMD5AndRC2_CBC OBJ_pkcs5,6L
+
+#define SN_pbeWithSHA1AndDES_CBC "PBE-SHA1-DES"
+#define LN_pbeWithSHA1AndDES_CBC "pbeWithSHA1AndDES-CBC"
+#define NID_pbeWithSHA1AndDES_CBC 170
+#define OBJ_pbeWithSHA1AndDES_CBC OBJ_pkcs5,10L
+
+#define SN_pbeWithSHA1AndRC2_CBC "PBE-SHA1-RC2-64"
+#define LN_pbeWithSHA1AndRC2_CBC "pbeWithSHA1AndRC2-CBC"
+#define NID_pbeWithSHA1AndRC2_CBC 68
+#define OBJ_pbeWithSHA1AndRC2_CBC OBJ_pkcs5,11L
+
+#define LN_id_pbkdf2 "PBKDF2"
+#define NID_id_pbkdf2 69
+#define OBJ_id_pbkdf2 OBJ_pkcs5,12L
+
+#define LN_pbes2 "PBES2"
+#define NID_pbes2 161
+#define OBJ_pbes2 OBJ_pkcs5,13L
+
+#define LN_pbmac1 "PBMAC1"
+#define NID_pbmac1 162
+#define OBJ_pbmac1 OBJ_pkcs5,14L
+
+#define SN_pkcs7 "pkcs7"
+#define NID_pkcs7 20
+#define OBJ_pkcs7 OBJ_pkcs,7L
+
+#define LN_pkcs7_data "pkcs7-data"
+#define NID_pkcs7_data 21
+#define OBJ_pkcs7_data OBJ_pkcs7,1L
+
+#define LN_pkcs7_signed "pkcs7-signedData"
+#define NID_pkcs7_signed 22
+#define OBJ_pkcs7_signed OBJ_pkcs7,2L
+
+#define LN_pkcs7_enveloped "pkcs7-envelopedData"
+#define NID_pkcs7_enveloped 23
+#define OBJ_pkcs7_enveloped OBJ_pkcs7,3L
+
+#define LN_pkcs7_signedAndEnveloped "pkcs7-signedAndEnvelopedData"
+#define NID_pkcs7_signedAndEnveloped 24
+#define OBJ_pkcs7_signedAndEnveloped OBJ_pkcs7,4L
+
+#define LN_pkcs7_digest "pkcs7-digestData"
+#define NID_pkcs7_digest 25
+#define OBJ_pkcs7_digest OBJ_pkcs7,5L
+
+#define LN_pkcs7_encrypted "pkcs7-encryptedData"
+#define NID_pkcs7_encrypted 26
+#define OBJ_pkcs7_encrypted OBJ_pkcs7,6L
+
+#define SN_pkcs9 "pkcs9"
+#define NID_pkcs9 47
+#define OBJ_pkcs9 OBJ_pkcs,9L
+
+#define LN_pkcs9_emailAddress "emailAddress"
+#define NID_pkcs9_emailAddress 48
+#define OBJ_pkcs9_emailAddress OBJ_pkcs9,1L
+
+#define LN_pkcs9_unstructuredName "unstructuredName"
+#define NID_pkcs9_unstructuredName 49
+#define OBJ_pkcs9_unstructuredName OBJ_pkcs9,2L
+
+#define LN_pkcs9_contentType "contentType"
+#define NID_pkcs9_contentType 50
+#define OBJ_pkcs9_contentType OBJ_pkcs9,3L
+
+#define LN_pkcs9_messageDigest "messageDigest"
+#define NID_pkcs9_messageDigest 51
+#define OBJ_pkcs9_messageDigest OBJ_pkcs9,4L
+
+#define LN_pkcs9_signingTime "signingTime"
+#define NID_pkcs9_signingTime 52
+#define OBJ_pkcs9_signingTime OBJ_pkcs9,5L
+
+#define LN_pkcs9_countersignature "countersignature"
+#define NID_pkcs9_countersignature 53
+#define OBJ_pkcs9_countersignature OBJ_pkcs9,6L
+
+#define LN_pkcs9_challengePassword "challengePassword"
+#define NID_pkcs9_challengePassword 54
+#define OBJ_pkcs9_challengePassword OBJ_pkcs9,7L
+
+#define LN_pkcs9_unstructuredAddress "unstructuredAddress"
+#define NID_pkcs9_unstructuredAddress 55
+#define OBJ_pkcs9_unstructuredAddress OBJ_pkcs9,8L
+
+#define LN_pkcs9_extCertAttributes "extendedCertificateAttributes"
+#define NID_pkcs9_extCertAttributes 56
+#define OBJ_pkcs9_extCertAttributes OBJ_pkcs9,9L
+
+#define SN_ext_req "extReq"
+#define LN_ext_req "Extension Request"
+#define NID_ext_req 172
+#define OBJ_ext_req OBJ_pkcs9,14L
+
+#define SN_SMIMECapabilities "SMIME-CAPS"
+#define LN_SMIMECapabilities "S/MIME Capabilities"
+#define NID_SMIMECapabilities 167
+#define OBJ_SMIMECapabilities OBJ_pkcs9,15L
+
+#define SN_SMIME "SMIME"
+#define LN_SMIME "S/MIME"
+#define NID_SMIME 188
+#define OBJ_SMIME OBJ_pkcs9,16L
+
+#define SN_id_smime_mod "id-smime-mod"
+#define NID_id_smime_mod 189
+#define OBJ_id_smime_mod OBJ_SMIME,0L
+
+#define SN_id_smime_ct "id-smime-ct"
+#define NID_id_smime_ct 190
+#define OBJ_id_smime_ct OBJ_SMIME,1L
+
+#define SN_id_smime_aa "id-smime-aa"
+#define NID_id_smime_aa 191
+#define OBJ_id_smime_aa OBJ_SMIME,2L
+
+#define SN_id_smime_alg "id-smime-alg"
+#define NID_id_smime_alg 192
+#define OBJ_id_smime_alg OBJ_SMIME,3L
+
+#define SN_id_smime_cd "id-smime-cd"
+#define NID_id_smime_cd 193
+#define OBJ_id_smime_cd OBJ_SMIME,4L
+
+#define SN_id_smime_spq "id-smime-spq"
+#define NID_id_smime_spq 194
+#define OBJ_id_smime_spq OBJ_SMIME,5L
+
+#define SN_id_smime_cti "id-smime-cti"
+#define NID_id_smime_cti 195
+#define OBJ_id_smime_cti OBJ_SMIME,6L
+
+#define SN_id_smime_mod_cms "id-smime-mod-cms"
+#define NID_id_smime_mod_cms 196
+#define OBJ_id_smime_mod_cms OBJ_id_smime_mod,1L
+
+#define SN_id_smime_mod_ess "id-smime-mod-ess"
+#define NID_id_smime_mod_ess 197
+#define OBJ_id_smime_mod_ess OBJ_id_smime_mod,2L
+
+#define SN_id_smime_mod_oid "id-smime-mod-oid"
+#define NID_id_smime_mod_oid 198
+#define OBJ_id_smime_mod_oid OBJ_id_smime_mod,3L
+
+#define SN_id_smime_mod_msg_v3 "id-smime-mod-msg-v3"
+#define NID_id_smime_mod_msg_v3 199
+#define OBJ_id_smime_mod_msg_v3 OBJ_id_smime_mod,4L
+
+#define SN_id_smime_mod_ets_eSignature_88 "id-smime-mod-ets-eSignature-88"
+#define NID_id_smime_mod_ets_eSignature_88 200
+#define OBJ_id_smime_mod_ets_eSignature_88 OBJ_id_smime_mod,5L
+
+#define SN_id_smime_mod_ets_eSignature_97 "id-smime-mod-ets-eSignature-97"
+#define NID_id_smime_mod_ets_eSignature_97 201
+#define OBJ_id_smime_mod_ets_eSignature_97 OBJ_id_smime_mod,6L
+
+#define SN_id_smime_mod_ets_eSigPolicy_88 "id-smime-mod-ets-eSigPolicy-88"
+#define NID_id_smime_mod_ets_eSigPolicy_88 202
+#define OBJ_id_smime_mod_ets_eSigPolicy_88 OBJ_id_smime_mod,7L
+
+#define SN_id_smime_mod_ets_eSigPolicy_97 "id-smime-mod-ets-eSigPolicy-97"
+#define NID_id_smime_mod_ets_eSigPolicy_97 203
+#define OBJ_id_smime_mod_ets_eSigPolicy_97 OBJ_id_smime_mod,8L
+
+#define SN_id_smime_ct_receipt "id-smime-ct-receipt"
+#define NID_id_smime_ct_receipt 204
+#define OBJ_id_smime_ct_receipt OBJ_id_smime_ct,1L
+
+#define SN_id_smime_ct_authData "id-smime-ct-authData"
+#define NID_id_smime_ct_authData 205
+#define OBJ_id_smime_ct_authData OBJ_id_smime_ct,2L
+
+#define SN_id_smime_ct_publishCert "id-smime-ct-publishCert"
+#define NID_id_smime_ct_publishCert 206
+#define OBJ_id_smime_ct_publishCert OBJ_id_smime_ct,3L
+
+#define SN_id_smime_ct_TSTInfo "id-smime-ct-TSTInfo"
+#define NID_id_smime_ct_TSTInfo 207
+#define OBJ_id_smime_ct_TSTInfo OBJ_id_smime_ct,4L
+
+#define SN_id_smime_ct_TDTInfo "id-smime-ct-TDTInfo"
+#define NID_id_smime_ct_TDTInfo 208
+#define OBJ_id_smime_ct_TDTInfo OBJ_id_smime_ct,5L
+
+#define SN_id_smime_ct_contentInfo "id-smime-ct-contentInfo"
+#define NID_id_smime_ct_contentInfo 209
+#define OBJ_id_smime_ct_contentInfo OBJ_id_smime_ct,6L
+
+#define SN_id_smime_ct_DVCSRequestData "id-smime-ct-DVCSRequestData"
+#define NID_id_smime_ct_DVCSRequestData 210
+#define OBJ_id_smime_ct_DVCSRequestData OBJ_id_smime_ct,7L
+
+#define SN_id_smime_ct_DVCSResponseData "id-smime-ct-DVCSResponseData"
+#define NID_id_smime_ct_DVCSResponseData 211
+#define OBJ_id_smime_ct_DVCSResponseData OBJ_id_smime_ct,8L
+
+#define SN_id_smime_ct_compressedData "id-smime-ct-compressedData"
+#define NID_id_smime_ct_compressedData 786
+#define OBJ_id_smime_ct_compressedData OBJ_id_smime_ct,9L
+
+#define SN_id_ct_asciiTextWithCRLF "id-ct-asciiTextWithCRLF"
+#define NID_id_ct_asciiTextWithCRLF 787
+#define OBJ_id_ct_asciiTextWithCRLF OBJ_id_smime_ct,27L
+
+#define SN_id_smime_aa_receiptRequest "id-smime-aa-receiptRequest"
+#define NID_id_smime_aa_receiptRequest 212
+#define OBJ_id_smime_aa_receiptRequest OBJ_id_smime_aa,1L
+
+#define SN_id_smime_aa_securityLabel "id-smime-aa-securityLabel"
+#define NID_id_smime_aa_securityLabel 213
+#define OBJ_id_smime_aa_securityLabel OBJ_id_smime_aa,2L
+
+#define SN_id_smime_aa_mlExpandHistory "id-smime-aa-mlExpandHistory"
+#define NID_id_smime_aa_mlExpandHistory 214
+#define OBJ_id_smime_aa_mlExpandHistory OBJ_id_smime_aa,3L
+
+#define SN_id_smime_aa_contentHint "id-smime-aa-contentHint"
+#define NID_id_smime_aa_contentHint 215
+#define OBJ_id_smime_aa_contentHint OBJ_id_smime_aa,4L
+
+#define SN_id_smime_aa_msgSigDigest "id-smime-aa-msgSigDigest"
+#define NID_id_smime_aa_msgSigDigest 216
+#define OBJ_id_smime_aa_msgSigDigest OBJ_id_smime_aa,5L
+
+#define SN_id_smime_aa_encapContentType "id-smime-aa-encapContentType"
+#define NID_id_smime_aa_encapContentType 217
+#define OBJ_id_smime_aa_encapContentType OBJ_id_smime_aa,6L
+
+#define SN_id_smime_aa_contentIdentifier "id-smime-aa-contentIdentifier"
+#define NID_id_smime_aa_contentIdentifier 218
+#define OBJ_id_smime_aa_contentIdentifier OBJ_id_smime_aa,7L
+
+#define SN_id_smime_aa_macValue "id-smime-aa-macValue"
+#define NID_id_smime_aa_macValue 219
+#define OBJ_id_smime_aa_macValue OBJ_id_smime_aa,8L
+
+#define SN_id_smime_aa_equivalentLabels "id-smime-aa-equivalentLabels"
+#define NID_id_smime_aa_equivalentLabels 220
+#define OBJ_id_smime_aa_equivalentLabels OBJ_id_smime_aa,9L
+
+#define SN_id_smime_aa_contentReference "id-smime-aa-contentReference"
+#define NID_id_smime_aa_contentReference 221
+#define OBJ_id_smime_aa_contentReference OBJ_id_smime_aa,10L
+
+#define SN_id_smime_aa_encrypKeyPref "id-smime-aa-encrypKeyPref"
+#define NID_id_smime_aa_encrypKeyPref 222
+#define OBJ_id_smime_aa_encrypKeyPref OBJ_id_smime_aa,11L
+
+#define SN_id_smime_aa_signingCertificate "id-smime-aa-signingCertificate"
+#define NID_id_smime_aa_signingCertificate 223
+#define OBJ_id_smime_aa_signingCertificate OBJ_id_smime_aa,12L
+
+#define SN_id_smime_aa_smimeEncryptCerts "id-smime-aa-smimeEncryptCerts"
+#define NID_id_smime_aa_smimeEncryptCerts 224
+#define OBJ_id_smime_aa_smimeEncryptCerts OBJ_id_smime_aa,13L
+
+#define SN_id_smime_aa_timeStampToken "id-smime-aa-timeStampToken"
+#define NID_id_smime_aa_timeStampToken 225
+#define OBJ_id_smime_aa_timeStampToken OBJ_id_smime_aa,14L
+
+#define SN_id_smime_aa_ets_sigPolicyId "id-smime-aa-ets-sigPolicyId"
+#define NID_id_smime_aa_ets_sigPolicyId 226
+#define OBJ_id_smime_aa_ets_sigPolicyId OBJ_id_smime_aa,15L
+
+#define SN_id_smime_aa_ets_commitmentType "id-smime-aa-ets-commitmentType"
+#define NID_id_smime_aa_ets_commitmentType 227
+#define OBJ_id_smime_aa_ets_commitmentType OBJ_id_smime_aa,16L
+
+#define SN_id_smime_aa_ets_signerLocation "id-smime-aa-ets-signerLocation"
+#define NID_id_smime_aa_ets_signerLocation 228
+#define OBJ_id_smime_aa_ets_signerLocation OBJ_id_smime_aa,17L
+
+#define SN_id_smime_aa_ets_signerAttr "id-smime-aa-ets-signerAttr"
+#define NID_id_smime_aa_ets_signerAttr 229
+#define OBJ_id_smime_aa_ets_signerAttr OBJ_id_smime_aa,18L
+
+#define SN_id_smime_aa_ets_otherSigCert "id-smime-aa-ets-otherSigCert"
+#define NID_id_smime_aa_ets_otherSigCert 230
+#define OBJ_id_smime_aa_ets_otherSigCert OBJ_id_smime_aa,19L
+
+#define SN_id_smime_aa_ets_contentTimestamp "id-smime-aa-ets-contentTimestamp"
+#define NID_id_smime_aa_ets_contentTimestamp 231
+#define OBJ_id_smime_aa_ets_contentTimestamp OBJ_id_smime_aa,20L
+
+#define SN_id_smime_aa_ets_CertificateRefs "id-smime-aa-ets-CertificateRefs"
+#define NID_id_smime_aa_ets_CertificateRefs 232
+#define OBJ_id_smime_aa_ets_CertificateRefs OBJ_id_smime_aa,21L
+
+#define SN_id_smime_aa_ets_RevocationRefs "id-smime-aa-ets-RevocationRefs"
+#define NID_id_smime_aa_ets_RevocationRefs 233
+#define OBJ_id_smime_aa_ets_RevocationRefs OBJ_id_smime_aa,22L
+
+#define SN_id_smime_aa_ets_certValues "id-smime-aa-ets-certValues"
+#define NID_id_smime_aa_ets_certValues 234
+#define OBJ_id_smime_aa_ets_certValues OBJ_id_smime_aa,23L
+
+#define SN_id_smime_aa_ets_revocationValues "id-smime-aa-ets-revocationValues"
+#define NID_id_smime_aa_ets_revocationValues 235
+#define OBJ_id_smime_aa_ets_revocationValues OBJ_id_smime_aa,24L
+
+#define SN_id_smime_aa_ets_escTimeStamp "id-smime-aa-ets-escTimeStamp"
+#define NID_id_smime_aa_ets_escTimeStamp 236
+#define OBJ_id_smime_aa_ets_escTimeStamp OBJ_id_smime_aa,25L
+
+#define SN_id_smime_aa_ets_certCRLTimestamp "id-smime-aa-ets-certCRLTimestamp"
+#define NID_id_smime_aa_ets_certCRLTimestamp 237
+#define OBJ_id_smime_aa_ets_certCRLTimestamp OBJ_id_smime_aa,26L
+
+#define SN_id_smime_aa_ets_archiveTimeStamp "id-smime-aa-ets-archiveTimeStamp"
+#define NID_id_smime_aa_ets_archiveTimeStamp 238
+#define OBJ_id_smime_aa_ets_archiveTimeStamp OBJ_id_smime_aa,27L
+
+#define SN_id_smime_aa_signatureType "id-smime-aa-signatureType"
+#define NID_id_smime_aa_signatureType 239
+#define OBJ_id_smime_aa_signatureType OBJ_id_smime_aa,28L
+
+#define SN_id_smime_aa_dvcs_dvc "id-smime-aa-dvcs-dvc"
+#define NID_id_smime_aa_dvcs_dvc 240
+#define OBJ_id_smime_aa_dvcs_dvc OBJ_id_smime_aa,29L
+
+#define SN_id_smime_alg_ESDHwith3DES "id-smime-alg-ESDHwith3DES"
+#define NID_id_smime_alg_ESDHwith3DES 241
+#define OBJ_id_smime_alg_ESDHwith3DES OBJ_id_smime_alg,1L
+
+#define SN_id_smime_alg_ESDHwithRC2 "id-smime-alg-ESDHwithRC2"
+#define NID_id_smime_alg_ESDHwithRC2 242
+#define OBJ_id_smime_alg_ESDHwithRC2 OBJ_id_smime_alg,2L
+
+#define SN_id_smime_alg_3DESwrap "id-smime-alg-3DESwrap"
+#define NID_id_smime_alg_3DESwrap 243
+#define OBJ_id_smime_alg_3DESwrap OBJ_id_smime_alg,3L
+
+#define SN_id_smime_alg_RC2wrap "id-smime-alg-RC2wrap"
+#define NID_id_smime_alg_RC2wrap 244
+#define OBJ_id_smime_alg_RC2wrap OBJ_id_smime_alg,4L
+
+#define SN_id_smime_alg_ESDH "id-smime-alg-ESDH"
+#define NID_id_smime_alg_ESDH 245
+#define OBJ_id_smime_alg_ESDH OBJ_id_smime_alg,5L
+
+#define SN_id_smime_alg_CMS3DESwrap "id-smime-alg-CMS3DESwrap"
+#define NID_id_smime_alg_CMS3DESwrap 246
+#define OBJ_id_smime_alg_CMS3DESwrap OBJ_id_smime_alg,6L
+
+#define SN_id_smime_alg_CMSRC2wrap "id-smime-alg-CMSRC2wrap"
+#define NID_id_smime_alg_CMSRC2wrap 247
+#define OBJ_id_smime_alg_CMSRC2wrap OBJ_id_smime_alg,7L
+
+#define SN_id_alg_PWRI_KEK "id-alg-PWRI-KEK"
+#define NID_id_alg_PWRI_KEK 893
+#define OBJ_id_alg_PWRI_KEK OBJ_id_smime_alg,9L
+
+#define SN_id_smime_cd_ldap "id-smime-cd-ldap"
+#define NID_id_smime_cd_ldap 248
+#define OBJ_id_smime_cd_ldap OBJ_id_smime_cd,1L
+
+#define SN_id_smime_spq_ets_sqt_uri "id-smime-spq-ets-sqt-uri"
+#define NID_id_smime_spq_ets_sqt_uri 249
+#define OBJ_id_smime_spq_ets_sqt_uri OBJ_id_smime_spq,1L
+
+#define SN_id_smime_spq_ets_sqt_unotice "id-smime-spq-ets-sqt-unotice"
+#define NID_id_smime_spq_ets_sqt_unotice 250
+#define OBJ_id_smime_spq_ets_sqt_unotice OBJ_id_smime_spq,2L
+
+#define SN_id_smime_cti_ets_proofOfOrigin "id-smime-cti-ets-proofOfOrigin"
+#define NID_id_smime_cti_ets_proofOfOrigin 251
+#define OBJ_id_smime_cti_ets_proofOfOrigin OBJ_id_smime_cti,1L
+
+#define SN_id_smime_cti_ets_proofOfReceipt "id-smime-cti-ets-proofOfReceipt"
+#define NID_id_smime_cti_ets_proofOfReceipt 252
+#define OBJ_id_smime_cti_ets_proofOfReceipt OBJ_id_smime_cti,2L
+
+#define SN_id_smime_cti_ets_proofOfDelivery "id-smime-cti-ets-proofOfDelivery"
+#define NID_id_smime_cti_ets_proofOfDelivery 253
+#define OBJ_id_smime_cti_ets_proofOfDelivery OBJ_id_smime_cti,3L
+
+#define SN_id_smime_cti_ets_proofOfSender "id-smime-cti-ets-proofOfSender"
+#define NID_id_smime_cti_ets_proofOfSender 254
+#define OBJ_id_smime_cti_ets_proofOfSender OBJ_id_smime_cti,4L
+
+#define SN_id_smime_cti_ets_proofOfApproval "id-smime-cti-ets-proofOfApproval"
+#define NID_id_smime_cti_ets_proofOfApproval 255
+#define OBJ_id_smime_cti_ets_proofOfApproval OBJ_id_smime_cti,5L
+
+#define SN_id_smime_cti_ets_proofOfCreation "id-smime-cti-ets-proofOfCreation"
+#define NID_id_smime_cti_ets_proofOfCreation 256
+#define OBJ_id_smime_cti_ets_proofOfCreation OBJ_id_smime_cti,6L
+
+#define LN_friendlyName "friendlyName"
+#define NID_friendlyName 156
+#define OBJ_friendlyName OBJ_pkcs9,20L
+
+#define LN_localKeyID "localKeyID"
+#define NID_localKeyID 157
+#define OBJ_localKeyID OBJ_pkcs9,21L
+
+#define SN_ms_csp_name "CSPName"
+#define LN_ms_csp_name "Microsoft CSP Name"
+#define NID_ms_csp_name 417
+#define OBJ_ms_csp_name 1L,3L,6L,1L,4L,1L,311L,17L,1L
+
+#define SN_LocalKeySet "LocalKeySet"
+#define LN_LocalKeySet "Microsoft Local Key set"
+#define NID_LocalKeySet 856
+#define OBJ_LocalKeySet 1L,3L,6L,1L,4L,1L,311L,17L,2L
+
+#define OBJ_certTypes OBJ_pkcs9,22L
+
+#define LN_x509Certificate "x509Certificate"
+#define NID_x509Certificate 158
+#define OBJ_x509Certificate OBJ_certTypes,1L
+
+#define LN_sdsiCertificate "sdsiCertificate"
+#define NID_sdsiCertificate 159
+#define OBJ_sdsiCertificate OBJ_certTypes,2L
+
+#define OBJ_crlTypes OBJ_pkcs9,23L
+
+#define LN_x509Crl "x509Crl"
+#define NID_x509Crl 160
+#define OBJ_x509Crl OBJ_crlTypes,1L
+
+#define OBJ_pkcs12 OBJ_pkcs,12L
+
+#define OBJ_pkcs12_pbeids OBJ_pkcs12,1L
+
+#define SN_pbe_WithSHA1And128BitRC4 "PBE-SHA1-RC4-128"
+#define LN_pbe_WithSHA1And128BitRC4 "pbeWithSHA1And128BitRC4"
+#define NID_pbe_WithSHA1And128BitRC4 144
+#define OBJ_pbe_WithSHA1And128BitRC4 OBJ_pkcs12_pbeids,1L
+
+#define SN_pbe_WithSHA1And40BitRC4 "PBE-SHA1-RC4-40"
+#define LN_pbe_WithSHA1And40BitRC4 "pbeWithSHA1And40BitRC4"
+#define NID_pbe_WithSHA1And40BitRC4 145
+#define OBJ_pbe_WithSHA1And40BitRC4 OBJ_pkcs12_pbeids,2L
+
+#define SN_pbe_WithSHA1And3_Key_TripleDES_CBC "PBE-SHA1-3DES"
+#define LN_pbe_WithSHA1And3_Key_TripleDES_CBC "pbeWithSHA1And3-KeyTripleDES-CBC"
+#define NID_pbe_WithSHA1And3_Key_TripleDES_CBC 146
+#define OBJ_pbe_WithSHA1And3_Key_TripleDES_CBC OBJ_pkcs12_pbeids,3L
+
+#define SN_pbe_WithSHA1And2_Key_TripleDES_CBC "PBE-SHA1-2DES"
+#define LN_pbe_WithSHA1And2_Key_TripleDES_CBC "pbeWithSHA1And2-KeyTripleDES-CBC"
+#define NID_pbe_WithSHA1And2_Key_TripleDES_CBC 147
+#define OBJ_pbe_WithSHA1And2_Key_TripleDES_CBC OBJ_pkcs12_pbeids,4L
+
+#define SN_pbe_WithSHA1And128BitRC2_CBC "PBE-SHA1-RC2-128"
+#define LN_pbe_WithSHA1And128BitRC2_CBC "pbeWithSHA1And128BitRC2-CBC"
+#define NID_pbe_WithSHA1And128BitRC2_CBC 148
+#define OBJ_pbe_WithSHA1And128BitRC2_CBC OBJ_pkcs12_pbeids,5L
+
+#define SN_pbe_WithSHA1And40BitRC2_CBC "PBE-SHA1-RC2-40"
+#define LN_pbe_WithSHA1And40BitRC2_CBC "pbeWithSHA1And40BitRC2-CBC"
+#define NID_pbe_WithSHA1And40BitRC2_CBC 149
+#define OBJ_pbe_WithSHA1And40BitRC2_CBC OBJ_pkcs12_pbeids,6L
+
+#define OBJ_pkcs12_Version1 OBJ_pkcs12,10L
+
+#define OBJ_pkcs12_BagIds OBJ_pkcs12_Version1,1L
+
+#define LN_keyBag "keyBag"
+#define NID_keyBag 150
+#define OBJ_keyBag OBJ_pkcs12_BagIds,1L
+
+#define LN_pkcs8ShroudedKeyBag "pkcs8ShroudedKeyBag"
+#define NID_pkcs8ShroudedKeyBag 151
+#define OBJ_pkcs8ShroudedKeyBag OBJ_pkcs12_BagIds,2L
+
+#define LN_certBag "certBag"
+#define NID_certBag 152
+#define OBJ_certBag OBJ_pkcs12_BagIds,3L
+
+#define LN_crlBag "crlBag"
+#define NID_crlBag 153
+#define OBJ_crlBag OBJ_pkcs12_BagIds,4L
+
+#define LN_secretBag "secretBag"
+#define NID_secretBag 154
+#define OBJ_secretBag OBJ_pkcs12_BagIds,5L
+
+#define LN_safeContentsBag "safeContentsBag"
+#define NID_safeContentsBag 155
+#define OBJ_safeContentsBag OBJ_pkcs12_BagIds,6L
+
+#define SN_md2 "MD2"
+#define LN_md2 "md2"
+#define NID_md2 3
+#define OBJ_md2 OBJ_rsadsi,2L,2L
+
+#define SN_md4 "MD4"
+#define LN_md4 "md4"
+#define NID_md4 257
+#define OBJ_md4 OBJ_rsadsi,2L,4L
+
+#define SN_md5 "MD5"
+#define LN_md5 "md5"
+#define NID_md5 4
+#define OBJ_md5 OBJ_rsadsi,2L,5L
+
+#define SN_md5_sha1 "MD5-SHA1"
+#define LN_md5_sha1 "md5-sha1"
+#define NID_md5_sha1 114
+
+#define LN_hmacWithMD5 "hmacWithMD5"
+#define NID_hmacWithMD5 797
+#define OBJ_hmacWithMD5 OBJ_rsadsi,2L,6L
+
+#define LN_hmacWithSHA1 "hmacWithSHA1"
+#define NID_hmacWithSHA1 163
+#define OBJ_hmacWithSHA1 OBJ_rsadsi,2L,7L
+
+#define LN_hmacWithSHA224 "hmacWithSHA224"
+#define NID_hmacWithSHA224 798
+#define OBJ_hmacWithSHA224 OBJ_rsadsi,2L,8L
+
+#define LN_hmacWithSHA256 "hmacWithSHA256"
+#define NID_hmacWithSHA256 799
+#define OBJ_hmacWithSHA256 OBJ_rsadsi,2L,9L
+
+#define LN_hmacWithSHA384 "hmacWithSHA384"
+#define NID_hmacWithSHA384 800
+#define OBJ_hmacWithSHA384 OBJ_rsadsi,2L,10L
+
+#define LN_hmacWithSHA512 "hmacWithSHA512"
+#define NID_hmacWithSHA512 801
+#define OBJ_hmacWithSHA512 OBJ_rsadsi,2L,11L
+
+#define SN_rc2_cbc "RC2-CBC"
+#define LN_rc2_cbc "rc2-cbc"
+#define NID_rc2_cbc 37
+#define OBJ_rc2_cbc OBJ_rsadsi,3L,2L
+
+#define SN_rc2_ecb "RC2-ECB"
+#define LN_rc2_ecb "rc2-ecb"
+#define NID_rc2_ecb 38
+
+#define SN_rc2_cfb64 "RC2-CFB"
+#define LN_rc2_cfb64 "rc2-cfb"
+#define NID_rc2_cfb64 39
+
+#define SN_rc2_ofb64 "RC2-OFB"
+#define LN_rc2_ofb64 "rc2-ofb"
+#define NID_rc2_ofb64 40
+
+#define SN_rc2_40_cbc "RC2-40-CBC"
+#define LN_rc2_40_cbc "rc2-40-cbc"
+#define NID_rc2_40_cbc 98
+
+#define SN_rc2_64_cbc "RC2-64-CBC"
+#define LN_rc2_64_cbc "rc2-64-cbc"
+#define NID_rc2_64_cbc 166
+
+#define SN_rc4 "RC4"
+#define LN_rc4 "rc4"
+#define NID_rc4 5
+#define OBJ_rc4 OBJ_rsadsi,3L,4L
+
+#define SN_rc4_40 "RC4-40"
+#define LN_rc4_40 "rc4-40"
+#define NID_rc4_40 97
+
+#define SN_des_ede3_cbc "DES-EDE3-CBC"
+#define LN_des_ede3_cbc "des-ede3-cbc"
+#define NID_des_ede3_cbc 44
+#define OBJ_des_ede3_cbc OBJ_rsadsi,3L,7L
+
+#define SN_rc5_cbc "RC5-CBC"
+#define LN_rc5_cbc "rc5-cbc"
+#define NID_rc5_cbc 120
+#define OBJ_rc5_cbc OBJ_rsadsi,3L,8L
+
+#define SN_rc5_ecb "RC5-ECB"
+#define LN_rc5_ecb "rc5-ecb"
+#define NID_rc5_ecb 121
+
+#define SN_rc5_cfb64 "RC5-CFB"
+#define LN_rc5_cfb64 "rc5-cfb"
+#define NID_rc5_cfb64 122
+
+#define SN_rc5_ofb64 "RC5-OFB"
+#define LN_rc5_ofb64 "rc5-ofb"
+#define NID_rc5_ofb64 123
+
+#define SN_ms_ext_req "msExtReq"
+#define LN_ms_ext_req "Microsoft Extension Request"
+#define NID_ms_ext_req 171
+#define OBJ_ms_ext_req 1L,3L,6L,1L,4L,1L,311L,2L,1L,14L
+
+#define SN_ms_code_ind "msCodeInd"
+#define LN_ms_code_ind "Microsoft Individual Code Signing"
+#define NID_ms_code_ind 134
+#define OBJ_ms_code_ind 1L,3L,6L,1L,4L,1L,311L,2L,1L,21L
+
+#define SN_ms_code_com "msCodeCom"
+#define LN_ms_code_com "Microsoft Commercial Code Signing"
+#define NID_ms_code_com 135
+#define OBJ_ms_code_com 1L,3L,6L,1L,4L,1L,311L,2L,1L,22L
+
+#define SN_ms_ctl_sign "msCTLSign"
+#define LN_ms_ctl_sign "Microsoft Trust List Signing"
+#define NID_ms_ctl_sign 136
+#define OBJ_ms_ctl_sign 1L,3L,6L,1L,4L,1L,311L,10L,3L,1L
+
+#define SN_ms_sgc "msSGC"
+#define LN_ms_sgc "Microsoft Server Gated Crypto"
+#define NID_ms_sgc 137
+#define OBJ_ms_sgc 1L,3L,6L,1L,4L,1L,311L,10L,3L,3L
+
+#define SN_ms_efs "msEFS"
+#define LN_ms_efs "Microsoft Encrypted File System"
+#define NID_ms_efs 138
+#define OBJ_ms_efs 1L,3L,6L,1L,4L,1L,311L,10L,3L,4L
+
+#define SN_ms_smartcard_login "msSmartcardLogin"
+#define LN_ms_smartcard_login "Microsoft Smartcardlogin"
+#define NID_ms_smartcard_login 648
+#define OBJ_ms_smartcard_login 1L,3L,6L,1L,4L,1L,311L,20L,2L,2L
+
+#define SN_ms_upn "msUPN"
+#define LN_ms_upn "Microsoft Universal Principal Name"
+#define NID_ms_upn 649
+#define OBJ_ms_upn 1L,3L,6L,1L,4L,1L,311L,20L,2L,3L
+
+#define SN_idea_cbc "IDEA-CBC"
+#define LN_idea_cbc "idea-cbc"
+#define NID_idea_cbc 34
+#define OBJ_idea_cbc 1L,3L,6L,1L,4L,1L,188L,7L,1L,1L,2L
+
+#define SN_idea_ecb "IDEA-ECB"
+#define LN_idea_ecb "idea-ecb"
+#define NID_idea_ecb 36
+
+#define SN_idea_cfb64 "IDEA-CFB"
+#define LN_idea_cfb64 "idea-cfb"
+#define NID_idea_cfb64 35
+
+#define SN_idea_ofb64 "IDEA-OFB"
+#define LN_idea_ofb64 "idea-ofb"
+#define NID_idea_ofb64 46
+
+#define SN_bf_cbc "BF-CBC"
+#define LN_bf_cbc "bf-cbc"
+#define NID_bf_cbc 91
+#define OBJ_bf_cbc 1L,3L,6L,1L,4L,1L,3029L,1L,2L
+
+#define SN_bf_ecb "BF-ECB"
+#define LN_bf_ecb "bf-ecb"
+#define NID_bf_ecb 92
+
+#define SN_bf_cfb64 "BF-CFB"
+#define LN_bf_cfb64 "bf-cfb"
+#define NID_bf_cfb64 93
+
+#define SN_bf_ofb64 "BF-OFB"
+#define LN_bf_ofb64 "bf-ofb"
+#define NID_bf_ofb64 94
+
+#define SN_id_pkix "PKIX"
+#define NID_id_pkix 127
+#define OBJ_id_pkix 1L,3L,6L,1L,5L,5L,7L
+
+#define SN_id_pkix_mod "id-pkix-mod"
+#define NID_id_pkix_mod 258
+#define OBJ_id_pkix_mod OBJ_id_pkix,0L
+
+#define SN_id_pe "id-pe"
+#define NID_id_pe 175
+#define OBJ_id_pe OBJ_id_pkix,1L
+
+#define SN_id_qt "id-qt"
+#define NID_id_qt 259
+#define OBJ_id_qt OBJ_id_pkix,2L
+
+#define SN_id_kp "id-kp"
+#define NID_id_kp 128
+#define OBJ_id_kp OBJ_id_pkix,3L
+
+#define SN_id_it "id-it"
+#define NID_id_it 260
+#define OBJ_id_it OBJ_id_pkix,4L
+
+#define SN_id_pkip "id-pkip"
+#define NID_id_pkip 261
+#define OBJ_id_pkip OBJ_id_pkix,5L
+
+#define SN_id_alg "id-alg"
+#define NID_id_alg 262
+#define OBJ_id_alg OBJ_id_pkix,6L
+
+#define SN_id_cmc "id-cmc"
+#define NID_id_cmc 263
+#define OBJ_id_cmc OBJ_id_pkix,7L
+
+#define SN_id_on "id-on"
+#define NID_id_on 264
+#define OBJ_id_on OBJ_id_pkix,8L
+
+#define SN_id_pda "id-pda"
+#define NID_id_pda 265
+#define OBJ_id_pda OBJ_id_pkix,9L
+
+#define SN_id_aca "id-aca"
+#define NID_id_aca 266
+#define OBJ_id_aca OBJ_id_pkix,10L
+
+#define SN_id_qcs "id-qcs"
+#define NID_id_qcs 267
+#define OBJ_id_qcs OBJ_id_pkix,11L
+
+#define SN_id_cct "id-cct"
+#define NID_id_cct 268
+#define OBJ_id_cct OBJ_id_pkix,12L
+
+#define SN_id_ppl "id-ppl"
+#define NID_id_ppl 662
+#define OBJ_id_ppl OBJ_id_pkix,21L
+
+#define SN_id_ad "id-ad"
+#define NID_id_ad 176
+#define OBJ_id_ad OBJ_id_pkix,48L
+
+#define SN_id_pkix1_explicit_88 "id-pkix1-explicit-88"
+#define NID_id_pkix1_explicit_88 269
+#define OBJ_id_pkix1_explicit_88 OBJ_id_pkix_mod,1L
+
+#define SN_id_pkix1_implicit_88 "id-pkix1-implicit-88"
+#define NID_id_pkix1_implicit_88 270
+#define OBJ_id_pkix1_implicit_88 OBJ_id_pkix_mod,2L
+
+#define SN_id_pkix1_explicit_93 "id-pkix1-explicit-93"
+#define NID_id_pkix1_explicit_93 271
+#define OBJ_id_pkix1_explicit_93 OBJ_id_pkix_mod,3L
+
+#define SN_id_pkix1_implicit_93 "id-pkix1-implicit-93"
+#define NID_id_pkix1_implicit_93 272
+#define OBJ_id_pkix1_implicit_93 OBJ_id_pkix_mod,4L
+
+#define SN_id_mod_crmf "id-mod-crmf"
+#define NID_id_mod_crmf 273
+#define OBJ_id_mod_crmf OBJ_id_pkix_mod,5L
+
+#define SN_id_mod_cmc "id-mod-cmc"
+#define NID_id_mod_cmc 274
+#define OBJ_id_mod_cmc OBJ_id_pkix_mod,6L
+
+#define SN_id_mod_kea_profile_88 "id-mod-kea-profile-88"
+#define NID_id_mod_kea_profile_88 275
+#define OBJ_id_mod_kea_profile_88 OBJ_id_pkix_mod,7L
+
+#define SN_id_mod_kea_profile_93 "id-mod-kea-profile-93"
+#define NID_id_mod_kea_profile_93 276
+#define OBJ_id_mod_kea_profile_93 OBJ_id_pkix_mod,8L
+
+#define SN_id_mod_cmp "id-mod-cmp"
+#define NID_id_mod_cmp 277
+#define OBJ_id_mod_cmp OBJ_id_pkix_mod,9L
+
+#define SN_id_mod_qualified_cert_88 "id-mod-qualified-cert-88"
+#define NID_id_mod_qualified_cert_88 278
+#define OBJ_id_mod_qualified_cert_88 OBJ_id_pkix_mod,10L
+
+#define SN_id_mod_qualified_cert_93 "id-mod-qualified-cert-93"
+#define NID_id_mod_qualified_cert_93 279
+#define OBJ_id_mod_qualified_cert_93 OBJ_id_pkix_mod,11L
+
+#define SN_id_mod_attribute_cert "id-mod-attribute-cert"
+#define NID_id_mod_attribute_cert 280
+#define OBJ_id_mod_attribute_cert OBJ_id_pkix_mod,12L
+
+#define SN_id_mod_timestamp_protocol "id-mod-timestamp-protocol"
+#define NID_id_mod_timestamp_protocol 281
+#define OBJ_id_mod_timestamp_protocol OBJ_id_pkix_mod,13L
+
+#define SN_id_mod_ocsp "id-mod-ocsp"
+#define NID_id_mod_ocsp 282
+#define OBJ_id_mod_ocsp OBJ_id_pkix_mod,14L
+
+#define SN_id_mod_dvcs "id-mod-dvcs"
+#define NID_id_mod_dvcs 283
+#define OBJ_id_mod_dvcs OBJ_id_pkix_mod,15L
+
+#define SN_id_mod_cmp2000 "id-mod-cmp2000"
+#define NID_id_mod_cmp2000 284
+#define OBJ_id_mod_cmp2000 OBJ_id_pkix_mod,16L
+
+#define SN_info_access "authorityInfoAccess"
+#define LN_info_access "Authority Information Access"
+#define NID_info_access 177
+#define OBJ_info_access OBJ_id_pe,1L
+
+#define SN_biometricInfo "biometricInfo"
+#define LN_biometricInfo "Biometric Info"
+#define NID_biometricInfo 285
+#define OBJ_biometricInfo OBJ_id_pe,2L
+
+#define SN_qcStatements "qcStatements"
+#define NID_qcStatements 286
+#define OBJ_qcStatements OBJ_id_pe,3L
+
+#define SN_ac_auditEntity "ac-auditEntity"
+#define NID_ac_auditEntity 287
+#define OBJ_ac_auditEntity OBJ_id_pe,4L
+
+#define SN_ac_targeting "ac-targeting"
+#define NID_ac_targeting 288
+#define OBJ_ac_targeting OBJ_id_pe,5L
+
+#define SN_aaControls "aaControls"
+#define NID_aaControls 289
+#define OBJ_aaControls OBJ_id_pe,6L
+
+#define SN_sbgp_ipAddrBlock "sbgp-ipAddrBlock"
+#define NID_sbgp_ipAddrBlock 290
+#define OBJ_sbgp_ipAddrBlock OBJ_id_pe,7L
+
+#define SN_sbgp_autonomousSysNum "sbgp-autonomousSysNum"
+#define NID_sbgp_autonomousSysNum 291
+#define OBJ_sbgp_autonomousSysNum OBJ_id_pe,8L
+
+#define SN_sbgp_routerIdentifier "sbgp-routerIdentifier"
+#define NID_sbgp_routerIdentifier 292
+#define OBJ_sbgp_routerIdentifier OBJ_id_pe,9L
+
+#define SN_ac_proxying "ac-proxying"
+#define NID_ac_proxying 397
+#define OBJ_ac_proxying OBJ_id_pe,10L
+
+#define SN_sinfo_access "subjectInfoAccess"
+#define LN_sinfo_access "Subject Information Access"
+#define NID_sinfo_access 398
+#define OBJ_sinfo_access OBJ_id_pe,11L
+
+#define SN_proxyCertInfo "proxyCertInfo"
+#define LN_proxyCertInfo "Proxy Certificate Information"
+#define NID_proxyCertInfo 663
+#define OBJ_proxyCertInfo OBJ_id_pe,14L
+
+#define SN_id_qt_cps "id-qt-cps"
+#define LN_id_qt_cps "Policy Qualifier CPS"
+#define NID_id_qt_cps 164
+#define OBJ_id_qt_cps OBJ_id_qt,1L
+
+#define SN_id_qt_unotice "id-qt-unotice"
+#define LN_id_qt_unotice "Policy Qualifier User Notice"
+#define NID_id_qt_unotice 165
+#define OBJ_id_qt_unotice OBJ_id_qt,2L
+
+#define SN_textNotice "textNotice"
+#define NID_textNotice 293
+#define OBJ_textNotice OBJ_id_qt,3L
+
+#define SN_server_auth "serverAuth"
+#define LN_server_auth "TLS Web Server Authentication"
+#define NID_server_auth 129
+#define OBJ_server_auth OBJ_id_kp,1L
+
+#define SN_client_auth "clientAuth"
+#define LN_client_auth "TLS Web Client Authentication"
+#define NID_client_auth 130
+#define OBJ_client_auth OBJ_id_kp,2L
+
+#define SN_code_sign "codeSigning"
+#define LN_code_sign "Code Signing"
+#define NID_code_sign 131
+#define OBJ_code_sign OBJ_id_kp,3L
+
+#define SN_email_protect "emailProtection"
+#define LN_email_protect "E-mail Protection"
+#define NID_email_protect 132
+#define OBJ_email_protect OBJ_id_kp,4L
+
+#define SN_ipsecEndSystem "ipsecEndSystem"
+#define LN_ipsecEndSystem "IPSec End System"
+#define NID_ipsecEndSystem 294
+#define OBJ_ipsecEndSystem OBJ_id_kp,5L
+
+#define SN_ipsecTunnel "ipsecTunnel"
+#define LN_ipsecTunnel "IPSec Tunnel"
+#define NID_ipsecTunnel 295
+#define OBJ_ipsecTunnel OBJ_id_kp,6L
+
+#define SN_ipsecUser "ipsecUser"
+#define LN_ipsecUser "IPSec User"
+#define NID_ipsecUser 296
+#define OBJ_ipsecUser OBJ_id_kp,7L
+
+#define SN_time_stamp "timeStamping"
+#define LN_time_stamp "Time Stamping"
+#define NID_time_stamp 133
+#define OBJ_time_stamp OBJ_id_kp,8L
+
+#define SN_OCSP_sign "OCSPSigning"
+#define LN_OCSP_sign "OCSP Signing"
+#define NID_OCSP_sign 180
+#define OBJ_OCSP_sign OBJ_id_kp,9L
+
+#define SN_dvcs "DVCS"
+#define LN_dvcs "dvcs"
+#define NID_dvcs 297
+#define OBJ_dvcs OBJ_id_kp,10L
+
+#define SN_id_it_caProtEncCert "id-it-caProtEncCert"
+#define NID_id_it_caProtEncCert 298
+#define OBJ_id_it_caProtEncCert OBJ_id_it,1L
+
+#define SN_id_it_signKeyPairTypes "id-it-signKeyPairTypes"
+#define NID_id_it_signKeyPairTypes 299
+#define OBJ_id_it_signKeyPairTypes OBJ_id_it,2L
+
+#define SN_id_it_encKeyPairTypes "id-it-encKeyPairTypes"
+#define NID_id_it_encKeyPairTypes 300
+#define OBJ_id_it_encKeyPairTypes OBJ_id_it,3L
+
+#define SN_id_it_preferredSymmAlg "id-it-preferredSymmAlg"
+#define NID_id_it_preferredSymmAlg 301
+#define OBJ_id_it_preferredSymmAlg OBJ_id_it,4L
+
+#define SN_id_it_caKeyUpdateInfo "id-it-caKeyUpdateInfo"
+#define NID_id_it_caKeyUpdateInfo 302
+#define OBJ_id_it_caKeyUpdateInfo OBJ_id_it,5L
+
+#define SN_id_it_currentCRL "id-it-currentCRL"
+#define NID_id_it_currentCRL 303
+#define OBJ_id_it_currentCRL OBJ_id_it,6L
+
+#define SN_id_it_unsupportedOIDs "id-it-unsupportedOIDs"
+#define NID_id_it_unsupportedOIDs 304
+#define OBJ_id_it_unsupportedOIDs OBJ_id_it,7L
+
+#define SN_id_it_subscriptionRequest "id-it-subscriptionRequest"
+#define NID_id_it_subscriptionRequest 305
+#define OBJ_id_it_subscriptionRequest OBJ_id_it,8L
+
+#define SN_id_it_subscriptionResponse "id-it-subscriptionResponse"
+#define NID_id_it_subscriptionResponse 306
+#define OBJ_id_it_subscriptionResponse OBJ_id_it,9L
+
+#define SN_id_it_keyPairParamReq "id-it-keyPairParamReq"
+#define NID_id_it_keyPairParamReq 307
+#define OBJ_id_it_keyPairParamReq OBJ_id_it,10L
+
+#define SN_id_it_keyPairParamRep "id-it-keyPairParamRep"
+#define NID_id_it_keyPairParamRep 308
+#define OBJ_id_it_keyPairParamRep OBJ_id_it,11L
+
+#define SN_id_it_revPassphrase "id-it-revPassphrase"
+#define NID_id_it_revPassphrase 309
+#define OBJ_id_it_revPassphrase OBJ_id_it,12L
+
+#define SN_id_it_implicitConfirm "id-it-implicitConfirm"
+#define NID_id_it_implicitConfirm 310
+#define OBJ_id_it_implicitConfirm OBJ_id_it,13L
+
+#define SN_id_it_confirmWaitTime "id-it-confirmWaitTime"
+#define NID_id_it_confirmWaitTime 311
+#define OBJ_id_it_confirmWaitTime OBJ_id_it,14L
+
+#define SN_id_it_origPKIMessage "id-it-origPKIMessage"
+#define NID_id_it_origPKIMessage 312
+#define OBJ_id_it_origPKIMessage OBJ_id_it,15L
+
+#define SN_id_it_suppLangTags "id-it-suppLangTags"
+#define NID_id_it_suppLangTags 784
+#define OBJ_id_it_suppLangTags OBJ_id_it,16L
+
+#define SN_id_regCtrl "id-regCtrl"
+#define NID_id_regCtrl 313
+#define OBJ_id_regCtrl OBJ_id_pkip,1L
+
+#define SN_id_regInfo "id-regInfo"
+#define NID_id_regInfo 314
+#define OBJ_id_regInfo OBJ_id_pkip,2L
+
+#define SN_id_regCtrl_regToken "id-regCtrl-regToken"
+#define NID_id_regCtrl_regToken 315
+#define OBJ_id_regCtrl_regToken OBJ_id_regCtrl,1L
+
+#define SN_id_regCtrl_authenticator "id-regCtrl-authenticator"
+#define NID_id_regCtrl_authenticator 316
+#define OBJ_id_regCtrl_authenticator OBJ_id_regCtrl,2L
+
+#define SN_id_regCtrl_pkiPublicationInfo "id-regCtrl-pkiPublicationInfo"
+#define NID_id_regCtrl_pkiPublicationInfo 317
+#define OBJ_id_regCtrl_pkiPublicationInfo OBJ_id_regCtrl,3L
+
+#define SN_id_regCtrl_pkiArchiveOptions "id-regCtrl-pkiArchiveOptions"
+#define NID_id_regCtrl_pkiArchiveOptions 318
+#define OBJ_id_regCtrl_pkiArchiveOptions OBJ_id_regCtrl,4L
+
+#define SN_id_regCtrl_oldCertID "id-regCtrl-oldCertID"
+#define NID_id_regCtrl_oldCertID 319
+#define OBJ_id_regCtrl_oldCertID OBJ_id_regCtrl,5L
+
+#define SN_id_regCtrl_protocolEncrKey "id-regCtrl-protocolEncrKey"
+#define NID_id_regCtrl_protocolEncrKey 320
+#define OBJ_id_regCtrl_protocolEncrKey OBJ_id_regCtrl,6L
+
+#define SN_id_regInfo_utf8Pairs "id-regInfo-utf8Pairs"
+#define NID_id_regInfo_utf8Pairs 321
+#define OBJ_id_regInfo_utf8Pairs OBJ_id_regInfo,1L
+
+#define SN_id_regInfo_certReq "id-regInfo-certReq"
+#define NID_id_regInfo_certReq 322
+#define OBJ_id_regInfo_certReq OBJ_id_regInfo,2L
+
+#define SN_id_alg_des40 "id-alg-des40"
+#define NID_id_alg_des40 323
+#define OBJ_id_alg_des40 OBJ_id_alg,1L
+
+#define SN_id_alg_noSignature "id-alg-noSignature"
+#define NID_id_alg_noSignature 324
+#define OBJ_id_alg_noSignature OBJ_id_alg,2L
+
+#define SN_id_alg_dh_sig_hmac_sha1 "id-alg-dh-sig-hmac-sha1"
+#define NID_id_alg_dh_sig_hmac_sha1 325
+#define OBJ_id_alg_dh_sig_hmac_sha1 OBJ_id_alg,3L
+
+#define SN_id_alg_dh_pop "id-alg-dh-pop"
+#define NID_id_alg_dh_pop 326
+#define OBJ_id_alg_dh_pop OBJ_id_alg,4L
+
+#define SN_id_cmc_statusInfo "id-cmc-statusInfo"
+#define NID_id_cmc_statusInfo 327
+#define OBJ_id_cmc_statusInfo OBJ_id_cmc,1L
+
+#define SN_id_cmc_identification "id-cmc-identification"
+#define NID_id_cmc_identification 328
+#define OBJ_id_cmc_identification OBJ_id_cmc,2L
+
+#define SN_id_cmc_identityProof "id-cmc-identityProof"
+#define NID_id_cmc_identityProof 329
+#define OBJ_id_cmc_identityProof OBJ_id_cmc,3L
+
+#define SN_id_cmc_dataReturn "id-cmc-dataReturn"
+#define NID_id_cmc_dataReturn 330
+#define OBJ_id_cmc_dataReturn OBJ_id_cmc,4L
+
+#define SN_id_cmc_transactionId "id-cmc-transactionId"
+#define NID_id_cmc_transactionId 331
+#define OBJ_id_cmc_transactionId OBJ_id_cmc,5L
+
+#define SN_id_cmc_senderNonce "id-cmc-senderNonce"
+#define NID_id_cmc_senderNonce 332
+#define OBJ_id_cmc_senderNonce OBJ_id_cmc,6L
+
+#define SN_id_cmc_recipientNonce "id-cmc-recipientNonce"
+#define NID_id_cmc_recipientNonce 333
+#define OBJ_id_cmc_recipientNonce OBJ_id_cmc,7L
+
+#define SN_id_cmc_addExtensions "id-cmc-addExtensions"
+#define NID_id_cmc_addExtensions 334
+#define OBJ_id_cmc_addExtensions OBJ_id_cmc,8L
+
+#define SN_id_cmc_encryptedPOP "id-cmc-encryptedPOP"
+#define NID_id_cmc_encryptedPOP 335
+#define OBJ_id_cmc_encryptedPOP OBJ_id_cmc,9L
+
+#define SN_id_cmc_decryptedPOP "id-cmc-decryptedPOP"
+#define NID_id_cmc_decryptedPOP 336
+#define OBJ_id_cmc_decryptedPOP OBJ_id_cmc,10L
+
+#define SN_id_cmc_lraPOPWitness "id-cmc-lraPOPWitness"
+#define NID_id_cmc_lraPOPWitness 337
+#define OBJ_id_cmc_lraPOPWitness OBJ_id_cmc,11L
+
+#define SN_id_cmc_getCert "id-cmc-getCert"
+#define NID_id_cmc_getCert 338
+#define OBJ_id_cmc_getCert OBJ_id_cmc,15L
+
+#define SN_id_cmc_getCRL "id-cmc-getCRL"
+#define NID_id_cmc_getCRL 339
+#define OBJ_id_cmc_getCRL OBJ_id_cmc,16L
+
+#define SN_id_cmc_revokeRequest "id-cmc-revokeRequest"
+#define NID_id_cmc_revokeRequest 340
+#define OBJ_id_cmc_revokeRequest OBJ_id_cmc,17L
+
+#define SN_id_cmc_regInfo "id-cmc-regInfo"
+#define NID_id_cmc_regInfo 341
+#define OBJ_id_cmc_regInfo OBJ_id_cmc,18L
+
+#define SN_id_cmc_responseInfo "id-cmc-responseInfo"
+#define NID_id_cmc_responseInfo 342
+#define OBJ_id_cmc_responseInfo OBJ_id_cmc,19L
+
+#define SN_id_cmc_queryPending "id-cmc-queryPending"
+#define NID_id_cmc_queryPending 343
+#define OBJ_id_cmc_queryPending OBJ_id_cmc,21L
+
+#define SN_id_cmc_popLinkRandom "id-cmc-popLinkRandom"
+#define NID_id_cmc_popLinkRandom 344
+#define OBJ_id_cmc_popLinkRandom OBJ_id_cmc,22L
+
+#define SN_id_cmc_popLinkWitness "id-cmc-popLinkWitness"
+#define NID_id_cmc_popLinkWitness 345
+#define OBJ_id_cmc_popLinkWitness OBJ_id_cmc,23L
+
+#define SN_id_cmc_confirmCertAcceptance "id-cmc-confirmCertAcceptance"
+#define NID_id_cmc_confirmCertAcceptance 346
+#define OBJ_id_cmc_confirmCertAcceptance OBJ_id_cmc,24L
+
+#define SN_id_on_personalData "id-on-personalData"
+#define NID_id_on_personalData 347
+#define OBJ_id_on_personalData OBJ_id_on,1L
+
+#define SN_id_on_permanentIdentifier "id-on-permanentIdentifier"
+#define LN_id_on_permanentIdentifier "Permanent Identifier"
+#define NID_id_on_permanentIdentifier 858
+#define OBJ_id_on_permanentIdentifier OBJ_id_on,3L
+
+#define SN_id_pda_dateOfBirth "id-pda-dateOfBirth"
+#define NID_id_pda_dateOfBirth 348
+#define OBJ_id_pda_dateOfBirth OBJ_id_pda,1L
+
+#define SN_id_pda_placeOfBirth "id-pda-placeOfBirth"
+#define NID_id_pda_placeOfBirth 349
+#define OBJ_id_pda_placeOfBirth OBJ_id_pda,2L
+
+#define SN_id_pda_gender "id-pda-gender"
+#define NID_id_pda_gender 351
+#define OBJ_id_pda_gender OBJ_id_pda,3L
+
+#define SN_id_pda_countryOfCitizenship "id-pda-countryOfCitizenship"
+#define NID_id_pda_countryOfCitizenship 352
+#define OBJ_id_pda_countryOfCitizenship OBJ_id_pda,4L
+
+#define SN_id_pda_countryOfResidence "id-pda-countryOfResidence"
+#define NID_id_pda_countryOfResidence 353
+#define OBJ_id_pda_countryOfResidence OBJ_id_pda,5L
+
+#define SN_id_aca_authenticationInfo "id-aca-authenticationInfo"
+#define NID_id_aca_authenticationInfo 354
+#define OBJ_id_aca_authenticationInfo OBJ_id_aca,1L
+
+#define SN_id_aca_accessIdentity "id-aca-accessIdentity"
+#define NID_id_aca_accessIdentity 355
+#define OBJ_id_aca_accessIdentity OBJ_id_aca,2L
+
+#define SN_id_aca_chargingIdentity "id-aca-chargingIdentity"
+#define NID_id_aca_chargingIdentity 356
+#define OBJ_id_aca_chargingIdentity OBJ_id_aca,3L
+
+#define SN_id_aca_group "id-aca-group"
+#define NID_id_aca_group 357
+#define OBJ_id_aca_group OBJ_id_aca,4L
+
+#define SN_id_aca_role "id-aca-role"
+#define NID_id_aca_role 358
+#define OBJ_id_aca_role OBJ_id_aca,5L
+
+#define SN_id_aca_encAttrs "id-aca-encAttrs"
+#define NID_id_aca_encAttrs 399
+#define OBJ_id_aca_encAttrs OBJ_id_aca,6L
+
+#define SN_id_qcs_pkixQCSyntax_v1 "id-qcs-pkixQCSyntax-v1"
+#define NID_id_qcs_pkixQCSyntax_v1 359
+#define OBJ_id_qcs_pkixQCSyntax_v1 OBJ_id_qcs,1L
+
+#define SN_id_cct_crs "id-cct-crs"
+#define NID_id_cct_crs 360
+#define OBJ_id_cct_crs OBJ_id_cct,1L
+
+#define SN_id_cct_PKIData "id-cct-PKIData"
+#define NID_id_cct_PKIData 361
+#define OBJ_id_cct_PKIData OBJ_id_cct,2L
+
+#define SN_id_cct_PKIResponse "id-cct-PKIResponse"
+#define NID_id_cct_PKIResponse 362
+#define OBJ_id_cct_PKIResponse OBJ_id_cct,3L
+
+#define SN_id_ppl_anyLanguage "id-ppl-anyLanguage"
+#define LN_id_ppl_anyLanguage "Any language"
+#define NID_id_ppl_anyLanguage 664
+#define OBJ_id_ppl_anyLanguage OBJ_id_ppl,0L
+
+#define SN_id_ppl_inheritAll "id-ppl-inheritAll"
+#define LN_id_ppl_inheritAll "Inherit all"
+#define NID_id_ppl_inheritAll 665
+#define OBJ_id_ppl_inheritAll OBJ_id_ppl,1L
+
+#define SN_Independent "id-ppl-independent"
+#define LN_Independent "Independent"
+#define NID_Independent 667
+#define OBJ_Independent OBJ_id_ppl,2L
+
+#define SN_ad_OCSP "OCSP"
+#define LN_ad_OCSP "OCSP"
+#define NID_ad_OCSP 178
+#define OBJ_ad_OCSP OBJ_id_ad,1L
+
+#define SN_ad_ca_issuers "caIssuers"
+#define LN_ad_ca_issuers "CA Issuers"
+#define NID_ad_ca_issuers 179
+#define OBJ_ad_ca_issuers OBJ_id_ad,2L
+
+#define SN_ad_timeStamping "ad_timestamping"
+#define LN_ad_timeStamping "AD Time Stamping"
+#define NID_ad_timeStamping 363
+#define OBJ_ad_timeStamping OBJ_id_ad,3L
+
+#define SN_ad_dvcs "AD_DVCS"
+#define LN_ad_dvcs "ad dvcs"
+#define NID_ad_dvcs 364
+#define OBJ_ad_dvcs OBJ_id_ad,4L
+
+#define SN_caRepository "caRepository"
+#define LN_caRepository "CA Repository"
+#define NID_caRepository 785
+#define OBJ_caRepository OBJ_id_ad,5L
+
+#define OBJ_id_pkix_OCSP OBJ_ad_OCSP
+
+#define SN_id_pkix_OCSP_basic "basicOCSPResponse"
+#define LN_id_pkix_OCSP_basic "Basic OCSP Response"
+#define NID_id_pkix_OCSP_basic 365
+#define OBJ_id_pkix_OCSP_basic OBJ_id_pkix_OCSP,1L
+
+#define SN_id_pkix_OCSP_Nonce "Nonce"
+#define LN_id_pkix_OCSP_Nonce "OCSP Nonce"
+#define NID_id_pkix_OCSP_Nonce 366
+#define OBJ_id_pkix_OCSP_Nonce OBJ_id_pkix_OCSP,2L
+
+#define SN_id_pkix_OCSP_CrlID "CrlID"
+#define LN_id_pkix_OCSP_CrlID "OCSP CRL ID"
+#define NID_id_pkix_OCSP_CrlID 367
+#define OBJ_id_pkix_OCSP_CrlID OBJ_id_pkix_OCSP,3L
+
+#define SN_id_pkix_OCSP_acceptableResponses "acceptableResponses"
+#define LN_id_pkix_OCSP_acceptableResponses "Acceptable OCSP Responses"
+#define NID_id_pkix_OCSP_acceptableResponses 368
+#define OBJ_id_pkix_OCSP_acceptableResponses OBJ_id_pkix_OCSP,4L
+
+#define SN_id_pkix_OCSP_noCheck "noCheck"
+#define LN_id_pkix_OCSP_noCheck "OCSP No Check"
+#define NID_id_pkix_OCSP_noCheck 369
+#define OBJ_id_pkix_OCSP_noCheck OBJ_id_pkix_OCSP,5L
+
+#define SN_id_pkix_OCSP_archiveCutoff "archiveCutoff"
+#define LN_id_pkix_OCSP_archiveCutoff "OCSP Archive Cutoff"
+#define NID_id_pkix_OCSP_archiveCutoff 370
+#define OBJ_id_pkix_OCSP_archiveCutoff OBJ_id_pkix_OCSP,6L
+
+#define SN_id_pkix_OCSP_serviceLocator "serviceLocator"
+#define LN_id_pkix_OCSP_serviceLocator "OCSP Service Locator"
+#define NID_id_pkix_OCSP_serviceLocator 371
+#define OBJ_id_pkix_OCSP_serviceLocator OBJ_id_pkix_OCSP,7L
+
+#define SN_id_pkix_OCSP_extendedStatus "extendedStatus"
+#define LN_id_pkix_OCSP_extendedStatus "Extended OCSP Status"
+#define NID_id_pkix_OCSP_extendedStatus 372
+#define OBJ_id_pkix_OCSP_extendedStatus OBJ_id_pkix_OCSP,8L
+
+#define SN_id_pkix_OCSP_valid "valid"
+#define NID_id_pkix_OCSP_valid 373
+#define OBJ_id_pkix_OCSP_valid OBJ_id_pkix_OCSP,9L
+
+#define SN_id_pkix_OCSP_path "path"
+#define NID_id_pkix_OCSP_path 374
+#define OBJ_id_pkix_OCSP_path OBJ_id_pkix_OCSP,10L
+
+#define SN_id_pkix_OCSP_trustRoot "trustRoot"
+#define LN_id_pkix_OCSP_trustRoot "Trust Root"
+#define NID_id_pkix_OCSP_trustRoot 375
+#define OBJ_id_pkix_OCSP_trustRoot OBJ_id_pkix_OCSP,11L
+
+#define SN_algorithm "algorithm"
+#define LN_algorithm "algorithm"
+#define NID_algorithm 376
+#define OBJ_algorithm 1L,3L,14L,3L,2L
+
+#define SN_md5WithRSA "RSA-NP-MD5"
+#define LN_md5WithRSA "md5WithRSA"
+#define NID_md5WithRSA 104
+#define OBJ_md5WithRSA OBJ_algorithm,3L
+
+#define SN_des_ecb "DES-ECB"
+#define LN_des_ecb "des-ecb"
+#define NID_des_ecb 29
+#define OBJ_des_ecb OBJ_algorithm,6L
+
+#define SN_des_cbc "DES-CBC"
+#define LN_des_cbc "des-cbc"
+#define NID_des_cbc 31
+#define OBJ_des_cbc OBJ_algorithm,7L
+
+#define SN_des_ofb64 "DES-OFB"
+#define LN_des_ofb64 "des-ofb"
+#define NID_des_ofb64 45
+#define OBJ_des_ofb64 OBJ_algorithm,8L
+
+#define SN_des_cfb64 "DES-CFB"
+#define LN_des_cfb64 "des-cfb"
+#define NID_des_cfb64 30
+#define OBJ_des_cfb64 OBJ_algorithm,9L
+
+#define SN_rsaSignature "rsaSignature"
+#define NID_rsaSignature 377
+#define OBJ_rsaSignature OBJ_algorithm,11L
+
+#define SN_dsa_2 "DSA-old"
+#define LN_dsa_2 "dsaEncryption-old"
+#define NID_dsa_2 67
+#define OBJ_dsa_2 OBJ_algorithm,12L
+
+#define SN_dsaWithSHA "DSA-SHA"
+#define LN_dsaWithSHA "dsaWithSHA"
+#define NID_dsaWithSHA 66
+#define OBJ_dsaWithSHA OBJ_algorithm,13L
+
+#define SN_shaWithRSAEncryption "RSA-SHA"
+#define LN_shaWithRSAEncryption "shaWithRSAEncryption"
+#define NID_shaWithRSAEncryption 42
+#define OBJ_shaWithRSAEncryption OBJ_algorithm,15L
+
+#define SN_des_ede_ecb "DES-EDE"
+#define LN_des_ede_ecb "des-ede"
+#define NID_des_ede_ecb 32
+#define OBJ_des_ede_ecb OBJ_algorithm,17L
+
+#define SN_des_ede3_ecb "DES-EDE3"
+#define LN_des_ede3_ecb "des-ede3"
+#define NID_des_ede3_ecb 33
+
+#define SN_des_ede_cbc "DES-EDE-CBC"
+#define LN_des_ede_cbc "des-ede-cbc"
+#define NID_des_ede_cbc 43
+
+#define SN_des_ede_cfb64 "DES-EDE-CFB"
+#define LN_des_ede_cfb64 "des-ede-cfb"
+#define NID_des_ede_cfb64 60
+
+#define SN_des_ede3_cfb64 "DES-EDE3-CFB"
+#define LN_des_ede3_cfb64 "des-ede3-cfb"
+#define NID_des_ede3_cfb64 61
+
+#define SN_des_ede_ofb64 "DES-EDE-OFB"
+#define LN_des_ede_ofb64 "des-ede-ofb"
+#define NID_des_ede_ofb64 62
+
+#define SN_des_ede3_ofb64 "DES-EDE3-OFB"
+#define LN_des_ede3_ofb64 "des-ede3-ofb"
+#define NID_des_ede3_ofb64 63
+
+#define SN_desx_cbc "DESX-CBC"
+#define LN_desx_cbc "desx-cbc"
+#define NID_desx_cbc 80
+
+#define SN_sha "SHA"
+#define LN_sha "sha"
+#define NID_sha 41
+#define OBJ_sha OBJ_algorithm,18L
+
+#define SN_sha1 "SHA1"
+#define LN_sha1 "sha1"
+#define NID_sha1 64
+#define OBJ_sha1 OBJ_algorithm,26L
+
+#define SN_dsaWithSHA1_2 "DSA-SHA1-old"
+#define LN_dsaWithSHA1_2 "dsaWithSHA1-old"
+#define NID_dsaWithSHA1_2 70
+#define OBJ_dsaWithSHA1_2 OBJ_algorithm,27L
+
+#define SN_sha1WithRSA "RSA-SHA1-2"
+#define LN_sha1WithRSA "sha1WithRSA"
+#define NID_sha1WithRSA 115
+#define OBJ_sha1WithRSA OBJ_algorithm,29L
+
+#define SN_ripemd160 "RIPEMD160"
+#define LN_ripemd160 "ripemd160"
+#define NID_ripemd160 117
+#define OBJ_ripemd160 1L,3L,36L,3L,2L,1L
+
+#define SN_ripemd160WithRSA "RSA-RIPEMD160"
+#define LN_ripemd160WithRSA "ripemd160WithRSA"
+#define NID_ripemd160WithRSA 119
+#define OBJ_ripemd160WithRSA 1L,3L,36L,3L,3L,1L,2L
+
+#define SN_sxnet "SXNetID"
+#define LN_sxnet "Strong Extranet ID"
+#define NID_sxnet 143
+#define OBJ_sxnet 1L,3L,101L,1L,4L,1L
+
+#define SN_X500 "X500"
+#define LN_X500 "directory services (X.500)"
+#define NID_X500 11
+#define OBJ_X500 2L,5L
+
+#define SN_X509 "X509"
+#define NID_X509 12
+#define OBJ_X509 OBJ_X500,4L
+
+#define SN_commonName "CN"
+#define LN_commonName "commonName"
+#define NID_commonName 13
+#define OBJ_commonName OBJ_X509,3L
+
+#define SN_surname "SN"
+#define LN_surname "surname"
+#define NID_surname 100
+#define OBJ_surname OBJ_X509,4L
+
+#define LN_serialNumber "serialNumber"
+#define NID_serialNumber 105
+#define OBJ_serialNumber OBJ_X509,5L
+
+#define SN_countryName "C"
+#define LN_countryName "countryName"
+#define NID_countryName 14
+#define OBJ_countryName OBJ_X509,6L
+
+#define SN_localityName "L"
+#define LN_localityName "localityName"
+#define NID_localityName 15
+#define OBJ_localityName OBJ_X509,7L
+
+#define SN_stateOrProvinceName "ST"
+#define LN_stateOrProvinceName "stateOrProvinceName"
+#define NID_stateOrProvinceName 16
+#define OBJ_stateOrProvinceName OBJ_X509,8L
+
+#define SN_streetAddress "street"
+#define LN_streetAddress "streetAddress"
+#define NID_streetAddress 660
+#define OBJ_streetAddress OBJ_X509,9L
+
+#define SN_organizationName "O"
+#define LN_organizationName "organizationName"
+#define NID_organizationName 17
+#define OBJ_organizationName OBJ_X509,10L
+
+#define SN_organizationalUnitName "OU"
+#define LN_organizationalUnitName "organizationalUnitName"
+#define NID_organizationalUnitName 18
+#define OBJ_organizationalUnitName OBJ_X509,11L
+
+#define SN_title "title"
+#define LN_title "title"
+#define NID_title 106
+#define OBJ_title OBJ_X509,12L
+
+#define LN_description "description"
+#define NID_description 107
+#define OBJ_description OBJ_X509,13L
+
+#define LN_searchGuide "searchGuide"
+#define NID_searchGuide 859
+#define OBJ_searchGuide OBJ_X509,14L
+
+#define LN_businessCategory "businessCategory"
+#define NID_businessCategory 860
+#define OBJ_businessCategory OBJ_X509,15L
+
+#define LN_postalAddress "postalAddress"
+#define NID_postalAddress 861
+#define OBJ_postalAddress OBJ_X509,16L
+
+#define LN_postalCode "postalCode"
+#define NID_postalCode 661
+#define OBJ_postalCode OBJ_X509,17L
+
+#define LN_postOfficeBox "postOfficeBox"
+#define NID_postOfficeBox 862
+#define OBJ_postOfficeBox OBJ_X509,18L
+
+#define LN_physicalDeliveryOfficeName "physicalDeliveryOfficeName"
+#define NID_physicalDeliveryOfficeName 863
+#define OBJ_physicalDeliveryOfficeName OBJ_X509,19L
+
+#define LN_telephoneNumber "telephoneNumber"
+#define NID_telephoneNumber 864
+#define OBJ_telephoneNumber OBJ_X509,20L
+
+#define LN_telexNumber "telexNumber"
+#define NID_telexNumber 865
+#define OBJ_telexNumber OBJ_X509,21L
+
+#define LN_teletexTerminalIdentifier "teletexTerminalIdentifier"
+#define NID_teletexTerminalIdentifier 866
+#define OBJ_teletexTerminalIdentifier OBJ_X509,22L
+
+#define LN_facsimileTelephoneNumber "facsimileTelephoneNumber"
+#define NID_facsimileTelephoneNumber 867
+#define OBJ_facsimileTelephoneNumber OBJ_X509,23L
+
+#define LN_x121Address "x121Address"
+#define NID_x121Address 868
+#define OBJ_x121Address OBJ_X509,24L
+
+#define LN_internationaliSDNNumber "internationaliSDNNumber"
+#define NID_internationaliSDNNumber 869
+#define OBJ_internationaliSDNNumber OBJ_X509,25L
+
+#define LN_registeredAddress "registeredAddress"
+#define NID_registeredAddress 870
+#define OBJ_registeredAddress OBJ_X509,26L
+
+#define LN_destinationIndicator "destinationIndicator"
+#define NID_destinationIndicator 871
+#define OBJ_destinationIndicator OBJ_X509,27L
+
+#define LN_preferredDeliveryMethod "preferredDeliveryMethod"
+#define NID_preferredDeliveryMethod 872
+#define OBJ_preferredDeliveryMethod OBJ_X509,28L
+
+#define LN_presentationAddress "presentationAddress"
+#define NID_presentationAddress 873
+#define OBJ_presentationAddress OBJ_X509,29L
+
+#define LN_supportedApplicationContext "supportedApplicationContext"
+#define NID_supportedApplicationContext 874
+#define OBJ_supportedApplicationContext OBJ_X509,30L
+
+#define SN_member "member"
+#define NID_member 875
+#define OBJ_member OBJ_X509,31L
+
+#define SN_owner "owner"
+#define NID_owner 876
+#define OBJ_owner OBJ_X509,32L
+
+#define LN_roleOccupant "roleOccupant"
+#define NID_roleOccupant 877
+#define OBJ_roleOccupant OBJ_X509,33L
+
+#define SN_seeAlso "seeAlso"
+#define NID_seeAlso 878
+#define OBJ_seeAlso OBJ_X509,34L
+
+#define LN_userPassword "userPassword"
+#define NID_userPassword 879
+#define OBJ_userPassword OBJ_X509,35L
+
+#define LN_userCertificate "userCertificate"
+#define NID_userCertificate 880
+#define OBJ_userCertificate OBJ_X509,36L
+
+#define LN_cACertificate "cACertificate"
+#define NID_cACertificate 881
+#define OBJ_cACertificate OBJ_X509,37L
+
+#define LN_authorityRevocationList "authorityRevocationList"
+#define NID_authorityRevocationList 882
+#define OBJ_authorityRevocationList OBJ_X509,38L
+
+#define LN_certificateRevocationList "certificateRevocationList"
+#define NID_certificateRevocationList 883
+#define OBJ_certificateRevocationList OBJ_X509,39L
+
+#define LN_crossCertificatePair "crossCertificatePair"
+#define NID_crossCertificatePair 884
+#define OBJ_crossCertificatePair OBJ_X509,40L
+
+#define SN_name "name"
+#define LN_name "name"
+#define NID_name 173
+#define OBJ_name OBJ_X509,41L
+
+#define SN_givenName "GN"
+#define LN_givenName "givenName"
+#define NID_givenName 99
+#define OBJ_givenName OBJ_X509,42L
+
+#define SN_initials "initials"
+#define LN_initials "initials"
+#define NID_initials 101
+#define OBJ_initials OBJ_X509,43L
+
+#define LN_generationQualifier "generationQualifier"
+#define NID_generationQualifier 509
+#define OBJ_generationQualifier OBJ_X509,44L
+
+#define LN_x500UniqueIdentifier "x500UniqueIdentifier"
+#define NID_x500UniqueIdentifier 503
+#define OBJ_x500UniqueIdentifier OBJ_X509,45L
+
+#define SN_dnQualifier "dnQualifier"
+#define LN_dnQualifier "dnQualifier"
+#define NID_dnQualifier 174
+#define OBJ_dnQualifier OBJ_X509,46L
+
+#define LN_enhancedSearchGuide "enhancedSearchGuide"
+#define NID_enhancedSearchGuide 885
+#define OBJ_enhancedSearchGuide OBJ_X509,47L
+
+#define LN_protocolInformation "protocolInformation"
+#define NID_protocolInformation 886
+#define OBJ_protocolInformation OBJ_X509,48L
+
+#define LN_distinguishedName "distinguishedName"
+#define NID_distinguishedName 887
+#define OBJ_distinguishedName OBJ_X509,49L
+
+#define LN_uniqueMember "uniqueMember"
+#define NID_uniqueMember 888
+#define OBJ_uniqueMember OBJ_X509,50L
+
+#define LN_houseIdentifier "houseIdentifier"
+#define NID_houseIdentifier 889
+#define OBJ_houseIdentifier OBJ_X509,51L
+
+#define LN_supportedAlgorithms "supportedAlgorithms"
+#define NID_supportedAlgorithms 890
+#define OBJ_supportedAlgorithms OBJ_X509,52L
+
+#define LN_deltaRevocationList "deltaRevocationList"
+#define NID_deltaRevocationList 891
+#define OBJ_deltaRevocationList OBJ_X509,53L
+
+#define SN_dmdName "dmdName"
+#define NID_dmdName 892
+#define OBJ_dmdName OBJ_X509,54L
+
+#define LN_pseudonym "pseudonym"
+#define NID_pseudonym 510
+#define OBJ_pseudonym OBJ_X509,65L
+
+#define SN_role "role"
+#define LN_role "role"
+#define NID_role 400
+#define OBJ_role OBJ_X509,72L
+
+#define SN_X500algorithms "X500algorithms"
+#define LN_X500algorithms "directory services - algorithms"
+#define NID_X500algorithms 378
+#define OBJ_X500algorithms OBJ_X500,8L
+
+#define SN_rsa "RSA"
+#define LN_rsa "rsa"
+#define NID_rsa 19
+#define OBJ_rsa OBJ_X500algorithms,1L,1L
+
+#define SN_mdc2WithRSA "RSA-MDC2"
+#define LN_mdc2WithRSA "mdc2WithRSA"
+#define NID_mdc2WithRSA 96
+#define OBJ_mdc2WithRSA OBJ_X500algorithms,3L,100L
+
+#define SN_mdc2 "MDC2"
+#define LN_mdc2 "mdc2"
+#define NID_mdc2 95
+#define OBJ_mdc2 OBJ_X500algorithms,3L,101L
+
+#define SN_id_ce "id-ce"
+#define NID_id_ce 81
+#define OBJ_id_ce OBJ_X500,29L
+
+#define SN_subject_directory_attributes "subjectDirectoryAttributes"
+#define LN_subject_directory_attributes "X509v3 Subject Directory Attributes"
+#define NID_subject_directory_attributes 769
+#define OBJ_subject_directory_attributes OBJ_id_ce,9L
+
+#define SN_subject_key_identifier "subjectKeyIdentifier"
+#define LN_subject_key_identifier "X509v3 Subject Key Identifier"
+#define NID_subject_key_identifier 82
+#define OBJ_subject_key_identifier OBJ_id_ce,14L
+
+#define SN_key_usage "keyUsage"
+#define LN_key_usage "X509v3 Key Usage"
+#define NID_key_usage 83
+#define OBJ_key_usage OBJ_id_ce,15L
+
+#define SN_private_key_usage_period "privateKeyUsagePeriod"
+#define LN_private_key_usage_period "X509v3 Private Key Usage Period"
+#define NID_private_key_usage_period 84
+#define OBJ_private_key_usage_period OBJ_id_ce,16L
+
+#define SN_subject_alt_name "subjectAltName"
+#define LN_subject_alt_name "X509v3 Subject Alternative Name"
+#define NID_subject_alt_name 85
+#define OBJ_subject_alt_name OBJ_id_ce,17L
+
+#define SN_issuer_alt_name "issuerAltName"
+#define LN_issuer_alt_name "X509v3 Issuer Alternative Name"
+#define NID_issuer_alt_name 86
+#define OBJ_issuer_alt_name OBJ_id_ce,18L
+
+#define SN_basic_constraints "basicConstraints"
+#define LN_basic_constraints "X509v3 Basic Constraints"
+#define NID_basic_constraints 87
+#define OBJ_basic_constraints OBJ_id_ce,19L
+
+#define SN_crl_number "crlNumber"
+#define LN_crl_number "X509v3 CRL Number"
+#define NID_crl_number 88
+#define OBJ_crl_number OBJ_id_ce,20L
+
+#define SN_crl_reason "CRLReason"
+#define LN_crl_reason "X509v3 CRL Reason Code"
+#define NID_crl_reason 141
+#define OBJ_crl_reason OBJ_id_ce,21L
+
+#define SN_invalidity_date "invalidityDate"
+#define LN_invalidity_date "Invalidity Date"
+#define NID_invalidity_date 142
+#define OBJ_invalidity_date OBJ_id_ce,24L
+
+#define SN_delta_crl "deltaCRL"
+#define LN_delta_crl "X509v3 Delta CRL Indicator"
+#define NID_delta_crl 140
+#define OBJ_delta_crl OBJ_id_ce,27L
+
+#define SN_issuing_distribution_point "issuingDistributionPoint"
+#define LN_issuing_distribution_point "X509v3 Issuing Distrubution Point"
+#define NID_issuing_distribution_point 770
+#define OBJ_issuing_distribution_point OBJ_id_ce,28L
+
+#define SN_certificate_issuer "certificateIssuer"
+#define LN_certificate_issuer "X509v3 Certificate Issuer"
+#define NID_certificate_issuer 771
+#define OBJ_certificate_issuer OBJ_id_ce,29L
+
+#define SN_name_constraints "nameConstraints"
+#define LN_name_constraints "X509v3 Name Constraints"
+#define NID_name_constraints 666
+#define OBJ_name_constraints OBJ_id_ce,30L
+
+#define SN_crl_distribution_points "crlDistributionPoints"
+#define LN_crl_distribution_points "X509v3 CRL Distribution Points"
+#define NID_crl_distribution_points 103
+#define OBJ_crl_distribution_points OBJ_id_ce,31L
+
+#define SN_certificate_policies "certificatePolicies"
+#define LN_certificate_policies "X509v3 Certificate Policies"
+#define NID_certificate_policies 89
+#define OBJ_certificate_policies OBJ_id_ce,32L
+
+#define SN_any_policy "anyPolicy"
+#define LN_any_policy "X509v3 Any Policy"
+#define NID_any_policy 746
+#define OBJ_any_policy OBJ_certificate_policies,0L
+
+#define SN_policy_mappings "policyMappings"
+#define LN_policy_mappings "X509v3 Policy Mappings"
+#define NID_policy_mappings 747
+#define OBJ_policy_mappings OBJ_id_ce,33L
+
+#define SN_authority_key_identifier "authorityKeyIdentifier"
+#define LN_authority_key_identifier "X509v3 Authority Key Identifier"
+#define NID_authority_key_identifier 90
+#define OBJ_authority_key_identifier OBJ_id_ce,35L
+
+#define SN_policy_constraints "policyConstraints"
+#define LN_policy_constraints "X509v3 Policy Constraints"
+#define NID_policy_constraints 401
+#define OBJ_policy_constraints OBJ_id_ce,36L
+
+#define SN_ext_key_usage "extendedKeyUsage"
+#define LN_ext_key_usage "X509v3 Extended Key Usage"
+#define NID_ext_key_usage 126
+#define OBJ_ext_key_usage OBJ_id_ce,37L
+
+#define SN_freshest_crl "freshestCRL"
+#define LN_freshest_crl "X509v3 Freshest CRL"
+#define NID_freshest_crl 857
+#define OBJ_freshest_crl OBJ_id_ce,46L
+
+#define SN_inhibit_any_policy "inhibitAnyPolicy"
+#define LN_inhibit_any_policy "X509v3 Inhibit Any Policy"
+#define NID_inhibit_any_policy 748
+#define OBJ_inhibit_any_policy OBJ_id_ce,54L
+
+#define SN_target_information "targetInformation"
+#define LN_target_information "X509v3 AC Targeting"
+#define NID_target_information 402
+#define OBJ_target_information OBJ_id_ce,55L
+
+#define SN_no_rev_avail "noRevAvail"
+#define LN_no_rev_avail "X509v3 No Revocation Available"
+#define NID_no_rev_avail 403
+#define OBJ_no_rev_avail OBJ_id_ce,56L
+
+#define SN_anyExtendedKeyUsage "anyExtendedKeyUsage"
+#define LN_anyExtendedKeyUsage "Any Extended Key Usage"
+#define NID_anyExtendedKeyUsage 910
+#define OBJ_anyExtendedKeyUsage OBJ_ext_key_usage,0L
+
+#define SN_netscape "Netscape"
+#define LN_netscape "Netscape Communications Corp."
+#define NID_netscape 57
+#define OBJ_netscape 2L,16L,840L,1L,113730L
+
+#define SN_netscape_cert_extension "nsCertExt"
+#define LN_netscape_cert_extension "Netscape Certificate Extension"
+#define NID_netscape_cert_extension 58
+#define OBJ_netscape_cert_extension OBJ_netscape,1L
+
+#define SN_netscape_data_type "nsDataType"
+#define LN_netscape_data_type "Netscape Data Type"
+#define NID_netscape_data_type 59
+#define OBJ_netscape_data_type OBJ_netscape,2L
+
+#define SN_netscape_cert_type "nsCertType"
+#define LN_netscape_cert_type "Netscape Cert Type"
+#define NID_netscape_cert_type 71
+#define OBJ_netscape_cert_type OBJ_netscape_cert_extension,1L
+
+#define SN_netscape_base_url "nsBaseUrl"
+#define LN_netscape_base_url "Netscape Base Url"
+#define NID_netscape_base_url 72
+#define OBJ_netscape_base_url OBJ_netscape_cert_extension,2L
+
+#define SN_netscape_revocation_url "nsRevocationUrl"
+#define LN_netscape_revocation_url "Netscape Revocation Url"
+#define NID_netscape_revocation_url 73
+#define OBJ_netscape_revocation_url OBJ_netscape_cert_extension,3L
+
+#define SN_netscape_ca_revocation_url "nsCaRevocationUrl"
+#define LN_netscape_ca_revocation_url "Netscape CA Revocation Url"
+#define NID_netscape_ca_revocation_url 74
+#define OBJ_netscape_ca_revocation_url OBJ_netscape_cert_extension,4L
+
+#define SN_netscape_renewal_url "nsRenewalUrl"
+#define LN_netscape_renewal_url "Netscape Renewal Url"
+#define NID_netscape_renewal_url 75
+#define OBJ_netscape_renewal_url OBJ_netscape_cert_extension,7L
+
+#define SN_netscape_ca_policy_url "nsCaPolicyUrl"
+#define LN_netscape_ca_policy_url "Netscape CA Policy Url"
+#define NID_netscape_ca_policy_url 76
+#define OBJ_netscape_ca_policy_url OBJ_netscape_cert_extension,8L
+
+#define SN_netscape_ssl_server_name "nsSslServerName"
+#define LN_netscape_ssl_server_name "Netscape SSL Server Name"
+#define NID_netscape_ssl_server_name 77
+#define OBJ_netscape_ssl_server_name OBJ_netscape_cert_extension,12L
+
+#define SN_netscape_comment "nsComment"
+#define LN_netscape_comment "Netscape Comment"
+#define NID_netscape_comment 78
+#define OBJ_netscape_comment OBJ_netscape_cert_extension,13L
+
+#define SN_netscape_cert_sequence "nsCertSequence"
+#define LN_netscape_cert_sequence "Netscape Certificate Sequence"
+#define NID_netscape_cert_sequence 79
+#define OBJ_netscape_cert_sequence OBJ_netscape_data_type,5L
+
+#define SN_ns_sgc "nsSGC"
+#define LN_ns_sgc "Netscape Server Gated Crypto"
+#define NID_ns_sgc 139
+#define OBJ_ns_sgc OBJ_netscape,4L,1L
+
+#define SN_org "ORG"
+#define LN_org "org"
+#define NID_org 379
+#define OBJ_org OBJ_iso,3L
+
+#define SN_dod "DOD"
+#define LN_dod "dod"
+#define NID_dod 380
+#define OBJ_dod OBJ_org,6L
+
+#define SN_iana "IANA"
+#define LN_iana "iana"
+#define NID_iana 381
+#define OBJ_iana OBJ_dod,1L
+
+#define OBJ_internet OBJ_iana
+
+#define SN_Directory "directory"
+#define LN_Directory "Directory"
+#define NID_Directory 382
+#define OBJ_Directory OBJ_internet,1L
+
+#define SN_Management "mgmt"
+#define LN_Management "Management"
+#define NID_Management 383
+#define OBJ_Management OBJ_internet,2L
+
+#define SN_Experimental "experimental"
+#define LN_Experimental "Experimental"
+#define NID_Experimental 384
+#define OBJ_Experimental OBJ_internet,3L
+
+#define SN_Private "private"
+#define LN_Private "Private"
+#define NID_Private 385
+#define OBJ_Private OBJ_internet,4L
+
+#define SN_Security "security"
+#define LN_Security "Security"
+#define NID_Security 386
+#define OBJ_Security OBJ_internet,5L
+
+#define SN_SNMPv2 "snmpv2"
+#define LN_SNMPv2 "SNMPv2"
+#define NID_SNMPv2 387
+#define OBJ_SNMPv2 OBJ_internet,6L
+
+#define LN_Mail "Mail"
+#define NID_Mail 388
+#define OBJ_Mail OBJ_internet,7L
+
+#define SN_Enterprises "enterprises"
+#define LN_Enterprises "Enterprises"
+#define NID_Enterprises 389
+#define OBJ_Enterprises OBJ_Private,1L
+
+#define SN_dcObject "dcobject"
+#define LN_dcObject "dcObject"
+#define NID_dcObject 390
+#define OBJ_dcObject OBJ_Enterprises,1466L,344L
+
+#define SN_mime_mhs "mime-mhs"
+#define LN_mime_mhs "MIME MHS"
+#define NID_mime_mhs 504
+#define OBJ_mime_mhs OBJ_Mail,1L
+
+#define SN_mime_mhs_headings "mime-mhs-headings"
+#define LN_mime_mhs_headings "mime-mhs-headings"
+#define NID_mime_mhs_headings 505
+#define OBJ_mime_mhs_headings OBJ_mime_mhs,1L
+
+#define SN_mime_mhs_bodies "mime-mhs-bodies"
+#define LN_mime_mhs_bodies "mime-mhs-bodies"
+#define NID_mime_mhs_bodies 506
+#define OBJ_mime_mhs_bodies OBJ_mime_mhs,2L
+
+#define SN_id_hex_partial_message "id-hex-partial-message"
+#define LN_id_hex_partial_message "id-hex-partial-message"
+#define NID_id_hex_partial_message 507
+#define OBJ_id_hex_partial_message OBJ_mime_mhs_headings,1L
+
+#define SN_id_hex_multipart_message "id-hex-multipart-message"
+#define LN_id_hex_multipart_message "id-hex-multipart-message"
+#define NID_id_hex_multipart_message 508
+#define OBJ_id_hex_multipart_message OBJ_mime_mhs_headings,2L
+
+#define SN_rle_compression "RLE"
+#define LN_rle_compression "run length compression"
+#define NID_rle_compression 124
+#define OBJ_rle_compression 1L,1L,1L,1L,666L,1L
+
+#define SN_zlib_compression "ZLIB"
+#define LN_zlib_compression "zlib compression"
+#define NID_zlib_compression 125
+#define OBJ_zlib_compression OBJ_id_smime_alg,8L
+
+#define OBJ_csor 2L,16L,840L,1L,101L,3L
+
+#define OBJ_nistAlgorithms OBJ_csor,4L
+
+#define OBJ_aes OBJ_nistAlgorithms,1L
+
+#define SN_aes_128_ecb "AES-128-ECB"
+#define LN_aes_128_ecb "aes-128-ecb"
+#define NID_aes_128_ecb 418
+#define OBJ_aes_128_ecb OBJ_aes,1L
+
+#define SN_aes_128_cbc "AES-128-CBC"
+#define LN_aes_128_cbc "aes-128-cbc"
+#define NID_aes_128_cbc 419
+#define OBJ_aes_128_cbc OBJ_aes,2L
+
+#define SN_aes_128_ofb128 "AES-128-OFB"
+#define LN_aes_128_ofb128 "aes-128-ofb"
+#define NID_aes_128_ofb128 420
+#define OBJ_aes_128_ofb128 OBJ_aes,3L
+
+#define SN_aes_128_cfb128 "AES-128-CFB"
+#define LN_aes_128_cfb128 "aes-128-cfb"
+#define NID_aes_128_cfb128 421
+#define OBJ_aes_128_cfb128 OBJ_aes,4L
+
+#define SN_id_aes128_wrap "id-aes128-wrap"
+#define NID_id_aes128_wrap 788
+#define OBJ_id_aes128_wrap OBJ_aes,5L
+
+#define SN_aes_128_gcm "id-aes128-GCM"
+#define LN_aes_128_gcm "aes-128-gcm"
+#define NID_aes_128_gcm 895
+#define OBJ_aes_128_gcm OBJ_aes,6L
+
+#define SN_aes_128_ccm "id-aes128-CCM"
+#define LN_aes_128_ccm "aes-128-ccm"
+#define NID_aes_128_ccm 896
+#define OBJ_aes_128_ccm OBJ_aes,7L
+
+#define SN_id_aes128_wrap_pad "id-aes128-wrap-pad"
+#define NID_id_aes128_wrap_pad 897
+#define OBJ_id_aes128_wrap_pad OBJ_aes,8L
+
+#define SN_aes_192_ecb "AES-192-ECB"
+#define LN_aes_192_ecb "aes-192-ecb"
+#define NID_aes_192_ecb 422
+#define OBJ_aes_192_ecb OBJ_aes,21L
+
+#define SN_aes_192_cbc "AES-192-CBC"
+#define LN_aes_192_cbc "aes-192-cbc"
+#define NID_aes_192_cbc 423
+#define OBJ_aes_192_cbc OBJ_aes,22L
+
+#define SN_aes_192_ofb128 "AES-192-OFB"
+#define LN_aes_192_ofb128 "aes-192-ofb"
+#define NID_aes_192_ofb128 424
+#define OBJ_aes_192_ofb128 OBJ_aes,23L
+
+#define SN_aes_192_cfb128 "AES-192-CFB"
+#define LN_aes_192_cfb128 "aes-192-cfb"
+#define NID_aes_192_cfb128 425
+#define OBJ_aes_192_cfb128 OBJ_aes,24L
+
+#define SN_id_aes192_wrap "id-aes192-wrap"
+#define NID_id_aes192_wrap 789
+#define OBJ_id_aes192_wrap OBJ_aes,25L
+
+#define SN_aes_192_gcm "id-aes192-GCM"
+#define LN_aes_192_gcm "aes-192-gcm"
+#define NID_aes_192_gcm 898
+#define OBJ_aes_192_gcm OBJ_aes,26L
+
+#define SN_aes_192_ccm "id-aes192-CCM"
+#define LN_aes_192_ccm "aes-192-ccm"
+#define NID_aes_192_ccm 899
+#define OBJ_aes_192_ccm OBJ_aes,27L
+
+#define SN_id_aes192_wrap_pad "id-aes192-wrap-pad"
+#define NID_id_aes192_wrap_pad 900
+#define OBJ_id_aes192_wrap_pad OBJ_aes,28L
+
+#define SN_aes_256_ecb "AES-256-ECB"
+#define LN_aes_256_ecb "aes-256-ecb"
+#define NID_aes_256_ecb 426
+#define OBJ_aes_256_ecb OBJ_aes,41L
+
+#define SN_aes_256_cbc "AES-256-CBC"
+#define LN_aes_256_cbc "aes-256-cbc"
+#define NID_aes_256_cbc 427
+#define OBJ_aes_256_cbc OBJ_aes,42L
+
+#define SN_aes_256_ofb128 "AES-256-OFB"
+#define LN_aes_256_ofb128 "aes-256-ofb"
+#define NID_aes_256_ofb128 428
+#define OBJ_aes_256_ofb128 OBJ_aes,43L
+
+#define SN_aes_256_cfb128 "AES-256-CFB"
+#define LN_aes_256_cfb128 "aes-256-cfb"
+#define NID_aes_256_cfb128 429
+#define OBJ_aes_256_cfb128 OBJ_aes,44L
+
+#define SN_id_aes256_wrap "id-aes256-wrap"
+#define NID_id_aes256_wrap 790
+#define OBJ_id_aes256_wrap OBJ_aes,45L
+
+#define SN_aes_256_gcm "id-aes256-GCM"
+#define LN_aes_256_gcm "aes-256-gcm"
+#define NID_aes_256_gcm 901
+#define OBJ_aes_256_gcm OBJ_aes,46L
+
+#define SN_aes_256_ccm "id-aes256-CCM"
+#define LN_aes_256_ccm "aes-256-ccm"
+#define NID_aes_256_ccm 902
+#define OBJ_aes_256_ccm OBJ_aes,47L
+
+#define SN_id_aes256_wrap_pad "id-aes256-wrap-pad"
+#define NID_id_aes256_wrap_pad 903
+#define OBJ_id_aes256_wrap_pad OBJ_aes,48L
+
+#define SN_aes_128_cfb1 "AES-128-CFB1"
+#define LN_aes_128_cfb1 "aes-128-cfb1"
+#define NID_aes_128_cfb1 650
+
+#define SN_aes_192_cfb1 "AES-192-CFB1"
+#define LN_aes_192_cfb1 "aes-192-cfb1"
+#define NID_aes_192_cfb1 651
+
+#define SN_aes_256_cfb1 "AES-256-CFB1"
+#define LN_aes_256_cfb1 "aes-256-cfb1"
+#define NID_aes_256_cfb1 652
+
+#define SN_aes_128_cfb8 "AES-128-CFB8"
+#define LN_aes_128_cfb8 "aes-128-cfb8"
+#define NID_aes_128_cfb8 653
+
+#define SN_aes_192_cfb8 "AES-192-CFB8"
+#define LN_aes_192_cfb8 "aes-192-cfb8"
+#define NID_aes_192_cfb8 654
+
+#define SN_aes_256_cfb8 "AES-256-CFB8"
+#define LN_aes_256_cfb8 "aes-256-cfb8"
+#define NID_aes_256_cfb8 655
+
+#define SN_aes_128_ctr "AES-128-CTR"
+#define LN_aes_128_ctr "aes-128-ctr"
+#define NID_aes_128_ctr 904
+
+#define SN_aes_192_ctr "AES-192-CTR"
+#define LN_aes_192_ctr "aes-192-ctr"
+#define NID_aes_192_ctr 905
+
+#define SN_aes_256_ctr "AES-256-CTR"
+#define LN_aes_256_ctr "aes-256-ctr"
+#define NID_aes_256_ctr 906
+
+#define SN_aes_128_xts "AES-128-XTS"
+#define LN_aes_128_xts "aes-128-xts"
+#define NID_aes_128_xts 913
+
+#define SN_aes_256_xts "AES-256-XTS"
+#define LN_aes_256_xts "aes-256-xts"
+#define NID_aes_256_xts 914
+
+#define SN_des_cfb1 "DES-CFB1"
+#define LN_des_cfb1 "des-cfb1"
+#define NID_des_cfb1 656
+
+#define SN_des_cfb8 "DES-CFB8"
+#define LN_des_cfb8 "des-cfb8"
+#define NID_des_cfb8 657
+
+#define SN_des_ede3_cfb1 "DES-EDE3-CFB1"
+#define LN_des_ede3_cfb1 "des-ede3-cfb1"
+#define NID_des_ede3_cfb1 658
+
+#define SN_des_ede3_cfb8 "DES-EDE3-CFB8"
+#define LN_des_ede3_cfb8 "des-ede3-cfb8"
+#define NID_des_ede3_cfb8 659
+
+#define OBJ_nist_hashalgs OBJ_nistAlgorithms,2L
+
+#define SN_sha256 "SHA256"
+#define LN_sha256 "sha256"
+#define NID_sha256 672
+#define OBJ_sha256 OBJ_nist_hashalgs,1L
+
+#define SN_sha384 "SHA384"
+#define LN_sha384 "sha384"
+#define NID_sha384 673
+#define OBJ_sha384 OBJ_nist_hashalgs,2L
+
+#define SN_sha512 "SHA512"
+#define LN_sha512 "sha512"
+#define NID_sha512 674
+#define OBJ_sha512 OBJ_nist_hashalgs,3L
+
+#define SN_sha224 "SHA224"
+#define LN_sha224 "sha224"
+#define NID_sha224 675
+#define OBJ_sha224 OBJ_nist_hashalgs,4L
+
+#define OBJ_dsa_with_sha2 OBJ_nistAlgorithms,3L
+
+#define SN_dsa_with_SHA224 "dsa_with_SHA224"
+#define NID_dsa_with_SHA224 802
+#define OBJ_dsa_with_SHA224 OBJ_dsa_with_sha2,1L
+
+#define SN_dsa_with_SHA256 "dsa_with_SHA256"
+#define NID_dsa_with_SHA256 803
+#define OBJ_dsa_with_SHA256 OBJ_dsa_with_sha2,2L
+
+#define SN_hold_instruction_code "holdInstructionCode"
+#define LN_hold_instruction_code "Hold Instruction Code"
+#define NID_hold_instruction_code 430
+#define OBJ_hold_instruction_code OBJ_id_ce,23L
+
+#define OBJ_holdInstruction OBJ_X9_57,2L
+
+#define SN_hold_instruction_none "holdInstructionNone"
+#define LN_hold_instruction_none "Hold Instruction None"
+#define NID_hold_instruction_none 431
+#define OBJ_hold_instruction_none OBJ_holdInstruction,1L
+
+#define SN_hold_instruction_call_issuer "holdInstructionCallIssuer"
+#define LN_hold_instruction_call_issuer "Hold Instruction Call Issuer"
+#define NID_hold_instruction_call_issuer 432
+#define OBJ_hold_instruction_call_issuer OBJ_holdInstruction,2L
+
+#define SN_hold_instruction_reject "holdInstructionReject"
+#define LN_hold_instruction_reject "Hold Instruction Reject"
+#define NID_hold_instruction_reject 433
+#define OBJ_hold_instruction_reject OBJ_holdInstruction,3L
+
+#define SN_data "data"
+#define NID_data 434
+#define OBJ_data OBJ_itu_t,9L
+
+#define SN_pss "pss"
+#define NID_pss 435
+#define OBJ_pss OBJ_data,2342L
+
+#define SN_ucl "ucl"
+#define NID_ucl 436
+#define OBJ_ucl OBJ_pss,19200300L
+
+#define SN_pilot "pilot"
+#define NID_pilot 437
+#define OBJ_pilot OBJ_ucl,100L
+
+#define LN_pilotAttributeType "pilotAttributeType"
+#define NID_pilotAttributeType 438
+#define OBJ_pilotAttributeType OBJ_pilot,1L
+
+#define LN_pilotAttributeSyntax "pilotAttributeSyntax"
+#define NID_pilotAttributeSyntax 439
+#define OBJ_pilotAttributeSyntax OBJ_pilot,3L
+
+#define LN_pilotObjectClass "pilotObjectClass"
+#define NID_pilotObjectClass 440
+#define OBJ_pilotObjectClass OBJ_pilot,4L
+
+#define LN_pilotGroups "pilotGroups"
+#define NID_pilotGroups 441
+#define OBJ_pilotGroups OBJ_pilot,10L
+
+#define LN_iA5StringSyntax "iA5StringSyntax"
+#define NID_iA5StringSyntax 442
+#define OBJ_iA5StringSyntax OBJ_pilotAttributeSyntax,4L
+
+#define LN_caseIgnoreIA5StringSyntax "caseIgnoreIA5StringSyntax"
+#define NID_caseIgnoreIA5StringSyntax 443
+#define OBJ_caseIgnoreIA5StringSyntax OBJ_pilotAttributeSyntax,5L
+
+#define LN_pilotObject "pilotObject"
+#define NID_pilotObject 444
+#define OBJ_pilotObject OBJ_pilotObjectClass,3L
+
+#define LN_pilotPerson "pilotPerson"
+#define NID_pilotPerson 445
+#define OBJ_pilotPerson OBJ_pilotObjectClass,4L
+
+#define SN_account "account"
+#define NID_account 446
+#define OBJ_account OBJ_pilotObjectClass,5L
+
+#define SN_document "document"
+#define NID_document 447
+#define OBJ_document OBJ_pilotObjectClass,6L
+
+#define SN_room "room"
+#define NID_room 448
+#define OBJ_room OBJ_pilotObjectClass,7L
+
+#define LN_documentSeries "documentSeries"
+#define NID_documentSeries 449
+#define OBJ_documentSeries OBJ_pilotObjectClass,9L
+
+#define SN_Domain "domain"
+#define LN_Domain "Domain"
+#define NID_Domain 392
+#define OBJ_Domain OBJ_pilotObjectClass,13L
+
+#define LN_rFC822localPart "rFC822localPart"
+#define NID_rFC822localPart 450
+#define OBJ_rFC822localPart OBJ_pilotObjectClass,14L
+
+#define LN_dNSDomain "dNSDomain"
+#define NID_dNSDomain 451
+#define OBJ_dNSDomain OBJ_pilotObjectClass,15L
+
+#define LN_domainRelatedObject "domainRelatedObject"
+#define NID_domainRelatedObject 452
+#define OBJ_domainRelatedObject OBJ_pilotObjectClass,17L
+
+#define LN_friendlyCountry "friendlyCountry"
+#define NID_friendlyCountry 453
+#define OBJ_friendlyCountry OBJ_pilotObjectClass,18L
+
+#define LN_simpleSecurityObject "simpleSecurityObject"
+#define NID_simpleSecurityObject 454
+#define OBJ_simpleSecurityObject OBJ_pilotObjectClass,19L
+
+#define LN_pilotOrganization "pilotOrganization"
+#define NID_pilotOrganization 455
+#define OBJ_pilotOrganization OBJ_pilotObjectClass,20L
+
+#define LN_pilotDSA "pilotDSA"
+#define NID_pilotDSA 456
+#define OBJ_pilotDSA OBJ_pilotObjectClass,21L
+
+#define LN_qualityLabelledData "qualityLabelledData"
+#define NID_qualityLabelledData 457
+#define OBJ_qualityLabelledData OBJ_pilotObjectClass,22L
+
+#define SN_userId "UID"
+#define LN_userId "userId"
+#define NID_userId 458
+#define OBJ_userId OBJ_pilotAttributeType,1L
+
+#define LN_textEncodedORAddress "textEncodedORAddress"
+#define NID_textEncodedORAddress 459
+#define OBJ_textEncodedORAddress OBJ_pilotAttributeType,2L
+
+#define SN_rfc822Mailbox "mail"
+#define LN_rfc822Mailbox "rfc822Mailbox"
+#define NID_rfc822Mailbox 460
+#define OBJ_rfc822Mailbox OBJ_pilotAttributeType,3L
+
+#define SN_info "info"
+#define NID_info 461
+#define OBJ_info OBJ_pilotAttributeType,4L
+
+#define LN_favouriteDrink "favouriteDrink"
+#define NID_favouriteDrink 462
+#define OBJ_favouriteDrink OBJ_pilotAttributeType,5L
+
+#define LN_roomNumber "roomNumber"
+#define NID_roomNumber 463
+#define OBJ_roomNumber OBJ_pilotAttributeType,6L
+
+#define SN_photo "photo"
+#define NID_photo 464
+#define OBJ_photo OBJ_pilotAttributeType,7L
+
+#define LN_userClass "userClass"
+#define NID_userClass 465
+#define OBJ_userClass OBJ_pilotAttributeType,8L
+
+#define SN_host "host"
+#define NID_host 466
+#define OBJ_host OBJ_pilotAttributeType,9L
+
+#define SN_manager "manager"
+#define NID_manager 467
+#define OBJ_manager OBJ_pilotAttributeType,10L
+
+#define LN_documentIdentifier "documentIdentifier"
+#define NID_documentIdentifier 468
+#define OBJ_documentIdentifier OBJ_pilotAttributeType,11L
+
+#define LN_documentTitle "documentTitle"
+#define NID_documentTitle 469
+#define OBJ_documentTitle OBJ_pilotAttributeType,12L
+
+#define LN_documentVersion "documentVersion"
+#define NID_documentVersion 470
+#define OBJ_documentVersion OBJ_pilotAttributeType,13L
+
+#define LN_documentAuthor "documentAuthor"
+#define NID_documentAuthor 471
+#define OBJ_documentAuthor OBJ_pilotAttributeType,14L
+
+#define LN_documentLocation "documentLocation"
+#define NID_documentLocation 472
+#define OBJ_documentLocation OBJ_pilotAttributeType,15L
+
+#define LN_homeTelephoneNumber "homeTelephoneNumber"
+#define NID_homeTelephoneNumber 473
+#define OBJ_homeTelephoneNumber OBJ_pilotAttributeType,20L
+
+#define SN_secretary "secretary"
+#define NID_secretary 474
+#define OBJ_secretary OBJ_pilotAttributeType,21L
+
+#define LN_otherMailbox "otherMailbox"
+#define NID_otherMailbox 475
+#define OBJ_otherMailbox OBJ_pilotAttributeType,22L
+
+#define LN_lastModifiedTime "lastModifiedTime"
+#define NID_lastModifiedTime 476
+#define OBJ_lastModifiedTime OBJ_pilotAttributeType,23L
+
+#define LN_lastModifiedBy "lastModifiedBy"
+#define NID_lastModifiedBy 477
+#define OBJ_lastModifiedBy OBJ_pilotAttributeType,24L
+
+#define SN_domainComponent "DC"
+#define LN_domainComponent "domainComponent"
+#define NID_domainComponent 391
+#define OBJ_domainComponent OBJ_pilotAttributeType,25L
+
+#define LN_aRecord "aRecord"
+#define NID_aRecord 478
+#define OBJ_aRecord OBJ_pilotAttributeType,26L
+
+#define LN_pilotAttributeType27 "pilotAttributeType27"
+#define NID_pilotAttributeType27 479
+#define OBJ_pilotAttributeType27 OBJ_pilotAttributeType,27L
+
+#define LN_mXRecord "mXRecord"
+#define NID_mXRecord 480
+#define OBJ_mXRecord OBJ_pilotAttributeType,28L
+
+#define LN_nSRecord "nSRecord"
+#define NID_nSRecord 481
+#define OBJ_nSRecord OBJ_pilotAttributeType,29L
+
+#define LN_sOARecord "sOARecord"
+#define NID_sOARecord 482
+#define OBJ_sOARecord OBJ_pilotAttributeType,30L
+
+#define LN_cNAMERecord "cNAMERecord"
+#define NID_cNAMERecord 483
+#define OBJ_cNAMERecord OBJ_pilotAttributeType,31L
+
+#define LN_associatedDomain "associatedDomain"
+#define NID_associatedDomain 484
+#define OBJ_associatedDomain OBJ_pilotAttributeType,37L
+
+#define LN_associatedName "associatedName"
+#define NID_associatedName 485
+#define OBJ_associatedName OBJ_pilotAttributeType,38L
+
+#define LN_homePostalAddress "homePostalAddress"
+#define NID_homePostalAddress 486
+#define OBJ_homePostalAddress OBJ_pilotAttributeType,39L
+
+#define LN_personalTitle "personalTitle"
+#define NID_personalTitle 487
+#define OBJ_personalTitle OBJ_pilotAttributeType,40L
+
+#define LN_mobileTelephoneNumber "mobileTelephoneNumber"
+#define NID_mobileTelephoneNumber 488
+#define OBJ_mobileTelephoneNumber OBJ_pilotAttributeType,41L
+
+#define LN_pagerTelephoneNumber "pagerTelephoneNumber"
+#define NID_pagerTelephoneNumber 489
+#define OBJ_pagerTelephoneNumber OBJ_pilotAttributeType,42L
+
+#define LN_friendlyCountryName "friendlyCountryName"
+#define NID_friendlyCountryName 490
+#define OBJ_friendlyCountryName OBJ_pilotAttributeType,43L
+
+#define LN_organizationalStatus "organizationalStatus"
+#define NID_organizationalStatus 491
+#define OBJ_organizationalStatus OBJ_pilotAttributeType,45L
+
+#define LN_janetMailbox "janetMailbox"
+#define NID_janetMailbox 492
+#define OBJ_janetMailbox OBJ_pilotAttributeType,46L
+
+#define LN_mailPreferenceOption "mailPreferenceOption"
+#define NID_mailPreferenceOption 493
+#define OBJ_mailPreferenceOption OBJ_pilotAttributeType,47L
+
+#define LN_buildingName "buildingName"
+#define NID_buildingName 494
+#define OBJ_buildingName OBJ_pilotAttributeType,48L
+
+#define LN_dSAQuality "dSAQuality"
+#define NID_dSAQuality 495
+#define OBJ_dSAQuality OBJ_pilotAttributeType,49L
+
+#define LN_singleLevelQuality "singleLevelQuality"
+#define NID_singleLevelQuality 496
+#define OBJ_singleLevelQuality OBJ_pilotAttributeType,50L
+
+#define LN_subtreeMinimumQuality "subtreeMinimumQuality"
+#define NID_subtreeMinimumQuality 497
+#define OBJ_subtreeMinimumQuality OBJ_pilotAttributeType,51L
+
+#define LN_subtreeMaximumQuality "subtreeMaximumQuality"
+#define NID_subtreeMaximumQuality 498
+#define OBJ_subtreeMaximumQuality OBJ_pilotAttributeType,52L
+
+#define LN_personalSignature "personalSignature"
+#define NID_personalSignature 499
+#define OBJ_personalSignature OBJ_pilotAttributeType,53L
+
+#define LN_dITRedirect "dITRedirect"
+#define NID_dITRedirect 500
+#define OBJ_dITRedirect OBJ_pilotAttributeType,54L
+
+#define SN_audio "audio"
+#define NID_audio 501
+#define OBJ_audio OBJ_pilotAttributeType,55L
+
+#define LN_documentPublisher "documentPublisher"
+#define NID_documentPublisher 502
+#define OBJ_documentPublisher OBJ_pilotAttributeType,56L
+
+#define SN_id_set "id-set"
+#define LN_id_set "Secure Electronic Transactions"
+#define NID_id_set 512
+#define OBJ_id_set OBJ_international_organizations,42L
+
+#define SN_set_ctype "set-ctype"
+#define LN_set_ctype "content types"
+#define NID_set_ctype 513
+#define OBJ_set_ctype OBJ_id_set,0L
+
+#define SN_set_msgExt "set-msgExt"
+#define LN_set_msgExt "message extensions"
+#define NID_set_msgExt 514
+#define OBJ_set_msgExt OBJ_id_set,1L
+
+#define SN_set_attr "set-attr"
+#define NID_set_attr 515
+#define OBJ_set_attr OBJ_id_set,3L
+
+#define SN_set_policy "set-policy"
+#define NID_set_policy 516
+#define OBJ_set_policy OBJ_id_set,5L
+
+#define SN_set_certExt "set-certExt"
+#define LN_set_certExt "certificate extensions"
+#define NID_set_certExt 517
+#define OBJ_set_certExt OBJ_id_set,7L
+
+#define SN_set_brand "set-brand"
+#define NID_set_brand 518
+#define OBJ_set_brand OBJ_id_set,8L
+
+#define SN_setct_PANData "setct-PANData"
+#define NID_setct_PANData 519
+#define OBJ_setct_PANData OBJ_set_ctype,0L
+
+#define SN_setct_PANToken "setct-PANToken"
+#define NID_setct_PANToken 520
+#define OBJ_setct_PANToken OBJ_set_ctype,1L
+
+#define SN_setct_PANOnly "setct-PANOnly"
+#define NID_setct_PANOnly 521
+#define OBJ_setct_PANOnly OBJ_set_ctype,2L
+
+#define SN_setct_OIData "setct-OIData"
+#define NID_setct_OIData 522
+#define OBJ_setct_OIData OBJ_set_ctype,3L
+
+#define SN_setct_PI "setct-PI"
+#define NID_setct_PI 523
+#define OBJ_setct_PI OBJ_set_ctype,4L
+
+#define SN_setct_PIData "setct-PIData"
+#define NID_setct_PIData 524
+#define OBJ_setct_PIData OBJ_set_ctype,5L
+
+#define SN_setct_PIDataUnsigned "setct-PIDataUnsigned"
+#define NID_setct_PIDataUnsigned 525
+#define OBJ_setct_PIDataUnsigned OBJ_set_ctype,6L
+
+#define SN_setct_HODInput "setct-HODInput"
+#define NID_setct_HODInput 526
+#define OBJ_setct_HODInput OBJ_set_ctype,7L
+
+#define SN_setct_AuthResBaggage "setct-AuthResBaggage"
+#define NID_setct_AuthResBaggage 527
+#define OBJ_setct_AuthResBaggage OBJ_set_ctype,8L
+
+#define SN_setct_AuthRevReqBaggage "setct-AuthRevReqBaggage"
+#define NID_setct_AuthRevReqBaggage 528
+#define OBJ_setct_AuthRevReqBaggage OBJ_set_ctype,9L
+
+#define SN_setct_AuthRevResBaggage "setct-AuthRevResBaggage"
+#define NID_setct_AuthRevResBaggage 529
+#define OBJ_setct_AuthRevResBaggage OBJ_set_ctype,10L
+
+#define SN_setct_CapTokenSeq "setct-CapTokenSeq"
+#define NID_setct_CapTokenSeq 530
+#define OBJ_setct_CapTokenSeq OBJ_set_ctype,11L
+
+#define SN_setct_PInitResData "setct-PInitResData"
+#define NID_setct_PInitResData 531
+#define OBJ_setct_PInitResData OBJ_set_ctype,12L
+
+#define SN_setct_PI_TBS "setct-PI-TBS"
+#define NID_setct_PI_TBS 532
+#define OBJ_setct_PI_TBS OBJ_set_ctype,13L
+
+#define SN_setct_PResData "setct-PResData"
+#define NID_setct_PResData 533
+#define OBJ_setct_PResData OBJ_set_ctype,14L
+
+#define SN_setct_AuthReqTBS "setct-AuthReqTBS"
+#define NID_setct_AuthReqTBS 534
+#define OBJ_setct_AuthReqTBS OBJ_set_ctype,16L
+
+#define SN_setct_AuthResTBS "setct-AuthResTBS"
+#define NID_setct_AuthResTBS 535
+#define OBJ_setct_AuthResTBS OBJ_set_ctype,17L
+
+#define SN_setct_AuthResTBSX "setct-AuthResTBSX"
+#define NID_setct_AuthResTBSX 536
+#define OBJ_setct_AuthResTBSX OBJ_set_ctype,18L
+
+#define SN_setct_AuthTokenTBS "setct-AuthTokenTBS"
+#define NID_setct_AuthTokenTBS 537
+#define OBJ_setct_AuthTokenTBS OBJ_set_ctype,19L
+
+#define SN_setct_CapTokenData "setct-CapTokenData"
+#define NID_setct_CapTokenData 538
+#define OBJ_setct_CapTokenData OBJ_set_ctype,20L
+
+#define SN_setct_CapTokenTBS "setct-CapTokenTBS"
+#define NID_setct_CapTokenTBS 539
+#define OBJ_setct_CapTokenTBS OBJ_set_ctype,21L
+
+#define SN_setct_AcqCardCodeMsg "setct-AcqCardCodeMsg"
+#define NID_setct_AcqCardCodeMsg 540
+#define OBJ_setct_AcqCardCodeMsg OBJ_set_ctype,22L
+
+#define SN_setct_AuthRevReqTBS "setct-AuthRevReqTBS"
+#define NID_setct_AuthRevReqTBS 541
+#define OBJ_setct_AuthRevReqTBS OBJ_set_ctype,23L
+
+#define SN_setct_AuthRevResData "setct-AuthRevResData"
+#define NID_setct_AuthRevResData 542
+#define OBJ_setct_AuthRevResData OBJ_set_ctype,24L
+
+#define SN_setct_AuthRevResTBS "setct-AuthRevResTBS"
+#define NID_setct_AuthRevResTBS 543
+#define OBJ_setct_AuthRevResTBS OBJ_set_ctype,25L
+
+#define SN_setct_CapReqTBS "setct-CapReqTBS"
+#define NID_setct_CapReqTBS 544
+#define OBJ_setct_CapReqTBS OBJ_set_ctype,26L
+
+#define SN_setct_CapReqTBSX "setct-CapReqTBSX"
+#define NID_setct_CapReqTBSX 545
+#define OBJ_setct_CapReqTBSX OBJ_set_ctype,27L
+
+#define SN_setct_CapResData "setct-CapResData"
+#define NID_setct_CapResData 546
+#define OBJ_setct_CapResData OBJ_set_ctype,28L
+
+#define SN_setct_CapRevReqTBS "setct-CapRevReqTBS"
+#define NID_setct_CapRevReqTBS 547
+#define OBJ_setct_CapRevReqTBS OBJ_set_ctype,29L
+
+#define SN_setct_CapRevReqTBSX "setct-CapRevReqTBSX"
+#define NID_setct_CapRevReqTBSX 548
+#define OBJ_setct_CapRevReqTBSX OBJ_set_ctype,30L
+
+#define SN_setct_CapRevResData "setct-CapRevResData"
+#define NID_setct_CapRevResData 549
+#define OBJ_setct_CapRevResData OBJ_set_ctype,31L
+
+#define SN_setct_CredReqTBS "setct-CredReqTBS"
+#define NID_setct_CredReqTBS 550
+#define OBJ_setct_CredReqTBS OBJ_set_ctype,32L
+
+#define SN_setct_CredReqTBSX "setct-CredReqTBSX"
+#define NID_setct_CredReqTBSX 551
+#define OBJ_setct_CredReqTBSX OBJ_set_ctype,33L
+
+#define SN_setct_CredResData "setct-CredResData"
+#define NID_setct_CredResData 552
+#define OBJ_setct_CredResData OBJ_set_ctype,34L
+
+#define SN_setct_CredRevReqTBS "setct-CredRevReqTBS"
+#define NID_setct_CredRevReqTBS 553
+#define OBJ_setct_CredRevReqTBS OBJ_set_ctype,35L
+
+#define SN_setct_CredRevReqTBSX "setct-CredRevReqTBSX"
+#define NID_setct_CredRevReqTBSX 554
+#define OBJ_setct_CredRevReqTBSX OBJ_set_ctype,36L
+
+#define SN_setct_CredRevResData "setct-CredRevResData"
+#define NID_setct_CredRevResData 555
+#define OBJ_setct_CredRevResData OBJ_set_ctype,37L
+
+#define SN_setct_PCertReqData "setct-PCertReqData"
+#define NID_setct_PCertReqData 556
+#define OBJ_setct_PCertReqData OBJ_set_ctype,38L
+
+#define SN_setct_PCertResTBS "setct-PCertResTBS"
+#define NID_setct_PCertResTBS 557
+#define OBJ_setct_PCertResTBS OBJ_set_ctype,39L
+
+#define SN_setct_BatchAdminReqData "setct-BatchAdminReqData"
+#define NID_setct_BatchAdminReqData 558
+#define OBJ_setct_BatchAdminReqData OBJ_set_ctype,40L
+
+#define SN_setct_BatchAdminResData "setct-BatchAdminResData"
+#define NID_setct_BatchAdminResData 559
+#define OBJ_setct_BatchAdminResData OBJ_set_ctype,41L
+
+#define SN_setct_CardCInitResTBS "setct-CardCInitResTBS"
+#define NID_setct_CardCInitResTBS 560
+#define OBJ_setct_CardCInitResTBS OBJ_set_ctype,42L
+
+#define SN_setct_MeAqCInitResTBS "setct-MeAqCInitResTBS"
+#define NID_setct_MeAqCInitResTBS 561
+#define OBJ_setct_MeAqCInitResTBS OBJ_set_ctype,43L
+
+#define SN_setct_RegFormResTBS "setct-RegFormResTBS"
+#define NID_setct_RegFormResTBS 562
+#define OBJ_setct_RegFormResTBS OBJ_set_ctype,44L
+
+#define SN_setct_CertReqData "setct-CertReqData"
+#define NID_setct_CertReqData 563
+#define OBJ_setct_CertReqData OBJ_set_ctype,45L
+
+#define SN_setct_CertReqTBS "setct-CertReqTBS"
+#define NID_setct_CertReqTBS 564
+#define OBJ_setct_CertReqTBS OBJ_set_ctype,46L
+
+#define SN_setct_CertResData "setct-CertResData"
+#define NID_setct_CertResData 565
+#define OBJ_setct_CertResData OBJ_set_ctype,47L
+
+#define SN_setct_CertInqReqTBS "setct-CertInqReqTBS"
+#define NID_setct_CertInqReqTBS 566
+#define OBJ_setct_CertInqReqTBS OBJ_set_ctype,48L
+
+#define SN_setct_ErrorTBS "setct-ErrorTBS"
+#define NID_setct_ErrorTBS 567
+#define OBJ_setct_ErrorTBS OBJ_set_ctype,49L
+
+#define SN_setct_PIDualSignedTBE "setct-PIDualSignedTBE"
+#define NID_setct_PIDualSignedTBE 568
+#define OBJ_setct_PIDualSignedTBE OBJ_set_ctype,50L
+
+#define SN_setct_PIUnsignedTBE "setct-PIUnsignedTBE"
+#define NID_setct_PIUnsignedTBE 569
+#define OBJ_setct_PIUnsignedTBE OBJ_set_ctype,51L
+
+#define SN_setct_AuthReqTBE "setct-AuthReqTBE"
+#define NID_setct_AuthReqTBE 570
+#define OBJ_setct_AuthReqTBE OBJ_set_ctype,52L
+
+#define SN_setct_AuthResTBE "setct-AuthResTBE"
+#define NID_setct_AuthResTBE 571
+#define OBJ_setct_AuthResTBE OBJ_set_ctype,53L
+
+#define SN_setct_AuthResTBEX "setct-AuthResTBEX"
+#define NID_setct_AuthResTBEX 572
+#define OBJ_setct_AuthResTBEX OBJ_set_ctype,54L
+
+#define SN_setct_AuthTokenTBE "setct-AuthTokenTBE"
+#define NID_setct_AuthTokenTBE 573
+#define OBJ_setct_AuthTokenTBE OBJ_set_ctype,55L
+
+#define SN_setct_CapTokenTBE "setct-CapTokenTBE"
+#define NID_setct_CapTokenTBE 574
+#define OBJ_setct_CapTokenTBE OBJ_set_ctype,56L
+
+#define SN_setct_CapTokenTBEX "setct-CapTokenTBEX"
+#define NID_setct_CapTokenTBEX 575
+#define OBJ_setct_CapTokenTBEX OBJ_set_ctype,57L
+
+#define SN_setct_AcqCardCodeMsgTBE "setct-AcqCardCodeMsgTBE"
+#define NID_setct_AcqCardCodeMsgTBE 576
+#define OBJ_setct_AcqCardCodeMsgTBE OBJ_set_ctype,58L
+
+#define SN_setct_AuthRevReqTBE "setct-AuthRevReqTBE"
+#define NID_setct_AuthRevReqTBE 577
+#define OBJ_setct_AuthRevReqTBE OBJ_set_ctype,59L
+
+#define SN_setct_AuthRevResTBE "setct-AuthRevResTBE"
+#define NID_setct_AuthRevResTBE 578
+#define OBJ_setct_AuthRevResTBE OBJ_set_ctype,60L
+
+#define SN_setct_AuthRevResTBEB "setct-AuthRevResTBEB"
+#define NID_setct_AuthRevResTBEB 579
+#define OBJ_setct_AuthRevResTBEB OBJ_set_ctype,61L
+
+#define SN_setct_CapReqTBE "setct-CapReqTBE"
+#define NID_setct_CapReqTBE 580
+#define OBJ_setct_CapReqTBE OBJ_set_ctype,62L
+
+#define SN_setct_CapReqTBEX "setct-CapReqTBEX"
+#define NID_setct_CapReqTBEX 581
+#define OBJ_setct_CapReqTBEX OBJ_set_ctype,63L
+
+#define SN_setct_CapResTBE "setct-CapResTBE"
+#define NID_setct_CapResTBE 582
+#define OBJ_setct_CapResTBE OBJ_set_ctype,64L
+
+#define SN_setct_CapRevReqTBE "setct-CapRevReqTBE"
+#define NID_setct_CapRevReqTBE 583
+#define OBJ_setct_CapRevReqTBE OBJ_set_ctype,65L
+
+#define SN_setct_CapRevReqTBEX "setct-CapRevReqTBEX"
+#define NID_setct_CapRevReqTBEX 584
+#define OBJ_setct_CapRevReqTBEX OBJ_set_ctype,66L
+
+#define SN_setct_CapRevResTBE "setct-CapRevResTBE"
+#define NID_setct_CapRevResTBE 585
+#define OBJ_setct_CapRevResTBE OBJ_set_ctype,67L
+
+#define SN_setct_CredReqTBE "setct-CredReqTBE"
+#define NID_setct_CredReqTBE 586
+#define OBJ_setct_CredReqTBE OBJ_set_ctype,68L
+
+#define SN_setct_CredReqTBEX "setct-CredReqTBEX"
+#define NID_setct_CredReqTBEX 587
+#define OBJ_setct_CredReqTBEX OBJ_set_ctype,69L
+
+#define SN_setct_CredResTBE "setct-CredResTBE"
+#define NID_setct_CredResTBE 588
+#define OBJ_setct_CredResTBE OBJ_set_ctype,70L
+
+#define SN_setct_CredRevReqTBE "setct-CredRevReqTBE"
+#define NID_setct_CredRevReqTBE 589
+#define OBJ_setct_CredRevReqTBE OBJ_set_ctype,71L
+
+#define SN_setct_CredRevReqTBEX "setct-CredRevReqTBEX"
+#define NID_setct_CredRevReqTBEX 590
+#define OBJ_setct_CredRevReqTBEX OBJ_set_ctype,72L
+
+#define SN_setct_CredRevResTBE "setct-CredRevResTBE"
+#define NID_setct_CredRevResTBE 591
+#define OBJ_setct_CredRevResTBE OBJ_set_ctype,73L
+
+#define SN_setct_BatchAdminReqTBE "setct-BatchAdminReqTBE"
+#define NID_setct_BatchAdminReqTBE 592
+#define OBJ_setct_BatchAdminReqTBE OBJ_set_ctype,74L
+
+#define SN_setct_BatchAdminResTBE "setct-BatchAdminResTBE"
+#define NID_setct_BatchAdminResTBE 593
+#define OBJ_setct_BatchAdminResTBE OBJ_set_ctype,75L
+
+#define SN_setct_RegFormReqTBE "setct-RegFormReqTBE"
+#define NID_setct_RegFormReqTBE 594
+#define OBJ_setct_RegFormReqTBE OBJ_set_ctype,76L
+
+#define SN_setct_CertReqTBE "setct-CertReqTBE"
+#define NID_setct_CertReqTBE 595
+#define OBJ_setct_CertReqTBE OBJ_set_ctype,77L
+
+#define SN_setct_CertReqTBEX "setct-CertReqTBEX"
+#define NID_setct_CertReqTBEX 596
+#define OBJ_setct_CertReqTBEX OBJ_set_ctype,78L
+
+#define SN_setct_CertResTBE "setct-CertResTBE"
+#define NID_setct_CertResTBE 597
+#define OBJ_setct_CertResTBE OBJ_set_ctype,79L
+
+#define SN_setct_CRLNotificationTBS "setct-CRLNotificationTBS"
+#define NID_setct_CRLNotificationTBS 598
+#define OBJ_setct_CRLNotificationTBS OBJ_set_ctype,80L
+
+#define SN_setct_CRLNotificationResTBS "setct-CRLNotificationResTBS"
+#define NID_setct_CRLNotificationResTBS 599
+#define OBJ_setct_CRLNotificationResTBS OBJ_set_ctype,81L
+
+#define SN_setct_BCIDistributionTBS "setct-BCIDistributionTBS"
+#define NID_setct_BCIDistributionTBS 600
+#define OBJ_setct_BCIDistributionTBS OBJ_set_ctype,82L
+
+#define SN_setext_genCrypt "setext-genCrypt"
+#define LN_setext_genCrypt "generic cryptogram"
+#define NID_setext_genCrypt 601
+#define OBJ_setext_genCrypt OBJ_set_msgExt,1L
+
+#define SN_setext_miAuth "setext-miAuth"
+#define LN_setext_miAuth "merchant initiated auth"
+#define NID_setext_miAuth 602
+#define OBJ_setext_miAuth OBJ_set_msgExt,3L
+
+#define SN_setext_pinSecure "setext-pinSecure"
+#define NID_setext_pinSecure 603
+#define OBJ_setext_pinSecure OBJ_set_msgExt,4L
+
+#define SN_setext_pinAny "setext-pinAny"
+#define NID_setext_pinAny 604
+#define OBJ_setext_pinAny OBJ_set_msgExt,5L
+
+#define SN_setext_track2 "setext-track2"
+#define NID_setext_track2 605
+#define OBJ_setext_track2 OBJ_set_msgExt,7L
+
+#define SN_setext_cv "setext-cv"
+#define LN_setext_cv "additional verification"
+#define NID_setext_cv 606
+#define OBJ_setext_cv OBJ_set_msgExt,8L
+
+#define SN_set_policy_root "set-policy-root"
+#define NID_set_policy_root 607
+#define OBJ_set_policy_root OBJ_set_policy,0L
+
+#define SN_setCext_hashedRoot "setCext-hashedRoot"
+#define NID_setCext_hashedRoot 608
+#define OBJ_setCext_hashedRoot OBJ_set_certExt,0L
+
+#define SN_setCext_certType "setCext-certType"
+#define NID_setCext_certType 609
+#define OBJ_setCext_certType OBJ_set_certExt,1L
+
+#define SN_setCext_merchData "setCext-merchData"
+#define NID_setCext_merchData 610
+#define OBJ_setCext_merchData OBJ_set_certExt,2L
+
+#define SN_setCext_cCertRequired "setCext-cCertRequired"
+#define NID_setCext_cCertRequired 611
+#define OBJ_setCext_cCertRequired OBJ_set_certExt,3L
+
+#define SN_setCext_tunneling "setCext-tunneling"
+#define NID_setCext_tunneling 612
+#define OBJ_setCext_tunneling OBJ_set_certExt,4L
+
+#define SN_setCext_setExt "setCext-setExt"
+#define NID_setCext_setExt 613
+#define OBJ_setCext_setExt OBJ_set_certExt,5L
+
+#define SN_setCext_setQualf "setCext-setQualf"
+#define NID_setCext_setQualf 614
+#define OBJ_setCext_setQualf OBJ_set_certExt,6L
+
+#define SN_setCext_PGWYcapabilities "setCext-PGWYcapabilities"
+#define NID_setCext_PGWYcapabilities 615
+#define OBJ_setCext_PGWYcapabilities OBJ_set_certExt,7L
+
+#define SN_setCext_TokenIdentifier "setCext-TokenIdentifier"
+#define NID_setCext_TokenIdentifier 616
+#define OBJ_setCext_TokenIdentifier OBJ_set_certExt,8L
+
+#define SN_setCext_Track2Data "setCext-Track2Data"
+#define NID_setCext_Track2Data 617
+#define OBJ_setCext_Track2Data OBJ_set_certExt,9L
+
+#define SN_setCext_TokenType "setCext-TokenType"
+#define NID_setCext_TokenType 618
+#define OBJ_setCext_TokenType OBJ_set_certExt,10L
+
+#define SN_setCext_IssuerCapabilities "setCext-IssuerCapabilities"
+#define NID_setCext_IssuerCapabilities 619
+#define OBJ_setCext_IssuerCapabilities OBJ_set_certExt,11L
+
+#define SN_setAttr_Cert "setAttr-Cert"
+#define NID_setAttr_Cert 620
+#define OBJ_setAttr_Cert OBJ_set_attr,0L
+
+#define SN_setAttr_PGWYcap "setAttr-PGWYcap"
+#define LN_setAttr_PGWYcap "payment gateway capabilities"
+#define NID_setAttr_PGWYcap 621
+#define OBJ_setAttr_PGWYcap OBJ_set_attr,1L
+
+#define SN_setAttr_TokenType "setAttr-TokenType"
+#define NID_setAttr_TokenType 622
+#define OBJ_setAttr_TokenType OBJ_set_attr,2L
+
+#define SN_setAttr_IssCap "setAttr-IssCap"
+#define LN_setAttr_IssCap "issuer capabilities"
+#define NID_setAttr_IssCap 623
+#define OBJ_setAttr_IssCap OBJ_set_attr,3L
+
+#define SN_set_rootKeyThumb "set-rootKeyThumb"
+#define NID_set_rootKeyThumb 624
+#define OBJ_set_rootKeyThumb OBJ_setAttr_Cert,0L
+
+#define SN_set_addPolicy "set-addPolicy"
+#define NID_set_addPolicy 625
+#define OBJ_set_addPolicy OBJ_setAttr_Cert,1L
+
+#define SN_setAttr_Token_EMV "setAttr-Token-EMV"
+#define NID_setAttr_Token_EMV 626
+#define OBJ_setAttr_Token_EMV OBJ_setAttr_TokenType,1L
+
+#define SN_setAttr_Token_B0Prime "setAttr-Token-B0Prime"
+#define NID_setAttr_Token_B0Prime 627
+#define OBJ_setAttr_Token_B0Prime OBJ_setAttr_TokenType,2L
+
+#define SN_setAttr_IssCap_CVM "setAttr-IssCap-CVM"
+#define NID_setAttr_IssCap_CVM 628
+#define OBJ_setAttr_IssCap_CVM OBJ_setAttr_IssCap,3L
+
+#define SN_setAttr_IssCap_T2 "setAttr-IssCap-T2"
+#define NID_setAttr_IssCap_T2 629
+#define OBJ_setAttr_IssCap_T2 OBJ_setAttr_IssCap,4L
+
+#define SN_setAttr_IssCap_Sig "setAttr-IssCap-Sig"
+#define NID_setAttr_IssCap_Sig 630
+#define OBJ_setAttr_IssCap_Sig OBJ_setAttr_IssCap,5L
+
+#define SN_setAttr_GenCryptgrm "setAttr-GenCryptgrm"
+#define LN_setAttr_GenCryptgrm "generate cryptogram"
+#define NID_setAttr_GenCryptgrm 631
+#define OBJ_setAttr_GenCryptgrm OBJ_setAttr_IssCap_CVM,1L
+
+#define SN_setAttr_T2Enc "setAttr-T2Enc"
+#define LN_setAttr_T2Enc "encrypted track 2"
+#define NID_setAttr_T2Enc 632
+#define OBJ_setAttr_T2Enc OBJ_setAttr_IssCap_T2,1L
+
+#define SN_setAttr_T2cleartxt "setAttr-T2cleartxt"
+#define LN_setAttr_T2cleartxt "cleartext track 2"
+#define NID_setAttr_T2cleartxt 633
+#define OBJ_setAttr_T2cleartxt OBJ_setAttr_IssCap_T2,2L
+
+#define SN_setAttr_TokICCsig "setAttr-TokICCsig"
+#define LN_setAttr_TokICCsig "ICC or token signature"
+#define NID_setAttr_TokICCsig 634
+#define OBJ_setAttr_TokICCsig OBJ_setAttr_IssCap_Sig,1L
+
+#define SN_setAttr_SecDevSig "setAttr-SecDevSig"
+#define LN_setAttr_SecDevSig "secure device signature"
+#define NID_setAttr_SecDevSig 635
+#define OBJ_setAttr_SecDevSig OBJ_setAttr_IssCap_Sig,2L
+
+#define SN_set_brand_IATA_ATA "set-brand-IATA-ATA"
+#define NID_set_brand_IATA_ATA 636
+#define OBJ_set_brand_IATA_ATA OBJ_set_brand,1L
+
+#define SN_set_brand_Diners "set-brand-Diners"
+#define NID_set_brand_Diners 637
+#define OBJ_set_brand_Diners OBJ_set_brand,30L
+
+#define SN_set_brand_AmericanExpress "set-brand-AmericanExpress"
+#define NID_set_brand_AmericanExpress 638
+#define OBJ_set_brand_AmericanExpress OBJ_set_brand,34L
+
+#define SN_set_brand_JCB "set-brand-JCB"
+#define NID_set_brand_JCB 639
+#define OBJ_set_brand_JCB OBJ_set_brand,35L
+
+#define SN_set_brand_Visa "set-brand-Visa"
+#define NID_set_brand_Visa 640
+#define OBJ_set_brand_Visa OBJ_set_brand,4L
+
+#define SN_set_brand_MasterCard "set-brand-MasterCard"
+#define NID_set_brand_MasterCard 641
+#define OBJ_set_brand_MasterCard OBJ_set_brand,5L
+
+#define SN_set_brand_Novus "set-brand-Novus"
+#define NID_set_brand_Novus 642
+#define OBJ_set_brand_Novus OBJ_set_brand,6011L
+
+#define SN_des_cdmf "DES-CDMF"
+#define LN_des_cdmf "des-cdmf"
+#define NID_des_cdmf 643
+#define OBJ_des_cdmf OBJ_rsadsi,3L,10L
+
+#define SN_rsaOAEPEncryptionSET "rsaOAEPEncryptionSET"
+#define NID_rsaOAEPEncryptionSET 644
+#define OBJ_rsaOAEPEncryptionSET OBJ_rsadsi,1L,1L,6L
+
+#define SN_ipsec3 "Oakley-EC2N-3"
+#define LN_ipsec3 "ipsec3"
+#define NID_ipsec3 749
+
+#define SN_ipsec4 "Oakley-EC2N-4"
+#define LN_ipsec4 "ipsec4"
+#define NID_ipsec4 750
+
+#define SN_whirlpool "whirlpool"
+#define NID_whirlpool 804
+#define OBJ_whirlpool OBJ_iso,0L,10118L,3L,0L,55L
+
+#define SN_cryptopro "cryptopro"
+#define NID_cryptopro 805
+#define OBJ_cryptopro OBJ_member_body,643L,2L,2L
+
+#define SN_cryptocom "cryptocom"
+#define NID_cryptocom 806
+#define OBJ_cryptocom OBJ_member_body,643L,2L,9L
+
+#define SN_id_GostR3411_94_with_GostR3410_2001 "id-GostR3411-94-with-GostR3410-2001"
+#define LN_id_GostR3411_94_with_GostR3410_2001 "GOST R 34.11-94 with GOST R 34.10-2001"
+#define NID_id_GostR3411_94_with_GostR3410_2001 807
+#define OBJ_id_GostR3411_94_with_GostR3410_2001 OBJ_cryptopro,3L
+
+#define SN_id_GostR3411_94_with_GostR3410_94 "id-GostR3411-94-with-GostR3410-94"
+#define LN_id_GostR3411_94_with_GostR3410_94 "GOST R 34.11-94 with GOST R 34.10-94"
+#define NID_id_GostR3411_94_with_GostR3410_94 808
+#define OBJ_id_GostR3411_94_with_GostR3410_94 OBJ_cryptopro,4L
+
+#define SN_id_GostR3411_94 "md_gost94"
+#define LN_id_GostR3411_94 "GOST R 34.11-94"
+#define NID_id_GostR3411_94 809
+#define OBJ_id_GostR3411_94 OBJ_cryptopro,9L
+
+#define SN_id_HMACGostR3411_94 "id-HMACGostR3411-94"
+#define LN_id_HMACGostR3411_94 "HMAC GOST 34.11-94"
+#define NID_id_HMACGostR3411_94 810
+#define OBJ_id_HMACGostR3411_94 OBJ_cryptopro,10L
+
+#define SN_id_GostR3410_2001 "gost2001"
+#define LN_id_GostR3410_2001 "GOST R 34.10-2001"
+#define NID_id_GostR3410_2001 811
+#define OBJ_id_GostR3410_2001 OBJ_cryptopro,19L
+
+#define SN_id_GostR3410_94 "gost94"
+#define LN_id_GostR3410_94 "GOST R 34.10-94"
+#define NID_id_GostR3410_94 812
+#define OBJ_id_GostR3410_94 OBJ_cryptopro,20L
+
+#define SN_id_Gost28147_89 "gost89"
+#define LN_id_Gost28147_89 "GOST 28147-89"
+#define NID_id_Gost28147_89 813
+#define OBJ_id_Gost28147_89 OBJ_cryptopro,21L
+
+#define SN_gost89_cnt "gost89-cnt"
+#define NID_gost89_cnt 814
+
+#define SN_id_Gost28147_89_MAC "gost-mac"
+#define LN_id_Gost28147_89_MAC "GOST 28147-89 MAC"
+#define NID_id_Gost28147_89_MAC 815
+#define OBJ_id_Gost28147_89_MAC OBJ_cryptopro,22L
+
+#define SN_id_GostR3411_94_prf "prf-gostr3411-94"
+#define LN_id_GostR3411_94_prf "GOST R 34.11-94 PRF"
+#define NID_id_GostR3411_94_prf 816
+#define OBJ_id_GostR3411_94_prf OBJ_cryptopro,23L
+
+#define SN_id_GostR3410_2001DH "id-GostR3410-2001DH"
+#define LN_id_GostR3410_2001DH "GOST R 34.10-2001 DH"
+#define NID_id_GostR3410_2001DH 817
+#define OBJ_id_GostR3410_2001DH OBJ_cryptopro,98L
+
+#define SN_id_GostR3410_94DH "id-GostR3410-94DH"
+#define LN_id_GostR3410_94DH "GOST R 34.10-94 DH"
+#define NID_id_GostR3410_94DH 818
+#define OBJ_id_GostR3410_94DH OBJ_cryptopro,99L
+
+#define SN_id_Gost28147_89_CryptoPro_KeyMeshing "id-Gost28147-89-CryptoPro-KeyMeshing"
+#define NID_id_Gost28147_89_CryptoPro_KeyMeshing 819
+#define OBJ_id_Gost28147_89_CryptoPro_KeyMeshing OBJ_cryptopro,14L,1L
+
+#define SN_id_Gost28147_89_None_KeyMeshing "id-Gost28147-89-None-KeyMeshing"
+#define NID_id_Gost28147_89_None_KeyMeshing 820
+#define OBJ_id_Gost28147_89_None_KeyMeshing OBJ_cryptopro,14L,0L
+
+#define SN_id_GostR3411_94_TestParamSet "id-GostR3411-94-TestParamSet"
+#define NID_id_GostR3411_94_TestParamSet 821
+#define OBJ_id_GostR3411_94_TestParamSet OBJ_cryptopro,30L,0L
+
+#define SN_id_GostR3411_94_CryptoProParamSet "id-GostR3411-94-CryptoProParamSet"
+#define NID_id_GostR3411_94_CryptoProParamSet 822
+#define OBJ_id_GostR3411_94_CryptoProParamSet OBJ_cryptopro,30L,1L
+
+#define SN_id_Gost28147_89_TestParamSet "id-Gost28147-89-TestParamSet"
+#define NID_id_Gost28147_89_TestParamSet 823
+#define OBJ_id_Gost28147_89_TestParamSet OBJ_cryptopro,31L,0L
+
+#define SN_id_Gost28147_89_CryptoPro_A_ParamSet "id-Gost28147-89-CryptoPro-A-ParamSet"
+#define NID_id_Gost28147_89_CryptoPro_A_ParamSet 824
+#define OBJ_id_Gost28147_89_CryptoPro_A_ParamSet OBJ_cryptopro,31L,1L
+
+#define SN_id_Gost28147_89_CryptoPro_B_ParamSet "id-Gost28147-89-CryptoPro-B-ParamSet"
+#define NID_id_Gost28147_89_CryptoPro_B_ParamSet 825
+#define OBJ_id_Gost28147_89_CryptoPro_B_ParamSet OBJ_cryptopro,31L,2L
+
+#define SN_id_Gost28147_89_CryptoPro_C_ParamSet "id-Gost28147-89-CryptoPro-C-ParamSet"
+#define NID_id_Gost28147_89_CryptoPro_C_ParamSet 826
+#define OBJ_id_Gost28147_89_CryptoPro_C_ParamSet OBJ_cryptopro,31L,3L
+
+#define SN_id_Gost28147_89_CryptoPro_D_ParamSet "id-Gost28147-89-CryptoPro-D-ParamSet"
+#define NID_id_Gost28147_89_CryptoPro_D_ParamSet 827
+#define OBJ_id_Gost28147_89_CryptoPro_D_ParamSet OBJ_cryptopro,31L,4L
+
+#define SN_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet "id-Gost28147-89-CryptoPro-Oscar-1-1-ParamSet"
+#define NID_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet 828
+#define OBJ_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet OBJ_cryptopro,31L,5L
+
+#define SN_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet "id-Gost28147-89-CryptoPro-Oscar-1-0-ParamSet"
+#define NID_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet 829
+#define OBJ_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet OBJ_cryptopro,31L,6L
+
+#define SN_id_Gost28147_89_CryptoPro_RIC_1_ParamSet "id-Gost28147-89-CryptoPro-RIC-1-ParamSet"
+#define NID_id_Gost28147_89_CryptoPro_RIC_1_ParamSet 830
+#define OBJ_id_Gost28147_89_CryptoPro_RIC_1_ParamSet OBJ_cryptopro,31L,7L
+
+#define SN_id_GostR3410_94_TestParamSet "id-GostR3410-94-TestParamSet"
+#define NID_id_GostR3410_94_TestParamSet 831
+#define OBJ_id_GostR3410_94_TestParamSet OBJ_cryptopro,32L,0L
+
+#define SN_id_GostR3410_94_CryptoPro_A_ParamSet "id-GostR3410-94-CryptoPro-A-ParamSet"
+#define NID_id_GostR3410_94_CryptoPro_A_ParamSet 832
+#define OBJ_id_GostR3410_94_CryptoPro_A_ParamSet OBJ_cryptopro,32L,2L
+
+#define SN_id_GostR3410_94_CryptoPro_B_ParamSet "id-GostR3410-94-CryptoPro-B-ParamSet"
+#define NID_id_GostR3410_94_CryptoPro_B_ParamSet 833
+#define OBJ_id_GostR3410_94_CryptoPro_B_ParamSet OBJ_cryptopro,32L,3L
+
+#define SN_id_GostR3410_94_CryptoPro_C_ParamSet "id-GostR3410-94-CryptoPro-C-ParamSet"
+#define NID_id_GostR3410_94_CryptoPro_C_ParamSet 834
+#define OBJ_id_GostR3410_94_CryptoPro_C_ParamSet OBJ_cryptopro,32L,4L
+
+#define SN_id_GostR3410_94_CryptoPro_D_ParamSet "id-GostR3410-94-CryptoPro-D-ParamSet"
+#define NID_id_GostR3410_94_CryptoPro_D_ParamSet 835
+#define OBJ_id_GostR3410_94_CryptoPro_D_ParamSet OBJ_cryptopro,32L,5L
+
+#define SN_id_GostR3410_94_CryptoPro_XchA_ParamSet "id-GostR3410-94-CryptoPro-XchA-ParamSet"
+#define NID_id_GostR3410_94_CryptoPro_XchA_ParamSet 836
+#define OBJ_id_GostR3410_94_CryptoPro_XchA_ParamSet OBJ_cryptopro,33L,1L
+
+#define SN_id_GostR3410_94_CryptoPro_XchB_ParamSet "id-GostR3410-94-CryptoPro-XchB-ParamSet"
+#define NID_id_GostR3410_94_CryptoPro_XchB_ParamSet 837
+#define OBJ_id_GostR3410_94_CryptoPro_XchB_ParamSet OBJ_cryptopro,33L,2L
+
+#define SN_id_GostR3410_94_CryptoPro_XchC_ParamSet "id-GostR3410-94-CryptoPro-XchC-ParamSet"
+#define NID_id_GostR3410_94_CryptoPro_XchC_ParamSet 838
+#define OBJ_id_GostR3410_94_CryptoPro_XchC_ParamSet OBJ_cryptopro,33L,3L
+
+#define SN_id_GostR3410_2001_TestParamSet "id-GostR3410-2001-TestParamSet"
+#define NID_id_GostR3410_2001_TestParamSet 839
+#define OBJ_id_GostR3410_2001_TestParamSet OBJ_cryptopro,35L,0L
+
+#define SN_id_GostR3410_2001_CryptoPro_A_ParamSet "id-GostR3410-2001-CryptoPro-A-ParamSet"
+#define NID_id_GostR3410_2001_CryptoPro_A_ParamSet 840
+#define OBJ_id_GostR3410_2001_CryptoPro_A_ParamSet OBJ_cryptopro,35L,1L
+
+#define SN_id_GostR3410_2001_CryptoPro_B_ParamSet "id-GostR3410-2001-CryptoPro-B-ParamSet"
+#define NID_id_GostR3410_2001_CryptoPro_B_ParamSet 841
+#define OBJ_id_GostR3410_2001_CryptoPro_B_ParamSet OBJ_cryptopro,35L,2L
+
+#define SN_id_GostR3410_2001_CryptoPro_C_ParamSet "id-GostR3410-2001-CryptoPro-C-ParamSet"
+#define NID_id_GostR3410_2001_CryptoPro_C_ParamSet 842
+#define OBJ_id_GostR3410_2001_CryptoPro_C_ParamSet OBJ_cryptopro,35L,3L
+
+#define SN_id_GostR3410_2001_CryptoPro_XchA_ParamSet "id-GostR3410-2001-CryptoPro-XchA-ParamSet"
+#define NID_id_GostR3410_2001_CryptoPro_XchA_ParamSet 843
+#define OBJ_id_GostR3410_2001_CryptoPro_XchA_ParamSet OBJ_cryptopro,36L,0L
+
+#define SN_id_GostR3410_2001_CryptoPro_XchB_ParamSet "id-GostR3410-2001-CryptoPro-XchB-ParamSet"
+#define NID_id_GostR3410_2001_CryptoPro_XchB_ParamSet 844
+#define OBJ_id_GostR3410_2001_CryptoPro_XchB_ParamSet OBJ_cryptopro,36L,1L
+
+#define SN_id_GostR3410_94_a "id-GostR3410-94-a"
+#define NID_id_GostR3410_94_a 845
+#define OBJ_id_GostR3410_94_a OBJ_id_GostR3410_94,1L
+
+#define SN_id_GostR3410_94_aBis "id-GostR3410-94-aBis"
+#define NID_id_GostR3410_94_aBis 846
+#define OBJ_id_GostR3410_94_aBis OBJ_id_GostR3410_94,2L
+
+#define SN_id_GostR3410_94_b "id-GostR3410-94-b"
+#define NID_id_GostR3410_94_b 847
+#define OBJ_id_GostR3410_94_b OBJ_id_GostR3410_94,3L
+
+#define SN_id_GostR3410_94_bBis "id-GostR3410-94-bBis"
+#define NID_id_GostR3410_94_bBis 848
+#define OBJ_id_GostR3410_94_bBis OBJ_id_GostR3410_94,4L
+
+#define SN_id_Gost28147_89_cc "id-Gost28147-89-cc"
+#define LN_id_Gost28147_89_cc "GOST 28147-89 Cryptocom ParamSet"
+#define NID_id_Gost28147_89_cc 849
+#define OBJ_id_Gost28147_89_cc OBJ_cryptocom,1L,6L,1L
+
+#define SN_id_GostR3410_94_cc "gost94cc"
+#define LN_id_GostR3410_94_cc "GOST 34.10-94 Cryptocom"
+#define NID_id_GostR3410_94_cc 850
+#define OBJ_id_GostR3410_94_cc OBJ_cryptocom,1L,5L,3L
+
+#define SN_id_GostR3410_2001_cc "gost2001cc"
+#define LN_id_GostR3410_2001_cc "GOST 34.10-2001 Cryptocom"
+#define NID_id_GostR3410_2001_cc 851
+#define OBJ_id_GostR3410_2001_cc OBJ_cryptocom,1L,5L,4L
+
+#define SN_id_GostR3411_94_with_GostR3410_94_cc "id-GostR3411-94-with-GostR3410-94-cc"
+#define LN_id_GostR3411_94_with_GostR3410_94_cc "GOST R 34.11-94 with GOST R 34.10-94 Cryptocom"
+#define NID_id_GostR3411_94_with_GostR3410_94_cc 852
+#define OBJ_id_GostR3411_94_with_GostR3410_94_cc OBJ_cryptocom,1L,3L,3L
+
+#define SN_id_GostR3411_94_with_GostR3410_2001_cc "id-GostR3411-94-with-GostR3410-2001-cc"
+#define LN_id_GostR3411_94_with_GostR3410_2001_cc "GOST R 34.11-94 with GOST R 34.10-2001 Cryptocom"
+#define NID_id_GostR3411_94_with_GostR3410_2001_cc 853
+#define OBJ_id_GostR3411_94_with_GostR3410_2001_cc OBJ_cryptocom,1L,3L,4L
+
+#define SN_id_GostR3410_2001_ParamSet_cc "id-GostR3410-2001-ParamSet-cc"
+#define LN_id_GostR3410_2001_ParamSet_cc "GOST R 3410-2001 Parameter Set Cryptocom"
+#define NID_id_GostR3410_2001_ParamSet_cc 854
+#define OBJ_id_GostR3410_2001_ParamSet_cc OBJ_cryptocom,1L,8L,1L
+
+#define SN_camellia_128_cbc "CAMELLIA-128-CBC"
+#define LN_camellia_128_cbc "camellia-128-cbc"
+#define NID_camellia_128_cbc 751
+#define OBJ_camellia_128_cbc 1L,2L,392L,200011L,61L,1L,1L,1L,2L
+
+#define SN_camellia_192_cbc "CAMELLIA-192-CBC"
+#define LN_camellia_192_cbc "camellia-192-cbc"
+#define NID_camellia_192_cbc 752
+#define OBJ_camellia_192_cbc 1L,2L,392L,200011L,61L,1L,1L,1L,3L
+
+#define SN_camellia_256_cbc "CAMELLIA-256-CBC"
+#define LN_camellia_256_cbc "camellia-256-cbc"
+#define NID_camellia_256_cbc 753
+#define OBJ_camellia_256_cbc 1L,2L,392L,200011L,61L,1L,1L,1L,4L
+
+#define SN_id_camellia128_wrap "id-camellia128-wrap"
+#define NID_id_camellia128_wrap 907
+#define OBJ_id_camellia128_wrap 1L,2L,392L,200011L,61L,1L,1L,3L,2L
+
+#define SN_id_camellia192_wrap "id-camellia192-wrap"
+#define NID_id_camellia192_wrap 908
+#define OBJ_id_camellia192_wrap 1L,2L,392L,200011L,61L,1L,1L,3L,3L
+
+#define SN_id_camellia256_wrap "id-camellia256-wrap"
+#define NID_id_camellia256_wrap 909
+#define OBJ_id_camellia256_wrap 1L,2L,392L,200011L,61L,1L,1L,3L,4L
+
+#define OBJ_ntt_ds 0L,3L,4401L,5L
+
+#define OBJ_camellia OBJ_ntt_ds,3L,1L,9L
+
+#define SN_camellia_128_ecb "CAMELLIA-128-ECB"
+#define LN_camellia_128_ecb "camellia-128-ecb"
+#define NID_camellia_128_ecb 754
+#define OBJ_camellia_128_ecb OBJ_camellia,1L
+
+#define SN_camellia_128_ofb128 "CAMELLIA-128-OFB"
+#define LN_camellia_128_ofb128 "camellia-128-ofb"
+#define NID_camellia_128_ofb128 766
+#define OBJ_camellia_128_ofb128 OBJ_camellia,3L
+
+#define SN_camellia_128_cfb128 "CAMELLIA-128-CFB"
+#define LN_camellia_128_cfb128 "camellia-128-cfb"
+#define NID_camellia_128_cfb128 757
+#define OBJ_camellia_128_cfb128 OBJ_camellia,4L
+
+#define SN_camellia_192_ecb "CAMELLIA-192-ECB"
+#define LN_camellia_192_ecb "camellia-192-ecb"
+#define NID_camellia_192_ecb 755
+#define OBJ_camellia_192_ecb OBJ_camellia,21L
+
+#define SN_camellia_192_ofb128 "CAMELLIA-192-OFB"
+#define LN_camellia_192_ofb128 "camellia-192-ofb"
+#define NID_camellia_192_ofb128 767
+#define OBJ_camellia_192_ofb128 OBJ_camellia,23L
+
+#define SN_camellia_192_cfb128 "CAMELLIA-192-CFB"
+#define LN_camellia_192_cfb128 "camellia-192-cfb"
+#define NID_camellia_192_cfb128 758
+#define OBJ_camellia_192_cfb128 OBJ_camellia,24L
+
+#define SN_camellia_256_ecb "CAMELLIA-256-ECB"
+#define LN_camellia_256_ecb "camellia-256-ecb"
+#define NID_camellia_256_ecb 756
+#define OBJ_camellia_256_ecb OBJ_camellia,41L
+
+#define SN_camellia_256_ofb128 "CAMELLIA-256-OFB"
+#define LN_camellia_256_ofb128 "camellia-256-ofb"
+#define NID_camellia_256_ofb128 768
+#define OBJ_camellia_256_ofb128 OBJ_camellia,43L
+
+#define SN_camellia_256_cfb128 "CAMELLIA-256-CFB"
+#define LN_camellia_256_cfb128 "camellia-256-cfb"
+#define NID_camellia_256_cfb128 759
+#define OBJ_camellia_256_cfb128 OBJ_camellia,44L
+
+#define SN_camellia_128_cfb1 "CAMELLIA-128-CFB1"
+#define LN_camellia_128_cfb1 "camellia-128-cfb1"
+#define NID_camellia_128_cfb1 760
+
+#define SN_camellia_192_cfb1 "CAMELLIA-192-CFB1"
+#define LN_camellia_192_cfb1 "camellia-192-cfb1"
+#define NID_camellia_192_cfb1 761
+
+#define SN_camellia_256_cfb1 "CAMELLIA-256-CFB1"
+#define LN_camellia_256_cfb1 "camellia-256-cfb1"
+#define NID_camellia_256_cfb1 762
+
+#define SN_camellia_128_cfb8 "CAMELLIA-128-CFB8"
+#define LN_camellia_128_cfb8 "camellia-128-cfb8"
+#define NID_camellia_128_cfb8 763
+
+#define SN_camellia_192_cfb8 "CAMELLIA-192-CFB8"
+#define LN_camellia_192_cfb8 "camellia-192-cfb8"
+#define NID_camellia_192_cfb8 764
+
+#define SN_camellia_256_cfb8 "CAMELLIA-256-CFB8"
+#define LN_camellia_256_cfb8 "camellia-256-cfb8"
+#define NID_camellia_256_cfb8 765
+
+#define SN_kisa "KISA"
+#define LN_kisa "kisa"
+#define NID_kisa 773
+#define OBJ_kisa OBJ_member_body,410L,200004L
+
+#define SN_seed_ecb "SEED-ECB"
+#define LN_seed_ecb "seed-ecb"
+#define NID_seed_ecb 776
+#define OBJ_seed_ecb OBJ_kisa,1L,3L
+
+#define SN_seed_cbc "SEED-CBC"
+#define LN_seed_cbc "seed-cbc"
+#define NID_seed_cbc 777
+#define OBJ_seed_cbc OBJ_kisa,1L,4L
+
+#define SN_seed_cfb128 "SEED-CFB"
+#define LN_seed_cfb128 "seed-cfb"
+#define NID_seed_cfb128 779
+#define OBJ_seed_cfb128 OBJ_kisa,1L,5L
+
+#define SN_seed_ofb128 "SEED-OFB"
+#define LN_seed_ofb128 "seed-ofb"
+#define NID_seed_ofb128 778
+#define OBJ_seed_ofb128 OBJ_kisa,1L,6L
+
+#define SN_hmac "HMAC"
+#define LN_hmac "hmac"
+#define NID_hmac 855
+
+#define SN_cmac "CMAC"
+#define LN_cmac "cmac"
+#define NID_cmac 894
+
+#define SN_rc4_hmac_md5 "RC4-HMAC-MD5"
+#define LN_rc4_hmac_md5 "rc4-hmac-md5"
+#define NID_rc4_hmac_md5 915
+
+#define SN_aes_128_cbc_hmac_sha1 "AES-128-CBC-HMAC-SHA1"
+#define LN_aes_128_cbc_hmac_sha1 "aes-128-cbc-hmac-sha1"
+#define NID_aes_128_cbc_hmac_sha1 916
+
+#define SN_aes_192_cbc_hmac_sha1 "AES-192-CBC-HMAC-SHA1"
+#define LN_aes_192_cbc_hmac_sha1 "aes-192-cbc-hmac-sha1"
+#define NID_aes_192_cbc_hmac_sha1 917
+
+#define SN_aes_256_cbc_hmac_sha1 "AES-256-CBC-HMAC-SHA1"
+#define LN_aes_256_cbc_hmac_sha1 "aes-256-cbc-hmac-sha1"
+#define NID_aes_256_cbc_hmac_sha1 918
+
+#define SN_aes_128_cbc_hmac_sha256 "AES-128-CBC-HMAC-SHA256"
+#define LN_aes_128_cbc_hmac_sha256 "aes-128-cbc-hmac-sha256"
+#define NID_aes_128_cbc_hmac_sha256 948
+
+#define SN_aes_192_cbc_hmac_sha256 "AES-192-CBC-HMAC-SHA256"
+#define LN_aes_192_cbc_hmac_sha256 "aes-192-cbc-hmac-sha256"
+#define NID_aes_192_cbc_hmac_sha256 949
+
+#define SN_aes_256_cbc_hmac_sha256 "AES-256-CBC-HMAC-SHA256"
+#define LN_aes_256_cbc_hmac_sha256 "aes-256-cbc-hmac-sha256"
+#define NID_aes_256_cbc_hmac_sha256 950
+
+#define SN_dhpublicnumber "dhpublicnumber"
+#define LN_dhpublicnumber "X9.42 DH"
+#define NID_dhpublicnumber 920
+#define OBJ_dhpublicnumber OBJ_ISO_US,10046L,2L,1L
+
+#define SN_brainpoolP160r1 "brainpoolP160r1"
+#define NID_brainpoolP160r1 921
+#define OBJ_brainpoolP160r1 1L,3L,36L,3L,3L,2L,8L,1L,1L,1L
+
+#define SN_brainpoolP160t1 "brainpoolP160t1"
+#define NID_brainpoolP160t1 922
+#define OBJ_brainpoolP160t1 1L,3L,36L,3L,3L,2L,8L,1L,1L,2L
+
+#define SN_brainpoolP192r1 "brainpoolP192r1"
+#define NID_brainpoolP192r1 923
+#define OBJ_brainpoolP192r1 1L,3L,36L,3L,3L,2L,8L,1L,1L,3L
+
+#define SN_brainpoolP192t1 "brainpoolP192t1"
+#define NID_brainpoolP192t1 924
+#define OBJ_brainpoolP192t1 1L,3L,36L,3L,3L,2L,8L,1L,1L,4L
+
+#define SN_brainpoolP224r1 "brainpoolP224r1"
+#define NID_brainpoolP224r1 925
+#define OBJ_brainpoolP224r1 1L,3L,36L,3L,3L,2L,8L,1L,1L,5L
+
+#define SN_brainpoolP224t1 "brainpoolP224t1"
+#define NID_brainpoolP224t1 926
+#define OBJ_brainpoolP224t1 1L,3L,36L,3L,3L,2L,8L,1L,1L,6L
+
+#define SN_brainpoolP256r1 "brainpoolP256r1"
+#define NID_brainpoolP256r1 927
+#define OBJ_brainpoolP256r1 1L,3L,36L,3L,3L,2L,8L,1L,1L,7L
+
+#define SN_brainpoolP256t1 "brainpoolP256t1"
+#define NID_brainpoolP256t1 928
+#define OBJ_brainpoolP256t1 1L,3L,36L,3L,3L,2L,8L,1L,1L,8L
+
+#define SN_brainpoolP320r1 "brainpoolP320r1"
+#define NID_brainpoolP320r1 929
+#define OBJ_brainpoolP320r1 1L,3L,36L,3L,3L,2L,8L,1L,1L,9L
+
+#define SN_brainpoolP320t1 "brainpoolP320t1"
+#define NID_brainpoolP320t1 930
+#define OBJ_brainpoolP320t1 1L,3L,36L,3L,3L,2L,8L,1L,1L,10L
+
+#define SN_brainpoolP384r1 "brainpoolP384r1"
+#define NID_brainpoolP384r1 931
+#define OBJ_brainpoolP384r1 1L,3L,36L,3L,3L,2L,8L,1L,1L,11L
+
+#define SN_brainpoolP384t1 "brainpoolP384t1"
+#define NID_brainpoolP384t1 932
+#define OBJ_brainpoolP384t1 1L,3L,36L,3L,3L,2L,8L,1L,1L,12L
+
+#define SN_brainpoolP512r1 "brainpoolP512r1"
+#define NID_brainpoolP512r1 933
+#define OBJ_brainpoolP512r1 1L,3L,36L,3L,3L,2L,8L,1L,1L,13L
+
+#define SN_brainpoolP512t1 "brainpoolP512t1"
+#define NID_brainpoolP512t1 934
+#define OBJ_brainpoolP512t1 1L,3L,36L,3L,3L,2L,8L,1L,1L,14L
+
+#define OBJ_x9_63_scheme 1L,3L,133L,16L,840L,63L,0L
+
+#define OBJ_secg_scheme OBJ_certicom_arc,1L
+
+#define SN_dhSinglePass_stdDH_sha1kdf_scheme "dhSinglePass-stdDH-sha1kdf-scheme"
+#define NID_dhSinglePass_stdDH_sha1kdf_scheme 936
+#define OBJ_dhSinglePass_stdDH_sha1kdf_scheme OBJ_x9_63_scheme,2L
+
+#define SN_dhSinglePass_stdDH_sha224kdf_scheme "dhSinglePass-stdDH-sha224kdf-scheme"
+#define NID_dhSinglePass_stdDH_sha224kdf_scheme 937
+#define OBJ_dhSinglePass_stdDH_sha224kdf_scheme OBJ_secg_scheme,11L,0L
+
+#define SN_dhSinglePass_stdDH_sha256kdf_scheme "dhSinglePass-stdDH-sha256kdf-scheme"
+#define NID_dhSinglePass_stdDH_sha256kdf_scheme 938
+#define OBJ_dhSinglePass_stdDH_sha256kdf_scheme OBJ_secg_scheme,11L,1L
+
+#define SN_dhSinglePass_stdDH_sha384kdf_scheme "dhSinglePass-stdDH-sha384kdf-scheme"
+#define NID_dhSinglePass_stdDH_sha384kdf_scheme 939
+#define OBJ_dhSinglePass_stdDH_sha384kdf_scheme OBJ_secg_scheme,11L,2L
+
+#define SN_dhSinglePass_stdDH_sha512kdf_scheme "dhSinglePass-stdDH-sha512kdf-scheme"
+#define NID_dhSinglePass_stdDH_sha512kdf_scheme 940
+#define OBJ_dhSinglePass_stdDH_sha512kdf_scheme OBJ_secg_scheme,11L,3L
+
+#define SN_dhSinglePass_cofactorDH_sha1kdf_scheme "dhSinglePass-cofactorDH-sha1kdf-scheme"
+#define NID_dhSinglePass_cofactorDH_sha1kdf_scheme 941
+#define OBJ_dhSinglePass_cofactorDH_sha1kdf_scheme OBJ_x9_63_scheme,3L
+
+#define SN_dhSinglePass_cofactorDH_sha224kdf_scheme "dhSinglePass-cofactorDH-sha224kdf-scheme"
+#define NID_dhSinglePass_cofactorDH_sha224kdf_scheme 942
+#define OBJ_dhSinglePass_cofactorDH_sha224kdf_scheme OBJ_secg_scheme,14L,0L
+
+#define SN_dhSinglePass_cofactorDH_sha256kdf_scheme "dhSinglePass-cofactorDH-sha256kdf-scheme"
+#define NID_dhSinglePass_cofactorDH_sha256kdf_scheme 943
+#define OBJ_dhSinglePass_cofactorDH_sha256kdf_scheme OBJ_secg_scheme,14L,1L
+
+#define SN_dhSinglePass_cofactorDH_sha384kdf_scheme "dhSinglePass-cofactorDH-sha384kdf-scheme"
+#define NID_dhSinglePass_cofactorDH_sha384kdf_scheme 944
+#define OBJ_dhSinglePass_cofactorDH_sha384kdf_scheme OBJ_secg_scheme,14L,2L
+
+#define SN_dhSinglePass_cofactorDH_sha512kdf_scheme "dhSinglePass-cofactorDH-sha512kdf-scheme"
+#define NID_dhSinglePass_cofactorDH_sha512kdf_scheme 945
+#define OBJ_dhSinglePass_cofactorDH_sha512kdf_scheme OBJ_secg_scheme,14L,3L
+
+#define SN_dh_std_kdf "dh-std-kdf"
+#define NID_dh_std_kdf 946
+
+#define SN_dh_cofactor_kdf "dh-cofactor-kdf"
+#define NID_dh_cofactor_kdf 947
+
+#define SN_ct_precert_scts "ct_precert_scts"
+#define LN_ct_precert_scts "CT Precertificate SCTs"
+#define NID_ct_precert_scts 951
+#define OBJ_ct_precert_scts 1L,3L,6L,1L,4L,1L,11129L,2L,4L,2L
+
+#define SN_ct_precert_poison "ct_precert_poison"
+#define LN_ct_precert_poison "CT Precertificate Poison"
+#define NID_ct_precert_poison 952
+#define OBJ_ct_precert_poison 1L,3L,6L,1L,4L,1L,11129L,2L,4L,3L
+
+#define SN_ct_precert_signer "ct_precert_signer"
+#define LN_ct_precert_signer "CT Precertificate Signer"
+#define NID_ct_precert_signer 953
+#define OBJ_ct_precert_signer 1L,3L,6L,1L,4L,1L,11129L,2L,4L,4L
+
+#define SN_ct_cert_scts "ct_cert_scts"
+#define LN_ct_cert_scts "CT Certificate SCTs"
+#define NID_ct_cert_scts 954
+#define OBJ_ct_cert_scts 1L,3L,6L,1L,4L,1L,11129L,2L,4L,5L
+
+#define SN_jurisdictionLocalityName "jurisdictionL"
+#define LN_jurisdictionLocalityName "jurisdictionLocalityName"
+#define NID_jurisdictionLocalityName 955
+#define OBJ_jurisdictionLocalityName 1L,3L,6L,1L,4L,1L,311L,60L,2L,1L,1L
+
+#define SN_jurisdictionStateOrProvinceName "jurisdictionST"
+#define LN_jurisdictionStateOrProvinceName "jurisdictionStateOrProvinceName"
+#define NID_jurisdictionStateOrProvinceName 956
+#define OBJ_jurisdictionStateOrProvinceName 1L,3L,6L,1L,4L,1L,311L,60L,2L,1L,2L
+
+#define SN_jurisdictionCountryName "jurisdictionC"
+#define LN_jurisdictionCountryName "jurisdictionCountryName"
+#define NID_jurisdictionCountryName 957
+#define OBJ_jurisdictionCountryName 1L,3L,6L,1L,4L,1L,311L,60L,2L,1L,3L
diff --git a/deps/openssl/openssl/include/openssl/objects.h b/deps/openssl/openssl/include/openssl/objects.h
index 5365a044bdc..b8dafa89ce3 100644
--- a/deps/openssl/openssl/include/openssl/objects.h
+++ b/deps/openssl/openssl/include/openssl/objects.h
@@ -1 +1,1143 @@
-#include "../../crypto/objects/objects.h"
+/* crypto/objects/objects.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_OBJECTS_H
+# define HEADER_OBJECTS_H
+
+# define USE_OBJ_MAC
+
+# ifdef USE_OBJ_MAC
+# include <openssl/obj_mac.h>
+# else
+# define SN_undef "UNDEF"
+# define LN_undef "undefined"
+# define NID_undef 0
+# define OBJ_undef 0L
+
+# define SN_Algorithm "Algorithm"
+# define LN_algorithm "algorithm"
+# define NID_algorithm 38
+# define OBJ_algorithm 1L,3L,14L,3L,2L
+
+# define LN_rsadsi "rsadsi"
+# define NID_rsadsi 1
+# define OBJ_rsadsi 1L,2L,840L,113549L
+
+# define LN_pkcs "pkcs"
+# define NID_pkcs 2
+# define OBJ_pkcs OBJ_rsadsi,1L
+
+# define SN_md2 "MD2"
+# define LN_md2 "md2"
+# define NID_md2 3
+# define OBJ_md2 OBJ_rsadsi,2L,2L
+
+# define SN_md5 "MD5"
+# define LN_md5 "md5"
+# define NID_md5 4
+# define OBJ_md5 OBJ_rsadsi,2L,5L
+
+# define SN_rc4 "RC4"
+# define LN_rc4 "rc4"
+# define NID_rc4 5
+# define OBJ_rc4 OBJ_rsadsi,3L,4L
+
+# define LN_rsaEncryption "rsaEncryption"
+# define NID_rsaEncryption 6
+# define OBJ_rsaEncryption OBJ_pkcs,1L,1L
+
+# define SN_md2WithRSAEncryption "RSA-MD2"
+# define LN_md2WithRSAEncryption "md2WithRSAEncryption"
+# define NID_md2WithRSAEncryption 7
+# define OBJ_md2WithRSAEncryption OBJ_pkcs,1L,2L
+
+# define SN_md5WithRSAEncryption "RSA-MD5"
+# define LN_md5WithRSAEncryption "md5WithRSAEncryption"
+# define NID_md5WithRSAEncryption 8
+# define OBJ_md5WithRSAEncryption OBJ_pkcs,1L,4L
+
+# define SN_pbeWithMD2AndDES_CBC "PBE-MD2-DES"
+# define LN_pbeWithMD2AndDES_CBC "pbeWithMD2AndDES-CBC"
+# define NID_pbeWithMD2AndDES_CBC 9
+# define OBJ_pbeWithMD2AndDES_CBC OBJ_pkcs,5L,1L
+
+# define SN_pbeWithMD5AndDES_CBC "PBE-MD5-DES"
+# define LN_pbeWithMD5AndDES_CBC "pbeWithMD5AndDES-CBC"
+# define NID_pbeWithMD5AndDES_CBC 10
+# define OBJ_pbeWithMD5AndDES_CBC OBJ_pkcs,5L,3L
+
+# define LN_X500 "X500"
+# define NID_X500 11
+# define OBJ_X500 2L,5L
+
+# define LN_X509 "X509"
+# define NID_X509 12
+# define OBJ_X509 OBJ_X500,4L
+
+# define SN_commonName "CN"
+# define LN_commonName "commonName"
+# define NID_commonName 13
+# define OBJ_commonName OBJ_X509,3L
+
+# define SN_countryName "C"
+# define LN_countryName "countryName"
+# define NID_countryName 14
+# define OBJ_countryName OBJ_X509,6L
+
+# define SN_localityName "L"
+# define LN_localityName "localityName"
+# define NID_localityName 15
+# define OBJ_localityName OBJ_X509,7L
+
+/* Postal Address? PA */
+
+/* should be "ST" (rfc1327) but MS uses 'S' */
+# define SN_stateOrProvinceName "ST"
+# define LN_stateOrProvinceName "stateOrProvinceName"
+# define NID_stateOrProvinceName 16
+# define OBJ_stateOrProvinceName OBJ_X509,8L
+
+# define SN_organizationName "O"
+# define LN_organizationName "organizationName"
+# define NID_organizationName 17
+# define OBJ_organizationName OBJ_X509,10L
+
+# define SN_organizationalUnitName "OU"
+# define LN_organizationalUnitName "organizationalUnitName"
+# define NID_organizationalUnitName 18
+# define OBJ_organizationalUnitName OBJ_X509,11L
+
+# define SN_rsa "RSA"
+# define LN_rsa "rsa"
+# define NID_rsa 19
+# define OBJ_rsa OBJ_X500,8L,1L,1L
+
+# define LN_pkcs7 "pkcs7"
+# define NID_pkcs7 20
+# define OBJ_pkcs7 OBJ_pkcs,7L
+
+# define LN_pkcs7_data "pkcs7-data"
+# define NID_pkcs7_data 21
+# define OBJ_pkcs7_data OBJ_pkcs7,1L
+
+# define LN_pkcs7_signed "pkcs7-signedData"
+# define NID_pkcs7_signed 22
+# define OBJ_pkcs7_signed OBJ_pkcs7,2L
+
+# define LN_pkcs7_enveloped "pkcs7-envelopedData"
+# define NID_pkcs7_enveloped 23
+# define OBJ_pkcs7_enveloped OBJ_pkcs7,3L
+
+# define LN_pkcs7_signedAndEnveloped "pkcs7-signedAndEnvelopedData"
+# define NID_pkcs7_signedAndEnveloped 24
+# define OBJ_pkcs7_signedAndEnveloped OBJ_pkcs7,4L
+
+# define LN_pkcs7_digest "pkcs7-digestData"
+# define NID_pkcs7_digest 25
+# define OBJ_pkcs7_digest OBJ_pkcs7,5L
+
+# define LN_pkcs7_encrypted "pkcs7-encryptedData"
+# define NID_pkcs7_encrypted 26
+# define OBJ_pkcs7_encrypted OBJ_pkcs7,6L
+
+# define LN_pkcs3 "pkcs3"
+# define NID_pkcs3 27
+# define OBJ_pkcs3 OBJ_pkcs,3L
+
+# define LN_dhKeyAgreement "dhKeyAgreement"
+# define NID_dhKeyAgreement 28
+# define OBJ_dhKeyAgreement OBJ_pkcs3,1L
+
+# define SN_des_ecb "DES-ECB"
+# define LN_des_ecb "des-ecb"
+# define NID_des_ecb 29
+# define OBJ_des_ecb OBJ_algorithm,6L
+
+# define SN_des_cfb64 "DES-CFB"
+# define LN_des_cfb64 "des-cfb"
+# define NID_des_cfb64 30
+/* IV + num */
+# define OBJ_des_cfb64 OBJ_algorithm,9L
+
+# define SN_des_cbc "DES-CBC"
+# define LN_des_cbc "des-cbc"
+# define NID_des_cbc 31
+/* IV */
+# define OBJ_des_cbc OBJ_algorithm,7L
+
+# define SN_des_ede "DES-EDE"
+# define LN_des_ede "des-ede"
+# define NID_des_ede 32
+/* ?? */
+# define OBJ_des_ede OBJ_algorithm,17L
+
+# define SN_des_ede3 "DES-EDE3"
+# define LN_des_ede3 "des-ede3"
+# define NID_des_ede3 33
+
+# define SN_idea_cbc "IDEA-CBC"
+# define LN_idea_cbc "idea-cbc"
+# define NID_idea_cbc 34
+# define OBJ_idea_cbc 1L,3L,6L,1L,4L,1L,188L,7L,1L,1L,2L
+
+# define SN_idea_cfb64 "IDEA-CFB"
+# define LN_idea_cfb64 "idea-cfb"
+# define NID_idea_cfb64 35
+
+# define SN_idea_ecb "IDEA-ECB"
+# define LN_idea_ecb "idea-ecb"
+# define NID_idea_ecb 36
+
+# define SN_rc2_cbc "RC2-CBC"
+# define LN_rc2_cbc "rc2-cbc"
+# define NID_rc2_cbc 37
+# define OBJ_rc2_cbc OBJ_rsadsi,3L,2L
+
+# define SN_rc2_ecb "RC2-ECB"
+# define LN_rc2_ecb "rc2-ecb"
+# define NID_rc2_ecb 38
+
+# define SN_rc2_cfb64 "RC2-CFB"
+# define LN_rc2_cfb64 "rc2-cfb"
+# define NID_rc2_cfb64 39
+
+# define SN_rc2_ofb64 "RC2-OFB"
+# define LN_rc2_ofb64 "rc2-ofb"
+# define NID_rc2_ofb64 40
+
+# define SN_sha "SHA"
+# define LN_sha "sha"
+# define NID_sha 41
+# define OBJ_sha OBJ_algorithm,18L
+
+# define SN_shaWithRSAEncryption "RSA-SHA"
+# define LN_shaWithRSAEncryption "shaWithRSAEncryption"
+# define NID_shaWithRSAEncryption 42
+# define OBJ_shaWithRSAEncryption OBJ_algorithm,15L
+
+# define SN_des_ede_cbc "DES-EDE-CBC"
+# define LN_des_ede_cbc "des-ede-cbc"
+# define NID_des_ede_cbc 43
+
+# define SN_des_ede3_cbc "DES-EDE3-CBC"
+# define LN_des_ede3_cbc "des-ede3-cbc"
+# define NID_des_ede3_cbc 44
+# define OBJ_des_ede3_cbc OBJ_rsadsi,3L,7L
+
+# define SN_des_ofb64 "DES-OFB"
+# define LN_des_ofb64 "des-ofb"
+# define NID_des_ofb64 45
+# define OBJ_des_ofb64 OBJ_algorithm,8L
+
+# define SN_idea_ofb64 "IDEA-OFB"
+# define LN_idea_ofb64 "idea-ofb"
+# define NID_idea_ofb64 46
+
+# define LN_pkcs9 "pkcs9"
+# define NID_pkcs9 47
+# define OBJ_pkcs9 OBJ_pkcs,9L
+
+# define SN_pkcs9_emailAddress "Email"
+# define LN_pkcs9_emailAddress "emailAddress"
+# define NID_pkcs9_emailAddress 48
+# define OBJ_pkcs9_emailAddress OBJ_pkcs9,1L
+
+# define LN_pkcs9_unstructuredName "unstructuredName"
+# define NID_pkcs9_unstructuredName 49
+# define OBJ_pkcs9_unstructuredName OBJ_pkcs9,2L
+
+# define LN_pkcs9_contentType "contentType"
+# define NID_pkcs9_contentType 50
+# define OBJ_pkcs9_contentType OBJ_pkcs9,3L
+
+# define LN_pkcs9_messageDigest "messageDigest"
+# define NID_pkcs9_messageDigest 51
+# define OBJ_pkcs9_messageDigest OBJ_pkcs9,4L
+
+# define LN_pkcs9_signingTime "signingTime"
+# define NID_pkcs9_signingTime 52
+# define OBJ_pkcs9_signingTime OBJ_pkcs9,5L
+
+# define LN_pkcs9_countersignature "countersignature"
+# define NID_pkcs9_countersignature 53
+# define OBJ_pkcs9_countersignature OBJ_pkcs9,6L
+
+# define LN_pkcs9_challengePassword "challengePassword"
+# define NID_pkcs9_challengePassword 54
+# define OBJ_pkcs9_challengePassword OBJ_pkcs9,7L
+
+# define LN_pkcs9_unstructuredAddress "unstructuredAddress"
+# define NID_pkcs9_unstructuredAddress 55
+# define OBJ_pkcs9_unstructuredAddress OBJ_pkcs9,8L
+
+# define LN_pkcs9_extCertAttributes "extendedCertificateAttributes"
+# define NID_pkcs9_extCertAttributes 56
+# define OBJ_pkcs9_extCertAttributes OBJ_pkcs9,9L
+
+# define SN_netscape "Netscape"
+# define LN_netscape "Netscape Communications Corp."
+# define NID_netscape 57
+# define OBJ_netscape 2L,16L,840L,1L,113730L
+
+# define SN_netscape_cert_extension "nsCertExt"
+# define LN_netscape_cert_extension "Netscape Certificate Extension"
+# define NID_netscape_cert_extension 58
+# define OBJ_netscape_cert_extension OBJ_netscape,1L
+
+# define SN_netscape_data_type "nsDataType"
+# define LN_netscape_data_type "Netscape Data Type"
+# define NID_netscape_data_type 59
+# define OBJ_netscape_data_type OBJ_netscape,2L
+
+# define SN_des_ede_cfb64 "DES-EDE-CFB"
+# define LN_des_ede_cfb64 "des-ede-cfb"
+# define NID_des_ede_cfb64 60
+
+# define SN_des_ede3_cfb64 "DES-EDE3-CFB"
+# define LN_des_ede3_cfb64 "des-ede3-cfb"
+# define NID_des_ede3_cfb64 61
+
+# define SN_des_ede_ofb64 "DES-EDE-OFB"
+# define LN_des_ede_ofb64 "des-ede-ofb"
+# define NID_des_ede_ofb64 62
+
+# define SN_des_ede3_ofb64 "DES-EDE3-OFB"
+# define LN_des_ede3_ofb64 "des-ede3-ofb"
+# define NID_des_ede3_ofb64 63
+
+/* I'm not sure about the object ID */
+# define SN_sha1 "SHA1"
+# define LN_sha1 "sha1"
+# define NID_sha1 64
+# define OBJ_sha1 OBJ_algorithm,26L
+/* 28 Jun 1996 - eay */
+/* #define OBJ_sha1 1L,3L,14L,2L,26L,05L <- wrong */
+
+# define SN_sha1WithRSAEncryption "RSA-SHA1"
+# define LN_sha1WithRSAEncryption "sha1WithRSAEncryption"
+# define NID_sha1WithRSAEncryption 65
+# define OBJ_sha1WithRSAEncryption OBJ_pkcs,1L,5L
+
+# define SN_dsaWithSHA "DSA-SHA"
+# define LN_dsaWithSHA "dsaWithSHA"
+# define NID_dsaWithSHA 66
+# define OBJ_dsaWithSHA OBJ_algorithm,13L
+
+# define SN_dsa_2 "DSA-old"
+# define LN_dsa_2 "dsaEncryption-old"
+# define NID_dsa_2 67
+# define OBJ_dsa_2 OBJ_algorithm,12L
+
+/* proposed by microsoft to RSA */
+# define SN_pbeWithSHA1AndRC2_CBC "PBE-SHA1-RC2-64"
+# define LN_pbeWithSHA1AndRC2_CBC "pbeWithSHA1AndRC2-CBC"
+# define NID_pbeWithSHA1AndRC2_CBC 68
+# define OBJ_pbeWithSHA1AndRC2_CBC OBJ_pkcs,5L,11L
+
+/*
+ * proposed by microsoft to RSA as pbeWithSHA1AndRC4: it is now defined
+ * explicitly in PKCS#5 v2.0 as id-PBKDF2 which is something completely
+ * different.
+ */
+# define LN_id_pbkdf2 "PBKDF2"
+# define NID_id_pbkdf2 69
+# define OBJ_id_pbkdf2 OBJ_pkcs,5L,12L
+
+# define SN_dsaWithSHA1_2 "DSA-SHA1-old"
+# define LN_dsaWithSHA1_2 "dsaWithSHA1-old"
+# define NID_dsaWithSHA1_2 70
+/* Got this one from 'sdn706r20.pdf' which is actually an NSA document :-) */
+# define OBJ_dsaWithSHA1_2 OBJ_algorithm,27L
+
+# define SN_netscape_cert_type "nsCertType"
+# define LN_netscape_cert_type "Netscape Cert Type"
+# define NID_netscape_cert_type 71
+# define OBJ_netscape_cert_type OBJ_netscape_cert_extension,1L
+
+# define SN_netscape_base_url "nsBaseUrl"
+# define LN_netscape_base_url "Netscape Base Url"
+# define NID_netscape_base_url 72
+# define OBJ_netscape_base_url OBJ_netscape_cert_extension,2L
+
+# define SN_netscape_revocation_url "nsRevocationUrl"
+# define LN_netscape_revocation_url "Netscape Revocation Url"
+# define NID_netscape_revocation_url 73
+# define OBJ_netscape_revocation_url OBJ_netscape_cert_extension,3L
+
+# define SN_netscape_ca_revocation_url "nsCaRevocationUrl"
+# define LN_netscape_ca_revocation_url "Netscape CA Revocation Url"
+# define NID_netscape_ca_revocation_url 74
+# define OBJ_netscape_ca_revocation_url OBJ_netscape_cert_extension,4L
+
+# define SN_netscape_renewal_url "nsRenewalUrl"
+# define LN_netscape_renewal_url "Netscape Renewal Url"
+# define NID_netscape_renewal_url 75
+# define OBJ_netscape_renewal_url OBJ_netscape_cert_extension,7L
+
+# define SN_netscape_ca_policy_url "nsCaPolicyUrl"
+# define LN_netscape_ca_policy_url "Netscape CA Policy Url"
+# define NID_netscape_ca_policy_url 76
+# define OBJ_netscape_ca_policy_url OBJ_netscape_cert_extension,8L
+
+# define SN_netscape_ssl_server_name "nsSslServerName"
+# define LN_netscape_ssl_server_name "Netscape SSL Server Name"
+# define NID_netscape_ssl_server_name 77
+# define OBJ_netscape_ssl_server_name OBJ_netscape_cert_extension,12L
+
+# define SN_netscape_comment "nsComment"
+# define LN_netscape_comment "Netscape Comment"
+# define NID_netscape_comment 78
+# define OBJ_netscape_comment OBJ_netscape_cert_extension,13L
+
+# define SN_netscape_cert_sequence "nsCertSequence"
+# define LN_netscape_cert_sequence "Netscape Certificate Sequence"
+# define NID_netscape_cert_sequence 79
+# define OBJ_netscape_cert_sequence OBJ_netscape_data_type,5L
+
+# define SN_desx_cbc "DESX-CBC"
+# define LN_desx_cbc "desx-cbc"
+# define NID_desx_cbc 80
+
+# define SN_id_ce "id-ce"
+# define NID_id_ce 81
+# define OBJ_id_ce 2L,5L,29L
+
+# define SN_subject_key_identifier "subjectKeyIdentifier"
+# define LN_subject_key_identifier "X509v3 Subject Key Identifier"
+# define NID_subject_key_identifier 82
+# define OBJ_subject_key_identifier OBJ_id_ce,14L
+
+# define SN_key_usage "keyUsage"
+# define LN_key_usage "X509v3 Key Usage"
+# define NID_key_usage 83
+# define OBJ_key_usage OBJ_id_ce,15L
+
+# define SN_private_key_usage_period "privateKeyUsagePeriod"
+# define LN_private_key_usage_period "X509v3 Private Key Usage Period"
+# define NID_private_key_usage_period 84
+# define OBJ_private_key_usage_period OBJ_id_ce,16L
+
+# define SN_subject_alt_name "subjectAltName"
+# define LN_subject_alt_name "X509v3 Subject Alternative Name"
+# define NID_subject_alt_name 85
+# define OBJ_subject_alt_name OBJ_id_ce,17L
+
+# define SN_issuer_alt_name "issuerAltName"
+# define LN_issuer_alt_name "X509v3 Issuer Alternative Name"
+# define NID_issuer_alt_name 86
+# define OBJ_issuer_alt_name OBJ_id_ce,18L
+
+# define SN_basic_constraints "basicConstraints"
+# define LN_basic_constraints "X509v3 Basic Constraints"
+# define NID_basic_constraints 87
+# define OBJ_basic_constraints OBJ_id_ce,19L
+
+# define SN_crl_number "crlNumber"
+# define LN_crl_number "X509v3 CRL Number"
+# define NID_crl_number 88
+# define OBJ_crl_number OBJ_id_ce,20L
+
+# define SN_certificate_policies "certificatePolicies"
+# define LN_certificate_policies "X509v3 Certificate Policies"
+# define NID_certificate_policies 89
+# define OBJ_certificate_policies OBJ_id_ce,32L
+
+# define SN_authority_key_identifier "authorityKeyIdentifier"
+# define LN_authority_key_identifier "X509v3 Authority Key Identifier"
+# define NID_authority_key_identifier 90
+# define OBJ_authority_key_identifier OBJ_id_ce,35L
+
+# define SN_bf_cbc "BF-CBC"
+# define LN_bf_cbc "bf-cbc"
+# define NID_bf_cbc 91
+# define OBJ_bf_cbc 1L,3L,6L,1L,4L,1L,3029L,1L,2L
+
+# define SN_bf_ecb "BF-ECB"
+# define LN_bf_ecb "bf-ecb"
+# define NID_bf_ecb 92
+
+# define SN_bf_cfb64 "BF-CFB"
+# define LN_bf_cfb64 "bf-cfb"
+# define NID_bf_cfb64 93
+
+# define SN_bf_ofb64 "BF-OFB"
+# define LN_bf_ofb64 "bf-ofb"
+# define NID_bf_ofb64 94
+
+# define SN_mdc2 "MDC2"
+# define LN_mdc2 "mdc2"
+# define NID_mdc2 95
+# define OBJ_mdc2 2L,5L,8L,3L,101L
+/* An alternative? 1L,3L,14L,3L,2L,19L */
+
+# define SN_mdc2WithRSA "RSA-MDC2"
+# define LN_mdc2WithRSA "mdc2withRSA"
+# define NID_mdc2WithRSA 96
+# define OBJ_mdc2WithRSA 2L,5L,8L,3L,100L
+
+# define SN_rc4_40 "RC4-40"
+# define LN_rc4_40 "rc4-40"
+# define NID_rc4_40 97
+
+# define SN_rc2_40_cbc "RC2-40-CBC"
+# define LN_rc2_40_cbc "rc2-40-cbc"
+# define NID_rc2_40_cbc 98
+
+# define SN_givenName "G"
+# define LN_givenName "givenName"
+# define NID_givenName 99
+# define OBJ_givenName OBJ_X509,42L
+
+# define SN_surname "S"
+# define LN_surname "surname"
+# define NID_surname 100
+# define OBJ_surname OBJ_X509,4L
+
+# define SN_initials "I"
+# define LN_initials "initials"
+# define NID_initials 101
+# define OBJ_initials OBJ_X509,43L
+
+# define SN_uniqueIdentifier "UID"
+# define LN_uniqueIdentifier "uniqueIdentifier"
+# define NID_uniqueIdentifier 102
+# define OBJ_uniqueIdentifier OBJ_X509,45L
+
+# define SN_crl_distribution_points "crlDistributionPoints"
+# define LN_crl_distribution_points "X509v3 CRL Distribution Points"
+# define NID_crl_distribution_points 103
+# define OBJ_crl_distribution_points OBJ_id_ce,31L
+
+# define SN_md5WithRSA "RSA-NP-MD5"
+# define LN_md5WithRSA "md5WithRSA"
+# define NID_md5WithRSA 104
+# define OBJ_md5WithRSA OBJ_algorithm,3L
+
+# define SN_serialNumber "SN"
+# define LN_serialNumber "serialNumber"
+# define NID_serialNumber 105
+# define OBJ_serialNumber OBJ_X509,5L
+
+# define SN_title "T"
+# define LN_title "title"
+# define NID_title 106
+# define OBJ_title OBJ_X509,12L
+
+# define SN_description "D"
+# define LN_description "description"
+# define NID_description 107
+# define OBJ_description OBJ_X509,13L
+
+/* CAST5 is CAST-128, I'm just sticking with the documentation */
+# define SN_cast5_cbc "CAST5-CBC"
+# define LN_cast5_cbc "cast5-cbc"
+# define NID_cast5_cbc 108
+# define OBJ_cast5_cbc 1L,2L,840L,113533L,7L,66L,10L
+
+# define SN_cast5_ecb "CAST5-ECB"
+# define LN_cast5_ecb "cast5-ecb"
+# define NID_cast5_ecb 109
+
+# define SN_cast5_cfb64 "CAST5-CFB"
+# define LN_cast5_cfb64 "cast5-cfb"
+# define NID_cast5_cfb64 110
+
+# define SN_cast5_ofb64 "CAST5-OFB"
+# define LN_cast5_ofb64 "cast5-ofb"
+# define NID_cast5_ofb64 111
+
+# define LN_pbeWithMD5AndCast5_CBC "pbeWithMD5AndCast5CBC"
+# define NID_pbeWithMD5AndCast5_CBC 112
+# define OBJ_pbeWithMD5AndCast5_CBC 1L,2L,840L,113533L,7L,66L,12L
+
+/*-
+ * This is one sun will soon be using :-(
+ * id-dsa-with-sha1 ID ::= {
+ * iso(1) member-body(2) us(840) x9-57 (10040) x9cm(4) 3 }
+ */
+# define SN_dsaWithSHA1 "DSA-SHA1"
+# define LN_dsaWithSHA1 "dsaWithSHA1"
+# define NID_dsaWithSHA1 113
+# define OBJ_dsaWithSHA1 1L,2L,840L,10040L,4L,3L
+
+# define NID_md5_sha1 114
+# define SN_md5_sha1 "MD5-SHA1"
+# define LN_md5_sha1 "md5-sha1"
+
+# define SN_sha1WithRSA "RSA-SHA1-2"
+# define LN_sha1WithRSA "sha1WithRSA"
+# define NID_sha1WithRSA 115
+# define OBJ_sha1WithRSA OBJ_algorithm,29L
+
+# define SN_dsa "DSA"
+# define LN_dsa "dsaEncryption"
+# define NID_dsa 116
+# define OBJ_dsa 1L,2L,840L,10040L,4L,1L
+
+# define SN_ripemd160 "RIPEMD160"
+# define LN_ripemd160 "ripemd160"
+# define NID_ripemd160 117
+# define OBJ_ripemd160 1L,3L,36L,3L,2L,1L
+
+/*
+ * The name should actually be rsaSignatureWithripemd160, but I'm going to
+ * continue using the convention I'm using with the other ciphers
+ */
+# define SN_ripemd160WithRSA "RSA-RIPEMD160"
+# define LN_ripemd160WithRSA "ripemd160WithRSA"
+# define NID_ripemd160WithRSA 119
+# define OBJ_ripemd160WithRSA 1L,3L,36L,3L,3L,1L,2L
+
+/*-
+ * Taken from rfc2040
+ * RC5_CBC_Parameters ::= SEQUENCE {
+ * version INTEGER (v1_0(16)),
+ * rounds INTEGER (8..127),
+ * blockSizeInBits INTEGER (64, 128),
+ * iv OCTET STRING OPTIONAL
+ * }
+ */
+# define SN_rc5_cbc "RC5-CBC"
+# define LN_rc5_cbc "rc5-cbc"
+# define NID_rc5_cbc 120
+# define OBJ_rc5_cbc OBJ_rsadsi,3L,8L
+
+# define SN_rc5_ecb "RC5-ECB"
+# define LN_rc5_ecb "rc5-ecb"
+# define NID_rc5_ecb 121
+
+# define SN_rc5_cfb64 "RC5-CFB"
+# define LN_rc5_cfb64 "rc5-cfb"
+# define NID_rc5_cfb64 122
+
+# define SN_rc5_ofb64 "RC5-OFB"
+# define LN_rc5_ofb64 "rc5-ofb"
+# define NID_rc5_ofb64 123
+
+# define SN_rle_compression "RLE"
+# define LN_rle_compression "run length compression"
+# define NID_rle_compression 124
+# define OBJ_rle_compression 1L,1L,1L,1L,666L,1L
+
+# define SN_zlib_compression "ZLIB"
+# define LN_zlib_compression "zlib compression"
+# define NID_zlib_compression 125
+# define OBJ_zlib_compression 1L,1L,1L,1L,666L,2L
+
+# define SN_ext_key_usage "extendedKeyUsage"
+# define LN_ext_key_usage "X509v3 Extended Key Usage"
+# define NID_ext_key_usage 126
+# define OBJ_ext_key_usage OBJ_id_ce,37
+
+# define SN_id_pkix "PKIX"
+# define NID_id_pkix 127
+# define OBJ_id_pkix 1L,3L,6L,1L,5L,5L,7L
+
+# define SN_id_kp "id-kp"
+# define NID_id_kp 128
+# define OBJ_id_kp OBJ_id_pkix,3L
+
+/* PKIX extended key usage OIDs */
+
+# define SN_server_auth "serverAuth"
+# define LN_server_auth "TLS Web Server Authentication"
+# define NID_server_auth 129
+# define OBJ_server_auth OBJ_id_kp,1L
+
+# define SN_client_auth "clientAuth"
+# define LN_client_auth "TLS Web Client Authentication"
+# define NID_client_auth 130
+# define OBJ_client_auth OBJ_id_kp,2L
+
+# define SN_code_sign "codeSigning"
+# define LN_code_sign "Code Signing"
+# define NID_code_sign 131
+# define OBJ_code_sign OBJ_id_kp,3L
+
+# define SN_email_protect "emailProtection"
+# define LN_email_protect "E-mail Protection"
+# define NID_email_protect 132
+# define OBJ_email_protect OBJ_id_kp,4L
+
+# define SN_time_stamp "timeStamping"
+# define LN_time_stamp "Time Stamping"
+# define NID_time_stamp 133
+# define OBJ_time_stamp OBJ_id_kp,8L
+
+/* Additional extended key usage OIDs: Microsoft */
+
+# define SN_ms_code_ind "msCodeInd"
+# define LN_ms_code_ind "Microsoft Individual Code Signing"
+# define NID_ms_code_ind 134
+# define OBJ_ms_code_ind 1L,3L,6L,1L,4L,1L,311L,2L,1L,21L
+
+# define SN_ms_code_com "msCodeCom"
+# define LN_ms_code_com "Microsoft Commercial Code Signing"
+# define NID_ms_code_com 135
+# define OBJ_ms_code_com 1L,3L,6L,1L,4L,1L,311L,2L,1L,22L
+
+# define SN_ms_ctl_sign "msCTLSign"
+# define LN_ms_ctl_sign "Microsoft Trust List Signing"
+# define NID_ms_ctl_sign 136
+# define OBJ_ms_ctl_sign 1L,3L,6L,1L,4L,1L,311L,10L,3L,1L
+
+# define SN_ms_sgc "msSGC"
+# define LN_ms_sgc "Microsoft Server Gated Crypto"
+# define NID_ms_sgc 137
+# define OBJ_ms_sgc 1L,3L,6L,1L,4L,1L,311L,10L,3L,3L
+
+# define SN_ms_efs "msEFS"
+# define LN_ms_efs "Microsoft Encrypted File System"
+# define NID_ms_efs 138
+# define OBJ_ms_efs 1L,3L,6L,1L,4L,1L,311L,10L,3L,4L
+
+/* Additional usage: Netscape */
+
+# define SN_ns_sgc "nsSGC"
+# define LN_ns_sgc "Netscape Server Gated Crypto"
+# define NID_ns_sgc 139
+# define OBJ_ns_sgc OBJ_netscape,4L,1L
+
+# define SN_delta_crl "deltaCRL"
+# define LN_delta_crl "X509v3 Delta CRL Indicator"
+# define NID_delta_crl 140
+# define OBJ_delta_crl OBJ_id_ce,27L
+
+# define SN_crl_reason "CRLReason"
+# define LN_crl_reason "CRL Reason Code"
+# define NID_crl_reason 141
+# define OBJ_crl_reason OBJ_id_ce,21L
+
+# define SN_invalidity_date "invalidityDate"
+# define LN_invalidity_date "Invalidity Date"
+# define NID_invalidity_date 142
+# define OBJ_invalidity_date OBJ_id_ce,24L
+
+# define SN_sxnet "SXNetID"
+# define LN_sxnet "Strong Extranet ID"
+# define NID_sxnet 143
+# define OBJ_sxnet 1L,3L,101L,1L,4L,1L
+
+/* PKCS12 and related OBJECT IDENTIFIERS */
+
+# define OBJ_pkcs12 OBJ_pkcs,12L
+# define OBJ_pkcs12_pbeids OBJ_pkcs12, 1
+
+# define SN_pbe_WithSHA1And128BitRC4 "PBE-SHA1-RC4-128"
+# define LN_pbe_WithSHA1And128BitRC4 "pbeWithSHA1And128BitRC4"
+# define NID_pbe_WithSHA1And128BitRC4 144
+# define OBJ_pbe_WithSHA1And128BitRC4 OBJ_pkcs12_pbeids, 1L
+
+# define SN_pbe_WithSHA1And40BitRC4 "PBE-SHA1-RC4-40"
+# define LN_pbe_WithSHA1And40BitRC4 "pbeWithSHA1And40BitRC4"
+# define NID_pbe_WithSHA1And40BitRC4 145
+# define OBJ_pbe_WithSHA1And40BitRC4 OBJ_pkcs12_pbeids, 2L
+
+# define SN_pbe_WithSHA1And3_Key_TripleDES_CBC "PBE-SHA1-3DES"
+# define LN_pbe_WithSHA1And3_Key_TripleDES_CBC "pbeWithSHA1And3-KeyTripleDES-CBC"
+# define NID_pbe_WithSHA1And3_Key_TripleDES_CBC 146
+# define OBJ_pbe_WithSHA1And3_Key_TripleDES_CBC OBJ_pkcs12_pbeids, 3L
+
+# define SN_pbe_WithSHA1And2_Key_TripleDES_CBC "PBE-SHA1-2DES"
+# define LN_pbe_WithSHA1And2_Key_TripleDES_CBC "pbeWithSHA1And2-KeyTripleDES-CBC"
+# define NID_pbe_WithSHA1And2_Key_TripleDES_CBC 147
+# define OBJ_pbe_WithSHA1And2_Key_TripleDES_CBC OBJ_pkcs12_pbeids, 4L
+
+# define SN_pbe_WithSHA1And128BitRC2_CBC "PBE-SHA1-RC2-128"
+# define LN_pbe_WithSHA1And128BitRC2_CBC "pbeWithSHA1And128BitRC2-CBC"
+# define NID_pbe_WithSHA1And128BitRC2_CBC 148
+# define OBJ_pbe_WithSHA1And128BitRC2_CBC OBJ_pkcs12_pbeids, 5L
+
+# define SN_pbe_WithSHA1And40BitRC2_CBC "PBE-SHA1-RC2-40"
+# define LN_pbe_WithSHA1And40BitRC2_CBC "pbeWithSHA1And40BitRC2-CBC"
+# define NID_pbe_WithSHA1And40BitRC2_CBC 149
+# define OBJ_pbe_WithSHA1And40BitRC2_CBC OBJ_pkcs12_pbeids, 6L
+
+# define OBJ_pkcs12_Version1 OBJ_pkcs12, 10L
+
+# define OBJ_pkcs12_BagIds OBJ_pkcs12_Version1, 1L
+
+# define LN_keyBag "keyBag"
+# define NID_keyBag 150
+# define OBJ_keyBag OBJ_pkcs12_BagIds, 1L
+
+# define LN_pkcs8ShroudedKeyBag "pkcs8ShroudedKeyBag"
+# define NID_pkcs8ShroudedKeyBag 151
+# define OBJ_pkcs8ShroudedKeyBag OBJ_pkcs12_BagIds, 2L
+
+# define LN_certBag "certBag"
+# define NID_certBag 152
+# define OBJ_certBag OBJ_pkcs12_BagIds, 3L
+
+# define LN_crlBag "crlBag"
+# define NID_crlBag 153
+# define OBJ_crlBag OBJ_pkcs12_BagIds, 4L
+
+# define LN_secretBag "secretBag"
+# define NID_secretBag 154
+# define OBJ_secretBag OBJ_pkcs12_BagIds, 5L
+
+# define LN_safeContentsBag "safeContentsBag"
+# define NID_safeContentsBag 155
+# define OBJ_safeContentsBag OBJ_pkcs12_BagIds, 6L
+
+# define LN_friendlyName "friendlyName"
+# define NID_friendlyName 156
+# define OBJ_friendlyName OBJ_pkcs9, 20L
+
+# define LN_localKeyID "localKeyID"
+# define NID_localKeyID 157
+# define OBJ_localKeyID OBJ_pkcs9, 21L
+
+# define OBJ_certTypes OBJ_pkcs9, 22L
+
+# define LN_x509Certificate "x509Certificate"
+# define NID_x509Certificate 158
+# define OBJ_x509Certificate OBJ_certTypes, 1L
+
+# define LN_sdsiCertificate "sdsiCertificate"
+# define NID_sdsiCertificate 159
+# define OBJ_sdsiCertificate OBJ_certTypes, 2L
+
+# define OBJ_crlTypes OBJ_pkcs9, 23L
+
+# define LN_x509Crl "x509Crl"
+# define NID_x509Crl 160
+# define OBJ_x509Crl OBJ_crlTypes, 1L
+
+/* PKCS#5 v2 OIDs */
+
+# define LN_pbes2 "PBES2"
+# define NID_pbes2 161
+# define OBJ_pbes2 OBJ_pkcs,5L,13L
+
+# define LN_pbmac1 "PBMAC1"
+# define NID_pbmac1 162
+# define OBJ_pbmac1 OBJ_pkcs,5L,14L
+
+# define LN_hmacWithSHA1 "hmacWithSHA1"
+# define NID_hmacWithSHA1 163
+# define OBJ_hmacWithSHA1 OBJ_rsadsi,2L,7L
+
+/* Policy Qualifier Ids */
+
+# define LN_id_qt_cps "Policy Qualifier CPS"
+# define SN_id_qt_cps "id-qt-cps"
+# define NID_id_qt_cps 164
+# define OBJ_id_qt_cps OBJ_id_pkix,2L,1L
+
+# define LN_id_qt_unotice "Policy Qualifier User Notice"
+# define SN_id_qt_unotice "id-qt-unotice"
+# define NID_id_qt_unotice 165
+# define OBJ_id_qt_unotice OBJ_id_pkix,2L,2L
+
+# define SN_rc2_64_cbc "RC2-64-CBC"
+# define LN_rc2_64_cbc "rc2-64-cbc"
+# define NID_rc2_64_cbc 166
+
+# define SN_SMIMECapabilities "SMIME-CAPS"
+# define LN_SMIMECapabilities "S/MIME Capabilities"
+# define NID_SMIMECapabilities 167
+# define OBJ_SMIMECapabilities OBJ_pkcs9,15L
+
+# define SN_pbeWithMD2AndRC2_CBC "PBE-MD2-RC2-64"
+# define LN_pbeWithMD2AndRC2_CBC "pbeWithMD2AndRC2-CBC"
+# define NID_pbeWithMD2AndRC2_CBC 168
+# define OBJ_pbeWithMD2AndRC2_CBC OBJ_pkcs,5L,4L
+
+# define SN_pbeWithMD5AndRC2_CBC "PBE-MD5-RC2-64"
+# define LN_pbeWithMD5AndRC2_CBC "pbeWithMD5AndRC2-CBC"
+# define NID_pbeWithMD5AndRC2_CBC 169
+# define OBJ_pbeWithMD5AndRC2_CBC OBJ_pkcs,5L,6L
+
+# define SN_pbeWithSHA1AndDES_CBC "PBE-SHA1-DES"
+# define LN_pbeWithSHA1AndDES_CBC "pbeWithSHA1AndDES-CBC"
+# define NID_pbeWithSHA1AndDES_CBC 170
+# define OBJ_pbeWithSHA1AndDES_CBC OBJ_pkcs,5L,10L
+
+/* Extension request OIDs */
+
+# define LN_ms_ext_req "Microsoft Extension Request"
+# define SN_ms_ext_req "msExtReq"
+# define NID_ms_ext_req 171
+# define OBJ_ms_ext_req 1L,3L,6L,1L,4L,1L,311L,2L,1L,14L
+
+# define LN_ext_req "Extension Request"
+# define SN_ext_req "extReq"
+# define NID_ext_req 172
+# define OBJ_ext_req OBJ_pkcs9,14L
+
+# define SN_name "name"
+# define LN_name "name"
+# define NID_name 173
+# define OBJ_name OBJ_X509,41L
+
+# define SN_dnQualifier "dnQualifier"
+# define LN_dnQualifier "dnQualifier"
+# define NID_dnQualifier 174
+# define OBJ_dnQualifier OBJ_X509,46L
+
+# define SN_id_pe "id-pe"
+# define NID_id_pe 175
+# define OBJ_id_pe OBJ_id_pkix,1L
+
+# define SN_id_ad "id-ad"
+# define NID_id_ad 176
+# define OBJ_id_ad OBJ_id_pkix,48L
+
+# define SN_info_access "authorityInfoAccess"
+# define LN_info_access "Authority Information Access"
+# define NID_info_access 177
+# define OBJ_info_access OBJ_id_pe,1L
+
+# define SN_ad_OCSP "OCSP"
+# define LN_ad_OCSP "OCSP"
+# define NID_ad_OCSP 178
+# define OBJ_ad_OCSP OBJ_id_ad,1L
+
+# define SN_ad_ca_issuers "caIssuers"
+# define LN_ad_ca_issuers "CA Issuers"
+# define NID_ad_ca_issuers 179
+# define OBJ_ad_ca_issuers OBJ_id_ad,2L
+
+# define SN_OCSP_sign "OCSPSigning"
+# define LN_OCSP_sign "OCSP Signing"
+# define NID_OCSP_sign 180
+# define OBJ_OCSP_sign OBJ_id_kp,9L
+# endif /* USE_OBJ_MAC */
+
+# include <openssl/bio.h>
+# include <openssl/asn1.h>
+
+# define OBJ_NAME_TYPE_UNDEF 0x00
+# define OBJ_NAME_TYPE_MD_METH 0x01
+# define OBJ_NAME_TYPE_CIPHER_METH 0x02
+# define OBJ_NAME_TYPE_PKEY_METH 0x03
+# define OBJ_NAME_TYPE_COMP_METH 0x04
+# define OBJ_NAME_TYPE_NUM 0x05
+
+# define OBJ_NAME_ALIAS 0x8000
+
+# define OBJ_BSEARCH_VALUE_ON_NOMATCH 0x01
+# define OBJ_BSEARCH_FIRST_VALUE_ON_MATCH 0x02
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct obj_name_st {
+ int type;
+ int alias;
+ const char *name;
+ const char *data;
+} OBJ_NAME;
+
+# define OBJ_create_and_add_object(a,b,c) OBJ_create(a,b,c)
+
+int OBJ_NAME_init(void);
+int OBJ_NAME_new_index(unsigned long (*hash_func) (const char *),
+ int (*cmp_func) (const char *, const char *),
+ void (*free_func) (const char *, int, const char *));
+const char *OBJ_NAME_get(const char *name, int type);
+int OBJ_NAME_add(const char *name, int type, const char *data);
+int OBJ_NAME_remove(const char *name, int type);
+void OBJ_NAME_cleanup(int type); /* -1 for everything */
+void OBJ_NAME_do_all(int type, void (*fn) (const OBJ_NAME *, void *arg),
+ void *arg);
+void OBJ_NAME_do_all_sorted(int type,
+ void (*fn) (const OBJ_NAME *, void *arg),
+ void *arg);
+
+ASN1_OBJECT *OBJ_dup(const ASN1_OBJECT *o);
+ASN1_OBJECT *OBJ_nid2obj(int n);
+const char *OBJ_nid2ln(int n);
+const char *OBJ_nid2sn(int n);
+int OBJ_obj2nid(const ASN1_OBJECT *o);
+ASN1_OBJECT *OBJ_txt2obj(const char *s, int no_name);
+int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name);
+int OBJ_txt2nid(const char *s);
+int OBJ_ln2nid(const char *s);
+int OBJ_sn2nid(const char *s);
+int OBJ_cmp(const ASN1_OBJECT *a, const ASN1_OBJECT *b);
+const void *OBJ_bsearch_(const void *key, const void *base, int num, int size,
+ int (*cmp) (const void *, const void *));
+const void *OBJ_bsearch_ex_(const void *key, const void *base, int num,
+ int size,
+ int (*cmp) (const void *, const void *),
+ int flags);
+
+# define _DECLARE_OBJ_BSEARCH_CMP_FN(scope, type1, type2, nm) \
+ static int nm##_cmp_BSEARCH_CMP_FN(const void *, const void *); \
+ static int nm##_cmp(type1 const *, type2 const *); \
+ scope type2 * OBJ_bsearch_##nm(type1 *key, type2 const *base, int num)
+
+# define DECLARE_OBJ_BSEARCH_CMP_FN(type1, type2, cmp) \
+ _DECLARE_OBJ_BSEARCH_CMP_FN(static, type1, type2, cmp)
+# define DECLARE_OBJ_BSEARCH_GLOBAL_CMP_FN(type1, type2, nm) \
+ type2 * OBJ_bsearch_##nm(type1 *key, type2 const *base, int num)
+
+/*-
+ * Unsolved problem: if a type is actually a pointer type, like
+ * nid_triple is, then its impossible to get a const where you need
+ * it. Consider:
+ *
+ * typedef int nid_triple[3];
+ * const void *a_;
+ * const nid_triple const *a = a_;
+ *
+ * The assignement discards a const because what you really want is:
+ *
+ * const int const * const *a = a_;
+ *
+ * But if you do that, you lose the fact that a is an array of 3 ints,
+ * which breaks comparison functions.
+ *
+ * Thus we end up having to cast, sadly, or unpack the
+ * declarations. Or, as I finally did in this case, delcare nid_triple
+ * to be a struct, which it should have been in the first place.
+ *
+ * Ben, August 2008.
+ *
+ * Also, strictly speaking not all types need be const, but handling
+ * the non-constness means a lot of complication, and in practice
+ * comparison routines do always not touch their arguments.
+ */
+
+# define IMPLEMENT_OBJ_BSEARCH_CMP_FN(type1, type2, nm) \
+ static int nm##_cmp_BSEARCH_CMP_FN(const void *a_, const void *b_) \
+ { \
+ type1 const *a = a_; \
+ type2 const *b = b_; \
+ return nm##_cmp(a,b); \
+ } \
+ static type2 *OBJ_bsearch_##nm(type1 *key, type2 const *base, int num) \
+ { \
+ return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
+ nm##_cmp_BSEARCH_CMP_FN); \
+ } \
+ extern void dummy_prototype(void)
+
+# define IMPLEMENT_OBJ_BSEARCH_GLOBAL_CMP_FN(type1, type2, nm) \
+ static int nm##_cmp_BSEARCH_CMP_FN(const void *a_, const void *b_) \
+ { \
+ type1 const *a = a_; \
+ type2 const *b = b_; \
+ return nm##_cmp(a,b); \
+ } \
+ type2 *OBJ_bsearch_##nm(type1 *key, type2 const *base, int num) \
+ { \
+ return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
+ nm##_cmp_BSEARCH_CMP_FN); \
+ } \
+ extern void dummy_prototype(void)
+
+# define OBJ_bsearch(type1,key,type2,base,num,cmp) \
+ ((type2 *)OBJ_bsearch_(CHECKED_PTR_OF(type1,key),CHECKED_PTR_OF(type2,base), \
+ num,sizeof(type2), \
+ ((void)CHECKED_PTR_OF(type1,cmp##_type_1), \
+ (void)CHECKED_PTR_OF(type2,cmp##_type_2), \
+ cmp##_BSEARCH_CMP_FN)))
+
+# define OBJ_bsearch_ex(type1,key,type2,base,num,cmp,flags) \
+ ((type2 *)OBJ_bsearch_ex_(CHECKED_PTR_OF(type1,key),CHECKED_PTR_OF(type2,base), \
+ num,sizeof(type2), \
+ ((void)CHECKED_PTR_OF(type1,cmp##_type_1), \
+ (void)type_2=CHECKED_PTR_OF(type2,cmp##_type_2), \
+ cmp##_BSEARCH_CMP_FN)),flags)
+
+int OBJ_new_nid(int num);
+int OBJ_add_object(const ASN1_OBJECT *obj);
+int OBJ_create(const char *oid, const char *sn, const char *ln);
+void OBJ_cleanup(void);
+int OBJ_create_objects(BIO *in);
+
+int OBJ_find_sigid_algs(int signid, int *pdig_nid, int *ppkey_nid);
+int OBJ_find_sigid_by_algs(int *psignid, int dig_nid, int pkey_nid);
+int OBJ_add_sigid(int signid, int dig_id, int pkey_id);
+void OBJ_sigid_free(void);
+
+extern int obj_cleanup_defer;
+void check_defer(int nid);
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_OBJ_strings(void);
+
+/* Error codes for the OBJ functions. */
+
+/* Function codes. */
+# define OBJ_F_OBJ_ADD_OBJECT 105
+# define OBJ_F_OBJ_CREATE 100
+# define OBJ_F_OBJ_DUP 101
+# define OBJ_F_OBJ_NAME_NEW_INDEX 106
+# define OBJ_F_OBJ_NID2LN 102
+# define OBJ_F_OBJ_NID2OBJ 103
+# define OBJ_F_OBJ_NID2SN 104
+
+/* Reason codes. */
+# define OBJ_R_MALLOC_FAILURE 100
+# define OBJ_R_UNKNOWN_NID 101
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/deps/openssl/openssl/include/openssl/ocsp.h b/deps/openssl/openssl/include/openssl/ocsp.h
index 50e2885cedb..ca2ee76dce4 100644
--- a/deps/openssl/openssl/include/openssl/ocsp.h
+++ b/deps/openssl/openssl/include/openssl/ocsp.h
@@ -1 +1,637 @@
-#include "../../crypto/ocsp/ocsp.h"
+/* ocsp.h */
+/*
+ * Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL
+ * project.
+ */
+
+/*
+ * History: This file was transfered to Richard Levitte from CertCo by Kathy
+ * Weinhold in mid-spring 2000 to be included in OpenSSL or released as a
+ * patch kit.
+ */
+
+/* ====================================================================
+ * Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+#ifndef HEADER_OCSP_H
+# define HEADER_OCSP_H
+
+# include <openssl/ossl_typ.h>
+# include <openssl/x509.h>
+# include <openssl/x509v3.h>
+# include <openssl/safestack.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Various flags and values */
+
+# define OCSP_DEFAULT_NONCE_LENGTH 16
+
+# define OCSP_NOCERTS 0x1
+# define OCSP_NOINTERN 0x2
+# define OCSP_NOSIGS 0x4
+# define OCSP_NOCHAIN 0x8
+# define OCSP_NOVERIFY 0x10
+# define OCSP_NOEXPLICIT 0x20
+# define OCSP_NOCASIGN 0x40
+# define OCSP_NODELEGATED 0x80
+# define OCSP_NOCHECKS 0x100
+# define OCSP_TRUSTOTHER 0x200
+# define OCSP_RESPID_KEY 0x400
+# define OCSP_NOTIME 0x800
+
+/*- CertID ::= SEQUENCE {
+ * hashAlgorithm AlgorithmIdentifier,
+ * issuerNameHash OCTET STRING, -- Hash of Issuer's DN
+ * issuerKeyHash OCTET STRING, -- Hash of Issuers public key (excluding the tag & length fields)
+ * serialNumber CertificateSerialNumber }
+ */
+typedef struct ocsp_cert_id_st {
+ X509_ALGOR *hashAlgorithm;
+ ASN1_OCTET_STRING *issuerNameHash;
+ ASN1_OCTET_STRING *issuerKeyHash;
+ ASN1_INTEGER *serialNumber;
+} OCSP_CERTID;
+
+DECLARE_STACK_OF(OCSP_CERTID)
+
+/*- Request ::= SEQUENCE {
+ * reqCert CertID,
+ * singleRequestExtensions [0] EXPLICIT Extensions OPTIONAL }
+ */
+typedef struct ocsp_one_request_st {
+ OCSP_CERTID *reqCert;
+ STACK_OF(X509_EXTENSION) *singleRequestExtensions;
+} OCSP_ONEREQ;
+
+DECLARE_STACK_OF(OCSP_ONEREQ)
+DECLARE_ASN1_SET_OF(OCSP_ONEREQ)
+
+/*- TBSRequest ::= SEQUENCE {
+ * version [0] EXPLICIT Version DEFAULT v1,
+ * requestorName [1] EXPLICIT GeneralName OPTIONAL,
+ * requestList SEQUENCE OF Request,
+ * requestExtensions [2] EXPLICIT Extensions OPTIONAL }
+ */
+typedef struct ocsp_req_info_st {
+ ASN1_INTEGER *version;
+ GENERAL_NAME *requestorName;
+ STACK_OF(OCSP_ONEREQ) *requestList;
+ STACK_OF(X509_EXTENSION) *requestExtensions;
+} OCSP_REQINFO;
+
+/*- Signature ::= SEQUENCE {
+ * signatureAlgorithm AlgorithmIdentifier,
+ * signature BIT STRING,
+ * certs [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL }
+ */
+typedef struct ocsp_signature_st {
+ X509_ALGOR *signatureAlgorithm;
+ ASN1_BIT_STRING *signature;
+ STACK_OF(X509) *certs;
+} OCSP_SIGNATURE;
+
+/*- OCSPRequest ::= SEQUENCE {
+ * tbsRequest TBSRequest,
+ * optionalSignature [0] EXPLICIT Signature OPTIONAL }
+ */
+typedef struct ocsp_request_st {
+ OCSP_REQINFO *tbsRequest;
+ OCSP_SIGNATURE *optionalSignature; /* OPTIONAL */
+} OCSP_REQUEST;
+
+/*- OCSPResponseStatus ::= ENUMERATED {
+ * successful (0), --Response has valid confirmations
+ * malformedRequest (1), --Illegal confirmation request
+ * internalError (2), --Internal error in issuer
+ * tryLater (3), --Try again later
+ * --(4) is not used
+ * sigRequired (5), --Must sign the request
+ * unauthorized (6) --Request unauthorized
+ * }
+ */
+# define OCSP_RESPONSE_STATUS_SUCCESSFUL 0
+# define OCSP_RESPONSE_STATUS_MALFORMEDREQUEST 1
+# define OCSP_RESPONSE_STATUS_INTERNALERROR 2
+# define OCSP_RESPONSE_STATUS_TRYLATER 3
+# define OCSP_RESPONSE_STATUS_SIGREQUIRED 5
+# define OCSP_RESPONSE_STATUS_UNAUTHORIZED 6
+
+/*- ResponseBytes ::= SEQUENCE {
+ * responseType OBJECT IDENTIFIER,
+ * response OCTET STRING }
+ */
+typedef struct ocsp_resp_bytes_st {
+ ASN1_OBJECT *responseType;
+ ASN1_OCTET_STRING *response;
+} OCSP_RESPBYTES;
+
+/*- OCSPResponse ::= SEQUENCE {
+ * responseStatus OCSPResponseStatus,
+ * responseBytes [0] EXPLICIT ResponseBytes OPTIONAL }
+ */
+struct ocsp_response_st {
+ ASN1_ENUMERATED *responseStatus;
+ OCSP_RESPBYTES *responseBytes;
+};
+
+/*- ResponderID ::= CHOICE {
+ * byName [1] Name,
+ * byKey [2] KeyHash }
+ */
+# define V_OCSP_RESPID_NAME 0
+# define V_OCSP_RESPID_KEY 1
+struct ocsp_responder_id_st {
+ int type;
+ union {
+ X509_NAME *byName;
+ ASN1_OCTET_STRING *byKey;
+ } value;
+};
+
+DECLARE_STACK_OF(OCSP_RESPID)
+DECLARE_ASN1_FUNCTIONS(OCSP_RESPID)
+
+/*- KeyHash ::= OCTET STRING --SHA-1 hash of responder's public key
+ * --(excluding the tag and length fields)
+ */
+
+/*- RevokedInfo ::= SEQUENCE {
+ * revocationTime GeneralizedTime,
+ * revocationReason [0] EXPLICIT CRLReason OPTIONAL }
+ */
+typedef struct ocsp_revoked_info_st {
+ ASN1_GENERALIZEDTIME *revocationTime;
+ ASN1_ENUMERATED *revocationReason;
+} OCSP_REVOKEDINFO;
+
+/*- CertStatus ::= CHOICE {
+ * good [0] IMPLICIT NULL,
+ * revoked [1] IMPLICIT RevokedInfo,
+ * unknown [2] IMPLICIT UnknownInfo }
+ */
+# define V_OCSP_CERTSTATUS_GOOD 0
+# define V_OCSP_CERTSTATUS_REVOKED 1
+# define V_OCSP_CERTSTATUS_UNKNOWN 2
+typedef struct ocsp_cert_status_st {
+ int type;
+ union {
+ ASN1_NULL *good;
+ OCSP_REVOKEDINFO *revoked;
+ ASN1_NULL *unknown;
+ } value;
+} OCSP_CERTSTATUS;
+
+/*- SingleResponse ::= SEQUENCE {
+ * certID CertID,
+ * certStatus CertStatus,
+ * thisUpdate GeneralizedTime,
+ * nextUpdate [0] EXPLICIT GeneralizedTime OPTIONAL,
+ * singleExtensions [1] EXPLICIT Extensions OPTIONAL }
+ */
+typedef struct ocsp_single_response_st {
+ OCSP_CERTID *certId;
+ OCSP_CERTSTATUS *certStatus;
+ ASN1_GENERALIZEDTIME *thisUpdate;
+ ASN1_GENERALIZEDTIME *nextUpdate;
+ STACK_OF(X509_EXTENSION) *singleExtensions;
+} OCSP_SINGLERESP;
+
+DECLARE_STACK_OF(OCSP_SINGLERESP)
+DECLARE_ASN1_SET_OF(OCSP_SINGLERESP)
+
+/*- ResponseData ::= SEQUENCE {
+ * version [0] EXPLICIT Version DEFAULT v1,
+ * responderID ResponderID,
+ * producedAt GeneralizedTime,
+ * responses SEQUENCE OF SingleResponse,
+ * responseExtensions [1] EXPLICIT Extensions OPTIONAL }
+ */
+typedef struct ocsp_response_data_st {
+ ASN1_INTEGER *version;
+ OCSP_RESPID *responderId;
+ ASN1_GENERALIZEDTIME *producedAt;
+ STACK_OF(OCSP_SINGLERESP) *responses;
+ STACK_OF(X509_EXTENSION) *responseExtensions;
+} OCSP_RESPDATA;
+
+/*- BasicOCSPResponse ::= SEQUENCE {
+ * tbsResponseData ResponseData,
+ * signatureAlgorithm AlgorithmIdentifier,
+ * signature BIT STRING,
+ * certs [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL }
+ */
+ /*
+ * Note 1: The value for "signature" is specified in the OCSP rfc2560 as
+ * follows: "The value for the signature SHALL be computed on the hash of
+ * the DER encoding ResponseData." This means that you must hash the
+ * DER-encoded tbsResponseData, and then run it through a crypto-signing
+ * function, which will (at least w/RSA) do a hash-'n'-private-encrypt
+ * operation. This seems a bit odd, but that's the spec. Also note that
+ * the data structures do not leave anywhere to independently specify the
+ * algorithm used for the initial hash. So, we look at the
+ * signature-specification algorithm, and try to do something intelligent.
+ * -- Kathy Weinhold, CertCo
+ */
+ /*
+ * Note 2: It seems that the mentioned passage from RFC 2560 (section
+ * 4.2.1) is open for interpretation. I've done tests against another
+ * responder, and found that it doesn't do the double hashing that the RFC
+ * seems to say one should. Therefore, all relevant functions take a flag
+ * saying which variant should be used. -- Richard Levitte, OpenSSL team
+ * and CeloCom
+ */
+typedef struct ocsp_basic_response_st {
+ OCSP_RESPDATA *tbsResponseData;
+ X509_ALGOR *signatureAlgorithm;
+ ASN1_BIT_STRING *signature;
+ STACK_OF(X509) *certs;
+} OCSP_BASICRESP;
+
+/*-
+ * CRLReason ::= ENUMERATED {
+ * unspecified (0),
+ * keyCompromise (1),
+ * cACompromise (2),
+ * affiliationChanged (3),
+ * superseded (4),
+ * cessationOfOperation (5),
+ * certificateHold (6),
+ * removeFromCRL (8) }
+ */
+# define OCSP_REVOKED_STATUS_NOSTATUS -1
+# define OCSP_REVOKED_STATUS_UNSPECIFIED 0
+# define OCSP_REVOKED_STATUS_KEYCOMPROMISE 1
+# define OCSP_REVOKED_STATUS_CACOMPROMISE 2
+# define OCSP_REVOKED_STATUS_AFFILIATIONCHANGED 3
+# define OCSP_REVOKED_STATUS_SUPERSEDED 4
+# define OCSP_REVOKED_STATUS_CESSATIONOFOPERATION 5
+# define OCSP_REVOKED_STATUS_CERTIFICATEHOLD 6
+# define OCSP_REVOKED_STATUS_REMOVEFROMCRL 8
+
+/*-
+ * CrlID ::= SEQUENCE {
+ * crlUrl [0] EXPLICIT IA5String OPTIONAL,
+ * crlNum [1] EXPLICIT INTEGER OPTIONAL,
+ * crlTime [2] EXPLICIT GeneralizedTime OPTIONAL }
+ */
+typedef struct ocsp_crl_id_st {
+ ASN1_IA5STRING *crlUrl;
+ ASN1_INTEGER *crlNum;
+ ASN1_GENERALIZEDTIME *crlTime;
+} OCSP_CRLID;
+
+/*-
+ * ServiceLocator ::= SEQUENCE {
+ * issuer Name,
+ * locator AuthorityInfoAccessSyntax OPTIONAL }
+ */
+typedef struct ocsp_service_locator_st {
+ X509_NAME *issuer;
+ STACK_OF(ACCESS_DESCRIPTION) *locator;
+} OCSP_SERVICELOC;
+
+# define PEM_STRING_OCSP_REQUEST "OCSP REQUEST"
+# define PEM_STRING_OCSP_RESPONSE "OCSP RESPONSE"
+
+# define d2i_OCSP_REQUEST_bio(bp,p) ASN1_d2i_bio_of(OCSP_REQUEST,OCSP_REQUEST_new,d2i_OCSP_REQUEST,bp,p)
+
+# define d2i_OCSP_RESPONSE_bio(bp,p) ASN1_d2i_bio_of(OCSP_RESPONSE,OCSP_RESPONSE_new,d2i_OCSP_RESPONSE,bp,p)
+
+# define PEM_read_bio_OCSP_REQUEST(bp,x,cb) (OCSP_REQUEST *)PEM_ASN1_read_bio( \
+ (char *(*)())d2i_OCSP_REQUEST,PEM_STRING_OCSP_REQUEST,bp,(char **)x,cb,NULL)
+
+# define PEM_read_bio_OCSP_RESPONSE(bp,x,cb)(OCSP_RESPONSE *)PEM_ASN1_read_bio(\
+ (char *(*)())d2i_OCSP_RESPONSE,PEM_STRING_OCSP_RESPONSE,bp,(char **)x,cb,NULL)
+
+# define PEM_write_bio_OCSP_REQUEST(bp,o) \
+ PEM_ASN1_write_bio((int (*)())i2d_OCSP_REQUEST,PEM_STRING_OCSP_REQUEST,\
+ bp,(char *)o, NULL,NULL,0,NULL,NULL)
+
+# define PEM_write_bio_OCSP_RESPONSE(bp,o) \
+ PEM_ASN1_write_bio((int (*)())i2d_OCSP_RESPONSE,PEM_STRING_OCSP_RESPONSE,\
+ bp,(char *)o, NULL,NULL,0,NULL,NULL)
+
+# define i2d_OCSP_RESPONSE_bio(bp,o) ASN1_i2d_bio_of(OCSP_RESPONSE,i2d_OCSP_RESPONSE,bp,o)
+
+# define i2d_OCSP_REQUEST_bio(bp,o) ASN1_i2d_bio_of(OCSP_REQUEST,i2d_OCSP_REQUEST,bp,o)
+
+# define OCSP_REQUEST_sign(o,pkey,md) \
+ ASN1_item_sign(ASN1_ITEM_rptr(OCSP_REQINFO),\
+ o->optionalSignature->signatureAlgorithm,NULL,\
+ o->optionalSignature->signature,o->tbsRequest,pkey,md)
+
+# define OCSP_BASICRESP_sign(o,pkey,md,d) \
+ ASN1_item_sign(ASN1_ITEM_rptr(OCSP_RESPDATA),o->signatureAlgorithm,NULL,\
+ o->signature,o->tbsResponseData,pkey,md)
+
+# define OCSP_REQUEST_verify(a,r) ASN1_item_verify(ASN1_ITEM_rptr(OCSP_REQINFO),\
+ a->optionalSignature->signatureAlgorithm,\
+ a->optionalSignature->signature,a->tbsRequest,r)
+
+# define OCSP_BASICRESP_verify(a,r,d) ASN1_item_verify(ASN1_ITEM_rptr(OCSP_RESPDATA),\
+ a->signatureAlgorithm,a->signature,a->tbsResponseData,r)
+
+# define ASN1_BIT_STRING_digest(data,type,md,len) \
+ ASN1_item_digest(ASN1_ITEM_rptr(ASN1_BIT_STRING),type,data,md,len)
+
+# define OCSP_CERTSTATUS_dup(cs)\
+ (OCSP_CERTSTATUS*)ASN1_dup((int(*)())i2d_OCSP_CERTSTATUS,\
+ (char *(*)())d2i_OCSP_CERTSTATUS,(char *)(cs))
+
+OCSP_CERTID *OCSP_CERTID_dup(OCSP_CERTID *id);
+
+OCSP_RESPONSE *OCSP_sendreq_bio(BIO *b, const char *path, OCSP_REQUEST *req);
+OCSP_REQ_CTX *OCSP_sendreq_new(BIO *io, const char *path, OCSP_REQUEST *req,
+ int maxline);
+int OCSP_REQ_CTX_nbio(OCSP_REQ_CTX *rctx);
+int OCSP_sendreq_nbio(OCSP_RESPONSE **presp, OCSP_REQ_CTX *rctx);
+OCSP_REQ_CTX *OCSP_REQ_CTX_new(BIO *io, int maxline);
+void OCSP_REQ_CTX_free(OCSP_REQ_CTX *rctx);
+void OCSP_set_max_response_length(OCSP_REQ_CTX *rctx, unsigned long len);
+int OCSP_REQ_CTX_i2d(OCSP_REQ_CTX *rctx, const ASN1_ITEM *it,
+ ASN1_VALUE *val);
+int OCSP_REQ_CTX_nbio_d2i(OCSP_REQ_CTX *rctx, ASN1_VALUE **pval,
+ const ASN1_ITEM *it);
+BIO *OCSP_REQ_CTX_get0_mem_bio(OCSP_REQ_CTX *rctx);
+int OCSP_REQ_CTX_i2d(OCSP_REQ_CTX *rctx, const ASN1_ITEM *it,
+ ASN1_VALUE *val);
+int OCSP_REQ_CTX_http(OCSP_REQ_CTX *rctx, const char *op, const char *path);
+int OCSP_REQ_CTX_set1_req(OCSP_REQ_CTX *rctx, OCSP_REQUEST *req);
+int OCSP_REQ_CTX_add1_header(OCSP_REQ_CTX *rctx,
+ const char *name, const char *value);
+
+OCSP_CERTID *OCSP_cert_to_id(const EVP_MD *dgst, X509 *subject, X509 *issuer);
+
+OCSP_CERTID *OCSP_cert_id_new(const EVP_MD *dgst,
+ X509_NAME *issuerName,
+ ASN1_BIT_STRING *issuerKey,
+ ASN1_INTEGER *serialNumber);
+
+OCSP_ONEREQ *OCSP_request_add0_id(OCSP_REQUEST *req, OCSP_CERTID *cid);
+
+int OCSP_request_add1_nonce(OCSP_REQUEST *req, unsigned char *val, int len);
+int OCSP_basic_add1_nonce(OCSP_BASICRESP *resp, unsigned char *val, int len);
+int OCSP_check_nonce(OCSP_REQUEST *req, OCSP_BASICRESP *bs);
+int OCSP_copy_nonce(OCSP_BASICRESP *resp, OCSP_REQUEST *req);
+
+int OCSP_request_set1_name(OCSP_REQUEST *req, X509_NAME *nm);
+int OCSP_request_add1_cert(OCSP_REQUEST *req, X509 *cert);
+
+int OCSP_request_sign(OCSP_REQUEST *req,
+ X509 *signer,
+ EVP_PKEY *key,
+ const EVP_MD *dgst,
+ STACK_OF(X509) *certs, unsigned long flags);
+
+int OCSP_response_status(OCSP_RESPONSE *resp);
+OCSP_BASICRESP *OCSP_response_get1_basic(OCSP_RESPONSE *resp);
+
+int OCSP_resp_count(OCSP_BASICRESP *bs);
+OCSP_SINGLERESP *OCSP_resp_get0(OCSP_BASICRESP *bs, int idx);
+int OCSP_resp_find(OCSP_BASICRESP *bs, OCSP_CERTID *id, int last);
+int OCSP_single_get0_status(OCSP_SINGLERESP *single, int *reason,
+ ASN1_GENERALIZEDTIME **revtime,
+ ASN1_GENERALIZEDTIME **thisupd,
+ ASN1_GENERALIZEDTIME **nextupd);
+int OCSP_resp_find_status(OCSP_BASICRESP *bs, OCSP_CERTID *id, int *status,
+ int *reason,
+ ASN1_GENERALIZEDTIME **revtime,
+ ASN1_GENERALIZEDTIME **thisupd,
+ ASN1_GENERALIZEDTIME **nextupd);
+int OCSP_check_validity(ASN1_GENERALIZEDTIME *thisupd,
+ ASN1_GENERALIZEDTIME *nextupd, long sec, long maxsec);
+
+int OCSP_request_verify(OCSP_REQUEST *req, STACK_OF(X509) *certs,
+ X509_STORE *store, unsigned long flags);
+
+int OCSP_parse_url(const char *url, char **phost, char **pport, char **ppath,
+ int *pssl);
+
+int OCSP_id_issuer_cmp(OCSP_CERTID *a, OCSP_CERTID *b);
+int OCSP_id_cmp(OCSP_CERTID *a, OCSP_CERTID *b);
+
+int OCSP_request_onereq_count(OCSP_REQUEST *req);
+OCSP_ONEREQ *OCSP_request_onereq_get0(OCSP_REQUEST *req, int i);
+OCSP_CERTID *OCSP_onereq_get0_id(OCSP_ONEREQ *one);
+int OCSP_id_get0_info(ASN1_OCTET_STRING **piNameHash, ASN1_OBJECT **pmd,
+ ASN1_OCTET_STRING **pikeyHash,
+ ASN1_INTEGER **pserial, OCSP_CERTID *cid);
+int OCSP_request_is_signed(OCSP_REQUEST *req);
+OCSP_RESPONSE *OCSP_response_create(int status, OCSP_BASICRESP *bs);
+OCSP_SINGLERESP *OCSP_basic_add1_status(OCSP_BASICRESP *rsp,
+ OCSP_CERTID *cid,
+ int status, int reason,
+ ASN1_TIME *revtime,
+ ASN1_TIME *thisupd,
+ ASN1_TIME *nextupd);
+int OCSP_basic_add1_cert(OCSP_BASICRESP *resp, X509 *cert);
+int OCSP_basic_sign(OCSP_BASICRESP *brsp,
+ X509 *signer, EVP_PKEY *key, const EVP_MD *dgst,
+ STACK_OF(X509) *certs, unsigned long flags);
+
+X509_EXTENSION *OCSP_crlID_new(char *url, long *n, char *tim);
+
+X509_EXTENSION *OCSP_accept_responses_new(char **oids);
+
+X509_EXTENSION *OCSP_archive_cutoff_new(char *tim);
+
+X509_EXTENSION *OCSP_url_svcloc_new(X509_NAME *issuer, char **urls);
+
+int OCSP_REQUEST_get_ext_count(OCSP_REQUEST *x);
+int OCSP_REQUEST_get_ext_by_NID(OCSP_REQUEST *x, int nid, int lastpos);
+int OCSP_REQUEST_get_ext_by_OBJ(OCSP_REQUEST *x, ASN1_OBJECT *obj,
+ int lastpos);
+int OCSP_REQUEST_get_ext_by_critical(OCSP_REQUEST *x, int crit, int lastpos);
+X509_EXTENSION *OCSP_REQUEST_get_ext(OCSP_REQUEST *x, int loc);
+X509_EXTENSION *OCSP_REQUEST_delete_ext(OCSP_REQUEST *x, int loc);
+void *OCSP_REQUEST_get1_ext_d2i(OCSP_REQUEST *x, int nid, int *crit,
+ int *idx);
+int OCSP_REQUEST_add1_ext_i2d(OCSP_REQUEST *x, int nid, void *value, int crit,
+ unsigned long flags);
+int OCSP_REQUEST_add_ext(OCSP_REQUEST *x, X509_EXTENSION *ex, int loc);
+
+int OCSP_ONEREQ_get_ext_count(OCSP_ONEREQ *x);
+int OCSP_ONEREQ_get_ext_by_NID(OCSP_ONEREQ *x, int nid, int lastpos);
+int OCSP_ONEREQ_get_ext_by_OBJ(OCSP_ONEREQ *x, ASN1_OBJECT *obj, int lastpos);
+int OCSP_ONEREQ_get_ext_by_critical(OCSP_ONEREQ *x, int crit, int lastpos);
+X509_EXTENSION *OCSP_ONEREQ_get_ext(OCSP_ONEREQ *x, int loc);
+X509_EXTENSION *OCSP_ONEREQ_delete_ext(OCSP_ONEREQ *x, int loc);
+void *OCSP_ONEREQ_get1_ext_d2i(OCSP_ONEREQ *x, int nid, int *crit, int *idx);
+int OCSP_ONEREQ_add1_ext_i2d(OCSP_ONEREQ *x, int nid, void *value, int crit,
+ unsigned long flags);
+int OCSP_ONEREQ_add_ext(OCSP_ONEREQ *x, X509_EXTENSION *ex, int loc);
+
+int OCSP_BASICRESP_get_ext_count(OCSP_BASICRESP *x);
+int OCSP_BASICRESP_get_ext_by_NID(OCSP_BASICRESP *x, int nid, int lastpos);
+int OCSP_BASICRESP_get_ext_by_OBJ(OCSP_BASICRESP *x, ASN1_OBJECT *obj,
+ int lastpos);
+int OCSP_BASICRESP_get_ext_by_critical(OCSP_BASICRESP *x, int crit,
+ int lastpos);
+X509_EXTENSION *OCSP_BASICRESP_get_ext(OCSP_BASICRESP *x, int loc);
+X509_EXTENSION *OCSP_BASICRESP_delete_ext(OCSP_BASICRESP *x, int loc);
+void *OCSP_BASICRESP_get1_ext_d2i(OCSP_BASICRESP *x, int nid, int *crit,
+ int *idx);
+int OCSP_BASICRESP_add1_ext_i2d(OCSP_BASICRESP *x, int nid, void *value,
+ int crit, unsigned long flags);
+int OCSP_BASICRESP_add_ext(OCSP_BASICRESP *x, X509_EXTENSION *ex, int loc);
+
+int OCSP_SINGLERESP_get_ext_count(OCSP_SINGLERESP *x);
+int OCSP_SINGLERESP_get_ext_by_NID(OCSP_SINGLERESP *x, int nid, int lastpos);
+int OCSP_SINGLERESP_get_ext_by_OBJ(OCSP_SINGLERESP *x, ASN1_OBJECT *obj,
+ int lastpos);
+int OCSP_SINGLERESP_get_ext_by_critical(OCSP_SINGLERESP *x, int crit,
+ int lastpos);
+X509_EXTENSION *OCSP_SINGLERESP_get_ext(OCSP_SINGLERESP *x, int loc);
+X509_EXTENSION *OCSP_SINGLERESP_delete_ext(OCSP_SINGLERESP *x, int loc);
+void *OCSP_SINGLERESP_get1_ext_d2i(OCSP_SINGLERESP *x, int nid, int *crit,
+ int *idx);
+int OCSP_SINGLERESP_add1_ext_i2d(OCSP_SINGLERESP *x, int nid, void *value,
+ int crit, unsigned long flags);
+int OCSP_SINGLERESP_add_ext(OCSP_SINGLERESP *x, X509_EXTENSION *ex, int loc);
+
+DECLARE_ASN1_FUNCTIONS(OCSP_SINGLERESP)
+DECLARE_ASN1_FUNCTIONS(OCSP_CERTSTATUS)
+DECLARE_ASN1_FUNCTIONS(OCSP_REVOKEDINFO)
+DECLARE_ASN1_FUNCTIONS(OCSP_BASICRESP)
+DECLARE_ASN1_FUNCTIONS(OCSP_RESPDATA)
+DECLARE_ASN1_FUNCTIONS(OCSP_RESPID)
+DECLARE_ASN1_FUNCTIONS(OCSP_RESPONSE)
+DECLARE_ASN1_FUNCTIONS(OCSP_RESPBYTES)
+DECLARE_ASN1_FUNCTIONS(OCSP_ONEREQ)
+DECLARE_ASN1_FUNCTIONS(OCSP_CERTID)
+DECLARE_ASN1_FUNCTIONS(OCSP_REQUEST)
+DECLARE_ASN1_FUNCTIONS(OCSP_SIGNATURE)
+DECLARE_ASN1_FUNCTIONS(OCSP_REQINFO)
+DECLARE_ASN1_FUNCTIONS(OCSP_CRLID)
+DECLARE_ASN1_FUNCTIONS(OCSP_SERVICELOC)
+
+const char *OCSP_response_status_str(long s);
+const char *OCSP_cert_status_str(long s);
+const char *OCSP_crl_reason_str(long s);
+
+int OCSP_REQUEST_print(BIO *bp, OCSP_REQUEST *a, unsigned long flags);
+int OCSP_RESPONSE_print(BIO *bp, OCSP_RESPONSE *o, unsigned long flags);
+
+int OCSP_basic_verify(OCSP_BASICRESP *bs, STACK_OF(X509) *certs,
+ X509_STORE *st, unsigned long flags);
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_OCSP_strings(void);
+
+/* Error codes for the OCSP functions. */
+
+/* Function codes. */
+# define OCSP_F_ASN1_STRING_ENCODE 100
+# define OCSP_F_D2I_OCSP_NONCE 102
+# define OCSP_F_OCSP_BASIC_ADD1_STATUS 103
+# define OCSP_F_OCSP_BASIC_SIGN 104
+# define OCSP_F_OCSP_BASIC_VERIFY 105
+# define OCSP_F_OCSP_CERT_ID_NEW 101
+# define OCSP_F_OCSP_CHECK_DELEGATED 106
+# define OCSP_F_OCSP_CHECK_IDS 107
+# define OCSP_F_OCSP_CHECK_ISSUER 108
+# define OCSP_F_OCSP_CHECK_VALIDITY 115
+# define OCSP_F_OCSP_MATCH_ISSUERID 109
+# define OCSP_F_OCSP_PARSE_URL 114
+# define OCSP_F_OCSP_REQUEST_SIGN 110
+# define OCSP_F_OCSP_REQUEST_VERIFY 116
+# define OCSP_F_OCSP_RESPONSE_GET1_BASIC 111
+# define OCSP_F_OCSP_SENDREQ_BIO 112
+# define OCSP_F_OCSP_SENDREQ_NBIO 117
+# define OCSP_F_PARSE_HTTP_LINE1 118
+# define OCSP_F_REQUEST_VERIFY 113
+
+/* Reason codes. */
+# define OCSP_R_BAD_DATA 100
+# define OCSP_R_CERTIFICATE_VERIFY_ERROR 101
+# define OCSP_R_DIGEST_ERR 102
+# define OCSP_R_ERROR_IN_NEXTUPDATE_FIELD 122
+# define OCSP_R_ERROR_IN_THISUPDATE_FIELD 123
+# define OCSP_R_ERROR_PARSING_URL 121
+# define OCSP_R_MISSING_OCSPSIGNING_USAGE 103
+# define OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE 124
+# define OCSP_R_NOT_BASIC_RESPONSE 104
+# define OCSP_R_NO_CERTIFICATES_IN_CHAIN 105
+# define OCSP_R_NO_CONTENT 106
+# define OCSP_R_NO_PUBLIC_KEY 107
+# define OCSP_R_NO_RESPONSE_DATA 108
+# define OCSP_R_NO_REVOKED_TIME 109
+# define OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 110
+# define OCSP_R_REQUEST_NOT_SIGNED 128
+# define OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA 111
+# define OCSP_R_ROOT_CA_NOT_TRUSTED 112
+# define OCSP_R_SERVER_READ_ERROR 113
+# define OCSP_R_SERVER_RESPONSE_ERROR 114
+# define OCSP_R_SERVER_RESPONSE_PARSE_ERROR 115
+# define OCSP_R_SERVER_WRITE_ERROR 116
+# define OCSP_R_SIGNATURE_FAILURE 117
+# define OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND 118
+# define OCSP_R_STATUS_EXPIRED 125
+# define OCSP_R_STATUS_NOT_YET_VALID 126
+# define OCSP_R_STATUS_TOO_OLD 127
+# define OCSP_R_UNKNOWN_MESSAGE_DIGEST 119
+# define OCSP_R_UNKNOWN_NID 120
+# define OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE 129
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/deps/openssl/openssl/include/openssl/opensslv.h b/deps/openssl/openssl/include/openssl/opensslv.h
index c39a0c3882d..c06b13ac6b0 100644
--- a/deps/openssl/openssl/include/openssl/opensslv.h
+++ b/deps/openssl/openssl/include/openssl/opensslv.h
@@ -1 +1,97 @@
-#include "../../crypto/opensslv.h"
+#ifndef HEADER_OPENSSLV_H
+# define HEADER_OPENSSLV_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*-
+ * Numeric release version identifier:
+ * MNNFFPPS: major minor fix patch status
+ * The status nibble has one of the values 0 for development, 1 to e for betas
+ * 1 to 14, and f for release. The patch level is exactly that.
+ * For example:
+ * 0.9.3-dev 0x00903000
+ * 0.9.3-beta1 0x00903001
+ * 0.9.3-beta2-dev 0x00903002
+ * 0.9.3-beta2 0x00903002 (same as ...beta2-dev)
+ * 0.9.3 0x0090300f
+ * 0.9.3a 0x0090301f
+ * 0.9.4 0x0090400f
+ * 1.2.3z 0x102031af
+ *
+ * For continuity reasons (because 0.9.5 is already out, and is coded
+ * 0x00905100), between 0.9.5 and 0.9.6 the coding of the patch level
+ * part is slightly different, by setting the highest bit. This means
+ * that 0.9.5a looks like this: 0x0090581f. At 0.9.6, we can start
+ * with 0x0090600S...
+ *
+ * (Prior to 0.9.3-dev a different scheme was used: 0.9.2b is 0x0922.)
+ * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for
+ * major minor fix final patch/beta)
+ */
+# define OPENSSL_VERSION_NUMBER 0x1000204fL
+# ifdef OPENSSL_FIPS
+# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2d-fips 9 Jul 2015"
+# else
+# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2d 9 Jul 2015"
+# endif
+# define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT
+
+/*-
+ * The macros below are to be used for shared library (.so, .dll, ...)
+ * versioning. That kind of versioning works a bit differently between
+ * operating systems. The most usual scheme is to set a major and a minor
+ * number, and have the runtime loader check that the major number is equal
+ * to what it was at application link time, while the minor number has to
+ * be greater or equal to what it was at application link time. With this
+ * scheme, the version number is usually part of the file name, like this:
+ *
+ * libcrypto.so.0.9
+ *
+ * Some unixen also make a softlink with the major verson number only:
+ *
+ * libcrypto.so.0
+ *
+ * On Tru64 and IRIX 6.x it works a little bit differently. There, the
+ * shared library version is stored in the file, and is actually a series
+ * of versions, separated by colons. The rightmost version present in the
+ * library when linking an application is stored in the application to be
+ * matched at run time. When the application is run, a check is done to
+ * see if the library version stored in the application matches any of the
+ * versions in the version string of the library itself.
+ * This version string can be constructed in any way, depending on what
+ * kind of matching is desired. However, to implement the same scheme as
+ * the one used in the other unixen, all compatible versions, from lowest
+ * to highest, should be part of the string. Consecutive builds would
+ * give the following versions strings:
+ *
+ * 3.0
+ * 3.0:3.1
+ * 3.0:3.1:3.2
+ * 4.0
+ * 4.0:4.1
+ *
+ * Notice how version 4 is completely incompatible with version, and
+ * therefore give the breach you can see.
+ *
+ * There may be other schemes as well that I haven't yet discovered.
+ *
+ * So, here's the way it works here: first of all, the library version
+ * number doesn't need at all to match the overall OpenSSL version.
+ * However, it's nice and more understandable if it actually does.
+ * The current library version is stored in the macro SHLIB_VERSION_NUMBER,
+ * which is just a piece of text in the format "M.m.e" (Major, minor, edit).
+ * For the sake of Tru64, IRIX, and any other OS that behaves in similar ways,
+ * we need to keep a history of version numbers, which is done in the
+ * macro SHLIB_VERSION_HISTORY. The numbers are separated by colons and
+ * should only keep the versions that are binary compatible with the current.
+ */
+# define SHLIB_VERSION_HISTORY ""
+# define SHLIB_VERSION_NUMBER "1.0.0"
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* HEADER_OPENSSLV_H */
diff --git a/deps/openssl/openssl/include/openssl/ossl_typ.h b/deps/openssl/openssl/include/openssl/ossl_typ.h
index ddd7e580dd6..9144ea2cf60 100644
--- a/deps/openssl/openssl/include/openssl/ossl_typ.h
+++ b/deps/openssl/openssl/include/openssl/ossl_typ.h
@@ -1 +1,211 @@
-#include "../../crypto/ossl_typ.h"
+/* ====================================================================
+ * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+#ifndef HEADER_OPENSSL_TYPES_H
+# define HEADER_OPENSSL_TYPES_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# include <openssl/e_os2.h>
+
+# ifdef NO_ASN1_TYPEDEFS
+# define ASN1_INTEGER ASN1_STRING
+# define ASN1_ENUMERATED ASN1_STRING
+# define ASN1_BIT_STRING ASN1_STRING
+# define ASN1_OCTET_STRING ASN1_STRING
+# define ASN1_PRINTABLESTRING ASN1_STRING
+# define ASN1_T61STRING ASN1_STRING
+# define ASN1_IA5STRING ASN1_STRING
+# define ASN1_UTCTIME ASN1_STRING
+# define ASN1_GENERALIZEDTIME ASN1_STRING
+# define ASN1_TIME ASN1_STRING
+# define ASN1_GENERALSTRING ASN1_STRING
+# define ASN1_UNIVERSALSTRING ASN1_STRING
+# define ASN1_BMPSTRING ASN1_STRING
+# define ASN1_VISIBLESTRING ASN1_STRING
+# define ASN1_UTF8STRING ASN1_STRING
+# define ASN1_BOOLEAN int
+# define ASN1_NULL int
+# else
+typedef struct asn1_string_st ASN1_INTEGER;
+typedef struct asn1_string_st ASN1_ENUMERATED;
+typedef struct asn1_string_st ASN1_BIT_STRING;
+typedef struct asn1_string_st ASN1_OCTET_STRING;
+typedef struct asn1_string_st ASN1_PRINTABLESTRING;
+typedef struct asn1_string_st ASN1_T61STRING;
+typedef struct asn1_string_st ASN1_IA5STRING;
+typedef struct asn1_string_st ASN1_GENERALSTRING;
+typedef struct asn1_string_st ASN1_UNIVERSALSTRING;
+typedef struct asn1_string_st ASN1_BMPSTRING;
+typedef struct asn1_string_st ASN1_UTCTIME;
+typedef struct asn1_string_st ASN1_TIME;
+typedef struct asn1_string_st ASN1_GENERALIZEDTIME;
+typedef struct asn1_string_st ASN1_VISIBLESTRING;
+typedef struct asn1_string_st ASN1_UTF8STRING;
+typedef struct asn1_string_st ASN1_STRING;
+typedef int ASN1_BOOLEAN;
+typedef int ASN1_NULL;
+# endif
+
+typedef struct asn1_object_st ASN1_OBJECT;
+
+typedef struct ASN1_ITEM_st ASN1_ITEM;
+typedef struct asn1_pctx_st ASN1_PCTX;
+
+# ifdef OPENSSL_SYS_WIN32
+# undef X509_NAME
+# undef X509_EXTENSIONS
+# undef X509_CERT_PAIR
+# undef PKCS7_ISSUER_AND_SERIAL
+# undef OCSP_REQUEST
+# undef OCSP_RESPONSE
+# endif
+
+# ifdef BIGNUM
+# undef BIGNUM
+# endif
+typedef struct bignum_st BIGNUM;
+typedef struct bignum_ctx BN_CTX;
+typedef struct bn_blinding_st BN_BLINDING;
+typedef struct bn_mont_ctx_st BN_MONT_CTX;
+typedef struct bn_recp_ctx_st BN_RECP_CTX;
+typedef struct bn_gencb_st BN_GENCB;
+
+typedef struct buf_mem_st BUF_MEM;
+
+typedef struct evp_cipher_st EVP_CIPHER;
+typedef struct evp_cipher_ctx_st EVP_CIPHER_CTX;
+typedef struct env_md_st EVP_MD;
+typedef struct env_md_ctx_st EVP_MD_CTX;
+typedef struct evp_pkey_st EVP_PKEY;
+
+typedef struct evp_pkey_asn1_method_st EVP_PKEY_ASN1_METHOD;
+
+typedef struct evp_pkey_method_st EVP_PKEY_METHOD;
+typedef struct evp_pkey_ctx_st EVP_PKEY_CTX;
+
+typedef struct dh_st DH;
+typedef struct dh_method DH_METHOD;
+
+typedef struct dsa_st DSA;
+typedef struct dsa_method DSA_METHOD;
+
+typedef struct rsa_st RSA;
+typedef struct rsa_meth_st RSA_METHOD;
+
+typedef struct rand_meth_st RAND_METHOD;
+
+typedef struct ecdh_method ECDH_METHOD;
+typedef struct ecdsa_method ECDSA_METHOD;
+
+typedef struct x509_st X509;
+typedef struct X509_algor_st X509_ALGOR;
+typedef struct X509_crl_st X509_CRL;
+typedef struct x509_crl_method_st X509_CRL_METHOD;
+typedef struct x509_revoked_st X509_REVOKED;
+typedef struct X509_name_st X509_NAME;
+typedef struct X509_pubkey_st X509_PUBKEY;
+typedef struct x509_store_st X509_STORE;
+typedef struct x509_store_ctx_st X509_STORE_CTX;
+
+typedef struct pkcs8_priv_key_info_st PKCS8_PRIV_KEY_INFO;
+
+typedef struct v3_ext_ctx X509V3_CTX;
+typedef struct conf_st CONF;
+
+typedef struct store_st STORE;
+typedef struct store_method_st STORE_METHOD;
+
+typedef struct ui_st UI;
+typedef struct ui_method_st UI_METHOD;
+
+typedef struct st_ERR_FNS ERR_FNS;
+
+typedef struct engine_st ENGINE;
+typedef struct ssl_st SSL;
+typedef struct ssl_ctx_st SSL_CTX;
+
+typedef struct X509_POLICY_NODE_st X509_POLICY_NODE;
+typedef struct X509_POLICY_LEVEL_st X509_POLICY_LEVEL;
+typedef struct X509_POLICY_TREE_st X509_POLICY_TREE;
+typedef struct X509_POLICY_CACHE_st X509_POLICY_CACHE;
+
+typedef struct AUTHORITY_KEYID_st AUTHORITY_KEYID;
+typedef struct DIST_POINT_st DIST_POINT;
+typedef struct ISSUING_DIST_POINT_st ISSUING_DIST_POINT;
+typedef struct NAME_CONSTRAINTS_st NAME_CONSTRAINTS;
+
+ /* If placed in pkcs12.h, we end up with a circular depency with pkcs7.h */
+# define DECLARE_PKCS12_STACK_OF(type)/* Nothing */
+# define IMPLEMENT_PKCS12_STACK_OF(type)/* Nothing */
+
+typedef struct crypto_ex_data_st CRYPTO_EX_DATA;
+/* Callback types for crypto.h */
+typedef int CRYPTO_EX_new (void *parent, void *ptr, CRYPTO_EX_DATA *ad,
+ int idx, long argl, void *argp);
+typedef void CRYPTO_EX_free (void *parent, void *ptr, CRYPTO_EX_DATA *ad,
+ int idx, long argl, void *argp);
+typedef int CRYPTO_EX_dup (CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from,
+ void *from_d, int idx, long argl, void *argp);
+
+typedef struct ocsp_req_ctx_st OCSP_REQ_CTX;
+typedef struct ocsp_response_st OCSP_RESPONSE;
+typedef struct ocsp_responder_id_st OCSP_RESPID;
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* def HEADER_OPENSSL_TYPES_H */
diff --git a/deps/openssl/openssl/include/openssl/pem.h b/deps/openssl/openssl/include/openssl/pem.h
index 5bcc5c59eed..d3b23fc997d 100644
--- a/deps/openssl/openssl/include/openssl/pem.h
+++ b/deps/openssl/openssl/include/openssl/pem.h
@@ -1 +1,615 @@
-#include "../../crypto/pem/pem.h"
+/* crypto/pem/pem.h */
+/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_PEM_H
+# define HEADER_PEM_H
+
+# include <openssl/e_os2.h>
+# ifndef OPENSSL_NO_BIO
+# include <openssl/bio.h>
+# endif
+# ifndef OPENSSL_NO_STACK
+# include <openssl/stack.h>
+# endif
+# include <openssl/evp.h>
+# include <openssl/x509.h>
+# include <openssl/pem2.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# define PEM_BUFSIZE 1024
+
+# define PEM_OBJ_UNDEF 0
+# define PEM_OBJ_X509 1
+# define PEM_OBJ_X509_REQ 2
+# define PEM_OBJ_CRL 3
+# define PEM_OBJ_SSL_SESSION 4
+# define PEM_OBJ_PRIV_KEY 10
+# define PEM_OBJ_PRIV_RSA 11
+# define PEM_OBJ_PRIV_DSA 12
+# define PEM_OBJ_PRIV_DH 13
+# define PEM_OBJ_PUB_RSA 14
+# define PEM_OBJ_PUB_DSA 15
+# define PEM_OBJ_PUB_DH 16
+# define PEM_OBJ_DHPARAMS 17
+# define PEM_OBJ_DSAPARAMS 18
+# define PEM_OBJ_PRIV_RSA_PUBLIC 19
+# define PEM_OBJ_PRIV_ECDSA 20
+# define PEM_OBJ_PUB_ECDSA 21
+# define PEM_OBJ_ECPARAMETERS 22
+
+# define PEM_ERROR 30
+# define PEM_DEK_DES_CBC 40
+# define PEM_DEK_IDEA_CBC 45
+# define PEM_DEK_DES_EDE 50
+# define PEM_DEK_DES_ECB 60
+# define PEM_DEK_RSA 70
+# define PEM_DEK_RSA_MD2 80
+# define PEM_DEK_RSA_MD5 90
+
+# define PEM_MD_MD2 NID_md2
+# define PEM_MD_MD5 NID_md5
+# define PEM_MD_SHA NID_sha
+# define PEM_MD_MD2_RSA NID_md2WithRSAEncryption
+# define PEM_MD_MD5_RSA NID_md5WithRSAEncryption
+# define PEM_MD_SHA_RSA NID_sha1WithRSAEncryption
+
+# define PEM_STRING_X509_OLD "X509 CERTIFICATE"
+# define PEM_STRING_X509 "CERTIFICATE"
+# define PEM_STRING_X509_PAIR "CERTIFICATE PAIR"
+# define PEM_STRING_X509_TRUSTED "TRUSTED CERTIFICATE"
+# define PEM_STRING_X509_REQ_OLD "NEW CERTIFICATE REQUEST"
+# define PEM_STRING_X509_REQ "CERTIFICATE REQUEST"
+# define PEM_STRING_X509_CRL "X509 CRL"
+# define PEM_STRING_EVP_PKEY "ANY PRIVATE KEY"
+# define PEM_STRING_PUBLIC "PUBLIC KEY"
+# define PEM_STRING_RSA "RSA PRIVATE KEY"
+# define PEM_STRING_RSA_PUBLIC "RSA PUBLIC KEY"
+# define PEM_STRING_DSA "DSA PRIVATE KEY"
+# define PEM_STRING_DSA_PUBLIC "DSA PUBLIC KEY"
+# define PEM_STRING_PKCS7 "PKCS7"
+# define PEM_STRING_PKCS7_SIGNED "PKCS #7 SIGNED DATA"
+# define PEM_STRING_PKCS8 "ENCRYPTED PRIVATE KEY"
+# define PEM_STRING_PKCS8INF "PRIVATE KEY"
+# define PEM_STRING_DHPARAMS "DH PARAMETERS"
+# define PEM_STRING_DHXPARAMS "X9.42 DH PARAMETERS"
+# define PEM_STRING_SSL_SESSION "SSL SESSION PARAMETERS"
+# define PEM_STRING_DSAPARAMS "DSA PARAMETERS"
+# define PEM_STRING_ECDSA_PUBLIC "ECDSA PUBLIC KEY"
+# define PEM_STRING_ECPARAMETERS "EC PARAMETERS"
+# define PEM_STRING_ECPRIVATEKEY "EC PRIVATE KEY"
+# define PEM_STRING_PARAMETERS "PARAMETERS"
+# define PEM_STRING_CMS "CMS"
+
+ /*
+ * Note that this structure is initialised by PEM_SealInit and cleaned up
+ * by PEM_SealFinal (at least for now)
+ */
+typedef struct PEM_Encode_Seal_st {
+ EVP_ENCODE_CTX encode;
+ EVP_MD_CTX md;
+ EVP_CIPHER_CTX cipher;
+} PEM_ENCODE_SEAL_CTX;
+
+/* enc_type is one off */
+# define PEM_TYPE_ENCRYPTED 10
+# define PEM_TYPE_MIC_ONLY 20
+# define PEM_TYPE_MIC_CLEAR 30
+# define PEM_TYPE_CLEAR 40
+
+typedef struct pem_recip_st {
+ char *name;
+ X509_NAME *dn;
+ int cipher;
+ int key_enc;
+ /* char iv[8]; unused and wrong size */
+} PEM_USER;
+
+typedef struct pem_ctx_st {
+ int type; /* what type of object */
+ struct {
+ int version;
+ int mode;
+ } proc_type;
+
+ char *domain;
+
+ struct {
+ int cipher;
+ /*-
+ unused, and wrong size
+ unsigned char iv[8]; */
+ } DEK_info;
+
+ PEM_USER *originator;
+
+ int num_recipient;
+ PEM_USER **recipient;
+/*-
+ XXX(ben): don#t think this is used!
+ STACK *x509_chain; / * certificate chain */
+ EVP_MD *md; /* signature type */
+
+ int md_enc; /* is the md encrypted or not? */
+ int md_len; /* length of md_data */
+ char *md_data; /* message digest, could be pkey encrypted */
+
+ EVP_CIPHER *dec; /* date encryption cipher */
+ int key_len; /* key length */
+ unsigned char *key; /* key */
+ /*-
+ unused, and wrong size
+ unsigned char iv[8]; */
+
+ int data_enc; /* is the data encrypted */
+ int data_len;
+ unsigned char *data;
+} PEM_CTX;
+
+/*
+ * These macros make the PEM_read/PEM_write functions easier to maintain and
+ * write. Now they are all implemented with either: IMPLEMENT_PEM_rw(...) or
+ * IMPLEMENT_PEM_rw_cb(...)
+ */
+
+# ifdef OPENSSL_NO_FP_API
+
+# define IMPLEMENT_PEM_read_fp(name, type, str, asn1) /**/
+# define IMPLEMENT_PEM_write_fp(name, type, str, asn1) /**/
+# define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) /**/
+# define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) /**/
+# define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) /**/
+# else
+
+# define IMPLEMENT_PEM_read_fp(name, type, str, asn1) \
+type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u)\
+{ \
+return PEM_ASN1_read((d2i_of_void *)d2i_##asn1, str,fp,(void **)x,cb,u); \
+}
+
+# define IMPLEMENT_PEM_write_fp(name, type, str, asn1) \
+int PEM_write_##name(FILE *fp, type *x) \
+{ \
+return PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,x,NULL,NULL,0,NULL,NULL); \
+}
+
+# define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) \
+int PEM_write_##name(FILE *fp, const type *x) \
+{ \
+return PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,(void *)x,NULL,NULL,0,NULL,NULL); \
+}
+
+# define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) \
+int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \
+ unsigned char *kstr, int klen, pem_password_cb *cb, \
+ void *u) \
+ { \
+ return PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,x,enc,kstr,klen,cb,u); \
+ }
+
+# define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) \
+int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \
+ unsigned char *kstr, int klen, pem_password_cb *cb, \
+ void *u) \
+ { \
+ return PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,x,enc,kstr,klen,cb,u); \
+ }
+
+# endif
+
+# define IMPLEMENT_PEM_read_bio(name, type, str, asn1) \
+type *PEM_read_bio_##name(BIO *bp, type **x, pem_password_cb *cb, void *u)\
+{ \
+return PEM_ASN1_read_bio((d2i_of_void *)d2i_##asn1, str,bp,(void **)x,cb,u); \
+}
+
+# define IMPLEMENT_PEM_write_bio(name, type, str, asn1) \
+int PEM_write_bio_##name(BIO *bp, type *x) \
+{ \
+return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,x,NULL,NULL,0,NULL,NULL); \
+}
+
+# define IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \
+int PEM_write_bio_##name(BIO *bp, const type *x) \
+{ \
+return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,(void *)x,NULL,NULL,0,NULL,NULL); \
+}
+
+# define IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \
+int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \
+ unsigned char *kstr, int klen, pem_password_cb *cb, void *u) \
+ { \
+ return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,x,enc,kstr,klen,cb,u); \
+ }
+
+# define IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \
+int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \
+ unsigned char *kstr, int klen, pem_password_cb *cb, void *u) \
+ { \
+ return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,(void *)x,enc,kstr,klen,cb,u); \
+ }
+
+# define IMPLEMENT_PEM_write(name, type, str, asn1) \
+ IMPLEMENT_PEM_write_bio(name, type, str, asn1) \
+ IMPLEMENT_PEM_write_fp(name, type, str, asn1)
+
+# define IMPLEMENT_PEM_write_const(name, type, str, asn1) \
+ IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \
+ IMPLEMENT_PEM_write_fp_const(name, type, str, asn1)
+
+# define IMPLEMENT_PEM_write_cb(name, type, str, asn1) \
+ IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \
+ IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1)
+
+# define IMPLEMENT_PEM_write_cb_const(name, type, str, asn1) \
+ IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \
+ IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1)
+
+# define IMPLEMENT_PEM_read(name, type, str, asn1) \
+ IMPLEMENT_PEM_read_bio(name, type, str, asn1) \
+ IMPLEMENT_PEM_read_fp(name, type, str, asn1)
+
+# define IMPLEMENT_PEM_rw(name, type, str, asn1) \
+ IMPLEMENT_PEM_read(name, type, str, asn1) \
+ IMPLEMENT_PEM_write(name, type, str, asn1)
+
+# define IMPLEMENT_PEM_rw_const(name, type, str, asn1) \
+ IMPLEMENT_PEM_read(name, type, str, asn1) \
+ IMPLEMENT_PEM_write_const(name, type, str, asn1)
+
+# define IMPLEMENT_PEM_rw_cb(name, type, str, asn1) \
+ IMPLEMENT_PEM_read(name, type, str, asn1) \
+ IMPLEMENT_PEM_write_cb(name, type, str, asn1)
+
+/* These are the same except they are for the declarations */
+
+# if defined(OPENSSL_NO_FP_API)
+
+# define DECLARE_PEM_read_fp(name, type) /**/
+# define DECLARE_PEM_write_fp(name, type) /**/
+# define DECLARE_PEM_write_cb_fp(name, type) /**/
+# else
+
+# define DECLARE_PEM_read_fp(name, type) \
+ type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u);
+
+# define DECLARE_PEM_write_fp(name, type) \
+ int PEM_write_##name(FILE *fp, type *x);
+
+# define DECLARE_PEM_write_fp_const(name, type) \
+ int PEM_write_##name(FILE *fp, const type *x);
+
+# define DECLARE_PEM_write_cb_fp(name, type) \
+ int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \
+ unsigned char *kstr, int klen, pem_password_cb *cb, void *u);
+
+# endif
+
+# ifndef OPENSSL_NO_BIO
+# define DECLARE_PEM_read_bio(name, type) \
+ type *PEM_read_bio_##name(BIO *bp, type **x, pem_password_cb *cb, void *u);
+
+# define DECLARE_PEM_write_bio(name, type) \
+ int PEM_write_bio_##name(BIO *bp, type *x);
+
+# define DECLARE_PEM_write_bio_const(name, type) \
+ int PEM_write_bio_##name(BIO *bp, const type *x);
+
+# define DECLARE_PEM_write_cb_bio(name, type) \
+ int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \
+ unsigned char *kstr, int klen, pem_password_cb *cb, void *u);
+
+# else
+
+# define DECLARE_PEM_read_bio(name, type) /**/
+# define DECLARE_PEM_write_bio(name, type) /**/
+# define DECLARE_PEM_write_bio_const(name, type) /**/
+# define DECLARE_PEM_write_cb_bio(name, type) /**/
+# endif
+# define DECLARE_PEM_write(name, type) \
+ DECLARE_PEM_write_bio(name, type) \
+ DECLARE_PEM_write_fp(name, type)
+# define DECLARE_PEM_write_const(name, type) \
+ DECLARE_PEM_write_bio_const(name, type) \
+ DECLARE_PEM_write_fp_const(name, type)
+# define DECLARE_PEM_write_cb(name, type) \
+ DECLARE_PEM_write_cb_bio(name, type) \
+ DECLARE_PEM_write_cb_fp(name, type)
+# define DECLARE_PEM_read(name, type) \
+ DECLARE_PEM_read_bio(name, type) \
+ DECLARE_PEM_read_fp(name, type)
+# define DECLARE_PEM_rw(name, type) \
+ DECLARE_PEM_read(name, type) \
+ DECLARE_PEM_write(name, type)
+# define DECLARE_PEM_rw_const(name, type) \
+ DECLARE_PEM_read(name, type) \
+ DECLARE_PEM_write_const(name, type)
+# define DECLARE_PEM_rw_cb(name, type) \
+ DECLARE_PEM_read(name, type) \
+ DECLARE_PEM_write_cb(name, type)
+# if 1
+/* "userdata": new with OpenSSL 0.9.4 */
+typedef int pem_password_cb (char *buf, int size, int rwflag, void *userdata);
+# else
+/* OpenSSL 0.9.3, 0.9.3a */
+typedef int pem_password_cb (char *buf, int size, int rwflag);
+# endif
+
+int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher);
+int PEM_do_header(EVP_CIPHER_INFO *cipher, unsigned char *data, long *len,
+ pem_password_cb *callback, void *u);
+
+# ifndef OPENSSL_NO_BIO
+int PEM_read_bio(BIO *bp, char **name, char **header,
+ unsigned char **data, long *len);
+int PEM_write_bio(BIO *bp, const char *name, const char *hdr,
+ const unsigned char *data, long len);
+int PEM_bytes_read_bio(unsigned char **pdata, long *plen, char **pnm,
+ const char *name, BIO *bp, pem_password_cb *cb,
+ void *u);
+void *PEM_ASN1_read_bio(d2i_of_void *d2i, const char *name, BIO *bp, void **x,
+ pem_password_cb *cb, void *u);
+int PEM_ASN1_write_bio(i2d_of_void *i2d, const char *name, BIO *bp, void *x,
+ const EVP_CIPHER *enc, unsigned char *kstr, int klen,
+ pem_password_cb *cb, void *u);
+
+STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk,
+ pem_password_cb *cb, void *u);
+int PEM_X509_INFO_write_bio(BIO *bp, X509_INFO *xi, EVP_CIPHER *enc,
+ unsigned char *kstr, int klen,
+ pem_password_cb *cd, void *u);
+# endif
+
+int PEM_read(FILE *fp, char **name, char **header,
+ unsigned char **data, long *len);
+int PEM_write(FILE *fp, const char *name, const char *hdr,
+ const unsigned char *data, long len);
+void *PEM_ASN1_read(d2i_of_void *d2i, const char *name, FILE *fp, void **x,
+ pem_password_cb *cb, void *u);
+int PEM_ASN1_write(i2d_of_void *i2d, const char *name, FILE *fp,
+ void *x, const EVP_CIPHER *enc, unsigned char *kstr,
+ int klen, pem_password_cb *callback, void *u);
+STACK_OF(X509_INFO) *PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk,
+ pem_password_cb *cb, void *u);
+
+int PEM_SealInit(PEM_ENCODE_SEAL_CTX *ctx, EVP_CIPHER *type,
+ EVP_MD *md_type, unsigned char **ek, int *ekl,
+ unsigned char *iv, EVP_PKEY **pubk, int npubk);
+void PEM_SealUpdate(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *out, int *outl,
+ unsigned char *in, int inl);
+int PEM_SealFinal(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *sig, int *sigl,
+ unsigned char *out, int *outl, EVP_PKEY *priv);
+
+void PEM_SignInit(EVP_MD_CTX *ctx, EVP_MD *type);
+void PEM_SignUpdate(EVP_MD_CTX *ctx, unsigned char *d, unsigned int cnt);
+int PEM_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret,
+ unsigned int *siglen, EVP_PKEY *pkey);
+
+int PEM_def_callback(char *buf, int num, int w, void *key);
+void PEM_proc_type(char *buf, int type);
+void PEM_dek_info(char *buf, const char *type, int len, char *str);
+
+# include <openssl/symhacks.h>
+
+DECLARE_PEM_rw(X509, X509)
+DECLARE_PEM_rw(X509_AUX, X509)
+DECLARE_PEM_rw(X509_CERT_PAIR, X509_CERT_PAIR)
+DECLARE_PEM_rw(X509_REQ, X509_REQ)
+DECLARE_PEM_write(X509_REQ_NEW, X509_REQ)
+DECLARE_PEM_rw(X509_CRL, X509_CRL)
+DECLARE_PEM_rw(PKCS7, PKCS7)
+DECLARE_PEM_rw(NETSCAPE_CERT_SEQUENCE, NETSCAPE_CERT_SEQUENCE)
+DECLARE_PEM_rw(PKCS8, X509_SIG)
+DECLARE_PEM_rw(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO)
+# ifndef OPENSSL_NO_RSA
+DECLARE_PEM_rw_cb(RSAPrivateKey, RSA)
+DECLARE_PEM_rw_const(RSAPublicKey, RSA)
+DECLARE_PEM_rw(RSA_PUBKEY, RSA)
+# endif
+# ifndef OPENSSL_NO_DSA
+DECLARE_PEM_rw_cb(DSAPrivateKey, DSA)
+DECLARE_PEM_rw(DSA_PUBKEY, DSA)
+DECLARE_PEM_rw_const(DSAparams, DSA)
+# endif
+# ifndef OPENSSL_NO_EC
+DECLARE_PEM_rw_const(ECPKParameters, EC_GROUP)
+DECLARE_PEM_rw_cb(ECPrivateKey, EC_KEY)
+DECLARE_PEM_rw(EC_PUBKEY, EC_KEY)
+# endif
+# ifndef OPENSSL_NO_DH
+DECLARE_PEM_rw_const(DHparams, DH)
+DECLARE_PEM_write_const(DHxparams, DH)
+# endif
+DECLARE_PEM_rw_cb(PrivateKey, EVP_PKEY)
+DECLARE_PEM_rw(PUBKEY, EVP_PKEY)
+
+int PEM_write_bio_PKCS8PrivateKey_nid(BIO *bp, EVP_PKEY *x, int nid,
+ char *kstr, int klen,
+ pem_password_cb *cb, void *u);
+int PEM_write_bio_PKCS8PrivateKey(BIO *, EVP_PKEY *, const EVP_CIPHER *,
+ char *, int, pem_password_cb *, void *);
+int i2d_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY *x, const EVP_CIPHER *enc,
+ char *kstr, int klen,
+ pem_password_cb *cb, void *u);
+int i2d_PKCS8PrivateKey_nid_bio(BIO *bp, EVP_PKEY *x, int nid,
+ char *kstr, int klen,
+ pem_password_cb *cb, void *u);
+EVP_PKEY *d2i_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY **x, pem_password_cb *cb,
+ void *u);
+
+int i2d_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc,
+ char *kstr, int klen,
+ pem_password_cb *cb, void *u);
+int i2d_PKCS8PrivateKey_nid_fp(FILE *fp, EVP_PKEY *x, int nid,
+ char *kstr, int klen,
+ pem_password_cb *cb, void *u);
+int PEM_write_PKCS8PrivateKey_nid(FILE *fp, EVP_PKEY *x, int nid,
+ char *kstr, int klen,
+ pem_password_cb *cb, void *u);
+
+EVP_PKEY *d2i_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY **x, pem_password_cb *cb,
+ void *u);
+
+int PEM_write_PKCS8PrivateKey(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc,
+ char *kstr, int klen, pem_password_cb *cd,
+ void *u);
+
+EVP_PKEY *PEM_read_bio_Parameters(BIO *bp, EVP_PKEY **x);
+int PEM_write_bio_Parameters(BIO *bp, EVP_PKEY *x);
+
+EVP_PKEY *b2i_PrivateKey(const unsigned char **in, long length);
+EVP_PKEY *b2i_PublicKey(const unsigned char **in, long length);
+EVP_PKEY *b2i_PrivateKey_bio(BIO *in);
+EVP_PKEY *b2i_PublicKey_bio(BIO *in);
+int i2b_PrivateKey_bio(BIO *out, EVP_PKEY *pk);
+int i2b_PublicKey_bio(BIO *out, EVP_PKEY *pk);
+# ifndef OPENSSL_NO_RC4
+EVP_PKEY *b2i_PVK_bio(BIO *in, pem_password_cb *cb, void *u);
+int i2b_PVK_bio(BIO *out, EVP_PKEY *pk, int enclevel,
+ pem_password_cb *cb, void *u);
+# endif
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_PEM_strings(void);
+
+/* Error codes for the PEM functions. */
+
+/* Function codes. */
+# define PEM_F_B2I_DSS 127
+# define PEM_F_B2I_PVK_BIO 128
+# define PEM_F_B2I_RSA 129
+# define PEM_F_CHECK_BITLEN_DSA 130
+# define PEM_F_CHECK_BITLEN_RSA 131
+# define PEM_F_D2I_PKCS8PRIVATEKEY_BIO 120
+# define PEM_F_D2I_PKCS8PRIVATEKEY_FP 121
+# define PEM_F_DO_B2I 132
+# define PEM_F_DO_B2I_BIO 133
+# define PEM_F_DO_BLOB_HEADER 134
+# define PEM_F_DO_PK8PKEY 126
+# define PEM_F_DO_PK8PKEY_FP 125
+# define PEM_F_DO_PVK_BODY 135
+# define PEM_F_DO_PVK_HEADER 136
+# define PEM_F_I2B_PVK 137
+# define PEM_F_I2B_PVK_BIO 138
+# define PEM_F_LOAD_IV 101
+# define PEM_F_PEM_ASN1_READ 102
+# define PEM_F_PEM_ASN1_READ_BIO 103
+# define PEM_F_PEM_ASN1_WRITE 104
+# define PEM_F_PEM_ASN1_WRITE_BIO 105
+# define PEM_F_PEM_DEF_CALLBACK 100
+# define PEM_F_PEM_DO_HEADER 106
+# define PEM_F_PEM_F_PEM_WRITE_PKCS8PRIVATEKEY 118
+# define PEM_F_PEM_GET_EVP_CIPHER_INFO 107
+# define PEM_F_PEM_PK8PKEY 119
+# define PEM_F_PEM_READ 108
+# define PEM_F_PEM_READ_BIO 109
+# define PEM_F_PEM_READ_BIO_DHPARAMS 141
+# define PEM_F_PEM_READ_BIO_PARAMETERS 140
+# define PEM_F_PEM_READ_BIO_PRIVATEKEY 123
+# define PEM_F_PEM_READ_DHPARAMS 142
+# define PEM_F_PEM_READ_PRIVATEKEY 124
+# define PEM_F_PEM_SEALFINAL 110
+# define PEM_F_PEM_SEALINIT 111
+# define PEM_F_PEM_SIGNFINAL 112
+# define PEM_F_PEM_WRITE 113
+# define PEM_F_PEM_WRITE_BIO 114
+# define PEM_F_PEM_WRITE_PRIVATEKEY 139
+# define PEM_F_PEM_X509_INFO_READ 115
+# define PEM_F_PEM_X509_INFO_READ_BIO 116
+# define PEM_F_PEM_X509_INFO_WRITE_BIO 117
+
+/* Reason codes. */
+# define PEM_R_BAD_BASE64_DECODE 100
+# define PEM_R_BAD_DECRYPT 101
+# define PEM_R_BAD_END_LINE 102
+# define PEM_R_BAD_IV_CHARS 103
+# define PEM_R_BAD_MAGIC_NUMBER 116
+# define PEM_R_BAD_PASSWORD_READ 104
+# define PEM_R_BAD_VERSION_NUMBER 117
+# define PEM_R_BIO_WRITE_FAILURE 118
+# define PEM_R_CIPHER_IS_NULL 127
+# define PEM_R_ERROR_CONVERTING_PRIVATE_KEY 115
+# define PEM_R_EXPECTING_PRIVATE_KEY_BLOB 119
+# define PEM_R_EXPECTING_PUBLIC_KEY_BLOB 120
+# define PEM_R_INCONSISTENT_HEADER 121
+# define PEM_R_KEYBLOB_HEADER_PARSE_ERROR 122
+# define PEM_R_KEYBLOB_TOO_SHORT 123
+# define PEM_R_NOT_DEK_INFO 105
+# define PEM_R_NOT_ENCRYPTED 106
+# define PEM_R_NOT_PROC_TYPE 107
+# define PEM_R_NO_START_LINE 108
+# define PEM_R_PROBLEMS_GETTING_PASSWORD 109
+# define PEM_R_PUBLIC_KEY_NO_RSA 110
+# define PEM_R_PVK_DATA_TOO_SHORT 124
+# define PEM_R_PVK_TOO_SHORT 125
+# define PEM_R_READ_KEY 111
+# define PEM_R_SHORT_HEADER 112
+# define PEM_R_UNSUPPORTED_CIPHER 113
+# define PEM_R_UNSUPPORTED_ENCRYPTION 114
+# define PEM_R_UNSUPPORTED_KEY_COMPONENTS 126
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/deps/openssl/openssl/include/openssl/pem2.h b/deps/openssl/openssl/include/openssl/pem2.h
index bcd3acf856b..84897d5ec35 100644
--- a/deps/openssl/openssl/include/openssl/pem2.h
+++ b/deps/openssl/openssl/include/openssl/pem2.h
@@ -1 +1,70 @@
-#include "../../crypto/pem/pem2.h"
+/* ====================================================================
+ * Copyright (c) 1999 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * licensing@OpenSSL.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+/*
+ * This header only exists to break a circular dependency between pem and err
+ * Ben 30 Jan 1999.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef HEADER_PEM_H
+void ERR_load_PEM_strings(void);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/deps/openssl/openssl/include/openssl/pkcs12.h b/deps/openssl/openssl/include/openssl/pkcs12.h
index 0b5fbbfe863..a39adf5eb52 100644
--- a/deps/openssl/openssl/include/openssl/pkcs12.h
+++ b/deps/openssl/openssl/include/openssl/pkcs12.h
@@ -1 +1,342 @@
-#include "../../crypto/pkcs12/pkcs12.h"
+/* pkcs12.h */
+/*
+ * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project
+ * 1999.
+ */
+/* ====================================================================
+ * Copyright (c) 1999 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * licensing@OpenSSL.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+#ifndef HEADER_PKCS12_H
+# define HEADER_PKCS12_H
+
+# include <openssl/bio.h>
+# include <openssl/x509.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# define PKCS12_KEY_ID 1
+# define PKCS12_IV_ID 2
+# define PKCS12_MAC_ID 3
+
+/* Default iteration count */
+# ifndef PKCS12_DEFAULT_ITER
+# define PKCS12_DEFAULT_ITER PKCS5_DEFAULT_ITER
+# endif
+
+# define PKCS12_MAC_KEY_LENGTH 20
+
+# define PKCS12_SALT_LEN 8
+
+/* Uncomment out next line for unicode password and names, otherwise ASCII */
+
+/*
+ * #define PBE_UNICODE
+ */
+
+# ifdef PBE_UNICODE
+# define PKCS12_key_gen PKCS12_key_gen_uni
+# define PKCS12_add_friendlyname PKCS12_add_friendlyname_uni
+# else
+# define PKCS12_key_gen PKCS12_key_gen_asc
+# define PKCS12_add_friendlyname PKCS12_add_friendlyname_asc
+# endif
+
+/* MS key usage constants */
+
+# define KEY_EX 0x10
+# define KEY_SIG 0x80
+
+typedef struct {
+ X509_SIG *dinfo;
+ ASN1_OCTET_STRING *salt;
+ ASN1_INTEGER *iter; /* defaults to 1 */
+} PKCS12_MAC_DATA;
+
+typedef struct {
+ ASN1_INTEGER *version;
+ PKCS12_MAC_DATA *mac;
+ PKCS7 *authsafes;
+} PKCS12;
+
+typedef struct {
+ ASN1_OBJECT *type;
+ union {
+ struct pkcs12_bag_st *bag; /* secret, crl and certbag */
+ struct pkcs8_priv_key_info_st *keybag; /* keybag */
+ X509_SIG *shkeybag; /* shrouded key bag */
+ STACK_OF(PKCS12_SAFEBAG) *safes;
+ ASN1_TYPE *other;
+ } value;
+ STACK_OF(X509_ATTRIBUTE) *attrib;
+} PKCS12_SAFEBAG;
+
+DECLARE_STACK_OF(PKCS12_SAFEBAG)
+DECLARE_ASN1_SET_OF(PKCS12_SAFEBAG)
+DECLARE_PKCS12_STACK_OF(PKCS12_SAFEBAG)
+
+typedef struct pkcs12_bag_st {
+ ASN1_OBJECT *type;
+ union {
+ ASN1_OCTET_STRING *x509cert;
+ ASN1_OCTET_STRING *x509crl;
+ ASN1_OCTET_STRING *octet;
+ ASN1_IA5STRING *sdsicert;
+ ASN1_TYPE *other; /* Secret or other bag */
+ } value;
+} PKCS12_BAGS;
+
+# define PKCS12_ERROR 0
+# define PKCS12_OK 1
+
+/* Compatibility macros */
+
+# define M_PKCS12_x5092certbag PKCS12_x5092certbag
+# define M_PKCS12_x509crl2certbag PKCS12_x509crl2certbag
+
+# define M_PKCS12_certbag2x509 PKCS12_certbag2x509
+# define M_PKCS12_certbag2x509crl PKCS12_certbag2x509crl
+
+# define M_PKCS12_unpack_p7data PKCS12_unpack_p7data
+# define M_PKCS12_pack_authsafes PKCS12_pack_authsafes
+# define M_PKCS12_unpack_authsafes PKCS12_unpack_authsafes
+# define M_PKCS12_unpack_p7encdata PKCS12_unpack_p7encdata
+
+# define M_PKCS12_decrypt_skey PKCS12_decrypt_skey
+# define M_PKCS8_decrypt PKCS8_decrypt
+
+# define M_PKCS12_bag_type(bg) OBJ_obj2nid((bg)->type)
+# define M_PKCS12_cert_bag_type(bg) OBJ_obj2nid((bg)->value.bag->type)
+# define M_PKCS12_crl_bag_type M_PKCS12_cert_bag_type
+
+# define PKCS12_get_attr(bag, attr_nid) \
+ PKCS12_get_attr_gen(bag->attrib, attr_nid)
+
+# define PKCS8_get_attr(p8, attr_nid) \
+ PKCS12_get_attr_gen(p8->attributes, attr_nid)
+
+# define PKCS12_mac_present(p12) ((p12)->mac ? 1 : 0)
+
+PKCS12_SAFEBAG *PKCS12_x5092certbag(X509 *x509);
+PKCS12_SAFEBAG *PKCS12_x509crl2certbag(X509_CRL *crl);
+X509 *PKCS12_certbag2x509(PKCS12_SAFEBAG *bag);
+X509_CRL *PKCS12_certbag2x509crl(PKCS12_SAFEBAG *bag);
+
+PKCS12_SAFEBAG *PKCS12_item_pack_safebag(void *obj, const ASN1_ITEM *it,
+ int nid1, int nid2);
+PKCS12_SAFEBAG *PKCS12_MAKE_KEYBAG(PKCS8_PRIV_KEY_INFO *p8);
+PKCS8_PRIV_KEY_INFO *PKCS8_decrypt(X509_SIG *p8, const char *pass,
+ int passlen);
+PKCS8_PRIV_KEY_INFO *PKCS12_decrypt_skey(PKCS12_SAFEBAG *bag,
+ const char *pass, int passlen);
+X509_SIG *PKCS8_encrypt(int pbe_nid, const EVP_CIPHER *cipher,
+ const char *pass, int passlen, unsigned char *salt,
+ int saltlen, int iter, PKCS8_PRIV_KEY_INFO *p8);
+PKCS12_SAFEBAG *PKCS12_MAKE_SHKEYBAG(int pbe_nid, const char *pass,
+ int passlen, unsigned char *salt,
+ int saltlen, int iter,
+ PKCS8_PRIV_KEY_INFO *p8);
+PKCS7 *PKCS12_pack_p7data(STACK_OF(PKCS12_SAFEBAG) *sk);
+STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7data(PKCS7 *p7);
+PKCS7 *PKCS12_pack_p7encdata(int pbe_nid, const char *pass, int passlen,
+ unsigned char *salt, int saltlen, int iter,
+ STACK_OF(PKCS12_SAFEBAG) *bags);
+STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7encdata(PKCS7 *p7, const char *pass,
+ int passlen);
+
+int PKCS12_pack_authsafes(PKCS12 *p12, STACK_OF(PKCS7) *safes);
+STACK_OF(PKCS7) *PKCS12_unpack_authsafes(PKCS12 *p12);
+
+int PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, unsigned char *name,
+ int namelen);
+int PKCS12_add_friendlyname_asc(PKCS12_SAFEBAG *bag, const char *name,
+ int namelen);
+int PKCS12_add_CSPName_asc(PKCS12_SAFEBAG *bag, const char *name,
+ int namelen);
+int PKCS12_add_friendlyname_uni(PKCS12_SAFEBAG *bag,
+ const unsigned char *name, int namelen);
+int PKCS8_add_keyusage(PKCS8_PRIV_KEY_INFO *p8, int usage);
+ASN1_TYPE *PKCS12_get_attr_gen(STACK_OF(X509_ATTRIBUTE) *attrs, int attr_nid);
+char *PKCS12_get_friendlyname(PKCS12_SAFEBAG *bag);
+unsigned char *PKCS12_pbe_crypt(X509_ALGOR *algor, const char *pass,
+ int passlen, unsigned char *in, int inlen,
+ unsigned char **data, int *datalen,
+ int en_de);
+void *PKCS12_item_decrypt_d2i(X509_ALGOR *algor, const ASN1_ITEM *it,
+ const char *pass, int passlen,
+ ASN1_OCTET_STRING *oct, int zbuf);
+ASN1_OCTET_STRING *PKCS12_item_i2d_encrypt(X509_ALGOR *algor,
+ const ASN1_ITEM *it,
+ const char *pass, int passlen,
+ void *obj, int zbuf);
+PKCS12 *PKCS12_init(int mode);
+int PKCS12_key_gen_asc(const char *pass, int passlen, unsigned char *salt,
+ int saltlen, int id, int iter, int n,
+ unsigned char *out, const EVP_MD *md_type);
+int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt,
+ int saltlen, int id, int iter, int n,
+ unsigned char *out, const EVP_MD *md_type);
+int PKCS12_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
+ ASN1_TYPE *param, const EVP_CIPHER *cipher,
+ const EVP_MD *md_type, int en_de);
+int PKCS12_gen_mac(PKCS12 *p12, const char *pass, int passlen,
+ unsigned char *mac, unsigned int *maclen);
+int PKCS12_verify_mac(PKCS12 *p12, const char *pass, int passlen);
+int PKCS12_set_mac(PKCS12 *p12, const char *pass, int passlen,
+ unsigned char *salt, int saltlen, int iter,
+ const EVP_MD *md_type);
+int PKCS12_setup_mac(PKCS12 *p12, int iter, unsigned char *salt,
+ int saltlen, const EVP_MD *md_type);
+unsigned char *OPENSSL_asc2uni(const char *asc, int asclen,
+ unsigned char **uni, int *unilen);
+char *OPENSSL_uni2asc(unsigned char *uni, int unilen);
+
+DECLARE_ASN1_FUNCTIONS(PKCS12)
+DECLARE_ASN1_FUNCTIONS(PKCS12_MAC_DATA)
+DECLARE_ASN1_FUNCTIONS(PKCS12_SAFEBAG)
+DECLARE_ASN1_FUNCTIONS(PKCS12_BAGS)
+
+DECLARE_ASN1_ITEM(PKCS12_SAFEBAGS)
+DECLARE_ASN1_ITEM(PKCS12_AUTHSAFES)
+
+void PKCS12_PBE_add(void);
+int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert,
+ STACK_OF(X509) **ca);
+PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert,
+ STACK_OF(X509) *ca, int nid_key, int nid_cert, int iter,
+ int mac_iter, int keytype);
+
+PKCS12_SAFEBAG *PKCS12_add_cert(STACK_OF(PKCS12_SAFEBAG) **pbags, X509 *cert);
+PKCS12_SAFEBAG *PKCS12_add_key(STACK_OF(PKCS12_SAFEBAG) **pbags,
+ EVP_PKEY *key, int key_usage, int iter,
+ int key_nid, char *pass);
+int PKCS12_add_safe(STACK_OF(PKCS7) **psafes, STACK_OF(PKCS12_SAFEBAG) *bags,
+ int safe_nid, int iter, char *pass);
+PKCS12 *PKCS12_add_safes(STACK_OF(PKCS7) *safes, int p7_nid);
+
+int i2d_PKCS12_bio(BIO *bp, PKCS12 *p12);
+int i2d_PKCS12_fp(FILE *fp, PKCS12 *p12);
+PKCS12 *d2i_PKCS12_bio(BIO *bp, PKCS12 **p12);
+PKCS12 *d2i_PKCS12_fp(FILE *fp, PKCS12 **p12);
+int PKCS12_newpass(PKCS12 *p12, char *oldpass, char *newpass);
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_PKCS12_strings(void);
+
+/* Error codes for the PKCS12 functions. */
+
+/* Function codes. */
+# define PKCS12_F_PARSE_BAG 129
+# define PKCS12_F_PARSE_BAGS 103
+# define PKCS12_F_PKCS12_ADD_FRIENDLYNAME 100
+# define PKCS12_F_PKCS12_ADD_FRIENDLYNAME_ASC 127
+# define PKCS12_F_PKCS12_ADD_FRIENDLYNAME_UNI 102
+# define PKCS12_F_PKCS12_ADD_LOCALKEYID 104
+# define PKCS12_F_PKCS12_CREATE 105
+# define PKCS12_F_PKCS12_GEN_MAC 107
+# define PKCS12_F_PKCS12_INIT 109
+# define PKCS12_F_PKCS12_ITEM_DECRYPT_D2I 106
+# define PKCS12_F_PKCS12_ITEM_I2D_ENCRYPT 108
+# define PKCS12_F_PKCS12_ITEM_PACK_SAFEBAG 117
+# define PKCS12_F_PKCS12_KEY_GEN_ASC 110
+# define PKCS12_F_PKCS12_KEY_GEN_UNI 111
+# define PKCS12_F_PKCS12_MAKE_KEYBAG 112
+# define PKCS12_F_PKCS12_MAKE_SHKEYBAG 113
+# define PKCS12_F_PKCS12_NEWPASS 128
+# define PKCS12_F_PKCS12_PACK_P7DATA 114
+# define PKCS12_F_PKCS12_PACK_P7ENCDATA 115
+# define PKCS12_F_PKCS12_PARSE 118
+# define PKCS12_F_PKCS12_PBE_CRYPT 119
+# define PKCS12_F_PKCS12_PBE_KEYIVGEN 120
+# define PKCS12_F_PKCS12_SETUP_MAC 122
+# define PKCS12_F_PKCS12_SET_MAC 123
+# define PKCS12_F_PKCS12_UNPACK_AUTHSAFES 130
+# define PKCS12_F_PKCS12_UNPACK_P7DATA 131
+# define PKCS12_F_PKCS12_VERIFY_MAC 126
+# define PKCS12_F_PKCS8_ADD_KEYUSAGE 124
+# define PKCS12_F_PKCS8_ENCRYPT 125
+
+/* Reason codes. */
+# define PKCS12_R_CANT_PACK_STRUCTURE 100
+# define PKCS12_R_CONTENT_TYPE_NOT_DATA 121
+# define PKCS12_R_DECODE_ERROR 101
+# define PKCS12_R_ENCODE_ERROR 102
+# define PKCS12_R_ENCRYPT_ERROR 103
+# define PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE 120
+# define PKCS12_R_INVALID_NULL_ARGUMENT 104
+# define PKCS12_R_INVALID_NULL_PKCS12_POINTER 105
+# define PKCS12_R_IV_GEN_ERROR 106
+# define PKCS12_R_KEY_GEN_ERROR 107
+# define PKCS12_R_MAC_ABSENT 108
+# define PKCS12_R_MAC_GENERATION_ERROR 109
+# define PKCS12_R_MAC_SETUP_ERROR 110
+# define PKCS12_R_MAC_STRING_SET_ERROR 111
+# define PKCS12_R_MAC_VERIFY_ERROR 112
+# define PKCS12_R_MAC_VERIFY_FAILURE 113
+# define PKCS12_R_PARSE_ERROR 114
+# define PKCS12_R_PKCS12_ALGOR_CIPHERINIT_ERROR 115
+# define PKCS12_R_PKCS12_CIPHERFINAL_ERROR 116
+# define PKCS12_R_PKCS12_PBE_CRYPT_ERROR 117
+# define PKCS12_R_UNKNOWN_DIGEST_ALGORITHM 118
+# define PKCS12_R_UNSUPPORTED_PKCS12_MODE 119
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/deps/openssl/openssl/include/openssl/pkcs7.h b/deps/openssl/openssl/include/openssl/pkcs7.h
index 2e19d7c4c9b..b51b3863eb3 100644
--- a/deps/openssl/openssl/include/openssl/pkcs7.h
+++ b/deps/openssl/openssl/include/openssl/pkcs7.h
@@ -1 +1,481 @@
-#include "../../crypto/pkcs7/pkcs7.h"
+/* crypto/pkcs7/pkcs7.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_PKCS7_H
+# define HEADER_PKCS7_H
+
+# include <openssl/asn1.h>
+# include <openssl/bio.h>
+# include <openssl/e_os2.h>
+
+# include <openssl/symhacks.h>
+# include <openssl/ossl_typ.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# ifdef OPENSSL_SYS_WIN32
+/* Under Win32 thes are defined in wincrypt.h */
+# undef PKCS7_ISSUER_AND_SERIAL
+# undef PKCS7_SIGNER_INFO
+# endif
+
+/*-
+Encryption_ID DES-CBC
+Digest_ID MD5
+Digest_Encryption_ID rsaEncryption
+Key_Encryption_ID rsaEncryption
+*/
+
+typedef struct pkcs7_issuer_and_serial_st {
+ X509_NAME *issuer;
+ ASN1_INTEGER *serial;
+} PKCS7_ISSUER_AND_SERIAL;
+
+typedef struct pkcs7_signer_info_st {
+ ASN1_INTEGER *version; /* version 1 */
+ PKCS7_ISSUER_AND_SERIAL *issuer_and_serial;
+ X509_ALGOR *digest_alg;
+ STACK_OF(X509_ATTRIBUTE) *auth_attr; /* [ 0 ] */
+ X509_ALGOR *digest_enc_alg;
+ ASN1_OCTET_STRING *enc_digest;
+ STACK_OF(X509_ATTRIBUTE) *unauth_attr; /* [ 1 ] */
+ /* The private key to sign with */
+ EVP_PKEY *pkey;
+} PKCS7_SIGNER_INFO;
+
+DECLARE_STACK_OF(PKCS7_SIGNER_INFO)
+DECLARE_ASN1_SET_OF(PKCS7_SIGNER_INFO)
+
+typedef struct pkcs7_recip_info_st {
+ ASN1_INTEGER *version; /* version 0 */
+ PKCS7_ISSUER_AND_SERIAL *issuer_and_serial;
+ X509_ALGOR *key_enc_algor;
+ ASN1_OCTET_STRING *enc_key;
+ X509 *cert; /* get the pub-key from this */
+} PKCS7_RECIP_INFO;
+
+DECLARE_STACK_OF(PKCS7_RECIP_INFO)
+DECLARE_ASN1_SET_OF(PKCS7_RECIP_INFO)
+
+typedef struct pkcs7_signed_st {
+ ASN1_INTEGER *version; /* version 1 */
+ STACK_OF(X509_ALGOR) *md_algs; /* md used */
+ STACK_OF(X509) *cert; /* [ 0 ] */
+ STACK_OF(X509_CRL) *crl; /* [ 1 ] */
+ STACK_OF(PKCS7_SIGNER_INFO) *signer_info;
+ struct pkcs7_st *contents;
+} PKCS7_SIGNED;
+/*
+ * The above structure is very very similar to PKCS7_SIGN_ENVELOPE. How about
+ * merging the two
+ */
+
+typedef struct pkcs7_enc_content_st {
+ ASN1_OBJECT *content_type;
+ X509_ALGOR *algorithm;
+ ASN1_OCTET_STRING *enc_data; /* [ 0 ] */
+ const EVP_CIPHER *cipher;
+} PKCS7_ENC_CONTENT;
+
+typedef struct pkcs7_enveloped_st {
+ ASN1_INTEGER *version; /* version 0 */
+ STACK_OF(PKCS7_RECIP_INFO) *recipientinfo;
+ PKCS7_ENC_CONTENT *enc_data;
+} PKCS7_ENVELOPE;
+
+typedef struct pkcs7_signedandenveloped_st {
+ ASN1_INTEGER *version; /* version 1 */
+ STACK_OF(X509_ALGOR) *md_algs; /* md used */
+ STACK_OF(X509) *cert; /* [ 0 ] */
+ STACK_OF(X509_CRL) *crl; /* [ 1 ] */
+ STACK_OF(PKCS7_SIGNER_INFO) *signer_info;
+ PKCS7_ENC_CONTENT *enc_data;
+ STACK_OF(PKCS7_RECIP_INFO) *recipientinfo;
+} PKCS7_SIGN_ENVELOPE;
+
+typedef struct pkcs7_digest_st {
+ ASN1_INTEGER *version; /* version 0 */
+ X509_ALGOR *md; /* md used */
+ struct pkcs7_st *contents;
+ ASN1_OCTET_STRING *digest;
+} PKCS7_DIGEST;
+
+typedef struct pkcs7_encrypted_st {
+ ASN1_INTEGER *version; /* version 0 */
+ PKCS7_ENC_CONTENT *enc_data;
+} PKCS7_ENCRYPT;
+
+typedef struct pkcs7_st {
+ /*
+ * The following is non NULL if it contains ASN1 encoding of this
+ * structure
+ */
+ unsigned char *asn1;
+ long length;
+# define PKCS7_S_HEADER 0
+# define PKCS7_S_BODY 1
+# define PKCS7_S_TAIL 2
+ int state; /* used during processing */
+ int detached;
+ ASN1_OBJECT *type;
+ /* content as defined by the type */
+ /*
+ * all encryption/message digests are applied to the 'contents', leaving
+ * out the 'type' field.
+ */
+ union {
+ char *ptr;
+ /* NID_pkcs7_data */
+ ASN1_OCTET_STRING *data;
+ /* NID_pkcs7_signed */
+ PKCS7_SIGNED *sign;
+ /* NID_pkcs7_enveloped */
+ PKCS7_ENVELOPE *enveloped;
+ /* NID_pkcs7_signedAndEnveloped */
+ PKCS7_SIGN_ENVELOPE *signed_and_enveloped;
+ /* NID_pkcs7_digest */
+ PKCS7_DIGEST *digest;
+ /* NID_pkcs7_encrypted */
+ PKCS7_ENCRYPT *encrypted;
+ /* Anything else */
+ ASN1_TYPE *other;
+ } d;
+} PKCS7;
+
+DECLARE_STACK_OF(PKCS7)
+DECLARE_ASN1_SET_OF(PKCS7)
+DECLARE_PKCS12_STACK_OF(PKCS7)
+
+# define PKCS7_OP_SET_DETACHED_SIGNATURE 1
+# define PKCS7_OP_GET_DETACHED_SIGNATURE 2
+
+# define PKCS7_get_signed_attributes(si) ((si)->auth_attr)
+# define PKCS7_get_attributes(si) ((si)->unauth_attr)
+
+# define PKCS7_type_is_signed(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_signed)
+# define PKCS7_type_is_encrypted(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_encrypted)
+# define PKCS7_type_is_enveloped(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_enveloped)
+# define PKCS7_type_is_signedAndEnveloped(a) \
+ (OBJ_obj2nid((a)->type) == NID_pkcs7_signedAndEnveloped)
+# define PKCS7_type_is_data(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_data)
+# define PKCS7_type_is_digest(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_digest)
+
+# define PKCS7_set_detached(p,v) \
+ PKCS7_ctrl(p,PKCS7_OP_SET_DETACHED_SIGNATURE,v,NULL)
+# define PKCS7_get_detached(p) \
+ PKCS7_ctrl(p,PKCS7_OP_GET_DETACHED_SIGNATURE,0,NULL)
+
+# define PKCS7_is_detached(p7) (PKCS7_type_is_signed(p7) && PKCS7_get_detached(p7))
+
+/* S/MIME related flags */
+
+# define PKCS7_TEXT 0x1
+# define PKCS7_NOCERTS 0x2
+# define PKCS7_NOSIGS 0x4
+# define PKCS7_NOCHAIN 0x8
+# define PKCS7_NOINTERN 0x10
+# define PKCS7_NOVERIFY 0x20
+# define PKCS7_DETACHED 0x40
+# define PKCS7_BINARY 0x80
+# define PKCS7_NOATTR 0x100
+# define PKCS7_NOSMIMECAP 0x200
+# define PKCS7_NOOLDMIMETYPE 0x400
+# define PKCS7_CRLFEOL 0x800
+# define PKCS7_STREAM 0x1000
+# define PKCS7_NOCRL 0x2000
+# define PKCS7_PARTIAL 0x4000
+# define PKCS7_REUSE_DIGEST 0x8000
+
+/* Flags: for compatibility with older code */
+
+# define SMIME_TEXT PKCS7_TEXT
+# define SMIME_NOCERTS PKCS7_NOCERTS
+# define SMIME_NOSIGS PKCS7_NOSIGS
+# define SMIME_NOCHAIN PKCS7_NOCHAIN
+# define SMIME_NOINTERN PKCS7_NOINTERN
+# define SMIME_NOVERIFY PKCS7_NOVERIFY
+# define SMIME_DETACHED PKCS7_DETACHED
+# define SMIME_BINARY PKCS7_BINARY
+# define SMIME_NOATTR PKCS7_NOATTR
+
+DECLARE_ASN1_FUNCTIONS(PKCS7_ISSUER_AND_SERIAL)
+
+int PKCS7_ISSUER_AND_SERIAL_digest(PKCS7_ISSUER_AND_SERIAL *data,
+ const EVP_MD *type, unsigned char *md,
+ unsigned int *len);
+# ifndef OPENSSL_NO_FP_API
+PKCS7 *d2i_PKCS7_fp(FILE *fp, PKCS7 **p7);
+int i2d_PKCS7_fp(FILE *fp, PKCS7 *p7);
+# endif
+PKCS7 *PKCS7_dup(PKCS7 *p7);
+PKCS7 *d2i_PKCS7_bio(BIO *bp, PKCS7 **p7);
+int i2d_PKCS7_bio(BIO *bp, PKCS7 *p7);
+int i2d_PKCS7_bio_stream(BIO *out, PKCS7 *p7, BIO *in, int flags);
+int PEM_write_bio_PKCS7_stream(BIO *out, PKCS7 *p7, BIO *in, int flags);
+
+DECLARE_ASN1_FUNCTIONS(PKCS7_SIGNER_INFO)
+DECLARE_ASN1_FUNCTIONS(PKCS7_RECIP_INFO)
+DECLARE_ASN1_FUNCTIONS(PKCS7_SIGNED)
+DECLARE_ASN1_FUNCTIONS(PKCS7_ENC_CONTENT)
+DECLARE_ASN1_FUNCTIONS(PKCS7_ENVELOPE)
+DECLARE_ASN1_FUNCTIONS(PKCS7_SIGN_ENVELOPE)
+DECLARE_ASN1_FUNCTIONS(PKCS7_DIGEST)
+DECLARE_ASN1_FUNCTIONS(PKCS7_ENCRYPT)
+DECLARE_ASN1_FUNCTIONS(PKCS7)
+
+DECLARE_ASN1_ITEM(PKCS7_ATTR_SIGN)
+DECLARE_ASN1_ITEM(PKCS7_ATTR_VERIFY)
+
+DECLARE_ASN1_NDEF_FUNCTION(PKCS7)
+DECLARE_ASN1_PRINT_FUNCTION(PKCS7)
+
+long PKCS7_ctrl(PKCS7 *p7, int cmd, long larg, char *parg);
+
+int PKCS7_set_type(PKCS7 *p7, int type);
+int PKCS7_set0_type_other(PKCS7 *p7, int type, ASN1_TYPE *other);
+int PKCS7_set_content(PKCS7 *p7, PKCS7 *p7_data);
+int PKCS7_SIGNER_INFO_set(PKCS7_SIGNER_INFO *p7i, X509 *x509, EVP_PKEY *pkey,
+ const EVP_MD *dgst);
+int PKCS7_SIGNER_INFO_sign(PKCS7_SIGNER_INFO *si);
+int PKCS7_add_signer(PKCS7 *p7, PKCS7_SIGNER_INFO *p7i);
+int PKCS7_add_certificate(PKCS7 *p7, X509 *x509);
+int PKCS7_add_crl(PKCS7 *p7, X509_CRL *x509);
+int PKCS7_content_new(PKCS7 *p7, int nid);
+int PKCS7_dataVerify(X509_STORE *cert_store, X509_STORE_CTX *ctx,
+ BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si);
+int PKCS7_signatureVerify(BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si,
+ X509 *x509);
+
+BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio);
+int PKCS7_dataFinal(PKCS7 *p7, BIO *bio);
+BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert);
+
+PKCS7_SIGNER_INFO *PKCS7_add_signature(PKCS7 *p7, X509 *x509,
+ EVP_PKEY *pkey, const EVP_MD *dgst);
+X509 *PKCS7_cert_from_signer_info(PKCS7 *p7, PKCS7_SIGNER_INFO *si);
+int PKCS7_set_digest(PKCS7 *p7, const EVP_MD *md);
+STACK_OF(PKCS7_SIGNER_INFO) *PKCS7_get_signer_info(PKCS7 *p7);
+
+PKCS7_RECIP_INFO *PKCS7_add_recipient(PKCS7 *p7, X509 *x509);
+void PKCS7_SIGNER_INFO_get0_algs(PKCS7_SIGNER_INFO *si, EVP_PKEY **pk,
+ X509_ALGOR **pdig, X509_ALGOR **psig);
+void PKCS7_RECIP_INFO_get0_alg(PKCS7_RECIP_INFO *ri, X509_ALGOR **penc);
+int PKCS7_add_recipient_info(PKCS7 *p7, PKCS7_RECIP_INFO *ri);
+int PKCS7_RECIP_INFO_set(PKCS7_RECIP_INFO *p7i, X509 *x509);
+int PKCS7_set_cipher(PKCS7 *p7, const EVP_CIPHER *cipher);
+int PKCS7_stream(unsigned char ***boundary, PKCS7 *p7);
+
+PKCS7_ISSUER_AND_SERIAL *PKCS7_get_issuer_and_serial(PKCS7 *p7, int idx);
+ASN1_OCTET_STRING *PKCS7_digest_from_attributes(STACK_OF(X509_ATTRIBUTE) *sk);
+int PKCS7_add_signed_attribute(PKCS7_SIGNER_INFO *p7si, int nid, int type,
+ void *data);
+int PKCS7_add_attribute(PKCS7_SIGNER_INFO *p7si, int nid, int atrtype,
+ void *value);
+ASN1_TYPE *PKCS7_get_attribute(PKCS7_SIGNER_INFO *si, int nid);
+ASN1_TYPE *PKCS7_get_signed_attribute(PKCS7_SIGNER_INFO *si, int nid);
+int PKCS7_set_signed_attributes(PKCS7_SIGNER_INFO *p7si,
+ STACK_OF(X509_ATTRIBUTE) *sk);
+int PKCS7_set_attributes(PKCS7_SIGNER_INFO *p7si,
+ STACK_OF(X509_ATTRIBUTE) *sk);
+
+PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
+ BIO *data, int flags);
+
+PKCS7_SIGNER_INFO *PKCS7_sign_add_signer(PKCS7 *p7,
+ X509 *signcert, EVP_PKEY *pkey,
+ const EVP_MD *md, int flags);
+
+int PKCS7_final(PKCS7 *p7, BIO *data, int flags);
+int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store,
+ BIO *indata, BIO *out, int flags);
+STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs,
+ int flags);
+PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, const EVP_CIPHER *cipher,
+ int flags);
+int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data,
+ int flags);
+
+int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si,
+ STACK_OF(X509_ALGOR) *cap);
+STACK_OF(X509_ALGOR) *PKCS7_get_smimecap(PKCS7_SIGNER_INFO *si);
+int PKCS7_simple_smimecap(STACK_OF(X509_ALGOR) *sk, int nid, int arg);
+
+int PKCS7_add_attrib_content_type(PKCS7_SIGNER_INFO *si, ASN1_OBJECT *coid);
+int PKCS7_add0_attrib_signing_time(PKCS7_SIGNER_INFO *si, ASN1_TIME *t);
+int PKCS7_add1_attrib_digest(PKCS7_SIGNER_INFO *si,
+ const unsigned char *md, int mdlen);
+
+int SMIME_write_PKCS7(BIO *bio, PKCS7 *p7, BIO *data, int flags);
+PKCS7 *SMIME_read_PKCS7(BIO *bio, BIO **bcont);
+
+BIO *BIO_new_PKCS7(BIO *out, PKCS7 *p7);
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_PKCS7_strings(void);
+
+/* Error codes for the PKCS7 functions. */
+
+/* Function codes. */
+# define PKCS7_F_B64_READ_PKCS7 120
+# define PKCS7_F_B64_WRITE_PKCS7 121
+# define PKCS7_F_DO_PKCS7_SIGNED_ATTRIB 136
+# define PKCS7_F_I2D_PKCS7_BIO_STREAM 140
+# define PKCS7_F_PKCS7_ADD0_ATTRIB_SIGNING_TIME 135
+# define PKCS7_F_PKCS7_ADD_ATTRIB_SMIMECAP 118
+# define PKCS7_F_PKCS7_ADD_CERTIFICATE 100
+# define PKCS7_F_PKCS7_ADD_CRL 101
+# define PKCS7_F_PKCS7_ADD_RECIPIENT_INFO 102
+# define PKCS7_F_PKCS7_ADD_SIGNATURE 131
+# define PKCS7_F_PKCS7_ADD_SIGNER 103
+# define PKCS7_F_PKCS7_BIO_ADD_DIGEST 125
+# define PKCS7_F_PKCS7_COPY_EXISTING_DIGEST 138
+# define PKCS7_F_PKCS7_CTRL 104
+# define PKCS7_F_PKCS7_DATADECODE 112
+# define PKCS7_F_PKCS7_DATAFINAL 128
+# define PKCS7_F_PKCS7_DATAINIT 105
+# define PKCS7_F_PKCS7_DATASIGN 106
+# define PKCS7_F_PKCS7_DATAVERIFY 107
+# define PKCS7_F_PKCS7_DECRYPT 114
+# define PKCS7_F_PKCS7_DECRYPT_RINFO 133
+# define PKCS7_F_PKCS7_ENCODE_RINFO 132
+# define PKCS7_F_PKCS7_ENCRYPT 115
+# define PKCS7_F_PKCS7_FINAL 134
+# define PKCS7_F_PKCS7_FIND_DIGEST 127
+# define PKCS7_F_PKCS7_GET0_SIGNERS 124
+# define PKCS7_F_PKCS7_RECIP_INFO_SET 130
+# define PKCS7_F_PKCS7_SET_CIPHER 108
+# define PKCS7_F_PKCS7_SET_CONTENT 109
+# define PKCS7_F_PKCS7_SET_DIGEST 126
+# define PKCS7_F_PKCS7_SET_TYPE 110
+# define PKCS7_F_PKCS7_SIGN 116
+# define PKCS7_F_PKCS7_SIGNATUREVERIFY 113
+# define PKCS7_F_PKCS7_SIGNER_INFO_SET 129
+# define PKCS7_F_PKCS7_SIGNER_INFO_SIGN 139
+# define PKCS7_F_PKCS7_SIGN_ADD_SIGNER 137
+# define PKCS7_F_PKCS7_SIMPLE_SMIMECAP 119
+# define PKCS7_F_PKCS7_VERIFY 117
+# define PKCS7_F_SMIME_READ_PKCS7 122
+# define PKCS7_F_SMIME_TEXT 123
+
+/* Reason codes. */
+# define PKCS7_R_CERTIFICATE_VERIFY_ERROR 117
+# define PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER 144
+# define PKCS7_R_CIPHER_NOT_INITIALIZED 116
+# define PKCS7_R_CONTENT_AND_DATA_PRESENT 118
+# define PKCS7_R_CTRL_ERROR 152
+# define PKCS7_R_DECODE_ERROR 130
+# define PKCS7_R_DECRYPTED_KEY_IS_WRONG_LENGTH 100
+# define PKCS7_R_DECRYPT_ERROR 119
+# define PKCS7_R_DIGEST_FAILURE 101
+# define PKCS7_R_ENCRYPTION_CTRL_FAILURE 149
+# define PKCS7_R_ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 150
+# define PKCS7_R_ERROR_ADDING_RECIPIENT 120
+# define PKCS7_R_ERROR_SETTING_CIPHER 121
+# define PKCS7_R_INVALID_MIME_TYPE 131
+# define PKCS7_R_INVALID_NULL_POINTER 143
+# define PKCS7_R_INVALID_SIGNED_DATA_TYPE 155
+# define PKCS7_R_MIME_NO_CONTENT_TYPE 132
+# define PKCS7_R_MIME_PARSE_ERROR 133
+# define PKCS7_R_MIME_SIG_PARSE_ERROR 134
+# define PKCS7_R_MISSING_CERIPEND_INFO 103
+# define PKCS7_R_NO_CONTENT 122
+# define PKCS7_R_NO_CONTENT_TYPE 135
+# define PKCS7_R_NO_DEFAULT_DIGEST 151
+# define PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND 154
+# define PKCS7_R_NO_MULTIPART_BODY_FAILURE 136
+# define PKCS7_R_NO_MULTIPART_BOUNDARY 137
+# define PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE 115
+# define PKCS7_R_NO_RECIPIENT_MATCHES_KEY 146
+# define PKCS7_R_NO_SIGNATURES_ON_DATA 123
+# define PKCS7_R_NO_SIGNERS 142
+# define PKCS7_R_NO_SIG_CONTENT_TYPE 138
+# define PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE 104
+# define PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR 124
+# define PKCS7_R_PKCS7_ADD_SIGNER_ERROR 153
+# define PKCS7_R_PKCS7_DATAFINAL 126
+# define PKCS7_R_PKCS7_DATAFINAL_ERROR 125
+# define PKCS7_R_PKCS7_DATASIGN 145
+# define PKCS7_R_PKCS7_PARSE_ERROR 139
+# define PKCS7_R_PKCS7_SIG_PARSE_ERROR 140
+# define PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 127
+# define PKCS7_R_SIGNATURE_FAILURE 105
+# define PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND 128
+# define PKCS7_R_SIGNING_CTRL_FAILURE 147
+# define PKCS7_R_SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 148
+# define PKCS7_R_SIG_INVALID_MIME_TYPE 141
+# define PKCS7_R_SMIME_TEXT_ERROR 129
+# define PKCS7_R_UNABLE_TO_FIND_CERTIFICATE 106
+# define PKCS7_R_UNABLE_TO_FIND_MEM_BIO 107
+# define PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST 108
+# define PKCS7_R_UNKNOWN_DIGEST_TYPE 109
+# define PKCS7_R_UNKNOWN_OPERATION 110
+# define PKCS7_R_UNSUPPORTED_CIPHER_TYPE 111
+# define PKCS7_R_UNSUPPORTED_CONTENT_TYPE 112
+# define PKCS7_R_WRONG_CONTENT_TYPE 113
+# define PKCS7_R_WRONG_PKCS7_TYPE 114
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/deps/openssl/openssl/include/openssl/pqueue.h b/deps/openssl/openssl/include/openssl/pqueue.h
index 9681ff52cd2..d40d9c7d852 100644
--- a/deps/openssl/openssl/include/openssl/pqueue.h
+++ b/deps/openssl/openssl/include/openssl/pqueue.h
@@ -1 +1,99 @@
-#include "../../crypto/pqueue/pqueue.h"
+/* crypto/pqueue/pqueue.h */
+/*
+ * DTLS implementation written by Nagendra Modadugu
+ * (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
+ */
+/* ====================================================================
+ * Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@OpenSSL.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+#ifndef HEADER_PQUEUE_H
+# define HEADER_PQUEUE_H
+
+# include <stdio.h>
+# include <stdlib.h>
+# include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+typedef struct _pqueue *pqueue;
+
+typedef struct _pitem {
+ unsigned char priority[8]; /* 64-bit value in big-endian encoding */
+ void *data;
+ struct _pitem *next;
+} pitem;
+
+typedef struct _pitem *piterator;
+
+pitem *pitem_new(unsigned char *prio64be, void *data);
+void pitem_free(pitem *item);
+
+pqueue pqueue_new(void);
+void pqueue_free(pqueue pq);
+
+pitem *pqueue_insert(pqueue pq, pitem *item);
+pitem *pqueue_peek(pqueue pq);
+pitem *pqueue_pop(pqueue pq);
+pitem *pqueue_find(pqueue pq, unsigned char *prio64be);
+pitem *pqueue_iterator(pqueue pq);
+pitem *pqueue_next(piterator *iter);
+
+void pqueue_print(pqueue pq);
+int pqueue_size(pqueue pq);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* ! HEADER_PQUEUE_H */
diff --git a/deps/openssl/openssl/include/openssl/rand.h b/deps/openssl/openssl/include/openssl/rand.h
index 9d1521bd4e3..2553afda200 100644
--- a/deps/openssl/openssl/include/openssl/rand.h
+++ b/deps/openssl/openssl/include/openssl/rand.h
@@ -1 +1,150 @@
-#include "../../crypto/rand/rand.h"
+/* crypto/rand/rand.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_RAND_H
+# define HEADER_RAND_H
+
+# include <stdlib.h>
+# include <openssl/ossl_typ.h>
+# include <openssl/e_os2.h>
+
+# if defined(OPENSSL_SYS_WINDOWS)
+# include <windows.h>
+# endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# if defined(OPENSSL_FIPS)
+# define FIPS_RAND_SIZE_T size_t
+# endif
+
+/* Already defined in ossl_typ.h */
+/* typedef struct rand_meth_st RAND_METHOD; */
+
+struct rand_meth_st {
+ void (*seed) (const void *buf, int num);
+ int (*bytes) (unsigned char *buf, int num);
+ void (*cleanup) (void);
+ void (*add) (const void *buf, int num, double entropy);
+ int (*pseudorand) (unsigned char *buf, int num);
+ int (*status) (void);
+};
+
+# ifdef BN_DEBUG
+extern int rand_predictable;
+# endif
+
+int RAND_set_rand_method(const RAND_METHOD *meth);
+const RAND_METHOD *RAND_get_rand_method(void);
+# ifndef OPENSSL_NO_ENGINE
+int RAND_set_rand_engine(ENGINE *engine);
+# endif
+RAND_METHOD *RAND_SSLeay(void);
+void RAND_cleanup(void);
+int RAND_bytes(unsigned char *buf, int num);
+int RAND_pseudo_bytes(unsigned char *buf, int num);
+void RAND_seed(const void *buf, int num);
+void RAND_add(const void *buf, int num, double entropy);
+int RAND_load_file(const char *file, long max_bytes);
+int RAND_write_file(const char *file);
+const char *RAND_file_name(char *file, size_t num);
+int RAND_status(void);
+int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes);
+int RAND_egd(const char *path);
+int RAND_egd_bytes(const char *path, int bytes);
+int RAND_poll(void);
+
+# if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32)
+
+void RAND_screen(void);
+int RAND_event(UINT, WPARAM, LPARAM);
+
+# endif
+
+# ifdef OPENSSL_FIPS
+void RAND_set_fips_drbg_type(int type, int flags);
+int RAND_init_fips(void);
+# endif
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_RAND_strings(void);
+
+/* Error codes for the RAND functions. */
+
+/* Function codes. */
+# define RAND_F_RAND_GET_RAND_METHOD 101
+# define RAND_F_RAND_INIT_FIPS 102
+# define RAND_F_SSLEAY_RAND_BYTES 100
+
+/* Reason codes. */
+# define RAND_R_DUAL_EC_DRBG_DISABLED 104
+# define RAND_R_ERROR_INITIALISING_DRBG 102
+# define RAND_R_ERROR_INSTANTIATING_DRBG 103
+# define RAND_R_NO_FIPS_RANDOM_METHOD_SET 101
+# define RAND_R_PRNG_NOT_SEEDED 100
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/deps/openssl/openssl/include/openssl/rc2.h b/deps/openssl/openssl/include/openssl/rc2.h
index f2f2bd1f21c..29d02d7322e 100644
--- a/deps/openssl/openssl/include/openssl/rc2.h
+++ b/deps/openssl/openssl/include/openssl/rc2.h
@@ -1 +1,103 @@
-#include "../../crypto/rc2/rc2.h"
+/* crypto/rc2/rc2.h */
+/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_RC2_H
+# define HEADER_RC2_H
+
+# include <openssl/opensslconf.h>/* OPENSSL_NO_RC2, RC2_INT */
+# ifdef OPENSSL_NO_RC2
+# error RC2 is disabled.
+# endif
+
+# define RC2_ENCRYPT 1
+# define RC2_DECRYPT 0
+
+# define RC2_BLOCK 8
+# define RC2_KEY_LENGTH 16
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct rc2_key_st {
+ RC2_INT data[64];
+} RC2_KEY;
+
+# ifdef OPENSSL_FIPS
+void private_RC2_set_key(RC2_KEY *key, int len, const unsigned char *data,
+ int bits);
+# endif
+void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data, int bits);
+void RC2_ecb_encrypt(const unsigned char *in, unsigned char *out,
+ RC2_KEY *key, int enc);
+void RC2_encrypt(unsigned long *data, RC2_KEY *key);
+void RC2_decrypt(unsigned long *data, RC2_KEY *key);
+void RC2_cbc_encrypt(const unsigned char *in, unsigned char *out, long length,
+ RC2_KEY *ks, unsigned char *iv, int enc);
+void RC2_cfb64_encrypt(const unsigned char *in, unsigned char *out,
+ long length, RC2_KEY *schedule, unsigned char *ivec,
+ int *num, int enc);
+void RC2_ofb64_encrypt(const unsigned char *in, unsigned char *out,
+ long length, RC2_KEY *schedule, unsigned char *ivec,
+ int *num);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/deps/openssl/openssl/include/openssl/rc4.h b/deps/openssl/openssl/include/openssl/rc4.h
index 306de2f406e..39162b1648d 100644
--- a/deps/openssl/openssl/include/openssl/rc4.h
+++ b/deps/openssl/openssl/include/openssl/rc4.h
@@ -1 +1,88 @@
-#include "../../crypto/rc4/rc4.h"
+/* crypto/rc4/rc4.h */
+/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_RC4_H
+# define HEADER_RC4_H
+
+# include <openssl/opensslconf.h>/* OPENSSL_NO_RC4, RC4_INT */
+# ifdef OPENSSL_NO_RC4
+# error RC4 is disabled.
+# endif
+
+# include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct rc4_key_st {
+ RC4_INT x, y;
+ RC4_INT data[256];
+} RC4_KEY;
+
+const char *RC4_options(void);
+void RC4_set_key(RC4_KEY *key, int len, const unsigned char *data);
+void private_RC4_set_key(RC4_KEY *key, int len, const unsigned char *data);
+void RC4(RC4_KEY *key, size_t len, const unsigned char *indata,
+ unsigned char *outdata);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/deps/openssl/openssl/include/openssl/ripemd.h b/deps/openssl/openssl/include/openssl/ripemd.h
index 11351fc819d..b88ef25e724 100644
--- a/deps/openssl/openssl/include/openssl/ripemd.h
+++ b/deps/openssl/openssl/include/openssl/ripemd.h
@@ -1 +1,105 @@
-#include "../../crypto/ripemd/ripemd.h"
+/* crypto/ripemd/ripemd.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_RIPEMD_H
+# define HEADER_RIPEMD_H
+
+# include <openssl/e_os2.h>
+# include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# ifdef OPENSSL_NO_RIPEMD
+# error RIPEMD is disabled.
+# endif
+
+# if defined(__LP32__)
+# define RIPEMD160_LONG unsigned long
+# elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__)
+# define RIPEMD160_LONG unsigned long
+# define RIPEMD160_LONG_LOG2 3
+# else
+# define RIPEMD160_LONG unsigned int
+# endif
+
+# define RIPEMD160_CBLOCK 64
+# define RIPEMD160_LBLOCK (RIPEMD160_CBLOCK/4)
+# define RIPEMD160_DIGEST_LENGTH 20
+
+typedef struct RIPEMD160state_st {
+ RIPEMD160_LONG A, B, C, D, E;
+ RIPEMD160_LONG Nl, Nh;
+ RIPEMD160_LONG data[RIPEMD160_LBLOCK];
+ unsigned int num;
+} RIPEMD160_CTX;
+
+# ifdef OPENSSL_FIPS
+int private_RIPEMD160_Init(RIPEMD160_CTX *c);
+# endif
+int RIPEMD160_Init(RIPEMD160_CTX *c);
+int RIPEMD160_Update(RIPEMD160_CTX *c, const void *data, size_t len);
+int RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c);
+unsigned char *RIPEMD160(const unsigned char *d, size_t n, unsigned char *md);
+void RIPEMD160_Transform(RIPEMD160_CTX *c, const unsigned char *b);
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/deps/openssl/openssl/include/openssl/rsa.h b/deps/openssl/openssl/include/openssl/rsa.h
index 975e5d355ab..d2ee37406e3 100644
--- a/deps/openssl/openssl/include/openssl/rsa.h
+++ b/deps/openssl/openssl/include/openssl/rsa.h
@@ -1 +1,664 @@
-#include "../../crypto/rsa/rsa.h"
+/* crypto/rsa/rsa.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_RSA_H
+# define HEADER_RSA_H
+
+# include <openssl/asn1.h>
+
+# ifndef OPENSSL_NO_BIO
+# include <openssl/bio.h>
+# endif
+# include <openssl/crypto.h>
+# include <openssl/ossl_typ.h>
+# ifndef OPENSSL_NO_DEPRECATED
+# include <openssl/bn.h>
+# endif
+
+# ifdef OPENSSL_NO_RSA
+# error RSA is disabled.
+# endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Declared already in ossl_typ.h */
+/* typedef struct rsa_st RSA; */
+/* typedef struct rsa_meth_st RSA_METHOD; */
+
+struct rsa_meth_st {
+ const char *name;
+ int (*rsa_pub_enc) (int flen, const unsigned char *from,
+ unsigned char *to, RSA *rsa, int padding);
+ int (*rsa_pub_dec) (int flen, const unsigned char *from,
+ unsigned char *to, RSA *rsa, int padding);
+ int (*rsa_priv_enc) (int flen, const unsigned char *from,
+ unsigned char *to, RSA *rsa, int padding);
+ int (*rsa_priv_dec) (int flen, const unsigned char *from,
+ unsigned char *to, RSA *rsa, int padding);
+ /* Can be null */
+ int (*rsa_mod_exp) (BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx);
+ /* Can be null */
+ int (*bn_mod_exp) (BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
+ const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
+ /* called at new */
+ int (*init) (RSA *rsa);
+ /* called at free */
+ int (*finish) (RSA *rsa);
+ /* RSA_METHOD_FLAG_* things */
+ int flags;
+ /* may be needed! */
+ char *app_data;
+ /*
+ * New sign and verify functions: some libraries don't allow arbitrary
+ * data to be signed/verified: this allows them to be used. Note: for
+ * this to work the RSA_public_decrypt() and RSA_private_encrypt() should
+ * *NOT* be used RSA_sign(), RSA_verify() should be used instead. Note:
+ * for backwards compatibility this functionality is only enabled if the
+ * RSA_FLAG_SIGN_VER option is set in 'flags'.
+ */
+ int (*rsa_sign) (int type,
+ const unsigned char *m, unsigned int m_length,
+ unsigned char *sigret, unsigned int *siglen,
+ const RSA *rsa);
+ int (*rsa_verify) (int dtype, const unsigned char *m,
+ unsigned int m_length, const unsigned char *sigbuf,
+ unsigned int siglen, const RSA *rsa);
+ /*
+ * If this callback is NULL, the builtin software RSA key-gen will be
+ * used. This is for behavioural compatibility whilst the code gets
+ * rewired, but one day it would be nice to assume there are no such
+ * things as "builtin software" implementations.
+ */
+ int (*rsa_keygen) (RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb);
+};
+
+struct rsa_st {
+ /*
+ * The first parameter is used to pickup errors where this is passed
+ * instead of aEVP_PKEY, it is set to 0
+ */
+ int pad;
+ long version;
+ const RSA_METHOD *meth;
+ /* functional reference if 'meth' is ENGINE-provided */
+ ENGINE *engine;
+ BIGNUM *n;
+ BIGNUM *e;
+ BIGNUM *d;
+ BIGNUM *p;
+ BIGNUM *q;
+ BIGNUM *dmp1;
+ BIGNUM *dmq1;
+ BIGNUM *iqmp;
+ /* be careful using this if the RSA structure is shared */
+ CRYPTO_EX_DATA ex_data;
+ int references;
+ int flags;
+ /* Used to cache montgomery values */
+ BN_MONT_CTX *_method_mod_n;
+ BN_MONT_CTX *_method_mod_p;
+ BN_MONT_CTX *_method_mod_q;
+ /*
+ * all BIGNUM values are actually in the following data, if it is not
+ * NULL
+ */
+ char *bignum_data;
+ BN_BLINDING *blinding;
+ BN_BLINDING *mt_blinding;
+};
+
+# ifndef OPENSSL_RSA_MAX_MODULUS_BITS
+# define OPENSSL_RSA_MAX_MODULUS_BITS 16384
+# endif
+
+# ifndef OPENSSL_RSA_SMALL_MODULUS_BITS
+# define OPENSSL_RSA_SMALL_MODULUS_BITS 3072
+# endif
+# ifndef OPENSSL_RSA_MAX_PUBEXP_BITS
+
+/* exponent limit enforced for "large" modulus only */
+# define OPENSSL_RSA_MAX_PUBEXP_BITS 64
+# endif
+
+# define RSA_3 0x3L
+# define RSA_F4 0x10001L
+
+# define RSA_METHOD_FLAG_NO_CHECK 0x0001/* don't check pub/private
+ * match */
+
+# define RSA_FLAG_CACHE_PUBLIC 0x0002
+# define RSA_FLAG_CACHE_PRIVATE 0x0004
+# define RSA_FLAG_BLINDING 0x0008
+# define RSA_FLAG_THREAD_SAFE 0x0010
+/*
+ * This flag means the private key operations will be handled by rsa_mod_exp
+ * and that they do not depend on the private key components being present:
+ * for example a key stored in external hardware. Without this flag
+ * bn_mod_exp gets called when private key components are absent.
+ */
+# define RSA_FLAG_EXT_PKEY 0x0020
+
+/*
+ * This flag in the RSA_METHOD enables the new rsa_sign, rsa_verify
+ * functions.
+ */
+# define RSA_FLAG_SIGN_VER 0x0040
+
+/*
+ * new with 0.9.6j and 0.9.7b; the built-in
+ * RSA implementation now uses blinding by
+ * default (ignoring RSA_FLAG_BLINDING),
+ * but other engines might not need it
+ */
+# define RSA_FLAG_NO_BLINDING 0x0080
+/*
+ * new with 0.9.8f; the built-in RSA
+ * implementation now uses constant time
+ * operations by default in private key operations,
+ * e.g., constant time modular exponentiation,
+ * modular inverse without leaking branches,
+ * division without leaking branches. This
+ * flag disables these constant time
+ * operations and results in faster RSA
+ * private key operations.
+ */
+# define RSA_FLAG_NO_CONSTTIME 0x0100
+# ifdef OPENSSL_USE_DEPRECATED
+/* deprecated name for the flag*/
+/*
+ * new with 0.9.7h; the built-in RSA
+ * implementation now uses constant time
+ * modular exponentiation for secret exponents
+ * by default. This flag causes the
+ * faster variable sliding window method to
+ * be used for all exponents.
+ */
+# define RSA_FLAG_NO_EXP_CONSTTIME RSA_FLAG_NO_CONSTTIME
+# endif
+
+# define EVP_PKEY_CTX_set_rsa_padding(ctx, pad) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, -1, EVP_PKEY_CTRL_RSA_PADDING, \
+ pad, NULL)
+
+# define EVP_PKEY_CTX_get_rsa_padding(ctx, ppad) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, -1, \
+ EVP_PKEY_CTRL_GET_RSA_PADDING, 0, ppad)
+
+# define EVP_PKEY_CTX_set_rsa_pss_saltlen(ctx, len) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, \
+ (EVP_PKEY_OP_SIGN|EVP_PKEY_OP_VERIFY), \
+ EVP_PKEY_CTRL_RSA_PSS_SALTLEN, \
+ len, NULL)
+
+# define EVP_PKEY_CTX_get_rsa_pss_saltlen(ctx, plen) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, \
+ (EVP_PKEY_OP_SIGN|EVP_PKEY_OP_VERIFY), \
+ EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN, \
+ 0, plen)
+
+# define EVP_PKEY_CTX_set_rsa_keygen_bits(ctx, bits) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_KEYGEN, \
+ EVP_PKEY_CTRL_RSA_KEYGEN_BITS, bits, NULL)
+
+# define EVP_PKEY_CTX_set_rsa_keygen_pubexp(ctx, pubexp) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_KEYGEN, \
+ EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP, 0, pubexp)
+
+# define EVP_PKEY_CTX_set_rsa_mgf1_md(ctx, md) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, \
+ EVP_PKEY_OP_TYPE_SIG | EVP_PKEY_OP_TYPE_CRYPT, \
+ EVP_PKEY_CTRL_RSA_MGF1_MD, 0, (void *)md)
+
+# define EVP_PKEY_CTX_set_rsa_oaep_md(ctx, md) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT, \
+ EVP_PKEY_CTRL_RSA_OAEP_MD, 0, (void *)md)
+
+# define EVP_PKEY_CTX_get_rsa_mgf1_md(ctx, pmd) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, \
+ EVP_PKEY_OP_TYPE_SIG | EVP_PKEY_OP_TYPE_CRYPT, \
+ EVP_PKEY_CTRL_GET_RSA_MGF1_MD, 0, (void *)pmd)
+
+# define EVP_PKEY_CTX_get_rsa_oaep_md(ctx, pmd) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT, \
+ EVP_PKEY_CTRL_GET_RSA_OAEP_MD, 0, (void *)pmd)
+
+# define EVP_PKEY_CTX_set0_rsa_oaep_label(ctx, l, llen) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT, \
+ EVP_PKEY_CTRL_RSA_OAEP_LABEL, llen, (void *)l)
+
+# define EVP_PKEY_CTX_get0_rsa_oaep_label(ctx, l) \
+ EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT, \
+ EVP_PKEY_CTRL_GET_RSA_OAEP_LABEL, 0, (void *)l)
+
+# define EVP_PKEY_CTRL_RSA_PADDING (EVP_PKEY_ALG_CTRL + 1)
+# define EVP_PKEY_CTRL_RSA_PSS_SALTLEN (EVP_PKEY_ALG_CTRL + 2)
+
+# define EVP_PKEY_CTRL_RSA_KEYGEN_BITS (EVP_PKEY_ALG_CTRL + 3)
+# define EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP (EVP_PKEY_ALG_CTRL + 4)
+# define EVP_PKEY_CTRL_RSA_MGF1_MD (EVP_PKEY_ALG_CTRL + 5)
+
+# define EVP_PKEY_CTRL_GET_RSA_PADDING (EVP_PKEY_ALG_CTRL + 6)
+# define EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN (EVP_PKEY_ALG_CTRL + 7)
+# define EVP_PKEY_CTRL_GET_RSA_MGF1_MD (EVP_PKEY_ALG_CTRL + 8)
+
+# define EVP_PKEY_CTRL_RSA_OAEP_MD (EVP_PKEY_ALG_CTRL + 9)
+# define EVP_PKEY_CTRL_RSA_OAEP_LABEL (EVP_PKEY_ALG_CTRL + 10)
+
+# define EVP_PKEY_CTRL_GET_RSA_OAEP_MD (EVP_PKEY_ALG_CTRL + 11)
+# define EVP_PKEY_CTRL_GET_RSA_OAEP_LABEL (EVP_PKEY_ALG_CTRL + 12)
+
+# define RSA_PKCS1_PADDING 1
+# define RSA_SSLV23_PADDING 2
+# define RSA_NO_PADDING 3
+# define RSA_PKCS1_OAEP_PADDING 4
+# define RSA_X931_PADDING 5
+/* EVP_PKEY_ only */
+# define RSA_PKCS1_PSS_PADDING 6
+
+# define RSA_PKCS1_PADDING_SIZE 11
+
+# define RSA_set_app_data(s,arg) RSA_set_ex_data(s,0,arg)
+# define RSA_get_app_data(s) RSA_get_ex_data(s,0)
+
+RSA *RSA_new(void);
+RSA *RSA_new_method(ENGINE *engine);
+int RSA_size(const RSA *rsa);
+
+/* Deprecated version */
+# ifndef OPENSSL_NO_DEPRECATED
+RSA *RSA_generate_key(int bits, unsigned long e, void
+ (*callback) (int, int, void *), void *cb_arg);
+# endif /* !defined(OPENSSL_NO_DEPRECATED) */
+
+/* New version */
+int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb);
+
+int RSA_check_key(const RSA *);
+ /* next 4 return -1 on error */
+int RSA_public_encrypt(int flen, const unsigned char *from,
+ unsigned char *to, RSA *rsa, int padding);
+int RSA_private_encrypt(int flen, const unsigned char *from,
+ unsigned char *to, RSA *rsa, int padding);
+int RSA_public_decrypt(int flen, const unsigned char *from,
+ unsigned char *to, RSA *rsa, int padding);
+int RSA_private_decrypt(int flen, const unsigned char *from,
+ unsigned char *to, RSA *rsa, int padding);
+void RSA_free(RSA *r);
+/* "up" the RSA object's reference count */
+int RSA_up_ref(RSA *r);
+
+int RSA_flags(const RSA *r);
+
+void RSA_set_default_method(const RSA_METHOD *meth);
+const RSA_METHOD *RSA_get_default_method(void);
+const RSA_METHOD *RSA_get_method(const RSA *rsa);
+int RSA_set_method(RSA *rsa, const RSA_METHOD *meth);
+
+/* This function needs the memory locking malloc callbacks to be installed */
+int RSA_memory_lock(RSA *r);
+
+/* these are the actual SSLeay RSA functions */
+const RSA_METHOD *RSA_PKCS1_SSLeay(void);
+
+const RSA_METHOD *RSA_null_method(void);
+
+DECLARE_ASN1_ENCODE_FUNCTIONS_const(RSA, RSAPublicKey)
+DECLARE_ASN1_ENCODE_FUNCTIONS_const(RSA, RSAPrivateKey)
+
+typedef struct rsa_pss_params_st {
+ X509_ALGOR *hashAlgorithm;
+ X509_ALGOR *maskGenAlgorithm;
+ ASN1_INTEGER *saltLength;
+ ASN1_INTEGER *trailerField;
+} RSA_PSS_PARAMS;
+
+DECLARE_ASN1_FUNCTIONS(RSA_PSS_PARAMS)
+
+typedef struct rsa_oaep_params_st {
+ X509_ALGOR *hashFunc;
+ X509_ALGOR *maskGenFunc;
+ X509_ALGOR *pSourceFunc;
+} RSA_OAEP_PARAMS;
+
+DECLARE_ASN1_FUNCTIONS(RSA_OAEP_PARAMS)
+
+# ifndef OPENSSL_NO_FP_API
+int RSA_print_fp(FILE *fp, const RSA *r, int offset);
+# endif
+
+# ifndef OPENSSL_NO_BIO
+int RSA_print(BIO *bp, const RSA *r, int offset);
+# endif
+
+# ifndef OPENSSL_NO_RC4
+int i2d_RSA_NET(const RSA *a, unsigned char **pp,
+ int (*cb) (char *buf, int len, const char *prompt,
+ int verify), int sgckey);
+RSA *d2i_RSA_NET(RSA **a, const unsigned char **pp, long length,
+ int (*cb) (char *buf, int len, const char *prompt,
+ int verify), int sgckey);
+
+int i2d_Netscape_RSA(const RSA *a, unsigned char **pp,
+ int (*cb) (char *buf, int len, const char *prompt,
+ int verify));
+RSA *d2i_Netscape_RSA(RSA **a, const unsigned char **pp, long length,
+ int (*cb) (char *buf, int len, const char *prompt,
+ int verify));
+# endif
+
+/*
+ * The following 2 functions sign and verify a X509_SIG ASN1 object inside
+ * PKCS#1 padded RSA encryption
+ */
+int RSA_sign(int type, const unsigned char *m, unsigned int m_length,
+ unsigned char *sigret, unsigned int *siglen, RSA *rsa);
+int RSA_verify(int type, const unsigned char *m, unsigned int m_length,
+ const unsigned char *sigbuf, unsigned int siglen, RSA *rsa);
+
+/*
+ * The following 2 function sign and verify a ASN1_OCTET_STRING object inside
+ * PKCS#1 padded RSA encryption
+ */
+int RSA_sign_ASN1_OCTET_STRING(int type,
+ const unsigned char *m, unsigned int m_length,
+ unsigned char *sigret, unsigned int *siglen,
+ RSA *rsa);
+int RSA_verify_ASN1_OCTET_STRING(int type, const unsigned char *m,
+ unsigned int m_length, unsigned char *sigbuf,
+ unsigned int siglen, RSA *rsa);
+
+int RSA_blinding_on(RSA *rsa, BN_CTX *ctx);
+void RSA_blinding_off(RSA *rsa);
+BN_BLINDING *RSA_setup_blinding(RSA *rsa, BN_CTX *ctx);
+
+int RSA_padding_add_PKCS1_type_1(unsigned char *to, int tlen,
+ const unsigned char *f, int fl);
+int RSA_padding_check_PKCS1_type_1(unsigned char *to, int tlen,
+ const unsigned char *f, int fl,
+ int rsa_len);
+int RSA_padding_add_PKCS1_type_2(unsigned char *to, int tlen,
+ const unsigned char *f, int fl);
+int RSA_padding_check_PKCS1_type_2(unsigned char *to, int tlen,
+ const unsigned char *f, int fl,
+ int rsa_len);
+int PKCS1_MGF1(unsigned char *mask, long len, const unsigned char *seed,
+ long seedlen, const EVP_MD *dgst);
+int RSA_padding_add_PKCS1_OAEP(unsigned char *to, int tlen,
+ const unsigned char *f, int fl,
+ const unsigned char *p, int pl);
+int RSA_padding_check_PKCS1_OAEP(unsigned char *to, int tlen,
+ const unsigned char *f, int fl, int rsa_len,
+ const unsigned char *p, int pl);
+int RSA_padding_add_PKCS1_OAEP_mgf1(unsigned char *to, int tlen,
+ const unsigned char *from, int flen,
+ const unsigned char *param, int plen,
+ const EVP_MD *md, const EVP_MD *mgf1md);
+int RSA_padding_check_PKCS1_OAEP_mgf1(unsigned char *to, int tlen,
+ const unsigned char *from, int flen,
+ int num, const unsigned char *param,
+ int plen, const EVP_MD *md,
+ const EVP_MD *mgf1md);
+int RSA_padding_add_SSLv23(unsigned char *to, int tlen,
+ const unsigned char *f, int fl);
+int RSA_padding_check_SSLv23(unsigned char *to, int tlen,
+ const unsigned char *f, int fl, int rsa_len);
+int RSA_padding_add_none(unsigned char *to, int tlen, const unsigned char *f,
+ int fl);
+int RSA_padding_check_none(unsigned char *to, int tlen,
+ const unsigned char *f, int fl, int rsa_len);
+int RSA_padding_add_X931(unsigned char *to, int tlen, const unsigned char *f,
+ int fl);
+int RSA_padding_check_X931(unsigned char *to, int tlen,
+ const unsigned char *f, int fl, int rsa_len);
+int RSA_X931_hash_id(int nid);
+
+int RSA_verify_PKCS1_PSS(RSA *rsa, const unsigned char *mHash,
+ const EVP_MD *Hash, const unsigned char *EM,
+ int sLen);
+int RSA_padding_add_PKCS1_PSS(RSA *rsa, unsigned char *EM,
+ const unsigned char *mHash, const EVP_MD *Hash,
+ int sLen);
+
+int RSA_verify_PKCS1_PSS_mgf1(RSA *rsa, const unsigned char *mHash,
+ const EVP_MD *Hash, const EVP_MD *mgf1Hash,
+ const unsigned char *EM, int sLen);
+
+int RSA_padding_add_PKCS1_PSS_mgf1(RSA *rsa, unsigned char *EM,
+ const unsigned char *mHash,
+ const EVP_MD *Hash, const EVP_MD *mgf1Hash,
+ int sLen);
+
+int RSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
+ CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
+int RSA_set_ex_data(RSA *r, int idx, void *arg);
+void *RSA_get_ex_data(const RSA *r, int idx);
+
+RSA *RSAPublicKey_dup(RSA *rsa);
+RSA *RSAPrivateKey_dup(RSA *rsa);
+
+/*
+ * If this flag is set the RSA method is FIPS compliant and can be used in
+ * FIPS mode. This is set in the validated module method. If an application
+ * sets this flag in its own methods it is its responsibility to ensure the
+ * result is compliant.
+ */
+
+# define RSA_FLAG_FIPS_METHOD 0x0400
+
+/*
+ * If this flag is set the operations normally disabled in FIPS mode are
+ * permitted it is then the applications responsibility to ensure that the
+ * usage is compliant.
+ */
+
+# define RSA_FLAG_NON_FIPS_ALLOW 0x0400
+/*
+ * Application has decided PRNG is good enough to generate a key: don't
+ * check.
+ */
+# define RSA_FLAG_CHECKED 0x0800
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_RSA_strings(void);
+
+/* Error codes for the RSA functions. */
+
+/* Function codes. */
+# define RSA_F_CHECK_PADDING_MD 140
+# define RSA_F_DO_RSA_PRINT 146
+# define RSA_F_INT_RSA_VERIFY 145
+# define RSA_F_MEMORY_LOCK 100
+# define RSA_F_OLD_RSA_PRIV_DECODE 147
+# define RSA_F_PKEY_RSA_CTRL 143
+# define RSA_F_PKEY_RSA_CTRL_STR 144
+# define RSA_F_PKEY_RSA_SIGN 142
+# define RSA_F_PKEY_RSA_VERIFY 154
+# define RSA_F_PKEY_RSA_VERIFYRECOVER 141
+# define RSA_F_RSA_ALGOR_TO_MD 157
+# define RSA_F_RSA_BUILTIN_KEYGEN 129
+# define RSA_F_RSA_CHECK_KEY 123
+# define RSA_F_RSA_CMS_DECRYPT 158
+# define RSA_F_RSA_EAY_PRIVATE_DECRYPT 101
+# define RSA_F_RSA_EAY_PRIVATE_ENCRYPT 102
+# define RSA_F_RSA_EAY_PUBLIC_DECRYPT 103
+# define RSA_F_RSA_EAY_PUBLIC_ENCRYPT 104
+# define RSA_F_RSA_GENERATE_KEY 105
+# define RSA_F_RSA_GENERATE_KEY_EX 155
+# define RSA_F_RSA_ITEM_VERIFY 156
+# define RSA_F_RSA_MEMORY_LOCK 130
+# define RSA_F_RSA_MGF1_TO_MD 159
+# define RSA_F_RSA_NEW_METHOD 106
+# define RSA_F_RSA_NULL 124
+# define RSA_F_RSA_NULL_MOD_EXP 131
+# define RSA_F_RSA_NULL_PRIVATE_DECRYPT 132
+# define RSA_F_RSA_NULL_PRIVATE_ENCRYPT 133
+# define RSA_F_RSA_NULL_PUBLIC_DECRYPT 134
+# define RSA_F_RSA_NULL_PUBLIC_ENCRYPT 135
+# define RSA_F_RSA_PADDING_ADD_NONE 107
+# define RSA_F_RSA_PADDING_ADD_PKCS1_OAEP 121
+# define RSA_F_RSA_PADDING_ADD_PKCS1_OAEP_MGF1 160
+# define RSA_F_RSA_PADDING_ADD_PKCS1_PSS 125
+# define RSA_F_RSA_PADDING_ADD_PKCS1_PSS_MGF1 148
+# define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_1 108
+# define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_2 109
+# define RSA_F_RSA_PADDING_ADD_SSLV23 110
+# define RSA_F_RSA_PADDING_ADD_X931 127
+# define RSA_F_RSA_PADDING_CHECK_NONE 111
+# define RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP 122
+# define RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP_MGF1 161
+# define RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_1 112
+# define RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_2 113
+# define RSA_F_RSA_PADDING_CHECK_SSLV23 114
+# define RSA_F_RSA_PADDING_CHECK_X931 128
+# define RSA_F_RSA_PRINT 115
+# define RSA_F_RSA_PRINT_FP 116
+# define RSA_F_RSA_PRIVATE_DECRYPT 150
+# define RSA_F_RSA_PRIVATE_ENCRYPT 151
+# define RSA_F_RSA_PRIV_DECODE 137
+# define RSA_F_RSA_PRIV_ENCODE 138
+# define RSA_F_RSA_PSS_TO_CTX 162
+# define RSA_F_RSA_PUBLIC_DECRYPT 152
+# define RSA_F_RSA_PUBLIC_ENCRYPT 153
+# define RSA_F_RSA_PUB_DECODE 139
+# define RSA_F_RSA_SETUP_BLINDING 136
+# define RSA_F_RSA_SIGN 117
+# define RSA_F_RSA_SIGN_ASN1_OCTET_STRING 118
+# define RSA_F_RSA_VERIFY 119
+# define RSA_F_RSA_VERIFY_ASN1_OCTET_STRING 120
+# define RSA_F_RSA_VERIFY_PKCS1_PSS 126
+# define RSA_F_RSA_VERIFY_PKCS1_PSS_MGF1 149
+
+/* Reason codes. */
+# define RSA_R_ALGORITHM_MISMATCH 100
+# define RSA_R_BAD_E_VALUE 101
+# define RSA_R_BAD_FIXED_HEADER_DECRYPT 102
+# define RSA_R_BAD_PAD_BYTE_COUNT 103
+# define RSA_R_BAD_SIGNATURE 104
+# define RSA_R_BLOCK_TYPE_IS_NOT_01 106
+# define RSA_R_BLOCK_TYPE_IS_NOT_02 107
+# define RSA_R_DATA_GREATER_THAN_MOD_LEN 108
+# define RSA_R_DATA_TOO_LARGE 109
+# define RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 110
+# define RSA_R_DATA_TOO_LARGE_FOR_MODULUS 132
+# define RSA_R_DATA_TOO_SMALL 111
+# define RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE 122
+# define RSA_R_DIGEST_DOES_NOT_MATCH 166
+# define RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY 112
+# define RSA_R_DMP1_NOT_CONGRUENT_TO_D 124
+# define RSA_R_DMQ1_NOT_CONGRUENT_TO_D 125
+# define RSA_R_D_E_NOT_CONGRUENT_TO_1 123
+# define RSA_R_FIRST_OCTET_INVALID 133
+# define RSA_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE 144
+# define RSA_R_INVALID_DIGEST 160
+# define RSA_R_INVALID_DIGEST_LENGTH 143
+# define RSA_R_INVALID_HEADER 137
+# define RSA_R_INVALID_KEYBITS 145
+# define RSA_R_INVALID_LABEL 161
+# define RSA_R_INVALID_MESSAGE_LENGTH 131
+# define RSA_R_INVALID_MGF1_MD 156
+# define RSA_R_INVALID_OAEP_PARAMETERS 162
+# define RSA_R_INVALID_PADDING 138
+# define RSA_R_INVALID_PADDING_MODE 141
+# define RSA_R_INVALID_PSS_PARAMETERS 149
+# define RSA_R_INVALID_PSS_SALTLEN 146
+# define RSA_R_INVALID_SALT_LENGTH 150
+# define RSA_R_INVALID_TRAILER 139
+# define RSA_R_INVALID_X931_DIGEST 142
+# define RSA_R_IQMP_NOT_INVERSE_OF_Q 126
+# define RSA_R_KEY_SIZE_TOO_SMALL 120
+# define RSA_R_LAST_OCTET_INVALID 134
+# define RSA_R_MODULUS_TOO_LARGE 105
+# define RSA_R_NON_FIPS_RSA_METHOD 157
+# define RSA_R_NO_PUBLIC_EXPONENT 140
+# define RSA_R_NULL_BEFORE_BLOCK_MISSING 113
+# define RSA_R_N_DOES_NOT_EQUAL_P_Q 127
+# define RSA_R_OAEP_DECODING_ERROR 121
+# define RSA_R_OPERATION_NOT_ALLOWED_IN_FIPS_MODE 158
+# define RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 148
+# define RSA_R_PADDING_CHECK_FAILED 114
+# define RSA_R_PKCS_DECODING_ERROR 159
+# define RSA_R_P_NOT_PRIME 128
+# define RSA_R_Q_NOT_PRIME 129
+# define RSA_R_RSA_OPERATIONS_NOT_SUPPORTED 130
+# define RSA_R_SLEN_CHECK_FAILED 136
+# define RSA_R_SLEN_RECOVERY_FAILED 135
+# define RSA_R_SSLV3_ROLLBACK_ATTACK 115
+# define RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 116
+# define RSA_R_UNKNOWN_ALGORITHM_TYPE 117
+# define RSA_R_UNKNOWN_DIGEST 163
+# define RSA_R_UNKNOWN_MASK_DIGEST 151
+# define RSA_R_UNKNOWN_PADDING_TYPE 118
+# define RSA_R_UNKNOWN_PSS_DIGEST 152
+# define RSA_R_UNSUPPORTED_ENCRYPTION_TYPE 164
+# define RSA_R_UNSUPPORTED_LABEL_SOURCE 165
+# define RSA_R_UNSUPPORTED_MASK_ALGORITHM 153
+# define RSA_R_UNSUPPORTED_MASK_PARAMETER 154
+# define RSA_R_UNSUPPORTED_SIGNATURE_TYPE 155
+# define RSA_R_VALUE_MISSING 147
+# define RSA_R_WRONG_SIGNATURE_LENGTH 119
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/deps/openssl/openssl/include/openssl/safestack.h b/deps/openssl/openssl/include/openssl/safestack.h
index 8a282b858ba..1d4f87eab34 100644
--- a/deps/openssl/openssl/include/openssl/safestack.h
+++ b/deps/openssl/openssl/include/openssl/safestack.h
@@ -1 +1,2672 @@
-#include "../../crypto/stack/safestack.h"
+/* ====================================================================
+ * Copyright (c) 1999 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+#ifndef HEADER_SAFESTACK_H
+# define HEADER_SAFESTACK_H
+
+# include <openssl/stack.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# ifndef CHECKED_PTR_OF
+# define CHECKED_PTR_OF(type, p) \
+ ((void*) (1 ? p : (type*)0))
+# endif
+
+/*
+ * In C++ we get problems because an explicit cast is needed from (void *) we
+ * use CHECKED_STACK_OF to ensure the correct type is passed in the macros
+ * below.
+ */
+
+# define CHECKED_STACK_OF(type, p) \
+ ((_STACK*) (1 ? p : (STACK_OF(type)*)0))
+
+# define CHECKED_SK_COPY_FUNC(type, p) \
+ ((void *(*)(void *)) ((1 ? p : (type *(*)(const type *))0)))
+
+# define CHECKED_SK_FREE_FUNC(type, p) \
+ ((void (*)(void *)) ((1 ? p : (void (*)(type *))0)))
+
+# define CHECKED_SK_CMP_FUNC(type, p) \
+ ((int (*)(const void *, const void *)) \
+ ((1 ? p : (int (*)(const type * const *, const type * const *))0)))
+
+# define STACK_OF(type) struct stack_st_##type
+# define PREDECLARE_STACK_OF(type) STACK_OF(type);
+
+# define DECLARE_STACK_OF(type) \
+STACK_OF(type) \
+ { \
+ _STACK stack; \
+ };
+# define DECLARE_SPECIAL_STACK_OF(type, type2) \
+STACK_OF(type) \
+ { \
+ _STACK stack; \
+ };
+
+/* nada (obsolete in new safestack approach)*/
+# define IMPLEMENT_STACK_OF(type)
+
+/*-
+ * Strings are special: normally an lhash entry will point to a single
+ * (somewhat) mutable object. In the case of strings:
+ *
+ * a) Instead of a single char, there is an array of chars, NUL-terminated.
+ * b) The string may have be immutable.
+ *
+ * So, they need their own declarations. Especially important for
+ * type-checking tools, such as Deputy.
+ *
+ * In practice, however, it appears to be hard to have a const
+ * string. For now, I'm settling for dealing with the fact it is a
+ * string at all.
+ */
+typedef char *OPENSSL_STRING;
+
+typedef const char *OPENSSL_CSTRING;
+
+/*
+ * Confusingly, LHASH_OF(STRING) deals with char ** throughout, but
+ * STACK_OF(STRING) is really more like STACK_OF(char), only, as mentioned
+ * above, instead of a single char each entry is a NUL-terminated array of
+ * chars. So, we have to implement STRING specially for STACK_OF. This is
+ * dealt with in the autogenerated macros below.
+ */
+
+DECLARE_SPECIAL_STACK_OF(OPENSSL_STRING, char)
+
+/*
+ * Similarly, we sometimes use a block of characters, NOT nul-terminated.
+ * These should also be distinguished from "normal" stacks.
+ */
+typedef void *OPENSSL_BLOCK;
+DECLARE_SPECIAL_STACK_OF(OPENSSL_BLOCK, void)
+
+/*
+ * SKM_sk_... stack macros are internal to safestack.h: never use them
+ * directly, use sk_<type>_... instead
+ */
+# define SKM_sk_new(type, cmp) \
+ ((STACK_OF(type) *)sk_new(CHECKED_SK_CMP_FUNC(type, cmp)))
+# define SKM_sk_new_null(type) \
+ ((STACK_OF(type) *)sk_new_null())
+# define SKM_sk_free(type, st) \
+ sk_free(CHECKED_STACK_OF(type, st))
+# define SKM_sk_num(type, st) \
+ sk_num(CHECKED_STACK_OF(type, st))
+# define SKM_sk_value(type, st,i) \
+ ((type *)sk_value(CHECKED_STACK_OF(type, st), i))
+# define SKM_sk_set(type, st,i,val) \
+ sk_set(CHECKED_STACK_OF(type, st), i, CHECKED_PTR_OF(type, val))
+# define SKM_sk_zero(type, st) \
+ sk_zero(CHECKED_STACK_OF(type, st))
+# define SKM_sk_push(type, st, val) \
+ sk_push(CHECKED_STACK_OF(type, st), CHECKED_PTR_OF(type, val))
+# define SKM_sk_unshift(type, st, val) \
+ sk_unshift(CHECKED_STACK_OF(type, st), CHECKED_PTR_OF(type, val))
+# define SKM_sk_find(type, st, val) \
+ sk_find(CHECKED_STACK_OF(type, st), CHECKED_PTR_OF(type, val))
+# define SKM_sk_find_ex(type, st, val) \
+ sk_find_ex(CHECKED_STACK_OF(type, st), \
+ CHECKED_PTR_OF(type, val))
+# define SKM_sk_delete(type, st, i) \
+ (type *)sk_delete(CHECKED_STACK_OF(type, st), i)
+# define SKM_sk_delete_ptr(type, st, ptr) \
+ (type *)sk_delete_ptr(CHECKED_STACK_OF(type, st), CHECKED_PTR_OF(type, ptr))
+# define SKM_sk_insert(type, st,val, i) \
+ sk_insert(CHECKED_STACK_OF(type, st), CHECKED_PTR_OF(type, val), i)
+# define SKM_sk_set_cmp_func(type, st, cmp) \
+ ((int (*)(const type * const *,const type * const *)) \
+ sk_set_cmp_func(CHECKED_STACK_OF(type, st), CHECKED_SK_CMP_FUNC(type, cmp)))
+# define SKM_sk_dup(type, st) \
+ (STACK_OF(type) *)sk_dup(CHECKED_STACK_OF(type, st))
+# define SKM_sk_pop_free(type, st, free_func) \
+ sk_pop_free(CHECKED_STACK_OF(type, st), CHECKED_SK_FREE_FUNC(type, free_func))
+# define SKM_sk_deep_copy(type, st, copy_func, free_func) \
+ (STACK_OF(type) *)sk_deep_copy(CHECKED_STACK_OF(type, st), CHECKED_SK_COPY_FUNC(type, copy_func), CHECKED_SK_FREE_FUNC(type, free_func))
+# define SKM_sk_shift(type, st) \
+ (type *)sk_shift(CHECKED_STACK_OF(type, st))
+# define SKM_sk_pop(type, st) \
+ (type *)sk_pop(CHECKED_STACK_OF(type, st))
+# define SKM_sk_sort(type, st) \
+ sk_sort(CHECKED_STACK_OF(type, st))
+# define SKM_sk_is_sorted(type, st) \
+ sk_is_sorted(CHECKED_STACK_OF(type, st))
+# define SKM_ASN1_SET_OF_d2i(type, st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ (STACK_OF(type) *)d2i_ASN1_SET( \
+ (STACK_OF(OPENSSL_BLOCK) **)CHECKED_PTR_OF(STACK_OF(type)*, st), \
+ pp, length, \
+ CHECKED_D2I_OF(type, d2i_func), \
+ CHECKED_SK_FREE_FUNC(type, free_func), \
+ ex_tag, ex_class)
+# define SKM_ASN1_SET_OF_i2d(type, st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ i2d_ASN1_SET((STACK_OF(OPENSSL_BLOCK) *)CHECKED_STACK_OF(type, st), pp, \
+ CHECKED_I2D_OF(type, i2d_func), \
+ ex_tag, ex_class, is_set)
+# define SKM_ASN1_seq_pack(type, st, i2d_func, buf, len) \
+ ASN1_seq_pack(CHECKED_PTR_OF(STACK_OF(type), st), \
+ CHECKED_I2D_OF(type, i2d_func), buf, len)
+# define SKM_ASN1_seq_unpack(type, buf, len, d2i_func, free_func) \
+ (STACK_OF(type) *)ASN1_seq_unpack(buf, len, CHECKED_D2I_OF(type, d2i_func), CHECKED_SK_FREE_FUNC(type, free_func))
+# define SKM_PKCS12_decrypt_d2i(type, algor, d2i_func, free_func, pass, passlen, oct, seq) \
+ (STACK_OF(type) *)PKCS12_decrypt_d2i(algor, \
+ CHECKED_D2I_OF(type, d2i_func), \
+ CHECKED_SK_FREE_FUNC(type, free_func), \
+ pass, passlen, oct, seq)
+/*
+ * This block of defines is updated by util/mkstack.pl, please do not touch!
+ */
+# define sk_ACCESS_DESCRIPTION_new(cmp) SKM_sk_new(ACCESS_DESCRIPTION, (cmp))
+# define sk_ACCESS_DESCRIPTION_new_null() SKM_sk_new_null(ACCESS_DESCRIPTION)
+# define sk_ACCESS_DESCRIPTION_free(st) SKM_sk_free(ACCESS_DESCRIPTION, (st))
+# define sk_ACCESS_DESCRIPTION_num(st) SKM_sk_num(ACCESS_DESCRIPTION, (st))
+# define sk_ACCESS_DESCRIPTION_value(st, i) SKM_sk_value(ACCESS_DESCRIPTION, (st), (i))
+# define sk_ACCESS_DESCRIPTION_set(st, i, val) SKM_sk_set(ACCESS_DESCRIPTION, (st), (i), (val))
+# define sk_ACCESS_DESCRIPTION_zero(st) SKM_sk_zero(ACCESS_DESCRIPTION, (st))
+# define sk_ACCESS_DESCRIPTION_push(st, val) SKM_sk_push(ACCESS_DESCRIPTION, (st), (val))
+# define sk_ACCESS_DESCRIPTION_unshift(st, val) SKM_sk_unshift(ACCESS_DESCRIPTION, (st), (val))
+# define sk_ACCESS_DESCRIPTION_find(st, val) SKM_sk_find(ACCESS_DESCRIPTION, (st), (val))
+# define sk_ACCESS_DESCRIPTION_find_ex(st, val) SKM_sk_find_ex(ACCESS_DESCRIPTION, (st), (val))
+# define sk_ACCESS_DESCRIPTION_delete(st, i) SKM_sk_delete(ACCESS_DESCRIPTION, (st), (i))
+# define sk_ACCESS_DESCRIPTION_delete_ptr(st, ptr) SKM_sk_delete_ptr(ACCESS_DESCRIPTION, (st), (ptr))
+# define sk_ACCESS_DESCRIPTION_insert(st, val, i) SKM_sk_insert(ACCESS_DESCRIPTION, (st), (val), (i))
+# define sk_ACCESS_DESCRIPTION_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ACCESS_DESCRIPTION, (st), (cmp))
+# define sk_ACCESS_DESCRIPTION_dup(st) SKM_sk_dup(ACCESS_DESCRIPTION, st)
+# define sk_ACCESS_DESCRIPTION_pop_free(st, free_func) SKM_sk_pop_free(ACCESS_DESCRIPTION, (st), (free_func))
+# define sk_ACCESS_DESCRIPTION_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ACCESS_DESCRIPTION, (st), (copy_func), (free_func))
+# define sk_ACCESS_DESCRIPTION_shift(st) SKM_sk_shift(ACCESS_DESCRIPTION, (st))
+# define sk_ACCESS_DESCRIPTION_pop(st) SKM_sk_pop(ACCESS_DESCRIPTION, (st))
+# define sk_ACCESS_DESCRIPTION_sort(st) SKM_sk_sort(ACCESS_DESCRIPTION, (st))
+# define sk_ACCESS_DESCRIPTION_is_sorted(st) SKM_sk_is_sorted(ACCESS_DESCRIPTION, (st))
+# define sk_ASIdOrRange_new(cmp) SKM_sk_new(ASIdOrRange, (cmp))
+# define sk_ASIdOrRange_new_null() SKM_sk_new_null(ASIdOrRange)
+# define sk_ASIdOrRange_free(st) SKM_sk_free(ASIdOrRange, (st))
+# define sk_ASIdOrRange_num(st) SKM_sk_num(ASIdOrRange, (st))
+# define sk_ASIdOrRange_value(st, i) SKM_sk_value(ASIdOrRange, (st), (i))
+# define sk_ASIdOrRange_set(st, i, val) SKM_sk_set(ASIdOrRange, (st), (i), (val))
+# define sk_ASIdOrRange_zero(st) SKM_sk_zero(ASIdOrRange, (st))
+# define sk_ASIdOrRange_push(st, val) SKM_sk_push(ASIdOrRange, (st), (val))
+# define sk_ASIdOrRange_unshift(st, val) SKM_sk_unshift(ASIdOrRange, (st), (val))
+# define sk_ASIdOrRange_find(st, val) SKM_sk_find(ASIdOrRange, (st), (val))
+# define sk_ASIdOrRange_find_ex(st, val) SKM_sk_find_ex(ASIdOrRange, (st), (val))
+# define sk_ASIdOrRange_delete(st, i) SKM_sk_delete(ASIdOrRange, (st), (i))
+# define sk_ASIdOrRange_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASIdOrRange, (st), (ptr))
+# define sk_ASIdOrRange_insert(st, val, i) SKM_sk_insert(ASIdOrRange, (st), (val), (i))
+# define sk_ASIdOrRange_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASIdOrRange, (st), (cmp))
+# define sk_ASIdOrRange_dup(st) SKM_sk_dup(ASIdOrRange, st)
+# define sk_ASIdOrRange_pop_free(st, free_func) SKM_sk_pop_free(ASIdOrRange, (st), (free_func))
+# define sk_ASIdOrRange_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ASIdOrRange, (st), (copy_func), (free_func))
+# define sk_ASIdOrRange_shift(st) SKM_sk_shift(ASIdOrRange, (st))
+# define sk_ASIdOrRange_pop(st) SKM_sk_pop(ASIdOrRange, (st))
+# define sk_ASIdOrRange_sort(st) SKM_sk_sort(ASIdOrRange, (st))
+# define sk_ASIdOrRange_is_sorted(st) SKM_sk_is_sorted(ASIdOrRange, (st))
+# define sk_ASN1_GENERALSTRING_new(cmp) SKM_sk_new(ASN1_GENERALSTRING, (cmp))
+# define sk_ASN1_GENERALSTRING_new_null() SKM_sk_new_null(ASN1_GENERALSTRING)
+# define sk_ASN1_GENERALSTRING_free(st) SKM_sk_free(ASN1_GENERALSTRING, (st))
+# define sk_ASN1_GENERALSTRING_num(st) SKM_sk_num(ASN1_GENERALSTRING, (st))
+# define sk_ASN1_GENERALSTRING_value(st, i) SKM_sk_value(ASN1_GENERALSTRING, (st), (i))
+# define sk_ASN1_GENERALSTRING_set(st, i, val) SKM_sk_set(ASN1_GENERALSTRING, (st), (i), (val))
+# define sk_ASN1_GENERALSTRING_zero(st) SKM_sk_zero(ASN1_GENERALSTRING, (st))
+# define sk_ASN1_GENERALSTRING_push(st, val) SKM_sk_push(ASN1_GENERALSTRING, (st), (val))
+# define sk_ASN1_GENERALSTRING_unshift(st, val) SKM_sk_unshift(ASN1_GENERALSTRING, (st), (val))
+# define sk_ASN1_GENERALSTRING_find(st, val) SKM_sk_find(ASN1_GENERALSTRING, (st), (val))
+# define sk_ASN1_GENERALSTRING_find_ex(st, val) SKM_sk_find_ex(ASN1_GENERALSTRING, (st), (val))
+# define sk_ASN1_GENERALSTRING_delete(st, i) SKM_sk_delete(ASN1_GENERALSTRING, (st), (i))
+# define sk_ASN1_GENERALSTRING_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_GENERALSTRING, (st), (ptr))
+# define sk_ASN1_GENERALSTRING_insert(st, val, i) SKM_sk_insert(ASN1_GENERALSTRING, (st), (val), (i))
+# define sk_ASN1_GENERALSTRING_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_GENERALSTRING, (st), (cmp))
+# define sk_ASN1_GENERALSTRING_dup(st) SKM_sk_dup(ASN1_GENERALSTRING, st)
+# define sk_ASN1_GENERALSTRING_pop_free(st, free_func) SKM_sk_pop_free(ASN1_GENERALSTRING, (st), (free_func))
+# define sk_ASN1_GENERALSTRING_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ASN1_GENERALSTRING, (st), (copy_func), (free_func))
+# define sk_ASN1_GENERALSTRING_shift(st) SKM_sk_shift(ASN1_GENERALSTRING, (st))
+# define sk_ASN1_GENERALSTRING_pop(st) SKM_sk_pop(ASN1_GENERALSTRING, (st))
+# define sk_ASN1_GENERALSTRING_sort(st) SKM_sk_sort(ASN1_GENERALSTRING, (st))
+# define sk_ASN1_GENERALSTRING_is_sorted(st) SKM_sk_is_sorted(ASN1_GENERALSTRING, (st))
+# define sk_ASN1_INTEGER_new(cmp) SKM_sk_new(ASN1_INTEGER, (cmp))
+# define sk_ASN1_INTEGER_new_null() SKM_sk_new_null(ASN1_INTEGER)
+# define sk_ASN1_INTEGER_free(st) SKM_sk_free(ASN1_INTEGER, (st))
+# define sk_ASN1_INTEGER_num(st) SKM_sk_num(ASN1_INTEGER, (st))
+# define sk_ASN1_INTEGER_value(st, i) SKM_sk_value(ASN1_INTEGER, (st), (i))
+# define sk_ASN1_INTEGER_set(st, i, val) SKM_sk_set(ASN1_INTEGER, (st), (i), (val))
+# define sk_ASN1_INTEGER_zero(st) SKM_sk_zero(ASN1_INTEGER, (st))
+# define sk_ASN1_INTEGER_push(st, val) SKM_sk_push(ASN1_INTEGER, (st), (val))
+# define sk_ASN1_INTEGER_unshift(st, val) SKM_sk_unshift(ASN1_INTEGER, (st), (val))
+# define sk_ASN1_INTEGER_find(st, val) SKM_sk_find(ASN1_INTEGER, (st), (val))
+# define sk_ASN1_INTEGER_find_ex(st, val) SKM_sk_find_ex(ASN1_INTEGER, (st), (val))
+# define sk_ASN1_INTEGER_delete(st, i) SKM_sk_delete(ASN1_INTEGER, (st), (i))
+# define sk_ASN1_INTEGER_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_INTEGER, (st), (ptr))
+# define sk_ASN1_INTEGER_insert(st, val, i) SKM_sk_insert(ASN1_INTEGER, (st), (val), (i))
+# define sk_ASN1_INTEGER_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_INTEGER, (st), (cmp))
+# define sk_ASN1_INTEGER_dup(st) SKM_sk_dup(ASN1_INTEGER, st)
+# define sk_ASN1_INTEGER_pop_free(st, free_func) SKM_sk_pop_free(ASN1_INTEGER, (st), (free_func))
+# define sk_ASN1_INTEGER_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ASN1_INTEGER, (st), (copy_func), (free_func))
+# define sk_ASN1_INTEGER_shift(st) SKM_sk_shift(ASN1_INTEGER, (st))
+# define sk_ASN1_INTEGER_pop(st) SKM_sk_pop(ASN1_INTEGER, (st))
+# define sk_ASN1_INTEGER_sort(st) SKM_sk_sort(ASN1_INTEGER, (st))
+# define sk_ASN1_INTEGER_is_sorted(st) SKM_sk_is_sorted(ASN1_INTEGER, (st))
+# define sk_ASN1_OBJECT_new(cmp) SKM_sk_new(ASN1_OBJECT, (cmp))
+# define sk_ASN1_OBJECT_new_null() SKM_sk_new_null(ASN1_OBJECT)
+# define sk_ASN1_OBJECT_free(st) SKM_sk_free(ASN1_OBJECT, (st))
+# define sk_ASN1_OBJECT_num(st) SKM_sk_num(ASN1_OBJECT, (st))
+# define sk_ASN1_OBJECT_value(st, i) SKM_sk_value(ASN1_OBJECT, (st), (i))
+# define sk_ASN1_OBJECT_set(st, i, val) SKM_sk_set(ASN1_OBJECT, (st), (i), (val))
+# define sk_ASN1_OBJECT_zero(st) SKM_sk_zero(ASN1_OBJECT, (st))
+# define sk_ASN1_OBJECT_push(st, val) SKM_sk_push(ASN1_OBJECT, (st), (val))
+# define sk_ASN1_OBJECT_unshift(st, val) SKM_sk_unshift(ASN1_OBJECT, (st), (val))
+# define sk_ASN1_OBJECT_find(st, val) SKM_sk_find(ASN1_OBJECT, (st), (val))
+# define sk_ASN1_OBJECT_find_ex(st, val) SKM_sk_find_ex(ASN1_OBJECT, (st), (val))
+# define sk_ASN1_OBJECT_delete(st, i) SKM_sk_delete(ASN1_OBJECT, (st), (i))
+# define sk_ASN1_OBJECT_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_OBJECT, (st), (ptr))
+# define sk_ASN1_OBJECT_insert(st, val, i) SKM_sk_insert(ASN1_OBJECT, (st), (val), (i))
+# define sk_ASN1_OBJECT_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_OBJECT, (st), (cmp))
+# define sk_ASN1_OBJECT_dup(st) SKM_sk_dup(ASN1_OBJECT, st)
+# define sk_ASN1_OBJECT_pop_free(st, free_func) SKM_sk_pop_free(ASN1_OBJECT, (st), (free_func))
+# define sk_ASN1_OBJECT_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ASN1_OBJECT, (st), (copy_func), (free_func))
+# define sk_ASN1_OBJECT_shift(st) SKM_sk_shift(ASN1_OBJECT, (st))
+# define sk_ASN1_OBJECT_pop(st) SKM_sk_pop(ASN1_OBJECT, (st))
+# define sk_ASN1_OBJECT_sort(st) SKM_sk_sort(ASN1_OBJECT, (st))
+# define sk_ASN1_OBJECT_is_sorted(st) SKM_sk_is_sorted(ASN1_OBJECT, (st))
+# define sk_ASN1_STRING_TABLE_new(cmp) SKM_sk_new(ASN1_STRING_TABLE, (cmp))
+# define sk_ASN1_STRING_TABLE_new_null() SKM_sk_new_null(ASN1_STRING_TABLE)
+# define sk_ASN1_STRING_TABLE_free(st) SKM_sk_free(ASN1_STRING_TABLE, (st))
+# define sk_ASN1_STRING_TABLE_num(st) SKM_sk_num(ASN1_STRING_TABLE, (st))
+# define sk_ASN1_STRING_TABLE_value(st, i) SKM_sk_value(ASN1_STRING_TABLE, (st), (i))
+# define sk_ASN1_STRING_TABLE_set(st, i, val) SKM_sk_set(ASN1_STRING_TABLE, (st), (i), (val))
+# define sk_ASN1_STRING_TABLE_zero(st) SKM_sk_zero(ASN1_STRING_TABLE, (st))
+# define sk_ASN1_STRING_TABLE_push(st, val) SKM_sk_push(ASN1_STRING_TABLE, (st), (val))
+# define sk_ASN1_STRING_TABLE_unshift(st, val) SKM_sk_unshift(ASN1_STRING_TABLE, (st), (val))
+# define sk_ASN1_STRING_TABLE_find(st, val) SKM_sk_find(ASN1_STRING_TABLE, (st), (val))
+# define sk_ASN1_STRING_TABLE_find_ex(st, val) SKM_sk_find_ex(ASN1_STRING_TABLE, (st), (val))
+# define sk_ASN1_STRING_TABLE_delete(st, i) SKM_sk_delete(ASN1_STRING_TABLE, (st), (i))
+# define sk_ASN1_STRING_TABLE_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_STRING_TABLE, (st), (ptr))
+# define sk_ASN1_STRING_TABLE_insert(st, val, i) SKM_sk_insert(ASN1_STRING_TABLE, (st), (val), (i))
+# define sk_ASN1_STRING_TABLE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_STRING_TABLE, (st), (cmp))
+# define sk_ASN1_STRING_TABLE_dup(st) SKM_sk_dup(ASN1_STRING_TABLE, st)
+# define sk_ASN1_STRING_TABLE_pop_free(st, free_func) SKM_sk_pop_free(ASN1_STRING_TABLE, (st), (free_func))
+# define sk_ASN1_STRING_TABLE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ASN1_STRING_TABLE, (st), (copy_func), (free_func))
+# define sk_ASN1_STRING_TABLE_shift(st) SKM_sk_shift(ASN1_STRING_TABLE, (st))
+# define sk_ASN1_STRING_TABLE_pop(st) SKM_sk_pop(ASN1_STRING_TABLE, (st))
+# define sk_ASN1_STRING_TABLE_sort(st) SKM_sk_sort(ASN1_STRING_TABLE, (st))
+# define sk_ASN1_STRING_TABLE_is_sorted(st) SKM_sk_is_sorted(ASN1_STRING_TABLE, (st))
+# define sk_ASN1_TYPE_new(cmp) SKM_sk_new(ASN1_TYPE, (cmp))
+# define sk_ASN1_TYPE_new_null() SKM_sk_new_null(ASN1_TYPE)
+# define sk_ASN1_TYPE_free(st) SKM_sk_free(ASN1_TYPE, (st))
+# define sk_ASN1_TYPE_num(st) SKM_sk_num(ASN1_TYPE, (st))
+# define sk_ASN1_TYPE_value(st, i) SKM_sk_value(ASN1_TYPE, (st), (i))
+# define sk_ASN1_TYPE_set(st, i, val) SKM_sk_set(ASN1_TYPE, (st), (i), (val))
+# define sk_ASN1_TYPE_zero(st) SKM_sk_zero(ASN1_TYPE, (st))
+# define sk_ASN1_TYPE_push(st, val) SKM_sk_push(ASN1_TYPE, (st), (val))
+# define sk_ASN1_TYPE_unshift(st, val) SKM_sk_unshift(ASN1_TYPE, (st), (val))
+# define sk_ASN1_TYPE_find(st, val) SKM_sk_find(ASN1_TYPE, (st), (val))
+# define sk_ASN1_TYPE_find_ex(st, val) SKM_sk_find_ex(ASN1_TYPE, (st), (val))
+# define sk_ASN1_TYPE_delete(st, i) SKM_sk_delete(ASN1_TYPE, (st), (i))
+# define sk_ASN1_TYPE_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_TYPE, (st), (ptr))
+# define sk_ASN1_TYPE_insert(st, val, i) SKM_sk_insert(ASN1_TYPE, (st), (val), (i))
+# define sk_ASN1_TYPE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_TYPE, (st), (cmp))
+# define sk_ASN1_TYPE_dup(st) SKM_sk_dup(ASN1_TYPE, st)
+# define sk_ASN1_TYPE_pop_free(st, free_func) SKM_sk_pop_free(ASN1_TYPE, (st), (free_func))
+# define sk_ASN1_TYPE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ASN1_TYPE, (st), (copy_func), (free_func))
+# define sk_ASN1_TYPE_shift(st) SKM_sk_shift(ASN1_TYPE, (st))
+# define sk_ASN1_TYPE_pop(st) SKM_sk_pop(ASN1_TYPE, (st))
+# define sk_ASN1_TYPE_sort(st) SKM_sk_sort(ASN1_TYPE, (st))
+# define sk_ASN1_TYPE_is_sorted(st) SKM_sk_is_sorted(ASN1_TYPE, (st))
+# define sk_ASN1_UTF8STRING_new(cmp) SKM_sk_new(ASN1_UTF8STRING, (cmp))
+# define sk_ASN1_UTF8STRING_new_null() SKM_sk_new_null(ASN1_UTF8STRING)
+# define sk_ASN1_UTF8STRING_free(st) SKM_sk_free(ASN1_UTF8STRING, (st))
+# define sk_ASN1_UTF8STRING_num(st) SKM_sk_num(ASN1_UTF8STRING, (st))
+# define sk_ASN1_UTF8STRING_value(st, i) SKM_sk_value(ASN1_UTF8STRING, (st), (i))
+# define sk_ASN1_UTF8STRING_set(st, i, val) SKM_sk_set(ASN1_UTF8STRING, (st), (i), (val))
+# define sk_ASN1_UTF8STRING_zero(st) SKM_sk_zero(ASN1_UTF8STRING, (st))
+# define sk_ASN1_UTF8STRING_push(st, val) SKM_sk_push(ASN1_UTF8STRING, (st), (val))
+# define sk_ASN1_UTF8STRING_unshift(st, val) SKM_sk_unshift(ASN1_UTF8STRING, (st), (val))
+# define sk_ASN1_UTF8STRING_find(st, val) SKM_sk_find(ASN1_UTF8STRING, (st), (val))
+# define sk_ASN1_UTF8STRING_find_ex(st, val) SKM_sk_find_ex(ASN1_UTF8STRING, (st), (val))
+# define sk_ASN1_UTF8STRING_delete(st, i) SKM_sk_delete(ASN1_UTF8STRING, (st), (i))
+# define sk_ASN1_UTF8STRING_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_UTF8STRING, (st), (ptr))
+# define sk_ASN1_UTF8STRING_insert(st, val, i) SKM_sk_insert(ASN1_UTF8STRING, (st), (val), (i))
+# define sk_ASN1_UTF8STRING_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_UTF8STRING, (st), (cmp))
+# define sk_ASN1_UTF8STRING_dup(st) SKM_sk_dup(ASN1_UTF8STRING, st)
+# define sk_ASN1_UTF8STRING_pop_free(st, free_func) SKM_sk_pop_free(ASN1_UTF8STRING, (st), (free_func))
+# define sk_ASN1_UTF8STRING_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ASN1_UTF8STRING, (st), (copy_func), (free_func))
+# define sk_ASN1_UTF8STRING_shift(st) SKM_sk_shift(ASN1_UTF8STRING, (st))
+# define sk_ASN1_UTF8STRING_pop(st) SKM_sk_pop(ASN1_UTF8STRING, (st))
+# define sk_ASN1_UTF8STRING_sort(st) SKM_sk_sort(ASN1_UTF8STRING, (st))
+# define sk_ASN1_UTF8STRING_is_sorted(st) SKM_sk_is_sorted(ASN1_UTF8STRING, (st))
+# define sk_ASN1_VALUE_new(cmp) SKM_sk_new(ASN1_VALUE, (cmp))
+# define sk_ASN1_VALUE_new_null() SKM_sk_new_null(ASN1_VALUE)
+# define sk_ASN1_VALUE_free(st) SKM_sk_free(ASN1_VALUE, (st))
+# define sk_ASN1_VALUE_num(st) SKM_sk_num(ASN1_VALUE, (st))
+# define sk_ASN1_VALUE_value(st, i) SKM_sk_value(ASN1_VALUE, (st), (i))
+# define sk_ASN1_VALUE_set(st, i, val) SKM_sk_set(ASN1_VALUE, (st), (i), (val))
+# define sk_ASN1_VALUE_zero(st) SKM_sk_zero(ASN1_VALUE, (st))
+# define sk_ASN1_VALUE_push(st, val) SKM_sk_push(ASN1_VALUE, (st), (val))
+# define sk_ASN1_VALUE_unshift(st, val) SKM_sk_unshift(ASN1_VALUE, (st), (val))
+# define sk_ASN1_VALUE_find(st, val) SKM_sk_find(ASN1_VALUE, (st), (val))
+# define sk_ASN1_VALUE_find_ex(st, val) SKM_sk_find_ex(ASN1_VALUE, (st), (val))
+# define sk_ASN1_VALUE_delete(st, i) SKM_sk_delete(ASN1_VALUE, (st), (i))
+# define sk_ASN1_VALUE_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_VALUE, (st), (ptr))
+# define sk_ASN1_VALUE_insert(st, val, i) SKM_sk_insert(ASN1_VALUE, (st), (val), (i))
+# define sk_ASN1_VALUE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_VALUE, (st), (cmp))
+# define sk_ASN1_VALUE_dup(st) SKM_sk_dup(ASN1_VALUE, st)
+# define sk_ASN1_VALUE_pop_free(st, free_func) SKM_sk_pop_free(ASN1_VALUE, (st), (free_func))
+# define sk_ASN1_VALUE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ASN1_VALUE, (st), (copy_func), (free_func))
+# define sk_ASN1_VALUE_shift(st) SKM_sk_shift(ASN1_VALUE, (st))
+# define sk_ASN1_VALUE_pop(st) SKM_sk_pop(ASN1_VALUE, (st))
+# define sk_ASN1_VALUE_sort(st) SKM_sk_sort(ASN1_VALUE, (st))
+# define sk_ASN1_VALUE_is_sorted(st) SKM_sk_is_sorted(ASN1_VALUE, (st))
+# define sk_BIO_new(cmp) SKM_sk_new(BIO, (cmp))
+# define sk_BIO_new_null() SKM_sk_new_null(BIO)
+# define sk_BIO_free(st) SKM_sk_free(BIO, (st))
+# define sk_BIO_num(st) SKM_sk_num(BIO, (st))
+# define sk_BIO_value(st, i) SKM_sk_value(BIO, (st), (i))
+# define sk_BIO_set(st, i, val) SKM_sk_set(BIO, (st), (i), (val))
+# define sk_BIO_zero(st) SKM_sk_zero(BIO, (st))
+# define sk_BIO_push(st, val) SKM_sk_push(BIO, (st), (val))
+# define sk_BIO_unshift(st, val) SKM_sk_unshift(BIO, (st), (val))
+# define sk_BIO_find(st, val) SKM_sk_find(BIO, (st), (val))
+# define sk_BIO_find_ex(st, val) SKM_sk_find_ex(BIO, (st), (val))
+# define sk_BIO_delete(st, i) SKM_sk_delete(BIO, (st), (i))
+# define sk_BIO_delete_ptr(st, ptr) SKM_sk_delete_ptr(BIO, (st), (ptr))
+# define sk_BIO_insert(st, val, i) SKM_sk_insert(BIO, (st), (val), (i))
+# define sk_BIO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(BIO, (st), (cmp))
+# define sk_BIO_dup(st) SKM_sk_dup(BIO, st)
+# define sk_BIO_pop_free(st, free_func) SKM_sk_pop_free(BIO, (st), (free_func))
+# define sk_BIO_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(BIO, (st), (copy_func), (free_func))
+# define sk_BIO_shift(st) SKM_sk_shift(BIO, (st))
+# define sk_BIO_pop(st) SKM_sk_pop(BIO, (st))
+# define sk_BIO_sort(st) SKM_sk_sort(BIO, (st))
+# define sk_BIO_is_sorted(st) SKM_sk_is_sorted(BIO, (st))
+# define sk_BY_DIR_ENTRY_new(cmp) SKM_sk_new(BY_DIR_ENTRY, (cmp))
+# define sk_BY_DIR_ENTRY_new_null() SKM_sk_new_null(BY_DIR_ENTRY)
+# define sk_BY_DIR_ENTRY_free(st) SKM_sk_free(BY_DIR_ENTRY, (st))
+# define sk_BY_DIR_ENTRY_num(st) SKM_sk_num(BY_DIR_ENTRY, (st))
+# define sk_BY_DIR_ENTRY_value(st, i) SKM_sk_value(BY_DIR_ENTRY, (st), (i))
+# define sk_BY_DIR_ENTRY_set(st, i, val) SKM_sk_set(BY_DIR_ENTRY, (st), (i), (val))
+# define sk_BY_DIR_ENTRY_zero(st) SKM_sk_zero(BY_DIR_ENTRY, (st))
+# define sk_BY_DIR_ENTRY_push(st, val) SKM_sk_push(BY_DIR_ENTRY, (st), (val))
+# define sk_BY_DIR_ENTRY_unshift(st, val) SKM_sk_unshift(BY_DIR_ENTRY, (st), (val))
+# define sk_BY_DIR_ENTRY_find(st, val) SKM_sk_find(BY_DIR_ENTRY, (st), (val))
+# define sk_BY_DIR_ENTRY_find_ex(st, val) SKM_sk_find_ex(BY_DIR_ENTRY, (st), (val))
+# define sk_BY_DIR_ENTRY_delete(st, i) SKM_sk_delete(BY_DIR_ENTRY, (st), (i))
+# define sk_BY_DIR_ENTRY_delete_ptr(st, ptr) SKM_sk_delete_ptr(BY_DIR_ENTRY, (st), (ptr))
+# define sk_BY_DIR_ENTRY_insert(st, val, i) SKM_sk_insert(BY_DIR_ENTRY, (st), (val), (i))
+# define sk_BY_DIR_ENTRY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(BY_DIR_ENTRY, (st), (cmp))
+# define sk_BY_DIR_ENTRY_dup(st) SKM_sk_dup(BY_DIR_ENTRY, st)
+# define sk_BY_DIR_ENTRY_pop_free(st, free_func) SKM_sk_pop_free(BY_DIR_ENTRY, (st), (free_func))
+# define sk_BY_DIR_ENTRY_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(BY_DIR_ENTRY, (st), (copy_func), (free_func))
+# define sk_BY_DIR_ENTRY_shift(st) SKM_sk_shift(BY_DIR_ENTRY, (st))
+# define sk_BY_DIR_ENTRY_pop(st) SKM_sk_pop(BY_DIR_ENTRY, (st))
+# define sk_BY_DIR_ENTRY_sort(st) SKM_sk_sort(BY_DIR_ENTRY, (st))
+# define sk_BY_DIR_ENTRY_is_sorted(st) SKM_sk_is_sorted(BY_DIR_ENTRY, (st))
+# define sk_BY_DIR_HASH_new(cmp) SKM_sk_new(BY_DIR_HASH, (cmp))
+# define sk_BY_DIR_HASH_new_null() SKM_sk_new_null(BY_DIR_HASH)
+# define sk_BY_DIR_HASH_free(st) SKM_sk_free(BY_DIR_HASH, (st))
+# define sk_BY_DIR_HASH_num(st) SKM_sk_num(BY_DIR_HASH, (st))
+# define sk_BY_DIR_HASH_value(st, i) SKM_sk_value(BY_DIR_HASH, (st), (i))
+# define sk_BY_DIR_HASH_set(st, i, val) SKM_sk_set(BY_DIR_HASH, (st), (i), (val))
+# define sk_BY_DIR_HASH_zero(st) SKM_sk_zero(BY_DIR_HASH, (st))
+# define sk_BY_DIR_HASH_push(st, val) SKM_sk_push(BY_DIR_HASH, (st), (val))
+# define sk_BY_DIR_HASH_unshift(st, val) SKM_sk_unshift(BY_DIR_HASH, (st), (val))
+# define sk_BY_DIR_HASH_find(st, val) SKM_sk_find(BY_DIR_HASH, (st), (val))
+# define sk_BY_DIR_HASH_find_ex(st, val) SKM_sk_find_ex(BY_DIR_HASH, (st), (val))
+# define sk_BY_DIR_HASH_delete(st, i) SKM_sk_delete(BY_DIR_HASH, (st), (i))
+# define sk_BY_DIR_HASH_delete_ptr(st, ptr) SKM_sk_delete_ptr(BY_DIR_HASH, (st), (ptr))
+# define sk_BY_DIR_HASH_insert(st, val, i) SKM_sk_insert(BY_DIR_HASH, (st), (val), (i))
+# define sk_BY_DIR_HASH_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(BY_DIR_HASH, (st), (cmp))
+# define sk_BY_DIR_HASH_dup(st) SKM_sk_dup(BY_DIR_HASH, st)
+# define sk_BY_DIR_HASH_pop_free(st, free_func) SKM_sk_pop_free(BY_DIR_HASH, (st), (free_func))
+# define sk_BY_DIR_HASH_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(BY_DIR_HASH, (st), (copy_func), (free_func))
+# define sk_BY_DIR_HASH_shift(st) SKM_sk_shift(BY_DIR_HASH, (st))
+# define sk_BY_DIR_HASH_pop(st) SKM_sk_pop(BY_DIR_HASH, (st))
+# define sk_BY_DIR_HASH_sort(st) SKM_sk_sort(BY_DIR_HASH, (st))
+# define sk_BY_DIR_HASH_is_sorted(st) SKM_sk_is_sorted(BY_DIR_HASH, (st))
+# define sk_CMS_CertificateChoices_new(cmp) SKM_sk_new(CMS_CertificateChoices, (cmp))
+# define sk_CMS_CertificateChoices_new_null() SKM_sk_new_null(CMS_CertificateChoices)
+# define sk_CMS_CertificateChoices_free(st) SKM_sk_free(CMS_CertificateChoices, (st))
+# define sk_CMS_CertificateChoices_num(st) SKM_sk_num(CMS_CertificateChoices, (st))
+# define sk_CMS_CertificateChoices_value(st, i) SKM_sk_value(CMS_CertificateChoices, (st), (i))
+# define sk_CMS_CertificateChoices_set(st, i, val) SKM_sk_set(CMS_CertificateChoices, (st), (i), (val))
+# define sk_CMS_CertificateChoices_zero(st) SKM_sk_zero(CMS_CertificateChoices, (st))
+# define sk_CMS_CertificateChoices_push(st, val) SKM_sk_push(CMS_CertificateChoices, (st), (val))
+# define sk_CMS_CertificateChoices_unshift(st, val) SKM_sk_unshift(CMS_CertificateChoices, (st), (val))
+# define sk_CMS_CertificateChoices_find(st, val) SKM_sk_find(CMS_CertificateChoices, (st), (val))
+# define sk_CMS_CertificateChoices_find_ex(st, val) SKM_sk_find_ex(CMS_CertificateChoices, (st), (val))
+# define sk_CMS_CertificateChoices_delete(st, i) SKM_sk_delete(CMS_CertificateChoices, (st), (i))
+# define sk_CMS_CertificateChoices_delete_ptr(st, ptr) SKM_sk_delete_ptr(CMS_CertificateChoices, (st), (ptr))
+# define sk_CMS_CertificateChoices_insert(st, val, i) SKM_sk_insert(CMS_CertificateChoices, (st), (val), (i))
+# define sk_CMS_CertificateChoices_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CMS_CertificateChoices, (st), (cmp))
+# define sk_CMS_CertificateChoices_dup(st) SKM_sk_dup(CMS_CertificateChoices, st)
+# define sk_CMS_CertificateChoices_pop_free(st, free_func) SKM_sk_pop_free(CMS_CertificateChoices, (st), (free_func))
+# define sk_CMS_CertificateChoices_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(CMS_CertificateChoices, (st), (copy_func), (free_func))
+# define sk_CMS_CertificateChoices_shift(st) SKM_sk_shift(CMS_CertificateChoices, (st))
+# define sk_CMS_CertificateChoices_pop(st) SKM_sk_pop(CMS_CertificateChoices, (st))
+# define sk_CMS_CertificateChoices_sort(st) SKM_sk_sort(CMS_CertificateChoices, (st))
+# define sk_CMS_CertificateChoices_is_sorted(st) SKM_sk_is_sorted(CMS_CertificateChoices, (st))
+# define sk_CMS_RecipientEncryptedKey_new(cmp) SKM_sk_new(CMS_RecipientEncryptedKey, (cmp))
+# define sk_CMS_RecipientEncryptedKey_new_null() SKM_sk_new_null(CMS_RecipientEncryptedKey)
+# define sk_CMS_RecipientEncryptedKey_free(st) SKM_sk_free(CMS_RecipientEncryptedKey, (st))
+# define sk_CMS_RecipientEncryptedKey_num(st) SKM_sk_num(CMS_RecipientEncryptedKey, (st))
+# define sk_CMS_RecipientEncryptedKey_value(st, i) SKM_sk_value(CMS_RecipientEncryptedKey, (st), (i))
+# define sk_CMS_RecipientEncryptedKey_set(st, i, val) SKM_sk_set(CMS_RecipientEncryptedKey, (st), (i), (val))
+# define sk_CMS_RecipientEncryptedKey_zero(st) SKM_sk_zero(CMS_RecipientEncryptedKey, (st))
+# define sk_CMS_RecipientEncryptedKey_push(st, val) SKM_sk_push(CMS_RecipientEncryptedKey, (st), (val))
+# define sk_CMS_RecipientEncryptedKey_unshift(st, val) SKM_sk_unshift(CMS_RecipientEncryptedKey, (st), (val))
+# define sk_CMS_RecipientEncryptedKey_find(st, val) SKM_sk_find(CMS_RecipientEncryptedKey, (st), (val))
+# define sk_CMS_RecipientEncryptedKey_find_ex(st, val) SKM_sk_find_ex(CMS_RecipientEncryptedKey, (st), (val))
+# define sk_CMS_RecipientEncryptedKey_delete(st, i) SKM_sk_delete(CMS_RecipientEncryptedKey, (st), (i))
+# define sk_CMS_RecipientEncryptedKey_delete_ptr(st, ptr) SKM_sk_delete_ptr(CMS_RecipientEncryptedKey, (st), (ptr))
+# define sk_CMS_RecipientEncryptedKey_insert(st, val, i) SKM_sk_insert(CMS_RecipientEncryptedKey, (st), (val), (i))
+# define sk_CMS_RecipientEncryptedKey_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CMS_RecipientEncryptedKey, (st), (cmp))
+# define sk_CMS_RecipientEncryptedKey_dup(st) SKM_sk_dup(CMS_RecipientEncryptedKey, st)
+# define sk_CMS_RecipientEncryptedKey_pop_free(st, free_func) SKM_sk_pop_free(CMS_RecipientEncryptedKey, (st), (free_func))
+# define sk_CMS_RecipientEncryptedKey_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(CMS_RecipientEncryptedKey, (st), (copy_func), (free_func))
+# define sk_CMS_RecipientEncryptedKey_shift(st) SKM_sk_shift(CMS_RecipientEncryptedKey, (st))
+# define sk_CMS_RecipientEncryptedKey_pop(st) SKM_sk_pop(CMS_RecipientEncryptedKey, (st))
+# define sk_CMS_RecipientEncryptedKey_sort(st) SKM_sk_sort(CMS_RecipientEncryptedKey, (st))
+# define sk_CMS_RecipientEncryptedKey_is_sorted(st) SKM_sk_is_sorted(CMS_RecipientEncryptedKey, (st))
+# define sk_CMS_RecipientInfo_new(cmp) SKM_sk_new(CMS_RecipientInfo, (cmp))
+# define sk_CMS_RecipientInfo_new_null() SKM_sk_new_null(CMS_RecipientInfo)
+# define sk_CMS_RecipientInfo_free(st) SKM_sk_free(CMS_RecipientInfo, (st))
+# define sk_CMS_RecipientInfo_num(st) SKM_sk_num(CMS_RecipientInfo, (st))
+# define sk_CMS_RecipientInfo_value(st, i) SKM_sk_value(CMS_RecipientInfo, (st), (i))
+# define sk_CMS_RecipientInfo_set(st, i, val) SKM_sk_set(CMS_RecipientInfo, (st), (i), (val))
+# define sk_CMS_RecipientInfo_zero(st) SKM_sk_zero(CMS_RecipientInfo, (st))
+# define sk_CMS_RecipientInfo_push(st, val) SKM_sk_push(CMS_RecipientInfo, (st), (val))
+# define sk_CMS_RecipientInfo_unshift(st, val) SKM_sk_unshift(CMS_RecipientInfo, (st), (val))
+# define sk_CMS_RecipientInfo_find(st, val) SKM_sk_find(CMS_RecipientInfo, (st), (val))
+# define sk_CMS_RecipientInfo_find_ex(st, val) SKM_sk_find_ex(CMS_RecipientInfo, (st), (val))
+# define sk_CMS_RecipientInfo_delete(st, i) SKM_sk_delete(CMS_RecipientInfo, (st), (i))
+# define sk_CMS_RecipientInfo_delete_ptr(st, ptr) SKM_sk_delete_ptr(CMS_RecipientInfo, (st), (ptr))
+# define sk_CMS_RecipientInfo_insert(st, val, i) SKM_sk_insert(CMS_RecipientInfo, (st), (val), (i))
+# define sk_CMS_RecipientInfo_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CMS_RecipientInfo, (st), (cmp))
+# define sk_CMS_RecipientInfo_dup(st) SKM_sk_dup(CMS_RecipientInfo, st)
+# define sk_CMS_RecipientInfo_pop_free(st, free_func) SKM_sk_pop_free(CMS_RecipientInfo, (st), (free_func))
+# define sk_CMS_RecipientInfo_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(CMS_RecipientInfo, (st), (copy_func), (free_func))
+# define sk_CMS_RecipientInfo_shift(st) SKM_sk_shift(CMS_RecipientInfo, (st))
+# define sk_CMS_RecipientInfo_pop(st) SKM_sk_pop(CMS_RecipientInfo, (st))
+# define sk_CMS_RecipientInfo_sort(st) SKM_sk_sort(CMS_RecipientInfo, (st))
+# define sk_CMS_RecipientInfo_is_sorted(st) SKM_sk_is_sorted(CMS_RecipientInfo, (st))
+# define sk_CMS_RevocationInfoChoice_new(cmp) SKM_sk_new(CMS_RevocationInfoChoice, (cmp))
+# define sk_CMS_RevocationInfoChoice_new_null() SKM_sk_new_null(CMS_RevocationInfoChoice)
+# define sk_CMS_RevocationInfoChoice_free(st) SKM_sk_free(CMS_RevocationInfoChoice, (st))
+# define sk_CMS_RevocationInfoChoice_num(st) SKM_sk_num(CMS_RevocationInfoChoice, (st))
+# define sk_CMS_RevocationInfoChoice_value(st, i) SKM_sk_value(CMS_RevocationInfoChoice, (st), (i))
+# define sk_CMS_RevocationInfoChoice_set(st, i, val) SKM_sk_set(CMS_RevocationInfoChoice, (st), (i), (val))
+# define sk_CMS_RevocationInfoChoice_zero(st) SKM_sk_zero(CMS_RevocationInfoChoice, (st))
+# define sk_CMS_RevocationInfoChoice_push(st, val) SKM_sk_push(CMS_RevocationInfoChoice, (st), (val))
+# define sk_CMS_RevocationInfoChoice_unshift(st, val) SKM_sk_unshift(CMS_RevocationInfoChoice, (st), (val))
+# define sk_CMS_RevocationInfoChoice_find(st, val) SKM_sk_find(CMS_RevocationInfoChoice, (st), (val))
+# define sk_CMS_RevocationInfoChoice_find_ex(st, val) SKM_sk_find_ex(CMS_RevocationInfoChoice, (st), (val))
+# define sk_CMS_RevocationInfoChoice_delete(st, i) SKM_sk_delete(CMS_RevocationInfoChoice, (st), (i))
+# define sk_CMS_RevocationInfoChoice_delete_ptr(st, ptr) SKM_sk_delete_ptr(CMS_RevocationInfoChoice, (st), (ptr))
+# define sk_CMS_RevocationInfoChoice_insert(st, val, i) SKM_sk_insert(CMS_RevocationInfoChoice, (st), (val), (i))
+# define sk_CMS_RevocationInfoChoice_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CMS_RevocationInfoChoice, (st), (cmp))
+# define sk_CMS_RevocationInfoChoice_dup(st) SKM_sk_dup(CMS_RevocationInfoChoice, st)
+# define sk_CMS_RevocationInfoChoice_pop_free(st, free_func) SKM_sk_pop_free(CMS_RevocationInfoChoice, (st), (free_func))
+# define sk_CMS_RevocationInfoChoice_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(CMS_RevocationInfoChoice, (st), (copy_func), (free_func))
+# define sk_CMS_RevocationInfoChoice_shift(st) SKM_sk_shift(CMS_RevocationInfoChoice, (st))
+# define sk_CMS_RevocationInfoChoice_pop(st) SKM_sk_pop(CMS_RevocationInfoChoice, (st))
+# define sk_CMS_RevocationInfoChoice_sort(st) SKM_sk_sort(CMS_RevocationInfoChoice, (st))
+# define sk_CMS_RevocationInfoChoice_is_sorted(st) SKM_sk_is_sorted(CMS_RevocationInfoChoice, (st))
+# define sk_CMS_SignerInfo_new(cmp) SKM_sk_new(CMS_SignerInfo, (cmp))
+# define sk_CMS_SignerInfo_new_null() SKM_sk_new_null(CMS_SignerInfo)
+# define sk_CMS_SignerInfo_free(st) SKM_sk_free(CMS_SignerInfo, (st))
+# define sk_CMS_SignerInfo_num(st) SKM_sk_num(CMS_SignerInfo, (st))
+# define sk_CMS_SignerInfo_value(st, i) SKM_sk_value(CMS_SignerInfo, (st), (i))
+# define sk_CMS_SignerInfo_set(st, i, val) SKM_sk_set(CMS_SignerInfo, (st), (i), (val))
+# define sk_CMS_SignerInfo_zero(st) SKM_sk_zero(CMS_SignerInfo, (st))
+# define sk_CMS_SignerInfo_push(st, val) SKM_sk_push(CMS_SignerInfo, (st), (val))
+# define sk_CMS_SignerInfo_unshift(st, val) SKM_sk_unshift(CMS_SignerInfo, (st), (val))
+# define sk_CMS_SignerInfo_find(st, val) SKM_sk_find(CMS_SignerInfo, (st), (val))
+# define sk_CMS_SignerInfo_find_ex(st, val) SKM_sk_find_ex(CMS_SignerInfo, (st), (val))
+# define sk_CMS_SignerInfo_delete(st, i) SKM_sk_delete(CMS_SignerInfo, (st), (i))
+# define sk_CMS_SignerInfo_delete_ptr(st, ptr) SKM_sk_delete_ptr(CMS_SignerInfo, (st), (ptr))
+# define sk_CMS_SignerInfo_insert(st, val, i) SKM_sk_insert(CMS_SignerInfo, (st), (val), (i))
+# define sk_CMS_SignerInfo_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CMS_SignerInfo, (st), (cmp))
+# define sk_CMS_SignerInfo_dup(st) SKM_sk_dup(CMS_SignerInfo, st)
+# define sk_CMS_SignerInfo_pop_free(st, free_func) SKM_sk_pop_free(CMS_SignerInfo, (st), (free_func))
+# define sk_CMS_SignerInfo_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(CMS_SignerInfo, (st), (copy_func), (free_func))
+# define sk_CMS_SignerInfo_shift(st) SKM_sk_shift(CMS_SignerInfo, (st))
+# define sk_CMS_SignerInfo_pop(st) SKM_sk_pop(CMS_SignerInfo, (st))
+# define sk_CMS_SignerInfo_sort(st) SKM_sk_sort(CMS_SignerInfo, (st))
+# define sk_CMS_SignerInfo_is_sorted(st) SKM_sk_is_sorted(CMS_SignerInfo, (st))
+# define sk_CONF_IMODULE_new(cmp) SKM_sk_new(CONF_IMODULE, (cmp))
+# define sk_CONF_IMODULE_new_null() SKM_sk_new_null(CONF_IMODULE)
+# define sk_CONF_IMODULE_free(st) SKM_sk_free(CONF_IMODULE, (st))
+# define sk_CONF_IMODULE_num(st) SKM_sk_num(CONF_IMODULE, (st))
+# define sk_CONF_IMODULE_value(st, i) SKM_sk_value(CONF_IMODULE, (st), (i))
+# define sk_CONF_IMODULE_set(st, i, val) SKM_sk_set(CONF_IMODULE, (st), (i), (val))
+# define sk_CONF_IMODULE_zero(st) SKM_sk_zero(CONF_IMODULE, (st))
+# define sk_CONF_IMODULE_push(st, val) SKM_sk_push(CONF_IMODULE, (st), (val))
+# define sk_CONF_IMODULE_unshift(st, val) SKM_sk_unshift(CONF_IMODULE, (st), (val))
+# define sk_CONF_IMODULE_find(st, val) SKM_sk_find(CONF_IMODULE, (st), (val))
+# define sk_CONF_IMODULE_find_ex(st, val) SKM_sk_find_ex(CONF_IMODULE, (st), (val))
+# define sk_CONF_IMODULE_delete(st, i) SKM_sk_delete(CONF_IMODULE, (st), (i))
+# define sk_CONF_IMODULE_delete_ptr(st, ptr) SKM_sk_delete_ptr(CONF_IMODULE, (st), (ptr))
+# define sk_CONF_IMODULE_insert(st, val, i) SKM_sk_insert(CONF_IMODULE, (st), (val), (i))
+# define sk_CONF_IMODULE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CONF_IMODULE, (st), (cmp))
+# define sk_CONF_IMODULE_dup(st) SKM_sk_dup(CONF_IMODULE, st)
+# define sk_CONF_IMODULE_pop_free(st, free_func) SKM_sk_pop_free(CONF_IMODULE, (st), (free_func))
+# define sk_CONF_IMODULE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(CONF_IMODULE, (st), (copy_func), (free_func))
+# define sk_CONF_IMODULE_shift(st) SKM_sk_shift(CONF_IMODULE, (st))
+# define sk_CONF_IMODULE_pop(st) SKM_sk_pop(CONF_IMODULE, (st))
+# define sk_CONF_IMODULE_sort(st) SKM_sk_sort(CONF_IMODULE, (st))
+# define sk_CONF_IMODULE_is_sorted(st) SKM_sk_is_sorted(CONF_IMODULE, (st))
+# define sk_CONF_MODULE_new(cmp) SKM_sk_new(CONF_MODULE, (cmp))
+# define sk_CONF_MODULE_new_null() SKM_sk_new_null(CONF_MODULE)
+# define sk_CONF_MODULE_free(st) SKM_sk_free(CONF_MODULE, (st))
+# define sk_CONF_MODULE_num(st) SKM_sk_num(CONF_MODULE, (st))
+# define sk_CONF_MODULE_value(st, i) SKM_sk_value(CONF_MODULE, (st), (i))
+# define sk_CONF_MODULE_set(st, i, val) SKM_sk_set(CONF_MODULE, (st), (i), (val))
+# define sk_CONF_MODULE_zero(st) SKM_sk_zero(CONF_MODULE, (st))
+# define sk_CONF_MODULE_push(st, val) SKM_sk_push(CONF_MODULE, (st), (val))
+# define sk_CONF_MODULE_unshift(st, val) SKM_sk_unshift(CONF_MODULE, (st), (val))
+# define sk_CONF_MODULE_find(st, val) SKM_sk_find(CONF_MODULE, (st), (val))
+# define sk_CONF_MODULE_find_ex(st, val) SKM_sk_find_ex(CONF_MODULE, (st), (val))
+# define sk_CONF_MODULE_delete(st, i) SKM_sk_delete(CONF_MODULE, (st), (i))
+# define sk_CONF_MODULE_delete_ptr(st, ptr) SKM_sk_delete_ptr(CONF_MODULE, (st), (ptr))
+# define sk_CONF_MODULE_insert(st, val, i) SKM_sk_insert(CONF_MODULE, (st), (val), (i))
+# define sk_CONF_MODULE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CONF_MODULE, (st), (cmp))
+# define sk_CONF_MODULE_dup(st) SKM_sk_dup(CONF_MODULE, st)
+# define sk_CONF_MODULE_pop_free(st, free_func) SKM_sk_pop_free(CONF_MODULE, (st), (free_func))
+# define sk_CONF_MODULE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(CONF_MODULE, (st), (copy_func), (free_func))
+# define sk_CONF_MODULE_shift(st) SKM_sk_shift(CONF_MODULE, (st))
+# define sk_CONF_MODULE_pop(st) SKM_sk_pop(CONF_MODULE, (st))
+# define sk_CONF_MODULE_sort(st) SKM_sk_sort(CONF_MODULE, (st))
+# define sk_CONF_MODULE_is_sorted(st) SKM_sk_is_sorted(CONF_MODULE, (st))
+# define sk_CONF_VALUE_new(cmp) SKM_sk_new(CONF_VALUE, (cmp))
+# define sk_CONF_VALUE_new_null() SKM_sk_new_null(CONF_VALUE)
+# define sk_CONF_VALUE_free(st) SKM_sk_free(CONF_VALUE, (st))
+# define sk_CONF_VALUE_num(st) SKM_sk_num(CONF_VALUE, (st))
+# define sk_CONF_VALUE_value(st, i) SKM_sk_value(CONF_VALUE, (st), (i))
+# define sk_CONF_VALUE_set(st, i, val) SKM_sk_set(CONF_VALUE, (st), (i), (val))
+# define sk_CONF_VALUE_zero(st) SKM_sk_zero(CONF_VALUE, (st))
+# define sk_CONF_VALUE_push(st, val) SKM_sk_push(CONF_VALUE, (st), (val))
+# define sk_CONF_VALUE_unshift(st, val) SKM_sk_unshift(CONF_VALUE, (st), (val))
+# define sk_CONF_VALUE_find(st, val) SKM_sk_find(CONF_VALUE, (st), (val))
+# define sk_CONF_VALUE_find_ex(st, val) SKM_sk_find_ex(CONF_VALUE, (st), (val))
+# define sk_CONF_VALUE_delete(st, i) SKM_sk_delete(CONF_VALUE, (st), (i))
+# define sk_CONF_VALUE_delete_ptr(st, ptr) SKM_sk_delete_ptr(CONF_VALUE, (st), (ptr))
+# define sk_CONF_VALUE_insert(st, val, i) SKM_sk_insert(CONF_VALUE, (st), (val), (i))
+# define sk_CONF_VALUE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CONF_VALUE, (st), (cmp))
+# define sk_CONF_VALUE_dup(st) SKM_sk_dup(CONF_VALUE, st)
+# define sk_CONF_VALUE_pop_free(st, free_func) SKM_sk_pop_free(CONF_VALUE, (st), (free_func))
+# define sk_CONF_VALUE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(CONF_VALUE, (st), (copy_func), (free_func))
+# define sk_CONF_VALUE_shift(st) SKM_sk_shift(CONF_VALUE, (st))
+# define sk_CONF_VALUE_pop(st) SKM_sk_pop(CONF_VALUE, (st))
+# define sk_CONF_VALUE_sort(st) SKM_sk_sort(CONF_VALUE, (st))
+# define sk_CONF_VALUE_is_sorted(st) SKM_sk_is_sorted(CONF_VALUE, (st))
+# define sk_CRYPTO_EX_DATA_FUNCS_new(cmp) SKM_sk_new(CRYPTO_EX_DATA_FUNCS, (cmp))
+# define sk_CRYPTO_EX_DATA_FUNCS_new_null() SKM_sk_new_null(CRYPTO_EX_DATA_FUNCS)
+# define sk_CRYPTO_EX_DATA_FUNCS_free(st) SKM_sk_free(CRYPTO_EX_DATA_FUNCS, (st))
+# define sk_CRYPTO_EX_DATA_FUNCS_num(st) SKM_sk_num(CRYPTO_EX_DATA_FUNCS, (st))
+# define sk_CRYPTO_EX_DATA_FUNCS_value(st, i) SKM_sk_value(CRYPTO_EX_DATA_FUNCS, (st), (i))
+# define sk_CRYPTO_EX_DATA_FUNCS_set(st, i, val) SKM_sk_set(CRYPTO_EX_DATA_FUNCS, (st), (i), (val))
+# define sk_CRYPTO_EX_DATA_FUNCS_zero(st) SKM_sk_zero(CRYPTO_EX_DATA_FUNCS, (st))
+# define sk_CRYPTO_EX_DATA_FUNCS_push(st, val) SKM_sk_push(CRYPTO_EX_DATA_FUNCS, (st), (val))
+# define sk_CRYPTO_EX_DATA_FUNCS_unshift(st, val) SKM_sk_unshift(CRYPTO_EX_DATA_FUNCS, (st), (val))
+# define sk_CRYPTO_EX_DATA_FUNCS_find(st, val) SKM_sk_find(CRYPTO_EX_DATA_FUNCS, (st), (val))
+# define sk_CRYPTO_EX_DATA_FUNCS_find_ex(st, val) SKM_sk_find_ex(CRYPTO_EX_DATA_FUNCS, (st), (val))
+# define sk_CRYPTO_EX_DATA_FUNCS_delete(st, i) SKM_sk_delete(CRYPTO_EX_DATA_FUNCS, (st), (i))
+# define sk_CRYPTO_EX_DATA_FUNCS_delete_ptr(st, ptr) SKM_sk_delete_ptr(CRYPTO_EX_DATA_FUNCS, (st), (ptr))
+# define sk_CRYPTO_EX_DATA_FUNCS_insert(st, val, i) SKM_sk_insert(CRYPTO_EX_DATA_FUNCS, (st), (val), (i))
+# define sk_CRYPTO_EX_DATA_FUNCS_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CRYPTO_EX_DATA_FUNCS, (st), (cmp))
+# define sk_CRYPTO_EX_DATA_FUNCS_dup(st) SKM_sk_dup(CRYPTO_EX_DATA_FUNCS, st)
+# define sk_CRYPTO_EX_DATA_FUNCS_pop_free(st, free_func) SKM_sk_pop_free(CRYPTO_EX_DATA_FUNCS, (st), (free_func))
+# define sk_CRYPTO_EX_DATA_FUNCS_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(CRYPTO_EX_DATA_FUNCS, (st), (copy_func), (free_func))
+# define sk_CRYPTO_EX_DATA_FUNCS_shift(st) SKM_sk_shift(CRYPTO_EX_DATA_FUNCS, (st))
+# define sk_CRYPTO_EX_DATA_FUNCS_pop(st) SKM_sk_pop(CRYPTO_EX_DATA_FUNCS, (st))
+# define sk_CRYPTO_EX_DATA_FUNCS_sort(st) SKM_sk_sort(CRYPTO_EX_DATA_FUNCS, (st))
+# define sk_CRYPTO_EX_DATA_FUNCS_is_sorted(st) SKM_sk_is_sorted(CRYPTO_EX_DATA_FUNCS, (st))
+# define sk_CRYPTO_dynlock_new(cmp) SKM_sk_new(CRYPTO_dynlock, (cmp))
+# define sk_CRYPTO_dynlock_new_null() SKM_sk_new_null(CRYPTO_dynlock)
+# define sk_CRYPTO_dynlock_free(st) SKM_sk_free(CRYPTO_dynlock, (st))
+# define sk_CRYPTO_dynlock_num(st) SKM_sk_num(CRYPTO_dynlock, (st))
+# define sk_CRYPTO_dynlock_value(st, i) SKM_sk_value(CRYPTO_dynlock, (st), (i))
+# define sk_CRYPTO_dynlock_set(st, i, val) SKM_sk_set(CRYPTO_dynlock, (st), (i), (val))
+# define sk_CRYPTO_dynlock_zero(st) SKM_sk_zero(CRYPTO_dynlock, (st))
+# define sk_CRYPTO_dynlock_push(st, val) SKM_sk_push(CRYPTO_dynlock, (st), (val))
+# define sk_CRYPTO_dynlock_unshift(st, val) SKM_sk_unshift(CRYPTO_dynlock, (st), (val))
+# define sk_CRYPTO_dynlock_find(st, val) SKM_sk_find(CRYPTO_dynlock, (st), (val))
+# define sk_CRYPTO_dynlock_find_ex(st, val) SKM_sk_find_ex(CRYPTO_dynlock, (st), (val))
+# define sk_CRYPTO_dynlock_delete(st, i) SKM_sk_delete(CRYPTO_dynlock, (st), (i))
+# define sk_CRYPTO_dynlock_delete_ptr(st, ptr) SKM_sk_delete_ptr(CRYPTO_dynlock, (st), (ptr))
+# define sk_CRYPTO_dynlock_insert(st, val, i) SKM_sk_insert(CRYPTO_dynlock, (st), (val), (i))
+# define sk_CRYPTO_dynlock_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CRYPTO_dynlock, (st), (cmp))
+# define sk_CRYPTO_dynlock_dup(st) SKM_sk_dup(CRYPTO_dynlock, st)
+# define sk_CRYPTO_dynlock_pop_free(st, free_func) SKM_sk_pop_free(CRYPTO_dynlock, (st), (free_func))
+# define sk_CRYPTO_dynlock_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(CRYPTO_dynlock, (st), (copy_func), (free_func))
+# define sk_CRYPTO_dynlock_shift(st) SKM_sk_shift(CRYPTO_dynlock, (st))
+# define sk_CRYPTO_dynlock_pop(st) SKM_sk_pop(CRYPTO_dynlock, (st))
+# define sk_CRYPTO_dynlock_sort(st) SKM_sk_sort(CRYPTO_dynlock, (st))
+# define sk_CRYPTO_dynlock_is_sorted(st) SKM_sk_is_sorted(CRYPTO_dynlock, (st))
+# define sk_DIST_POINT_new(cmp) SKM_sk_new(DIST_POINT, (cmp))
+# define sk_DIST_POINT_new_null() SKM_sk_new_null(DIST_POINT)
+# define sk_DIST_POINT_free(st) SKM_sk_free(DIST_POINT, (st))
+# define sk_DIST_POINT_num(st) SKM_sk_num(DIST_POINT, (st))
+# define sk_DIST_POINT_value(st, i) SKM_sk_value(DIST_POINT, (st), (i))
+# define sk_DIST_POINT_set(st, i, val) SKM_sk_set(DIST_POINT, (st), (i), (val))
+# define sk_DIST_POINT_zero(st) SKM_sk_zero(DIST_POINT, (st))
+# define sk_DIST_POINT_push(st, val) SKM_sk_push(DIST_POINT, (st), (val))
+# define sk_DIST_POINT_unshift(st, val) SKM_sk_unshift(DIST_POINT, (st), (val))
+# define sk_DIST_POINT_find(st, val) SKM_sk_find(DIST_POINT, (st), (val))
+# define sk_DIST_POINT_find_ex(st, val) SKM_sk_find_ex(DIST_POINT, (st), (val))
+# define sk_DIST_POINT_delete(st, i) SKM_sk_delete(DIST_POINT, (st), (i))
+# define sk_DIST_POINT_delete_ptr(st, ptr) SKM_sk_delete_ptr(DIST_POINT, (st), (ptr))
+# define sk_DIST_POINT_insert(st, val, i) SKM_sk_insert(DIST_POINT, (st), (val), (i))
+# define sk_DIST_POINT_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(DIST_POINT, (st), (cmp))
+# define sk_DIST_POINT_dup(st) SKM_sk_dup(DIST_POINT, st)
+# define sk_DIST_POINT_pop_free(st, free_func) SKM_sk_pop_free(DIST_POINT, (st), (free_func))
+# define sk_DIST_POINT_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(DIST_POINT, (st), (copy_func), (free_func))
+# define sk_DIST_POINT_shift(st) SKM_sk_shift(DIST_POINT, (st))
+# define sk_DIST_POINT_pop(st) SKM_sk_pop(DIST_POINT, (st))
+# define sk_DIST_POINT_sort(st) SKM_sk_sort(DIST_POINT, (st))
+# define sk_DIST_POINT_is_sorted(st) SKM_sk_is_sorted(DIST_POINT, (st))
+# define sk_ENGINE_new(cmp) SKM_sk_new(ENGINE, (cmp))
+# define sk_ENGINE_new_null() SKM_sk_new_null(ENGINE)
+# define sk_ENGINE_free(st) SKM_sk_free(ENGINE, (st))
+# define sk_ENGINE_num(st) SKM_sk_num(ENGINE, (st))
+# define sk_ENGINE_value(st, i) SKM_sk_value(ENGINE, (st), (i))
+# define sk_ENGINE_set(st, i, val) SKM_sk_set(ENGINE, (st), (i), (val))
+# define sk_ENGINE_zero(st) SKM_sk_zero(ENGINE, (st))
+# define sk_ENGINE_push(st, val) SKM_sk_push(ENGINE, (st), (val))
+# define sk_ENGINE_unshift(st, val) SKM_sk_unshift(ENGINE, (st), (val))
+# define sk_ENGINE_find(st, val) SKM_sk_find(ENGINE, (st), (val))
+# define sk_ENGINE_find_ex(st, val) SKM_sk_find_ex(ENGINE, (st), (val))
+# define sk_ENGINE_delete(st, i) SKM_sk_delete(ENGINE, (st), (i))
+# define sk_ENGINE_delete_ptr(st, ptr) SKM_sk_delete_ptr(ENGINE, (st), (ptr))
+# define sk_ENGINE_insert(st, val, i) SKM_sk_insert(ENGINE, (st), (val), (i))
+# define sk_ENGINE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ENGINE, (st), (cmp))
+# define sk_ENGINE_dup(st) SKM_sk_dup(ENGINE, st)
+# define sk_ENGINE_pop_free(st, free_func) SKM_sk_pop_free(ENGINE, (st), (free_func))
+# define sk_ENGINE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ENGINE, (st), (copy_func), (free_func))
+# define sk_ENGINE_shift(st) SKM_sk_shift(ENGINE, (st))
+# define sk_ENGINE_pop(st) SKM_sk_pop(ENGINE, (st))
+# define sk_ENGINE_sort(st) SKM_sk_sort(ENGINE, (st))
+# define sk_ENGINE_is_sorted(st) SKM_sk_is_sorted(ENGINE, (st))
+# define sk_ENGINE_CLEANUP_ITEM_new(cmp) SKM_sk_new(ENGINE_CLEANUP_ITEM, (cmp))
+# define sk_ENGINE_CLEANUP_ITEM_new_null() SKM_sk_new_null(ENGINE_CLEANUP_ITEM)
+# define sk_ENGINE_CLEANUP_ITEM_free(st) SKM_sk_free(ENGINE_CLEANUP_ITEM, (st))
+# define sk_ENGINE_CLEANUP_ITEM_num(st) SKM_sk_num(ENGINE_CLEANUP_ITEM, (st))
+# define sk_ENGINE_CLEANUP_ITEM_value(st, i) SKM_sk_value(ENGINE_CLEANUP_ITEM, (st), (i))
+# define sk_ENGINE_CLEANUP_ITEM_set(st, i, val) SKM_sk_set(ENGINE_CLEANUP_ITEM, (st), (i), (val))
+# define sk_ENGINE_CLEANUP_ITEM_zero(st) SKM_sk_zero(ENGINE_CLEANUP_ITEM, (st))
+# define sk_ENGINE_CLEANUP_ITEM_push(st, val) SKM_sk_push(ENGINE_CLEANUP_ITEM, (st), (val))
+# define sk_ENGINE_CLEANUP_ITEM_unshift(st, val) SKM_sk_unshift(ENGINE_CLEANUP_ITEM, (st), (val))
+# define sk_ENGINE_CLEANUP_ITEM_find(st, val) SKM_sk_find(ENGINE_CLEANUP_ITEM, (st), (val))
+# define sk_ENGINE_CLEANUP_ITEM_find_ex(st, val) SKM_sk_find_ex(ENGINE_CLEANUP_ITEM, (st), (val))
+# define sk_ENGINE_CLEANUP_ITEM_delete(st, i) SKM_sk_delete(ENGINE_CLEANUP_ITEM, (st), (i))
+# define sk_ENGINE_CLEANUP_ITEM_delete_ptr(st, ptr) SKM_sk_delete_ptr(ENGINE_CLEANUP_ITEM, (st), (ptr))
+# define sk_ENGINE_CLEANUP_ITEM_insert(st, val, i) SKM_sk_insert(ENGINE_CLEANUP_ITEM, (st), (val), (i))
+# define sk_ENGINE_CLEANUP_ITEM_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ENGINE_CLEANUP_ITEM, (st), (cmp))
+# define sk_ENGINE_CLEANUP_ITEM_dup(st) SKM_sk_dup(ENGINE_CLEANUP_ITEM, st)
+# define sk_ENGINE_CLEANUP_ITEM_pop_free(st, free_func) SKM_sk_pop_free(ENGINE_CLEANUP_ITEM, (st), (free_func))
+# define sk_ENGINE_CLEANUP_ITEM_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ENGINE_CLEANUP_ITEM, (st), (copy_func), (free_func))
+# define sk_ENGINE_CLEANUP_ITEM_shift(st) SKM_sk_shift(ENGINE_CLEANUP_ITEM, (st))
+# define sk_ENGINE_CLEANUP_ITEM_pop(st) SKM_sk_pop(ENGINE_CLEANUP_ITEM, (st))
+# define sk_ENGINE_CLEANUP_ITEM_sort(st) SKM_sk_sort(ENGINE_CLEANUP_ITEM, (st))
+# define sk_ENGINE_CLEANUP_ITEM_is_sorted(st) SKM_sk_is_sorted(ENGINE_CLEANUP_ITEM, (st))
+# define sk_ESS_CERT_ID_new(cmp) SKM_sk_new(ESS_CERT_ID, (cmp))
+# define sk_ESS_CERT_ID_new_null() SKM_sk_new_null(ESS_CERT_ID)
+# define sk_ESS_CERT_ID_free(st) SKM_sk_free(ESS_CERT_ID, (st))
+# define sk_ESS_CERT_ID_num(st) SKM_sk_num(ESS_CERT_ID, (st))
+# define sk_ESS_CERT_ID_value(st, i) SKM_sk_value(ESS_CERT_ID, (st), (i))
+# define sk_ESS_CERT_ID_set(st, i, val) SKM_sk_set(ESS_CERT_ID, (st), (i), (val))
+# define sk_ESS_CERT_ID_zero(st) SKM_sk_zero(ESS_CERT_ID, (st))
+# define sk_ESS_CERT_ID_push(st, val) SKM_sk_push(ESS_CERT_ID, (st), (val))
+# define sk_ESS_CERT_ID_unshift(st, val) SKM_sk_unshift(ESS_CERT_ID, (st), (val))
+# define sk_ESS_CERT_ID_find(st, val) SKM_sk_find(ESS_CERT_ID, (st), (val))
+# define sk_ESS_CERT_ID_find_ex(st, val) SKM_sk_find_ex(ESS_CERT_ID, (st), (val))
+# define sk_ESS_CERT_ID_delete(st, i) SKM_sk_delete(ESS_CERT_ID, (st), (i))
+# define sk_ESS_CERT_ID_delete_ptr(st, ptr) SKM_sk_delete_ptr(ESS_CERT_ID, (st), (ptr))
+# define sk_ESS_CERT_ID_insert(st, val, i) SKM_sk_insert(ESS_CERT_ID, (st), (val), (i))
+# define sk_ESS_CERT_ID_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ESS_CERT_ID, (st), (cmp))
+# define sk_ESS_CERT_ID_dup(st) SKM_sk_dup(ESS_CERT_ID, st)
+# define sk_ESS_CERT_ID_pop_free(st, free_func) SKM_sk_pop_free(ESS_CERT_ID, (st), (free_func))
+# define sk_ESS_CERT_ID_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ESS_CERT_ID, (st), (copy_func), (free_func))
+# define sk_ESS_CERT_ID_shift(st) SKM_sk_shift(ESS_CERT_ID, (st))
+# define sk_ESS_CERT_ID_pop(st) SKM_sk_pop(ESS_CERT_ID, (st))
+# define sk_ESS_CERT_ID_sort(st) SKM_sk_sort(ESS_CERT_ID, (st))
+# define sk_ESS_CERT_ID_is_sorted(st) SKM_sk_is_sorted(ESS_CERT_ID, (st))
+# define sk_EVP_MD_new(cmp) SKM_sk_new(EVP_MD, (cmp))
+# define sk_EVP_MD_new_null() SKM_sk_new_null(EVP_MD)
+# define sk_EVP_MD_free(st) SKM_sk_free(EVP_MD, (st))
+# define sk_EVP_MD_num(st) SKM_sk_num(EVP_MD, (st))
+# define sk_EVP_MD_value(st, i) SKM_sk_value(EVP_MD, (st), (i))
+# define sk_EVP_MD_set(st, i, val) SKM_sk_set(EVP_MD, (st), (i), (val))
+# define sk_EVP_MD_zero(st) SKM_sk_zero(EVP_MD, (st))
+# define sk_EVP_MD_push(st, val) SKM_sk_push(EVP_MD, (st), (val))
+# define sk_EVP_MD_unshift(st, val) SKM_sk_unshift(EVP_MD, (st), (val))
+# define sk_EVP_MD_find(st, val) SKM_sk_find(EVP_MD, (st), (val))
+# define sk_EVP_MD_find_ex(st, val) SKM_sk_find_ex(EVP_MD, (st), (val))
+# define sk_EVP_MD_delete(st, i) SKM_sk_delete(EVP_MD, (st), (i))
+# define sk_EVP_MD_delete_ptr(st, ptr) SKM_sk_delete_ptr(EVP_MD, (st), (ptr))
+# define sk_EVP_MD_insert(st, val, i) SKM_sk_insert(EVP_MD, (st), (val), (i))
+# define sk_EVP_MD_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(EVP_MD, (st), (cmp))
+# define sk_EVP_MD_dup(st) SKM_sk_dup(EVP_MD, st)
+# define sk_EVP_MD_pop_free(st, free_func) SKM_sk_pop_free(EVP_MD, (st), (free_func))
+# define sk_EVP_MD_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(EVP_MD, (st), (copy_func), (free_func))
+# define sk_EVP_MD_shift(st) SKM_sk_shift(EVP_MD, (st))
+# define sk_EVP_MD_pop(st) SKM_sk_pop(EVP_MD, (st))
+# define sk_EVP_MD_sort(st) SKM_sk_sort(EVP_MD, (st))
+# define sk_EVP_MD_is_sorted(st) SKM_sk_is_sorted(EVP_MD, (st))
+# define sk_EVP_PBE_CTL_new(cmp) SKM_sk_new(EVP_PBE_CTL, (cmp))
+# define sk_EVP_PBE_CTL_new_null() SKM_sk_new_null(EVP_PBE_CTL)
+# define sk_EVP_PBE_CTL_free(st) SKM_sk_free(EVP_PBE_CTL, (st))
+# define sk_EVP_PBE_CTL_num(st) SKM_sk_num(EVP_PBE_CTL, (st))
+# define sk_EVP_PBE_CTL_value(st, i) SKM_sk_value(EVP_PBE_CTL, (st), (i))
+# define sk_EVP_PBE_CTL_set(st, i, val) SKM_sk_set(EVP_PBE_CTL, (st), (i), (val))
+# define sk_EVP_PBE_CTL_zero(st) SKM_sk_zero(EVP_PBE_CTL, (st))
+# define sk_EVP_PBE_CTL_push(st, val) SKM_sk_push(EVP_PBE_CTL, (st), (val))
+# define sk_EVP_PBE_CTL_unshift(st, val) SKM_sk_unshift(EVP_PBE_CTL, (st), (val))
+# define sk_EVP_PBE_CTL_find(st, val) SKM_sk_find(EVP_PBE_CTL, (st), (val))
+# define sk_EVP_PBE_CTL_find_ex(st, val) SKM_sk_find_ex(EVP_PBE_CTL, (st), (val))
+# define sk_EVP_PBE_CTL_delete(st, i) SKM_sk_delete(EVP_PBE_CTL, (st), (i))
+# define sk_EVP_PBE_CTL_delete_ptr(st, ptr) SKM_sk_delete_ptr(EVP_PBE_CTL, (st), (ptr))
+# define sk_EVP_PBE_CTL_insert(st, val, i) SKM_sk_insert(EVP_PBE_CTL, (st), (val), (i))
+# define sk_EVP_PBE_CTL_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(EVP_PBE_CTL, (st), (cmp))
+# define sk_EVP_PBE_CTL_dup(st) SKM_sk_dup(EVP_PBE_CTL, st)
+# define sk_EVP_PBE_CTL_pop_free(st, free_func) SKM_sk_pop_free(EVP_PBE_CTL, (st), (free_func))
+# define sk_EVP_PBE_CTL_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(EVP_PBE_CTL, (st), (copy_func), (free_func))
+# define sk_EVP_PBE_CTL_shift(st) SKM_sk_shift(EVP_PBE_CTL, (st))
+# define sk_EVP_PBE_CTL_pop(st) SKM_sk_pop(EVP_PBE_CTL, (st))
+# define sk_EVP_PBE_CTL_sort(st) SKM_sk_sort(EVP_PBE_CTL, (st))
+# define sk_EVP_PBE_CTL_is_sorted(st) SKM_sk_is_sorted(EVP_PBE_CTL, (st))
+# define sk_EVP_PKEY_ASN1_METHOD_new(cmp) SKM_sk_new(EVP_PKEY_ASN1_METHOD, (cmp))
+# define sk_EVP_PKEY_ASN1_METHOD_new_null() SKM_sk_new_null(EVP_PKEY_ASN1_METHOD)
+# define sk_EVP_PKEY_ASN1_METHOD_free(st) SKM_sk_free(EVP_PKEY_ASN1_METHOD, (st))
+# define sk_EVP_PKEY_ASN1_METHOD_num(st) SKM_sk_num(EVP_PKEY_ASN1_METHOD, (st))
+# define sk_EVP_PKEY_ASN1_METHOD_value(st, i) SKM_sk_value(EVP_PKEY_ASN1_METHOD, (st), (i))
+# define sk_EVP_PKEY_ASN1_METHOD_set(st, i, val) SKM_sk_set(EVP_PKEY_ASN1_METHOD, (st), (i), (val))
+# define sk_EVP_PKEY_ASN1_METHOD_zero(st) SKM_sk_zero(EVP_PKEY_ASN1_METHOD, (st))
+# define sk_EVP_PKEY_ASN1_METHOD_push(st, val) SKM_sk_push(EVP_PKEY_ASN1_METHOD, (st), (val))
+# define sk_EVP_PKEY_ASN1_METHOD_unshift(st, val) SKM_sk_unshift(EVP_PKEY_ASN1_METHOD, (st), (val))
+# define sk_EVP_PKEY_ASN1_METHOD_find(st, val) SKM_sk_find(EVP_PKEY_ASN1_METHOD, (st), (val))
+# define sk_EVP_PKEY_ASN1_METHOD_find_ex(st, val) SKM_sk_find_ex(EVP_PKEY_ASN1_METHOD, (st), (val))
+# define sk_EVP_PKEY_ASN1_METHOD_delete(st, i) SKM_sk_delete(EVP_PKEY_ASN1_METHOD, (st), (i))
+# define sk_EVP_PKEY_ASN1_METHOD_delete_ptr(st, ptr) SKM_sk_delete_ptr(EVP_PKEY_ASN1_METHOD, (st), (ptr))
+# define sk_EVP_PKEY_ASN1_METHOD_insert(st, val, i) SKM_sk_insert(EVP_PKEY_ASN1_METHOD, (st), (val), (i))
+# define sk_EVP_PKEY_ASN1_METHOD_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(EVP_PKEY_ASN1_METHOD, (st), (cmp))
+# define sk_EVP_PKEY_ASN1_METHOD_dup(st) SKM_sk_dup(EVP_PKEY_ASN1_METHOD, st)
+# define sk_EVP_PKEY_ASN1_METHOD_pop_free(st, free_func) SKM_sk_pop_free(EVP_PKEY_ASN1_METHOD, (st), (free_func))
+# define sk_EVP_PKEY_ASN1_METHOD_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(EVP_PKEY_ASN1_METHOD, (st), (copy_func), (free_func))
+# define sk_EVP_PKEY_ASN1_METHOD_shift(st) SKM_sk_shift(EVP_PKEY_ASN1_METHOD, (st))
+# define sk_EVP_PKEY_ASN1_METHOD_pop(st) SKM_sk_pop(EVP_PKEY_ASN1_METHOD, (st))
+# define sk_EVP_PKEY_ASN1_METHOD_sort(st) SKM_sk_sort(EVP_PKEY_ASN1_METHOD, (st))
+# define sk_EVP_PKEY_ASN1_METHOD_is_sorted(st) SKM_sk_is_sorted(EVP_PKEY_ASN1_METHOD, (st))
+# define sk_EVP_PKEY_METHOD_new(cmp) SKM_sk_new(EVP_PKEY_METHOD, (cmp))
+# define sk_EVP_PKEY_METHOD_new_null() SKM_sk_new_null(EVP_PKEY_METHOD)
+# define sk_EVP_PKEY_METHOD_free(st) SKM_sk_free(EVP_PKEY_METHOD, (st))
+# define sk_EVP_PKEY_METHOD_num(st) SKM_sk_num(EVP_PKEY_METHOD, (st))
+# define sk_EVP_PKEY_METHOD_value(st, i) SKM_sk_value(EVP_PKEY_METHOD, (st), (i))
+# define sk_EVP_PKEY_METHOD_set(st, i, val) SKM_sk_set(EVP_PKEY_METHOD, (st), (i), (val))
+# define sk_EVP_PKEY_METHOD_zero(st) SKM_sk_zero(EVP_PKEY_METHOD, (st))
+# define sk_EVP_PKEY_METHOD_push(st, val) SKM_sk_push(EVP_PKEY_METHOD, (st), (val))
+# define sk_EVP_PKEY_METHOD_unshift(st, val) SKM_sk_unshift(EVP_PKEY_METHOD, (st), (val))
+# define sk_EVP_PKEY_METHOD_find(st, val) SKM_sk_find(EVP_PKEY_METHOD, (st), (val))
+# define sk_EVP_PKEY_METHOD_find_ex(st, val) SKM_sk_find_ex(EVP_PKEY_METHOD, (st), (val))
+# define sk_EVP_PKEY_METHOD_delete(st, i) SKM_sk_delete(EVP_PKEY_METHOD, (st), (i))
+# define sk_EVP_PKEY_METHOD_delete_ptr(st, ptr) SKM_sk_delete_ptr(EVP_PKEY_METHOD, (st), (ptr))
+# define sk_EVP_PKEY_METHOD_insert(st, val, i) SKM_sk_insert(EVP_PKEY_METHOD, (st), (val), (i))
+# define sk_EVP_PKEY_METHOD_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(EVP_PKEY_METHOD, (st), (cmp))
+# define sk_EVP_PKEY_METHOD_dup(st) SKM_sk_dup(EVP_PKEY_METHOD, st)
+# define sk_EVP_PKEY_METHOD_pop_free(st, free_func) SKM_sk_pop_free(EVP_PKEY_METHOD, (st), (free_func))
+# define sk_EVP_PKEY_METHOD_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(EVP_PKEY_METHOD, (st), (copy_func), (free_func))
+# define sk_EVP_PKEY_METHOD_shift(st) SKM_sk_shift(EVP_PKEY_METHOD, (st))
+# define sk_EVP_PKEY_METHOD_pop(st) SKM_sk_pop(EVP_PKEY_METHOD, (st))
+# define sk_EVP_PKEY_METHOD_sort(st) SKM_sk_sort(EVP_PKEY_METHOD, (st))
+# define sk_EVP_PKEY_METHOD_is_sorted(st) SKM_sk_is_sorted(EVP_PKEY_METHOD, (st))
+# define sk_GENERAL_NAME_new(cmp) SKM_sk_new(GENERAL_NAME, (cmp))
+# define sk_GENERAL_NAME_new_null() SKM_sk_new_null(GENERAL_NAME)
+# define sk_GENERAL_NAME_free(st) SKM_sk_free(GENERAL_NAME, (st))
+# define sk_GENERAL_NAME_num(st) SKM_sk_num(GENERAL_NAME, (st))
+# define sk_GENERAL_NAME_value(st, i) SKM_sk_value(GENERAL_NAME, (st), (i))
+# define sk_GENERAL_NAME_set(st, i, val) SKM_sk_set(GENERAL_NAME, (st), (i), (val))
+# define sk_GENERAL_NAME_zero(st) SKM_sk_zero(GENERAL_NAME, (st))
+# define sk_GENERAL_NAME_push(st, val) SKM_sk_push(GENERAL_NAME, (st), (val))
+# define sk_GENERAL_NAME_unshift(st, val) SKM_sk_unshift(GENERAL_NAME, (st), (val))
+# define sk_GENERAL_NAME_find(st, val) SKM_sk_find(GENERAL_NAME, (st), (val))
+# define sk_GENERAL_NAME_find_ex(st, val) SKM_sk_find_ex(GENERAL_NAME, (st), (val))
+# define sk_GENERAL_NAME_delete(st, i) SKM_sk_delete(GENERAL_NAME, (st), (i))
+# define sk_GENERAL_NAME_delete_ptr(st, ptr) SKM_sk_delete_ptr(GENERAL_NAME, (st), (ptr))
+# define sk_GENERAL_NAME_insert(st, val, i) SKM_sk_insert(GENERAL_NAME, (st), (val), (i))
+# define sk_GENERAL_NAME_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(GENERAL_NAME, (st), (cmp))
+# define sk_GENERAL_NAME_dup(st) SKM_sk_dup(GENERAL_NAME, st)
+# define sk_GENERAL_NAME_pop_free(st, free_func) SKM_sk_pop_free(GENERAL_NAME, (st), (free_func))
+# define sk_GENERAL_NAME_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(GENERAL_NAME, (st), (copy_func), (free_func))
+# define sk_GENERAL_NAME_shift(st) SKM_sk_shift(GENERAL_NAME, (st))
+# define sk_GENERAL_NAME_pop(st) SKM_sk_pop(GENERAL_NAME, (st))
+# define sk_GENERAL_NAME_sort(st) SKM_sk_sort(GENERAL_NAME, (st))
+# define sk_GENERAL_NAME_is_sorted(st) SKM_sk_is_sorted(GENERAL_NAME, (st))
+# define sk_GENERAL_NAMES_new(cmp) SKM_sk_new(GENERAL_NAMES, (cmp))
+# define sk_GENERAL_NAMES_new_null() SKM_sk_new_null(GENERAL_NAMES)
+# define sk_GENERAL_NAMES_free(st) SKM_sk_free(GENERAL_NAMES, (st))
+# define sk_GENERAL_NAMES_num(st) SKM_sk_num(GENERAL_NAMES, (st))
+# define sk_GENERAL_NAMES_value(st, i) SKM_sk_value(GENERAL_NAMES, (st), (i))
+# define sk_GENERAL_NAMES_set(st, i, val) SKM_sk_set(GENERAL_NAMES, (st), (i), (val))
+# define sk_GENERAL_NAMES_zero(st) SKM_sk_zero(GENERAL_NAMES, (st))
+# define sk_GENERAL_NAMES_push(st, val) SKM_sk_push(GENERAL_NAMES, (st), (val))
+# define sk_GENERAL_NAMES_unshift(st, val) SKM_sk_unshift(GENERAL_NAMES, (st), (val))
+# define sk_GENERAL_NAMES_find(st, val) SKM_sk_find(GENERAL_NAMES, (st), (val))
+# define sk_GENERAL_NAMES_find_ex(st, val) SKM_sk_find_ex(GENERAL_NAMES, (st), (val))
+# define sk_GENERAL_NAMES_delete(st, i) SKM_sk_delete(GENERAL_NAMES, (st), (i))
+# define sk_GENERAL_NAMES_delete_ptr(st, ptr) SKM_sk_delete_ptr(GENERAL_NAMES, (st), (ptr))
+# define sk_GENERAL_NAMES_insert(st, val, i) SKM_sk_insert(GENERAL_NAMES, (st), (val), (i))
+# define sk_GENERAL_NAMES_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(GENERAL_NAMES, (st), (cmp))
+# define sk_GENERAL_NAMES_dup(st) SKM_sk_dup(GENERAL_NAMES, st)
+# define sk_GENERAL_NAMES_pop_free(st, free_func) SKM_sk_pop_free(GENERAL_NAMES, (st), (free_func))
+# define sk_GENERAL_NAMES_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(GENERAL_NAMES, (st), (copy_func), (free_func))
+# define sk_GENERAL_NAMES_shift(st) SKM_sk_shift(GENERAL_NAMES, (st))
+# define sk_GENERAL_NAMES_pop(st) SKM_sk_pop(GENERAL_NAMES, (st))
+# define sk_GENERAL_NAMES_sort(st) SKM_sk_sort(GENERAL_NAMES, (st))
+# define sk_GENERAL_NAMES_is_sorted(st) SKM_sk_is_sorted(GENERAL_NAMES, (st))
+# define sk_GENERAL_SUBTREE_new(cmp) SKM_sk_new(GENERAL_SUBTREE, (cmp))
+# define sk_GENERAL_SUBTREE_new_null() SKM_sk_new_null(GENERAL_SUBTREE)
+# define sk_GENERAL_SUBTREE_free(st) SKM_sk_free(GENERAL_SUBTREE, (st))
+# define sk_GENERAL_SUBTREE_num(st) SKM_sk_num(GENERAL_SUBTREE, (st))
+# define sk_GENERAL_SUBTREE_value(st, i) SKM_sk_value(GENERAL_SUBTREE, (st), (i))
+# define sk_GENERAL_SUBTREE_set(st, i, val) SKM_sk_set(GENERAL_SUBTREE, (st), (i), (val))
+# define sk_GENERAL_SUBTREE_zero(st) SKM_sk_zero(GENERAL_SUBTREE, (st))
+# define sk_GENERAL_SUBTREE_push(st, val) SKM_sk_push(GENERAL_SUBTREE, (st), (val))
+# define sk_GENERAL_SUBTREE_unshift(st, val) SKM_sk_unshift(GENERAL_SUBTREE, (st), (val))
+# define sk_GENERAL_SUBTREE_find(st, val) SKM_sk_find(GENERAL_SUBTREE, (st), (val))
+# define sk_GENERAL_SUBTREE_find_ex(st, val) SKM_sk_find_ex(GENERAL_SUBTREE, (st), (val))
+# define sk_GENERAL_SUBTREE_delete(st, i) SKM_sk_delete(GENERAL_SUBTREE, (st), (i))
+# define sk_GENERAL_SUBTREE_delete_ptr(st, ptr) SKM_sk_delete_ptr(GENERAL_SUBTREE, (st), (ptr))
+# define sk_GENERAL_SUBTREE_insert(st, val, i) SKM_sk_insert(GENERAL_SUBTREE, (st), (val), (i))
+# define sk_GENERAL_SUBTREE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(GENERAL_SUBTREE, (st), (cmp))
+# define sk_GENERAL_SUBTREE_dup(st) SKM_sk_dup(GENERAL_SUBTREE, st)
+# define sk_GENERAL_SUBTREE_pop_free(st, free_func) SKM_sk_pop_free(GENERAL_SUBTREE, (st), (free_func))
+# define sk_GENERAL_SUBTREE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(GENERAL_SUBTREE, (st), (copy_func), (free_func))
+# define sk_GENERAL_SUBTREE_shift(st) SKM_sk_shift(GENERAL_SUBTREE, (st))
+# define sk_GENERAL_SUBTREE_pop(st) SKM_sk_pop(GENERAL_SUBTREE, (st))
+# define sk_GENERAL_SUBTREE_sort(st) SKM_sk_sort(GENERAL_SUBTREE, (st))
+# define sk_GENERAL_SUBTREE_is_sorted(st) SKM_sk_is_sorted(GENERAL_SUBTREE, (st))
+# define sk_IPAddressFamily_new(cmp) SKM_sk_new(IPAddressFamily, (cmp))
+# define sk_IPAddressFamily_new_null() SKM_sk_new_null(IPAddressFamily)
+# define sk_IPAddressFamily_free(st) SKM_sk_free(IPAddressFamily, (st))
+# define sk_IPAddressFamily_num(st) SKM_sk_num(IPAddressFamily, (st))
+# define sk_IPAddressFamily_value(st, i) SKM_sk_value(IPAddressFamily, (st), (i))
+# define sk_IPAddressFamily_set(st, i, val) SKM_sk_set(IPAddressFamily, (st), (i), (val))
+# define sk_IPAddressFamily_zero(st) SKM_sk_zero(IPAddressFamily, (st))
+# define sk_IPAddressFamily_push(st, val) SKM_sk_push(IPAddressFamily, (st), (val))
+# define sk_IPAddressFamily_unshift(st, val) SKM_sk_unshift(IPAddressFamily, (st), (val))
+# define sk_IPAddressFamily_find(st, val) SKM_sk_find(IPAddressFamily, (st), (val))
+# define sk_IPAddressFamily_find_ex(st, val) SKM_sk_find_ex(IPAddressFamily, (st), (val))
+# define sk_IPAddressFamily_delete(st, i) SKM_sk_delete(IPAddressFamily, (st), (i))
+# define sk_IPAddressFamily_delete_ptr(st, ptr) SKM_sk_delete_ptr(IPAddressFamily, (st), (ptr))
+# define sk_IPAddressFamily_insert(st, val, i) SKM_sk_insert(IPAddressFamily, (st), (val), (i))
+# define sk_IPAddressFamily_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(IPAddressFamily, (st), (cmp))
+# define sk_IPAddressFamily_dup(st) SKM_sk_dup(IPAddressFamily, st)
+# define sk_IPAddressFamily_pop_free(st, free_func) SKM_sk_pop_free(IPAddressFamily, (st), (free_func))
+# define sk_IPAddressFamily_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(IPAddressFamily, (st), (copy_func), (free_func))
+# define sk_IPAddressFamily_shift(st) SKM_sk_shift(IPAddressFamily, (st))
+# define sk_IPAddressFamily_pop(st) SKM_sk_pop(IPAddressFamily, (st))
+# define sk_IPAddressFamily_sort(st) SKM_sk_sort(IPAddressFamily, (st))
+# define sk_IPAddressFamily_is_sorted(st) SKM_sk_is_sorted(IPAddressFamily, (st))
+# define sk_IPAddressOrRange_new(cmp) SKM_sk_new(IPAddressOrRange, (cmp))
+# define sk_IPAddressOrRange_new_null() SKM_sk_new_null(IPAddressOrRange)
+# define sk_IPAddressOrRange_free(st) SKM_sk_free(IPAddressOrRange, (st))
+# define sk_IPAddressOrRange_num(st) SKM_sk_num(IPAddressOrRange, (st))
+# define sk_IPAddressOrRange_value(st, i) SKM_sk_value(IPAddressOrRange, (st), (i))
+# define sk_IPAddressOrRange_set(st, i, val) SKM_sk_set(IPAddressOrRange, (st), (i), (val))
+# define sk_IPAddressOrRange_zero(st) SKM_sk_zero(IPAddressOrRange, (st))
+# define sk_IPAddressOrRange_push(st, val) SKM_sk_push(IPAddressOrRange, (st), (val))
+# define sk_IPAddressOrRange_unshift(st, val) SKM_sk_unshift(IPAddressOrRange, (st), (val))
+# define sk_IPAddressOrRange_find(st, val) SKM_sk_find(IPAddressOrRange, (st), (val))
+# define sk_IPAddressOrRange_find_ex(st, val) SKM_sk_find_ex(IPAddressOrRange, (st), (val))
+# define sk_IPAddressOrRange_delete(st, i) SKM_sk_delete(IPAddressOrRange, (st), (i))
+# define sk_IPAddressOrRange_delete_ptr(st, ptr) SKM_sk_delete_ptr(IPAddressOrRange, (st), (ptr))
+# define sk_IPAddressOrRange_insert(st, val, i) SKM_sk_insert(IPAddressOrRange, (st), (val), (i))
+# define sk_IPAddressOrRange_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(IPAddressOrRange, (st), (cmp))
+# define sk_IPAddressOrRange_dup(st) SKM_sk_dup(IPAddressOrRange, st)
+# define sk_IPAddressOrRange_pop_free(st, free_func) SKM_sk_pop_free(IPAddressOrRange, (st), (free_func))
+# define sk_IPAddressOrRange_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(IPAddressOrRange, (st), (copy_func), (free_func))
+# define sk_IPAddressOrRange_shift(st) SKM_sk_shift(IPAddressOrRange, (st))
+# define sk_IPAddressOrRange_pop(st) SKM_sk_pop(IPAddressOrRange, (st))
+# define sk_IPAddressOrRange_sort(st) SKM_sk_sort(IPAddressOrRange, (st))
+# define sk_IPAddressOrRange_is_sorted(st) SKM_sk_is_sorted(IPAddressOrRange, (st))
+# define sk_KRB5_APREQBODY_new(cmp) SKM_sk_new(KRB5_APREQBODY, (cmp))
+# define sk_KRB5_APREQBODY_new_null() SKM_sk_new_null(KRB5_APREQBODY)
+# define sk_KRB5_APREQBODY_free(st) SKM_sk_free(KRB5_APREQBODY, (st))
+# define sk_KRB5_APREQBODY_num(st) SKM_sk_num(KRB5_APREQBODY, (st))
+# define sk_KRB5_APREQBODY_value(st, i) SKM_sk_value(KRB5_APREQBODY, (st), (i))
+# define sk_KRB5_APREQBODY_set(st, i, val) SKM_sk_set(KRB5_APREQBODY, (st), (i), (val))
+# define sk_KRB5_APREQBODY_zero(st) SKM_sk_zero(KRB5_APREQBODY, (st))
+# define sk_KRB5_APREQBODY_push(st, val) SKM_sk_push(KRB5_APREQBODY, (st), (val))
+# define sk_KRB5_APREQBODY_unshift(st, val) SKM_sk_unshift(KRB5_APREQBODY, (st), (val))
+# define sk_KRB5_APREQBODY_find(st, val) SKM_sk_find(KRB5_APREQBODY, (st), (val))
+# define sk_KRB5_APREQBODY_find_ex(st, val) SKM_sk_find_ex(KRB5_APREQBODY, (st), (val))
+# define sk_KRB5_APREQBODY_delete(st, i) SKM_sk_delete(KRB5_APREQBODY, (st), (i))
+# define sk_KRB5_APREQBODY_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_APREQBODY, (st), (ptr))
+# define sk_KRB5_APREQBODY_insert(st, val, i) SKM_sk_insert(KRB5_APREQBODY, (st), (val), (i))
+# define sk_KRB5_APREQBODY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_APREQBODY, (st), (cmp))
+# define sk_KRB5_APREQBODY_dup(st) SKM_sk_dup(KRB5_APREQBODY, st)
+# define sk_KRB5_APREQBODY_pop_free(st, free_func) SKM_sk_pop_free(KRB5_APREQBODY, (st), (free_func))
+# define sk_KRB5_APREQBODY_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(KRB5_APREQBODY, (st), (copy_func), (free_func))
+# define sk_KRB5_APREQBODY_shift(st) SKM_sk_shift(KRB5_APREQBODY, (st))
+# define sk_KRB5_APREQBODY_pop(st) SKM_sk_pop(KRB5_APREQBODY, (st))
+# define sk_KRB5_APREQBODY_sort(st) SKM_sk_sort(KRB5_APREQBODY, (st))
+# define sk_KRB5_APREQBODY_is_sorted(st) SKM_sk_is_sorted(KRB5_APREQBODY, (st))
+# define sk_KRB5_AUTHDATA_new(cmp) SKM_sk_new(KRB5_AUTHDATA, (cmp))
+# define sk_KRB5_AUTHDATA_new_null() SKM_sk_new_null(KRB5_AUTHDATA)
+# define sk_KRB5_AUTHDATA_free(st) SKM_sk_free(KRB5_AUTHDATA, (st))
+# define sk_KRB5_AUTHDATA_num(st) SKM_sk_num(KRB5_AUTHDATA, (st))
+# define sk_KRB5_AUTHDATA_value(st, i) SKM_sk_value(KRB5_AUTHDATA, (st), (i))
+# define sk_KRB5_AUTHDATA_set(st, i, val) SKM_sk_set(KRB5_AUTHDATA, (st), (i), (val))
+# define sk_KRB5_AUTHDATA_zero(st) SKM_sk_zero(KRB5_AUTHDATA, (st))
+# define sk_KRB5_AUTHDATA_push(st, val) SKM_sk_push(KRB5_AUTHDATA, (st), (val))
+# define sk_KRB5_AUTHDATA_unshift(st, val) SKM_sk_unshift(KRB5_AUTHDATA, (st), (val))
+# define sk_KRB5_AUTHDATA_find(st, val) SKM_sk_find(KRB5_AUTHDATA, (st), (val))
+# define sk_KRB5_AUTHDATA_find_ex(st, val) SKM_sk_find_ex(KRB5_AUTHDATA, (st), (val))
+# define sk_KRB5_AUTHDATA_delete(st, i) SKM_sk_delete(KRB5_AUTHDATA, (st), (i))
+# define sk_KRB5_AUTHDATA_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_AUTHDATA, (st), (ptr))
+# define sk_KRB5_AUTHDATA_insert(st, val, i) SKM_sk_insert(KRB5_AUTHDATA, (st), (val), (i))
+# define sk_KRB5_AUTHDATA_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_AUTHDATA, (st), (cmp))
+# define sk_KRB5_AUTHDATA_dup(st) SKM_sk_dup(KRB5_AUTHDATA, st)
+# define sk_KRB5_AUTHDATA_pop_free(st, free_func) SKM_sk_pop_free(KRB5_AUTHDATA, (st), (free_func))
+# define sk_KRB5_AUTHDATA_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(KRB5_AUTHDATA, (st), (copy_func), (free_func))
+# define sk_KRB5_AUTHDATA_shift(st) SKM_sk_shift(KRB5_AUTHDATA, (st))
+# define sk_KRB5_AUTHDATA_pop(st) SKM_sk_pop(KRB5_AUTHDATA, (st))
+# define sk_KRB5_AUTHDATA_sort(st) SKM_sk_sort(KRB5_AUTHDATA, (st))
+# define sk_KRB5_AUTHDATA_is_sorted(st) SKM_sk_is_sorted(KRB5_AUTHDATA, (st))
+# define sk_KRB5_AUTHENTBODY_new(cmp) SKM_sk_new(KRB5_AUTHENTBODY, (cmp))
+# define sk_KRB5_AUTHENTBODY_new_null() SKM_sk_new_null(KRB5_AUTHENTBODY)
+# define sk_KRB5_AUTHENTBODY_free(st) SKM_sk_free(KRB5_AUTHENTBODY, (st))
+# define sk_KRB5_AUTHENTBODY_num(st) SKM_sk_num(KRB5_AUTHENTBODY, (st))
+# define sk_KRB5_AUTHENTBODY_value(st, i) SKM_sk_value(KRB5_AUTHENTBODY, (st), (i))
+# define sk_KRB5_AUTHENTBODY_set(st, i, val) SKM_sk_set(KRB5_AUTHENTBODY, (st), (i), (val))
+# define sk_KRB5_AUTHENTBODY_zero(st) SKM_sk_zero(KRB5_AUTHENTBODY, (st))
+# define sk_KRB5_AUTHENTBODY_push(st, val) SKM_sk_push(KRB5_AUTHENTBODY, (st), (val))
+# define sk_KRB5_AUTHENTBODY_unshift(st, val) SKM_sk_unshift(KRB5_AUTHENTBODY, (st), (val))
+# define sk_KRB5_AUTHENTBODY_find(st, val) SKM_sk_find(KRB5_AUTHENTBODY, (st), (val))
+# define sk_KRB5_AUTHENTBODY_find_ex(st, val) SKM_sk_find_ex(KRB5_AUTHENTBODY, (st), (val))
+# define sk_KRB5_AUTHENTBODY_delete(st, i) SKM_sk_delete(KRB5_AUTHENTBODY, (st), (i))
+# define sk_KRB5_AUTHENTBODY_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_AUTHENTBODY, (st), (ptr))
+# define sk_KRB5_AUTHENTBODY_insert(st, val, i) SKM_sk_insert(KRB5_AUTHENTBODY, (st), (val), (i))
+# define sk_KRB5_AUTHENTBODY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_AUTHENTBODY, (st), (cmp))
+# define sk_KRB5_AUTHENTBODY_dup(st) SKM_sk_dup(KRB5_AUTHENTBODY, st)
+# define sk_KRB5_AUTHENTBODY_pop_free(st, free_func) SKM_sk_pop_free(KRB5_AUTHENTBODY, (st), (free_func))
+# define sk_KRB5_AUTHENTBODY_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(KRB5_AUTHENTBODY, (st), (copy_func), (free_func))
+# define sk_KRB5_AUTHENTBODY_shift(st) SKM_sk_shift(KRB5_AUTHENTBODY, (st))
+# define sk_KRB5_AUTHENTBODY_pop(st) SKM_sk_pop(KRB5_AUTHENTBODY, (st))
+# define sk_KRB5_AUTHENTBODY_sort(st) SKM_sk_sort(KRB5_AUTHENTBODY, (st))
+# define sk_KRB5_AUTHENTBODY_is_sorted(st) SKM_sk_is_sorted(KRB5_AUTHENTBODY, (st))
+# define sk_KRB5_CHECKSUM_new(cmp) SKM_sk_new(KRB5_CHECKSUM, (cmp))
+# define sk_KRB5_CHECKSUM_new_null() SKM_sk_new_null(KRB5_CHECKSUM)
+# define sk_KRB5_CHECKSUM_free(st) SKM_sk_free(KRB5_CHECKSUM, (st))
+# define sk_KRB5_CHECKSUM_num(st) SKM_sk_num(KRB5_CHECKSUM, (st))
+# define sk_KRB5_CHECKSUM_value(st, i) SKM_sk_value(KRB5_CHECKSUM, (st), (i))
+# define sk_KRB5_CHECKSUM_set(st, i, val) SKM_sk_set(KRB5_CHECKSUM, (st), (i), (val))
+# define sk_KRB5_CHECKSUM_zero(st) SKM_sk_zero(KRB5_CHECKSUM, (st))
+# define sk_KRB5_CHECKSUM_push(st, val) SKM_sk_push(KRB5_CHECKSUM, (st), (val))
+# define sk_KRB5_CHECKSUM_unshift(st, val) SKM_sk_unshift(KRB5_CHECKSUM, (st), (val))
+# define sk_KRB5_CHECKSUM_find(st, val) SKM_sk_find(KRB5_CHECKSUM, (st), (val))
+# define sk_KRB5_CHECKSUM_find_ex(st, val) SKM_sk_find_ex(KRB5_CHECKSUM, (st), (val))
+# define sk_KRB5_CHECKSUM_delete(st, i) SKM_sk_delete(KRB5_CHECKSUM, (st), (i))
+# define sk_KRB5_CHECKSUM_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_CHECKSUM, (st), (ptr))
+# define sk_KRB5_CHECKSUM_insert(st, val, i) SKM_sk_insert(KRB5_CHECKSUM, (st), (val), (i))
+# define sk_KRB5_CHECKSUM_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_CHECKSUM, (st), (cmp))
+# define sk_KRB5_CHECKSUM_dup(st) SKM_sk_dup(KRB5_CHECKSUM, st)
+# define sk_KRB5_CHECKSUM_pop_free(st, free_func) SKM_sk_pop_free(KRB5_CHECKSUM, (st), (free_func))
+# define sk_KRB5_CHECKSUM_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(KRB5_CHECKSUM, (st), (copy_func), (free_func))
+# define sk_KRB5_CHECKSUM_shift(st) SKM_sk_shift(KRB5_CHECKSUM, (st))
+# define sk_KRB5_CHECKSUM_pop(st) SKM_sk_pop(KRB5_CHECKSUM, (st))
+# define sk_KRB5_CHECKSUM_sort(st) SKM_sk_sort(KRB5_CHECKSUM, (st))
+# define sk_KRB5_CHECKSUM_is_sorted(st) SKM_sk_is_sorted(KRB5_CHECKSUM, (st))
+# define sk_KRB5_ENCDATA_new(cmp) SKM_sk_new(KRB5_ENCDATA, (cmp))
+# define sk_KRB5_ENCDATA_new_null() SKM_sk_new_null(KRB5_ENCDATA)
+# define sk_KRB5_ENCDATA_free(st) SKM_sk_free(KRB5_ENCDATA, (st))
+# define sk_KRB5_ENCDATA_num(st) SKM_sk_num(KRB5_ENCDATA, (st))
+# define sk_KRB5_ENCDATA_value(st, i) SKM_sk_value(KRB5_ENCDATA, (st), (i))
+# define sk_KRB5_ENCDATA_set(st, i, val) SKM_sk_set(KRB5_ENCDATA, (st), (i), (val))
+# define sk_KRB5_ENCDATA_zero(st) SKM_sk_zero(KRB5_ENCDATA, (st))
+# define sk_KRB5_ENCDATA_push(st, val) SKM_sk_push(KRB5_ENCDATA, (st), (val))
+# define sk_KRB5_ENCDATA_unshift(st, val) SKM_sk_unshift(KRB5_ENCDATA, (st), (val))
+# define sk_KRB5_ENCDATA_find(st, val) SKM_sk_find(KRB5_ENCDATA, (st), (val))
+# define sk_KRB5_ENCDATA_find_ex(st, val) SKM_sk_find_ex(KRB5_ENCDATA, (st), (val))
+# define sk_KRB5_ENCDATA_delete(st, i) SKM_sk_delete(KRB5_ENCDATA, (st), (i))
+# define sk_KRB5_ENCDATA_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_ENCDATA, (st), (ptr))
+# define sk_KRB5_ENCDATA_insert(st, val, i) SKM_sk_insert(KRB5_ENCDATA, (st), (val), (i))
+# define sk_KRB5_ENCDATA_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_ENCDATA, (st), (cmp))
+# define sk_KRB5_ENCDATA_dup(st) SKM_sk_dup(KRB5_ENCDATA, st)
+# define sk_KRB5_ENCDATA_pop_free(st, free_func) SKM_sk_pop_free(KRB5_ENCDATA, (st), (free_func))
+# define sk_KRB5_ENCDATA_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(KRB5_ENCDATA, (st), (copy_func), (free_func))
+# define sk_KRB5_ENCDATA_shift(st) SKM_sk_shift(KRB5_ENCDATA, (st))
+# define sk_KRB5_ENCDATA_pop(st) SKM_sk_pop(KRB5_ENCDATA, (st))
+# define sk_KRB5_ENCDATA_sort(st) SKM_sk_sort(KRB5_ENCDATA, (st))
+# define sk_KRB5_ENCDATA_is_sorted(st) SKM_sk_is_sorted(KRB5_ENCDATA, (st))
+# define sk_KRB5_ENCKEY_new(cmp) SKM_sk_new(KRB5_ENCKEY, (cmp))
+# define sk_KRB5_ENCKEY_new_null() SKM_sk_new_null(KRB5_ENCKEY)
+# define sk_KRB5_ENCKEY_free(st) SKM_sk_free(KRB5_ENCKEY, (st))
+# define sk_KRB5_ENCKEY_num(st) SKM_sk_num(KRB5_ENCKEY, (st))
+# define sk_KRB5_ENCKEY_value(st, i) SKM_sk_value(KRB5_ENCKEY, (st), (i))
+# define sk_KRB5_ENCKEY_set(st, i, val) SKM_sk_set(KRB5_ENCKEY, (st), (i), (val))
+# define sk_KRB5_ENCKEY_zero(st) SKM_sk_zero(KRB5_ENCKEY, (st))
+# define sk_KRB5_ENCKEY_push(st, val) SKM_sk_push(KRB5_ENCKEY, (st), (val))
+# define sk_KRB5_ENCKEY_unshift(st, val) SKM_sk_unshift(KRB5_ENCKEY, (st), (val))
+# define sk_KRB5_ENCKEY_find(st, val) SKM_sk_find(KRB5_ENCKEY, (st), (val))
+# define sk_KRB5_ENCKEY_find_ex(st, val) SKM_sk_find_ex(KRB5_ENCKEY, (st), (val))
+# define sk_KRB5_ENCKEY_delete(st, i) SKM_sk_delete(KRB5_ENCKEY, (st), (i))
+# define sk_KRB5_ENCKEY_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_ENCKEY, (st), (ptr))
+# define sk_KRB5_ENCKEY_insert(st, val, i) SKM_sk_insert(KRB5_ENCKEY, (st), (val), (i))
+# define sk_KRB5_ENCKEY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_ENCKEY, (st), (cmp))
+# define sk_KRB5_ENCKEY_dup(st) SKM_sk_dup(KRB5_ENCKEY, st)
+# define sk_KRB5_ENCKEY_pop_free(st, free_func) SKM_sk_pop_free(KRB5_ENCKEY, (st), (free_func))
+# define sk_KRB5_ENCKEY_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(KRB5_ENCKEY, (st), (copy_func), (free_func))
+# define sk_KRB5_ENCKEY_shift(st) SKM_sk_shift(KRB5_ENCKEY, (st))
+# define sk_KRB5_ENCKEY_pop(st) SKM_sk_pop(KRB5_ENCKEY, (st))
+# define sk_KRB5_ENCKEY_sort(st) SKM_sk_sort(KRB5_ENCKEY, (st))
+# define sk_KRB5_ENCKEY_is_sorted(st) SKM_sk_is_sorted(KRB5_ENCKEY, (st))
+# define sk_KRB5_PRINCNAME_new(cmp) SKM_sk_new(KRB5_PRINCNAME, (cmp))
+# define sk_KRB5_PRINCNAME_new_null() SKM_sk_new_null(KRB5_PRINCNAME)
+# define sk_KRB5_PRINCNAME_free(st) SKM_sk_free(KRB5_PRINCNAME, (st))
+# define sk_KRB5_PRINCNAME_num(st) SKM_sk_num(KRB5_PRINCNAME, (st))
+# define sk_KRB5_PRINCNAME_value(st, i) SKM_sk_value(KRB5_PRINCNAME, (st), (i))
+# define sk_KRB5_PRINCNAME_set(st, i, val) SKM_sk_set(KRB5_PRINCNAME, (st), (i), (val))
+# define sk_KRB5_PRINCNAME_zero(st) SKM_sk_zero(KRB5_PRINCNAME, (st))
+# define sk_KRB5_PRINCNAME_push(st, val) SKM_sk_push(KRB5_PRINCNAME, (st), (val))
+# define sk_KRB5_PRINCNAME_unshift(st, val) SKM_sk_unshift(KRB5_PRINCNAME, (st), (val))
+# define sk_KRB5_PRINCNAME_find(st, val) SKM_sk_find(KRB5_PRINCNAME, (st), (val))
+# define sk_KRB5_PRINCNAME_find_ex(st, val) SKM_sk_find_ex(KRB5_PRINCNAME, (st), (val))
+# define sk_KRB5_PRINCNAME_delete(st, i) SKM_sk_delete(KRB5_PRINCNAME, (st), (i))
+# define sk_KRB5_PRINCNAME_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_PRINCNAME, (st), (ptr))
+# define sk_KRB5_PRINCNAME_insert(st, val, i) SKM_sk_insert(KRB5_PRINCNAME, (st), (val), (i))
+# define sk_KRB5_PRINCNAME_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_PRINCNAME, (st), (cmp))
+# define sk_KRB5_PRINCNAME_dup(st) SKM_sk_dup(KRB5_PRINCNAME, st)
+# define sk_KRB5_PRINCNAME_pop_free(st, free_func) SKM_sk_pop_free(KRB5_PRINCNAME, (st), (free_func))
+# define sk_KRB5_PRINCNAME_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(KRB5_PRINCNAME, (st), (copy_func), (free_func))
+# define sk_KRB5_PRINCNAME_shift(st) SKM_sk_shift(KRB5_PRINCNAME, (st))
+# define sk_KRB5_PRINCNAME_pop(st) SKM_sk_pop(KRB5_PRINCNAME, (st))
+# define sk_KRB5_PRINCNAME_sort(st) SKM_sk_sort(KRB5_PRINCNAME, (st))
+# define sk_KRB5_PRINCNAME_is_sorted(st) SKM_sk_is_sorted(KRB5_PRINCNAME, (st))
+# define sk_KRB5_TKTBODY_new(cmp) SKM_sk_new(KRB5_TKTBODY, (cmp))
+# define sk_KRB5_TKTBODY_new_null() SKM_sk_new_null(KRB5_TKTBODY)
+# define sk_KRB5_TKTBODY_free(st) SKM_sk_free(KRB5_TKTBODY, (st))
+# define sk_KRB5_TKTBODY_num(st) SKM_sk_num(KRB5_TKTBODY, (st))
+# define sk_KRB5_TKTBODY_value(st, i) SKM_sk_value(KRB5_TKTBODY, (st), (i))
+# define sk_KRB5_TKTBODY_set(st, i, val) SKM_sk_set(KRB5_TKTBODY, (st), (i), (val))
+# define sk_KRB5_TKTBODY_zero(st) SKM_sk_zero(KRB5_TKTBODY, (st))
+# define sk_KRB5_TKTBODY_push(st, val) SKM_sk_push(KRB5_TKTBODY, (st), (val))
+# define sk_KRB5_TKTBODY_unshift(st, val) SKM_sk_unshift(KRB5_TKTBODY, (st), (val))
+# define sk_KRB5_TKTBODY_find(st, val) SKM_sk_find(KRB5_TKTBODY, (st), (val))
+# define sk_KRB5_TKTBODY_find_ex(st, val) SKM_sk_find_ex(KRB5_TKTBODY, (st), (val))
+# define sk_KRB5_TKTBODY_delete(st, i) SKM_sk_delete(KRB5_TKTBODY, (st), (i))
+# define sk_KRB5_TKTBODY_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_TKTBODY, (st), (ptr))
+# define sk_KRB5_TKTBODY_insert(st, val, i) SKM_sk_insert(KRB5_TKTBODY, (st), (val), (i))
+# define sk_KRB5_TKTBODY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_TKTBODY, (st), (cmp))
+# define sk_KRB5_TKTBODY_dup(st) SKM_sk_dup(KRB5_TKTBODY, st)
+# define sk_KRB5_TKTBODY_pop_free(st, free_func) SKM_sk_pop_free(KRB5_TKTBODY, (st), (free_func))
+# define sk_KRB5_TKTBODY_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(KRB5_TKTBODY, (st), (copy_func), (free_func))
+# define sk_KRB5_TKTBODY_shift(st) SKM_sk_shift(KRB5_TKTBODY, (st))
+# define sk_KRB5_TKTBODY_pop(st) SKM_sk_pop(KRB5_TKTBODY, (st))
+# define sk_KRB5_TKTBODY_sort(st) SKM_sk_sort(KRB5_TKTBODY, (st))
+# define sk_KRB5_TKTBODY_is_sorted(st) SKM_sk_is_sorted(KRB5_TKTBODY, (st))
+# define sk_MEM_OBJECT_DATA_new(cmp) SKM_sk_new(MEM_OBJECT_DATA, (cmp))
+# define sk_MEM_OBJECT_DATA_new_null() SKM_sk_new_null(MEM_OBJECT_DATA)
+# define sk_MEM_OBJECT_DATA_free(st) SKM_sk_free(MEM_OBJECT_DATA, (st))
+# define sk_MEM_OBJECT_DATA_num(st) SKM_sk_num(MEM_OBJECT_DATA, (st))
+# define sk_MEM_OBJECT_DATA_value(st, i) SKM_sk_value(MEM_OBJECT_DATA, (st), (i))
+# define sk_MEM_OBJECT_DATA_set(st, i, val) SKM_sk_set(MEM_OBJECT_DATA, (st), (i), (val))
+# define sk_MEM_OBJECT_DATA_zero(st) SKM_sk_zero(MEM_OBJECT_DATA, (st))
+# define sk_MEM_OBJECT_DATA_push(st, val) SKM_sk_push(MEM_OBJECT_DATA, (st), (val))
+# define sk_MEM_OBJECT_DATA_unshift(st, val) SKM_sk_unshift(MEM_OBJECT_DATA, (st), (val))
+# define sk_MEM_OBJECT_DATA_find(st, val) SKM_sk_find(MEM_OBJECT_DATA, (st), (val))
+# define sk_MEM_OBJECT_DATA_find_ex(st, val) SKM_sk_find_ex(MEM_OBJECT_DATA, (st), (val))
+# define sk_MEM_OBJECT_DATA_delete(st, i) SKM_sk_delete(MEM_OBJECT_DATA, (st), (i))
+# define sk_MEM_OBJECT_DATA_delete_ptr(st, ptr) SKM_sk_delete_ptr(MEM_OBJECT_DATA, (st), (ptr))
+# define sk_MEM_OBJECT_DATA_insert(st, val, i) SKM_sk_insert(MEM_OBJECT_DATA, (st), (val), (i))
+# define sk_MEM_OBJECT_DATA_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(MEM_OBJECT_DATA, (st), (cmp))
+# define sk_MEM_OBJECT_DATA_dup(st) SKM_sk_dup(MEM_OBJECT_DATA, st)
+# define sk_MEM_OBJECT_DATA_pop_free(st, free_func) SKM_sk_pop_free(MEM_OBJECT_DATA, (st), (free_func))
+# define sk_MEM_OBJECT_DATA_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(MEM_OBJECT_DATA, (st), (copy_func), (free_func))
+# define sk_MEM_OBJECT_DATA_shift(st) SKM_sk_shift(MEM_OBJECT_DATA, (st))
+# define sk_MEM_OBJECT_DATA_pop(st) SKM_sk_pop(MEM_OBJECT_DATA, (st))
+# define sk_MEM_OBJECT_DATA_sort(st) SKM_sk_sort(MEM_OBJECT_DATA, (st))
+# define sk_MEM_OBJECT_DATA_is_sorted(st) SKM_sk_is_sorted(MEM_OBJECT_DATA, (st))
+# define sk_MIME_HEADER_new(cmp) SKM_sk_new(MIME_HEADER, (cmp))
+# define sk_MIME_HEADER_new_null() SKM_sk_new_null(MIME_HEADER)
+# define sk_MIME_HEADER_free(st) SKM_sk_free(MIME_HEADER, (st))
+# define sk_MIME_HEADER_num(st) SKM_sk_num(MIME_HEADER, (st))
+# define sk_MIME_HEADER_value(st, i) SKM_sk_value(MIME_HEADER, (st), (i))
+# define sk_MIME_HEADER_set(st, i, val) SKM_sk_set(MIME_HEADER, (st), (i), (val))
+# define sk_MIME_HEADER_zero(st) SKM_sk_zero(MIME_HEADER, (st))
+# define sk_MIME_HEADER_push(st, val) SKM_sk_push(MIME_HEADER, (st), (val))
+# define sk_MIME_HEADER_unshift(st, val) SKM_sk_unshift(MIME_HEADER, (st), (val))
+# define sk_MIME_HEADER_find(st, val) SKM_sk_find(MIME_HEADER, (st), (val))
+# define sk_MIME_HEADER_find_ex(st, val) SKM_sk_find_ex(MIME_HEADER, (st), (val))
+# define sk_MIME_HEADER_delete(st, i) SKM_sk_delete(MIME_HEADER, (st), (i))
+# define sk_MIME_HEADER_delete_ptr(st, ptr) SKM_sk_delete_ptr(MIME_HEADER, (st), (ptr))
+# define sk_MIME_HEADER_insert(st, val, i) SKM_sk_insert(MIME_HEADER, (st), (val), (i))
+# define sk_MIME_HEADER_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(MIME_HEADER, (st), (cmp))
+# define sk_MIME_HEADER_dup(st) SKM_sk_dup(MIME_HEADER, st)
+# define sk_MIME_HEADER_pop_free(st, free_func) SKM_sk_pop_free(MIME_HEADER, (st), (free_func))
+# define sk_MIME_HEADER_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(MIME_HEADER, (st), (copy_func), (free_func))
+# define sk_MIME_HEADER_shift(st) SKM_sk_shift(MIME_HEADER, (st))
+# define sk_MIME_HEADER_pop(st) SKM_sk_pop(MIME_HEADER, (st))
+# define sk_MIME_HEADER_sort(st) SKM_sk_sort(MIME_HEADER, (st))
+# define sk_MIME_HEADER_is_sorted(st) SKM_sk_is_sorted(MIME_HEADER, (st))
+# define sk_MIME_PARAM_new(cmp) SKM_sk_new(MIME_PARAM, (cmp))
+# define sk_MIME_PARAM_new_null() SKM_sk_new_null(MIME_PARAM)
+# define sk_MIME_PARAM_free(st) SKM_sk_free(MIME_PARAM, (st))
+# define sk_MIME_PARAM_num(st) SKM_sk_num(MIME_PARAM, (st))
+# define sk_MIME_PARAM_value(st, i) SKM_sk_value(MIME_PARAM, (st), (i))
+# define sk_MIME_PARAM_set(st, i, val) SKM_sk_set(MIME_PARAM, (st), (i), (val))
+# define sk_MIME_PARAM_zero(st) SKM_sk_zero(MIME_PARAM, (st))
+# define sk_MIME_PARAM_push(st, val) SKM_sk_push(MIME_PARAM, (st), (val))
+# define sk_MIME_PARAM_unshift(st, val) SKM_sk_unshift(MIME_PARAM, (st), (val))
+# define sk_MIME_PARAM_find(st, val) SKM_sk_find(MIME_PARAM, (st), (val))
+# define sk_MIME_PARAM_find_ex(st, val) SKM_sk_find_ex(MIME_PARAM, (st), (val))
+# define sk_MIME_PARAM_delete(st, i) SKM_sk_delete(MIME_PARAM, (st), (i))
+# define sk_MIME_PARAM_delete_ptr(st, ptr) SKM_sk_delete_ptr(MIME_PARAM, (st), (ptr))
+# define sk_MIME_PARAM_insert(st, val, i) SKM_sk_insert(MIME_PARAM, (st), (val), (i))
+# define sk_MIME_PARAM_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(MIME_PARAM, (st), (cmp))
+# define sk_MIME_PARAM_dup(st) SKM_sk_dup(MIME_PARAM, st)
+# define sk_MIME_PARAM_pop_free(st, free_func) SKM_sk_pop_free(MIME_PARAM, (st), (free_func))
+# define sk_MIME_PARAM_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(MIME_PARAM, (st), (copy_func), (free_func))
+# define sk_MIME_PARAM_shift(st) SKM_sk_shift(MIME_PARAM, (st))
+# define sk_MIME_PARAM_pop(st) SKM_sk_pop(MIME_PARAM, (st))
+# define sk_MIME_PARAM_sort(st) SKM_sk_sort(MIME_PARAM, (st))
+# define sk_MIME_PARAM_is_sorted(st) SKM_sk_is_sorted(MIME_PARAM, (st))
+# define sk_NAME_FUNCS_new(cmp) SKM_sk_new(NAME_FUNCS, (cmp))
+# define sk_NAME_FUNCS_new_null() SKM_sk_new_null(NAME_FUNCS)
+# define sk_NAME_FUNCS_free(st) SKM_sk_free(NAME_FUNCS, (st))
+# define sk_NAME_FUNCS_num(st) SKM_sk_num(NAME_FUNCS, (st))
+# define sk_NAME_FUNCS_value(st, i) SKM_sk_value(NAME_FUNCS, (st), (i))
+# define sk_NAME_FUNCS_set(st, i, val) SKM_sk_set(NAME_FUNCS, (st), (i), (val))
+# define sk_NAME_FUNCS_zero(st) SKM_sk_zero(NAME_FUNCS, (st))
+# define sk_NAME_FUNCS_push(st, val) SKM_sk_push(NAME_FUNCS, (st), (val))
+# define sk_NAME_FUNCS_unshift(st, val) SKM_sk_unshift(NAME_FUNCS, (st), (val))
+# define sk_NAME_FUNCS_find(st, val) SKM_sk_find(NAME_FUNCS, (st), (val))
+# define sk_NAME_FUNCS_find_ex(st, val) SKM_sk_find_ex(NAME_FUNCS, (st), (val))
+# define sk_NAME_FUNCS_delete(st, i) SKM_sk_delete(NAME_FUNCS, (st), (i))
+# define sk_NAME_FUNCS_delete_ptr(st, ptr) SKM_sk_delete_ptr(NAME_FUNCS, (st), (ptr))
+# define sk_NAME_FUNCS_insert(st, val, i) SKM_sk_insert(NAME_FUNCS, (st), (val), (i))
+# define sk_NAME_FUNCS_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(NAME_FUNCS, (st), (cmp))
+# define sk_NAME_FUNCS_dup(st) SKM_sk_dup(NAME_FUNCS, st)
+# define sk_NAME_FUNCS_pop_free(st, free_func) SKM_sk_pop_free(NAME_FUNCS, (st), (free_func))
+# define sk_NAME_FUNCS_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(NAME_FUNCS, (st), (copy_func), (free_func))
+# define sk_NAME_FUNCS_shift(st) SKM_sk_shift(NAME_FUNCS, (st))
+# define sk_NAME_FUNCS_pop(st) SKM_sk_pop(NAME_FUNCS, (st))
+# define sk_NAME_FUNCS_sort(st) SKM_sk_sort(NAME_FUNCS, (st))
+# define sk_NAME_FUNCS_is_sorted(st) SKM_sk_is_sorted(NAME_FUNCS, (st))
+# define sk_OCSP_CERTID_new(cmp) SKM_sk_new(OCSP_CERTID, (cmp))
+# define sk_OCSP_CERTID_new_null() SKM_sk_new_null(OCSP_CERTID)
+# define sk_OCSP_CERTID_free(st) SKM_sk_free(OCSP_CERTID, (st))
+# define sk_OCSP_CERTID_num(st) SKM_sk_num(OCSP_CERTID, (st))
+# define sk_OCSP_CERTID_value(st, i) SKM_sk_value(OCSP_CERTID, (st), (i))
+# define sk_OCSP_CERTID_set(st, i, val) SKM_sk_set(OCSP_CERTID, (st), (i), (val))
+# define sk_OCSP_CERTID_zero(st) SKM_sk_zero(OCSP_CERTID, (st))
+# define sk_OCSP_CERTID_push(st, val) SKM_sk_push(OCSP_CERTID, (st), (val))
+# define sk_OCSP_CERTID_unshift(st, val) SKM_sk_unshift(OCSP_CERTID, (st), (val))
+# define sk_OCSP_CERTID_find(st, val) SKM_sk_find(OCSP_CERTID, (st), (val))
+# define sk_OCSP_CERTID_find_ex(st, val) SKM_sk_find_ex(OCSP_CERTID, (st), (val))
+# define sk_OCSP_CERTID_delete(st, i) SKM_sk_delete(OCSP_CERTID, (st), (i))
+# define sk_OCSP_CERTID_delete_ptr(st, ptr) SKM_sk_delete_ptr(OCSP_CERTID, (st), (ptr))
+# define sk_OCSP_CERTID_insert(st, val, i) SKM_sk_insert(OCSP_CERTID, (st), (val), (i))
+# define sk_OCSP_CERTID_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(OCSP_CERTID, (st), (cmp))
+# define sk_OCSP_CERTID_dup(st) SKM_sk_dup(OCSP_CERTID, st)
+# define sk_OCSP_CERTID_pop_free(st, free_func) SKM_sk_pop_free(OCSP_CERTID, (st), (free_func))
+# define sk_OCSP_CERTID_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(OCSP_CERTID, (st), (copy_func), (free_func))
+# define sk_OCSP_CERTID_shift(st) SKM_sk_shift(OCSP_CERTID, (st))
+# define sk_OCSP_CERTID_pop(st) SKM_sk_pop(OCSP_CERTID, (st))
+# define sk_OCSP_CERTID_sort(st) SKM_sk_sort(OCSP_CERTID, (st))
+# define sk_OCSP_CERTID_is_sorted(st) SKM_sk_is_sorted(OCSP_CERTID, (st))
+# define sk_OCSP_ONEREQ_new(cmp) SKM_sk_new(OCSP_ONEREQ, (cmp))
+# define sk_OCSP_ONEREQ_new_null() SKM_sk_new_null(OCSP_ONEREQ)
+# define sk_OCSP_ONEREQ_free(st) SKM_sk_free(OCSP_ONEREQ, (st))
+# define sk_OCSP_ONEREQ_num(st) SKM_sk_num(OCSP_ONEREQ, (st))
+# define sk_OCSP_ONEREQ_value(st, i) SKM_sk_value(OCSP_ONEREQ, (st), (i))
+# define sk_OCSP_ONEREQ_set(st, i, val) SKM_sk_set(OCSP_ONEREQ, (st), (i), (val))
+# define sk_OCSP_ONEREQ_zero(st) SKM_sk_zero(OCSP_ONEREQ, (st))
+# define sk_OCSP_ONEREQ_push(st, val) SKM_sk_push(OCSP_ONEREQ, (st), (val))
+# define sk_OCSP_ONEREQ_unshift(st, val) SKM_sk_unshift(OCSP_ONEREQ, (st), (val))
+# define sk_OCSP_ONEREQ_find(st, val) SKM_sk_find(OCSP_ONEREQ, (st), (val))
+# define sk_OCSP_ONEREQ_find_ex(st, val) SKM_sk_find_ex(OCSP_ONEREQ, (st), (val))
+# define sk_OCSP_ONEREQ_delete(st, i) SKM_sk_delete(OCSP_ONEREQ, (st), (i))
+# define sk_OCSP_ONEREQ_delete_ptr(st, ptr) SKM_sk_delete_ptr(OCSP_ONEREQ, (st), (ptr))
+# define sk_OCSP_ONEREQ_insert(st, val, i) SKM_sk_insert(OCSP_ONEREQ, (st), (val), (i))
+# define sk_OCSP_ONEREQ_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(OCSP_ONEREQ, (st), (cmp))
+# define sk_OCSP_ONEREQ_dup(st) SKM_sk_dup(OCSP_ONEREQ, st)
+# define sk_OCSP_ONEREQ_pop_free(st, free_func) SKM_sk_pop_free(OCSP_ONEREQ, (st), (free_func))
+# define sk_OCSP_ONEREQ_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(OCSP_ONEREQ, (st), (copy_func), (free_func))
+# define sk_OCSP_ONEREQ_shift(st) SKM_sk_shift(OCSP_ONEREQ, (st))
+# define sk_OCSP_ONEREQ_pop(st) SKM_sk_pop(OCSP_ONEREQ, (st))
+# define sk_OCSP_ONEREQ_sort(st) SKM_sk_sort(OCSP_ONEREQ, (st))
+# define sk_OCSP_ONEREQ_is_sorted(st) SKM_sk_is_sorted(OCSP_ONEREQ, (st))
+# define sk_OCSP_RESPID_new(cmp) SKM_sk_new(OCSP_RESPID, (cmp))
+# define sk_OCSP_RESPID_new_null() SKM_sk_new_null(OCSP_RESPID)
+# define sk_OCSP_RESPID_free(st) SKM_sk_free(OCSP_RESPID, (st))
+# define sk_OCSP_RESPID_num(st) SKM_sk_num(OCSP_RESPID, (st))
+# define sk_OCSP_RESPID_value(st, i) SKM_sk_value(OCSP_RESPID, (st), (i))
+# define sk_OCSP_RESPID_set(st, i, val) SKM_sk_set(OCSP_RESPID, (st), (i), (val))
+# define sk_OCSP_RESPID_zero(st) SKM_sk_zero(OCSP_RESPID, (st))
+# define sk_OCSP_RESPID_push(st, val) SKM_sk_push(OCSP_RESPID, (st), (val))
+# define sk_OCSP_RESPID_unshift(st, val) SKM_sk_unshift(OCSP_RESPID, (st), (val))
+# define sk_OCSP_RESPID_find(st, val) SKM_sk_find(OCSP_RESPID, (st), (val))
+# define sk_OCSP_RESPID_find_ex(st, val) SKM_sk_find_ex(OCSP_RESPID, (st), (val))
+# define sk_OCSP_RESPID_delete(st, i) SKM_sk_delete(OCSP_RESPID, (st), (i))
+# define sk_OCSP_RESPID_delete_ptr(st, ptr) SKM_sk_delete_ptr(OCSP_RESPID, (st), (ptr))
+# define sk_OCSP_RESPID_insert(st, val, i) SKM_sk_insert(OCSP_RESPID, (st), (val), (i))
+# define sk_OCSP_RESPID_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(OCSP_RESPID, (st), (cmp))
+# define sk_OCSP_RESPID_dup(st) SKM_sk_dup(OCSP_RESPID, st)
+# define sk_OCSP_RESPID_pop_free(st, free_func) SKM_sk_pop_free(OCSP_RESPID, (st), (free_func))
+# define sk_OCSP_RESPID_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(OCSP_RESPID, (st), (copy_func), (free_func))
+# define sk_OCSP_RESPID_shift(st) SKM_sk_shift(OCSP_RESPID, (st))
+# define sk_OCSP_RESPID_pop(st) SKM_sk_pop(OCSP_RESPID, (st))
+# define sk_OCSP_RESPID_sort(st) SKM_sk_sort(OCSP_RESPID, (st))
+# define sk_OCSP_RESPID_is_sorted(st) SKM_sk_is_sorted(OCSP_RESPID, (st))
+# define sk_OCSP_SINGLERESP_new(cmp) SKM_sk_new(OCSP_SINGLERESP, (cmp))
+# define sk_OCSP_SINGLERESP_new_null() SKM_sk_new_null(OCSP_SINGLERESP)
+# define sk_OCSP_SINGLERESP_free(st) SKM_sk_free(OCSP_SINGLERESP, (st))
+# define sk_OCSP_SINGLERESP_num(st) SKM_sk_num(OCSP_SINGLERESP, (st))
+# define sk_OCSP_SINGLERESP_value(st, i) SKM_sk_value(OCSP_SINGLERESP, (st), (i))
+# define sk_OCSP_SINGLERESP_set(st, i, val) SKM_sk_set(OCSP_SINGLERESP, (st), (i), (val))
+# define sk_OCSP_SINGLERESP_zero(st) SKM_sk_zero(OCSP_SINGLERESP, (st))
+# define sk_OCSP_SINGLERESP_push(st, val) SKM_sk_push(OCSP_SINGLERESP, (st), (val))
+# define sk_OCSP_SINGLERESP_unshift(st, val) SKM_sk_unshift(OCSP_SINGLERESP, (st), (val))
+# define sk_OCSP_SINGLERESP_find(st, val) SKM_sk_find(OCSP_SINGLERESP, (st), (val))
+# define sk_OCSP_SINGLERESP_find_ex(st, val) SKM_sk_find_ex(OCSP_SINGLERESP, (st), (val))
+# define sk_OCSP_SINGLERESP_delete(st, i) SKM_sk_delete(OCSP_SINGLERESP, (st), (i))
+# define sk_OCSP_SINGLERESP_delete_ptr(st, ptr) SKM_sk_delete_ptr(OCSP_SINGLERESP, (st), (ptr))
+# define sk_OCSP_SINGLERESP_insert(st, val, i) SKM_sk_insert(OCSP_SINGLERESP, (st), (val), (i))
+# define sk_OCSP_SINGLERESP_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(OCSP_SINGLERESP, (st), (cmp))
+# define sk_OCSP_SINGLERESP_dup(st) SKM_sk_dup(OCSP_SINGLERESP, st)
+# define sk_OCSP_SINGLERESP_pop_free(st, free_func) SKM_sk_pop_free(OCSP_SINGLERESP, (st), (free_func))
+# define sk_OCSP_SINGLERESP_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(OCSP_SINGLERESP, (st), (copy_func), (free_func))
+# define sk_OCSP_SINGLERESP_shift(st) SKM_sk_shift(OCSP_SINGLERESP, (st))
+# define sk_OCSP_SINGLERESP_pop(st) SKM_sk_pop(OCSP_SINGLERESP, (st))
+# define sk_OCSP_SINGLERESP_sort(st) SKM_sk_sort(OCSP_SINGLERESP, (st))
+# define sk_OCSP_SINGLERESP_is_sorted(st) SKM_sk_is_sorted(OCSP_SINGLERESP, (st))
+# define sk_PKCS12_SAFEBAG_new(cmp) SKM_sk_new(PKCS12_SAFEBAG, (cmp))
+# define sk_PKCS12_SAFEBAG_new_null() SKM_sk_new_null(PKCS12_SAFEBAG)
+# define sk_PKCS12_SAFEBAG_free(st) SKM_sk_free(PKCS12_SAFEBAG, (st))
+# define sk_PKCS12_SAFEBAG_num(st) SKM_sk_num(PKCS12_SAFEBAG, (st))
+# define sk_PKCS12_SAFEBAG_value(st, i) SKM_sk_value(PKCS12_SAFEBAG, (st), (i))
+# define sk_PKCS12_SAFEBAG_set(st, i, val) SKM_sk_set(PKCS12_SAFEBAG, (st), (i), (val))
+# define sk_PKCS12_SAFEBAG_zero(st) SKM_sk_zero(PKCS12_SAFEBAG, (st))
+# define sk_PKCS12_SAFEBAG_push(st, val) SKM_sk_push(PKCS12_SAFEBAG, (st), (val))
+# define sk_PKCS12_SAFEBAG_unshift(st, val) SKM_sk_unshift(PKCS12_SAFEBAG, (st), (val))
+# define sk_PKCS12_SAFEBAG_find(st, val) SKM_sk_find(PKCS12_SAFEBAG, (st), (val))
+# define sk_PKCS12_SAFEBAG_find_ex(st, val) SKM_sk_find_ex(PKCS12_SAFEBAG, (st), (val))
+# define sk_PKCS12_SAFEBAG_delete(st, i) SKM_sk_delete(PKCS12_SAFEBAG, (st), (i))
+# define sk_PKCS12_SAFEBAG_delete_ptr(st, ptr) SKM_sk_delete_ptr(PKCS12_SAFEBAG, (st), (ptr))
+# define sk_PKCS12_SAFEBAG_insert(st, val, i) SKM_sk_insert(PKCS12_SAFEBAG, (st), (val), (i))
+# define sk_PKCS12_SAFEBAG_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(PKCS12_SAFEBAG, (st), (cmp))
+# define sk_PKCS12_SAFEBAG_dup(st) SKM_sk_dup(PKCS12_SAFEBAG, st)
+# define sk_PKCS12_SAFEBAG_pop_free(st, free_func) SKM_sk_pop_free(PKCS12_SAFEBAG, (st), (free_func))
+# define sk_PKCS12_SAFEBAG_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(PKCS12_SAFEBAG, (st), (copy_func), (free_func))
+# define sk_PKCS12_SAFEBAG_shift(st) SKM_sk_shift(PKCS12_SAFEBAG, (st))
+# define sk_PKCS12_SAFEBAG_pop(st) SKM_sk_pop(PKCS12_SAFEBAG, (st))
+# define sk_PKCS12_SAFEBAG_sort(st) SKM_sk_sort(PKCS12_SAFEBAG, (st))
+# define sk_PKCS12_SAFEBAG_is_sorted(st) SKM_sk_is_sorted(PKCS12_SAFEBAG, (st))
+# define sk_PKCS7_new(cmp) SKM_sk_new(PKCS7, (cmp))
+# define sk_PKCS7_new_null() SKM_sk_new_null(PKCS7)
+# define sk_PKCS7_free(st) SKM_sk_free(PKCS7, (st))
+# define sk_PKCS7_num(st) SKM_sk_num(PKCS7, (st))
+# define sk_PKCS7_value(st, i) SKM_sk_value(PKCS7, (st), (i))
+# define sk_PKCS7_set(st, i, val) SKM_sk_set(PKCS7, (st), (i), (val))
+# define sk_PKCS7_zero(st) SKM_sk_zero(PKCS7, (st))
+# define sk_PKCS7_push(st, val) SKM_sk_push(PKCS7, (st), (val))
+# define sk_PKCS7_unshift(st, val) SKM_sk_unshift(PKCS7, (st), (val))
+# define sk_PKCS7_find(st, val) SKM_sk_find(PKCS7, (st), (val))
+# define sk_PKCS7_find_ex(st, val) SKM_sk_find_ex(PKCS7, (st), (val))
+# define sk_PKCS7_delete(st, i) SKM_sk_delete(PKCS7, (st), (i))
+# define sk_PKCS7_delete_ptr(st, ptr) SKM_sk_delete_ptr(PKCS7, (st), (ptr))
+# define sk_PKCS7_insert(st, val, i) SKM_sk_insert(PKCS7, (st), (val), (i))
+# define sk_PKCS7_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(PKCS7, (st), (cmp))
+# define sk_PKCS7_dup(st) SKM_sk_dup(PKCS7, st)
+# define sk_PKCS7_pop_free(st, free_func) SKM_sk_pop_free(PKCS7, (st), (free_func))
+# define sk_PKCS7_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(PKCS7, (st), (copy_func), (free_func))
+# define sk_PKCS7_shift(st) SKM_sk_shift(PKCS7, (st))
+# define sk_PKCS7_pop(st) SKM_sk_pop(PKCS7, (st))
+# define sk_PKCS7_sort(st) SKM_sk_sort(PKCS7, (st))
+# define sk_PKCS7_is_sorted(st) SKM_sk_is_sorted(PKCS7, (st))
+# define sk_PKCS7_RECIP_INFO_new(cmp) SKM_sk_new(PKCS7_RECIP_INFO, (cmp))
+# define sk_PKCS7_RECIP_INFO_new_null() SKM_sk_new_null(PKCS7_RECIP_INFO)
+# define sk_PKCS7_RECIP_INFO_free(st) SKM_sk_free(PKCS7_RECIP_INFO, (st))
+# define sk_PKCS7_RECIP_INFO_num(st) SKM_sk_num(PKCS7_RECIP_INFO, (st))
+# define sk_PKCS7_RECIP_INFO_value(st, i) SKM_sk_value(PKCS7_RECIP_INFO, (st), (i))
+# define sk_PKCS7_RECIP_INFO_set(st, i, val) SKM_sk_set(PKCS7_RECIP_INFO, (st), (i), (val))
+# define sk_PKCS7_RECIP_INFO_zero(st) SKM_sk_zero(PKCS7_RECIP_INFO, (st))
+# define sk_PKCS7_RECIP_INFO_push(st, val) SKM_sk_push(PKCS7_RECIP_INFO, (st), (val))
+# define sk_PKCS7_RECIP_INFO_unshift(st, val) SKM_sk_unshift(PKCS7_RECIP_INFO, (st), (val))
+# define sk_PKCS7_RECIP_INFO_find(st, val) SKM_sk_find(PKCS7_RECIP_INFO, (st), (val))
+# define sk_PKCS7_RECIP_INFO_find_ex(st, val) SKM_sk_find_ex(PKCS7_RECIP_INFO, (st), (val))
+# define sk_PKCS7_RECIP_INFO_delete(st, i) SKM_sk_delete(PKCS7_RECIP_INFO, (st), (i))
+# define sk_PKCS7_RECIP_INFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(PKCS7_RECIP_INFO, (st), (ptr))
+# define sk_PKCS7_RECIP_INFO_insert(st, val, i) SKM_sk_insert(PKCS7_RECIP_INFO, (st), (val), (i))
+# define sk_PKCS7_RECIP_INFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(PKCS7_RECIP_INFO, (st), (cmp))
+# define sk_PKCS7_RECIP_INFO_dup(st) SKM_sk_dup(PKCS7_RECIP_INFO, st)
+# define sk_PKCS7_RECIP_INFO_pop_free(st, free_func) SKM_sk_pop_free(PKCS7_RECIP_INFO, (st), (free_func))
+# define sk_PKCS7_RECIP_INFO_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(PKCS7_RECIP_INFO, (st), (copy_func), (free_func))
+# define sk_PKCS7_RECIP_INFO_shift(st) SKM_sk_shift(PKCS7_RECIP_INFO, (st))
+# define sk_PKCS7_RECIP_INFO_pop(st) SKM_sk_pop(PKCS7_RECIP_INFO, (st))
+# define sk_PKCS7_RECIP_INFO_sort(st) SKM_sk_sort(PKCS7_RECIP_INFO, (st))
+# define sk_PKCS7_RECIP_INFO_is_sorted(st) SKM_sk_is_sorted(PKCS7_RECIP_INFO, (st))
+# define sk_PKCS7_SIGNER_INFO_new(cmp) SKM_sk_new(PKCS7_SIGNER_INFO, (cmp))
+# define sk_PKCS7_SIGNER_INFO_new_null() SKM_sk_new_null(PKCS7_SIGNER_INFO)
+# define sk_PKCS7_SIGNER_INFO_free(st) SKM_sk_free(PKCS7_SIGNER_INFO, (st))
+# define sk_PKCS7_SIGNER_INFO_num(st) SKM_sk_num(PKCS7_SIGNER_INFO, (st))
+# define sk_PKCS7_SIGNER_INFO_value(st, i) SKM_sk_value(PKCS7_SIGNER_INFO, (st), (i))
+# define sk_PKCS7_SIGNER_INFO_set(st, i, val) SKM_sk_set(PKCS7_SIGNER_INFO, (st), (i), (val))
+# define sk_PKCS7_SIGNER_INFO_zero(st) SKM_sk_zero(PKCS7_SIGNER_INFO, (st))
+# define sk_PKCS7_SIGNER_INFO_push(st, val) SKM_sk_push(PKCS7_SIGNER_INFO, (st), (val))
+# define sk_PKCS7_SIGNER_INFO_unshift(st, val) SKM_sk_unshift(PKCS7_SIGNER_INFO, (st), (val))
+# define sk_PKCS7_SIGNER_INFO_find(st, val) SKM_sk_find(PKCS7_SIGNER_INFO, (st), (val))
+# define sk_PKCS7_SIGNER_INFO_find_ex(st, val) SKM_sk_find_ex(PKCS7_SIGNER_INFO, (st), (val))
+# define sk_PKCS7_SIGNER_INFO_delete(st, i) SKM_sk_delete(PKCS7_SIGNER_INFO, (st), (i))
+# define sk_PKCS7_SIGNER_INFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(PKCS7_SIGNER_INFO, (st), (ptr))
+# define sk_PKCS7_SIGNER_INFO_insert(st, val, i) SKM_sk_insert(PKCS7_SIGNER_INFO, (st), (val), (i))
+# define sk_PKCS7_SIGNER_INFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(PKCS7_SIGNER_INFO, (st), (cmp))
+# define sk_PKCS7_SIGNER_INFO_dup(st) SKM_sk_dup(PKCS7_SIGNER_INFO, st)
+# define sk_PKCS7_SIGNER_INFO_pop_free(st, free_func) SKM_sk_pop_free(PKCS7_SIGNER_INFO, (st), (free_func))
+# define sk_PKCS7_SIGNER_INFO_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(PKCS7_SIGNER_INFO, (st), (copy_func), (free_func))
+# define sk_PKCS7_SIGNER_INFO_shift(st) SKM_sk_shift(PKCS7_SIGNER_INFO, (st))
+# define sk_PKCS7_SIGNER_INFO_pop(st) SKM_sk_pop(PKCS7_SIGNER_INFO, (st))
+# define sk_PKCS7_SIGNER_INFO_sort(st) SKM_sk_sort(PKCS7_SIGNER_INFO, (st))
+# define sk_PKCS7_SIGNER_INFO_is_sorted(st) SKM_sk_is_sorted(PKCS7_SIGNER_INFO, (st))
+# define sk_POLICYINFO_new(cmp) SKM_sk_new(POLICYINFO, (cmp))
+# define sk_POLICYINFO_new_null() SKM_sk_new_null(POLICYINFO)
+# define sk_POLICYINFO_free(st) SKM_sk_free(POLICYINFO, (st))
+# define sk_POLICYINFO_num(st) SKM_sk_num(POLICYINFO, (st))
+# define sk_POLICYINFO_value(st, i) SKM_sk_value(POLICYINFO, (st), (i))
+# define sk_POLICYINFO_set(st, i, val) SKM_sk_set(POLICYINFO, (st), (i), (val))
+# define sk_POLICYINFO_zero(st) SKM_sk_zero(POLICYINFO, (st))
+# define sk_POLICYINFO_push(st, val) SKM_sk_push(POLICYINFO, (st), (val))
+# define sk_POLICYINFO_unshift(st, val) SKM_sk_unshift(POLICYINFO, (st), (val))
+# define sk_POLICYINFO_find(st, val) SKM_sk_find(POLICYINFO, (st), (val))
+# define sk_POLICYINFO_find_ex(st, val) SKM_sk_find_ex(POLICYINFO, (st), (val))
+# define sk_POLICYINFO_delete(st, i) SKM_sk_delete(POLICYINFO, (st), (i))
+# define sk_POLICYINFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(POLICYINFO, (st), (ptr))
+# define sk_POLICYINFO_insert(st, val, i) SKM_sk_insert(POLICYINFO, (st), (val), (i))
+# define sk_POLICYINFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(POLICYINFO, (st), (cmp))
+# define sk_POLICYINFO_dup(st) SKM_sk_dup(POLICYINFO, st)
+# define sk_POLICYINFO_pop_free(st, free_func) SKM_sk_pop_free(POLICYINFO, (st), (free_func))
+# define sk_POLICYINFO_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(POLICYINFO, (st), (copy_func), (free_func))
+# define sk_POLICYINFO_shift(st) SKM_sk_shift(POLICYINFO, (st))
+# define sk_POLICYINFO_pop(st) SKM_sk_pop(POLICYINFO, (st))
+# define sk_POLICYINFO_sort(st) SKM_sk_sort(POLICYINFO, (st))
+# define sk_POLICYINFO_is_sorted(st) SKM_sk_is_sorted(POLICYINFO, (st))
+# define sk_POLICYQUALINFO_new(cmp) SKM_sk_new(POLICYQUALINFO, (cmp))
+# define sk_POLICYQUALINFO_new_null() SKM_sk_new_null(POLICYQUALINFO)
+# define sk_POLICYQUALINFO_free(st) SKM_sk_free(POLICYQUALINFO, (st))
+# define sk_POLICYQUALINFO_num(st) SKM_sk_num(POLICYQUALINFO, (st))
+# define sk_POLICYQUALINFO_value(st, i) SKM_sk_value(POLICYQUALINFO, (st), (i))
+# define sk_POLICYQUALINFO_set(st, i, val) SKM_sk_set(POLICYQUALINFO, (st), (i), (val))
+# define sk_POLICYQUALINFO_zero(st) SKM_sk_zero(POLICYQUALINFO, (st))
+# define sk_POLICYQUALINFO_push(st, val) SKM_sk_push(POLICYQUALINFO, (st), (val))
+# define sk_POLICYQUALINFO_unshift(st, val) SKM_sk_unshift(POLICYQUALINFO, (st), (val))
+# define sk_POLICYQUALINFO_find(st, val) SKM_sk_find(POLICYQUALINFO, (st), (val))
+# define sk_POLICYQUALINFO_find_ex(st, val) SKM_sk_find_ex(POLICYQUALINFO, (st), (val))
+# define sk_POLICYQUALINFO_delete(st, i) SKM_sk_delete(POLICYQUALINFO, (st), (i))
+# define sk_POLICYQUALINFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(POLICYQUALINFO, (st), (ptr))
+# define sk_POLICYQUALINFO_insert(st, val, i) SKM_sk_insert(POLICYQUALINFO, (st), (val), (i))
+# define sk_POLICYQUALINFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(POLICYQUALINFO, (st), (cmp))
+# define sk_POLICYQUALINFO_dup(st) SKM_sk_dup(POLICYQUALINFO, st)
+# define sk_POLICYQUALINFO_pop_free(st, free_func) SKM_sk_pop_free(POLICYQUALINFO, (st), (free_func))
+# define sk_POLICYQUALINFO_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(POLICYQUALINFO, (st), (copy_func), (free_func))
+# define sk_POLICYQUALINFO_shift(st) SKM_sk_shift(POLICYQUALINFO, (st))
+# define sk_POLICYQUALINFO_pop(st) SKM_sk_pop(POLICYQUALINFO, (st))
+# define sk_POLICYQUALINFO_sort(st) SKM_sk_sort(POLICYQUALINFO, (st))
+# define sk_POLICYQUALINFO_is_sorted(st) SKM_sk_is_sorted(POLICYQUALINFO, (st))
+# define sk_POLICY_MAPPING_new(cmp) SKM_sk_new(POLICY_MAPPING, (cmp))
+# define sk_POLICY_MAPPING_new_null() SKM_sk_new_null(POLICY_MAPPING)
+# define sk_POLICY_MAPPING_free(st) SKM_sk_free(POLICY_MAPPING, (st))
+# define sk_POLICY_MAPPING_num(st) SKM_sk_num(POLICY_MAPPING, (st))
+# define sk_POLICY_MAPPING_value(st, i) SKM_sk_value(POLICY_MAPPING, (st), (i))
+# define sk_POLICY_MAPPING_set(st, i, val) SKM_sk_set(POLICY_MAPPING, (st), (i), (val))
+# define sk_POLICY_MAPPING_zero(st) SKM_sk_zero(POLICY_MAPPING, (st))
+# define sk_POLICY_MAPPING_push(st, val) SKM_sk_push(POLICY_MAPPING, (st), (val))
+# define sk_POLICY_MAPPING_unshift(st, val) SKM_sk_unshift(POLICY_MAPPING, (st), (val))
+# define sk_POLICY_MAPPING_find(st, val) SKM_sk_find(POLICY_MAPPING, (st), (val))
+# define sk_POLICY_MAPPING_find_ex(st, val) SKM_sk_find_ex(POLICY_MAPPING, (st), (val))
+# define sk_POLICY_MAPPING_delete(st, i) SKM_sk_delete(POLICY_MAPPING, (st), (i))
+# define sk_POLICY_MAPPING_delete_ptr(st, ptr) SKM_sk_delete_ptr(POLICY_MAPPING, (st), (ptr))
+# define sk_POLICY_MAPPING_insert(st, val, i) SKM_sk_insert(POLICY_MAPPING, (st), (val), (i))
+# define sk_POLICY_MAPPING_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(POLICY_MAPPING, (st), (cmp))
+# define sk_POLICY_MAPPING_dup(st) SKM_sk_dup(POLICY_MAPPING, st)
+# define sk_POLICY_MAPPING_pop_free(st, free_func) SKM_sk_pop_free(POLICY_MAPPING, (st), (free_func))
+# define sk_POLICY_MAPPING_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(POLICY_MAPPING, (st), (copy_func), (free_func))
+# define sk_POLICY_MAPPING_shift(st) SKM_sk_shift(POLICY_MAPPING, (st))
+# define sk_POLICY_MAPPING_pop(st) SKM_sk_pop(POLICY_MAPPING, (st))
+# define sk_POLICY_MAPPING_sort(st) SKM_sk_sort(POLICY_MAPPING, (st))
+# define sk_POLICY_MAPPING_is_sorted(st) SKM_sk_is_sorted(POLICY_MAPPING, (st))
+# define sk_SCT_new(cmp) SKM_sk_new(SCT, (cmp))
+# define sk_SCT_new_null() SKM_sk_new_null(SCT)
+# define sk_SCT_free(st) SKM_sk_free(SCT, (st))
+# define sk_SCT_num(st) SKM_sk_num(SCT, (st))
+# define sk_SCT_value(st, i) SKM_sk_value(SCT, (st), (i))
+# define sk_SCT_set(st, i, val) SKM_sk_set(SCT, (st), (i), (val))
+# define sk_SCT_zero(st) SKM_sk_zero(SCT, (st))
+# define sk_SCT_push(st, val) SKM_sk_push(SCT, (st), (val))
+# define sk_SCT_unshift(st, val) SKM_sk_unshift(SCT, (st), (val))
+# define sk_SCT_find(st, val) SKM_sk_find(SCT, (st), (val))
+# define sk_SCT_find_ex(st, val) SKM_sk_find_ex(SCT, (st), (val))
+# define sk_SCT_delete(st, i) SKM_sk_delete(SCT, (st), (i))
+# define sk_SCT_delete_ptr(st, ptr) SKM_sk_delete_ptr(SCT, (st), (ptr))
+# define sk_SCT_insert(st, val, i) SKM_sk_insert(SCT, (st), (val), (i))
+# define sk_SCT_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SCT, (st), (cmp))
+# define sk_SCT_dup(st) SKM_sk_dup(SCT, st)
+# define sk_SCT_pop_free(st, free_func) SKM_sk_pop_free(SCT, (st), (free_func))
+# define sk_SCT_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(SCT, (st), (copy_func), (free_func))
+# define sk_SCT_shift(st) SKM_sk_shift(SCT, (st))
+# define sk_SCT_pop(st) SKM_sk_pop(SCT, (st))
+# define sk_SCT_sort(st) SKM_sk_sort(SCT, (st))
+# define sk_SCT_is_sorted(st) SKM_sk_is_sorted(SCT, (st))
+# define sk_SRP_gN_new(cmp) SKM_sk_new(SRP_gN, (cmp))
+# define sk_SRP_gN_new_null() SKM_sk_new_null(SRP_gN)
+# define sk_SRP_gN_free(st) SKM_sk_free(SRP_gN, (st))
+# define sk_SRP_gN_num(st) SKM_sk_num(SRP_gN, (st))
+# define sk_SRP_gN_value(st, i) SKM_sk_value(SRP_gN, (st), (i))
+# define sk_SRP_gN_set(st, i, val) SKM_sk_set(SRP_gN, (st), (i), (val))
+# define sk_SRP_gN_zero(st) SKM_sk_zero(SRP_gN, (st))
+# define sk_SRP_gN_push(st, val) SKM_sk_push(SRP_gN, (st), (val))
+# define sk_SRP_gN_unshift(st, val) SKM_sk_unshift(SRP_gN, (st), (val))
+# define sk_SRP_gN_find(st, val) SKM_sk_find(SRP_gN, (st), (val))
+# define sk_SRP_gN_find_ex(st, val) SKM_sk_find_ex(SRP_gN, (st), (val))
+# define sk_SRP_gN_delete(st, i) SKM_sk_delete(SRP_gN, (st), (i))
+# define sk_SRP_gN_delete_ptr(st, ptr) SKM_sk_delete_ptr(SRP_gN, (st), (ptr))
+# define sk_SRP_gN_insert(st, val, i) SKM_sk_insert(SRP_gN, (st), (val), (i))
+# define sk_SRP_gN_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SRP_gN, (st), (cmp))
+# define sk_SRP_gN_dup(st) SKM_sk_dup(SRP_gN, st)
+# define sk_SRP_gN_pop_free(st, free_func) SKM_sk_pop_free(SRP_gN, (st), (free_func))
+# define sk_SRP_gN_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(SRP_gN, (st), (copy_func), (free_func))
+# define sk_SRP_gN_shift(st) SKM_sk_shift(SRP_gN, (st))
+# define sk_SRP_gN_pop(st) SKM_sk_pop(SRP_gN, (st))
+# define sk_SRP_gN_sort(st) SKM_sk_sort(SRP_gN, (st))
+# define sk_SRP_gN_is_sorted(st) SKM_sk_is_sorted(SRP_gN, (st))
+# define sk_SRP_gN_cache_new(cmp) SKM_sk_new(SRP_gN_cache, (cmp))
+# define sk_SRP_gN_cache_new_null() SKM_sk_new_null(SRP_gN_cache)
+# define sk_SRP_gN_cache_free(st) SKM_sk_free(SRP_gN_cache, (st))
+# define sk_SRP_gN_cache_num(st) SKM_sk_num(SRP_gN_cache, (st))
+# define sk_SRP_gN_cache_value(st, i) SKM_sk_value(SRP_gN_cache, (st), (i))
+# define sk_SRP_gN_cache_set(st, i, val) SKM_sk_set(SRP_gN_cache, (st), (i), (val))
+# define sk_SRP_gN_cache_zero(st) SKM_sk_zero(SRP_gN_cache, (st))
+# define sk_SRP_gN_cache_push(st, val) SKM_sk_push(SRP_gN_cache, (st), (val))
+# define sk_SRP_gN_cache_unshift(st, val) SKM_sk_unshift(SRP_gN_cache, (st), (val))
+# define sk_SRP_gN_cache_find(st, val) SKM_sk_find(SRP_gN_cache, (st), (val))
+# define sk_SRP_gN_cache_find_ex(st, val) SKM_sk_find_ex(SRP_gN_cache, (st), (val))
+# define sk_SRP_gN_cache_delete(st, i) SKM_sk_delete(SRP_gN_cache, (st), (i))
+# define sk_SRP_gN_cache_delete_ptr(st, ptr) SKM_sk_delete_ptr(SRP_gN_cache, (st), (ptr))
+# define sk_SRP_gN_cache_insert(st, val, i) SKM_sk_insert(SRP_gN_cache, (st), (val), (i))
+# define sk_SRP_gN_cache_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SRP_gN_cache, (st), (cmp))
+# define sk_SRP_gN_cache_dup(st) SKM_sk_dup(SRP_gN_cache, st)
+# define sk_SRP_gN_cache_pop_free(st, free_func) SKM_sk_pop_free(SRP_gN_cache, (st), (free_func))
+# define sk_SRP_gN_cache_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(SRP_gN_cache, (st), (copy_func), (free_func))
+# define sk_SRP_gN_cache_shift(st) SKM_sk_shift(SRP_gN_cache, (st))
+# define sk_SRP_gN_cache_pop(st) SKM_sk_pop(SRP_gN_cache, (st))
+# define sk_SRP_gN_cache_sort(st) SKM_sk_sort(SRP_gN_cache, (st))
+# define sk_SRP_gN_cache_is_sorted(st) SKM_sk_is_sorted(SRP_gN_cache, (st))
+# define sk_SRP_user_pwd_new(cmp) SKM_sk_new(SRP_user_pwd, (cmp))
+# define sk_SRP_user_pwd_new_null() SKM_sk_new_null(SRP_user_pwd)
+# define sk_SRP_user_pwd_free(st) SKM_sk_free(SRP_user_pwd, (st))
+# define sk_SRP_user_pwd_num(st) SKM_sk_num(SRP_user_pwd, (st))
+# define sk_SRP_user_pwd_value(st, i) SKM_sk_value(SRP_user_pwd, (st), (i))
+# define sk_SRP_user_pwd_set(st, i, val) SKM_sk_set(SRP_user_pwd, (st), (i), (val))
+# define sk_SRP_user_pwd_zero(st) SKM_sk_zero(SRP_user_pwd, (st))
+# define sk_SRP_user_pwd_push(st, val) SKM_sk_push(SRP_user_pwd, (st), (val))
+# define sk_SRP_user_pwd_unshift(st, val) SKM_sk_unshift(SRP_user_pwd, (st), (val))
+# define sk_SRP_user_pwd_find(st, val) SKM_sk_find(SRP_user_pwd, (st), (val))
+# define sk_SRP_user_pwd_find_ex(st, val) SKM_sk_find_ex(SRP_user_pwd, (st), (val))
+# define sk_SRP_user_pwd_delete(st, i) SKM_sk_delete(SRP_user_pwd, (st), (i))
+# define sk_SRP_user_pwd_delete_ptr(st, ptr) SKM_sk_delete_ptr(SRP_user_pwd, (st), (ptr))
+# define sk_SRP_user_pwd_insert(st, val, i) SKM_sk_insert(SRP_user_pwd, (st), (val), (i))
+# define sk_SRP_user_pwd_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SRP_user_pwd, (st), (cmp))
+# define sk_SRP_user_pwd_dup(st) SKM_sk_dup(SRP_user_pwd, st)
+# define sk_SRP_user_pwd_pop_free(st, free_func) SKM_sk_pop_free(SRP_user_pwd, (st), (free_func))
+# define sk_SRP_user_pwd_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(SRP_user_pwd, (st), (copy_func), (free_func))
+# define sk_SRP_user_pwd_shift(st) SKM_sk_shift(SRP_user_pwd, (st))
+# define sk_SRP_user_pwd_pop(st) SKM_sk_pop(SRP_user_pwd, (st))
+# define sk_SRP_user_pwd_sort(st) SKM_sk_sort(SRP_user_pwd, (st))
+# define sk_SRP_user_pwd_is_sorted(st) SKM_sk_is_sorted(SRP_user_pwd, (st))
+# define sk_SRTP_PROTECTION_PROFILE_new(cmp) SKM_sk_new(SRTP_PROTECTION_PROFILE, (cmp))
+# define sk_SRTP_PROTECTION_PROFILE_new_null() SKM_sk_new_null(SRTP_PROTECTION_PROFILE)
+# define sk_SRTP_PROTECTION_PROFILE_free(st) SKM_sk_free(SRTP_PROTECTION_PROFILE, (st))
+# define sk_SRTP_PROTECTION_PROFILE_num(st) SKM_sk_num(SRTP_PROTECTION_PROFILE, (st))
+# define sk_SRTP_PROTECTION_PROFILE_value(st, i) SKM_sk_value(SRTP_PROTECTION_PROFILE, (st), (i))
+# define sk_SRTP_PROTECTION_PROFILE_set(st, i, val) SKM_sk_set(SRTP_PROTECTION_PROFILE, (st), (i), (val))
+# define sk_SRTP_PROTECTION_PROFILE_zero(st) SKM_sk_zero(SRTP_PROTECTION_PROFILE, (st))
+# define sk_SRTP_PROTECTION_PROFILE_push(st, val) SKM_sk_push(SRTP_PROTECTION_PROFILE, (st), (val))
+# define sk_SRTP_PROTECTION_PROFILE_unshift(st, val) SKM_sk_unshift(SRTP_PROTECTION_PROFILE, (st), (val))
+# define sk_SRTP_PROTECTION_PROFILE_find(st, val) SKM_sk_find(SRTP_PROTECTION_PROFILE, (st), (val))
+# define sk_SRTP_PROTECTION_PROFILE_find_ex(st, val) SKM_sk_find_ex(SRTP_PROTECTION_PROFILE, (st), (val))
+# define sk_SRTP_PROTECTION_PROFILE_delete(st, i) SKM_sk_delete(SRTP_PROTECTION_PROFILE, (st), (i))
+# define sk_SRTP_PROTECTION_PROFILE_delete_ptr(st, ptr) SKM_sk_delete_ptr(SRTP_PROTECTION_PROFILE, (st), (ptr))
+# define sk_SRTP_PROTECTION_PROFILE_insert(st, val, i) SKM_sk_insert(SRTP_PROTECTION_PROFILE, (st), (val), (i))
+# define sk_SRTP_PROTECTION_PROFILE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SRTP_PROTECTION_PROFILE, (st), (cmp))
+# define sk_SRTP_PROTECTION_PROFILE_dup(st) SKM_sk_dup(SRTP_PROTECTION_PROFILE, st)
+# define sk_SRTP_PROTECTION_PROFILE_pop_free(st, free_func) SKM_sk_pop_free(SRTP_PROTECTION_PROFILE, (st), (free_func))
+# define sk_SRTP_PROTECTION_PROFILE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(SRTP_PROTECTION_PROFILE, (st), (copy_func), (free_func))
+# define sk_SRTP_PROTECTION_PROFILE_shift(st) SKM_sk_shift(SRTP_PROTECTION_PROFILE, (st))
+# define sk_SRTP_PROTECTION_PROFILE_pop(st) SKM_sk_pop(SRTP_PROTECTION_PROFILE, (st))
+# define sk_SRTP_PROTECTION_PROFILE_sort(st) SKM_sk_sort(SRTP_PROTECTION_PROFILE, (st))
+# define sk_SRTP_PROTECTION_PROFILE_is_sorted(st) SKM_sk_is_sorted(SRTP_PROTECTION_PROFILE, (st))
+# define sk_SSL_CIPHER_new(cmp) SKM_sk_new(SSL_CIPHER, (cmp))
+# define sk_SSL_CIPHER_new_null() SKM_sk_new_null(SSL_CIPHER)
+# define sk_SSL_CIPHER_free(st) SKM_sk_free(SSL_CIPHER, (st))
+# define sk_SSL_CIPHER_num(st) SKM_sk_num(SSL_CIPHER, (st))
+# define sk_SSL_CIPHER_value(st, i) SKM_sk_value(SSL_CIPHER, (st), (i))
+# define sk_SSL_CIPHER_set(st, i, val) SKM_sk_set(SSL_CIPHER, (st), (i), (val))
+# define sk_SSL_CIPHER_zero(st) SKM_sk_zero(SSL_CIPHER, (st))
+# define sk_SSL_CIPHER_push(st, val) SKM_sk_push(SSL_CIPHER, (st), (val))
+# define sk_SSL_CIPHER_unshift(st, val) SKM_sk_unshift(SSL_CIPHER, (st), (val))
+# define sk_SSL_CIPHER_find(st, val) SKM_sk_find(SSL_CIPHER, (st), (val))
+# define sk_SSL_CIPHER_find_ex(st, val) SKM_sk_find_ex(SSL_CIPHER, (st), (val))
+# define sk_SSL_CIPHER_delete(st, i) SKM_sk_delete(SSL_CIPHER, (st), (i))
+# define sk_SSL_CIPHER_delete_ptr(st, ptr) SKM_sk_delete_ptr(SSL_CIPHER, (st), (ptr))
+# define sk_SSL_CIPHER_insert(st, val, i) SKM_sk_insert(SSL_CIPHER, (st), (val), (i))
+# define sk_SSL_CIPHER_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SSL_CIPHER, (st), (cmp))
+# define sk_SSL_CIPHER_dup(st) SKM_sk_dup(SSL_CIPHER, st)
+# define sk_SSL_CIPHER_pop_free(st, free_func) SKM_sk_pop_free(SSL_CIPHER, (st), (free_func))
+# define sk_SSL_CIPHER_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(SSL_CIPHER, (st), (copy_func), (free_func))
+# define sk_SSL_CIPHER_shift(st) SKM_sk_shift(SSL_CIPHER, (st))
+# define sk_SSL_CIPHER_pop(st) SKM_sk_pop(SSL_CIPHER, (st))
+# define sk_SSL_CIPHER_sort(st) SKM_sk_sort(SSL_CIPHER, (st))
+# define sk_SSL_CIPHER_is_sorted(st) SKM_sk_is_sorted(SSL_CIPHER, (st))
+# define sk_SSL_COMP_new(cmp) SKM_sk_new(SSL_COMP, (cmp))
+# define sk_SSL_COMP_new_null() SKM_sk_new_null(SSL_COMP)
+# define sk_SSL_COMP_free(st) SKM_sk_free(SSL_COMP, (st))
+# define sk_SSL_COMP_num(st) SKM_sk_num(SSL_COMP, (st))
+# define sk_SSL_COMP_value(st, i) SKM_sk_value(SSL_COMP, (st), (i))
+# define sk_SSL_COMP_set(st, i, val) SKM_sk_set(SSL_COMP, (st), (i), (val))
+# define sk_SSL_COMP_zero(st) SKM_sk_zero(SSL_COMP, (st))
+# define sk_SSL_COMP_push(st, val) SKM_sk_push(SSL_COMP, (st), (val))
+# define sk_SSL_COMP_unshift(st, val) SKM_sk_unshift(SSL_COMP, (st), (val))
+# define sk_SSL_COMP_find(st, val) SKM_sk_find(SSL_COMP, (st), (val))
+# define sk_SSL_COMP_find_ex(st, val) SKM_sk_find_ex(SSL_COMP, (st), (val))
+# define sk_SSL_COMP_delete(st, i) SKM_sk_delete(SSL_COMP, (st), (i))
+# define sk_SSL_COMP_delete_ptr(st, ptr) SKM_sk_delete_ptr(SSL_COMP, (st), (ptr))
+# define sk_SSL_COMP_insert(st, val, i) SKM_sk_insert(SSL_COMP, (st), (val), (i))
+# define sk_SSL_COMP_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SSL_COMP, (st), (cmp))
+# define sk_SSL_COMP_dup(st) SKM_sk_dup(SSL_COMP, st)
+# define sk_SSL_COMP_pop_free(st, free_func) SKM_sk_pop_free(SSL_COMP, (st), (free_func))
+# define sk_SSL_COMP_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(SSL_COMP, (st), (copy_func), (free_func))
+# define sk_SSL_COMP_shift(st) SKM_sk_shift(SSL_COMP, (st))
+# define sk_SSL_COMP_pop(st) SKM_sk_pop(SSL_COMP, (st))
+# define sk_SSL_COMP_sort(st) SKM_sk_sort(SSL_COMP, (st))
+# define sk_SSL_COMP_is_sorted(st) SKM_sk_is_sorted(SSL_COMP, (st))
+# define sk_STACK_OF_X509_NAME_ENTRY_new(cmp) SKM_sk_new(STACK_OF_X509_NAME_ENTRY, (cmp))
+# define sk_STACK_OF_X509_NAME_ENTRY_new_null() SKM_sk_new_null(STACK_OF_X509_NAME_ENTRY)
+# define sk_STACK_OF_X509_NAME_ENTRY_free(st) SKM_sk_free(STACK_OF_X509_NAME_ENTRY, (st))
+# define sk_STACK_OF_X509_NAME_ENTRY_num(st) SKM_sk_num(STACK_OF_X509_NAME_ENTRY, (st))
+# define sk_STACK_OF_X509_NAME_ENTRY_value(st, i) SKM_sk_value(STACK_OF_X509_NAME_ENTRY, (st), (i))
+# define sk_STACK_OF_X509_NAME_ENTRY_set(st, i, val) SKM_sk_set(STACK_OF_X509_NAME_ENTRY, (st), (i), (val))
+# define sk_STACK_OF_X509_NAME_ENTRY_zero(st) SKM_sk_zero(STACK_OF_X509_NAME_ENTRY, (st))
+# define sk_STACK_OF_X509_NAME_ENTRY_push(st, val) SKM_sk_push(STACK_OF_X509_NAME_ENTRY, (st), (val))
+# define sk_STACK_OF_X509_NAME_ENTRY_unshift(st, val) SKM_sk_unshift(STACK_OF_X509_NAME_ENTRY, (st), (val))
+# define sk_STACK_OF_X509_NAME_ENTRY_find(st, val) SKM_sk_find(STACK_OF_X509_NAME_ENTRY, (st), (val))
+# define sk_STACK_OF_X509_NAME_ENTRY_find_ex(st, val) SKM_sk_find_ex(STACK_OF_X509_NAME_ENTRY, (st), (val))
+# define sk_STACK_OF_X509_NAME_ENTRY_delete(st, i) SKM_sk_delete(STACK_OF_X509_NAME_ENTRY, (st), (i))
+# define sk_STACK_OF_X509_NAME_ENTRY_delete_ptr(st, ptr) SKM_sk_delete_ptr(STACK_OF_X509_NAME_ENTRY, (st), (ptr))
+# define sk_STACK_OF_X509_NAME_ENTRY_insert(st, val, i) SKM_sk_insert(STACK_OF_X509_NAME_ENTRY, (st), (val), (i))
+# define sk_STACK_OF_X509_NAME_ENTRY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(STACK_OF_X509_NAME_ENTRY, (st), (cmp))
+# define sk_STACK_OF_X509_NAME_ENTRY_dup(st) SKM_sk_dup(STACK_OF_X509_NAME_ENTRY, st)
+# define sk_STACK_OF_X509_NAME_ENTRY_pop_free(st, free_func) SKM_sk_pop_free(STACK_OF_X509_NAME_ENTRY, (st), (free_func))
+# define sk_STACK_OF_X509_NAME_ENTRY_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(STACK_OF_X509_NAME_ENTRY, (st), (copy_func), (free_func))
+# define sk_STACK_OF_X509_NAME_ENTRY_shift(st) SKM_sk_shift(STACK_OF_X509_NAME_ENTRY, (st))
+# define sk_STACK_OF_X509_NAME_ENTRY_pop(st) SKM_sk_pop(STACK_OF_X509_NAME_ENTRY, (st))
+# define sk_STACK_OF_X509_NAME_ENTRY_sort(st) SKM_sk_sort(STACK_OF_X509_NAME_ENTRY, (st))
+# define sk_STACK_OF_X509_NAME_ENTRY_is_sorted(st) SKM_sk_is_sorted(STACK_OF_X509_NAME_ENTRY, (st))
+# define sk_STORE_ATTR_INFO_new(cmp) SKM_sk_new(STORE_ATTR_INFO, (cmp))
+# define sk_STORE_ATTR_INFO_new_null() SKM_sk_new_null(STORE_ATTR_INFO)
+# define sk_STORE_ATTR_INFO_free(st) SKM_sk_free(STORE_ATTR_INFO, (st))
+# define sk_STORE_ATTR_INFO_num(st) SKM_sk_num(STORE_ATTR_INFO, (st))
+# define sk_STORE_ATTR_INFO_value(st, i) SKM_sk_value(STORE_ATTR_INFO, (st), (i))
+# define sk_STORE_ATTR_INFO_set(st, i, val) SKM_sk_set(STORE_ATTR_INFO, (st), (i), (val))
+# define sk_STORE_ATTR_INFO_zero(st) SKM_sk_zero(STORE_ATTR_INFO, (st))
+# define sk_STORE_ATTR_INFO_push(st, val) SKM_sk_push(STORE_ATTR_INFO, (st), (val))
+# define sk_STORE_ATTR_INFO_unshift(st, val) SKM_sk_unshift(STORE_ATTR_INFO, (st), (val))
+# define sk_STORE_ATTR_INFO_find(st, val) SKM_sk_find(STORE_ATTR_INFO, (st), (val))
+# define sk_STORE_ATTR_INFO_find_ex(st, val) SKM_sk_find_ex(STORE_ATTR_INFO, (st), (val))
+# define sk_STORE_ATTR_INFO_delete(st, i) SKM_sk_delete(STORE_ATTR_INFO, (st), (i))
+# define sk_STORE_ATTR_INFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(STORE_ATTR_INFO, (st), (ptr))
+# define sk_STORE_ATTR_INFO_insert(st, val, i) SKM_sk_insert(STORE_ATTR_INFO, (st), (val), (i))
+# define sk_STORE_ATTR_INFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(STORE_ATTR_INFO, (st), (cmp))
+# define sk_STORE_ATTR_INFO_dup(st) SKM_sk_dup(STORE_ATTR_INFO, st)
+# define sk_STORE_ATTR_INFO_pop_free(st, free_func) SKM_sk_pop_free(STORE_ATTR_INFO, (st), (free_func))
+# define sk_STORE_ATTR_INFO_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(STORE_ATTR_INFO, (st), (copy_func), (free_func))
+# define sk_STORE_ATTR_INFO_shift(st) SKM_sk_shift(STORE_ATTR_INFO, (st))
+# define sk_STORE_ATTR_INFO_pop(st) SKM_sk_pop(STORE_ATTR_INFO, (st))
+# define sk_STORE_ATTR_INFO_sort(st) SKM_sk_sort(STORE_ATTR_INFO, (st))
+# define sk_STORE_ATTR_INFO_is_sorted(st) SKM_sk_is_sorted(STORE_ATTR_INFO, (st))
+# define sk_STORE_OBJECT_new(cmp) SKM_sk_new(STORE_OBJECT, (cmp))
+# define sk_STORE_OBJECT_new_null() SKM_sk_new_null(STORE_OBJECT)
+# define sk_STORE_OBJECT_free(st) SKM_sk_free(STORE_OBJECT, (st))
+# define sk_STORE_OBJECT_num(st) SKM_sk_num(STORE_OBJECT, (st))
+# define sk_STORE_OBJECT_value(st, i) SKM_sk_value(STORE_OBJECT, (st), (i))
+# define sk_STORE_OBJECT_set(st, i, val) SKM_sk_set(STORE_OBJECT, (st), (i), (val))
+# define sk_STORE_OBJECT_zero(st) SKM_sk_zero(STORE_OBJECT, (st))
+# define sk_STORE_OBJECT_push(st, val) SKM_sk_push(STORE_OBJECT, (st), (val))
+# define sk_STORE_OBJECT_unshift(st, val) SKM_sk_unshift(STORE_OBJECT, (st), (val))
+# define sk_STORE_OBJECT_find(st, val) SKM_sk_find(STORE_OBJECT, (st), (val))
+# define sk_STORE_OBJECT_find_ex(st, val) SKM_sk_find_ex(STORE_OBJECT, (st), (val))
+# define sk_STORE_OBJECT_delete(st, i) SKM_sk_delete(STORE_OBJECT, (st), (i))
+# define sk_STORE_OBJECT_delete_ptr(st, ptr) SKM_sk_delete_ptr(STORE_OBJECT, (st), (ptr))
+# define sk_STORE_OBJECT_insert(st, val, i) SKM_sk_insert(STORE_OBJECT, (st), (val), (i))
+# define sk_STORE_OBJECT_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(STORE_OBJECT, (st), (cmp))
+# define sk_STORE_OBJECT_dup(st) SKM_sk_dup(STORE_OBJECT, st)
+# define sk_STORE_OBJECT_pop_free(st, free_func) SKM_sk_pop_free(STORE_OBJECT, (st), (free_func))
+# define sk_STORE_OBJECT_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(STORE_OBJECT, (st), (copy_func), (free_func))
+# define sk_STORE_OBJECT_shift(st) SKM_sk_shift(STORE_OBJECT, (st))
+# define sk_STORE_OBJECT_pop(st) SKM_sk_pop(STORE_OBJECT, (st))
+# define sk_STORE_OBJECT_sort(st) SKM_sk_sort(STORE_OBJECT, (st))
+# define sk_STORE_OBJECT_is_sorted(st) SKM_sk_is_sorted(STORE_OBJECT, (st))
+# define sk_SXNETID_new(cmp) SKM_sk_new(SXNETID, (cmp))
+# define sk_SXNETID_new_null() SKM_sk_new_null(SXNETID)
+# define sk_SXNETID_free(st) SKM_sk_free(SXNETID, (st))
+# define sk_SXNETID_num(st) SKM_sk_num(SXNETID, (st))
+# define sk_SXNETID_value(st, i) SKM_sk_value(SXNETID, (st), (i))
+# define sk_SXNETID_set(st, i, val) SKM_sk_set(SXNETID, (st), (i), (val))
+# define sk_SXNETID_zero(st) SKM_sk_zero(SXNETID, (st))
+# define sk_SXNETID_push(st, val) SKM_sk_push(SXNETID, (st), (val))
+# define sk_SXNETID_unshift(st, val) SKM_sk_unshift(SXNETID, (st), (val))
+# define sk_SXNETID_find(st, val) SKM_sk_find(SXNETID, (st), (val))
+# define sk_SXNETID_find_ex(st, val) SKM_sk_find_ex(SXNETID, (st), (val))
+# define sk_SXNETID_delete(st, i) SKM_sk_delete(SXNETID, (st), (i))
+# define sk_SXNETID_delete_ptr(st, ptr) SKM_sk_delete_ptr(SXNETID, (st), (ptr))
+# define sk_SXNETID_insert(st, val, i) SKM_sk_insert(SXNETID, (st), (val), (i))
+# define sk_SXNETID_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SXNETID, (st), (cmp))
+# define sk_SXNETID_dup(st) SKM_sk_dup(SXNETID, st)
+# define sk_SXNETID_pop_free(st, free_func) SKM_sk_pop_free(SXNETID, (st), (free_func))
+# define sk_SXNETID_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(SXNETID, (st), (copy_func), (free_func))
+# define sk_SXNETID_shift(st) SKM_sk_shift(SXNETID, (st))
+# define sk_SXNETID_pop(st) SKM_sk_pop(SXNETID, (st))
+# define sk_SXNETID_sort(st) SKM_sk_sort(SXNETID, (st))
+# define sk_SXNETID_is_sorted(st) SKM_sk_is_sorted(SXNETID, (st))
+# define sk_UI_STRING_new(cmp) SKM_sk_new(UI_STRING, (cmp))
+# define sk_UI_STRING_new_null() SKM_sk_new_null(UI_STRING)
+# define sk_UI_STRING_free(st) SKM_sk_free(UI_STRING, (st))
+# define sk_UI_STRING_num(st) SKM_sk_num(UI_STRING, (st))
+# define sk_UI_STRING_value(st, i) SKM_sk_value(UI_STRING, (st), (i))
+# define sk_UI_STRING_set(st, i, val) SKM_sk_set(UI_STRING, (st), (i), (val))
+# define sk_UI_STRING_zero(st) SKM_sk_zero(UI_STRING, (st))
+# define sk_UI_STRING_push(st, val) SKM_sk_push(UI_STRING, (st), (val))
+# define sk_UI_STRING_unshift(st, val) SKM_sk_unshift(UI_STRING, (st), (val))
+# define sk_UI_STRING_find(st, val) SKM_sk_find(UI_STRING, (st), (val))
+# define sk_UI_STRING_find_ex(st, val) SKM_sk_find_ex(UI_STRING, (st), (val))
+# define sk_UI_STRING_delete(st, i) SKM_sk_delete(UI_STRING, (st), (i))
+# define sk_UI_STRING_delete_ptr(st, ptr) SKM_sk_delete_ptr(UI_STRING, (st), (ptr))
+# define sk_UI_STRING_insert(st, val, i) SKM_sk_insert(UI_STRING, (st), (val), (i))
+# define sk_UI_STRING_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(UI_STRING, (st), (cmp))
+# define sk_UI_STRING_dup(st) SKM_sk_dup(UI_STRING, st)
+# define sk_UI_STRING_pop_free(st, free_func) SKM_sk_pop_free(UI_STRING, (st), (free_func))
+# define sk_UI_STRING_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(UI_STRING, (st), (copy_func), (free_func))
+# define sk_UI_STRING_shift(st) SKM_sk_shift(UI_STRING, (st))
+# define sk_UI_STRING_pop(st) SKM_sk_pop(UI_STRING, (st))
+# define sk_UI_STRING_sort(st) SKM_sk_sort(UI_STRING, (st))
+# define sk_UI_STRING_is_sorted(st) SKM_sk_is_sorted(UI_STRING, (st))
+# define sk_X509_new(cmp) SKM_sk_new(X509, (cmp))
+# define sk_X509_new_null() SKM_sk_new_null(X509)
+# define sk_X509_free(st) SKM_sk_free(X509, (st))
+# define sk_X509_num(st) SKM_sk_num(X509, (st))
+# define sk_X509_value(st, i) SKM_sk_value(X509, (st), (i))
+# define sk_X509_set(st, i, val) SKM_sk_set(X509, (st), (i), (val))
+# define sk_X509_zero(st) SKM_sk_zero(X509, (st))
+# define sk_X509_push(st, val) SKM_sk_push(X509, (st), (val))
+# define sk_X509_unshift(st, val) SKM_sk_unshift(X509, (st), (val))
+# define sk_X509_find(st, val) SKM_sk_find(X509, (st), (val))
+# define sk_X509_find_ex(st, val) SKM_sk_find_ex(X509, (st), (val))
+# define sk_X509_delete(st, i) SKM_sk_delete(X509, (st), (i))
+# define sk_X509_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509, (st), (ptr))
+# define sk_X509_insert(st, val, i) SKM_sk_insert(X509, (st), (val), (i))
+# define sk_X509_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509, (st), (cmp))
+# define sk_X509_dup(st) SKM_sk_dup(X509, st)
+# define sk_X509_pop_free(st, free_func) SKM_sk_pop_free(X509, (st), (free_func))
+# define sk_X509_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509, (st), (copy_func), (free_func))
+# define sk_X509_shift(st) SKM_sk_shift(X509, (st))
+# define sk_X509_pop(st) SKM_sk_pop(X509, (st))
+# define sk_X509_sort(st) SKM_sk_sort(X509, (st))
+# define sk_X509_is_sorted(st) SKM_sk_is_sorted(X509, (st))
+# define sk_X509V3_EXT_METHOD_new(cmp) SKM_sk_new(X509V3_EXT_METHOD, (cmp))
+# define sk_X509V3_EXT_METHOD_new_null() SKM_sk_new_null(X509V3_EXT_METHOD)
+# define sk_X509V3_EXT_METHOD_free(st) SKM_sk_free(X509V3_EXT_METHOD, (st))
+# define sk_X509V3_EXT_METHOD_num(st) SKM_sk_num(X509V3_EXT_METHOD, (st))
+# define sk_X509V3_EXT_METHOD_value(st, i) SKM_sk_value(X509V3_EXT_METHOD, (st), (i))
+# define sk_X509V3_EXT_METHOD_set(st, i, val) SKM_sk_set(X509V3_EXT_METHOD, (st), (i), (val))
+# define sk_X509V3_EXT_METHOD_zero(st) SKM_sk_zero(X509V3_EXT_METHOD, (st))
+# define sk_X509V3_EXT_METHOD_push(st, val) SKM_sk_push(X509V3_EXT_METHOD, (st), (val))
+# define sk_X509V3_EXT_METHOD_unshift(st, val) SKM_sk_unshift(X509V3_EXT_METHOD, (st), (val))
+# define sk_X509V3_EXT_METHOD_find(st, val) SKM_sk_find(X509V3_EXT_METHOD, (st), (val))
+# define sk_X509V3_EXT_METHOD_find_ex(st, val) SKM_sk_find_ex(X509V3_EXT_METHOD, (st), (val))
+# define sk_X509V3_EXT_METHOD_delete(st, i) SKM_sk_delete(X509V3_EXT_METHOD, (st), (i))
+# define sk_X509V3_EXT_METHOD_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509V3_EXT_METHOD, (st), (ptr))
+# define sk_X509V3_EXT_METHOD_insert(st, val, i) SKM_sk_insert(X509V3_EXT_METHOD, (st), (val), (i))
+# define sk_X509V3_EXT_METHOD_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509V3_EXT_METHOD, (st), (cmp))
+# define sk_X509V3_EXT_METHOD_dup(st) SKM_sk_dup(X509V3_EXT_METHOD, st)
+# define sk_X509V3_EXT_METHOD_pop_free(st, free_func) SKM_sk_pop_free(X509V3_EXT_METHOD, (st), (free_func))
+# define sk_X509V3_EXT_METHOD_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509V3_EXT_METHOD, (st), (copy_func), (free_func))
+# define sk_X509V3_EXT_METHOD_shift(st) SKM_sk_shift(X509V3_EXT_METHOD, (st))
+# define sk_X509V3_EXT_METHOD_pop(st) SKM_sk_pop(X509V3_EXT_METHOD, (st))
+# define sk_X509V3_EXT_METHOD_sort(st) SKM_sk_sort(X509V3_EXT_METHOD, (st))
+# define sk_X509V3_EXT_METHOD_is_sorted(st) SKM_sk_is_sorted(X509V3_EXT_METHOD, (st))
+# define sk_X509_ALGOR_new(cmp) SKM_sk_new(X509_ALGOR, (cmp))
+# define sk_X509_ALGOR_new_null() SKM_sk_new_null(X509_ALGOR)
+# define sk_X509_ALGOR_free(st) SKM_sk_free(X509_ALGOR, (st))
+# define sk_X509_ALGOR_num(st) SKM_sk_num(X509_ALGOR, (st))
+# define sk_X509_ALGOR_value(st, i) SKM_sk_value(X509_ALGOR, (st), (i))
+# define sk_X509_ALGOR_set(st, i, val) SKM_sk_set(X509_ALGOR, (st), (i), (val))
+# define sk_X509_ALGOR_zero(st) SKM_sk_zero(X509_ALGOR, (st))
+# define sk_X509_ALGOR_push(st, val) SKM_sk_push(X509_ALGOR, (st), (val))
+# define sk_X509_ALGOR_unshift(st, val) SKM_sk_unshift(X509_ALGOR, (st), (val))
+# define sk_X509_ALGOR_find(st, val) SKM_sk_find(X509_ALGOR, (st), (val))
+# define sk_X509_ALGOR_find_ex(st, val) SKM_sk_find_ex(X509_ALGOR, (st), (val))
+# define sk_X509_ALGOR_delete(st, i) SKM_sk_delete(X509_ALGOR, (st), (i))
+# define sk_X509_ALGOR_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_ALGOR, (st), (ptr))
+# define sk_X509_ALGOR_insert(st, val, i) SKM_sk_insert(X509_ALGOR, (st), (val), (i))
+# define sk_X509_ALGOR_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_ALGOR, (st), (cmp))
+# define sk_X509_ALGOR_dup(st) SKM_sk_dup(X509_ALGOR, st)
+# define sk_X509_ALGOR_pop_free(st, free_func) SKM_sk_pop_free(X509_ALGOR, (st), (free_func))
+# define sk_X509_ALGOR_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_ALGOR, (st), (copy_func), (free_func))
+# define sk_X509_ALGOR_shift(st) SKM_sk_shift(X509_ALGOR, (st))
+# define sk_X509_ALGOR_pop(st) SKM_sk_pop(X509_ALGOR, (st))
+# define sk_X509_ALGOR_sort(st) SKM_sk_sort(X509_ALGOR, (st))
+# define sk_X509_ALGOR_is_sorted(st) SKM_sk_is_sorted(X509_ALGOR, (st))
+# define sk_X509_ATTRIBUTE_new(cmp) SKM_sk_new(X509_ATTRIBUTE, (cmp))
+# define sk_X509_ATTRIBUTE_new_null() SKM_sk_new_null(X509_ATTRIBUTE)
+# define sk_X509_ATTRIBUTE_free(st) SKM_sk_free(X509_ATTRIBUTE, (st))
+# define sk_X509_ATTRIBUTE_num(st) SKM_sk_num(X509_ATTRIBUTE, (st))
+# define sk_X509_ATTRIBUTE_value(st, i) SKM_sk_value(X509_ATTRIBUTE, (st), (i))
+# define sk_X509_ATTRIBUTE_set(st, i, val) SKM_sk_set(X509_ATTRIBUTE, (st), (i), (val))
+# define sk_X509_ATTRIBUTE_zero(st) SKM_sk_zero(X509_ATTRIBUTE, (st))
+# define sk_X509_ATTRIBUTE_push(st, val) SKM_sk_push(X509_ATTRIBUTE, (st), (val))
+# define sk_X509_ATTRIBUTE_unshift(st, val) SKM_sk_unshift(X509_ATTRIBUTE, (st), (val))
+# define sk_X509_ATTRIBUTE_find(st, val) SKM_sk_find(X509_ATTRIBUTE, (st), (val))
+# define sk_X509_ATTRIBUTE_find_ex(st, val) SKM_sk_find_ex(X509_ATTRIBUTE, (st), (val))
+# define sk_X509_ATTRIBUTE_delete(st, i) SKM_sk_delete(X509_ATTRIBUTE, (st), (i))
+# define sk_X509_ATTRIBUTE_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_ATTRIBUTE, (st), (ptr))
+# define sk_X509_ATTRIBUTE_insert(st, val, i) SKM_sk_insert(X509_ATTRIBUTE, (st), (val), (i))
+# define sk_X509_ATTRIBUTE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_ATTRIBUTE, (st), (cmp))
+# define sk_X509_ATTRIBUTE_dup(st) SKM_sk_dup(X509_ATTRIBUTE, st)
+# define sk_X509_ATTRIBUTE_pop_free(st, free_func) SKM_sk_pop_free(X509_ATTRIBUTE, (st), (free_func))
+# define sk_X509_ATTRIBUTE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_ATTRIBUTE, (st), (copy_func), (free_func))
+# define sk_X509_ATTRIBUTE_shift(st) SKM_sk_shift(X509_ATTRIBUTE, (st))
+# define sk_X509_ATTRIBUTE_pop(st) SKM_sk_pop(X509_ATTRIBUTE, (st))
+# define sk_X509_ATTRIBUTE_sort(st) SKM_sk_sort(X509_ATTRIBUTE, (st))
+# define sk_X509_ATTRIBUTE_is_sorted(st) SKM_sk_is_sorted(X509_ATTRIBUTE, (st))
+# define sk_X509_CRL_new(cmp) SKM_sk_new(X509_CRL, (cmp))
+# define sk_X509_CRL_new_null() SKM_sk_new_null(X509_CRL)
+# define sk_X509_CRL_free(st) SKM_sk_free(X509_CRL, (st))
+# define sk_X509_CRL_num(st) SKM_sk_num(X509_CRL, (st))
+# define sk_X509_CRL_value(st, i) SKM_sk_value(X509_CRL, (st), (i))
+# define sk_X509_CRL_set(st, i, val) SKM_sk_set(X509_CRL, (st), (i), (val))
+# define sk_X509_CRL_zero(st) SKM_sk_zero(X509_CRL, (st))
+# define sk_X509_CRL_push(st, val) SKM_sk_push(X509_CRL, (st), (val))
+# define sk_X509_CRL_unshift(st, val) SKM_sk_unshift(X509_CRL, (st), (val))
+# define sk_X509_CRL_find(st, val) SKM_sk_find(X509_CRL, (st), (val))
+# define sk_X509_CRL_find_ex(st, val) SKM_sk_find_ex(X509_CRL, (st), (val))
+# define sk_X509_CRL_delete(st, i) SKM_sk_delete(X509_CRL, (st), (i))
+# define sk_X509_CRL_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_CRL, (st), (ptr))
+# define sk_X509_CRL_insert(st, val, i) SKM_sk_insert(X509_CRL, (st), (val), (i))
+# define sk_X509_CRL_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_CRL, (st), (cmp))
+# define sk_X509_CRL_dup(st) SKM_sk_dup(X509_CRL, st)
+# define sk_X509_CRL_pop_free(st, free_func) SKM_sk_pop_free(X509_CRL, (st), (free_func))
+# define sk_X509_CRL_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_CRL, (st), (copy_func), (free_func))
+# define sk_X509_CRL_shift(st) SKM_sk_shift(X509_CRL, (st))
+# define sk_X509_CRL_pop(st) SKM_sk_pop(X509_CRL, (st))
+# define sk_X509_CRL_sort(st) SKM_sk_sort(X509_CRL, (st))
+# define sk_X509_CRL_is_sorted(st) SKM_sk_is_sorted(X509_CRL, (st))
+# define sk_X509_EXTENSION_new(cmp) SKM_sk_new(X509_EXTENSION, (cmp))
+# define sk_X509_EXTENSION_new_null() SKM_sk_new_null(X509_EXTENSION)
+# define sk_X509_EXTENSION_free(st) SKM_sk_free(X509_EXTENSION, (st))
+# define sk_X509_EXTENSION_num(st) SKM_sk_num(X509_EXTENSION, (st))
+# define sk_X509_EXTENSION_value(st, i) SKM_sk_value(X509_EXTENSION, (st), (i))
+# define sk_X509_EXTENSION_set(st, i, val) SKM_sk_set(X509_EXTENSION, (st), (i), (val))
+# define sk_X509_EXTENSION_zero(st) SKM_sk_zero(X509_EXTENSION, (st))
+# define sk_X509_EXTENSION_push(st, val) SKM_sk_push(X509_EXTENSION, (st), (val))
+# define sk_X509_EXTENSION_unshift(st, val) SKM_sk_unshift(X509_EXTENSION, (st), (val))
+# define sk_X509_EXTENSION_find(st, val) SKM_sk_find(X509_EXTENSION, (st), (val))
+# define sk_X509_EXTENSION_find_ex(st, val) SKM_sk_find_ex(X509_EXTENSION, (st), (val))
+# define sk_X509_EXTENSION_delete(st, i) SKM_sk_delete(X509_EXTENSION, (st), (i))
+# define sk_X509_EXTENSION_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_EXTENSION, (st), (ptr))
+# define sk_X509_EXTENSION_insert(st, val, i) SKM_sk_insert(X509_EXTENSION, (st), (val), (i))
+# define sk_X509_EXTENSION_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_EXTENSION, (st), (cmp))
+# define sk_X509_EXTENSION_dup(st) SKM_sk_dup(X509_EXTENSION, st)
+# define sk_X509_EXTENSION_pop_free(st, free_func) SKM_sk_pop_free(X509_EXTENSION, (st), (free_func))
+# define sk_X509_EXTENSION_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_EXTENSION, (st), (copy_func), (free_func))
+# define sk_X509_EXTENSION_shift(st) SKM_sk_shift(X509_EXTENSION, (st))
+# define sk_X509_EXTENSION_pop(st) SKM_sk_pop(X509_EXTENSION, (st))
+# define sk_X509_EXTENSION_sort(st) SKM_sk_sort(X509_EXTENSION, (st))
+# define sk_X509_EXTENSION_is_sorted(st) SKM_sk_is_sorted(X509_EXTENSION, (st))
+# define sk_X509_INFO_new(cmp) SKM_sk_new(X509_INFO, (cmp))
+# define sk_X509_INFO_new_null() SKM_sk_new_null(X509_INFO)
+# define sk_X509_INFO_free(st) SKM_sk_free(X509_INFO, (st))
+# define sk_X509_INFO_num(st) SKM_sk_num(X509_INFO, (st))
+# define sk_X509_INFO_value(st, i) SKM_sk_value(X509_INFO, (st), (i))
+# define sk_X509_INFO_set(st, i, val) SKM_sk_set(X509_INFO, (st), (i), (val))
+# define sk_X509_INFO_zero(st) SKM_sk_zero(X509_INFO, (st))
+# define sk_X509_INFO_push(st, val) SKM_sk_push(X509_INFO, (st), (val))
+# define sk_X509_INFO_unshift(st, val) SKM_sk_unshift(X509_INFO, (st), (val))
+# define sk_X509_INFO_find(st, val) SKM_sk_find(X509_INFO, (st), (val))
+# define sk_X509_INFO_find_ex(st, val) SKM_sk_find_ex(X509_INFO, (st), (val))
+# define sk_X509_INFO_delete(st, i) SKM_sk_delete(X509_INFO, (st), (i))
+# define sk_X509_INFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_INFO, (st), (ptr))
+# define sk_X509_INFO_insert(st, val, i) SKM_sk_insert(X509_INFO, (st), (val), (i))
+# define sk_X509_INFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_INFO, (st), (cmp))
+# define sk_X509_INFO_dup(st) SKM_sk_dup(X509_INFO, st)
+# define sk_X509_INFO_pop_free(st, free_func) SKM_sk_pop_free(X509_INFO, (st), (free_func))
+# define sk_X509_INFO_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_INFO, (st), (copy_func), (free_func))
+# define sk_X509_INFO_shift(st) SKM_sk_shift(X509_INFO, (st))
+# define sk_X509_INFO_pop(st) SKM_sk_pop(X509_INFO, (st))
+# define sk_X509_INFO_sort(st) SKM_sk_sort(X509_INFO, (st))
+# define sk_X509_INFO_is_sorted(st) SKM_sk_is_sorted(X509_INFO, (st))
+# define sk_X509_LOOKUP_new(cmp) SKM_sk_new(X509_LOOKUP, (cmp))
+# define sk_X509_LOOKUP_new_null() SKM_sk_new_null(X509_LOOKUP)
+# define sk_X509_LOOKUP_free(st) SKM_sk_free(X509_LOOKUP, (st))
+# define sk_X509_LOOKUP_num(st) SKM_sk_num(X509_LOOKUP, (st))
+# define sk_X509_LOOKUP_value(st, i) SKM_sk_value(X509_LOOKUP, (st), (i))
+# define sk_X509_LOOKUP_set(st, i, val) SKM_sk_set(X509_LOOKUP, (st), (i), (val))
+# define sk_X509_LOOKUP_zero(st) SKM_sk_zero(X509_LOOKUP, (st))
+# define sk_X509_LOOKUP_push(st, val) SKM_sk_push(X509_LOOKUP, (st), (val))
+# define sk_X509_LOOKUP_unshift(st, val) SKM_sk_unshift(X509_LOOKUP, (st), (val))
+# define sk_X509_LOOKUP_find(st, val) SKM_sk_find(X509_LOOKUP, (st), (val))
+# define sk_X509_LOOKUP_find_ex(st, val) SKM_sk_find_ex(X509_LOOKUP, (st), (val))
+# define sk_X509_LOOKUP_delete(st, i) SKM_sk_delete(X509_LOOKUP, (st), (i))
+# define sk_X509_LOOKUP_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_LOOKUP, (st), (ptr))
+# define sk_X509_LOOKUP_insert(st, val, i) SKM_sk_insert(X509_LOOKUP, (st), (val), (i))
+# define sk_X509_LOOKUP_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_LOOKUP, (st), (cmp))
+# define sk_X509_LOOKUP_dup(st) SKM_sk_dup(X509_LOOKUP, st)
+# define sk_X509_LOOKUP_pop_free(st, free_func) SKM_sk_pop_free(X509_LOOKUP, (st), (free_func))
+# define sk_X509_LOOKUP_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_LOOKUP, (st), (copy_func), (free_func))
+# define sk_X509_LOOKUP_shift(st) SKM_sk_shift(X509_LOOKUP, (st))
+# define sk_X509_LOOKUP_pop(st) SKM_sk_pop(X509_LOOKUP, (st))
+# define sk_X509_LOOKUP_sort(st) SKM_sk_sort(X509_LOOKUP, (st))
+# define sk_X509_LOOKUP_is_sorted(st) SKM_sk_is_sorted(X509_LOOKUP, (st))
+# define sk_X509_NAME_new(cmp) SKM_sk_new(X509_NAME, (cmp))
+# define sk_X509_NAME_new_null() SKM_sk_new_null(X509_NAME)
+# define sk_X509_NAME_free(st) SKM_sk_free(X509_NAME, (st))
+# define sk_X509_NAME_num(st) SKM_sk_num(X509_NAME, (st))
+# define sk_X509_NAME_value(st, i) SKM_sk_value(X509_NAME, (st), (i))
+# define sk_X509_NAME_set(st, i, val) SKM_sk_set(X509_NAME, (st), (i), (val))
+# define sk_X509_NAME_zero(st) SKM_sk_zero(X509_NAME, (st))
+# define sk_X509_NAME_push(st, val) SKM_sk_push(X509_NAME, (st), (val))
+# define sk_X509_NAME_unshift(st, val) SKM_sk_unshift(X509_NAME, (st), (val))
+# define sk_X509_NAME_find(st, val) SKM_sk_find(X509_NAME, (st), (val))
+# define sk_X509_NAME_find_ex(st, val) SKM_sk_find_ex(X509_NAME, (st), (val))
+# define sk_X509_NAME_delete(st, i) SKM_sk_delete(X509_NAME, (st), (i))
+# define sk_X509_NAME_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_NAME, (st), (ptr))
+# define sk_X509_NAME_insert(st, val, i) SKM_sk_insert(X509_NAME, (st), (val), (i))
+# define sk_X509_NAME_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_NAME, (st), (cmp))
+# define sk_X509_NAME_dup(st) SKM_sk_dup(X509_NAME, st)
+# define sk_X509_NAME_pop_free(st, free_func) SKM_sk_pop_free(X509_NAME, (st), (free_func))
+# define sk_X509_NAME_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_NAME, (st), (copy_func), (free_func))
+# define sk_X509_NAME_shift(st) SKM_sk_shift(X509_NAME, (st))
+# define sk_X509_NAME_pop(st) SKM_sk_pop(X509_NAME, (st))
+# define sk_X509_NAME_sort(st) SKM_sk_sort(X509_NAME, (st))
+# define sk_X509_NAME_is_sorted(st) SKM_sk_is_sorted(X509_NAME, (st))
+# define sk_X509_NAME_ENTRY_new(cmp) SKM_sk_new(X509_NAME_ENTRY, (cmp))
+# define sk_X509_NAME_ENTRY_new_null() SKM_sk_new_null(X509_NAME_ENTRY)
+# define sk_X509_NAME_ENTRY_free(st) SKM_sk_free(X509_NAME_ENTRY, (st))
+# define sk_X509_NAME_ENTRY_num(st) SKM_sk_num(X509_NAME_ENTRY, (st))
+# define sk_X509_NAME_ENTRY_value(st, i) SKM_sk_value(X509_NAME_ENTRY, (st), (i))
+# define sk_X509_NAME_ENTRY_set(st, i, val) SKM_sk_set(X509_NAME_ENTRY, (st), (i), (val))
+# define sk_X509_NAME_ENTRY_zero(st) SKM_sk_zero(X509_NAME_ENTRY, (st))
+# define sk_X509_NAME_ENTRY_push(st, val) SKM_sk_push(X509_NAME_ENTRY, (st), (val))
+# define sk_X509_NAME_ENTRY_unshift(st, val) SKM_sk_unshift(X509_NAME_ENTRY, (st), (val))
+# define sk_X509_NAME_ENTRY_find(st, val) SKM_sk_find(X509_NAME_ENTRY, (st), (val))
+# define sk_X509_NAME_ENTRY_find_ex(st, val) SKM_sk_find_ex(X509_NAME_ENTRY, (st), (val))
+# define sk_X509_NAME_ENTRY_delete(st, i) SKM_sk_delete(X509_NAME_ENTRY, (st), (i))
+# define sk_X509_NAME_ENTRY_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_NAME_ENTRY, (st), (ptr))
+# define sk_X509_NAME_ENTRY_insert(st, val, i) SKM_sk_insert(X509_NAME_ENTRY, (st), (val), (i))
+# define sk_X509_NAME_ENTRY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_NAME_ENTRY, (st), (cmp))
+# define sk_X509_NAME_ENTRY_dup(st) SKM_sk_dup(X509_NAME_ENTRY, st)
+# define sk_X509_NAME_ENTRY_pop_free(st, free_func) SKM_sk_pop_free(X509_NAME_ENTRY, (st), (free_func))
+# define sk_X509_NAME_ENTRY_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_NAME_ENTRY, (st), (copy_func), (free_func))
+# define sk_X509_NAME_ENTRY_shift(st) SKM_sk_shift(X509_NAME_ENTRY, (st))
+# define sk_X509_NAME_ENTRY_pop(st) SKM_sk_pop(X509_NAME_ENTRY, (st))
+# define sk_X509_NAME_ENTRY_sort(st) SKM_sk_sort(X509_NAME_ENTRY, (st))
+# define sk_X509_NAME_ENTRY_is_sorted(st) SKM_sk_is_sorted(X509_NAME_ENTRY, (st))
+# define sk_X509_OBJECT_new(cmp) SKM_sk_new(X509_OBJECT, (cmp))
+# define sk_X509_OBJECT_new_null() SKM_sk_new_null(X509_OBJECT)
+# define sk_X509_OBJECT_free(st) SKM_sk_free(X509_OBJECT, (st))
+# define sk_X509_OBJECT_num(st) SKM_sk_num(X509_OBJECT, (st))
+# define sk_X509_OBJECT_value(st, i) SKM_sk_value(X509_OBJECT, (st), (i))
+# define sk_X509_OBJECT_set(st, i, val) SKM_sk_set(X509_OBJECT, (st), (i), (val))
+# define sk_X509_OBJECT_zero(st) SKM_sk_zero(X509_OBJECT, (st))
+# define sk_X509_OBJECT_push(st, val) SKM_sk_push(X509_OBJECT, (st), (val))
+# define sk_X509_OBJECT_unshift(st, val) SKM_sk_unshift(X509_OBJECT, (st), (val))
+# define sk_X509_OBJECT_find(st, val) SKM_sk_find(X509_OBJECT, (st), (val))
+# define sk_X509_OBJECT_find_ex(st, val) SKM_sk_find_ex(X509_OBJECT, (st), (val))
+# define sk_X509_OBJECT_delete(st, i) SKM_sk_delete(X509_OBJECT, (st), (i))
+# define sk_X509_OBJECT_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_OBJECT, (st), (ptr))
+# define sk_X509_OBJECT_insert(st, val, i) SKM_sk_insert(X509_OBJECT, (st), (val), (i))
+# define sk_X509_OBJECT_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_OBJECT, (st), (cmp))
+# define sk_X509_OBJECT_dup(st) SKM_sk_dup(X509_OBJECT, st)
+# define sk_X509_OBJECT_pop_free(st, free_func) SKM_sk_pop_free(X509_OBJECT, (st), (free_func))
+# define sk_X509_OBJECT_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_OBJECT, (st), (copy_func), (free_func))
+# define sk_X509_OBJECT_shift(st) SKM_sk_shift(X509_OBJECT, (st))
+# define sk_X509_OBJECT_pop(st) SKM_sk_pop(X509_OBJECT, (st))
+# define sk_X509_OBJECT_sort(st) SKM_sk_sort(X509_OBJECT, (st))
+# define sk_X509_OBJECT_is_sorted(st) SKM_sk_is_sorted(X509_OBJECT, (st))
+# define sk_X509_POLICY_DATA_new(cmp) SKM_sk_new(X509_POLICY_DATA, (cmp))
+# define sk_X509_POLICY_DATA_new_null() SKM_sk_new_null(X509_POLICY_DATA)
+# define sk_X509_POLICY_DATA_free(st) SKM_sk_free(X509_POLICY_DATA, (st))
+# define sk_X509_POLICY_DATA_num(st) SKM_sk_num(X509_POLICY_DATA, (st))
+# define sk_X509_POLICY_DATA_value(st, i) SKM_sk_value(X509_POLICY_DATA, (st), (i))
+# define sk_X509_POLICY_DATA_set(st, i, val) SKM_sk_set(X509_POLICY_DATA, (st), (i), (val))
+# define sk_X509_POLICY_DATA_zero(st) SKM_sk_zero(X509_POLICY_DATA, (st))
+# define sk_X509_POLICY_DATA_push(st, val) SKM_sk_push(X509_POLICY_DATA, (st), (val))
+# define sk_X509_POLICY_DATA_unshift(st, val) SKM_sk_unshift(X509_POLICY_DATA, (st), (val))
+# define sk_X509_POLICY_DATA_find(st, val) SKM_sk_find(X509_POLICY_DATA, (st), (val))
+# define sk_X509_POLICY_DATA_find_ex(st, val) SKM_sk_find_ex(X509_POLICY_DATA, (st), (val))
+# define sk_X509_POLICY_DATA_delete(st, i) SKM_sk_delete(X509_POLICY_DATA, (st), (i))
+# define sk_X509_POLICY_DATA_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_POLICY_DATA, (st), (ptr))
+# define sk_X509_POLICY_DATA_insert(st, val, i) SKM_sk_insert(X509_POLICY_DATA, (st), (val), (i))
+# define sk_X509_POLICY_DATA_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_POLICY_DATA, (st), (cmp))
+# define sk_X509_POLICY_DATA_dup(st) SKM_sk_dup(X509_POLICY_DATA, st)
+# define sk_X509_POLICY_DATA_pop_free(st, free_func) SKM_sk_pop_free(X509_POLICY_DATA, (st), (free_func))
+# define sk_X509_POLICY_DATA_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_POLICY_DATA, (st), (copy_func), (free_func))
+# define sk_X509_POLICY_DATA_shift(st) SKM_sk_shift(X509_POLICY_DATA, (st))
+# define sk_X509_POLICY_DATA_pop(st) SKM_sk_pop(X509_POLICY_DATA, (st))
+# define sk_X509_POLICY_DATA_sort(st) SKM_sk_sort(X509_POLICY_DATA, (st))
+# define sk_X509_POLICY_DATA_is_sorted(st) SKM_sk_is_sorted(X509_POLICY_DATA, (st))
+# define sk_X509_POLICY_NODE_new(cmp) SKM_sk_new(X509_POLICY_NODE, (cmp))
+# define sk_X509_POLICY_NODE_new_null() SKM_sk_new_null(X509_POLICY_NODE)
+# define sk_X509_POLICY_NODE_free(st) SKM_sk_free(X509_POLICY_NODE, (st))
+# define sk_X509_POLICY_NODE_num(st) SKM_sk_num(X509_POLICY_NODE, (st))
+# define sk_X509_POLICY_NODE_value(st, i) SKM_sk_value(X509_POLICY_NODE, (st), (i))
+# define sk_X509_POLICY_NODE_set(st, i, val) SKM_sk_set(X509_POLICY_NODE, (st), (i), (val))
+# define sk_X509_POLICY_NODE_zero(st) SKM_sk_zero(X509_POLICY_NODE, (st))
+# define sk_X509_POLICY_NODE_push(st, val) SKM_sk_push(X509_POLICY_NODE, (st), (val))
+# define sk_X509_POLICY_NODE_unshift(st, val) SKM_sk_unshift(X509_POLICY_NODE, (st), (val))
+# define sk_X509_POLICY_NODE_find(st, val) SKM_sk_find(X509_POLICY_NODE, (st), (val))
+# define sk_X509_POLICY_NODE_find_ex(st, val) SKM_sk_find_ex(X509_POLICY_NODE, (st), (val))
+# define sk_X509_POLICY_NODE_delete(st, i) SKM_sk_delete(X509_POLICY_NODE, (st), (i))
+# define sk_X509_POLICY_NODE_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_POLICY_NODE, (st), (ptr))
+# define sk_X509_POLICY_NODE_insert(st, val, i) SKM_sk_insert(X509_POLICY_NODE, (st), (val), (i))
+# define sk_X509_POLICY_NODE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_POLICY_NODE, (st), (cmp))
+# define sk_X509_POLICY_NODE_dup(st) SKM_sk_dup(X509_POLICY_NODE, st)
+# define sk_X509_POLICY_NODE_pop_free(st, free_func) SKM_sk_pop_free(X509_POLICY_NODE, (st), (free_func))
+# define sk_X509_POLICY_NODE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_POLICY_NODE, (st), (copy_func), (free_func))
+# define sk_X509_POLICY_NODE_shift(st) SKM_sk_shift(X509_POLICY_NODE, (st))
+# define sk_X509_POLICY_NODE_pop(st) SKM_sk_pop(X509_POLICY_NODE, (st))
+# define sk_X509_POLICY_NODE_sort(st) SKM_sk_sort(X509_POLICY_NODE, (st))
+# define sk_X509_POLICY_NODE_is_sorted(st) SKM_sk_is_sorted(X509_POLICY_NODE, (st))
+# define sk_X509_PURPOSE_new(cmp) SKM_sk_new(X509_PURPOSE, (cmp))
+# define sk_X509_PURPOSE_new_null() SKM_sk_new_null(X509_PURPOSE)
+# define sk_X509_PURPOSE_free(st) SKM_sk_free(X509_PURPOSE, (st))
+# define sk_X509_PURPOSE_num(st) SKM_sk_num(X509_PURPOSE, (st))
+# define sk_X509_PURPOSE_value(st, i) SKM_sk_value(X509_PURPOSE, (st), (i))
+# define sk_X509_PURPOSE_set(st, i, val) SKM_sk_set(X509_PURPOSE, (st), (i), (val))
+# define sk_X509_PURPOSE_zero(st) SKM_sk_zero(X509_PURPOSE, (st))
+# define sk_X509_PURPOSE_push(st, val) SKM_sk_push(X509_PURPOSE, (st), (val))
+# define sk_X509_PURPOSE_unshift(st, val) SKM_sk_unshift(X509_PURPOSE, (st), (val))
+# define sk_X509_PURPOSE_find(st, val) SKM_sk_find(X509_PURPOSE, (st), (val))
+# define sk_X509_PURPOSE_find_ex(st, val) SKM_sk_find_ex(X509_PURPOSE, (st), (val))
+# define sk_X509_PURPOSE_delete(st, i) SKM_sk_delete(X509_PURPOSE, (st), (i))
+# define sk_X509_PURPOSE_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_PURPOSE, (st), (ptr))
+# define sk_X509_PURPOSE_insert(st, val, i) SKM_sk_insert(X509_PURPOSE, (st), (val), (i))
+# define sk_X509_PURPOSE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_PURPOSE, (st), (cmp))
+# define sk_X509_PURPOSE_dup(st) SKM_sk_dup(X509_PURPOSE, st)
+# define sk_X509_PURPOSE_pop_free(st, free_func) SKM_sk_pop_free(X509_PURPOSE, (st), (free_func))
+# define sk_X509_PURPOSE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_PURPOSE, (st), (copy_func), (free_func))
+# define sk_X509_PURPOSE_shift(st) SKM_sk_shift(X509_PURPOSE, (st))
+# define sk_X509_PURPOSE_pop(st) SKM_sk_pop(X509_PURPOSE, (st))
+# define sk_X509_PURPOSE_sort(st) SKM_sk_sort(X509_PURPOSE, (st))
+# define sk_X509_PURPOSE_is_sorted(st) SKM_sk_is_sorted(X509_PURPOSE, (st))
+# define sk_X509_REVOKED_new(cmp) SKM_sk_new(X509_REVOKED, (cmp))
+# define sk_X509_REVOKED_new_null() SKM_sk_new_null(X509_REVOKED)
+# define sk_X509_REVOKED_free(st) SKM_sk_free(X509_REVOKED, (st))
+# define sk_X509_REVOKED_num(st) SKM_sk_num(X509_REVOKED, (st))
+# define sk_X509_REVOKED_value(st, i) SKM_sk_value(X509_REVOKED, (st), (i))
+# define sk_X509_REVOKED_set(st, i, val) SKM_sk_set(X509_REVOKED, (st), (i), (val))
+# define sk_X509_REVOKED_zero(st) SKM_sk_zero(X509_REVOKED, (st))
+# define sk_X509_REVOKED_push(st, val) SKM_sk_push(X509_REVOKED, (st), (val))
+# define sk_X509_REVOKED_unshift(st, val) SKM_sk_unshift(X509_REVOKED, (st), (val))
+# define sk_X509_REVOKED_find(st, val) SKM_sk_find(X509_REVOKED, (st), (val))
+# define sk_X509_REVOKED_find_ex(st, val) SKM_sk_find_ex(X509_REVOKED, (st), (val))
+# define sk_X509_REVOKED_delete(st, i) SKM_sk_delete(X509_REVOKED, (st), (i))
+# define sk_X509_REVOKED_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_REVOKED, (st), (ptr))
+# define sk_X509_REVOKED_insert(st, val, i) SKM_sk_insert(X509_REVOKED, (st), (val), (i))
+# define sk_X509_REVOKED_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_REVOKED, (st), (cmp))
+# define sk_X509_REVOKED_dup(st) SKM_sk_dup(X509_REVOKED, st)
+# define sk_X509_REVOKED_pop_free(st, free_func) SKM_sk_pop_free(X509_REVOKED, (st), (free_func))
+# define sk_X509_REVOKED_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_REVOKED, (st), (copy_func), (free_func))
+# define sk_X509_REVOKED_shift(st) SKM_sk_shift(X509_REVOKED, (st))
+# define sk_X509_REVOKED_pop(st) SKM_sk_pop(X509_REVOKED, (st))
+# define sk_X509_REVOKED_sort(st) SKM_sk_sort(X509_REVOKED, (st))
+# define sk_X509_REVOKED_is_sorted(st) SKM_sk_is_sorted(X509_REVOKED, (st))
+# define sk_X509_TRUST_new(cmp) SKM_sk_new(X509_TRUST, (cmp))
+# define sk_X509_TRUST_new_null() SKM_sk_new_null(X509_TRUST)
+# define sk_X509_TRUST_free(st) SKM_sk_free(X509_TRUST, (st))
+# define sk_X509_TRUST_num(st) SKM_sk_num(X509_TRUST, (st))
+# define sk_X509_TRUST_value(st, i) SKM_sk_value(X509_TRUST, (st), (i))
+# define sk_X509_TRUST_set(st, i, val) SKM_sk_set(X509_TRUST, (st), (i), (val))
+# define sk_X509_TRUST_zero(st) SKM_sk_zero(X509_TRUST, (st))
+# define sk_X509_TRUST_push(st, val) SKM_sk_push(X509_TRUST, (st), (val))
+# define sk_X509_TRUST_unshift(st, val) SKM_sk_unshift(X509_TRUST, (st), (val))
+# define sk_X509_TRUST_find(st, val) SKM_sk_find(X509_TRUST, (st), (val))
+# define sk_X509_TRUST_find_ex(st, val) SKM_sk_find_ex(X509_TRUST, (st), (val))
+# define sk_X509_TRUST_delete(st, i) SKM_sk_delete(X509_TRUST, (st), (i))
+# define sk_X509_TRUST_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_TRUST, (st), (ptr))
+# define sk_X509_TRUST_insert(st, val, i) SKM_sk_insert(X509_TRUST, (st), (val), (i))
+# define sk_X509_TRUST_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_TRUST, (st), (cmp))
+# define sk_X509_TRUST_dup(st) SKM_sk_dup(X509_TRUST, st)
+# define sk_X509_TRUST_pop_free(st, free_func) SKM_sk_pop_free(X509_TRUST, (st), (free_func))
+# define sk_X509_TRUST_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_TRUST, (st), (copy_func), (free_func))
+# define sk_X509_TRUST_shift(st) SKM_sk_shift(X509_TRUST, (st))
+# define sk_X509_TRUST_pop(st) SKM_sk_pop(X509_TRUST, (st))
+# define sk_X509_TRUST_sort(st) SKM_sk_sort(X509_TRUST, (st))
+# define sk_X509_TRUST_is_sorted(st) SKM_sk_is_sorted(X509_TRUST, (st))
+# define sk_X509_VERIFY_PARAM_new(cmp) SKM_sk_new(X509_VERIFY_PARAM, (cmp))
+# define sk_X509_VERIFY_PARAM_new_null() SKM_sk_new_null(X509_VERIFY_PARAM)
+# define sk_X509_VERIFY_PARAM_free(st) SKM_sk_free(X509_VERIFY_PARAM, (st))
+# define sk_X509_VERIFY_PARAM_num(st) SKM_sk_num(X509_VERIFY_PARAM, (st))
+# define sk_X509_VERIFY_PARAM_value(st, i) SKM_sk_value(X509_VERIFY_PARAM, (st), (i))
+# define sk_X509_VERIFY_PARAM_set(st, i, val) SKM_sk_set(X509_VERIFY_PARAM, (st), (i), (val))
+# define sk_X509_VERIFY_PARAM_zero(st) SKM_sk_zero(X509_VERIFY_PARAM, (st))
+# define sk_X509_VERIFY_PARAM_push(st, val) SKM_sk_push(X509_VERIFY_PARAM, (st), (val))
+# define sk_X509_VERIFY_PARAM_unshift(st, val) SKM_sk_unshift(X509_VERIFY_PARAM, (st), (val))
+# define sk_X509_VERIFY_PARAM_find(st, val) SKM_sk_find(X509_VERIFY_PARAM, (st), (val))
+# define sk_X509_VERIFY_PARAM_find_ex(st, val) SKM_sk_find_ex(X509_VERIFY_PARAM, (st), (val))
+# define sk_X509_VERIFY_PARAM_delete(st, i) SKM_sk_delete(X509_VERIFY_PARAM, (st), (i))
+# define sk_X509_VERIFY_PARAM_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_VERIFY_PARAM, (st), (ptr))
+# define sk_X509_VERIFY_PARAM_insert(st, val, i) SKM_sk_insert(X509_VERIFY_PARAM, (st), (val), (i))
+# define sk_X509_VERIFY_PARAM_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_VERIFY_PARAM, (st), (cmp))
+# define sk_X509_VERIFY_PARAM_dup(st) SKM_sk_dup(X509_VERIFY_PARAM, st)
+# define sk_X509_VERIFY_PARAM_pop_free(st, free_func) SKM_sk_pop_free(X509_VERIFY_PARAM, (st), (free_func))
+# define sk_X509_VERIFY_PARAM_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_VERIFY_PARAM, (st), (copy_func), (free_func))
+# define sk_X509_VERIFY_PARAM_shift(st) SKM_sk_shift(X509_VERIFY_PARAM, (st))
+# define sk_X509_VERIFY_PARAM_pop(st) SKM_sk_pop(X509_VERIFY_PARAM, (st))
+# define sk_X509_VERIFY_PARAM_sort(st) SKM_sk_sort(X509_VERIFY_PARAM, (st))
+# define sk_X509_VERIFY_PARAM_is_sorted(st) SKM_sk_is_sorted(X509_VERIFY_PARAM, (st))
+# define sk_nid_triple_new(cmp) SKM_sk_new(nid_triple, (cmp))
+# define sk_nid_triple_new_null() SKM_sk_new_null(nid_triple)
+# define sk_nid_triple_free(st) SKM_sk_free(nid_triple, (st))
+# define sk_nid_triple_num(st) SKM_sk_num(nid_triple, (st))
+# define sk_nid_triple_value(st, i) SKM_sk_value(nid_triple, (st), (i))
+# define sk_nid_triple_set(st, i, val) SKM_sk_set(nid_triple, (st), (i), (val))
+# define sk_nid_triple_zero(st) SKM_sk_zero(nid_triple, (st))
+# define sk_nid_triple_push(st, val) SKM_sk_push(nid_triple, (st), (val))
+# define sk_nid_triple_unshift(st, val) SKM_sk_unshift(nid_triple, (st), (val))
+# define sk_nid_triple_find(st, val) SKM_sk_find(nid_triple, (st), (val))
+# define sk_nid_triple_find_ex(st, val) SKM_sk_find_ex(nid_triple, (st), (val))
+# define sk_nid_triple_delete(st, i) SKM_sk_delete(nid_triple, (st), (i))
+# define sk_nid_triple_delete_ptr(st, ptr) SKM_sk_delete_ptr(nid_triple, (st), (ptr))
+# define sk_nid_triple_insert(st, val, i) SKM_sk_insert(nid_triple, (st), (val), (i))
+# define sk_nid_triple_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(nid_triple, (st), (cmp))
+# define sk_nid_triple_dup(st) SKM_sk_dup(nid_triple, st)
+# define sk_nid_triple_pop_free(st, free_func) SKM_sk_pop_free(nid_triple, (st), (free_func))
+# define sk_nid_triple_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(nid_triple, (st), (copy_func), (free_func))
+# define sk_nid_triple_shift(st) SKM_sk_shift(nid_triple, (st))
+# define sk_nid_triple_pop(st) SKM_sk_pop(nid_triple, (st))
+# define sk_nid_triple_sort(st) SKM_sk_sort(nid_triple, (st))
+# define sk_nid_triple_is_sorted(st) SKM_sk_is_sorted(nid_triple, (st))
+# define sk_void_new(cmp) SKM_sk_new(void, (cmp))
+# define sk_void_new_null() SKM_sk_new_null(void)
+# define sk_void_free(st) SKM_sk_free(void, (st))
+# define sk_void_num(st) SKM_sk_num(void, (st))
+# define sk_void_value(st, i) SKM_sk_value(void, (st), (i))
+# define sk_void_set(st, i, val) SKM_sk_set(void, (st), (i), (val))
+# define sk_void_zero(st) SKM_sk_zero(void, (st))
+# define sk_void_push(st, val) SKM_sk_push(void, (st), (val))
+# define sk_void_unshift(st, val) SKM_sk_unshift(void, (st), (val))
+# define sk_void_find(st, val) SKM_sk_find(void, (st), (val))
+# define sk_void_find_ex(st, val) SKM_sk_find_ex(void, (st), (val))
+# define sk_void_delete(st, i) SKM_sk_delete(void, (st), (i))
+# define sk_void_delete_ptr(st, ptr) SKM_sk_delete_ptr(void, (st), (ptr))
+# define sk_void_insert(st, val, i) SKM_sk_insert(void, (st), (val), (i))
+# define sk_void_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(void, (st), (cmp))
+# define sk_void_dup(st) SKM_sk_dup(void, st)
+# define sk_void_pop_free(st, free_func) SKM_sk_pop_free(void, (st), (free_func))
+# define sk_void_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(void, (st), (copy_func), (free_func))
+# define sk_void_shift(st) SKM_sk_shift(void, (st))
+# define sk_void_pop(st) SKM_sk_pop(void, (st))
+# define sk_void_sort(st) SKM_sk_sort(void, (st))
+# define sk_void_is_sorted(st) SKM_sk_is_sorted(void, (st))
+# define sk_OPENSSL_STRING_new(cmp) ((STACK_OF(OPENSSL_STRING) *)sk_new(CHECKED_SK_CMP_FUNC(char, cmp)))
+# define sk_OPENSSL_STRING_new_null() ((STACK_OF(OPENSSL_STRING) *)sk_new_null())
+# define sk_OPENSSL_STRING_push(st, val) sk_push(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_PTR_OF(char, val))
+# define sk_OPENSSL_STRING_find(st, val) sk_find(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_PTR_OF(char, val))
+# define sk_OPENSSL_STRING_value(st, i) ((OPENSSL_STRING)sk_value(CHECKED_STACK_OF(OPENSSL_STRING, st), i))
+# define sk_OPENSSL_STRING_num(st) SKM_sk_num(OPENSSL_STRING, st)
+# define sk_OPENSSL_STRING_pop_free(st, free_func) sk_pop_free(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_SK_FREE_FUNC(char, free_func))
+# define sk_OPENSSL_STRING_deep_copy(st, copy_func, free_func) ((STACK_OF(OPENSSL_STRING) *)sk_deep_copy(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_SK_COPY_FUNC(char, copy_func), CHECKED_SK_FREE_FUNC(char, free_func)))
+# define sk_OPENSSL_STRING_insert(st, val, i) sk_insert(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_PTR_OF(char, val), i)
+# define sk_OPENSSL_STRING_free(st) SKM_sk_free(OPENSSL_STRING, st)
+# define sk_OPENSSL_STRING_set(st, i, val) sk_set(CHECKED_STACK_OF(OPENSSL_STRING, st), i, CHECKED_PTR_OF(char, val))
+# define sk_OPENSSL_STRING_zero(st) SKM_sk_zero(OPENSSL_STRING, (st))
+# define sk_OPENSSL_STRING_unshift(st, val) sk_unshift(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_PTR_OF(char, val))
+# define sk_OPENSSL_STRING_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_CONST_PTR_OF(char, val))
+# define sk_OPENSSL_STRING_delete(st, i) SKM_sk_delete(OPENSSL_STRING, (st), (i))
+# define sk_OPENSSL_STRING_delete_ptr(st, ptr) (OPENSSL_STRING *)sk_delete_ptr(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_PTR_OF(char, ptr))
+# define sk_OPENSSL_STRING_set_cmp_func(st, cmp) \
+ ((int (*)(const char * const *,const char * const *)) \
+ sk_set_cmp_func(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_SK_CMP_FUNC(char, cmp)))
+# define sk_OPENSSL_STRING_dup(st) SKM_sk_dup(OPENSSL_STRING, st)
+# define sk_OPENSSL_STRING_shift(st) SKM_sk_shift(OPENSSL_STRING, (st))
+# define sk_OPENSSL_STRING_pop(st) (char *)sk_pop(CHECKED_STACK_OF(OPENSSL_STRING, st))
+# define sk_OPENSSL_STRING_sort(st) SKM_sk_sort(OPENSSL_STRING, (st))
+# define sk_OPENSSL_STRING_is_sorted(st) SKM_sk_is_sorted(OPENSSL_STRING, (st))
+# define sk_OPENSSL_BLOCK_new(cmp) ((STACK_OF(OPENSSL_BLOCK) *)sk_new(CHECKED_SK_CMP_FUNC(void, cmp)))
+# define sk_OPENSSL_BLOCK_new_null() ((STACK_OF(OPENSSL_BLOCK) *)sk_new_null())
+# define sk_OPENSSL_BLOCK_push(st, val) sk_push(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_PTR_OF(void, val))
+# define sk_OPENSSL_BLOCK_find(st, val) sk_find(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_PTR_OF(void, val))
+# define sk_OPENSSL_BLOCK_value(st, i) ((OPENSSL_BLOCK)sk_value(CHECKED_STACK_OF(OPENSSL_BLOCK, st), i))
+# define sk_OPENSSL_BLOCK_num(st) SKM_sk_num(OPENSSL_BLOCK, st)
+# define sk_OPENSSL_BLOCK_pop_free(st, free_func) sk_pop_free(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_SK_FREE_FUNC(void, free_func))
+# define sk_OPENSSL_BLOCK_deep_copy(st, copy_func, free_func) ((STACK_OF(OPENSSL_BLOCK) *)sk_deep_copy(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_SK_COPY_FUNC(void, copy_func), CHECKED_SK_FREE_FUNC(void, free_func)))
+# define sk_OPENSSL_BLOCK_insert(st, val, i) sk_insert(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_PTR_OF(void, val), i)
+# define sk_OPENSSL_BLOCK_free(st) SKM_sk_free(OPENSSL_BLOCK, st)
+# define sk_OPENSSL_BLOCK_set(st, i, val) sk_set(CHECKED_STACK_OF(OPENSSL_BLOCK, st), i, CHECKED_PTR_OF(void, val))
+# define sk_OPENSSL_BLOCK_zero(st) SKM_sk_zero(OPENSSL_BLOCK, (st))
+# define sk_OPENSSL_BLOCK_unshift(st, val) sk_unshift(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_PTR_OF(void, val))
+# define sk_OPENSSL_BLOCK_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF(OPENSSL_BLOCK), st), CHECKED_CONST_PTR_OF(void, val))
+# define sk_OPENSSL_BLOCK_delete(st, i) SKM_sk_delete(OPENSSL_BLOCK, (st), (i))
+# define sk_OPENSSL_BLOCK_delete_ptr(st, ptr) (OPENSSL_BLOCK *)sk_delete_ptr(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_PTR_OF(void, ptr))
+# define sk_OPENSSL_BLOCK_set_cmp_func(st, cmp) \
+ ((int (*)(const void * const *,const void * const *)) \
+ sk_set_cmp_func(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_SK_CMP_FUNC(void, cmp)))
+# define sk_OPENSSL_BLOCK_dup(st) SKM_sk_dup(OPENSSL_BLOCK, st)
+# define sk_OPENSSL_BLOCK_shift(st) SKM_sk_shift(OPENSSL_BLOCK, (st))
+# define sk_OPENSSL_BLOCK_pop(st) (void *)sk_pop(CHECKED_STACK_OF(OPENSSL_BLOCK, st))
+# define sk_OPENSSL_BLOCK_sort(st) SKM_sk_sort(OPENSSL_BLOCK, (st))
+# define sk_OPENSSL_BLOCK_is_sorted(st) SKM_sk_is_sorted(OPENSSL_BLOCK, (st))
+# define sk_OPENSSL_PSTRING_new(cmp) ((STACK_OF(OPENSSL_PSTRING) *)sk_new(CHECKED_SK_CMP_FUNC(OPENSSL_STRING, cmp)))
+# define sk_OPENSSL_PSTRING_new_null() ((STACK_OF(OPENSSL_PSTRING) *)sk_new_null())
+# define sk_OPENSSL_PSTRING_push(st, val) sk_push(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, val))
+# define sk_OPENSSL_PSTRING_find(st, val) sk_find(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, val))
+# define sk_OPENSSL_PSTRING_value(st, i) ((OPENSSL_PSTRING)sk_value(CHECKED_STACK_OF(OPENSSL_PSTRING, st), i))
+# define sk_OPENSSL_PSTRING_num(st) SKM_sk_num(OPENSSL_PSTRING, st)
+# define sk_OPENSSL_PSTRING_pop_free(st, free_func) sk_pop_free(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_SK_FREE_FUNC(OPENSSL_STRING, free_func))
+# define sk_OPENSSL_PSTRING_deep_copy(st, copy_func, free_func) ((STACK_OF(OPENSSL_PSTRING) *)sk_deep_copy(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_SK_COPY_FUNC(OPENSSL_STRING, copy_func), CHECKED_SK_FREE_FUNC(OPENSSL_STRING, free_func)))
+# define sk_OPENSSL_PSTRING_insert(st, val, i) sk_insert(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, val), i)
+# define sk_OPENSSL_PSTRING_free(st) SKM_sk_free(OPENSSL_PSTRING, st)
+# define sk_OPENSSL_PSTRING_set(st, i, val) sk_set(CHECKED_STACK_OF(OPENSSL_PSTRING, st), i, CHECKED_PTR_OF(OPENSSL_STRING, val))
+# define sk_OPENSSL_PSTRING_zero(st) SKM_sk_zero(OPENSSL_PSTRING, (st))
+# define sk_OPENSSL_PSTRING_unshift(st, val) sk_unshift(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, val))
+# define sk_OPENSSL_PSTRING_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF(OPENSSL_PSTRING), st), CHECKED_CONST_PTR_OF(OPENSSL_STRING, val))
+# define sk_OPENSSL_PSTRING_delete(st, i) SKM_sk_delete(OPENSSL_PSTRING, (st), (i))
+# define sk_OPENSSL_PSTRING_delete_ptr(st, ptr) (OPENSSL_PSTRING *)sk_delete_ptr(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, ptr))
+# define sk_OPENSSL_PSTRING_set_cmp_func(st, cmp) \
+ ((int (*)(const OPENSSL_STRING * const *,const OPENSSL_STRING * const *)) \
+ sk_set_cmp_func(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_SK_CMP_FUNC(OPENSSL_STRING, cmp)))
+# define sk_OPENSSL_PSTRING_dup(st) SKM_sk_dup(OPENSSL_PSTRING, st)
+# define sk_OPENSSL_PSTRING_shift(st) SKM_sk_shift(OPENSSL_PSTRING, (st))
+# define sk_OPENSSL_PSTRING_pop(st) (OPENSSL_STRING *)sk_pop(CHECKED_STACK_OF(OPENSSL_PSTRING, st))
+# define sk_OPENSSL_PSTRING_sort(st) SKM_sk_sort(OPENSSL_PSTRING, (st))
+# define sk_OPENSSL_PSTRING_is_sorted(st) SKM_sk_is_sorted(OPENSSL_PSTRING, (st))
+# define d2i_ASN1_SET_OF_ACCESS_DESCRIPTION(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(ACCESS_DESCRIPTION, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_ACCESS_DESCRIPTION(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(ACCESS_DESCRIPTION, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_ACCESS_DESCRIPTION(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(ACCESS_DESCRIPTION, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_ACCESS_DESCRIPTION(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(ACCESS_DESCRIPTION, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_ASN1_INTEGER(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(ASN1_INTEGER, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_ASN1_INTEGER(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(ASN1_INTEGER, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_ASN1_INTEGER(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(ASN1_INTEGER, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_ASN1_INTEGER(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(ASN1_INTEGER, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_ASN1_OBJECT(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(ASN1_OBJECT, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_ASN1_OBJECT(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(ASN1_OBJECT, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_ASN1_OBJECT(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(ASN1_OBJECT, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_ASN1_OBJECT(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(ASN1_OBJECT, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_ASN1_TYPE(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(ASN1_TYPE, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_ASN1_TYPE(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(ASN1_TYPE, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_ASN1_TYPE(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(ASN1_TYPE, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_ASN1_TYPE(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(ASN1_TYPE, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_ASN1_UTF8STRING(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(ASN1_UTF8STRING, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_ASN1_UTF8STRING(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(ASN1_UTF8STRING, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_ASN1_UTF8STRING(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(ASN1_UTF8STRING, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_ASN1_UTF8STRING(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(ASN1_UTF8STRING, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_DIST_POINT(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(DIST_POINT, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_DIST_POINT(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(DIST_POINT, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_DIST_POINT(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(DIST_POINT, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_DIST_POINT(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(DIST_POINT, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_ESS_CERT_ID(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(ESS_CERT_ID, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_ESS_CERT_ID(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(ESS_CERT_ID, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_ESS_CERT_ID(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(ESS_CERT_ID, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_ESS_CERT_ID(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(ESS_CERT_ID, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_EVP_MD(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(EVP_MD, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_EVP_MD(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(EVP_MD, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_EVP_MD(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(EVP_MD, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_EVP_MD(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(EVP_MD, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_GENERAL_NAME(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(GENERAL_NAME, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_GENERAL_NAME(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(GENERAL_NAME, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_GENERAL_NAME(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(GENERAL_NAME, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_GENERAL_NAME(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(GENERAL_NAME, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_OCSP_ONEREQ(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(OCSP_ONEREQ, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_OCSP_ONEREQ(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(OCSP_ONEREQ, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_OCSP_ONEREQ(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(OCSP_ONEREQ, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_OCSP_ONEREQ(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(OCSP_ONEREQ, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_OCSP_SINGLERESP(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(OCSP_SINGLERESP, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_OCSP_SINGLERESP(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(OCSP_SINGLERESP, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_OCSP_SINGLERESP(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(OCSP_SINGLERESP, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_OCSP_SINGLERESP(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(OCSP_SINGLERESP, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_PKCS12_SAFEBAG(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(PKCS12_SAFEBAG, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_PKCS12_SAFEBAG(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(PKCS12_SAFEBAG, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_PKCS12_SAFEBAG(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(PKCS12_SAFEBAG, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_PKCS12_SAFEBAG(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(PKCS12_SAFEBAG, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_PKCS7(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(PKCS7, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_PKCS7(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(PKCS7, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_PKCS7(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(PKCS7, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_PKCS7(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(PKCS7, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_PKCS7_RECIP_INFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(PKCS7_RECIP_INFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_PKCS7_RECIP_INFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(PKCS7_RECIP_INFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_PKCS7_RECIP_INFO(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(PKCS7_RECIP_INFO, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_PKCS7_RECIP_INFO(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(PKCS7_RECIP_INFO, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(PKCS7_SIGNER_INFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(PKCS7_SIGNER_INFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_PKCS7_SIGNER_INFO(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(PKCS7_SIGNER_INFO, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_PKCS7_SIGNER_INFO(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(PKCS7_SIGNER_INFO, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_POLICYINFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(POLICYINFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_POLICYINFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(POLICYINFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_POLICYINFO(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(POLICYINFO, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_POLICYINFO(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(POLICYINFO, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_POLICYQUALINFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(POLICYQUALINFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_POLICYQUALINFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(POLICYQUALINFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_POLICYQUALINFO(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(POLICYQUALINFO, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_POLICYQUALINFO(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(POLICYQUALINFO, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_SXNETID(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(SXNETID, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_SXNETID(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(SXNETID, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_SXNETID(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(SXNETID, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_SXNETID(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(SXNETID, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_X509(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(X509, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_X509(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(X509, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_X509(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(X509, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_X509(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(X509, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_X509_ALGOR(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(X509_ALGOR, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_X509_ALGOR(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(X509_ALGOR, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_X509_ALGOR(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(X509_ALGOR, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_X509_ALGOR(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(X509_ALGOR, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_X509_ATTRIBUTE(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(X509_ATTRIBUTE, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_X509_ATTRIBUTE(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(X509_ATTRIBUTE, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_X509_ATTRIBUTE(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(X509_ATTRIBUTE, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_X509_ATTRIBUTE(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(X509_ATTRIBUTE, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_X509_CRL(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(X509_CRL, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_X509_CRL(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(X509_CRL, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_X509_CRL(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(X509_CRL, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_X509_CRL(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(X509_CRL, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_X509_EXTENSION(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(X509_EXTENSION, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_X509_EXTENSION(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(X509_EXTENSION, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_X509_EXTENSION(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(X509_EXTENSION, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_X509_EXTENSION(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(X509_EXTENSION, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_X509_NAME_ENTRY(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(X509_NAME_ENTRY, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_X509_NAME_ENTRY(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(X509_NAME_ENTRY, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_X509_NAME_ENTRY(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(X509_NAME_ENTRY, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_X509_NAME_ENTRY(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(X509_NAME_ENTRY, (buf), (len), (d2i_func), (free_func))
+# define d2i_ASN1_SET_OF_X509_REVOKED(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ SKM_ASN1_SET_OF_d2i(X509_REVOKED, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
+# define i2d_ASN1_SET_OF_X509_REVOKED(st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ SKM_ASN1_SET_OF_i2d(X509_REVOKED, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
+# define ASN1_seq_pack_X509_REVOKED(st, i2d_func, buf, len) \
+ SKM_ASN1_seq_pack(X509_REVOKED, (st), (i2d_func), (buf), (len))
+# define ASN1_seq_unpack_X509_REVOKED(buf, len, d2i_func, free_func) \
+ SKM_ASN1_seq_unpack(X509_REVOKED, (buf), (len), (d2i_func), (free_func))
+# define PKCS12_decrypt_d2i_PKCS12_SAFEBAG(algor, d2i_func, free_func, pass, passlen, oct, seq) \
+ SKM_PKCS12_decrypt_d2i(PKCS12_SAFEBAG, (algor), (d2i_func), (free_func), (pass), (passlen), (oct), (seq))
+# define PKCS12_decrypt_d2i_PKCS7(algor, d2i_func, free_func, pass, passlen, oct, seq) \
+ SKM_PKCS12_decrypt_d2i(PKCS7, (algor), (d2i_func), (free_func), (pass), (passlen), (oct), (seq))
+# define lh_ADDED_OBJ_new() LHM_lh_new(ADDED_OBJ,added_obj)
+# define lh_ADDED_OBJ_insert(lh,inst) LHM_lh_insert(ADDED_OBJ,lh,inst)
+# define lh_ADDED_OBJ_retrieve(lh,inst) LHM_lh_retrieve(ADDED_OBJ,lh,inst)
+# define lh_ADDED_OBJ_delete(lh,inst) LHM_lh_delete(ADDED_OBJ,lh,inst)
+# define lh_ADDED_OBJ_doall(lh,fn) LHM_lh_doall(ADDED_OBJ,lh,fn)
+# define lh_ADDED_OBJ_doall_arg(lh,fn,arg_type,arg) \
+ LHM_lh_doall_arg(ADDED_OBJ,lh,fn,arg_type,arg)
+# define lh_ADDED_OBJ_error(lh) LHM_lh_error(ADDED_OBJ,lh)
+# define lh_ADDED_OBJ_num_items(lh) LHM_lh_num_items(ADDED_OBJ,lh)
+# define lh_ADDED_OBJ_down_load(lh) LHM_lh_down_load(ADDED_OBJ,lh)
+# define lh_ADDED_OBJ_node_stats_bio(lh,out) \
+ LHM_lh_node_stats_bio(ADDED_OBJ,lh,out)
+# define lh_ADDED_OBJ_node_usage_stats_bio(lh,out) \
+ LHM_lh_node_usage_stats_bio(ADDED_OBJ,lh,out)
+# define lh_ADDED_OBJ_stats_bio(lh,out) \
+ LHM_lh_stats_bio(ADDED_OBJ,lh,out)
+# define lh_ADDED_OBJ_free(lh) LHM_lh_free(ADDED_OBJ,lh)
+# define lh_APP_INFO_new() LHM_lh_new(APP_INFO,app_info)
+# define lh_APP_INFO_insert(lh,inst) LHM_lh_insert(APP_INFO,lh,inst)
+# define lh_APP_INFO_retrieve(lh,inst) LHM_lh_retrieve(APP_INFO,lh,inst)
+# define lh_APP_INFO_delete(lh,inst) LHM_lh_delete(APP_INFO,lh,inst)
+# define lh_APP_INFO_doall(lh,fn) LHM_lh_doall(APP_INFO,lh,fn)
+# define lh_APP_INFO_doall_arg(lh,fn,arg_type,arg) \
+ LHM_lh_doall_arg(APP_INFO,lh,fn,arg_type,arg)
+# define lh_APP_INFO_error(lh) LHM_lh_error(APP_INFO,lh)
+# define lh_APP_INFO_num_items(lh) LHM_lh_num_items(APP_INFO,lh)
+# define lh_APP_INFO_down_load(lh) LHM_lh_down_load(APP_INFO,lh)
+# define lh_APP_INFO_node_stats_bio(lh,out) \
+ LHM_lh_node_stats_bio(APP_INFO,lh,out)
+# define lh_APP_INFO_node_usage_stats_bio(lh,out) \
+ LHM_lh_node_usage_stats_bio(APP_INFO,lh,out)
+# define lh_APP_INFO_stats_bio(lh,out) \
+ LHM_lh_stats_bio(APP_INFO,lh,out)
+# define lh_APP_INFO_free(lh) LHM_lh_free(APP_INFO,lh)
+# define lh_CONF_VALUE_new() LHM_lh_new(CONF_VALUE,conf_value)
+# define lh_CONF_VALUE_insert(lh,inst) LHM_lh_insert(CONF_VALUE,lh,inst)
+# define lh_CONF_VALUE_retrieve(lh,inst) LHM_lh_retrieve(CONF_VALUE,lh,inst)
+# define lh_CONF_VALUE_delete(lh,inst) LHM_lh_delete(CONF_VALUE,lh,inst)
+# define lh_CONF_VALUE_doall(lh,fn) LHM_lh_doall(CONF_VALUE,lh,fn)
+# define lh_CONF_VALUE_doall_arg(lh,fn,arg_type,arg) \
+ LHM_lh_doall_arg(CONF_VALUE,lh,fn,arg_type,arg)
+# define lh_CONF_VALUE_error(lh) LHM_lh_error(CONF_VALUE,lh)
+# define lh_CONF_VALUE_num_items(lh) LHM_lh_num_items(CONF_VALUE,lh)
+# define lh_CONF_VALUE_down_load(lh) LHM_lh_down_load(CONF_VALUE,lh)
+# define lh_CONF_VALUE_node_stats_bio(lh,out) \
+ LHM_lh_node_stats_bio(CONF_VALUE,lh,out)
+# define lh_CONF_VALUE_node_usage_stats_bio(lh,out) \
+ LHM_lh_node_usage_stats_bio(CONF_VALUE,lh,out)
+# define lh_CONF_VALUE_stats_bio(lh,out) \
+ LHM_lh_stats_bio(CONF_VALUE,lh,out)
+# define lh_CONF_VALUE_free(lh) LHM_lh_free(CONF_VALUE,lh)
+# define lh_ENGINE_PILE_new() LHM_lh_new(ENGINE_PILE,engine_pile)
+# define lh_ENGINE_PILE_insert(lh,inst) LHM_lh_insert(ENGINE_PILE,lh,inst)
+# define lh_ENGINE_PILE_retrieve(lh,inst) LHM_lh_retrieve(ENGINE_PILE,lh,inst)
+# define lh_ENGINE_PILE_delete(lh,inst) LHM_lh_delete(ENGINE_PILE,lh,inst)
+# define lh_ENGINE_PILE_doall(lh,fn) LHM_lh_doall(ENGINE_PILE,lh,fn)
+# define lh_ENGINE_PILE_doall_arg(lh,fn,arg_type,arg) \
+ LHM_lh_doall_arg(ENGINE_PILE,lh,fn,arg_type,arg)
+# define lh_ENGINE_PILE_error(lh) LHM_lh_error(ENGINE_PILE,lh)
+# define lh_ENGINE_PILE_num_items(lh) LHM_lh_num_items(ENGINE_PILE,lh)
+# define lh_ENGINE_PILE_down_load(lh) LHM_lh_down_load(ENGINE_PILE,lh)
+# define lh_ENGINE_PILE_node_stats_bio(lh,out) \
+ LHM_lh_node_stats_bio(ENGINE_PILE,lh,out)
+# define lh_ENGINE_PILE_node_usage_stats_bio(lh,out) \
+ LHM_lh_node_usage_stats_bio(ENGINE_PILE,lh,out)
+# define lh_ENGINE_PILE_stats_bio(lh,out) \
+ LHM_lh_stats_bio(ENGINE_PILE,lh,out)
+# define lh_ENGINE_PILE_free(lh) LHM_lh_free(ENGINE_PILE,lh)
+# define lh_ERR_STATE_new() LHM_lh_new(ERR_STATE,err_state)
+# define lh_ERR_STATE_insert(lh,inst) LHM_lh_insert(ERR_STATE,lh,inst)
+# define lh_ERR_STATE_retrieve(lh,inst) LHM_lh_retrieve(ERR_STATE,lh,inst)
+# define lh_ERR_STATE_delete(lh,inst) LHM_lh_delete(ERR_STATE,lh,inst)
+# define lh_ERR_STATE_doall(lh,fn) LHM_lh_doall(ERR_STATE,lh,fn)
+# define lh_ERR_STATE_doall_arg(lh,fn,arg_type,arg) \
+ LHM_lh_doall_arg(ERR_STATE,lh,fn,arg_type,arg)
+# define lh_ERR_STATE_error(lh) LHM_lh_error(ERR_STATE,lh)
+# define lh_ERR_STATE_num_items(lh) LHM_lh_num_items(ERR_STATE,lh)
+# define lh_ERR_STATE_down_load(lh) LHM_lh_down_load(ERR_STATE,lh)
+# define lh_ERR_STATE_node_stats_bio(lh,out) \
+ LHM_lh_node_stats_bio(ERR_STATE,lh,out)
+# define lh_ERR_STATE_node_usage_stats_bio(lh,out) \
+ LHM_lh_node_usage_stats_bio(ERR_STATE,lh,out)
+# define lh_ERR_STATE_stats_bio(lh,out) \
+ LHM_lh_stats_bio(ERR_STATE,lh,out)
+# define lh_ERR_STATE_free(lh) LHM_lh_free(ERR_STATE,lh)
+# define lh_ERR_STRING_DATA_new() LHM_lh_new(ERR_STRING_DATA,err_string_data)
+# define lh_ERR_STRING_DATA_insert(lh,inst) LHM_lh_insert(ERR_STRING_DATA,lh,inst)
+# define lh_ERR_STRING_DATA_retrieve(lh,inst) LHM_lh_retrieve(ERR_STRING_DATA,lh,inst)
+# define lh_ERR_STRING_DATA_delete(lh,inst) LHM_lh_delete(ERR_STRING_DATA,lh,inst)
+# define lh_ERR_STRING_DATA_doall(lh,fn) LHM_lh_doall(ERR_STRING_DATA,lh,fn)
+# define lh_ERR_STRING_DATA_doall_arg(lh,fn,arg_type,arg) \
+ LHM_lh_doall_arg(ERR_STRING_DATA,lh,fn,arg_type,arg)
+# define lh_ERR_STRING_DATA_error(lh) LHM_lh_error(ERR_STRING_DATA,lh)
+# define lh_ERR_STRING_DATA_num_items(lh) LHM_lh_num_items(ERR_STRING_DATA,lh)
+# define lh_ERR_STRING_DATA_down_load(lh) LHM_lh_down_load(ERR_STRING_DATA,lh)
+# define lh_ERR_STRING_DATA_node_stats_bio(lh,out) \
+ LHM_lh_node_stats_bio(ERR_STRING_DATA,lh,out)
+# define lh_ERR_STRING_DATA_node_usage_stats_bio(lh,out) \
+ LHM_lh_node_usage_stats_bio(ERR_STRING_DATA,lh,out)
+# define lh_ERR_STRING_DATA_stats_bio(lh,out) \
+ LHM_lh_stats_bio(ERR_STRING_DATA,lh,out)
+# define lh_ERR_STRING_DATA_free(lh) LHM_lh_free(ERR_STRING_DATA,lh)
+# define lh_EX_CLASS_ITEM_new() LHM_lh_new(EX_CLASS_ITEM,ex_class_item)
+# define lh_EX_CLASS_ITEM_insert(lh,inst) LHM_lh_insert(EX_CLASS_ITEM,lh,inst)
+# define lh_EX_CLASS_ITEM_retrieve(lh,inst) LHM_lh_retrieve(EX_CLASS_ITEM,lh,inst)
+# define lh_EX_CLASS_ITEM_delete(lh,inst) LHM_lh_delete(EX_CLASS_ITEM,lh,inst)
+# define lh_EX_CLASS_ITEM_doall(lh,fn) LHM_lh_doall(EX_CLASS_ITEM,lh,fn)
+# define lh_EX_CLASS_ITEM_doall_arg(lh,fn,arg_type,arg) \
+ LHM_lh_doall_arg(EX_CLASS_ITEM,lh,fn,arg_type,arg)
+# define lh_EX_CLASS_ITEM_error(lh) LHM_lh_error(EX_CLASS_ITEM,lh)
+# define lh_EX_CLASS_ITEM_num_items(lh) LHM_lh_num_items(EX_CLASS_ITEM,lh)
+# define lh_EX_CLASS_ITEM_down_load(lh) LHM_lh_down_load(EX_CLASS_ITEM,lh)
+# define lh_EX_CLASS_ITEM_node_stats_bio(lh,out) \
+ LHM_lh_node_stats_bio(EX_CLASS_ITEM,lh,out)
+# define lh_EX_CLASS_ITEM_node_usage_stats_bio(lh,out) \
+ LHM_lh_node_usage_stats_bio(EX_CLASS_ITEM,lh,out)
+# define lh_EX_CLASS_ITEM_stats_bio(lh,out) \
+ LHM_lh_stats_bio(EX_CLASS_ITEM,lh,out)
+# define lh_EX_CLASS_ITEM_free(lh) LHM_lh_free(EX_CLASS_ITEM,lh)
+# define lh_FUNCTION_new() LHM_lh_new(FUNCTION,function)
+# define lh_FUNCTION_insert(lh,inst) LHM_lh_insert(FUNCTION,lh,inst)
+# define lh_FUNCTION_retrieve(lh,inst) LHM_lh_retrieve(FUNCTION,lh,inst)
+# define lh_FUNCTION_delete(lh,inst) LHM_lh_delete(FUNCTION,lh,inst)
+# define lh_FUNCTION_doall(lh,fn) LHM_lh_doall(FUNCTION,lh,fn)
+# define lh_FUNCTION_doall_arg(lh,fn,arg_type,arg) \
+ LHM_lh_doall_arg(FUNCTION,lh,fn,arg_type,arg)
+# define lh_FUNCTION_error(lh) LHM_lh_error(FUNCTION,lh)
+# define lh_FUNCTION_num_items(lh) LHM_lh_num_items(FUNCTION,lh)
+# define lh_FUNCTION_down_load(lh) LHM_lh_down_load(FUNCTION,lh)
+# define lh_FUNCTION_node_stats_bio(lh,out) \
+ LHM_lh_node_stats_bio(FUNCTION,lh,out)
+# define lh_FUNCTION_node_usage_stats_bio(lh,out) \
+ LHM_lh_node_usage_stats_bio(FUNCTION,lh,out)
+# define lh_FUNCTION_stats_bio(lh,out) \
+ LHM_lh_stats_bio(FUNCTION,lh,out)
+# define lh_FUNCTION_free(lh) LHM_lh_free(FUNCTION,lh)
+# define lh_MEM_new() LHM_lh_new(MEM,mem)
+# define lh_MEM_insert(lh,inst) LHM_lh_insert(MEM,lh,inst)
+# define lh_MEM_retrieve(lh,inst) LHM_lh_retrieve(MEM,lh,inst)
+# define lh_MEM_delete(lh,inst) LHM_lh_delete(MEM,lh,inst)
+# define lh_MEM_doall(lh,fn) LHM_lh_doall(MEM,lh,fn)
+# define lh_MEM_doall_arg(lh,fn,arg_type,arg) \
+ LHM_lh_doall_arg(MEM,lh,fn,arg_type,arg)
+# define lh_MEM_error(lh) LHM_lh_error(MEM,lh)
+# define lh_MEM_num_items(lh) LHM_lh_num_items(MEM,lh)
+# define lh_MEM_down_load(lh) LHM_lh_down_load(MEM,lh)
+# define lh_MEM_node_stats_bio(lh,out) \
+ LHM_lh_node_stats_bio(MEM,lh,out)
+# define lh_MEM_node_usage_stats_bio(lh,out) \
+ LHM_lh_node_usage_stats_bio(MEM,lh,out)
+# define lh_MEM_stats_bio(lh,out) \
+ LHM_lh_stats_bio(MEM,lh,out)
+# define lh_MEM_free(lh) LHM_lh_free(MEM,lh)
+# define lh_OBJ_NAME_new() LHM_lh_new(OBJ_NAME,obj_name)
+# define lh_OBJ_NAME_insert(lh,inst) LHM_lh_insert(OBJ_NAME,lh,inst)
+# define lh_OBJ_NAME_retrieve(lh,inst) LHM_lh_retrieve(OBJ_NAME,lh,inst)
+# define lh_OBJ_NAME_delete(lh,inst) LHM_lh_delete(OBJ_NAME,lh,inst)
+# define lh_OBJ_NAME_doall(lh,fn) LHM_lh_doall(OBJ_NAME,lh,fn)
+# define lh_OBJ_NAME_doall_arg(lh,fn,arg_type,arg) \
+ LHM_lh_doall_arg(OBJ_NAME,lh,fn,arg_type,arg)
+# define lh_OBJ_NAME_error(lh) LHM_lh_error(OBJ_NAME,lh)
+# define lh_OBJ_NAME_num_items(lh) LHM_lh_num_items(OBJ_NAME,lh)
+# define lh_OBJ_NAME_down_load(lh) LHM_lh_down_load(OBJ_NAME,lh)
+# define lh_OBJ_NAME_node_stats_bio(lh,out) \
+ LHM_lh_node_stats_bio(OBJ_NAME,lh,out)
+# define lh_OBJ_NAME_node_usage_stats_bio(lh,out) \
+ LHM_lh_node_usage_stats_bio(OBJ_NAME,lh,out)
+# define lh_OBJ_NAME_stats_bio(lh,out) \
+ LHM_lh_stats_bio(OBJ_NAME,lh,out)
+# define lh_OBJ_NAME_free(lh) LHM_lh_free(OBJ_NAME,lh)
+# define lh_OPENSSL_CSTRING_new() LHM_lh_new(OPENSSL_CSTRING,openssl_cstring)
+# define lh_OPENSSL_CSTRING_insert(lh,inst) LHM_lh_insert(OPENSSL_CSTRING,lh,inst)
+# define lh_OPENSSL_CSTRING_retrieve(lh,inst) LHM_lh_retrieve(OPENSSL_CSTRING,lh,inst)
+# define lh_OPENSSL_CSTRING_delete(lh,inst) LHM_lh_delete(OPENSSL_CSTRING,lh,inst)
+# define lh_OPENSSL_CSTRING_doall(lh,fn) LHM_lh_doall(OPENSSL_CSTRING,lh,fn)
+# define lh_OPENSSL_CSTRING_doall_arg(lh,fn,arg_type,arg) \
+ LHM_lh_doall_arg(OPENSSL_CSTRING,lh,fn,arg_type,arg)
+# define lh_OPENSSL_CSTRING_error(lh) LHM_lh_error(OPENSSL_CSTRING,lh)
+# define lh_OPENSSL_CSTRING_num_items(lh) LHM_lh_num_items(OPENSSL_CSTRING,lh)
+# define lh_OPENSSL_CSTRING_down_load(lh) LHM_lh_down_load(OPENSSL_CSTRING,lh)
+# define lh_OPENSSL_CSTRING_node_stats_bio(lh,out) \
+ LHM_lh_node_stats_bio(OPENSSL_CSTRING,lh,out)
+# define lh_OPENSSL_CSTRING_node_usage_stats_bio(lh,out) \
+ LHM_lh_node_usage_stats_bio(OPENSSL_CSTRING,lh,out)
+# define lh_OPENSSL_CSTRING_stats_bio(lh,out) \
+ LHM_lh_stats_bio(OPENSSL_CSTRING,lh,out)
+# define lh_OPENSSL_CSTRING_free(lh) LHM_lh_free(OPENSSL_CSTRING,lh)
+# define lh_OPENSSL_STRING_new() LHM_lh_new(OPENSSL_STRING,openssl_string)
+# define lh_OPENSSL_STRING_insert(lh,inst) LHM_lh_insert(OPENSSL_STRING,lh,inst)
+# define lh_OPENSSL_STRING_retrieve(lh,inst) LHM_lh_retrieve(OPENSSL_STRING,lh,inst)
+# define lh_OPENSSL_STRING_delete(lh,inst) LHM_lh_delete(OPENSSL_STRING,lh,inst)
+# define lh_OPENSSL_STRING_doall(lh,fn) LHM_lh_doall(OPENSSL_STRING,lh,fn)
+# define lh_OPENSSL_STRING_doall_arg(lh,fn,arg_type,arg) \
+ LHM_lh_doall_arg(OPENSSL_STRING,lh,fn,arg_type,arg)
+# define lh_OPENSSL_STRING_error(lh) LHM_lh_error(OPENSSL_STRING,lh)
+# define lh_OPENSSL_STRING_num_items(lh) LHM_lh_num_items(OPENSSL_STRING,lh)
+# define lh_OPENSSL_STRING_down_load(lh) LHM_lh_down_load(OPENSSL_STRING,lh)
+# define lh_OPENSSL_STRING_node_stats_bio(lh,out) \
+ LHM_lh_node_stats_bio(OPENSSL_STRING,lh,out)
+# define lh_OPENSSL_STRING_node_usage_stats_bio(lh,out) \
+ LHM_lh_node_usage_stats_bio(OPENSSL_STRING,lh,out)
+# define lh_OPENSSL_STRING_stats_bio(lh,out) \
+ LHM_lh_stats_bio(OPENSSL_STRING,lh,out)
+# define lh_OPENSSL_STRING_free(lh) LHM_lh_free(OPENSSL_STRING,lh)
+# define lh_SSL_SESSION_new() LHM_lh_new(SSL_SESSION,ssl_session)
+# define lh_SSL_SESSION_insert(lh,inst) LHM_lh_insert(SSL_SESSION,lh,inst)
+# define lh_SSL_SESSION_retrieve(lh,inst) LHM_lh_retrieve(SSL_SESSION,lh,inst)
+# define lh_SSL_SESSION_delete(lh,inst) LHM_lh_delete(SSL_SESSION,lh,inst)
+# define lh_SSL_SESSION_doall(lh,fn) LHM_lh_doall(SSL_SESSION,lh,fn)
+# define lh_SSL_SESSION_doall_arg(lh,fn,arg_type,arg) \
+ LHM_lh_doall_arg(SSL_SESSION,lh,fn,arg_type,arg)
+# define lh_SSL_SESSION_error(lh) LHM_lh_error(SSL_SESSION,lh)
+# define lh_SSL_SESSION_num_items(lh) LHM_lh_num_items(SSL_SESSION,lh)
+# define lh_SSL_SESSION_down_load(lh) LHM_lh_down_load(SSL_SESSION,lh)
+# define lh_SSL_SESSION_node_stats_bio(lh,out) \
+ LHM_lh_node_stats_bio(SSL_SESSION,lh,out)
+# define lh_SSL_SESSION_node_usage_stats_bio(lh,out) \
+ LHM_lh_node_usage_stats_bio(SSL_SESSION,lh,out)
+# define lh_SSL_SESSION_stats_bio(lh,out) \
+ LHM_lh_stats_bio(SSL_SESSION,lh,out)
+# define lh_SSL_SESSION_free(lh) LHM_lh_free(SSL_SESSION,lh)
+#ifdef __cplusplus
+}
+#endif
+#endif /* !defined HEADER_SAFESTACK_H */
diff --git a/deps/openssl/openssl/include/openssl/seed.h b/deps/openssl/openssl/include/openssl/seed.h
index bbbf596df86..8cbf0d9281b 100644
--- a/deps/openssl/openssl/include/openssl/seed.h
+++ b/deps/openssl/openssl/include/openssl/seed.h
@@ -1 +1,149 @@
-#include "../../crypto/seed/seed.h"
+/*
+ * Copyright (c) 2007 KISA(Korea Information Security Agency). All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Neither the name of author nor the names of its contributors may
+ * be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+/* ====================================================================
+ * Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+#ifndef HEADER_SEED_H
+# define HEADER_SEED_H
+
+# include <openssl/opensslconf.h>
+# include <openssl/e_os2.h>
+# include <openssl/crypto.h>
+
+# ifdef OPENSSL_NO_SEED
+# error SEED is disabled.
+# endif
+
+/* look whether we need 'long' to get 32 bits */
+# ifdef AES_LONG
+# ifndef SEED_LONG
+# define SEED_LONG 1
+# endif
+# endif
+
+# if !defined(NO_SYS_TYPES_H)
+# include <sys/types.h>
+# endif
+
+# define SEED_BLOCK_SIZE 16
+# define SEED_KEY_LENGTH 16
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct seed_key_st {
+# ifdef SEED_LONG
+ unsigned long data[32];
+# else
+ unsigned int data[32];
+# endif
+} SEED_KEY_SCHEDULE;
+
+# ifdef OPENSSL_FIPS
+void private_SEED_set_key(const unsigned char rawkey[SEED_KEY_LENGTH],
+ SEED_KEY_SCHEDULE *ks);
+# endif
+void SEED_set_key(const unsigned char rawkey[SEED_KEY_LENGTH],
+ SEED_KEY_SCHEDULE *ks);
+
+void SEED_encrypt(const unsigned char s[SEED_BLOCK_SIZE],
+ unsigned char d[SEED_BLOCK_SIZE],
+ const SEED_KEY_SCHEDULE *ks);
+void SEED_decrypt(const unsigned char s[SEED_BLOCK_SIZE],
+ unsigned char d[SEED_BLOCK_SIZE],
+ const SEED_KEY_SCHEDULE *ks);
+
+void SEED_ecb_encrypt(const unsigned char *in, unsigned char *out,
+ const SEED_KEY_SCHEDULE *ks, int enc);
+void SEED_cbc_encrypt(const unsigned char *in, unsigned char *out, size_t len,
+ const SEED_KEY_SCHEDULE *ks,
+ unsigned char ivec[SEED_BLOCK_SIZE], int enc);
+void SEED_cfb128_encrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const SEED_KEY_SCHEDULE *ks,
+ unsigned char ivec[SEED_BLOCK_SIZE], int *num,
+ int enc);
+void SEED_ofb128_encrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const SEED_KEY_SCHEDULE *ks,
+ unsigned char ivec[SEED_BLOCK_SIZE], int *num);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* HEADER_SEED_H */
diff --git a/deps/openssl/openssl/include/openssl/sha.h b/deps/openssl/openssl/include/openssl/sha.h
index ab9d94c3868..e5169e4fee0 100644
--- a/deps/openssl/openssl/include/openssl/sha.h
+++ b/deps/openssl/openssl/include/openssl/sha.h
@@ -1 +1,214 @@
-#include "../../crypto/sha/sha.h"
+/* crypto/sha/sha.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_SHA_H
+# define HEADER_SHA_H
+
+# include <openssl/e_os2.h>
+# include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# if defined(OPENSSL_NO_SHA) || (defined(OPENSSL_NO_SHA0) && defined(OPENSSL_NO_SHA1))
+# error SHA is disabled.
+# endif
+
+# if defined(OPENSSL_FIPS)
+# define FIPS_SHA_SIZE_T size_t
+# endif
+
+/*-
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ * ! SHA_LONG has to be at least 32 bits wide. If it's wider, then !
+ * ! SHA_LONG_LOG2 has to be defined along. !
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ */
+
+# if defined(__LP32__)
+# define SHA_LONG unsigned long
+# elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__)
+# define SHA_LONG unsigned long
+# define SHA_LONG_LOG2 3
+# else
+# define SHA_LONG unsigned int
+# endif
+
+# define SHA_LBLOCK 16
+# define SHA_CBLOCK (SHA_LBLOCK*4)/* SHA treats input data as a
+ * contiguous array of 32 bit wide
+ * big-endian values. */
+# define SHA_LAST_BLOCK (SHA_CBLOCK-8)
+# define SHA_DIGEST_LENGTH 20
+
+typedef struct SHAstate_st {
+ SHA_LONG h0, h1, h2, h3, h4;
+ SHA_LONG Nl, Nh;
+ SHA_LONG data[SHA_LBLOCK];
+ unsigned int num;
+} SHA_CTX;
+
+# ifndef OPENSSL_NO_SHA0
+# ifdef OPENSSL_FIPS
+int private_SHA_Init(SHA_CTX *c);
+# endif
+int SHA_Init(SHA_CTX *c);
+int SHA_Update(SHA_CTX *c, const void *data, size_t len);
+int SHA_Final(unsigned char *md, SHA_CTX *c);
+unsigned char *SHA(const unsigned char *d, size_t n, unsigned char *md);
+void SHA_Transform(SHA_CTX *c, const unsigned char *data);
+# endif
+# ifndef OPENSSL_NO_SHA1
+# ifdef OPENSSL_FIPS
+int private_SHA1_Init(SHA_CTX *c);
+# endif
+int SHA1_Init(SHA_CTX *c);
+int SHA1_Update(SHA_CTX *c, const void *data, size_t len);
+int SHA1_Final(unsigned char *md, SHA_CTX *c);
+unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md);
+void SHA1_Transform(SHA_CTX *c, const unsigned char *data);
+# endif
+
+# define SHA256_CBLOCK (SHA_LBLOCK*4)/* SHA-256 treats input data as a
+ * contiguous array of 32 bit wide
+ * big-endian values. */
+# define SHA224_DIGEST_LENGTH 28
+# define SHA256_DIGEST_LENGTH 32
+
+typedef struct SHA256state_st {
+ SHA_LONG h[8];
+ SHA_LONG Nl, Nh;
+ SHA_LONG data[SHA_LBLOCK];
+ unsigned int num, md_len;
+} SHA256_CTX;
+
+# ifndef OPENSSL_NO_SHA256
+# ifdef OPENSSL_FIPS
+int private_SHA224_Init(SHA256_CTX *c);
+int private_SHA256_Init(SHA256_CTX *c);
+# endif
+int SHA224_Init(SHA256_CTX *c);
+int SHA224_Update(SHA256_CTX *c, const void *data, size_t len);
+int SHA224_Final(unsigned char *md, SHA256_CTX *c);
+unsigned char *SHA224(const unsigned char *d, size_t n, unsigned char *md);
+int SHA256_Init(SHA256_CTX *c);
+int SHA256_Update(SHA256_CTX *c, const void *data, size_t len);
+int SHA256_Final(unsigned char *md, SHA256_CTX *c);
+unsigned char *SHA256(const unsigned char *d, size_t n, unsigned char *md);
+void SHA256_Transform(SHA256_CTX *c, const unsigned char *data);
+# endif
+
+# define SHA384_DIGEST_LENGTH 48
+# define SHA512_DIGEST_LENGTH 64
+
+# ifndef OPENSSL_NO_SHA512
+/*
+ * Unlike 32-bit digest algorithms, SHA-512 *relies* on SHA_LONG64
+ * being exactly 64-bit wide. See Implementation Notes in sha512.c
+ * for further details.
+ */
+/*
+ * SHA-512 treats input data as a
+ * contiguous array of 64 bit
+ * wide big-endian values.
+ */
+# define SHA512_CBLOCK (SHA_LBLOCK*8)
+# if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32__)
+# define SHA_LONG64 unsigned __int64
+# define U64(C) C##UI64
+# elif defined(__arch64__)
+# define SHA_LONG64 unsigned long
+# define U64(C) C##UL
+# else
+# define SHA_LONG64 unsigned long long
+# define U64(C) C##ULL
+# endif
+
+typedef struct SHA512state_st {
+ SHA_LONG64 h[8];
+ SHA_LONG64 Nl, Nh;
+ union {
+ SHA_LONG64 d[SHA_LBLOCK];
+ unsigned char p[SHA512_CBLOCK];
+ } u;
+ unsigned int num, md_len;
+} SHA512_CTX;
+# endif
+
+# ifndef OPENSSL_NO_SHA512
+# ifdef OPENSSL_FIPS
+int private_SHA384_Init(SHA512_CTX *c);
+int private_SHA512_Init(SHA512_CTX *c);
+# endif
+int SHA384_Init(SHA512_CTX *c);
+int SHA384_Update(SHA512_CTX *c, const void *data, size_t len);
+int SHA384_Final(unsigned char *md, SHA512_CTX *c);
+unsigned char *SHA384(const unsigned char *d, size_t n, unsigned char *md);
+int SHA512_Init(SHA512_CTX *c);
+int SHA512_Update(SHA512_CTX *c, const void *data, size_t len);
+int SHA512_Final(unsigned char *md, SHA512_CTX *c);
+unsigned char *SHA512(const unsigned char *d, size_t n, unsigned char *md);
+void SHA512_Transform(SHA512_CTX *c, const unsigned char *data);
+# endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/deps/openssl/openssl/include/openssl/srp.h b/deps/openssl/openssl/include/openssl/srp.h
index 8217476779e..d072536fec9 100644
--- a/deps/openssl/openssl/include/openssl/srp.h
+++ b/deps/openssl/openssl/include/openssl/srp.h
@@ -1 +1,169 @@
-#include "../../crypto/srp/srp.h"
+/* crypto/srp/srp.h */
+/*
+ * Written by Christophe Renou (christophe.renou@edelweb.fr) with the
+ * precious help of Peter Sylvester (peter.sylvester@edelweb.fr) for the
+ * EdelKey project and contributed to the OpenSSL project 2004.
+ */
+/* ====================================================================
+ * Copyright (c) 2004 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * licensing@OpenSSL.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+#ifndef __SRP_H__
+# define __SRP_H__
+
+# ifndef OPENSSL_NO_SRP
+
+# include <stdio.h>
+# include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# include <openssl/safestack.h>
+# include <openssl/bn.h>
+# include <openssl/crypto.h>
+
+typedef struct SRP_gN_cache_st {
+ char *b64_bn;
+ BIGNUM *bn;
+} SRP_gN_cache;
+
+
+DECLARE_STACK_OF(SRP_gN_cache)
+
+typedef struct SRP_user_pwd_st {
+ char *id;
+ BIGNUM *s;
+ BIGNUM *v;
+ const BIGNUM *g;
+ const BIGNUM *N;
+ char *info;
+} SRP_user_pwd;
+
+DECLARE_STACK_OF(SRP_user_pwd)
+
+typedef struct SRP_VBASE_st {
+ STACK_OF(SRP_user_pwd) *users_pwd;
+ STACK_OF(SRP_gN_cache) *gN_cache;
+/* to simulate a user */
+ char *seed_key;
+ BIGNUM *default_g;
+ BIGNUM *default_N;
+} SRP_VBASE;
+
+/*
+ * Structure interne pour retenir les couples N et g
+ */
+typedef struct SRP_gN_st {
+ char *id;
+ BIGNUM *g;
+ BIGNUM *N;
+} SRP_gN;
+
+DECLARE_STACK_OF(SRP_gN)
+
+SRP_VBASE *SRP_VBASE_new(char *seed_key);
+int SRP_VBASE_free(SRP_VBASE *vb);
+int SRP_VBASE_init(SRP_VBASE *vb, char *verifier_file);
+SRP_user_pwd *SRP_VBASE_get_by_user(SRP_VBASE *vb, char *username);
+char *SRP_create_verifier(const char *user, const char *pass, char **salt,
+ char **verifier, const char *N, const char *g);
+int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt,
+ BIGNUM **verifier, BIGNUM *N, BIGNUM *g);
+
+# define SRP_NO_ERROR 0
+# define SRP_ERR_VBASE_INCOMPLETE_FILE 1
+# define SRP_ERR_VBASE_BN_LIB 2
+# define SRP_ERR_OPEN_FILE 3
+# define SRP_ERR_MEMORY 4
+
+# define DB_srptype 0
+# define DB_srpverifier 1
+# define DB_srpsalt 2
+# define DB_srpid 3
+# define DB_srpgN 4
+# define DB_srpinfo 5
+# undef DB_NUMBER
+# define DB_NUMBER 6
+
+# define DB_SRP_INDEX 'I'
+# define DB_SRP_VALID 'V'
+# define DB_SRP_REVOKED 'R'
+# define DB_SRP_MODIF 'v'
+
+/* see srp.c */
+char *SRP_check_known_gN_param(BIGNUM *g, BIGNUM *N);
+SRP_gN *SRP_get_default_gN(const char *id);
+
+/* server side .... */
+BIGNUM *SRP_Calc_server_key(BIGNUM *A, BIGNUM *v, BIGNUM *u, BIGNUM *b,
+ BIGNUM *N);
+BIGNUM *SRP_Calc_B(BIGNUM *b, BIGNUM *N, BIGNUM *g, BIGNUM *v);
+int SRP_Verify_A_mod_N(BIGNUM *A, BIGNUM *N);
+BIGNUM *SRP_Calc_u(BIGNUM *A, BIGNUM *B, BIGNUM *N);
+
+/* client side .... */
+BIGNUM *SRP_Calc_x(BIGNUM *s, const char *user, const char *pass);
+BIGNUM *SRP_Calc_A(BIGNUM *a, BIGNUM *N, BIGNUM *g);
+BIGNUM *SRP_Calc_client_key(BIGNUM *N, BIGNUM *B, BIGNUM *g, BIGNUM *x,
+ BIGNUM *a, BIGNUM *u);
+int SRP_Verify_B_mod_N(BIGNUM *B, BIGNUM *N);
+
+# define SRP_MINIMAL_N 1024
+
+#ifdef __cplusplus
+}
+#endif
+
+# endif
+#endif
diff --git a/deps/openssl/openssl/include/openssl/srtp.h b/deps/openssl/openssl/include/openssl/srtp.h
index e185494a523..2279c32b895 100644
--- a/deps/openssl/openssl/include/openssl/srtp.h
+++ b/deps/openssl/openssl/include/openssl/srtp.h
@@ -1 +1,147 @@
-#include "../../ssl/srtp.h"
+/* ssl/srtp.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+/* ====================================================================
+ * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+/*
+ * DTLS code by Eric Rescorla <ekr@rtfm.com>
+ *
+ * Copyright (C) 2006, Network Resonance, Inc. Copyright (C) 2011, RTFM, Inc.
+ */
+
+#ifndef HEADER_D1_SRTP_H
+# define HEADER_D1_SRTP_H
+
+# include <openssl/ssl.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# define SRTP_AES128_CM_SHA1_80 0x0001
+# define SRTP_AES128_CM_SHA1_32 0x0002
+# define SRTP_AES128_F8_SHA1_80 0x0003
+# define SRTP_AES128_F8_SHA1_32 0x0004
+# define SRTP_NULL_SHA1_80 0x0005
+# define SRTP_NULL_SHA1_32 0x0006
+
+# ifndef OPENSSL_NO_SRTP
+
+int SSL_CTX_set_tlsext_use_srtp(SSL_CTX *ctx, const char *profiles);
+int SSL_set_tlsext_use_srtp(SSL *ctx, const char *profiles);
+
+STACK_OF(SRTP_PROTECTION_PROFILE) *SSL_get_srtp_profiles(SSL *ssl);
+SRTP_PROTECTION_PROFILE *SSL_get_selected_srtp_profile(SSL *s);
+
+# endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/deps/openssl/openssl/include/openssl/ssl.h b/deps/openssl/openssl/include/openssl/ssl.h
index 0b0589c639a..6fe1a2474d4 100644
--- a/deps/openssl/openssl/include/openssl/ssl.h
+++ b/deps/openssl/openssl/include/openssl/ssl.h
@@ -1 +1,3164 @@
-#include "../../ssl/ssl.h"
+/* ssl/ssl.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+/* ====================================================================
+ * Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+/* ====================================================================
+ * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
+ * ECC cipher suite support in OpenSSL originally developed by
+ * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
+ */
+/* ====================================================================
+ * Copyright 2005 Nokia. All rights reserved.
+ *
+ * The portions of the attached software ("Contribution") is developed by
+ * Nokia Corporation and is licensed pursuant to the OpenSSL open source
+ * license.
+ *
+ * The Contribution, originally written by Mika Kousa and Pasi Eronen of
+ * Nokia Corporation, consists of the "PSK" (Pre-Shared Key) ciphersuites
+ * support (see RFC 4279) to OpenSSL.
+ *
+ * No patent licenses or other rights except those expressly stated in
+ * the OpenSSL open source license shall be deemed granted or received
+ * expressly, by implication, estoppel, or otherwise.
+ *
+ * No assurances are provided by Nokia that the Contribution does not
+ * infringe the patent or other intellectual property rights of any third
+ * party or that the license provides you with all the necessary rights
+ * to make use of the Contribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. IN
+ * ADDITION TO THE DISCLAIMERS INCLUDED IN THE LICENSE, NOKIA
+ * SPECIFICALLY DISCLAIMS ANY LIABILITY FOR CLAIMS BROUGHT BY YOU OR ANY
+ * OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR
+ * OTHERWISE.
+ */
+
+#ifndef HEADER_SSL_H
+# define HEADER_SSL_H
+
+# include <openssl/e_os2.h>
+
+# ifndef OPENSSL_NO_COMP
+# include <openssl/comp.h>
+# endif
+# ifndef OPENSSL_NO_BIO
+# include <openssl/bio.h>
+# endif
+# ifndef OPENSSL_NO_DEPRECATED
+# ifndef OPENSSL_NO_X509
+# include <openssl/x509.h>
+# endif
+# include <openssl/crypto.h>
+# include <openssl/lhash.h>
+# include <openssl/buffer.h>
+# endif
+# include <openssl/pem.h>
+# include <openssl/hmac.h>
+
+# include <openssl/kssl.h>
+# include <openssl/safestack.h>
+# include <openssl/symhacks.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* SSLeay version number for ASN.1 encoding of the session information */
+/*-
+ * Version 0 - initial version
+ * Version 1 - added the optional peer certificate
+ */
+# define SSL_SESSION_ASN1_VERSION 0x0001
+
+/* text strings for the ciphers */
+# define SSL_TXT_NULL_WITH_MD5 SSL2_TXT_NULL_WITH_MD5
+# define SSL_TXT_RC4_128_WITH_MD5 SSL2_TXT_RC4_128_WITH_MD5
+# define SSL_TXT_RC4_128_EXPORT40_WITH_MD5 SSL2_TXT_RC4_128_EXPORT40_WITH_MD5
+# define SSL_TXT_RC2_128_CBC_WITH_MD5 SSL2_TXT_RC2_128_CBC_WITH_MD5
+# define SSL_TXT_RC2_128_CBC_EXPORT40_WITH_MD5 SSL2_TXT_RC2_128_CBC_EXPORT40_WITH_MD5
+# define SSL_TXT_IDEA_128_CBC_WITH_MD5 SSL2_TXT_IDEA_128_CBC_WITH_MD5
+# define SSL_TXT_DES_64_CBC_WITH_MD5 SSL2_TXT_DES_64_CBC_WITH_MD5
+# define SSL_TXT_DES_64_CBC_WITH_SHA SSL2_TXT_DES_64_CBC_WITH_SHA
+# define SSL_TXT_DES_192_EDE3_CBC_WITH_MD5 SSL2_TXT_DES_192_EDE3_CBC_WITH_MD5
+# define SSL_TXT_DES_192_EDE3_CBC_WITH_SHA SSL2_TXT_DES_192_EDE3_CBC_WITH_SHA
+
+/*
+ * VRS Additional Kerberos5 entries
+ */
+# define SSL_TXT_KRB5_DES_64_CBC_SHA SSL3_TXT_KRB5_DES_64_CBC_SHA
+# define SSL_TXT_KRB5_DES_192_CBC3_SHA SSL3_TXT_KRB5_DES_192_CBC3_SHA
+# define SSL_TXT_KRB5_RC4_128_SHA SSL3_TXT_KRB5_RC4_128_SHA
+# define SSL_TXT_KRB5_IDEA_128_CBC_SHA SSL3_TXT_KRB5_IDEA_128_CBC_SHA
+# define SSL_TXT_KRB5_DES_64_CBC_MD5 SSL3_TXT_KRB5_DES_64_CBC_MD5
+# define SSL_TXT_KRB5_DES_192_CBC3_MD5 SSL3_TXT_KRB5_DES_192_CBC3_MD5
+# define SSL_TXT_KRB5_RC4_128_MD5 SSL3_TXT_KRB5_RC4_128_MD5
+# define SSL_TXT_KRB5_IDEA_128_CBC_MD5 SSL3_TXT_KRB5_IDEA_128_CBC_MD5
+
+# define SSL_TXT_KRB5_DES_40_CBC_SHA SSL3_TXT_KRB5_DES_40_CBC_SHA
+# define SSL_TXT_KRB5_RC2_40_CBC_SHA SSL3_TXT_KRB5_RC2_40_CBC_SHA
+# define SSL_TXT_KRB5_RC4_40_SHA SSL3_TXT_KRB5_RC4_40_SHA
+# define SSL_TXT_KRB5_DES_40_CBC_MD5 SSL3_TXT_KRB5_DES_40_CBC_MD5
+# define SSL_TXT_KRB5_RC2_40_CBC_MD5 SSL3_TXT_KRB5_RC2_40_CBC_MD5
+# define SSL_TXT_KRB5_RC4_40_MD5 SSL3_TXT_KRB5_RC4_40_MD5
+
+# define SSL_TXT_KRB5_DES_40_CBC_SHA SSL3_TXT_KRB5_DES_40_CBC_SHA
+# define SSL_TXT_KRB5_DES_40_CBC_MD5 SSL3_TXT_KRB5_DES_40_CBC_MD5
+# define SSL_TXT_KRB5_DES_64_CBC_SHA SSL3_TXT_KRB5_DES_64_CBC_SHA
+# define SSL_TXT_KRB5_DES_64_CBC_MD5 SSL3_TXT_KRB5_DES_64_CBC_MD5
+# define SSL_TXT_KRB5_DES_192_CBC3_SHA SSL3_TXT_KRB5_DES_192_CBC3_SHA
+# define SSL_TXT_KRB5_DES_192_CBC3_MD5 SSL3_TXT_KRB5_DES_192_CBC3_MD5
+# define SSL_MAX_KRB5_PRINCIPAL_LENGTH 256
+
+# define SSL_MAX_SSL_SESSION_ID_LENGTH 32
+# define SSL_MAX_SID_CTX_LENGTH 32
+
+# define SSL_MIN_RSA_MODULUS_LENGTH_IN_BYTES (512/8)
+# define SSL_MAX_KEY_ARG_LENGTH 8
+# define SSL_MAX_MASTER_KEY_LENGTH 48
+
+/* These are used to specify which ciphers to use and not to use */
+
+# define SSL_TXT_EXP40 "EXPORT40"
+# define SSL_TXT_EXP56 "EXPORT56"
+# define SSL_TXT_LOW "LOW"
+# define SSL_TXT_MEDIUM "MEDIUM"
+# define SSL_TXT_HIGH "HIGH"
+# define SSL_TXT_FIPS "FIPS"
+
+# define SSL_TXT_kFZA "kFZA"/* unused! */
+# define SSL_TXT_aFZA "aFZA"/* unused! */
+# define SSL_TXT_eFZA "eFZA"/* unused! */
+# define SSL_TXT_FZA "FZA"/* unused! */
+
+# define SSL_TXT_aNULL "aNULL"
+# define SSL_TXT_eNULL "eNULL"
+# define SSL_TXT_NULL "NULL"
+
+# define SSL_TXT_kRSA "kRSA"
+# define SSL_TXT_kDHr "kDHr"
+# define SSL_TXT_kDHd "kDHd"
+# define SSL_TXT_kDH "kDH"
+# define SSL_TXT_kEDH "kEDH"
+# define SSL_TXT_kDHE "kDHE"/* alias for kEDH */
+# define SSL_TXT_kKRB5 "kKRB5"
+# define SSL_TXT_kECDHr "kECDHr"
+# define SSL_TXT_kECDHe "kECDHe"
+# define SSL_TXT_kECDH "kECDH"
+# define SSL_TXT_kEECDH "kEECDH"
+# define SSL_TXT_kECDHE "kECDHE"/* alias for kEECDH */
+# define SSL_TXT_kPSK "kPSK"
+# define SSL_TXT_kGOST "kGOST"
+# define SSL_TXT_kSRP "kSRP"
+
+# define SSL_TXT_aRSA "aRSA"
+# define SSL_TXT_aDSS "aDSS"
+# define SSL_TXT_aDH "aDH"
+# define SSL_TXT_aECDH "aECDH"
+# define SSL_TXT_aKRB5 "aKRB5"
+# define SSL_TXT_aECDSA "aECDSA"
+# define SSL_TXT_aPSK "aPSK"
+# define SSL_TXT_aGOST94 "aGOST94"
+# define SSL_TXT_aGOST01 "aGOST01"
+# define SSL_TXT_aGOST "aGOST"
+# define SSL_TXT_aSRP "aSRP"
+
+# define SSL_TXT_DSS "DSS"
+# define SSL_TXT_DH "DH"
+# define SSL_TXT_EDH "EDH"/* same as "kEDH:-ADH" */
+# define SSL_TXT_DHE "DHE"/* alias for EDH */
+# define SSL_TXT_ADH "ADH"
+# define SSL_TXT_RSA "RSA"
+# define SSL_TXT_ECDH "ECDH"
+# define SSL_TXT_EECDH "EECDH"/* same as "kEECDH:-AECDH" */
+# define SSL_TXT_ECDHE "ECDHE"/* alias for ECDHE" */
+# define SSL_TXT_AECDH "AECDH"
+# define SSL_TXT_ECDSA "ECDSA"
+# define SSL_TXT_KRB5 "KRB5"
+# define SSL_TXT_PSK "PSK"
+# define SSL_TXT_SRP "SRP"
+
+# define SSL_TXT_DES "DES"
+# define SSL_TXT_3DES "3DES"
+# define SSL_TXT_RC4 "RC4"
+# define SSL_TXT_RC2 "RC2"
+# define SSL_TXT_IDEA "IDEA"
+# define SSL_TXT_SEED "SEED"
+# define SSL_TXT_AES128 "AES128"
+# define SSL_TXT_AES256 "AES256"
+# define SSL_TXT_AES "AES"
+# define SSL_TXT_AES_GCM "AESGCM"
+# define SSL_TXT_CAMELLIA128 "CAMELLIA128"
+# define SSL_TXT_CAMELLIA256 "CAMELLIA256"
+# define SSL_TXT_CAMELLIA "CAMELLIA"
+
+# define SSL_TXT_MD5 "MD5"
+# define SSL_TXT_SHA1 "SHA1"
+# define SSL_TXT_SHA "SHA"/* same as "SHA1" */
+# define SSL_TXT_GOST94 "GOST94"
+# define SSL_TXT_GOST89MAC "GOST89MAC"
+# define SSL_TXT_SHA256 "SHA256"
+# define SSL_TXT_SHA384 "SHA384"
+
+# define SSL_TXT_SSLV2 "SSLv2"
+# define SSL_TXT_SSLV3 "SSLv3"
+# define SSL_TXT_TLSV1 "TLSv1"
+# define SSL_TXT_TLSV1_1 "TLSv1.1"
+# define SSL_TXT_TLSV1_2 "TLSv1.2"
+
+# define SSL_TXT_EXP "EXP"
+# define SSL_TXT_EXPORT "EXPORT"
+
+# define SSL_TXT_ALL "ALL"
+
+/*-
+ * COMPLEMENTOF* definitions. These identifiers are used to (de-select)
+ * ciphers normally not being used.
+ * Example: "RC4" will activate all ciphers using RC4 including ciphers
+ * without authentication, which would normally disabled by DEFAULT (due
+ * the "!ADH" being part of default). Therefore "RC4:!COMPLEMENTOFDEFAULT"
+ * will make sure that it is also disabled in the specific selection.
+ * COMPLEMENTOF* identifiers are portable between version, as adjustments
+ * to the default cipher setup will also be included here.
+ *
+ * COMPLEMENTOFDEFAULT does not experience the same special treatment that
+ * DEFAULT gets, as only selection is being done and no sorting as needed
+ * for DEFAULT.
+ */
+# define SSL_TXT_CMPALL "COMPLEMENTOFALL"
+# define SSL_TXT_CMPDEF "COMPLEMENTOFDEFAULT"
+
+/*
+ * The following cipher list is used by default. It also is substituted when
+ * an application-defined cipher list string starts with 'DEFAULT'.
+ */
+# define SSL_DEFAULT_CIPHER_LIST "ALL:!EXPORT:!aNULL:!eNULL:!SSLv2"
+/*
+ * As of OpenSSL 1.0.0, ssl_create_cipher_list() in ssl/ssl_ciph.c always
+ * starts with a reasonable order, and all we have to do for DEFAULT is
+ * throwing out anonymous and unencrypted ciphersuites! (The latter are not
+ * actually enabled by ALL, but "ALL:RSA" would enable some of them.)
+ */
+
+/* Used in SSL_set_shutdown()/SSL_get_shutdown(); */
+# define SSL_SENT_SHUTDOWN 1
+# define SSL_RECEIVED_SHUTDOWN 2
+
+#ifdef __cplusplus
+}
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# if (defined(OPENSSL_NO_RSA) || defined(OPENSSL_NO_MD5)) && !defined(OPENSSL_NO_SSL2)
+# define OPENSSL_NO_SSL2
+# endif
+
+# define SSL_FILETYPE_ASN1 X509_FILETYPE_ASN1
+# define SSL_FILETYPE_PEM X509_FILETYPE_PEM
+
+/*
+ * This is needed to stop compilers complaining about the 'struct ssl_st *'
+ * function parameters used to prototype callbacks in SSL_CTX.
+ */
+typedef struct ssl_st *ssl_crock_st;
+typedef struct tls_session_ticket_ext_st TLS_SESSION_TICKET_EXT;
+typedef struct ssl_method_st SSL_METHOD;
+typedef struct ssl_cipher_st SSL_CIPHER;
+typedef struct ssl_session_st SSL_SESSION;
+typedef struct tls_sigalgs_st TLS_SIGALGS;
+typedef struct ssl_conf_ctx_st SSL_CONF_CTX;
+
+DECLARE_STACK_OF(SSL_CIPHER)
+
+/* SRTP protection profiles for use with the use_srtp extension (RFC 5764)*/
+typedef struct srtp_protection_profile_st {
+ const char *name;
+ unsigned long id;
+} SRTP_PROTECTION_PROFILE;
+
+DECLARE_STACK_OF(SRTP_PROTECTION_PROFILE)
+
+typedef int (*tls_session_ticket_ext_cb_fn) (SSL *s,
+ const unsigned char *data,
+ int len, void *arg);
+typedef int (*tls_session_secret_cb_fn) (SSL *s, void *secret,
+ int *secret_len,
+ STACK_OF(SSL_CIPHER) *peer_ciphers,
+ SSL_CIPHER **cipher, void *arg);
+
+# ifndef OPENSSL_NO_TLSEXT
+
+/* Typedefs for handling custom extensions */
+
+typedef int (*custom_ext_add_cb) (SSL *s, unsigned int ext_type,
+ const unsigned char **out,
+ size_t *outlen, int *al, void *add_arg);
+
+typedef void (*custom_ext_free_cb) (SSL *s, unsigned int ext_type,
+ const unsigned char *out, void *add_arg);
+
+typedef int (*custom_ext_parse_cb) (SSL *s, unsigned int ext_type,
+ const unsigned char *in,
+ size_t inlen, int *al, void *parse_arg);
+
+# endif
+
+# ifndef OPENSSL_NO_SSL_INTERN
+
+/* used to hold info on the particular ciphers used */
+struct ssl_cipher_st {
+ int valid;
+ const char *name; /* text name */
+ unsigned long id; /* id, 4 bytes, first is version */
+ /*
+ * changed in 0.9.9: these four used to be portions of a single value
+ * 'algorithms'
+ */
+ unsigned long algorithm_mkey; /* key exchange algorithm */
+ unsigned long algorithm_auth; /* server authentication */
+ unsigned long algorithm_enc; /* symmetric encryption */
+ unsigned long algorithm_mac; /* symmetric authentication */
+ unsigned long algorithm_ssl; /* (major) protocol version */
+ unsigned long algo_strength; /* strength and export flags */
+ unsigned long algorithm2; /* Extra flags */
+ int strength_bits; /* Number of bits really used */
+ int alg_bits; /* Number of bits for algorithm */
+};
+
+/* Used to hold functions for SSLv2 or SSLv3/TLSv1 functions */
+struct ssl_method_st {
+ int version;
+ int (*ssl_new) (SSL *s);
+ void (*ssl_clear) (SSL *s);
+ void (*ssl_free) (SSL *s);
+ int (*ssl_accept) (SSL *s);
+ int (*ssl_connect) (SSL *s);
+ int (*ssl_read) (SSL *s, void *buf, int len);
+ int (*ssl_peek) (SSL *s, void *buf, int len);
+ int (*ssl_write) (SSL *s, const void *buf, int len);
+ int (*ssl_shutdown) (SSL *s);
+ int (*ssl_renegotiate) (SSL *s);
+ int (*ssl_renegotiate_check) (SSL *s);
+ long (*ssl_get_message) (SSL *s, int st1, int stn, int mt, long
+ max, int *ok);
+ int (*ssl_read_bytes) (SSL *s, int type, unsigned char *buf, int len,
+ int peek);
+ int (*ssl_write_bytes) (SSL *s, int type, const void *buf_, int len);
+ int (*ssl_dispatch_alert) (SSL *s);
+ long (*ssl_ctrl) (SSL *s, int cmd, long larg, void *parg);
+ long (*ssl_ctx_ctrl) (SSL_CTX *ctx, int cmd, long larg, void *parg);
+ const SSL_CIPHER *(*get_cipher_by_char) (const unsigned char *ptr);
+ int (*put_cipher_by_char) (const SSL_CIPHER *cipher, unsigned char *ptr);
+ int (*ssl_pending) (const SSL *s);
+ int (*num_ciphers) (void);
+ const SSL_CIPHER *(*get_cipher) (unsigned ncipher);
+ const struct ssl_method_st *(*get_ssl_method) (int version);
+ long (*get_timeout) (void);
+ struct ssl3_enc_method *ssl3_enc; /* Extra SSLv3/TLS stuff */
+ int (*ssl_version) (void);
+ long (*ssl_callback_ctrl) (SSL *s, int cb_id, void (*fp) (void));
+ long (*ssl_ctx_callback_ctrl) (SSL_CTX *s, int cb_id, void (*fp) (void));
+};
+
+/*-
+ * Lets make this into an ASN.1 type structure as follows
+ * SSL_SESSION_ID ::= SEQUENCE {
+ * version INTEGER, -- structure version number
+ * SSLversion INTEGER, -- SSL version number
+ * Cipher OCTET STRING, -- the 3 byte cipher ID
+ * Session_ID OCTET STRING, -- the Session ID
+ * Master_key OCTET STRING, -- the master key
+ * KRB5_principal OCTET STRING -- optional Kerberos principal
+ * Key_Arg [ 0 ] IMPLICIT OCTET STRING, -- the optional Key argument
+ * Time [ 1 ] EXPLICIT INTEGER, -- optional Start Time
+ * Timeout [ 2 ] EXPLICIT INTEGER, -- optional Timeout ins seconds
+ * Peer [ 3 ] EXPLICIT X509, -- optional Peer Certificate
+ * Session_ID_context [ 4 ] EXPLICIT OCTET STRING, -- the Session ID context
+ * Verify_result [ 5 ] EXPLICIT INTEGER, -- X509_V_... code for `Peer'
+ * HostName [ 6 ] EXPLICIT OCTET STRING, -- optional HostName from servername TLS extension
+ * PSK_identity_hint [ 7 ] EXPLICIT OCTET STRING, -- optional PSK identity hint
+ * PSK_identity [ 8 ] EXPLICIT OCTET STRING, -- optional PSK identity
+ * Ticket_lifetime_hint [9] EXPLICIT INTEGER, -- server's lifetime hint for session ticket
+ * Ticket [10] EXPLICIT OCTET STRING, -- session ticket (clients only)
+ * Compression_meth [11] EXPLICIT OCTET STRING, -- optional compression method
+ * SRP_username [ 12 ] EXPLICIT OCTET STRING -- optional SRP username
+ * }
+ * Look in ssl/ssl_asn1.c for more details
+ * I'm using EXPLICIT tags so I can read the damn things using asn1parse :-).
+ */
+struct ssl_session_st {
+ int ssl_version; /* what ssl version session info is being
+ * kept in here? */
+ /* only really used in SSLv2 */
+ unsigned int key_arg_length;
+ unsigned char key_arg[SSL_MAX_KEY_ARG_LENGTH];
+ int master_key_length;
+ unsigned char master_key[SSL_MAX_MASTER_KEY_LENGTH];
+ /* session_id - valid? */
+ unsigned int session_id_length;
+ unsigned char session_id[SSL_MAX_SSL_SESSION_ID_LENGTH];
+ /*
+ * this is used to determine whether the session is being reused in the
+ * appropriate context. It is up to the application to set this, via
+ * SSL_new
+ */
+ unsigned int sid_ctx_length;
+ unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH];
+# ifndef OPENSSL_NO_KRB5
+ unsigned int krb5_client_princ_len;
+ unsigned char krb5_client_princ[SSL_MAX_KRB5_PRINCIPAL_LENGTH];
+# endif /* OPENSSL_NO_KRB5 */
+# ifndef OPENSSL_NO_PSK
+ char *psk_identity_hint;
+ char *psk_identity;
+# endif
+ /*
+ * Used to indicate that session resumption is not allowed. Applications
+ * can also set this bit for a new session via not_resumable_session_cb
+ * to disable session caching and tickets.
+ */
+ int not_resumable;
+ /* The cert is the certificate used to establish this connection */
+ struct sess_cert_st /* SESS_CERT */ *sess_cert;
+ /*
+ * This is the cert for the other end. On clients, it will be the same as
+ * sess_cert->peer_key->x509 (the latter is not enough as sess_cert is
+ * not retained in the external representation of sessions, see
+ * ssl_asn1.c).
+ */
+ X509 *peer;
+ /*
+ * when app_verify_callback accepts a session where the peer's
+ * certificate is not ok, we must remember the error for session reuse:
+ */
+ long verify_result; /* only for servers */
+ int references;
+ long timeout;
+ long time;
+ unsigned int compress_meth; /* Need to lookup the method */
+ const SSL_CIPHER *cipher;
+ unsigned long cipher_id; /* when ASN.1 loaded, this needs to be used
+ * to load the 'cipher' structure */
+ STACK_OF(SSL_CIPHER) *ciphers; /* shared ciphers? */
+ CRYPTO_EX_DATA ex_data; /* application specific data */
+ /*
+ * These are used to make removal of session-ids more efficient and to
+ * implement a maximum cache size.
+ */
+ struct ssl_session_st *prev, *next;
+# ifndef OPENSSL_NO_TLSEXT
+ char *tlsext_hostname;
+# ifndef OPENSSL_NO_EC
+ size_t tlsext_ecpointformatlist_length;
+ unsigned char *tlsext_ecpointformatlist; /* peer's list */
+ size_t tlsext_ellipticcurvelist_length;
+ unsigned char *tlsext_ellipticcurvelist; /* peer's list */
+# endif /* OPENSSL_NO_EC */
+ /* RFC4507 info */
+ unsigned char *tlsext_tick; /* Session ticket */
+ size_t tlsext_ticklen; /* Session ticket length */
+ long tlsext_tick_lifetime_hint; /* Session lifetime hint in seconds */
+# endif
+# ifndef OPENSSL_NO_SRP
+ char *srp_username;
+# endif
+};
+
+# endif
+
+# define SSL_OP_MICROSOFT_SESS_ID_BUG 0x00000001L
+# define SSL_OP_NETSCAPE_CHALLENGE_BUG 0x00000002L
+/* Allow initial connection to servers that don't support RI */
+# define SSL_OP_LEGACY_SERVER_CONNECT 0x00000004L
+# define SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG 0x00000008L
+# define SSL_OP_TLSEXT_PADDING 0x00000010L
+# define SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER 0x00000020L
+# define SSL_OP_SAFARI_ECDHE_ECDSA_BUG 0x00000040L
+# define SSL_OP_SSLEAY_080_CLIENT_DH_BUG 0x00000080L
+# define SSL_OP_TLS_D5_BUG 0x00000100L
+# define SSL_OP_TLS_BLOCK_PADDING_BUG 0x00000200L
+
+/* Hasn't done anything since OpenSSL 0.9.7h, retained for compatibility */
+# define SSL_OP_MSIE_SSLV2_RSA_PADDING 0x0
+/* Refers to ancient SSLREF and SSLv2, retained for compatibility */
+# define SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG 0x0
+
+/*
+ * Disable SSL 3.0/TLS 1.0 CBC vulnerability workaround that was added in
+ * OpenSSL 0.9.6d. Usually (depending on the application protocol) the
+ * workaround is not needed. Unfortunately some broken SSL/TLS
+ * implementations cannot handle it at all, which is why we include it in
+ * SSL_OP_ALL.
+ */
+/* added in 0.9.6e */
+# define SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS 0x00000800L
+
+/*
+ * SSL_OP_ALL: various bug workarounds that should be rather harmless. This
+ * used to be 0x000FFFFFL before 0.9.7.
+ */
+# define SSL_OP_ALL 0x80000BFFL
+
+/* DTLS options */
+# define SSL_OP_NO_QUERY_MTU 0x00001000L
+/* Turn on Cookie Exchange (on relevant for servers) */
+# define SSL_OP_COOKIE_EXCHANGE 0x00002000L
+/* Don't use RFC4507 ticket extension */
+# define SSL_OP_NO_TICKET 0x00004000L
+/* Use Cisco's "speshul" version of DTLS_BAD_VER (as client) */
+# define SSL_OP_CISCO_ANYCONNECT 0x00008000L
+
+/* As server, disallow session resumption on renegotiation */
+# define SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION 0x00010000L
+/* Don't use compression even if supported */
+# define SSL_OP_NO_COMPRESSION 0x00020000L
+/* Permit unsafe legacy renegotiation */
+# define SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION 0x00040000L
+/* If set, always create a new key when using tmp_ecdh parameters */
+# define SSL_OP_SINGLE_ECDH_USE 0x00080000L
+/* If set, always create a new key when using tmp_dh parameters */
+# define SSL_OP_SINGLE_DH_USE 0x00100000L
+/* Does nothing: retained for compatibiity */
+# define SSL_OP_EPHEMERAL_RSA 0x0
+/*
+ * Set on servers to choose the cipher according to the server's preferences
+ */
+# define SSL_OP_CIPHER_SERVER_PREFERENCE 0x00400000L
+/*
+ * If set, a server will allow a client to issue a SSLv3.0 version number as
+ * latest version supported in the premaster secret, even when TLSv1.0
+ * (version 3.1) was announced in the client hello. Normally this is
+ * forbidden to prevent version rollback attacks.
+ */
+# define SSL_OP_TLS_ROLLBACK_BUG 0x00800000L
+
+# define SSL_OP_NO_SSLv2 0x01000000L
+# define SSL_OP_NO_SSLv3 0x02000000L
+# define SSL_OP_NO_TLSv1 0x04000000L
+# define SSL_OP_NO_TLSv1_2 0x08000000L
+# define SSL_OP_NO_TLSv1_1 0x10000000L
+
+# define SSL_OP_NO_DTLSv1 0x04000000L
+# define SSL_OP_NO_DTLSv1_2 0x08000000L
+
+# define SSL_OP_NO_SSL_MASK (SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3|\
+ SSL_OP_NO_TLSv1|SSL_OP_NO_TLSv1_1|SSL_OP_NO_TLSv1_2)
+
+/*
+ * These next two were never actually used for anything since SSLeay zap so
+ * we have some more flags.
+ */
+/*
+ * The next flag deliberately changes the ciphertest, this is a check for the
+ * PKCS#1 attack
+ */
+# define SSL_OP_PKCS1_CHECK_1 0x0
+# define SSL_OP_PKCS1_CHECK_2 0x0
+
+# define SSL_OP_NETSCAPE_CA_DN_BUG 0x20000000L
+# define SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG 0x40000000L
+/*
+ * Make server add server-hello extension from early version of cryptopro
+ * draft, when GOST ciphersuite is negotiated. Required for interoperability
+ * with CryptoPro CSP 3.x
+ */
+# define SSL_OP_CRYPTOPRO_TLSEXT_BUG 0x80000000L
+
+/*
+ * Allow SSL_write(..., n) to return r with 0 < r < n (i.e. report success
+ * when just a single record has been written):
+ */
+# define SSL_MODE_ENABLE_PARTIAL_WRITE 0x00000001L
+/*
+ * Make it possible to retry SSL_write() with changed buffer location (buffer
+ * contents must stay the same!); this is not the default to avoid the
+ * misconception that non-blocking SSL_write() behaves like non-blocking
+ * write():
+ */
+# define SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER 0x00000002L
+/*
+ * Never bother the application with retries if the transport is blocking:
+ */
+# define SSL_MODE_AUTO_RETRY 0x00000004L
+/* Don't attempt to automatically build certificate chain */
+# define SSL_MODE_NO_AUTO_CHAIN 0x00000008L
+/*
+ * Save RAM by releasing read and write buffers when they're empty. (SSL3 and
+ * TLS only.) "Released" buffers are put onto a free-list in the context or
+ * just freed (depending on the context's setting for freelist_max_len).
+ */
+# define SSL_MODE_RELEASE_BUFFERS 0x00000010L
+/*
+ * Send the current time in the Random fields of the ClientHello and
+ * ServerHello records for compatibility with hypothetical implementations
+ * that require it.
+ */
+# define SSL_MODE_SEND_CLIENTHELLO_TIME 0x00000020L
+# define SSL_MODE_SEND_SERVERHELLO_TIME 0x00000040L
+/*
+ * Send TLS_FALLBACK_SCSV in the ClientHello. To be set only by applications
+ * that reconnect with a downgraded protocol version; see
+ * draft-ietf-tls-downgrade-scsv-00 for details. DO NOT ENABLE THIS if your
+ * application attempts a normal handshake. Only use this in explicit
+ * fallback retries, following the guidance in
+ * draft-ietf-tls-downgrade-scsv-00.
+ */
+# define SSL_MODE_SEND_FALLBACK_SCSV 0x00000080L
+
+/* Cert related flags */
+/*
+ * Many implementations ignore some aspects of the TLS standards such as
+ * enforcing certifcate chain algorithms. When this is set we enforce them.
+ */
+# define SSL_CERT_FLAG_TLS_STRICT 0x00000001L
+
+/* Suite B modes, takes same values as certificate verify flags */
+# define SSL_CERT_FLAG_SUITEB_128_LOS_ONLY 0x10000
+/* Suite B 192 bit only mode */
+# define SSL_CERT_FLAG_SUITEB_192_LOS 0x20000
+/* Suite B 128 bit mode allowing 192 bit algorithms */
+# define SSL_CERT_FLAG_SUITEB_128_LOS 0x30000
+
+/* Perform all sorts of protocol violations for testing purposes */
+# define SSL_CERT_FLAG_BROKEN_PROTOCOL 0x10000000
+
+/* Flags for building certificate chains */
+/* Treat any existing certificates as untrusted CAs */
+# define SSL_BUILD_CHAIN_FLAG_UNTRUSTED 0x1
+/* Don't include root CA in chain */
+# define SSL_BUILD_CHAIN_FLAG_NO_ROOT 0x2
+/* Just check certificates already there */
+# define SSL_BUILD_CHAIN_FLAG_CHECK 0x4
+/* Ignore verification errors */
+# define SSL_BUILD_CHAIN_FLAG_IGNORE_ERROR 0x8
+/* Clear verification errors from queue */
+# define SSL_BUILD_CHAIN_FLAG_CLEAR_ERROR 0x10
+
+/* Flags returned by SSL_check_chain */
+/* Certificate can be used with this session */
+# define CERT_PKEY_VALID 0x1
+/* Certificate can also be used for signing */
+# define CERT_PKEY_SIGN 0x2
+/* EE certificate signing algorithm OK */
+# define CERT_PKEY_EE_SIGNATURE 0x10
+/* CA signature algorithms OK */
+# define CERT_PKEY_CA_SIGNATURE 0x20
+/* EE certificate parameters OK */
+# define CERT_PKEY_EE_PARAM 0x40
+/* CA certificate parameters OK */
+# define CERT_PKEY_CA_PARAM 0x80
+/* Signing explicitly allowed as opposed to SHA1 fallback */
+# define CERT_PKEY_EXPLICIT_SIGN 0x100
+/* Client CA issuer names match (always set for server cert) */
+# define CERT_PKEY_ISSUER_NAME 0x200
+/* Cert type matches client types (always set for server cert) */
+# define CERT_PKEY_CERT_TYPE 0x400
+/* Cert chain suitable to Suite B */
+# define CERT_PKEY_SUITEB 0x800
+
+# define SSL_CONF_FLAG_CMDLINE 0x1
+# define SSL_CONF_FLAG_FILE 0x2
+# define SSL_CONF_FLAG_CLIENT 0x4
+# define SSL_CONF_FLAG_SERVER 0x8
+# define SSL_CONF_FLAG_SHOW_ERRORS 0x10
+# define SSL_CONF_FLAG_CERTIFICATE 0x20
+/* Configuration value types */
+# define SSL_CONF_TYPE_UNKNOWN 0x0
+# define SSL_CONF_TYPE_STRING 0x1
+# define SSL_CONF_TYPE_FILE 0x2
+# define SSL_CONF_TYPE_DIR 0x3
+
+/*
+ * Note: SSL[_CTX]_set_{options,mode} use |= op on the previous value, they
+ * cannot be used to clear bits.
+ */
+
+# define SSL_CTX_set_options(ctx,op) \
+ SSL_CTX_ctrl((ctx),SSL_CTRL_OPTIONS,(op),NULL)
+# define SSL_CTX_clear_options(ctx,op) \
+ SSL_CTX_ctrl((ctx),SSL_CTRL_CLEAR_OPTIONS,(op),NULL)
+# define SSL_CTX_get_options(ctx) \
+ SSL_CTX_ctrl((ctx),SSL_CTRL_OPTIONS,0,NULL)
+# define SSL_set_options(ssl,op) \
+ SSL_ctrl((ssl),SSL_CTRL_OPTIONS,(op),NULL)
+# define SSL_clear_options(ssl,op) \
+ SSL_ctrl((ssl),SSL_CTRL_CLEAR_OPTIONS,(op),NULL)
+# define SSL_get_options(ssl) \
+ SSL_ctrl((ssl),SSL_CTRL_OPTIONS,0,NULL)
+
+# define SSL_CTX_set_mode(ctx,op) \
+ SSL_CTX_ctrl((ctx),SSL_CTRL_MODE,(op),NULL)
+# define SSL_CTX_clear_mode(ctx,op) \
+ SSL_CTX_ctrl((ctx),SSL_CTRL_CLEAR_MODE,(op),NULL)
+# define SSL_CTX_get_mode(ctx) \
+ SSL_CTX_ctrl((ctx),SSL_CTRL_MODE,0,NULL)
+# define SSL_clear_mode(ssl,op) \
+ SSL_ctrl((ssl),SSL_CTRL_CLEAR_MODE,(op),NULL)
+# define SSL_set_mode(ssl,op) \
+ SSL_ctrl((ssl),SSL_CTRL_MODE,(op),NULL)
+# define SSL_get_mode(ssl) \
+ SSL_ctrl((ssl),SSL_CTRL_MODE,0,NULL)
+# define SSL_set_mtu(ssl, mtu) \
+ SSL_ctrl((ssl),SSL_CTRL_SET_MTU,(mtu),NULL)
+# define DTLS_set_link_mtu(ssl, mtu) \
+ SSL_ctrl((ssl),DTLS_CTRL_SET_LINK_MTU,(mtu),NULL)
+# define DTLS_get_link_min_mtu(ssl) \
+ SSL_ctrl((ssl),DTLS_CTRL_GET_LINK_MIN_MTU,0,NULL)
+
+# define SSL_get_secure_renegotiation_support(ssl) \
+ SSL_ctrl((ssl), SSL_CTRL_GET_RI_SUPPORT, 0, NULL)
+
+# ifndef OPENSSL_NO_HEARTBEATS
+# define SSL_heartbeat(ssl) \
+ SSL_ctrl((ssl),SSL_CTRL_TLS_EXT_SEND_HEARTBEAT,0,NULL)
+# endif
+
+# define SSL_CTX_set_cert_flags(ctx,op) \
+ SSL_CTX_ctrl((ctx),SSL_CTRL_CERT_FLAGS,(op),NULL)
+# define SSL_set_cert_flags(s,op) \
+ SSL_ctrl((s),SSL_CTRL_CERT_FLAGS,(op),NULL)
+# define SSL_CTX_clear_cert_flags(ctx,op) \
+ SSL_CTX_ctrl((ctx),SSL_CTRL_CLEAR_CERT_FLAGS,(op),NULL)
+# define SSL_clear_cert_flags(s,op) \
+ SSL_ctrl((s),SSL_CTRL_CLEAR_CERT_FLAGS,(op),NULL)
+
+void SSL_CTX_set_msg_callback(SSL_CTX *ctx,
+ void (*cb) (int write_p, int version,
+ int content_type, const void *buf,
+ size_t len, SSL *ssl, void *arg));
+void SSL_set_msg_callback(SSL *ssl,
+ void (*cb) (int write_p, int version,
+ int content_type, const void *buf,
+ size_t len, SSL *ssl, void *arg));
+# define SSL_CTX_set_msg_callback_arg(ctx, arg) SSL_CTX_ctrl((ctx), SSL_CTRL_SET_MSG_CALLBACK_ARG, 0, (arg))
+# define SSL_set_msg_callback_arg(ssl, arg) SSL_ctrl((ssl), SSL_CTRL_SET_MSG_CALLBACK_ARG, 0, (arg))
+
+# ifndef OPENSSL_NO_SRP
+
+# ifndef OPENSSL_NO_SSL_INTERN
+
+typedef struct srp_ctx_st {
+ /* param for all the callbacks */
+ void *SRP_cb_arg;
+ /* set client Hello login callback */
+ int (*TLS_ext_srp_username_callback) (SSL *, int *, void *);
+ /* set SRP N/g param callback for verification */
+ int (*SRP_verify_param_callback) (SSL *, void *);
+ /* set SRP client passwd callback */
+ char *(*SRP_give_srp_client_pwd_callback) (SSL *, void *);
+ char *login;
+ BIGNUM *N, *g, *s, *B, *A;
+ BIGNUM *a, *b, *v;
+ char *info;
+ int strength;
+ unsigned long srp_Mask;
+} SRP_CTX;
+
+# endif
+
+/* see tls_srp.c */
+int SSL_SRP_CTX_init(SSL *s);
+int SSL_CTX_SRP_CTX_init(SSL_CTX *ctx);
+int SSL_SRP_CTX_free(SSL *ctx);
+int SSL_CTX_SRP_CTX_free(SSL_CTX *ctx);
+int SSL_srp_server_param_with_username(SSL *s, int *ad);
+int SRP_generate_server_master_secret(SSL *s, unsigned char *master_key);
+int SRP_Calc_A_param(SSL *s);
+int SRP_generate_client_master_secret(SSL *s, unsigned char *master_key);
+
+# endif
+
+# if defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_WIN32)
+# define SSL_MAX_CERT_LIST_DEFAULT 1024*30
+ /* 30k max cert list :-) */
+# else
+# define SSL_MAX_CERT_LIST_DEFAULT 1024*100
+ /* 100k max cert list :-) */
+# endif
+
+# define SSL_SESSION_CACHE_MAX_SIZE_DEFAULT (1024*20)
+
+/*
+ * This callback type is used inside SSL_CTX, SSL, and in the functions that
+ * set them. It is used to override the generation of SSL/TLS session IDs in
+ * a server. Return value should be zero on an error, non-zero to proceed.
+ * Also, callbacks should themselves check if the id they generate is unique
+ * otherwise the SSL handshake will fail with an error - callbacks can do
+ * this using the 'ssl' value they're passed by;
+ * SSL_has_matching_session_id(ssl, id, *id_len) The length value passed in
+ * is set at the maximum size the session ID can be. In SSLv2 this is 16
+ * bytes, whereas SSLv3/TLSv1 it is 32 bytes. The callback can alter this
+ * length to be less if desired, but under SSLv2 session IDs are supposed to
+ * be fixed at 16 bytes so the id will be padded after the callback returns
+ * in this case. It is also an error for the callback to set the size to
+ * zero.
+ */
+typedef int (*GEN_SESSION_CB) (const SSL *ssl, unsigned char *id,
+ unsigned int *id_len);
+
+typedef struct ssl_comp_st SSL_COMP;
+
+# ifndef OPENSSL_NO_SSL_INTERN
+
+struct ssl_comp_st {
+ int id;
+ const char *name;
+# ifndef OPENSSL_NO_COMP
+ COMP_METHOD *method;
+# else
+ char *method;
+# endif
+};
+
+DECLARE_STACK_OF(SSL_COMP)
+DECLARE_LHASH_OF(SSL_SESSION);
+
+struct ssl_ctx_st {
+ const SSL_METHOD *method;
+ STACK_OF(SSL_CIPHER) *cipher_list;
+ /* same as above but sorted for lookup */
+ STACK_OF(SSL_CIPHER) *cipher_list_by_id;
+ struct x509_store_st /* X509_STORE */ *cert_store;
+ LHASH_OF(SSL_SESSION) *sessions;
+ /*
+ * Most session-ids that will be cached, default is
+ * SSL_SESSION_CACHE_MAX_SIZE_DEFAULT. 0 is unlimited.
+ */
+ unsigned long session_cache_size;
+ struct ssl_session_st *session_cache_head;
+ struct ssl_session_st *session_cache_tail;
+ /*
+ * This can have one of 2 values, ored together, SSL_SESS_CACHE_CLIENT,
+ * SSL_SESS_CACHE_SERVER, Default is SSL_SESSION_CACHE_SERVER, which
+ * means only SSL_accept which cache SSL_SESSIONS.
+ */
+ int session_cache_mode;
+ /*
+ * If timeout is not 0, it is the default timeout value set when
+ * SSL_new() is called. This has been put in to make life easier to set
+ * things up
+ */
+ long session_timeout;
+ /*
+ * If this callback is not null, it will be called each time a session id
+ * is added to the cache. If this function returns 1, it means that the
+ * callback will do a SSL_SESSION_free() when it has finished using it.
+ * Otherwise, on 0, it means the callback has finished with it. If
+ * remove_session_cb is not null, it will be called when a session-id is
+ * removed from the cache. After the call, OpenSSL will
+ * SSL_SESSION_free() it.
+ */
+ int (*new_session_cb) (struct ssl_st *ssl, SSL_SESSION *sess);
+ void (*remove_session_cb) (struct ssl_ctx_st *ctx, SSL_SESSION *sess);
+ SSL_SESSION *(*get_session_cb) (struct ssl_st *ssl,
+ unsigned char *data, int len, int *copy);
+ struct {
+ int sess_connect; /* SSL new conn - started */
+ int sess_connect_renegotiate; /* SSL reneg - requested */
+ int sess_connect_good; /* SSL new conne/reneg - finished */
+ int sess_accept; /* SSL new accept - started */
+ int sess_accept_renegotiate; /* SSL reneg - requested */
+ int sess_accept_good; /* SSL accept/reneg - finished */
+ int sess_miss; /* session lookup misses */
+ int sess_timeout; /* reuse attempt on timeouted session */
+ int sess_cache_full; /* session removed due to full cache */
+ int sess_hit; /* session reuse actually done */
+ int sess_cb_hit; /* session-id that was not in the cache was
+ * passed back via the callback. This
+ * indicates that the application is
+ * supplying session-id's from other
+ * processes - spooky :-) */
+ } stats;
+
+ int references;
+
+ /* if defined, these override the X509_verify_cert() calls */
+ int (*app_verify_callback) (X509_STORE_CTX *, void *);
+ void *app_verify_arg;
+ /*
+ * before OpenSSL 0.9.7, 'app_verify_arg' was ignored
+ * ('app_verify_callback' was called with just one argument)
+ */
+
+ /* Default password callback. */
+ pem_password_cb *default_passwd_callback;
+
+ /* Default password callback user data. */
+ void *default_passwd_callback_userdata;
+
+ /* get client cert callback */
+ int (*client_cert_cb) (SSL *ssl, X509 **x509, EVP_PKEY **pkey);
+
+ /* cookie generate callback */
+ int (*app_gen_cookie_cb) (SSL *ssl, unsigned char *cookie,
+ unsigned int *cookie_len);
+
+ /* verify cookie callback */
+ int (*app_verify_cookie_cb) (SSL *ssl, unsigned char *cookie,
+ unsigned int cookie_len);
+
+ CRYPTO_EX_DATA ex_data;
+
+ const EVP_MD *rsa_md5; /* For SSLv2 - name is 'ssl2-md5' */
+ const EVP_MD *md5; /* For SSLv3/TLSv1 'ssl3-md5' */
+ const EVP_MD *sha1; /* For SSLv3/TLSv1 'ssl3->sha1' */
+
+ STACK_OF(X509) *extra_certs;
+ STACK_OF(SSL_COMP) *comp_methods; /* stack of SSL_COMP, SSLv3/TLSv1 */
+
+ /* Default values used when no per-SSL value is defined follow */
+
+ /* used if SSL's info_callback is NULL */
+ void (*info_callback) (const SSL *ssl, int type, int val);
+
+ /* what we put in client cert requests */
+ STACK_OF(X509_NAME) *client_CA;
+
+ /*
+ * Default values to use in SSL structures follow (these are copied by
+ * SSL_new)
+ */
+
+ unsigned long options;
+ unsigned long mode;
+ long max_cert_list;
+
+ struct cert_st /* CERT */ *cert;
+ int read_ahead;
+
+ /* callback that allows applications to peek at protocol messages */
+ void (*msg_callback) (int write_p, int version, int content_type,
+ const void *buf, size_t len, SSL *ssl, void *arg);
+ void *msg_callback_arg;
+
+ int verify_mode;
+ unsigned int sid_ctx_length;
+ unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH];
+ /* called 'verify_callback' in the SSL */
+ int (*default_verify_callback) (int ok, X509_STORE_CTX *ctx);
+
+ /* Default generate session ID callback. */
+ GEN_SESSION_CB generate_session_id;
+
+ X509_VERIFY_PARAM *param;
+
+# if 0
+ int purpose; /* Purpose setting */
+ int trust; /* Trust setting */
+# endif
+
+ int quiet_shutdown;
+
+ /*
+ * Maximum amount of data to send in one fragment. actual record size can
+ * be more than this due to padding and MAC overheads.
+ */
+ unsigned int max_send_fragment;
+
+# ifndef OPENSSL_NO_ENGINE
+ /*
+ * Engine to pass requests for client certs to
+ */
+ ENGINE *client_cert_engine;
+# endif
+
+# ifndef OPENSSL_NO_TLSEXT
+ /* TLS extensions servername callback */
+ int (*tlsext_servername_callback) (SSL *, int *, void *);
+ void *tlsext_servername_arg;
+ /* RFC 4507 session ticket keys */
+ unsigned char tlsext_tick_key_name[16];
+ unsigned char tlsext_tick_hmac_key[16];
+ unsigned char tlsext_tick_aes_key[16];
+ /* Callback to support customisation of ticket key setting */
+ int (*tlsext_ticket_key_cb) (SSL *ssl,
+ unsigned char *name, unsigned char *iv,
+ EVP_CIPHER_CTX *ectx,
+ HMAC_CTX *hctx, int enc);
+
+ /* certificate status request info */
+ /* Callback for status request */
+ int (*tlsext_status_cb) (SSL *ssl, void *arg);
+ void *tlsext_status_arg;
+
+ /* draft-rescorla-tls-opaque-prf-input-00.txt information */
+ int (*tlsext_opaque_prf_input_callback) (SSL *, void *peerinput,
+ size_t len, void *arg);
+ void *tlsext_opaque_prf_input_callback_arg;
+# endif
+
+# ifndef OPENSSL_NO_PSK
+ char *psk_identity_hint;
+ unsigned int (*psk_client_callback) (SSL *ssl, const char *hint,
+ char *identity,
+ unsigned int max_identity_len,
+ unsigned char *psk,
+ unsigned int max_psk_len);
+ unsigned int (*psk_server_callback) (SSL *ssl, const char *identity,
+ unsigned char *psk,
+ unsigned int max_psk_len);
+# endif
+
+# ifndef OPENSSL_NO_BUF_FREELISTS
+# define SSL_MAX_BUF_FREELIST_LEN_DEFAULT 32
+ unsigned int freelist_max_len;
+ struct ssl3_buf_freelist_st *wbuf_freelist;
+ struct ssl3_buf_freelist_st *rbuf_freelist;
+# endif
+# ifndef OPENSSL_NO_SRP
+ SRP_CTX srp_ctx; /* ctx for SRP authentication */
+# endif
+
+# ifndef OPENSSL_NO_TLSEXT
+
+# ifndef OPENSSL_NO_NEXTPROTONEG
+ /* Next protocol negotiation information */
+ /* (for experimental NPN extension). */
+
+ /*
+ * For a server, this contains a callback function by which the set of
+ * advertised protocols can be provided.
+ */
+ int (*next_protos_advertised_cb) (SSL *s, const unsigned char **buf,
+ unsigned int *len, void *arg);
+ void *next_protos_advertised_cb_arg;
+ /*
+ * For a client, this contains a callback function that selects the next
+ * protocol from the list provided by the server.
+ */
+ int (*next_proto_select_cb) (SSL *s, unsigned char **out,
+ unsigned char *outlen,
+ const unsigned char *in,
+ unsigned int inlen, void *arg);
+ void *next_proto_select_cb_arg;
+# endif
+ /* SRTP profiles we are willing to do from RFC 5764 */
+ STACK_OF(SRTP_PROTECTION_PROFILE) *srtp_profiles;
+
+ /*
+ * ALPN information (we are in the process of transitioning from NPN to
+ * ALPN.)
+ */
+
+ /*-
+ * For a server, this contains a callback function that allows the
+ * server to select the protocol for the connection.
+ * out: on successful return, this must point to the raw protocol
+ * name (without the length prefix).
+ * outlen: on successful return, this contains the length of |*out|.
+ * in: points to the client's list of supported protocols in
+ * wire-format.
+ * inlen: the length of |in|.
+ */
+ int (*alpn_select_cb) (SSL *s,
+ const unsigned char **out,
+ unsigned char *outlen,
+ const unsigned char *in,
+ unsigned int inlen, void *arg);
+ void *alpn_select_cb_arg;
+
+ /*
+ * For a client, this contains the list of supported protocols in wire
+ * format.
+ */
+ unsigned char *alpn_client_proto_list;
+ unsigned alpn_client_proto_list_len;
+
+# ifndef OPENSSL_NO_EC
+ /* EC extension values inherited by SSL structure */
+ size_t tlsext_ecpointformatlist_length;
+ unsigned char *tlsext_ecpointformatlist;
+ size_t tlsext_ellipticcurvelist_length;
+ unsigned char *tlsext_ellipticcurvelist;
+# endif /* OPENSSL_NO_EC */
+# endif
+};
+
+# endif
+
+# define SSL_SESS_CACHE_OFF 0x0000
+# define SSL_SESS_CACHE_CLIENT 0x0001
+# define SSL_SESS_CACHE_SERVER 0x0002
+# define SSL_SESS_CACHE_BOTH (SSL_SESS_CACHE_CLIENT|SSL_SESS_CACHE_SERVER)
+# define SSL_SESS_CACHE_NO_AUTO_CLEAR 0x0080
+/* enough comments already ... see SSL_CTX_set_session_cache_mode(3) */
+# define SSL_SESS_CACHE_NO_INTERNAL_LOOKUP 0x0100
+# define SSL_SESS_CACHE_NO_INTERNAL_STORE 0x0200
+# define SSL_SESS_CACHE_NO_INTERNAL \
+ (SSL_SESS_CACHE_NO_INTERNAL_LOOKUP|SSL_SESS_CACHE_NO_INTERNAL_STORE)
+
+LHASH_OF(SSL_SESSION) *SSL_CTX_sessions(SSL_CTX *ctx);
+# define SSL_CTX_sess_number(ctx) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_NUMBER,0,NULL)
+# define SSL_CTX_sess_connect(ctx) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT,0,NULL)
+# define SSL_CTX_sess_connect_good(ctx) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT_GOOD,0,NULL)
+# define SSL_CTX_sess_connect_renegotiate(ctx) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT_RENEGOTIATE,0,NULL)
+# define SSL_CTX_sess_accept(ctx) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT,0,NULL)
+# define SSL_CTX_sess_accept_renegotiate(ctx) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT_RENEGOTIATE,0,NULL)
+# define SSL_CTX_sess_accept_good(ctx) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT_GOOD,0,NULL)
+# define SSL_CTX_sess_hits(ctx) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_HIT,0,NULL)
+# define SSL_CTX_sess_cb_hits(ctx) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CB_HIT,0,NULL)
+# define SSL_CTX_sess_misses(ctx) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_MISSES,0,NULL)
+# define SSL_CTX_sess_timeouts(ctx) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_TIMEOUTS,0,NULL)
+# define SSL_CTX_sess_cache_full(ctx) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CACHE_FULL,0,NULL)
+
+void SSL_CTX_sess_set_new_cb(SSL_CTX *ctx,
+ int (*new_session_cb) (struct ssl_st *ssl,
+ SSL_SESSION *sess));
+int (*SSL_CTX_sess_get_new_cb(SSL_CTX *ctx)) (struct ssl_st *ssl,
+ SSL_SESSION *sess);
+void SSL_CTX_sess_set_remove_cb(SSL_CTX *ctx,
+ void (*remove_session_cb) (struct ssl_ctx_st
+ *ctx,
+ SSL_SESSION
+ *sess));
+void (*SSL_CTX_sess_get_remove_cb(SSL_CTX *ctx)) (struct ssl_ctx_st *ctx,
+ SSL_SESSION *sess);
+void SSL_CTX_sess_set_get_cb(SSL_CTX *ctx,
+ SSL_SESSION *(*get_session_cb) (struct ssl_st
+ *ssl,
+ unsigned char
+ *data, int len,
+ int *copy));
+SSL_SESSION *(*SSL_CTX_sess_get_get_cb(SSL_CTX *ctx)) (struct ssl_st *ssl,
+ unsigned char *Data,
+ int len, int *copy);
+void SSL_CTX_set_info_callback(SSL_CTX *ctx,
+ void (*cb) (const SSL *ssl, int type,
+ int val));
+void (*SSL_CTX_get_info_callback(SSL_CTX *ctx)) (const SSL *ssl, int type,
+ int val);
+void SSL_CTX_set_client_cert_cb(SSL_CTX *ctx,
+ int (*client_cert_cb) (SSL *ssl, X509 **x509,
+ EVP_PKEY **pkey));
+int (*SSL_CTX_get_client_cert_cb(SSL_CTX *ctx)) (SSL *ssl, X509 **x509,
+ EVP_PKEY **pkey);
+# ifndef OPENSSL_NO_ENGINE
+int SSL_CTX_set_client_cert_engine(SSL_CTX *ctx, ENGINE *e);
+# endif
+void SSL_CTX_set_cookie_generate_cb(SSL_CTX *ctx,
+ int (*app_gen_cookie_cb) (SSL *ssl,
+ unsigned char
+ *cookie,
+ unsigned int
+ *cookie_len));
+void SSL_CTX_set_cookie_verify_cb(SSL_CTX *ctx,
+ int (*app_verify_cookie_cb) (SSL *ssl,
+ unsigned char
+ *cookie,
+ unsigned int
+ cookie_len));
+# ifndef OPENSSL_NO_NEXTPROTONEG
+void SSL_CTX_set_next_protos_advertised_cb(SSL_CTX *s,
+ int (*cb) (SSL *ssl,
+ const unsigned char
+ **out,
+ unsigned int *outlen,
+ void *arg), void *arg);
+void SSL_CTX_set_next_proto_select_cb(SSL_CTX *s,
+ int (*cb) (SSL *ssl,
+ unsigned char **out,
+ unsigned char *outlen,
+ const unsigned char *in,
+ unsigned int inlen,
+ void *arg), void *arg);
+void SSL_get0_next_proto_negotiated(const SSL *s, const unsigned char **data,
+ unsigned *len);
+# endif
+
+# ifndef OPENSSL_NO_TLSEXT
+int SSL_select_next_proto(unsigned char **out, unsigned char *outlen,
+ const unsigned char *in, unsigned int inlen,
+ const unsigned char *client,
+ unsigned int client_len);
+# endif
+
+# define OPENSSL_NPN_UNSUPPORTED 0
+# define OPENSSL_NPN_NEGOTIATED 1
+# define OPENSSL_NPN_NO_OVERLAP 2
+
+int SSL_CTX_set_alpn_protos(SSL_CTX *ctx, const unsigned char *protos,
+ unsigned protos_len);
+int SSL_set_alpn_protos(SSL *ssl, const unsigned char *protos,
+ unsigned protos_len);
+void SSL_CTX_set_alpn_select_cb(SSL_CTX *ctx,
+ int (*cb) (SSL *ssl,
+ const unsigned char **out,
+ unsigned char *outlen,
+ const unsigned char *in,
+ unsigned int inlen,
+ void *arg), void *arg);
+void SSL_get0_alpn_selected(const SSL *ssl, const unsigned char **data,
+ unsigned *len);
+
+# ifndef OPENSSL_NO_PSK
+/*
+ * the maximum length of the buffer given to callbacks containing the
+ * resulting identity/psk
+ */
+# define PSK_MAX_IDENTITY_LEN 128
+# define PSK_MAX_PSK_LEN 256
+void SSL_CTX_set_psk_client_callback(SSL_CTX *ctx,
+ unsigned int (*psk_client_callback) (SSL
+ *ssl,
+ const
+ char
+ *hint,
+ char
+ *identity,
+ unsigned
+ int
+ max_identity_len,
+ unsigned
+ char
+ *psk,
+ unsigned
+ int
+ max_psk_len));
+void SSL_set_psk_client_callback(SSL *ssl,
+ unsigned int (*psk_client_callback) (SSL
+ *ssl,
+ const
+ char
+ *hint,
+ char
+ *identity,
+ unsigned
+ int
+ max_identity_len,
+ unsigned
+ char
+ *psk,
+ unsigned
+ int
+ max_psk_len));
+void SSL_CTX_set_psk_server_callback(SSL_CTX *ctx,
+ unsigned int (*psk_server_callback) (SSL
+ *ssl,
+ const
+ char
+ *identity,
+ unsigned
+ char
+ *psk,
+ unsigned
+ int
+ max_psk_len));
+void SSL_set_psk_server_callback(SSL *ssl,
+ unsigned int (*psk_server_callback) (SSL
+ *ssl,
+ const
+ char
+ *identity,
+ unsigned
+ char
+ *psk,
+ unsigned
+ int
+ max_psk_len));
+int SSL_CTX_use_psk_identity_hint(SSL_CTX *ctx, const char *identity_hint);
+int SSL_use_psk_identity_hint(SSL *s, const char *identity_hint);
+const char *SSL_get_psk_identity_hint(const SSL *s);
+const char *SSL_get_psk_identity(const SSL *s);
+# endif
+
+# ifndef OPENSSL_NO_TLSEXT
+/* Register callbacks to handle custom TLS Extensions for client or server. */
+
+int SSL_CTX_add_client_custom_ext(SSL_CTX *ctx, unsigned int ext_type,
+ custom_ext_add_cb add_cb,
+ custom_ext_free_cb free_cb,
+ void *add_arg,
+ custom_ext_parse_cb parse_cb,
+ void *parse_arg);
+
+int SSL_CTX_add_server_custom_ext(SSL_CTX *ctx, unsigned int ext_type,
+ custom_ext_add_cb add_cb,
+ custom_ext_free_cb free_cb,
+ void *add_arg,
+ custom_ext_parse_cb parse_cb,
+ void *parse_arg);
+
+int SSL_extension_supported(unsigned int ext_type);
+
+# endif
+
+# define SSL_NOTHING 1
+# define SSL_WRITING 2
+# define SSL_READING 3
+# define SSL_X509_LOOKUP 4
+
+/* These will only be used when doing non-blocking IO */
+# define SSL_want_nothing(s) (SSL_want(s) == SSL_NOTHING)
+# define SSL_want_read(s) (SSL_want(s) == SSL_READING)
+# define SSL_want_write(s) (SSL_want(s) == SSL_WRITING)
+# define SSL_want_x509_lookup(s) (SSL_want(s) == SSL_X509_LOOKUP)
+
+# define SSL_MAC_FLAG_READ_MAC_STREAM 1
+# define SSL_MAC_FLAG_WRITE_MAC_STREAM 2
+
+# ifndef OPENSSL_NO_SSL_INTERN
+
+struct ssl_st {
+ /*
+ * protocol version (one of SSL2_VERSION, SSL3_VERSION, TLS1_VERSION,
+ * DTLS1_VERSION)
+ */
+ int version;
+ /* SSL_ST_CONNECT or SSL_ST_ACCEPT */
+ int type;
+ /* SSLv3 */
+ const SSL_METHOD *method;
+ /*
+ * There are 2 BIO's even though they are normally both the same. This
+ * is so data can be read and written to different handlers
+ */
+# ifndef OPENSSL_NO_BIO
+ /* used by SSL_read */
+ BIO *rbio;
+ /* used by SSL_write */
+ BIO *wbio;
+ /* used during session-id reuse to concatenate messages */
+ BIO *bbio;
+# else
+ /* used by SSL_read */
+ char *rbio;
+ /* used by SSL_write */
+ char *wbio;
+ char *bbio;
+# endif
+ /*
+ * This holds a variable that indicates what we were doing when a 0 or -1
+ * is returned. This is needed for non-blocking IO so we know what
+ * request needs re-doing when in SSL_accept or SSL_connect
+ */
+ int rwstate;
+ /* true when we are actually in SSL_accept() or SSL_connect() */
+ int in_handshake;
+ int (*handshake_func) (SSL *);
+ /*
+ * Imagine that here's a boolean member "init" that is switched as soon
+ * as SSL_set_{accept/connect}_state is called for the first time, so
+ * that "state" and "handshake_func" are properly initialized. But as
+ * handshake_func is == 0 until then, we use this test instead of an
+ * "init" member.
+ */
+ /* are we the server side? - mostly used by SSL_clear */
+ int server;
+ /*
+ * Generate a new session or reuse an old one.
+ * NB: For servers, the 'new' session may actually be a previously
+ * cached session or even the previous session unless
+ * SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION is set
+ */
+ int new_session;
+ /* don't send shutdown packets */
+ int quiet_shutdown;
+ /* we have shut things down, 0x01 sent, 0x02 for received */
+ int shutdown;
+ /* where we are */
+ int state;
+ /* where we are when reading */
+ int rstate;
+ BUF_MEM *init_buf; /* buffer used during init */
+ void *init_msg; /* pointer to handshake message body, set by
+ * ssl3_get_message() */
+ int init_num; /* amount read/written */
+ int init_off; /* amount read/written */
+ /* used internally to point at a raw packet */
+ unsigned char *packet;
+ unsigned int packet_length;
+ struct ssl2_state_st *s2; /* SSLv2 variables */
+ struct ssl3_state_st *s3; /* SSLv3 variables */
+ struct dtls1_state_st *d1; /* DTLSv1 variables */
+ int read_ahead; /* Read as many input bytes as possible (for
+ * non-blocking reads) */
+ /* callback that allows applications to peek at protocol messages */
+ void (*msg_callback) (int write_p, int version, int content_type,
+ const void *buf, size_t len, SSL *ssl, void *arg);
+ void *msg_callback_arg;
+ int hit; /* reusing a previous session */
+ X509_VERIFY_PARAM *param;
+# if 0
+ int purpose; /* Purpose setting */
+ int trust; /* Trust setting */
+# endif
+ /* crypto */
+ STACK_OF(SSL_CIPHER) *cipher_list;
+ STACK_OF(SSL_CIPHER) *cipher_list_by_id;
+ /*
+ * These are the ones being used, the ones in SSL_SESSION are the ones to
+ * be 'copied' into these ones
+ */
+ int mac_flags;
+ EVP_CIPHER_CTX *enc_read_ctx; /* cryptographic state */
+ EVP_MD_CTX *read_hash; /* used for mac generation */
+# ifndef OPENSSL_NO_COMP
+ COMP_CTX *expand; /* uncompress */
+# else
+ char *expand;
+# endif
+ EVP_CIPHER_CTX *enc_write_ctx; /* cryptographic state */
+ EVP_MD_CTX *write_hash; /* used for mac generation */
+# ifndef OPENSSL_NO_COMP
+ COMP_CTX *compress; /* compression */
+# else
+ char *compress;
+# endif
+ /* session info */
+ /* client cert? */
+ /* This is used to hold the server certificate used */
+ struct cert_st /* CERT */ *cert;
+ /*
+ * the session_id_context is used to ensure sessions are only reused in
+ * the appropriate context
+ */
+ unsigned int sid_ctx_length;
+ unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH];
+ /* This can also be in the session once a session is established */
+ SSL_SESSION *session;
+ /* Default generate session ID callback. */
+ GEN_SESSION_CB generate_session_id;
+ /* Used in SSL2 and SSL3 */
+ /*
+ * 0 don't care about verify failure.
+ * 1 fail if verify fails
+ */
+ int verify_mode;
+ /* fail if callback returns 0 */
+ int (*verify_callback) (int ok, X509_STORE_CTX *ctx);
+ /* optional informational callback */
+ void (*info_callback) (const SSL *ssl, int type, int val);
+ /* error bytes to be written */
+ int error;
+ /* actual code */
+ int error_code;
+# ifndef OPENSSL_NO_KRB5
+ /* Kerberos 5 context */
+ KSSL_CTX *kssl_ctx;
+# endif /* OPENSSL_NO_KRB5 */
+# ifndef OPENSSL_NO_PSK
+ unsigned int (*psk_client_callback) (SSL *ssl, const char *hint,
+ char *identity,
+ unsigned int max_identity_len,
+ unsigned char *psk,
+ unsigned int max_psk_len);
+ unsigned int (*psk_server_callback) (SSL *ssl, const char *identity,
+ unsigned char *psk,
+ unsigned int max_psk_len);
+# endif
+ SSL_CTX *ctx;
+ /*
+ * set this flag to 1 and a sleep(1) is put into all SSL_read() and
+ * SSL_write() calls, good for nbio debuging :-)
+ */
+ int debug;
+ /* extra application data */
+ long verify_result;
+ CRYPTO_EX_DATA ex_data;
+ /* for server side, keep the list of CA_dn we can use */
+ STACK_OF(X509_NAME) *client_CA;
+ int references;
+ /* protocol behaviour */
+ unsigned long options;
+ /* API behaviour */
+ unsigned long mode;
+ long max_cert_list;
+ int first_packet;
+ /* what was passed, used for SSLv3/TLS rollback check */
+ int client_version;
+ unsigned int max_send_fragment;
+# ifndef OPENSSL_NO_TLSEXT
+ /* TLS extension debug callback */
+ void (*tlsext_debug_cb) (SSL *s, int client_server, int type,
+ unsigned char *data, int len, void *arg);
+ void *tlsext_debug_arg;
+ char *tlsext_hostname;
+ /*-
+ * no further mod of servername
+ * 0 : call the servername extension callback.
+ * 1 : prepare 2, allow last ack just after in server callback.
+ * 2 : don't call servername callback, no ack in server hello
+ */
+ int servername_done;
+ /* certificate status request info */
+ /* Status type or -1 if no status type */
+ int tlsext_status_type;
+ /* Expect OCSP CertificateStatus message */
+ int tlsext_status_expected;
+ /* OCSP status request only */
+ STACK_OF(OCSP_RESPID) *tlsext_ocsp_ids;
+ X509_EXTENSIONS *tlsext_ocsp_exts;
+ /* OCSP response received or to be sent */
+ unsigned char *tlsext_ocsp_resp;
+ int tlsext_ocsp_resplen;
+ /* RFC4507 session ticket expected to be received or sent */
+ int tlsext_ticket_expected;
+# ifndef OPENSSL_NO_EC
+ size_t tlsext_ecpointformatlist_length;
+ /* our list */
+ unsigned char *tlsext_ecpointformatlist;
+ size_t tlsext_ellipticcurvelist_length;
+ /* our list */
+ unsigned char *tlsext_ellipticcurvelist;
+# endif /* OPENSSL_NO_EC */
+ /*
+ * draft-rescorla-tls-opaque-prf-input-00.txt information to be used for
+ * handshakes
+ */
+ void *tlsext_opaque_prf_input;
+ size_t tlsext_opaque_prf_input_len;
+ /* TLS Session Ticket extension override */
+ TLS_SESSION_TICKET_EXT *tlsext_session_ticket;
+ /* TLS Session Ticket extension callback */
+ tls_session_ticket_ext_cb_fn tls_session_ticket_ext_cb;
+ void *tls_session_ticket_ext_cb_arg;
+ /* TLS pre-shared secret session resumption */
+ tls_session_secret_cb_fn tls_session_secret_cb;
+ void *tls_session_secret_cb_arg;
+ SSL_CTX *initial_ctx; /* initial ctx, used to store sessions */
+# ifndef OPENSSL_NO_NEXTPROTONEG
+ /*
+ * Next protocol negotiation. For the client, this is the protocol that
+ * we sent in NextProtocol and is set when handling ServerHello
+ * extensions. For a server, this is the client's selected_protocol from
+ * NextProtocol and is set when handling the NextProtocol message, before
+ * the Finished message.
+ */
+ unsigned char *next_proto_negotiated;
+ unsigned char next_proto_negotiated_len;
+# endif
+# define session_ctx initial_ctx
+ /* What we'll do */
+ STACK_OF(SRTP_PROTECTION_PROFILE) *srtp_profiles;
+ /* What's been chosen */
+ SRTP_PROTECTION_PROFILE *srtp_profile;
+ /*-
+ * Is use of the Heartbeat extension negotiated?
+ * 0: disabled
+ * 1: enabled
+ * 2: enabled, but not allowed to send Requests
+ */
+ unsigned int tlsext_heartbeat;
+ /* Indicates if a HeartbeatRequest is in flight */
+ unsigned int tlsext_hb_pending;
+ /* HeartbeatRequest sequence number */
+ unsigned int tlsext_hb_seq;
+# else
+# define session_ctx ctx
+# endif /* OPENSSL_NO_TLSEXT */
+ /*-
+ * 1 if we are renegotiating.
+ * 2 if we are a server and are inside a handshake
+ * (i.e. not just sending a HelloRequest)
+ */
+ int renegotiate;
+# ifndef OPENSSL_NO_SRP
+ /* ctx for SRP authentication */
+ SRP_CTX srp_ctx;
+# endif
+# ifndef OPENSSL_NO_TLSEXT
+ /*
+ * For a client, this contains the list of supported protocols in wire
+ * format.
+ */
+ unsigned char *alpn_client_proto_list;
+ unsigned alpn_client_proto_list_len;
+# endif /* OPENSSL_NO_TLSEXT */
+};
+
+# endif
+
+#ifdef __cplusplus
+}
+#endif
+
+# include <openssl/ssl2.h>
+# include <openssl/ssl3.h>
+# include <openssl/tls1.h> /* This is mostly sslv3 with a few tweaks */
+# include <openssl/dtls1.h> /* Datagram TLS */
+# include <openssl/ssl23.h>
+# include <openssl/srtp.h> /* Support for the use_srtp extension */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* compatibility */
+# define SSL_set_app_data(s,arg) (SSL_set_ex_data(s,0,(char *)arg))
+# define SSL_get_app_data(s) (SSL_get_ex_data(s,0))
+# define SSL_SESSION_set_app_data(s,a) (SSL_SESSION_set_ex_data(s,0,(char *)a))
+# define SSL_SESSION_get_app_data(s) (SSL_SESSION_get_ex_data(s,0))
+# define SSL_CTX_get_app_data(ctx) (SSL_CTX_get_ex_data(ctx,0))
+# define SSL_CTX_set_app_data(ctx,arg) (SSL_CTX_set_ex_data(ctx,0,(char *)arg))
+
+/*
+ * The following are the possible values for ssl->state are are used to
+ * indicate where we are up to in the SSL connection establishment. The
+ * macros that follow are about the only things you should need to use and
+ * even then, only when using non-blocking IO. It can also be useful to work
+ * out where you were when the connection failed
+ */
+
+# define SSL_ST_CONNECT 0x1000
+# define SSL_ST_ACCEPT 0x2000
+# define SSL_ST_MASK 0x0FFF
+# define SSL_ST_INIT (SSL_ST_CONNECT|SSL_ST_ACCEPT)
+# define SSL_ST_BEFORE 0x4000
+# define SSL_ST_OK 0x03
+# define SSL_ST_RENEGOTIATE (0x04|SSL_ST_INIT)
+# define SSL_ST_ERR 0x05
+
+# define SSL_CB_LOOP 0x01
+# define SSL_CB_EXIT 0x02
+# define SSL_CB_READ 0x04
+# define SSL_CB_WRITE 0x08
+# define SSL_CB_ALERT 0x4000/* used in callback */
+# define SSL_CB_READ_ALERT (SSL_CB_ALERT|SSL_CB_READ)
+# define SSL_CB_WRITE_ALERT (SSL_CB_ALERT|SSL_CB_WRITE)
+# define SSL_CB_ACCEPT_LOOP (SSL_ST_ACCEPT|SSL_CB_LOOP)
+# define SSL_CB_ACCEPT_EXIT (SSL_ST_ACCEPT|SSL_CB_EXIT)
+# define SSL_CB_CONNECT_LOOP (SSL_ST_CONNECT|SSL_CB_LOOP)
+# define SSL_CB_CONNECT_EXIT (SSL_ST_CONNECT|SSL_CB_EXIT)
+# define SSL_CB_HANDSHAKE_START 0x10
+# define SSL_CB_HANDSHAKE_DONE 0x20
+
+/* Is the SSL_connection established? */
+# define SSL_get_state(a) SSL_state(a)
+# define SSL_is_init_finished(a) (SSL_state(a) == SSL_ST_OK)
+# define SSL_in_init(a) (SSL_state(a)&SSL_ST_INIT)
+# define SSL_in_before(a) (SSL_state(a)&SSL_ST_BEFORE)
+# define SSL_in_connect_init(a) (SSL_state(a)&SSL_ST_CONNECT)
+# define SSL_in_accept_init(a) (SSL_state(a)&SSL_ST_ACCEPT)
+
+/*
+ * The following 2 states are kept in ssl->rstate when reads fail, you should
+ * not need these
+ */
+# define SSL_ST_READ_HEADER 0xF0
+# define SSL_ST_READ_BODY 0xF1
+# define SSL_ST_READ_DONE 0xF2
+
+/*-
+ * Obtain latest Finished message
+ * -- that we sent (SSL_get_finished)
+ * -- that we expected from peer (SSL_get_peer_finished).
+ * Returns length (0 == no Finished so far), copies up to 'count' bytes.
+ */
+size_t SSL_get_finished(const SSL *s, void *buf, size_t count);
+size_t SSL_get_peer_finished(const SSL *s, void *buf, size_t count);
+
+/*
+ * use either SSL_VERIFY_NONE or SSL_VERIFY_PEER, the last 2 options are
+ * 'ored' with SSL_VERIFY_PEER if they are desired
+ */
+# define SSL_VERIFY_NONE 0x00
+# define SSL_VERIFY_PEER 0x01
+# define SSL_VERIFY_FAIL_IF_NO_PEER_CERT 0x02
+# define SSL_VERIFY_CLIENT_ONCE 0x04
+
+# define OpenSSL_add_ssl_algorithms() SSL_library_init()
+# define SSLeay_add_ssl_algorithms() SSL_library_init()
+
+/* this is for backward compatibility */
+# if 0 /* NEW_SSLEAY */
+# define SSL_CTX_set_default_verify(a,b,c) SSL_CTX_set_verify(a,b,c)
+# define SSL_set_pref_cipher(c,n) SSL_set_cipher_list(c,n)
+# define SSL_add_session(a,b) SSL_CTX_add_session((a),(b))
+# define SSL_remove_session(a,b) SSL_CTX_remove_session((a),(b))
+# define SSL_flush_sessions(a,b) SSL_CTX_flush_sessions((a),(b))
+# endif
+/* More backward compatibility */
+# define SSL_get_cipher(s) \
+ SSL_CIPHER_get_name(SSL_get_current_cipher(s))
+# define SSL_get_cipher_bits(s,np) \
+ SSL_CIPHER_get_bits(SSL_get_current_cipher(s),np)
+# define SSL_get_cipher_version(s) \
+ SSL_CIPHER_get_version(SSL_get_current_cipher(s))
+# define SSL_get_cipher_name(s) \
+ SSL_CIPHER_get_name(SSL_get_current_cipher(s))
+# define SSL_get_time(a) SSL_SESSION_get_time(a)
+# define SSL_set_time(a,b) SSL_SESSION_set_time((a),(b))
+# define SSL_get_timeout(a) SSL_SESSION_get_timeout(a)
+# define SSL_set_timeout(a,b) SSL_SESSION_set_timeout((a),(b))
+
+# define d2i_SSL_SESSION_bio(bp,s_id) ASN1_d2i_bio_of(SSL_SESSION,SSL_SESSION_new,d2i_SSL_SESSION,bp,s_id)
+# define i2d_SSL_SESSION_bio(bp,s_id) ASN1_i2d_bio_of(SSL_SESSION,i2d_SSL_SESSION,bp,s_id)
+
+DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION)
+# define SSL_AD_REASON_OFFSET 1000/* offset to get SSL_R_... value
+ * from SSL_AD_... */
+/* These alert types are for SSLv3 and TLSv1 */
+# define SSL_AD_CLOSE_NOTIFY SSL3_AD_CLOSE_NOTIFY
+/* fatal */
+# define SSL_AD_UNEXPECTED_MESSAGE SSL3_AD_UNEXPECTED_MESSAGE
+/* fatal */
+# define SSL_AD_BAD_RECORD_MAC SSL3_AD_BAD_RECORD_MAC
+# define SSL_AD_DECRYPTION_FAILED TLS1_AD_DECRYPTION_FAILED
+# define SSL_AD_RECORD_OVERFLOW TLS1_AD_RECORD_OVERFLOW
+/* fatal */
+# define SSL_AD_DECOMPRESSION_FAILURE SSL3_AD_DECOMPRESSION_FAILURE
+/* fatal */
+# define SSL_AD_HANDSHAKE_FAILURE SSL3_AD_HANDSHAKE_FAILURE
+/* Not for TLS */
+# define SSL_AD_NO_CERTIFICATE SSL3_AD_NO_CERTIFICATE
+# define SSL_AD_BAD_CERTIFICATE SSL3_AD_BAD_CERTIFICATE
+# define SSL_AD_UNSUPPORTED_CERTIFICATE SSL3_AD_UNSUPPORTED_CERTIFICATE
+# define SSL_AD_CERTIFICATE_REVOKED SSL3_AD_CERTIFICATE_REVOKED
+# define SSL_AD_CERTIFICATE_EXPIRED SSL3_AD_CERTIFICATE_EXPIRED
+# define SSL_AD_CERTIFICATE_UNKNOWN SSL3_AD_CERTIFICATE_UNKNOWN
+/* fatal */
+# define SSL_AD_ILLEGAL_PARAMETER SSL3_AD_ILLEGAL_PARAMETER
+/* fatal */
+# define SSL_AD_UNKNOWN_CA TLS1_AD_UNKNOWN_CA
+/* fatal */
+# define SSL_AD_ACCESS_DENIED TLS1_AD_ACCESS_DENIED
+/* fatal */
+# define SSL_AD_DECODE_ERROR TLS1_AD_DECODE_ERROR
+# define SSL_AD_DECRYPT_ERROR TLS1_AD_DECRYPT_ERROR
+/* fatal */
+# define SSL_AD_EXPORT_RESTRICTION TLS1_AD_EXPORT_RESTRICTION
+/* fatal */
+# define SSL_AD_PROTOCOL_VERSION TLS1_AD_PROTOCOL_VERSION
+/* fatal */
+# define SSL_AD_INSUFFICIENT_SECURITY TLS1_AD_INSUFFICIENT_SECURITY
+/* fatal */
+# define SSL_AD_INTERNAL_ERROR TLS1_AD_INTERNAL_ERROR
+# define SSL_AD_USER_CANCELLED TLS1_AD_USER_CANCELLED
+# define SSL_AD_NO_RENEGOTIATION TLS1_AD_NO_RENEGOTIATION
+# define SSL_AD_UNSUPPORTED_EXTENSION TLS1_AD_UNSUPPORTED_EXTENSION
+# define SSL_AD_CERTIFICATE_UNOBTAINABLE TLS1_AD_CERTIFICATE_UNOBTAINABLE
+# define SSL_AD_UNRECOGNIZED_NAME TLS1_AD_UNRECOGNIZED_NAME
+# define SSL_AD_BAD_CERTIFICATE_STATUS_RESPONSE TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE
+# define SSL_AD_BAD_CERTIFICATE_HASH_VALUE TLS1_AD_BAD_CERTIFICATE_HASH_VALUE
+/* fatal */
+# define SSL_AD_UNKNOWN_PSK_IDENTITY TLS1_AD_UNKNOWN_PSK_IDENTITY
+/* fatal */
+# define SSL_AD_INAPPROPRIATE_FALLBACK TLS1_AD_INAPPROPRIATE_FALLBACK
+# define SSL_ERROR_NONE 0
+# define SSL_ERROR_SSL 1
+# define SSL_ERROR_WANT_READ 2
+# define SSL_ERROR_WANT_WRITE 3
+# define SSL_ERROR_WANT_X509_LOOKUP 4
+# define SSL_ERROR_SYSCALL 5/* look at error stack/return
+ * value/errno */
+# define SSL_ERROR_ZERO_RETURN 6
+# define SSL_ERROR_WANT_CONNECT 7
+# define SSL_ERROR_WANT_ACCEPT 8
+# define SSL_CTRL_NEED_TMP_RSA 1
+# define SSL_CTRL_SET_TMP_RSA 2
+# define SSL_CTRL_SET_TMP_DH 3
+# define SSL_CTRL_SET_TMP_ECDH 4
+# define SSL_CTRL_SET_TMP_RSA_CB 5
+# define SSL_CTRL_SET_TMP_DH_CB 6
+# define SSL_CTRL_SET_TMP_ECDH_CB 7
+# define SSL_CTRL_GET_SESSION_REUSED 8
+# define SSL_CTRL_GET_CLIENT_CERT_REQUEST 9
+# define SSL_CTRL_GET_NUM_RENEGOTIATIONS 10
+# define SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS 11
+# define SSL_CTRL_GET_TOTAL_RENEGOTIATIONS 12
+# define SSL_CTRL_GET_FLAGS 13
+# define SSL_CTRL_EXTRA_CHAIN_CERT 14
+# define SSL_CTRL_SET_MSG_CALLBACK 15
+# define SSL_CTRL_SET_MSG_CALLBACK_ARG 16
+/* only applies to datagram connections */
+# define SSL_CTRL_SET_MTU 17
+/* Stats */
+# define SSL_CTRL_SESS_NUMBER 20
+# define SSL_CTRL_SESS_CONNECT 21
+# define SSL_CTRL_SESS_CONNECT_GOOD 22
+# define SSL_CTRL_SESS_CONNECT_RENEGOTIATE 23
+# define SSL_CTRL_SESS_ACCEPT 24
+# define SSL_CTRL_SESS_ACCEPT_GOOD 25
+# define SSL_CTRL_SESS_ACCEPT_RENEGOTIATE 26
+# define SSL_CTRL_SESS_HIT 27
+# define SSL_CTRL_SESS_CB_HIT 28
+# define SSL_CTRL_SESS_MISSES 29
+# define SSL_CTRL_SESS_TIMEOUTS 30
+# define SSL_CTRL_SESS_CACHE_FULL 31
+# define SSL_CTRL_OPTIONS 32
+# define SSL_CTRL_MODE 33
+# define SSL_CTRL_GET_READ_AHEAD 40
+# define SSL_CTRL_SET_READ_AHEAD 41
+# define SSL_CTRL_SET_SESS_CACHE_SIZE 42
+# define SSL_CTRL_GET_SESS_CACHE_SIZE 43
+# define SSL_CTRL_SET_SESS_CACHE_MODE 44
+# define SSL_CTRL_GET_SESS_CACHE_MODE 45
+# define SSL_CTRL_GET_MAX_CERT_LIST 50
+# define SSL_CTRL_SET_MAX_CERT_LIST 51
+# define SSL_CTRL_SET_MAX_SEND_FRAGMENT 52
+/* see tls1.h for macros based on these */
+# ifndef OPENSSL_NO_TLSEXT
+# define SSL_CTRL_SET_TLSEXT_SERVERNAME_CB 53
+# define SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG 54
+# define SSL_CTRL_SET_TLSEXT_HOSTNAME 55
+# define SSL_CTRL_SET_TLSEXT_DEBUG_CB 56
+# define SSL_CTRL_SET_TLSEXT_DEBUG_ARG 57
+# define SSL_CTRL_GET_TLSEXT_TICKET_KEYS 58
+# define SSL_CTRL_SET_TLSEXT_TICKET_KEYS 59
+# define SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT 60
+# define SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB 61
+# define SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB_ARG 62
+# define SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB 63
+# define SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG 64
+# define SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE 65
+# define SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS 66
+# define SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS 67
+# define SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS 68
+# define SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS 69
+# define SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP 70
+# define SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP 71
+# define SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB 72
+# define SSL_CTRL_SET_TLS_EXT_SRP_USERNAME_CB 75
+# define SSL_CTRL_SET_SRP_VERIFY_PARAM_CB 76
+# define SSL_CTRL_SET_SRP_GIVE_CLIENT_PWD_CB 77
+# define SSL_CTRL_SET_SRP_ARG 78
+# define SSL_CTRL_SET_TLS_EXT_SRP_USERNAME 79
+# define SSL_CTRL_SET_TLS_EXT_SRP_STRENGTH 80
+# define SSL_CTRL_SET_TLS_EXT_SRP_PASSWORD 81
+# ifndef OPENSSL_NO_HEARTBEATS
+# define SSL_CTRL_TLS_EXT_SEND_HEARTBEAT 85
+# define SSL_CTRL_GET_TLS_EXT_HEARTBEAT_PENDING 86
+# define SSL_CTRL_SET_TLS_EXT_HEARTBEAT_NO_REQUESTS 87
+# endif
+# endif /* OPENSSL_NO_TLSEXT */
+# define DTLS_CTRL_GET_TIMEOUT 73
+# define DTLS_CTRL_HANDLE_TIMEOUT 74
+# define DTLS_CTRL_LISTEN 75
+# define SSL_CTRL_GET_RI_SUPPORT 76
+# define SSL_CTRL_CLEAR_OPTIONS 77
+# define SSL_CTRL_CLEAR_MODE 78
+# define SSL_CTRL_GET_EXTRA_CHAIN_CERTS 82
+# define SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS 83
+# define SSL_CTRL_CHAIN 88
+# define SSL_CTRL_CHAIN_CERT 89
+# define SSL_CTRL_GET_CURVES 90
+# define SSL_CTRL_SET_CURVES 91
+# define SSL_CTRL_SET_CURVES_LIST 92
+# define SSL_CTRL_GET_SHARED_CURVE 93
+# define SSL_CTRL_SET_ECDH_AUTO 94
+# define SSL_CTRL_SET_SIGALGS 97
+# define SSL_CTRL_SET_SIGALGS_LIST 98
+# define SSL_CTRL_CERT_FLAGS 99
+# define SSL_CTRL_CLEAR_CERT_FLAGS 100
+# define SSL_CTRL_SET_CLIENT_SIGALGS 101
+# define SSL_CTRL_SET_CLIENT_SIGALGS_LIST 102
+# define SSL_CTRL_GET_CLIENT_CERT_TYPES 103
+# define SSL_CTRL_SET_CLIENT_CERT_TYPES 104
+# define SSL_CTRL_BUILD_CERT_CHAIN 105
+# define SSL_CTRL_SET_VERIFY_CERT_STORE 106
+# define SSL_CTRL_SET_CHAIN_CERT_STORE 107
+# define SSL_CTRL_GET_PEER_SIGNATURE_NID 108
+# define SSL_CTRL_GET_SERVER_TMP_KEY 109
+# define SSL_CTRL_GET_RAW_CIPHERLIST 110
+# define SSL_CTRL_GET_EC_POINT_FORMATS 111
+# define SSL_CTRL_GET_CHAIN_CERTS 115
+# define SSL_CTRL_SELECT_CURRENT_CERT 116
+# define SSL_CTRL_SET_CURRENT_CERT 117
+# define SSL_CTRL_CHECK_PROTO_VERSION 119
+# define DTLS_CTRL_SET_LINK_MTU 120
+# define DTLS_CTRL_GET_LINK_MIN_MTU 121
+# define SSL_CERT_SET_FIRST 1
+# define SSL_CERT_SET_NEXT 2
+# define SSL_CERT_SET_SERVER 3
+# define DTLSv1_get_timeout(ssl, arg) \
+ SSL_ctrl(ssl,DTLS_CTRL_GET_TIMEOUT,0, (void *)arg)
+# define DTLSv1_handle_timeout(ssl) \
+ SSL_ctrl(ssl,DTLS_CTRL_HANDLE_TIMEOUT,0, NULL)
+# define DTLSv1_listen(ssl, peer) \
+ SSL_ctrl(ssl,DTLS_CTRL_LISTEN,0, (void *)peer)
+# define SSL_session_reused(ssl) \
+ SSL_ctrl((ssl),SSL_CTRL_GET_SESSION_REUSED,0,NULL)
+# define SSL_num_renegotiations(ssl) \
+ SSL_ctrl((ssl),SSL_CTRL_GET_NUM_RENEGOTIATIONS,0,NULL)
+# define SSL_clear_num_renegotiations(ssl) \
+ SSL_ctrl((ssl),SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS,0,NULL)
+# define SSL_total_renegotiations(ssl) \
+ SSL_ctrl((ssl),SSL_CTRL_GET_TOTAL_RENEGOTIATIONS,0,NULL)
+# define SSL_CTX_need_tmp_RSA(ctx) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_NEED_TMP_RSA,0,NULL)
+# define SSL_CTX_set_tmp_rsa(ctx,rsa) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_RSA,0,(char *)rsa)
+# define SSL_CTX_set_tmp_dh(ctx,dh) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_DH,0,(char *)dh)
+# define SSL_CTX_set_tmp_ecdh(ctx,ecdh) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_ECDH,0,(char *)ecdh)
+# define SSL_need_tmp_RSA(ssl) \
+ SSL_ctrl(ssl,SSL_CTRL_NEED_TMP_RSA,0,NULL)
+# define SSL_set_tmp_rsa(ssl,rsa) \
+ SSL_ctrl(ssl,SSL_CTRL_SET_TMP_RSA,0,(char *)rsa)
+# define SSL_set_tmp_dh(ssl,dh) \
+ SSL_ctrl(ssl,SSL_CTRL_SET_TMP_DH,0,(char *)dh)
+# define SSL_set_tmp_ecdh(ssl,ecdh) \
+ SSL_ctrl(ssl,SSL_CTRL_SET_TMP_ECDH,0,(char *)ecdh)
+# define SSL_CTX_add_extra_chain_cert(ctx,x509) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_EXTRA_CHAIN_CERT,0,(char *)x509)
+# define SSL_CTX_get_extra_chain_certs(ctx,px509) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_GET_EXTRA_CHAIN_CERTS,0,px509)
+# define SSL_CTX_get_extra_chain_certs_only(ctx,px509) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_GET_EXTRA_CHAIN_CERTS,1,px509)
+# define SSL_CTX_clear_extra_chain_certs(ctx) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS,0,NULL)
+# define SSL_CTX_set0_chain(ctx,sk) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_CHAIN,0,(char *)sk)
+# define SSL_CTX_set1_chain(ctx,sk) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_CHAIN,1,(char *)sk)
+# define SSL_CTX_add0_chain_cert(ctx,x509) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_CHAIN_CERT,0,(char *)x509)
+# define SSL_CTX_add1_chain_cert(ctx,x509) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_CHAIN_CERT,1,(char *)x509)
+# define SSL_CTX_get0_chain_certs(ctx,px509) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_GET_CHAIN_CERTS,0,px509)
+# define SSL_CTX_clear_chain_certs(ctx) \
+ SSL_CTX_set0_chain(ctx,NULL)
+# define SSL_CTX_build_cert_chain(ctx, flags) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_BUILD_CERT_CHAIN, flags, NULL)
+# define SSL_CTX_select_current_cert(ctx,x509) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SELECT_CURRENT_CERT,0,(char *)x509)
+# define SSL_CTX_set_current_cert(ctx, op) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CURRENT_CERT, op, NULL)
+# define SSL_CTX_set0_verify_cert_store(ctx,st) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_VERIFY_CERT_STORE,0,(char *)st)
+# define SSL_CTX_set1_verify_cert_store(ctx,st) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_VERIFY_CERT_STORE,1,(char *)st)
+# define SSL_CTX_set0_chain_cert_store(ctx,st) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CHAIN_CERT_STORE,0,(char *)st)
+# define SSL_CTX_set1_chain_cert_store(ctx,st) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CHAIN_CERT_STORE,1,(char *)st)
+# define SSL_set0_chain(ctx,sk) \
+ SSL_ctrl(ctx,SSL_CTRL_CHAIN,0,(char *)sk)
+# define SSL_set1_chain(ctx,sk) \
+ SSL_ctrl(ctx,SSL_CTRL_CHAIN,1,(char *)sk)
+# define SSL_add0_chain_cert(ctx,x509) \
+ SSL_ctrl(ctx,SSL_CTRL_CHAIN_CERT,0,(char *)x509)
+# define SSL_add1_chain_cert(ctx,x509) \
+ SSL_ctrl(ctx,SSL_CTRL_CHAIN_CERT,1,(char *)x509)
+# define SSL_get0_chain_certs(ctx,px509) \
+ SSL_ctrl(ctx,SSL_CTRL_GET_CHAIN_CERTS,0,px509)
+# define SSL_clear_chain_certs(ctx) \
+ SSL_set0_chain(ctx,NULL)
+# define SSL_build_cert_chain(s, flags) \
+ SSL_ctrl(s,SSL_CTRL_BUILD_CERT_CHAIN, flags, NULL)
+# define SSL_select_current_cert(ctx,x509) \
+ SSL_ctrl(ctx,SSL_CTRL_SELECT_CURRENT_CERT,0,(char *)x509)
+# define SSL_set_current_cert(ctx,op) \
+ SSL_ctrl(ctx,SSL_CTRL_SET_CURRENT_CERT, op, NULL)
+# define SSL_set0_verify_cert_store(s,st) \
+ SSL_ctrl(s,SSL_CTRL_SET_VERIFY_CERT_STORE,0,(char *)st)
+# define SSL_set1_verify_cert_store(s,st) \
+ SSL_ctrl(s,SSL_CTRL_SET_VERIFY_CERT_STORE,1,(char *)st)
+# define SSL_set0_chain_cert_store(s,st) \
+ SSL_ctrl(s,SSL_CTRL_SET_CHAIN_CERT_STORE,0,(char *)st)
+# define SSL_set1_chain_cert_store(s,st) \
+ SSL_ctrl(s,SSL_CTRL_SET_CHAIN_CERT_STORE,1,(char *)st)
+# define SSL_get1_curves(ctx, s) \
+ SSL_ctrl(ctx,SSL_CTRL_GET_CURVES,0,(char *)s)
+# define SSL_CTX_set1_curves(ctx, clist, clistlen) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CURVES,clistlen,(char *)clist)
+# define SSL_CTX_set1_curves_list(ctx, s) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CURVES_LIST,0,(char *)s)
+# define SSL_set1_curves(ctx, clist, clistlen) \
+ SSL_ctrl(ctx,SSL_CTRL_SET_CURVES,clistlen,(char *)clist)
+# define SSL_set1_curves_list(ctx, s) \
+ SSL_ctrl(ctx,SSL_CTRL_SET_CURVES_LIST,0,(char *)s)
+# define SSL_get_shared_curve(s, n) \
+ SSL_ctrl(s,SSL_CTRL_GET_SHARED_CURVE,n,NULL)
+# define SSL_CTX_set_ecdh_auto(ctx, onoff) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_ECDH_AUTO,onoff,NULL)
+# define SSL_set_ecdh_auto(s, onoff) \
+ SSL_ctrl(s,SSL_CTRL_SET_ECDH_AUTO,onoff,NULL)
+# define SSL_CTX_set1_sigalgs(ctx, slist, slistlen) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SIGALGS,slistlen,(int *)slist)
+# define SSL_CTX_set1_sigalgs_list(ctx, s) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SIGALGS_LIST,0,(char *)s)
+# define SSL_set1_sigalgs(ctx, slist, slistlen) \
+ SSL_ctrl(ctx,SSL_CTRL_SET_SIGALGS,clistlen,(int *)slist)
+# define SSL_set1_sigalgs_list(ctx, s) \
+ SSL_ctrl(ctx,SSL_CTRL_SET_SIGALGS_LIST,0,(char *)s)
+# define SSL_CTX_set1_client_sigalgs(ctx, slist, slistlen) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CLIENT_SIGALGS,slistlen,(int *)slist)
+# define SSL_CTX_set1_client_sigalgs_list(ctx, s) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CLIENT_SIGALGS_LIST,0,(char *)s)
+# define SSL_set1_client_sigalgs(ctx, slist, slistlen) \
+ SSL_ctrl(ctx,SSL_CTRL_SET_CLIENT_SIGALGS,clistlen,(int *)slist)
+# define SSL_set1_client_sigalgs_list(ctx, s) \
+ SSL_ctrl(ctx,SSL_CTRL_SET_CLIENT_SIGALGS_LIST,0,(char *)s)
+# define SSL_get0_certificate_types(s, clist) \
+ SSL_ctrl(s, SSL_CTRL_GET_CLIENT_CERT_TYPES, 0, (char *)clist)
+# define SSL_CTX_set1_client_certificate_types(ctx, clist, clistlen) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CLIENT_CERT_TYPES,clistlen,(char *)clist)
+# define SSL_set1_client_certificate_types(s, clist, clistlen) \
+ SSL_ctrl(s,SSL_CTRL_SET_CLIENT_CERT_TYPES,clistlen,(char *)clist)
+# define SSL_get_peer_signature_nid(s, pn) \
+ SSL_ctrl(s,SSL_CTRL_GET_PEER_SIGNATURE_NID,0,pn)
+# define SSL_get_server_tmp_key(s, pk) \
+ SSL_ctrl(s,SSL_CTRL_GET_SERVER_TMP_KEY,0,pk)
+# define SSL_get0_raw_cipherlist(s, plst) \
+ SSL_ctrl(s,SSL_CTRL_GET_RAW_CIPHERLIST,0,(char *)plst)
+# define SSL_get0_ec_point_formats(s, plst) \
+ SSL_ctrl(s,SSL_CTRL_GET_EC_POINT_FORMATS,0,(char *)plst)
+# ifndef OPENSSL_NO_BIO
+BIO_METHOD *BIO_f_ssl(void);
+BIO *BIO_new_ssl(SSL_CTX *ctx, int client);
+BIO *BIO_new_ssl_connect(SSL_CTX *ctx);
+BIO *BIO_new_buffer_ssl_connect(SSL_CTX *ctx);
+int BIO_ssl_copy_session_id(BIO *to, BIO *from);
+void BIO_ssl_shutdown(BIO *ssl_bio);
+
+# endif
+
+int SSL_CTX_set_cipher_list(SSL_CTX *, const char *str);
+SSL_CTX *SSL_CTX_new(const SSL_METHOD *meth);
+void SSL_CTX_free(SSL_CTX *);
+long SSL_CTX_set_timeout(SSL_CTX *ctx, long t);
+long SSL_CTX_get_timeout(const SSL_CTX *ctx);
+X509_STORE *SSL_CTX_get_cert_store(const SSL_CTX *);
+void SSL_CTX_set_cert_store(SSL_CTX *, X509_STORE *);
+int SSL_want(const SSL *s);
+int SSL_clear(SSL *s);
+
+void SSL_CTX_flush_sessions(SSL_CTX *ctx, long tm);
+
+const SSL_CIPHER *SSL_get_current_cipher(const SSL *s);
+int SSL_CIPHER_get_bits(const SSL_CIPHER *c, int *alg_bits);
+char *SSL_CIPHER_get_version(const SSL_CIPHER *c);
+const char *SSL_CIPHER_get_name(const SSL_CIPHER *c);
+unsigned long SSL_CIPHER_get_id(const SSL_CIPHER *c);
+
+int SSL_get_fd(const SSL *s);
+int SSL_get_rfd(const SSL *s);
+int SSL_get_wfd(const SSL *s);
+const char *SSL_get_cipher_list(const SSL *s, int n);
+char *SSL_get_shared_ciphers(const SSL *s, char *buf, int len);
+int SSL_get_read_ahead(const SSL *s);
+int SSL_pending(const SSL *s);
+# ifndef OPENSSL_NO_SOCK
+int SSL_set_fd(SSL *s, int fd);
+int SSL_set_rfd(SSL *s, int fd);
+int SSL_set_wfd(SSL *s, int fd);
+# endif
+# ifndef OPENSSL_NO_BIO
+void SSL_set_bio(SSL *s, BIO *rbio, BIO *wbio);
+BIO *SSL_get_rbio(const SSL *s);
+BIO *SSL_get_wbio(const SSL *s);
+# endif
+int SSL_set_cipher_list(SSL *s, const char *str);
+void SSL_set_read_ahead(SSL *s, int yes);
+int SSL_get_verify_mode(const SSL *s);
+int SSL_get_verify_depth(const SSL *s);
+int (*SSL_get_verify_callback(const SSL *s)) (int, X509_STORE_CTX *);
+void SSL_set_verify(SSL *s, int mode,
+ int (*callback) (int ok, X509_STORE_CTX *ctx));
+void SSL_set_verify_depth(SSL *s, int depth);
+void SSL_set_cert_cb(SSL *s, int (*cb) (SSL *ssl, void *arg), void *arg);
+# ifndef OPENSSL_NO_RSA
+int SSL_use_RSAPrivateKey(SSL *ssl, RSA *rsa);
+# endif
+int SSL_use_RSAPrivateKey_ASN1(SSL *ssl, unsigned char *d, long len);
+int SSL_use_PrivateKey(SSL *ssl, EVP_PKEY *pkey);
+int SSL_use_PrivateKey_ASN1(int pk, SSL *ssl, const unsigned char *d,
+ long len);
+int SSL_use_certificate(SSL *ssl, X509 *x);
+int SSL_use_certificate_ASN1(SSL *ssl, const unsigned char *d, int len);
+
+# ifndef OPENSSL_NO_TLSEXT
+/* Set serverinfo data for the current active cert. */
+int SSL_CTX_use_serverinfo(SSL_CTX *ctx, const unsigned char *serverinfo,
+ size_t serverinfo_length);
+# ifndef OPENSSL_NO_STDIO
+int SSL_CTX_use_serverinfo_file(SSL_CTX *ctx, const char *file);
+# endif /* NO_STDIO */
+
+# endif
+
+# ifndef OPENSSL_NO_STDIO
+int SSL_use_RSAPrivateKey_file(SSL *ssl, const char *file, int type);
+int SSL_use_PrivateKey_file(SSL *ssl, const char *file, int type);
+int SSL_use_certificate_file(SSL *ssl, const char *file, int type);
+int SSL_CTX_use_RSAPrivateKey_file(SSL_CTX *ctx, const char *file, int type);
+int SSL_CTX_use_PrivateKey_file(SSL_CTX *ctx, const char *file, int type);
+int SSL_CTX_use_certificate_file(SSL_CTX *ctx, const char *file, int type);
+/* PEM type */
+int SSL_CTX_use_certificate_chain_file(SSL_CTX *ctx, const char *file);
+STACK_OF(X509_NAME) *SSL_load_client_CA_file(const char *file);
+int SSL_add_file_cert_subjects_to_stack(STACK_OF(X509_NAME) *stackCAs,
+ const char *file);
+# ifndef OPENSSL_SYS_VMS
+/* XXXXX: Better scheme needed! [was: #ifndef MAC_OS_pre_X] */
+# ifndef OPENSSL_SYS_MACINTOSH_CLASSIC
+int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stackCAs,
+ const char *dir);
+# endif
+# endif
+
+# endif
+
+void SSL_load_error_strings(void);
+const char *SSL_state_string(const SSL *s);
+const char *SSL_rstate_string(const SSL *s);
+const char *SSL_state_string_long(const SSL *s);
+const char *SSL_rstate_string_long(const SSL *s);
+long SSL_SESSION_get_time(const SSL_SESSION *s);
+long SSL_SESSION_set_time(SSL_SESSION *s, long t);
+long SSL_SESSION_get_timeout(const SSL_SESSION *s);
+long SSL_SESSION_set_timeout(SSL_SESSION *s, long t);
+void SSL_copy_session_id(SSL *to, const SSL *from);
+X509 *SSL_SESSION_get0_peer(SSL_SESSION *s);
+int SSL_SESSION_set1_id_context(SSL_SESSION *s, const unsigned char *sid_ctx,
+ unsigned int sid_ctx_len);
+
+SSL_SESSION *SSL_SESSION_new(void);
+const unsigned char *SSL_SESSION_get_id(const SSL_SESSION *s,
+ unsigned int *len);
+unsigned int SSL_SESSION_get_compress_id(const SSL_SESSION *s);
+# ifndef OPENSSL_NO_FP_API
+int SSL_SESSION_print_fp(FILE *fp, const SSL_SESSION *ses);
+# endif
+# ifndef OPENSSL_NO_BIO
+int SSL_SESSION_print(BIO *fp, const SSL_SESSION *ses);
+# endif
+void SSL_SESSION_free(SSL_SESSION *ses);
+int i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp);
+int SSL_set_session(SSL *to, SSL_SESSION *session);
+int SSL_CTX_add_session(SSL_CTX *s, SSL_SESSION *c);
+int SSL_CTX_remove_session(SSL_CTX *, SSL_SESSION *c);
+int SSL_CTX_set_generate_session_id(SSL_CTX *, GEN_SESSION_CB);
+int SSL_set_generate_session_id(SSL *, GEN_SESSION_CB);
+int SSL_has_matching_session_id(const SSL *ssl, const unsigned char *id,
+ unsigned int id_len);
+SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp,
+ long length);
+
+# ifdef HEADER_X509_H
+X509 *SSL_get_peer_certificate(const SSL *s);
+# endif
+
+STACK_OF(X509) *SSL_get_peer_cert_chain(const SSL *s);
+
+int SSL_CTX_get_verify_mode(const SSL_CTX *ctx);
+int SSL_CTX_get_verify_depth(const SSL_CTX *ctx);
+int (*SSL_CTX_get_verify_callback(const SSL_CTX *ctx)) (int,
+ X509_STORE_CTX *);
+void SSL_CTX_set_verify(SSL_CTX *ctx, int mode,
+ int (*callback) (int, X509_STORE_CTX *));
+void SSL_CTX_set_verify_depth(SSL_CTX *ctx, int depth);
+void SSL_CTX_set_cert_verify_callback(SSL_CTX *ctx,
+ int (*cb) (X509_STORE_CTX *, void *),
+ void *arg);
+void SSL_CTX_set_cert_cb(SSL_CTX *c, int (*cb) (SSL *ssl, void *arg),
+ void *arg);
+# ifndef OPENSSL_NO_RSA
+int SSL_CTX_use_RSAPrivateKey(SSL_CTX *ctx, RSA *rsa);
+# endif
+int SSL_CTX_use_RSAPrivateKey_ASN1(SSL_CTX *ctx, const unsigned char *d,
+ long len);
+int SSL_CTX_use_PrivateKey(SSL_CTX *ctx, EVP_PKEY *pkey);
+int SSL_CTX_use_PrivateKey_ASN1(int pk, SSL_CTX *ctx,
+ const unsigned char *d, long len);
+int SSL_CTX_use_certificate(SSL_CTX *ctx, X509 *x);
+int SSL_CTX_use_certificate_ASN1(SSL_CTX *ctx, int len,
+ const unsigned char *d);
+
+void SSL_CTX_set_default_passwd_cb(SSL_CTX *ctx, pem_password_cb *cb);
+void SSL_CTX_set_default_passwd_cb_userdata(SSL_CTX *ctx, void *u);
+
+int SSL_CTX_check_private_key(const SSL_CTX *ctx);
+int SSL_check_private_key(const SSL *ctx);
+
+int SSL_CTX_set_session_id_context(SSL_CTX *ctx, const unsigned char *sid_ctx,
+ unsigned int sid_ctx_len);
+
+SSL *SSL_new(SSL_CTX *ctx);
+int SSL_set_session_id_context(SSL *ssl, const unsigned char *sid_ctx,
+ unsigned int sid_ctx_len);
+
+int SSL_CTX_set_purpose(SSL_CTX *s, int purpose);
+int SSL_set_purpose(SSL *s, int purpose);
+int SSL_CTX_set_trust(SSL_CTX *s, int trust);
+int SSL_set_trust(SSL *s, int trust);
+
+int SSL_CTX_set1_param(SSL_CTX *ctx, X509_VERIFY_PARAM *vpm);
+int SSL_set1_param(SSL *ssl, X509_VERIFY_PARAM *vpm);
+
+X509_VERIFY_PARAM *SSL_CTX_get0_param(SSL_CTX *ctx);
+X509_VERIFY_PARAM *SSL_get0_param(SSL *ssl);
+
+# ifndef OPENSSL_NO_SRP
+int SSL_CTX_set_srp_username(SSL_CTX *ctx, char *name);
+int SSL_CTX_set_srp_password(SSL_CTX *ctx, char *password);
+int SSL_CTX_set_srp_strength(SSL_CTX *ctx, int strength);
+int SSL_CTX_set_srp_client_pwd_callback(SSL_CTX *ctx,
+ char *(*cb) (SSL *, void *));
+int SSL_CTX_set_srp_verify_param_callback(SSL_CTX *ctx,
+ int (*cb) (SSL *, void *));
+int SSL_CTX_set_srp_username_callback(SSL_CTX *ctx,
+ int (*cb) (SSL *, int *, void *));
+int SSL_CTX_set_srp_cb_arg(SSL_CTX *ctx, void *arg);
+
+int SSL_set_srp_server_param(SSL *s, const BIGNUM *N, const BIGNUM *g,
+ BIGNUM *sa, BIGNUM *v, char *info);
+int SSL_set_srp_server_param_pw(SSL *s, const char *user, const char *pass,
+ const char *grp);
+
+BIGNUM *SSL_get_srp_g(SSL *s);
+BIGNUM *SSL_get_srp_N(SSL *s);
+
+char *SSL_get_srp_username(SSL *s);
+char *SSL_get_srp_userinfo(SSL *s);
+# endif
+
+void SSL_certs_clear(SSL *s);
+void SSL_free(SSL *ssl);
+int SSL_accept(SSL *ssl);
+int SSL_connect(SSL *ssl);
+int SSL_read(SSL *ssl, void *buf, int num);
+int SSL_peek(SSL *ssl, void *buf, int num);
+int SSL_write(SSL *ssl, const void *buf, int num);
+long SSL_ctrl(SSL *ssl, int cmd, long larg, void *parg);
+long SSL_callback_ctrl(SSL *, int, void (*)(void));
+long SSL_CTX_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg);
+long SSL_CTX_callback_ctrl(SSL_CTX *, int, void (*)(void));
+
+int SSL_get_error(const SSL *s, int ret_code);
+const char *SSL_get_version(const SSL *s);
+
+/* This sets the 'default' SSL version that SSL_new() will create */
+int SSL_CTX_set_ssl_version(SSL_CTX *ctx, const SSL_METHOD *meth);
+
+# ifndef OPENSSL_NO_SSL2
+const SSL_METHOD *SSLv2_method(void); /* SSLv2 */
+const SSL_METHOD *SSLv2_server_method(void); /* SSLv2 */
+const SSL_METHOD *SSLv2_client_method(void); /* SSLv2 */
+# endif
+
+# ifndef OPENSSL_NO_SSL3_METHOD
+const SSL_METHOD *SSLv3_method(void); /* SSLv3 */
+const SSL_METHOD *SSLv3_server_method(void); /* SSLv3 */
+const SSL_METHOD *SSLv3_client_method(void); /* SSLv3 */
+# endif
+
+const SSL_METHOD *SSLv23_method(void); /* Negotiate highest available SSL/TLS
+ * version */
+const SSL_METHOD *SSLv23_server_method(void); /* Negotiate highest available
+ * SSL/TLS version */
+const SSL_METHOD *SSLv23_client_method(void); /* Negotiate highest available
+ * SSL/TLS version */
+
+const SSL_METHOD *TLSv1_method(void); /* TLSv1.0 */
+const SSL_METHOD *TLSv1_server_method(void); /* TLSv1.0 */
+const SSL_METHOD *TLSv1_client_method(void); /* TLSv1.0 */
+
+const SSL_METHOD *TLSv1_1_method(void); /* TLSv1.1 */
+const SSL_METHOD *TLSv1_1_server_method(void); /* TLSv1.1 */
+const SSL_METHOD *TLSv1_1_client_method(void); /* TLSv1.1 */
+
+const SSL_METHOD *TLSv1_2_method(void); /* TLSv1.2 */
+const SSL_METHOD *TLSv1_2_server_method(void); /* TLSv1.2 */
+const SSL_METHOD *TLSv1_2_client_method(void); /* TLSv1.2 */
+
+const SSL_METHOD *DTLSv1_method(void); /* DTLSv1.0 */
+const SSL_METHOD *DTLSv1_server_method(void); /* DTLSv1.0 */
+const SSL_METHOD *DTLSv1_client_method(void); /* DTLSv1.0 */
+
+const SSL_METHOD *DTLSv1_2_method(void); /* DTLSv1.2 */
+const SSL_METHOD *DTLSv1_2_server_method(void); /* DTLSv1.2 */
+const SSL_METHOD *DTLSv1_2_client_method(void); /* DTLSv1.2 */
+
+const SSL_METHOD *DTLS_method(void); /* DTLS 1.0 and 1.2 */
+const SSL_METHOD *DTLS_server_method(void); /* DTLS 1.0 and 1.2 */
+const SSL_METHOD *DTLS_client_method(void); /* DTLS 1.0 and 1.2 */
+
+STACK_OF(SSL_CIPHER) *SSL_get_ciphers(const SSL *s);
+
+int SSL_do_handshake(SSL *s);
+int SSL_renegotiate(SSL *s);
+int SSL_renegotiate_abbreviated(SSL *s);
+int SSL_renegotiate_pending(SSL *s);
+int SSL_shutdown(SSL *s);
+
+const SSL_METHOD *SSL_CTX_get_ssl_method(SSL_CTX *ctx);
+const SSL_METHOD *SSL_get_ssl_method(SSL *s);
+int SSL_set_ssl_method(SSL *s, const SSL_METHOD *method);
+const char *SSL_alert_type_string_long(int value);
+const char *SSL_alert_type_string(int value);
+const char *SSL_alert_desc_string_long(int value);
+const char *SSL_alert_desc_string(int value);
+
+void SSL_set_client_CA_list(SSL *s, STACK_OF(X509_NAME) *name_list);
+void SSL_CTX_set_client_CA_list(SSL_CTX *ctx, STACK_OF(X509_NAME) *name_list);
+STACK_OF(X509_NAME) *SSL_get_client_CA_list(const SSL *s);
+STACK_OF(X509_NAME) *SSL_CTX_get_client_CA_list(const SSL_CTX *s);
+int SSL_add_client_CA(SSL *ssl, X509 *x);
+int SSL_CTX_add_client_CA(SSL_CTX *ctx, X509 *x);
+
+void SSL_set_connect_state(SSL *s);
+void SSL_set_accept_state(SSL *s);
+
+long SSL_get_default_timeout(const SSL *s);
+
+int SSL_library_init(void);
+
+char *SSL_CIPHER_description(const SSL_CIPHER *, char *buf, int size);
+STACK_OF(X509_NAME) *SSL_dup_CA_list(STACK_OF(X509_NAME) *sk);
+
+SSL *SSL_dup(SSL *ssl);
+
+X509 *SSL_get_certificate(const SSL *ssl);
+/*
+ * EVP_PKEY
+ */ struct evp_pkey_st *SSL_get_privatekey(const SSL *ssl);
+
+X509 *SSL_CTX_get0_certificate(const SSL_CTX *ctx);
+EVP_PKEY *SSL_CTX_get0_privatekey(const SSL_CTX *ctx);
+
+void SSL_CTX_set_quiet_shutdown(SSL_CTX *ctx, int mode);
+int SSL_CTX_get_quiet_shutdown(const SSL_CTX *ctx);
+void SSL_set_quiet_shutdown(SSL *ssl, int mode);
+int SSL_get_quiet_shutdown(const SSL *ssl);
+void SSL_set_shutdown(SSL *ssl, int mode);
+int SSL_get_shutdown(const SSL *ssl);
+int SSL_version(const SSL *ssl);
+int SSL_CTX_set_default_verify_paths(SSL_CTX *ctx);
+int SSL_CTX_load_verify_locations(SSL_CTX *ctx, const char *CAfile,
+ const char *CApath);
+# define SSL_get0_session SSL_get_session/* just peek at pointer */
+SSL_SESSION *SSL_get_session(const SSL *ssl);
+SSL_SESSION *SSL_get1_session(SSL *ssl); /* obtain a reference count */
+SSL_CTX *SSL_get_SSL_CTX(const SSL *ssl);
+SSL_CTX *SSL_set_SSL_CTX(SSL *ssl, SSL_CTX *ctx);
+void SSL_set_info_callback(SSL *ssl,
+ void (*cb) (const SSL *ssl, int type, int val));
+void (*SSL_get_info_callback(const SSL *ssl)) (const SSL *ssl, int type,
+ int val);
+int SSL_state(const SSL *ssl);
+void SSL_set_state(SSL *ssl, int state);
+
+void SSL_set_verify_result(SSL *ssl, long v);
+long SSL_get_verify_result(const SSL *ssl);
+
+int SSL_set_ex_data(SSL *ssl, int idx, void *data);
+void *SSL_get_ex_data(const SSL *ssl, int idx);
+int SSL_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
+ CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
+
+int SSL_SESSION_set_ex_data(SSL_SESSION *ss, int idx, void *data);
+void *SSL_SESSION_get_ex_data(const SSL_SESSION *ss, int idx);
+int SSL_SESSION_get_ex_new_index(long argl, void *argp,
+ CRYPTO_EX_new *new_func,
+ CRYPTO_EX_dup *dup_func,
+ CRYPTO_EX_free *free_func);
+
+int SSL_CTX_set_ex_data(SSL_CTX *ssl, int idx, void *data);
+void *SSL_CTX_get_ex_data(const SSL_CTX *ssl, int idx);
+int SSL_CTX_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
+ CRYPTO_EX_dup *dup_func,
+ CRYPTO_EX_free *free_func);
+
+int SSL_get_ex_data_X509_STORE_CTX_idx(void);
+
+# define SSL_CTX_sess_set_cache_size(ctx,t) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SESS_CACHE_SIZE,t,NULL)
+# define SSL_CTX_sess_get_cache_size(ctx) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_GET_SESS_CACHE_SIZE,0,NULL)
+# define SSL_CTX_set_session_cache_mode(ctx,m) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SESS_CACHE_MODE,m,NULL)
+# define SSL_CTX_get_session_cache_mode(ctx) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_GET_SESS_CACHE_MODE,0,NULL)
+
+# define SSL_CTX_get_default_read_ahead(ctx) SSL_CTX_get_read_ahead(ctx)
+# define SSL_CTX_set_default_read_ahead(ctx,m) SSL_CTX_set_read_ahead(ctx,m)
+# define SSL_CTX_get_read_ahead(ctx) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_GET_READ_AHEAD,0,NULL)
+# define SSL_CTX_set_read_ahead(ctx,m) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_READ_AHEAD,m,NULL)
+# define SSL_CTX_get_max_cert_list(ctx) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_GET_MAX_CERT_LIST,0,NULL)
+# define SSL_CTX_set_max_cert_list(ctx,m) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_MAX_CERT_LIST,m,NULL)
+# define SSL_get_max_cert_list(ssl) \
+ SSL_ctrl(ssl,SSL_CTRL_GET_MAX_CERT_LIST,0,NULL)
+# define SSL_set_max_cert_list(ssl,m) \
+ SSL_ctrl(ssl,SSL_CTRL_SET_MAX_CERT_LIST,m,NULL)
+
+# define SSL_CTX_set_max_send_fragment(ctx,m) \
+ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_MAX_SEND_FRAGMENT,m,NULL)
+# define SSL_set_max_send_fragment(ssl,m) \
+ SSL_ctrl(ssl,SSL_CTRL_SET_MAX_SEND_FRAGMENT,m,NULL)
+
+ /* NB: the keylength is only applicable when is_export is true */
+# ifndef OPENSSL_NO_RSA
+void SSL_CTX_set_tmp_rsa_callback(SSL_CTX *ctx,
+ RSA *(*cb) (SSL *ssl, int is_export,
+ int keylength));
+
+void SSL_set_tmp_rsa_callback(SSL *ssl,
+ RSA *(*cb) (SSL *ssl, int is_export,
+ int keylength));
+# endif
+# ifndef OPENSSL_NO_DH
+void SSL_CTX_set_tmp_dh_callback(SSL_CTX *ctx,
+ DH *(*dh) (SSL *ssl, int is_export,
+ int keylength));
+void SSL_set_tmp_dh_callback(SSL *ssl,
+ DH *(*dh) (SSL *ssl, int is_export,
+ int keylength));
+# endif
+# ifndef OPENSSL_NO_ECDH
+void SSL_CTX_set_tmp_ecdh_callback(SSL_CTX *ctx,
+ EC_KEY *(*ecdh) (SSL *ssl, int is_export,
+ int keylength));
+void SSL_set_tmp_ecdh_callback(SSL *ssl,
+ EC_KEY *(*ecdh) (SSL *ssl, int is_export,
+ int keylength));
+# endif
+
+# ifndef OPENSSL_NO_COMP
+const COMP_METHOD *SSL_get_current_compression(SSL *s);
+const COMP_METHOD *SSL_get_current_expansion(SSL *s);
+const char *SSL_COMP_get_name(const COMP_METHOD *comp);
+STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void);
+STACK_OF(SSL_COMP) *SSL_COMP_set0_compression_methods(STACK_OF(SSL_COMP)
+ *meths);
+void SSL_COMP_free_compression_methods(void);
+int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm);
+# else
+const void *SSL_get_current_compression(SSL *s);
+const void *SSL_get_current_expansion(SSL *s);
+const char *SSL_COMP_get_name(const void *comp);
+void *SSL_COMP_get_compression_methods(void);
+int SSL_COMP_add_compression_method(int id, void *cm);
+# endif
+
+const SSL_CIPHER *SSL_CIPHER_find(SSL *ssl, const unsigned char *ptr);
+
+/* TLS extensions functions */
+int SSL_set_session_ticket_ext(SSL *s, void *ext_data, int ext_len);
+
+int SSL_set_session_ticket_ext_cb(SSL *s, tls_session_ticket_ext_cb_fn cb,
+ void *arg);
+
+/* Pre-shared secret session resumption functions */
+int SSL_set_session_secret_cb(SSL *s,
+ tls_session_secret_cb_fn tls_session_secret_cb,
+ void *arg);
+
+void SSL_set_debug(SSL *s, int debug);
+int SSL_cache_hit(SSL *s);
+int SSL_is_server(SSL *s);
+
+SSL_CONF_CTX *SSL_CONF_CTX_new(void);
+int SSL_CONF_CTX_finish(SSL_CONF_CTX *cctx);
+void SSL_CONF_CTX_free(SSL_CONF_CTX *cctx);
+unsigned int SSL_CONF_CTX_set_flags(SSL_CONF_CTX *cctx, unsigned int flags);
+unsigned int SSL_CONF_CTX_clear_flags(SSL_CONF_CTX *cctx, unsigned int flags);
+int SSL_CONF_CTX_set1_prefix(SSL_CONF_CTX *cctx, const char *pre);
+
+void SSL_CONF_CTX_set_ssl(SSL_CONF_CTX *cctx, SSL *ssl);
+void SSL_CONF_CTX_set_ssl_ctx(SSL_CONF_CTX *cctx, SSL_CTX *ctx);
+
+int SSL_CONF_cmd(SSL_CONF_CTX *cctx, const char *cmd, const char *value);
+int SSL_CONF_cmd_argv(SSL_CONF_CTX *cctx, int *pargc, char ***pargv);
+int SSL_CONF_cmd_value_type(SSL_CONF_CTX *cctx, const char *cmd);
+
+# ifndef OPENSSL_NO_SSL_TRACE
+void SSL_trace(int write_p, int version, int content_type,
+ const void *buf, size_t len, SSL *ssl, void *arg);
+const char *SSL_CIPHER_standard_name(const SSL_CIPHER *c);
+# endif
+
+# ifndef OPENSSL_NO_UNIT_TEST
+const struct openssl_ssl_test_functions *SSL_test_functions(void);
+# endif
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_SSL_strings(void);
+
+/* Error codes for the SSL functions. */
+
+/* Function codes. */
+# define SSL_F_CHECK_SUITEB_CIPHER_LIST 331
+# define SSL_F_CLIENT_CERTIFICATE 100
+# define SSL_F_CLIENT_FINISHED 167
+# define SSL_F_CLIENT_HELLO 101
+# define SSL_F_CLIENT_MASTER_KEY 102
+# define SSL_F_D2I_SSL_SESSION 103
+# define SSL_F_DO_DTLS1_WRITE 245
+# define SSL_F_DO_SSL3_WRITE 104
+# define SSL_F_DTLS1_ACCEPT 246
+# define SSL_F_DTLS1_ADD_CERT_TO_BUF 295
+# define SSL_F_DTLS1_BUFFER_RECORD 247
+# define SSL_F_DTLS1_CHECK_TIMEOUT_NUM 316
+# define SSL_F_DTLS1_CLIENT_HELLO 248
+# define SSL_F_DTLS1_CONNECT 249
+# define SSL_F_DTLS1_ENC 250
+# define SSL_F_DTLS1_GET_HELLO_VERIFY 251
+# define SSL_F_DTLS1_GET_MESSAGE 252
+# define SSL_F_DTLS1_GET_MESSAGE_FRAGMENT 253
+# define SSL_F_DTLS1_GET_RECORD 254
+# define SSL_F_DTLS1_HANDLE_TIMEOUT 297
+# define SSL_F_DTLS1_HEARTBEAT 305
+# define SSL_F_DTLS1_OUTPUT_CERT_CHAIN 255
+# define SSL_F_DTLS1_PREPROCESS_FRAGMENT 288
+# define SSL_F_DTLS1_PROCESS_OUT_OF_SEQ_MESSAGE 256
+# define SSL_F_DTLS1_PROCESS_RECORD 257
+# define SSL_F_DTLS1_READ_BYTES 258
+# define SSL_F_DTLS1_READ_FAILED 259
+# define SSL_F_DTLS1_SEND_CERTIFICATE_REQUEST 260
+# define SSL_F_DTLS1_SEND_CLIENT_CERTIFICATE 261
+# define SSL_F_DTLS1_SEND_CLIENT_KEY_EXCHANGE 262
+# define SSL_F_DTLS1_SEND_CLIENT_VERIFY 263
+# define SSL_F_DTLS1_SEND_HELLO_VERIFY_REQUEST 264
+# define SSL_F_DTLS1_SEND_SERVER_CERTIFICATE 265
+# define SSL_F_DTLS1_SEND_SERVER_HELLO 266
+# define SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE 267
+# define SSL_F_DTLS1_WRITE_APP_DATA_BYTES 268
+# define SSL_F_GET_CLIENT_FINISHED 105
+# define SSL_F_GET_CLIENT_HELLO 106
+# define SSL_F_GET_CLIENT_MASTER_KEY 107
+# define SSL_F_GET_SERVER_FINISHED 108
+# define SSL_F_GET_SERVER_HELLO 109
+# define SSL_F_GET_SERVER_STATIC_DH_KEY 340
+# define SSL_F_GET_SERVER_VERIFY 110
+# define SSL_F_I2D_SSL_SESSION 111
+# define SSL_F_READ_N 112
+# define SSL_F_REQUEST_CERTIFICATE 113
+# define SSL_F_SERVER_FINISH 239
+# define SSL_F_SERVER_HELLO 114
+# define SSL_F_SERVER_VERIFY 240
+# define SSL_F_SSL23_ACCEPT 115
+# define SSL_F_SSL23_CLIENT_HELLO 116
+# define SSL_F_SSL23_CONNECT 117
+# define SSL_F_SSL23_GET_CLIENT_HELLO 118
+# define SSL_F_SSL23_GET_SERVER_HELLO 119
+# define SSL_F_SSL23_PEEK 237
+# define SSL_F_SSL23_READ 120
+# define SSL_F_SSL23_WRITE 121
+# define SSL_F_SSL2_ACCEPT 122
+# define SSL_F_SSL2_CONNECT 123
+# define SSL_F_SSL2_ENC_INIT 124
+# define SSL_F_SSL2_GENERATE_KEY_MATERIAL 241
+# define SSL_F_SSL2_PEEK 234
+# define SSL_F_SSL2_READ 125
+# define SSL_F_SSL2_READ_INTERNAL 236
+# define SSL_F_SSL2_SET_CERTIFICATE 126
+# define SSL_F_SSL2_WRITE 127
+# define SSL_F_SSL3_ACCEPT 128
+# define SSL_F_SSL3_ADD_CERT_TO_BUF 296
+# define SSL_F_SSL3_CALLBACK_CTRL 233
+# define SSL_F_SSL3_CHANGE_CIPHER_STATE 129
+# define SSL_F_SSL3_CHECK_CERT_AND_ALGORITHM 130
+# define SSL_F_SSL3_CHECK_CLIENT_HELLO 304
+# define SSL_F_SSL3_CHECK_FINISHED 339
+# define SSL_F_SSL3_CLIENT_HELLO 131
+# define SSL_F_SSL3_CONNECT 132
+# define SSL_F_SSL3_CTRL 213
+# define SSL_F_SSL3_CTX_CTRL 133
+# define SSL_F_SSL3_DIGEST_CACHED_RECORDS 293
+# define SSL_F_SSL3_DO_CHANGE_CIPHER_SPEC 292
+# define SSL_F_SSL3_ENC 134
+# define SSL_F_SSL3_GENERATE_KEY_BLOCK 238
+# define SSL_F_SSL3_GET_CERTIFICATE_REQUEST 135
+# define SSL_F_SSL3_GET_CERT_STATUS 289
+# define SSL_F_SSL3_GET_CERT_VERIFY 136
+# define SSL_F_SSL3_GET_CLIENT_CERTIFICATE 137
+# define SSL_F_SSL3_GET_CLIENT_HELLO 138
+# define SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE 139
+# define SSL_F_SSL3_GET_FINISHED 140
+# define SSL_F_SSL3_GET_KEY_EXCHANGE 141
+# define SSL_F_SSL3_GET_MESSAGE 142
+# define SSL_F_SSL3_GET_NEW_SESSION_TICKET 283
+# define SSL_F_SSL3_GET_NEXT_PROTO 306
+# define SSL_F_SSL3_GET_RECORD 143
+# define SSL_F_SSL3_GET_SERVER_CERTIFICATE 144
+# define SSL_F_SSL3_GET_SERVER_DONE 145
+# define SSL_F_SSL3_GET_SERVER_HELLO 146
+# define SSL_F_SSL3_HANDSHAKE_MAC 285
+# define SSL_F_SSL3_NEW_SESSION_TICKET 287
+# define SSL_F_SSL3_OUTPUT_CERT_CHAIN 147
+# define SSL_F_SSL3_PEEK 235
+# define SSL_F_SSL3_READ_BYTES 148
+# define SSL_F_SSL3_READ_N 149
+# define SSL_F_SSL3_SEND_CERTIFICATE_REQUEST 150
+# define SSL_F_SSL3_SEND_CLIENT_CERTIFICATE 151
+# define SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE 152
+# define SSL_F_SSL3_SEND_CLIENT_VERIFY 153
+# define SSL_F_SSL3_SEND_SERVER_CERTIFICATE 154
+# define SSL_F_SSL3_SEND_SERVER_HELLO 242
+# define SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE 155
+# define SSL_F_SSL3_SETUP_KEY_BLOCK 157
+# define SSL_F_SSL3_SETUP_READ_BUFFER 156
+# define SSL_F_SSL3_SETUP_WRITE_BUFFER 291
+# define SSL_F_SSL3_WRITE_BYTES 158
+# define SSL_F_SSL3_WRITE_PENDING 159
+# define SSL_F_SSL_ADD_CERT_CHAIN 318
+# define SSL_F_SSL_ADD_CERT_TO_BUF 319
+# define SSL_F_SSL_ADD_CLIENTHELLO_RENEGOTIATE_EXT 298
+# define SSL_F_SSL_ADD_CLIENTHELLO_TLSEXT 277
+# define SSL_F_SSL_ADD_CLIENTHELLO_USE_SRTP_EXT 307
+# define SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK 215
+# define SSL_F_SSL_ADD_FILE_CERT_SUBJECTS_TO_STACK 216
+# define SSL_F_SSL_ADD_SERVERHELLO_RENEGOTIATE_EXT 299
+# define SSL_F_SSL_ADD_SERVERHELLO_TLSEXT 278
+# define SSL_F_SSL_ADD_SERVERHELLO_USE_SRTP_EXT 308
+# define SSL_F_SSL_BAD_METHOD 160
+# define SSL_F_SSL_BUILD_CERT_CHAIN 332
+# define SSL_F_SSL_BYTES_TO_CIPHER_LIST 161
+# define SSL_F_SSL_CERT_DUP 221
+# define SSL_F_SSL_CERT_INST 222
+# define SSL_F_SSL_CERT_INSTANTIATE 214
+# define SSL_F_SSL_CERT_NEW 162
+# define SSL_F_SSL_CHECK_PRIVATE_KEY 163
+# define SSL_F_SSL_CHECK_SERVERHELLO_TLSEXT 280
+# define SSL_F_SSL_CHECK_SRVR_ECC_CERT_AND_ALG 279
+# define SSL_F_SSL_CIPHER_PROCESS_RULESTR 230
+# define SSL_F_SSL_CIPHER_STRENGTH_SORT 231
+# define SSL_F_SSL_CLEAR 164
+# define SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD 165
+# define SSL_F_SSL_CONF_CMD 334
+# define SSL_F_SSL_CREATE_CIPHER_LIST 166
+# define SSL_F_SSL_CTRL 232
+# define SSL_F_SSL_CTX_CHECK_PRIVATE_KEY 168
+# define SSL_F_SSL_CTX_MAKE_PROFILES 309
+# define SSL_F_SSL_CTX_NEW 169
+# define SSL_F_SSL_CTX_SET_CIPHER_LIST 269
+# define SSL_F_SSL_CTX_SET_CLIENT_CERT_ENGINE 290
+# define SSL_F_SSL_CTX_SET_PURPOSE 226
+# define SSL_F_SSL_CTX_SET_SESSION_ID_CONTEXT 219
+# define SSL_F_SSL_CTX_SET_SSL_VERSION 170
+# define SSL_F_SSL_CTX_SET_TRUST 229
+# define SSL_F_SSL_CTX_USE_CERTIFICATE 171
+# define SSL_F_SSL_CTX_USE_CERTIFICATE_ASN1 172
+# define SSL_F_SSL_CTX_USE_CERTIFICATE_CHAIN_FILE 220
+# define SSL_F_SSL_CTX_USE_CERTIFICATE_FILE 173
+# define SSL_F_SSL_CTX_USE_PRIVATEKEY 174
+# define SSL_F_SSL_CTX_USE_PRIVATEKEY_ASN1 175
+# define SSL_F_SSL_CTX_USE_PRIVATEKEY_FILE 176
+# define SSL_F_SSL_CTX_USE_PSK_IDENTITY_HINT 272
+# define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY 177
+# define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_ASN1 178
+# define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_FILE 179
+# define SSL_F_SSL_CTX_USE_SERVERINFO 336
+# define SSL_F_SSL_CTX_USE_SERVERINFO_FILE 337
+# define SSL_F_SSL_DO_HANDSHAKE 180
+# define SSL_F_SSL_GET_NEW_SESSION 181
+# define SSL_F_SSL_GET_PREV_SESSION 217
+# define SSL_F_SSL_GET_SERVER_CERT_INDEX 322
+# define SSL_F_SSL_GET_SERVER_SEND_CERT 182
+# define SSL_F_SSL_GET_SERVER_SEND_PKEY 317
+# define SSL_F_SSL_GET_SIGN_PKEY 183
+# define SSL_F_SSL_INIT_WBIO_BUFFER 184
+# define SSL_F_SSL_LOAD_CLIENT_CA_FILE 185
+# define SSL_F_SSL_NEW 186
+# define SSL_F_SSL_PARSE_CLIENTHELLO_RENEGOTIATE_EXT 300
+# define SSL_F_SSL_PARSE_CLIENTHELLO_TLSEXT 302
+# define SSL_F_SSL_PARSE_CLIENTHELLO_USE_SRTP_EXT 310
+# define SSL_F_SSL_PARSE_SERVERHELLO_RENEGOTIATE_EXT 301
+# define SSL_F_SSL_PARSE_SERVERHELLO_TLSEXT 303
+# define SSL_F_SSL_PARSE_SERVERHELLO_USE_SRTP_EXT 311
+# define SSL_F_SSL_PEEK 270
+# define SSL_F_SSL_PREPARE_CLIENTHELLO_TLSEXT 281
+# define SSL_F_SSL_PREPARE_SERVERHELLO_TLSEXT 282
+# define SSL_F_SSL_READ 223
+# define SSL_F_SSL_RSA_PRIVATE_DECRYPT 187
+# define SSL_F_SSL_RSA_PUBLIC_ENCRYPT 188
+# define SSL_F_SSL_SCAN_CLIENTHELLO_TLSEXT 320
+# define SSL_F_SSL_SCAN_SERVERHELLO_TLSEXT 321
+# define SSL_F_SSL_SESSION_DUP 348
+# define SSL_F_SSL_SESSION_NEW 189
+# define SSL_F_SSL_SESSION_PRINT_FP 190
+# define SSL_F_SSL_SESSION_SET1_ID_CONTEXT 312
+# define SSL_F_SSL_SESS_CERT_NEW 225
+# define SSL_F_SSL_SET_CERT 191
+# define SSL_F_SSL_SET_CIPHER_LIST 271
+# define SSL_F_SSL_SET_FD 192
+# define SSL_F_SSL_SET_PKEY 193
+# define SSL_F_SSL_SET_PURPOSE 227
+# define SSL_F_SSL_SET_RFD 194
+# define SSL_F_SSL_SET_SESSION 195
+# define SSL_F_SSL_SET_SESSION_ID_CONTEXT 218
+# define SSL_F_SSL_SET_SESSION_TICKET_EXT 294
+# define SSL_F_SSL_SET_TRUST 228
+# define SSL_F_SSL_SET_WFD 196
+# define SSL_F_SSL_SHUTDOWN 224
+# define SSL_F_SSL_SRP_CTX_INIT 313
+# define SSL_F_SSL_UNDEFINED_CONST_FUNCTION 243
+# define SSL_F_SSL_UNDEFINED_FUNCTION 197
+# define SSL_F_SSL_UNDEFINED_VOID_FUNCTION 244
+# define SSL_F_SSL_USE_CERTIFICATE 198
+# define SSL_F_SSL_USE_CERTIFICATE_ASN1 199
+# define SSL_F_SSL_USE_CERTIFICATE_FILE 200
+# define SSL_F_SSL_USE_PRIVATEKEY 201
+# define SSL_F_SSL_USE_PRIVATEKEY_ASN1 202
+# define SSL_F_SSL_USE_PRIVATEKEY_FILE 203
+# define SSL_F_SSL_USE_PSK_IDENTITY_HINT 273
+# define SSL_F_SSL_USE_RSAPRIVATEKEY 204
+# define SSL_F_SSL_USE_RSAPRIVATEKEY_ASN1 205
+# define SSL_F_SSL_USE_RSAPRIVATEKEY_FILE 206
+# define SSL_F_SSL_VERIFY_CERT_CHAIN 207
+# define SSL_F_SSL_WRITE 208
+# define SSL_F_TLS12_CHECK_PEER_SIGALG 333
+# define SSL_F_TLS1_CERT_VERIFY_MAC 286
+# define SSL_F_TLS1_CHANGE_CIPHER_STATE 209
+# define SSL_F_TLS1_CHECK_SERVERHELLO_TLSEXT 274
+# define SSL_F_TLS1_ENC 210
+# define SSL_F_TLS1_EXPORT_KEYING_MATERIAL 314
+# define SSL_F_TLS1_GET_CURVELIST 338
+# define SSL_F_TLS1_HEARTBEAT 315
+# define SSL_F_TLS1_PREPARE_CLIENTHELLO_TLSEXT 275
+# define SSL_F_TLS1_PREPARE_SERVERHELLO_TLSEXT 276
+# define SSL_F_TLS1_PRF 284
+# define SSL_F_TLS1_SETUP_KEY_BLOCK 211
+# define SSL_F_TLS1_SET_SERVER_SIGALGS 335
+# define SSL_F_WRITE_PENDING 212
+
+/* Reason codes. */
+# define SSL_R_APP_DATA_IN_HANDSHAKE 100
+# define SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT 272
+# define SSL_R_BAD_ALERT_RECORD 101
+# define SSL_R_BAD_AUTHENTICATION_TYPE 102
+# define SSL_R_BAD_CHANGE_CIPHER_SPEC 103
+# define SSL_R_BAD_CHECKSUM 104
+# define SSL_R_BAD_DATA 390
+# define SSL_R_BAD_DATA_RETURNED_BY_CALLBACK 106
+# define SSL_R_BAD_DECOMPRESSION 107
+# define SSL_R_BAD_DH_G_LENGTH 108
+# define SSL_R_BAD_DH_PUB_KEY_LENGTH 109
+# define SSL_R_BAD_DH_P_LENGTH 110
+# define SSL_R_BAD_DIGEST_LENGTH 111
+# define SSL_R_BAD_DSA_SIGNATURE 112
+# define SSL_R_BAD_ECC_CERT 304
+# define SSL_R_BAD_ECDSA_SIGNATURE 305
+# define SSL_R_BAD_ECPOINT 306
+# define SSL_R_BAD_HANDSHAKE_LENGTH 332
+# define SSL_R_BAD_HELLO_REQUEST 105
+# define SSL_R_BAD_LENGTH 271
+# define SSL_R_BAD_MAC_DECODE 113
+# define SSL_R_BAD_MAC_LENGTH 333
+# define SSL_R_BAD_MESSAGE_TYPE 114
+# define SSL_R_BAD_PACKET_LENGTH 115
+# define SSL_R_BAD_PROTOCOL_VERSION_NUMBER 116
+# define SSL_R_BAD_PSK_IDENTITY_HINT_LENGTH 316
+# define SSL_R_BAD_RESPONSE_ARGUMENT 117
+# define SSL_R_BAD_RSA_DECRYPT 118
+# define SSL_R_BAD_RSA_ENCRYPT 119
+# define SSL_R_BAD_RSA_E_LENGTH 120
+# define SSL_R_BAD_RSA_MODULUS_LENGTH 121
+# define SSL_R_BAD_RSA_SIGNATURE 122
+# define SSL_R_BAD_SIGNATURE 123
+# define SSL_R_BAD_SRP_A_LENGTH 347
+# define SSL_R_BAD_SRP_B_LENGTH 348
+# define SSL_R_BAD_SRP_G_LENGTH 349
+# define SSL_R_BAD_SRP_N_LENGTH 350
+# define SSL_R_BAD_SRP_PARAMETERS 371
+# define SSL_R_BAD_SRP_S_LENGTH 351
+# define SSL_R_BAD_SRTP_MKI_VALUE 352
+# define SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST 353
+# define SSL_R_BAD_SSL_FILETYPE 124
+# define SSL_R_BAD_SSL_SESSION_ID_LENGTH 125
+# define SSL_R_BAD_STATE 126
+# define SSL_R_BAD_VALUE 384
+# define SSL_R_BAD_WRITE_RETRY 127
+# define SSL_R_BIO_NOT_SET 128
+# define SSL_R_BLOCK_CIPHER_PAD_IS_WRONG 129
+# define SSL_R_BN_LIB 130
+# define SSL_R_CA_DN_LENGTH_MISMATCH 131
+# define SSL_R_CA_DN_TOO_LONG 132
+# define SSL_R_CCS_RECEIVED_EARLY 133
+# define SSL_R_CERTIFICATE_VERIFY_FAILED 134
+# define SSL_R_CERT_CB_ERROR 377
+# define SSL_R_CERT_LENGTH_MISMATCH 135
+# define SSL_R_CHALLENGE_IS_DIFFERENT 136
+# define SSL_R_CIPHER_CODE_WRONG_LENGTH 137
+# define SSL_R_CIPHER_OR_HASH_UNAVAILABLE 138
+# define SSL_R_CIPHER_TABLE_SRC_ERROR 139
+# define SSL_R_CLIENTHELLO_TLSEXT 226
+# define SSL_R_COMPRESSED_LENGTH_TOO_LONG 140
+# define SSL_R_COMPRESSION_DISABLED 343
+# define SSL_R_COMPRESSION_FAILURE 141
+# define SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE 307
+# define SSL_R_COMPRESSION_LIBRARY_ERROR 142
+# define SSL_R_CONNECTION_ID_IS_DIFFERENT 143
+# define SSL_R_CONNECTION_TYPE_NOT_SET 144
+# define SSL_R_COOKIE_MISMATCH 308
+# define SSL_R_DATA_BETWEEN_CCS_AND_FINISHED 145
+# define SSL_R_DATA_LENGTH_TOO_LONG 146
+# define SSL_R_DECRYPTION_FAILED 147
+# define SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC 281
+# define SSL_R_DH_KEY_TOO_SMALL 372
+# define SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG 148
+# define SSL_R_DIGEST_CHECK_FAILED 149
+# define SSL_R_DTLS_MESSAGE_TOO_BIG 334
+# define SSL_R_DUPLICATE_COMPRESSION_ID 309
+# define SSL_R_ECC_CERT_NOT_FOR_KEY_AGREEMENT 317
+# define SSL_R_ECC_CERT_NOT_FOR_SIGNING 318
+# define SSL_R_ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE 322
+# define SSL_R_ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE 323
+# define SSL_R_ECDH_REQUIRED_FOR_SUITEB_MODE 374
+# define SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER 310
+# define SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST 354
+# define SSL_R_ENCRYPTED_LENGTH_TOO_LONG 150
+# define SSL_R_ERROR_GENERATING_TMP_RSA_KEY 282
+# define SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST 151
+# define SSL_R_EXCESSIVE_MESSAGE_SIZE 152
+# define SSL_R_EXTRA_DATA_IN_MESSAGE 153
+# define SSL_R_GOT_A_FIN_BEFORE_A_CCS 154
+# define SSL_R_GOT_NEXT_PROTO_BEFORE_A_CCS 355
+# define SSL_R_GOT_NEXT_PROTO_WITHOUT_EXTENSION 356
+# define SSL_R_HTTPS_PROXY_REQUEST 155
+# define SSL_R_HTTP_REQUEST 156
+# define SSL_R_ILLEGAL_PADDING 283
+# define SSL_R_ILLEGAL_SUITEB_DIGEST 380
+# define SSL_R_INAPPROPRIATE_FALLBACK 373
+# define SSL_R_INCONSISTENT_COMPRESSION 340
+# define SSL_R_INVALID_CHALLENGE_LENGTH 158
+# define SSL_R_INVALID_COMMAND 280
+# define SSL_R_INVALID_COMPRESSION_ALGORITHM 341
+# define SSL_R_INVALID_NULL_CMD_NAME 385
+# define SSL_R_INVALID_PURPOSE 278
+# define SSL_R_INVALID_SERVERINFO_DATA 388
+# define SSL_R_INVALID_SRP_USERNAME 357
+# define SSL_R_INVALID_STATUS_RESPONSE 328
+# define SSL_R_INVALID_TICKET_KEYS_LENGTH 325
+# define SSL_R_INVALID_TRUST 279
+# define SSL_R_KEY_ARG_TOO_LONG 284
+# define SSL_R_KRB5 285
+# define SSL_R_KRB5_C_CC_PRINC 286
+# define SSL_R_KRB5_C_GET_CRED 287
+# define SSL_R_KRB5_C_INIT 288
+# define SSL_R_KRB5_C_MK_REQ 289
+# define SSL_R_KRB5_S_BAD_TICKET 290
+# define SSL_R_KRB5_S_INIT 291
+# define SSL_R_KRB5_S_RD_REQ 292
+# define SSL_R_KRB5_S_TKT_EXPIRED 293
+# define SSL_R_KRB5_S_TKT_NYV 294
+# define SSL_R_KRB5_S_TKT_SKEW 295
+# define SSL_R_LENGTH_MISMATCH 159
+# define SSL_R_LENGTH_TOO_SHORT 160
+# define SSL_R_LIBRARY_BUG 274
+# define SSL_R_LIBRARY_HAS_NO_CIPHERS 161
+# define SSL_R_MESSAGE_TOO_LONG 296
+# define SSL_R_MISSING_DH_DSA_CERT 162
+# define SSL_R_MISSING_DH_KEY 163
+# define SSL_R_MISSING_DH_RSA_CERT 164
+# define SSL_R_MISSING_DSA_SIGNING_CERT 165
+# define SSL_R_MISSING_ECDH_CERT 382
+# define SSL_R_MISSING_ECDSA_SIGNING_CERT 381
+# define SSL_R_MISSING_EXPORT_TMP_DH_KEY 166
+# define SSL_R_MISSING_EXPORT_TMP_RSA_KEY 167
+# define SSL_R_MISSING_RSA_CERTIFICATE 168
+# define SSL_R_MISSING_RSA_ENCRYPTING_CERT 169
+# define SSL_R_MISSING_RSA_SIGNING_CERT 170
+# define SSL_R_MISSING_SRP_PARAM 358
+# define SSL_R_MISSING_TMP_DH_KEY 171
+# define SSL_R_MISSING_TMP_ECDH_KEY 311
+# define SSL_R_MISSING_TMP_RSA_KEY 172
+# define SSL_R_MISSING_TMP_RSA_PKEY 173
+# define SSL_R_MISSING_VERIFY_MESSAGE 174
+# define SSL_R_MULTIPLE_SGC_RESTARTS 346
+# define SSL_R_NON_SSLV2_INITIAL_PACKET 175
+# define SSL_R_NO_CERTIFICATES_RETURNED 176
+# define SSL_R_NO_CERTIFICATE_ASSIGNED 177
+# define SSL_R_NO_CERTIFICATE_RETURNED 178
+# define SSL_R_NO_CERTIFICATE_SET 179
+# define SSL_R_NO_CERTIFICATE_SPECIFIED 180
+# define SSL_R_NO_CIPHERS_AVAILABLE 181
+# define SSL_R_NO_CIPHERS_PASSED 182
+# define SSL_R_NO_CIPHERS_SPECIFIED 183
+# define SSL_R_NO_CIPHER_LIST 184
+# define SSL_R_NO_CIPHER_MATCH 185
+# define SSL_R_NO_CLIENT_CERT_METHOD 331
+# define SSL_R_NO_CLIENT_CERT_RECEIVED 186
+# define SSL_R_NO_COMPRESSION_SPECIFIED 187
+# define SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER 330
+# define SSL_R_NO_METHOD_SPECIFIED 188
+# define SSL_R_NO_PEM_EXTENSIONS 389
+# define SSL_R_NO_PRIVATEKEY 189
+# define SSL_R_NO_PRIVATE_KEY_ASSIGNED 190
+# define SSL_R_NO_PROTOCOLS_AVAILABLE 191
+# define SSL_R_NO_PUBLICKEY 192
+# define SSL_R_NO_RENEGOTIATION 339
+# define SSL_R_NO_REQUIRED_DIGEST 324
+# define SSL_R_NO_SHARED_CIPHER 193
+# define SSL_R_NO_SHARED_SIGATURE_ALGORITHMS 376
+# define SSL_R_NO_SRTP_PROFILES 359
+# define SSL_R_NO_VERIFY_CALLBACK 194
+# define SSL_R_NULL_SSL_CTX 195
+# define SSL_R_NULL_SSL_METHOD_PASSED 196
+# define SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED 197
+# define SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED 344
+# define SSL_R_ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE 387
+# define SSL_R_ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE 379
+# define SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE 297
+# define SSL_R_OPAQUE_PRF_INPUT_TOO_LONG 327
+# define SSL_R_PACKET_LENGTH_TOO_LONG 198
+# define SSL_R_PARSE_TLSEXT 227
+# define SSL_R_PATH_TOO_LONG 270
+# define SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE 199
+# define SSL_R_PEER_ERROR 200
+# define SSL_R_PEER_ERROR_CERTIFICATE 201
+# define SSL_R_PEER_ERROR_NO_CERTIFICATE 202
+# define SSL_R_PEER_ERROR_NO_CIPHER 203
+# define SSL_R_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE 204
+# define SSL_R_PEM_NAME_BAD_PREFIX 391
+# define SSL_R_PEM_NAME_TOO_SHORT 392
+# define SSL_R_PRE_MAC_LENGTH_TOO_LONG 205
+# define SSL_R_PROBLEMS_MAPPING_CIPHER_FUNCTIONS 206
+# define SSL_R_PROTOCOL_IS_SHUTDOWN 207
+# define SSL_R_PSK_IDENTITY_NOT_FOUND 223
+# define SSL_R_PSK_NO_CLIENT_CB 224
+# define SSL_R_PSK_NO_SERVER_CB 225
+# define SSL_R_PUBLIC_KEY_ENCRYPT_ERROR 208
+# define SSL_R_PUBLIC_KEY_IS_NOT_RSA 209
+# define SSL_R_PUBLIC_KEY_NOT_RSA 210
+# define SSL_R_READ_BIO_NOT_SET 211
+# define SSL_R_READ_TIMEOUT_EXPIRED 312
+# define SSL_R_READ_WRONG_PACKET_TYPE 212
+# define SSL_R_RECORD_LENGTH_MISMATCH 213
+# define SSL_R_RECORD_TOO_LARGE 214
+# define SSL_R_RECORD_TOO_SMALL 298
+# define SSL_R_RENEGOTIATE_EXT_TOO_LONG 335
+# define SSL_R_RENEGOTIATION_ENCODING_ERR 336
+# define SSL_R_RENEGOTIATION_MISMATCH 337
+# define SSL_R_REQUIRED_CIPHER_MISSING 215
+# define SSL_R_REQUIRED_COMPRESSSION_ALGORITHM_MISSING 342
+# define SSL_R_REUSE_CERT_LENGTH_NOT_ZERO 216
+# define SSL_R_REUSE_CERT_TYPE_NOT_ZERO 217
+# define SSL_R_REUSE_CIPHER_LIST_NOT_ZERO 218
+# define SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING 345
+# define SSL_R_SERVERHELLO_TLSEXT 275
+# define SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED 277
+# define SSL_R_SHORT_READ 219
+# define SSL_R_SIGNATURE_ALGORITHMS_ERROR 360
+# define SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE 220
+# define SSL_R_SRP_A_CALC 361
+# define SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES 362
+# define SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG 363
+# define SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE 364
+# define SSL_R_SSL23_DOING_SESSION_ID_REUSE 221
+# define SSL_R_SSL2_CONNECTION_ID_TOO_LONG 299
+# define SSL_R_SSL3_EXT_INVALID_ECPOINTFORMAT 321
+# define SSL_R_SSL3_EXT_INVALID_SERVERNAME 319
+# define SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE 320
+# define SSL_R_SSL3_SESSION_ID_TOO_LONG 300
+# define SSL_R_SSL3_SESSION_ID_TOO_SHORT 222
+# define SSL_R_SSLV3_ALERT_BAD_CERTIFICATE 1042
+# define SSL_R_SSLV3_ALERT_BAD_RECORD_MAC 1020
+# define SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED 1045
+# define SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED 1044
+# define SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN 1046
+# define SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE 1030
+# define SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE 1040
+# define SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER 1047
+# define SSL_R_SSLV3_ALERT_NO_CERTIFICATE 1041
+# define SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE 1010
+# define SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE 1043
+# define SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION 228
+# define SSL_R_SSL_HANDSHAKE_FAILURE 229
+# define SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS 230
+# define SSL_R_SSL_SESSION_ID_CALLBACK_FAILED 301
+# define SSL_R_SSL_SESSION_ID_CONFLICT 302
+# define SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG 273
+# define SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH 303
+# define SSL_R_SSL_SESSION_ID_IS_DIFFERENT 231
+# define SSL_R_TLSV1_ALERT_ACCESS_DENIED 1049
+# define SSL_R_TLSV1_ALERT_DECODE_ERROR 1050
+# define SSL_R_TLSV1_ALERT_DECRYPTION_FAILED 1021
+# define SSL_R_TLSV1_ALERT_DECRYPT_ERROR 1051
+# define SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION 1060
+# define SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK 1086
+# define SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY 1071
+# define SSL_R_TLSV1_ALERT_INTERNAL_ERROR 1080
+# define SSL_R_TLSV1_ALERT_NO_RENEGOTIATION 1100
+# define SSL_R_TLSV1_ALERT_PROTOCOL_VERSION 1070
+# define SSL_R_TLSV1_ALERT_RECORD_OVERFLOW 1022
+# define SSL_R_TLSV1_ALERT_UNKNOWN_CA 1048
+# define SSL_R_TLSV1_ALERT_USER_CANCELLED 1090
+# define SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE 1114
+# define SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE 1113
+# define SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE 1111
+# define SSL_R_TLSV1_UNRECOGNIZED_NAME 1112
+# define SSL_R_TLSV1_UNSUPPORTED_EXTENSION 1110
+# define SSL_R_TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER 232
+# define SSL_R_TLS_HEARTBEAT_PEER_DOESNT_ACCEPT 365
+# define SSL_R_TLS_HEARTBEAT_PENDING 366
+# define SSL_R_TLS_ILLEGAL_EXPORTER_LABEL 367
+# define SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST 157
+# define SSL_R_TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST 233
+# define SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG 234
+# define SSL_R_TRIED_TO_USE_UNSUPPORTED_CIPHER 235
+# define SSL_R_UNABLE_TO_DECODE_DH_CERTS 236
+# define SSL_R_UNABLE_TO_DECODE_ECDH_CERTS 313
+# define SSL_R_UNABLE_TO_EXTRACT_PUBLIC_KEY 237
+# define SSL_R_UNABLE_TO_FIND_DH_PARAMETERS 238
+# define SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS 314
+# define SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS 239
+# define SSL_R_UNABLE_TO_FIND_SSL_METHOD 240
+# define SSL_R_UNABLE_TO_LOAD_SSL2_MD5_ROUTINES 241
+# define SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES 242
+# define SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES 243
+# define SSL_R_UNEXPECTED_MESSAGE 244
+# define SSL_R_UNEXPECTED_RECORD 245
+# define SSL_R_UNINITIALIZED 276
+# define SSL_R_UNKNOWN_ALERT_TYPE 246
+# define SSL_R_UNKNOWN_CERTIFICATE_TYPE 247
+# define SSL_R_UNKNOWN_CIPHER_RETURNED 248
+# define SSL_R_UNKNOWN_CIPHER_TYPE 249
+# define SSL_R_UNKNOWN_CMD_NAME 386
+# define SSL_R_UNKNOWN_DIGEST 368
+# define SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE 250
+# define SSL_R_UNKNOWN_PKEY_TYPE 251
+# define SSL_R_UNKNOWN_PROTOCOL 252
+# define SSL_R_UNKNOWN_REMOTE_ERROR_TYPE 253
+# define SSL_R_UNKNOWN_SSL_VERSION 254
+# define SSL_R_UNKNOWN_STATE 255
+# define SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED 338
+# define SSL_R_UNSUPPORTED_CIPHER 256
+# define SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM 257
+# define SSL_R_UNSUPPORTED_DIGEST_TYPE 326
+# define SSL_R_UNSUPPORTED_ELLIPTIC_CURVE 315
+# define SSL_R_UNSUPPORTED_PROTOCOL 258
+# define SSL_R_UNSUPPORTED_SSL_VERSION 259
+# define SSL_R_UNSUPPORTED_STATUS_TYPE 329
+# define SSL_R_USE_SRTP_NOT_NEGOTIATED 369
+# define SSL_R_WRITE_BIO_NOT_SET 260
+# define SSL_R_WRONG_CERTIFICATE_TYPE 383
+# define SSL_R_WRONG_CIPHER_RETURNED 261
+# define SSL_R_WRONG_CURVE 378
+# define SSL_R_WRONG_MESSAGE_TYPE 262
+# define SSL_R_WRONG_NUMBER_OF_KEY_BITS 263
+# define SSL_R_WRONG_SIGNATURE_LENGTH 264
+# define SSL_R_WRONG_SIGNATURE_SIZE 265
+# define SSL_R_WRONG_SIGNATURE_TYPE 370
+# define SSL_R_WRONG_SSL_VERSION 266
+# define SSL_R_WRONG_VERSION_NUMBER 267
+# define SSL_R_X509_LIB 268
+# define SSL_R_X509_VERIFICATION_SETUP_PROBLEMS 269
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/deps/openssl/openssl/include/openssl/ssl2.h b/deps/openssl/openssl/include/openssl/ssl2.h
index 11b22055ea7..03c7dd8cac1 100644
--- a/deps/openssl/openssl/include/openssl/ssl2.h
+++ b/deps/openssl/openssl/include/openssl/ssl2.h
@@ -1 +1,265 @@
-#include "../../ssl/ssl2.h"
+/* ssl/ssl2.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_SSL2_H
+# define HEADER_SSL2_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Protocol Version Codes */
+# define SSL2_VERSION 0x0002
+# define SSL2_VERSION_MAJOR 0x00
+# define SSL2_VERSION_MINOR 0x02
+/* #define SSL2_CLIENT_VERSION 0x0002 */
+/* #define SSL2_SERVER_VERSION 0x0002 */
+
+/* Protocol Message Codes */
+# define SSL2_MT_ERROR 0
+# define SSL2_MT_CLIENT_HELLO 1
+# define SSL2_MT_CLIENT_MASTER_KEY 2
+# define SSL2_MT_CLIENT_FINISHED 3
+# define SSL2_MT_SERVER_HELLO 4
+# define SSL2_MT_SERVER_VERIFY 5
+# define SSL2_MT_SERVER_FINISHED 6
+# define SSL2_MT_REQUEST_CERTIFICATE 7
+# define SSL2_MT_CLIENT_CERTIFICATE 8
+
+/* Error Message Codes */
+# define SSL2_PE_UNDEFINED_ERROR 0x0000
+# define SSL2_PE_NO_CIPHER 0x0001
+# define SSL2_PE_NO_CERTIFICATE 0x0002
+# define SSL2_PE_BAD_CERTIFICATE 0x0004
+# define SSL2_PE_UNSUPPORTED_CERTIFICATE_TYPE 0x0006
+
+/* Cipher Kind Values */
+# define SSL2_CK_NULL_WITH_MD5 0x02000000/* v3 */
+# define SSL2_CK_RC4_128_WITH_MD5 0x02010080
+# define SSL2_CK_RC4_128_EXPORT40_WITH_MD5 0x02020080
+# define SSL2_CK_RC2_128_CBC_WITH_MD5 0x02030080
+# define SSL2_CK_RC2_128_CBC_EXPORT40_WITH_MD5 0x02040080
+# define SSL2_CK_IDEA_128_CBC_WITH_MD5 0x02050080
+# define SSL2_CK_DES_64_CBC_WITH_MD5 0x02060040
+# define SSL2_CK_DES_64_CBC_WITH_SHA 0x02060140/* v3 */
+# define SSL2_CK_DES_192_EDE3_CBC_WITH_MD5 0x020700c0
+# define SSL2_CK_DES_192_EDE3_CBC_WITH_SHA 0x020701c0/* v3 */
+# define SSL2_CK_RC4_64_WITH_MD5 0x02080080/* MS hack */
+
+# define SSL2_CK_DES_64_CFB64_WITH_MD5_1 0x02ff0800/* SSLeay */
+# define SSL2_CK_NULL 0x02ff0810/* SSLeay */
+
+# define SSL2_TXT_DES_64_CFB64_WITH_MD5_1 "DES-CFB-M1"
+# define SSL2_TXT_NULL_WITH_MD5 "NULL-MD5"
+# define SSL2_TXT_RC4_128_WITH_MD5 "RC4-MD5"
+# define SSL2_TXT_RC4_128_EXPORT40_WITH_MD5 "EXP-RC4-MD5"
+# define SSL2_TXT_RC2_128_CBC_WITH_MD5 "RC2-CBC-MD5"
+# define SSL2_TXT_RC2_128_CBC_EXPORT40_WITH_MD5 "EXP-RC2-CBC-MD5"
+# define SSL2_TXT_IDEA_128_CBC_WITH_MD5 "IDEA-CBC-MD5"
+# define SSL2_TXT_DES_64_CBC_WITH_MD5 "DES-CBC-MD5"
+# define SSL2_TXT_DES_64_CBC_WITH_SHA "DES-CBC-SHA"
+# define SSL2_TXT_DES_192_EDE3_CBC_WITH_MD5 "DES-CBC3-MD5"
+# define SSL2_TXT_DES_192_EDE3_CBC_WITH_SHA "DES-CBC3-SHA"
+# define SSL2_TXT_RC4_64_WITH_MD5 "RC4-64-MD5"
+
+# define SSL2_TXT_NULL "NULL"
+
+/* Flags for the SSL_CIPHER.algorithm2 field */
+# define SSL2_CF_5_BYTE_ENC 0x01
+# define SSL2_CF_8_BYTE_ENC 0x02
+
+/* Certificate Type Codes */
+# define SSL2_CT_X509_CERTIFICATE 0x01
+
+/* Authentication Type Code */
+# define SSL2_AT_MD5_WITH_RSA_ENCRYPTION 0x01
+
+# define SSL2_MAX_SSL_SESSION_ID_LENGTH 32
+
+/* Upper/Lower Bounds */
+# define SSL2_MAX_MASTER_KEY_LENGTH_IN_BITS 256
+# ifdef OPENSSL_SYS_MPE
+# define SSL2_MAX_RECORD_LENGTH_2_BYTE_HEADER 29998u
+# else
+# define SSL2_MAX_RECORD_LENGTH_2_BYTE_HEADER 32767u
+ /* 2^15-1 */
+# endif
+# define SSL2_MAX_RECORD_LENGTH_3_BYTE_HEADER 16383/* 2^14-1 */
+
+# define SSL2_CHALLENGE_LENGTH 16
+/*
+ * #define SSL2_CHALLENGE_LENGTH 32
+ */
+# define SSL2_MIN_CHALLENGE_LENGTH 16
+# define SSL2_MAX_CHALLENGE_LENGTH 32
+# define SSL2_CONNECTION_ID_LENGTH 16
+# define SSL2_MAX_CONNECTION_ID_LENGTH 16
+# define SSL2_SSL_SESSION_ID_LENGTH 16
+# define SSL2_MAX_CERT_CHALLENGE_LENGTH 32
+# define SSL2_MIN_CERT_CHALLENGE_LENGTH 16
+# define SSL2_MAX_KEY_MATERIAL_LENGTH 24
+
+# ifndef HEADER_SSL_LOCL_H
+# define CERT char
+# endif
+
+# ifndef OPENSSL_NO_SSL_INTERN
+
+typedef struct ssl2_state_st {
+ int three_byte_header;
+ int clear_text; /* clear text */
+ int escape; /* not used in SSLv2 */
+ int ssl2_rollback; /* used if SSLv23 rolled back to SSLv2 */
+ /*
+ * non-blocking io info, used to make sure the same args were passwd
+ */
+ unsigned int wnum; /* number of bytes sent so far */
+ int wpend_tot;
+ const unsigned char *wpend_buf;
+ int wpend_off; /* offset to data to write */
+ int wpend_len; /* number of bytes passwd to write */
+ int wpend_ret; /* number of bytes to return to caller */
+ /* buffer raw data */
+ int rbuf_left;
+ int rbuf_offs;
+ unsigned char *rbuf;
+ unsigned char *wbuf;
+ unsigned char *write_ptr; /* used to point to the start due to 2/3 byte
+ * header. */
+ unsigned int padding;
+ unsigned int rlength; /* passed to ssl2_enc */
+ int ract_data_length; /* Set when things are encrypted. */
+ unsigned int wlength; /* passed to ssl2_enc */
+ int wact_data_length; /* Set when things are decrypted. */
+ unsigned char *ract_data;
+ unsigned char *wact_data;
+ unsigned char *mac_data;
+ unsigned char *read_key;
+ unsigned char *write_key;
+ /* Stuff specifically to do with this SSL session */
+ unsigned int challenge_length;
+ unsigned char challenge[SSL2_MAX_CHALLENGE_LENGTH];
+ unsigned int conn_id_length;
+ unsigned char conn_id[SSL2_MAX_CONNECTION_ID_LENGTH];
+ unsigned int key_material_length;
+ unsigned char key_material[SSL2_MAX_KEY_MATERIAL_LENGTH * 2];
+ unsigned long read_sequence;
+ unsigned long write_sequence;
+ struct {
+ unsigned int conn_id_length;
+ unsigned int cert_type;
+ unsigned int cert_length;
+ unsigned int csl;
+ unsigned int clear;
+ unsigned int enc;
+ unsigned char ccl[SSL2_MAX_CERT_CHALLENGE_LENGTH];
+ unsigned int cipher_spec_length;
+ unsigned int session_id_length;
+ unsigned int clen;
+ unsigned int rlen;
+ } tmp;
+} SSL2_STATE;
+
+# endif
+
+/* SSLv2 */
+/* client */
+# define SSL2_ST_SEND_CLIENT_HELLO_A (0x10|SSL_ST_CONNECT)
+# define SSL2_ST_SEND_CLIENT_HELLO_B (0x11|SSL_ST_CONNECT)
+# define SSL2_ST_GET_SERVER_HELLO_A (0x20|SSL_ST_CONNECT)
+# define SSL2_ST_GET_SERVER_HELLO_B (0x21|SSL_ST_CONNECT)
+# define SSL2_ST_SEND_CLIENT_MASTER_KEY_A (0x30|SSL_ST_CONNECT)
+# define SSL2_ST_SEND_CLIENT_MASTER_KEY_B (0x31|SSL_ST_CONNECT)
+# define SSL2_ST_SEND_CLIENT_FINISHED_A (0x40|SSL_ST_CONNECT)
+# define SSL2_ST_SEND_CLIENT_FINISHED_B (0x41|SSL_ST_CONNECT)
+# define SSL2_ST_SEND_CLIENT_CERTIFICATE_A (0x50|SSL_ST_CONNECT)
+# define SSL2_ST_SEND_CLIENT_CERTIFICATE_B (0x51|SSL_ST_CONNECT)
+# define SSL2_ST_SEND_CLIENT_CERTIFICATE_C (0x52|SSL_ST_CONNECT)
+# define SSL2_ST_SEND_CLIENT_CERTIFICATE_D (0x53|SSL_ST_CONNECT)
+# define SSL2_ST_GET_SERVER_VERIFY_A (0x60|SSL_ST_CONNECT)
+# define SSL2_ST_GET_SERVER_VERIFY_B (0x61|SSL_ST_CONNECT)
+# define SSL2_ST_GET_SERVER_FINISHED_A (0x70|SSL_ST_CONNECT)
+# define SSL2_ST_GET_SERVER_FINISHED_B (0x71|SSL_ST_CONNECT)
+# define SSL2_ST_CLIENT_START_ENCRYPTION (0x80|SSL_ST_CONNECT)
+# define SSL2_ST_X509_GET_CLIENT_CERTIFICATE (0x90|SSL_ST_CONNECT)
+/* server */
+# define SSL2_ST_GET_CLIENT_HELLO_A (0x10|SSL_ST_ACCEPT)
+# define SSL2_ST_GET_CLIENT_HELLO_B (0x11|SSL_ST_ACCEPT)
+# define SSL2_ST_GET_CLIENT_HELLO_C (0x12|SSL_ST_ACCEPT)
+# define SSL2_ST_SEND_SERVER_HELLO_A (0x20|SSL_ST_ACCEPT)
+# define SSL2_ST_SEND_SERVER_HELLO_B (0x21|SSL_ST_ACCEPT)
+# define SSL2_ST_GET_CLIENT_MASTER_KEY_A (0x30|SSL_ST_ACCEPT)
+# define SSL2_ST_GET_CLIENT_MASTER_KEY_B (0x31|SSL_ST_ACCEPT)
+# define SSL2_ST_SEND_SERVER_VERIFY_A (0x40|SSL_ST_ACCEPT)
+# define SSL2_ST_SEND_SERVER_VERIFY_B (0x41|SSL_ST_ACCEPT)
+# define SSL2_ST_SEND_SERVER_VERIFY_C (0x42|SSL_ST_ACCEPT)
+# define SSL2_ST_GET_CLIENT_FINISHED_A (0x50|SSL_ST_ACCEPT)
+# define SSL2_ST_GET_CLIENT_FINISHED_B (0x51|SSL_ST_ACCEPT)
+# define SSL2_ST_SEND_SERVER_FINISHED_A (0x60|SSL_ST_ACCEPT)
+# define SSL2_ST_SEND_SERVER_FINISHED_B (0x61|SSL_ST_ACCEPT)
+# define SSL2_ST_SEND_REQUEST_CERTIFICATE_A (0x70|SSL_ST_ACCEPT)
+# define SSL2_ST_SEND_REQUEST_CERTIFICATE_B (0x71|SSL_ST_ACCEPT)
+# define SSL2_ST_SEND_REQUEST_CERTIFICATE_C (0x72|SSL_ST_ACCEPT)
+# define SSL2_ST_SEND_REQUEST_CERTIFICATE_D (0x73|SSL_ST_ACCEPT)
+# define SSL2_ST_SERVER_START_ENCRYPTION (0x80|SSL_ST_ACCEPT)
+# define SSL2_ST_X509_GET_SERVER_CERTIFICATE (0x90|SSL_ST_ACCEPT)
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/deps/openssl/openssl/include/openssl/ssl23.h b/deps/openssl/openssl/include/openssl/ssl23.h
index fe4dae6661f..9de4685af9e 100644
--- a/deps/openssl/openssl/include/openssl/ssl23.h
+++ b/deps/openssl/openssl/include/openssl/ssl23.h
@@ -1 +1,84 @@
-#include "../../ssl/ssl23.h"
+/* ssl/ssl23.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_SSL23_H
+# define HEADER_SSL23_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * client
+ */
+/* write to server */
+# define SSL23_ST_CW_CLNT_HELLO_A (0x210|SSL_ST_CONNECT)
+# define SSL23_ST_CW_CLNT_HELLO_B (0x211|SSL_ST_CONNECT)
+/* read from server */
+# define SSL23_ST_CR_SRVR_HELLO_A (0x220|SSL_ST_CONNECT)
+# define SSL23_ST_CR_SRVR_HELLO_B (0x221|SSL_ST_CONNECT)
+
+/* server */
+/* read from client */
+# define SSL23_ST_SR_CLNT_HELLO_A (0x210|SSL_ST_ACCEPT)
+# define SSL23_ST_SR_CLNT_HELLO_B (0x211|SSL_ST_ACCEPT)
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/deps/openssl/openssl/include/openssl/ssl3.h b/deps/openssl/openssl/include/openssl/ssl3.h
index 0fb66a6f752..e681d50a9e8 100644
--- a/deps/openssl/openssl/include/openssl/ssl3.h
+++ b/deps/openssl/openssl/include/openssl/ssl3.h
@@ -1 +1,774 @@
-#include "../../ssl/ssl3.h"
+/* ssl/ssl3.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+/* ====================================================================
+ * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+/* ====================================================================
+ * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
+ * ECC cipher suite support in OpenSSL originally developed by
+ * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
+ */
+
+#ifndef HEADER_SSL3_H
+# define HEADER_SSL3_H
+
+# ifndef OPENSSL_NO_COMP
+# include <openssl/comp.h>
+# endif
+# include <openssl/buffer.h>
+# include <openssl/evp.h>
+# include <openssl/ssl.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Signalling cipher suite value from RFC 5746
+ * (TLS_EMPTY_RENEGOTIATION_INFO_SCSV)
+ */
+# define SSL3_CK_SCSV 0x030000FF
+
+/*
+ * Signalling cipher suite value from draft-ietf-tls-downgrade-scsv-00
+ * (TLS_FALLBACK_SCSV)
+ */
+# define SSL3_CK_FALLBACK_SCSV 0x03005600
+
+# define SSL3_CK_RSA_NULL_MD5 0x03000001
+# define SSL3_CK_RSA_NULL_SHA 0x03000002
+# define SSL3_CK_RSA_RC4_40_MD5 0x03000003
+# define SSL3_CK_RSA_RC4_128_MD5 0x03000004
+# define SSL3_CK_RSA_RC4_128_SHA 0x03000005
+# define SSL3_CK_RSA_RC2_40_MD5 0x03000006
+# define SSL3_CK_RSA_IDEA_128_SHA 0x03000007
+# define SSL3_CK_RSA_DES_40_CBC_SHA 0x03000008
+# define SSL3_CK_RSA_DES_64_CBC_SHA 0x03000009
+# define SSL3_CK_RSA_DES_192_CBC3_SHA 0x0300000A
+
+# define SSL3_CK_DH_DSS_DES_40_CBC_SHA 0x0300000B
+# define SSL3_CK_DH_DSS_DES_64_CBC_SHA 0x0300000C
+# define SSL3_CK_DH_DSS_DES_192_CBC3_SHA 0x0300000D
+# define SSL3_CK_DH_RSA_DES_40_CBC_SHA 0x0300000E
+# define SSL3_CK_DH_RSA_DES_64_CBC_SHA 0x0300000F
+# define SSL3_CK_DH_RSA_DES_192_CBC3_SHA 0x03000010
+
+# define SSL3_CK_EDH_DSS_DES_40_CBC_SHA 0x03000011
+# define SSL3_CK_DHE_DSS_DES_40_CBC_SHA SSL3_CK_EDH_DSS_DES_40_CBC_SHA
+# define SSL3_CK_EDH_DSS_DES_64_CBC_SHA 0x03000012
+# define SSL3_CK_DHE_DSS_DES_64_CBC_SHA SSL3_CK_EDH_DSS_DES_64_CBC_SHA
+# define SSL3_CK_EDH_DSS_DES_192_CBC3_SHA 0x03000013
+# define SSL3_CK_DHE_DSS_DES_192_CBC3_SHA SSL3_CK_EDH_DSS_DES_192_CBC3_SHA
+# define SSL3_CK_EDH_RSA_DES_40_CBC_SHA 0x03000014
+# define SSL3_CK_DHE_RSA_DES_40_CBC_SHA SSL3_CK_EDH_RSA_DES_40_CBC_SHA
+# define SSL3_CK_EDH_RSA_DES_64_CBC_SHA 0x03000015
+# define SSL3_CK_DHE_RSA_DES_64_CBC_SHA SSL3_CK_EDH_RSA_DES_64_CBC_SHA
+# define SSL3_CK_EDH_RSA_DES_192_CBC3_SHA 0x03000016
+# define SSL3_CK_DHE_RSA_DES_192_CBC3_SHA SSL3_CK_EDH_RSA_DES_192_CBC3_SHA
+
+# define SSL3_CK_ADH_RC4_40_MD5 0x03000017
+# define SSL3_CK_ADH_RC4_128_MD5 0x03000018
+# define SSL3_CK_ADH_DES_40_CBC_SHA 0x03000019
+# define SSL3_CK_ADH_DES_64_CBC_SHA 0x0300001A
+# define SSL3_CK_ADH_DES_192_CBC_SHA 0x0300001B
+
+# if 0
+# define SSL3_CK_FZA_DMS_NULL_SHA 0x0300001C
+# define SSL3_CK_FZA_DMS_FZA_SHA 0x0300001D
+# if 0 /* Because it clashes with KRB5, is never
+ * used any more, and is safe to remove
+ * according to David Hopwood
+ * <david.hopwood@zetnet.co.uk> of the
+ * ietf-tls list */
+# define SSL3_CK_FZA_DMS_RC4_SHA 0x0300001E
+# endif
+# endif
+
+/*
+ * VRS Additional Kerberos5 entries
+ */
+# define SSL3_CK_KRB5_DES_64_CBC_SHA 0x0300001E
+# define SSL3_CK_KRB5_DES_192_CBC3_SHA 0x0300001F
+# define SSL3_CK_KRB5_RC4_128_SHA 0x03000020
+# define SSL3_CK_KRB5_IDEA_128_CBC_SHA 0x03000021
+# define SSL3_CK_KRB5_DES_64_CBC_MD5 0x03000022
+# define SSL3_CK_KRB5_DES_192_CBC3_MD5 0x03000023
+# define SSL3_CK_KRB5_RC4_128_MD5 0x03000024
+# define SSL3_CK_KRB5_IDEA_128_CBC_MD5 0x03000025
+
+# define SSL3_CK_KRB5_DES_40_CBC_SHA 0x03000026
+# define SSL3_CK_KRB5_RC2_40_CBC_SHA 0x03000027
+# define SSL3_CK_KRB5_RC4_40_SHA 0x03000028
+# define SSL3_CK_KRB5_DES_40_CBC_MD5 0x03000029
+# define SSL3_CK_KRB5_RC2_40_CBC_MD5 0x0300002A
+# define SSL3_CK_KRB5_RC4_40_MD5 0x0300002B
+
+# define SSL3_TXT_RSA_NULL_MD5 "NULL-MD5"
+# define SSL3_TXT_RSA_NULL_SHA "NULL-SHA"
+# define SSL3_TXT_RSA_RC4_40_MD5 "EXP-RC4-MD5"
+# define SSL3_TXT_RSA_RC4_128_MD5 "RC4-MD5"
+# define SSL3_TXT_RSA_RC4_128_SHA "RC4-SHA"
+# define SSL3_TXT_RSA_RC2_40_MD5 "EXP-RC2-CBC-MD5"
+# define SSL3_TXT_RSA_IDEA_128_SHA "IDEA-CBC-SHA"
+# define SSL3_TXT_RSA_DES_40_CBC_SHA "EXP-DES-CBC-SHA"
+# define SSL3_TXT_RSA_DES_64_CBC_SHA "DES-CBC-SHA"
+# define SSL3_TXT_RSA_DES_192_CBC3_SHA "DES-CBC3-SHA"
+
+# define SSL3_TXT_DH_DSS_DES_40_CBC_SHA "EXP-DH-DSS-DES-CBC-SHA"
+# define SSL3_TXT_DH_DSS_DES_64_CBC_SHA "DH-DSS-DES-CBC-SHA"
+# define SSL3_TXT_DH_DSS_DES_192_CBC3_SHA "DH-DSS-DES-CBC3-SHA"
+# define SSL3_TXT_DH_RSA_DES_40_CBC_SHA "EXP-DH-RSA-DES-CBC-SHA"
+# define SSL3_TXT_DH_RSA_DES_64_CBC_SHA "DH-RSA-DES-CBC-SHA"
+# define SSL3_TXT_DH_RSA_DES_192_CBC3_SHA "DH-RSA-DES-CBC3-SHA"
+
+# define SSL3_TXT_DHE_DSS_DES_40_CBC_SHA "EXP-DHE-DSS-DES-CBC-SHA"
+# define SSL3_TXT_DHE_DSS_DES_64_CBC_SHA "DHE-DSS-DES-CBC-SHA"
+# define SSL3_TXT_DHE_DSS_DES_192_CBC3_SHA "DHE-DSS-DES-CBC3-SHA"
+# define SSL3_TXT_DHE_RSA_DES_40_CBC_SHA "EXP-DHE-RSA-DES-CBC-SHA"
+# define SSL3_TXT_DHE_RSA_DES_64_CBC_SHA "DHE-RSA-DES-CBC-SHA"
+# define SSL3_TXT_DHE_RSA_DES_192_CBC3_SHA "DHE-RSA-DES-CBC3-SHA"
+
+/*
+ * This next block of six "EDH" labels is for backward compatibility with
+ * older versions of OpenSSL. New code should use the six "DHE" labels above
+ * instead:
+ */
+# define SSL3_TXT_EDH_DSS_DES_40_CBC_SHA "EXP-EDH-DSS-DES-CBC-SHA"
+# define SSL3_TXT_EDH_DSS_DES_64_CBC_SHA "EDH-DSS-DES-CBC-SHA"
+# define SSL3_TXT_EDH_DSS_DES_192_CBC3_SHA "EDH-DSS-DES-CBC3-SHA"
+# define SSL3_TXT_EDH_RSA_DES_40_CBC_SHA "EXP-EDH-RSA-DES-CBC-SHA"
+# define SSL3_TXT_EDH_RSA_DES_64_CBC_SHA "EDH-RSA-DES-CBC-SHA"
+# define SSL3_TXT_EDH_RSA_DES_192_CBC3_SHA "EDH-RSA-DES-CBC3-SHA"
+
+# define SSL3_TXT_ADH_RC4_40_MD5 "EXP-ADH-RC4-MD5"
+# define SSL3_TXT_ADH_RC4_128_MD5 "ADH-RC4-MD5"
+# define SSL3_TXT_ADH_DES_40_CBC_SHA "EXP-ADH-DES-CBC-SHA"
+# define SSL3_TXT_ADH_DES_64_CBC_SHA "ADH-DES-CBC-SHA"
+# define SSL3_TXT_ADH_DES_192_CBC_SHA "ADH-DES-CBC3-SHA"
+
+# if 0
+# define SSL3_TXT_FZA_DMS_NULL_SHA "FZA-NULL-SHA"
+# define SSL3_TXT_FZA_DMS_FZA_SHA "FZA-FZA-CBC-SHA"
+# define SSL3_TXT_FZA_DMS_RC4_SHA "FZA-RC4-SHA"
+# endif
+
+# define SSL3_TXT_KRB5_DES_64_CBC_SHA "KRB5-DES-CBC-SHA"
+# define SSL3_TXT_KRB5_DES_192_CBC3_SHA "KRB5-DES-CBC3-SHA"
+# define SSL3_TXT_KRB5_RC4_128_SHA "KRB5-RC4-SHA"
+# define SSL3_TXT_KRB5_IDEA_128_CBC_SHA "KRB5-IDEA-CBC-SHA"
+# define SSL3_TXT_KRB5_DES_64_CBC_MD5 "KRB5-DES-CBC-MD5"
+# define SSL3_TXT_KRB5_DES_192_CBC3_MD5 "KRB5-DES-CBC3-MD5"
+# define SSL3_TXT_KRB5_RC4_128_MD5 "KRB5-RC4-MD5"
+# define SSL3_TXT_KRB5_IDEA_128_CBC_MD5 "KRB5-IDEA-CBC-MD5"
+
+# define SSL3_TXT_KRB5_DES_40_CBC_SHA "EXP-KRB5-DES-CBC-SHA"
+# define SSL3_TXT_KRB5_RC2_40_CBC_SHA "EXP-KRB5-RC2-CBC-SHA"
+# define SSL3_TXT_KRB5_RC4_40_SHA "EXP-KRB5-RC4-SHA"
+# define SSL3_TXT_KRB5_DES_40_CBC_MD5 "EXP-KRB5-DES-CBC-MD5"
+# define SSL3_TXT_KRB5_RC2_40_CBC_MD5 "EXP-KRB5-RC2-CBC-MD5"
+# define SSL3_TXT_KRB5_RC4_40_MD5 "EXP-KRB5-RC4-MD5"
+
+# define SSL3_SSL_SESSION_ID_LENGTH 32
+# define SSL3_MAX_SSL_SESSION_ID_LENGTH 32
+
+# define SSL3_MASTER_SECRET_SIZE 48
+# define SSL3_RANDOM_SIZE 32
+# define SSL3_SESSION_ID_SIZE 32
+# define SSL3_RT_HEADER_LENGTH 5
+
+# define SSL3_HM_HEADER_LENGTH 4
+
+# ifndef SSL3_ALIGN_PAYLOAD
+ /*
+ * Some will argue that this increases memory footprint, but it's not
+ * actually true. Point is that malloc has to return at least 64-bit aligned
+ * pointers, meaning that allocating 5 bytes wastes 3 bytes in either case.
+ * Suggested pre-gaping simply moves these wasted bytes from the end of
+ * allocated region to its front, but makes data payload aligned, which
+ * improves performance:-)
+ */
+# define SSL3_ALIGN_PAYLOAD 8
+# else
+# if (SSL3_ALIGN_PAYLOAD&(SSL3_ALIGN_PAYLOAD-1))!=0
+# error "insane SSL3_ALIGN_PAYLOAD"
+# undef SSL3_ALIGN_PAYLOAD
+# endif
+# endif
+
+/*
+ * This is the maximum MAC (digest) size used by the SSL library. Currently
+ * maximum of 20 is used by SHA1, but we reserve for future extension for
+ * 512-bit hashes.
+ */
+
+# define SSL3_RT_MAX_MD_SIZE 64
+
+/*
+ * Maximum block size used in all ciphersuites. Currently 16 for AES.
+ */
+
+# define SSL_RT_MAX_CIPHER_BLOCK_SIZE 16
+
+# define SSL3_RT_MAX_EXTRA (16384)
+
+/* Maximum plaintext length: defined by SSL/TLS standards */
+# define SSL3_RT_MAX_PLAIN_LENGTH 16384
+/* Maximum compression overhead: defined by SSL/TLS standards */
+# define SSL3_RT_MAX_COMPRESSED_OVERHEAD 1024
+
+/*
+ * The standards give a maximum encryption overhead of 1024 bytes. In
+ * practice the value is lower than this. The overhead is the maximum number
+ * of padding bytes (256) plus the mac size.
+ */
+# define SSL3_RT_MAX_ENCRYPTED_OVERHEAD (256 + SSL3_RT_MAX_MD_SIZE)
+
+/*
+ * OpenSSL currently only uses a padding length of at most one block so the
+ * send overhead is smaller.
+ */
+
+# define SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD \
+ (SSL_RT_MAX_CIPHER_BLOCK_SIZE + SSL3_RT_MAX_MD_SIZE)
+
+/* If compression isn't used don't include the compression overhead */
+
+# ifdef OPENSSL_NO_COMP
+# define SSL3_RT_MAX_COMPRESSED_LENGTH SSL3_RT_MAX_PLAIN_LENGTH
+# else
+# define SSL3_RT_MAX_COMPRESSED_LENGTH \
+ (SSL3_RT_MAX_PLAIN_LENGTH+SSL3_RT_MAX_COMPRESSED_OVERHEAD)
+# endif
+# define SSL3_RT_MAX_ENCRYPTED_LENGTH \
+ (SSL3_RT_MAX_ENCRYPTED_OVERHEAD+SSL3_RT_MAX_COMPRESSED_LENGTH)
+# define SSL3_RT_MAX_PACKET_SIZE \
+ (SSL3_RT_MAX_ENCRYPTED_LENGTH+SSL3_RT_HEADER_LENGTH)
+
+# define SSL3_MD_CLIENT_FINISHED_CONST "\x43\x4C\x4E\x54"
+# define SSL3_MD_SERVER_FINISHED_CONST "\x53\x52\x56\x52"
+
+# define SSL3_VERSION 0x0300
+# define SSL3_VERSION_MAJOR 0x03
+# define SSL3_VERSION_MINOR 0x00
+
+# define SSL3_RT_CHANGE_CIPHER_SPEC 20
+# define SSL3_RT_ALERT 21
+# define SSL3_RT_HANDSHAKE 22
+# define SSL3_RT_APPLICATION_DATA 23
+# define TLS1_RT_HEARTBEAT 24
+
+/* Pseudo content types to indicate additional parameters */
+# define TLS1_RT_CRYPTO 0x1000
+# define TLS1_RT_CRYPTO_PREMASTER (TLS1_RT_CRYPTO | 0x1)
+# define TLS1_RT_CRYPTO_CLIENT_RANDOM (TLS1_RT_CRYPTO | 0x2)
+# define TLS1_RT_CRYPTO_SERVER_RANDOM (TLS1_RT_CRYPTO | 0x3)
+# define TLS1_RT_CRYPTO_MASTER (TLS1_RT_CRYPTO | 0x4)
+
+# define TLS1_RT_CRYPTO_READ 0x0000
+# define TLS1_RT_CRYPTO_WRITE 0x0100
+# define TLS1_RT_CRYPTO_MAC (TLS1_RT_CRYPTO | 0x5)
+# define TLS1_RT_CRYPTO_KEY (TLS1_RT_CRYPTO | 0x6)
+# define TLS1_RT_CRYPTO_IV (TLS1_RT_CRYPTO | 0x7)
+# define TLS1_RT_CRYPTO_FIXED_IV (TLS1_RT_CRYPTO | 0x8)
+
+/* Pseudo content type for SSL/TLS header info */
+# define SSL3_RT_HEADER 0x100
+
+# define SSL3_AL_WARNING 1
+# define SSL3_AL_FATAL 2
+
+# define SSL3_AD_CLOSE_NOTIFY 0
+# define SSL3_AD_UNEXPECTED_MESSAGE 10/* fatal */
+# define SSL3_AD_BAD_RECORD_MAC 20/* fatal */
+# define SSL3_AD_DECOMPRESSION_FAILURE 30/* fatal */
+# define SSL3_AD_HANDSHAKE_FAILURE 40/* fatal */
+# define SSL3_AD_NO_CERTIFICATE 41
+# define SSL3_AD_BAD_CERTIFICATE 42
+# define SSL3_AD_UNSUPPORTED_CERTIFICATE 43
+# define SSL3_AD_CERTIFICATE_REVOKED 44
+# define SSL3_AD_CERTIFICATE_EXPIRED 45
+# define SSL3_AD_CERTIFICATE_UNKNOWN 46
+# define SSL3_AD_ILLEGAL_PARAMETER 47/* fatal */
+
+# define TLS1_HB_REQUEST 1
+# define TLS1_HB_RESPONSE 2
+
+# ifndef OPENSSL_NO_SSL_INTERN
+
+typedef struct ssl3_record_st {
+ /* type of record */
+ /*
+ * r
+ */ int type;
+ /* How many bytes available */
+ /*
+ * rw
+ */ unsigned int length;
+ /* read/write offset into 'buf' */
+ /*
+ * r
+ */ unsigned int off;
+ /* pointer to the record data */
+ /*
+ * rw
+ */ unsigned char *data;
+ /* where the decode bytes are */
+ /*
+ * rw
+ */ unsigned char *input;
+ /* only used with decompression - malloc()ed */
+ /*
+ * r
+ */ unsigned char *comp;
+ /* epoch number, needed by DTLS1 */
+ /*
+ * r
+ */ unsigned long epoch;
+ /* sequence number, needed by DTLS1 */
+ /*
+ * r
+ */ unsigned char seq_num[8];
+} SSL3_RECORD;
+
+typedef struct ssl3_buffer_st {
+ /* at least SSL3_RT_MAX_PACKET_SIZE bytes, see ssl3_setup_buffers() */
+ unsigned char *buf;
+ /* buffer size */
+ size_t len;
+ /* where to 'copy from' */
+ int offset;
+ /* how many bytes left */
+ int left;
+} SSL3_BUFFER;
+
+# endif
+
+# define SSL3_CT_RSA_SIGN 1
+# define SSL3_CT_DSS_SIGN 2
+# define SSL3_CT_RSA_FIXED_DH 3
+# define SSL3_CT_DSS_FIXED_DH 4
+# define SSL3_CT_RSA_EPHEMERAL_DH 5
+# define SSL3_CT_DSS_EPHEMERAL_DH 6
+# define SSL3_CT_FORTEZZA_DMS 20
+/*
+ * SSL3_CT_NUMBER is used to size arrays and it must be large enough to
+ * contain all of the cert types defined either for SSLv3 and TLSv1.
+ */
+# define SSL3_CT_NUMBER 9
+
+# define SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS 0x0001
+# define SSL3_FLAGS_DELAY_CLIENT_FINISHED 0x0002
+# define SSL3_FLAGS_POP_BUFFER 0x0004
+# define TLS1_FLAGS_TLS_PADDING_BUG 0x0008
+# define TLS1_FLAGS_SKIP_CERT_VERIFY 0x0010
+# define TLS1_FLAGS_KEEP_HANDSHAKE 0x0020
+/*
+ * Set when the handshake is ready to process peer's ChangeCipherSpec message.
+ * Cleared after the message has been processed.
+ */
+# define SSL3_FLAGS_CCS_OK 0x0080
+
+/* SSL3_FLAGS_SGC_RESTART_DONE is no longer used */
+# define SSL3_FLAGS_SGC_RESTART_DONE 0x0040
+
+# ifndef OPENSSL_NO_SSL_INTERN
+
+typedef struct ssl3_state_st {
+ long flags;
+ int delay_buf_pop_ret;
+ unsigned char read_sequence[8];
+ int read_mac_secret_size;
+ unsigned char read_mac_secret[EVP_MAX_MD_SIZE];
+ unsigned char write_sequence[8];
+ int write_mac_secret_size;
+ unsigned char write_mac_secret[EVP_MAX_MD_SIZE];
+ unsigned char server_random[SSL3_RANDOM_SIZE];
+ unsigned char client_random[SSL3_RANDOM_SIZE];
+ /* flags for countermeasure against known-IV weakness */
+ int need_empty_fragments;
+ int empty_fragment_done;
+ /* The value of 'extra' when the buffers were initialized */
+ int init_extra;
+ SSL3_BUFFER rbuf; /* read IO goes into here */
+ SSL3_BUFFER wbuf; /* write IO goes into here */
+ SSL3_RECORD rrec; /* each decoded record goes in here */
+ SSL3_RECORD wrec; /* goes out from here */
+ /*
+ * storage for Alert/Handshake protocol data received but not yet
+ * processed by ssl3_read_bytes:
+ */
+ unsigned char alert_fragment[2];
+ unsigned int alert_fragment_len;
+ unsigned char handshake_fragment[4];
+ unsigned int handshake_fragment_len;
+ /* partial write - check the numbers match */
+ unsigned int wnum; /* number of bytes sent so far */
+ int wpend_tot; /* number bytes written */
+ int wpend_type;
+ int wpend_ret; /* number of bytes submitted */
+ const unsigned char *wpend_buf;
+ /* used during startup, digest all incoming/outgoing packets */
+ BIO *handshake_buffer;
+ /*
+ * When set of handshake digests is determined, buffer is hashed and
+ * freed and MD_CTX-es for all required digests are stored in this array
+ */
+ EVP_MD_CTX **handshake_dgst;
+ /*
+ * Set whenever an expected ChangeCipherSpec message is processed.
+ * Unset when the peer's Finished message is received.
+ * Unexpected ChangeCipherSpec messages trigger a fatal alert.
+ */
+ int change_cipher_spec;
+ int warn_alert;
+ int fatal_alert;
+ /*
+ * we allow one fatal and one warning alert to be outstanding, send close
+ * alert via the warning alert
+ */
+ int alert_dispatch;
+ unsigned char send_alert[2];
+ /*
+ * This flag is set when we should renegotiate ASAP, basically when there
+ * is no more data in the read or write buffers
+ */
+ int renegotiate;
+ int total_renegotiations;
+ int num_renegotiations;
+ int in_read_app_data;
+ /*
+ * Opaque PRF input as used for the current handshake. These fields are
+ * used only if TLSEXT_TYPE_opaque_prf_input is defined (otherwise, they
+ * are merely present to improve binary compatibility)
+ */
+ void *client_opaque_prf_input;
+ size_t client_opaque_prf_input_len;
+ void *server_opaque_prf_input;
+ size_t server_opaque_prf_input_len;
+ struct {
+ /* actually only needs to be 16+20 */
+ unsigned char cert_verify_md[EVP_MAX_MD_SIZE * 2];
+ /* actually only need to be 16+20 for SSLv3 and 12 for TLS */
+ unsigned char finish_md[EVP_MAX_MD_SIZE * 2];
+ int finish_md_len;
+ unsigned char peer_finish_md[EVP_MAX_MD_SIZE * 2];
+ int peer_finish_md_len;
+ unsigned long message_size;
+ int message_type;
+ /* used to hold the new cipher we are going to use */
+ const SSL_CIPHER *new_cipher;
+# ifndef OPENSSL_NO_DH
+ DH *dh;
+# endif
+# ifndef OPENSSL_NO_ECDH
+ EC_KEY *ecdh; /* holds short lived ECDH key */
+# endif
+ /* used when SSL_ST_FLUSH_DATA is entered */
+ int next_state;
+ int reuse_message;
+ /* used for certificate requests */
+ int cert_req;
+ int ctype_num;
+ char ctype[SSL3_CT_NUMBER];
+ STACK_OF(X509_NAME) *ca_names;
+ int use_rsa_tmp;
+ int key_block_length;
+ unsigned char *key_block;
+ const EVP_CIPHER *new_sym_enc;
+ const EVP_MD *new_hash;
+ int new_mac_pkey_type;
+ int new_mac_secret_size;
+# ifndef OPENSSL_NO_COMP
+ const SSL_COMP *new_compression;
+# else
+ char *new_compression;
+# endif
+ int cert_request;
+ } tmp;
+
+ /* Connection binding to prevent renegotiation attacks */
+ unsigned char previous_client_finished[EVP_MAX_MD_SIZE];
+ unsigned char previous_client_finished_len;
+ unsigned char previous_server_finished[EVP_MAX_MD_SIZE];
+ unsigned char previous_server_finished_len;
+ int send_connection_binding; /* TODOEKR */
+
+# ifndef OPENSSL_NO_NEXTPROTONEG
+ /*
+ * Set if we saw the Next Protocol Negotiation extension from our peer.
+ */
+ int next_proto_neg_seen;
+# endif
+
+# ifndef OPENSSL_NO_TLSEXT
+# ifndef OPENSSL_NO_EC
+ /*
+ * This is set to true if we believe that this is a version of Safari
+ * running on OS X 10.6 or newer. We wish to know this because Safari on
+ * 10.8 .. 10.8.3 has broken ECDHE-ECDSA support.
+ */
+ char is_probably_safari;
+# endif /* !OPENSSL_NO_EC */
+
+ /*
+ * ALPN information (we are in the process of transitioning from NPN to
+ * ALPN.)
+ */
+
+ /*
+ * In a server these point to the selected ALPN protocol after the
+ * ClientHello has been processed. In a client these contain the protocol
+ * that the server selected once the ServerHello has been processed.
+ */
+ unsigned char *alpn_selected;
+ unsigned alpn_selected_len;
+# endif /* OPENSSL_NO_TLSEXT */
+} SSL3_STATE;
+
+# endif
+
+/* SSLv3 */
+/*
+ * client
+ */
+/* extra state */
+# define SSL3_ST_CW_FLUSH (0x100|SSL_ST_CONNECT)
+# ifndef OPENSSL_NO_SCTP
+# define DTLS1_SCTP_ST_CW_WRITE_SOCK (0x310|SSL_ST_CONNECT)
+# define DTLS1_SCTP_ST_CR_READ_SOCK (0x320|SSL_ST_CONNECT)
+# endif
+/* write to server */
+# define SSL3_ST_CW_CLNT_HELLO_A (0x110|SSL_ST_CONNECT)
+# define SSL3_ST_CW_CLNT_HELLO_B (0x111|SSL_ST_CONNECT)
+/* read from server */
+# define SSL3_ST_CR_SRVR_HELLO_A (0x120|SSL_ST_CONNECT)
+# define SSL3_ST_CR_SRVR_HELLO_B (0x121|SSL_ST_CONNECT)
+# define DTLS1_ST_CR_HELLO_VERIFY_REQUEST_A (0x126|SSL_ST_CONNECT)
+# define DTLS1_ST_CR_HELLO_VERIFY_REQUEST_B (0x127|SSL_ST_CONNECT)
+# define SSL3_ST_CR_CERT_A (0x130|SSL_ST_CONNECT)
+# define SSL3_ST_CR_CERT_B (0x131|SSL_ST_CONNECT)
+# define SSL3_ST_CR_KEY_EXCH_A (0x140|SSL_ST_CONNECT)
+# define SSL3_ST_CR_KEY_EXCH_B (0x141|SSL_ST_CONNECT)
+# define SSL3_ST_CR_CERT_REQ_A (0x150|SSL_ST_CONNECT)
+# define SSL3_ST_CR_CERT_REQ_B (0x151|SSL_ST_CONNECT)
+# define SSL3_ST_CR_SRVR_DONE_A (0x160|SSL_ST_CONNECT)
+# define SSL3_ST_CR_SRVR_DONE_B (0x161|SSL_ST_CONNECT)
+/* write to server */
+# define SSL3_ST_CW_CERT_A (0x170|SSL_ST_CONNECT)
+# define SSL3_ST_CW_CERT_B (0x171|SSL_ST_CONNECT)
+# define SSL3_ST_CW_CERT_C (0x172|SSL_ST_CONNECT)
+# define SSL3_ST_CW_CERT_D (0x173|SSL_ST_CONNECT)
+# define SSL3_ST_CW_KEY_EXCH_A (0x180|SSL_ST_CONNECT)
+# define SSL3_ST_CW_KEY_EXCH_B (0x181|SSL_ST_CONNECT)
+# define SSL3_ST_CW_CERT_VRFY_A (0x190|SSL_ST_CONNECT)
+# define SSL3_ST_CW_CERT_VRFY_B (0x191|SSL_ST_CONNECT)
+# define SSL3_ST_CW_CHANGE_A (0x1A0|SSL_ST_CONNECT)
+# define SSL3_ST_CW_CHANGE_B (0x1A1|SSL_ST_CONNECT)
+# ifndef OPENSSL_NO_NEXTPROTONEG
+# define SSL3_ST_CW_NEXT_PROTO_A (0x200|SSL_ST_CONNECT)
+# define SSL3_ST_CW_NEXT_PROTO_B (0x201|SSL_ST_CONNECT)
+# endif
+# define SSL3_ST_CW_FINISHED_A (0x1B0|SSL_ST_CONNECT)
+# define SSL3_ST_CW_FINISHED_B (0x1B1|SSL_ST_CONNECT)
+/* read from server */
+# define SSL3_ST_CR_CHANGE_A (0x1C0|SSL_ST_CONNECT)
+# define SSL3_ST_CR_CHANGE_B (0x1C1|SSL_ST_CONNECT)
+# define SSL3_ST_CR_FINISHED_A (0x1D0|SSL_ST_CONNECT)
+# define SSL3_ST_CR_FINISHED_B (0x1D1|SSL_ST_CONNECT)
+# define SSL3_ST_CR_SESSION_TICKET_A (0x1E0|SSL_ST_CONNECT)
+# define SSL3_ST_CR_SESSION_TICKET_B (0x1E1|SSL_ST_CONNECT)
+# define SSL3_ST_CR_CERT_STATUS_A (0x1F0|SSL_ST_CONNECT)
+# define SSL3_ST_CR_CERT_STATUS_B (0x1F1|SSL_ST_CONNECT)
+
+/* server */
+/* extra state */
+# define SSL3_ST_SW_FLUSH (0x100|SSL_ST_ACCEPT)
+# ifndef OPENSSL_NO_SCTP
+# define DTLS1_SCTP_ST_SW_WRITE_SOCK (0x310|SSL_ST_ACCEPT)
+# define DTLS1_SCTP_ST_SR_READ_SOCK (0x320|SSL_ST_ACCEPT)
+# endif
+/* read from client */
+/* Do not change the number values, they do matter */
+# define SSL3_ST_SR_CLNT_HELLO_A (0x110|SSL_ST_ACCEPT)
+# define SSL3_ST_SR_CLNT_HELLO_B (0x111|SSL_ST_ACCEPT)
+# define SSL3_ST_SR_CLNT_HELLO_C (0x112|SSL_ST_ACCEPT)
+# define SSL3_ST_SR_CLNT_HELLO_D (0x115|SSL_ST_ACCEPT)
+/* write to client */
+# define DTLS1_ST_SW_HELLO_VERIFY_REQUEST_A (0x113|SSL_ST_ACCEPT)
+# define DTLS1_ST_SW_HELLO_VERIFY_REQUEST_B (0x114|SSL_ST_ACCEPT)
+# define SSL3_ST_SW_HELLO_REQ_A (0x120|SSL_ST_ACCEPT)
+# define SSL3_ST_SW_HELLO_REQ_B (0x121|SSL_ST_ACCEPT)
+# define SSL3_ST_SW_HELLO_REQ_C (0x122|SSL_ST_ACCEPT)
+# define SSL3_ST_SW_SRVR_HELLO_A (0x130|SSL_ST_ACCEPT)
+# define SSL3_ST_SW_SRVR_HELLO_B (0x131|SSL_ST_ACCEPT)
+# define SSL3_ST_SW_CERT_A (0x140|SSL_ST_ACCEPT)
+# define SSL3_ST_SW_CERT_B (0x141|SSL_ST_ACCEPT)
+# define SSL3_ST_SW_KEY_EXCH_A (0x150|SSL_ST_ACCEPT)
+# define SSL3_ST_SW_KEY_EXCH_B (0x151|SSL_ST_ACCEPT)
+# define SSL3_ST_SW_CERT_REQ_A (0x160|SSL_ST_ACCEPT)
+# define SSL3_ST_SW_CERT_REQ_B (0x161|SSL_ST_ACCEPT)
+# define SSL3_ST_SW_SRVR_DONE_A (0x170|SSL_ST_ACCEPT)
+# define SSL3_ST_SW_SRVR_DONE_B (0x171|SSL_ST_ACCEPT)
+/* read from client */
+# define SSL3_ST_SR_CERT_A (0x180|SSL_ST_ACCEPT)
+# define SSL3_ST_SR_CERT_B (0x181|SSL_ST_ACCEPT)
+# define SSL3_ST_SR_KEY_EXCH_A (0x190|SSL_ST_ACCEPT)
+# define SSL3_ST_SR_KEY_EXCH_B (0x191|SSL_ST_ACCEPT)
+# define SSL3_ST_SR_CERT_VRFY_A (0x1A0|SSL_ST_ACCEPT)
+# define SSL3_ST_SR_CERT_VRFY_B (0x1A1|SSL_ST_ACCEPT)
+# define SSL3_ST_SR_CHANGE_A (0x1B0|SSL_ST_ACCEPT)
+# define SSL3_ST_SR_CHANGE_B (0x1B1|SSL_ST_ACCEPT)
+# ifndef OPENSSL_NO_NEXTPROTONEG
+# define SSL3_ST_SR_NEXT_PROTO_A (0x210|SSL_ST_ACCEPT)
+# define SSL3_ST_SR_NEXT_PROTO_B (0x211|SSL_ST_ACCEPT)
+# endif
+# define SSL3_ST_SR_FINISHED_A (0x1C0|SSL_ST_ACCEPT)
+# define SSL3_ST_SR_FINISHED_B (0x1C1|SSL_ST_ACCEPT)
+/* write to client */
+# define SSL3_ST_SW_CHANGE_A (0x1D0|SSL_ST_ACCEPT)
+# define SSL3_ST_SW_CHANGE_B (0x1D1|SSL_ST_ACCEPT)
+# define SSL3_ST_SW_FINISHED_A (0x1E0|SSL_ST_ACCEPT)
+# define SSL3_ST_SW_FINISHED_B (0x1E1|SSL_ST_ACCEPT)
+# define SSL3_ST_SW_SESSION_TICKET_A (0x1F0|SSL_ST_ACCEPT)
+# define SSL3_ST_SW_SESSION_TICKET_B (0x1F1|SSL_ST_ACCEPT)
+# define SSL3_ST_SW_CERT_STATUS_A (0x200|SSL_ST_ACCEPT)
+# define SSL3_ST_SW_CERT_STATUS_B (0x201|SSL_ST_ACCEPT)
+
+# define SSL3_MT_HELLO_REQUEST 0
+# define SSL3_MT_CLIENT_HELLO 1
+# define SSL3_MT_SERVER_HELLO 2
+# define SSL3_MT_NEWSESSION_TICKET 4
+# define SSL3_MT_CERTIFICATE 11
+# define SSL3_MT_SERVER_KEY_EXCHANGE 12
+# define SSL3_MT_CERTIFICATE_REQUEST 13
+# define SSL3_MT_SERVER_DONE 14
+# define SSL3_MT_CERTIFICATE_VERIFY 15
+# define SSL3_MT_CLIENT_KEY_EXCHANGE 16
+# define SSL3_MT_FINISHED 20
+# define SSL3_MT_CERTIFICATE_STATUS 22
+# ifndef OPENSSL_NO_NEXTPROTONEG
+# define SSL3_MT_NEXT_PROTO 67
+# endif
+# define DTLS1_MT_HELLO_VERIFY_REQUEST 3
+
+# define SSL3_MT_CCS 1
+
+/* These are used when changing over to a new cipher */
+# define SSL3_CC_READ 0x01
+# define SSL3_CC_WRITE 0x02
+# define SSL3_CC_CLIENT 0x10
+# define SSL3_CC_SERVER 0x20
+# define SSL3_CHANGE_CIPHER_CLIENT_WRITE (SSL3_CC_CLIENT|SSL3_CC_WRITE)
+# define SSL3_CHANGE_CIPHER_SERVER_READ (SSL3_CC_SERVER|SSL3_CC_READ)
+# define SSL3_CHANGE_CIPHER_CLIENT_READ (SSL3_CC_CLIENT|SSL3_CC_READ)
+# define SSL3_CHANGE_CIPHER_SERVER_WRITE (SSL3_CC_SERVER|SSL3_CC_WRITE)
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/deps/openssl/openssl/include/openssl/stack.h b/deps/openssl/openssl/include/openssl/stack.h
index 295968cc186..eb07216659d 100644
--- a/deps/openssl/openssl/include/openssl/stack.h
+++ b/deps/openssl/openssl/include/openssl/stack.h
@@ -1 +1,107 @@
-#include "../../crypto/stack/stack.h"
+/* crypto/stack/stack.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_STACK_H
+# define HEADER_STACK_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct stack_st {
+ int num;
+ char **data;
+ int sorted;
+ int num_alloc;
+ int (*comp) (const void *, const void *);
+} _STACK; /* Use STACK_OF(...) instead */
+
+# define M_sk_num(sk) ((sk) ? (sk)->num:-1)
+# define M_sk_value(sk,n) ((sk) ? (sk)->data[n] : NULL)
+
+int sk_num(const _STACK *);
+void *sk_value(const _STACK *, int);
+
+void *sk_set(_STACK *, int, void *);
+
+_STACK *sk_new(int (*cmp) (const void *, const void *));
+_STACK *sk_new_null(void);
+void sk_free(_STACK *);
+void sk_pop_free(_STACK *st, void (*func) (void *));
+_STACK *sk_deep_copy(_STACK *, void *(*)(void *), void (*)(void *));
+int sk_insert(_STACK *sk, void *data, int where);
+void *sk_delete(_STACK *st, int loc);
+void *sk_delete_ptr(_STACK *st, void *p);
+int sk_find(_STACK *st, void *data);
+int sk_find_ex(_STACK *st, void *data);
+int sk_push(_STACK *st, void *data);
+int sk_unshift(_STACK *st, void *data);
+void *sk_shift(_STACK *st);
+void *sk_pop(_STACK *st);
+void sk_zero(_STACK *st);
+int (*sk_set_cmp_func(_STACK *sk, int (*c) (const void *, const void *)))
+ (const void *, const void *);
+_STACK *sk_dup(_STACK *st);
+void sk_sort(_STACK *st);
+int sk_is_sorted(const _STACK *st);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/deps/openssl/openssl/include/openssl/symhacks.h b/deps/openssl/openssl/include/openssl/symhacks.h
index f946f4ffc6f..239fa4fb1b7 100644
--- a/deps/openssl/openssl/include/openssl/symhacks.h
+++ b/deps/openssl/openssl/include/openssl/symhacks.h
@@ -1 +1,516 @@
-#include "../../crypto/symhacks.h"
+/* ====================================================================
+ * Copyright (c) 1999 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+#ifndef HEADER_SYMHACKS_H
+# define HEADER_SYMHACKS_H
+
+# include <openssl/e_os2.h>
+
+/*
+ * Hacks to solve the problem with linkers incapable of handling very long
+ * symbol names. In the case of VMS, the limit is 31 characters on VMS for
+ * VAX.
+ */
+/*
+ * Note that this affects util/libeay.num and util/ssleay.num... you may
+ * change those manually, but that's not recommended, as those files are
+ * controlled centrally and updated on Unix, and the central definition may
+ * disagree with yours, which in turn may come with shareable library
+ * incompatibilities.
+ */
+# ifdef OPENSSL_SYS_VMS
+
+/* Hack a long name in crypto/ex_data.c */
+# undef CRYPTO_get_ex_data_implementation
+# define CRYPTO_get_ex_data_implementation CRYPTO_get_ex_data_impl
+# undef CRYPTO_set_ex_data_implementation
+# define CRYPTO_set_ex_data_implementation CRYPTO_set_ex_data_impl
+
+/* Hack a long name in crypto/asn1/a_mbstr.c */
+# undef ASN1_STRING_set_default_mask_asc
+# define ASN1_STRING_set_default_mask_asc ASN1_STRING_set_def_mask_asc
+
+# if 0 /* No longer needed, since safestack macro
+ * magic does the job */
+/* Hack the names created with DECLARE_ASN1_SET_OF(PKCS7_SIGNER_INFO) */
+# undef i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO
+# define i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO i2d_ASN1_SET_OF_PKCS7_SIGINF
+# undef d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO
+# define d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO d2i_ASN1_SET_OF_PKCS7_SIGINF
+# endif
+
+# if 0 /* No longer needed, since safestack macro
+ * magic does the job */
+/* Hack the names created with DECLARE_ASN1_SET_OF(PKCS7_RECIP_INFO) */
+# undef i2d_ASN1_SET_OF_PKCS7_RECIP_INFO
+# define i2d_ASN1_SET_OF_PKCS7_RECIP_INFO i2d_ASN1_SET_OF_PKCS7_RECINF
+# undef d2i_ASN1_SET_OF_PKCS7_RECIP_INFO
+# define d2i_ASN1_SET_OF_PKCS7_RECIP_INFO d2i_ASN1_SET_OF_PKCS7_RECINF
+# endif
+
+# if 0 /* No longer needed, since safestack macro
+ * magic does the job */
+/* Hack the names created with DECLARE_ASN1_SET_OF(ACCESS_DESCRIPTION) */
+# undef i2d_ASN1_SET_OF_ACCESS_DESCRIPTION
+# define i2d_ASN1_SET_OF_ACCESS_DESCRIPTION i2d_ASN1_SET_OF_ACC_DESC
+# undef d2i_ASN1_SET_OF_ACCESS_DESCRIPTION
+# define d2i_ASN1_SET_OF_ACCESS_DESCRIPTION d2i_ASN1_SET_OF_ACC_DESC
+# endif
+
+/* Hack the names created with DECLARE_PEM_rw(NETSCAPE_CERT_SEQUENCE) */
+# undef PEM_read_NETSCAPE_CERT_SEQUENCE
+# define PEM_read_NETSCAPE_CERT_SEQUENCE PEM_read_NS_CERT_SEQ
+# undef PEM_write_NETSCAPE_CERT_SEQUENCE
+# define PEM_write_NETSCAPE_CERT_SEQUENCE PEM_write_NS_CERT_SEQ
+# undef PEM_read_bio_NETSCAPE_CERT_SEQUENCE
+# define PEM_read_bio_NETSCAPE_CERT_SEQUENCE PEM_read_bio_NS_CERT_SEQ
+# undef PEM_write_bio_NETSCAPE_CERT_SEQUENCE
+# define PEM_write_bio_NETSCAPE_CERT_SEQUENCE PEM_write_bio_NS_CERT_SEQ
+# undef PEM_write_cb_bio_NETSCAPE_CERT_SEQUENCE
+# define PEM_write_cb_bio_NETSCAPE_CERT_SEQUENCE PEM_write_cb_bio_NS_CERT_SEQ
+
+/* Hack the names created with DECLARE_PEM_rw(PKCS8_PRIV_KEY_INFO) */
+# undef PEM_read_PKCS8_PRIV_KEY_INFO
+# define PEM_read_PKCS8_PRIV_KEY_INFO PEM_read_P8_PRIV_KEY_INFO
+# undef PEM_write_PKCS8_PRIV_KEY_INFO
+# define PEM_write_PKCS8_PRIV_KEY_INFO PEM_write_P8_PRIV_KEY_INFO
+# undef PEM_read_bio_PKCS8_PRIV_KEY_INFO
+# define PEM_read_bio_PKCS8_PRIV_KEY_INFO PEM_read_bio_P8_PRIV_KEY_INFO
+# undef PEM_write_bio_PKCS8_PRIV_KEY_INFO
+# define PEM_write_bio_PKCS8_PRIV_KEY_INFO PEM_write_bio_P8_PRIV_KEY_INFO
+# undef PEM_write_cb_bio_PKCS8_PRIV_KEY_INFO
+# define PEM_write_cb_bio_PKCS8_PRIV_KEY_INFO PEM_wrt_cb_bio_P8_PRIV_KEY_INFO
+
+/* Hack other PEM names */
+# undef PEM_write_bio_PKCS8PrivateKey_nid
+# define PEM_write_bio_PKCS8PrivateKey_nid PEM_write_bio_PKCS8PrivKey_nid
+
+/* Hack some long X509 names */
+# undef X509_REVOKED_get_ext_by_critical
+# define X509_REVOKED_get_ext_by_critical X509_REVOKED_get_ext_by_critic
+# undef X509_policy_tree_get0_user_policies
+# define X509_policy_tree_get0_user_policies X509_pcy_tree_get0_usr_policies
+# undef X509_policy_node_get0_qualifiers
+# define X509_policy_node_get0_qualifiers X509_pcy_node_get0_qualifiers
+# undef X509_STORE_CTX_get_explicit_policy
+# define X509_STORE_CTX_get_explicit_policy X509_STORE_CTX_get_expl_policy
+# undef X509_STORE_CTX_get0_current_issuer
+# define X509_STORE_CTX_get0_current_issuer X509_STORE_CTX_get0_cur_issuer
+
+/* Hack some long CRYPTO names */
+# undef CRYPTO_set_dynlock_destroy_callback
+# define CRYPTO_set_dynlock_destroy_callback CRYPTO_set_dynlock_destroy_cb
+# undef CRYPTO_set_dynlock_create_callback
+# define CRYPTO_set_dynlock_create_callback CRYPTO_set_dynlock_create_cb
+# undef CRYPTO_set_dynlock_lock_callback
+# define CRYPTO_set_dynlock_lock_callback CRYPTO_set_dynlock_lock_cb
+# undef CRYPTO_get_dynlock_lock_callback
+# define CRYPTO_get_dynlock_lock_callback CRYPTO_get_dynlock_lock_cb
+# undef CRYPTO_get_dynlock_destroy_callback
+# define CRYPTO_get_dynlock_destroy_callback CRYPTO_get_dynlock_destroy_cb
+# undef CRYPTO_get_dynlock_create_callback
+# define CRYPTO_get_dynlock_create_callback CRYPTO_get_dynlock_create_cb
+# undef CRYPTO_set_locked_mem_ex_functions
+# define CRYPTO_set_locked_mem_ex_functions CRYPTO_set_locked_mem_ex_funcs
+# undef CRYPTO_get_locked_mem_ex_functions
+# define CRYPTO_get_locked_mem_ex_functions CRYPTO_get_locked_mem_ex_funcs
+
+/* Hack some long SSL/TLS names */
+# undef SSL_CTX_set_default_verify_paths
+# define SSL_CTX_set_default_verify_paths SSL_CTX_set_def_verify_paths
+# undef SSL_get_ex_data_X509_STORE_CTX_idx
+# define SSL_get_ex_data_X509_STORE_CTX_idx SSL_get_ex_d_X509_STORE_CTX_idx
+# undef SSL_add_file_cert_subjects_to_stack
+# define SSL_add_file_cert_subjects_to_stack SSL_add_file_cert_subjs_to_stk
+# undef SSL_add_dir_cert_subjects_to_stack
+# define SSL_add_dir_cert_subjects_to_stack SSL_add_dir_cert_subjs_to_stk
+# undef SSL_CTX_use_certificate_chain_file
+# define SSL_CTX_use_certificate_chain_file SSL_CTX_use_cert_chain_file
+# undef SSL_CTX_set_cert_verify_callback
+# define SSL_CTX_set_cert_verify_callback SSL_CTX_set_cert_verify_cb
+# undef SSL_CTX_set_default_passwd_cb_userdata
+# define SSL_CTX_set_default_passwd_cb_userdata SSL_CTX_set_def_passwd_cb_ud
+# undef SSL_COMP_get_compression_methods
+# define SSL_COMP_get_compression_methods SSL_COMP_get_compress_methods
+# undef SSL_COMP_set0_compression_methods
+# define SSL_COMP_set0_compression_methods SSL_COMP_set0_compress_methods
+# undef SSL_COMP_free_compression_methods
+# define SSL_COMP_free_compression_methods SSL_COMP_free_compress_methods
+# undef ssl_add_clienthello_renegotiate_ext
+# define ssl_add_clienthello_renegotiate_ext ssl_add_clienthello_reneg_ext
+# undef ssl_add_serverhello_renegotiate_ext
+# define ssl_add_serverhello_renegotiate_ext ssl_add_serverhello_reneg_ext
+# undef ssl_parse_clienthello_renegotiate_ext
+# define ssl_parse_clienthello_renegotiate_ext ssl_parse_clienthello_reneg_ext
+# undef ssl_parse_serverhello_renegotiate_ext
+# define ssl_parse_serverhello_renegotiate_ext ssl_parse_serverhello_reneg_ext
+# undef SSL_srp_server_param_with_username
+# define SSL_srp_server_param_with_username SSL_srp_server_param_with_un
+# undef SSL_CTX_set_srp_client_pwd_callback
+# define SSL_CTX_set_srp_client_pwd_callback SSL_CTX_set_srp_client_pwd_cb
+# undef SSL_CTX_set_srp_verify_param_callback
+# define SSL_CTX_set_srp_verify_param_callback SSL_CTX_set_srp_vfy_param_cb
+# undef SSL_CTX_set_srp_username_callback
+# define SSL_CTX_set_srp_username_callback SSL_CTX_set_srp_un_cb
+# undef ssl_add_clienthello_use_srtp_ext
+# define ssl_add_clienthello_use_srtp_ext ssl_add_clihello_use_srtp_ext
+# undef ssl_add_serverhello_use_srtp_ext
+# define ssl_add_serverhello_use_srtp_ext ssl_add_serhello_use_srtp_ext
+# undef ssl_parse_clienthello_use_srtp_ext
+# define ssl_parse_clienthello_use_srtp_ext ssl_parse_clihello_use_srtp_ext
+# undef ssl_parse_serverhello_use_srtp_ext
+# define ssl_parse_serverhello_use_srtp_ext ssl_parse_serhello_use_srtp_ext
+# undef SSL_CTX_set_next_protos_advertised_cb
+# define SSL_CTX_set_next_protos_advertised_cb SSL_CTX_set_next_protos_adv_cb
+# undef SSL_CTX_set_next_proto_select_cb
+# define SSL_CTX_set_next_proto_select_cb SSL_CTX_set_next_proto_sel_cb
+
+# undef tls1_send_server_supplemental_data
+# define tls1_send_server_supplemental_data tls1_send_server_suppl_data
+# undef tls1_send_client_supplemental_data
+# define tls1_send_client_supplemental_data tls1_send_client_suppl_data
+# undef tls1_get_server_supplemental_data
+# define tls1_get_server_supplemental_data tls1_get_server_suppl_data
+# undef tls1_get_client_supplemental_data
+# define tls1_get_client_supplemental_data tls1_get_client_suppl_data
+
+# undef ssl3_cbc_record_digest_supported
+# define ssl3_cbc_record_digest_supported ssl3_cbc_record_digest_support
+# undef ssl_check_clienthello_tlsext_late
+# define ssl_check_clienthello_tlsext_late ssl_check_clihello_tlsext_late
+# undef ssl_check_clienthello_tlsext_early
+# define ssl_check_clienthello_tlsext_early ssl_check_clihello_tlsext_early
+
+/* Hack some RSA long names */
+# undef RSA_padding_check_PKCS1_OAEP_mgf1
+# define RSA_padding_check_PKCS1_OAEP_mgf1 RSA_pad_check_PKCS1_OAEP_mgf1
+
+/* Hack some ENGINE long names */
+# undef ENGINE_get_default_BN_mod_exp_crt
+# define ENGINE_get_default_BN_mod_exp_crt ENGINE_get_def_BN_mod_exp_crt
+# undef ENGINE_set_default_BN_mod_exp_crt
+# define ENGINE_set_default_BN_mod_exp_crt ENGINE_set_def_BN_mod_exp_crt
+# undef ENGINE_set_load_privkey_function
+# define ENGINE_set_load_privkey_function ENGINE_set_load_privkey_fn
+# undef ENGINE_get_load_privkey_function
+# define ENGINE_get_load_privkey_function ENGINE_get_load_privkey_fn
+# undef ENGINE_unregister_pkey_asn1_meths
+# define ENGINE_unregister_pkey_asn1_meths ENGINE_unreg_pkey_asn1_meths
+# undef ENGINE_register_all_pkey_asn1_meths
+# define ENGINE_register_all_pkey_asn1_meths ENGINE_reg_all_pkey_asn1_meths
+# undef ENGINE_set_default_pkey_asn1_meths
+# define ENGINE_set_default_pkey_asn1_meths ENGINE_set_def_pkey_asn1_meths
+# undef ENGINE_get_pkey_asn1_meth_engine
+# define ENGINE_get_pkey_asn1_meth_engine ENGINE_get_pkey_asn1_meth_eng
+# undef ENGINE_set_load_ssl_client_cert_function
+# define ENGINE_set_load_ssl_client_cert_function \
+ ENGINE_set_ld_ssl_clnt_cert_fn
+# undef ENGINE_get_ssl_client_cert_function
+# define ENGINE_get_ssl_client_cert_function ENGINE_get_ssl_client_cert_fn
+
+/* Hack some long OCSP names */
+# undef OCSP_REQUEST_get_ext_by_critical
+# define OCSP_REQUEST_get_ext_by_critical OCSP_REQUEST_get_ext_by_crit
+# undef OCSP_BASICRESP_get_ext_by_critical
+# define OCSP_BASICRESP_get_ext_by_critical OCSP_BASICRESP_get_ext_by_crit
+# undef OCSP_SINGLERESP_get_ext_by_critical
+# define OCSP_SINGLERESP_get_ext_by_critical OCSP_SINGLERESP_get_ext_by_crit
+
+/* Hack some long DES names */
+# undef _ossl_old_des_ede3_cfb64_encrypt
+# define _ossl_old_des_ede3_cfb64_encrypt _ossl_odes_ede3_cfb64_encrypt
+# undef _ossl_old_des_ede3_ofb64_encrypt
+# define _ossl_old_des_ede3_ofb64_encrypt _ossl_odes_ede3_ofb64_encrypt
+
+/* Hack some long EVP names */
+# undef OPENSSL_add_all_algorithms_noconf
+# define OPENSSL_add_all_algorithms_noconf OPENSSL_add_all_algo_noconf
+# undef OPENSSL_add_all_algorithms_conf
+# define OPENSSL_add_all_algorithms_conf OPENSSL_add_all_algo_conf
+# undef EVP_PKEY_meth_set_verify_recover
+# define EVP_PKEY_meth_set_verify_recover EVP_PKEY_meth_set_vrfy_recover
+
+/* Hack some long EC names */
+# undef EC_GROUP_set_point_conversion_form
+# define EC_GROUP_set_point_conversion_form EC_GROUP_set_point_conv_form
+# undef EC_GROUP_get_point_conversion_form
+# define EC_GROUP_get_point_conversion_form EC_GROUP_get_point_conv_form
+# undef EC_GROUP_clear_free_all_extra_data
+# define EC_GROUP_clear_free_all_extra_data EC_GROUP_clr_free_all_xtra_data
+# undef EC_KEY_set_public_key_affine_coordinates
+# define EC_KEY_set_public_key_affine_coordinates \
+ EC_KEY_set_pub_key_aff_coords
+# undef EC_POINT_set_Jprojective_coordinates_GFp
+# define EC_POINT_set_Jprojective_coordinates_GFp \
+ EC_POINT_set_Jproj_coords_GFp
+# undef EC_POINT_get_Jprojective_coordinates_GFp
+# define EC_POINT_get_Jprojective_coordinates_GFp \
+ EC_POINT_get_Jproj_coords_GFp
+# undef EC_POINT_set_affine_coordinates_GFp
+# define EC_POINT_set_affine_coordinates_GFp EC_POINT_set_affine_coords_GFp
+# undef EC_POINT_get_affine_coordinates_GFp
+# define EC_POINT_get_affine_coordinates_GFp EC_POINT_get_affine_coords_GFp
+# undef EC_POINT_set_compressed_coordinates_GFp
+# define EC_POINT_set_compressed_coordinates_GFp EC_POINT_set_compr_coords_GFp
+# undef EC_POINT_set_affine_coordinates_GF2m
+# define EC_POINT_set_affine_coordinates_GF2m EC_POINT_set_affine_coords_GF2m
+# undef EC_POINT_get_affine_coordinates_GF2m
+# define EC_POINT_get_affine_coordinates_GF2m EC_POINT_get_affine_coords_GF2m
+# undef EC_POINT_set_compressed_coordinates_GF2m
+# define EC_POINT_set_compressed_coordinates_GF2m \
+ EC_POINT_set_compr_coords_GF2m
+# undef ec_GF2m_simple_group_clear_finish
+# define ec_GF2m_simple_group_clear_finish ec_GF2m_simple_grp_clr_finish
+# undef ec_GF2m_simple_group_check_discriminant
+# define ec_GF2m_simple_group_check_discriminant ec_GF2m_simple_grp_chk_discrim
+# undef ec_GF2m_simple_point_clear_finish
+# define ec_GF2m_simple_point_clear_finish ec_GF2m_simple_pt_clr_finish
+# undef ec_GF2m_simple_point_set_to_infinity
+# define ec_GF2m_simple_point_set_to_infinity ec_GF2m_simple_pt_set_to_inf
+# undef ec_GF2m_simple_points_make_affine
+# define ec_GF2m_simple_points_make_affine ec_GF2m_simple_pts_make_affine
+# undef ec_GF2m_simple_point_set_affine_coordinates
+# define ec_GF2m_simple_point_set_affine_coordinates \
+ ec_GF2m_smp_pt_set_af_coords
+# undef ec_GF2m_simple_point_get_affine_coordinates
+# define ec_GF2m_simple_point_get_affine_coordinates \
+ ec_GF2m_smp_pt_get_af_coords
+# undef ec_GF2m_simple_set_compressed_coordinates
+# define ec_GF2m_simple_set_compressed_coordinates \
+ ec_GF2m_smp_set_compr_coords
+# undef ec_GFp_simple_group_set_curve_GFp
+# define ec_GFp_simple_group_set_curve_GFp ec_GFp_simple_grp_set_curve_GFp
+# undef ec_GFp_simple_group_get_curve_GFp
+# define ec_GFp_simple_group_get_curve_GFp ec_GFp_simple_grp_get_curve_GFp
+# undef ec_GFp_simple_group_clear_finish
+# define ec_GFp_simple_group_clear_finish ec_GFp_simple_grp_clear_finish
+# undef ec_GFp_simple_group_set_generator
+# define ec_GFp_simple_group_set_generator ec_GFp_simple_grp_set_generator
+# undef ec_GFp_simple_group_get0_generator
+# define ec_GFp_simple_group_get0_generator ec_GFp_simple_grp_gt0_generator
+# undef ec_GFp_simple_group_get_cofactor
+# define ec_GFp_simple_group_get_cofactor ec_GFp_simple_grp_get_cofactor
+# undef ec_GFp_simple_point_clear_finish
+# define ec_GFp_simple_point_clear_finish ec_GFp_simple_pt_clear_finish
+# undef ec_GFp_simple_point_set_to_infinity
+# define ec_GFp_simple_point_set_to_infinity ec_GFp_simple_pt_set_to_inf
+# undef ec_GFp_simple_points_make_affine
+# define ec_GFp_simple_points_make_affine ec_GFp_simple_pts_make_affine
+# undef ec_GFp_simple_set_Jprojective_coordinates_GFp
+# define ec_GFp_simple_set_Jprojective_coordinates_GFp \
+ ec_GFp_smp_set_Jproj_coords_GFp
+# undef ec_GFp_simple_get_Jprojective_coordinates_GFp
+# define ec_GFp_simple_get_Jprojective_coordinates_GFp \
+ ec_GFp_smp_get_Jproj_coords_GFp
+# undef ec_GFp_simple_point_set_affine_coordinates_GFp
+# define ec_GFp_simple_point_set_affine_coordinates_GFp \
+ ec_GFp_smp_pt_set_af_coords_GFp
+# undef ec_GFp_simple_point_get_affine_coordinates_GFp
+# define ec_GFp_simple_point_get_affine_coordinates_GFp \
+ ec_GFp_smp_pt_get_af_coords_GFp
+# undef ec_GFp_simple_set_compressed_coordinates_GFp
+# define ec_GFp_simple_set_compressed_coordinates_GFp \
+ ec_GFp_smp_set_compr_coords_GFp
+# undef ec_GFp_simple_point_set_affine_coordinates
+# define ec_GFp_simple_point_set_affine_coordinates \
+ ec_GFp_smp_pt_set_af_coords
+# undef ec_GFp_simple_point_get_affine_coordinates
+# define ec_GFp_simple_point_get_affine_coordinates \
+ ec_GFp_smp_pt_get_af_coords
+# undef ec_GFp_simple_set_compressed_coordinates
+# define ec_GFp_simple_set_compressed_coordinates \
+ ec_GFp_smp_set_compr_coords
+# undef ec_GFp_simple_group_check_discriminant
+# define ec_GFp_simple_group_check_discriminant ec_GFp_simple_grp_chk_discrim
+
+/* Hack som long STORE names */
+# undef STORE_method_set_initialise_function
+# define STORE_method_set_initialise_function STORE_meth_set_initialise_fn
+# undef STORE_method_set_cleanup_function
+# define STORE_method_set_cleanup_function STORE_meth_set_cleanup_fn
+# undef STORE_method_set_generate_function
+# define STORE_method_set_generate_function STORE_meth_set_generate_fn
+# undef STORE_method_set_modify_function
+# define STORE_method_set_modify_function STORE_meth_set_modify_fn
+# undef STORE_method_set_revoke_function
+# define STORE_method_set_revoke_function STORE_meth_set_revoke_fn
+# undef STORE_method_set_delete_function
+# define STORE_method_set_delete_function STORE_meth_set_delete_fn
+# undef STORE_method_set_list_start_function
+# define STORE_method_set_list_start_function STORE_meth_set_list_start_fn
+# undef STORE_method_set_list_next_function
+# define STORE_method_set_list_next_function STORE_meth_set_list_next_fn
+# undef STORE_method_set_list_end_function
+# define STORE_method_set_list_end_function STORE_meth_set_list_end_fn
+# undef STORE_method_set_update_store_function
+# define STORE_method_set_update_store_function STORE_meth_set_update_store_fn
+# undef STORE_method_set_lock_store_function
+# define STORE_method_set_lock_store_function STORE_meth_set_lock_store_fn
+# undef STORE_method_set_unlock_store_function
+# define STORE_method_set_unlock_store_function STORE_meth_set_unlock_store_fn
+# undef STORE_method_get_initialise_function
+# define STORE_method_get_initialise_function STORE_meth_get_initialise_fn
+# undef STORE_method_get_cleanup_function
+# define STORE_method_get_cleanup_function STORE_meth_get_cleanup_fn
+# undef STORE_method_get_generate_function
+# define STORE_method_get_generate_function STORE_meth_get_generate_fn
+# undef STORE_method_get_modify_function
+# define STORE_method_get_modify_function STORE_meth_get_modify_fn
+# undef STORE_method_get_revoke_function
+# define STORE_method_get_revoke_function STORE_meth_get_revoke_fn
+# undef STORE_method_get_delete_function
+# define STORE_method_get_delete_function STORE_meth_get_delete_fn
+# undef STORE_method_get_list_start_function
+# define STORE_method_get_list_start_function STORE_meth_get_list_start_fn
+# undef STORE_method_get_list_next_function
+# define STORE_method_get_list_next_function STORE_meth_get_list_next_fn
+# undef STORE_method_get_list_end_function
+# define STORE_method_get_list_end_function STORE_meth_get_list_end_fn
+# undef STORE_method_get_update_store_function
+# define STORE_method_get_update_store_function STORE_meth_get_update_store_fn
+# undef STORE_method_get_lock_store_function
+# define STORE_method_get_lock_store_function STORE_meth_get_lock_store_fn
+# undef STORE_method_get_unlock_store_function
+# define STORE_method_get_unlock_store_function STORE_meth_get_unlock_store_fn
+
+/* Hack some long TS names */
+# undef TS_RESP_CTX_set_status_info_cond
+# define TS_RESP_CTX_set_status_info_cond TS_RESP_CTX_set_stat_info_cond
+# undef TS_RESP_CTX_set_clock_precision_digits
+# define TS_RESP_CTX_set_clock_precision_digits TS_RESP_CTX_set_clk_prec_digits
+# undef TS_CONF_set_clock_precision_digits
+# define TS_CONF_set_clock_precision_digits TS_CONF_set_clk_prec_digits
+
+/* Hack some long CMS names */
+# undef CMS_RecipientInfo_ktri_get0_algs
+# define CMS_RecipientInfo_ktri_get0_algs CMS_RecipInfo_ktri_get0_algs
+# undef CMS_RecipientInfo_ktri_get0_signer_id
+# define CMS_RecipientInfo_ktri_get0_signer_id CMS_RecipInfo_ktri_get0_sigr_id
+# undef CMS_OtherRevocationInfoFormat_it
+# define CMS_OtherRevocationInfoFormat_it CMS_OtherRevocInfoFormat_it
+# undef CMS_KeyAgreeRecipientIdentifier_it
+# define CMS_KeyAgreeRecipientIdentifier_it CMS_KeyAgreeRecipIdentifier_it
+# undef CMS_OriginatorIdentifierOrKey_it
+# define CMS_OriginatorIdentifierOrKey_it CMS_OriginatorIdOrKey_it
+# undef cms_SignerIdentifier_get0_signer_id
+# define cms_SignerIdentifier_get0_signer_id cms_SignerId_get0_signer_id
+# undef CMS_RecipientInfo_kari_get0_orig_id
+# define CMS_RecipientInfo_kari_get0_orig_id CMS_RecipInfo_kari_get0_orig_id
+# undef CMS_RecipientInfo_kari_get0_reks
+# define CMS_RecipientInfo_kari_get0_reks CMS_RecipInfo_kari_get0_reks
+# undef CMS_RecipientEncryptedKey_cert_cmp
+# define CMS_RecipientEncryptedKey_cert_cmp CMS_RecipEncryptedKey_cert_cmp
+# undef CMS_RecipientInfo_kari_set0_pkey
+# define CMS_RecipientInfo_kari_set0_pkey CMS_RecipInfo_kari_set0_pkey
+# undef CMS_RecipientEncryptedKey_get0_id
+# define CMS_RecipientEncryptedKey_get0_id CMS_RecipEncryptedKey_get0_id
+# undef CMS_RecipientInfo_kari_orig_id_cmp
+# define CMS_RecipientInfo_kari_orig_id_cmp CMS_RecipInfo_kari_orig_id_cmp
+
+/* Hack some long DTLS1 names */
+# undef dtls1_retransmit_buffered_messages
+# define dtls1_retransmit_buffered_messages dtls1_retransmit_buffered_msgs
+
+/* Hack some long SRP names */
+# undef SRP_generate_server_master_secret
+# define SRP_generate_server_master_secret SRP_gen_server_master_secret
+# undef SRP_generate_client_master_secret
+# define SRP_generate_client_master_secret SRP_gen_client_master_secret
+
+/* Hack some long UI names */
+# undef UI_method_get_prompt_constructor
+# define UI_method_get_prompt_constructor UI_method_get_prompt_constructr
+# undef UI_method_set_prompt_constructor
+# define UI_method_set_prompt_constructor UI_method_set_prompt_constructr
+
+# endif /* defined OPENSSL_SYS_VMS */
+
+/* Case insensitive linking causes problems.... */
+# if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_OS2)
+# undef ERR_load_CRYPTO_strings
+# define ERR_load_CRYPTO_strings ERR_load_CRYPTOlib_strings
+# undef OCSP_crlID_new
+# define OCSP_crlID_new OCSP_crlID2_new
+
+# undef d2i_ECPARAMETERS
+# define d2i_ECPARAMETERS d2i_UC_ECPARAMETERS
+# undef i2d_ECPARAMETERS
+# define i2d_ECPARAMETERS i2d_UC_ECPARAMETERS
+# undef d2i_ECPKPARAMETERS
+# define d2i_ECPKPARAMETERS d2i_UC_ECPKPARAMETERS
+# undef i2d_ECPKPARAMETERS
+# define i2d_ECPKPARAMETERS i2d_UC_ECPKPARAMETERS
+
+/*
+ * These functions do not seem to exist! However, I'm paranoid... Original
+ * command in x509v3.h: These functions are being redefined in another
+ * directory, and clash when the linker is case-insensitive, so let's hide
+ * them a little, by giving them an extra 'o' at the beginning of the name...
+ */
+# undef X509v3_cleanup_extensions
+# define X509v3_cleanup_extensions oX509v3_cleanup_extensions
+# undef X509v3_add_extension
+# define X509v3_add_extension oX509v3_add_extension
+# undef X509v3_add_netscape_extensions
+# define X509v3_add_netscape_extensions oX509v3_add_netscape_extensions
+# undef X509v3_add_standard_extensions
+# define X509v3_add_standard_extensions oX509v3_add_standard_extensions
+
+/* This one clashes with CMS_data_create */
+# undef cms_Data_create
+# define cms_Data_create priv_cms_Data_create
+
+# endif
+
+#endif /* ! defined HEADER_VMS_IDHACKS_H */
diff --git a/deps/openssl/openssl/include/openssl/tls1.h b/deps/openssl/openssl/include/openssl/tls1.h
index c43a70ff31f..5929607ff8b 100644
--- a/deps/openssl/openssl/include/openssl/tls1.h
+++ b/deps/openssl/openssl/include/openssl/tls1.h
@@ -1 +1,813 @@
-#include "../../ssl/tls1.h"
+/* ssl/tls1.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+/* ====================================================================
+ * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+/* ====================================================================
+ * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
+ *
+ * Portions of the attached software ("Contribution") are developed by
+ * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project.
+ *
+ * The Contribution is licensed pursuant to the OpenSSL open source
+ * license provided above.
+ *
+ * ECC cipher suite support in OpenSSL originally written by
+ * Vipul Gupta and Sumit Gupta of Sun Microsystems Laboratories.
+ *
+ */
+/* ====================================================================
+ * Copyright 2005 Nokia. All rights reserved.
+ *
+ * The portions of the attached software ("Contribution") is developed by
+ * Nokia Corporation and is licensed pursuant to the OpenSSL open source
+ * license.
+ *
+ * The Contribution, originally written by Mika Kousa and Pasi Eronen of
+ * Nokia Corporation, consists of the "PSK" (Pre-Shared Key) ciphersuites
+ * support (see RFC 4279) to OpenSSL.
+ *
+ * No patent licenses or other rights except those expressly stated in
+ * the OpenSSL open source license shall be deemed granted or received
+ * expressly, by implication, estoppel, or otherwise.
+ *
+ * No assurances are provided by Nokia that the Contribution does not
+ * infringe the patent or other intellectual property rights of any third
+ * party or that the license provides you with all the necessary rights
+ * to make use of the Contribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. IN
+ * ADDITION TO THE DISCLAIMERS INCLUDED IN THE LICENSE, NOKIA
+ * SPECIFICALLY DISCLAIMS ANY LIABILITY FOR CLAIMS BROUGHT BY YOU OR ANY
+ * OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR
+ * OTHERWISE.
+ */
+
+#ifndef HEADER_TLS1_H
+# define HEADER_TLS1_H
+
+# include <openssl/buffer.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# define TLS1_ALLOW_EXPERIMENTAL_CIPHERSUITES 0
+
+# define TLS1_VERSION 0x0301
+# define TLS1_1_VERSION 0x0302
+# define TLS1_2_VERSION 0x0303
+# define TLS_MAX_VERSION TLS1_2_VERSION
+
+# define TLS1_VERSION_MAJOR 0x03
+# define TLS1_VERSION_MINOR 0x01
+
+# define TLS1_1_VERSION_MAJOR 0x03
+# define TLS1_1_VERSION_MINOR 0x02
+
+# define TLS1_2_VERSION_MAJOR 0x03
+# define TLS1_2_VERSION_MINOR 0x03
+
+# define TLS1_get_version(s) \
+ ((s->version >> 8) == TLS1_VERSION_MAJOR ? s->version : 0)
+
+# define TLS1_get_client_version(s) \
+ ((s->client_version >> 8) == TLS1_VERSION_MAJOR ? s->client_version : 0)
+
+# define TLS1_AD_DECRYPTION_FAILED 21
+# define TLS1_AD_RECORD_OVERFLOW 22
+# define TLS1_AD_UNKNOWN_CA 48/* fatal */
+# define TLS1_AD_ACCESS_DENIED 49/* fatal */
+# define TLS1_AD_DECODE_ERROR 50/* fatal */
+# define TLS1_AD_DECRYPT_ERROR 51
+# define TLS1_AD_EXPORT_RESTRICTION 60/* fatal */
+# define TLS1_AD_PROTOCOL_VERSION 70/* fatal */
+# define TLS1_AD_INSUFFICIENT_SECURITY 71/* fatal */
+# define TLS1_AD_INTERNAL_ERROR 80/* fatal */
+# define TLS1_AD_INAPPROPRIATE_FALLBACK 86/* fatal */
+# define TLS1_AD_USER_CANCELLED 90
+# define TLS1_AD_NO_RENEGOTIATION 100
+/* codes 110-114 are from RFC3546 */
+# define TLS1_AD_UNSUPPORTED_EXTENSION 110
+# define TLS1_AD_CERTIFICATE_UNOBTAINABLE 111
+# define TLS1_AD_UNRECOGNIZED_NAME 112
+# define TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE 113
+# define TLS1_AD_BAD_CERTIFICATE_HASH_VALUE 114
+# define TLS1_AD_UNKNOWN_PSK_IDENTITY 115/* fatal */
+
+/* ExtensionType values from RFC3546 / RFC4366 / RFC6066 */
+# define TLSEXT_TYPE_server_name 0
+# define TLSEXT_TYPE_max_fragment_length 1
+# define TLSEXT_TYPE_client_certificate_url 2
+# define TLSEXT_TYPE_trusted_ca_keys 3
+# define TLSEXT_TYPE_truncated_hmac 4
+# define TLSEXT_TYPE_status_request 5
+/* ExtensionType values from RFC4681 */
+# define TLSEXT_TYPE_user_mapping 6
+/* ExtensionType values from RFC5878 */
+# define TLSEXT_TYPE_client_authz 7
+# define TLSEXT_TYPE_server_authz 8
+/* ExtensionType values from RFC6091 */
+# define TLSEXT_TYPE_cert_type 9
+
+/* ExtensionType values from RFC4492 */
+# define TLSEXT_TYPE_elliptic_curves 10
+# define TLSEXT_TYPE_ec_point_formats 11
+
+/* ExtensionType value from RFC5054 */
+# define TLSEXT_TYPE_srp 12
+
+/* ExtensionType values from RFC5246 */
+# define TLSEXT_TYPE_signature_algorithms 13
+
+/* ExtensionType value from RFC5764 */
+# define TLSEXT_TYPE_use_srtp 14
+
+/* ExtensionType value from RFC5620 */
+# define TLSEXT_TYPE_heartbeat 15
+
+/* ExtensionType value from draft-ietf-tls-applayerprotoneg-00 */
+# define TLSEXT_TYPE_application_layer_protocol_negotiation 16
+
+/*
+ * ExtensionType value for TLS padding extension.
+ * http://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml
+ * http://tools.ietf.org/html/draft-agl-tls-padding-03
+ */
+# define TLSEXT_TYPE_padding 21
+
+/* ExtensionType value from RFC4507 */
+# define TLSEXT_TYPE_session_ticket 35
+
+/* ExtensionType value from draft-rescorla-tls-opaque-prf-input-00.txt */
+# if 0
+/*
+ * will have to be provided externally for now ,
+ * i.e. build with -DTLSEXT_TYPE_opaque_prf_input=38183
+ * using whatever extension number you'd like to try
+ */
+# define TLSEXT_TYPE_opaque_prf_input ??
+# endif
+
+/* Temporary extension type */
+# define TLSEXT_TYPE_renegotiate 0xff01
+
+# ifndef OPENSSL_NO_NEXTPROTONEG
+/* This is not an IANA defined extension number */
+# define TLSEXT_TYPE_next_proto_neg 13172
+# endif
+
+/* NameType value from RFC 3546 */
+# define TLSEXT_NAMETYPE_host_name 0
+/* status request value from RFC 3546 */
+# define TLSEXT_STATUSTYPE_ocsp 1
+
+/* ECPointFormat values from draft-ietf-tls-ecc-12 */
+# define TLSEXT_ECPOINTFORMAT_first 0
+# define TLSEXT_ECPOINTFORMAT_uncompressed 0
+# define TLSEXT_ECPOINTFORMAT_ansiX962_compressed_prime 1
+# define TLSEXT_ECPOINTFORMAT_ansiX962_compressed_char2 2
+# define TLSEXT_ECPOINTFORMAT_last 2
+
+/* Signature and hash algorithms from RFC 5246 */
+
+# define TLSEXT_signature_anonymous 0
+# define TLSEXT_signature_rsa 1
+# define TLSEXT_signature_dsa 2
+# define TLSEXT_signature_ecdsa 3
+
+/* Total number of different signature algorithms */
+# define TLSEXT_signature_num 4
+
+# define TLSEXT_hash_none 0
+# define TLSEXT_hash_md5 1
+# define TLSEXT_hash_sha1 2
+# define TLSEXT_hash_sha224 3
+# define TLSEXT_hash_sha256 4
+# define TLSEXT_hash_sha384 5
+# define TLSEXT_hash_sha512 6
+
+/* Total number of different digest algorithms */
+
+# define TLSEXT_hash_num 7
+
+/* Flag set for unrecognised algorithms */
+# define TLSEXT_nid_unknown 0x1000000
+
+/* ECC curves */
+
+# define TLSEXT_curve_P_256 23
+# define TLSEXT_curve_P_384 24
+
+# ifndef OPENSSL_NO_TLSEXT
+
+# define TLSEXT_MAXLEN_host_name 255
+
+const char *SSL_get_servername(const SSL *s, const int type);
+int SSL_get_servername_type(const SSL *s);
+/*
+ * SSL_export_keying_material exports a value derived from the master secret,
+ * as specified in RFC 5705. It writes |olen| bytes to |out| given a label and
+ * optional context. (Since a zero length context is allowed, the |use_context|
+ * flag controls whether a context is included.) It returns 1 on success and
+ * zero otherwise.
+ */
+int SSL_export_keying_material(SSL *s, unsigned char *out, size_t olen,
+ const char *label, size_t llen,
+ const unsigned char *p, size_t plen,
+ int use_context);
+
+int SSL_get_sigalgs(SSL *s, int idx,
+ int *psign, int *phash, int *psignandhash,
+ unsigned char *rsig, unsigned char *rhash);
+
+int SSL_get_shared_sigalgs(SSL *s, int idx,
+ int *psign, int *phash, int *psignandhash,
+ unsigned char *rsig, unsigned char *rhash);
+
+int SSL_check_chain(SSL *s, X509 *x, EVP_PKEY *pk, STACK_OF(X509) *chain);
+
+# define SSL_set_tlsext_host_name(s,name) \
+SSL_ctrl(s,SSL_CTRL_SET_TLSEXT_HOSTNAME,TLSEXT_NAMETYPE_host_name,(char *)name)
+
+# define SSL_set_tlsext_debug_callback(ssl, cb) \
+SSL_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_DEBUG_CB,(void (*)(void))cb)
+
+# define SSL_set_tlsext_debug_arg(ssl, arg) \
+SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_DEBUG_ARG,0, (void *)arg)
+
+# define SSL_set_tlsext_status_type(ssl, type) \
+SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE,type, NULL)
+
+# define SSL_get_tlsext_status_exts(ssl, arg) \
+SSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS,0, (void *)arg)
+
+# define SSL_set_tlsext_status_exts(ssl, arg) \
+SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS,0, (void *)arg)
+
+# define SSL_get_tlsext_status_ids(ssl, arg) \
+SSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS,0, (void *)arg)
+
+# define SSL_set_tlsext_status_ids(ssl, arg) \
+SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS,0, (void *)arg)
+
+# define SSL_get_tlsext_status_ocsp_resp(ssl, arg) \
+SSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP,0, (void *)arg)
+
+# define SSL_set_tlsext_status_ocsp_resp(ssl, arg, arglen) \
+SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP,arglen, (void *)arg)
+
+# define SSL_CTX_set_tlsext_servername_callback(ctx, cb) \
+SSL_CTX_callback_ctrl(ctx,SSL_CTRL_SET_TLSEXT_SERVERNAME_CB,(void (*)(void))cb)
+
+# define SSL_TLSEXT_ERR_OK 0
+# define SSL_TLSEXT_ERR_ALERT_WARNING 1
+# define SSL_TLSEXT_ERR_ALERT_FATAL 2
+# define SSL_TLSEXT_ERR_NOACK 3
+
+# define SSL_CTX_set_tlsext_servername_arg(ctx, arg) \
+SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG,0, (void *)arg)
+
+# define SSL_CTX_get_tlsext_ticket_keys(ctx, keys, keylen) \
+ SSL_CTX_ctrl((ctx),SSL_CTRL_GET_TLSEXT_TICKET_KEYS,(keylen),(keys))
+# define SSL_CTX_set_tlsext_ticket_keys(ctx, keys, keylen) \
+ SSL_CTX_ctrl((ctx),SSL_CTRL_SET_TLSEXT_TICKET_KEYS,(keylen),(keys))
+
+# define SSL_CTX_set_tlsext_status_cb(ssl, cb) \
+SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB,(void (*)(void))cb)
+
+# define SSL_CTX_set_tlsext_status_arg(ssl, arg) \
+SSL_CTX_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG,0, (void *)arg)
+
+# define SSL_set_tlsext_opaque_prf_input(s, src, len) \
+SSL_ctrl(s,SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT, len, src)
+# define SSL_CTX_set_tlsext_opaque_prf_input_callback(ctx, cb) \
+SSL_CTX_callback_ctrl(ctx,SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB, (void (*)(void))cb)
+# define SSL_CTX_set_tlsext_opaque_prf_input_callback_arg(ctx, arg) \
+SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB_ARG, 0, arg)
+
+# define SSL_CTX_set_tlsext_ticket_key_cb(ssl, cb) \
+SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb)
+
+# ifndef OPENSSL_NO_HEARTBEATS
+# define SSL_TLSEXT_HB_ENABLED 0x01
+# define SSL_TLSEXT_HB_DONT_SEND_REQUESTS 0x02
+# define SSL_TLSEXT_HB_DONT_RECV_REQUESTS 0x04
+
+# define SSL_get_tlsext_heartbeat_pending(ssl) \
+ SSL_ctrl((ssl),SSL_CTRL_GET_TLS_EXT_HEARTBEAT_PENDING,0,NULL)
+# define SSL_set_tlsext_heartbeat_no_requests(ssl, arg) \
+ SSL_ctrl((ssl),SSL_CTRL_SET_TLS_EXT_HEARTBEAT_NO_REQUESTS,arg,NULL)
+# endif
+# endif
+
+/* PSK ciphersuites from 4279 */
+# define TLS1_CK_PSK_WITH_RC4_128_SHA 0x0300008A
+# define TLS1_CK_PSK_WITH_3DES_EDE_CBC_SHA 0x0300008B
+# define TLS1_CK_PSK_WITH_AES_128_CBC_SHA 0x0300008C
+# define TLS1_CK_PSK_WITH_AES_256_CBC_SHA 0x0300008D
+
+/*
+ * Additional TLS ciphersuites from expired Internet Draft
+ * draft-ietf-tls-56-bit-ciphersuites-01.txt (available if
+ * TLS1_ALLOW_EXPERIMENTAL_CIPHERSUITES is defined, see s3_lib.c). We
+ * actually treat them like SSL 3.0 ciphers, which we probably shouldn't.
+ * Note that the first two are actually not in the IDs.
+ */
+# define TLS1_CK_RSA_EXPORT1024_WITH_RC4_56_MD5 0x03000060/* not in
+ * ID */
+# define TLS1_CK_RSA_EXPORT1024_WITH_RC2_CBC_56_MD5 0x03000061/* not in
+ * ID */
+# define TLS1_CK_RSA_EXPORT1024_WITH_DES_CBC_SHA 0x03000062
+# define TLS1_CK_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA 0x03000063
+# define TLS1_CK_RSA_EXPORT1024_WITH_RC4_56_SHA 0x03000064
+# define TLS1_CK_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA 0x03000065
+# define TLS1_CK_DHE_DSS_WITH_RC4_128_SHA 0x03000066
+
+/* AES ciphersuites from RFC3268 */
+
+# define TLS1_CK_RSA_WITH_AES_128_SHA 0x0300002F
+# define TLS1_CK_DH_DSS_WITH_AES_128_SHA 0x03000030
+# define TLS1_CK_DH_RSA_WITH_AES_128_SHA 0x03000031
+# define TLS1_CK_DHE_DSS_WITH_AES_128_SHA 0x03000032
+# define TLS1_CK_DHE_RSA_WITH_AES_128_SHA 0x03000033
+# define TLS1_CK_ADH_WITH_AES_128_SHA 0x03000034
+
+# define TLS1_CK_RSA_WITH_AES_256_SHA 0x03000035
+# define TLS1_CK_DH_DSS_WITH_AES_256_SHA 0x03000036
+# define TLS1_CK_DH_RSA_WITH_AES_256_SHA 0x03000037
+# define TLS1_CK_DHE_DSS_WITH_AES_256_SHA 0x03000038
+# define TLS1_CK_DHE_RSA_WITH_AES_256_SHA 0x03000039
+# define TLS1_CK_ADH_WITH_AES_256_SHA 0x0300003A
+
+/* TLS v1.2 ciphersuites */
+# define TLS1_CK_RSA_WITH_NULL_SHA256 0x0300003B
+# define TLS1_CK_RSA_WITH_AES_128_SHA256 0x0300003C
+# define TLS1_CK_RSA_WITH_AES_256_SHA256 0x0300003D
+# define TLS1_CK_DH_DSS_WITH_AES_128_SHA256 0x0300003E
+# define TLS1_CK_DH_RSA_WITH_AES_128_SHA256 0x0300003F
+# define TLS1_CK_DHE_DSS_WITH_AES_128_SHA256 0x03000040
+
+/* Camellia ciphersuites from RFC4132 */
+# define TLS1_CK_RSA_WITH_CAMELLIA_128_CBC_SHA 0x03000041
+# define TLS1_CK_DH_DSS_WITH_CAMELLIA_128_CBC_SHA 0x03000042
+# define TLS1_CK_DH_RSA_WITH_CAMELLIA_128_CBC_SHA 0x03000043
+# define TLS1_CK_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA 0x03000044
+# define TLS1_CK_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA 0x03000045
+# define TLS1_CK_ADH_WITH_CAMELLIA_128_CBC_SHA 0x03000046
+
+/* TLS v1.2 ciphersuites */
+# define TLS1_CK_DHE_RSA_WITH_AES_128_SHA256 0x03000067
+# define TLS1_CK_DH_DSS_WITH_AES_256_SHA256 0x03000068
+# define TLS1_CK_DH_RSA_WITH_AES_256_SHA256 0x03000069
+# define TLS1_CK_DHE_DSS_WITH_AES_256_SHA256 0x0300006A
+# define TLS1_CK_DHE_RSA_WITH_AES_256_SHA256 0x0300006B
+# define TLS1_CK_ADH_WITH_AES_128_SHA256 0x0300006C
+# define TLS1_CK_ADH_WITH_AES_256_SHA256 0x0300006D
+
+/* Camellia ciphersuites from RFC4132 */
+# define TLS1_CK_RSA_WITH_CAMELLIA_256_CBC_SHA 0x03000084
+# define TLS1_CK_DH_DSS_WITH_CAMELLIA_256_CBC_SHA 0x03000085
+# define TLS1_CK_DH_RSA_WITH_CAMELLIA_256_CBC_SHA 0x03000086
+# define TLS1_CK_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA 0x03000087
+# define TLS1_CK_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA 0x03000088
+# define TLS1_CK_ADH_WITH_CAMELLIA_256_CBC_SHA 0x03000089
+
+/* SEED ciphersuites from RFC4162 */
+# define TLS1_CK_RSA_WITH_SEED_SHA 0x03000096
+# define TLS1_CK_DH_DSS_WITH_SEED_SHA 0x03000097
+# define TLS1_CK_DH_RSA_WITH_SEED_SHA 0x03000098
+# define TLS1_CK_DHE_DSS_WITH_SEED_SHA 0x03000099
+# define TLS1_CK_DHE_RSA_WITH_SEED_SHA 0x0300009A
+# define TLS1_CK_ADH_WITH_SEED_SHA 0x0300009B
+
+/* TLS v1.2 GCM ciphersuites from RFC5288 */
+# define TLS1_CK_RSA_WITH_AES_128_GCM_SHA256 0x0300009C
+# define TLS1_CK_RSA_WITH_AES_256_GCM_SHA384 0x0300009D
+# define TLS1_CK_DHE_RSA_WITH_AES_128_GCM_SHA256 0x0300009E
+# define TLS1_CK_DHE_RSA_WITH_AES_256_GCM_SHA384 0x0300009F
+# define TLS1_CK_DH_RSA_WITH_AES_128_GCM_SHA256 0x030000A0
+# define TLS1_CK_DH_RSA_WITH_AES_256_GCM_SHA384 0x030000A1
+# define TLS1_CK_DHE_DSS_WITH_AES_128_GCM_SHA256 0x030000A2
+# define TLS1_CK_DHE_DSS_WITH_AES_256_GCM_SHA384 0x030000A3
+# define TLS1_CK_DH_DSS_WITH_AES_128_GCM_SHA256 0x030000A4
+# define TLS1_CK_DH_DSS_WITH_AES_256_GCM_SHA384 0x030000A5
+# define TLS1_CK_ADH_WITH_AES_128_GCM_SHA256 0x030000A6
+# define TLS1_CK_ADH_WITH_AES_256_GCM_SHA384 0x030000A7
+
+/*
+ * ECC ciphersuites from draft-ietf-tls-ecc-12.txt with changes soon to be in
+ * draft 13
+ */
+# define TLS1_CK_ECDH_ECDSA_WITH_NULL_SHA 0x0300C001
+# define TLS1_CK_ECDH_ECDSA_WITH_RC4_128_SHA 0x0300C002
+# define TLS1_CK_ECDH_ECDSA_WITH_DES_192_CBC3_SHA 0x0300C003
+# define TLS1_CK_ECDH_ECDSA_WITH_AES_128_CBC_SHA 0x0300C004
+# define TLS1_CK_ECDH_ECDSA_WITH_AES_256_CBC_SHA 0x0300C005
+
+# define TLS1_CK_ECDHE_ECDSA_WITH_NULL_SHA 0x0300C006
+# define TLS1_CK_ECDHE_ECDSA_WITH_RC4_128_SHA 0x0300C007
+# define TLS1_CK_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA 0x0300C008
+# define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CBC_SHA 0x0300C009
+# define TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CBC_SHA 0x0300C00A
+
+# define TLS1_CK_ECDH_RSA_WITH_NULL_SHA 0x0300C00B
+# define TLS1_CK_ECDH_RSA_WITH_RC4_128_SHA 0x0300C00C
+# define TLS1_CK_ECDH_RSA_WITH_DES_192_CBC3_SHA 0x0300C00D
+# define TLS1_CK_ECDH_RSA_WITH_AES_128_CBC_SHA 0x0300C00E
+# define TLS1_CK_ECDH_RSA_WITH_AES_256_CBC_SHA 0x0300C00F
+
+# define TLS1_CK_ECDHE_RSA_WITH_NULL_SHA 0x0300C010
+# define TLS1_CK_ECDHE_RSA_WITH_RC4_128_SHA 0x0300C011
+# define TLS1_CK_ECDHE_RSA_WITH_DES_192_CBC3_SHA 0x0300C012
+# define TLS1_CK_ECDHE_RSA_WITH_AES_128_CBC_SHA 0x0300C013
+# define TLS1_CK_ECDHE_RSA_WITH_AES_256_CBC_SHA 0x0300C014
+
+# define TLS1_CK_ECDH_anon_WITH_NULL_SHA 0x0300C015
+# define TLS1_CK_ECDH_anon_WITH_RC4_128_SHA 0x0300C016
+# define TLS1_CK_ECDH_anon_WITH_DES_192_CBC3_SHA 0x0300C017
+# define TLS1_CK_ECDH_anon_WITH_AES_128_CBC_SHA 0x0300C018
+# define TLS1_CK_ECDH_anon_WITH_AES_256_CBC_SHA 0x0300C019
+
+/* SRP ciphersuites from RFC 5054 */
+# define TLS1_CK_SRP_SHA_WITH_3DES_EDE_CBC_SHA 0x0300C01A
+# define TLS1_CK_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA 0x0300C01B
+# define TLS1_CK_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA 0x0300C01C
+# define TLS1_CK_SRP_SHA_WITH_AES_128_CBC_SHA 0x0300C01D
+# define TLS1_CK_SRP_SHA_RSA_WITH_AES_128_CBC_SHA 0x0300C01E
+# define TLS1_CK_SRP_SHA_DSS_WITH_AES_128_CBC_SHA 0x0300C01F
+# define TLS1_CK_SRP_SHA_WITH_AES_256_CBC_SHA 0x0300C020
+# define TLS1_CK_SRP_SHA_RSA_WITH_AES_256_CBC_SHA 0x0300C021
+# define TLS1_CK_SRP_SHA_DSS_WITH_AES_256_CBC_SHA 0x0300C022
+
+/* ECDH HMAC based ciphersuites from RFC5289 */
+
+# define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_SHA256 0x0300C023
+# define TLS1_CK_ECDHE_ECDSA_WITH_AES_256_SHA384 0x0300C024
+# define TLS1_CK_ECDH_ECDSA_WITH_AES_128_SHA256 0x0300C025
+# define TLS1_CK_ECDH_ECDSA_WITH_AES_256_SHA384 0x0300C026
+# define TLS1_CK_ECDHE_RSA_WITH_AES_128_SHA256 0x0300C027
+# define TLS1_CK_ECDHE_RSA_WITH_AES_256_SHA384 0x0300C028
+# define TLS1_CK_ECDH_RSA_WITH_AES_128_SHA256 0x0300C029
+# define TLS1_CK_ECDH_RSA_WITH_AES_256_SHA384 0x0300C02A
+
+/* ECDH GCM based ciphersuites from RFC5289 */
+# define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 0x0300C02B
+# define TLS1_CK_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 0x0300C02C
+# define TLS1_CK_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 0x0300C02D
+# define TLS1_CK_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 0x0300C02E
+# define TLS1_CK_ECDHE_RSA_WITH_AES_128_GCM_SHA256 0x0300C02F
+# define TLS1_CK_ECDHE_RSA_WITH_AES_256_GCM_SHA384 0x0300C030
+# define TLS1_CK_ECDH_RSA_WITH_AES_128_GCM_SHA256 0x0300C031
+# define TLS1_CK_ECDH_RSA_WITH_AES_256_GCM_SHA384 0x0300C032
+
+/*
+ * XXX * Backward compatibility alert: + * Older versions of OpenSSL gave
+ * some DHE ciphers names with "EDH" + * instead of "DHE". Going forward, we
+ * should be using DHE + * everywhere, though we may indefinitely maintain
+ * aliases for users + * or configurations that used "EDH" +
+ */
+# define TLS1_TXT_RSA_EXPORT1024_WITH_RC4_56_MD5 "EXP1024-RC4-MD5"
+# define TLS1_TXT_RSA_EXPORT1024_WITH_RC2_CBC_56_MD5 "EXP1024-RC2-CBC-MD5"
+# define TLS1_TXT_RSA_EXPORT1024_WITH_DES_CBC_SHA "EXP1024-DES-CBC-SHA"
+# define TLS1_TXT_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA "EXP1024-DHE-DSS-DES-CBC-SHA"
+# define TLS1_TXT_RSA_EXPORT1024_WITH_RC4_56_SHA "EXP1024-RC4-SHA"
+# define TLS1_TXT_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA "EXP1024-DHE-DSS-RC4-SHA"
+# define TLS1_TXT_DHE_DSS_WITH_RC4_128_SHA "DHE-DSS-RC4-SHA"
+
+/* AES ciphersuites from RFC3268 */
+# define TLS1_TXT_RSA_WITH_AES_128_SHA "AES128-SHA"
+# define TLS1_TXT_DH_DSS_WITH_AES_128_SHA "DH-DSS-AES128-SHA"
+# define TLS1_TXT_DH_RSA_WITH_AES_128_SHA "DH-RSA-AES128-SHA"
+# define TLS1_TXT_DHE_DSS_WITH_AES_128_SHA "DHE-DSS-AES128-SHA"
+# define TLS1_TXT_DHE_RSA_WITH_AES_128_SHA "DHE-RSA-AES128-SHA"
+# define TLS1_TXT_ADH_WITH_AES_128_SHA "ADH-AES128-SHA"
+
+# define TLS1_TXT_RSA_WITH_AES_256_SHA "AES256-SHA"
+# define TLS1_TXT_DH_DSS_WITH_AES_256_SHA "DH-DSS-AES256-SHA"
+# define TLS1_TXT_DH_RSA_WITH_AES_256_SHA "DH-RSA-AES256-SHA"
+# define TLS1_TXT_DHE_DSS_WITH_AES_256_SHA "DHE-DSS-AES256-SHA"
+# define TLS1_TXT_DHE_RSA_WITH_AES_256_SHA "DHE-RSA-AES256-SHA"
+# define TLS1_TXT_ADH_WITH_AES_256_SHA "ADH-AES256-SHA"
+
+/* ECC ciphersuites from draft-ietf-tls-ecc-01.txt (Mar 15, 2001) */
+# define TLS1_TXT_ECDH_ECDSA_WITH_NULL_SHA "ECDH-ECDSA-NULL-SHA"
+# define TLS1_TXT_ECDH_ECDSA_WITH_RC4_128_SHA "ECDH-ECDSA-RC4-SHA"
+# define TLS1_TXT_ECDH_ECDSA_WITH_DES_192_CBC3_SHA "ECDH-ECDSA-DES-CBC3-SHA"
+# define TLS1_TXT_ECDH_ECDSA_WITH_AES_128_CBC_SHA "ECDH-ECDSA-AES128-SHA"
+# define TLS1_TXT_ECDH_ECDSA_WITH_AES_256_CBC_SHA "ECDH-ECDSA-AES256-SHA"
+
+# define TLS1_TXT_ECDHE_ECDSA_WITH_NULL_SHA "ECDHE-ECDSA-NULL-SHA"
+# define TLS1_TXT_ECDHE_ECDSA_WITH_RC4_128_SHA "ECDHE-ECDSA-RC4-SHA"
+# define TLS1_TXT_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA "ECDHE-ECDSA-DES-CBC3-SHA"
+# define TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CBC_SHA "ECDHE-ECDSA-AES128-SHA"
+# define TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CBC_SHA "ECDHE-ECDSA-AES256-SHA"
+
+# define TLS1_TXT_ECDH_RSA_WITH_NULL_SHA "ECDH-RSA-NULL-SHA"
+# define TLS1_TXT_ECDH_RSA_WITH_RC4_128_SHA "ECDH-RSA-RC4-SHA"
+# define TLS1_TXT_ECDH_RSA_WITH_DES_192_CBC3_SHA "ECDH-RSA-DES-CBC3-SHA"
+# define TLS1_TXT_ECDH_RSA_WITH_AES_128_CBC_SHA "ECDH-RSA-AES128-SHA"
+# define TLS1_TXT_ECDH_RSA_WITH_AES_256_CBC_SHA "ECDH-RSA-AES256-SHA"
+
+# define TLS1_TXT_ECDHE_RSA_WITH_NULL_SHA "ECDHE-RSA-NULL-SHA"
+# define TLS1_TXT_ECDHE_RSA_WITH_RC4_128_SHA "ECDHE-RSA-RC4-SHA"
+# define TLS1_TXT_ECDHE_RSA_WITH_DES_192_CBC3_SHA "ECDHE-RSA-DES-CBC3-SHA"
+# define TLS1_TXT_ECDHE_RSA_WITH_AES_128_CBC_SHA "ECDHE-RSA-AES128-SHA"
+# define TLS1_TXT_ECDHE_RSA_WITH_AES_256_CBC_SHA "ECDHE-RSA-AES256-SHA"
+
+# define TLS1_TXT_ECDH_anon_WITH_NULL_SHA "AECDH-NULL-SHA"
+# define TLS1_TXT_ECDH_anon_WITH_RC4_128_SHA "AECDH-RC4-SHA"
+# define TLS1_TXT_ECDH_anon_WITH_DES_192_CBC3_SHA "AECDH-DES-CBC3-SHA"
+# define TLS1_TXT_ECDH_anon_WITH_AES_128_CBC_SHA "AECDH-AES128-SHA"
+# define TLS1_TXT_ECDH_anon_WITH_AES_256_CBC_SHA "AECDH-AES256-SHA"
+
+/* PSK ciphersuites from RFC 4279 */
+# define TLS1_TXT_PSK_WITH_RC4_128_SHA "PSK-RC4-SHA"
+# define TLS1_TXT_PSK_WITH_3DES_EDE_CBC_SHA "PSK-3DES-EDE-CBC-SHA"
+# define TLS1_TXT_PSK_WITH_AES_128_CBC_SHA "PSK-AES128-CBC-SHA"
+# define TLS1_TXT_PSK_WITH_AES_256_CBC_SHA "PSK-AES256-CBC-SHA"
+
+/* SRP ciphersuite from RFC 5054 */
+# define TLS1_TXT_SRP_SHA_WITH_3DES_EDE_CBC_SHA "SRP-3DES-EDE-CBC-SHA"
+# define TLS1_TXT_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA "SRP-RSA-3DES-EDE-CBC-SHA"
+# define TLS1_TXT_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA "SRP-DSS-3DES-EDE-CBC-SHA"
+# define TLS1_TXT_SRP_SHA_WITH_AES_128_CBC_SHA "SRP-AES-128-CBC-SHA"
+# define TLS1_TXT_SRP_SHA_RSA_WITH_AES_128_CBC_SHA "SRP-RSA-AES-128-CBC-SHA"
+# define TLS1_TXT_SRP_SHA_DSS_WITH_AES_128_CBC_SHA "SRP-DSS-AES-128-CBC-SHA"
+# define TLS1_TXT_SRP_SHA_WITH_AES_256_CBC_SHA "SRP-AES-256-CBC-SHA"
+# define TLS1_TXT_SRP_SHA_RSA_WITH_AES_256_CBC_SHA "SRP-RSA-AES-256-CBC-SHA"
+# define TLS1_TXT_SRP_SHA_DSS_WITH_AES_256_CBC_SHA "SRP-DSS-AES-256-CBC-SHA"
+
+/* Camellia ciphersuites from RFC4132 */
+# define TLS1_TXT_RSA_WITH_CAMELLIA_128_CBC_SHA "CAMELLIA128-SHA"
+# define TLS1_TXT_DH_DSS_WITH_CAMELLIA_128_CBC_SHA "DH-DSS-CAMELLIA128-SHA"
+# define TLS1_TXT_DH_RSA_WITH_CAMELLIA_128_CBC_SHA "DH-RSA-CAMELLIA128-SHA"
+# define TLS1_TXT_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA "DHE-DSS-CAMELLIA128-SHA"
+# define TLS1_TXT_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA "DHE-RSA-CAMELLIA128-SHA"
+# define TLS1_TXT_ADH_WITH_CAMELLIA_128_CBC_SHA "ADH-CAMELLIA128-SHA"
+
+# define TLS1_TXT_RSA_WITH_CAMELLIA_256_CBC_SHA "CAMELLIA256-SHA"
+# define TLS1_TXT_DH_DSS_WITH_CAMELLIA_256_CBC_SHA "DH-DSS-CAMELLIA256-SHA"
+# define TLS1_TXT_DH_RSA_WITH_CAMELLIA_256_CBC_SHA "DH-RSA-CAMELLIA256-SHA"
+# define TLS1_TXT_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA "DHE-DSS-CAMELLIA256-SHA"
+# define TLS1_TXT_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA "DHE-RSA-CAMELLIA256-SHA"
+# define TLS1_TXT_ADH_WITH_CAMELLIA_256_CBC_SHA "ADH-CAMELLIA256-SHA"
+
+/* SEED ciphersuites from RFC4162 */
+# define TLS1_TXT_RSA_WITH_SEED_SHA "SEED-SHA"
+# define TLS1_TXT_DH_DSS_WITH_SEED_SHA "DH-DSS-SEED-SHA"
+# define TLS1_TXT_DH_RSA_WITH_SEED_SHA "DH-RSA-SEED-SHA"
+# define TLS1_TXT_DHE_DSS_WITH_SEED_SHA "DHE-DSS-SEED-SHA"
+# define TLS1_TXT_DHE_RSA_WITH_SEED_SHA "DHE-RSA-SEED-SHA"
+# define TLS1_TXT_ADH_WITH_SEED_SHA "ADH-SEED-SHA"
+
+/* TLS v1.2 ciphersuites */
+# define TLS1_TXT_RSA_WITH_NULL_SHA256 "NULL-SHA256"
+# define TLS1_TXT_RSA_WITH_AES_128_SHA256 "AES128-SHA256"
+# define TLS1_TXT_RSA_WITH_AES_256_SHA256 "AES256-SHA256"
+# define TLS1_TXT_DH_DSS_WITH_AES_128_SHA256 "DH-DSS-AES128-SHA256"
+# define TLS1_TXT_DH_RSA_WITH_AES_128_SHA256 "DH-RSA-AES128-SHA256"
+# define TLS1_TXT_DHE_DSS_WITH_AES_128_SHA256 "DHE-DSS-AES128-SHA256"
+# define TLS1_TXT_DHE_RSA_WITH_AES_128_SHA256 "DHE-RSA-AES128-SHA256"
+# define TLS1_TXT_DH_DSS_WITH_AES_256_SHA256 "DH-DSS-AES256-SHA256"
+# define TLS1_TXT_DH_RSA_WITH_AES_256_SHA256 "DH-RSA-AES256-SHA256"
+# define TLS1_TXT_DHE_DSS_WITH_AES_256_SHA256 "DHE-DSS-AES256-SHA256"
+# define TLS1_TXT_DHE_RSA_WITH_AES_256_SHA256 "DHE-RSA-AES256-SHA256"
+# define TLS1_TXT_ADH_WITH_AES_128_SHA256 "ADH-AES128-SHA256"
+# define TLS1_TXT_ADH_WITH_AES_256_SHA256 "ADH-AES256-SHA256"
+
+/* TLS v1.2 GCM ciphersuites from RFC5288 */
+# define TLS1_TXT_RSA_WITH_AES_128_GCM_SHA256 "AES128-GCM-SHA256"
+# define TLS1_TXT_RSA_WITH_AES_256_GCM_SHA384 "AES256-GCM-SHA384"
+# define TLS1_TXT_DHE_RSA_WITH_AES_128_GCM_SHA256 "DHE-RSA-AES128-GCM-SHA256"
+# define TLS1_TXT_DHE_RSA_WITH_AES_256_GCM_SHA384 "DHE-RSA-AES256-GCM-SHA384"
+# define TLS1_TXT_DH_RSA_WITH_AES_128_GCM_SHA256 "DH-RSA-AES128-GCM-SHA256"
+# define TLS1_TXT_DH_RSA_WITH_AES_256_GCM_SHA384 "DH-RSA-AES256-GCM-SHA384"
+# define TLS1_TXT_DHE_DSS_WITH_AES_128_GCM_SHA256 "DHE-DSS-AES128-GCM-SHA256"
+# define TLS1_TXT_DHE_DSS_WITH_AES_256_GCM_SHA384 "DHE-DSS-AES256-GCM-SHA384"
+# define TLS1_TXT_DH_DSS_WITH_AES_128_GCM_SHA256 "DH-DSS-AES128-GCM-SHA256"
+# define TLS1_TXT_DH_DSS_WITH_AES_256_GCM_SHA384 "DH-DSS-AES256-GCM-SHA384"
+# define TLS1_TXT_ADH_WITH_AES_128_GCM_SHA256 "ADH-AES128-GCM-SHA256"
+# define TLS1_TXT_ADH_WITH_AES_256_GCM_SHA384 "ADH-AES256-GCM-SHA384"
+
+/* ECDH HMAC based ciphersuites from RFC5289 */
+
+# define TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_SHA256 "ECDHE-ECDSA-AES128-SHA256"
+# define TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_SHA384 "ECDHE-ECDSA-AES256-SHA384"
+# define TLS1_TXT_ECDH_ECDSA_WITH_AES_128_SHA256 "ECDH-ECDSA-AES128-SHA256"
+# define TLS1_TXT_ECDH_ECDSA_WITH_AES_256_SHA384 "ECDH-ECDSA-AES256-SHA384"
+# define TLS1_TXT_ECDHE_RSA_WITH_AES_128_SHA256 "ECDHE-RSA-AES128-SHA256"
+# define TLS1_TXT_ECDHE_RSA_WITH_AES_256_SHA384 "ECDHE-RSA-AES256-SHA384"
+# define TLS1_TXT_ECDH_RSA_WITH_AES_128_SHA256 "ECDH-RSA-AES128-SHA256"
+# define TLS1_TXT_ECDH_RSA_WITH_AES_256_SHA384 "ECDH-RSA-AES256-SHA384"
+
+/* ECDH GCM based ciphersuites from RFC5289 */
+# define TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 "ECDHE-ECDSA-AES128-GCM-SHA256"
+# define TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 "ECDHE-ECDSA-AES256-GCM-SHA384"
+# define TLS1_TXT_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 "ECDH-ECDSA-AES128-GCM-SHA256"
+# define TLS1_TXT_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 "ECDH-ECDSA-AES256-GCM-SHA384"
+# define TLS1_TXT_ECDHE_RSA_WITH_AES_128_GCM_SHA256 "ECDHE-RSA-AES128-GCM-SHA256"
+# define TLS1_TXT_ECDHE_RSA_WITH_AES_256_GCM_SHA384 "ECDHE-RSA-AES256-GCM-SHA384"
+# define TLS1_TXT_ECDH_RSA_WITH_AES_128_GCM_SHA256 "ECDH-RSA-AES128-GCM-SHA256"
+# define TLS1_TXT_ECDH_RSA_WITH_AES_256_GCM_SHA384 "ECDH-RSA-AES256-GCM-SHA384"
+
+# define TLS_CT_RSA_SIGN 1
+# define TLS_CT_DSS_SIGN 2
+# define TLS_CT_RSA_FIXED_DH 3
+# define TLS_CT_DSS_FIXED_DH 4
+# define TLS_CT_ECDSA_SIGN 64
+# define TLS_CT_RSA_FIXED_ECDH 65
+# define TLS_CT_ECDSA_FIXED_ECDH 66
+# define TLS_CT_GOST94_SIGN 21
+# define TLS_CT_GOST01_SIGN 22
+/*
+ * when correcting this number, correct also SSL3_CT_NUMBER in ssl3.h (see
+ * comment there)
+ */
+# define TLS_CT_NUMBER 9
+
+# define TLS1_FINISH_MAC_LENGTH 12
+
+# define TLS_MD_MAX_CONST_SIZE 20
+# define TLS_MD_CLIENT_FINISH_CONST "client finished"
+# define TLS_MD_CLIENT_FINISH_CONST_SIZE 15
+# define TLS_MD_SERVER_FINISH_CONST "server finished"
+# define TLS_MD_SERVER_FINISH_CONST_SIZE 15
+# define TLS_MD_SERVER_WRITE_KEY_CONST "server write key"
+# define TLS_MD_SERVER_WRITE_KEY_CONST_SIZE 16
+# define TLS_MD_KEY_EXPANSION_CONST "key expansion"
+# define TLS_MD_KEY_EXPANSION_CONST_SIZE 13
+# define TLS_MD_CLIENT_WRITE_KEY_CONST "client write key"
+# define TLS_MD_CLIENT_WRITE_KEY_CONST_SIZE 16
+# define TLS_MD_SERVER_WRITE_KEY_CONST "server write key"
+# define TLS_MD_SERVER_WRITE_KEY_CONST_SIZE 16
+# define TLS_MD_IV_BLOCK_CONST "IV block"
+# define TLS_MD_IV_BLOCK_CONST_SIZE 8
+# define TLS_MD_MASTER_SECRET_CONST "master secret"
+# define TLS_MD_MASTER_SECRET_CONST_SIZE 13
+
+# ifdef CHARSET_EBCDIC
+# undef TLS_MD_CLIENT_FINISH_CONST
+/*
+ * client finished
+ */
+# define TLS_MD_CLIENT_FINISH_CONST "\x63\x6c\x69\x65\x6e\x74\x20\x66\x69\x6e\x69\x73\x68\x65\x64"
+
+# undef TLS_MD_SERVER_FINISH_CONST
+/*
+ * server finished
+ */
+# define TLS_MD_SERVER_FINISH_CONST "\x73\x65\x72\x76\x65\x72\x20\x66\x69\x6e\x69\x73\x68\x65\x64"
+
+# undef TLS_MD_SERVER_WRITE_KEY_CONST
+/*
+ * server write key
+ */
+# define TLS_MD_SERVER_WRITE_KEY_CONST "\x73\x65\x72\x76\x65\x72\x20\x77\x72\x69\x74\x65\x20\x6b\x65\x79"
+
+# undef TLS_MD_KEY_EXPANSION_CONST
+/*
+ * key expansion
+ */
+# define TLS_MD_KEY_EXPANSION_CONST "\x6b\x65\x79\x20\x65\x78\x70\x61\x6e\x73\x69\x6f\x6e"
+
+# undef TLS_MD_CLIENT_WRITE_KEY_CONST
+/*
+ * client write key
+ */
+# define TLS_MD_CLIENT_WRITE_KEY_CONST "\x63\x6c\x69\x65\x6e\x74\x20\x77\x72\x69\x74\x65\x20\x6b\x65\x79"
+
+# undef TLS_MD_SERVER_WRITE_KEY_CONST
+/*
+ * server write key
+ */
+# define TLS_MD_SERVER_WRITE_KEY_CONST "\x73\x65\x72\x76\x65\x72\x20\x77\x72\x69\x74\x65\x20\x6b\x65\x79"
+
+# undef TLS_MD_IV_BLOCK_CONST
+/*
+ * IV block
+ */
+# define TLS_MD_IV_BLOCK_CONST "\x49\x56\x20\x62\x6c\x6f\x63\x6b"
+
+# undef TLS_MD_MASTER_SECRET_CONST
+/*
+ * master secret
+ */
+# define TLS_MD_MASTER_SECRET_CONST "\x6d\x61\x73\x74\x65\x72\x20\x73\x65\x63\x72\x65\x74"
+# endif
+
+/* TLS Session Ticket extension struct */
+struct tls_session_ticket_ext_st {
+ unsigned short length;
+ void *data;
+};
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/deps/openssl/openssl/include/openssl/ts.h b/deps/openssl/openssl/include/openssl/ts.h
index fe8a2cb51a2..16eccbb38d9 100644
--- a/deps/openssl/openssl/include/openssl/ts.h
+++ b/deps/openssl/openssl/include/openssl/ts.h
@@ -1 +1,862 @@
-#include "../../crypto/ts/ts.h"
+/* crypto/ts/ts.h */
+/*
+ * Written by Zoltan Glozik (zglozik@opentsa.org) for the OpenSSL project
+ * 2002, 2003, 2004.
+ */
+/* ====================================================================
+ * Copyright (c) 2006 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * licensing@OpenSSL.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+#ifndef HEADER_TS_H
+# define HEADER_TS_H
+
+# include <openssl/opensslconf.h>
+# include <openssl/symhacks.h>
+# ifndef OPENSSL_NO_BUFFER
+# include <openssl/buffer.h>
+# endif
+# ifndef OPENSSL_NO_EVP
+# include <openssl/evp.h>
+# endif
+# ifndef OPENSSL_NO_BIO
+# include <openssl/bio.h>
+# endif
+# include <openssl/stack.h>
+# include <openssl/asn1.h>
+# include <openssl/safestack.h>
+
+# ifndef OPENSSL_NO_RSA
+# include <openssl/rsa.h>
+# endif
+
+# ifndef OPENSSL_NO_DSA
+# include <openssl/dsa.h>
+# endif
+
+# ifndef OPENSSL_NO_DH
+# include <openssl/dh.h>
+# endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# ifdef WIN32
+/* Under Win32 this is defined in wincrypt.h */
+# undef X509_NAME
+# endif
+
+# include <openssl/x509.h>
+# include <openssl/x509v3.h>
+
+/*-
+MessageImprint ::= SEQUENCE {
+ hashAlgorithm AlgorithmIdentifier,
+ hashedMessage OCTET STRING }
+*/
+
+typedef struct TS_msg_imprint_st {
+ X509_ALGOR *hash_algo;
+ ASN1_OCTET_STRING *hashed_msg;
+} TS_MSG_IMPRINT;
+
+/*-
+TimeStampReq ::= SEQUENCE {
+ version INTEGER { v1(1) },
+ messageImprint MessageImprint,
+ --a hash algorithm OID and the hash value of the data to be
+ --time-stamped
+ reqPolicy TSAPolicyId OPTIONAL,
+ nonce INTEGER OPTIONAL,
+ certReq BOOLEAN DEFAULT FALSE,
+ extensions [0] IMPLICIT Extensions OPTIONAL }
+*/
+
+typedef struct TS_req_st {
+ ASN1_INTEGER *version;
+ TS_MSG_IMPRINT *msg_imprint;
+ ASN1_OBJECT *policy_id; /* OPTIONAL */
+ ASN1_INTEGER *nonce; /* OPTIONAL */
+ ASN1_BOOLEAN cert_req; /* DEFAULT FALSE */
+ STACK_OF(X509_EXTENSION) *extensions; /* [0] OPTIONAL */
+} TS_REQ;
+
+/*-
+Accuracy ::= SEQUENCE {
+ seconds INTEGER OPTIONAL,
+ millis [0] INTEGER (1..999) OPTIONAL,
+ micros [1] INTEGER (1..999) OPTIONAL }
+*/
+
+typedef struct TS_accuracy_st {
+ ASN1_INTEGER *seconds;
+ ASN1_INTEGER *millis;
+ ASN1_INTEGER *micros;
+} TS_ACCURACY;
+
+/*-
+TSTInfo ::= SEQUENCE {
+ version INTEGER { v1(1) },
+ policy TSAPolicyId,
+ messageImprint MessageImprint,
+ -- MUST have the same value as the similar field in
+ -- TimeStampReq
+ serialNumber INTEGER,
+ -- Time-Stamping users MUST be ready to accommodate integers
+ -- up to 160 bits.
+ genTime GeneralizedTime,
+ accuracy Accuracy OPTIONAL,
+ ordering BOOLEAN DEFAULT FALSE,
+ nonce INTEGER OPTIONAL,
+ -- MUST be present if the similar field was present
+ -- in TimeStampReq. In that case it MUST have the same value.
+ tsa [0] GeneralName OPTIONAL,
+ extensions [1] IMPLICIT Extensions OPTIONAL }
+*/
+
+typedef struct TS_tst_info_st {
+ ASN1_INTEGER *version;
+ ASN1_OBJECT *policy_id;
+ TS_MSG_IMPRINT *msg_imprint;
+ ASN1_INTEGER *serial;
+ ASN1_GENERALIZEDTIME *time;
+ TS_ACCURACY *accuracy;
+ ASN1_BOOLEAN ordering;
+ ASN1_INTEGER *nonce;
+ GENERAL_NAME *tsa;
+ STACK_OF(X509_EXTENSION) *extensions;
+} TS_TST_INFO;
+
+/*-
+PKIStatusInfo ::= SEQUENCE {
+ status PKIStatus,
+ statusString PKIFreeText OPTIONAL,
+ failInfo PKIFailureInfo OPTIONAL }
+
+From RFC 1510 - section 3.1.1:
+PKIFreeText ::= SEQUENCE SIZE (1..MAX) OF UTF8String
+ -- text encoded as UTF-8 String (note: each UTF8String SHOULD
+ -- include an RFC 1766 language tag to indicate the language
+ -- of the contained text)
+*/
+
+/* Possible values for status. See ts_resp_print.c && ts_resp_verify.c. */
+
+# define TS_STATUS_GRANTED 0
+# define TS_STATUS_GRANTED_WITH_MODS 1
+# define TS_STATUS_REJECTION 2
+# define TS_STATUS_WAITING 3
+# define TS_STATUS_REVOCATION_WARNING 4
+# define TS_STATUS_REVOCATION_NOTIFICATION 5
+
+/*
+ * Possible values for failure_info. See ts_resp_print.c && ts_resp_verify.c
+ */
+
+# define TS_INFO_BAD_ALG 0
+# define TS_INFO_BAD_REQUEST 2
+# define TS_INFO_BAD_DATA_FORMAT 5
+# define TS_INFO_TIME_NOT_AVAILABLE 14
+# define TS_INFO_UNACCEPTED_POLICY 15
+# define TS_INFO_UNACCEPTED_EXTENSION 16
+# define TS_INFO_ADD_INFO_NOT_AVAILABLE 17
+# define TS_INFO_SYSTEM_FAILURE 25
+
+typedef struct TS_status_info_st {
+ ASN1_INTEGER *status;
+ STACK_OF(ASN1_UTF8STRING) *text;
+ ASN1_BIT_STRING *failure_info;
+} TS_STATUS_INFO;
+
+DECLARE_STACK_OF(ASN1_UTF8STRING)
+DECLARE_ASN1_SET_OF(ASN1_UTF8STRING)
+
+/*-
+TimeStampResp ::= SEQUENCE {
+ status PKIStatusInfo,
+ timeStampToken TimeStampToken OPTIONAL }
+*/
+
+typedef struct TS_resp_st {
+ TS_STATUS_INFO *status_info;
+ PKCS7 *token;
+ TS_TST_INFO *tst_info;
+} TS_RESP;
+
+/* The structure below would belong to the ESS component. */
+
+/*-
+IssuerSerial ::= SEQUENCE {
+ issuer GeneralNames,
+ serialNumber CertificateSerialNumber
+ }
+*/
+
+typedef struct ESS_issuer_serial {
+ STACK_OF(GENERAL_NAME) *issuer;
+ ASN1_INTEGER *serial;
+} ESS_ISSUER_SERIAL;
+
+/*-
+ESSCertID ::= SEQUENCE {
+ certHash Hash,
+ issuerSerial IssuerSerial OPTIONAL
+}
+*/
+
+typedef struct ESS_cert_id {
+ ASN1_OCTET_STRING *hash; /* Always SHA-1 digest. */
+ ESS_ISSUER_SERIAL *issuer_serial;
+} ESS_CERT_ID;
+
+DECLARE_STACK_OF(ESS_CERT_ID)
+DECLARE_ASN1_SET_OF(ESS_CERT_ID)
+
+/*-
+SigningCertificate ::= SEQUENCE {
+ certs SEQUENCE OF ESSCertID,
+ policies SEQUENCE OF PolicyInformation OPTIONAL
+}
+*/
+
+typedef struct ESS_signing_cert {
+ STACK_OF(ESS_CERT_ID) *cert_ids;
+ STACK_OF(POLICYINFO) *policy_info;
+} ESS_SIGNING_CERT;
+
+TS_REQ *TS_REQ_new(void);
+void TS_REQ_free(TS_REQ *a);
+int i2d_TS_REQ(const TS_REQ *a, unsigned char **pp);
+TS_REQ *d2i_TS_REQ(TS_REQ **a, const unsigned char **pp, long length);
+
+TS_REQ *TS_REQ_dup(TS_REQ *a);
+
+TS_REQ *d2i_TS_REQ_fp(FILE *fp, TS_REQ **a);
+int i2d_TS_REQ_fp(FILE *fp, TS_REQ *a);
+TS_REQ *d2i_TS_REQ_bio(BIO *fp, TS_REQ **a);
+int i2d_TS_REQ_bio(BIO *fp, TS_REQ *a);
+
+TS_MSG_IMPRINT *TS_MSG_IMPRINT_new(void);
+void TS_MSG_IMPRINT_free(TS_MSG_IMPRINT *a);
+int i2d_TS_MSG_IMPRINT(const TS_MSG_IMPRINT *a, unsigned char **pp);
+TS_MSG_IMPRINT *d2i_TS_MSG_IMPRINT(TS_MSG_IMPRINT **a,
+ const unsigned char **pp, long length);
+
+TS_MSG_IMPRINT *TS_MSG_IMPRINT_dup(TS_MSG_IMPRINT *a);
+
+TS_MSG_IMPRINT *d2i_TS_MSG_IMPRINT_fp(FILE *fp, TS_MSG_IMPRINT **a);
+int i2d_TS_MSG_IMPRINT_fp(FILE *fp, TS_MSG_IMPRINT *a);
+TS_MSG_IMPRINT *d2i_TS_MSG_IMPRINT_bio(BIO *fp, TS_MSG_IMPRINT **a);
+int i2d_TS_MSG_IMPRINT_bio(BIO *fp, TS_MSG_IMPRINT *a);
+
+TS_RESP *TS_RESP_new(void);
+void TS_RESP_free(TS_RESP *a);
+int i2d_TS_RESP(const TS_RESP *a, unsigned char **pp);
+TS_RESP *d2i_TS_RESP(TS_RESP **a, const unsigned char **pp, long length);
+TS_TST_INFO *PKCS7_to_TS_TST_INFO(PKCS7 *token);
+TS_RESP *TS_RESP_dup(TS_RESP *a);
+
+TS_RESP *d2i_TS_RESP_fp(FILE *fp, TS_RESP **a);
+int i2d_TS_RESP_fp(FILE *fp, TS_RESP *a);
+TS_RESP *d2i_TS_RESP_bio(BIO *fp, TS_RESP **a);
+int i2d_TS_RESP_bio(BIO *fp, TS_RESP *a);
+
+TS_STATUS_INFO *TS_STATUS_INFO_new(void);
+void TS_STATUS_INFO_free(TS_STATUS_INFO *a);
+int i2d_TS_STATUS_INFO(const TS_STATUS_INFO *a, unsigned char **pp);
+TS_STATUS_INFO *d2i_TS_STATUS_INFO(TS_STATUS_INFO **a,
+ const unsigned char **pp, long length);
+TS_STATUS_INFO *TS_STATUS_INFO_dup(TS_STATUS_INFO *a);
+
+TS_TST_INFO *TS_TST_INFO_new(void);
+void TS_TST_INFO_free(TS_TST_INFO *a);
+int i2d_TS_TST_INFO(const TS_TST_INFO *a, unsigned char **pp);
+TS_TST_INFO *d2i_TS_TST_INFO(TS_TST_INFO **a, const unsigned char **pp,
+ long length);
+TS_TST_INFO *TS_TST_INFO_dup(TS_TST_INFO *a);
+
+TS_TST_INFO *d2i_TS_TST_INFO_fp(FILE *fp, TS_TST_INFO **a);
+int i2d_TS_TST_INFO_fp(FILE *fp, TS_TST_INFO *a);
+TS_TST_INFO *d2i_TS_TST_INFO_bio(BIO *fp, TS_TST_INFO **a);
+int i2d_TS_TST_INFO_bio(BIO *fp, TS_TST_INFO *a);
+
+TS_ACCURACY *TS_ACCURACY_new(void);
+void TS_ACCURACY_free(TS_ACCURACY *a);
+int i2d_TS_ACCURACY(const TS_ACCURACY *a, unsigned char **pp);
+TS_ACCURACY *d2i_TS_ACCURACY(TS_ACCURACY **a, const unsigned char **pp,
+ long length);
+TS_ACCURACY *TS_ACCURACY_dup(TS_ACCURACY *a);
+
+ESS_ISSUER_SERIAL *ESS_ISSUER_SERIAL_new(void);
+void ESS_ISSUER_SERIAL_free(ESS_ISSUER_SERIAL *a);
+int i2d_ESS_ISSUER_SERIAL(const ESS_ISSUER_SERIAL *a, unsigned char **pp);
+ESS_ISSUER_SERIAL *d2i_ESS_ISSUER_SERIAL(ESS_ISSUER_SERIAL **a,
+ const unsigned char **pp,
+ long length);
+ESS_ISSUER_SERIAL *ESS_ISSUER_SERIAL_dup(ESS_ISSUER_SERIAL *a);
+
+ESS_CERT_ID *ESS_CERT_ID_new(void);
+void ESS_CERT_ID_free(ESS_CERT_ID *a);
+int i2d_ESS_CERT_ID(const ESS_CERT_ID *a, unsigned char **pp);
+ESS_CERT_ID *d2i_ESS_CERT_ID(ESS_CERT_ID **a, const unsigned char **pp,
+ long length);
+ESS_CERT_ID *ESS_CERT_ID_dup(ESS_CERT_ID *a);
+
+ESS_SIGNING_CERT *ESS_SIGNING_CERT_new(void);
+void ESS_SIGNING_CERT_free(ESS_SIGNING_CERT *a);
+int i2d_ESS_SIGNING_CERT(const ESS_SIGNING_CERT *a, unsigned char **pp);
+ESS_SIGNING_CERT *d2i_ESS_SIGNING_CERT(ESS_SIGNING_CERT **a,
+ const unsigned char **pp, long length);
+ESS_SIGNING_CERT *ESS_SIGNING_CERT_dup(ESS_SIGNING_CERT *a);
+
+void ERR_load_TS_strings(void);
+
+int TS_REQ_set_version(TS_REQ *a, long version);
+long TS_REQ_get_version(const TS_REQ *a);
+
+int TS_REQ_set_msg_imprint(TS_REQ *a, TS_MSG_IMPRINT *msg_imprint);
+TS_MSG_IMPRINT *TS_REQ_get_msg_imprint(TS_REQ *a);
+
+int TS_MSG_IMPRINT_set_algo(TS_MSG_IMPRINT *a, X509_ALGOR *alg);
+X509_ALGOR *TS_MSG_IMPRINT_get_algo(TS_MSG_IMPRINT *a);
+
+int TS_MSG_IMPRINT_set_msg(TS_MSG_IMPRINT *a, unsigned char *d, int len);
+ASN1_OCTET_STRING *TS_MSG_IMPRINT_get_msg(TS_MSG_IMPRINT *a);
+
+int TS_REQ_set_policy_id(TS_REQ *a, ASN1_OBJECT *policy);
+ASN1_OBJECT *TS_REQ_get_policy_id(TS_REQ *a);
+
+int TS_REQ_set_nonce(TS_REQ *a, const ASN1_INTEGER *nonce);
+const ASN1_INTEGER *TS_REQ_get_nonce(const TS_REQ *a);
+
+int TS_REQ_set_cert_req(TS_REQ *a, int cert_req);
+int TS_REQ_get_cert_req(const TS_REQ *a);
+
+STACK_OF(X509_EXTENSION) *TS_REQ_get_exts(TS_REQ *a);
+void TS_REQ_ext_free(TS_REQ *a);
+int TS_REQ_get_ext_count(TS_REQ *a);
+int TS_REQ_get_ext_by_NID(TS_REQ *a, int nid, int lastpos);
+int TS_REQ_get_ext_by_OBJ(TS_REQ *a, ASN1_OBJECT *obj, int lastpos);
+int TS_REQ_get_ext_by_critical(TS_REQ *a, int crit, int lastpos);
+X509_EXTENSION *TS_REQ_get_ext(TS_REQ *a, int loc);
+X509_EXTENSION *TS_REQ_delete_ext(TS_REQ *a, int loc);
+int TS_REQ_add_ext(TS_REQ *a, X509_EXTENSION *ex, int loc);
+void *TS_REQ_get_ext_d2i(TS_REQ *a, int nid, int *crit, int *idx);
+
+/* Function declarations for TS_REQ defined in ts/ts_req_print.c */
+
+int TS_REQ_print_bio(BIO *bio, TS_REQ *a);
+
+/* Function declarations for TS_RESP defined in ts/ts_resp_utils.c */
+
+int TS_RESP_set_status_info(TS_RESP *a, TS_STATUS_INFO *info);
+TS_STATUS_INFO *TS_RESP_get_status_info(TS_RESP *a);
+
+/* Caller loses ownership of PKCS7 and TS_TST_INFO objects. */
+void TS_RESP_set_tst_info(TS_RESP *a, PKCS7 *p7, TS_TST_INFO *tst_info);
+PKCS7 *TS_RESP_get_token(TS_RESP *a);
+TS_TST_INFO *TS_RESP_get_tst_info(TS_RESP *a);
+
+int TS_TST_INFO_set_version(TS_TST_INFO *a, long version);
+long TS_TST_INFO_get_version(const TS_TST_INFO *a);
+
+int TS_TST_INFO_set_policy_id(TS_TST_INFO *a, ASN1_OBJECT *policy_id);
+ASN1_OBJECT *TS_TST_INFO_get_policy_id(TS_TST_INFO *a);
+
+int TS_TST_INFO_set_msg_imprint(TS_TST_INFO *a, TS_MSG_IMPRINT *msg_imprint);
+TS_MSG_IMPRINT *TS_TST_INFO_get_msg_imprint(TS_TST_INFO *a);
+
+int TS_TST_INFO_set_serial(TS_TST_INFO *a, const ASN1_INTEGER *serial);
+const ASN1_INTEGER *TS_TST_INFO_get_serial(const TS_TST_INFO *a);
+
+int TS_TST_INFO_set_time(TS_TST_INFO *a, const ASN1_GENERALIZEDTIME *gtime);
+const ASN1_GENERALIZEDTIME *TS_TST_INFO_get_time(const TS_TST_INFO *a);
+
+int TS_TST_INFO_set_accuracy(TS_TST_INFO *a, TS_ACCURACY *accuracy);
+TS_ACCURACY *TS_TST_INFO_get_accuracy(TS_TST_INFO *a);
+
+int TS_ACCURACY_set_seconds(TS_ACCURACY *a, const ASN1_INTEGER *seconds);
+const ASN1_INTEGER *TS_ACCURACY_get_seconds(const TS_ACCURACY *a);
+
+int TS_ACCURACY_set_millis(TS_ACCURACY *a, const ASN1_INTEGER *millis);
+const ASN1_INTEGER *TS_ACCURACY_get_millis(const TS_ACCURACY *a);
+
+int TS_ACCURACY_set_micros(TS_ACCURACY *a, const ASN1_INTEGER *micros);
+const ASN1_INTEGER *TS_ACCURACY_get_micros(const TS_ACCURACY *a);
+
+int TS_TST_INFO_set_ordering(TS_TST_INFO *a, int ordering);
+int TS_TST_INFO_get_ordering(const TS_TST_INFO *a);
+
+int TS_TST_INFO_set_nonce(TS_TST_INFO *a, const ASN1_INTEGER *nonce);
+const ASN1_INTEGER *TS_TST_INFO_get_nonce(const TS_TST_INFO *a);
+
+int TS_TST_INFO_set_tsa(TS_TST_INFO *a, GENERAL_NAME *tsa);
+GENERAL_NAME *TS_TST_INFO_get_tsa(TS_TST_INFO *a);
+
+STACK_OF(X509_EXTENSION) *TS_TST_INFO_get_exts(TS_TST_INFO *a);
+void TS_TST_INFO_ext_free(TS_TST_INFO *a);
+int TS_TST_INFO_get_ext_count(TS_TST_INFO *a);
+int TS_TST_INFO_get_ext_by_NID(TS_TST_INFO *a, int nid, int lastpos);
+int TS_TST_INFO_get_ext_by_OBJ(TS_TST_INFO *a, ASN1_OBJECT *obj, int lastpos);
+int TS_TST_INFO_get_ext_by_critical(TS_TST_INFO *a, int crit, int lastpos);
+X509_EXTENSION *TS_TST_INFO_get_ext(TS_TST_INFO *a, int loc);
+X509_EXTENSION *TS_TST_INFO_delete_ext(TS_TST_INFO *a, int loc);
+int TS_TST_INFO_add_ext(TS_TST_INFO *a, X509_EXTENSION *ex, int loc);
+void *TS_TST_INFO_get_ext_d2i(TS_TST_INFO *a, int nid, int *crit, int *idx);
+
+/*
+ * Declarations related to response generation, defined in ts/ts_resp_sign.c.
+ */
+
+/* Optional flags for response generation. */
+
+/* Don't include the TSA name in response. */
+# define TS_TSA_NAME 0x01
+
+/* Set ordering to true in response. */
+# define TS_ORDERING 0x02
+
+/*
+ * Include the signer certificate and the other specified certificates in
+ * the ESS signing certificate attribute beside the PKCS7 signed data.
+ * Only the signer certificates is included by default.
+ */
+# define TS_ESS_CERT_ID_CHAIN 0x04
+
+/* Forward declaration. */
+struct TS_resp_ctx;
+
+/* This must return a unique number less than 160 bits long. */
+typedef ASN1_INTEGER *(*TS_serial_cb) (struct TS_resp_ctx *, void *);
+
+/*
+ * This must return the seconds and microseconds since Jan 1, 1970 in the sec
+ * and usec variables allocated by the caller. Return non-zero for success
+ * and zero for failure.
+ */
+typedef int (*TS_time_cb) (struct TS_resp_ctx *, void *, long *sec,
+ long *usec);
+
+/*
+ * This must process the given extension. It can modify the TS_TST_INFO
+ * object of the context. Return values: !0 (processed), 0 (error, it must
+ * set the status info/failure info of the response).
+ */
+typedef int (*TS_extension_cb) (struct TS_resp_ctx *, X509_EXTENSION *,
+ void *);
+
+typedef struct TS_resp_ctx {
+ X509 *signer_cert;
+ EVP_PKEY *signer_key;
+ STACK_OF(X509) *certs; /* Certs to include in signed data. */
+ STACK_OF(ASN1_OBJECT) *policies; /* Acceptable policies. */
+ ASN1_OBJECT *default_policy; /* It may appear in policies, too. */
+ STACK_OF(EVP_MD) *mds; /* Acceptable message digests. */
+ ASN1_INTEGER *seconds; /* accuracy, 0 means not specified. */
+ ASN1_INTEGER *millis; /* accuracy, 0 means not specified. */
+ ASN1_INTEGER *micros; /* accuracy, 0 means not specified. */
+ unsigned clock_precision_digits; /* fraction of seconds in time stamp
+ * token. */
+ unsigned flags; /* Optional info, see values above. */
+ /* Callback functions. */
+ TS_serial_cb serial_cb;
+ void *serial_cb_data; /* User data for serial_cb. */
+ TS_time_cb time_cb;
+ void *time_cb_data; /* User data for time_cb. */
+ TS_extension_cb extension_cb;
+ void *extension_cb_data; /* User data for extension_cb. */
+ /* These members are used only while creating the response. */
+ TS_REQ *request;
+ TS_RESP *response;
+ TS_TST_INFO *tst_info;
+} TS_RESP_CTX;
+
+DECLARE_STACK_OF(EVP_MD)
+DECLARE_ASN1_SET_OF(EVP_MD)
+
+/* Creates a response context that can be used for generating responses. */
+TS_RESP_CTX *TS_RESP_CTX_new(void);
+void TS_RESP_CTX_free(TS_RESP_CTX *ctx);
+
+/* This parameter must be set. */
+int TS_RESP_CTX_set_signer_cert(TS_RESP_CTX *ctx, X509 *signer);
+
+/* This parameter must be set. */
+int TS_RESP_CTX_set_signer_key(TS_RESP_CTX *ctx, EVP_PKEY *key);
+
+/* This parameter must be set. */
+int TS_RESP_CTX_set_def_policy(TS_RESP_CTX *ctx, ASN1_OBJECT *def_policy);
+
+/* No additional certs are included in the response by default. */
+int TS_RESP_CTX_set_certs(TS_RESP_CTX *ctx, STACK_OF(X509) *certs);
+
+/*
+ * Adds a new acceptable policy, only the default policy is accepted by
+ * default.
+ */
+int TS_RESP_CTX_add_policy(TS_RESP_CTX *ctx, ASN1_OBJECT *policy);
+
+/*
+ * Adds a new acceptable message digest. Note that no message digests are
+ * accepted by default. The md argument is shared with the caller.
+ */
+int TS_RESP_CTX_add_md(TS_RESP_CTX *ctx, const EVP_MD *md);
+
+/* Accuracy is not included by default. */
+int TS_RESP_CTX_set_accuracy(TS_RESP_CTX *ctx,
+ int secs, int millis, int micros);
+
+/*
+ * Clock precision digits, i.e. the number of decimal digits: '0' means sec,
+ * '3' msec, '6' usec, and so on. Default is 0.
+ */
+int TS_RESP_CTX_set_clock_precision_digits(TS_RESP_CTX *ctx,
+ unsigned clock_precision_digits);
+/* At most we accept usec precision. */
+# define TS_MAX_CLOCK_PRECISION_DIGITS 6
+
+/* No flags are set by default. */
+void TS_RESP_CTX_add_flags(TS_RESP_CTX *ctx, int flags);
+
+/* Default callback always returns a constant. */
+void TS_RESP_CTX_set_serial_cb(TS_RESP_CTX *ctx, TS_serial_cb cb, void *data);
+
+/* Default callback uses the gettimeofday() and gmtime() system calls. */
+void TS_RESP_CTX_set_time_cb(TS_RESP_CTX *ctx, TS_time_cb cb, void *data);
+
+/*
+ * Default callback rejects all extensions. The extension callback is called
+ * when the TS_TST_INFO object is already set up and not signed yet.
+ */
+/* FIXME: extension handling is not tested yet. */
+void TS_RESP_CTX_set_extension_cb(TS_RESP_CTX *ctx,
+ TS_extension_cb cb, void *data);
+
+/* The following methods can be used in the callbacks. */
+int TS_RESP_CTX_set_status_info(TS_RESP_CTX *ctx,
+ int status, const char *text);
+
+/* Sets the status info only if it is still TS_STATUS_GRANTED. */
+int TS_RESP_CTX_set_status_info_cond(TS_RESP_CTX *ctx,
+ int status, const char *text);
+
+int TS_RESP_CTX_add_failure_info(TS_RESP_CTX *ctx, int failure);
+
+/* The get methods below can be used in the extension callback. */
+TS_REQ *TS_RESP_CTX_get_request(TS_RESP_CTX *ctx);
+
+TS_TST_INFO *TS_RESP_CTX_get_tst_info(TS_RESP_CTX *ctx);
+
+/*
+ * Creates the signed TS_TST_INFO and puts it in TS_RESP.
+ * In case of errors it sets the status info properly.
+ * Returns NULL only in case of memory allocation/fatal error.
+ */
+TS_RESP *TS_RESP_create_response(TS_RESP_CTX *ctx, BIO *req_bio);
+
+/*
+ * Declarations related to response verification,
+ * they are defined in ts/ts_resp_verify.c.
+ */
+
+int TS_RESP_verify_signature(PKCS7 *token, STACK_OF(X509) *certs,
+ X509_STORE *store, X509 **signer_out);
+
+/* Context structure for the generic verify method. */
+
+/* Verify the signer's certificate and the signature of the response. */
+# define TS_VFY_SIGNATURE (1u << 0)
+/* Verify the version number of the response. */
+# define TS_VFY_VERSION (1u << 1)
+/* Verify if the policy supplied by the user matches the policy of the TSA. */
+# define TS_VFY_POLICY (1u << 2)
+/*
+ * Verify the message imprint provided by the user. This flag should not be
+ * specified with TS_VFY_DATA.
+ */
+# define TS_VFY_IMPRINT (1u << 3)
+/*
+ * Verify the message imprint computed by the verify method from the user
+ * provided data and the MD algorithm of the response. This flag should not
+ * be specified with TS_VFY_IMPRINT.
+ */
+# define TS_VFY_DATA (1u << 4)
+/* Verify the nonce value. */
+# define TS_VFY_NONCE (1u << 5)
+/* Verify if the TSA name field matches the signer certificate. */
+# define TS_VFY_SIGNER (1u << 6)
+/* Verify if the TSA name field equals to the user provided name. */
+# define TS_VFY_TSA_NAME (1u << 7)
+
+/* You can use the following convenience constants. */
+# define TS_VFY_ALL_IMPRINT (TS_VFY_SIGNATURE \
+ | TS_VFY_VERSION \
+ | TS_VFY_POLICY \
+ | TS_VFY_IMPRINT \
+ | TS_VFY_NONCE \
+ | TS_VFY_SIGNER \
+ | TS_VFY_TSA_NAME)
+# define TS_VFY_ALL_DATA (TS_VFY_SIGNATURE \
+ | TS_VFY_VERSION \
+ | TS_VFY_POLICY \
+ | TS_VFY_DATA \
+ | TS_VFY_NONCE \
+ | TS_VFY_SIGNER \
+ | TS_VFY_TSA_NAME)
+
+typedef struct TS_verify_ctx {
+ /* Set this to the union of TS_VFY_... flags you want to carry out. */
+ unsigned flags;
+ /* Must be set only with TS_VFY_SIGNATURE. certs is optional. */
+ X509_STORE *store;
+ STACK_OF(X509) *certs;
+ /* Must be set only with TS_VFY_POLICY. */
+ ASN1_OBJECT *policy;
+ /*
+ * Must be set only with TS_VFY_IMPRINT. If md_alg is NULL, the
+ * algorithm from the response is used.
+ */
+ X509_ALGOR *md_alg;
+ unsigned char *imprint;
+ unsigned imprint_len;
+ /* Must be set only with TS_VFY_DATA. */
+ BIO *data;
+ /* Must be set only with TS_VFY_TSA_NAME. */
+ ASN1_INTEGER *nonce;
+ /* Must be set only with TS_VFY_TSA_NAME. */
+ GENERAL_NAME *tsa_name;
+} TS_VERIFY_CTX;
+
+int TS_RESP_verify_response(TS_VERIFY_CTX *ctx, TS_RESP *response);
+int TS_RESP_verify_token(TS_VERIFY_CTX *ctx, PKCS7 *token);
+
+/*
+ * Declarations related to response verification context,
+ * they are defined in ts/ts_verify_ctx.c.
+ */
+
+/* Set all fields to zero. */
+TS_VERIFY_CTX *TS_VERIFY_CTX_new(void);
+void TS_VERIFY_CTX_init(TS_VERIFY_CTX *ctx);
+void TS_VERIFY_CTX_free(TS_VERIFY_CTX *ctx);
+void TS_VERIFY_CTX_cleanup(TS_VERIFY_CTX *ctx);
+
+/*-
+ * If ctx is NULL, it allocates and returns a new object, otherwise
+ * it returns ctx. It initialises all the members as follows:
+ * flags = TS_VFY_ALL_IMPRINT & ~(TS_VFY_TSA_NAME | TS_VFY_SIGNATURE)
+ * certs = NULL
+ * store = NULL
+ * policy = policy from the request or NULL if absent (in this case
+ * TS_VFY_POLICY is cleared from flags as well)
+ * md_alg = MD algorithm from request
+ * imprint, imprint_len = imprint from request
+ * data = NULL
+ * nonce, nonce_len = nonce from the request or NULL if absent (in this case
+ * TS_VFY_NONCE is cleared from flags as well)
+ * tsa_name = NULL
+ * Important: after calling this method TS_VFY_SIGNATURE should be added!
+ */
+TS_VERIFY_CTX *TS_REQ_to_TS_VERIFY_CTX(TS_REQ *req, TS_VERIFY_CTX *ctx);
+
+/* Function declarations for TS_RESP defined in ts/ts_resp_print.c */
+
+int TS_RESP_print_bio(BIO *bio, TS_RESP *a);
+int TS_STATUS_INFO_print_bio(BIO *bio, TS_STATUS_INFO *a);
+int TS_TST_INFO_print_bio(BIO *bio, TS_TST_INFO *a);
+
+/* Common utility functions defined in ts/ts_lib.c */
+
+int TS_ASN1_INTEGER_print_bio(BIO *bio, const ASN1_INTEGER *num);
+int TS_OBJ_print_bio(BIO *bio, const ASN1_OBJECT *obj);
+int TS_ext_print_bio(BIO *bio, const STACK_OF(X509_EXTENSION) *extensions);
+int TS_X509_ALGOR_print_bio(BIO *bio, const X509_ALGOR *alg);
+int TS_MSG_IMPRINT_print_bio(BIO *bio, TS_MSG_IMPRINT *msg);
+
+/*
+ * Function declarations for handling configuration options, defined in
+ * ts/ts_conf.c
+ */
+
+X509 *TS_CONF_load_cert(const char *file);
+STACK_OF(X509) *TS_CONF_load_certs(const char *file);
+EVP_PKEY *TS_CONF_load_key(const char *file, const char *pass);
+const char *TS_CONF_get_tsa_section(CONF *conf, const char *section);
+int TS_CONF_set_serial(CONF *conf, const char *section, TS_serial_cb cb,
+ TS_RESP_CTX *ctx);
+int TS_CONF_set_crypto_device(CONF *conf, const char *section,
+ const char *device);
+int TS_CONF_set_default_engine(const char *name);
+int TS_CONF_set_signer_cert(CONF *conf, const char *section,
+ const char *cert, TS_RESP_CTX *ctx);
+int TS_CONF_set_certs(CONF *conf, const char *section, const char *certs,
+ TS_RESP_CTX *ctx);
+int TS_CONF_set_signer_key(CONF *conf, const char *section,
+ const char *key, const char *pass,
+ TS_RESP_CTX *ctx);
+int TS_CONF_set_def_policy(CONF *conf, const char *section,
+ const char *policy, TS_RESP_CTX *ctx);
+int TS_CONF_set_policies(CONF *conf, const char *section, TS_RESP_CTX *ctx);
+int TS_CONF_set_digests(CONF *conf, const char *section, TS_RESP_CTX *ctx);
+int TS_CONF_set_accuracy(CONF *conf, const char *section, TS_RESP_CTX *ctx);
+int TS_CONF_set_clock_precision_digits(CONF *conf, const char *section,
+ TS_RESP_CTX *ctx);
+int TS_CONF_set_ordering(CONF *conf, const char *section, TS_RESP_CTX *ctx);
+int TS_CONF_set_tsa_name(CONF *conf, const char *section, TS_RESP_CTX *ctx);
+int TS_CONF_set_ess_cert_id_chain(CONF *conf, const char *section,
+ TS_RESP_CTX *ctx);
+
+/* -------------------------------------------------- */
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_TS_strings(void);
+
+/* Error codes for the TS functions. */
+
+/* Function codes. */
+# define TS_F_D2I_TS_RESP 147
+# define TS_F_DEF_SERIAL_CB 110
+# define TS_F_DEF_TIME_CB 111
+# define TS_F_ESS_ADD_SIGNING_CERT 112
+# define TS_F_ESS_CERT_ID_NEW_INIT 113
+# define TS_F_ESS_SIGNING_CERT_NEW_INIT 114
+# define TS_F_INT_TS_RESP_VERIFY_TOKEN 149
+# define TS_F_PKCS7_TO_TS_TST_INFO 148
+# define TS_F_TS_ACCURACY_SET_MICROS 115
+# define TS_F_TS_ACCURACY_SET_MILLIS 116
+# define TS_F_TS_ACCURACY_SET_SECONDS 117
+# define TS_F_TS_CHECK_IMPRINTS 100
+# define TS_F_TS_CHECK_NONCES 101
+# define TS_F_TS_CHECK_POLICY 102
+# define TS_F_TS_CHECK_SIGNING_CERTS 103
+# define TS_F_TS_CHECK_STATUS_INFO 104
+# define TS_F_TS_COMPUTE_IMPRINT 145
+# define TS_F_TS_CONF_SET_DEFAULT_ENGINE 146
+# define TS_F_TS_GET_STATUS_TEXT 105
+# define TS_F_TS_MSG_IMPRINT_SET_ALGO 118
+# define TS_F_TS_REQ_SET_MSG_IMPRINT 119
+# define TS_F_TS_REQ_SET_NONCE 120
+# define TS_F_TS_REQ_SET_POLICY_ID 121
+# define TS_F_TS_RESP_CREATE_RESPONSE 122
+# define TS_F_TS_RESP_CREATE_TST_INFO 123
+# define TS_F_TS_RESP_CTX_ADD_FAILURE_INFO 124
+# define TS_F_TS_RESP_CTX_ADD_MD 125
+# define TS_F_TS_RESP_CTX_ADD_POLICY 126
+# define TS_F_TS_RESP_CTX_NEW 127
+# define TS_F_TS_RESP_CTX_SET_ACCURACY 128
+# define TS_F_TS_RESP_CTX_SET_CERTS 129
+# define TS_F_TS_RESP_CTX_SET_DEF_POLICY 130
+# define TS_F_TS_RESP_CTX_SET_SIGNER_CERT 131
+# define TS_F_TS_RESP_CTX_SET_STATUS_INFO 132
+# define TS_F_TS_RESP_GET_POLICY 133
+# define TS_F_TS_RESP_SET_GENTIME_WITH_PRECISION 134
+# define TS_F_TS_RESP_SET_STATUS_INFO 135
+# define TS_F_TS_RESP_SET_TST_INFO 150
+# define TS_F_TS_RESP_SIGN 136
+# define TS_F_TS_RESP_VERIFY_SIGNATURE 106
+# define TS_F_TS_RESP_VERIFY_TOKEN 107
+# define TS_F_TS_TST_INFO_SET_ACCURACY 137
+# define TS_F_TS_TST_INFO_SET_MSG_IMPRINT 138
+# define TS_F_TS_TST_INFO_SET_NONCE 139
+# define TS_F_TS_TST_INFO_SET_POLICY_ID 140
+# define TS_F_TS_TST_INFO_SET_SERIAL 141
+# define TS_F_TS_TST_INFO_SET_TIME 142
+# define TS_F_TS_TST_INFO_SET_TSA 143
+# define TS_F_TS_VERIFY 108
+# define TS_F_TS_VERIFY_CERT 109
+# define TS_F_TS_VERIFY_CTX_NEW 144
+
+/* Reason codes. */
+# define TS_R_BAD_PKCS7_TYPE 132
+# define TS_R_BAD_TYPE 133
+# define TS_R_CERTIFICATE_VERIFY_ERROR 100
+# define TS_R_COULD_NOT_SET_ENGINE 127
+# define TS_R_COULD_NOT_SET_TIME 115
+# define TS_R_D2I_TS_RESP_INT_FAILED 128
+# define TS_R_DETACHED_CONTENT 134
+# define TS_R_ESS_ADD_SIGNING_CERT_ERROR 116
+# define TS_R_ESS_SIGNING_CERTIFICATE_ERROR 101
+# define TS_R_INVALID_NULL_POINTER 102
+# define TS_R_INVALID_SIGNER_CERTIFICATE_PURPOSE 117
+# define TS_R_MESSAGE_IMPRINT_MISMATCH 103
+# define TS_R_NONCE_MISMATCH 104
+# define TS_R_NONCE_NOT_RETURNED 105
+# define TS_R_NO_CONTENT 106
+# define TS_R_NO_TIME_STAMP_TOKEN 107
+# define TS_R_PKCS7_ADD_SIGNATURE_ERROR 118
+# define TS_R_PKCS7_ADD_SIGNED_ATTR_ERROR 119
+# define TS_R_PKCS7_TO_TS_TST_INFO_FAILED 129
+# define TS_R_POLICY_MISMATCH 108
+# define TS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 120
+# define TS_R_RESPONSE_SETUP_ERROR 121
+# define TS_R_SIGNATURE_FAILURE 109
+# define TS_R_THERE_MUST_BE_ONE_SIGNER 110
+# define TS_R_TIME_SYSCALL_ERROR 122
+# define TS_R_TOKEN_NOT_PRESENT 130
+# define TS_R_TOKEN_PRESENT 131
+# define TS_R_TSA_NAME_MISMATCH 111
+# define TS_R_TSA_UNTRUSTED 112
+# define TS_R_TST_INFO_SETUP_ERROR 123
+# define TS_R_TS_DATASIGN 124
+# define TS_R_UNACCEPTABLE_POLICY 125
+# define TS_R_UNSUPPORTED_MD_ALGORITHM 126
+# define TS_R_UNSUPPORTED_VERSION 113
+# define TS_R_WRONG_CONTENT_TYPE 114
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/deps/openssl/openssl/include/openssl/txt_db.h b/deps/openssl/openssl/include/openssl/txt_db.h
index 167621b6fa8..98e23a2003c 100644
--- a/deps/openssl/openssl/include/openssl/txt_db.h
+++ b/deps/openssl/openssl/include/openssl/txt_db.h
@@ -1 +1,112 @@
-#include "../../crypto/txt_db/txt_db.h"
+/* crypto/txt_db/txt_db.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_TXT_DB_H
+# define HEADER_TXT_DB_H
+
+# include <openssl/opensslconf.h>
+# ifndef OPENSSL_NO_BIO
+# include <openssl/bio.h>
+# endif
+# include <openssl/stack.h>
+# include <openssl/lhash.h>
+
+# define DB_ERROR_OK 0
+# define DB_ERROR_MALLOC 1
+# define DB_ERROR_INDEX_CLASH 2
+# define DB_ERROR_INDEX_OUT_OF_RANGE 3
+# define DB_ERROR_NO_INDEX 4
+# define DB_ERROR_INSERT_INDEX_CLASH 5
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef OPENSSL_STRING *OPENSSL_PSTRING;
+DECLARE_SPECIAL_STACK_OF(OPENSSL_PSTRING, OPENSSL_STRING)
+
+typedef struct txt_db_st {
+ int num_fields;
+ STACK_OF(OPENSSL_PSTRING) *data;
+ LHASH_OF(OPENSSL_STRING) **index;
+ int (**qual) (OPENSSL_STRING *);
+ long error;
+ long arg1;
+ long arg2;
+ OPENSSL_STRING *arg_row;
+} TXT_DB;
+
+# ifndef OPENSSL_NO_BIO
+TXT_DB *TXT_DB_read(BIO *in, int num);
+long TXT_DB_write(BIO *out, TXT_DB *db);
+# else
+TXT_DB *TXT_DB_read(char *in, int num);
+long TXT_DB_write(char *out, TXT_DB *db);
+# endif
+int TXT_DB_create_index(TXT_DB *db, int field, int (*qual) (OPENSSL_STRING *),
+ LHASH_HASH_FN_TYPE hash, LHASH_COMP_FN_TYPE cmp);
+void TXT_DB_free(TXT_DB *db);
+OPENSSL_STRING *TXT_DB_get_by_index(TXT_DB *db, int idx,
+ OPENSSL_STRING *value);
+int TXT_DB_insert(TXT_DB *db, OPENSSL_STRING *value);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/deps/openssl/openssl/include/openssl/ui.h b/deps/openssl/openssl/include/openssl/ui.h
index 43dd3ae83a5..b917edab3a7 100644
--- a/deps/openssl/openssl/include/openssl/ui.h
+++ b/deps/openssl/openssl/include/openssl/ui.h
@@ -1 +1,415 @@
-#include "../../crypto/ui/ui.h"
+/* crypto/ui/ui.h -*- mode:C; c-file-style: "eay" -*- */
+/*
+ * Written by Richard Levitte (richard@levitte.org) for the OpenSSL project
+ * 2001.
+ */
+/* ====================================================================
+ * Copyright (c) 2001 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+#ifndef HEADER_UI_H
+# define HEADER_UI_H
+
+# ifndef OPENSSL_NO_DEPRECATED
+# include <openssl/crypto.h>
+# endif
+# include <openssl/safestack.h>
+# include <openssl/ossl_typ.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Declared already in ossl_typ.h */
+/* typedef struct ui_st UI; */
+/* typedef struct ui_method_st UI_METHOD; */
+
+/*
+ * All the following functions return -1 or NULL on error and in some cases
+ * (UI_process()) -2 if interrupted or in some other way cancelled. When
+ * everything is fine, they return 0, a positive value or a non-NULL pointer,
+ * all depending on their purpose.
+ */
+
+/* Creators and destructor. */
+UI *UI_new(void);
+UI *UI_new_method(const UI_METHOD *method);
+void UI_free(UI *ui);
+
+/*-
+ The following functions are used to add strings to be printed and prompt
+ strings to prompt for data. The names are UI_{add,dup}_<function>_string
+ and UI_{add,dup}_input_boolean.
+
+ UI_{add,dup}_<function>_string have the following meanings:
+ add add a text or prompt string. The pointers given to these
+ functions are used verbatim, no copying is done.
+ dup make a copy of the text or prompt string, then add the copy
+ to the collection of strings in the user interface.
+ <function>
+ The function is a name for the functionality that the given
+ string shall be used for. It can be one of:
+ input use the string as data prompt.
+ verify use the string as verification prompt. This
+ is used to verify a previous input.
+ info use the string for informational output.
+ error use the string for error output.
+ Honestly, there's currently no difference between info and error for the
+ moment.
+
+ UI_{add,dup}_input_boolean have the same semantics for "add" and "dup",
+ and are typically used when one wants to prompt for a yes/no response.
+
+ All of the functions in this group take a UI and a prompt string.
+ The string input and verify addition functions also take a flag argument,
+ a buffer for the result to end up with, a minimum input size and a maximum
+ input size (the result buffer MUST be large enough to be able to contain
+ the maximum number of characters). Additionally, the verify addition
+ functions takes another buffer to compare the result against.
+ The boolean input functions take an action description string (which should
+ be safe to ignore if the expected user action is obvious, for example with
+ a dialog box with an OK button and a Cancel button), a string of acceptable
+ characters to mean OK and to mean Cancel. The two last strings are checked
+ to make sure they don't have common characters. Additionally, the same
+ flag argument as for the string input is taken, as well as a result buffer.
+ The result buffer is required to be at least one byte long. Depending on
+ the answer, the first character from the OK or the Cancel character strings
+ will be stored in the first byte of the result buffer. No NUL will be
+ added, so the result is *not* a string.
+
+ On success, the all return an index of the added information. That index
+ is usefull when retrieving results with UI_get0_result(). */
+int UI_add_input_string(UI *ui, const char *prompt, int flags,
+ char *result_buf, int minsize, int maxsize);
+int UI_dup_input_string(UI *ui, const char *prompt, int flags,
+ char *result_buf, int minsize, int maxsize);
+int UI_add_verify_string(UI *ui, const char *prompt, int flags,
+ char *result_buf, int minsize, int maxsize,
+ const char *test_buf);
+int UI_dup_verify_string(UI *ui, const char *prompt, int flags,
+ char *result_buf, int minsize, int maxsize,
+ const char *test_buf);
+int UI_add_input_boolean(UI *ui, const char *prompt, const char *action_desc,
+ const char *ok_chars, const char *cancel_chars,
+ int flags, char *result_buf);
+int UI_dup_input_boolean(UI *ui, const char *prompt, const char *action_desc,
+ const char *ok_chars, const char *cancel_chars,
+ int flags, char *result_buf);
+int UI_add_info_string(UI *ui, const char *text);
+int UI_dup_info_string(UI *ui, const char *text);
+int UI_add_error_string(UI *ui, const char *text);
+int UI_dup_error_string(UI *ui, const char *text);
+
+/* These are the possible flags. They can be or'ed together. */
+/* Use to have echoing of input */
+# define UI_INPUT_FLAG_ECHO 0x01
+/*
+ * Use a default password. Where that password is found is completely up to
+ * the application, it might for example be in the user data set with
+ * UI_add_user_data(). It is not recommended to have more than one input in
+ * each UI being marked with this flag, or the application might get
+ * confused.
+ */
+# define UI_INPUT_FLAG_DEFAULT_PWD 0x02
+
+/*-
+ * The user of these routines may want to define flags of their own. The core
+ * UI won't look at those, but will pass them on to the method routines. They
+ * must use higher bits so they don't get confused with the UI bits above.
+ * UI_INPUT_FLAG_USER_BASE tells which is the lowest bit to use. A good
+ * example of use is this:
+ *
+ * #define MY_UI_FLAG1 (0x01 << UI_INPUT_FLAG_USER_BASE)
+ *
+*/
+# define UI_INPUT_FLAG_USER_BASE 16
+
+/*-
+ * The following function helps construct a prompt. object_desc is a
+ * textual short description of the object, for example "pass phrase",
+ * and object_name is the name of the object (might be a card name or
+ * a file name.
+ * The returned string shall always be allocated on the heap with
+ * OPENSSL_malloc(), and need to be free'd with OPENSSL_free().
+ *
+ * If the ui_method doesn't contain a pointer to a user-defined prompt
+ * constructor, a default string is built, looking like this:
+ *
+ * "Enter {object_desc} for {object_name}:"
+ *
+ * So, if object_desc has the value "pass phrase" and object_name has
+ * the value "foo.key", the resulting string is:
+ *
+ * "Enter pass phrase for foo.key:"
+*/
+char *UI_construct_prompt(UI *ui_method,
+ const char *object_desc, const char *object_name);
+
+/*
+ * The following function is used to store a pointer to user-specific data.
+ * Any previous such pointer will be returned and replaced.
+ *
+ * For callback purposes, this function makes a lot more sense than using
+ * ex_data, since the latter requires that different parts of OpenSSL or
+ * applications share the same ex_data index.
+ *
+ * Note that the UI_OpenSSL() method completely ignores the user data. Other
+ * methods may not, however.
+ */
+void *UI_add_user_data(UI *ui, void *user_data);
+/* We need a user data retrieving function as well. */
+void *UI_get0_user_data(UI *ui);
+
+/* Return the result associated with a prompt given with the index i. */
+const char *UI_get0_result(UI *ui, int i);
+
+/* When all strings have been added, process the whole thing. */
+int UI_process(UI *ui);
+
+/*
+ * Give a user interface parametrised control commands. This can be used to
+ * send down an integer, a data pointer or a function pointer, as well as be
+ * used to get information from a UI.
+ */
+int UI_ctrl(UI *ui, int cmd, long i, void *p, void (*f) (void));
+
+/* The commands */
+/*
+ * Use UI_CONTROL_PRINT_ERRORS with the value 1 to have UI_process print the
+ * OpenSSL error stack before printing any info or added error messages and
+ * before any prompting.
+ */
+# define UI_CTRL_PRINT_ERRORS 1
+/*
+ * Check if a UI_process() is possible to do again with the same instance of
+ * a user interface. This makes UI_ctrl() return 1 if it is redoable, and 0
+ * if not.
+ */
+# define UI_CTRL_IS_REDOABLE 2
+
+/* Some methods may use extra data */
+# define UI_set_app_data(s,arg) UI_set_ex_data(s,0,arg)
+# define UI_get_app_data(s) UI_get_ex_data(s,0)
+int UI_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
+ CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
+int UI_set_ex_data(UI *r, int idx, void *arg);
+void *UI_get_ex_data(UI *r, int idx);
+
+/* Use specific methods instead of the built-in one */
+void UI_set_default_method(const UI_METHOD *meth);
+const UI_METHOD *UI_get_default_method(void);
+const UI_METHOD *UI_get_method(UI *ui);
+const UI_METHOD *UI_set_method(UI *ui, const UI_METHOD *meth);
+
+/* The method with all the built-in thingies */
+UI_METHOD *UI_OpenSSL(void);
+
+/* ---------- For method writers ---------- */
+/*-
+ A method contains a number of functions that implement the low level
+ of the User Interface. The functions are:
+
+ an opener This function starts a session, maybe by opening
+ a channel to a tty, or by opening a window.
+ a writer This function is called to write a given string,
+ maybe to the tty, maybe as a field label in a
+ window.
+ a flusher This function is called to flush everything that
+ has been output so far. It can be used to actually
+ display a dialog box after it has been built.
+ a reader This function is called to read a given prompt,
+ maybe from the tty, maybe from a field in a
+ window. Note that it's called wth all string
+ structures, not only the prompt ones, so it must
+ check such things itself.
+ a closer This function closes the session, maybe by closing
+ the channel to the tty, or closing the window.
+
+ All these functions are expected to return:
+
+ 0 on error.
+ 1 on success.
+ -1 on out-of-band events, for example if some prompting has
+ been canceled (by pressing Ctrl-C, for example). This is
+ only checked when returned by the flusher or the reader.
+
+ The way this is used, the opener is first called, then the writer for all
+ strings, then the flusher, then the reader for all strings and finally the
+ closer. Note that if you want to prompt from a terminal or other command
+ line interface, the best is to have the reader also write the prompts
+ instead of having the writer do it. If you want to prompt from a dialog
+ box, the writer can be used to build up the contents of the box, and the
+ flusher to actually display the box and run the event loop until all data
+ has been given, after which the reader only grabs the given data and puts
+ them back into the UI strings.
+
+ All method functions take a UI as argument. Additionally, the writer and
+ the reader take a UI_STRING.
+*/
+
+/*
+ * The UI_STRING type is the data structure that contains all the needed info
+ * about a string or a prompt, including test data for a verification prompt.
+ */
+typedef struct ui_string_st UI_STRING;
+DECLARE_STACK_OF(UI_STRING)
+
+/*
+ * The different types of strings that are currently supported. This is only
+ * needed by method authors.
+ */
+enum UI_string_types {
+ UIT_NONE = 0,
+ UIT_PROMPT, /* Prompt for a string */
+ UIT_VERIFY, /* Prompt for a string and verify */
+ UIT_BOOLEAN, /* Prompt for a yes/no response */
+ UIT_INFO, /* Send info to the user */
+ UIT_ERROR /* Send an error message to the user */
+};
+
+/* Create and manipulate methods */
+UI_METHOD *UI_create_method(char *name);
+void UI_destroy_method(UI_METHOD *ui_method);
+int UI_method_set_opener(UI_METHOD *method, int (*opener) (UI *ui));
+int UI_method_set_writer(UI_METHOD *method,
+ int (*writer) (UI *ui, UI_STRING *uis));
+int UI_method_set_flusher(UI_METHOD *method, int (*flusher) (UI *ui));
+int UI_method_set_reader(UI_METHOD *method,
+ int (*reader) (UI *ui, UI_STRING *uis));
+int UI_method_set_closer(UI_METHOD *method, int (*closer) (UI *ui));
+int UI_method_set_prompt_constructor(UI_METHOD *method,
+ char *(*prompt_constructor) (UI *ui,
+ const char
+ *object_desc,
+ const char
+ *object_name));
+int (*UI_method_get_opener(UI_METHOD *method)) (UI *);
+int (*UI_method_get_writer(UI_METHOD *method)) (UI *, UI_STRING *);
+int (*UI_method_get_flusher(UI_METHOD *method)) (UI *);
+int (*UI_method_get_reader(UI_METHOD *method)) (UI *, UI_STRING *);
+int (*UI_method_get_closer(UI_METHOD *method)) (UI *);
+char *(*UI_method_get_prompt_constructor(UI_METHOD *method)) (UI *,
+ const char *,
+ const char *);
+
+/*
+ * The following functions are helpers for method writers to access relevant
+ * data from a UI_STRING.
+ */
+
+/* Return type of the UI_STRING */
+enum UI_string_types UI_get_string_type(UI_STRING *uis);
+/* Return input flags of the UI_STRING */
+int UI_get_input_flags(UI_STRING *uis);
+/* Return the actual string to output (the prompt, info or error) */
+const char *UI_get0_output_string(UI_STRING *uis);
+/*
+ * Return the optional action string to output (the boolean promtp
+ * instruction)
+ */
+const char *UI_get0_action_string(UI_STRING *uis);
+/* Return the result of a prompt */
+const char *UI_get0_result_string(UI_STRING *uis);
+/*
+ * Return the string to test the result against. Only useful with verifies.
+ */
+const char *UI_get0_test_string(UI_STRING *uis);
+/* Return the required minimum size of the result */
+int UI_get_result_minsize(UI_STRING *uis);
+/* Return the required maximum size of the result */
+int UI_get_result_maxsize(UI_STRING *uis);
+/* Set the result of a UI_STRING. */
+int UI_set_result(UI *ui, UI_STRING *uis, const char *result);
+
+/* A couple of popular utility functions */
+int UI_UTIL_read_pw_string(char *buf, int length, const char *prompt,
+ int verify);
+int UI_UTIL_read_pw(char *buf, char *buff, int size, const char *prompt,
+ int verify);
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_UI_strings(void);
+
+/* Error codes for the UI functions. */
+
+/* Function codes. */
+# define UI_F_GENERAL_ALLOCATE_BOOLEAN 108
+# define UI_F_GENERAL_ALLOCATE_PROMPT 109
+# define UI_F_GENERAL_ALLOCATE_STRING 100
+# define UI_F_UI_CTRL 111
+# define UI_F_UI_DUP_ERROR_STRING 101
+# define UI_F_UI_DUP_INFO_STRING 102
+# define UI_F_UI_DUP_INPUT_BOOLEAN 110
+# define UI_F_UI_DUP_INPUT_STRING 103
+# define UI_F_UI_DUP_VERIFY_STRING 106
+# define UI_F_UI_GET0_RESULT 107
+# define UI_F_UI_NEW_METHOD 104
+# define UI_F_UI_SET_RESULT 105
+
+/* Reason codes. */
+# define UI_R_COMMON_OK_AND_CANCEL_CHARACTERS 104
+# define UI_R_INDEX_TOO_LARGE 102
+# define UI_R_INDEX_TOO_SMALL 103
+# define UI_R_NO_RESULT_BUFFER 105
+# define UI_R_RESULT_TOO_LARGE 100
+# define UI_R_RESULT_TOO_SMALL 101
+# define UI_R_UNKNOWN_CONTROL_COMMAND 106
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/deps/openssl/openssl/include/openssl/ui_compat.h b/deps/openssl/openssl/include/openssl/ui_compat.h
index c83f160d802..42fb9ff6500 100644
--- a/deps/openssl/openssl/include/openssl/ui_compat.h
+++ b/deps/openssl/openssl/include/openssl/ui_compat.h
@@ -1 +1,88 @@
-#include "../../crypto/ui/ui_compat.h"
+/* crypto/ui/ui.h -*- mode:C; c-file-style: "eay" -*- */
+/*
+ * Written by Richard Levitte (richard@levitte.org) for the OpenSSL project
+ * 2001.
+ */
+/* ====================================================================
+ * Copyright (c) 2001 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+#ifndef HEADER_UI_COMPAT_H
+# define HEADER_UI_COMPAT_H
+
+# include <openssl/opensslconf.h>
+# include <openssl/ui.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * The following functions were previously part of the DES section, and are
+ * provided here for backward compatibility reasons.
+ */
+
+# define des_read_pw_string(b,l,p,v) \
+ _ossl_old_des_read_pw_string((b),(l),(p),(v))
+# define des_read_pw(b,bf,s,p,v) \
+ _ossl_old_des_read_pw((b),(bf),(s),(p),(v))
+
+int _ossl_old_des_read_pw_string(char *buf, int length, const char *prompt,
+ int verify);
+int _ossl_old_des_read_pw(char *buf, char *buff, int size, const char *prompt,
+ int verify);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/deps/openssl/openssl/include/openssl/whrlpool.h b/deps/openssl/openssl/include/openssl/whrlpool.h
index e2424fadde2..73c749da815 100644
--- a/deps/openssl/openssl/include/openssl/whrlpool.h
+++ b/deps/openssl/openssl/include/openssl/whrlpool.h
@@ -1 +1,41 @@
-#include "../../crypto/whrlpool/whrlpool.h"
+#ifndef HEADER_WHRLPOOL_H
+# define HEADER_WHRLPOOL_H
+
+# include <openssl/e_os2.h>
+# include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# define WHIRLPOOL_DIGEST_LENGTH (512/8)
+# define WHIRLPOOL_BBLOCK 512
+# define WHIRLPOOL_COUNTER (256/8)
+
+typedef struct {
+ union {
+ unsigned char c[WHIRLPOOL_DIGEST_LENGTH];
+ /* double q is here to ensure 64-bit alignment */
+ double q[WHIRLPOOL_DIGEST_LENGTH / sizeof(double)];
+ } H;
+ unsigned char data[WHIRLPOOL_BBLOCK / 8];
+ unsigned int bitoff;
+ size_t bitlen[WHIRLPOOL_COUNTER / sizeof(size_t)];
+} WHIRLPOOL_CTX;
+
+# ifndef OPENSSL_NO_WHIRLPOOL
+# ifdef OPENSSL_FIPS
+int private_WHIRLPOOL_Init(WHIRLPOOL_CTX *c);
+# endif
+int WHIRLPOOL_Init(WHIRLPOOL_CTX *c);
+int WHIRLPOOL_Update(WHIRLPOOL_CTX *c, const void *inp, size_t bytes);
+void WHIRLPOOL_BitUpdate(WHIRLPOOL_CTX *c, const void *inp, size_t bits);
+int WHIRLPOOL_Final(unsigned char *md, WHIRLPOOL_CTX *c);
+unsigned char *WHIRLPOOL(const void *inp, size_t bytes, unsigned char *md);
+# endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/deps/openssl/openssl/include/openssl/x509.h b/deps/openssl/openssl/include/openssl/x509.h
index a4651a28652..99337b849a5 100644
--- a/deps/openssl/openssl/include/openssl/x509.h
+++ b/deps/openssl/openssl/include/openssl/x509.h
@@ -1 +1,1327 @@
-#include "../../crypto/x509/x509.h"
+/* crypto/x509/x509.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+/* ====================================================================
+ * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
+ * ECDH support in OpenSSL originally developed by
+ * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
+ */
+
+#ifndef HEADER_X509_H
+# define HEADER_X509_H
+
+# include <openssl/e_os2.h>
+# include <openssl/symhacks.h>
+# ifndef OPENSSL_NO_BUFFER
+# include <openssl/buffer.h>
+# endif
+# ifndef OPENSSL_NO_EVP
+# include <openssl/evp.h>
+# endif
+# ifndef OPENSSL_NO_BIO
+# include <openssl/bio.h>
+# endif
+# include <openssl/stack.h>
+# include <openssl/asn1.h>
+# include <openssl/safestack.h>
+
+# ifndef OPENSSL_NO_EC
+# include <openssl/ec.h>
+# endif
+
+# ifndef OPENSSL_NO_ECDSA
+# include <openssl/ecdsa.h>
+# endif
+
+# ifndef OPENSSL_NO_ECDH
+# include <openssl/ecdh.h>
+# endif
+
+# ifndef OPENSSL_NO_DEPRECATED
+# ifndef OPENSSL_NO_RSA
+# include <openssl/rsa.h>
+# endif
+# ifndef OPENSSL_NO_DSA
+# include <openssl/dsa.h>
+# endif
+# ifndef OPENSSL_NO_DH
+# include <openssl/dh.h>
+# endif
+# endif
+
+# ifndef OPENSSL_NO_SHA
+# include <openssl/sha.h>
+# endif
+# include <openssl/ossl_typ.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# ifdef OPENSSL_SYS_WIN32
+/* Under Win32 these are defined in wincrypt.h */
+# undef X509_NAME
+# undef X509_CERT_PAIR
+# undef X509_EXTENSIONS
+# endif
+
+# define X509_FILETYPE_PEM 1
+# define X509_FILETYPE_ASN1 2
+# define X509_FILETYPE_DEFAULT 3
+
+# define X509v3_KU_DIGITAL_SIGNATURE 0x0080
+# define X509v3_KU_NON_REPUDIATION 0x0040
+# define X509v3_KU_KEY_ENCIPHERMENT 0x0020
+# define X509v3_KU_DATA_ENCIPHERMENT 0x0010
+# define X509v3_KU_KEY_AGREEMENT 0x0008
+# define X509v3_KU_KEY_CERT_SIGN 0x0004
+# define X509v3_KU_CRL_SIGN 0x0002
+# define X509v3_KU_ENCIPHER_ONLY 0x0001
+# define X509v3_KU_DECIPHER_ONLY 0x8000
+# define X509v3_KU_UNDEF 0xffff
+
+typedef struct X509_objects_st {
+ int nid;
+ int (*a2i) (void);
+ int (*i2a) (void);
+} X509_OBJECTS;
+
+struct X509_algor_st {
+ ASN1_OBJECT *algorithm;
+ ASN1_TYPE *parameter;
+} /* X509_ALGOR */ ;
+
+DECLARE_ASN1_SET_OF(X509_ALGOR)
+
+typedef STACK_OF(X509_ALGOR) X509_ALGORS;
+
+typedef struct X509_val_st {
+ ASN1_TIME *notBefore;
+ ASN1_TIME *notAfter;
+} X509_VAL;
+
+struct X509_pubkey_st {
+ X509_ALGOR *algor;
+ ASN1_BIT_STRING *public_key;
+ EVP_PKEY *pkey;
+};
+
+typedef struct X509_sig_st {
+ X509_ALGOR *algor;
+ ASN1_OCTET_STRING *digest;
+} X509_SIG;
+
+typedef struct X509_name_entry_st {
+ ASN1_OBJECT *object;
+ ASN1_STRING *value;
+ int set;
+ int size; /* temp variable */
+} X509_NAME_ENTRY;
+
+DECLARE_STACK_OF(X509_NAME_ENTRY)
+DECLARE_ASN1_SET_OF(X509_NAME_ENTRY)
+
+/* we always keep X509_NAMEs in 2 forms. */
+struct X509_name_st {
+ STACK_OF(X509_NAME_ENTRY) *entries;
+ int modified; /* true if 'bytes' needs to be built */
+# ifndef OPENSSL_NO_BUFFER
+ BUF_MEM *bytes;
+# else
+ char *bytes;
+# endif
+/* unsigned long hash; Keep the hash around for lookups */
+ unsigned char *canon_enc;
+ int canon_enclen;
+} /* X509_NAME */ ;
+
+DECLARE_STACK_OF(X509_NAME)
+
+# define X509_EX_V_NETSCAPE_HACK 0x8000
+# define X509_EX_V_INIT 0x0001
+typedef struct X509_extension_st {
+ ASN1_OBJECT *object;
+ ASN1_BOOLEAN critical;
+ ASN1_OCTET_STRING *value;
+} X509_EXTENSION;
+
+typedef STACK_OF(X509_EXTENSION) X509_EXTENSIONS;
+
+DECLARE_STACK_OF(X509_EXTENSION)
+DECLARE_ASN1_SET_OF(X509_EXTENSION)
+
+/* a sequence of these are used */
+typedef struct x509_attributes_st {
+ ASN1_OBJECT *object;
+ int single; /* 0 for a set, 1 for a single item (which is
+ * wrong) */
+ union {
+ char *ptr;
+ /*
+ * 0
+ */ STACK_OF(ASN1_TYPE) *set;
+ /*
+ * 1
+ */ ASN1_TYPE *single;
+ } value;
+} X509_ATTRIBUTE;
+
+DECLARE_STACK_OF(X509_ATTRIBUTE)
+DECLARE_ASN1_SET_OF(X509_ATTRIBUTE)
+
+typedef struct X509_req_info_st {
+ ASN1_ENCODING enc;
+ ASN1_INTEGER *version;
+ X509_NAME *subject;
+ X509_PUBKEY *pubkey;
+ /* d=2 hl=2 l= 0 cons: cont: 00 */
+ STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */
+} X509_REQ_INFO;
+
+typedef struct X509_req_st {
+ X509_REQ_INFO *req_info;
+ X509_ALGOR *sig_alg;
+ ASN1_BIT_STRING *signature;
+ int references;
+} X509_REQ;
+
+typedef struct x509_cinf_st {
+ ASN1_INTEGER *version; /* [ 0 ] default of v1 */
+ ASN1_INTEGER *serialNumber;
+ X509_ALGOR *signature;
+ X509_NAME *issuer;
+ X509_VAL *validity;
+ X509_NAME *subject;
+ X509_PUBKEY *key;
+ ASN1_BIT_STRING *issuerUID; /* [ 1 ] optional in v2 */
+ ASN1_BIT_STRING *subjectUID; /* [ 2 ] optional in v2 */
+ STACK_OF(X509_EXTENSION) *extensions; /* [ 3 ] optional in v3 */
+ ASN1_ENCODING enc;
+} X509_CINF;
+
+/*
+ * This stuff is certificate "auxiliary info" it contains details which are
+ * useful in certificate stores and databases. When used this is tagged onto
+ * the end of the certificate itself
+ */
+
+typedef struct x509_cert_aux_st {
+ STACK_OF(ASN1_OBJECT) *trust; /* trusted uses */
+ STACK_OF(ASN1_OBJECT) *reject; /* rejected uses */
+ ASN1_UTF8STRING *alias; /* "friendly name" */
+ ASN1_OCTET_STRING *keyid; /* key id of private key */
+ STACK_OF(X509_ALGOR) *other; /* other unspecified info */
+} X509_CERT_AUX;
+
+struct x509_st {
+ X509_CINF *cert_info;
+ X509_ALGOR *sig_alg;
+ ASN1_BIT_STRING *signature;
+ int valid;
+ int references;
+ char *name;
+ CRYPTO_EX_DATA ex_data;
+ /* These contain copies of various extension values */
+ long ex_pathlen;
+ long ex_pcpathlen;
+ unsigned long ex_flags;
+ unsigned long ex_kusage;
+ unsigned long ex_xkusage;
+ unsigned long ex_nscert;
+ ASN1_OCTET_STRING *skid;
+ AUTHORITY_KEYID *akid;
+ X509_POLICY_CACHE *policy_cache;
+ STACK_OF(DIST_POINT) *crldp;
+ STACK_OF(GENERAL_NAME) *altname;
+ NAME_CONSTRAINTS *nc;
+# ifndef OPENSSL_NO_RFC3779
+ STACK_OF(IPAddressFamily) *rfc3779_addr;
+ struct ASIdentifiers_st *rfc3779_asid;
+# endif
+# ifndef OPENSSL_NO_SHA
+ unsigned char sha1_hash[SHA_DIGEST_LENGTH];
+# endif
+ X509_CERT_AUX *aux;
+} /* X509 */ ;
+
+DECLARE_STACK_OF(X509)
+DECLARE_ASN1_SET_OF(X509)
+
+/* This is used for a table of trust checking functions */
+
+typedef struct x509_trust_st {
+ int trust;
+ int flags;
+ int (*check_trust) (struct x509_trust_st *, X509 *, int);
+ char *name;
+ int arg1;
+ void *arg2;
+} X509_TRUST;
+
+DECLARE_STACK_OF(X509_TRUST)
+
+typedef struct x509_cert_pair_st {
+ X509 *forward;
+ X509 *reverse;
+} X509_CERT_PAIR;
+
+/* standard trust ids */
+
+# define X509_TRUST_DEFAULT -1/* Only valid in purpose settings */
+
+# define X509_TRUST_COMPAT 1
+# define X509_TRUST_SSL_CLIENT 2
+# define X509_TRUST_SSL_SERVER 3
+# define X509_TRUST_EMAIL 4
+# define X509_TRUST_OBJECT_SIGN 5
+# define X509_TRUST_OCSP_SIGN 6
+# define X509_TRUST_OCSP_REQUEST 7
+# define X509_TRUST_TSA 8
+
+/* Keep these up to date! */
+# define X509_TRUST_MIN 1
+# define X509_TRUST_MAX 8
+
+/* trust_flags values */
+# define X509_TRUST_DYNAMIC 1
+# define X509_TRUST_DYNAMIC_NAME 2
+
+/* check_trust return codes */
+
+# define X509_TRUST_TRUSTED 1
+# define X509_TRUST_REJECTED 2
+# define X509_TRUST_UNTRUSTED 3
+
+/* Flags for X509_print_ex() */
+
+# define X509_FLAG_COMPAT 0
+# define X509_FLAG_NO_HEADER 1L
+# define X509_FLAG_NO_VERSION (1L << 1)
+# define X509_FLAG_NO_SERIAL (1L << 2)
+# define X509_FLAG_NO_SIGNAME (1L << 3)
+# define X509_FLAG_NO_ISSUER (1L << 4)
+# define X509_FLAG_NO_VALIDITY (1L << 5)
+# define X509_FLAG_NO_SUBJECT (1L << 6)
+# define X509_FLAG_NO_PUBKEY (1L << 7)
+# define X509_FLAG_NO_EXTENSIONS (1L << 8)
+# define X509_FLAG_NO_SIGDUMP (1L << 9)
+# define X509_FLAG_NO_AUX (1L << 10)
+# define X509_FLAG_NO_ATTRIBUTES (1L << 11)
+# define X509_FLAG_NO_IDS (1L << 12)
+
+/* Flags specific to X509_NAME_print_ex() */
+
+/* The field separator information */
+
+# define XN_FLAG_SEP_MASK (0xf << 16)
+
+# define XN_FLAG_COMPAT 0/* Traditional SSLeay: use old
+ * X509_NAME_print */
+# define XN_FLAG_SEP_COMMA_PLUS (1 << 16)/* RFC2253 ,+ */
+# define XN_FLAG_SEP_CPLUS_SPC (2 << 16)/* ,+ spaced: more readable */
+# define XN_FLAG_SEP_SPLUS_SPC (3 << 16)/* ;+ spaced */
+# define XN_FLAG_SEP_MULTILINE (4 << 16)/* One line per field */
+
+# define XN_FLAG_DN_REV (1 << 20)/* Reverse DN order */
+
+/* How the field name is shown */
+
+# define XN_FLAG_FN_MASK (0x3 << 21)
+
+# define XN_FLAG_FN_SN 0/* Object short name */
+# define XN_FLAG_FN_LN (1 << 21)/* Object long name */
+# define XN_FLAG_FN_OID (2 << 21)/* Always use OIDs */
+# define XN_FLAG_FN_NONE (3 << 21)/* No field names */
+
+# define XN_FLAG_SPC_EQ (1 << 23)/* Put spaces round '=' */
+
+/*
+ * This determines if we dump fields we don't recognise: RFC2253 requires
+ * this.
+ */
+
+# define XN_FLAG_DUMP_UNKNOWN_FIELDS (1 << 24)
+
+# define XN_FLAG_FN_ALIGN (1 << 25)/* Align field names to 20
+ * characters */
+
+/* Complete set of RFC2253 flags */
+
+# define XN_FLAG_RFC2253 (ASN1_STRFLGS_RFC2253 | \
+ XN_FLAG_SEP_COMMA_PLUS | \
+ XN_FLAG_DN_REV | \
+ XN_FLAG_FN_SN | \
+ XN_FLAG_DUMP_UNKNOWN_FIELDS)
+
+/* readable oneline form */
+
+# define XN_FLAG_ONELINE (ASN1_STRFLGS_RFC2253 | \
+ ASN1_STRFLGS_ESC_QUOTE | \
+ XN_FLAG_SEP_CPLUS_SPC | \
+ XN_FLAG_SPC_EQ | \
+ XN_FLAG_FN_SN)
+
+/* readable multiline form */
+
+# define XN_FLAG_MULTILINE (ASN1_STRFLGS_ESC_CTRL | \
+ ASN1_STRFLGS_ESC_MSB | \
+ XN_FLAG_SEP_MULTILINE | \
+ XN_FLAG_SPC_EQ | \
+ XN_FLAG_FN_LN | \
+ XN_FLAG_FN_ALIGN)
+
+struct x509_revoked_st {
+ ASN1_INTEGER *serialNumber;
+ ASN1_TIME *revocationDate;
+ STACK_OF(X509_EXTENSION) /* optional */ *extensions;
+ /* Set up if indirect CRL */
+ STACK_OF(GENERAL_NAME) *issuer;
+ /* Revocation reason */
+ int reason;
+ int sequence; /* load sequence */
+};
+
+DECLARE_STACK_OF(X509_REVOKED)
+DECLARE_ASN1_SET_OF(X509_REVOKED)
+
+typedef struct X509_crl_info_st {
+ ASN1_INTEGER *version;
+ X509_ALGOR *sig_alg;
+ X509_NAME *issuer;
+ ASN1_TIME *lastUpdate;
+ ASN1_TIME *nextUpdate;
+ STACK_OF(X509_REVOKED) *revoked;
+ STACK_OF(X509_EXTENSION) /* [0] */ *extensions;
+ ASN1_ENCODING enc;
+} X509_CRL_INFO;
+
+struct X509_crl_st {
+ /* actual signature */
+ X509_CRL_INFO *crl;
+ X509_ALGOR *sig_alg;
+ ASN1_BIT_STRING *signature;
+ int references;
+ int flags;
+ /* Copies of various extensions */
+ AUTHORITY_KEYID *akid;
+ ISSUING_DIST_POINT *idp;
+ /* Convenient breakdown of IDP */
+ int idp_flags;
+ int idp_reasons;
+ /* CRL and base CRL numbers for delta processing */
+ ASN1_INTEGER *crl_number;
+ ASN1_INTEGER *base_crl_number;
+# ifndef OPENSSL_NO_SHA
+ unsigned char sha1_hash[SHA_DIGEST_LENGTH];
+# endif
+ STACK_OF(GENERAL_NAMES) *issuers;
+ const X509_CRL_METHOD *meth;
+ void *meth_data;
+} /* X509_CRL */ ;
+
+DECLARE_STACK_OF(X509_CRL)
+DECLARE_ASN1_SET_OF(X509_CRL)
+
+typedef struct private_key_st {
+ int version;
+ /* The PKCS#8 data types */
+ X509_ALGOR *enc_algor;
+ ASN1_OCTET_STRING *enc_pkey; /* encrypted pub key */
+ /* When decrypted, the following will not be NULL */
+ EVP_PKEY *dec_pkey;
+ /* used to encrypt and decrypt */
+ int key_length;
+ char *key_data;
+ int key_free; /* true if we should auto free key_data */
+ /* expanded version of 'enc_algor' */
+ EVP_CIPHER_INFO cipher;
+ int references;
+} X509_PKEY;
+
+# ifndef OPENSSL_NO_EVP
+typedef struct X509_info_st {
+ X509 *x509;
+ X509_CRL *crl;
+ X509_PKEY *x_pkey;
+ EVP_CIPHER_INFO enc_cipher;
+ int enc_len;
+ char *enc_data;
+ int references;
+} X509_INFO;
+
+DECLARE_STACK_OF(X509_INFO)
+# endif
+
+/*
+ * The next 2 structures and their 8 routines were sent to me by Pat Richard
+ * <patr@x509.com> and are used to manipulate Netscapes spki structures -
+ * useful if you are writing a CA web page
+ */
+typedef struct Netscape_spkac_st {
+ X509_PUBKEY *pubkey;
+ ASN1_IA5STRING *challenge; /* challenge sent in atlas >= PR2 */
+} NETSCAPE_SPKAC;
+
+typedef struct Netscape_spki_st {
+ NETSCAPE_SPKAC *spkac; /* signed public key and challenge */
+ X509_ALGOR *sig_algor;
+ ASN1_BIT_STRING *signature;
+} NETSCAPE_SPKI;
+
+/* Netscape certificate sequence structure */
+typedef struct Netscape_certificate_sequence {
+ ASN1_OBJECT *type;
+ STACK_OF(X509) *certs;
+} NETSCAPE_CERT_SEQUENCE;
+
+/*- Unused (and iv length is wrong)
+typedef struct CBCParameter_st
+ {
+ unsigned char iv[8];
+ } CBC_PARAM;
+*/
+
+/* Password based encryption structure */
+
+typedef struct PBEPARAM_st {
+ ASN1_OCTET_STRING *salt;
+ ASN1_INTEGER *iter;
+} PBEPARAM;
+
+/* Password based encryption V2 structures */
+
+typedef struct PBE2PARAM_st {
+ X509_ALGOR *keyfunc;
+ X509_ALGOR *encryption;
+} PBE2PARAM;
+
+typedef struct PBKDF2PARAM_st {
+/* Usually OCTET STRING but could be anything */
+ ASN1_TYPE *salt;
+ ASN1_INTEGER *iter;
+ ASN1_INTEGER *keylength;
+ X509_ALGOR *prf;
+} PBKDF2PARAM;
+
+/* PKCS#8 private key info structure */
+
+struct pkcs8_priv_key_info_st {
+ /* Flag for various broken formats */
+ int broken;
+# define PKCS8_OK 0
+# define PKCS8_NO_OCTET 1
+# define PKCS8_EMBEDDED_PARAM 2
+# define PKCS8_NS_DB 3
+# define PKCS8_NEG_PRIVKEY 4
+ ASN1_INTEGER *version;
+ X509_ALGOR *pkeyalg;
+ /* Should be OCTET STRING but some are broken */
+ ASN1_TYPE *pkey;
+ STACK_OF(X509_ATTRIBUTE) *attributes;
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+# include <openssl/x509_vfy.h>
+# include <openssl/pkcs7.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# define X509_EXT_PACK_UNKNOWN 1
+# define X509_EXT_PACK_STRING 2
+
+# define X509_get_version(x) ASN1_INTEGER_get((x)->cert_info->version)
+/* #define X509_get_serialNumber(x) ((x)->cert_info->serialNumber) */
+# define X509_get_notBefore(x) ((x)->cert_info->validity->notBefore)
+# define X509_get_notAfter(x) ((x)->cert_info->validity->notAfter)
+# define X509_extract_key(x) X509_get_pubkey(x)/*****/
+# define X509_REQ_get_version(x) ASN1_INTEGER_get((x)->req_info->version)
+# define X509_REQ_get_subject_name(x) ((x)->req_info->subject)
+# define X509_REQ_extract_key(a) X509_REQ_get_pubkey(a)
+# define X509_name_cmp(a,b) X509_NAME_cmp((a),(b))
+# define X509_get_signature_type(x) EVP_PKEY_type(OBJ_obj2nid((x)->sig_alg->algorithm))
+
+# define X509_CRL_get_version(x) ASN1_INTEGER_get((x)->crl->version)
+# define X509_CRL_get_lastUpdate(x) ((x)->crl->lastUpdate)
+# define X509_CRL_get_nextUpdate(x) ((x)->crl->nextUpdate)
+# define X509_CRL_get_issuer(x) ((x)->crl->issuer)
+# define X509_CRL_get_REVOKED(x) ((x)->crl->revoked)
+
+void X509_CRL_set_default_method(const X509_CRL_METHOD *meth);
+X509_CRL_METHOD *X509_CRL_METHOD_new(int (*crl_init) (X509_CRL *crl),
+ int (*crl_free) (X509_CRL *crl),
+ int (*crl_lookup) (X509_CRL *crl,
+ X509_REVOKED **ret,
+ ASN1_INTEGER *ser,
+ X509_NAME *issuer),
+ int (*crl_verify) (X509_CRL *crl,
+ EVP_PKEY *pk));
+void X509_CRL_METHOD_free(X509_CRL_METHOD *m);
+
+void X509_CRL_set_meth_data(X509_CRL *crl, void *dat);
+void *X509_CRL_get_meth_data(X509_CRL *crl);
+
+/*
+ * This one is only used so that a binary form can output, as in
+ * i2d_X509_NAME(X509_get_X509_PUBKEY(x),&buf)
+ */
+# define X509_get_X509_PUBKEY(x) ((x)->cert_info->key)
+
+const char *X509_verify_cert_error_string(long n);
+
+# ifndef OPENSSL_NO_EVP
+int X509_verify(X509 *a, EVP_PKEY *r);
+
+int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r);
+int X509_CRL_verify(X509_CRL *a, EVP_PKEY *r);
+int NETSCAPE_SPKI_verify(NETSCAPE_SPKI *a, EVP_PKEY *r);
+
+NETSCAPE_SPKI *NETSCAPE_SPKI_b64_decode(const char *str, int len);
+char *NETSCAPE_SPKI_b64_encode(NETSCAPE_SPKI *x);
+EVP_PKEY *NETSCAPE_SPKI_get_pubkey(NETSCAPE_SPKI *x);
+int NETSCAPE_SPKI_set_pubkey(NETSCAPE_SPKI *x, EVP_PKEY *pkey);
+
+int NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki);
+
+int X509_signature_dump(BIO *bp, const ASN1_STRING *sig, int indent);
+int X509_signature_print(BIO *bp, X509_ALGOR *alg, ASN1_STRING *sig);
+
+int X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md);
+int X509_sign_ctx(X509 *x, EVP_MD_CTX *ctx);
+int X509_http_nbio(OCSP_REQ_CTX *rctx, X509 **pcert);
+int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md);
+int X509_REQ_sign_ctx(X509_REQ *x, EVP_MD_CTX *ctx);
+int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md);
+int X509_CRL_sign_ctx(X509_CRL *x, EVP_MD_CTX *ctx);
+int X509_CRL_http_nbio(OCSP_REQ_CTX *rctx, X509_CRL **pcrl);
+int NETSCAPE_SPKI_sign(NETSCAPE_SPKI *x, EVP_PKEY *pkey, const EVP_MD *md);
+
+int X509_pubkey_digest(const X509 *data, const EVP_MD *type,
+ unsigned char *md, unsigned int *len);
+int X509_digest(const X509 *data, const EVP_MD *type,
+ unsigned char *md, unsigned int *len);
+int X509_CRL_digest(const X509_CRL *data, const EVP_MD *type,
+ unsigned char *md, unsigned int *len);
+int X509_REQ_digest(const X509_REQ *data, const EVP_MD *type,
+ unsigned char *md, unsigned int *len);
+int X509_NAME_digest(const X509_NAME *data, const EVP_MD *type,
+ unsigned char *md, unsigned int *len);
+# endif
+
+# ifndef OPENSSL_NO_FP_API
+X509 *d2i_X509_fp(FILE *fp, X509 **x509);
+int i2d_X509_fp(FILE *fp, X509 *x509);
+X509_CRL *d2i_X509_CRL_fp(FILE *fp, X509_CRL **crl);
+int i2d_X509_CRL_fp(FILE *fp, X509_CRL *crl);
+X509_REQ *d2i_X509_REQ_fp(FILE *fp, X509_REQ **req);
+int i2d_X509_REQ_fp(FILE *fp, X509_REQ *req);
+# ifndef OPENSSL_NO_RSA
+RSA *d2i_RSAPrivateKey_fp(FILE *fp, RSA **rsa);
+int i2d_RSAPrivateKey_fp(FILE *fp, RSA *rsa);
+RSA *d2i_RSAPublicKey_fp(FILE *fp, RSA **rsa);
+int i2d_RSAPublicKey_fp(FILE *fp, RSA *rsa);
+RSA *d2i_RSA_PUBKEY_fp(FILE *fp, RSA **rsa);
+int i2d_RSA_PUBKEY_fp(FILE *fp, RSA *rsa);
+# endif
+# ifndef OPENSSL_NO_DSA
+DSA *d2i_DSA_PUBKEY_fp(FILE *fp, DSA **dsa);
+int i2d_DSA_PUBKEY_fp(FILE *fp, DSA *dsa);
+DSA *d2i_DSAPrivateKey_fp(FILE *fp, DSA **dsa);
+int i2d_DSAPrivateKey_fp(FILE *fp, DSA *dsa);
+# endif
+# ifndef OPENSSL_NO_EC
+EC_KEY *d2i_EC_PUBKEY_fp(FILE *fp, EC_KEY **eckey);
+int i2d_EC_PUBKEY_fp(FILE *fp, EC_KEY *eckey);
+EC_KEY *d2i_ECPrivateKey_fp(FILE *fp, EC_KEY **eckey);
+int i2d_ECPrivateKey_fp(FILE *fp, EC_KEY *eckey);
+# endif
+X509_SIG *d2i_PKCS8_fp(FILE *fp, X509_SIG **p8);
+int i2d_PKCS8_fp(FILE *fp, X509_SIG *p8);
+PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_fp(FILE *fp,
+ PKCS8_PRIV_KEY_INFO **p8inf);
+int i2d_PKCS8_PRIV_KEY_INFO_fp(FILE *fp, PKCS8_PRIV_KEY_INFO *p8inf);
+int i2d_PKCS8PrivateKeyInfo_fp(FILE *fp, EVP_PKEY *key);
+int i2d_PrivateKey_fp(FILE *fp, EVP_PKEY *pkey);
+EVP_PKEY *d2i_PrivateKey_fp(FILE *fp, EVP_PKEY **a);
+int i2d_PUBKEY_fp(FILE *fp, EVP_PKEY *pkey);
+EVP_PKEY *d2i_PUBKEY_fp(FILE *fp, EVP_PKEY **a);
+# endif
+
+# ifndef OPENSSL_NO_BIO
+X509 *d2i_X509_bio(BIO *bp, X509 **x509);
+int i2d_X509_bio(BIO *bp, X509 *x509);
+X509_CRL *d2i_X509_CRL_bio(BIO *bp, X509_CRL **crl);
+int i2d_X509_CRL_bio(BIO *bp, X509_CRL *crl);
+X509_REQ *d2i_X509_REQ_bio(BIO *bp, X509_REQ **req);
+int i2d_X509_REQ_bio(BIO *bp, X509_REQ *req);
+# ifndef OPENSSL_NO_RSA
+RSA *d2i_RSAPrivateKey_bio(BIO *bp, RSA **rsa);
+int i2d_RSAPrivateKey_bio(BIO *bp, RSA *rsa);
+RSA *d2i_RSAPublicKey_bio(BIO *bp, RSA **rsa);
+int i2d_RSAPublicKey_bio(BIO *bp, RSA *rsa);
+RSA *d2i_RSA_PUBKEY_bio(BIO *bp, RSA **rsa);
+int i2d_RSA_PUBKEY_bio(BIO *bp, RSA *rsa);
+# endif
+# ifndef OPENSSL_NO_DSA
+DSA *d2i_DSA_PUBKEY_bio(BIO *bp, DSA **dsa);
+int i2d_DSA_PUBKEY_bio(BIO *bp, DSA *dsa);
+DSA *d2i_DSAPrivateKey_bio(BIO *bp, DSA **dsa);
+int i2d_DSAPrivateKey_bio(BIO *bp, DSA *dsa);
+# endif
+# ifndef OPENSSL_NO_EC
+EC_KEY *d2i_EC_PUBKEY_bio(BIO *bp, EC_KEY **eckey);
+int i2d_EC_PUBKEY_bio(BIO *bp, EC_KEY *eckey);
+EC_KEY *d2i_ECPrivateKey_bio(BIO *bp, EC_KEY **eckey);
+int i2d_ECPrivateKey_bio(BIO *bp, EC_KEY *eckey);
+# endif
+X509_SIG *d2i_PKCS8_bio(BIO *bp, X509_SIG **p8);
+int i2d_PKCS8_bio(BIO *bp, X509_SIG *p8);
+PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_bio(BIO *bp,
+ PKCS8_PRIV_KEY_INFO **p8inf);
+int i2d_PKCS8_PRIV_KEY_INFO_bio(BIO *bp, PKCS8_PRIV_KEY_INFO *p8inf);
+int i2d_PKCS8PrivateKeyInfo_bio(BIO *bp, EVP_PKEY *key);
+int i2d_PrivateKey_bio(BIO *bp, EVP_PKEY *pkey);
+EVP_PKEY *d2i_PrivateKey_bio(BIO *bp, EVP_PKEY **a);
+int i2d_PUBKEY_bio(BIO *bp, EVP_PKEY *pkey);
+EVP_PKEY *d2i_PUBKEY_bio(BIO *bp, EVP_PKEY **a);
+# endif
+
+X509 *X509_dup(X509 *x509);
+X509_ATTRIBUTE *X509_ATTRIBUTE_dup(X509_ATTRIBUTE *xa);
+X509_EXTENSION *X509_EXTENSION_dup(X509_EXTENSION *ex);
+X509_CRL *X509_CRL_dup(X509_CRL *crl);
+X509_REVOKED *X509_REVOKED_dup(X509_REVOKED *rev);
+X509_REQ *X509_REQ_dup(X509_REQ *req);
+X509_ALGOR *X509_ALGOR_dup(X509_ALGOR *xn);
+int X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype,
+ void *pval);
+void X509_ALGOR_get0(ASN1_OBJECT **paobj, int *pptype, void **ppval,
+ X509_ALGOR *algor);
+void X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md);
+int X509_ALGOR_cmp(const X509_ALGOR *a, const X509_ALGOR *b);
+
+X509_NAME *X509_NAME_dup(X509_NAME *xn);
+X509_NAME_ENTRY *X509_NAME_ENTRY_dup(X509_NAME_ENTRY *ne);
+
+int X509_cmp_time(const ASN1_TIME *s, time_t *t);
+int X509_cmp_current_time(const ASN1_TIME *s);
+ASN1_TIME *X509_time_adj(ASN1_TIME *s, long adj, time_t *t);
+ASN1_TIME *X509_time_adj_ex(ASN1_TIME *s,
+ int offset_day, long offset_sec, time_t *t);
+ASN1_TIME *X509_gmtime_adj(ASN1_TIME *s, long adj);
+
+const char *X509_get_default_cert_area(void);
+const char *X509_get_default_cert_dir(void);
+const char *X509_get_default_cert_file(void);
+const char *X509_get_default_cert_dir_env(void);
+const char *X509_get_default_cert_file_env(void);
+const char *X509_get_default_private_dir(void);
+
+X509_REQ *X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md);
+X509 *X509_REQ_to_X509(X509_REQ *r, int days, EVP_PKEY *pkey);
+
+DECLARE_ASN1_FUNCTIONS(X509_ALGOR)
+DECLARE_ASN1_ENCODE_FUNCTIONS(X509_ALGORS, X509_ALGORS, X509_ALGORS)
+DECLARE_ASN1_FUNCTIONS(X509_VAL)
+
+DECLARE_ASN1_FUNCTIONS(X509_PUBKEY)
+
+int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey);
+EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key);
+int X509_get_pubkey_parameters(EVP_PKEY *pkey, STACK_OF(X509) *chain);
+int i2d_PUBKEY(EVP_PKEY *a, unsigned char **pp);
+EVP_PKEY *d2i_PUBKEY(EVP_PKEY **a, const unsigned char **pp, long length);
+# ifndef OPENSSL_NO_RSA
+int i2d_RSA_PUBKEY(RSA *a, unsigned char **pp);
+RSA *d2i_RSA_PUBKEY(RSA **a, const unsigned char **pp, long length);
+# endif
+# ifndef OPENSSL_NO_DSA
+int i2d_DSA_PUBKEY(DSA *a, unsigned char **pp);
+DSA *d2i_DSA_PUBKEY(DSA **a, const unsigned char **pp, long length);
+# endif
+# ifndef OPENSSL_NO_EC
+int i2d_EC_PUBKEY(EC_KEY *a, unsigned char **pp);
+EC_KEY *d2i_EC_PUBKEY(EC_KEY **a, const unsigned char **pp, long length);
+# endif
+
+DECLARE_ASN1_FUNCTIONS(X509_SIG)
+DECLARE_ASN1_FUNCTIONS(X509_REQ_INFO)
+DECLARE_ASN1_FUNCTIONS(X509_REQ)
+
+DECLARE_ASN1_FUNCTIONS(X509_ATTRIBUTE)
+X509_ATTRIBUTE *X509_ATTRIBUTE_create(int nid, int atrtype, void *value);
+
+DECLARE_ASN1_FUNCTIONS(X509_EXTENSION)
+DECLARE_ASN1_ENCODE_FUNCTIONS(X509_EXTENSIONS, X509_EXTENSIONS, X509_EXTENSIONS)
+
+DECLARE_ASN1_FUNCTIONS(X509_NAME_ENTRY)
+
+DECLARE_ASN1_FUNCTIONS(X509_NAME)
+
+int X509_NAME_set(X509_NAME **xn, X509_NAME *name);
+
+DECLARE_ASN1_FUNCTIONS(X509_CINF)
+
+DECLARE_ASN1_FUNCTIONS(X509)
+DECLARE_ASN1_FUNCTIONS(X509_CERT_AUX)
+
+DECLARE_ASN1_FUNCTIONS(X509_CERT_PAIR)
+
+int X509_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
+ CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
+int X509_set_ex_data(X509 *r, int idx, void *arg);
+void *X509_get_ex_data(X509 *r, int idx);
+int i2d_X509_AUX(X509 *a, unsigned char **pp);
+X509 *d2i_X509_AUX(X509 **a, const unsigned char **pp, long length);
+
+int i2d_re_X509_tbs(X509 *x, unsigned char **pp);
+
+void X509_get0_signature(ASN1_BIT_STRING **psig, X509_ALGOR **palg,
+ const X509 *x);
+int X509_get_signature_nid(const X509 *x);
+
+int X509_alias_set1(X509 *x, unsigned char *name, int len);
+int X509_keyid_set1(X509 *x, unsigned char *id, int len);
+unsigned char *X509_alias_get0(X509 *x, int *len);
+unsigned char *X509_keyid_get0(X509 *x, int *len);
+int (*X509_TRUST_set_default(int (*trust) (int, X509 *, int))) (int, X509 *,
+ int);
+int X509_TRUST_set(int *t, int trust);
+int X509_add1_trust_object(X509 *x, ASN1_OBJECT *obj);
+int X509_add1_reject_object(X509 *x, ASN1_OBJECT *obj);
+void X509_trust_clear(X509 *x);
+void X509_reject_clear(X509 *x);
+
+DECLARE_ASN1_FUNCTIONS(X509_REVOKED)
+DECLARE_ASN1_FUNCTIONS(X509_CRL_INFO)
+DECLARE_ASN1_FUNCTIONS(X509_CRL)
+
+int X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev);
+int X509_CRL_get0_by_serial(X509_CRL *crl,
+ X509_REVOKED **ret, ASN1_INTEGER *serial);
+int X509_CRL_get0_by_cert(X509_CRL *crl, X509_REVOKED **ret, X509 *x);
+
+X509_PKEY *X509_PKEY_new(void);
+void X509_PKEY_free(X509_PKEY *a);
+int i2d_X509_PKEY(X509_PKEY *a, unsigned char **pp);
+X509_PKEY *d2i_X509_PKEY(X509_PKEY **a, const unsigned char **pp,
+ long length);
+
+DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKI)
+DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKAC)
+DECLARE_ASN1_FUNCTIONS(NETSCAPE_CERT_SEQUENCE)
+
+# ifndef OPENSSL_NO_EVP
+X509_INFO *X509_INFO_new(void);
+void X509_INFO_free(X509_INFO *a);
+char *X509_NAME_oneline(X509_NAME *a, char *buf, int size);
+
+int ASN1_verify(i2d_of_void *i2d, X509_ALGOR *algor1,
+ ASN1_BIT_STRING *signature, char *data, EVP_PKEY *pkey);
+
+int ASN1_digest(i2d_of_void *i2d, const EVP_MD *type, char *data,
+ unsigned char *md, unsigned int *len);
+
+int ASN1_sign(i2d_of_void *i2d, X509_ALGOR *algor1,
+ X509_ALGOR *algor2, ASN1_BIT_STRING *signature,
+ char *data, EVP_PKEY *pkey, const EVP_MD *type);
+
+int ASN1_item_digest(const ASN1_ITEM *it, const EVP_MD *type, void *data,
+ unsigned char *md, unsigned int *len);
+
+int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *algor1,
+ ASN1_BIT_STRING *signature, void *data, EVP_PKEY *pkey);
+
+int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1,
+ X509_ALGOR *algor2, ASN1_BIT_STRING *signature, void *data,
+ EVP_PKEY *pkey, const EVP_MD *type);
+int ASN1_item_sign_ctx(const ASN1_ITEM *it, X509_ALGOR *algor1,
+ X509_ALGOR *algor2, ASN1_BIT_STRING *signature,
+ void *asn, EVP_MD_CTX *ctx);
+# endif
+
+int X509_set_version(X509 *x, long version);
+int X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial);
+ASN1_INTEGER *X509_get_serialNumber(X509 *x);
+int X509_set_issuer_name(X509 *x, X509_NAME *name);
+X509_NAME *X509_get_issuer_name(X509 *a);
+int X509_set_subject_name(X509 *x, X509_NAME *name);
+X509_NAME *X509_get_subject_name(X509 *a);
+int X509_set_notBefore(X509 *x, const ASN1_TIME *tm);
+int X509_set_notAfter(X509 *x, const ASN1_TIME *tm);
+int X509_set_pubkey(X509 *x, EVP_PKEY *pkey);
+EVP_PKEY *X509_get_pubkey(X509 *x);
+ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x);
+int X509_certificate_type(X509 *x, EVP_PKEY *pubkey /* optional */ );
+
+int X509_REQ_set_version(X509_REQ *x, long version);
+int X509_REQ_set_subject_name(X509_REQ *req, X509_NAME *name);
+int X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey);
+EVP_PKEY *X509_REQ_get_pubkey(X509_REQ *req);
+int X509_REQ_extension_nid(int nid);
+int *X509_REQ_get_extension_nids(void);
+void X509_REQ_set_extension_nids(int *nids);
+STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(X509_REQ *req);
+int X509_REQ_add_extensions_nid(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts,
+ int nid);
+int X509_REQ_add_extensions(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts);
+int X509_REQ_get_attr_count(const X509_REQ *req);
+int X509_REQ_get_attr_by_NID(const X509_REQ *req, int nid, int lastpos);
+int X509_REQ_get_attr_by_OBJ(const X509_REQ *req, ASN1_OBJECT *obj,
+ int lastpos);
+X509_ATTRIBUTE *X509_REQ_get_attr(const X509_REQ *req, int loc);
+X509_ATTRIBUTE *X509_REQ_delete_attr(X509_REQ *req, int loc);
+int X509_REQ_add1_attr(X509_REQ *req, X509_ATTRIBUTE *attr);
+int X509_REQ_add1_attr_by_OBJ(X509_REQ *req,
+ const ASN1_OBJECT *obj, int type,
+ const unsigned char *bytes, int len);
+int X509_REQ_add1_attr_by_NID(X509_REQ *req,
+ int nid, int type,
+ const unsigned char *bytes, int len);
+int X509_REQ_add1_attr_by_txt(X509_REQ *req,
+ const char *attrname, int type,
+ const unsigned char *bytes, int len);
+
+int X509_CRL_set_version(X509_CRL *x, long version);
+int X509_CRL_set_issuer_name(X509_CRL *x, X509_NAME *name);
+int X509_CRL_set_lastUpdate(X509_CRL *x, const ASN1_TIME *tm);
+int X509_CRL_set_nextUpdate(X509_CRL *x, const ASN1_TIME *tm);
+int X509_CRL_sort(X509_CRL *crl);
+
+int X509_REVOKED_set_serialNumber(X509_REVOKED *x, ASN1_INTEGER *serial);
+int X509_REVOKED_set_revocationDate(X509_REVOKED *r, ASN1_TIME *tm);
+
+X509_CRL *X509_CRL_diff(X509_CRL *base, X509_CRL *newer,
+ EVP_PKEY *skey, const EVP_MD *md, unsigned int flags);
+
+int X509_REQ_check_private_key(X509_REQ *x509, EVP_PKEY *pkey);
+
+int X509_check_private_key(X509 *x509, EVP_PKEY *pkey);
+int X509_chain_check_suiteb(int *perror_depth,
+ X509 *x, STACK_OF(X509) *chain,
+ unsigned long flags);
+int X509_CRL_check_suiteb(X509_CRL *crl, EVP_PKEY *pk, unsigned long flags);
+STACK_OF(X509) *X509_chain_up_ref(STACK_OF(X509) *chain);
+
+int X509_issuer_and_serial_cmp(const X509 *a, const X509 *b);
+unsigned long X509_issuer_and_serial_hash(X509 *a);
+
+int X509_issuer_name_cmp(const X509 *a, const X509 *b);
+unsigned long X509_issuer_name_hash(X509 *a);
+
+int X509_subject_name_cmp(const X509 *a, const X509 *b);
+unsigned long X509_subject_name_hash(X509 *x);
+
+# ifndef OPENSSL_NO_MD5
+unsigned long X509_issuer_name_hash_old(X509 *a);
+unsigned long X509_subject_name_hash_old(X509 *x);
+# endif
+
+int X509_cmp(const X509 *a, const X509 *b);
+int X509_NAME_cmp(const X509_NAME *a, const X509_NAME *b);
+unsigned long X509_NAME_hash(X509_NAME *x);
+unsigned long X509_NAME_hash_old(X509_NAME *x);
+
+int X509_CRL_cmp(const X509_CRL *a, const X509_CRL *b);
+int X509_CRL_match(const X509_CRL *a, const X509_CRL *b);
+# ifndef OPENSSL_NO_FP_API
+int X509_print_ex_fp(FILE *bp, X509 *x, unsigned long nmflag,
+ unsigned long cflag);
+int X509_print_fp(FILE *bp, X509 *x);
+int X509_CRL_print_fp(FILE *bp, X509_CRL *x);
+int X509_REQ_print_fp(FILE *bp, X509_REQ *req);
+int X509_NAME_print_ex_fp(FILE *fp, X509_NAME *nm, int indent,
+ unsigned long flags);
+# endif
+
+# ifndef OPENSSL_NO_BIO
+int X509_NAME_print(BIO *bp, X509_NAME *name, int obase);
+int X509_NAME_print_ex(BIO *out, X509_NAME *nm, int indent,
+ unsigned long flags);
+int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflag,
+ unsigned long cflag);
+int X509_print(BIO *bp, X509 *x);
+int X509_ocspid_print(BIO *bp, X509 *x);
+int X509_CERT_AUX_print(BIO *bp, X509_CERT_AUX *x, int indent);
+int X509_CRL_print(BIO *bp, X509_CRL *x);
+int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflag,
+ unsigned long cflag);
+int X509_REQ_print(BIO *bp, X509_REQ *req);
+# endif
+
+int X509_NAME_entry_count(X509_NAME *name);
+int X509_NAME_get_text_by_NID(X509_NAME *name, int nid, char *buf, int len);
+int X509_NAME_get_text_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj,
+ char *buf, int len);
+
+/*
+ * NOTE: you should be passsing -1, not 0 as lastpos. The functions that use
+ * lastpos, search after that position on.
+ */
+int X509_NAME_get_index_by_NID(X509_NAME *name, int nid, int lastpos);
+int X509_NAME_get_index_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj,
+ int lastpos);
+X509_NAME_ENTRY *X509_NAME_get_entry(X509_NAME *name, int loc);
+X509_NAME_ENTRY *X509_NAME_delete_entry(X509_NAME *name, int loc);
+int X509_NAME_add_entry(X509_NAME *name, X509_NAME_ENTRY *ne,
+ int loc, int set);
+int X509_NAME_add_entry_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, int type,
+ unsigned char *bytes, int len, int loc,
+ int set);
+int X509_NAME_add_entry_by_NID(X509_NAME *name, int nid, int type,
+ unsigned char *bytes, int len, int loc,
+ int set);
+X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_txt(X509_NAME_ENTRY **ne,
+ const char *field, int type,
+ const unsigned char *bytes,
+ int len);
+X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid,
+ int type, unsigned char *bytes,
+ int len);
+int X509_NAME_add_entry_by_txt(X509_NAME *name, const char *field, int type,
+ const unsigned char *bytes, int len, int loc,
+ int set);
+X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_OBJ(X509_NAME_ENTRY **ne,
+ ASN1_OBJECT *obj, int type,
+ const unsigned char *bytes,
+ int len);
+int X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne, ASN1_OBJECT *obj);
+int X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type,
+ const unsigned char *bytes, int len);
+ASN1_OBJECT *X509_NAME_ENTRY_get_object(X509_NAME_ENTRY *ne);
+ASN1_STRING *X509_NAME_ENTRY_get_data(X509_NAME_ENTRY *ne);
+
+int X509v3_get_ext_count(const STACK_OF(X509_EXTENSION) *x);
+int X509v3_get_ext_by_NID(const STACK_OF(X509_EXTENSION) *x,
+ int nid, int lastpos);
+int X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *x,
+ ASN1_OBJECT *obj, int lastpos);
+int X509v3_get_ext_by_critical(const STACK_OF(X509_EXTENSION) *x,
+ int crit, int lastpos);
+X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc);
+X509_EXTENSION *X509v3_delete_ext(STACK_OF(X509_EXTENSION) *x, int loc);
+STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x,
+ X509_EXTENSION *ex, int loc);
+
+int X509_get_ext_count(X509 *x);
+int X509_get_ext_by_NID(X509 *x, int nid, int lastpos);
+int X509_get_ext_by_OBJ(X509 *x, ASN1_OBJECT *obj, int lastpos);
+int X509_get_ext_by_critical(X509 *x, int crit, int lastpos);
+X509_EXTENSION *X509_get_ext(X509 *x, int loc);
+X509_EXTENSION *X509_delete_ext(X509 *x, int loc);
+int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc);
+void *X509_get_ext_d2i(X509 *x, int nid, int *crit, int *idx);
+int X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit,
+ unsigned long flags);
+
+int X509_CRL_get_ext_count(X509_CRL *x);
+int X509_CRL_get_ext_by_NID(X509_CRL *x, int nid, int lastpos);
+int X509_CRL_get_ext_by_OBJ(X509_CRL *x, ASN1_OBJECT *obj, int lastpos);
+int X509_CRL_get_ext_by_critical(X509_CRL *x, int crit, int lastpos);
+X509_EXTENSION *X509_CRL_get_ext(X509_CRL *x, int loc);
+X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc);
+int X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc);
+void *X509_CRL_get_ext_d2i(X509_CRL *x, int nid, int *crit, int *idx);
+int X509_CRL_add1_ext_i2d(X509_CRL *x, int nid, void *value, int crit,
+ unsigned long flags);
+
+int X509_REVOKED_get_ext_count(X509_REVOKED *x);
+int X509_REVOKED_get_ext_by_NID(X509_REVOKED *x, int nid, int lastpos);
+int X509_REVOKED_get_ext_by_OBJ(X509_REVOKED *x, ASN1_OBJECT *obj,
+ int lastpos);
+int X509_REVOKED_get_ext_by_critical(X509_REVOKED *x, int crit, int lastpos);
+X509_EXTENSION *X509_REVOKED_get_ext(X509_REVOKED *x, int loc);
+X509_EXTENSION *X509_REVOKED_delete_ext(X509_REVOKED *x, int loc);
+int X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, int loc);
+void *X509_REVOKED_get_ext_d2i(X509_REVOKED *x, int nid, int *crit, int *idx);
+int X509_REVOKED_add1_ext_i2d(X509_REVOKED *x, int nid, void *value, int crit,
+ unsigned long flags);
+
+X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex,
+ int nid, int crit,
+ ASN1_OCTET_STRING *data);
+X509_EXTENSION *X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex,
+ ASN1_OBJECT *obj, int crit,
+ ASN1_OCTET_STRING *data);
+int X509_EXTENSION_set_object(X509_EXTENSION *ex, ASN1_OBJECT *obj);
+int X509_EXTENSION_set_critical(X509_EXTENSION *ex, int crit);
+int X509_EXTENSION_set_data(X509_EXTENSION *ex, ASN1_OCTET_STRING *data);
+ASN1_OBJECT *X509_EXTENSION_get_object(X509_EXTENSION *ex);
+ASN1_OCTET_STRING *X509_EXTENSION_get_data(X509_EXTENSION *ne);
+int X509_EXTENSION_get_critical(X509_EXTENSION *ex);
+
+int X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x);
+int X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, int nid,
+ int lastpos);
+int X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk,
+ ASN1_OBJECT *obj, int lastpos);
+X509_ATTRIBUTE *X509at_get_attr(const STACK_OF(X509_ATTRIBUTE) *x, int loc);
+X509_ATTRIBUTE *X509at_delete_attr(STACK_OF(X509_ATTRIBUTE) *x, int loc);
+STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x,
+ X509_ATTRIBUTE *attr);
+STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE)
+ **x, const ASN1_OBJECT *obj,
+ int type,
+ const unsigned char *bytes,
+ int len);
+STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE)
+ **x, int nid, int type,
+ const unsigned char *bytes,
+ int len);
+STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE)
+ **x, const char *attrname,
+ int type,
+ const unsigned char *bytes,
+ int len);
+void *X509at_get0_data_by_OBJ(STACK_OF(X509_ATTRIBUTE) *x, ASN1_OBJECT *obj,
+ int lastpos, int type);
+X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid,
+ int atrtype, const void *data,
+ int len);
+X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr,
+ const ASN1_OBJECT *obj,
+ int atrtype, const void *data,
+ int len);
+X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr,
+ const char *atrname, int type,
+ const unsigned char *bytes,
+ int len);
+int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, const ASN1_OBJECT *obj);
+int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype,
+ const void *data, int len);
+void *X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *attr, int idx, int atrtype,
+ void *data);
+int X509_ATTRIBUTE_count(X509_ATTRIBUTE *attr);
+ASN1_OBJECT *X509_ATTRIBUTE_get0_object(X509_ATTRIBUTE *attr);
+ASN1_TYPE *X509_ATTRIBUTE_get0_type(X509_ATTRIBUTE *attr, int idx);
+
+int EVP_PKEY_get_attr_count(const EVP_PKEY *key);
+int EVP_PKEY_get_attr_by_NID(const EVP_PKEY *key, int nid, int lastpos);
+int EVP_PKEY_get_attr_by_OBJ(const EVP_PKEY *key, ASN1_OBJECT *obj,
+ int lastpos);
+X509_ATTRIBUTE *EVP_PKEY_get_attr(const EVP_PKEY *key, int loc);
+X509_ATTRIBUTE *EVP_PKEY_delete_attr(EVP_PKEY *key, int loc);
+int EVP_PKEY_add1_attr(EVP_PKEY *key, X509_ATTRIBUTE *attr);
+int EVP_PKEY_add1_attr_by_OBJ(EVP_PKEY *key,
+ const ASN1_OBJECT *obj, int type,
+ const unsigned char *bytes, int len);
+int EVP_PKEY_add1_attr_by_NID(EVP_PKEY *key,
+ int nid, int type,
+ const unsigned char *bytes, int len);
+int EVP_PKEY_add1_attr_by_txt(EVP_PKEY *key,
+ const char *attrname, int type,
+ const unsigned char *bytes, int len);
+
+int X509_verify_cert(X509_STORE_CTX *ctx);
+
+/* lookup a cert from a X509 STACK */
+X509 *X509_find_by_issuer_and_serial(STACK_OF(X509) *sk, X509_NAME *name,
+ ASN1_INTEGER *serial);
+X509 *X509_find_by_subject(STACK_OF(X509) *sk, X509_NAME *name);
+
+DECLARE_ASN1_FUNCTIONS(PBEPARAM)
+DECLARE_ASN1_FUNCTIONS(PBE2PARAM)
+DECLARE_ASN1_FUNCTIONS(PBKDF2PARAM)
+
+int PKCS5_pbe_set0_algor(X509_ALGOR *algor, int alg, int iter,
+ const unsigned char *salt, int saltlen);
+
+X509_ALGOR *PKCS5_pbe_set(int alg, int iter,
+ const unsigned char *salt, int saltlen);
+X509_ALGOR *PKCS5_pbe2_set(const EVP_CIPHER *cipher, int iter,
+ unsigned char *salt, int saltlen);
+X509_ALGOR *PKCS5_pbe2_set_iv(const EVP_CIPHER *cipher, int iter,
+ unsigned char *salt, int saltlen,
+ unsigned char *aiv, int prf_nid);
+
+X509_ALGOR *PKCS5_pbkdf2_set(int iter, unsigned char *salt, int saltlen,
+ int prf_nid, int keylen);
+
+/* PKCS#8 utilities */
+
+DECLARE_ASN1_FUNCTIONS(PKCS8_PRIV_KEY_INFO)
+
+EVP_PKEY *EVP_PKCS82PKEY(PKCS8_PRIV_KEY_INFO *p8);
+PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey);
+PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8_broken(EVP_PKEY *pkey, int broken);
+PKCS8_PRIV_KEY_INFO *PKCS8_set_broken(PKCS8_PRIV_KEY_INFO *p8, int broken);
+
+int PKCS8_pkey_set0(PKCS8_PRIV_KEY_INFO *priv, ASN1_OBJECT *aobj,
+ int version, int ptype, void *pval,
+ unsigned char *penc, int penclen);
+int PKCS8_pkey_get0(ASN1_OBJECT **ppkalg,
+ const unsigned char **pk, int *ppklen,
+ X509_ALGOR **pa, PKCS8_PRIV_KEY_INFO *p8);
+
+int X509_PUBKEY_set0_param(X509_PUBKEY *pub, ASN1_OBJECT *aobj,
+ int ptype, void *pval,
+ unsigned char *penc, int penclen);
+int X509_PUBKEY_get0_param(ASN1_OBJECT **ppkalg,
+ const unsigned char **pk, int *ppklen,
+ X509_ALGOR **pa, X509_PUBKEY *pub);
+
+int X509_check_trust(X509 *x, int id, int flags);
+int X509_TRUST_get_count(void);
+X509_TRUST *X509_TRUST_get0(int idx);
+int X509_TRUST_get_by_id(int id);
+int X509_TRUST_add(int id, int flags, int (*ck) (X509_TRUST *, X509 *, int),
+ char *name, int arg1, void *arg2);
+void X509_TRUST_cleanup(void);
+int X509_TRUST_get_flags(X509_TRUST *xp);
+char *X509_TRUST_get0_name(X509_TRUST *xp);
+int X509_TRUST_get_trust(X509_TRUST *xp);
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_X509_strings(void);
+
+/* Error codes for the X509 functions. */
+
+/* Function codes. */
+# define X509_F_ADD_CERT_DIR 100
+# define X509_F_BY_FILE_CTRL 101
+# define X509_F_CHECK_POLICY 145
+# define X509_F_DIR_CTRL 102
+# define X509_F_GET_CERT_BY_SUBJECT 103
+# define X509_F_NETSCAPE_SPKI_B64_DECODE 129
+# define X509_F_NETSCAPE_SPKI_B64_ENCODE 130
+# define X509_F_X509AT_ADD1_ATTR 135
+# define X509_F_X509V3_ADD_EXT 104
+# define X509_F_X509_ATTRIBUTE_CREATE_BY_NID 136
+# define X509_F_X509_ATTRIBUTE_CREATE_BY_OBJ 137
+# define X509_F_X509_ATTRIBUTE_CREATE_BY_TXT 140
+# define X509_F_X509_ATTRIBUTE_GET0_DATA 139
+# define X509_F_X509_ATTRIBUTE_SET1_DATA 138
+# define X509_F_X509_CHECK_PRIVATE_KEY 128
+# define X509_F_X509_CRL_DIFF 105
+# define X509_F_X509_CRL_PRINT_FP 147
+# define X509_F_X509_EXTENSION_CREATE_BY_NID 108
+# define X509_F_X509_EXTENSION_CREATE_BY_OBJ 109
+# define X509_F_X509_GET_PUBKEY_PARAMETERS 110
+# define X509_F_X509_LOAD_CERT_CRL_FILE 132
+# define X509_F_X509_LOAD_CERT_FILE 111
+# define X509_F_X509_LOAD_CRL_FILE 112
+# define X509_F_X509_NAME_ADD_ENTRY 113
+# define X509_F_X509_NAME_ENTRY_CREATE_BY_NID 114
+# define X509_F_X509_NAME_ENTRY_CREATE_BY_TXT 131
+# define X509_F_X509_NAME_ENTRY_SET_OBJECT 115
+# define X509_F_X509_NAME_ONELINE 116
+# define X509_F_X509_NAME_PRINT 117
+# define X509_F_X509_PRINT_EX_FP 118
+# define X509_F_X509_PUBKEY_GET 119
+# define X509_F_X509_PUBKEY_SET 120
+# define X509_F_X509_REQ_CHECK_PRIVATE_KEY 144
+# define X509_F_X509_REQ_PRINT_EX 121
+# define X509_F_X509_REQ_PRINT_FP 122
+# define X509_F_X509_REQ_TO_X509 123
+# define X509_F_X509_STORE_ADD_CERT 124
+# define X509_F_X509_STORE_ADD_CRL 125
+# define X509_F_X509_STORE_CTX_GET1_ISSUER 146
+# define X509_F_X509_STORE_CTX_INIT 143
+# define X509_F_X509_STORE_CTX_NEW 142
+# define X509_F_X509_STORE_CTX_PURPOSE_INHERIT 134
+# define X509_F_X509_TO_X509_REQ 126
+# define X509_F_X509_TRUST_ADD 133
+# define X509_F_X509_TRUST_SET 141
+# define X509_F_X509_VERIFY_CERT 127
+
+/* Reason codes. */
+# define X509_R_AKID_MISMATCH 110
+# define X509_R_BAD_X509_FILETYPE 100
+# define X509_R_BASE64_DECODE_ERROR 118
+# define X509_R_CANT_CHECK_DH_KEY 114
+# define X509_R_CERT_ALREADY_IN_HASH_TABLE 101
+# define X509_R_CRL_ALREADY_DELTA 127
+# define X509_R_CRL_VERIFY_FAILURE 131
+# define X509_R_ERR_ASN1_LIB 102
+# define X509_R_IDP_MISMATCH 128
+# define X509_R_INVALID_DIRECTORY 113
+# define X509_R_INVALID_FIELD_NAME 119
+# define X509_R_INVALID_TRUST 123
+# define X509_R_ISSUER_MISMATCH 129
+# define X509_R_KEY_TYPE_MISMATCH 115
+# define X509_R_KEY_VALUES_MISMATCH 116
+# define X509_R_LOADING_CERT_DIR 103
+# define X509_R_LOADING_DEFAULTS 104
+# define X509_R_METHOD_NOT_SUPPORTED 124
+# define X509_R_NEWER_CRL_NOT_NEWER 132
+# define X509_R_NO_CERT_SET_FOR_US_TO_VERIFY 105
+# define X509_R_NO_CRL_NUMBER 130
+# define X509_R_PUBLIC_KEY_DECODE_ERROR 125
+# define X509_R_PUBLIC_KEY_ENCODE_ERROR 126
+# define X509_R_SHOULD_RETRY 106
+# define X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN 107
+# define X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY 108
+# define X509_R_UNKNOWN_KEY_TYPE 117
+# define X509_R_UNKNOWN_NID 109
+# define X509_R_UNKNOWN_PURPOSE_ID 121
+# define X509_R_UNKNOWN_TRUST_ID 120
+# define X509_R_UNSUPPORTED_ALGORITHM 111
+# define X509_R_WRONG_LOOKUP_TYPE 112
+# define X509_R_WRONG_TYPE 122
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/deps/openssl/openssl/include/openssl/x509_vfy.h b/deps/openssl/openssl/include/openssl/x509_vfy.h
index b897aa087bd..bd8613c62ba 100644
--- a/deps/openssl/openssl/include/openssl/x509_vfy.h
+++ b/deps/openssl/openssl/include/openssl/x509_vfy.h
@@ -1 +1,647 @@
-#include "../../crypto/x509/x509_vfy.h"
+/* crypto/x509/x509_vfy.h */
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
+#ifndef HEADER_X509_H
+# include <openssl/x509.h>
+/*
+ * openssl/x509.h ends up #include-ing this file at about the only
+ * appropriate moment.
+ */
+#endif
+
+#ifndef HEADER_X509_VFY_H
+# define HEADER_X509_VFY_H
+
+# include <openssl/opensslconf.h>
+# ifndef OPENSSL_NO_LHASH
+# include <openssl/lhash.h>
+# endif
+# include <openssl/bio.h>
+# include <openssl/crypto.h>
+# include <openssl/symhacks.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# if 0
+/* Outer object */
+typedef struct x509_hash_dir_st {
+ int num_dirs;
+ char **dirs;
+ int *dirs_type;
+ int num_dirs_alloced;
+} X509_HASH_DIR_CTX;
+# endif
+
+typedef struct x509_file_st {
+ int num_paths; /* number of paths to files or directories */
+ int num_alloced;
+ char **paths; /* the list of paths or directories */
+ int *path_type;
+} X509_CERT_FILE_CTX;
+
+/*******************************/
+/*-
+SSL_CTX -> X509_STORE
+ -> X509_LOOKUP
+ ->X509_LOOKUP_METHOD
+ -> X509_LOOKUP
+ ->X509_LOOKUP_METHOD
+
+SSL -> X509_STORE_CTX
+ ->X509_STORE
+
+The X509_STORE holds the tables etc for verification stuff.
+A X509_STORE_CTX is used while validating a single certificate.
+The X509_STORE has X509_LOOKUPs for looking up certs.
+The X509_STORE then calls a function to actually verify the
+certificate chain.
+*/
+
+# define X509_LU_RETRY -1
+# define X509_LU_FAIL 0
+# define X509_LU_X509 1
+# define X509_LU_CRL 2
+# define X509_LU_PKEY 3
+
+typedef struct x509_object_st {
+ /* one of the above types */
+ int type;
+ union {
+ char *ptr;
+ X509 *x509;
+ X509_CRL *crl;
+ EVP_PKEY *pkey;
+ } data;
+} X509_OBJECT;
+
+typedef struct x509_lookup_st X509_LOOKUP;
+
+DECLARE_STACK_OF(X509_LOOKUP)
+DECLARE_STACK_OF(X509_OBJECT)
+
+/* This is a static that defines the function interface */
+typedef struct x509_lookup_method_st {
+ const char *name;
+ int (*new_item) (X509_LOOKUP *ctx);
+ void (*free) (X509_LOOKUP *ctx);
+ int (*init) (X509_LOOKUP *ctx);
+ int (*shutdown) (X509_LOOKUP *ctx);
+ int (*ctrl) (X509_LOOKUP *ctx, int cmd, const char *argc, long argl,
+ char **ret);
+ int (*get_by_subject) (X509_LOOKUP *ctx, int type, X509_NAME *name,
+ X509_OBJECT *ret);
+ int (*get_by_issuer_serial) (X509_LOOKUP *ctx, int type, X509_NAME *name,
+ ASN1_INTEGER *serial, X509_OBJECT *ret);
+ int (*get_by_fingerprint) (X509_LOOKUP *ctx, int type,
+ unsigned char *bytes, int len,
+ X509_OBJECT *ret);
+ int (*get_by_alias) (X509_LOOKUP *ctx, int type, char *str, int len,
+ X509_OBJECT *ret);
+} X509_LOOKUP_METHOD;
+
+typedef struct X509_VERIFY_PARAM_ID_st X509_VERIFY_PARAM_ID;
+
+/*
+ * This structure hold all parameters associated with a verify operation by
+ * including an X509_VERIFY_PARAM structure in related structures the
+ * parameters used can be customized
+ */
+
+typedef struct X509_VERIFY_PARAM_st {
+ char *name;
+ time_t check_time; /* Time to use */
+ unsigned long inh_flags; /* Inheritance flags */
+ unsigned long flags; /* Various verify flags */
+ int purpose; /* purpose to check untrusted certificates */
+ int trust; /* trust setting to check */
+ int depth; /* Verify depth */
+ STACK_OF(ASN1_OBJECT) *policies; /* Permissible policies */
+ X509_VERIFY_PARAM_ID *id; /* opaque ID data */
+} X509_VERIFY_PARAM;
+
+DECLARE_STACK_OF(X509_VERIFY_PARAM)
+
+/*
+ * This is used to hold everything. It is used for all certificate
+ * validation. Once we have a certificate chain, the 'verify' function is
+ * then called to actually check the cert chain.
+ */
+struct x509_store_st {
+ /* The following is a cache of trusted certs */
+ int cache; /* if true, stash any hits */
+ STACK_OF(X509_OBJECT) *objs; /* Cache of all objects */
+ /* These are external lookup methods */
+ STACK_OF(X509_LOOKUP) *get_cert_methods;
+ X509_VERIFY_PARAM *param;
+ /* Callbacks for various operations */
+ /* called to verify a certificate */
+ int (*verify) (X509_STORE_CTX *ctx);
+ /* error callback */
+ int (*verify_cb) (int ok, X509_STORE_CTX *ctx);
+ /* get issuers cert from ctx */
+ int (*get_issuer) (X509 **issuer, X509_STORE_CTX *ctx, X509 *x);
+ /* check issued */
+ int (*check_issued) (X509_STORE_CTX *ctx, X509 *x, X509 *issuer);
+ /* Check revocation status of chain */
+ int (*check_revocation) (X509_STORE_CTX *ctx);
+ /* retrieve CRL */
+ int (*get_crl) (X509_STORE_CTX *ctx, X509_CRL **crl, X509 *x);
+ /* Check CRL validity */
+ int (*check_crl) (X509_STORE_CTX *ctx, X509_CRL *crl);
+ /* Check certificate against CRL */
+ int (*cert_crl) (X509_STORE_CTX *ctx, X509_CRL *crl, X509 *x);
+ STACK_OF(X509) *(*lookup_certs) (X509_STORE_CTX *ctx, X509_NAME *nm);
+ STACK_OF(X509_CRL) *(*lookup_crls) (X509_STORE_CTX *ctx, X509_NAME *nm);
+ int (*cleanup) (X509_STORE_CTX *ctx);
+ CRYPTO_EX_DATA ex_data;
+ int references;
+} /* X509_STORE */ ;
+
+int X509_STORE_set_depth(X509_STORE *store, int depth);
+
+# define X509_STORE_set_verify_cb_func(ctx,func) ((ctx)->verify_cb=(func))
+# define X509_STORE_set_verify_func(ctx,func) ((ctx)->verify=(func))
+
+/* This is the functions plus an instance of the local variables. */
+struct x509_lookup_st {
+ int init; /* have we been started */
+ int skip; /* don't use us. */
+ X509_LOOKUP_METHOD *method; /* the functions */
+ char *method_data; /* method data */
+ X509_STORE *store_ctx; /* who owns us */
+} /* X509_LOOKUP */ ;
+
+/*
+ * This is a used when verifying cert chains. Since the gathering of the
+ * cert chain can take some time (and have to be 'retried', this needs to be
+ * kept and passed around.
+ */
+struct x509_store_ctx_st { /* X509_STORE_CTX */
+ X509_STORE *ctx;
+ /* used when looking up certs */
+ int current_method;
+ /* The following are set by the caller */
+ /* The cert to check */
+ X509 *cert;
+ /* chain of X509s - untrusted - passed in */
+ STACK_OF(X509) *untrusted;
+ /* set of CRLs passed in */
+ STACK_OF(X509_CRL) *crls;
+ X509_VERIFY_PARAM *param;
+ /* Other info for use with get_issuer() */
+ void *other_ctx;
+ /* Callbacks for various operations */
+ /* called to verify a certificate */
+ int (*verify) (X509_STORE_CTX *ctx);
+ /* error callback */
+ int (*verify_cb) (int ok, X509_STORE_CTX *ctx);
+ /* get issuers cert from ctx */
+ int (*get_issuer) (X509 **issuer, X509_STORE_CTX *ctx, X509 *x);
+ /* check issued */
+ int (*check_issued) (X509_STORE_CTX *ctx, X509 *x, X509 *issuer);
+ /* Check revocation status of chain */
+ int (*check_revocation) (X509_STORE_CTX *ctx);
+ /* retrieve CRL */
+ int (*get_crl) (X509_STORE_CTX *ctx, X509_CRL **crl, X509 *x);
+ /* Check CRL validity */
+ int (*check_crl) (X509_STORE_CTX *ctx, X509_CRL *crl);
+ /* Check certificate against CRL */
+ int (*cert_crl) (X509_STORE_CTX *ctx, X509_CRL *crl, X509 *x);
+ int (*check_policy) (X509_STORE_CTX *ctx);
+ STACK_OF(X509) *(*lookup_certs) (X509_STORE_CTX *ctx, X509_NAME *nm);
+ STACK_OF(X509_CRL) *(*lookup_crls) (X509_STORE_CTX *ctx, X509_NAME *nm);
+ int (*cleanup) (X509_STORE_CTX *ctx);
+ /* The following is built up */
+ /* if 0, rebuild chain */
+ int valid;
+ /* index of last untrusted cert */
+ int last_untrusted;
+ /* chain of X509s - built up and trusted */
+ STACK_OF(X509) *chain;
+ /* Valid policy tree */
+ X509_POLICY_TREE *tree;
+ /* Require explicit policy value */
+ int explicit_policy;
+ /* When something goes wrong, this is why */
+ int error_depth;
+ int error;
+ X509 *current_cert;
+ /* cert currently being tested as valid issuer */
+ X509 *current_issuer;
+ /* current CRL */
+ X509_CRL *current_crl;
+ /* score of current CRL */
+ int current_crl_score;
+ /* Reason mask */
+ unsigned int current_reasons;
+ /* For CRL path validation: parent context */
+ X509_STORE_CTX *parent;
+ CRYPTO_EX_DATA ex_data;
+} /* X509_STORE_CTX */ ;
+
+void X509_STORE_CTX_set_depth(X509_STORE_CTX *ctx, int depth);
+
+# define X509_STORE_CTX_set_app_data(ctx,data) \
+ X509_STORE_CTX_set_ex_data(ctx,0,data)
+# define X509_STORE_CTX_get_app_data(ctx) \
+ X509_STORE_CTX_get_ex_data(ctx,0)
+
+# define X509_L_FILE_LOAD 1
+# define X509_L_ADD_DIR 2
+
+# define X509_LOOKUP_load_file(x,name,type) \
+ X509_LOOKUP_ctrl((x),X509_L_FILE_LOAD,(name),(long)(type),NULL)
+
+# define X509_LOOKUP_add_dir(x,name,type) \
+ X509_LOOKUP_ctrl((x),X509_L_ADD_DIR,(name),(long)(type),NULL)
+
+# define X509_V_OK 0
+/* illegal error (for uninitialized values, to avoid X509_V_OK): 1 */
+
+# define X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT 2
+# define X509_V_ERR_UNABLE_TO_GET_CRL 3
+# define X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE 4
+# define X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE 5
+# define X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY 6
+# define X509_V_ERR_CERT_SIGNATURE_FAILURE 7
+# define X509_V_ERR_CRL_SIGNATURE_FAILURE 8
+# define X509_V_ERR_CERT_NOT_YET_VALID 9
+# define X509_V_ERR_CERT_HAS_EXPIRED 10
+# define X509_V_ERR_CRL_NOT_YET_VALID 11
+# define X509_V_ERR_CRL_HAS_EXPIRED 12
+# define X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD 13
+# define X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD 14
+# define X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD 15
+# define X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD 16
+# define X509_V_ERR_OUT_OF_MEM 17
+# define X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT 18
+# define X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN 19
+# define X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY 20
+# define X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE 21
+# define X509_V_ERR_CERT_CHAIN_TOO_LONG 22
+# define X509_V_ERR_CERT_REVOKED 23
+# define X509_V_ERR_INVALID_CA 24
+# define X509_V_ERR_PATH_LENGTH_EXCEEDED 25
+# define X509_V_ERR_INVALID_PURPOSE 26
+# define X509_V_ERR_CERT_UNTRUSTED 27
+# define X509_V_ERR_CERT_REJECTED 28
+/* These are 'informational' when looking for issuer cert */
+# define X509_V_ERR_SUBJECT_ISSUER_MISMATCH 29
+# define X509_V_ERR_AKID_SKID_MISMATCH 30
+# define X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH 31
+# define X509_V_ERR_KEYUSAGE_NO_CERTSIGN 32
+
+# define X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER 33
+# define X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION 34
+# define X509_V_ERR_KEYUSAGE_NO_CRL_SIGN 35
+# define X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION 36
+# define X509_V_ERR_INVALID_NON_CA 37
+# define X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED 38
+# define X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE 39
+# define X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED 40
+
+# define X509_V_ERR_INVALID_EXTENSION 41
+# define X509_V_ERR_INVALID_POLICY_EXTENSION 42
+# define X509_V_ERR_NO_EXPLICIT_POLICY 43
+# define X509_V_ERR_DIFFERENT_CRL_SCOPE 44
+# define X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE 45
+
+# define X509_V_ERR_UNNESTED_RESOURCE 46
+
+# define X509_V_ERR_PERMITTED_VIOLATION 47
+# define X509_V_ERR_EXCLUDED_VIOLATION 48
+# define X509_V_ERR_SUBTREE_MINMAX 49
+# define X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE 51
+# define X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX 52
+# define X509_V_ERR_UNSUPPORTED_NAME_SYNTAX 53
+# define X509_V_ERR_CRL_PATH_VALIDATION_ERROR 54
+
+/* Suite B mode algorithm violation */
+# define X509_V_ERR_SUITE_B_INVALID_VERSION 56
+# define X509_V_ERR_SUITE_B_INVALID_ALGORITHM 57
+# define X509_V_ERR_SUITE_B_INVALID_CURVE 58
+# define X509_V_ERR_SUITE_B_INVALID_SIGNATURE_ALGORITHM 59
+# define X509_V_ERR_SUITE_B_LOS_NOT_ALLOWED 60
+# define X509_V_ERR_SUITE_B_CANNOT_SIGN_P_384_WITH_P_256 61
+
+/* Host, email and IP check errors */
+# define X509_V_ERR_HOSTNAME_MISMATCH 62
+# define X509_V_ERR_EMAIL_MISMATCH 63
+# define X509_V_ERR_IP_ADDRESS_MISMATCH 64
+
+/* The application is not happy */
+# define X509_V_ERR_APPLICATION_VERIFICATION 50
+
+/* Certificate verify flags */
+
+/* Send issuer+subject checks to verify_cb */
+# define X509_V_FLAG_CB_ISSUER_CHECK 0x1
+/* Use check time instead of current time */
+# define X509_V_FLAG_USE_CHECK_TIME 0x2
+/* Lookup CRLs */
+# define X509_V_FLAG_CRL_CHECK 0x4
+/* Lookup CRLs for whole chain */
+# define X509_V_FLAG_CRL_CHECK_ALL 0x8
+/* Ignore unhandled critical extensions */
+# define X509_V_FLAG_IGNORE_CRITICAL 0x10
+/* Disable workarounds for broken certificates */
+# define X509_V_FLAG_X509_STRICT 0x20
+/* Enable proxy certificate validation */
+# define X509_V_FLAG_ALLOW_PROXY_CERTS 0x40
+/* Enable policy checking */
+# define X509_V_FLAG_POLICY_CHECK 0x80
+/* Policy variable require-explicit-policy */
+# define X509_V_FLAG_EXPLICIT_POLICY 0x100
+/* Policy variable inhibit-any-policy */
+# define X509_V_FLAG_INHIBIT_ANY 0x200
+/* Policy variable inhibit-policy-mapping */
+# define X509_V_FLAG_INHIBIT_MAP 0x400
+/* Notify callback that policy is OK */
+# define X509_V_FLAG_NOTIFY_POLICY 0x800
+/* Extended CRL features such as indirect CRLs, alternate CRL signing keys */
+# define X509_V_FLAG_EXTENDED_CRL_SUPPORT 0x1000
+/* Delta CRL support */
+# define X509_V_FLAG_USE_DELTAS 0x2000
+/* Check selfsigned CA signature */
+# define X509_V_FLAG_CHECK_SS_SIGNATURE 0x4000
+/* Use trusted store first */
+# define X509_V_FLAG_TRUSTED_FIRST 0x8000
+/* Suite B 128 bit only mode: not normally used */
+# define X509_V_FLAG_SUITEB_128_LOS_ONLY 0x10000
+/* Suite B 192 bit only mode */
+# define X509_V_FLAG_SUITEB_192_LOS 0x20000
+/* Suite B 128 bit mode allowing 192 bit algorithms */
+# define X509_V_FLAG_SUITEB_128_LOS 0x30000
+
+/* Allow partial chains if at least one certificate is in trusted store */
+# define X509_V_FLAG_PARTIAL_CHAIN 0x80000
+/*
+ * If the initial chain is not trusted, do not attempt to build an alternative
+ * chain. Alternate chain checking was introduced in 1.0.2b. Setting this flag
+ * will force the behaviour to match that of previous versions.
+ */
+# define X509_V_FLAG_NO_ALT_CHAINS 0x100000
+
+# define X509_VP_FLAG_DEFAULT 0x1
+# define X509_VP_FLAG_OVERWRITE 0x2
+# define X509_VP_FLAG_RESET_FLAGS 0x4
+# define X509_VP_FLAG_LOCKED 0x8
+# define X509_VP_FLAG_ONCE 0x10
+
+/* Internal use: mask of policy related options */
+# define X509_V_FLAG_POLICY_MASK (X509_V_FLAG_POLICY_CHECK \
+ | X509_V_FLAG_EXPLICIT_POLICY \
+ | X509_V_FLAG_INHIBIT_ANY \
+ | X509_V_FLAG_INHIBIT_MAP)
+
+int X509_OBJECT_idx_by_subject(STACK_OF(X509_OBJECT) *h, int type,
+ X509_NAME *name);
+X509_OBJECT *X509_OBJECT_retrieve_by_subject(STACK_OF(X509_OBJECT) *h,
+ int type, X509_NAME *name);
+X509_OBJECT *X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h,
+ X509_OBJECT *x);
+void X509_OBJECT_up_ref_count(X509_OBJECT *a);
+void X509_OBJECT_free_contents(X509_OBJECT *a);
+X509_STORE *X509_STORE_new(void);
+void X509_STORE_free(X509_STORE *v);
+
+STACK_OF(X509) *X509_STORE_get1_certs(X509_STORE_CTX *st, X509_NAME *nm);
+STACK_OF(X509_CRL) *X509_STORE_get1_crls(X509_STORE_CTX *st, X509_NAME *nm);
+int X509_STORE_set_flags(X509_STORE *ctx, unsigned long flags);
+int X509_STORE_set_purpose(X509_STORE *ctx, int purpose);
+int X509_STORE_set_trust(X509_STORE *ctx, int trust);
+int X509_STORE_set1_param(X509_STORE *ctx, X509_VERIFY_PARAM *pm);
+
+void X509_STORE_set_verify_cb(X509_STORE *ctx,
+ int (*verify_cb) (int, X509_STORE_CTX *));
+
+void X509_STORE_set_lookup_crls_cb(X509_STORE *ctx,
+ STACK_OF(X509_CRL) *(*cb) (X509_STORE_CTX
+ *ctx,
+ X509_NAME *nm));
+
+X509_STORE_CTX *X509_STORE_CTX_new(void);
+
+int X509_STORE_CTX_get1_issuer(X509 **issuer, X509_STORE_CTX *ctx, X509 *x);
+
+void X509_STORE_CTX_free(X509_STORE_CTX *ctx);
+int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store,
+ X509 *x509, STACK_OF(X509) *chain);
+void X509_STORE_CTX_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk);
+void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx);
+
+X509_STORE *X509_STORE_CTX_get0_store(X509_STORE_CTX *ctx);
+
+X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m);
+
+X509_LOOKUP_METHOD *X509_LOOKUP_hash_dir(void);
+X509_LOOKUP_METHOD *X509_LOOKUP_file(void);
+
+int X509_STORE_add_cert(X509_STORE *ctx, X509 *x);
+int X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x);
+
+int X509_STORE_get_by_subject(X509_STORE_CTX *vs, int type, X509_NAME *name,
+ X509_OBJECT *ret);
+
+int X509_LOOKUP_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc,
+ long argl, char **ret);
+
+# ifndef OPENSSL_NO_STDIO
+int X509_load_cert_file(X509_LOOKUP *ctx, const char *file, int type);
+int X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type);
+int X509_load_cert_crl_file(X509_LOOKUP *ctx, const char *file, int type);
+# endif
+
+X509_LOOKUP *X509_LOOKUP_new(X509_LOOKUP_METHOD *method);
+void X509_LOOKUP_free(X509_LOOKUP *ctx);
+int X509_LOOKUP_init(X509_LOOKUP *ctx);
+int X509_LOOKUP_by_subject(X509_LOOKUP *ctx, int type, X509_NAME *name,
+ X509_OBJECT *ret);
+int X509_LOOKUP_by_issuer_serial(X509_LOOKUP *ctx, int type, X509_NAME *name,
+ ASN1_INTEGER *serial, X509_OBJECT *ret);
+int X509_LOOKUP_by_fingerprint(X509_LOOKUP *ctx, int type,
+ unsigned char *bytes, int len,
+ X509_OBJECT *ret);
+int X509_LOOKUP_by_alias(X509_LOOKUP *ctx, int type, char *str, int len,
+ X509_OBJECT *ret);
+int X509_LOOKUP_shutdown(X509_LOOKUP *ctx);
+
+# ifndef OPENSSL_NO_STDIO
+int X509_STORE_load_locations(X509_STORE *ctx,
+ const char *file, const char *dir);
+int X509_STORE_set_default_paths(X509_STORE *ctx);
+# endif
+
+int X509_STORE_CTX_get_ex_new_index(long argl, void *argp,
+ CRYPTO_EX_new *new_func,
+ CRYPTO_EX_dup *dup_func,
+ CRYPTO_EX_free *free_func);
+int X509_STORE_CTX_set_ex_data(X509_STORE_CTX *ctx, int idx, void *data);
+void *X509_STORE_CTX_get_ex_data(X509_STORE_CTX *ctx, int idx);
+int X509_STORE_CTX_get_error(X509_STORE_CTX *ctx);
+void X509_STORE_CTX_set_error(X509_STORE_CTX *ctx, int s);
+int X509_STORE_CTX_get_error_depth(X509_STORE_CTX *ctx);
+X509 *X509_STORE_CTX_get_current_cert(X509_STORE_CTX *ctx);
+X509 *X509_STORE_CTX_get0_current_issuer(X509_STORE_CTX *ctx);
+X509_CRL *X509_STORE_CTX_get0_current_crl(X509_STORE_CTX *ctx);
+X509_STORE_CTX *X509_STORE_CTX_get0_parent_ctx(X509_STORE_CTX *ctx);
+STACK_OF(X509) *X509_STORE_CTX_get_chain(X509_STORE_CTX *ctx);
+STACK_OF(X509) *X509_STORE_CTX_get1_chain(X509_STORE_CTX *ctx);
+void X509_STORE_CTX_set_cert(X509_STORE_CTX *c, X509 *x);
+void X509_STORE_CTX_set_chain(X509_STORE_CTX *c, STACK_OF(X509) *sk);
+void X509_STORE_CTX_set0_crls(X509_STORE_CTX *c, STACK_OF(X509_CRL) *sk);
+int X509_STORE_CTX_set_purpose(X509_STORE_CTX *ctx, int purpose);
+int X509_STORE_CTX_set_trust(X509_STORE_CTX *ctx, int trust);
+int X509_STORE_CTX_purpose_inherit(X509_STORE_CTX *ctx, int def_purpose,
+ int purpose, int trust);
+void X509_STORE_CTX_set_flags(X509_STORE_CTX *ctx, unsigned long flags);
+void X509_STORE_CTX_set_time(X509_STORE_CTX *ctx, unsigned long flags,
+ time_t t);
+void X509_STORE_CTX_set_verify_cb(X509_STORE_CTX *ctx,
+ int (*verify_cb) (int, X509_STORE_CTX *));
+
+X509_POLICY_TREE *X509_STORE_CTX_get0_policy_tree(X509_STORE_CTX *ctx);
+int X509_STORE_CTX_get_explicit_policy(X509_STORE_CTX *ctx);
+
+X509_VERIFY_PARAM *X509_STORE_CTX_get0_param(X509_STORE_CTX *ctx);
+void X509_STORE_CTX_set0_param(X509_STORE_CTX *ctx, X509_VERIFY_PARAM *param);
+int X509_STORE_CTX_set_default(X509_STORE_CTX *ctx, const char *name);
+
+/* X509_VERIFY_PARAM functions */
+
+X509_VERIFY_PARAM *X509_VERIFY_PARAM_new(void);
+void X509_VERIFY_PARAM_free(X509_VERIFY_PARAM *param);
+int X509_VERIFY_PARAM_inherit(X509_VERIFY_PARAM *to,
+ const X509_VERIFY_PARAM *from);
+int X509_VERIFY_PARAM_set1(X509_VERIFY_PARAM *to,
+ const X509_VERIFY_PARAM *from);
+int X509_VERIFY_PARAM_set1_name(X509_VERIFY_PARAM *param, const char *name);
+int X509_VERIFY_PARAM_set_flags(X509_VERIFY_PARAM *param,
+ unsigned long flags);
+int X509_VERIFY_PARAM_clear_flags(X509_VERIFY_PARAM *param,
+ unsigned long flags);
+unsigned long X509_VERIFY_PARAM_get_flags(X509_VERIFY_PARAM *param);
+int X509_VERIFY_PARAM_set_purpose(X509_VERIFY_PARAM *param, int purpose);
+int X509_VERIFY_PARAM_set_trust(X509_VERIFY_PARAM *param, int trust);
+void X509_VERIFY_PARAM_set_depth(X509_VERIFY_PARAM *param, int depth);
+void X509_VERIFY_PARAM_set_time(X509_VERIFY_PARAM *param, time_t t);
+int X509_VERIFY_PARAM_add0_policy(X509_VERIFY_PARAM *param,
+ ASN1_OBJECT *policy);
+int X509_VERIFY_PARAM_set1_policies(X509_VERIFY_PARAM *param,
+ STACK_OF(ASN1_OBJECT) *policies);
+
+int X509_VERIFY_PARAM_set1_host(X509_VERIFY_PARAM *param,
+ const char *name, size_t namelen);
+int X509_VERIFY_PARAM_add1_host(X509_VERIFY_PARAM *param,
+ const char *name, size_t namelen);
+void X509_VERIFY_PARAM_set_hostflags(X509_VERIFY_PARAM *param,
+ unsigned int flags);
+char *X509_VERIFY_PARAM_get0_peername(X509_VERIFY_PARAM *);
+int X509_VERIFY_PARAM_set1_email(X509_VERIFY_PARAM *param,
+ const char *email, size_t emaillen);
+int X509_VERIFY_PARAM_set1_ip(X509_VERIFY_PARAM *param,
+ const unsigned char *ip, size_t iplen);
+int X509_VERIFY_PARAM_set1_ip_asc(X509_VERIFY_PARAM *param,
+ const char *ipasc);
+
+int X509_VERIFY_PARAM_get_depth(const X509_VERIFY_PARAM *param);
+const char *X509_VERIFY_PARAM_get0_name(const X509_VERIFY_PARAM *param);
+
+int X509_VERIFY_PARAM_add0_table(X509_VERIFY_PARAM *param);
+int X509_VERIFY_PARAM_get_count(void);
+const X509_VERIFY_PARAM *X509_VERIFY_PARAM_get0(int id);
+const X509_VERIFY_PARAM *X509_VERIFY_PARAM_lookup(const char *name);
+void X509_VERIFY_PARAM_table_cleanup(void);
+
+int X509_policy_check(X509_POLICY_TREE **ptree, int *pexplicit_policy,
+ STACK_OF(X509) *certs,
+ STACK_OF(ASN1_OBJECT) *policy_oids, unsigned int flags);
+
+void X509_policy_tree_free(X509_POLICY_TREE *tree);
+
+int X509_policy_tree_level_count(const X509_POLICY_TREE *tree);
+X509_POLICY_LEVEL *X509_policy_tree_get0_level(const X509_POLICY_TREE *tree,
+ int i);
+
+STACK_OF(X509_POLICY_NODE) *X509_policy_tree_get0_policies(const
+ X509_POLICY_TREE
+ *tree);
+
+STACK_OF(X509_POLICY_NODE) *X509_policy_tree_get0_user_policies(const
+ X509_POLICY_TREE
+ *tree);
+
+int X509_policy_level_node_count(X509_POLICY_LEVEL *level);
+
+X509_POLICY_NODE *X509_policy_level_get0_node(X509_POLICY_LEVEL *level,
+ int i);
+
+const ASN1_OBJECT *X509_policy_node_get0_policy(const X509_POLICY_NODE *node);
+
+STACK_OF(POLICYQUALINFO) *X509_policy_node_get0_qualifiers(const
+ X509_POLICY_NODE
+ *node);
+const X509_POLICY_NODE *X509_policy_node_get0_parent(const X509_POLICY_NODE
+ *node);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/deps/openssl/openssl/include/openssl/x509v3.h b/deps/openssl/openssl/include/openssl/x509v3.h
index 363795e55a2..f5c61560aa1 100644
--- a/deps/openssl/openssl/include/openssl/x509v3.h
+++ b/deps/openssl/openssl/include/openssl/x509v3.h
@@ -1 +1,1055 @@
-#include "../../crypto/x509v3/x509v3.h"
+/* x509v3.h */
+/*
+ * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project
+ * 1999.
+ */
+/* ====================================================================
+ * Copyright (c) 1999-2004 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * licensing@OpenSSL.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+#ifndef HEADER_X509V3_H
+# define HEADER_X509V3_H
+
+# include <openssl/bio.h>
+# include <openssl/x509.h>
+# include <openssl/conf.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# ifdef OPENSSL_SYS_WIN32
+/* Under Win32 these are defined in wincrypt.h */
+# undef X509_NAME
+# undef X509_CERT_PAIR
+# undef X509_EXTENSIONS
+# endif
+
+/* Forward reference */
+struct v3_ext_method;
+struct v3_ext_ctx;
+
+/* Useful typedefs */
+
+typedef void *(*X509V3_EXT_NEW)(void);
+typedef void (*X509V3_EXT_FREE) (void *);
+typedef void *(*X509V3_EXT_D2I)(void *, const unsigned char **, long);
+typedef int (*X509V3_EXT_I2D) (void *, unsigned char **);
+typedef STACK_OF(CONF_VALUE) *
+ (*X509V3_EXT_I2V) (const struct v3_ext_method *method, void *ext,
+ STACK_OF(CONF_VALUE) *extlist);
+typedef void *(*X509V3_EXT_V2I)(const struct v3_ext_method *method,
+ struct v3_ext_ctx *ctx,
+ STACK_OF(CONF_VALUE) *values);
+typedef char *(*X509V3_EXT_I2S)(const struct v3_ext_method *method,
+ void *ext);
+typedef void *(*X509V3_EXT_S2I)(const struct v3_ext_method *method,
+ struct v3_ext_ctx *ctx, const char *str);
+typedef int (*X509V3_EXT_I2R) (const struct v3_ext_method *method, void *ext,
+ BIO *out, int indent);
+typedef void *(*X509V3_EXT_R2I)(const struct v3_ext_method *method,
+ struct v3_ext_ctx *ctx, const char *str);
+
+/* V3 extension structure */
+
+struct v3_ext_method {
+ int ext_nid;
+ int ext_flags;
+/* If this is set the following four fields are ignored */
+ ASN1_ITEM_EXP *it;
+/* Old style ASN1 calls */
+ X509V3_EXT_NEW ext_new;
+ X509V3_EXT_FREE ext_free;
+ X509V3_EXT_D2I d2i;
+ X509V3_EXT_I2D i2d;
+/* The following pair is used for string extensions */
+ X509V3_EXT_I2S i2s;
+ X509V3_EXT_S2I s2i;
+/* The following pair is used for multi-valued extensions */
+ X509V3_EXT_I2V i2v;
+ X509V3_EXT_V2I v2i;
+/* The following are used for raw extensions */
+ X509V3_EXT_I2R i2r;
+ X509V3_EXT_R2I r2i;
+ void *usr_data; /* Any extension specific data */
+};
+
+typedef struct X509V3_CONF_METHOD_st {
+ char *(*get_string) (void *db, char *section, char *value);
+ STACK_OF(CONF_VALUE) *(*get_section) (void *db, char *section);
+ void (*free_string) (void *db, char *string);
+ void (*free_section) (void *db, STACK_OF(CONF_VALUE) *section);
+} X509V3_CONF_METHOD;
+
+/* Context specific info */
+struct v3_ext_ctx {
+# define CTX_TEST 0x1
+ int flags;
+ X509 *issuer_cert;
+ X509 *subject_cert;
+ X509_REQ *subject_req;
+ X509_CRL *crl;
+ X509V3_CONF_METHOD *db_meth;
+ void *db;
+/* Maybe more here */
+};
+
+typedef struct v3_ext_method X509V3_EXT_METHOD;
+
+DECLARE_STACK_OF(X509V3_EXT_METHOD)
+
+/* ext_flags values */
+# define X509V3_EXT_DYNAMIC 0x1
+# define X509V3_EXT_CTX_DEP 0x2
+# define X509V3_EXT_MULTILINE 0x4
+
+typedef BIT_STRING_BITNAME ENUMERATED_NAMES;
+
+typedef struct BASIC_CONSTRAINTS_st {
+ int ca;
+ ASN1_INTEGER *pathlen;
+} BASIC_CONSTRAINTS;
+
+typedef struct PKEY_USAGE_PERIOD_st {
+ ASN1_GENERALIZEDTIME *notBefore;
+ ASN1_GENERALIZEDTIME *notAfter;
+} PKEY_USAGE_PERIOD;
+
+typedef struct otherName_st {
+ ASN1_OBJECT *type_id;
+ ASN1_TYPE *value;
+} OTHERNAME;
+
+typedef struct EDIPartyName_st {
+ ASN1_STRING *nameAssigner;
+ ASN1_STRING *partyName;
+} EDIPARTYNAME;
+
+typedef struct GENERAL_NAME_st {
+# define GEN_OTHERNAME 0
+# define GEN_EMAIL 1
+# define GEN_DNS 2
+# define GEN_X400 3
+# define GEN_DIRNAME 4
+# define GEN_EDIPARTY 5
+# define GEN_URI 6
+# define GEN_IPADD 7
+# define GEN_RID 8
+ int type;
+ union {
+ char *ptr;
+ OTHERNAME *otherName; /* otherName */
+ ASN1_IA5STRING *rfc822Name;
+ ASN1_IA5STRING *dNSName;
+ ASN1_TYPE *x400Address;
+ X509_NAME *directoryName;
+ EDIPARTYNAME *ediPartyName;
+ ASN1_IA5STRING *uniformResourceIdentifier;
+ ASN1_OCTET_STRING *iPAddress;
+ ASN1_OBJECT *registeredID;
+ /* Old names */
+ ASN1_OCTET_STRING *ip; /* iPAddress */
+ X509_NAME *dirn; /* dirn */
+ ASN1_IA5STRING *ia5; /* rfc822Name, dNSName,
+ * uniformResourceIdentifier */
+ ASN1_OBJECT *rid; /* registeredID */
+ ASN1_TYPE *other; /* x400Address */
+ } d;
+} GENERAL_NAME;
+
+typedef STACK_OF(GENERAL_NAME) GENERAL_NAMES;
+
+typedef struct ACCESS_DESCRIPTION_st {
+ ASN1_OBJECT *method;
+ GENERAL_NAME *location;
+} ACCESS_DESCRIPTION;
+
+typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS;
+
+typedef STACK_OF(ASN1_OBJECT) EXTENDED_KEY_USAGE;
+
+DECLARE_STACK_OF(GENERAL_NAME)
+DECLARE_ASN1_SET_OF(GENERAL_NAME)
+
+DECLARE_STACK_OF(ACCESS_DESCRIPTION)
+DECLARE_ASN1_SET_OF(ACCESS_DESCRIPTION)
+
+typedef struct DIST_POINT_NAME_st {
+ int type;
+ union {
+ GENERAL_NAMES *fullname;
+ STACK_OF(X509_NAME_ENTRY) *relativename;
+ } name;
+/* If relativename then this contains the full distribution point name */
+ X509_NAME *dpname;
+} DIST_POINT_NAME;
+/* All existing reasons */
+# define CRLDP_ALL_REASONS 0x807f
+
+# define CRL_REASON_NONE -1
+# define CRL_REASON_UNSPECIFIED 0
+# define CRL_REASON_KEY_COMPROMISE 1
+# define CRL_REASON_CA_COMPROMISE 2
+# define CRL_REASON_AFFILIATION_CHANGED 3
+# define CRL_REASON_SUPERSEDED 4
+# define CRL_REASON_CESSATION_OF_OPERATION 5
+# define CRL_REASON_CERTIFICATE_HOLD 6
+# define CRL_REASON_REMOVE_FROM_CRL 8
+# define CRL_REASON_PRIVILEGE_WITHDRAWN 9
+# define CRL_REASON_AA_COMPROMISE 10
+
+struct DIST_POINT_st {
+ DIST_POINT_NAME *distpoint;
+ ASN1_BIT_STRING *reasons;
+ GENERAL_NAMES *CRLissuer;
+ int dp_reasons;
+};
+
+typedef STACK_OF(DIST_POINT) CRL_DIST_POINTS;
+
+DECLARE_STACK_OF(DIST_POINT)
+DECLARE_ASN1_SET_OF(DIST_POINT)
+
+struct AUTHORITY_KEYID_st {
+ ASN1_OCTET_STRING *keyid;
+ GENERAL_NAMES *issuer;
+ ASN1_INTEGER *serial;
+};
+
+/* Strong extranet structures */
+
+typedef struct SXNET_ID_st {
+ ASN1_INTEGER *zone;
+ ASN1_OCTET_STRING *user;
+} SXNETID;
+
+DECLARE_STACK_OF(SXNETID)
+DECLARE_ASN1_SET_OF(SXNETID)
+
+typedef struct SXNET_st {
+ ASN1_INTEGER *version;
+ STACK_OF(SXNETID) *ids;
+} SXNET;
+
+typedef struct NOTICEREF_st {
+ ASN1_STRING *organization;
+ STACK_OF(ASN1_INTEGER) *noticenos;
+} NOTICEREF;
+
+typedef struct USERNOTICE_st {
+ NOTICEREF *noticeref;
+ ASN1_STRING *exptext;
+} USERNOTICE;
+
+typedef struct POLICYQUALINFO_st {
+ ASN1_OBJECT *pqualid;
+ union {
+ ASN1_IA5STRING *cpsuri;
+ USERNOTICE *usernotice;
+ ASN1_TYPE *other;
+ } d;
+} POLICYQUALINFO;
+
+DECLARE_STACK_OF(POLICYQUALINFO)
+DECLARE_ASN1_SET_OF(POLICYQUALINFO)
+
+typedef struct POLICYINFO_st {
+ ASN1_OBJECT *policyid;
+ STACK_OF(POLICYQUALINFO) *qualifiers;
+} POLICYINFO;
+
+typedef STACK_OF(POLICYINFO) CERTIFICATEPOLICIES;
+
+DECLARE_STACK_OF(POLICYINFO)
+DECLARE_ASN1_SET_OF(POLICYINFO)
+
+typedef struct POLICY_MAPPING_st {
+ ASN1_OBJECT *issuerDomainPolicy;
+ ASN1_OBJECT *subjectDomainPolicy;
+} POLICY_MAPPING;
+
+DECLARE_STACK_OF(POLICY_MAPPING)
+
+typedef STACK_OF(POLICY_MAPPING) POLICY_MAPPINGS;
+
+typedef struct GENERAL_SUBTREE_st {
+ GENERAL_NAME *base;
+ ASN1_INTEGER *minimum;
+ ASN1_INTEGER *maximum;
+} GENERAL_SUBTREE;
+
+DECLARE_STACK_OF(GENERAL_SUBTREE)
+
+struct NAME_CONSTRAINTS_st {
+ STACK_OF(GENERAL_SUBTREE) *permittedSubtrees;
+ STACK_OF(GENERAL_SUBTREE) *excludedSubtrees;
+};
+
+typedef struct POLICY_CONSTRAINTS_st {
+ ASN1_INTEGER *requireExplicitPolicy;
+ ASN1_INTEGER *inhibitPolicyMapping;
+} POLICY_CONSTRAINTS;
+
+/* Proxy certificate structures, see RFC 3820 */
+typedef struct PROXY_POLICY_st {
+ ASN1_OBJECT *policyLanguage;
+ ASN1_OCTET_STRING *policy;
+} PROXY_POLICY;
+
+typedef struct PROXY_CERT_INFO_EXTENSION_st {
+ ASN1_INTEGER *pcPathLengthConstraint;
+ PROXY_POLICY *proxyPolicy;
+} PROXY_CERT_INFO_EXTENSION;
+
+DECLARE_ASN1_FUNCTIONS(PROXY_POLICY)
+DECLARE_ASN1_FUNCTIONS(PROXY_CERT_INFO_EXTENSION)
+
+struct ISSUING_DIST_POINT_st {
+ DIST_POINT_NAME *distpoint;
+ int onlyuser;
+ int onlyCA;
+ ASN1_BIT_STRING *onlysomereasons;
+ int indirectCRL;
+ int onlyattr;
+};
+
+/* Values in idp_flags field */
+/* IDP present */
+# define IDP_PRESENT 0x1
+/* IDP values inconsistent */
+# define IDP_INVALID 0x2
+/* onlyuser true */
+# define IDP_ONLYUSER 0x4
+/* onlyCA true */
+# define IDP_ONLYCA 0x8
+/* onlyattr true */
+# define IDP_ONLYATTR 0x10
+/* indirectCRL true */
+# define IDP_INDIRECT 0x20
+/* onlysomereasons present */
+# define IDP_REASONS 0x40
+
+# define X509V3_conf_err(val) ERR_add_error_data(6, "section:", val->section, \
+",name:", val->name, ",value:", val->value);
+
+# define X509V3_set_ctx_test(ctx) \
+ X509V3_set_ctx(ctx, NULL, NULL, NULL, NULL, CTX_TEST)
+# define X509V3_set_ctx_nodb(ctx) (ctx)->db = NULL;
+
+# define EXT_BITSTRING(nid, table) { nid, 0, ASN1_ITEM_ref(ASN1_BIT_STRING), \
+ 0,0,0,0, \
+ 0,0, \
+ (X509V3_EXT_I2V)i2v_ASN1_BIT_STRING, \
+ (X509V3_EXT_V2I)v2i_ASN1_BIT_STRING, \
+ NULL, NULL, \
+ table}
+
+# define EXT_IA5STRING(nid) { nid, 0, ASN1_ITEM_ref(ASN1_IA5STRING), \
+ 0,0,0,0, \
+ (X509V3_EXT_I2S)i2s_ASN1_IA5STRING, \
+ (X509V3_EXT_S2I)s2i_ASN1_IA5STRING, \
+ 0,0,0,0, \
+ NULL}
+
+# define EXT_END { -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
+
+/* X509_PURPOSE stuff */
+
+# define EXFLAG_BCONS 0x1
+# define EXFLAG_KUSAGE 0x2
+# define EXFLAG_XKUSAGE 0x4
+# define EXFLAG_NSCERT 0x8
+
+# define EXFLAG_CA 0x10
+/* Really self issued not necessarily self signed */
+# define EXFLAG_SI 0x20
+# define EXFLAG_V1 0x40
+# define EXFLAG_INVALID 0x80
+# define EXFLAG_SET 0x100
+# define EXFLAG_CRITICAL 0x200
+# define EXFLAG_PROXY 0x400
+
+# define EXFLAG_INVALID_POLICY 0x800
+# define EXFLAG_FRESHEST 0x1000
+/* Self signed */
+# define EXFLAG_SS 0x2000
+
+# define KU_DIGITAL_SIGNATURE 0x0080
+# define KU_NON_REPUDIATION 0x0040
+# define KU_KEY_ENCIPHERMENT 0x0020
+# define KU_DATA_ENCIPHERMENT 0x0010
+# define KU_KEY_AGREEMENT 0x0008
+# define KU_KEY_CERT_SIGN 0x0004
+# define KU_CRL_SIGN 0x0002
+# define KU_ENCIPHER_ONLY 0x0001
+# define KU_DECIPHER_ONLY 0x8000
+
+# define NS_SSL_CLIENT 0x80
+# define NS_SSL_SERVER 0x40
+# define NS_SMIME 0x20
+# define NS_OBJSIGN 0x10
+# define NS_SSL_CA 0x04
+# define NS_SMIME_CA 0x02
+# define NS_OBJSIGN_CA 0x01
+# define NS_ANY_CA (NS_SSL_CA|NS_SMIME_CA|NS_OBJSIGN_CA)
+
+# define XKU_SSL_SERVER 0x1
+# define XKU_SSL_CLIENT 0x2
+# define XKU_SMIME 0x4
+# define XKU_CODE_SIGN 0x8
+# define XKU_SGC 0x10
+# define XKU_OCSP_SIGN 0x20
+# define XKU_TIMESTAMP 0x40
+# define XKU_DVCS 0x80
+# define XKU_ANYEKU 0x100
+
+# define X509_PURPOSE_DYNAMIC 0x1
+# define X509_PURPOSE_DYNAMIC_NAME 0x2
+
+typedef struct x509_purpose_st {
+ int purpose;
+ int trust; /* Default trust ID */
+ int flags;
+ int (*check_purpose) (const struct x509_purpose_st *, const X509 *, int);
+ char *name;
+ char *sname;
+ void *usr_data;
+} X509_PURPOSE;
+
+# define X509_PURPOSE_SSL_CLIENT 1
+# define X509_PURPOSE_SSL_SERVER 2
+# define X509_PURPOSE_NS_SSL_SERVER 3
+# define X509_PURPOSE_SMIME_SIGN 4
+# define X509_PURPOSE_SMIME_ENCRYPT 5
+# define X509_PURPOSE_CRL_SIGN 6
+# define X509_PURPOSE_ANY 7
+# define X509_PURPOSE_OCSP_HELPER 8
+# define X509_PURPOSE_TIMESTAMP_SIGN 9
+
+# define X509_PURPOSE_MIN 1
+# define X509_PURPOSE_MAX 9
+
+/* Flags for X509V3_EXT_print() */
+
+# define X509V3_EXT_UNKNOWN_MASK (0xfL << 16)
+/* Return error for unknown extensions */
+# define X509V3_EXT_DEFAULT 0
+/* Print error for unknown extensions */
+# define X509V3_EXT_ERROR_UNKNOWN (1L << 16)
+/* ASN1 parse unknown extensions */
+# define X509V3_EXT_PARSE_UNKNOWN (2L << 16)
+/* BIO_dump unknown extensions */
+# define X509V3_EXT_DUMP_UNKNOWN (3L << 16)
+
+/* Flags for X509V3_add1_i2d */
+
+# define X509V3_ADD_OP_MASK 0xfL
+# define X509V3_ADD_DEFAULT 0L
+# define X509V3_ADD_APPEND 1L
+# define X509V3_ADD_REPLACE 2L
+# define X509V3_ADD_REPLACE_EXISTING 3L
+# define X509V3_ADD_KEEP_EXISTING 4L
+# define X509V3_ADD_DELETE 5L
+# define X509V3_ADD_SILENT 0x10
+
+DECLARE_STACK_OF(X509_PURPOSE)
+
+DECLARE_ASN1_FUNCTIONS(BASIC_CONSTRAINTS)
+
+DECLARE_ASN1_FUNCTIONS(SXNET)
+DECLARE_ASN1_FUNCTIONS(SXNETID)
+
+int SXNET_add_id_asc(SXNET **psx, char *zone, char *user, int userlen);
+int SXNET_add_id_ulong(SXNET **psx, unsigned long lzone, char *user,
+ int userlen);
+int SXNET_add_id_INTEGER(SXNET **psx, ASN1_INTEGER *izone, char *user,
+ int userlen);
+
+ASN1_OCTET_STRING *SXNET_get_id_asc(SXNET *sx, char *zone);
+ASN1_OCTET_STRING *SXNET_get_id_ulong(SXNET *sx, unsigned long lzone);
+ASN1_OCTET_STRING *SXNET_get_id_INTEGER(SXNET *sx, ASN1_INTEGER *zone);
+
+DECLARE_ASN1_FUNCTIONS(AUTHORITY_KEYID)
+
+DECLARE_ASN1_FUNCTIONS(PKEY_USAGE_PERIOD)
+
+DECLARE_ASN1_FUNCTIONS(GENERAL_NAME)
+GENERAL_NAME *GENERAL_NAME_dup(GENERAL_NAME *a);
+int GENERAL_NAME_cmp(GENERAL_NAME *a, GENERAL_NAME *b);
+
+ASN1_BIT_STRING *v2i_ASN1_BIT_STRING(X509V3_EXT_METHOD *method,
+ X509V3_CTX *ctx,
+ STACK_OF(CONF_VALUE) *nval);
+STACK_OF(CONF_VALUE) *i2v_ASN1_BIT_STRING(X509V3_EXT_METHOD *method,
+ ASN1_BIT_STRING *bits,
+ STACK_OF(CONF_VALUE) *extlist);
+
+STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(X509V3_EXT_METHOD *method,
+ GENERAL_NAME *gen,
+ STACK_OF(CONF_VALUE) *ret);
+int GENERAL_NAME_print(BIO *out, GENERAL_NAME *gen);
+
+DECLARE_ASN1_FUNCTIONS(GENERAL_NAMES)
+
+STACK_OF(CONF_VALUE) *i2v_GENERAL_NAMES(X509V3_EXT_METHOD *method,
+ GENERAL_NAMES *gen,
+ STACK_OF(CONF_VALUE) *extlist);
+GENERAL_NAMES *v2i_GENERAL_NAMES(const X509V3_EXT_METHOD *method,
+ X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval);
+
+DECLARE_ASN1_FUNCTIONS(OTHERNAME)
+DECLARE_ASN1_FUNCTIONS(EDIPARTYNAME)
+int OTHERNAME_cmp(OTHERNAME *a, OTHERNAME *b);
+void GENERAL_NAME_set0_value(GENERAL_NAME *a, int type, void *value);
+void *GENERAL_NAME_get0_value(GENERAL_NAME *a, int *ptype);
+int GENERAL_NAME_set0_othername(GENERAL_NAME *gen,
+ ASN1_OBJECT *oid, ASN1_TYPE *value);
+int GENERAL_NAME_get0_otherName(GENERAL_NAME *gen,
+ ASN1_OBJECT **poid, ASN1_TYPE **pvalue);
+
+char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method,
+ ASN1_OCTET_STRING *ia5);
+ASN1_OCTET_STRING *s2i_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method,
+ X509V3_CTX *ctx, char *str);
+
+DECLARE_ASN1_FUNCTIONS(EXTENDED_KEY_USAGE)
+int i2a_ACCESS_DESCRIPTION(BIO *bp, ACCESS_DESCRIPTION *a);
+
+DECLARE_ASN1_FUNCTIONS(CERTIFICATEPOLICIES)
+DECLARE_ASN1_FUNCTIONS(POLICYINFO)
+DECLARE_ASN1_FUNCTIONS(POLICYQUALINFO)
+DECLARE_ASN1_FUNCTIONS(USERNOTICE)
+DECLARE_ASN1_FUNCTIONS(NOTICEREF)
+
+DECLARE_ASN1_FUNCTIONS(CRL_DIST_POINTS)
+DECLARE_ASN1_FUNCTIONS(DIST_POINT)
+DECLARE_ASN1_FUNCTIONS(DIST_POINT_NAME)
+DECLARE_ASN1_FUNCTIONS(ISSUING_DIST_POINT)
+
+int DIST_POINT_set_dpname(DIST_POINT_NAME *dpn, X509_NAME *iname);
+
+int NAME_CONSTRAINTS_check(X509 *x, NAME_CONSTRAINTS *nc);
+
+DECLARE_ASN1_FUNCTIONS(ACCESS_DESCRIPTION)
+DECLARE_ASN1_FUNCTIONS(AUTHORITY_INFO_ACCESS)
+
+DECLARE_ASN1_ITEM(POLICY_MAPPING)
+DECLARE_ASN1_ALLOC_FUNCTIONS(POLICY_MAPPING)
+DECLARE_ASN1_ITEM(POLICY_MAPPINGS)
+
+DECLARE_ASN1_ITEM(GENERAL_SUBTREE)
+DECLARE_ASN1_ALLOC_FUNCTIONS(GENERAL_SUBTREE)
+
+DECLARE_ASN1_ITEM(NAME_CONSTRAINTS)
+DECLARE_ASN1_ALLOC_FUNCTIONS(NAME_CONSTRAINTS)
+
+DECLARE_ASN1_ALLOC_FUNCTIONS(POLICY_CONSTRAINTS)
+DECLARE_ASN1_ITEM(POLICY_CONSTRAINTS)
+
+GENERAL_NAME *a2i_GENERAL_NAME(GENERAL_NAME *out,
+ const X509V3_EXT_METHOD *method,
+ X509V3_CTX *ctx, int gen_type, char *value,
+ int is_nc);
+
+# ifdef HEADER_CONF_H
+GENERAL_NAME *v2i_GENERAL_NAME(const X509V3_EXT_METHOD *method,
+ X509V3_CTX *ctx, CONF_VALUE *cnf);
+GENERAL_NAME *v2i_GENERAL_NAME_ex(GENERAL_NAME *out,
+ const X509V3_EXT_METHOD *method,
+ X509V3_CTX *ctx, CONF_VALUE *cnf,
+ int is_nc);
+void X509V3_conf_free(CONF_VALUE *val);
+
+X509_EXTENSION *X509V3_EXT_nconf_nid(CONF *conf, X509V3_CTX *ctx, int ext_nid,
+ char *value);
+X509_EXTENSION *X509V3_EXT_nconf(CONF *conf, X509V3_CTX *ctx, char *name,
+ char *value);
+int X509V3_EXT_add_nconf_sk(CONF *conf, X509V3_CTX *ctx, char *section,
+ STACK_OF(X509_EXTENSION) **sk);
+int X509V3_EXT_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section,
+ X509 *cert);
+int X509V3_EXT_REQ_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section,
+ X509_REQ *req);
+int X509V3_EXT_CRL_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section,
+ X509_CRL *crl);
+
+X509_EXTENSION *X509V3_EXT_conf_nid(LHASH_OF(CONF_VALUE) *conf,
+ X509V3_CTX *ctx, int ext_nid,
+ char *value);
+X509_EXTENSION *X509V3_EXT_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,
+ char *name, char *value);
+int X509V3_EXT_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,
+ char *section, X509 *cert);
+int X509V3_EXT_REQ_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,
+ char *section, X509_REQ *req);
+int X509V3_EXT_CRL_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,
+ char *section, X509_CRL *crl);
+
+int X509V3_add_value_bool_nf(char *name, int asn1_bool,
+ STACK_OF(CONF_VALUE) **extlist);
+int X509V3_get_value_bool(CONF_VALUE *value, int *asn1_bool);
+int X509V3_get_value_int(CONF_VALUE *value, ASN1_INTEGER **aint);
+void X509V3_set_nconf(X509V3_CTX *ctx, CONF *conf);
+void X509V3_set_conf_lhash(X509V3_CTX *ctx, LHASH_OF(CONF_VALUE) *lhash);
+# endif
+
+char *X509V3_get_string(X509V3_CTX *ctx, char *name, char *section);
+STACK_OF(CONF_VALUE) *X509V3_get_section(X509V3_CTX *ctx, char *section);
+void X509V3_string_free(X509V3_CTX *ctx, char *str);
+void X509V3_section_free(X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *section);
+void X509V3_set_ctx(X509V3_CTX *ctx, X509 *issuer, X509 *subject,
+ X509_REQ *req, X509_CRL *crl, int flags);
+
+int X509V3_add_value(const char *name, const char *value,
+ STACK_OF(CONF_VALUE) **extlist);
+int X509V3_add_value_uchar(const char *name, const unsigned char *value,
+ STACK_OF(CONF_VALUE) **extlist);
+int X509V3_add_value_bool(const char *name, int asn1_bool,
+ STACK_OF(CONF_VALUE) **extlist);
+int X509V3_add_value_int(const char *name, ASN1_INTEGER *aint,
+ STACK_OF(CONF_VALUE) **extlist);
+char *i2s_ASN1_INTEGER(X509V3_EXT_METHOD *meth, ASN1_INTEGER *aint);
+ASN1_INTEGER *s2i_ASN1_INTEGER(X509V3_EXT_METHOD *meth, char *value);
+char *i2s_ASN1_ENUMERATED(X509V3_EXT_METHOD *meth, ASN1_ENUMERATED *aint);
+char *i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *meth,
+ ASN1_ENUMERATED *aint);
+int X509V3_EXT_add(X509V3_EXT_METHOD *ext);
+int X509V3_EXT_add_list(X509V3_EXT_METHOD *extlist);
+int X509V3_EXT_add_alias(int nid_to, int nid_from);
+void X509V3_EXT_cleanup(void);
+
+const X509V3_EXT_METHOD *X509V3_EXT_get(X509_EXTENSION *ext);
+const X509V3_EXT_METHOD *X509V3_EXT_get_nid(int nid);
+int X509V3_add_standard_extensions(void);
+STACK_OF(CONF_VALUE) *X509V3_parse_list(const char *line);
+void *X509V3_EXT_d2i(X509_EXTENSION *ext);
+void *X509V3_get_d2i(STACK_OF(X509_EXTENSION) *x, int nid, int *crit,
+ int *idx);
+int X509V3_EXT_free(int nid, void *ext_data);
+
+X509_EXTENSION *X509V3_EXT_i2d(int ext_nid, int crit, void *ext_struc);
+int X509V3_add1_i2d(STACK_OF(X509_EXTENSION) **x, int nid, void *value,
+ int crit, unsigned long flags);
+
+char *hex_to_string(const unsigned char *buffer, long len);
+unsigned char *string_to_hex(const char *str, long *len);
+int name_cmp(const char *name, const char *cmp);
+
+void X509V3_EXT_val_prn(BIO *out, STACK_OF(CONF_VALUE) *val, int indent,
+ int ml);
+int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, unsigned long flag,
+ int indent);
+int X509V3_EXT_print_fp(FILE *out, X509_EXTENSION *ext, int flag, int indent);
+
+int X509V3_extensions_print(BIO *out, char *title,
+ STACK_OF(X509_EXTENSION) *exts,
+ unsigned long flag, int indent);
+
+int X509_check_ca(X509 *x);
+int X509_check_purpose(X509 *x, int id, int ca);
+int X509_supported_extension(X509_EXTENSION *ex);
+int X509_PURPOSE_set(int *p, int purpose);
+int X509_check_issued(X509 *issuer, X509 *subject);
+int X509_check_akid(X509 *issuer, AUTHORITY_KEYID *akid);
+int X509_PURPOSE_get_count(void);
+X509_PURPOSE *X509_PURPOSE_get0(int idx);
+int X509_PURPOSE_get_by_sname(char *sname);
+int X509_PURPOSE_get_by_id(int id);
+int X509_PURPOSE_add(int id, int trust, int flags,
+ int (*ck) (const X509_PURPOSE *, const X509 *, int),
+ char *name, char *sname, void *arg);
+char *X509_PURPOSE_get0_name(X509_PURPOSE *xp);
+char *X509_PURPOSE_get0_sname(X509_PURPOSE *xp);
+int X509_PURPOSE_get_trust(X509_PURPOSE *xp);
+void X509_PURPOSE_cleanup(void);
+int X509_PURPOSE_get_id(X509_PURPOSE *);
+
+STACK_OF(OPENSSL_STRING) *X509_get1_email(X509 *x);
+STACK_OF(OPENSSL_STRING) *X509_REQ_get1_email(X509_REQ *x);
+void X509_email_free(STACK_OF(OPENSSL_STRING) *sk);
+STACK_OF(OPENSSL_STRING) *X509_get1_ocsp(X509 *x);
+/* Flags for X509_check_* functions */
+
+/*
+ * Always check subject name for host match even if subject alt names present
+ */
+# define X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT 0x1
+/* Disable wildcard matching for dnsName fields and common name. */
+# define X509_CHECK_FLAG_NO_WILDCARDS 0x2
+/* Wildcards must not match a partial label. */
+# define X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS 0x4
+/* Allow (non-partial) wildcards to match multiple labels. */
+# define X509_CHECK_FLAG_MULTI_LABEL_WILDCARDS 0x8
+/* Constraint verifier subdomain patterns to match a single labels. */
+# define X509_CHECK_FLAG_SINGLE_LABEL_SUBDOMAINS 0x10
+/*
+ * Match reference identifiers starting with "." to any sub-domain.
+ * This is a non-public flag, turned on implicitly when the subject
+ * reference identity is a DNS name.
+ */
+# define _X509_CHECK_FLAG_DOT_SUBDOMAINS 0x8000
+
+int X509_check_host(X509 *x, const char *chk, size_t chklen,
+ unsigned int flags, char **peername);
+int X509_check_email(X509 *x, const char *chk, size_t chklen,
+ unsigned int flags);
+int X509_check_ip(X509 *x, const unsigned char *chk, size_t chklen,
+ unsigned int flags);
+int X509_check_ip_asc(X509 *x, const char *ipasc, unsigned int flags);
+
+ASN1_OCTET_STRING *a2i_IPADDRESS(const char *ipasc);
+ASN1_OCTET_STRING *a2i_IPADDRESS_NC(const char *ipasc);
+int a2i_ipadd(unsigned char *ipout, const char *ipasc);
+int X509V3_NAME_from_section(X509_NAME *nm, STACK_OF(CONF_VALUE) *dn_sk,
+ unsigned long chtype);
+
+void X509_POLICY_NODE_print(BIO *out, X509_POLICY_NODE *node, int indent);
+DECLARE_STACK_OF(X509_POLICY_NODE)
+
+# ifndef OPENSSL_NO_RFC3779
+
+typedef struct ASRange_st {
+ ASN1_INTEGER *min, *max;
+} ASRange;
+
+# define ASIdOrRange_id 0
+# define ASIdOrRange_range 1
+
+typedef struct ASIdOrRange_st {
+ int type;
+ union {
+ ASN1_INTEGER *id;
+ ASRange *range;
+ } u;
+} ASIdOrRange;
+
+typedef STACK_OF(ASIdOrRange) ASIdOrRanges;
+DECLARE_STACK_OF(ASIdOrRange)
+
+# define ASIdentifierChoice_inherit 0
+# define ASIdentifierChoice_asIdsOrRanges 1
+
+typedef struct ASIdentifierChoice_st {
+ int type;
+ union {
+ ASN1_NULL *inherit;
+ ASIdOrRanges *asIdsOrRanges;
+ } u;
+} ASIdentifierChoice;
+
+typedef struct ASIdentifiers_st {
+ ASIdentifierChoice *asnum, *rdi;
+} ASIdentifiers;
+
+DECLARE_ASN1_FUNCTIONS(ASRange)
+DECLARE_ASN1_FUNCTIONS(ASIdOrRange)
+DECLARE_ASN1_FUNCTIONS(ASIdentifierChoice)
+DECLARE_ASN1_FUNCTIONS(ASIdentifiers)
+
+typedef struct IPAddressRange_st {
+ ASN1_BIT_STRING *min, *max;
+} IPAddressRange;
+
+# define IPAddressOrRange_addressPrefix 0
+# define IPAddressOrRange_addressRange 1
+
+typedef struct IPAddressOrRange_st {
+ int type;
+ union {
+ ASN1_BIT_STRING *addressPrefix;
+ IPAddressRange *addressRange;
+ } u;
+} IPAddressOrRange;
+
+typedef STACK_OF(IPAddressOrRange) IPAddressOrRanges;
+DECLARE_STACK_OF(IPAddressOrRange)
+
+# define IPAddressChoice_inherit 0
+# define IPAddressChoice_addressesOrRanges 1
+
+typedef struct IPAddressChoice_st {
+ int type;
+ union {
+ ASN1_NULL *inherit;
+ IPAddressOrRanges *addressesOrRanges;
+ } u;
+} IPAddressChoice;
+
+typedef struct IPAddressFamily_st {
+ ASN1_OCTET_STRING *addressFamily;
+ IPAddressChoice *ipAddressChoice;
+} IPAddressFamily;
+
+typedef STACK_OF(IPAddressFamily) IPAddrBlocks;
+DECLARE_STACK_OF(IPAddressFamily)
+
+DECLARE_ASN1_FUNCTIONS(IPAddressRange)
+DECLARE_ASN1_FUNCTIONS(IPAddressOrRange)
+DECLARE_ASN1_FUNCTIONS(IPAddressChoice)
+DECLARE_ASN1_FUNCTIONS(IPAddressFamily)
+
+/*
+ * API tag for elements of the ASIdentifer SEQUENCE.
+ */
+# define V3_ASID_ASNUM 0
+# define V3_ASID_RDI 1
+
+/*
+ * AFI values, assigned by IANA. It'd be nice to make the AFI
+ * handling code totally generic, but there are too many little things
+ * that would need to be defined for other address families for it to
+ * be worth the trouble.
+ */
+# define IANA_AFI_IPV4 1
+# define IANA_AFI_IPV6 2
+
+/*
+ * Utilities to construct and extract values from RFC3779 extensions,
+ * since some of the encodings (particularly for IP address prefixes
+ * and ranges) are a bit tedious to work with directly.
+ */
+int v3_asid_add_inherit(ASIdentifiers *asid, int which);
+int v3_asid_add_id_or_range(ASIdentifiers *asid, int which,
+ ASN1_INTEGER *min, ASN1_INTEGER *max);
+int v3_addr_add_inherit(IPAddrBlocks *addr,
+ const unsigned afi, const unsigned *safi);
+int v3_addr_add_prefix(IPAddrBlocks *addr,
+ const unsigned afi, const unsigned *safi,
+ unsigned char *a, const int prefixlen);
+int v3_addr_add_range(IPAddrBlocks *addr,
+ const unsigned afi, const unsigned *safi,
+ unsigned char *min, unsigned char *max);
+unsigned v3_addr_get_afi(const IPAddressFamily *f);
+int v3_addr_get_range(IPAddressOrRange *aor, const unsigned afi,
+ unsigned char *min, unsigned char *max,
+ const int length);
+
+/*
+ * Canonical forms.
+ */
+int v3_asid_is_canonical(ASIdentifiers *asid);
+int v3_addr_is_canonical(IPAddrBlocks *addr);
+int v3_asid_canonize(ASIdentifiers *asid);
+int v3_addr_canonize(IPAddrBlocks *addr);
+
+/*
+ * Tests for inheritance and containment.
+ */
+int v3_asid_inherits(ASIdentifiers *asid);
+int v3_addr_inherits(IPAddrBlocks *addr);
+int v3_asid_subset(ASIdentifiers *a, ASIdentifiers *b);
+int v3_addr_subset(IPAddrBlocks *a, IPAddrBlocks *b);
+
+/*
+ * Check whether RFC 3779 extensions nest properly in chains.
+ */
+int v3_asid_validate_path(X509_STORE_CTX *);
+int v3_addr_validate_path(X509_STORE_CTX *);
+int v3_asid_validate_resource_set(STACK_OF(X509) *chain,
+ ASIdentifiers *ext, int allow_inheritance);
+int v3_addr_validate_resource_set(STACK_OF(X509) *chain,
+ IPAddrBlocks *ext, int allow_inheritance);
+
+# endif /* OPENSSL_NO_RFC3779 */
+
+/* BEGIN ERROR CODES */
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
+ * made after this point may be overwritten when the script is next run.
+ */
+void ERR_load_X509V3_strings(void);
+
+/* Error codes for the X509V3 functions. */
+
+/* Function codes. */
+# define X509V3_F_A2I_GENERAL_NAME 164
+# define X509V3_F_ASIDENTIFIERCHOICE_CANONIZE 161
+# define X509V3_F_ASIDENTIFIERCHOICE_IS_CANONICAL 162
+# define X509V3_F_COPY_EMAIL 122
+# define X509V3_F_COPY_ISSUER 123
+# define X509V3_F_DO_DIRNAME 144
+# define X509V3_F_DO_EXT_CONF 124
+# define X509V3_F_DO_EXT_I2D 135
+# define X509V3_F_DO_EXT_NCONF 151
+# define X509V3_F_DO_I2V_NAME_CONSTRAINTS 148
+# define X509V3_F_GNAMES_FROM_SECTNAME 156
+# define X509V3_F_HEX_TO_STRING 111
+# define X509V3_F_I2S_ASN1_ENUMERATED 121
+# define X509V3_F_I2S_ASN1_IA5STRING 149
+# define X509V3_F_I2S_ASN1_INTEGER 120
+# define X509V3_F_I2V_AUTHORITY_INFO_ACCESS 138
+# define X509V3_F_NOTICE_SECTION 132
+# define X509V3_F_NREF_NOS 133
+# define X509V3_F_POLICY_SECTION 131
+# define X509V3_F_PROCESS_PCI_VALUE 150
+# define X509V3_F_R2I_CERTPOL 130
+# define X509V3_F_R2I_PCI 155
+# define X509V3_F_S2I_ASN1_IA5STRING 100
+# define X509V3_F_S2I_ASN1_INTEGER 108
+# define X509V3_F_S2I_ASN1_OCTET_STRING 112
+# define X509V3_F_S2I_ASN1_SKEY_ID 114
+# define X509V3_F_S2I_SKEY_ID 115
+# define X509V3_F_SET_DIST_POINT_NAME 158
+# define X509V3_F_STRING_TO_HEX 113
+# define X509V3_F_SXNET_ADD_ID_ASC 125
+# define X509V3_F_SXNET_ADD_ID_INTEGER 126
+# define X509V3_F_SXNET_ADD_ID_ULONG 127
+# define X509V3_F_SXNET_GET_ID_ASC 128
+# define X509V3_F_SXNET_GET_ID_ULONG 129
+# define X509V3_F_V2I_ASIDENTIFIERS 163
+# define X509V3_F_V2I_ASN1_BIT_STRING 101
+# define X509V3_F_V2I_AUTHORITY_INFO_ACCESS 139
+# define X509V3_F_V2I_AUTHORITY_KEYID 119
+# define X509V3_F_V2I_BASIC_CONSTRAINTS 102
+# define X509V3_F_V2I_CRLD 134
+# define X509V3_F_V2I_EXTENDED_KEY_USAGE 103
+# define X509V3_F_V2I_GENERAL_NAMES 118
+# define X509V3_F_V2I_GENERAL_NAME_EX 117
+# define X509V3_F_V2I_IDP 157
+# define X509V3_F_V2I_IPADDRBLOCKS 159
+# define X509V3_F_V2I_ISSUER_ALT 153
+# define X509V3_F_V2I_NAME_CONSTRAINTS 147
+# define X509V3_F_V2I_POLICY_CONSTRAINTS 146
+# define X509V3_F_V2I_POLICY_MAPPINGS 145
+# define X509V3_F_V2I_SUBJECT_ALT 154
+# define X509V3_F_V3_ADDR_VALIDATE_PATH_INTERNAL 160
+# define X509V3_F_V3_GENERIC_EXTENSION 116
+# define X509V3_F_X509V3_ADD1_I2D 140
+# define X509V3_F_X509V3_ADD_VALUE 105
+# define X509V3_F_X509V3_EXT_ADD 104
+# define X509V3_F_X509V3_EXT_ADD_ALIAS 106
+# define X509V3_F_X509V3_EXT_CONF 107
+# define X509V3_F_X509V3_EXT_FREE 165
+# define X509V3_F_X509V3_EXT_I2D 136
+# define X509V3_F_X509V3_EXT_NCONF 152
+# define X509V3_F_X509V3_GET_SECTION 142
+# define X509V3_F_X509V3_GET_STRING 143
+# define X509V3_F_X509V3_GET_VALUE_BOOL 110
+# define X509V3_F_X509V3_PARSE_LIST 109
+# define X509V3_F_X509_PURPOSE_ADD 137
+# define X509V3_F_X509_PURPOSE_SET 141
+
+/* Reason codes. */
+# define X509V3_R_BAD_IP_ADDRESS 118
+# define X509V3_R_BAD_OBJECT 119
+# define X509V3_R_BN_DEC2BN_ERROR 100
+# define X509V3_R_BN_TO_ASN1_INTEGER_ERROR 101
+# define X509V3_R_CANNOT_FIND_FREE_FUNCTION 168
+# define X509V3_R_DIRNAME_ERROR 149
+# define X509V3_R_DISTPOINT_ALREADY_SET 160
+# define X509V3_R_DUPLICATE_ZONE_ID 133
+# define X509V3_R_ERROR_CONVERTING_ZONE 131
+# define X509V3_R_ERROR_CREATING_EXTENSION 144
+# define X509V3_R_ERROR_IN_EXTENSION 128
+# define X509V3_R_EXPECTED_A_SECTION_NAME 137
+# define X509V3_R_EXTENSION_EXISTS 145
+# define X509V3_R_EXTENSION_NAME_ERROR 115
+# define X509V3_R_EXTENSION_NOT_FOUND 102
+# define X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED 103
+# define X509V3_R_EXTENSION_VALUE_ERROR 116
+# define X509V3_R_ILLEGAL_EMPTY_EXTENSION 151
+# define X509V3_R_ILLEGAL_HEX_DIGIT 113
+# define X509V3_R_INCORRECT_POLICY_SYNTAX_TAG 152
+# define X509V3_R_INVALID_ASNUMBER 162
+# define X509V3_R_INVALID_ASRANGE 163
+# define X509V3_R_INVALID_BOOLEAN_STRING 104
+# define X509V3_R_INVALID_EXTENSION_STRING 105
+# define X509V3_R_INVALID_INHERITANCE 165
+# define X509V3_R_INVALID_IPADDRESS 166
+# define X509V3_R_INVALID_MULTIPLE_RDNS 161
+# define X509V3_R_INVALID_NAME 106
+# define X509V3_R_INVALID_NULL_ARGUMENT 107
+# define X509V3_R_INVALID_NULL_NAME 108
+# define X509V3_R_INVALID_NULL_VALUE 109
+# define X509V3_R_INVALID_NUMBER 140
+# define X509V3_R_INVALID_NUMBERS 141
+# define X509V3_R_INVALID_OBJECT_IDENTIFIER 110
+# define X509V3_R_INVALID_OPTION 138
+# define X509V3_R_INVALID_POLICY_IDENTIFIER 134
+# define X509V3_R_INVALID_PROXY_POLICY_SETTING 153
+# define X509V3_R_INVALID_PURPOSE 146
+# define X509V3_R_INVALID_SAFI 164
+# define X509V3_R_INVALID_SECTION 135
+# define X509V3_R_INVALID_SYNTAX 143
+# define X509V3_R_ISSUER_DECODE_ERROR 126
+# define X509V3_R_MISSING_VALUE 124
+# define X509V3_R_NEED_ORGANIZATION_AND_NUMBERS 142
+# define X509V3_R_NO_CONFIG_DATABASE 136
+# define X509V3_R_NO_ISSUER_CERTIFICATE 121
+# define X509V3_R_NO_ISSUER_DETAILS 127
+# define X509V3_R_NO_POLICY_IDENTIFIER 139
+# define X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED 154
+# define X509V3_R_NO_PUBLIC_KEY 114
+# define X509V3_R_NO_SUBJECT_DETAILS 125
+# define X509V3_R_ODD_NUMBER_OF_DIGITS 112
+# define X509V3_R_OPERATION_NOT_DEFINED 148
+# define X509V3_R_OTHERNAME_ERROR 147
+# define X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED 155
+# define X509V3_R_POLICY_PATH_LENGTH 156
+# define X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED 157
+# define X509V3_R_POLICY_SYNTAX_NOT_CURRENTLY_SUPPORTED 158
+# define X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY 159
+# define X509V3_R_SECTION_NOT_FOUND 150
+# define X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS 122
+# define X509V3_R_UNABLE_TO_GET_ISSUER_KEYID 123
+# define X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT 111
+# define X509V3_R_UNKNOWN_EXTENSION 129
+# define X509V3_R_UNKNOWN_EXTENSION_NAME 130
+# define X509V3_R_UNKNOWN_OPTION 120
+# define X509V3_R_UNSUPPORTED_OPTION 117
+# define X509V3_R_UNSUPPORTED_TYPE 167
+# define X509V3_R_USER_TOO_LONG 132
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/deps/openssl/openssl/openssl.spec b/deps/openssl/openssl/openssl.spec
index e6c75843305..b721d657297 100644
--- a/deps/openssl/openssl/openssl.spec
+++ b/deps/openssl/openssl/openssl.spec
@@ -6,7 +6,7 @@ Release: 1
Summary: Secure Sockets Layer and cryptography libraries and tools
Name: openssl
-Version: 1.0.2c
+Version: 1.0.2d
Source0: ftp://ftp.openssl.org/source/%{name}-%{version}.tar.gz
License: OpenSSL
Group: System Environment/Libraries
diff --git a/deps/openssl/openssl/ssl/s3_clnt.c b/deps/openssl/openssl/ssl/s3_clnt.c
index 2346ce50c07..6af145a8b74 100644
--- a/deps/openssl/openssl/ssl/s3_clnt.c
+++ b/deps/openssl/openssl/ssl/s3_clnt.c
@@ -1456,8 +1456,6 @@ int ssl3_get_key_exchange(SSL *s)
#ifndef OPENSSL_NO_PSK
if (alg_k & SSL_kPSK) {
- char tmp_id_hint[PSK_MAX_IDENTITY_LEN + 1];
-
param_len = 2;
if (param_len > n) {
SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, SSL_R_LENGTH_TOO_SHORT);
@@ -1483,17 +1481,8 @@ int ssl3_get_key_exchange(SSL *s)
}
param_len += i;
- /*
- * If received PSK identity hint contains NULL characters, the hint
- * is truncated from the first NULL. p may not be ending with NULL,
- * so create a NULL-terminated string.
- */
- memcpy(tmp_id_hint, p, i);
- memset(tmp_id_hint + i, 0, PSK_MAX_IDENTITY_LEN + 1 - i);
- if (s->ctx->psk_identity_hint != NULL)
- OPENSSL_free(s->ctx->psk_identity_hint);
- s->ctx->psk_identity_hint = BUF_strdup(tmp_id_hint);
- if (s->ctx->psk_identity_hint == NULL) {
+ s->session->psk_identity_hint = BUF_strndup((char *)p, i);
+ if (s->session->psk_identity_hint == NULL) {
al = SSL_AD_HANDSHAKE_FAILURE;
SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, ERR_R_MALLOC_FAILURE);
goto f_err;
@@ -3077,7 +3066,7 @@ int ssl3_send_client_key_exchange(SSL *s)
}
memset(identity, 0, sizeof(identity));
- psk_len = s->psk_client_callback(s, s->ctx->psk_identity_hint,
+ psk_len = s->psk_client_callback(s, s->session->psk_identity_hint,
identity, sizeof(identity) - 1,
psk_or_pre_ms,
sizeof(psk_or_pre_ms));
diff --git a/deps/openssl/openssl/ssl/s3_lib.c b/deps/openssl/openssl/ssl/s3_lib.c
index 5db349a23a6..ad9eeb6fd45 100644
--- a/deps/openssl/openssl/ssl/s3_lib.c
+++ b/deps/openssl/openssl/ssl/s3_lib.c
@@ -3084,7 +3084,7 @@ void ssl3_clear(SSL *s)
}
#if !defined(OPENSSL_NO_TLSEXT)
if (s->s3->alpn_selected) {
- free(s->s3->alpn_selected);
+ OPENSSL_free(s->s3->alpn_selected);
s->s3->alpn_selected = NULL;
}
#endif
diff --git a/deps/openssl/openssl/ssl/s3_srvr.c b/deps/openssl/openssl/ssl/s3_srvr.c
index 8885694c02b..acd3b9e964a 100644
--- a/deps/openssl/openssl/ssl/s3_srvr.c
+++ b/deps/openssl/openssl/ssl/s3_srvr.c
@@ -2780,7 +2780,7 @@ int ssl3_get_client_key_exchange(SSL *s)
if (s->session->psk_identity != NULL)
OPENSSL_free(s->session->psk_identity);
- s->session->psk_identity = BUF_strdup((char *)p);
+ s->session->psk_identity = BUF_strndup((char *)p, i);
if (s->session->psk_identity == NULL) {
SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, ERR_R_MALLOC_FAILURE);
goto psk_err;
diff --git a/deps/openssl/openssl/test/Makefile b/deps/openssl/openssl/test/Makefile
index a570fadf984..e695073fd3f 100644
--- a/deps/openssl/openssl/test/Makefile
+++ b/deps/openssl/openssl/test/Makefile
@@ -68,6 +68,7 @@ V3NAMETEST= v3nametest
ASN1TEST= asn1test
HEARTBEATTEST= heartbeat_test
CONSTTIMETEST= constant_time_test
+VERIFYEXTRATEST= verify_extra_test
TESTS= alltests
@@ -80,7 +81,7 @@ EXE= $(BNTEST)$(EXE_EXT) $(ECTEST)$(EXE_EXT) $(ECDSATEST)$(EXE_EXT) $(ECDHTEST)
$(BFTEST)$(EXE_EXT) $(CASTTEST)$(EXE_EXT) $(SSLTEST)$(EXE_EXT) $(EXPTEST)$(EXE_EXT) $(DSATEST)$(EXE_EXT) $(RSATEST)$(EXE_EXT) \
$(EVPTEST)$(EXE_EXT) $(EVPEXTRATEST)$(EXE_EXT) $(IGETEST)$(EXE_EXT) $(JPAKETEST)$(EXE_EXT) $(SRPTEST)$(EXE_EXT) \
$(ASN1TEST)$(EXE_EXT) $(V3NAMETEST)$(EXE_EXT) $(HEARTBEATTEST)$(EXE_EXT) \
- $(CONSTTIMETEST)$(EXE_EXT)
+ $(CONSTTIMETEST)$(EXE_EXT) $(VERIFYEXTRATEST)$(EXE_EXT)
# $(METHTEST)$(EXE_EXT)
@@ -93,7 +94,7 @@ OBJ= $(BNTEST).o $(ECTEST).o $(ECDSATEST).o $(ECDHTEST).o $(IDEATEST).o \
$(RANDTEST).o $(DHTEST).o $(ENGINETEST).o $(CASTTEST).o \
$(BFTEST).o $(SSLTEST).o $(DSATEST).o $(EXPTEST).o $(RSATEST).o \
$(EVPTEST).o $(EVPEXTRATEST).o $(IGETEST).o $(JPAKETEST).o $(ASN1TEST).o $(V3NAMETEST).o \
- $(HEARTBEATTEST).o $(CONSTTIMETEST).o
+ $(HEARTBEATTEST).o $(CONSTTIMETEST).o $(VERIFYEXTRATEST).o
SRC= $(BNTEST).c $(ECTEST).c $(ECDSATEST).c $(ECDHTEST).c $(IDEATEST).c \
$(MD2TEST).c $(MD4TEST).c $(MD5TEST).c \
@@ -103,7 +104,7 @@ SRC= $(BNTEST).c $(ECTEST).c $(ECDSATEST).c $(ECDHTEST).c $(IDEATEST).c \
$(RANDTEST).c $(DHTEST).c $(ENGINETEST).c $(CASTTEST).c \
$(BFTEST).c $(SSLTEST).c $(DSATEST).c $(EXPTEST).c $(RSATEST).c \
$(EVPTEST).c $(EVPEXTRATEST).c $(IGETEST).c $(JPAKETEST).c $(SRPTEST).c $(ASN1TEST).c \
- $(V3NAMETEST).c $(HEARTBEATTEST).c $(CONSTTIMETEST).c
+ $(V3NAMETEST).c $(HEARTBEATTEST).c $(CONSTTIMETEST).c $(VERIFYEXTRATEST).c
EXHEADER=
HEADER= testutil.h $(EXHEADER)
@@ -147,7 +148,7 @@ alltests: \
test_gen test_req test_pkcs7 test_verify test_dh test_dsa \
test_ss test_ca test_engine test_evp test_evp_extra test_ssl test_tsa test_ige \
test_jpake test_srp test_cms test_ocsp test_v3name test_heartbeat \
- test_constant_time
+ test_constant_time test_verify_extra
test_evp: $(EVPTEST)$(EXE_EXT) evptests.txt
../util/shlib_wrap.sh ./$(EVPTEST) evptests.txt
@@ -348,6 +349,10 @@ test_constant_time: $(CONSTTIMETEST)$(EXE_EXT)
@echo "Test constant time utilites"
../util/shlib_wrap.sh ./$(CONSTTIMETEST)
+test_verify_extra: $(VERIFYEXTRATEST)$(EXE_EXT)
+ @echo $(START) $@
+ ../util/shlib_wrap.sh ./$(VERIFYEXTRATEST)
+
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
@@ -519,6 +524,9 @@ $(HEARTBEATTEST)$(EXE_EXT): $(HEARTBEATTEST).o $(DLIBCRYPTO)
$(CONSTTIMETEST)$(EXE_EXT): $(CONSTTIMETEST).o
@target=$(CONSTTIMETEST) $(BUILD_CMD)
+$(VERIFYEXTRATEST)$(EXE_EXT): $(VERIFYEXTRATEST).o
+ @target=$(VERIFYEXTRATEST) $(BUILD_CMD)
+
#$(AESTEST).o: $(AESTEST).c
# $(CC) -c $(CFLAGS) -DINTERMEDIATE_VALUE_KAT -DTRACE_KAT_MCT $(AESTEST).c
@@ -822,6 +830,21 @@ v3nametest.o: ../include/openssl/sha.h ../include/openssl/stack.h
v3nametest.o: ../include/openssl/symhacks.h ../include/openssl/x509.h
v3nametest.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h
v3nametest.o: v3nametest.c
+verify_extra_test.o: ../include/openssl/asn1.h ../include/openssl/bio.h
+verify_extra_test.o: ../include/openssl/buffer.h ../include/openssl/crypto.h
+verify_extra_test.o: ../include/openssl/e_os2.h ../include/openssl/ec.h
+verify_extra_test.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h
+verify_extra_test.o: ../include/openssl/err.h ../include/openssl/evp.h
+verify_extra_test.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h
+verify_extra_test.o: ../include/openssl/objects.h
+verify_extra_test.o: ../include/openssl/opensslconf.h
+verify_extra_test.o: ../include/openssl/opensslv.h
+verify_extra_test.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h
+verify_extra_test.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h
+verify_extra_test.o: ../include/openssl/safestack.h ../include/openssl/sha.h
+verify_extra_test.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
+verify_extra_test.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
+verify_extra_test.o: verify_extra_test.c
wp_test.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
wp_test.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
wp_test.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
diff --git a/deps/openssl/openssl/test/certs/bad.key b/deps/openssl/openssl/test/certs/bad.key
new file mode 100644
index 00000000000..4708495204d
--- /dev/null
+++ b/deps/openssl/openssl/test/certs/bad.key
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEogIBAAKCAQEAwTqNko5vQiQ5BQohPJ3sySrjT6JedjsKtt1OZ8ndR2C1asUi
+HgpVO8QDHKID88Qklx6UCieeKAwIY0VzqWz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YI4KRZvijaSFiV3XeLP
+kCI6KWQLCf2nRUjISa+cBAVLib88mMzrnROyHiA+psFGOrAuc/DSQ3lUxxKUT+HH
++G6I4XHQKE7Du2X+qGzs4QKBgBZyJNjRxWhF7rR5Dq4/RHsLM0yKqPPCoSkx2+ur
+WJjU47sofpVKUE4mzUaOumGnNicqk3nfkgw54HL6kTZpQ7JqUKt9pNGLBM+zI8qi
+njPec04MRmo7zjg1YKNmqDodXGl38QD7+5r/VRzO04fwgI8e5G98aiOhIuLezGHR
+R3GRAoGAAyhwtKoC87fSGrpyZQ16UAYuqNy0fVAQtrDgRgP5Nu4esr9QxS/hWjcR
+8s2P82wsR4gZna6l6vSz4awGVG4PGKnVjteAtZxok3nBHxPmRke5o7IpdObPjpQP
+RJNZYbJ9G/PbYDhciEoTjVyig6Ol5BRe9stSbO7+JIxEYr7VSpA=
+-----END RSA PRIVATE KEY-----
diff --git a/deps/openssl/openssl/test/certs/bad.pem b/deps/openssl/openssl/test/certs/bad.pem
new file mode 100644
index 00000000000..87692315169
--- /dev/null
+++ b/deps/openssl/openssl/test/certs/bad.pem
@@ -0,0 +1,21 @@
+-----BEGIN CERTIFICATE-----
+MIIDdzCCAl+gAwIBAgIJAJgwOOciuxjSMA0GCSqGSIb3DQEBCwUAMFQxCzAJBgNV
+BAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX
+aWRnaXRzIFB0eSBMdGQxDTALBgNVBAMTBGxlYWYwHhcNMTUwNzAyMTMyMDQ2WhcN
+MzUwNzAyMTMyMDQ2WjBTMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0
+ZTEhMB8GA1UEChMYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMQwwCgYDVQQDEwNi
+YWQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDBOo2Sjm9CJDkFCiE8
+nezJKuNPol52Owq23U5nyd1HYLVqxSIeClU7xAMcogPzxCSXHpQKJ54oDAhjRXOp
+bNPJlZPB2pNT23xqsccm7shwWWZawAt/BOYBFYmalj4rx8adDHUrF+LqdAnxaGrh
+twConYdfMbr1aOzcqLvRJw1tD1FTBcmf8V42uymEoC/krbbMGqNYBB1gyDq+0pkB
+cIRPyPDo6Q9WdRv9C/KgESKNa3T4cGHvAuRJS8yP/t9zzz7G28apk/IbY/LgN1Zb
+Wy2mCJndNOiESTzi3W7kvepBpFCZUTrLlEwibJVjyF6ALjNzpoZkMVG/wxH6CTqm
+ty5TAgMBAAGjTTBLMAkGA1UdEwQCMAAwHQYDVR0OBBYEFJoH29IULbskIG8BwYp4
+9yD+q7wbMB8GA1UdIwQYMBaAFBwdxP7xJUYhGU31hO4z2uXPtRl/MA0GCSqGSIb3
+DQEBCwUAA4IBAQBl0tHkWMBHW6r3ywBlWWFdok04xlt2QD8eA4ywwz97t/8JgLht
+OpuHO1bQtrZR6bxAgYT1+yHQnYBTfjKxFq+S9EP6nxBe94mEgizLmMv9pf7x5q+H
+pfT8ejcY54E/oXlFXSbLDE1BDpfgkWll2/TIsTRJNoM2n8mytEdPqzRburwWnoFR
+VchcfO968asdc9/8glSLJSNO+Wh9vQlbtcPzfbd4ZVE5E/P6drQzSwNjWvHQdswJ
+ujkY1zkTP2rtVBGN4OyOfkE6enVKpt5lN6AqjEMhJ5i/yFM/jDndTrgd/JkAvyUJ
+O2ELtifCd8DeSYNA9Qm8/MEUYq1xXQrGJHCE
+-----END CERTIFICATE-----
diff --git a/deps/openssl/openssl/test/certs/interCA.key b/deps/openssl/openssl/test/certs/interCA.key
new file mode 100644
index 00000000000..c32fe26bc97
--- /dev/null
+++ b/deps/openssl/openssl/test/certs/interCA.key
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEowIBAAKCAQEAu7NHo76UDp738A/nuEfvVkKL7a7Kjk8PJIYkRKouSZZgBW6Q
+xBWptfJ6UZLeoDnBjJ47hc7s+ohLkJnnsodAalg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7OV3gpSNMTrl55eLL8XilUqVYGjkgo29udyE11Ym7XwjgiNmrLCynjZ/drKr
+fkUDxR1QNjK0CwrYGwhqfwKBgQDAYGn3foK4nRthqWdrJjLjlzZLBwgJldbqhjsc
+YlIJezImWnU0k2YGpioDd0DPKqLlV3pCLXptVmGXlpM3jags7YlsObGE8C+zoBAu
+DHtWPLgsDltckg6Jh8YltlkSgLe9q2vXOhEF2aBsDDb62nGmonxSeWTe/Z4tB56U
+fJu2vwKBgFnGbZIcH8sDR7Vwh0sjSKnFkZ1v0T4qsBKpDz9yCvZVIgIFXPkKnALT
++OEpQTuLVN/MZxVlc8qo8UFflJprDsK1/Rm3iPaw+lwErswgddNUKNLnLPjlxcEe
+nTinsfyf4i48+IW55UFVU118nyufNeDdasoU6SSBH/MdeNq4hrTa
+-----END RSA PRIVATE KEY-----
diff --git a/deps/openssl/openssl/test/certs/interCA.pem b/deps/openssl/openssl/test/certs/interCA.pem
new file mode 100644
index 00000000000..35568abe17a
--- /dev/null
+++ b/deps/openssl/openssl/test/certs/interCA.pem
@@ -0,0 +1,21 @@
+-----BEGIN CERTIFICATE-----
+MIIDgDCCAmigAwIBAgIJANnoWlLlEsTgMA0GCSqGSIb3DQEBCwUAMFYxCzAJBgNV
+BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX
+aWRnaXRzIFB0eSBMdGQxDzANBgNVBAMMBnJvb3RDQTAeFw0xNTA3MDIxMzE3MDVa
+Fw0zNTA3MDIxMzE3MDVaMFcxCzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0
+YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQxEDAOBgNVBAMT
+B2ludGVyQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC7s0ejvpQO
+nvfwD+e4R+9WQovtrsqOTw8khiREqi5JlmAFbpDEFam18npRkt6gOcGMnjuFzuz6
+iEuQmeeyh0BqWAwpMgWMMteEzLOAaqkEl//J2+WgRbA/8pmwHfbPW/d+f3bp64Fo
+D1hQAenBzXmLxVohEQ9BA+xEDRkL/cA3Y+k/O1C9ORhSQrJNsB9aE3zKbFHd9mOm
+H4aNSsF8On3SqlRVOCQine5c6ACSd0HUEjYy9aObqY47ySNULbzVq5y6VOjMs0W+
+2G/XqrcVkxzf9bVqyVBrrAJrnb35/y/iK0zWgJBP+HXhwr5mMTvNuEirBeVYuz+6
+hUerUbuJhr0FAgMBAAGjUDBOMAwGA1UdEwQFMAMBAf8wHQYDVR0OBBYEFBj61iO5
+j11dE30+j6iRx9lhwBcuMB8GA1UdIwQYMBaAFIVWiTXinwAa4YYDC0uvdhJrM239
+MA0GCSqGSIb3DQEBCwUAA4IBAQDAU0MvL/yZpmibhxUsoSsa97UJbejn5IbxpPzZ
+4WHw8lsoUGs12ZHzQJ9LxkZVeuccFXy9yFEHW56GTlkBmD2qrddlmQCfQ3m8jtZ9
+Hh5feKAyrqfmfsWF5QPjAmdj/MFdq+yMJVosDftkmUmaBHjzbvbcq1sWh/6drH8U
+7pdYRpfeEY8dHSU6FHwVN/H8VaBB7vYYc2wXwtk8On7z2ocIVHn9RPkcLwmwJjb/
+e4jmcYiyZev22KXQudeHc4w6crWiEFkVspomn5PqDmza3rkdB3baXFVZ6sd23ufU
+wjkiKKtwRBwU+5tCCagQZoeQ5dZXQThkiH2XEIOCOLxyD/tb
+-----END CERTIFICATE-----
diff --git a/deps/openssl/openssl/test/certs/leaf.key b/deps/openssl/openssl/test/certs/leaf.key
new file mode 100644
index 00000000000..a1b1721245b
--- /dev/null
+++ b/deps/openssl/openssl/test/certs/leaf.key
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEpAIBAAKCAQEAv0Qo9WC/BKA70LtQJdwVGSXqr9dut3cQmiFzTb/SaWldjOT1
+sRNDFxSzdTJjU/8cIDEZvaTIwRxP/dtVQLjc+4jzrUwz93NuZ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PcppgZ1l52oNSiduw4z28mAQPbBVbUGkiqPVfCa3vhUYoLvt
+nUZCsXoGF3CVBJydpGFzXI0CgYEAtt3Jg72PoM8YZEimI0R462F4xHXlEYtE6tjJ
+C+vG/fU65P4Kw+ijrJQv9d6YEX+RscXdg51bjLJl5OvuAStopCLOZBPR3Ei+bobF
+RNkW4gyYZHLSc6JqZqbSopuNYkeENEKvyuPFvW3f5FxPJbxkbi9UdZCKlBEXAh/O
+IMGregcCgYBC8bS7zk6KNDy8q2uC/m/g6LRMxpb8G4jsrcLoyuJs3zDckBjQuLJQ
+IOMXcQBWN1h+DKekF2ecr3fJAJyEv4pU4Ct2r/ZTYFMdJTyAbjw0mqOjUR4nsdOh
+t/vCbt0QW3HXYTcVdCnFqBtelKnI12KoC0jAO9EAJGZ6kE/NwG6dQg==
+-----END RSA PRIVATE KEY-----
diff --git a/deps/openssl/openssl/test/certs/leaf.pem b/deps/openssl/openssl/test/certs/leaf.pem
new file mode 100644
index 00000000000..bb94d126e93
--- /dev/null
+++ b/deps/openssl/openssl/test/certs/leaf.pem
@@ -0,0 +1,21 @@
+-----BEGIN CERTIFICATE-----
+MIIDfjCCAmagAwIBAgIJAKRNsDKacUqNMA0GCSqGSIb3DQEBCwUAMFoxCzAJBgNV
+BAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX
+aWRnaXRzIFB0eSBMdGQxEzARBgNVBAMTCnN1YmludGVyQ0EwHhcNMTUwNzAyMTMx
+OTQ5WhcNMzUwNzAyMTMxOTQ5WjBUMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29t
+ZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMQ0wCwYD
+VQQDEwRsZWFmMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAv0Qo9WC/
+BKA70LtQJdwVGSXqr9dut3cQmiFzTb/SaWldjOT1sRNDFxSzdTJjU/8cIDEZvaTI
+wRxP/dtVQLjc+4jzrUwz93NuZYlsEWUEUg4Lrnfs0Nz50yHk4rJhVxWjb8Ii/wRB
+ViWHFExP7CwTkXiTclC1bCqTuWkjxF3thTfTsttRyY7qNkz2JpNx0guD8v4otQoY
+jA5AEZvK4IXLwOwxol5xBTMvIrvvff2kkh+c7OC2QVbUTow/oppjqIKCx2maNHCt
+LFTJELf3fwtRJLJsy4fKGP0/6kpZc8Sp88WK4B4FauF9IV1CmoAJUC1vJxhagHIK
+fVtFjUWs8GPobQIDAQABo00wSzAJBgNVHRMEAjAAMB0GA1UdDgQWBBQcHcT+8SVG
+IRlN9YTuM9rlz7UZfzAfBgNVHSMEGDAWgBTpZ30QdMGarrhMPwk+HHAV3R8aTzAN
+BgkqhkiG9w0BAQsFAAOCAQEAGjmSkF8is+v0/RLcnSRiCXENz+yNi4pFCAt6dOtT
+6Gtpqa1tY5It9lVppfWb26JrygMIzOr/fB0r1Q7FtZ/7Ft3P6IXVdk3GDO0QsORD
+2dRAejhYpc5c7joHxAw9oRfKrEqE+ihVPUTcfcIuBaalvuhkpQRmKP71ws5DVzOw
+QhnMd0TtIrbKHaNQ4kNsmSY5fQolwB0LtNfTus7OEFdcZWhOXrWImKXN9jewPKdV
+mSG34NfXOnA6qx0eQg06z+TkdrptH6j1Va2vS1/bL+h1GxjpTHlvTGaZYxaloIjw
+y/EzY5jygRoABnR3eBm15CYZwwKL9izIq1H3OhymEi/Ycg==
+-----END CERTIFICATE-----
diff --git a/deps/openssl/openssl/test/certs/rootCA.key b/deps/openssl/openssl/test/certs/rootCA.key
new file mode 100644
index 00000000000..527f3ad75f8
--- /dev/null
+++ b/deps/openssl/openssl/test/certs/rootCA.key
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEpAIBAAKCAQEAwPFrd4isNd/7c1MvkoAvdBYyTfUQIG9sOo7R3GvhLj7DBA+/
+m8TJEtHkC0WX5QbNZjrh4OIr36LE7HvTP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jg5kd67Vdvy+pqP
+Ju/ACvNVc5TmIo8V1cglmYVfaLBtP1DCcTOoA4ko196Hi8QUUIvat14lu+pKlIHh
+Q0xQa41kLhNbvaszegWVyLsCgYEAxhuGySbw/U9CbNDhhL1eANZOXoUNXWRcK6z5
+VS3dgcw6N2C5A86G+2mfUa5dywXyCWgZhRyvGQh5btZApUlCFvYJZc63Ysy7WkTQ
+f6rkm3ltiQimrURirn4CjwVOAZEIwJc7oeRj3g6Scz4acysd8KrRh93trwC55LtH
+mcWi6JECgYAlqCQvaAnvaWpR0RX7m/UMpqWOVgIperGR7hrN3d04RaWG4yv1+66T
+xANNBA8aDxhFwXjAKev4iOE/rp8SEjYXh3lbKmx+p9dk8REUdIFqoClX9tqctW9g
+AkDF34S0mSE4T34zhs2+InfohJa6ojsuiNJSQMBPBxfr6wV2C+UWMQ==
+-----END RSA PRIVATE KEY-----
diff --git a/deps/openssl/openssl/test/certs/rootCA.pem b/deps/openssl/openssl/test/certs/rootCA.pem
new file mode 100644
index 00000000000..ef73d001b67
--- /dev/null
+++ b/deps/openssl/openssl/test/certs/rootCA.pem
@@ -0,0 +1,21 @@
+-----BEGIN CERTIFICATE-----
+MIIDfzCCAmegAwIBAgIJAIhDKcvC6xWaMA0GCSqGSIb3DQEBCwUAMFYxCzAJBgNV
+BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX
+aWRnaXRzIFB0eSBMdGQxDzANBgNVBAMMBnJvb3RDQTAeFw0xNTA3MDIxMzE1MTFa
+Fw0zNTA3MDIxMzE1MTFaMFYxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0
+YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQxDzANBgNVBAMM
+BnJvb3RDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMDxa3eIrDXf
++3NTL5KAL3QWMk31ECBvbDqO0dxr4S4+wwQPv5vEyRLR5AtFl+UGzWY64eDiK9+i
+xOx70z08iv9edKCrpwNqFlteksR+W3mKadS8g16uQpJ0pSvnAMGp3NWxUwcPc/eO
+rRQ+JZ7lHubMkc2VDIBEIMP9F8+RPWMQHBRb+8OowYiyd/+c2/xqRERE94XsCCzU
+34Gjecn+HpuTFlO3l6u+Txql4vpGBeQNnCqkzLkeIaBsxKtZsEA5u/mIrf3fjbQL
+r35B4CE8yDNFSYQvkwbu/U/tT/O8m978JV5V1XXUxXs6QDUGn8SEtGyTDK83Wq+2
+QU0mIxy4ArMCAwEAAaNQME4wDAYDVR0TBAUwAwEB/zAdBgNVHQ4EFgQUhVaJNeKf
+ABrhhgMLS692Emszbf0wHwYDVR0jBBgwFoAUhVaJNeKfABrhhgMLS692Emszbf0w
+DQYJKoZIhvcNAQELBQADggEBADIKvyoK4rtPQ86I2lo5EDeAuzctXi2I3SZpnOe0
+mCCxJeZhWW0S7JuHvlfhEgXFBPEXzhS4HJLUlZUsWyiJ+3KcINMygaiF7MgIe6hZ
+WzpsMatS4mbNFElc89M+YryRFrQc9d1Uqjxhl3ms5MhDNcMP/PNwHa/wnIoqkpNI
+qtDoR741wcZ7bdr6XVdF8+pBjzbBPPRSf24x3bqavHBWcTjcSVcM/ZEXxeqH5SN0
+GbK2mQxrogX4UWjtl+DfYvl+ejpEcYNXKEmIabUUHtpG42544cuPtZizLW5bt/aT
+JBQfpPZpvf9MUlACxUONFOLQdZ8SXpSJ0e93iX2J2Z52mSQ=
+-----END CERTIFICATE-----
diff --git a/deps/openssl/openssl/test/certs/roots.pem b/deps/openssl/openssl/test/certs/roots.pem
new file mode 100644
index 00000000000..0bc69127df5
--- /dev/null
+++ b/deps/openssl/openssl/test/certs/roots.pem
@@ -0,0 +1,42 @@
+-----BEGIN CERTIFICATE-----
+MIIDgDCCAmigAwIBAgIJANnoWlLlEsTgMA0GCSqGSIb3DQEBCwUAMFYxCzAJBgNV
+BAYTAkFVMRMwEQYDVQQIDApTb21lLVN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umNhFb7QI1e4hO64y1kKbSs2AjWcJ2
+QxAyGiMM3wl2UfxPohDtgNhm0GFgQ1tUTeSnW3kAom9NqI7U/2lPpLh4rrFYTepR
+wy0FV3NpRuHPtJE0VfqYnwWiTRdCJ7w1XzknKOUSHP/hRbyJVlwQp3VEQ9SIOYU6
+C+QEVGIgQiST6MRlCvoNP43guaRtrMuBZJaHKy/hLPvkdRpXHoUeKQFDuH77sZsF
+sBv3EHNKoBvpSpSJndZN6UcH7Z1yn41Y6AnO4u492jiRAjQpP9+Nf/x1eg==
+-----END CERTIFICATE-----
diff --git a/deps/openssl/openssl/test/certs/subinterCA-ss.pem b/deps/openssl/openssl/test/certs/subinterCA-ss.pem
new file mode 100644
index 00000000000..a436b4b00db
--- /dev/null
+++ b/deps/openssl/openssl/test/certs/subinterCA-ss.pem
@@ -0,0 +1,21 @@
+-----BEGIN CERTIFICATE-----
+MIIDhzCCAm+gAwIBAgIJAJTed6XmFiu/MA0GCSqGSIb3DQEBCwUAMFoxCzAJBgNV
+BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX
+aWRnaXRzIFB0eSBMdGQxEzARBgNVBAMMCnN1YmludGVyQ0EwHhcNMTUwNzAyMTMy
+MTU4WhcNMzUwNzAyMTMyMTU4WjBaMQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29t
+ZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMRMwEQYD
+VQQDDApzdWJpbnRlckNBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA
+/zQjvhbU7RWDsRaEkVUBZWR/PqZ49GoE9p3OyRN4pkt1c1yb2ARVkYZP5e9gHb04
+wPVz2+FYy+2mNkl+uAZbcK5w5fWO3WJIEn57he4MkWu3ew1nJeSv3na8gyOoCheG
+64kWVbA2YL92mR7QoSCo4SP7RmykLrwj6TlDxqgH6DxKSD/CpdCHE3DKAzAiri3G
+Vc90OJAszYHlje4/maVIOayGROVET3xa5cbtRJl8IBgmqhMywtz4hhY/XZTvdEn2
+90aL857Hk7JjogA7mLKi07yKzknMxHV+k6JX7xJEttkcNQRFHONWZG1T4mRY1Drh
+6VbJGb+0GNIldNLQqigkfwIDAQABo1AwTjAMBgNVHRMEBTADAQH/MB0GA1UdDgQW
+BBTpZ30QdMGarrhMPwk+HHAV3R8aTzAfBgNVHSMEGDAWgBTpZ30QdMGarrhMPwk+
+HHAV3R8aTzANBgkqhkiG9w0BAQsFAAOCAQEAF8UAMtV1DClUWRw1h+THdAhjeo8S
+9BOp6QphtlYuc9o+tQri5m+WqbyUZKIBEtumNhFb7QI1e4hO64y1kKbSs2AjWcJ2
+QxAyGiMM3wl2UfxPohDtgNhm0GFgQ1tUTeSnW3kAom9NqI7U/2lPpLh4rrFYTepR
+wy0FV3NpRuHPtJE0VfqYnwWiTRdCJ7w1XzknKOUSHP/hRbyJVlwQp3VEQ9SIOYU6
+C+QEVGIgQiST6MRlCvoNP43guaRtrMuBZJaHKy/hLPvkdRpXHoUeKQFDuH77sZsF
+sBv3EHNKoBvpSpSJndZN6UcH7Z1yn41Y6AnO4u492jiRAjQpP9+Nf/x1eg==
+-----END CERTIFICATE-----
diff --git a/deps/openssl/openssl/test/certs/subinterCA.key b/deps/openssl/openssl/test/certs/subinterCA.key
new file mode 100644
index 00000000000..c867af9463d
--- /dev/null
+++ b/deps/openssl/openssl/test/certs/subinterCA.key
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEpQIBAAKCAQEA/zQjvhbU7RWDsRaEkVUBZWR/PqZ49GoE9p3OyRN4pkt1c1yb
+2ARVkYZP5e9gHb04wPVz2+FYy+2mNkl+uAZbcK5w5fWO3WJIEn57he4MkWu3ew1n
+JeSv3na8gyOoCheG64kWVbA2YL92mR7QoSCo4SP7RmykLrwj6TlDxqgH6DxKSD/C
+pdCHE3DKAzAiri3GVc90OJAszYHlje4/maV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0O1
+sX9xC3F4Rm4ymGJLA5ntg1bwNMoCytdodun6h5+O4YcXfIseQJFib7KxP/Bf0qcW
+aOzCnx36y5MQUMAD8H+1SU9TnjQhs9N8eBUE/kQu3BT99e8KllgJCEPoUNIP/s8s
+5LtFg6ECgYEAgLwJoJ3hBwr0LmUi3kpFYdbZ+tAKIvKQH3xYMnQulOqtlXJFy0bu
+ZcIAwsigRUqdCC2JuyAUw52HCtVVlpQjNs4BnUzaKooLOCm3w3i6X27mnHE0200S
+zqC0rcB0xNz/IltGc7IP+T8UK5xX38uhJ/vUW75OvAjqheJSBwR9h5c=
+-----END RSA PRIVATE KEY-----
diff --git a/deps/openssl/openssl/test/certs/subinterCA.pem b/deps/openssl/openssl/test/certs/subinterCA.pem
new file mode 100644
index 00000000000..2cdf4801139
--- /dev/null
+++ b/deps/openssl/openssl/test/certs/subinterCA.pem
@@ -0,0 +1,21 @@
+-----BEGIN CERTIFICATE-----
+MIIDhDCCAmygAwIBAgIJAJkv2OGshkmUMA0GCSqGSIb3DQEBCwUAMFcxCzAJBgNV
+BAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX
+aWRnaXRzIFB0eSBMdGQxEDAOBgNVBAMTB2ludGVyQ0EwHhcNMTUwNzAyMTMxODIz
+WhcNMzUwNzAyMTMxODIzWjBaMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1T
+dGF0ZTEhMB8GA1UEChMYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMRMwEQYDVQQD
+EwpzdWJpbnRlckNBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA/zQj
+vhbU7RWDsRaEkVUBZWR/PqZ49GoE9p3OyRN4pkt1c1yb2ARVkYZP5e9gHb04wPVz
+2+FYy+2mNkl+uAZbcK5w5fWO3WJIEn57he4MkWu3ew1nJeSv3na8gyOoCheG64kW
+VbA2YL92mR7QoSCo4SP7RmykLrwj6TlDxqgH6DxKSD/CpdCHE3DKAzAiri3GVc90
+OJAszYHlje4/maVIOayGROVET3xa5cbtRJl8IBgmqhMywtz4hhY/XZTvdEn290aL
+857Hk7JjogA7mLKi07yKzknMxHV+k6JX7xJEttkcNQRFHONWZG1T4mRY1Drh6VbJ
+Gb+0GNIldNLQqigkfwIDAQABo1AwTjAMBgNVHRMEBTADAQH/MB0GA1UdDgQWBBTp
+Z30QdMGarrhMPwk+HHAV3R8aTzAfBgNVHSMEGDAWgBQY+tYjuY9dXRN9Po+okcfZ
+YcAXLjANBgkqhkiG9w0BAQsFAAOCAQEAgVUsOf9rdHlQDw4clP8GMY7QahfXbvd8
+8o++P18KeInQXH6+sCg0axZXzhOmKwn+Ina3EsOP7xk4aKIYwJ4A1xBuT7fKxquQ
+pbJyjkEBsNRVLC9t4gOA0FC791v5bOCZjyff5uN+hy8r0828nVxha6CKLqwrPd+E
+mC7DtilSZIgO2vwbTBL6ifmw9n1dd/Bl8Wdjnl7YJqTIf0Ozc2SZSMRUq9ryn4Wq
+YrjRl8NwioGb1LfjEJ0wJi2ngL3IgaN94qmDn10OJs8hlsufwP1n+Bca3fsl0m5U
+gUMG+CXxbF0kdCKZ9kQb1MJE4vOk6zfyBGQndmQnxHjt5botI/xpXg==
+-----END CERTIFICATE-----
diff --git a/deps/openssl/openssl/test/certs/untrusted.pem b/deps/openssl/openssl/test/certs/untrusted.pem
new file mode 100644
index 00000000000..d93d312ddb3
--- /dev/null
+++ b/deps/openssl/openssl/test/certs/untrusted.pem
@@ -0,0 +1,42 @@
+-----BEGIN CERTIFICATE-----
+MIIDhDCCAmygAwIBAgIJAJkv2OGshkmUMA0GCSqGSIb3DQEBCwUAMFcxCzAJBgNV
+BAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX
+aWRnaXRzIFB0eSBMdGQxEDAOBgNVBAMTB2ludGVyQ0EwHhcNMTUwNzAyMTMxODIz
+WhcNMzUwNz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+QhnMd0TtIrbKHaNQ4kNsmSY5fQolwB0LtNfTus7OEFdcZWhOXrWImKXN9jewPKdV
+mSG34NfXOnA6qx0eQg06z+TkdrptH6j1Va2vS1/bL+h1GxjpTHlvTGaZYxaloIjw
+y/EzY5jygRoABnR3eBm15CYZwwKL9izIq1H3OhymEi/Ycg==
+-----END CERTIFICATE-----
diff --git a/deps/openssl/openssl/test/testssl b/deps/openssl/openssl/test/testssl
index ddebf085343..747e4ba381c 100644
--- a/deps/openssl/openssl/test/testssl
+++ b/deps/openssl/openssl/test/testssl
@@ -146,16 +146,15 @@ echo test sslv2/sslv3 with both client and server authentication via BIO pair an
$ssltest -bio_pair -server_auth -client_auth -app_verify $CA $extra || exit 1
test_cipher() {
- local cipher=$1
- local protocol=$2
- echo "Testing $cipher"
+ _cipher=$1
+ echo "Testing $_cipher"
prot=""
- if [ $protocol = "SSLv3" ] ; then
+ if [ $2 = "SSLv3" ] ; then
prot="-ssl3"
fi
- $ssltest -cipher $cipher $prot
+ $ssltest -cipher $_cipher $prot
if [ $? -ne 0 ] ; then
- echo "Failed $cipher"
+ echo "Failed $_cipher"
exit 1
fi
}
@@ -254,16 +253,16 @@ if ../util/shlib_wrap.sh ../apps/openssl no-srp; then
echo skipping SRP tests
else
echo test tls1 with SRP
- $ssltest -tls1 -cipher SRP -srpuser test -srppass abc123
+ $ssltest -tls1 -cipher SRP -srpuser test -srppass abc123 || exit 1
echo test tls1 with SRP via BIO pair
- $ssltest -bio_pair -tls1 -cipher SRP -srpuser test -srppass abc123
+ $ssltest -bio_pair -tls1 -cipher SRP -srpuser test -srppass abc123 || exit 1
echo test tls1 with SRP auth
- $ssltest -tls1 -cipher aSRP -srpuser test -srppass abc123
+ $ssltest -tls1 -cipher aSRP -srpuser test -srppass abc123 || exit 1
echo test tls1 with SRP auth via BIO pair
- $ssltest -bio_pair -tls1 -cipher aSRP -srpuser test -srppass abc123
+ $ssltest -bio_pair -tls1 -cipher aSRP -srpuser test -srppass abc123 || exit 1
fi
#############################################################################
diff --git a/deps/openssl/openssl/test/verify_extra_test.c b/deps/openssl/openssl/test/verify_extra_test.c
new file mode 120000
index 00000000000..11d837c6fae
--- /dev/null
+++ b/deps/openssl/openssl/test/verify_extra_test.c
@@ -0,0 +1 @@
+../crypto/x509/verify_extra_test.c \ No newline at end of file
diff --git a/deps/v8/src/log.cc b/deps/v8/src/log.cc
index ec2bb631ea9..04a154450f9 100644
--- a/deps/v8/src/log.cc
+++ b/deps/v8/src/log.cc
@@ -1620,7 +1620,7 @@ void Logger::LogCodeObject(Object* object) {
tag = Logger::REG_EXP_TAG;
break;
case Code::BUILTIN:
- description = "A builtin from the snapshot";
+ description = isolate_->builtins()->name(code_object->builtin_index());
tag = Logger::BUILTIN_TAG;
break;
case Code::HANDLER:
diff --git a/deps/v8/src/unicode-decoder.cc b/deps/v8/src/unicode-decoder.cc
index a3bf8295226..bb520990f0e 100644
--- a/deps/v8/src/unicode-decoder.cc
+++ b/deps/v8/src/unicode-decoder.cc
@@ -15,6 +15,7 @@ void Utf8DecoderBase::Reset(uint16_t* buffer, size_t buffer_length,
// Assume everything will fit in the buffer and stream won't be needed.
last_byte_of_buffer_unused_ = false;
unbuffered_start_ = NULL;
+ unbuffered_length_ = 0;
bool writing_to_buffer = true;
// Loop until stream is read, writing to buffer as long as buffer has space.
size_t utf16_length = 0;
@@ -41,6 +42,7 @@ void Utf8DecoderBase::Reset(uint16_t* buffer, size_t buffer_length,
// Just wrote last character of buffer
writing_to_buffer = false;
unbuffered_start_ = stream;
+ unbuffered_length_ = stream_length;
}
continue;
}
@@ -50,19 +52,22 @@ void Utf8DecoderBase::Reset(uint16_t* buffer, size_t buffer_length,
writing_to_buffer = false;
last_byte_of_buffer_unused_ = true;
unbuffered_start_ = stream - cursor;
+ unbuffered_length_ = stream_length + cursor;
}
utf16_length_ = utf16_length;
}
-void Utf8DecoderBase::WriteUtf16Slow(const uint8_t* stream, uint16_t* data,
+void Utf8DecoderBase::WriteUtf16Slow(const uint8_t* stream,
+ size_t stream_length, uint16_t* data,
size_t data_length) {
while (data_length != 0) {
size_t cursor = 0;
- uint32_t character = Utf8::ValueOf(stream, Utf8::kMaxEncodedSize, &cursor);
+ uint32_t character = Utf8::ValueOf(stream, stream_length, &cursor);
// There's a total lack of bounds checking for stream
// as it was already done in Reset.
stream += cursor;
+ stream_length -= cursor;
if (character > unibrow::Utf16::kMaxNonSurrogateCharCode) {
*data++ = Utf16::LeadSurrogate(character);
*data++ = Utf16::TrailSurrogate(character);
@@ -73,6 +78,7 @@ void Utf8DecoderBase::WriteUtf16Slow(const uint8_t* stream, uint16_t* data,
data_length -= 1;
}
}
+ DCHECK(stream_length >= 0);
}
} // namespace unibrow
diff --git a/deps/v8/src/unicode-decoder.h b/deps/v8/src/unicode-decoder.h
index bfb14a38555..c0308411660 100644
--- a/deps/v8/src/unicode-decoder.h
+++ b/deps/v8/src/unicode-decoder.h
@@ -23,9 +23,10 @@ class Utf8DecoderBase {
// The first buffer_length utf16 chars are cached in the buffer.
void Reset(uint16_t* buffer, size_t buffer_length, const uint8_t* stream,
size_t stream_length);
- static void WriteUtf16Slow(const uint8_t* stream, uint16_t* data,
- size_t length);
+ static void WriteUtf16Slow(const uint8_t* stream, size_t stream_length,
+ uint16_t* data, size_t length);
const uint8_t* unbuffered_start_;
+ size_t unbuffered_length_;
size_t utf16_length_;
bool last_byte_of_buffer_unused_;
@@ -48,6 +49,7 @@ class Utf8Decoder : public Utf8DecoderBase {
Utf8DecoderBase::Utf8DecoderBase()
: unbuffered_start_(NULL),
+ unbuffered_length_(0),
utf16_length_(0),
last_byte_of_buffer_unused_(false) {}
@@ -84,7 +86,7 @@ size_t Utf8Decoder<kBufferSize>::WriteUtf16(uint16_t* data,
if (length <= buffer_length) return length;
DCHECK(unbuffered_start_ != NULL);
// Copy the rest the slow way.
- WriteUtf16Slow(unbuffered_start_, data + buffer_length,
+ WriteUtf16Slow(unbuffered_start_, unbuffered_length_, data + buffer_length,
length - buffer_length);
return length;
}
diff --git a/doc/api/process.markdown b/doc/api/process.markdown
index ebff3d6496a..71c7d3cfcc7 100644
--- a/doc/api/process.markdown
+++ b/doc/api/process.markdown
@@ -104,9 +104,6 @@ Example of listening for `uncaughtException`:
Note that `uncaughtException` is a very crude mechanism for exception
handling.
-Don't use it, use [domains](domain.html) instead. If you do use it, restart
-your application after every unhandled exception!
-
Do *not* use it as the io.js equivalent of `On Error Resume Next`. An
unhandled exception means your application - and by extension io.js itself -
is in an undefined state. Blindly resuming means *anything* could happen.
@@ -114,6 +111,11 @@ is in an undefined state. Blindly resuming means *anything* could happen.
Think of resuming as pulling the power cord when you are upgrading your system.
Nine out of ten times nothing happens - but the 10th time, your system is bust.
+`uncaughtException` should be used to perform synchronous cleanup before
+shutting down the process. It is not safe to resume normal operation after
+`uncaughtException`. If you do use it, restart your application after every
+unhandled exception!
+
You have been warned.
## Event: 'unhandledRejection'
diff --git a/doc/api/stream.markdown b/doc/api/stream.markdown
index 12f99078aa1..a7a78f229ed 100644
--- a/doc/api/stream.markdown
+++ b/doc/api/stream.markdown
@@ -527,7 +527,7 @@ event will indicate when it is appropriate to begin writing more data
to the stream.
```javascript
-// Write the data to the supplied writable stream 1MM times.
+// Write the data to the supplied writable stream one million times.
// Be attentive to back-pressure.
function writeOneMillionTimes(writer, data, encoding, callback) {
var i = 1000000;
diff --git a/doc/releases.md b/doc/releases.md
index 5d72e4fb056..966af557e71 100644
--- a/doc/releases.md
+++ b/doc/releases.md
@@ -1,7 +1,7 @@
io.js Release Process
=====================
-This document describes the technical aspects of the io.js release process. The intended audience is those who have been authorized by the Technical Committee (TC) to create, promote and sign official release builds for io.js, hosted on <https://iojs.org>.
+This document describes the technical aspects of the io.js release process. The intended audience is those who have been authorized by the Node.js Foundation Technical Steering Committee (TSC) to create, promote and sign official release builds for io.js, hosted on <https://iojs.org>.
## Who can make a release?
@@ -11,11 +11,11 @@ Release authorization is given by the io.js TC. Once authorized, an individual m
There are three relevant Jenkins jobs that should be used for a release flow:
-**a.** **[iojs+any-pr+multi](https://jenkins-iojs.nodesource.com/job/iojs+any-pr+multi/)** is used for a final full-test run to ensure that the current *HEAD* is stable.
+**a.** **Test runs:** **[iojs+any-pr+multi](https://jenkins-iojs.nodesource.com/job/iojs+any-pr+multi/)** is used for a final full-test run to ensure that the current *HEAD* is stable.
-**b.** (optional) **[iojs+release+nightly](https://jenkins-iojs.nodesource.com/job/iojs+release+nightly/)** can be used to create a nightly release for the current *HEAD* if public test releases are required. Builds triggered with this job are published straight to <http://iojs.org/download/nightly/> and are available for public download.
+**b.** **Nightly builds:** (optional) **[iojs+release](https://jenkins-iojs.nodesource.com/job/iojs+release/)** can be used to create a nightly release for the current *HEAD* if public test releases are required. Builds triggered with this job are published straight to <http://iojs.org/download/nightly/> and are available for public download.
-**c.** **[iojs+release](https://jenkins-iojs.nodesource.com/job/iojs+release/)** does all of the work to build all required release assets. Promotion of the release files is a manual step once they are ready (see below).
+**c.** **Release builds:** **[iojs+release](https://jenkins-iojs.nodesource.com/job/iojs+release/)** does all of the work to build all required release assets. Promotion of the release files is a manual step once they are ready (see below).
The [io.js build team](https://github.com/nodejs/build) is able to provide this access to individuals authorized by the TC.
@@ -23,7 +23,7 @@ The [io.js build team](https://github.com/nodejs/build) is able to provide this
The _dist_ user on iojs.org controls the assets available in <http://iojs.org/download/> (note that <http://iojs.org/dist/> is an alias for <https://iojs.org/download/release/>).
-The Jenkins release build slaves upload their artefacts to the web server as the _staging_ user, the _dist_ user has access to move these assets to public access (the _staging_ user does not, for security purposes).
+The Jenkins release build slaves upload their artifacts to the web server as the _staging_ user, the _dist_ user has access to move these assets to public access (the _staging_ user does not, for security purposes).
Nightly builds are promoted automatically on the server by a cron task for the _dist_ user.
@@ -39,6 +39,8 @@ The GPG keys should be fetchable from a known third-party keyserver, currently t
gpg --keyserver pool.sks-keyservers.net --recv-keys <FINGERPRINT>
```
+The key you use may be a child/subkey of an existing key.
+
Additionally, full GPG key fingerprints for individuals authorized to release should be listed in the io.js GitHub README.md file.
## How to create a release
@@ -54,25 +56,28 @@ Run a **[iojs+any-pr+multi](https://jenkins-iojs.nodesource.com/job/iojs+any-pr+
### 2. Produce a Nightly Build _(optional)_
-If there is reason to produce a test release for the purpose of having others try out installers or specifics of builds, produce a nightly build using **[iojs+release+nightly](https://jenkins-iojs.nodesource.com/job/iojs+release+nightly/)** and wait for it to drop in <http://iojs.org/download/nightly/>.
+If there is a reason to produce a test release for the purpose of having others try out installers or specifics of builds, produce a nightly build using **[iojs+release](https://jenkins-iojs.nodesource.com/job/iojs+release/)** and wait for it to drop in <http://iojs.org/download/nightly/>. Follow the directions and enter a proper length commit sha, a date string and select "nightly" for "disttype".
This is particularly recommended if there has been recent work relating to the OS X or Windows installers as they are not tested in any way by CI.
-### 4. Update the _CHANGELOG.md_
+### 3. Update the _CHANGELOG.md_
-Use the following git command to produce a list of commits since the last release:
+Collect a formatted list of commits since the last release. Use [changelog-maker](https://github.com/rvagg/changelog-maker) (available from npm: `npm install changelog-maker -g`) to do this.
```
-git log --pretty=format:"* [%h] - %s (%aN)" \
- --since="$(git show -s --format=%ad `git rev-list --tags --max-count=1`)"
+$ changelog-maker --group
```
-_(You will probably need to omit the first two commits as they relate to the last release.)_
+Note that changelog-maker counts commits since the last tag and if the last tag in the repository was not on the current branch you may have to supply a `--start-ref` argument:
+
+```
+$ changelog-maker --group --start-ref v2.3.1
+```
The _CHANGELOG.md_ entry should take the following form:
```
-## YYYY-MM-DD, Version x.y.z, @user
+## YYYY-MM-DD, Version x.y.z, @releaser
### Notable changes
@@ -83,6 +88,8 @@ The _CHANGELOG.md_ entry should take the following form:
### Known issues
+See https://github.com/nodejs/io.js/labels/confirmed-bug for complete and current list of known issues.
+
* Include this section if there are any known problems with this release
* Scan GitHub for unresolved problems that users may need to be aware of
@@ -91,7 +98,7 @@ The _CHANGELOG.md_ entry should take the following form:
* Include the full list of commits since the last release here
```
-### 5. Update _src/node_version.h_
+### 4. Update _src/node_version.h_
The following macros should already be set for the release since they will have been updated directly following the last release. They shouldn't require changing:
@@ -116,7 +123,9 @@ This macro is used to signal an ABI version for native addons. It currently has
The general rule is to bump this version when there are _breaking ABI_ changes and also if there are non-trivial API changes. The rules are not yet strictly defined, so if in doubt, please confer with someone that will have a more informed perspective, such as a member of the NAN team.
-### 6. Create Release Commit
+**Note** that it is current TSC policy to bump major version when ABI changes. If you see a need to bump `NODE_MODULE_VERSION` then you should consult the TSC, commits may need to be reverted or a major version bump may need to happen.
+
+### 5. Create Release Commit
The _CHANGELOG.md_ and _src/node_version.h_ changes should be the final commit that will be tagged for the release.
@@ -127,64 +136,67 @@ YYYY-MM-DD io.js vx.y.z Release
Notable changes:
-* Copy the notable changes list here
+* Copy the notable changes list here, reformatted for plain-text
```
-### 7. Tag and Sign the Release Commit
+### 6. Push to GitHub
-Tag the release as <b><code>vx.y.z</code></b> and sign **using the same GPG key that will be used to sign SHASUMS256.txt**.
+Note that it is not essential that the release builds be created from the io.js repository, they may be created from your own fork if you desire. It is preferable, but not essential that the commits remain the same between that used to build and the tagged commit in the io.js repository.
-```
-git tag -sm 'YYYY-MM-DD io.js vz.y.x Release' vx.y.z
-```
+### 7. Produce Release Builds
-### 8. Set Up For the Next Release
+Use **[iojs+release](https://jenkins-iojs.nodesource.com/job/iojs+release/)** to produce release artifacts. Enter the commit that you want to build from and select "release" for "disttype".
-Edit _src/node_version.h_ again and:
+Artifacts from each slave are uploaded to Jenkins and are available if further testing is required. Use this opportunity particularly to test OS X and Windows installers if there are any concerns. Click through to the individual slaves for a run to find the artifacts.
-* Increment `NODE_PATCH_VERSION` by one
-* Change `NODE_VERSION_IS_RELEASE` back to `0`
+All release slaves should achieve "SUCCESS" (and be green, not red). A release with failures should not be promoted, there are likely problems to be investigated.
-Commit this change with:
+You can rebuild the release as many times as you need prior to promoting them if you encounter problems.
-```
-git commit -am 'Working on vx.y.z' # where 'z' is the incremented patch number
-```
+Note that you do not have to wait for the ARM builds if they are take longer than the others. It is only necessary to have the main Linux (x64 and x86), OS X .pkg and .tar.gz, Windows (x64 and x86) .msi and .exe, source, headers and docs (both produced currently by an OS X slave). i.e. the slaves with "arm" in their name don't need to have finished to progress to the next step. However, **if you promote builds _before_ ARM builds have finished, you must repeat the promotion step for the ARM builds when they are ready**.
-This sets up the branch so that nightly builds are produced with the next version number _and_ a pre-release tag.
+### 8. Tag and Sign the Release Commit
-### 9. Push to GitHub
+Tag the release as <b><code>vx.y.z</code></b> and sign **using the same GPG key that will be used to sign SHASUMS256.txt**.
-Push the changes along with the tag you created:
+```
+$ git tag <vx.y.z> <commit-sha> -sm 'YYYY-MM-DD io.js vz.y.x Release'
+```
+
+Push the tag to GitHub.
```
-git push origin branch vx.y.z
-# where "branch" is the working branch and "vx.y.z" the the release version
+$ git push origin <vx.y.z>
```
-### 9. Produce Release Builds
+### 9. Set Up For the Next Release
+
+Edit _src/node_version.h_ again and:
-Use **[iojs+release](https://jenkins-iojs.nodesource.com/job/iojs+release/)** to produce release artefacts. Enter the "vx.y.z" version string for this release and it will fetch your tagged commit.
+* Increment `NODE_PATCH_VERSION` by one
+* Change `NODE_VERSION_IS_RELEASE` back to `0`
-Artefacts from each slave are uploaded to Jenkins and are available if further testing is required. Use this opportunity particularly to test OS X and Windows installers if there are any concerns. Click through to the individual slaves for a run to find the artefacts. For example, the Windows 64-bit .msi file for v1.0.4 can be found [here](https://jenkins-iojs.nodesource.com/job/iojs+release/20/nodes=iojs-win2008r2-release-x64/).
+Commit this change with:
-All release slaves should achieve "SUCCESS" (and be blue, not red). A release with failures should not be promoted, there are likely problems to be investigated.
+```
+$ git commit -am 'Working on vx.y.z' # where 'z' is the incremented patch number
+```
-Note that you do not have to wait for the ARM builds if they are take longer than the others. It is only necessary to have the main Linux (x64 and x86), OS X .pkg and .tar.gz, Windows (x64 and x86) .msi and .exe, source and docs (both produced currently by an OS X slave). i.e. the slaves with "arm" in their name don't need to have finished to progress to the next step. However, **if you promote builds _before_ ARM builds have finished, you must repeat the promotion step for the ARM builds when they are ready**.
+This sets up the branch so that nightly builds are produced with the next version number _and_ a pre-release tag.
### 10. Promote and Sign the Release Builds
**It is important that the same individual who signed the release tag be the one to promote the builds as the SHASUMS256.txt file needs to be signed with the same GPG key!**
-When you are confident that the build slaves have properly produced usable artefacts and uploaded them to the web server you can promote them to release status. This is done by interacting with the web server via the _dist_ user.
+When you are confident that the build slaves have properly produced usable artifacts and uploaded them to the web server you can promote them to release status. This is done by interacting with the web server via the _dist_ user.
-The _tools/release.sh_ script may be used to promote and sign the build. When run, it will perform the following actions:
+The _tools/release.sh_ script should be used to promote and sign the build. When run, it will perform the following actions:
**a.** Select a GPG key from your private keys, it will use a command similar to: `gpg --list-secret-keys` to list your keys. If you don't have any keys, it will bail (why are you releasing? Your tag should be signed!). If you have only one key, it will use that. If you have more than one key it will ask you to select one from the list. Be sure to use the same key that you signed your git tag with.
-**b.** Log in to the server via SSH and check for releases that can be promoted, along with the list of artefacts. It will use the `dist-promotable` command on the server to find these. You will be asked, for each promotable release, whether you want to proceed. If there is more than one release to promote (there shouldn't be), be sure to only promote the release you are responsible for.
+**b.** Log in to the server via SSH and check for releases that can be promoted, along with the list of artifacts. It will use the `dist-promotable` command on the server to find these. You will be asked, for each promotable release, whether you want to proceed. If there is more than one release to promote (there shouldn't be), be sure to only promote the release you are responsible for.
-**c.** Log in to the server via SSH and run the promote script for the given release. The command on the server will be similar to: `dist-promote vx.y.z`. After this step, the release artefacts will be available for download and a SHASUMS256.txt file will be present. The release will still be unsigned, however.
+**c.** Log in to the server via SSH and run the promote script for the given release. The command on the server will be similar to: `dist-promote vx.y.z`. After this step, the release artifacts will be available for download and a SHASUMS256.txt file will be present. The release will still be unsigned, however.
**d.** Download SHASUMS256.txt to your computer using SCP into a temporary directory.
@@ -194,7 +206,7 @@ The _tools/release.sh_ script may be used to promote and sign the build. When ru
**g.** Upload the SHASUMS256.txt\* files back to the server into the release directory.
-If you didn't wait for ARM builds in the previous step before promoting the release, you should re-run _tools/release.sh_ after the ARM builds have finished and it will move the ARM artefacts into the correct location and you will be prompted to re-sign SHASUMS256.txt.
+If you didn't wait for ARM builds in the previous step before promoting the release, you should re-run _tools/release.sh_ after the ARM builds have finished and it will move the ARM artifacts into the correct location and you will be prompted to re-sign SHASUMS256.txt.
### 11. Check the Release
@@ -202,7 +214,9 @@ Your release should be available at <https://iojs.org/dist/vx.y.z/> and also <ht
### 12. Announce
-_TODO: Update doc with announce procedure when we figure this out._
+The iojs.org website will automatically rebuild and include the new version. You simply need to announce the build, preferably via twitter with a message such as:
+
+> v2.3.2 of @official_iojs is out @ https://iojs.org/dist/latest/ changelog @ https://github.com/nodejs/io.js/blob/master/CHANGELOG.md#2015-07-01-version-232-rvagg … something here about notable changes
### 13. Celebrate
diff --git a/doc/tsc-meetings/2015-05-27.md b/doc/tsc-meetings/2015-05-27.md
new file mode 100644
index 00000000000..7d93cd89dd4
--- /dev/null
+++ b/doc/tsc-meetings/2015-05-27.md
@@ -0,0 +1,142 @@
+# Node Foundation TSC Meeting 2015-05-27
+
+## Links
+
+* **Public YouTube feed**: http://www.youtube.com/watch?v=0DPfLxulsbQ
+* **GitHub Issue**: https://github.com/nodejs/node/issues/41
+* **Original Minutes Google Doc**: https://docs.google.com/document/d/1-KlxiQGMsJFNJu3meok9e9XFsM39k_PMnQmY_9d_cy0
+
+## Agenda
+
+Extracted from **tsc-agenda** labelled issues and pull requests prior to meeting.
+
+### nodejs/node
+
+* \[Converge\] timers: Avoid linear scan in `_unrefActive`. [#23](https://github.com/nodejs/node/issues/23)
+* \[Converge\] child_process argument type checking [#22](https://github.com/nodejs/node/issues/22)
+* \[Converge\] SSLv2/3 disable/enable related commits [#20](https://github.com/nodejs/node/issues/20)
+* doc: Add new working groups [#15](https://github.com/nodejs/node/pull/15)
+
+### nodejs/io.js
+
+* Buffer implemented using Uint8Array [#1810](https://github.com/nodejs/io.js/issues/1810)
+* \[Discussion\] FFI - Giving Buffer more low-level C functionality [#1750](https://github.com/nodejs/io.js/pull/1750)
+* Chrome 43 released; time for V8 4.3! [#1735](https://github.com/nodejs/io.js/issues/1735)
+* Deprecation Policy [#1704](https://github.com/nodejs/io.js/issues/1704)
+* TSC needs to elect a board representative. [#1697](https://github.com/nodejs/io.js/issues/1697)
+* V8 4.4 to remove indexed properties via external data [#1451](https://github.com/nodejs/io.js/issues/1451)
+
+### joyent/node
+
+## Present
+
+* Alexis Campailla (TSC)
+* Ben Noordhuis (TSC)
+* Bert Belder (TSC)
+* Brian White
+* Chris Dickinson (TSC)
+* Colin Ihrig (TSC)
+* James M Snell (TSC)
+* Jeremiah Senkpiel (TSC)
+* Mikeal Rogers
+* Michael Dawson (TSC)
+* Mike Dolan (TSC)
+* Rod Vagg (TSC)
+* Shigeki Ohtsu
+* Trevor Norris (TSC)
+
+## Quick stand-up
+
+* Rod: Working on combining the build, 3.0
+* James: Working on repo convergence, triaging joyent/node issues, LTS policy drafting
+* Shigeki: Investigating a slow tls test and SSL mitigations for a log jam attack.
+* Jeremiah: Lots of little things
+* Colin: Libuv work for os.homedir()
+* Chris: Removing sys, checking breakage; fixing bug I introduced in persistent history
+* Bert: Looking at issues
+* Alexis: Working on combining the build, fixing windows issues
+* Trevor: Working on the new Buffer impl using Uint8Array
+* Michael: Traging joyent/node, spun up the benchmarking WG, looking into adding powerpc build machines
+* Brian: Almost done the pure JS dns resolver, all tests are passing
+* Ben:
+ - Make require faster
+ - Date.now() perf improvements
+
+## Review of last meeting
+
+* _Skipping_
+
+## Minutes
+
+### \[Converge\] timers: Avoid linear scan in `_unrefActive`. [#23](https://github.com/nodejs/node/issues/23)
+
+* James: conflicting approaches in both repos
+* Ben: both are terrible under different workloads - do away with the code and start again
+* Jeremiah: might have a go at it, working off an existing heap impl by Ben (ACTION)
+* Bert: some problems with http - discussion happened about the implementation
+* Chris: would be good to have Julien’s input since he was active on the joyent/node impl
+
+### \[Converge\] child_process argument type checking [#22](https://github.com/nodejs/node/issues/22)
+
+* James: arg checking merged in 0.10 after the fork
+* Discussion about why this wasn’t merged to io.js
+* Defer back to GitHub discussion after no reason for not merging could be found on the call
+
+### \[Converge\] SSLv2/3 disable/enable related commits [#20](https://github.com/nodejs/node/issues/20)
+
+* James: SSLv2/3 removed in io.js, merging these commits would involve reverting
+* Jeremiah proposed 0.12 being the LTS for SSLv2/3 support
+* Rod: are we happy killing this off?
+* Michael: we don’t know how extensively it’s being used?
+* James: pending research into that question we’ll leave this alone, come back if there’s a compelling reason to revert
+
+### doc: Add new working groups [#15](https://github.com/nodejs/node/pull/15)
+
+* Michael: Benchmarking and Post Mortem Debugging working groups are ready and have started, i18n group needs a bit more work to get off the ground
+* Group didn’t see any reason not to go forward with these groups, they have repos and can be in an “incubating” state for now
+
+
+### Buffer implemented using Uint8Array [#1810](https://github.com/nodejs/io.js/issues/1810)
+
+* Trevor: Buffer using Uint8Array is now working, all applicable tests pass, currently behind a flag:
+* Trevor Questions:
+ - Are we going with v8 4.3 or 4.4?
+ - If we go v8 4.3, do we want to release behind a flag?
+ - we still want an upper kMaxlength Buffer size limit?
+* Ben: Buffer size limit should be safe to remove
+* Rod: 4.3 and 4.4 both contain major breakage for native addons
+* Discussed if we would like to delay 3.0 until v8 4.4
+* Rod: no appetite here for delaying a 3.0 with 4.3, take discussion on that back to GitHub
+* Ben: suggested we release new Buffer impl with a flag to revert to old impl, Jeremiah seconded
+* Discussed how hard it would be to land and review
+* Fedor: how does it work with 32bit numbers?
+* Trevor: It acts the same as before
+
+### \[Discussion\] FFI - Giving Buffer more low-level C functionality [#1750](https://github.com/nodejs/io.js/pull/1750)
+
+* Trevor: concerns about being able to write to buffers and execute arbitrary code
+* Rod: concerned about changing the nature of what Node _is_ and the safety it exposes
+* Ben suggested that we move this new work to an ffi module rather than hanging it off Buffer
+ - Group agreed to take this suggestion back to the issue for discussion
+
+### Chrome 43 released; time for V8 4.3! [#1735](https://github.com/nodejs/io.js/issues/1735)
+
+* Concerns about deps forcing semver-major, the C++ API changes are big enough to warrant this though
+
+### Deprecation Policy [#1704](https://github.com/nodejs/io.js/issues/1704)
+
+* Discussion dividing into two camps - conservative camp and those who want to test the size of the impact on the ecosystem
+* Suggestion (Michael?) that we use LTS releases to determine when things get properly removed
+* Discussed why we want a deprecation policy
+
+### TSC needs to elect a board representative. [#1697](https://github.com/nodejs/io.js/issues/1697)
+
+* Deferred till next meeting - need to nominate and vote someone in to this role and should discuss how we want to structure the role in terms of rotation
+
+### V8 4.4 to remove indexed properties via external data [#1451](https://github.com/nodejs/io.js/issues/1451)
+
+* Nothing to discuss, rolled up in to Buffer discussion earlier
+
+## Next meeting
+
+* June 3rd, 8PM UTC
diff --git a/doc/tc-meetings/2015-06-10.md b/doc/tsc-meetings/2015-06-10.md
index 989541d1c88..989541d1c88 100644
--- a/doc/tc-meetings/2015-06-10.md
+++ b/doc/tsc-meetings/2015-06-10.md
diff --git a/doc/tsc-meetings/2015-06-17.md b/doc/tsc-meetings/2015-06-17.md
new file mode 100644
index 00000000000..b4dc10571ac
--- /dev/null
+++ b/doc/tsc-meetings/2015-06-17.md
@@ -0,0 +1,133 @@
+# Node Foundation TSC Meeting 2015-06-17
+
+## Links
+
+* **GitHub Issue**: https://github.com/nodejs/node/issues/56
+* **Original Minutes Google Doc**: https://docs.google.com/document/d/1d4mAJgm06rpPWLDqhZcxsRnKMrS92Ip4CW2akOyeIL4
+
+## Agenda
+
+Extracted from **tsc-agenda** labelled issues and pull requests prior to meeting.
+
+### nodejs/node
+
+* Create a security team [#48](https://github.com/nodejs/node/issues/48)
+
+### nodejs/io.js
+
+* Nominating Shigeki Ohtsu @shigeki to the TC [#1501](https://github.com/nodejs/io.js/issues/1501)
+* Nominating Brian White @mscdex to the TC [#1500](https://github.com/nodejs/io.js/issues/1500)
+* on working with proposals from the API WG [#1993](https://github.com/nodejs/io.js/issues/1993)
+* zlib: prevent uncaught exception in zlibBuffer [#1993](https://github.com/nodejs/io.js/issues/1811)
+* Proposal: Release Process [#1997](https://github.com/nodejs/io.js/issues/1997)
+
+### joyent/node
+
+* Nominating new collaborators to this repository [#25481](https://github.com/joyent/node/issues/25481)
+
+## Minutes
+
+
+### Present
+
+* Rod Vagg (TSC)
+* Colin Ihrig (TSC)
+* Chris Dickinson (TSC)
+* Michael Dawson (TSC)
+* Mikeal Rogers
+* Steven R. Loomis (TSC)
+* Bert Belder (TSC)
+* Alexis Campailla (TSC)
+* Julien Gilli (TSC)
+* Shigeki Ohtsu
+* Jeremiah Senkpiel (TSC)
+* Brian White
+* Trevor Norris (TSC)
+* Domenic Denicola
+* Fedor Indutny (TSC)
+
+### Review of the previous meeting
+
+* Add working group state per Project Lifecycle
+* Chrome 43 released; time for V8 4.3
+* TSC needs to elect a board representative.
+* Nominating new collaborators to this repository
+* Node should not automatically change rlimits
+* New OpenSSL version about to be released, with fixed for logjam
+* Repurpose previous node.js TSC meeting as LTS WG meeting
+* 3.0 upgrade documentation
+* Rebasing on top of the 'next' branch (not on the agenda)
+* Workers PR from Petka
+
+### Standup:
+
+* Rod: build, productive work on improving the ci and build convergence, ci now does linting before running the tests, also improving the io.js make file so that less logic for releases is contained in jenkins
+* Colin: reviewing issues and pr’s, landed a cluster patch to not use --debug_port on cluster workers by default
+* Chris: NodeConf, got great feedback there. PR for code coverage incoming soon, spun up the docs WG.
+ * http://neversaw.us/scratch/node-coverage/ – code coverage
+ * https://github.com/nodejs/docs
+* Michael: Reviewing OpenSSL changes for LogJam; PPC LE & BE work nearly complete, some OpenSSL blockers (EC related)--working towards including PPC in CI
+* Mikeal: running NodeConf and writing up feedback & foundation work
+* Steven: getting back on board
+* Bert: libuv work for multi-worker on Windows (https://github.com/libuv/libuv/pull/396), found a potential libuv/Windows contributor at NodeConf, NF board meeting
+* Alexis: Working on build & CI convergence with Rod, CI can now automatically decide what options to use for different node versions, and porting node-accept-pull-request CI job.
+* Julien: time off, launching nodejs.org updates for NF launch, working on changes for 0.10/0.12 releases, onboarded two new collaborators for joyent/node - https://github.com/nodejs/node/wiki/Breaking-changes-between-v0.12-and-next-LTS-release
+* Shigeki: Working on upgrading OpenSSL, the upgrade process is becoming much simpler, landed the CINNIC whitelist
+* Jeremiah: NodeConf - brought back good feedback, helping spin up the Diversity WG, integrating timers heap impl, struggling with bugs
+* Brian: not much, triage & PR review
+* Trevor: reviewing, commenting, merging, PR to next branch allowing passing ArrayBuffers to Buffers constructor
+* Domenic: reviewing, some work with Trevor, discussing release procedure
+* Fedor: Reviewing issues(?), working on http/2 in node-spdy
+
+### Nominating Shigeki Ohtsu @shigeki to the TC [#1501](https://github.com/nodejs/io.js/issues/1501)
+### Nominating Brian White @mscdex to the TC [#1500](https://github.com/nodejs/io.js/issues/1500)
+
+Called for a vote, got +1's for both candidates from each of: Chris, Rod, Bert, Colin, Trevor, Jeremiah, Julien, Michael, Alexis
+
+### on working with proposals from the API WG [#1993](https://github.com/nodejs/io.js/issues/1993)
+
+* Trevor: started discussions back in advisory board before io.js existed, large companies wanted “official Node.js compatibility” at both module and JS layer. Some dissenting voices in Joyent that prevented things proceeding. After io.js happened the formal discussion ended but informal discussion continued, e.g. in https://github.com/nodejs/nan/issues/349, aim at the C++ level is to reduce API turn-over. Companies involved have their own VMs and want to maintain them for their own purposes (e.g. Chakra, JVM).
+* Trevor: interested in starting a WG or piggy-backing Addon API WG.
+* Domenic: would like more clarity on what this thing could be, is it libuv.js? is it a VM abstraction layer?
+* Bert: would be good to scope this work
+* Trevor: there’s one interest group--concerned with binary addons and not having to ship new versions with each new Node release. Another interest group is concerned with something akin to a process.bindings abstraction layer so you could put the Node JS layer on top of whatever runtime chosen.
+* Bert: standardising the process.bindings API might be easiest but standardising the C++ API has more beneifits because it solves the v8-upgrade-breaks-addons problem.
+* Rod: https://github.com/nodejs/nan/issues/373 is an issue in NAN for organising a meeting for the various groups interested in exploring C++ API compatibility, specifically for addons.
+
+### zlib: prevent uncaught exception in zlibBuffer [#1811](https://github.com/nodejs/io.js/issues/1811)
+
+* Trevor: Issue #1811 is potentially CVE-worthy, it’s been fixed but what is the process for going forward with a CVE if necessary?
+* Rod: security@nodejs.org has an expanded team and security@iojs.org redirects there as well. That team should be delegated to for discussion--if you have concerns then email them and let them be responsible for deciding how to proceed.
+* ACTION: Trevor to email summary of potential security concern to security@nodejs.org for further discussion amongst that group. Potentially also backporting to 0.10 and 0.12.
+
+### Proposal: Release Process [#1997](https://github.com/nodejs/io.js/issues/1997)
+
+* Mikeal:
+ - next branch to be released on a more regular timeline
+need to message to users that are on the “next” branch that there is a tradeoff between new V8 (features + perf) and being able to use native modules
+ - bring next to current, current to LTS
+* Domenic:
+ - core of the proposal:
+ - pseudo-LTS
+ - maintain V8 version for ourselves
+ - don’t backport any breaking changes from master, only features and patches
+ - release this with name that implies “use this to work with native modules and features” ???? (CD - lost track here)
+ - active dev happens here
+* Trevor: Naming is confusing; why isn’t it sufficient to say “this release is LTS”?
+* Mikeal: We don’t want LTS to mean “this is stable”, we want it to mean “I can use this for five years”
+* Trevor: But that’s the same thing, isn’t it?
+* Rod: Using the term LTS is counterproductive (leave it to the LTS working group) – it distracts
+* Trevor: one year span before [V8] is merged – that sounds like LTS
+* Domenic: This is a new release channel/train
+* Mikeal: We need “stable for a year” / “new features in V8, no native modules” / “stable for five years”
+ we stick with semver
+ (CD: Mikeal could you fill this out further?)
+* Domenic: We don’t need to move away from semver for the next branch
+Yearly releases pick a version that aligns
+* Mikeal: don’t call it canary, get a codename – increment one, two, three or five over a year – when we merge into master we choose a new name
+* CD: Could not capture entirety of discussion – moved a bit fast for me.
+* Bert: there is no ideal answer here. Would like mikeal and domenic to continue discussion and come back with something to vote on.
+
+## Next meeting
+
+Next week, 2015-06-24
diff --git a/doc/tc-meetings/2014-10-09.md b/doc/tsc-meetings/io.js/2014-10-09.md
index 57c4e34c769..57c4e34c769 100644
--- a/doc/tc-meetings/2014-10-09.md
+++ b/doc/tsc-meetings/io.js/2014-10-09.md
diff --git a/doc/tc-meetings/2014-10-15.md b/doc/tsc-meetings/io.js/2014-10-15.md
index 0499cddefb4..0499cddefb4 100644
--- a/doc/tc-meetings/2014-10-15.md
+++ b/doc/tsc-meetings/io.js/2014-10-15.md
diff --git a/doc/tc-meetings/2014-10-29.md b/doc/tsc-meetings/io.js/2014-10-29.md
index ce64c62ddb0..ce64c62ddb0 100644
--- a/doc/tc-meetings/2014-10-29.md
+++ b/doc/tsc-meetings/io.js/2014-10-29.md
diff --git a/doc/tc-meetings/2014-12-10.md b/doc/tsc-meetings/io.js/2014-12-10.md
index 8bbfdfed10d..8bbfdfed10d 100644
--- a/doc/tc-meetings/2014-12-10.md
+++ b/doc/tsc-meetings/io.js/2014-12-10.md
diff --git a/doc/tc-meetings/2014-12-17.md b/doc/tsc-meetings/io.js/2014-12-17.md
index 6d302ab88fc..6d302ab88fc 100644
--- a/doc/tc-meetings/2014-12-17.md
+++ b/doc/tsc-meetings/io.js/2014-12-17.md
diff --git a/doc/tc-meetings/2014-12-30.md b/doc/tsc-meetings/io.js/2014-12-30.md
index 5956e3a6f31..5956e3a6f31 100644
--- a/doc/tc-meetings/2014-12-30.md
+++ b/doc/tsc-meetings/io.js/2014-12-30.md
diff --git a/doc/tc-meetings/2015-01-07.md b/doc/tsc-meetings/io.js/2015-01-07.md
index 5ba0f86d7f4..5ba0f86d7f4 100644
--- a/doc/tc-meetings/2015-01-07.md
+++ b/doc/tsc-meetings/io.js/2015-01-07.md
diff --git a/doc/tc-meetings/2015-01-13.md b/doc/tsc-meetings/io.js/2015-01-13.md
index 76e529bf8b9..76e529bf8b9 100644
--- a/doc/tc-meetings/2015-01-13.md
+++ b/doc/tsc-meetings/io.js/2015-01-13.md
diff --git a/doc/tc-meetings/2015-01-21.md b/doc/tsc-meetings/io.js/2015-01-21.md
index 87e9e6b1796..87e9e6b1796 100644
--- a/doc/tc-meetings/2015-01-21.md
+++ b/doc/tsc-meetings/io.js/2015-01-21.md
diff --git a/doc/tc-meetings/2015-01-28.md b/doc/tsc-meetings/io.js/2015-01-28.md
index c24a44dbe13..c24a44dbe13 100644
--- a/doc/tc-meetings/2015-01-28.md
+++ b/doc/tsc-meetings/io.js/2015-01-28.md
diff --git a/doc/tc-meetings/2015-02-04.md b/doc/tsc-meetings/io.js/2015-02-04.md
index 8a2a06352a2..8a2a06352a2 100644
--- a/doc/tc-meetings/2015-02-04.md
+++ b/doc/tsc-meetings/io.js/2015-02-04.md
diff --git a/doc/tc-meetings/2015-02-18.md b/doc/tsc-meetings/io.js/2015-02-18.md
index 15ef5458828..15ef5458828 100644
--- a/doc/tc-meetings/2015-02-18.md
+++ b/doc/tsc-meetings/io.js/2015-02-18.md
diff --git a/doc/tc-meetings/2015-03-04.md b/doc/tsc-meetings/io.js/2015-03-04.md
index 33431a5fab0..33431a5fab0 100644
--- a/doc/tc-meetings/2015-03-04.md
+++ b/doc/tsc-meetings/io.js/2015-03-04.md
diff --git a/doc/tc-meetings/2015-03-18.md b/doc/tsc-meetings/io.js/2015-03-18.md
index 63b1bb758fc..63b1bb758fc 100644
--- a/doc/tc-meetings/2015-03-18.md
+++ b/doc/tsc-meetings/io.js/2015-03-18.md
diff --git a/doc/tc-meetings/2015-04-01.md b/doc/tsc-meetings/io.js/2015-04-01.md
index 43a756e75bf..43a756e75bf 100644
--- a/doc/tc-meetings/2015-04-01.md
+++ b/doc/tsc-meetings/io.js/2015-04-01.md
diff --git a/doc/tc-meetings/2015-04-08.md b/doc/tsc-meetings/io.js/2015-04-08.md
index 489df62ef9b..489df62ef9b 100644
--- a/doc/tc-meetings/2015-04-08.md
+++ b/doc/tsc-meetings/io.js/2015-04-08.md
diff --git a/doc/tc-meetings/2015-04-15.md b/doc/tsc-meetings/io.js/2015-04-15.md
index 931c568cef2..931c568cef2 100644
--- a/doc/tc-meetings/2015-04-15.md
+++ b/doc/tsc-meetings/io.js/2015-04-15.md
diff --git a/doc/tc-meetings/2015-04-22.md b/doc/tsc-meetings/io.js/2015-04-22.md
index f6715c7ad8c..f6715c7ad8c 100644
--- a/doc/tc-meetings/2015-04-22.md
+++ b/doc/tsc-meetings/io.js/2015-04-22.md
diff --git a/doc/tc-meetings/2015-04-29.md b/doc/tsc-meetings/io.js/2015-04-29.md
index 84b76a4ef4d..84b76a4ef4d 100644
--- a/doc/tc-meetings/2015-04-29.md
+++ b/doc/tsc-meetings/io.js/2015-04-29.md
diff --git a/doc/tsc-meetings/io.js/2015-05-13.md b/doc/tsc-meetings/io.js/2015-05-13.md
new file mode 100644
index 00000000000..3e18071ac7b
--- /dev/null
+++ b/doc/tsc-meetings/io.js/2015-05-13.md
@@ -0,0 +1,137 @@
+# io.js TC Meeting 2015-05-13
+
+## Links
+
+* **Public YouTube feed**: http://www.youtube.com/watch?v=UbYiFLf7MpU
+* **Google Plus Event page**: https://plus.google.com/events/cu606mlllfehl11u8kcj7q2407k
+* **GitHub Issue**: https://github.com/iojs/io.js/issues/1689
+* **Original Minutes Google Doc**: https://docs.google.com/document/d/15Y_kJlYm-8cIf-alniaqUWMM-TjGISCqLf40G3pv4sM
+
+## Agenda
+
+Extracted from https://github.com/iojs/io.js/labels/tc-agenda prior to meeting.
+
+* V8 4.4 to remove indexed properties via external data [#1451](https://github.com/iojs/io.js/issues/1451)
+* NODE_PATH deprecation [#1627](https://github.com/iojs/io.js/issues/1627)
+* Join the Node Foundation? [#1664](https://github.com/iojs/io.js/issues/1664)
+* Put `*Sync` methods behind a flag in some future major version [#1665](https://github.com/iojs/io.js/issues/1665)
+* TC Nominations
+ - Shigeki Ohtsu @shigeki [#1501](https://github.com/iojs/io.js/issues/1501)
+ - Brian White @mscdex [#1500](https://github.com/iojs/io.js/issues/1500)
+ - @mikeal [#1481](https://github.com/iojs/io.js/issues/1481)
+* Public QA via #io.js channel on Freenode
+
+### Present
+
+* Ben (TC)
+* Bert (TC)
+* Brian
+* Chris (TC)
+* Domenic
+* Jeremiah (TC)
+* Mikeal
+* Rod (TC)
+* Shigeki
+* Trevor (TC)
+
+### Quick stand-up
+
+* Ben: Upgraded V8, upgraded cares for the first time in 2 years, reviewed pull requests
+* Bert: Played Keen, not much io.js stuff; last Monday met with James, Mikeal about convergence
+* Brian: looking over potential optimizations in the JS codebase, started working on a DNS resolver as a potential replacement for cares
+* Chris: fixing race conditions in the REPL, poking at adding Ctrl-R history searching to readline
+* Domenic: working with V8 team in Munich, working on v8-extras feature, putting large portions of things into snapshot to speed up startup and other things: https://groups.google.com/forum/#!topic/v8-users/D6FmTwlvCgk
+* Jeremiah: issue management, working on tooling for automatic dependency upgrades, see [#1688](https://github.com/iojs/io.js/pull/1688)
+* Mikeal: Foundation stuff, getting ducks in a row
+* Shigeki: holiday in JP, fix TLS bug involving edge-case, needs review
+* Trevor: Helped with re-enabling snapshots, looking at changing the Buffer APIs to use TypedArrays
+* Rod: Been doing lots of little things, working on the CI and build cluster
+
+### Review of last meeting
+
+* Release Proposal: v2.0.0 [#1532](https://github.com/iojs/io.js/pull/1532)
+* Forward-port from v1.x [#1559](https://github.com/iojs/io.js/pull/1559)
+* Convergence plan (https://github.com/jasnell/dev-policy/pull/66)
+* Combined node.js/io.js TC/core call [#1413](https://github.com/iojs/io.js/issues/1413)
+
+## Minutes
+
+* Discussed creating a more formal deprecation policy, chris to open an issue.
+
+### V8 4.4 to remove indexed properties via external data [#1451](https://github.com/iojs/io.js/issues/1451)
+
+* ‘smalloc’ has to go away when we land this V8, thankfully it’s not been around for long but this is a forced deprecation & removal.
+* currently usage of ‘smalloc’ gives a deprecation warning, as of v2.0.0
+* @jeisinger has been backporting some APIs needed for Buffer, NAN will have to catch up but @kkoopa is involved
+* Domenic: V8 4.3 will be next week, 7 weeks from now will be 4.4 (~1 week behind Chrome release)
+* Trevor: no major problems with JS API, most problems will be in the C++ API, should be able to shim to ease it
+
+### NODE_PATH deprecation [#1627](https://github.com/iojs/io.js/issues/1627)
+
+* Jeremiah: there was a suggestion to deprecate NODE_PATH entirely, debate is over deprecation or not, lots of people appear to be finding novel uses of it.
+* Domenic: maybe we should document it
+* Chris: it is documented, Googling shows that it’s been ingrained into the Node background, there’s lots of info out there about how it’s used
+* Domenic: https://iojs.org/api/modules.html#modules_loading_from_the_global_folders
+* Mikeal: maybe write docs about how it exists but you shouldn’t use it
+
+**Action: Mikeal to open an issue to change the docs to talk about how you probably shouldn’t use them** (note: it might be as simple as styling!)
+
+### Join the Node Foundation? [#1664](https://github.com/iojs/io.js/issues/1664)
+
+* Mikeal: Mostly a consensus in the issue about joining
+* Mikeal: Next step is to move the “iojs” org to “nodejs”, then move the convergence repo in to be “node” to be the new tip: https://github.com/jasnell/node.js-convergence
+
+Lots of discussions about process and what needs to happen & when, Mikeal pushing for a vote to get the org moved.
+
+**Voting Question**: The io.js TC agrees to:
+ 1. have the io.js project join the Node Foundation
+ 2. rename the entire “iojs” GitHub org to be “nodejs”
+ 3. invite the the current Node.js TC on to our TC to form the basis of a Node Foundation TSC under the policies of the Node Foundation
+ 4. moving the io.js Working Groups to be under the Node Foundation
+
+**Voting Results**:
+
+* Fedor: 0
+* Ben: +1
+* Bert: +1
+* Chris: +1
+* Jeremiah: +1
+* Trevor: +1
+* Rod: +1
+
+Action: Mikeal to make the move happen in a coordinated way so we get redirects and whatnot
+
+### Put `*Sync` methods behind a flag in some future major version [#1665](https://github.com/iojs/io.js/issues/1665)
+
+* Ben: some people feel that `fs.*Sync()` methods are harmful and would like to see them go away and be behind a flag
+* Bert: don’t agree with deprecating but agree with a flag
+* Rod: agree with Bert, but would like to see doc changes
+* Trevor: working on a flag to print a stack trace
+
+### TC Nominations
+
+* Shigeki Ohtsu @shigeki [#1501](https://github.com/iojs/io.js/issues/1501)
+* Brian White @mscdex [#1500](https://github.com/iojs/io.js/issues/1500)
+* @mikeal [#1481](https://github.com/iojs/io.js/issues/1481)
+
+* Mikeal: joining
+* Rod: timing is awkward with convergence but I’d like to make sure that Shigeki and Brian have a path to join the TC and not have that delayed too much
+
+### Public QA via #io.js channel on Freenode
+
+* `<therebelrobot> After the converged release, will io.js/node still be semver? for example, the history would be node 0.10, 0.12, iojs 1.x 2.x then the converged one would be node 3.x?`
+ - Mikeal: the dev policy says so, there’s nobody advocating not to
+* `<evanlucas> Are there plans to symlink node to iojs in the installers after the first converged release?`
+ - Bert: undecided. We should figure out a way to allow users to “node lts” and “node bleeding edge” side by side.
+ - Mikeal: part of the above is covered by a thread in NG about localizing the node installation to global modules.
+* `<phpnode> will members of the core team be able to revive io.js if they disagree with the direction of the project in future`
+ - (Group) Yes
+* `<skinan5> any plans for nan resolution?`
+ - Rod: it’s just a header file and you need it for older versions of Node so it doesn’t make sense to _not_ use it from npm
+ - Ben: current NAN isn’t suitable for bringing in
+ - Trevor: would support bringing in something that would provide proper ABI support
+ - Action: Trevor to open an issue on the NAN repo to talk about a stable C++ layer
+
+## Next meeting
+
+* May 20th, invite joyent/node TC members, figure out who that is and if this timeslot works for them when we have a combined call tomorrow (14th)
diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js
index b513852110e..6aad552e7a5 100644
--- a/lib/_http_outgoing.js
+++ b/lib/_http_outgoing.js
@@ -4,6 +4,7 @@ const assert = require('assert').ok;
const Stream = require('stream');
const timers = require('timers');
const util = require('util');
+const internalUtil = require('internal/util');
const Buffer = require('buffer').Buffer;
const common = require('_http_common');
@@ -644,6 +645,6 @@ OutgoingMessage.prototype.flushHeaders = function() {
this._send('');
};
-OutgoingMessage.prototype.flush = util.deprecate(function() {
+OutgoingMessage.prototype.flush = internalUtil.deprecate(function() {
this.flushHeaders();
-}, 'flush is deprecated. Use flushHeaders instead.');
+}, 'OutgoingMessage.flush is deprecated. Use flushHeaders instead.');
diff --git a/lib/_stream_wrap.js b/lib/_stream_wrap.js
index 1eac2ddf941..924d07a986a 100644
--- a/lib/_stream_wrap.js
+++ b/lib/_stream_wrap.js
@@ -1,18 +1,23 @@
'use strict';
+const assert = require('assert');
const util = require('util');
const Socket = require('net').Socket;
const JSStream = process.binding('js_stream').JSStream;
const uv = process.binding('uv');
+const debug = util.debuglog('stream_wrap');
function StreamWrap(stream) {
- var handle = new JSStream();
+ const handle = new JSStream();
this.stream = stream;
- var self = this;
+ this._list = null;
+
+ const self = this;
handle.close = function(cb) {
- cb();
+ debug('close');
+ self.doClose(cb);
};
handle.isAlive = function() {
return self.isAlive();
@@ -27,21 +32,25 @@ function StreamWrap(stream) {
return self.readStop();
};
handle.onshutdown = function(req) {
- return self.shutdown(req);
+ return self.doShutdown(req);
};
handle.onwrite = function(req, bufs) {
- return self.write(req, bufs);
+ return self.doWrite(req, bufs);
};
this.stream.pause();
+ this.stream.on('error', function(err) {
+ self.emit('error', err);
+ });
this.stream.on('data', function(chunk) {
- self._handle.readBuffer(chunk);
+ debug('data', chunk.length);
+ if (self._handle)
+ self._handle.readBuffer(chunk);
});
this.stream.once('end', function() {
- self._handle.emitEOF();
- });
- this.stream.on('error', function(err) {
- self.emit('error', err);
+ debug('end');
+ if (self._handle)
+ self._handle.emitEOF();
});
Socket.call(this, {
@@ -55,11 +64,11 @@ module.exports = StreamWrap;
StreamWrap.StreamWrap = StreamWrap;
StreamWrap.prototype.isAlive = function isAlive() {
- return this.readable && this.writable;
+ return true;
};
StreamWrap.prototype.isClosing = function isClosing() {
- return !this.isAlive();
+ return !this.readable || !this.writable;
};
StreamWrap.prototype.readStart = function readStart() {
@@ -72,21 +81,31 @@ StreamWrap.prototype.readStop = function readStop() {
return 0;
};
-StreamWrap.prototype.shutdown = function shutdown(req) {
- var self = this;
+StreamWrap.prototype.doShutdown = function doShutdown(req) {
+ const self = this;
+ const handle = this._handle;
+ const item = this._enqueue('shutdown', req);
this.stream.end(function() {
// Ensure that write was dispatched
setImmediate(function() {
- self._handle.finishShutdown(req, 0);
+ if (!self._dequeue(item))
+ return;
+
+ handle.finishShutdown(req, 0);
});
});
return 0;
};
-StreamWrap.prototype.write = function write(req, bufs) {
+StreamWrap.prototype.doWrite = function doWrite(req, bufs) {
+ const self = this;
+ const handle = self._handle;
+
var pending = bufs.length;
- var self = this;
+
+ // Queue the request to be able to cancel it
+ const item = self._enqueue('write', req);
self.stream.cork();
bufs.forEach(function(buf) {
@@ -103,6 +122,10 @@ StreamWrap.prototype.write = function write(req, bufs) {
// Ensure that write was dispatched
setImmediate(function() {
+ // Do not invoke callback twice
+ if (!self._dequeue(item))
+ return;
+
var errCode = 0;
if (err) {
if (err.code && uv['UV_' + err.code])
@@ -111,10 +134,83 @@ StreamWrap.prototype.write = function write(req, bufs) {
errCode = uv.UV_EPIPE;
}
- self._handle.doAfterWrite(req);
- self._handle.finishWrite(req, errCode);
+ handle.doAfterWrite(req);
+ handle.finishWrite(req, errCode);
});
}
return 0;
};
+
+function QueueItem(type, req) {
+ this.type = type;
+ this.req = req;
+ this.prev = this;
+ this.next = this;
+}
+
+StreamWrap.prototype._enqueue = function enqueue(type, req) {
+ const item = new QueueItem(type, req);
+ if (this._list === null) {
+ this._list = item;
+ return item;
+ }
+
+ item.next = this._list.next;
+ item.prev = this._list;
+ item.next.prev = item;
+ item.prev.next = item;
+
+ return item;
+};
+
+StreamWrap.prototype._dequeue = function dequeue(item) {
+ assert(item instanceof QueueItem);
+
+ var next = item.next;
+ var prev = item.prev;
+
+ if (next === null && prev === null)
+ return false;
+
+ item.next = null;
+ item.prev = null;
+
+ if (next === item) {
+ prev = null;
+ next = null;
+ } else {
+ prev.next = next;
+ next.prev = prev;
+ }
+
+ if (this._list === item)
+ this._list = next;
+
+ return true;
+};
+
+StreamWrap.prototype.doClose = function doClose(cb) {
+ const self = this;
+ const handle = self._handle;
+
+ setImmediate(function() {
+ while (self._list !== null) {
+ const item = self._list;
+ const req = item.req;
+ self._dequeue(item);
+
+ const errCode = uv.UV_ECANCELED;
+ if (item.type === 'write') {
+ handle.doAfterWrite(req);
+ handle.finishWrite(req, errCode);
+ } else if (item.type === 'shutdown') {
+ handle.finishShutdown(req, errCode);
+ }
+ }
+
+ // Should be already set by net.js
+ assert(self._handle === null);
+ cb();
+ });
+};
diff --git a/lib/_stream_writable.js b/lib/_stream_writable.js
index 5b374688b01..19c0c8a006f 100644
--- a/lib/_stream_writable.js
+++ b/lib/_stream_writable.js
@@ -8,6 +8,7 @@ module.exports = Writable;
Writable.WritableState = WritableState;
const util = require('util');
+const internalUtil = require('internal/util');
const Stream = require('stream');
const Buffer = require('buffer').Buffer;
@@ -120,10 +121,10 @@ WritableState.prototype.getBuffer = function writableStateGetBuffer() {
};
Object.defineProperty(WritableState.prototype, 'buffer', {
- get: util.deprecate(function() {
+ get: internalUtil.deprecate(function() {
return this.getBuffer();
- }, '_writableState.buffer is deprecated. Use ' +
- '_writableState.getBuffer() instead.')
+ }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' +
+ 'instead.')
});
function Writable(options) {
diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js
index 8ccee2379d4..b96e577a760 100644
--- a/lib/_tls_wrap.js
+++ b/lib/_tls_wrap.js
@@ -254,7 +254,7 @@ function TLSSocket(socket, options) {
this.encrypted = true;
net.Socket.call(this, {
- handle: this._wrapHandle(wrap && wrap._handle),
+ handle: this._wrapHandle(wrap),
allowHalfOpen: socket && socket.allowHalfOpen,
readable: false,
writable: false
@@ -279,7 +279,7 @@ util.inherits(TLSSocket, net.Socket);
exports.TLSSocket = TLSSocket;
var proxiedMethods = [
- 'close', 'ref', 'unref', 'open', 'bind', 'listen', 'connect', 'bind6',
+ 'ref', 'unref', 'open', 'bind', 'listen', 'connect', 'bind6',
'connect6', 'getsockname', 'getpeername', 'setNoDelay', 'setKeepAlive',
'setSimultaneousAccepts', 'setBlocking',
@@ -295,8 +295,20 @@ proxiedMethods.forEach(function(name) {
};
});
-TLSSocket.prototype._wrapHandle = function(handle) {
+tls_wrap.TLSWrap.prototype.close = function closeProxy(cb) {
+ if (this._parentWrap && this._parentWrap._handle === this._parent) {
+ setImmediate(cb);
+ return this._parentWrap.destroy();
+ }
+ return this._parent.close(cb);
+};
+
+TLSSocket.prototype._wrapHandle = function(wrap) {
var res;
+ var handle;
+
+ if (wrap)
+ handle = wrap._handle;
var options = this._tlsOptions;
if (!handle) {
@@ -310,6 +322,7 @@ TLSSocket.prototype._wrapHandle = function(handle) {
tls.createSecureContext();
res = tls_wrap.wrap(handle, context.context, options.isServer);
res._parent = handle;
+ res._parentWrap = wrap;
res._secureContext = context;
res.reading = handle.reading;
Object.defineProperty(handle, 'reading', {
@@ -355,7 +368,13 @@ TLSSocket.prototype._init = function(socket, wrap) {
// represent real writeQueueSize during regular writes.
ssl.writeQueueSize = 1;
- this.server = options.server || null;
+ this.server = options.server;
+
+ // Move the server to TLSSocket, otherwise both `socket.destroy()` and
+ // `TLSSocket.destroy()` will decrement number of connections of the TLS
+ // server, leading to misfiring `server.close()` callback
+ if (socket && socket.server === this.server)
+ socket.server = null;
// For clients, we will always have either a given ca list or be using
// default one
@@ -418,6 +437,7 @@ TLSSocket.prototype._init = function(socket, wrap) {
// set `.onsniselect` callback.
if (process.features.tls_sni &&
options.isServer &&
+ options.SNICallback &&
options.server &&
(options.SNICallback !== SNICallback ||
options.server._contexts.length)) {
@@ -554,6 +574,10 @@ TLSSocket.prototype._start = function() {
return;
}
+ // Socket was destroyed before the connection was established
+ if (!this._handle)
+ return;
+
debug('start');
if (this._tlsOptions.requestOCSP)
this._handle.requestOCSP();
diff --git a/lib/buffer.js b/lib/buffer.js
index d2ca9cdd65d..e3e2083ff9c 100644
--- a/lib/buffer.js
+++ b/lib/buffer.js
@@ -289,8 +289,7 @@ Object.defineProperty(Buffer.prototype, 'offset', {
});
-// toString(encoding, start=0, end=buffer.length)
-Buffer.prototype.toString = function(encoding, start, end) {
+function slowToString(encoding, start, end) {
var loweredCase = false;
start = start >>> 0;
@@ -332,6 +331,15 @@ Buffer.prototype.toString = function(encoding, start, end) {
loweredCase = true;
}
}
+}
+
+
+// toString(encoding, start=0, end=buffer.length)
+Buffer.prototype.toString = function() {
+ const length = this.length | 0;
+ if (arguments.length === 0)
+ return this.utf8Slice(0, length);
+ return slowToString.apply(this, arguments);
};
@@ -417,7 +425,7 @@ Buffer.prototype.get = internalUtil.deprecate(function get(offset) {
if (offset < 0 || offset >= this.length)
throw new RangeError('index out of range');
return this[offset];
-}, '.get() is deprecated. Access using array indexes instead.');
+}, 'Buffer.get is deprecated. Use array indexes instead.');
// XXX remove in v0.13
@@ -426,14 +434,15 @@ Buffer.prototype.set = internalUtil.deprecate(function set(offset, v) {
if (offset < 0 || offset >= this.length)
throw new RangeError('index out of range');
return this[offset] = v;
-}, '.set() is deprecated. Set using array indexes instead.');
+}, 'Buffer.set is deprecated. Use array indexes instead.');
// TODO(trevnorris): fix these checks to follow new standard
// write(string, offset = 0, length = buffer.length, encoding = 'utf8')
var writeWarned = false;
-const writeMsg = '.write(string, encoding, offset, length) is deprecated.' +
- ' Use write(string[, offset[, length]][, encoding]) instead.';
+const writeMsg = 'Buffer.write(string, encoding, offset, length) is ' +
+ 'deprecated. Use write(string[, offset[, length]]' +
+ '[, encoding]) instead.';
Buffer.prototype.write = function(string, offset, length, encoding) {
// Buffer#write(string);
if (offset === undefined) {
diff --git a/lib/child_process.js b/lib/child_process.js
index 6856c532668..d8ca371777f 100644
--- a/lib/child_process.js
+++ b/lib/child_process.js
@@ -1,6 +1,7 @@
'use strict';
const util = require('util');
+const internalUtil = require('internal/util');
const debug = util.debuglog('child_process');
const constants = require('constants');
@@ -269,11 +270,12 @@ exports.execFile = function(file /* args, options, callback */) {
return child;
};
-var _deprecatedCustomFds = util.deprecate(function(options) {
+var _deprecatedCustomFds = internalUtil.deprecate(function(options) {
options.stdio = options.customFds.map(function(fd) {
return fd === -1 ? 'pipe' : fd;
});
-}, 'child_process: customFds option is deprecated, use stdio instead.');
+}, 'child_process: options.customFds option is deprecated. ' +
+ 'Use options.stdio instead.');
function _convertCustomFds(options) {
if (options && options.customFds && !options.stdio) {
diff --git a/lib/crypto.js b/lib/crypto.js
index 6306eee05fc..bfe7837cb4e 100644
--- a/lib/crypto.js
+++ b/lib/crypto.js
@@ -19,6 +19,7 @@ const Buffer = require('buffer').Buffer;
const constants = require('constants');
const stream = require('stream');
const util = require('util');
+const internalUtil = require('internal/util');
const DH_GENERATOR = 2;
@@ -682,10 +683,13 @@ function filterDuplicates(names) {
}
// Legacy API
-exports.__defineGetter__('createCredentials', util.deprecate(function() {
- return require('tls').createSecureContext;
-}, 'createCredentials() is deprecated, use tls.createSecureContext instead'));
+exports.__defineGetter__('createCredentials',
+ internalUtil.deprecate(function() {
+ return require('tls').createSecureContext;
+ }, 'crypto.createCredentials is deprecated. ' +
+ 'Use tls.createSecureContext instead.'));
-exports.__defineGetter__('Credentials', util.deprecate(function() {
+exports.__defineGetter__('Credentials', internalUtil.deprecate(function() {
return require('tls').SecureContext;
-}, 'Credentials is deprecated, use tls.createSecureContext instead'));
+}, 'crypto.Credentials is deprecated. ' +
+ 'Use tls.createSecureContext instead.'));
diff --git a/lib/http.js b/lib/http.js
index a9cfeddeea5..cead865749b 100644
--- a/lib/http.js
+++ b/lib/http.js
@@ -1,6 +1,7 @@
'use strict';
const util = require('util');
+const internalUtil = require('internal/util');
const EventEmitter = require('events').EventEmitter;
@@ -91,9 +92,8 @@ Client.prototype.request = function(method, path, headers) {
return c;
};
-exports.Client = util.deprecate(Client,
- 'http.Client will be removed soon. Do not use it.');
+exports.Client = internalUtil.deprecate(Client, 'http.Client is deprecated.');
-exports.createClient = util.deprecate(function(port, host) {
+exports.createClient = internalUtil.deprecate(function(port, host) {
return new Client(port, host);
-}, 'http.createClient is deprecated. Use `http.request` instead.');
+}, 'http.createClient is deprecated. Use http.request instead.');
diff --git a/lib/internal/util.js b/lib/internal/util.js
index 8019260e0c7..a31f22e6e9f 100644
--- a/lib/internal/util.js
+++ b/lib/internal/util.js
@@ -1,6 +1,20 @@
'use strict';
+const prefix = '(node) ';
+
+// All the internal deprecations have to use this function only, as this will
+// prepend the prefix to the actual message.
+exports.deprecate = function(fn, msg) {
+ return exports._deprecate(fn, `${prefix}${msg}`);
+};
+
+// All the internal deprecations have to use this function only, as this will
+// prepend the prefix to the actual message.
exports.printDeprecationMessage = function(msg, warned) {
+ return exports._printDeprecationMessage(`${prefix}${msg}`, warned);
+};
+
+exports._printDeprecationMessage = function(msg, warned) {
if (process.noDeprecation)
return true;
@@ -10,7 +24,7 @@ exports.printDeprecationMessage = function(msg, warned) {
if (process.throwDeprecation)
throw new Error(msg);
else if (process.traceDeprecation)
- console.trace(msg);
+ console.trace(msg.startsWith(prefix) ? msg.replace(prefix, '') : msg);
else
console.error(msg);
@@ -20,11 +34,11 @@ exports.printDeprecationMessage = function(msg, warned) {
// Mark that a method should not be used.
// Returns a modified function which warns once by default.
// If --no-deprecation is set, then it is a no-op.
-exports.deprecate = function(fn, msg) {
+exports._deprecate = function(fn, msg) {
// Allow for deprecating things in the process of starting up.
if (global.process === undefined) {
return function() {
- return exports.deprecate(fn, msg).apply(this, arguments);
+ return exports._deprecate(fn, msg).apply(this, arguments);
};
}
@@ -34,7 +48,7 @@ exports.deprecate = function(fn, msg) {
var warned = false;
function deprecated() {
- warned = exports.printDeprecationMessage(msg, warned);
+ warned = exports._printDeprecationMessage(msg, warned);
return fn.apply(this, arguments);
}
diff --git a/lib/module.js b/lib/module.js
index d9b4415ad8f..fa7d5ebcda7 100644
--- a/lib/module.js
+++ b/lib/module.js
@@ -2,6 +2,7 @@
const NativeModule = require('native_module');
const util = require('util');
+const internalUtil = require('internal/util');
const runInThisContext = require('vm').runInThisContext;
const assert = require('assert').ok;
const fs = require('fs');
@@ -120,12 +121,7 @@ function tryExtensions(p, exts) {
return false;
}
-
-const noopDeprecateRequireDot = util.deprecate(function() {},
- 'warning: require(\'.\') resolved outside the package directory. ' +
- 'This functionality is deprecated and will be removed soon.');
-
-
+var warned = false;
Module._findPath = function(request, paths) {
var exts = Object.keys(Module._extensions);
@@ -172,7 +168,13 @@ Module._findPath = function(request, paths) {
if (filename) {
// Warn once if '.' resolved outside the module dir
- if (request === '.' && i > 0) noopDeprecateRequireDot();
+ if (request === '.' && i > 0) {
+ warned = internalUtil.printDeprecationMessage(
+ 'warning: require(\'.\') resolved outside the package ' +
+ 'directory. This functionality is deprecated and will be removed ' +
+ 'soon.', warned);
+ }
+
Module._pathCache[cacheKey] = filename;
return filename;
}
diff --git a/lib/net.js b/lib/net.js
index 8cffb33cd63..dbb2bcb7cc7 100644
--- a/lib/net.js
+++ b/lib/net.js
@@ -4,6 +4,7 @@ const events = require('events');
const stream = require('stream');
const timers = require('timers');
const util = require('util');
+const internalUtil = require('internal/util');
const assert = require('assert');
const cares = process.binding('cares_wrap');
const uv = process.binding('uv');
@@ -925,7 +926,9 @@ function lookupAndConnect(self, options) {
// TODO(evanlucas) should we hot path this for localhost?
var addressType = exports.isIP(host);
if (addressType) {
- connect(self, host, port, addressType, localAddress, localPort);
+ process.nextTick(function() {
+ connect(self, host, port, addressType, localAddress, localPort);
+ });
return;
}
@@ -949,7 +952,7 @@ function lookupAndConnect(self, options) {
}
debug('connect: find host ' + host);
- debug('connect: dns options ' + dnsopts);
+ debug('connect: dns options', dnsopts);
self._host = host;
var lookup = options.lookup || dns.lookup;
lookup(host, dnsopts, function(err, ip, addressType) {
@@ -1083,16 +1086,17 @@ function Server(options, connectionListener) {
this._connections = 0;
Object.defineProperty(this, 'connections', {
- get: util.deprecate(function() {
+ get: internalUtil.deprecate(function() {
if (self._usingSlaves) {
return null;
}
return self._connections;
- }, 'connections property is deprecated. Use getConnections() method'),
- set: util.deprecate(function(val) {
+ }, 'Server.connections property is deprecated. ' +
+ 'Use Server.getConnections method instead.'),
+ set: internalUtil.deprecate(function(val) {
return (self._connections = val);
- }, 'connections property is deprecated. Use getConnections() method'),
+ }, 'Server.connections property is deprecated.'),
configurable: true, enumerable: false
});
@@ -1504,9 +1508,9 @@ function emitCloseNT(self) {
}
-Server.prototype.listenFD = util.deprecate(function(fd, type) {
+Server.prototype.listenFD = internalUtil.deprecate(function(fd, type) {
return this.listen({ fd: fd });
-}, 'listenFD is deprecated. Use listen({fd: <number>}).');
+}, 'Server.listenFD is deprecated. Use Server.listen({fd: <number>}) instead.');
Server.prototype._setupSlave = function(socketList) {
this._usingSlaves = true;
diff --git a/lib/os.js b/lib/os.js
index 040c8dac916..2d537f53840 100644
--- a/lib/os.js
+++ b/lib/os.js
@@ -2,6 +2,7 @@
const binding = process.binding('os');
const util = require('util');
+const internalUtil = require('internal/util');
const isWindows = process.platform === 'win32';
exports.hostname = binding.getHostname;
@@ -46,9 +47,10 @@ exports.tmpdir = function() {
exports.tmpDir = exports.tmpdir;
-exports.getNetworkInterfaces = util.deprecate(function() {
+exports.getNetworkInterfaces = internalUtil.deprecate(function() {
return exports.networkInterfaces();
-}, 'getNetworkInterfaces is now called `os.networkInterfaces`.');
+}, 'os.getNetworkInterfaces is deprecated. ' +
+ 'Use os.networkInterfaces instead.');
exports.EOL = isWindows ? '\r\n' : '\n';
diff --git a/lib/path.js b/lib/path.js
index b7e28b22250..69e7992c013 100644
--- a/lib/path.js
+++ b/lib/path.js
@@ -37,6 +37,29 @@ function normalizeArray(parts, allowAboveRoot) {
return res;
}
+// Returns an array with empty elements removed from either end of the input
+// array or the original array if no elements need to be removed
+function trimArray(arr) {
+ var lastIndex = arr.length - 1;
+ var start = 0;
+ for (; start <= lastIndex; start++) {
+ if (arr[start])
+ break;
+ }
+
+ var end = lastIndex;
+ for (; end >= 0; end--) {
+ if (arr[end])
+ break;
+ }
+
+ if (start === 0 && end === lastIndex)
+ return arr;
+ if (start > end)
+ return [];
+ return arr.slice(start, end + 1);
+}
+
// Regex to split a windows path into three parts: [*, device, slash,
// tail] windows-only
const splitDeviceRe =
@@ -62,9 +85,21 @@ function win32SplitPath(filename) {
return [device, dir, basename, ext];
}
-var normalizeUNCRoot = function(device) {
+function win32StatPath(path) {
+ var result = splitDeviceRe.exec(path),
+ device = result[1] || '',
+ isUnc = !!device && device[1] !== ':';
+ return {
+ device,
+ isUnc,
+ isAbsolute: isUnc || !!result[2], // UNC paths are always absolute
+ tail: result[3]
+ };
+}
+
+function normalizeUNCRoot(device) {
return '\\\\' + device.replace(/^[\\\/]+/, '').replace(/[\\\/]+/g, '\\');
-};
+}
// path.resolve([from ...], to)
win32.resolve = function() {
@@ -99,11 +134,11 @@ win32.resolve = function() {
continue;
}
- var result = splitDeviceRe.exec(path),
- device = result[1] || '',
- isUnc = device && device.charAt(1) !== ':',
- isAbsolute = win32.isAbsolute(path),
- tail = result[3];
+ var result = win32StatPath(path),
+ device = result.device,
+ isUnc = result.isUnc,
+ isAbsolute = result.isAbsolute,
+ tail = result.tail;
if (device &&
resolvedDevice &&
@@ -147,11 +182,11 @@ win32.resolve = function() {
win32.normalize = function(path) {
assertPath(path);
- var result = splitDeviceRe.exec(path),
- device = result[1] || '',
- isUnc = device && device.charAt(1) !== ':',
- isAbsolute = win32.isAbsolute(path),
- tail = result[3],
+ var result = win32StatPath(path),
+ device = result.device,
+ isUnc = result.isUnc,
+ isAbsolute = result.isAbsolute,
+ tail = result.tail,
trailingSlash = /[\\\/]$/.test(tail);
// Normalize the tail path
@@ -176,23 +211,19 @@ win32.normalize = function(path) {
win32.isAbsolute = function(path) {
assertPath(path);
-
- var result = splitDeviceRe.exec(path),
- device = result[1] || '',
- isUnc = !!device && device.charAt(1) !== ':';
- // UNC paths are always absolute
- return !!result[2] || isUnc;
+ return win32StatPath(path).isAbsolute;
};
win32.join = function() {
- function f(p) {
- if (typeof p !== 'string') {
- throw new TypeError('Arguments to path.join must be strings');
+ var paths = [];
+ for (var i = 0; i < arguments.length; i++) {
+ var arg = arguments[i];
+ assertPath(arg);
+ if (arg) {
+ paths.push(arg);
}
- return p;
}
- var paths = Array.prototype.filter.call(arguments, f);
var joined = paths.join('\\');
// Make sure that the joined path doesn't start with two slashes, because
@@ -232,25 +263,10 @@ win32.relative = function(from, to) {
var lowerFrom = from.toLowerCase();
var lowerTo = to.toLowerCase();
- function trim(arr) {
- var start = 0;
- for (; start < arr.length; start++) {
- if (arr[start] !== '') break;
- }
-
- var end = arr.length - 1;
- for (; end >= 0; end--) {
- if (arr[end] !== '') break;
- }
-
- if (start > end) return [];
- return arr.slice(start, end + 1);
- }
+ var toParts = trimArray(to.split('\\'));
- var toParts = trim(to.split('\\'));
-
- var lowerFromParts = trim(lowerFrom.split('\\'));
- var lowerToParts = trim(lowerTo.split('\\'));
+ var lowerFromParts = trimArray(lowerFrom.split('\\'));
+ var lowerToParts = trimArray(lowerTo.split('\\'));
var length = Math.min(lowerFromParts.length, lowerToParts.length);
var samePartsLength = length;
@@ -356,15 +372,13 @@ win32.format = function(pathObject) {
var dir = pathObject.dir;
var base = pathObject.base || '';
- if (dir.slice(dir.length - 1, dir.length) === win32.sep) {
- return dir + base;
+ if (!dir) {
+ return base;
}
-
- if (dir) {
- return dir + win32.sep + base;
+ if (dir[dir.length - 1] === win32.sep) {
+ return dir + base;
}
-
- return base;
+ return dir + win32.sep + base;
};
@@ -377,7 +391,7 @@ win32.parse = function(pathString) {
}
return {
root: allParts[0],
- dir: allParts[0] + allParts[1].slice(0, allParts[1].length - 1),
+ dir: allParts[0] + allParts[1].slice(0, -1),
base: allParts[2],
ext: allParts[3],
name: allParts[2].slice(0, allParts[2].length - allParts[3].length)
@@ -418,7 +432,7 @@ posix.resolve = function() {
}
resolvedPath = path + '/' + resolvedPath;
- resolvedAbsolute = path.charAt(0) === '/';
+ resolvedAbsolute = path[0] === '/';
}
// At this point the path should be resolved to a full absolute path, but
@@ -437,7 +451,7 @@ posix.normalize = function(path) {
assertPath(path);
var isAbsolute = posix.isAbsolute(path),
- trailingSlash = path.substr(-1) === '/';
+ trailingSlash = path && path[path.length - 1] === '/';
// Normalize the path
path = normalizeArray(path.split('/'), !isAbsolute).join('/');
@@ -455,7 +469,7 @@ posix.normalize = function(path) {
// posix version
posix.isAbsolute = function(path) {
assertPath(path);
- return path.charAt(0) === '/';
+ return !!path && path[0] === '/';
};
// posix version
@@ -487,23 +501,8 @@ posix.relative = function(from, to) {
from = posix.resolve(from).substr(1);
to = posix.resolve(to).substr(1);
- function trim(arr) {
- var start = 0;
- for (; start < arr.length; start++) {
- if (arr[start] !== '') break;
- }
-
- var end = arr.length - 1;
- for (; end >= 0; end--) {
- if (arr[end] !== '') break;
- }
-
- if (start > end) return [];
- return arr.slice(start, end + 1);
- }
-
- var fromParts = trim(from.split('/'));
- var toParts = trim(to.split('/'));
+ var fromParts = trimArray(from.split('/'));
+ var toParts = trimArray(to.split('/'));
var length = Math.min(fromParts.length, toParts.length);
var samePartsLength = length;
@@ -602,7 +601,7 @@ posix.parse = function(pathString) {
return {
root: allParts[0],
- dir: allParts[0] + allParts[1].slice(0, allParts[1].length - 1),
+ dir: allParts[0] + allParts[1].slice(0, -1),
base: allParts[2],
ext: allParts[3],
name: allParts[2].slice(0, allParts[2].length - allParts[3].length)
diff --git a/lib/readline.js b/lib/readline.js
index fa51c16cc9d..2c1294608dc 100644
--- a/lib/readline.js
+++ b/lib/readline.js
@@ -9,6 +9,7 @@
const kHistorySize = 30;
const util = require('util');
+const internalUtil = require('internal/util');
const inherits = util.inherits;
const Buffer = require('buffer').Buffer;
const EventEmitter = require('events').EventEmitter;
@@ -1418,8 +1419,9 @@ function codePointAt(str, index) {
}
return code;
}
-exports.codePointAt = util.deprecate(codePointAt,
- 'codePointAt() is deprecated. Use String.prototype.codePointAt');
+exports.codePointAt = internalUtil.deprecate(codePointAt,
+ 'readline.codePointAt is deprecated. ' +
+ 'Use String.prototype.codePointAt instead.');
/**
diff --git a/lib/repl.js b/lib/repl.js
index 420fde45eb6..763e283816b 100644
--- a/lib/repl.js
+++ b/lib/repl.js
@@ -611,9 +611,7 @@ REPLServer.prototype.complete = function(line, callback) {
if (!expr) {
// If context is instance of vm.ScriptContext
// Get global vars synchronously
- if (this.useGlobal ||
- this.context.constructor &&
- this.context.constructor.name === 'Context') {
+ if (this.useGlobal || vm.isContext(this.context)) {
var contextProto = this.context;
while (contextProto = Object.getPrototypeOf(contextProto)) {
completionGroups.push(Object.getOwnPropertyNames(contextProto));
@@ -643,7 +641,14 @@ REPLServer.prototype.complete = function(line, callback) {
if (obj != null) {
if (typeof obj === 'object' || typeof obj === 'function') {
- memberGroups.push(Object.getOwnPropertyNames(obj));
+ try {
+ memberGroups.push(Object.getOwnPropertyNames(obj));
+ } catch (ex) {
+ // Probably a Proxy object without `getOwnPropertyNames` trap.
+ // We simply ignore it here, as we don't want to break the
+ // autocompletion. Fixes the bug
+ // https://github.com/nodejs/io.js/issues/2119
+ }
}
// works for non-objects
try {
@@ -857,7 +862,6 @@ function addStandardGlobals(completionGroups, filter) {
}
function defineDefaultCommands(repl) {
- // TODO remove me after 0.3.x
repl.defineCommand('break', {
help: 'Sometimes you get stuck, this gets you out',
action: function() {
@@ -996,7 +1000,7 @@ function isRecoverableError(e, self) {
self._inTemplateLiteral = true;
return true;
}
- return /^(Unexpected end of input|Unexpected token :)/.test(message);
+ return /^(Unexpected end of input|Unexpected token)/.test(message);
}
return false;
}
diff --git a/lib/smalloc.js b/lib/smalloc.js
new file mode 100644
index 00000000000..9d52e02cd09
--- /dev/null
+++ b/lib/smalloc.js
@@ -0,0 +1,7 @@
+'use strict';
+
+const util = require('internal/util');
+
+module.exports = require('internal/smalloc');
+util.printDeprecationMessage('smalloc is deprecated. ' +
+ 'Use typed arrays instead.');
diff --git a/lib/tty.js b/lib/tty.js
index acab1b5735c..f3f84ca5a6e 100644
--- a/lib/tty.js
+++ b/lib/tty.js
@@ -1,6 +1,7 @@
'use strict';
const util = require('util');
+const internalUtil = require('internal/util');
const net = require('net');
const TTY = process.binding('tty_wrap').TTY;
const isTTY = process.binding('tty_wrap').isTTY;
@@ -14,12 +15,13 @@ exports.isatty = function(fd) {
// backwards-compat
-exports.setRawMode = util.deprecate(function(flag) {
+exports.setRawMode = internalUtil.deprecate(function(flag) {
if (!process.stdin.isTTY) {
throw new Error('can\'t set raw mode on non-tty');
}
process.stdin.setRawMode(flag);
-}, 'tty.setRawMode: Use `process.stdin.setRawMode()` instead.');
+}, 'tty.setRawMode is deprecated. ' +
+ 'Use process.stdin.setRawMode instead.');
function ReadStream(fd, options) {
diff --git a/lib/url.js b/lib/url.js
index 8da2f025dc8..55c5248e475 100644
--- a/lib/url.js
+++ b/lib/url.js
@@ -162,7 +162,7 @@ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {
//
// ex:
// http://a@b@c/ => user:a@b host:c
- // http://a@b?@c => user:a host:c path:/?@c
+ // http://a@b?@c => user:a host:b path:/?@c
// v0.12 TODO(isaacs): This is not quite how Chrome does things.
// Review our test case against browsers more comprehensively.
diff --git a/lib/util.js b/lib/util.js
index 50f1e1b5313..89017450e02 100644
--- a/lib/util.js
+++ b/lib/util.js
@@ -48,7 +48,7 @@ exports.format = function(f) {
};
-exports.deprecate = internalUtil.deprecate;
+exports.deprecate = internalUtil._deprecate;
var debugs = {};
@@ -730,50 +730,50 @@ function hasOwnProperty(obj, prop) {
// Deprecated old stuff.
-exports.p = exports.deprecate(function() {
+exports.p = internalUtil.deprecate(function() {
for (var i = 0, len = arguments.length; i < len; ++i) {
console.error(exports.inspect(arguments[i]));
}
-}, 'util.p: Use console.error() instead');
+}, 'util.p is deprecated. Use console.error instead.');
-exports.exec = exports.deprecate(function() {
+exports.exec = internalUtil.deprecate(function() {
return require('child_process').exec.apply(this, arguments);
-}, 'util.exec is now called `child_process.exec`.');
+}, 'util.exec is deprecated. Use child_process.exec instead.');
-exports.print = exports.deprecate(function() {
+exports.print = internalUtil.deprecate(function() {
for (var i = 0, len = arguments.length; i < len; ++i) {
process.stdout.write(String(arguments[i]));
}
-}, 'util.print: Use console.log instead');
+}, 'util.print is deprecated. Use console.log instead.');
-exports.puts = exports.deprecate(function() {
+exports.puts = internalUtil.deprecate(function() {
for (var i = 0, len = arguments.length; i < len; ++i) {
process.stdout.write(arguments[i] + '\n');
}
-}, 'util.puts: Use console.log instead');
+}, 'util.puts is deprecated. Use console.log instead.');
-exports.debug = exports.deprecate(function(x) {
+exports.debug = internalUtil.deprecate(function(x) {
process.stderr.write('DEBUG: ' + x + '\n');
-}, 'util.debug: Use console.error instead');
+}, 'util.debug is deprecated. Use console.error instead.');
-exports.error = exports.deprecate(function(x) {
+exports.error = internalUtil.deprecate(function(x) {
for (var i = 0, len = arguments.length; i < len; ++i) {
process.stderr.write(arguments[i] + '\n');
}
-}, 'util.error: Use console.error instead');
+}, 'util.error is deprecated. Use console.error instead.');
-exports.pump = exports.deprecate(function(readStream, writeStream, callback) {
+exports.pump = internalUtil.deprecate(function(readStream, writeStream, cb) {
var callbackCalled = false;
function call(a, b, c) {
- if (callback && !callbackCalled) {
- callback(a, b, c);
+ if (cb && !callbackCalled) {
+ cb(a, b, c);
callbackCalled = true;
}
}
@@ -803,7 +803,7 @@ exports.pump = exports.deprecate(function(readStream, writeStream, callback) {
readStream.destroy();
call(err);
});
-}, 'util.pump(): Use readableStream.pipe() instead');
+}, 'util.pump is deprecated. Use readableStream.pipe instead.');
exports._errnoException = function(err, syscall, original) {
diff --git a/src/js_stream.cc b/src/js_stream.cc
index 7a779b451f8..aa8de3a9ad9 100644
--- a/src/js_stream.cc
+++ b/src/js_stream.cc
@@ -168,7 +168,7 @@ template <class Wrap>
void JSStream::Finish(const FunctionCallbackInfo<Value>& args) {
Wrap* w = Unwrap<Wrap>(args[0].As<Object>());
- w->Done(args[0]->Int32Value());
+ w->Done(args[1]->Int32Value());
}
diff --git a/src/node.cc b/src/node.cc
index 7a949adfb59..356dc732dd6 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -2832,13 +2832,6 @@ void SetupProcessObject(Environment* env,
READONLY_PROPERTY(process, "traceDeprecation", True(env->isolate()));
}
- // --trace-sync-io
- if (trace_sync_io) {
- READONLY_PROPERTY(process, "traceSyncIO", True(env->isolate()));
- // Don't env->set_trace_sync_io(true) because it will be enabled
- // after LoadEnvironment() has run.
- }
-
size_t exec_path_len = 2 * PATH_MAX;
char* exec_path = new char[exec_path_len];
Local<String> exec_path_value;
diff --git a/src/node.js b/src/node.js
index 3aa84dae763..9d19e78d2f7 100644
--- a/src/node.js
+++ b/src/node.js
@@ -698,7 +698,7 @@
// not-reading state.
if (stdin._handle && stdin._handle.readStop) {
stdin._handle.reading = false;
- stdin._readableState.reading = false;
+ stdin.push('');
stdin._handle.readStop();
}
@@ -707,7 +707,7 @@
stdin.on('pause', function() {
if (!stdin._handle)
return;
- stdin._readableState.reading = false;
+ stdin.push('');
stdin._handle.reading = false;
stdin._handle.readStop();
});
diff --git a/src/node_buffer.cc b/src/node_buffer.cc
index 37f08632cbe..0074363bd9f 100644
--- a/src/node_buffer.cc
+++ b/src/node_buffer.cc
@@ -32,6 +32,12 @@
if (name##_length > 0) \
CHECK_NE(name##_data, nullptr);
+#define THROW_AND_RETURN_UNLESS_BUFFER(env, obj) \
+ do { \
+ if (!HasInstance(obj)) \
+ return env->ThrowTypeError("argument should be a Buffer"); \
+ } while (0)
+
#define SLICE_START_END(start_arg, end_arg, end_max) \
size_t start; \
size_t end; \
@@ -478,7 +484,12 @@ void StringSlice(const FunctionCallbackInfo<Value>& args) {
Environment* env = Environment::GetCurrent(args);
Isolate* isolate = env->isolate();
+ THROW_AND_RETURN_UNLESS_BUFFER(env, args.This());
SPREAD_ARG(args.This(), ts_obj);
+
+ if (ts_obj_length == 0)
+ return args.GetReturnValue().SetEmptyString();
+
SLICE_START_END(args[0], args[1], ts_obj_length)
args.GetReturnValue().Set(
@@ -490,7 +501,12 @@ template <>
void StringSlice<UCS2>(const FunctionCallbackInfo<Value>& args) {
Environment* env = Environment::GetCurrent(args);
+ THROW_AND_RETURN_UNLESS_BUFFER(env, args.This());
SPREAD_ARG(args.This(), ts_obj);
+
+ if (ts_obj_length == 0)
+ return args.GetReturnValue().SetEmptyString();
+
SLICE_START_END(args[0], args[1], ts_obj_length)
length /= 2;
@@ -558,10 +574,9 @@ void Base64Slice(const FunctionCallbackInfo<Value>& args) {
void Copy(const FunctionCallbackInfo<Value> &args) {
Environment* env = Environment::GetCurrent(args);
- if (!HasInstance(args[0]))
- return env->ThrowTypeError("first arg should be a Buffer");
-
- Local<Object> target_obj = args[0]->ToObject(env->isolate());
+ THROW_AND_RETURN_UNLESS_BUFFER(env, args.This());
+ THROW_AND_RETURN_UNLESS_BUFFER(env, args[0]);
+ Local<Object> target_obj = args[0].As<Object>();
SPREAD_ARG(args.This(), ts_obj);
SPREAD_ARG(target_obj, target);
@@ -593,6 +608,7 @@ void Copy(const FunctionCallbackInfo<Value> &args) {
void Fill(const FunctionCallbackInfo<Value>& args) {
+ THROW_AND_RETURN_UNLESS_BUFFER(Environment::GetCurrent(args), args[0]);
SPREAD_ARG(args[0], ts_obj);
size_t start = args[2]->Uint32Value();
@@ -636,6 +652,7 @@ template <encoding encoding>
void StringWrite(const FunctionCallbackInfo<Value>& args) {
Environment* env = Environment::GetCurrent(args);
+ THROW_AND_RETURN_UNLESS_BUFFER(env, args.This());
SPREAD_ARG(args.This(), ts_obj);
if (!args[0]->IsString())
@@ -712,6 +729,7 @@ static inline void Swizzle(char* start, unsigned int len) {
template <typename T, enum Endianness endianness>
void ReadFloatGeneric(const FunctionCallbackInfo<Value>& args) {
+ THROW_AND_RETURN_UNLESS_BUFFER(Environment::GetCurrent(args), args[0]);
SPREAD_ARG(args[0], ts_obj);
uint32_t offset = args[1]->Uint32Value();
@@ -775,21 +793,25 @@ uint32_t WriteFloatGeneric(const FunctionCallbackInfo<Value>& args) {
void WriteFloatLE(const FunctionCallbackInfo<Value>& args) {
+ THROW_AND_RETURN_UNLESS_BUFFER(Environment::GetCurrent(args), args[0]);
args.GetReturnValue().Set(WriteFloatGeneric<float, kLittleEndian>(args));
}
void WriteFloatBE(const FunctionCallbackInfo<Value>& args) {
+ THROW_AND_RETURN_UNLESS_BUFFER(Environment::GetCurrent(args), args[0]);
args.GetReturnValue().Set(WriteFloatGeneric<float, kBigEndian>(args));
}
void WriteDoubleLE(const FunctionCallbackInfo<Value>& args) {
+ THROW_AND_RETURN_UNLESS_BUFFER(Environment::GetCurrent(args), args[0]);
args.GetReturnValue().Set(WriteFloatGeneric<double, kLittleEndian>(args));
}
void WriteDoubleBE(const FunctionCallbackInfo<Value>& args) {
+ THROW_AND_RETURN_UNLESS_BUFFER(Environment::GetCurrent(args), args[0]);
args.GetReturnValue().Set(WriteFloatGeneric<double, kBigEndian>(args));
}
@@ -803,6 +825,10 @@ void ByteLengthUtf8(const FunctionCallbackInfo<Value> &args) {
void Compare(const FunctionCallbackInfo<Value> &args) {
+ Environment* env = Environment::GetCurrent(args);
+
+ THROW_AND_RETURN_UNLESS_BUFFER(env, args[0]);
+ THROW_AND_RETURN_UNLESS_BUFFER(env, args[1]);
SPREAD_ARG(args[0], obj_a);
SPREAD_ARG(args[1], obj_b);
@@ -845,10 +871,10 @@ int32_t IndexOf(const char* haystack,
void IndexOfString(const FunctionCallbackInfo<Value>& args) {
- ASSERT(args[0]->IsObject());
ASSERT(args[1]->IsString());
ASSERT(args[2]->IsNumber());
+ THROW_AND_RETURN_UNLESS_BUFFER(Environment::GetCurrent(args), args[0]);
SPREAD_ARG(args[0], ts_obj);
node::Utf8Value str(args.GetIsolate(), args[1]);
@@ -877,10 +903,10 @@ void IndexOfString(const FunctionCallbackInfo<Value>& args) {
void IndexOfBuffer(const FunctionCallbackInfo<Value>& args) {
- ASSERT(args[0]->IsObject());
ASSERT(args[1]->IsObject());
ASSERT(args[2]->IsNumber());
+ THROW_AND_RETURN_UNLESS_BUFFER(Environment::GetCurrent(args), args[0]);
SPREAD_ARG(args[0], ts_obj);
SPREAD_ARG(args[1], buf);
const int32_t offset_i32 = args[2]->Int32Value();
@@ -911,10 +937,10 @@ void IndexOfBuffer(const FunctionCallbackInfo<Value>& args) {
void IndexOfNumber(const FunctionCallbackInfo<Value>& args) {
- ASSERT(args[0]->IsObject());
ASSERT(args[1]->IsNumber());
ASSERT(args[2]->IsNumber());
+ THROW_AND_RETURN_UNLESS_BUFFER(Environment::GetCurrent(args), args[0]);
SPREAD_ARG(args[0], ts_obj);
uint32_t needle = args[1]->Uint32Value();
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
index 1b921fbb4b5..4e343afeaf8 100644
--- a/src/node_crypto.cc
+++ b/src/node_crypto.cc
@@ -2312,7 +2312,7 @@ inline CheckResult CheckWhitelistedServerCert(X509_STORE_CTX* ctx) {
inline int VerifyCallback(int preverify_ok, X509_STORE_CTX* ctx) {
// Failure on verification of the cert is handled in
// Connection::VerifyError.
- if (preverify_ok == 0)
+ if (preverify_ok == 0 || X509_STORE_CTX_get_error(ctx) != X509_V_OK)
return 1;
// Server does not need to check the whitelist.
diff --git a/src/tls_wrap.cc b/src/tls_wrap.cc
index 7cf9945dc69..fc19a5ce0bb 100644
--- a/src/tls_wrap.cc
+++ b/src/tls_wrap.cc
@@ -320,6 +320,10 @@ void TLSWrap::EncOutCb(WriteWrap* req_wrap, int status) {
TLSWrap* wrap = req_wrap->wrap()->Cast<TLSWrap>();
req_wrap->Dispose();
+ // We should not be getting here after `DestroySSL`, because all queued writes
+ // must be invoked with UV_ECANCELED
+ CHECK_NE(wrap->ssl_, nullptr);
+
// Handle error
if (status) {
// Ignore errors after shutdown
@@ -331,9 +335,6 @@ void TLSWrap::EncOutCb(WriteWrap* req_wrap, int status) {
return;
}
- if (wrap->ssl_ == nullptr)
- return;
-
// Commit
NodeBIO::FromBIO(wrap->enc_out_)->Read(nullptr, wrap->write_size_);
diff --git a/test/disabled/test-cat.js b/test/disabled/test-cat.js
deleted file mode 100644
index e37820ba4b3..00000000000
--- a/test/disabled/test-cat.js
+++ /dev/null
@@ -1,53 +0,0 @@
-'use strict';
-var common = require('../common.js');
-var assert = require('assert');
-var http = require('http');
-
-console.log('hello world');
-
-var body = 'exports.A = function() { return "A";}';
-var server = http.createServer(function(req, res) {
- console.log('req?');
- res.sendHeader(200, {
- 'Content-Length': body.length,
- 'Content-Type': 'text/plain'
- });
- res.sendBody(body);
- res.finish();
-});
-server.listen(common.PORT);
-
-var errors = 0;
-var successes = 0;
-
-var promise = process.cat('http://localhost:' + common.PORT, 'utf8');
-
-promise.addCallback(function(content) {
- assert.equal(body, content);
- server.close();
- successes += 1;
-});
-
-promise.addErrback(function() {
- errors += 1;
-});
-
-var dirname = process.path.dirname(__filename);
-var fixtures = process.path.join(dirname, 'fixtures');
-var x = process.path.join(fixtures, 'x.txt');
-
-promise = process.cat(x, 'utf8');
-
-promise.addCallback(function(content) {
- assert.equal('xyz', content.replace(/[\r\n]/, ''));
- successes += 1;
-});
-
-promise.addErrback(function() {
- errors += 1;
-});
-
-process.on('exit', function() {
- assert.equal(2, successes);
- assert.equal(0, errors);
-});
diff --git a/test/disabled/test-child-process-custom-fds.js b/test/disabled/test-child-process-custom-fds.js
deleted file mode 100644
index 12087684727..00000000000
--- a/test/disabled/test-child-process-custom-fds.js
+++ /dev/null
@@ -1,94 +0,0 @@
-'use strict';
-var common = require('../common');
-var assert = require('assert');
-
-var assert = require('assert');
-var spawn = require('child_process').spawn;
-var path = require('path');
-var fs = require('fs');
-
-function fixtPath(p) {
- return path.join(common.fixturesDir, p);
-}
-
-var expected = 'hello world';
-
-// Test the equivalent of:
-// $ /bin/echo 'hello world' > hello.txt
-var helloPath = path.join(common.tmpDir, 'hello.txt');
-
-function test1(next) {
- console.log('Test 1...');
- fs.open(helloPath, 'w', 400, function(err, fd) {
- if (err) throw err;
- var child = spawn('/bin/echo', [expected], {customFds: [-1, fd]});
-
- assert.notEqual(child.stdin, null);
- assert.equal(child.stdout, null);
- assert.notEqual(child.stderr, null);
-
- child.on('exit', function(err) {
- if (err) throw err;
- fs.close(fd, function(error) {
- if (error) throw error;
-
- fs.readFile(helloPath, function(err, data) {
- if (err) throw err;
- assert.equal(data.toString(), expected + '\n');
- console.log(' File was written.');
- next(test3);
- });
- });
- });
- });
-}
-
-// Test the equivalent of:
-// $ node ../fixture/stdio-filter.js < hello.txt
-function test2(next) {
- console.log('Test 2...');
- fs.open(helloPath, 'r', undefined, function(err, fd) {
- var child = spawn(process.argv[0],
- [fixtPath('stdio-filter.js'), 'o', 'a'],
- {customFds: [fd, -1, -1]});
-
- assert.equal(child.stdin, null);
- var actualData = '';
- child.stdout.on('data', function(data) {
- actualData += data.toString();
- });
- child.on('exit', function(code) {
- if (err) throw err;
- assert.equal(actualData, 'hella warld\n');
- console.log(' File was filtered successfully');
- fs.close(fd, function() {
- next(test3);
- });
- });
- });
-}
-
-// Test the equivalent of:
-// $ /bin/echo 'hello world' | ../stdio-filter.js a o
-function test3(next) {
- console.log('Test 3...');
- var filter = spawn(process.argv[0], [fixtPath('stdio-filter.js'), 'o', 'a']);
- var echo = spawn('/bin/echo', [expected], {customFds: [-1, filter.fds[0]]});
- var actualData = '';
- filter.stdout.on('data', function(data) {
- console.log(' Got data --> ' + data);
- actualData += data;
- });
- filter.on('exit', function(code) {
- if (code) throw 'Return code was ' + code;
- assert.equal(actualData, 'hella warld\n');
- console.log(' Talked to another process successfully');
- });
- echo.on('exit', function(code) {
- if (code) throw 'Return code was ' + code;
- filter.stdin.end();
- fs.unlinkSync(helloPath);
- });
-}
-
-test1(test2);
diff --git a/test/disabled/test-child-process-customfd-bounded.js b/test/disabled/test-child-process-customfd-bounded.js
deleted file mode 100644
index 98da4ef4d13..00000000000
--- a/test/disabled/test-child-process-customfd-bounded.js
+++ /dev/null
@@ -1,9 +0,0 @@
-'use strict';
-var common = require('../common');
-
-var bigish = Array(200);
-
-for (var i = 0, il = bigish.length; i < il; ++i)
- bigish[i] = -1;
-
-common.spawnPwd({ customFds: bigish });
diff --git a/test/disabled/test-dgram-multicast.js b/test/disabled/test-dgram-multicast.js
deleted file mode 100644
index f2668d24c9a..00000000000
--- a/test/disabled/test-dgram-multicast.js
+++ /dev/null
@@ -1,96 +0,0 @@
-'use strict';
-var common = require('../common');
-var assert = require('assert');
-
-var dgram = require('dgram'),
- util = require('util'),
- assert = require('assert'),
- Buffer = require('buffer').Buffer;
-var LOCAL_BROADCAST_HOST = '224.0.0.1';
-var sendMessages = [
- new Buffer('First message to send'),
- new Buffer('Second message to send'),
- new Buffer('Third message to send'),
- new Buffer('Fourth message to send')
-];
-
-var listenSockets = [];
-
-var sendSocket = dgram.createSocket('udp4');
-
-sendSocket.on('close', function() {
- console.error('sendSocket closed');
-});
-
-sendSocket.setBroadcast(true);
-sendSocket.setMulticastTTL(1);
-sendSocket.setMulticastLoopback(true);
-
-var i = 0;
-
-sendSocket.sendNext = function() {
- var buf = sendMessages[i++];
-
- if (!buf) {
- try { sendSocket.close(); } catch (e) {}
- return;
- }
-
- sendSocket.send(buf, 0, buf.length,
- common.PORT, LOCAL_BROADCAST_HOST, function(err) {
- if (err) throw err;
- console.error('sent %s to %s', util.inspect(buf.toString()),
- LOCAL_BROADCAST_HOST + common.PORT);
- process.nextTick(sendSocket.sendNext);
- });
-};
-
-var listener_count = 0;
-
-function mkListener() {
- var receivedMessages = [];
- var listenSocket = dgram.createSocket('udp4');
- listenSocket.addMembership(LOCAL_BROADCAST_HOST);
-
- listenSocket.on('message', function(buf, rinfo) {
- console.error('received %s from %j', util.inspect(buf.toString()), rinfo);
- receivedMessages.push(buf);
-
- if (receivedMessages.length == sendMessages.length) {
- listenSocket.dropMembership(LOCAL_BROADCAST_HOST);
- process.nextTick(function() { // TODO should be changed to below.
- // listenSocket.dropMembership(LOCAL_BROADCAST_HOST, function() {
- listenSocket.close();
- });
- }
- });
-
- listenSocket.on('close', function() {
- console.error('listenSocket closed -- checking received messages');
- var count = 0;
- receivedMessages.forEach(function(buf) {
- for (var i = 0; i < sendMessages.length; ++i) {
- if (buf.toString() === sendMessages[i].toString()) {
- count++;
- break;
- }
- }
- });
- console.error('count %d', count);
- //assert.strictEqual(count, sendMessages.length);
- });
-
- listenSocket.on('listening', function() {
- listenSockets.push(listenSocket);
- if (listenSockets.length == 3) {
- sendSocket.sendNext();
- }
- });
-
- listenSocket.bind(common.PORT);
-}
-
-mkListener();
-mkListener();
-mkListener();
-
diff --git a/test/disabled/test-dgram-unix-anon.js b/test/disabled/test-dgram-unix-anon.js
deleted file mode 100644
index 417ff8c2915..00000000000
--- a/test/disabled/test-dgram-unix-anon.js
+++ /dev/null
@@ -1,58 +0,0 @@
-'use strict';
-var common = require('../common');
-var assert = require('assert');
-
-var Buffer = require('buffer').Buffer,
- fs = require('fs'),
- dgram = require('dgram'), server, client,
- server_path = '/tmp/dgram_server_sock',
- messages_to_send = [
- new Buffer('First message to send'),
- new Buffer('Second message to send'),
- new Buffer('Third message to send'),
- new Buffer('Fourth message to send')
- ],
- timer;
-
-server = dgram.createSocket('unix_dgram');
-server.bind(server_path);
-server.messages = [];
-server.on('message', function(msg, rinfo) {
- console.log('server got: ' + msg);
- assert.strictEqual(rinfo.address, ''); // anon client sending
- server.messages.push(msg.toString());
- if (server.messages.length === messages_to_send.length) {
- server.messages.forEach(function(m, i) {
- assert.strictEqual(m, messages_to_send[i].toString());
- });
- server.close();
- client.close();
- }
-});
-server.on('listening', function() {
- console.log('server is listening');
- client = dgram.createSocket('unix_dgram');
- messages_to_send.forEach(function(m) {
- client.send(m, 0, m.length, server_path, function(err, bytes) {
- if (err) {
- console.log('Caught error in client send.');
- throw err;
- }
- console.log('client wrote ' + bytes + ' bytes.');
- });
- });
- client.on('close', function() {
- if (server.fd === null) {
- clearTimeout(timer);
- }
- });
-});
-server.on('close', function() {
- if (client.fd === null) {
- clearTimeout(timer);
- }
-});
-
-timer = setTimeout(function() {
- throw new Error('Timeout');
-}, 500);
diff --git a/test/disabled/test-dgram-unix.js b/test/disabled/test-dgram-unix.js
deleted file mode 100644
index d8ebd81a92d..00000000000
--- a/test/disabled/test-dgram-unix.js
+++ /dev/null
@@ -1,52 +0,0 @@
-'use strict';
-var common = require('../common');
-var assert = require('assert');
-
-var fs = require('fs');
-var dgram = require('dgram');
-
-// TODO use common.tmpDir here
-var serverPath = '/tmp/dgram_server_sock';
-var clientPath = '/tmp/dgram_client_sock';
-
-var msgToSend = new Buffer('A message to send');
-
-var server = dgram.createSocket('unix_dgram');
-server.on('message', function(msg, rinfo) {
- console.log('server got: ' + msg + ' from ' + rinfo.address);
- assert.strictEqual(rinfo.address, clientPath);
- assert.strictEqual(msg.toString(), msgToSend.toString());
- server.send(msg, 0, msg.length, rinfo.address);
-});
-
-server.on('listening', function() {
- console.log('server is listening');
-
- var client = dgram.createSocket('unix_dgram');
-
- client.on('message', function(msg, rinfo) {
- console.log('client got: ' + msg + ' from ' + rinfo.address);
- assert.strictEqual(rinfo.address, serverPath);
- assert.strictEqual(msg.toString(), msgToSend.toString());
- client.close();
- server.close();
- });
-
- client.on('listening', function() {
- console.log('client is listening');
- client.send(msgToSend, 0, msgToSend.length, serverPath,
- function(err, bytes) {
- if (err) {
- console.log('Caught error in client send.');
- throw err;
- }
- console.log('client wrote ' + bytes + ' bytes.');
- assert.strictEqual(bytes, msgToSend.length);
- });
- });
-
-
- client.bind(clientPath);
-});
-
-server.bind(serverPath);
diff --git a/test/disabled/test-eio-race2.js b/test/disabled/test-eio-race2.js
deleted file mode 100644
index 16c0468775a..00000000000
--- a/test/disabled/test-eio-race2.js
+++ /dev/null
@@ -1,23 +0,0 @@
-'use strict';
-var common = require('../common');
-var assert = require('assert');
-var path = require('path');
-var testTxt = path.join(common.fixturesDir, 'x.txt');
-var fs = require('fs');
-
-setTimeout(function() {
- // put this in a timeout, just so it doesn't get bunched up with the
- // require() calls..
- var N = 30;
- for (var i = 0; i < N; i++) {
- console.log('start ' + i);
- fs.readFile(testTxt, function(err, data) {
- if (err) {
- console.log('error! ' + e);
- process.exit(1);
- } else {
- console.log('finish');
- }
- });
- }
-}, 100);
diff --git a/test/disabled/test-eio-race3.js b/test/disabled/test-eio-race3.js
deleted file mode 100644
index 872a105dd5a..00000000000
--- a/test/disabled/test-eio-race3.js
+++ /dev/null
@@ -1,20 +0,0 @@
-'use strict';
-/* XXX Can this test be modified to not call the now-removed wait()? */
-
-var common = require('../common');
-var assert = require('assert');
-
-
-console.log('first stat ...');
-
-fs.stat(__filename)
- .addCallback(function(stats) {
- console.log('second stat ...');
- fs.stat(__filename)
- .timeout(1000)
- .wait();
- console.log('test passed');
- })
- .addErrback(function() {
- throw new Exception();
- });
diff --git a/test/disabled/test-eio-race4.js b/test/disabled/test-eio-race4.js
deleted file mode 100644
index d22c4225b15..00000000000
--- a/test/disabled/test-eio-race4.js
+++ /dev/null
@@ -1,22 +0,0 @@
-'use strict';
-var common = require('../common');
-var assert = require('assert');
-var fs = require('fs');
-var N = 100;
-var j = 0;
-
-for (var i = 0; i < N; i++) {
- // these files don't exist
- fs.stat('does-not-exist-' + i, function(err) {
- if (err) {
- j++; // only makes it to about 17
- console.log('finish ' + j);
- } else {
- throw new Error('this shouldn\'t be called');
- }
- });
-}
-
-process.on('exit', function() {
- assert.equal(N, j);
-});
diff --git a/test/disabled/test-http-agent2.js b/test/disabled/test-http-agent2.js
deleted file mode 100644
index 928194757b3..00000000000
--- a/test/disabled/test-http-agent2.js
+++ /dev/null
@@ -1,64 +0,0 @@
-'use strict';
-var common = require('../common');
-var assert = require('assert');
-var http = require('http');
-
-var reqEndCount = 0;
-
-var server = http.Server(function(req, res) {
- res.writeHead(200);
- res.end('hello world\n');
-
- var buffer = '';
-
- req.setEncoding('utf8');
-
- req.on('data', function(s) {
- buffer += s;
- });
-
- req.on('end', function() {
- reqEndCount++;
- assert.equal(body, buffer);
- });
-});
-
-var responses = 0;
-var N = 10;
-var M = 10;
-
-var body = '';
-for (var i = 0; i < 1000; i++) {
- body += 'hello world';
-}
-
-var options = {
- port: common.PORT,
- path: '/',
- method: 'PUT'
-};
-
-server.listen(common.PORT, function() {
- for (var i = 0; i < N; i++) {
- setTimeout(function() {
- for (var j = 0; j < M; j++) {
-
- var req = http.request(options, function(res) {
- console.log(res.statusCode);
- if (++responses == N * M) server.close();
- }).on('error', function(e) {
- console.log(e.message);
- process.exit(1);
- });
-
- req.end(body);
- }
- }, i);
- }
-});
-
-
-process.on('exit', function() {
- assert.equal(N * M, responses);
- assert.equal(N * M, reqEndCount);
-});
diff --git a/test/disabled/test-http-big-proxy-responses.js b/test/disabled/test-http-big-proxy-responses.js
deleted file mode 100644
index 9727edbb806..00000000000
--- a/test/disabled/test-http-big-proxy-responses.js
+++ /dev/null
@@ -1,112 +0,0 @@
-'use strict';
-var common = require('../common');
-var assert = require('assert');
-var util = require('util'),
- fs = require('fs'),
- http = require('http'),
- url = require('url');
-
-var chunk = '01234567890123456789';
-
-// Produce a very large response.
-var chargen = http.createServer(function(req, res) {
- var len = parseInt(req.headers['x-len'], 10);
- assert.ok(len > 0);
- res.writeHead(200, {'transfer-encoding': 'chunked'});
- for (var i = 0; i < len; i++) {
- if (i % 1000 == 0) common.print(',');
- res.write(chunk);
- }
- res.end();
-});
-chargen.listen(9000, ready);
-
-// Proxy to the chargen server.
-var proxy = http.createServer(function(req, res) {
- var len = parseInt(req.headers['x-len'], 10);
- assert.ok(len > 0);
-
- var sent = 0;
-
-
- function onError(e) {
- console.log('proxy client error. sent ' + sent);
- throw e;
- }
-
- var proxy_req = http.request({
- host: 'localhost',
- port: 9000,
- method: req.method,
- path: req.url,
- headers: req.headers
- }, function(proxy_res) {
- res.writeHead(proxy_res.statusCode, proxy_res.headers);
-
- var count = 0;
-
- proxy_res.on('data', function(d) {
- if (count++ % 1000 == 0) common.print('.');
- res.write(d);
- sent += d.length;
- assert.ok(sent <= (len * chunk.length));
- });
-
- proxy_res.on('end', function() {
- res.end();
- });
-
- });
- proxy_req.on('error', onError);
- proxy_req.end();
-});
-proxy.listen(9001, ready);
-
-var done = false;
-
-function call_chargen(list) {
- if (list.length > 0) {
- var len = list.shift();
-
- common.debug('calling chargen for ' + len + ' chunks.');
-
- var recved = 0;
-
- var req = http.request({
- port: 9001,
- host: 'localhost',
- path: '/',
- headers: {'x-len': len}
- }, function(res) {
-
- res.on('data', function(d) {
- recved += d.length;
- assert.ok(recved <= (len * chunk.length));
- });
-
- res.on('end', function() {
- assert.ok(recved <= (len * chunk.length));
- common.debug('end for ' + len + ' chunks.');
- call_chargen(list);
- });
-
- });
- req.end();
-
- } else {
- console.log('End of list. closing servers');
- proxy.close();
- chargen.close();
- done = true;
- }
-}
-
-var serversRunning = 0;
-function ready() {
- if (++serversRunning < 2) return;
- call_chargen([100, 1000, 10000, 100000, 1000000]);
-}
-
-process.on('exit', function() {
- assert.ok(done);
-});
diff --git a/test/disabled/test-http-head-request.js b/test/disabled/test-http-head-request.js
deleted file mode 100644
index c6fa78fe2b7..00000000000
--- a/test/disabled/test-http-head-request.js
+++ /dev/null
@@ -1,44 +0,0 @@
-'use strict';
-var common = require('../common');
-var assert = require('assert');
-
-var assert = require('assert');
-var http = require('http');
-var util = require('util');
-
-var body = 'hello world';
-
-var server = http.createServer(function(req, res) {
- res.writeHeader(200,
- {'Content-Length': body.length.toString(),
- 'Content-Type': 'text/plain'
- });
- console.log('method: ' + req.method);
- if (req.method != 'HEAD') res.write(body);
- res.end();
-});
-server.listen(common.PORT);
-
-var gotEnd = false;
-
-server.on('listening', function() {
- var request = http.request({
- port: common.PORT,
- method: 'HEAD',
- path: '/'
- }, function(response) {
- console.log('got response');
- response.on('data', function() {
- process.exit(2);
- });
- response.on('end', function() {
- process.exit(0);
- });
- });
- request.end();
-});
-
-//give a bit of time for the server to respond before we check it
-setTimeout(function() {
- process.exit(1);
-}, 2000);
diff --git a/test/disabled/test-http-stress.js b/test/disabled/test-http-stress.js
deleted file mode 100644
index e4b51e07ca3..00000000000
--- a/test/disabled/test-http-stress.js
+++ /dev/null
@@ -1,43 +0,0 @@
-'use strict';
-var common = require('../common');
-var assert = require('assert');
-
-var http = require('http');
-
-var request_count = 1000;
-var body = '{"ok": true}';
-
-var server = http.createServer(function(req, res) {
- res.writeHead(200, {'Content-Type': 'text/javascript'});
- res.write(body);
- res.end();
-});
-server.listen(common.PORT);
-
-var requests_ok = 0;
-var requests_complete = 0;
-
-server.on('listening', function() {
- for (var i = 0; i < request_count; i++) {
- http.cat('http://localhost:' + common.PORT + '/', 'utf8',
- function(err, content) {
- requests_complete++;
- if (err) {
- common.print('-');
- } else {
- assert.equal(body, content);
- common.print('.');
- requests_ok++;
- }
- if (requests_complete == request_count) {
- console.log('\nrequests ok: ' + requests_ok);
- server.close();
- }
- });
- }
-});
-
-process.on('exit', function() {
- assert.equal(request_count, requests_complete);
- assert.equal(request_count, requests_ok);
-});
diff --git a/test/disabled/test-http-tls.js b/test/disabled/test-http-tls.js
deleted file mode 100644
index 867c3a076ae..00000000000
--- a/test/disabled/test-http-tls.js
+++ /dev/null
@@ -1,155 +0,0 @@
-'use strict';
-var common = require('../common');
-var assert = require('assert');
-
-var net = require('net');
-var http = require('http');
-var url = require('url');
-var qs = require('querystring');
-var fs = require('fs');
-
-var have_openssl;
-try {
- var crypto = require('crypto');
- var dummy_server = http.createServer(function() {});
- dummy_server.setSecure();
- have_openssl = true;
-} catch (e) {
- have_openssl = false;
- console.log('Not compiled with OPENSSL support.');
- process.exit();
-}
-
-var request_number = 0;
-var requests_sent = 0;
-var server_response = '';
-var client_got_eof = false;
-var caPem = fs.readFileSync(common.fixturesDir + '/test_ca.pem', 'ascii');
-var certPem = fs.readFileSync(common.fixturesDir + '/test_cert.pem', 'ascii');
-var keyPem = fs.readFileSync(common.fixturesDir + '/test_key.pem', 'ascii');
-
-try {
- var credentials = crypto.createCredentials(
- { key: keyPem,
- cert: certPem,
- ca: caPem
- });
-} catch (e) {
- console.log('Not compiled with OPENSSL support.');
- process.exit();
-}
-
-
-var https_server = http.createServer(function(req, res) {
- res.id = request_number;
- req.id = request_number++;
-
- var verified = res.connection.verifyPeer();
- var peerDN = JSON.stringify(req.connection.getPeerCertificate());
- assert.equal(verified, true);
- assert.equal(peerDN,
- '{"subject":"/C=UK/ST=Acknack Ltd/L=Rhys Jones' +
- '/O=node.js/OU=Test TLS Certificate/CN=localhost",' +
- '"issuer":"/C=UK/ST=Acknack Ltd/L=Rhys Jones/O=node.js' +
- '/OU=Test TLS Certificate/CN=localhost",' +
- '"valid_from":"Nov 11 09:52:22 2009 GMT",' +
- '"valid_to":"Nov 6 09:52:22 2029 GMT",' +
- '"fingerprint":"2A:7A:C2:DD:E5:F9:CC:53:72:35:99:7A:02:' +
- '5A:71:38:52:EC:8A:DF"}');
-
- if (req.id == 0) {
- assert.equal('GET', req.method);
- assert.equal('/hello', url.parse(req.url).pathname);
- assert.equal('world', qs.parse(url.parse(req.url).query).hello);
- assert.equal('b==ar', qs.parse(url.parse(req.url).query).foo);
- }
-
- if (req.id == 1) {
- assert.equal('POST', req.method);
- assert.equal('/quit', url.parse(req.url).pathname);
- }
-
- if (req.id == 2) {
- assert.equal('foo', req.headers['x-x']);
- }
-
- if (req.id == 3) {
- assert.equal('bar', req.headers['x-x']);
- this.close();
- //console.log('server closed');
- }
- setTimeout(function() {
- res.writeHead(200, {'Content-Type': 'text/plain'});
- res.write(url.parse(req.url).pathname);
- res.end();
- }, 1);
-
-});
-https_server.setSecure(credentials);
-https_server.listen(common.PORT);
-
-https_server.on('listening', function() {
- var c = net.createConnection(common.PORT);
-
- c.setEncoding('utf8');
-
- c.on('connect', function() {
- c.setSecure(credentials);
- });
-
- c.on('secure', function() {
- var verified = c.verifyPeer();
- var peerDN = JSON.stringify(c.getPeerCertificate());
- assert.equal(verified, true);
- assert.equal(peerDN,
- '{"subject":"/C=UK/ST=Acknack Ltd/L=Rhys Jones' +
- '/O=node.js/OU=Test TLS Certificate/CN=localhost",' +
- '"issuer":"/C=UK/ST=Acknack Ltd/L=Rhys Jones/O=node.js' +
- '/OU=Test TLS Certificate/CN=localhost",' +
- '"valid_from":"Nov 11 09:52:22 2009 GMT",' +
- '"valid_to":"Nov 6 09:52:22 2029 GMT",' +
- '"fingerprint":"2A:7A:C2:DD:E5:F9:CC:53:72:35:99:7A:02:' +
- '5A:71:38:52:EC:8A:DF"}');
- c.write('GET /hello?hello=world&foo=b==ar HTTP/1.1\r\n\r\n');
- requests_sent += 1;
- });
-
- c.on('data', function(chunk) {
- server_response += chunk;
-
- if (requests_sent == 1) {
- c.write('POST /quit HTTP/1.1\r\n\r\n');
- requests_sent += 1;
- }
-
- if (requests_sent == 2) {
- c.write('GET / HTTP/1.1\r\nX-X: foo\r\n\r\n' +
- 'GET / HTTP/1.1\r\nX-X: bar\r\n\r\n');
- c.end();
- assert.equal(c.readyState, 'readOnly');
- requests_sent += 2;
- }
-
- });
-
- c.on('end', function() {
- client_got_eof = true;
- });
-
- c.on('close', function() {
- assert.equal(c.readyState, 'closed');
- });
-});
-
-process.on('exit', function() {
- assert.equal(4, request_number);
- assert.equal(4, requests_sent);
-
- var hello = new RegExp('/hello');
- assert.equal(true, hello.exec(server_response) != null);
-
- var quit = new RegExp('/quit');
- assert.equal(true, quit.exec(server_response) != null);
-
- assert.equal(true, client_got_eof);
-});
diff --git a/test/disabled/test-idle-watcher.js b/test/disabled/test-idle-watcher.js
deleted file mode 100644
index 6cf78ad1740..00000000000
--- a/test/disabled/test-idle-watcher.js
+++ /dev/null
@@ -1,16 +0,0 @@
-'use strict';
-var common = require('../common');
-var assert = require('assert');
-
-var complete = false;
-var idle = new process.IdleWatcher();
-idle.callback = function() {
- complete = true;
- idle.stop();
-};
-idle.setPriority(process.EVMAXPRI);
-idle.start();
-
-process.on('exit', function() {
- assert.ok(complete);
-});
diff --git a/test/disabled/test-net-fd-passing.js b/test/disabled/test-net-fd-passing.js
deleted file mode 100644
index 380032a2e66..00000000000
--- a/test/disabled/test-net-fd-passing.js
+++ /dev/null
@@ -1,71 +0,0 @@
-'use strict';
-var common = require('../common');
-var assert = require('assert');
-var net = require('net');
-
-var tests_run = 0;
-
-function fdPassingTest(path, port) {
- var greeting = 'howdy';
- var message = 'beep toot';
- var expectedData = ['[greeting] ' + greeting, '[echo] ' + message];
-
- var receiverArgs = [common.fixturesDir + '/net-fd-passing-receiver.js',
- path,
- greeting];
- var receiver = process.createChildProcess(process.ARGV[0], receiverArgs);
-
- var initializeSender = function() {
- var fdHighway = new net.Socket();
-
- fdHighway.on('connect', function() {
- var sender = net.createServer(function(socket) {
- fdHighway.sendFD(socket);
- socket.flush();
- socket.forceClose(); // want to close() the fd, not shutdown()
- });
-
- sender.on('listening', function() {
- var client = net.createConnection(port);
-
- client.on('connect', function() {
- client.write(message);
- });
-
- client.on('data', function(data) {
- assert.equal(expectedData[0], data);
- if (expectedData.length > 1) {
- expectedData.shift();
- }
- else {
- // time to shut down
- fdHighway.close();
- sender.close();
- client.forceClose();
- }
- });
- });
-
- tests_run += 1;
- sender.listen(port);
- });
-
- fdHighway.connect(path);
-
-
- };
-
- receiver.on('output', function(data) {
- var initialized = false;
- if ((! initialized) && (data == 'ready')) {
- initializeSender();
- initialized = true;
- }
- });
-}
-
-fdPassingTest('/tmp/passing-socket-test', 31075);
-
-process.on('exit', function() {
- assert.equal(1, tests_run);
-});
diff --git a/test/disabled/test-net-tls-pummel.js b/test/disabled/test-net-tls-pummel.js
deleted file mode 100644
index 0fb63d33f44..00000000000
--- a/test/disabled/test-net-tls-pummel.js
+++ /dev/null
@@ -1,127 +0,0 @@
-'use strict';
-var common = require('../common');
-var assert = require('assert');
-
-var net = require('net');
-var fs = require('fs');
-
-var tests_run = 0;
-
-function tlsTest(port, host, caPem, keyPem, certPem) {
- var N = 50;
- var count = 0;
- var sent_final_ping = false;
-
- var server = net.createServer(function(socket) {
- assert.equal(true, socket.remoteAddress !== null);
- assert.equal(true, socket.remoteAddress !== undefined);
- if (host === '127.0.0.1')
- assert.equal(socket.remoteAddress, '127.0.0.1');
- else if (host == null)
- assert.equal(socket.remoteAddress, '127.0.0.1');
-
- socket.setEncoding('utf8');
- socket.setNoDelay();
- socket.timeout = 0;
-
- socket.on('data', function(data) {
- var verified = socket.verifyPeer();
- var peerDN = socket.getPeerCertificate('DNstring');
- assert.equal(verified, 1);
- assert.equal(peerDN,
- 'C=UK,ST=Acknack Ltd,L=Rhys Jones,O=node.js,' +
- 'OU=Test TLS Certificate,CN=localhost');
- console.log('server got: ' + JSON.stringify(data));
- assert.equal('open', socket.readyState);
- assert.equal(true, count <= N);
- if (/PING/.exec(data)) {
- socket.write('PONG');
- }
- });
-
- socket.on('end', function() {
- assert.equal('writeOnly', socket.readyState);
- socket.end();
- });
-
- socket.on('close', function(had_error) {
- assert.equal(false, had_error);
- assert.equal('closed', socket.readyState);
- socket.server.close();
- });
- });
-
- server.setSecure('X509_PEM', caPem, 0, keyPem, certPem);
- server.listen(port, host);
-
- var client = net.createConnection(port, host);
-
- client.setEncoding('utf8');
- client.setSecure('X509_PEM', caPem, 0, keyPem, caPem);
-
- client.on('connect', function() {
- assert.equal('open', client.readyState);
- var verified = client.verifyPeer();
- var peerDN = client.getPeerCertificate('DNstring');
- assert.equal(verified, 1);
- assert.equal(peerDN,
- 'C=UK,ST=Acknack Ltd,L=Rhys Jones,O=node.js,' +
- 'OU=Test TLS Certificate,CN=localhost');
- client.write('PING');
- });
-
- client.on('data', function(data) {
- assert.equal('PONG', data);
- count += 1;
-
- console.log('client got PONG');
-
- if (sent_final_ping) {
- assert.equal('readOnly', client.readyState);
- return;
- } else {
- assert.equal('open', client.readyState);
- }
-
- if (count < N) {
- client.write('PING');
- } else {
- sent_final_ping = true;
- client.write('PING');
- client.end();
- }
- });
-
- client.on('close', function() {
- assert.equal(N + 1, count);
- assert.equal(true, sent_final_ping);
- tests_run += 1;
- });
-}
-
-
-var have_tls;
-try {
- var dummy_server = net.createServer();
- dummy_server.setSecure();
- have_tls = true;
-} catch (e) {
- have_tls = false;
-}
-
-if (have_tls) {
- var caPem = fs.readFileSync(common.fixturesDir + '/test_ca.pem');
- var certPem = fs.readFileSync(common.fixturesDir + '/test_cert.pem');
- var keyPem = fs.readFileSync(common.fixturesDir + '/test_key.pem');
-
- /* All are run at once, so run on different ports */
- tlsTest(common.PORT, 'localhost', caPem, keyPem, certPem);
- tlsTest(common.PORT + 1, null, caPem, keyPem, certPem);
-
- process.on('exit', function() {
- assert.equal(2, tests_run);
- });
-} else {
- console.log('Not compiled with TLS support -- skipping test');
- process.exit(0);
-}
diff --git a/test/disabled/test-net-tls.js b/test/disabled/test-net-tls.js
deleted file mode 100644
index 01797fc689f..00000000000
--- a/test/disabled/test-net-tls.js
+++ /dev/null
@@ -1,112 +0,0 @@
-'use strict';
-var common = require('../common');
-var assert = require('assert');
-var fs = require('fs');
-var net = require('net');
-
-var have_openssl;
-try {
- var crypto = require('crypto');
- have_openssl = true;
-} catch (e) {
- have_openssl = false;
- console.log('Not compiled with OPENSSL support.');
- process.exit();
-}
-
-var caPem = fs.readFileSync(common.fixturesDir + '/test_ca.pem', 'ascii');
-var certPem = fs.readFileSync(common.fixturesDir + '/test_cert.pem', 'ascii');
-var keyPem = fs.readFileSync(common.fixturesDir + '/test_key.pem', 'ascii');
-
-try {
- var credentials = crypto.createCredentials(
- { key: keyPem,
- cert: certPem,
- ca: caPem
- });
-} catch (e) {
- console.log('Not compiled with OPENSSL support.');
- process.exit();
-}
-
-var testData = 'TEST123';
-var serverData = '';
-var clientData = '';
-var gotSecureServer = false;
-var gotSecureClient = false;
-
-var secureServer = net.createServer(function(connection) {
- var self = this;
- connection.setSecure(credentials);
- connection.setEncoding('UTF8');
-
- connection.on('secure', function() {
- gotSecureServer = true;
- var verified = connection.verifyPeer();
- var peerDN = JSON.stringify(connection.getPeerCertificate());
- assert.equal(verified, true);
- assert.equal(peerDN,
- '{"subject":"/C=UK/ST=Acknack Ltd/L=Rhys Jones' +
- '/O=node.js/OU=Test TLS Certificate/CN=localhost",' +
- '"issuer":"/C=UK/ST=Acknack Ltd/L=Rhys Jones/O=node.js' +
- '/OU=Test TLS Certificate/CN=localhost",' +
- '"valid_from":"Nov 11 09:52:22 2009 GMT",' +
- '"valid_to":"Nov 6 09:52:22 2029 GMT",' +
- '"fingerprint":"2A:7A:C2:DD:E5:F9:CC:53:72:35:99:7A:02:' +
- '5A:71:38:52:EC:8A:DF"}');
-
- });
-
- connection.on('data', function(chunk) {
- serverData += chunk;
- connection.write(chunk);
- });
-
- connection.on('end', function() {
- assert.equal(serverData, testData);
- connection.end();
- self.close();
- });
-});
-secureServer.listen(common.PORT);
-
-secureServer.on('listening', function() {
- var secureClient = net.createConnection(common.PORT);
-
- secureClient.setEncoding('UTF8');
- secureClient.on('connect', function() {
- secureClient.setSecure(credentials);
- });
-
- secureClient.on('secure', function() {
- gotSecureClient = true;
- var verified = secureClient.verifyPeer();
- var peerDN = JSON.stringify(secureClient.getPeerCertificate());
- assert.equal(verified, true);
- assert.equal(peerDN,
- '{"subject":"/C=UK/ST=Acknack Ltd/L=Rhys Jones' +
- '/O=node.js/OU=Test TLS Certificate/CN=localhost",' +
- '"issuer":"/C=UK/ST=Acknack Ltd/L=Rhys Jones/O=node.js' +
- '/OU=Test TLS Certificate/CN=localhost",' +
- '"valid_from":"Nov 11 09:52:22 2009 GMT",' +
- '"valid_to":"Nov 6 09:52:22 2029 GMT",' +
- '"fingerprint":"2A:7A:C2:DD:E5:F9:CC:53:72:35:99:7A:02:' +
- '5A:71:38:52:EC:8A:DF"}');
-
- secureClient.write(testData);
- secureClient.end();
- });
-
- secureClient.on('data', function(chunk) {
- clientData += chunk;
- });
-
- secureClient.on('end', function() {
- assert.equal(clientData, testData);
- });
-});
-
-process.on('exit', function() {
- assert.ok(gotSecureServer, 'Did not get secure event for server');
- assert.ok(gotSecureClient, 'Did not get secure event for client');
-});
diff --git a/test/disabled/test-process-title.js b/test/disabled/test-process-title.js
deleted file mode 100644
index 629d78d7237..00000000000
--- a/test/disabled/test-process-title.js
+++ /dev/null
@@ -1,40 +0,0 @@
-'use strict';
-var common = require('../common');
-var assert = require('assert');
-var spawn = require('child_process').spawn;
-
-if (process.title === '') {
- console.log('skipping test -- not implemented for the host platform');
- //return;
-}
-
-// disabled because of two things
-// - not tested on linux (can ps show process title on Linux?)
-// - unable to verify effect on Darwin/OS X (only avail through GUI tools AFAIK)
-
-function verifyProcessName(str, callback) {
- process.title = str;
- var buf = '';
- ps = spawn('ps');
- ps.stdout.setEncoding('utf8');
- ps.stdout.on('data', function(s) { buf += s; });
- ps.on('exit', function(c) {
- try {
- assert.equal(0, c);
- assert.ok(new RegExp(process.pid + ' ', 'm').test(buf));
- assert.ok(new RegExp(str, 'm').test(buf));
- callback();
- } catch (err) {
- callback(err);
- }
- });
-}
-
-verifyProcessName('3kd023mslkfp--unique-string--sksdf', function(err) {
- if (err) throw err;
- console.log('title is now %j', process.title);
- verifyProcessName('3kd023mslxxx--unique-string--xxx', function(err) {
- if (err) throw err;
- console.log('title is now %j', process.title);
- });
-});
diff --git a/test/disabled/test-remote-module-loading.js b/test/disabled/test-remote-module-loading.js
deleted file mode 100644
index d589ecf35be..00000000000
--- a/test/disabled/test-remote-module-loading.js
+++ /dev/null
@@ -1,39 +0,0 @@
-'use strict';
-var common = require('../common');
-var assert = require('assert');
-
-var http = require('http');
-var util = require('util');
-var url = require('url');
-var modulesLoaded = 0;
-
-var server = http.createServer(function(req, res) {
- var body = 'exports.httpPath = function() {' +
- 'return ' + JSON.stringify(url.parse(req.url).pathname) + ';' +
- '};';
- res.writeHead(200, {'Content-Type': 'text/javascript'});
- res.write(body);
- res.end();
-});
-server.listen(common.PORT);
-
-assert.throws(function() {
- var httpModule = require('http://localhost:' + common.PORT + '/moduleA.js');
- assert.equal('/moduleA.js', httpModule.httpPath());
- modulesLoaded++;
-});
-
-var nodeBinary = process.ARGV[0];
-var cmd = 'NODE_PATH=' + common.libDir + ' ' + nodeBinary +
- ' http://localhost:' + common.PORT + '/moduleB.js';
-
-util.exec(cmd, function(err, stdout, stderr) {
- if (err) throw err;
- console.log('success!');
- modulesLoaded++;
- server.close();
-});
-
-process.on('exit', function() {
- assert.equal(1, modulesLoaded);
-});
diff --git a/test/disabled/test-tls-large-push.js b/test/disabled/test-tls-large-push.js
deleted file mode 100644
index 80a3cf52209..00000000000
--- a/test/disabled/test-tls-large-push.js
+++ /dev/null
@@ -1,65 +0,0 @@
-/* eslint-disable no-debugger */
-'use strict';
-// Server sends a large string. Client counts bytes and pauses every few
-// seconds. Makes sure that pause and resume work properly.
-var common = require('../common');
-var assert = require('assert');
-var tls = require('tls');
-var fs = require('fs');
-
-
-var body = '';
-
-process.stdout.write('build body...');
-for (var i = 0; i < 10 * 1024 * 1024; i++) {
- body += 'hello world\n';
-}
-process.stdout.write('done\n');
-
-
-var options = {
- key: fs.readFileSync(common.fixturesDir + '/keys/agent2-key.pem'),
- cert: fs.readFileSync(common.fixturesDir + '/keys/agent2-cert.pem')
-};
-
-var connections = 0;
-
-
-var server = tls.Server(options, function(socket) {
- socket.end(body);
- connections++;
-});
-
-var recvCount = 0;
-
-server.listen(common.PORT, function() {
- var client = tls.connect(common.PORT);
-
- client.on('data', function(d) {
- process.stdout.write('.');
- recvCount += d.length;
-
- /*
- client.pause();
- process.nextTick(function() {
- client.resume();
- });
- */
- });
-
-
- client.on('close', function() {
- debugger;
- console.log('close');
- server.close();
- });
-});
-
-
-
-process.on('exit', function() {
- assert.equal(1, connections);
- console.log('body.length: %d', body.length);
- console.log(' recvCount: %d', recvCount);
- assert.equal(body.length, recvCount);
-});
diff --git a/test/disabled/test-tls-server.js b/test/disabled/test-tls-server.js
deleted file mode 100644
index c1e62bf01ce..00000000000
--- a/test/disabled/test-tls-server.js
+++ /dev/null
@@ -1,36 +0,0 @@
-'use strict';
-// Example of new TLS API. Test with:
-//
-// $> openssl s_client -connect localhost:12346 \
-// -key test/fixtures/agent.key -cert test/fixtures/agent.crt
-//
-// $> openssl s_client -connect localhost:12346
-//
-var common = require('../common');
-var tls = require('tls');
-var fs = require('fs');
-var join = require('path').join;
-
-var key = fs.readFileSync(join(common.fixturesDir, 'agent.key')).toString();
-var cert = fs.readFileSync(join(common.fixturesDir, 'agent.crt')).toString();
-
-s = tls.Server({ key: key,
- cert: cert,
- ca: [],
- requestCert: true,
- rejectUnauthorized: true });
-
-s.listen(common.PORT, function() {
- console.log('TLS server on 127.0.0.1:%d', common.PORT);
-});
-
-
-s.on('authorized', function(c) {
- console.log('authed connection');
- c.end('bye authorized friend.\n');
-});
-
-s.on('unauthorized', function(c, e) {
- console.log('unauthed connection: %s', e);
- c.end('bye unauthorized person.\n');
-});
diff --git a/test/disabled/test-tty-stdio.js b/test/disabled/test-tty-stdio.js
deleted file mode 100644
index 57d7ee67759..00000000000
--- a/test/disabled/test-tty-stdio.js
+++ /dev/null
@@ -1,13 +0,0 @@
-'use strict';
-// Can't test this when 'make test' doesn't assign a tty to the stdout.
-var common = require('../common');
-var assert = require('assert');
-var tty = require('tty');
-
-assert.ok(process.stdin instanceof tty.ReadStream);
-assert.ok(process.stdin.readable);
-assert.ok(!process.stdin.writable);
-
-assert.ok(process.stdout instanceof tty.WriteStream);
-assert.ok(!process.stdout.readable);
-assert.ok(process.stdout.writable);
diff --git a/test/disabled/tls-client.js b/test/disabled/tls-client.js
deleted file mode 100644
index b47b681f95d..00000000000
--- a/test/disabled/tls-client.js
+++ /dev/null
@@ -1,23 +0,0 @@
-'use strict';
-var common = require('../common');
-var tls = require('tls');
-var fs = require('fs');
-
-
-// most servers don't require certificates
-
-var options = {
- key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem')
-};
-
-
-var s = tls.connect(443, 'joyent.com', options, function() {
- if (!s.authorized) {
- console.error('CONNECTED: ' + s.authorizationError);
- s.destroy();
- return;
- }
- s.pipe(process.stdout);
- process.openStdin().pipe(s);
-});
-
diff --git a/test/disabled/tls_client.js b/test/disabled/tls_client.js
deleted file mode 100644
index 425cb54a591..00000000000
--- a/test/disabled/tls_client.js
+++ /dev/null
@@ -1,44 +0,0 @@
-'use strict';
-var common = require('../common');
-var assert = require('assert');
-
-var util = require('util');
-var net = require('net');
-var fs = require('fs');
-var crypto = require('crypto');
-
-//var client = net.createConnection(4443, 'localhost');
-var client = net.createConnection(443, 'www.microsoft.com');
-//var client = net.createConnection(443, 'www.google.com');
-
-var caPem = fs.readFileSync(common.fixturesDir + '/msca.pem');
-//var caPem = fs.readFileSync('ca.pem');
-
-try {
- var credentials = crypto.createCredentials({ca: caPem});
-} catch (e) {
- console.log('Not compiled with OPENSSL support.');
- process.exit();
-}
-
-client.setEncoding('UTF8');
-client.on('connect', function() {
- console.log('client connected.');
- client.setSecure(credentials);
-});
-
-client.on('secure', function() {
- console.log('client secure : ' + JSON.stringify(client.getCipher()));
- console.log(JSON.stringify(client.getPeerCertificate()));
- console.log('verifyPeer : ' + client.verifyPeer());
- client.write('GET / HTTP/1.0\r\n\r\n');
-});
-
-client.on('data', function(chunk) {
- common.error(chunk);
-});
-
-client.on('end', function() {
- console.log('client disconnected.');
-});
-
diff --git a/test/fixtures/deprecated-userland-function.js b/test/fixtures/deprecated-userland-function.js
new file mode 100644
index 00000000000..d54565b4ede
--- /dev/null
+++ b/test/fixtures/deprecated-userland-function.js
@@ -0,0 +1,6 @@
+const util = require('util');
+
+function deprecatedFunction() {
+}
+
+util.deprecate(deprecatedFunction, 'deprecatedFunction is deprecated.')();
diff --git a/test/internet/test-tls-connnect-cnnic.js b/test/internet/test-tls-connnect-cnnic.js
index b71a3e9a827..d95685a3f70 100644
--- a/test/internet/test-tls-connnect-cnnic.js
+++ b/test/internet/test-tls-connnect-cnnic.js
@@ -7,6 +7,13 @@
// 0x44, 0xB5, 0x00, 0x76, 0x48, 0x11, 0x41, 0xED },
// },
// in src/CNNICHashWhitelist.inc
+
+var common = require('../common');
+if (!common.hasCrypto) {
+ console.log('1..0 # Skipped: missing crypto');
+ process.exit();
+}
+
var tls = require('tls');
var socket = tls.connect(443, 'www1.cnnic.cn', function() {
socket.resume();
diff --git a/test/internet/test-tls-connnect-melissadata.js b/test/internet/test-tls-connnect-melissadata.js
index 96ff41af30c..326e76cb240 100644
--- a/test/internet/test-tls-connnect-melissadata.js
+++ b/test/internet/test-tls-connnect-melissadata.js
@@ -1,6 +1,13 @@
'use strict';
// Test for authorized access to the server which has a cross root
// certification between Starfield Class 2 and ValiCert Class 2
+
+var common = require('../common');
+if (!common.hasCrypto) {
+ console.log('1..0 # Skipped: missing crypto');
+ process.exit();
+}
+
var tls = require('tls');
var socket = tls.connect(443, 'address.melissadata.net', function() {
socket.resume();
diff --git a/test/parallel/test-buffer-fakes.js b/test/parallel/test-buffer-fakes.js
new file mode 100644
index 00000000000..d473d16e921
--- /dev/null
+++ b/test/parallel/test-buffer-fakes.js
@@ -0,0 +1,56 @@
+'use strict';
+
+const common = require('../common');
+const assert = require('assert');
+const Buffer = require('buffer').Buffer;
+const Bp = Buffer.prototype;
+
+function FakeBuffer() { }
+FakeBuffer.__proto__ = Buffer;
+FakeBuffer.prototype.__proto__ = Buffer.prototype;
+
+const fb = new FakeBuffer();
+
+assert.throws(function() {
+ new Buffer(fb);
+}, TypeError);
+
+assert.throws(function() {
+ +Buffer.prototype;
+}, TypeError);
+
+assert.throws(function() {
+ Buffer.compare(fb, new Buffer(0));
+}, TypeError);
+
+assert.throws(function() {
+ fb.write('foo');
+}, TypeError);
+
+assert.throws(function() {
+ Buffer.concat([fb, fb]);
+}, TypeError);
+
+assert.throws(function() {
+ fb.toString();
+}, TypeError);
+
+assert.throws(function() {
+ fb.equals(new Buffer(0));
+}, TypeError);
+
+assert.throws(function() {
+ fb.indexOf(5);
+}, TypeError);
+
+assert.throws(function() {
+ fb.readFloatLE(0);
+}, TypeError);
+
+assert.throws(function() {
+ fb.writeFloatLE(0);
+}, TypeError);
+
+assert.throws(function() {
+ fb.fill(0);
+}, TypeError);
diff --git a/test/parallel/test-crypto.js b/test/parallel/test-crypto.js
index 2555cf448a6..47f0430f167 100644
--- a/test/parallel/test-crypto.js
+++ b/test/parallel/test-crypto.js
@@ -18,20 +18,7 @@ var caPem = fs.readFileSync(common.fixturesDir + '/test_ca.pem', 'ascii');
var certPem = fs.readFileSync(common.fixturesDir + '/test_cert.pem', 'ascii');
var certPfx = fs.readFileSync(common.fixturesDir + '/test_cert.pfx');
var keyPem = fs.readFileSync(common.fixturesDir + '/test_key.pem', 'ascii');
-
-
-// TODO(indunty): move to a separate test eventually
-try {
- var tls = require('tls');
- var context = tls.createSecureContext({
- key: keyPem,
- cert: certPem,
- ca: caPem
- });
-} catch (e) {
- console.log('Not compiled with OPENSSL support.');
- process.exit();
-}
+var tls = require('tls');
// 'this' safety
// https://github.com/joyent/node/issues/6690
diff --git a/test/parallel/test-dgram-bind-shared-ports.js b/test/parallel/test-dgram-bind-shared-ports.js
index 91a48a260fb..dcd96d7a7c8 100644
--- a/test/parallel/test-dgram-bind-shared-ports.js
+++ b/test/parallel/test-dgram-bind-shared-ports.js
@@ -4,16 +4,21 @@ var assert = require('assert');
var cluster = require('cluster');
var dgram = require('dgram');
-// TODO XXX FIXME when windows supports clustered dgram ports re-enable this
-// test
-if (process.platform == 'win32')
- process.exit(0);
-
function noop() {}
if (cluster.isMaster) {
var worker1 = cluster.fork();
+ if (common.isWindows) {
+ var checkErrType = function(er) {
+ assert.equal(er.code, 'ENOTSUP');
+ worker1.kill();
+ };
+
+ worker1.on('error', common.mustCall(checkErrType, 1));
+ return;
+ }
+
worker1.on('message', function(msg) {
assert.equal(msg, 'success');
var worker2 = cluster.fork();
diff --git a/test/parallel/test-dgram-oob-buffer.js b/test/parallel/test-dgram-oob-buffer.js
index b64c7236afd..e873715e4e1 100644
--- a/test/parallel/test-dgram-oob-buffer.js
+++ b/test/parallel/test-dgram-oob-buffer.js
@@ -8,7 +8,7 @@ var assert = require('assert');
var dgram = require('dgram');
var socket = dgram.createSocket('udp4');
-var buf = Buffer([1,2,3,4]);
+var buf = Buffer([1, 2, 3, 4]);
function ok() {}
socket.send(buf, 0, 0, common.PORT, '127.0.0.1', ok); // useful? no
diff --git a/test/parallel/test-dgram-setTTL.js b/test/parallel/test-dgram-setTTL.js
new file mode 100644
index 00000000000..88627a314c3
--- /dev/null
+++ b/test/parallel/test-dgram-setTTL.js
@@ -0,0 +1,17 @@
+'use strict';
+const common = require('../common');
+const assert = require('assert');
+const dgram = require('dgram');
+const socket = dgram.createSocket('udp4');
+
+socket.bind(common.PORT);
+socket.on('listening', function() {
+ var result = socket.setTTL(16);
+ assert.strictEqual(result, 16);
+
+ assert.throws(function() {
+ socket.setTTL('foo');
+ }, /Argument must be a number/);
+
+ socket.close();
+});
diff --git a/test/parallel/test-domain-http-server.js b/test/parallel/test-domain-http-server.js
index 7cabf205e8f..99dbf413e3a 100644
--- a/test/parallel/test-domain-http-server.js
+++ b/test/parallel/test-domain-http-server.js
@@ -4,7 +4,7 @@ var http = require('http');
var assert = require('assert');
var common = require('../common');
-var objects = { foo: 'bar', baz: {}, num: 42, arr: [1,2,3] };
+var objects = { foo: 'bar', baz: {}, num: 42, arr: [1, 2, 3] };
objects.baz.asdf = objects;
var serverCaught = 0;
diff --git a/test/parallel/test-fs-mkdir.js b/test/parallel/test-fs-mkdir.js
index 91a5a63fa59..ae13b9bc7a0 100644
--- a/test/parallel/test-fs-mkdir.js
+++ b/test/parallel/test-fs-mkdir.js
@@ -36,7 +36,7 @@ common.refreshTmpDir();
unlink(pathname);
- fs.mkdir(pathname, 511 /*=0777*/, function(err) {
+ fs.mkdir(pathname, 0o777, function(err) {
assert.equal(err, null);
assert.equal(common.fileExists(pathname), true);
ncalls++;
diff --git a/test/parallel/test-fs-read-stream-inherit.js b/test/parallel/test-fs-read-stream-inherit.js
index 3b53578397f..2261b269f31 100644
--- a/test/parallel/test-fs-read-stream-inherit.js
+++ b/test/parallel/test-fs-read-stream-inherit.js
@@ -2,10 +2,6 @@
var common = require('../common');
var assert = require('assert');
-// TODO Improved this test. test_ca.pem is too small. A proper test would
-// great a large utf8 (with multibyte chars) file and stream it in,
-// performing sanity checks throughout.
-
var path = require('path');
var fs = require('fs');
var fn = path.join(common.fixturesDir, 'elipses.txt');
diff --git a/test/parallel/test-fs-read-stream.js b/test/parallel/test-fs-read-stream.js
index 490ae0866d9..e6aa997cc5b 100644
--- a/test/parallel/test-fs-read-stream.js
+++ b/test/parallel/test-fs-read-stream.js
@@ -2,10 +2,6 @@
var common = require('../common');
var assert = require('assert');
-// TODO Improved this test. test_ca.pem is too small. A proper test would
-// great a large utf8 (with multibyte chars) file and stream it in,
-// performing sanity checks throughout.
-
var path = require('path');
var fs = require('fs');
var fn = path.join(common.fixturesDir, 'elipses.txt');
diff --git a/test/parallel/test-fs-readfile-pipe-large.js b/test/parallel/test-fs-readfile-pipe-large.js
index ac50e9c0134..690da928e72 100644
--- a/test/parallel/test-fs-readfile-pipe-large.js
+++ b/test/parallel/test-fs-readfile-pipe-large.js
@@ -5,7 +5,6 @@ var path = require('path');
// simulate `cat readfile.js | node readfile.js`
-// TODO: Have some way to make this work on windows.
if (process.platform === 'win32') {
console.error('No /dev/stdin on windows. Skipping test.');
process.exit();
diff --git a/test/parallel/test-fs-readfile-pipe.js b/test/parallel/test-fs-readfile-pipe.js
index b55bfb6a22c..80cbaeac7cc 100644
--- a/test/parallel/test-fs-readfile-pipe.js
+++ b/test/parallel/test-fs-readfile-pipe.js
@@ -4,7 +4,6 @@ var assert = require('assert');
// simulate `cat readfile.js | node readfile.js`
-// TODO: Have some way to make this work on windows.
if (process.platform === 'win32') {
console.error('No /dev/stdin on windows. Skipping test.');
process.exit();
diff --git a/test/parallel/test-fs-readfilesync-pipe-large.js b/test/parallel/test-fs-readfilesync-pipe-large.js
index ebd093de69b..991c8589ded 100644
--- a/test/parallel/test-fs-readfilesync-pipe-large.js
+++ b/test/parallel/test-fs-readfilesync-pipe-large.js
@@ -5,7 +5,6 @@ var path = require('path');
// simulate `cat readfile.js | node readfile.js`
-// TODO: Have some way to make this work on windows.
if (process.platform === 'win32') {
console.error('No /dev/stdin on windows. Skipping test.');
process.exit();
diff --git a/test/parallel/test-http-response-close-event-race.js b/test/parallel/test-http-response-close-event-race.js
deleted file mode 100644
index b83a3035976..00000000000
--- a/test/parallel/test-http-response-close-event-race.js
+++ /dev/null
@@ -1,90 +0,0 @@
-var common = require('../common');
-var assert = require('assert');
-var http = require('http');
-
-var clientRequest = null;
-var eventCount = 0;
-var testTickCount = 3;
-
-var server = http.createServer(function(req, res) {
- console.log('server: request');
-
- res.on('finish', function() {
- console.log('server: response finish');
- eventCount++;
- });
- res.on('close', function() {
- console.log('server: response close');
- eventCount++;
- });
-
- console.log('client: aborting request');
- clientRequest.abort();
-
- var ticks = 0;
- function tick() {
- console.log('server: tick ' + ticks +
- (req.connection.destroyed ? ' (connection destroyed!)' : ''));
-
- if (ticks < testTickCount) {
- ticks++;
- setImmediate(tick);
- } else {
- sendResponse();
- }
- }
- tick();
-
- function sendResponse() {
- console.log('server: sending response');
- res.writeHead(200, {'Content-Type': 'text/plain'});
- res.end('Response\n');
- console.log('server: res.end() returned');
-
- handleResponseEnd();
- }
-});
-
-server.on('listening', function() {
- console.log('server: listening on port ' + common.PORT);
- console.log('-----------------------------------------------------');
- startRequest();
-});
-
-server.on('connection', function(connection) {
- console.log('server: connection');
- connection.on('close', function() {
- console.log('server: connection close');
- });
-});
-
-server.on('close', function() {
- console.log('server: close');
-});
-
-server.listen(common.PORT);
-
-function startRequest() {
- console.log('client: starting request - testing with %d ticks after abort()',
- testTickCount);
- eventCount = 0;
-
- var options = {port: common.PORT, path: '/'};
- clientRequest = http.get(options, function() {});
- clientRequest.on('error', function() {});
-}
-
-function handleResponseEnd() {
- setImmediate(function() {
- setImmediate(function() {
- assert.equal(eventCount, 1);
-
- if (testTickCount > 0) {
- testTickCount--;
- startRequest();
- } else {
- server.close();
- }
- });
- });
-}
diff --git a/test/parallel/test-http-server-multiheaders.js b/test/parallel/test-http-server-multiheaders.js
index 440e1053378..7033ef8e707 100644
--- a/test/parallel/test-http-server-multiheaders.js
+++ b/test/parallel/test-http-server-multiheaders.js
@@ -38,9 +38,9 @@ srv.listen(common.PORT, function() {
['www-authenticate', 'foo'],
['WWW-Authenticate', 'bar'],
['WWW-AUTHENTICATE', 'baz'],
- ['proxy-authenticate','foo'],
- ['Proxy-Authenticate','bar'],
- ['PROXY-AUTHENTICATE','baz'],
+ ['proxy-authenticate', 'foo'],
+ ['Proxy-Authenticate', 'bar'],
+ ['PROXY-AUTHENTICATE', 'baz'],
['x-foo', 'bingo'],
['x-bar', 'banjo'],
['x-bar', 'bango'],
diff --git a/test/parallel/test-path-parse-format.js b/test/parallel/test-path-parse-format.js
index 37f37fc9b57..677bf3241f0 100644
--- a/test/parallel/test-path-parse-format.js
+++ b/test/parallel/test-path-parse-format.js
@@ -15,7 +15,12 @@ var winPaths = [
'\\\\server two\\shared folder\\file path.zip',
'\\\\teela\\admin$\\system32',
'\\\\?\\UNC\\server\\share'
+];
+var winSpecialCaseFormatTests = [
+ [{dir: 'some\\dir'}, 'some\\dir\\'],
+ [{base: 'index.html'}, 'index.html'],
+ [{}, '']
];
var unixPaths = [
@@ -30,6 +35,12 @@ var unixPaths = [
'C:\\foo'
];
+var unixSpecialCaseFormatTests = [
+ [{dir: 'some/dir'}, 'some/dir/'],
+ [{base: 'index.html'}, 'index.html'],
+ [{}, '']
+];
+
var errors = [
{method: 'parse', input: [null],
message: /Path must be a string. Received null/},
@@ -57,10 +68,12 @@ var errors = [
message: /'pathObject.root' must be a string or undefined, not number/},
];
-check(path.win32, winPaths);
-check(path.posix, unixPaths);
+checkParseFormat(path.win32, winPaths);
+checkParseFormat(path.posix, unixPaths);
checkErrors(path.win32);
checkErrors(path.posix);
+checkFormat(path.win32, winSpecialCaseFormatTests);
+checkFormat(path.posix, unixSpecialCaseFormatTests);
function checkErrors(path) {
errors.forEach(function(errorCase) {
@@ -79,8 +92,7 @@ function checkErrors(path) {
});
}
-
-function check(path, paths) {
+function checkParseFormat(path, paths) {
paths.forEach(function(element, index, array) {
var output = path.parse(element);
assert.strictEqual(path.format(output), element);
@@ -89,3 +101,9 @@ function check(path, paths) {
assert.strictEqual(output.ext, path.extname(element));
});
}
+
+function checkFormat(path, testCases) {
+ testCases.forEach(function(testCase) {
+ assert.strictEqual(path.format(testCase[0]), testCase[1]);
+ });
+}
diff --git a/test/parallel/test-repl-tab-complete.js b/test/parallel/test-repl-tab-complete.js
index 659c8046a98..856fd9b041f 100644
--- a/test/parallel/test-repl-tab-complete.js
+++ b/test/parallel/test-repl-tab-complete.js
@@ -1,9 +1,24 @@
'use strict';
+
+// Flags: --harmony-proxies
+
var common = require('../common');
var assert = require('assert');
var util = require('util');
-
var repl = require('repl');
+var referenceErrors = 0;
+var expectedReferenceErrors = 0;
+
+function getDoNotCallFunction() {
+ expectedReferenceErrors += 1;
+ return function() {
+ assert(false);
+ };
+}
+
+process.on('exit', function() {
+ assert.strictEqual(referenceErrors, expectedReferenceErrors);
+});
// A stream to push an array into a REPL
function ArrayStream() {
@@ -21,29 +36,37 @@ ArrayStream.prototype.resume = function() {};
ArrayStream.prototype.write = function() {};
var works = [['inner.one'], 'inner.o'];
-var doesNotBreak = [[], 'inner.o'];
-
var putIn = new ArrayStream();
var testMe = repl.start('', putIn);
+// Some errors are passed to the domain, but do not callback
+testMe._domain.on('error', function(err) {
+ // Errors come from another context, so instanceof doesn't work
+ var str = err.toString();
+
+ if (/^ReferenceError:/.test(str))
+ referenceErrors++;
+ else
+ assert(false);
+});
+
// Tab Complete will not break in an object literal
putIn.run(['.clear']);
putIn.run([
'var inner = {',
'one:1'
]);
-testMe.complete('inner.o', function(error, data) {
- assert.deepEqual(data, doesNotBreak);
-});
-testMe.complete('console.lo', function(error, data) {
+testMe.complete('inner.o', getDoNotCallFunction());
+
+testMe.complete('console.lo', common.mustCall(function(error, data) {
assert.deepEqual(data, [['console.log'], 'console.lo']);
-});
+}));
// Tab Complete will return globaly scoped variables
putIn.run(['};']);
-testMe.complete('inner.o', function(error, data) {
+testMe.complete('inner.o', common.mustCall(function(error, data) {
assert.deepEqual(data, works);
-});
+}));
putIn.run(['.clear']);
@@ -53,9 +76,7 @@ putIn.run([
'?',
'{one: 1} : '
]);
-testMe.complete('inner.o', function(error, data) {
- assert.deepEqual(data, doesNotBreak);
-});
+testMe.complete('inner.o', getDoNotCallFunction());
putIn.run(['.clear']);
@@ -64,16 +85,14 @@ putIn.run([
'var top = function() {',
'var inner = {one:1};'
]);
-testMe.complete('inner.o', function(error, data) {
+testMe.complete('inner.o', common.mustCall(function(error, data) {
assert.deepEqual(data, works);
-});
+}));
// When you close the function scope tab complete will not return the
// locally scoped variable
putIn.run(['};']);
-testMe.complete('inner.o', function(error, data) {
- assert.deepEqual(data, doesNotBreak);
-});
+testMe.complete('inner.o', getDoNotCallFunction());
putIn.run(['.clear']);
@@ -84,9 +103,9 @@ putIn.run([
' one:1',
'};'
]);
-testMe.complete('inner.o', function(error, data) {
+testMe.complete('inner.o', common.mustCall(function(error, data) {
assert.deepEqual(data, works);
-});
+}));
putIn.run(['.clear']);
@@ -98,9 +117,9 @@ putIn.run([
' one:1',
'};'
]);
-testMe.complete('inner.o', function(error, data) {
+testMe.complete('inner.o', common.mustCall(function(error, data) {
assert.deepEqual(data, works);
-});
+}));
putIn.run(['.clear']);
@@ -113,13 +132,12 @@ putIn.run([
' one:1',
'};'
]);
-testMe.complete('inner.o', function(error, data) {
+testMe.complete('inner.o', common.mustCall(function(error, data) {
assert.deepEqual(data, works);
-});
+}));
putIn.run(['.clear']);
-// currently does not work, but should not break note the inner function
// def has the params and { on a separate line
putIn.run([
'var top = function() {',
@@ -129,9 +147,7 @@ putIn.run([
' one:1',
'};'
]);
-testMe.complete('inner.o', function(error, data) {
- assert.deepEqual(data, doesNotBreak);
-});
+testMe.complete('inner.o', getDoNotCallFunction());
putIn.run(['.clear']);
@@ -144,9 +160,7 @@ putIn.run([
' one:1',
'};'
]);
-testMe.complete('inner.o', function(error, data) {
- assert.deepEqual(data, doesNotBreak);
-});
+testMe.complete('inner.o', getDoNotCallFunction());
putIn.run(['.clear']);
@@ -160,9 +174,7 @@ putIn.run([
' one:1',
'};'
]);
-testMe.complete('inner.o', function(error, data) {
- assert.deepEqual(data, doesNotBreak);
-});
+testMe.complete('inner.o', getDoNotCallFunction());
putIn.run(['.clear']);
@@ -170,9 +182,9 @@ putIn.run(['.clear']);
putIn.run([
'var str = "test";'
]);
-testMe.complete('str.len', function(error, data) {
+testMe.complete('str.len', common.mustCall(function(error, data) {
assert.deepEqual(data, [['str.length'], 'str.len']);
-});
+}));
putIn.run(['.clear']);
@@ -181,28 +193,58 @@ var spaceTimeout = setTimeout(function() {
throw new Error('timeout');
}, 1000);
-testMe.complete(' ', function(error, data) {
+testMe.complete(' ', common.mustCall(function(error, data) {
assert.deepEqual(data, [[], undefined]);
clearTimeout(spaceTimeout);
-});
+}));
// tab completion should pick up the global "toString" object, and
// any other properties up the "global" object's prototype chain
-testMe.complete('toSt', function(error, data) {
+testMe.complete('toSt', common.mustCall(function(error, data) {
assert.deepEqual(data, [['toString'], 'toSt']);
-});
+}));
// Tab complete provides built in libs for require()
putIn.run(['.clear']);
-testMe.complete('require(\'', function(error, data) {
+testMe.complete('require(\'', common.mustCall(function(error, data) {
assert.strictEqual(error, null);
repl._builtinLibs.forEach(function(lib) {
assert.notStrictEqual(data[0].indexOf(lib), -1, lib + ' not found');
});
-});
+}));
-testMe.complete('require(\'n', function(error, data) {
+testMe.complete('require(\'n', common.mustCall(function(error, data) {
assert.strictEqual(error, null);
- assert.deepEqual(data, [['net'], 'n']);
-});
+ assert.strictEqual(data.length, 2);
+ assert.strictEqual(data[1], 'n');
+ assert.notStrictEqual(data[0].indexOf('net'), -1);
+ // It's possible to pick up non-core modules too
+ data[0].forEach(function(completion) {
+ if (completion)
+ assert(/^n/.test(completion));
+ });
+}));
+
+// Make sure tab completion works on context properties
+putIn.run(['.clear']);
+
+putIn.run([
+ 'var custom = "test";'
+]);
+testMe.complete('cus', common.mustCall(function(error, data) {
+ assert.deepEqual(data, [['custom'], 'cus']);
+}));
+
+// Make sure tab completion doesn't crash REPL with half-baked proxy objects.
+// See: https://github.com/nodejs/io.js/issues/2119
+putIn.run(['.clear']);
+
+putIn.run([
+ 'var proxy = Proxy.create({});'
+]);
+
+testMe.complete('proxy.', common.mustCall(function(error, data) {
+ assert.strictEqual(error, null);
+ assert.deepEqual(data, [[], 'proxy.']);
+}));
diff --git a/test/parallel/test-repl-unexpected-token-recoverable.js b/test/parallel/test-repl-unexpected-token-recoverable.js
new file mode 100644
index 00000000000..4cfaa5136b6
--- /dev/null
+++ b/test/parallel/test-repl-unexpected-token-recoverable.js
@@ -0,0 +1,33 @@
+'use strict';
+/*
+ * This is a regression test for https://github.com/joyent/node/issues/8874.
+ */
+var common = require('../common');
+var assert = require('assert');
+
+var spawn = require('child_process').spawn;
+// use -i to force node into interactive mode, despite stdout not being a TTY
+var args = [ '-i' ];
+var child = spawn(process.execPath, args);
+
+var input = 'var foo = "bar\\\nbaz"';
+// Match '...' as well since it marks a multi-line statement
+var expectOut = /^> ... undefined\n/;
+
+child.stderr.setEncoding('utf8');
+child.stderr.on('data', function(c) {
+ throw new Error('child.stderr be silent');
+});
+
+child.stdout.setEncoding('utf8');
+var out = '';
+child.stdout.on('data', function(c) {
+ out += c;
+});
+
+child.stdout.on('end', function() {
+ assert(expectOut.test(out));
+ console.log('ok');
+});
+
+child.stdin.end(input);
diff --git a/test/parallel/test-stream-wrap.js b/test/parallel/test-stream-wrap.js
new file mode 100644
index 00000000000..e7a7ecddd23
--- /dev/null
+++ b/test/parallel/test-stream-wrap.js
@@ -0,0 +1,39 @@
+'use strict';
+const common = require('../common');
+const assert = require('assert');
+
+const StreamWrap = require('_stream_wrap');
+const Duplex = require('stream').Duplex;
+const ShutdownWrap = process.binding('stream_wrap').ShutdownWrap;
+
+var done = false;
+
+function testShutdown(callback) {
+ var stream = new Duplex({
+ read: function() {
+ },
+ write: function() {
+ }
+ });
+
+ var wrap = new StreamWrap(stream);
+
+ var req = new ShutdownWrap();
+ req.oncomplete = function(code) {
+ assert(code < 0);
+ callback();
+ };
+ req.handle = wrap._handle;
+
+ // Close the handle to simulate
+ wrap.destroy();
+ req.handle.shutdown(req);
+}
+
+testShutdown(function() {
+ done = true;
+});
+
+process.on('exit', function() {
+ assert(done);
+});
diff --git a/test/parallel/test-sys.js b/test/parallel/test-sys.js
index a5631a5cb16..bbc8c092002 100644
--- a/test/parallel/test-sys.js
+++ b/test/parallel/test-sys.js
@@ -75,7 +75,7 @@ assert.equal('{ readonly: [Getter] }',
common.inspect({get readonly() {}}));
assert.equal('{ readwrite: [Getter/Setter] }',
- common.inspect({get readwrite() {},set readwrite(val) {}}));
+ common.inspect({get readwrite() {}, set readwrite(val) {}}));
assert.equal('{ writeonly: [Setter] }',
common.inspect({set writeonly(val) {}}));
diff --git a/test/parallel/test-tls-cnnic-whitelist.js b/test/parallel/test-tls-cnnic-whitelist.js
index ec1177d6caf..759ce3230fd 100644
--- a/test/parallel/test-tls-cnnic-whitelist.js
+++ b/test/parallel/test-tls-cnnic-whitelist.js
@@ -10,33 +10,74 @@ if (!common.hasCrypto) {
var tls = require('tls');
var fs = require('fs');
var path = require('path');
+var finished = 0;
-var error = false;
-
-// agent7-cert.pem is issued by the fake CNNIC root CA so that its
-// hash is not listed in the whitelist.
-var options = {
- key: fs.readFileSync(path.join(common.fixturesDir, 'keys/agent7-key.pem')),
- cert: fs.readFileSync(path.join(common.fixturesDir, 'keys/agent7-cert.pem'))
-};
-
-var server = tls.createServer(options, function(s) {
- s.resume();
-}).listen(common.PORT, function() {
- var client = tls.connect({
- port: common.PORT,
- rejectUnauthorized: true,
+function filenamePEM(n) {
+ return path.join(common.fixturesDir, 'keys', n + '.pem');
+}
+
+function loadPEM(n) {
+ return fs.readFileSync(filenamePEM(n));
+}
+
+var testCases = [
+ { // Test 0: for the check of a cert not existed in the whitelist.
+ // agent7-cert.pem is issued by the fake CNNIC root CA so that its
+ // hash is not listed in the whitelist.
// fake-cnnic-root-cert has the same subject name as the original
// rootCA.
- ca: [fs.readFileSync(path.join(common.fixturesDir,
- 'keys/fake-cnnic-root-cert.pem'))]
- });
- client.on('error', function(e) {
- assert.strictEqual(e.code, 'CERT_REVOKED');
- error = true;
- server.close();
+ serverOpts: {
+ key: loadPEM('agent7-key'),
+ cert: loadPEM('agent7-cert')
+ },
+ clientOpts: {
+ port: common.PORT,
+ rejectUnauthorized: true,
+ ca: [loadPEM('fake-cnnic-root-cert')]
+ },
+ errorCode: 'CERT_REVOKED'
+ },
+ // Test 1: for the fix of iojs#2061
+ // agent6-cert.pem is signed by intermidate cert of ca3.
+ // The server has a cert chain of agent6->ca3->ca1(root) but
+ // tls.connect should be failed with an error of
+ // UNABLE_TO_GET_ISSUER_CERT_LOCALLY since the root CA of ca1 is not
+ // installed locally.
+ {
+ serverOpts: {
+ ca: loadPEM('ca3-key'),
+ key: loadPEM('agent6-key'),
+ cert: loadPEM('agent6-cert')
+ },
+ clientOpts: {
+ port: common.PORT,
+ rejectUnauthorized: true
+ },
+ errorCode: 'UNABLE_TO_GET_ISSUER_CERT_LOCALLY'
+ }
+];
+
+function runTest(tindex) {
+ var tcase = testCases[tindex];
+
+ if (!tcase) return;
+
+ var server = tls.createServer(tcase.serverOpts, function(s) {
+ s.resume();
+ }).listen(common.PORT, function() {
+ var client = tls.connect(tcase.clientOpts);
+ client.on('error', function(e) {
+ assert.strictEqual(e.code, tcase.errorCode);
+ server.close(function() {
+ finished++;
+ runTest(tindex + 1);
+ });
+ });
});
-});
+}
+
+runTest(0);
+
process.on('exit', function() {
- assert(error);
+ assert.equal(finished, testCases.length);
});
diff --git a/test/parallel/test-tls-connect-given-socket.js b/test/parallel/test-tls-connect-given-socket.js
index 9e8170b13af..902b67aa515 100644
--- a/test/parallel/test-tls-connect-given-socket.js
+++ b/test/parallel/test-tls-connect-given-socket.js
@@ -43,16 +43,33 @@ var server = tls.createServer(options, function(socket) {
});
assert(client.readable);
assert(client.writable);
+
+ return client;
}
- // Already connected socket
- var connected = net.connect(common.PORT, function() {
- establish(connected);
+ // Immediate death socket
+ var immediateDeath = net.connect(common.PORT);
+ establish(immediateDeath).destroy();
+
+ // Outliving
+ var outlivingTCP = net.connect(common.PORT);
+ outlivingTCP.on('connect', function() {
+ outlivingTLS.destroy();
+ next();
});
+ var outlivingTLS = establish(outlivingTCP);
+
+ function next() {
+ // Already connected socket
+ var connected = net.connect(common.PORT, function() {
+ establish(connected);
+ });
+
+ // Connecting socket
+ var connecting = net.connect(common.PORT);
+ establish(connecting);
- // Connecting socket
- var connecting = net.connect(common.PORT);
- establish(connecting);
+ }
});
process.on('exit', function() {
diff --git a/test/parallel/test-tls-destroy-whilst-write.js b/test/parallel/test-tls-destroy-whilst-write.js
new file mode 100644
index 00000000000..8b865fab178
--- /dev/null
+++ b/test/parallel/test-tls-destroy-whilst-write.js
@@ -0,0 +1,29 @@
+'use strict';
+var assert = require('assert');
+var common = require('../common');
+
+if (!common.hasCrypto) {
+ console.log('1..0 # Skipped: missing crypto');
+ process.exit();
+}
+var tls = require('tls');
+var stream = require('stream');
+
+var delay = new stream.Duplex({
+ read: function read() {
+ },
+ write: function write(data, enc, cb) {
+ console.log('pending');
+ setTimeout(function() {
+ console.log('done');
+ cb();
+ }, 200);
+ }
+});
+
+var secure = tls.connect({
+ socket: delay
+});
+setImmediate(function() {
+ secure.destroy();
+});
diff --git a/test/parallel/test-tls-npn-server-client.js b/test/parallel/test-tls-npn-server-client.js
index bebb6799b9f..6e877b7ddef 100644
--- a/test/parallel/test-tls-npn-server-client.js
+++ b/test/parallel/test-tls-npn-server-client.js
@@ -47,20 +47,20 @@ var clientsOptions = [{
crl: serverOptions.crl,
NPNProtocols: ['a', 'b', 'c'],
rejectUnauthorized: false
-},{
+}, {
port: serverPort,
key: serverOptions.key,
cert: serverOptions.cert,
crl: serverOptions.crl,
NPNProtocols: ['c', 'b', 'e'],
rejectUnauthorized: false
-},{
+}, {
port: serverPort,
key: serverOptions.key,
cert: serverOptions.cert,
crl: serverOptions.crl,
rejectUnauthorized: false
-},{
+}, {
port: serverPort,
key: serverOptions.key,
cert: serverOptions.cert,
diff --git a/test/parallel/test-tls-session-cache.js b/test/parallel/test-tls-session-cache.js
index 7ba063a3a02..9b3da271709 100644
--- a/test/parallel/test-tls-session-cache.js
+++ b/test/parallel/test-tls-session-cache.js
@@ -11,8 +11,8 @@ if (!common.hasCrypto) {
process.exit();
}
-doTest({ tickets: false } , function() {
- doTest({ tickets: true } , function() {
+doTest({ tickets: false }, function() {
+ doTest({ tickets: true }, function() {
console.error('all done');
});
});
diff --git a/test/parallel/test-util-log.js b/test/parallel/test-util-log.js
index fbe3963348a..9285e3e3409 100644
--- a/test/parallel/test-util-log.js
+++ b/test/parallel/test-util-log.js
@@ -21,7 +21,7 @@ var tests = [
{input: function() {}, output: '[Function]'},
{input: parseInt('not a number', 10), output: 'NaN'},
{input: {answer: 42}, output: '{ answer: 42 }'},
- {input: [1,2,3], output: '[ 1, 2, 3 ]'}
+ {input: [1, 2, 3], output: '[ 1, 2, 3 ]'}
];
// test util.log()
diff --git a/test/parallel/test-zlib-dictionary-fail.js b/test/parallel/test-zlib-dictionary-fail.js
index ced829f8d49..b4a344ceef5 100644
--- a/test/parallel/test-zlib-dictionary-fail.js
+++ b/test/parallel/test-zlib-dictionary-fail.js
@@ -12,7 +12,7 @@ var zlib = require('zlib');
}));
// String "test" encoded with dictionary "dict".
- stream.write(Buffer([0x78,0xBB,0x04,0x09,0x01,0xA5]));
+ stream.write(Buffer([0x78, 0xBB, 0x04, 0x09, 0x01, 0xA5]));
})();
// Should raise an error, not trigger an assertion in src/node_zlib.cc
@@ -24,5 +24,5 @@ var zlib = require('zlib');
}));
// String "test" encoded with dictionary "dict".
- stream.write(Buffer([0x78,0xBB,0x04,0x09,0x01,0xA5]));
+ stream.write(Buffer([0x78, 0xBB, 0x04, 0x09, 0x01, 0xA5]));
})();
diff --git a/test/sequential/test-deprecation-flags.js b/test/sequential/test-deprecation-flags.js
index e8565a33635..ca325654c55 100644
--- a/test/sequential/test-deprecation-flags.js
+++ b/test/sequential/test-deprecation-flags.js
@@ -5,6 +5,9 @@ var execFile = require('child_process').execFile;
var depmod = require.resolve('../fixtures/deprecated.js');
var node = process.execPath;
+var depUserland =
+ require.resolve('../fixtures/deprecated-userland-function.js');
+
var normal = [depmod];
var noDep = ['--no-deprecation', depmod];
var traceDep = ['--trace-deprecation', depmod];
@@ -13,8 +16,8 @@ execFile(node, normal, function(er, stdout, stderr) {
console.error('normal: show deprecation warning');
assert.equal(er, null);
assert.equal(stdout, '');
- assert.equal(stderr,
- 'util.p: Use console.error() instead\n\'This is deprecated\'\n');
+ assert.equal(stderr, '(node) util.p is deprecated. Use console.error ' +
+ 'instead.\n\'This is deprecated\'\n');
console.log('normal ok');
});
@@ -32,7 +35,16 @@ execFile(node, traceDep, function(er, stdout, stderr) {
assert.equal(stdout, '');
var stack = stderr.trim().split('\n');
// just check the top and bottom.
- assert.equal(stack[0], 'Trace: util.p: Use console.error() instead');
+ assert.equal(stack[0],
+ 'Trace: util.p is deprecated. Use console.error instead.');
assert.equal(stack.pop(), '\'This is deprecated\'');
console.log('trace ok');
});
+
+execFile(node, [depUserland], function(er, stdout, stderr) {
+ console.error('normal: testing deprecated userland function');
+ assert.equal(er, null);
+ assert.equal(stdout, '');
+ assert.equal(0, stderr.indexOf('deprecatedFunction is deprecated.'));
+ console.error('normal: ok');
+});
diff --git a/test/sequential/test-tls-honorcipherorder.js b/test/sequential/test-tls-honorcipherorder.js
index c33cd9eea63..7e93ac5a059 100644
--- a/test/sequential/test-tls-honorcipherorder.js
+++ b/test/sequential/test-tls-honorcipherorder.js
@@ -57,7 +57,7 @@ test1();
function test1() {
// Client has the preference of cipher suites by default
- test(false, 'AES256-SHA:DES-CBC-SHA:RC4-SHA','AES256-SHA', test2);
+ test(false, 'AES256-SHA:DES-CBC-SHA:RC4-SHA', 'AES256-SHA', test2);
}
function test2() {
diff --git a/tools/eslint/README.md b/tools/eslint/README.md
index f2f75acf19c..bb4cc9c8e5a 100644
--- a/tools/eslint/README.md
+++ b/tools/eslint/README.md
@@ -3,6 +3,7 @@
[![Test coverage][coveralls-image]][coveralls-url]
[![Downloads][downloads-image]][downloads-url]
[![Bountysource](https://www.bountysource.com/badge/tracker?tracker_id=282608)](https://www.bountysource.com/trackers/282608-eslint?utm_source=282608&utm_medium=shield&utm_campaign=TRACKER_BADGE)
+[![Join the chat at https://gitter.im/eslint/eslint](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/eslint/eslint?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
# ESLint
@@ -22,8 +23,26 @@ You can install ESLint using npm:
## Usage
+If it's your first time using ESLint, you should set up a config file using `--init`:
+
+ eslint --init
+
+After that, you can run ESLint on any JavaScript file:
+
eslint test.js test2.js
+## Team
+
+These folks keep the project moving and are resources for help:
+
+* Nicholas C. Zakas ([@nzakas](https://github.com/nzakas)) - project lead
+* Ilya Volodin ([@ilyavolodin](https://github.com/ilyavolodin)) - reviewer
+* Brandon Mills ([@btmills](https://github.com/btmills)) - reviewer
+* Mathias Schreck ([@lo1tuma](https://github.com/lo1tuma)) - committer
+* Gyandeep Singh ([@gyandeeps](https://github.com/gyandeeps)) - committer
+* Jamund Ferguson ([@xjamundx](https://github.com/xjamundx)) - committer
+
+
## Frequently Asked Questions
### Why don't you like JSHint???
@@ -34,12 +53,16 @@ I do like JSHint. And I like Anton and Rick. Neither of those were deciding fact
That's not really a question, but I got it. I'm not trying to convince you that ESLint is better than JSHint. The only thing I know is that ESLint is better than JSHint for what I'm doing. In the off chance you're doing something similar, it might be better for you. Otherwise, keep using JSHint, I'm certainly not going to tell you to stop using it.
-### How does ESLint performance compare to JSHint?
+### How does ESLint performance compare to JSHint and JSCS?
ESLint is slower than JSHint, usually 2-3x slower on a single file. This is because ESLint uses Espree to construct an AST before it can evaluate your code whereas JSHint evaluates your code as it's being parsed. The speed is also based on the number of rules you enable; the more rules you enable, the slower the process.
Despite being slower, we believe that ESLint is fast enough to replace JSHint without causing significant pain.
+ESLint is faster than JSCS, as ESLint uses a single-pass traversal for analysis whereas JSCS using a querying model.
+
+If you are using both JSHint and JSCS on your files, then using just ESLint will be faster.
+
### Is ESLint just linting or does it also check style?
ESLint does both traditional linting (looking for problematic patterns) and style checking (enforcement of conventions). You can use it for both.
@@ -50,6 +73,7 @@ The following projects are using ESLint to validate their JavaScript:
* [Drupal](https://www.drupal.org/node/2274223)
* [Esprima](https://github.com/ariya/esprima)
+* [io.js](https://github.com/iojs/io.js/commit/f9dd34d301ab385ae316769b85ef916f9b70b6f6)
* [WebKit](https://bugs.webkit.org/show_bug.cgi?id=125048)
In addition, the following companies are using ESLint internally to validate their JavaScript:
@@ -62,11 +86,19 @@ In addition, the following companies are using ESLint internally to validate the
### What about ECMAScript 6 support?
-We are implementing ECMAScript 6 support piece-by-piece starting with version 0.12.0. You'll be able to opt-in to any ECMAScript 6 feature you want to use.
+ESLint has full support for ECMAScript 6. By default, this support is off. You can enable ECMAScript 6 support through [configuration](http://eslint.org/docs/user-guide/configuring).
+
+### Does ESLint support JSX?
+
+Yes, ESLint natively supports parsing JSX syntax (this must be enabled in [configuration](http://eslint.org/docs/user-guide/configuring).). Please note that supporting JSX syntax *is not* the same as supporting React. React applies specific semantics to JSX syntax that ESLint doesn't recognize. We recommend using [eslint-plugin-react](https://www.npmjs.com/package/eslint-plugin-react) if you are using React and want React semantics.
+
+### What about ECMAScript 7/2016 and experimental features?
+
+ESLint doesn't natively support experimental ECMAScript language features. You can use [babel-eslint](https://github.com/babel/babel-eslint) to use any option available in Babel.
### Where to ask for help?
-Join our [Mailing List](https://groups.google.com/group/eslint)
+Join our [Mailing List](https://groups.google.com/group/eslint) or [Chatroom](https://gitter.im/eslint/eslint)
[npm-image]: https://img.shields.io/npm/v/eslint.svg?style=flat-square
diff --git a/tools/eslint/bin/eslint.js b/tools/eslint/bin/eslint.js
index 0188c2e6000..5e0cc800c8c 100755
--- a/tools/eslint/bin/eslint.js
+++ b/tools/eslint/bin/eslint.js
@@ -1,9 +1,11 @@
#!/usr/bin/env node
var concat = require("concat-stream"),
+ configInit = require("../lib/config-initializer"),
cli = require("../lib/cli");
var exitCode = 0,
- useStdIn = (process.argv.indexOf("--stdin") > -1);
+ useStdIn = (process.argv.indexOf("--stdin") > -1),
+ init = (process.argv.indexOf("--init") > -1);
if (useStdIn) {
process.stdin.pipe(concat({ encoding: "string" }, function(text) {
@@ -15,6 +17,17 @@ if (useStdIn) {
exitCode = 1;
}
}));
+} else if (init) {
+ configInit.initializeConfig(function(err) {
+ if (err) {
+ exitCode = 1;
+ console.error(err.message);
+ console.error(err.stack);
+ } else {
+ console.log("Successfully created .eslintrc file in " + process.cwd());
+ exitCode = 0;
+ }
+ });
} else {
exitCode = cli.execute(process.argv);
}
diff --git a/tools/eslint/conf/environments.js b/tools/eslint/conf/environments.js
index f59b852f946..5b01dc7ad6b 100644
--- a/tools/eslint/conf/environments.js
+++ b/tools/eslint/conf/environments.js
@@ -28,6 +28,9 @@ module.exports = {
"handle-callback-err": [2, "err"]
}
},
+ worker: {
+ globals: globals.worker
+ },
amd: {
globals: globals.amd
},
@@ -52,6 +55,12 @@ module.exports = {
meteor: {
globals: globals.meteor
},
+ mongo: {
+ globals: globals.mongo
+ },
+ applescript: {
+ globals: globals.applescript
+ },
es6: {
ecmaFeatures: {
arrowFunctions: true,
diff --git a/tools/eslint/conf/eslint.json b/tools/eslint/conf/eslint.json
index dc92cc143d2..28dc73ca09f 100644
--- a/tools/eslint/conf/eslint.json
+++ b/tools/eslint/conf/eslint.json
@@ -29,7 +29,8 @@
"no-duplicate-case": 2,
"no-else-return": 0,
"no-empty": 2,
- "no-empty-class": 2,
+ "no-empty-class": 0,
+ "no-empty-character-class": 2,
"no-empty-label": 2,
"no-eq-null": 0,
"no-eval": 2,
@@ -56,6 +57,7 @@
"no-loop-func": 2,
"no-mixed-requires": [0, false],
"no-mixed-spaces-and-tabs": [2, false],
+ "linebreak-style": [0, "unix"],
"no-multi-spaces": 2,
"no-multi-str": 2,
"no-multiple-empty-lines": [0, {"max": 2}],
@@ -92,21 +94,27 @@
"no-sync": 0,
"no-ternary": 0,
"no-trailing-spaces": 2,
+ "no-this-before-super": 0,
"no-throw-literal": 0,
"no-undef": 2,
"no-undef-init": 2,
"no-undefined": 0,
+ "no-unexpected-multiline": 0,
"no-underscore-dangle": 2,
+ "no-unneeded-ternary": 0,
"no-unreachable": 2,
"no-unused-expressions": 2,
"no-unused-vars": [2, {"vars": "all", "args": "after-used"}],
"no-use-before-define": 2,
"no-void": 0,
"no-var": 0,
+ "prefer-const": 0,
"no-warning-comments": [0, { "terms": ["todo", "fixme", "xxx"], "location": "start" }],
"no-with": 2,
"no-wrap-func": 2,
+ "array-bracket-spacing": [0, "never"],
+ "accessor-pairs": 0,
"block-scoped-var": 0,
"brace-style": [0, "1tbs"],
"camelcase": 2,
@@ -114,10 +122,13 @@
"comma-spacing": 2,
"comma-style": 0,
"complexity": [0, 11],
+ "computed-property-spacing": [0, "never"],
"consistent-return": 2,
"consistent-this": [0, "that"],
+ "constructor-super": 0,
"curly": [2, "all"],
"default-case": 0,
+ "dot-location": 0,
"dot-notation": [2, { "allowKeywords": true }],
"eol-last": 2,
"eqeqeq": 2,
@@ -130,6 +141,7 @@
"handle-callback-err": 0,
"indent": 0,
"key-spacing": [2, { "beforeColon": false, "afterColon": true }],
+ "lines-around-comment": 0,
"max-depth": [0, 4],
"max-len": [0, 80, 4],
"max-nested-callbacks": [0, 2],
@@ -138,6 +150,7 @@
"new-cap": 2,
"new-parens": 2,
"newline-after-var": 0,
+ "object-curly-spacing": [0, "never"],
"object-shorthand": 0,
"one-var": 0,
"operator-assignment": [0, "always"],
@@ -159,6 +172,7 @@
"space-infix-ops": 2,
"space-return-throw-case": 2,
"space-unary-ops": [2, { "words": true, "nonwords": false }],
+ "spaced-comment": 0,
"spaced-line-comment": [0, "always"],
"strict": 2,
"use-isnan": 2,
diff --git a/tools/eslint/lib/api.js b/tools/eslint/lib/api.js
index aafad533c2f..160319ef59a 100644
--- a/tools/eslint/lib/api.js
+++ b/tools/eslint/lib/api.js
@@ -8,5 +8,6 @@
module.exports = {
linter: require("./eslint"),
cli: require("./cli"),
- CLIEngine: require("./cli-engine")
+ CLIEngine: require("./cli-engine"),
+ validator: require("./config-validator")
};
diff --git a/tools/eslint/lib/cli-engine.js b/tools/eslint/lib/cli-engine.js
index 29863fadd5d..fce73c6bba7 100644
--- a/tools/eslint/lib/cli-engine.js
+++ b/tools/eslint/lib/cli-engine.js
@@ -27,7 +27,8 @@ var fs = require("fs"),
traverse = require("./util/traverse"),
IgnoredPaths = require("./ignored-paths"),
Config = require("./config"),
- util = require("./util");
+ util = require("./util"),
+ validator = require("./config-validator");
//------------------------------------------------------------------------------
// Typedefs
@@ -154,30 +155,33 @@ function calculateStatsPerRun(results) {
}
/**
- * Processes an individual file using ESLint. Files used here are known to
- * exist, so no need to check that here.
- * @param {string} filename The filename of the file being checked.
+ * Processes an source code using ESLint.
+ * @param {string} text The source code to check.
* @param {Object} configHelper The configuration options for ESLint.
- * @returns {Result} The results for linting on this file.
+ * @param {string} filename An optional string representing the texts filename.
+ * @returns {Result} The results for linting on this text.
* @private
*/
-function processFile(filename, configHelper) {
+function processText(text, configHelper, filename) {
// clear all existing settings for a new file
eslint.reset();
- var filePath = path.resolve(filename),
+ var filePath,
config,
- text,
messages,
stats,
fileExtension = path.extname(filename),
processor;
- debug("Linting " + filePath);
+ if (filename) {
+ filePath = path.resolve(filename);
+ }
+
+ filename = filename || "<text>";
+ debug("Linting " + filename);
config = configHelper.getConfig(filePath);
loadPlugins(config.plugins);
- text = fs.readFileSync(path.resolve(filename), "utf8");
for (var plugin in loadedPlugins) {
if (loadedPlugins[plugin].processors && Object.keys(loadedPlugins[plugin].processors).indexOf(fileExtension) >= 0) {
@@ -208,35 +212,38 @@ function processFile(filename, configHelper) {
}
/**
- * Processes an source code using ESLint.
- * @param {string} text The source code to check.
+ * Processes an individual file using ESLint. Files used here are known to
+ * exist, so no need to check that here.
+ * @param {string} filename The filename of the file being checked.
* @param {Object} configHelper The configuration options for ESLint.
- * @param {string} filename An optional string representing the texts filename.
- * @returns {Result} The results for linting on this text.
+ * @returns {Result} The results for linting on this file.
* @private
*/
-function processText(text, configHelper, filename) {
-
- // clear all existing settings for a new file
- eslint.reset();
-
- var config,
- messages,
- stats;
+function processFile(filename, configHelper) {
- filename = filename || "<text>";
- debug("Linting " + filename);
- config = configHelper.getConfig();
- loadPlugins(config.plugins);
- messages = eslint.verify(text, config, filename);
+ var text = fs.readFileSync(path.resolve(filename), "utf8");
- stats = calculateStatsPerFile(messages);
+ return processText(text, configHelper, filename);
+}
+/**
+ * Returns result with warning by ignore settings
+ * @param {string} filePath File path of checked code
+ * @returns {Result} Result with single warning
+ * @private
+ */
+function createIgnoreResult(filePath) {
return {
- filePath: filename,
- messages: messages,
- errorCount: stats.errorCount,
- warningCount: stats.warningCount
+ filePath: filePath,
+ messages: [
+ {
+ fatal: false,
+ severity: 1,
+ message: "File ignored because of your .eslintignore file. Use --no-ignore to override."
+ }
+ ],
+ errorCount: 0,
+ warningCount: 1
};
}
@@ -265,7 +272,9 @@ function CLIEngine(options) {
});
}
- loadPlugins(this.options.plugins);
+ Object.keys(this.options.rules || {}).forEach(function(name) {
+ validator.validateRuleOptions(name, this.options.rules[name], "CLI");
+ }.bind(this));
}
CLIEngine.prototype = {
@@ -273,6 +282,20 @@ CLIEngine.prototype = {
constructor: CLIEngine,
/**
+ * Add a plugin by passing it's configuration
+ * @param {string} name Name of the plugin.
+ * @param {Object} pluginobject Plugin configuration object.
+ * @returns {void}
+ */
+ addPlugin: function(name, pluginobject) {
+ var pluginNameWithoutPrefix = util.removePluginPrefix(util.removeNameSpace(name));
+ if (pluginobject.rules) {
+ rules.import(pluginobject.rules, pluginNameWithoutPrefix);
+ }
+ loadedPlugins[pluginNameWithoutPrefix] = pluginobject;
+ },
+
+ /**
* Executes the current configuration on an array of file and directory names.
* @param {string[]} files An array of file and directory names.
* @returns {Object} The results for all files that were linted.
@@ -303,18 +326,7 @@ CLIEngine.prototype = {
if (options.ignore) {
files.forEach(function(file) {
if (fs.statSync(path.resolve(file)).isFile() && processed.indexOf(file) === -1) {
- results.push({
- filePath: file,
- messages: [
- {
- fatal: false,
- severity: 1,
- message: "File ignored because of your .eslintignore file. Use --no-ignore to override."
- }
- ],
- errorCount: 0,
- warningCount: 1
- });
+ results.push(createIgnoreResult(file));
}
});
}
@@ -336,11 +348,19 @@ CLIEngine.prototype = {
*/
executeOnText: function(text, filename) {
- var configHelper = new Config(this.options),
- results = [],
- stats;
+ var results = [],
+ stats,
+ options = this.options,
+ configHelper = new Config(options),
+ ignoredPaths = IgnoredPaths.load(options),
+ exclude = ignoredPaths.contains.bind(ignoredPaths);
+
+ if (filename && options.ignore && exclude(filename)) {
+ results.push(createIgnoreResult(filename));
+ } else {
+ results.push(processText(text, configHelper, filename));
+ }
- results.push(processText(text, configHelper, filename));
stats = calculateStatsPerRun(results);
return {
@@ -414,8 +434,6 @@ CLIEngine.prototype = {
} else {
return null;
}
-
-
}
};
diff --git a/tools/eslint/lib/cli.js b/tools/eslint/lib/cli.js
index 72afc98167c..a6d08caf956 100644
--- a/tools/eslint/lib/cli.js
+++ b/tools/eslint/lib/cli.js
@@ -45,6 +45,7 @@ function translateOptions(cliOptions) {
globals: cliOptions.global,
ignore: cliOptions.ignore,
ignorePath: cliOptions.ignorePath,
+ ignorePattern: cliOptions.ignorePattern,
configFile: cliOptions.config,
rulePaths: cliOptions.rulesdir,
reset: cliOptions.reset,
diff --git a/tools/eslint/lib/config-initializer.js b/tools/eslint/lib/config-initializer.js
new file mode 100644
index 00000000000..56723cd5baf
--- /dev/null
+++ b/tools/eslint/lib/config-initializer.js
@@ -0,0 +1,145 @@
+/**
+ * @fileoverview Config initialization wizard.
+ * @author Ilya Volodin
+ * @copyright 2015 Ilya Volodin. All rights reserved.
+ */
+
+"use strict";
+
+var exec = require("child_process").exec,
+ fs = require("fs"),
+ inquirer = require("inquirer"),
+ yaml = require("js-yaml");
+
+/* istanbul ignore next: hard to test fs function */
+/**
+ * Create .eslintrc file in the current working directory
+ * @param {object} config object that contains user's answers
+ * @param {bool} isJson should config file be json or yaml
+ * @param {function} callback function to call once the file is written.
+ * @returns {void}
+ */
+function writeFile(config, isJson, callback) {
+ try {
+ fs.writeFileSync("./.eslintrc", isJson ? JSON.stringify(config, null, 4) : yaml.safeDump(config));
+ } catch (e) {
+ callback(e);
+ return;
+ }
+ if (config.plugins && config.plugins.indexOf("react") >= 0) {
+ exec("npm i eslint-plugin-react --save-dev", callback);
+ } else {
+ callback();
+ }
+}
+
+/**
+ * process user's answers and create config object
+ * @param {object} answers answers received from inquirer
+ * @returns {object} config object
+ */
+function processAnswers(answers) {
+ var config = {rules: {}, env: {}};
+ config.rules.indent = [2, answers.indent];
+ config.rules.quotes = [2, answers.quotes];
+ config.rules["linebreak-style"] = [2, answers.linebreak];
+ config.rules.semi = [2, answers.semi ? "always" : "never"];
+ if (answers.es6) {
+ config.env.es6 = true;
+ }
+ answers.env.forEach(function(env) {
+ config.env[env] = true;
+ });
+ if (answers.jsx) {
+ config.ecmaFeatures = {jsx: true};
+ if (answers.react) {
+ config.plugins = ["react"];
+ }
+ }
+ return config;
+}
+
+/* istanbul ignore next: no need to test inquirer*/
+/**
+ * Ask use a few questions on command prompt
+ * @param {function} callback callback function when file has been written
+ * @returns {void}
+ */
+function promptUser(callback) {
+ inquirer.prompt([
+ {
+ type: "list",
+ name: "indent",
+ message: "What style of indentation do you use?",
+ default: "tabs",
+ choices: [{name: "Tabs", value: "tab"}, {name: "Spaces", value: 4}]
+ },
+ {
+ type: "list",
+ name: "quotes",
+ message: "What quotes do you use for strings?",
+ default: "double",
+ choices: [{name: "Double", value: "double"}, {name: "Single", value: "single"}]
+ },
+ {
+ type: "list",
+ name: "linebreak",
+ message: "What line endings do you use?",
+ default: "unix",
+ choices: [{name: "Unix", value: "unix"}, {name: "Windows", value: "windows"}]
+ },
+ {
+ type: "confirm",
+ name: "semi",
+ message: "Do you require semicolons?",
+ default: true
+ },
+ {
+ type: "confirm",
+ name: "es6",
+ message: "Are you using ECMAScript 6 features?",
+ default: false
+ },
+ {
+ type: "checkbox",
+ name: "env",
+ message: "Where will your code run?",
+ default: ["browser"],
+ choices: [{name: "Node", value: "node"}, {name: "Browser", value: "browser"}]
+ },
+ {
+ type: "confirm",
+ name: "jsx",
+ message: "Do you use JSX?",
+ default: false
+ },
+ {
+ type: "confirm",
+ name: "react",
+ message: "Do you use React",
+ default: false,
+ when: function (answers) {
+ return answers.jsx;
+ }
+ },
+ {
+ type: "list",
+ name: "format",
+ message: "What format do you want your config file to be in?",
+ default: "JSON",
+ choices: ["JSON", "YAML"]
+ }
+ ], function(answers) {
+ var config = processAnswers(answers);
+ writeFile(config, answers.format === "JSON", callback);
+ });
+}
+
+var init = {
+ processAnswers: processAnswers,
+ initializeConfig: /* istanbul ignore next */ function(callback) {
+ promptUser(callback);
+ }
+};
+
+module.exports = init;
diff --git a/tools/eslint/lib/config-validator.js b/tools/eslint/lib/config-validator.js
new file mode 100644
index 00000000000..cece433c7cc
--- /dev/null
+++ b/tools/eslint/lib/config-validator.js
@@ -0,0 +1,110 @@
+/**
+ * @fileoverview Validates configs.
+ * @author Brandon Mills
+ * @copyright 2015 Brandon Mills
+ */
+
+"use strict";
+
+var rules = require("./rules"),
+ schemaValidator = require("is-my-json-valid");
+
+var validators = {
+ rules: Object.create(null)
+};
+
+/**
+ * Gets a complete options schema for a rule.
+ * @param {string} id The rule's unique name.
+ * @returns {object} JSON Schema for the rule's options.
+ */
+function getRuleOptionsSchema(id) {
+ var rule = rules.get(id),
+ schema = rule && rule.schema;
+
+ if (!schema) {
+ return {
+ "type": "array",
+ "items": [
+ {
+ "enum": [0, 1, 2]
+ }
+ ],
+ "minItems": 1
+ };
+ }
+
+ // Given a tuple of schemas, insert warning level at the beginning
+ if (Array.isArray(schema)) {
+ return {
+ "type": "array",
+ "items": [
+ {
+ "enum": [0, 1, 2]
+ }
+ ].concat(schema),
+ "minItems": 1,
+ "maxItems": schema.length + 1
+ };
+ }
+
+ // Given a full schema, leave it alone
+ return schema;
+}
+
+/**
+ * Validates a rule's options against its schema.
+ * @param {string} id The rule's unique name.
+ * @param {array|number} options The given options for the rule.
+ * @param {string} source The name of the configuration source.
+ * @returns {void}
+ */
+function validateRuleOptions(id, options, source) {
+ var validateRule = validators.rules[id],
+ message;
+
+ if (!validateRule) {
+ validateRule = schemaValidator(getRuleOptionsSchema(id), { verbose: true });
+ validators.rules[id] = validateRule;
+ }
+
+ if (typeof options === "number") {
+ options = [options];
+ }
+
+ validateRule(options);
+
+ if (validateRule.errors) {
+ message = [
+ source, ":\n",
+ "\tConfiguration for rule \"", id, "\" is invalid:\n"
+ ];
+ validateRule.errors.forEach(function (error) {
+ message.push(
+ "\tValue \"", error.value, "\" ", error.message, ".\n"
+ );
+ });
+
+ throw new Error(message.join(""));
+ }
+}
+
+/**
+ * Validates an entire config object.
+ * @param {object} config The config object to validate.
+ * @param {string} source The location to report with any errors.
+ * @returns {void}
+ */
+function validate(config, source) {
+ if (typeof config.rules === "object") {
+ Object.keys(config.rules).forEach(function (id) {
+ validateRuleOptions(id, config.rules[id], source);
+ });
+ }
+}
+
+module.exports = {
+ getRuleOptionsSchema: getRuleOptionsSchema,
+ validate: validate,
+ validateRuleOptions: validateRuleOptions
+};
diff --git a/tools/eslint/lib/config.js b/tools/eslint/lib/config.js
index 3955a048f68..a4f8d0e87cd 100644
--- a/tools/eslint/lib/config.js
+++ b/tools/eslint/lib/config.js
@@ -20,7 +20,9 @@ var fs = require("fs"),
assign = require("object-assign"),
debug = require("debug"),
yaml = require("js-yaml"),
- userHome = require("user-home");
+ userHome = require("user-home"),
+ isAbsolutePath = require("path-is-absolute"),
+ validator = require("./config-validator");
//------------------------------------------------------------------------------
// Constants
@@ -44,23 +46,97 @@ var loadedPlugins = Object.create(null);
debug = debug("eslint:config");
/**
+ * Determines if a given string represents a filepath or not using the same
+ * conventions as require(), meaning that the first character must be nonalphanumeric
+ * and not the @ sign which is used for scoped packages to be considered a file path.
+ * @param {string} filePath The string to check.
+ * @returns {boolean} True if it's a filepath, false if not.
+ * @private
+ */
+function isFilePath(filePath) {
+ return isAbsolutePath(filePath) || !/\w|@/.test(filePath[0]);
+}
+
+/**
* Load and parse a JSON config object from a file.
* @param {string} filePath the path to the JSON config file
* @returns {Object} the parsed config object (empty object if there was a parse error)
+ * @private
*/
function loadConfig(filePath) {
var config = {};
if (filePath) {
- try {
- config = yaml.safeLoad(stripComments(fs.readFileSync(filePath, "utf8"))) || {};
- } catch (e) {
- debug("Error reading YAML file: " + filePath);
- e.message = "Cannot read config file: " + filePath + "\nError: " + e.message;
- throw e;
+
+ if (isFilePath(filePath)) {
+ try {
+ config = yaml.safeLoad(stripComments(fs.readFileSync(filePath, "utf8"))) || {};
+ } catch (e) {
+ debug("Error reading YAML file: " + filePath);
+ e.message = "Cannot read config file: " + filePath + "\nError: " + e.message;
+ throw e;
+ }
+
+ if (path.basename(filePath) === PACKAGE_CONFIG_FILENAME) {
+ config = config[PACKAGE_CONFIG_FIELD_NAME] || {};
+ }
+
+ } else {
+
+ // it's a package
+ if (filePath.indexOf("eslint-config-") === -1) {
+ if (filePath.indexOf("@") === 0) {
+ // for scoped packages, insert the eslint-config after the first /
+ filePath = filePath.replace(/^([^\/]+\/)(.*)$/, "$1eslint-config-$2");
+ } else {
+ filePath = "eslint-config-" + filePath;
+ }
+ }
+
+ config = util.mergeConfigs(config, require(filePath));
+ }
+
+ validator.validate(config, filePath);
+
+ // If an `extends` property is defined, it represents a configuration file to use as
+ // a "parent". Load the referenced file and merge the configuration recursively.
+ if (config.extends) {
+ var configExtends = config.extends;
+
+ if (!Array.isArray(config.extends)) {
+ configExtends = [config.extends];
+ }
+
+ // Make the last element in an array take the highest precedence
+ config = configExtends.reduceRight(function (previousValue, parentPath) {
+
+ if (isFilePath(parentPath)) {
+ // If the `extends` path is relative, use the directory of the current configuration
+ // file as the reference point. Otherwise, use as-is.
+ parentPath = (!isAbsolutePath(parentPath) ?
+ path.join(path.dirname(filePath), parentPath) :
+ parentPath
+ );
+ }
+
+ try {
+ return util.mergeConfigs(loadConfig(parentPath), previousValue);
+ } catch (e) {
+ // If the file referenced by `extends` failed to load, add the path to the
+ // configuration file that referenced it to the error message so the user is
+ // able to see where it was referenced from, then re-throw
+ e.message += "\nReferenced from: " + filePath;
+ throw e;
+ }
+
+ }, config);
+
}
+
+
}
+
return config;
}
@@ -72,37 +148,35 @@ function loadConfig(filePath) {
function getPluginsConfig(pluginNames) {
var pluginConfig = {};
- if (pluginNames) {
- pluginNames.forEach(function (pluginName) {
- var pluginNamespace = util.getNamespace(pluginName),
- pluginNameWithoutNamespace = util.removeNameSpace(pluginName),
- pluginNameWithoutPrefix = util.removePluginPrefix(pluginNameWithoutNamespace),
- plugin = {},
- rules = {};
-
- if (!loadedPlugins[pluginNameWithoutPrefix]) {
- try {
- plugin = require(pluginNamespace + util.PLUGIN_NAME_PREFIX + pluginNameWithoutPrefix);
- loadedPlugins[pluginNameWithoutPrefix] = plugin;
- } catch(err) {
- debug("Failed to load plugin configuration for " + pluginNameWithoutPrefix + ". Proceeding without it.");
- plugin = { rulesConfig: {}};
- }
- } else {
- plugin = loadedPlugins[pluginNameWithoutPrefix];
- }
-
- if (!plugin.rulesConfig) {
- plugin.rulesConfig = {};
+ pluginNames.forEach(function (pluginName) {
+ var pluginNamespace = util.getNamespace(pluginName),
+ pluginNameWithoutNamespace = util.removeNameSpace(pluginName),
+ pluginNameWithoutPrefix = util.removePluginPrefix(pluginNameWithoutNamespace),
+ plugin = {},
+ rules = {};
+
+ if (!loadedPlugins[pluginNameWithoutPrefix]) {
+ try {
+ plugin = require(pluginNamespace + util.PLUGIN_NAME_PREFIX + pluginNameWithoutPrefix);
+ loadedPlugins[pluginNameWithoutPrefix] = plugin;
+ } catch(err) {
+ debug("Failed to load plugin configuration for " + pluginNameWithoutPrefix + ". Proceeding without it.");
+ plugin = { rulesConfig: {}};
}
+ } else {
+ plugin = loadedPlugins[pluginNameWithoutPrefix];
+ }
- Object.keys(plugin.rulesConfig).forEach(function(item) {
- rules[pluginNameWithoutPrefix + "/" + item] = plugin.rulesConfig[item];
- });
+ if (!plugin.rulesConfig) {
+ plugin.rulesConfig = {};
+ }
- pluginConfig = util.mergeConfigs(pluginConfig, rules);
+ Object.keys(plugin.rulesConfig).forEach(function(item) {
+ rules[pluginNameWithoutPrefix + "/" + item] = plugin.rulesConfig[item];
});
- }
+
+ pluginConfig = util.mergeConfigs(pluginConfig, rules);
+ });
return {rules: pluginConfig};
}
@@ -147,15 +221,12 @@ function getLocalConfig(thisConfig, directory) {
continue;
}
+ debug("Loading " + localConfigFile);
localConfig = loadConfig(localConfigFile);
- if (path.basename(localConfigFile) !== LOCAL_CONFIG_FILENAME) {
-
- // Don't consider a local config file found if the package.json doesn't have the eslintConfig field.
- if (!localConfig.hasOwnProperty(PACKAGE_CONFIG_FIELD_NAME)) {
- continue;
- }
- localConfig = localConfig[PACKAGE_CONFIG_FIELD_NAME] || {};
+ // Don't consider a local config file found if the config is empty.
+ if (!Object.keys(localConfig).length) {
+ continue;
}
found = true;
@@ -242,7 +313,6 @@ function Config(options) {
require(path.resolve(__dirname, "..", "conf", "eslint.json"));
}
- this.baseConfig.format = options.format;
this.useEslintrc = (options.useEslintrc !== false);
this.env = (options.envs || []).reduce(function (envs, name) {
@@ -317,10 +387,8 @@ Config.prototype.getConfig = function (filePath) {
}
// Step 6: Merge in command line environments
- if (this.env) {
- debug("Merging command line environment settings");
- config = util.mergeConfigs(config, createEnvironmentConfig(this.env, this.options.reset));
- }
+ debug("Merging command line environment settings");
+ config = util.mergeConfigs(config, createEnvironmentConfig(this.env, this.options.reset));
// Step 7: Merge in command line rules
if (this.options.rules) {
diff --git a/tools/eslint/lib/eslint.js b/tools/eslint/lib/eslint.js
index 0a3e39192b1..28f6d036d86 100644
--- a/tools/eslint/lib/eslint.js
+++ b/tools/eslint/lib/eslint.js
@@ -18,16 +18,13 @@ var estraverse = require("estraverse-fb"),
timing = require("./timing"),
createTokenStore = require("./token-store.js"),
EventEmitter = require("events").EventEmitter,
- escapeRegExp = require("escape-string-regexp");
+ escapeRegExp = require("escape-string-regexp"),
+ validator = require("./config-validator");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
-// TODO: Remove when estraverse is updated
-estraverse.Syntax.Super = "Super";
-estraverse.VisitorKeys.Super = [];
-
/**
* Parses a list of "name:boolean_value" or/and "name" options divided by comma or
* whitespace.
@@ -238,13 +235,14 @@ function enableReporting(reportingConfig, start, rulesToEnable) {
* Parses comments in file to extract file-specific config of rules, globals
* and environments and merges them with global config; also code blocks
* where reporting is disabled or enabled and merges them with reporting config.
+ * @param {string} filename The file being checked.
* @param {ASTNode} ast The top node of the AST.
* @param {Object} config The existing configuration data.
* @param {Object[]} reportingConfig The existing reporting configuration data.
* @param {Object[]} messages The messages queue.
* @returns {void}
*/
-function modifyConfigsFromComments(ast, config, reportingConfig, messages) {
+function modifyConfigsFromComments(filename, ast, config, reportingConfig, messages) {
var commentConfig = {
astGlobals: {},
@@ -284,9 +282,8 @@ function modifyConfigsFromComments(ast, config, reportingConfig, messages) {
var items = parseJsonConfig(value, comment.loc, messages);
Object.keys(items).forEach(function(name) {
var ruleValue = items[name];
- if (typeof ruleValue === "number" || (Array.isArray(ruleValue) && typeof ruleValue[0] === "number")) {
- commentRules[name] = ruleValue;
- }
+ validator.validateRuleOptions(name, ruleValue, filename + " line " + comment.loc.start.line);
+ commentRules[name] = ruleValue;
});
break;
@@ -302,11 +299,10 @@ function modifyConfigsFromComments(ast, config, reportingConfig, messages) {
}
});
- // apply environment rules before user rules
+ // apply environment configs
Object.keys(commentConfig.env).forEach(function (name) {
- var environmentRules = environments[name] && environments[name].rules;
- if (commentConfig.env[name] && environmentRules) {
- assign(commentConfig.rules, environmentRules);
+ if (environments[name]) {
+ util.mergeConfigs(commentConfig, environments[name]);
}
});
assign(commentConfig.rules, commentRules);
@@ -461,12 +457,14 @@ module.exports = (function() {
});
} catch (ex) {
+ // If the message includes a leading line number, strip it:
+ var message = ex.message.replace(/^line \d+:/i, "").trim();
+
messages.push({
fatal: true,
severity: 2,
- // messages come as "Line X: Unexpected token foo", so strip off leading part
- message: ex.message.substring(ex.message.indexOf(":") + 1).trim(),
+ message: message,
line: ex.lineNumber,
column: ex.column
@@ -613,7 +611,7 @@ module.exports = (function() {
currentAST = ast;
// parse global comments and modify config
- modifyConfigsFromComments(ast, config, reportingConfig, messages);
+ modifyConfigsFromComments(filename, ast, config, reportingConfig, messages);
// enable appropriate rules
Object.keys(config.rules).filter(function(key) {
@@ -774,7 +772,7 @@ module.exports = (function() {
}
Object.keys(opts || {}).forEach(function (key) {
- var rx = new RegExp("{{" + escapeRegExp(key) + "}}", "g");
+ var rx = new RegExp(escapeRegExp("{{" + key + "}}"), "g");
message = message.replace(rx, opts[key]);
});
@@ -888,9 +886,24 @@ module.exports = (function() {
return null;
}
+ /**
+ * Check to see if its a ES6 export declaration
+ * @param {ASTNode} astNode - any node
+ * @returns {boolean} whether the given node represents a export declaration
+ */
+ function looksLikeExport(astNode) {
+ return astNode.type === "ExportDefaultDeclaration" || astNode.type === "ExportNamedDeclaration" ||
+ astNode.type === "ExportAllDeclaration" || astNode.type === "ExportSpecifier";
+ }
+
switch (node.type) {
case "FunctionDeclaration":
- return findJSDocComment(node.leadingComments);
+ if (looksLikeExport(parent)) {
+ return findJSDocComment(parent.leadingComments);
+ } else {
+ return findJSDocComment(node.leadingComments);
+ }
+ break;
case "ArrowFunctionExpression":
case "FunctionExpression":
@@ -958,7 +971,7 @@ module.exports = (function() {
// if current node is function declaration, add it to the list
var current = controller.current();
if (["FunctionDeclaration", "FunctionExpression",
- "ArrowFunctionExpression"].indexOf(current.type) >= 0) {
+ "ArrowFunctionExpression", "SwitchStatement"].indexOf(current.type) >= 0) {
parents.push(current);
}
diff --git a/tools/eslint/lib/file-finder.js b/tools/eslint/lib/file-finder.js
index 3cdf9150fd7..f4b8a5ce7aa 100644
--- a/tools/eslint/lib/file-finder.js
+++ b/tools/eslint/lib/file-finder.js
@@ -78,7 +78,7 @@ FileFinder.prototype.findInDirectoryOrParents = function (directory) {
while (directory !== child) {
dirs[searched++] = directory;
- if (getDirectoryEntries(directory).indexOf(name) !== -1) {
+ if (getDirectoryEntries(directory).indexOf(name) !== -1 && fs.statSync(path.resolve(directory, name)).isFile()) {
filePath = path.resolve(directory, name);
break;
}
@@ -137,7 +137,7 @@ FileFinder.prototype.findAllInDirectoryAndParents = function (directory) {
for (i = 0; i < fileNamesCount; i++) {
name = fileNames[i];
- if (getDirectoryEntries(directory).indexOf(name) !== -1) {
+ if (getDirectoryEntries(directory).indexOf(name) !== -1 && fs.statSync(path.resolve(directory, name)).isFile()) {
filePath = path.resolve(directory, name);
// Add the file path to the cache of each directory searched.
diff --git a/tools/eslint/lib/formatters/tap.js b/tools/eslint/lib/formatters/tap.js
index b9f4cd66b9a..ecb6960c375 100644
--- a/tools/eslint/lib/formatters/tap.js
+++ b/tools/eslint/lib/formatters/tap.js
@@ -66,11 +66,7 @@ module.exports = function(results) {
// The first error will be logged as message key
// This is to adhere to TAP 13 loosely defined specification of having a message key
if ("message" in diagnostics) {
- if ("messages" in diagnostics) {
- diagnostics.messages.push(diagnostic);
- } else {
- diagnostics.messages = [diagnostic];
- }
+ diagnostics.messages = [diagnostic];
} else {
diagnostics = diagnostic;
}
diff --git a/tools/eslint/lib/ignored-paths.js b/tools/eslint/lib/ignored-paths.js
index 3d2bd9b44cd..6d57da2776d 100644
--- a/tools/eslint/lib/ignored-paths.js
+++ b/tools/eslint/lib/ignored-paths.js
@@ -96,6 +96,10 @@ IgnoredPaths.load = function (options) {
patterns = [];
}
+ if (options.ignorePattern) {
+ patterns.push(options.ignorePattern);
+ }
+
return new IgnoredPaths(patterns);
};
diff --git a/tools/eslint/lib/options.js b/tools/eslint/lib/options.js
index 4b5803c1153..58111090b6e 100644
--- a/tools/eslint/lib/options.js
+++ b/tools/eslint/lib/options.js
@@ -90,6 +90,11 @@ module.exports = optionator({
description: "Disable use of .eslintignore"
},
{
+ option: "ignore-pattern",
+ type: "String",
+ description: "Pattern of files to ignore (in addition to those in .eslintignore)"
+ },
+ {
option: "color",
type: "Boolean",
default: "true",
@@ -117,5 +122,11 @@ module.exports = optionator({
option: "stdin-filename",
type: "String",
description: "Specify filename to process STDIN as"
+ },
+ {
+ option: "init",
+ type: "Boolean",
+ default: "false",
+ description: "Run config initialization wizard"
}]
});
diff --git a/tools/eslint/lib/rules/accessor-pairs.js b/tools/eslint/lib/rules/accessor-pairs.js
new file mode 100644
index 00000000000..42734acf9a2
--- /dev/null
+++ b/tools/eslint/lib/rules/accessor-pairs.js
@@ -0,0 +1,65 @@
+/**
+ * @fileoverview Rule to flag wrapping non-iife in parens
+ * @author Gyandeep Singh
+ * @copyright 2015 Gyandeep Singh. All rights reserved.
+ */
+
+"use strict";
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+module.exports = function(context) {
+ var config = context.options[0] || {};
+ var checkGetWithoutSet = config.getWithoutSet === true;
+ var checkSetWithoutGet = config.setWithoutGet !== false;
+
+ /**
+ * Checks a object expression to see if it has setter and getter both present or none.
+ * @param {ASTNode} node The node to check.
+ * @returns {void}
+ * @private
+ */
+ function checkLonelySetGet(node) {
+ var isSetPresent = false;
+ var isGetPresent = false;
+ var propLength = node.properties.length;
+
+ for (var i = 0; i < propLength; i++) {
+ var propToCheck = node.properties[i].kind === "init" ? node.properties[i].key.name : node.properties[i].kind;
+
+ switch (propToCheck) {
+ case "set":
+ isSetPresent = true;
+ break;
+
+ case "get":
+ isGetPresent = true;
+ break;
+
+ default:
+ // Do nothing
+ }
+
+ if (isSetPresent && isGetPresent) {
+ break;
+ }
+ }
+
+ if (checkSetWithoutGet && isSetPresent && !isGetPresent) {
+ context.report(node, "Getter is not present");
+ } else if (checkGetWithoutSet && isGetPresent && !isSetPresent) {
+ context.report(node, "Setter is not present");
+ }
+ }
+
+ return {
+ "ObjectExpression": function (node) {
+ if (checkSetWithoutGet || checkGetWithoutSet) {
+ checkLonelySetGet(node);
+ }
+ }
+ };
+
+};
diff --git a/tools/eslint/lib/rules/array-bracket-spacing.js b/tools/eslint/lib/rules/array-bracket-spacing.js
new file mode 100644
index 00000000000..eaec76e294d
--- /dev/null
+++ b/tools/eslint/lib/rules/array-bracket-spacing.js
@@ -0,0 +1,180 @@
+/**
+ * @fileoverview Disallows or enforces spaces inside of array brackets.
+ * @author Jamund Ferguson
+ * @copyright 2015 Jamund Ferguson. All rights reserved.
+ * @copyright 2014 Brandyn Bennett. All rights reserved.
+ * @copyright 2014 Michael Ficarra. No rights reserved.
+ * @copyright 2014 Vignesh Anand. All rights reserved.
+ */
+"use strict";
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+module.exports = function(context) {
+ var spaced = context.options[0] === "always";
+
+ /**
+ * Determines whether an option is set, relative to the spacing option.
+ * If spaced is "always", then check whether option is set to false.
+ * If spaced is "never", then check whether option is set to true.
+ * @param {Object} option - The option to exclude.
+ * @returns {boolean} Whether or not the property is excluded.
+ */
+ function isOptionSet(option) {
+ return context.options[1] != null ? context.options[1][option] === !spaced : false;
+ }
+
+ var options = {
+ spaced: spaced,
+ singleElementException: isOptionSet("singleValue"),
+ objectsInArraysException: isOptionSet("objectsInArrays"),
+ arraysInArraysException: isOptionSet("arraysInArrays")
+ };
+
+ //--------------------------------------------------------------------------
+ // Helpers
+ //--------------------------------------------------------------------------
+
+ /**
+ * Determines whether two adjacent tokens are have whitespace between them.
+ * @param {Object} left - The left token object.
+ * @param {Object} right - The right token object.
+ * @returns {boolean} Whether or not there is space between the tokens.
+ */
+ function isSpaced(left, right) {
+ return left.range[1] < right.range[0];
+ }
+
+ /**
+ * Determines whether two adjacent tokens are on the same line.
+ * @param {Object} left - The left token object.
+ * @param {Object} right - The right token object.
+ * @returns {boolean} Whether or not the tokens are on the same line.
+ */
+ function isSameLine(left, right) {
+ return left.loc.start.line === right.loc.start.line;
+ }
+
+ /**
+ * Reports that there shouldn't be a space after the first token
+ * @param {ASTNode} node - The node to report in the event of an error.
+ * @param {Token} token - The token to use for the report.
+ * @returns {void}
+ */
+ function reportNoBeginningSpace(node, token) {
+ context.report(node, token.loc.start,
+ "There should be no space after '" + token.value + "'");
+ }
+
+ /**
+ * Reports that there shouldn't be a space before the last token
+ * @param {ASTNode} node - The node to report in the event of an error.
+ * @param {Token} token - The token to use for the report.
+ * @returns {void}
+ */
+ function reportNoEndingSpace(node, token) {
+ context.report(node, token.loc.start,
+ "There should be no space before '" + token.value + "'");
+ }
+
+ /**
+ * Reports that there should be a space after the first token
+ * @param {ASTNode} node - The node to report in the event of an error.
+ * @param {Token} token - The token to use for the report.
+ * @returns {void}
+ */
+ function reportRequiredBeginningSpace(node, token) {
+ context.report(node, token.loc.start,
+ "A space is required after '" + token.value + "'");
+ }
+
+ /**
+ * Reports that there should be a space before the last token
+ * @param {ASTNode} node - The node to report in the event of an error.
+ * @param {Token} token - The token to use for the report.
+ * @returns {void}
+ */
+ function reportRequiredEndingSpace(node, token) {
+ context.report(node, token.loc.start,
+ "A space is required before '" + token.value + "'");
+ }
+
+ /**
+ * Validates the spacing around array brackets
+ * @param {ASTNode} node - The node we're checking for spacing
+ * @returns {void}
+ */
+ function validateArraySpacing(node) {
+ if (node.elements.length === 0) {
+ return;
+ }
+
+ var first = context.getFirstToken(node),
+ second = context.getFirstToken(node, 1),
+ penultimate = context.getLastToken(node, 1),
+ last = context.getLastToken(node);
+
+ var openingBracketMustBeSpaced =
+ options.objectsInArraysException && second.value === "{" ||
+ options.arraysInArraysException && second.value === "[" ||
+ options.singleElementException && node.elements.length === 1
+ ? !options.spaced : options.spaced;
+
+ var closingBracketMustBeSpaced =
+ options.objectsInArraysException && penultimate.value === "}" ||
+ options.arraysInArraysException && penultimate.value === "]" ||
+ options.singleElementException && node.elements.length === 1
+ ? !options.spaced : options.spaced;
+
+ if (isSameLine(first, second)) {
+ if (openingBracketMustBeSpaced && !isSpaced(first, second)) {
+ reportRequiredBeginningSpace(node, first);
+ }
+ if (!openingBracketMustBeSpaced && isSpaced(first, second)) {
+ reportNoBeginningSpace(node, first);
+ }
+ }
+
+ if (isSameLine(penultimate, last)) {
+ if (closingBracketMustBeSpaced && !isSpaced(penultimate, last)) {
+ reportRequiredEndingSpace(node, last);
+ }
+ if (!closingBracketMustBeSpaced && isSpaced(penultimate, last)) {
+ reportNoEndingSpace(node, last);
+ }
+ }
+ }
+
+ //--------------------------------------------------------------------------
+ // Public
+ //--------------------------------------------------------------------------
+
+ return {
+ ArrayPattern: validateArraySpacing,
+ ArrayExpression: validateArraySpacing
+ };
+
+};
+
+module.exports.schema = [
+ {
+ "enum": ["always", "never"]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "singleValue": {
+ "type": "boolean"
+ },
+ "objectsInArrays": {
+ "type": "boolean"
+ },
+ "arraysInArrays": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+];
diff --git a/tools/eslint/lib/rules/block-scoped-var.js b/tools/eslint/lib/rules/block-scoped-var.js
index 6b23167fd1f..a463b12daf6 100644
--- a/tools/eslint/lib/rules/block-scoped-var.js
+++ b/tools/eslint/lib/rules/block-scoped-var.js
@@ -316,3 +316,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/brace-style.js b/tools/eslint/lib/rules/brace-style.js
index 599e86f68b9..2e56377f050 100644
--- a/tools/eslint/lib/rules/brace-style.js
+++ b/tools/eslint/lib/rules/brace-style.js
@@ -33,6 +33,15 @@ module.exports = function(context) {
return node && node.type === "BlockStatement";
}
+ /**
+ * Check if the token is an punctuator with a value of curly brace
+ * @param {object} token - Token to check
+ * @returns {boolean} true if its a curly punctuator
+ * @private
+ */
+ function isCurlyPunctuator(token) {
+ return token.value === "{" || token.value === "}";
+ }
/**
* Binds a list of properties to a function that verifies that the opening
@@ -97,7 +106,7 @@ module.exports = function(context) {
tokens = context.getTokensBefore(node.alternate, 2);
if (style === "1tbs") {
- if (tokens[0].loc.start.line !== tokens[1].loc.start.line) {
+ if (tokens[0].loc.start.line !== tokens[1].loc.start.line && isCurlyPunctuator(tokens[0]) ) {
context.report(node.alternate, CLOSE_MESSAGE);
}
} else if (style === "stroustrup") {
@@ -202,3 +211,18 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [
+ {
+ "enum": ["1tbs", "stroustrup"]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "allowSingleLine": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+];
diff --git a/tools/eslint/lib/rules/camelcase.js b/tools/eslint/lib/rules/camelcase.js
index 5b1b8020da0..3091b815ca7 100644
--- a/tools/eslint/lib/rules/camelcase.js
+++ b/tools/eslint/lib/rules/camelcase.js
@@ -97,3 +97,15 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [
+ {
+ "type": "object",
+ "properties": {
+ "properties": {
+ "enum": ["always", "never"]
+ }
+ },
+ "additionalProperties": false
+ }
+];
diff --git a/tools/eslint/lib/rules/comma-dangle.js b/tools/eslint/lib/rules/comma-dangle.js
index da3776d4243..1c8f79ea9e0 100644
--- a/tools/eslint/lib/rules/comma-dangle.js
+++ b/tools/eslint/lib/rules/comma-dangle.js
@@ -25,7 +25,7 @@ module.exports = function (context) {
function checkForTrailingComma(node) {
var items = node.properties || node.elements,
length = items.length,
- nodeIsMultiLine = node.loc.start.line !== node.loc.end.line,
+ lastTokenOnNewLine,
lastItem,
penultimateToken,
hasDanglingComma;
@@ -39,9 +39,10 @@ module.exports = function (context) {
if (forbidDangle && hasDanglingComma) {
context.report(lastItem, penultimateToken.loc.start, UNEXPECTED_MESSAGE);
} else if (allowDangle === "always-multiline") {
- if (hasDanglingComma && !nodeIsMultiLine) {
+ lastTokenOnNewLine = node.loc.end.line !== penultimateToken.loc.end.line;
+ if (hasDanglingComma && !lastTokenOnNewLine) {
context.report(lastItem, penultimateToken.loc.start, UNEXPECTED_MESSAGE);
- } else if (!hasDanglingComma && nodeIsMultiLine) {
+ } else if (!hasDanglingComma && lastTokenOnNewLine) {
context.report(lastItem, penultimateToken.loc.end, MISSING_MESSAGE);
}
} else if (allowDangle === "always" && !hasDanglingComma) {
@@ -56,3 +57,9 @@ module.exports = function (context) {
"ArrayExpression": checkForTrailingComma
};
};
+
+module.exports.schema = [
+ {
+ "enum": ["always", "always-multiline", "never"]
+ }
+];
diff --git a/tools/eslint/lib/rules/comma-spacing.js b/tools/eslint/lib/rules/comma-spacing.js
index 32136a35239..5204801504a 100644
--- a/tools/eslint/lib/rules/comma-spacing.js
+++ b/tools/eslint/lib/rules/comma-spacing.js
@@ -22,6 +22,22 @@ module.exports = function(context) {
// the index of the last comment that was checked
var lastCommentIndex = 0;
+ var allComments;
+
+ /**
+ * Determines the length of comment between 2 tokens
+ * @param {Object} left - The left token object.
+ * @param {Object} right - The right token object.
+ * @returns {number} Length of comment in between tokens
+ */
+ function getCommentLengthBetweenTokens(left, right) {
+ return allComments.reduce(function(val, comment) {
+ if (left.range[1] <= comment.range[0] && comment.range[1] <= right.range[0]) {
+ val = val + comment.range[1] - comment.range[0];
+ }
+ return val;
+ }, 0);
+ }
/**
* Determines whether two adjacent tokens have whitespace between them.
@@ -31,7 +47,8 @@ module.exports = function(context) {
*/
function isSpaced(left, right) {
var punctuationLength = context.getTokensBetween(left, right).length; // the length of any parenthesis
- return (left.range[1] + punctuationLength) < right.range[0];
+ var commentLenth = getCommentLengthBetweenTokens(left, right);
+ return (left.range[1] + punctuationLength + commentLenth) < right.range[0];
}
/**
@@ -130,12 +147,12 @@ module.exports = function(context) {
"Program": function() {
var source = context.getSource(),
- allComments = context.getAllComments(),
pattern = /,/g,
commaToken,
previousToken,
nextToken;
+ allComments = context.getAllComments();
while (pattern.test(source)) {
// do not flag anything inside of comments
@@ -157,3 +174,18 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [
+ {
+ "type": "object",
+ "properties": {
+ "before": {
+ "type": "boolean"
+ },
+ "after": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+];
diff --git a/tools/eslint/lib/rules/comma-style.js b/tools/eslint/lib/rules/comma-style.js
index 4b8d1457753..52e0ac47b0f 100644
--- a/tools/eslint/lib/rules/comma-style.js
+++ b/tools/eslint/lib/rules/comma-style.js
@@ -175,3 +175,21 @@ module.exports = function(context) {
return nodes;
};
+
+module.exports.schema = [
+ {
+ "enum": ["first", "last"]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "exceptions": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "boolean"
+ }
+ }
+ },
+ "additionalProperties": false
+ }
+];
diff --git a/tools/eslint/lib/rules/complexity.js b/tools/eslint/lib/rules/complexity.js
index 36c9c1f4670..b4e52784cbd 100644
--- a/tools/eslint/lib/rules/complexity.js
+++ b/tools/eslint/lib/rules/complexity.js
@@ -86,3 +86,9 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [
+ {
+ "type": "integer"
+ }
+];
diff --git a/tools/eslint/lib/rules/computed-property-spacing.js b/tools/eslint/lib/rules/computed-property-spacing.js
new file mode 100644
index 00000000000..653a40eb041
--- /dev/null
+++ b/tools/eslint/lib/rules/computed-property-spacing.js
@@ -0,0 +1,144 @@
+/**
+ * @fileoverview Disallows or enforces spaces inside computed properties.
+ * @author Jamund Ferguson
+ * @copyright 2015 Jamund Ferguson. All rights reserved.
+ */
+"use strict";
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+module.exports = function(context) {
+ var propertyNameMustBeSpaced = context.options[0] === "always"; // default is "never"
+
+ //--------------------------------------------------------------------------
+ // Helpers
+ //--------------------------------------------------------------------------
+
+ /**
+ * Determines whether two adjacent tokens are have whitespace between them.
+ * @param {Object} left - The left token object.
+ * @param {Object} right - The right token object.
+ * @returns {boolean} Whether or not there is space between the tokens.
+ */
+ function isSpaced(left, right) {
+ return left.range[1] < right.range[0];
+ }
+
+ /**
+ * Determines whether two adjacent tokens are on the same line.
+ * @param {Object} left - The left token object.
+ * @param {Object} right - The right token object.
+ * @returns {boolean} Whether or not the tokens are on the same line.
+ */
+ function isSameLine(left, right) {
+ return left.loc.start.line === right.loc.start.line;
+ }
+
+ /**
+ * Reports that there shouldn't be a space after the first token
+ * @param {ASTNode} node - The node to report in the event of an error.
+ * @param {Token} token - The token to use for the report.
+ * @returns {void}
+ */
+ function reportNoBeginningSpace(node, token) {
+ context.report(node, token.loc.start,
+ "There should be no space after '" + token.value + "'");
+ }
+
+ /**
+ * Reports that there shouldn't be a space before the last token
+ * @param {ASTNode} node - The node to report in the event of an error.
+ * @param {Token} token - The token to use for the report.
+ * @returns {void}
+ */
+ function reportNoEndingSpace(node, token) {
+ context.report(node, token.loc.start,
+ "There should be no space before '" + token.value + "'");
+ }
+
+ /**
+ * Reports that there should be a space after the first token
+ * @param {ASTNode} node - The node to report in the event of an error.
+ * @param {Token} token - The token to use for the report.
+ * @returns {void}
+ */
+ function reportRequiredBeginningSpace(node, token) {
+ context.report(node, token.loc.start,
+ "A space is required after '" + token.value + "'");
+ }
+
+ /**
+ * Reports that there should be a space before the last token
+ * @param {ASTNode} node - The node to report in the event of an error.
+ * @param {Token} token - The token to use for the report.
+ * @returns {void}
+ */
+ function reportRequiredEndingSpace(node, token) {
+ context.report(node, token.loc.start,
+ "A space is required before '" + token.value + "'");
+ }
+
+ /**
+ * Returns a function that checks the spacing of a node on the property name
+ * that was passed in.
+ * @param {String} propertyName The property on the node to check for spacing
+ * @returns {Function} A function that will check spacing on a node
+ */
+ function checkSpacing(propertyName) {
+ return function(node) {
+ if (!node.computed) {
+ return;
+ }
+
+ var property = node[propertyName];
+
+ var before = context.getTokenBefore(property),
+ first = context.getFirstToken(property),
+ last = context.getLastToken(property),
+ after = context.getTokenAfter(property);
+
+ if (isSameLine(before, first)) {
+ if (propertyNameMustBeSpaced) {
+ if (!isSpaced(before, first) && isSameLine(before, first)) {
+ reportRequiredBeginningSpace(node, before);
+ }
+ } else {
+ if (isSpaced(before, first)) {
+ reportNoBeginningSpace(node, before);
+ }
+ }
+ }
+
+ if (isSameLine(last, after)) {
+ if (propertyNameMustBeSpaced) {
+ if (!isSpaced(last, after) && isSameLine(last, after)) {
+ reportRequiredEndingSpace(node, after);
+ }
+ } else {
+ if (isSpaced(last, after)) {
+ reportNoEndingSpace(node, after);
+ }
+ }
+ }
+ };
+ }
+
+
+ //--------------------------------------------------------------------------
+ // Public
+ //--------------------------------------------------------------------------
+
+ return {
+ Property: checkSpacing("key"),
+ MemberExpression: checkSpacing("property")
+ };
+
+};
+
+module.exports.schema = [
+ {
+ "enum": ["always", "never"]
+ }
+];
diff --git a/tools/eslint/lib/rules/consistent-return.js b/tools/eslint/lib/rules/consistent-return.js
index 38adba7f318..e5eb5f9b469 100644
--- a/tools/eslint/lib/rules/consistent-return.js
+++ b/tools/eslint/lib/rules/consistent-return.js
@@ -71,3 +71,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/consistent-this.js b/tools/eslint/lib/rules/consistent-this.js
index 3efb2cd372c..bcf7fefb051 100644
--- a/tools/eslint/lib/rules/consistent-this.js
+++ b/tools/eslint/lib/rules/consistent-this.js
@@ -2,6 +2,7 @@
* @fileoverview Rule to enforce consistent naming of "this" context variables
* @author Raphael Pigulla
* @copyright 2015 Timothy Jones. All rights reserved.
+ * @copyright 2015 David Aurelio. All rights reserved.
*/
"use strict";
@@ -93,8 +94,12 @@ module.exports = function(context) {
"FunctionDeclaration:exit": ensureWasAssigned,
"VariableDeclarator": function (node) {
- if (node.init !== null) {
- checkAssignment(node, node.id.name, node.init);
+ var id = node.id;
+ var isDestructuring =
+ id.type === "ArrayPattern" || id.type === "ObjectPattern";
+
+ if (node.init !== null && !isDestructuring) {
+ checkAssignment(node, id.name, node.init);
}
},
@@ -106,3 +111,9 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [
+ {
+ "type": "string"
+ }
+];
diff --git a/tools/eslint/lib/rules/constructor-super.js b/tools/eslint/lib/rules/constructor-super.js
new file mode 100644
index 00000000000..a8c77a15a5e
--- /dev/null
+++ b/tools/eslint/lib/rules/constructor-super.js
@@ -0,0 +1,108 @@
+/**
+ * @fileoverview A rule to verify `super()` callings in constructor.
+ * @author Toru Nagashima
+ * @copyright 2015 Toru Nagashima. All rights reserved.
+ */
+
+"use strict";
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+module.exports = function(context) {
+
+ /**
+ * Searches a class node from ancestors of a node.
+ * @param {Node} node - A node to get.
+ * @returns {ClassDeclaration|ClassExpression|null} the found class node or `null`.
+ */
+ function getClassInAncestor(node) {
+ while (node != null) {
+ if (node.type === "ClassDeclaration" || node.type === "ClassExpression") {
+ return node;
+ }
+ node = node.parent;
+ }
+ /* istanbul ignore next */
+ return null;
+ }
+
+ /**
+ * Checks whether or not a node is the null literal.
+ * @param {Node} node - A node to check.
+ * @returns {boolean} whether or not a node is the null literal.
+ */
+ function isNullLiteral(node) {
+ return node != null && node.type === "Literal" && node.value === null;
+ }
+
+ /**
+ * Checks whether or not the current traversal context is on constructors.
+ * @param {{scope: Scope}} item - A checking context to check.
+ * @returns {boolean} whether or not the current traversal context is on constructors.
+ */
+ function isOnConstructor(item) {
+ return item != null && item.scope === context.getScope().variableScope.upper.variableScope;
+ }
+
+ // A stack for checking context.
+ var stack = [];
+
+ return {
+ /**
+ * Start checking.
+ * @param {MethodDefinition} node - A target node.
+ * @returns {void}
+ */
+ "MethodDefinition": function(node) {
+ if (node.kind !== "constructor") {
+ return;
+ }
+ stack.push({
+ superCallings: [],
+ scope: context.getScope().variableScope
+ });
+ },
+
+ /**
+ * Checks the result, then reports invalid/missing `super()`.
+ * @param {MethodDefinition} node - A target node.
+ * @returns {void}
+ */
+ "MethodDefinition:exit": function(node) {
+ if (node.kind !== "constructor") {
+ return;
+ }
+ var result = stack.pop();
+
+ var classNode = getClassInAncestor(node);
+ /* istanbul ignore if */
+ if (classNode == null) {
+ return;
+ }
+
+ if (classNode.superClass === null || isNullLiteral(classNode.superClass)) {
+ result.superCallings.forEach(function(superCalling) {
+ context.report(superCalling, "unexpected `super()`.");
+ });
+ } else if (result.superCallings.length === 0) {
+ context.report(node.key, "this constructor requires `super()`.");
+ }
+ },
+
+ /**
+ * Checks the result of checking, then reports invalid/missing `super()`.
+ * @param {MethodDefinition} node - A target node.
+ * @returns {void}
+ */
+ "CallExpression": function(node) {
+ var item = stack[stack.length - 1];
+ if (isOnConstructor(item) && node.callee.type === "Super") {
+ item.superCallings.push(node);
+ }
+ }
+ };
+};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/curly.js b/tools/eslint/lib/rules/curly.js
index 2bfcfb27982..df7ad4c5703 100644
--- a/tools/eslint/lib/rules/curly.js
+++ b/tools/eslint/lib/rules/curly.js
@@ -101,3 +101,9 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [
+ {
+ "enum": ["all", "multi", "multi-line"]
+ }
+];
diff --git a/tools/eslint/lib/rules/default-case.js b/tools/eslint/lib/rules/default-case.js
index da0da1ad7d4..e8a748401e5 100644
--- a/tools/eslint/lib/rules/default-case.js
+++ b/tools/eslint/lib/rules/default-case.js
@@ -62,3 +62,5 @@ module.exports = function(context) {
}
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/dot-location.js b/tools/eslint/lib/rules/dot-location.js
new file mode 100644
index 00000000000..6e83b984887
--- /dev/null
+++ b/tools/eslint/lib/rules/dot-location.js
@@ -0,0 +1,63 @@
+/**
+ * @fileoverview Validates newlines before and after dots
+ * @author Greg Cochard
+ * @copyright 2015 Greg Cochard
+ */
+
+"use strict";
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+module.exports = function (context) {
+
+ var config = context.options[0],
+ // default to onObject if no preference is passed
+ onObject = config === "object" || !config;
+
+ /**
+ * Checks whether two tokens are on the same line.
+ * @param {Object} left The leftmost token.
+ * @param {Object} right The rightmost token.
+ * @returns {boolean} True if the tokens are on the same line, false if not.
+ * @private
+ */
+ function isSameLine(left, right) {
+ return left.loc.end.line === right.loc.start.line;
+ }
+
+ /**
+ * Reports if the dot between object and property is on the correct loccation.
+ * @param {ASTNode} obj The object owning the property.
+ * @param {ASTNode} prop The property of the object.
+ * @param {ASTNode} node The corresponding node of the token.
+ * @returns {void}
+ */
+ function checkDotLocation(obj, prop, node) {
+ var dot = context.getTokenBefore(prop);
+
+ if (dot.type === "Punctuator" && dot.value === ".") {
+ if (onObject) {
+ if (!isSameLine(obj, dot)) {
+ context.report(node, dot.loc.start, "Expected dot to be on same line as object.");
+ }
+ } else if (!isSameLine(dot, prop)) {
+ context.report(node, dot.loc.start, "Expected dot to be on same line as property.");
+ }
+ }
+ }
+
+ /**
+ * Checks the spacing of the dot within a member expression.
+ * @param {ASTNode} node The node to check.
+ * @returns {void}
+ */
+ function checkNode(node) {
+ checkDotLocation(node.object, node.property, node);
+ }
+
+ return {
+ "MemberExpression": checkNode
+ };
+};
diff --git a/tools/eslint/lib/rules/dot-notation.js b/tools/eslint/lib/rules/dot-notation.js
index bf89cbfdf8e..2198cd75470 100644
--- a/tools/eslint/lib/rules/dot-notation.js
+++ b/tools/eslint/lib/rules/dot-notation.js
@@ -102,3 +102,18 @@ module.exports = function(context) {
}
};
};
+
+module.exports.schema = [
+ {
+ "type": "object",
+ "properties": {
+ "allowKeywords": {
+ "type": "boolean"
+ },
+ "allowPattern": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ }
+];
diff --git a/tools/eslint/lib/rules/eol-last.js b/tools/eslint/lib/rules/eol-last.js
index 96c78c18b45..2f68b8a7df1 100644
--- a/tools/eslint/lib/rules/eol-last.js
+++ b/tools/eslint/lib/rules/eol-last.js
@@ -34,3 +34,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/eqeqeq.js b/tools/eslint/lib/rules/eqeqeq.js
index e847a8327eb..1576d6c1ab5 100644
--- a/tools/eslint/lib/rules/eqeqeq.js
+++ b/tools/eslint/lib/rules/eqeqeq.js
@@ -88,3 +88,9 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [
+ {
+ "enum": ["smart", "allow-null"]
+ }
+];
diff --git a/tools/eslint/lib/rules/func-names.js b/tools/eslint/lib/rules/func-names.js
index eb4d9be10a6..a4fb59edd63 100644
--- a/tools/eslint/lib/rules/func-names.js
+++ b/tools/eslint/lib/rules/func-names.js
@@ -41,3 +41,5 @@ module.exports = function(context) {
}
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/func-style.js b/tools/eslint/lib/rules/func-style.js
index f54350e7651..c9d64b6d00b 100644
--- a/tools/eslint/lib/rules/func-style.js
+++ b/tools/eslint/lib/rules/func-style.js
@@ -41,3 +41,9 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [
+ {
+ "enum": ["declaration", "expression"]
+ }
+];
diff --git a/tools/eslint/lib/rules/generator-star-spacing.js b/tools/eslint/lib/rules/generator-star-spacing.js
index fe0b82bd198..1769f300449 100644
--- a/tools/eslint/lib/rules/generator-star-spacing.js
+++ b/tools/eslint/lib/rules/generator-star-spacing.js
@@ -13,12 +13,17 @@
module.exports = function(context) {
- var mode = {
- before: { before: true, after: false },
- after: { before: false, after: true },
- both: { before: true, after: true },
- neither: { before: false, after: false }
- }[context.options[0] || "before"];
+ var mode = (function(option) {
+ if (option == null || typeof option === "string") {
+ return {
+ before: { before: true, after: false },
+ after: { before: false, after: true },
+ both: { before: true, after: true },
+ neither: { before: false, after: false }
+ }[option || "before"];
+ }
+ return option;
+ }(context.options[0]));
/**
* Checks the spacing between two tokens before or after the star token.
@@ -48,30 +53,28 @@ module.exports = function(context) {
* @returns {void}
*/
function checkFunction(node) {
- var isMethod, starToken, tokenBefore, tokenAfter;
+ var prevToken, starToken, nextToken;
if (!node.generator) {
return;
}
- isMethod = !!context.getAncestors().pop().method;
-
- if (isMethod) {
+ if (node.parent.method || node.parent.type === "MethodDefinition") {
starToken = context.getTokenBefore(node, 1);
} else {
starToken = context.getFirstToken(node, 1);
}
// Only check before when preceded by `function` keyword
- tokenBefore = context.getTokenBefore(starToken);
- if (tokenBefore.value === "function") {
- checkSpacing("before", tokenBefore, starToken);
+ prevToken = context.getTokenBefore(starToken);
+ if (prevToken.value === "function" || prevToken.value === "static") {
+ checkSpacing("before", prevToken, starToken);
}
// Only check after when followed by an identifier
- tokenAfter = context.getTokenAfter(starToken);
- if (tokenAfter.type === "Identifier") {
- checkSpacing("after", starToken, tokenAfter);
+ nextToken = context.getTokenAfter(starToken);
+ if (nextToken.type === "Identifier") {
+ checkSpacing("after", starToken, nextToken);
}
}
@@ -81,3 +84,21 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [
+ {
+ "oneOf": [
+ {
+ "enum": ["before", "after", "both", "neither"]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "before": {"type": "boolean"},
+ "after": {"type": "boolean"}
+ },
+ "additionalProperties": false
+ }
+ ]
+ }
+];
diff --git a/tools/eslint/lib/rules/generator-star.js b/tools/eslint/lib/rules/generator-star.js
index 4541e6711c1..d6f3d2cdc58 100644
--- a/tools/eslint/lib/rules/generator-star.js
+++ b/tools/eslint/lib/rules/generator-star.js
@@ -68,3 +68,9 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [
+ {
+ "enum": ["start", "middle", "end"]
+ }
+];
diff --git a/tools/eslint/lib/rules/global-strict.js b/tools/eslint/lib/rules/global-strict.js
index c16c62db92b..97980f6fed2 100644
--- a/tools/eslint/lib/rules/global-strict.js
+++ b/tools/eslint/lib/rules/global-strict.js
@@ -41,3 +41,9 @@ module.exports = function(context) {
}
};
+
+module.exports.schema = [
+ {
+ "enum": ["always", "never"]
+ }
+];
diff --git a/tools/eslint/lib/rules/guard-for-in.js b/tools/eslint/lib/rules/guard-for-in.js
index d79651d38c4..925e11817b0 100644
--- a/tools/eslint/lib/rules/guard-for-in.js
+++ b/tools/eslint/lib/rules/guard-for-in.js
@@ -28,3 +28,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/handle-callback-err.js b/tools/eslint/lib/rules/handle-callback-err.js
index f57e4d1752d..438ea93c074 100644
--- a/tools/eslint/lib/rules/handle-callback-err.js
+++ b/tools/eslint/lib/rules/handle-callback-err.js
@@ -1,6 +1,7 @@
/**
* @fileoverview Ensure handling of errors when we know they exist.
* @author Jamund Ferguson
+ * @copyright 2015 Mathias Schreck.
* @copyright 2014 Jamund Ferguson. All rights reserved.
*/
@@ -13,8 +14,6 @@
module.exports = function(context) {
var errorArgument = context.options[0] || "err";
- var callbacks = [];
- var scopes = 0;
/**
* Checks if the given argument should be interpreted as a regexp pattern.
@@ -40,44 +39,14 @@ module.exports = function(context) {
}
/**
- * Check the arguments to see if we need to start tracking the error object.
- * @param {ASTNode} node The AST node to check.
- * @returns {void}
+ * Get the parameters of a given function scope.
+ * @param {object} scope The function scope.
+ * @returns {array} All parameters of the given scope.
*/
- function startFunction(node) {
-
- // keep track of nested scopes
- scopes++;
-
- // check if the first argument matches our argument name
- var firstArg = node.params && node.params[0];
- if (firstArg && matchesConfiguredErrorName(firstArg.name)) {
- callbacks.push({handled: false, depth: scopes, errorVariableName: firstArg.name});
- }
- }
-
- /**
- * At the end of a function check to see if the error was handled.
- * @param {ASTNode} node The AST node to check.
- * @returns {void}
- */
- function endFunction(node) {
-
- var callback = callbacks[callbacks.length - 1] || {};
-
- // check if a callback is ending, if so pop it off the stack
- if (callback.depth === scopes) {
- callbacks.pop();
-
- // check if there were no handled errors since the last callback
- if (!callback.handled) {
- context.report(node, "Expected error to be handled.");
- }
- }
-
- // less nested functions
- scopes--;
-
+ function getParameters(scope) {
+ return scope.variables.filter(function (variable) {
+ return variable.defs[0] && variable.defs[0].type === "Parameter";
+ });
}
/**
@@ -86,33 +55,27 @@ module.exports = function(context) {
* @returns {void}
*/
function checkForError(node) {
- if (callbacks.length > 0) {
- var callback = callbacks[callbacks.length - 1] || {};
+ var scope = context.getScope(),
+ parameters = getParameters(scope),
+ firstParameter = parameters[0];
- // make sure the node's name matches our error argument name
- var isAboutError = node.name === callback.errorVariableName;
-
- // we don't consider these use cases as "handling" the error
- var doNotCount = ["FunctionDeclaration", "ArrowFunctionExpression", "FunctionExpression", "CatchClause"];
-
- // make sure this identifier isn't used as part of one of them
- var isHandled = doNotCount.indexOf(node.parent.type) === -1;
-
- if (isAboutError && isHandled) {
- // record that this callback handled its error
- callback.handled = true;
+ if (firstParameter && matchesConfiguredErrorName(firstParameter.name)) {
+ if (firstParameter.references.length === 0) {
+ context.report(node, "Expected error to be handled.");
}
}
}
return {
- "FunctionDeclaration": startFunction,
- "FunctionExpression": startFunction,
- "ArrowFunctionExpression": startFunction,
- "Identifier": checkForError,
- "FunctionDeclaration:exit": endFunction,
- "FunctionExpression:exit": endFunction,
- "ArrowFunctionExpression:exit": endFunction
+ "FunctionDeclaration": checkForError,
+ "FunctionExpression": checkForError,
+ "ArrowFunctionExpression": checkForError
};
};
+
+module.exports.schema = [
+ {
+ "type": "string"
+ }
+];
diff --git a/tools/eslint/lib/rules/indent.js b/tools/eslint/lib/rules/indent.js
index b0e838e74bb..d0cf27cca34 100644
--- a/tools/eslint/lib/rules/indent.js
+++ b/tools/eslint/lib/rules/indent.js
@@ -46,7 +46,7 @@ module.exports = function (context) {
if (context.options[0] === "tab") {
indentChar = "\t";
indentSize = 1;
- } else if (typeof context.options[0] === "number") {
+ } else /* istanbul ignore else : this will be caught by options validation */ if (typeof context.options[0] === "number") {
indentSize = context.options[0];
}
@@ -462,3 +462,25 @@ module.exports = function (context) {
};
};
+
+module.exports.schema = [
+ {
+ "oneOf": [
+ {
+ "enum": ["tab"]
+ },
+ {
+ "type": "integer"
+ }
+ ]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "indentSwitchCase": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+];
diff --git a/tools/eslint/lib/rules/key-spacing.js b/tools/eslint/lib/rules/key-spacing.js
index 3ffaf9302fc..5ba944ea4ed 100644
--- a/tools/eslint/lib/rules/key-spacing.js
+++ b/tools/eslint/lib/rules/key-spacing.js
@@ -35,7 +35,7 @@ function last(arr) {
* @returns {boolean} True if the candidate property is part of the group.
*/
function continuesPropertyGroup(lastMember, candidate) {
- var groupEndLine = lastMember.loc.end.line,
+ var groupEndLine = lastMember.loc.start.line,
candidateStartLine = candidate.loc.start.line,
comments, i;
@@ -305,3 +305,21 @@ module.exports = function(context) {
}
};
+
+module.exports.schema = [
+ {
+ "type": "object",
+ "properties": {
+ "align": {
+ "enum": ["colon", "value"]
+ },
+ "beforeColon": {
+ "type": "boolean"
+ },
+ "afterColon": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+];
diff --git a/tools/eslint/lib/rules/linebreak-style.js b/tools/eslint/lib/rules/linebreak-style.js
new file mode 100644
index 00000000000..b9afe7a4ba7
--- /dev/null
+++ b/tools/eslint/lib/rules/linebreak-style.js
@@ -0,0 +1,44 @@
+/**
+ * @fileoverview Rule to forbid mixing LF and LFCR line breaks.
+ * @author Erik Mueller
+ * @copyright 2015 Varun Verma. All rights reserverd.
+ * @copyright 2015 James Whitney. All rights reserved.
+ * @copyright 2015 Erik Mueller. All rights reserved.
+ */
+
+"use strict";
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+module.exports = function (context) {
+ var EXPECTED_LF_MSG = "Expected linebreaks to be 'LF' but found 'CRLF'.",
+ EXPECTED_CRLF_MSG = "Expected linebreaks to be 'CRLF' but found 'LF'.";
+
+ return {
+ "Program": function checkForlinebreakStyle(node) {
+ var linebreakStyle = context.options[0] || "unix",
+ expectedLF = linebreakStyle === "unix",
+ linebreaks = context.getSource().match(/\r\n|\r|\n|\u2028|\u2029/g),
+ lineOfError = -1;
+
+ if (linebreaks !== null) {
+ lineOfError = linebreaks.indexOf(expectedLF ? "\r\n" : "\n");
+ }
+
+ if (lineOfError !== -1) {
+ context.report(node, {
+ line: lineOfError + 1,
+ column: context.getSourceLines()[lineOfError].length
+ }, expectedLF ? EXPECTED_LF_MSG : EXPECTED_CRLF_MSG);
+ }
+ }
+ };
+};
+
+module.exports.schema = [
+ {
+ "enum": ["unix", "windows"]
+ }
+];
diff --git a/tools/eslint/lib/rules/lines-around-comment.js b/tools/eslint/lib/rules/lines-around-comment.js
new file mode 100644
index 00000000000..655d8376592
--- /dev/null
+++ b/tools/eslint/lib/rules/lines-around-comment.js
@@ -0,0 +1,224 @@
+/**
+ * @fileoverview Enforces empty lines around comments.
+ * @author Jamund Ferguson
+ * @copyright 2015 Jamund Ferguson. All rights reserved.
+ */
+"use strict";
+
+/**
+ * Return an array with with any line numbers that are empty.
+ * @param {Array} lines An array of each line of the file.
+ * @returns {Array} An array of line numbers.
+ */
+function getEmptyLineNums(lines) {
+ var emptyLines = lines.map(function(line, i) {
+ return {
+ code: line.trim(),
+ num: i + 1
+ };
+ }).filter(function(line) {
+ return !line.code;
+ }).map(function(line) {
+ return line.num;
+ });
+ return emptyLines;
+}
+
+/**
+ * Return an array with with any line numbers that contain comments.
+ * @param {Array} comments An array of comment nodes.
+ * @returns {Array} An array of line numbers.
+ */
+function getCommentLineNums(comments) {
+ var lines = [];
+ comments.forEach(function (token) {
+ var start = token.loc.start.line;
+ var end = token.loc.end.line;
+ lines.push(start, end);
+ });
+ return lines;
+}
+
+/**
+ * Determines if a value is an array.
+ * @param {number} val The value we wish to check for in the array..
+ * @param {Array} array An array.
+ * @returns {boolean} True if the value is in the array..
+ */
+function contains(val, array) {
+ return array.indexOf(val) > -1;
+}
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+module.exports = function(context) {
+
+ var options = context.options[0] || {};
+ options.beforeLineComment = options.beforeLineComment || false;
+ options.afterLineComment = options.afterLineComment || false;
+ options.beforeBlockComment = typeof options.beforeBlockComment !== "undefined" ? options.beforeBlockComment : true;
+ options.afterBlockComment = options.afterBlockComment || false;
+ options.allowBlockStart = options.allowBlockStart || false;
+ options.allowBlockEnd = options.allowBlockEnd || false;
+
+ /**
+ * Returns whether or not comments are not on lines starting with or ending with code
+ * @param {ASTNode} node The comment node to check.
+ * @returns {boolean} True if the comment is not alone.
+ */
+ function codeAroundComment(node) {
+
+ var lines = context.getSourceLines();
+
+ // Get the whole line and cut it off at the start of the comment
+ var startLine = lines[node.loc.start.line - 1];
+ var endLine = lines[node.loc.end.line - 1];
+
+ var preamble = startLine.slice(0, node.loc.start.column).trim();
+
+ // Also check after the comment
+ var postamble = endLine.slice(node.loc.end.column).trim();
+
+ // Should be false if there was only whitespace around the comment
+ return !!(preamble || postamble);
+ }
+
+ /**
+ * Returns whether or not comments are at the block start or not.
+ * @param {ASTNode} node The Comment node.
+ * @returns {boolean} True if the comment is at block start.
+ */
+ function isCommentAtBlockStart(node) {
+ var ancestors = context.getAncestors();
+ var parent;
+
+ if (ancestors.length) {
+ parent = ancestors.pop();
+ }
+ return parent && (parent.type === "BlockStatement" || parent.body.type === "BlockStatement") &&
+ node.loc.start.line - parent.loc.start.line === 1;
+ }
+
+ /**
+ * Returns whether or not comments are at the block end or not.
+ * @param {ASTNode} node The Comment node.
+ * @returns {boolean} True if the comment is at block end.
+ */
+ function isCommentAtBlockEnd(node) {
+ var ancestors = context.getAncestors();
+ var parent;
+
+ if (ancestors.length) {
+ parent = ancestors.pop();
+ }
+ return parent && (parent.type === "BlockStatement" || parent.body.type === "BlockStatement") &&
+ parent.loc.end.line - node.loc.end.line === 1;
+ }
+
+ /**
+ * Checks if a comment node has lines around it (ignores inline comments)
+ * @param {ASTNode} node The Comment node.
+ * @param {Object} opts Options to determine the newline.
+ * @param {Boolean} opts.after Should have a newline after this line.
+ * @param {Boolean} opts.before Should have a newline before this line.
+ * @returns {void}
+ */
+ function checkForEmptyLine(node, opts) {
+
+ var lines = context.getSourceLines(),
+ numLines = lines.length + 1,
+ comments = context.getAllComments(),
+ commentLines = getCommentLineNums(comments),
+ emptyLines = getEmptyLineNums(lines),
+ commentAndEmptyLines = commentLines.concat(emptyLines);
+
+ var after = opts.after,
+ before = opts.before;
+
+ var prevLineNum = node.loc.start.line - 1,
+ nextLineNum = node.loc.end.line + 1,
+ commentIsNotAlone = codeAroundComment(node);
+
+ var blockStartAllowed = options.allowBlockStart && isCommentAtBlockStart(node),
+ blockEndAllowed = options.allowBlockEnd && isCommentAtBlockEnd(node);
+
+ // ignore top of the file and bottom of the file
+ if (prevLineNum < 1) {
+ before = false;
+ }
+ if (nextLineNum >= numLines) {
+ after = false;
+ }
+
+ // we ignore all inline comments
+ if (commentIsNotAlone) {
+ return;
+ }
+
+ // check for newline before
+ if (!blockStartAllowed && before && !contains(prevLineNum, commentAndEmptyLines)) {
+ context.report(node, "Expected line before comment.");
+ }
+
+ // check for newline after
+ if (!blockEndAllowed && after && !contains(nextLineNum, commentAndEmptyLines)) {
+ context.report(node, "Expected line after comment.");
+ }
+
+ }
+
+ //--------------------------------------------------------------------------
+ // Public
+ //--------------------------------------------------------------------------
+
+ return {
+
+ "LineComment": function(node) {
+ if (options.beforeLineComment || options.afterLineComment) {
+ checkForEmptyLine(node, {
+ after: options.afterLineComment,
+ before: options.beforeLineComment
+ });
+ }
+ },
+
+ "BlockComment": function(node) {
+ if (options.beforeBlockComment || options.afterBlockComment) {
+ checkForEmptyLine(node, {
+ after: options.afterBlockComment,
+ before: options.beforeBlockComment
+ });
+ }
+ }
+
+ };
+};
+
+module.exports.schema = [
+ {
+ "type": "object",
+ "properties": {
+ "beforeBlockComment": {
+ "type": "boolean"
+ },
+ "afterBlockComment": {
+ "type": "boolean"
+ },
+ "beforeLineComment": {
+ "type": "boolean"
+ },
+ "afterLineComment": {
+ "type": "boolean"
+ },
+ "allowBlockStart": {
+ "type": "boolean"
+ },
+ "allowBlockEnd": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+];
diff --git a/tools/eslint/lib/rules/max-depth.js b/tools/eslint/lib/rules/max-depth.js
index cc7e3662572..5b630ed2e5a 100644
--- a/tools/eslint/lib/rules/max-depth.js
+++ b/tools/eslint/lib/rules/max-depth.js
@@ -81,3 +81,9 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [
+ {
+ "type": "integer"
+ }
+];
diff --git a/tools/eslint/lib/rules/max-len.js b/tools/eslint/lib/rules/max-len.js
index a36dd73b1bb..8d0400dcea6 100644
--- a/tools/eslint/lib/rules/max-len.js
+++ b/tools/eslint/lib/rules/max-len.js
@@ -32,9 +32,9 @@ module.exports = function(context) {
return result;
}
- var tabWidth = context.options[1];
+ var tabWidth = context.options[1] || 4;
- var maxLength = context.options[0],
+ var maxLength = context.options[0] || 80,
tabString = stringRepeat(" ", tabWidth);
//--------------------------------------------------------------------------
@@ -63,3 +63,14 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [
+ {
+ "type": "integer",
+ "minimum": 0
+ },
+ {
+ "type": "integer",
+ "minimum": 0
+ }
+];
diff --git a/tools/eslint/lib/rules/max-nested-callbacks.js b/tools/eslint/lib/rules/max-nested-callbacks.js
index 590274ffd1c..2caff10764a 100644
--- a/tools/eslint/lib/rules/max-nested-callbacks.js
+++ b/tools/eslint/lib/rules/max-nested-callbacks.js
@@ -65,3 +65,9 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [
+ {
+ "type": "integer"
+ }
+];
diff --git a/tools/eslint/lib/rules/max-params.js b/tools/eslint/lib/rules/max-params.js
index 931548932f5..c09fba06d06 100644
--- a/tools/eslint/lib/rules/max-params.js
+++ b/tools/eslint/lib/rules/max-params.js
@@ -37,3 +37,9 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [
+ {
+ "type": "integer"
+ }
+];
diff --git a/tools/eslint/lib/rules/max-statements.js b/tools/eslint/lib/rules/max-statements.js
index 9fe11bfd91d..8c7f4fd31b1 100644
--- a/tools/eslint/lib/rules/max-statements.js
+++ b/tools/eslint/lib/rules/max-statements.js
@@ -53,3 +53,9 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [
+ {
+ "type": "integer"
+ }
+];
diff --git a/tools/eslint/lib/rules/new-cap.js b/tools/eslint/lib/rules/new-cap.js
index 1474fc80289..3f47d9a5edb 100644
--- a/tools/eslint/lib/rules/new-cap.js
+++ b/tools/eslint/lib/rules/new-cap.js
@@ -67,8 +67,8 @@ function calculateCapIsNewExceptions(config) {
module.exports = function(context) {
var config = context.options[0] || {};
- config.newIsCap = config.newIsCap === false ? false : true;
- config.capIsNew = config.capIsNew === false ? false : true;
+ config.newIsCap = config.newIsCap !== false;
+ config.capIsNew = config.capIsNew !== false;
var newIsCapExceptions = checkArray(config, "newIsCapExceptions", []).reduce(invert, {});
@@ -195,3 +195,30 @@ module.exports = function(context) {
return listeners;
};
+
+module.exports.schema = [
+ {
+ "type": "object",
+ "properties": {
+ "newIsCap": {
+ "type": "boolean"
+ },
+ "capIsNew": {
+ "type": "boolean"
+ },
+ "newIsCapExceptions": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "capIsNewExceptions": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ },
+ "additionalProperties": false
+ }
+];
diff --git a/tools/eslint/lib/rules/new-parens.js b/tools/eslint/lib/rules/new-parens.js
index adc2f70c92f..903564b5d77 100644
--- a/tools/eslint/lib/rules/new-parens.js
+++ b/tools/eslint/lib/rules/new-parens.js
@@ -25,3 +25,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/newline-after-var.js b/tools/eslint/lib/rules/newline-after-var.js
index 7a6c3cff2fb..e1ade14bded 100644
--- a/tools/eslint/lib/rules/newline-after-var.js
+++ b/tools/eslint/lib/rules/newline-after-var.js
@@ -119,3 +119,9 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [
+ {
+ "enum": ["never", "always"]
+ }
+];
diff --git a/tools/eslint/lib/rules/no-alert.js b/tools/eslint/lib/rules/no-alert.js
index 1f14b533d71..7d041eaf748 100644
--- a/tools/eslint/lib/rules/no-alert.js
+++ b/tools/eslint/lib/rules/no-alert.js
@@ -1,6 +1,8 @@
/**
* @fileoverview Rule to flag use of alert, confirm, prompt
* @author Nicholas C. Zakas
+ * @copyright 2015 Mathias Schreck
+ * @copyright 2013 Nicholas C. Zakas
*/
"use strict";
@@ -8,47 +10,144 @@
// Helpers
//------------------------------------------------------------------------------
-function matchProhibited(name) {
- return name.match(/^(alert|confirm|prompt)$/);
+/**
+ * Checks if the given name is a prohibited identifier.
+ * @param {string} name The name to check
+ * @returns {boolean} Whether or not the name is prohibited.
+ */
+function isProhibitedIdentifier(name) {
+ return /^(alert|confirm|prompt)$/.test(name);
}
-function report(context, node, result) {
- context.report(node, "Unexpected {{name}}.", { name: result[1] });
+/**
+ * Reports the given node and identifier name.
+ * @param {RuleContext} context The ESLint rule context.
+ * @param {ASTNode} node The node to report on.
+ * @param {string} identifierName The name of the identifier.
+ * @returns {void}
+ */
+function report(context, node, identifierName) {
+ context.report(node, "Unexpected {{name}}.", { name: identifierName });
}
+/**
+ * Returns the property name of a MemberExpression.
+ * @param {ASTNode} memberExpressionNode The MemberExpression node.
+ * @returns {string|undefined} Returns the property name if available, undefined else.
+ */
+function getPropertyName(memberExpressionNode) {
+ if (memberExpressionNode.computed) {
+ if (memberExpressionNode.property.type === "Literal") {
+ return memberExpressionNode.property.value;
+ }
+ } else {
+ return memberExpressionNode.property.name;
+ }
+}
+
+/**
+ * Finds the escope reference in the given scope.
+ * @param {Object} scope The scope to search.
+ * @param {ASTNode} node The identifier node.
+ * @returns {Reference|undefined} Returns the found reference or undefined if none were found.
+ */
+function findReference(scope, node) {
+ var references = scope.references.filter(function (reference) {
+ return reference.identifier.range[0] === node.range[0] &&
+ reference.identifier.range[1] === node.range[1];
+ });
+
+ if (references.length === 1) {
+ return references[0];
+ }
+}
+
+/**
+ * Checks if the given identifier name is shadowed in the given global scope.
+ * @param {Object} globalScope The global scope.
+ * @param {string} identifierName The identifier name to check
+ * @returns {boolean} Whether or not the name is shadowed globally.
+ */
+function isGloballyShadowed(globalScope, identifierName) {
+ return globalScope.variables.some(function (variable) {
+ return variable.name === identifierName && variable.defs.length > 0;
+ });
+}
+
+/**
+ * Checks if the given identifier node is shadowed in the given scope.
+ * @param {Object} scope The current scope.
+ * @param {Object} globalScope The global scope.
+ * @param {string} node The identifier node to check
+ * @returns {boolean} Whether or not the name is shadowed.
+ */
+function isShadowed(scope, globalScope, node) {
+ var reference = findReference(scope, node),
+ identifierName = node.name;
+
+ if (reference) {
+ if (reference.resolved || isGloballyShadowed(globalScope, identifierName)) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+/**
+ * Checks if the given identifier node is a ThisExpression in the global scope or the global window property.
+ * @param {Object} scope The current scope.
+ * @param {Object} globalScope The global scope.
+ * @param {string} node The identifier node to check
+ * @returns {boolean} Whether or not the node is a reference to the global object.
+ */
+function isGlobalThisReferenceOrGlobalWindow(scope, globalScope, node) {
+ if (scope.type === "global" && node.type === "ThisExpression") {
+ return true;
+ } else if (node.name === "window") {
+ return !isShadowed(scope, globalScope, node);
+ }
+
+ return false;
+}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
module.exports = function(context) {
+ var globalScope;
return {
- "CallExpression": function(node) {
+ "Program": function () {
+ globalScope = context.getScope();
+ },
- var result;
+ "CallExpression": function(node) {
+ var callee = node.callee,
+ identifierName,
+ currentScope = context.getScope();
// without window.
- if (node.callee.type === "Identifier") {
+ if (callee.type === "Identifier") {
+ identifierName = callee.name;
- result = matchProhibited(node.callee.name);
-
- if (result) {
- report(context, node, result);
+ if (!isShadowed(currentScope, globalScope, callee) && isProhibitedIdentifier(callee.name)) {
+ report(context, node, identifierName);
}
- } else if (node.callee.type === "MemberExpression" && node.callee.property.type === "Identifier") {
-
- result = matchProhibited(node.callee.property.name);
+ } else if (callee.type === "MemberExpression" && isGlobalThisReferenceOrGlobalWindow(currentScope, globalScope, callee.object)) {
+ identifierName = getPropertyName(callee);
- if (result && node.callee.object.name === "window") {
- report(context, node, result);
+ if (isProhibitedIdentifier(identifierName)) {
+ report(context, node, identifierName);
}
-
}
}
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-array-constructor.js b/tools/eslint/lib/rules/no-array-constructor.js
index a37d674c807..b7167a49e59 100644
--- a/tools/eslint/lib/rules/no-array-constructor.js
+++ b/tools/eslint/lib/rules/no-array-constructor.js
@@ -27,3 +27,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-bitwise.js b/tools/eslint/lib/rules/no-bitwise.js
index 942317f3d0e..439b7be4b20 100644
--- a/tools/eslint/lib/rules/no-bitwise.js
+++ b/tools/eslint/lib/rules/no-bitwise.js
@@ -53,3 +53,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-caller.js b/tools/eslint/lib/rules/no-caller.js
index b489d79c548..aacb3feffbe 100644
--- a/tools/eslint/lib/rules/no-caller.js
+++ b/tools/eslint/lib/rules/no-caller.js
@@ -25,3 +25,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-catch-shadow.js b/tools/eslint/lib/rules/no-catch-shadow.js
index af07c462920..5776cd1780c 100644
--- a/tools/eslint/lib/rules/no-catch-shadow.js
+++ b/tools/eslint/lib/rules/no-catch-shadow.js
@@ -48,3 +48,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-comma-dangle.js b/tools/eslint/lib/rules/no-comma-dangle.js
index 32b2a73658e..899529efe8a 100644
--- a/tools/eslint/lib/rules/no-comma-dangle.js
+++ b/tools/eslint/lib/rules/no-comma-dangle.js
@@ -41,3 +41,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-cond-assign.js b/tools/eslint/lib/rules/no-cond-assign.js
index 9b00fe4e32b..2dc6251e39e 100644
--- a/tools/eslint/lib/rules/no-cond-assign.js
+++ b/tools/eslint/lib/rules/no-cond-assign.js
@@ -115,3 +115,9 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [
+ {
+ "enum": ["except-parens", "always"]
+ }
+];
diff --git a/tools/eslint/lib/rules/no-console.js b/tools/eslint/lib/rules/no-console.js
index 929f00045ed..5de6adadbf4 100644
--- a/tools/eslint/lib/rules/no-console.js
+++ b/tools/eslint/lib/rules/no-console.js
@@ -23,3 +23,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-constant-condition.js b/tools/eslint/lib/rules/no-constant-condition.js
index 394a9c9bb8b..0fe0845de49 100644
--- a/tools/eslint/lib/rules/no-constant-condition.js
+++ b/tools/eslint/lib/rules/no-constant-condition.js
@@ -69,3 +69,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-continue.js b/tools/eslint/lib/rules/no-continue.js
index b4810130057..89fa1848e95 100644
--- a/tools/eslint/lib/rules/no-continue.js
+++ b/tools/eslint/lib/rules/no-continue.js
@@ -19,3 +19,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-control-regex.js b/tools/eslint/lib/rules/no-control-regex.js
index a800acc87fe..cd57f734510 100644
--- a/tools/eslint/lib/rules/no-control-regex.js
+++ b/tools/eslint/lib/rules/no-control-regex.js
@@ -54,3 +54,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-debugger.js b/tools/eslint/lib/rules/no-debugger.js
index 1a9a7e7d70d..7d86e76d4fd 100644
--- a/tools/eslint/lib/rules/no-debugger.js
+++ b/tools/eslint/lib/rules/no-debugger.js
@@ -18,3 +18,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-delete-var.js b/tools/eslint/lib/rules/no-delete-var.js
index a863d6897a5..d6ffbd107a6 100644
--- a/tools/eslint/lib/rules/no-delete-var.js
+++ b/tools/eslint/lib/rules/no-delete-var.js
@@ -21,3 +21,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-div-regex.js b/tools/eslint/lib/rules/no-div-regex.js
index 17347480c64..61e7a1c4d88 100644
--- a/tools/eslint/lib/rules/no-div-regex.js
+++ b/tools/eslint/lib/rules/no-div-regex.js
@@ -23,3 +23,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-dupe-args.js b/tools/eslint/lib/rules/no-dupe-args.js
index 458622e5e0d..cb6e558154c 100644
--- a/tools/eslint/lib/rules/no-dupe-args.js
+++ b/tools/eslint/lib/rules/no-dupe-args.js
@@ -57,7 +57,11 @@ module.exports = function(context) {
case "ArrayPattern":
param.elements.forEach(function(element) {
- markParam(element.name);
+
+ // Arrays can be sparse (unwanted arguments)
+ if (element !== null) {
+ markParam(element.name);
+ }
});
break;
@@ -81,3 +85,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-dupe-keys.js b/tools/eslint/lib/rules/no-dupe-keys.js
index 522f6ace6db..1f86c10d6ce 100644
--- a/tools/eslint/lib/rules/no-dupe-keys.js
+++ b/tools/eslint/lib/rules/no-dupe-keys.js
@@ -39,3 +39,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-duplicate-case.js b/tools/eslint/lib/rules/no-duplicate-case.js
index 89de7174fcb..978e63cade4 100644
--- a/tools/eslint/lib/rules/no-duplicate-case.js
+++ b/tools/eslint/lib/rules/no-duplicate-case.js
@@ -25,6 +25,12 @@ module.exports = function(context) {
return node.type + typeof node.name + node.name;
} else if (node.type === "MemberExpression") {
return node.type + getHash(node.object) + getHash(node.property);
+ } else if (node.type === "CallExpression") {
+ return node.type + getHash(node.callee) + node.arguments.map(getHash).join("");
+ } else if (node.type === "BinaryExpression") {
+ return node.type + getHash(node.left) + node.operator + getHash(node.right);
+ } else if (node.type === "ConditionalExpression") {
+ return node.type + getHash(node.test) + getHash(node.consequent) + getHash(node.alternate);
}
}
@@ -57,3 +63,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-else-return.js b/tools/eslint/lib/rules/no-else-return.js
index 24960953657..df674c4753c 100644
--- a/tools/eslint/lib/rules/no-else-return.js
+++ b/tools/eslint/lib/rules/no-else-return.js
@@ -121,3 +121,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-empty-character-class.js b/tools/eslint/lib/rules/no-empty-character-class.js
new file mode 100644
index 00000000000..ccb01bd40c8
--- /dev/null
+++ b/tools/eslint/lib/rules/no-empty-character-class.js
@@ -0,0 +1,43 @@
+/**
+ * @fileoverview Rule to flag the use of empty character classes in regular expressions
+ * @author Ian Christian Myers
+ */
+
+"use strict";
+
+//------------------------------------------------------------------------------
+// Helpers
+//------------------------------------------------------------------------------
+
+/*
+plain-English description of the following regexp:
+0. `^` fix the match at the beginning of the string
+1. `\/`: the `/` that begins the regexp
+2. `([^\\[]|\\.|\[([^\\\]]|\\.)+\])*`: regexp contents; 0 or more of the following
+ 2.0. `[^\\[]`: any character that's not a `\` or a `[` (anything but escape sequences and character classes)
+ 2.1. `\\.`: an escape sequence
+ 2.2. `\[([^\\\]]|\\.)+\]`: a character class that isn't empty
+3. `\/` the `/` that ends the regexp
+4. `[gimuy]*`: optional regexp flags
+5. `$`: fix the match at the end of the string
+*/
+var regex = /^\/([^\\[]|\\.|\[([^\\\]]|\\.)+\])*\/[gimuy]*$/;
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+module.exports = function(context) {
+
+ return {
+
+ "Literal": function(node) {
+ var token = context.getFirstToken(node);
+ if (token.type === "RegularExpression" && !regex.test(token.value)) {
+ context.report(node, "Empty class.");
+ }
+ }
+
+ };
+
+};
diff --git a/tools/eslint/lib/rules/no-empty-class.js b/tools/eslint/lib/rules/no-empty-class.js
index 009c1446b42..94564f44988 100644
--- a/tools/eslint/lib/rules/no-empty-class.js
+++ b/tools/eslint/lib/rules/no-empty-class.js
@@ -41,3 +41,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-empty-label.js b/tools/eslint/lib/rules/no-empty-label.js
index 371c629a824..f15694f6d0d 100644
--- a/tools/eslint/lib/rules/no-empty-label.js
+++ b/tools/eslint/lib/rules/no-empty-label.js
@@ -23,3 +23,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-empty.js b/tools/eslint/lib/rules/no-empty.js
index 1c2307d63f8..7f1adf58384 100644
--- a/tools/eslint/lib/rules/no-empty.js
+++ b/tools/eslint/lib/rules/no-empty.js
@@ -45,3 +45,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-eq-null.js b/tools/eslint/lib/rules/no-eq-null.js
index deee40c36a6..92d88920ae6 100644
--- a/tools/eslint/lib/rules/no-eq-null.js
+++ b/tools/eslint/lib/rules/no-eq-null.js
@@ -25,3 +25,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-eval.js b/tools/eslint/lib/rules/no-eval.js
index 8eced727db3..2347abfc91a 100644
--- a/tools/eslint/lib/rules/no-eval.js
+++ b/tools/eslint/lib/rules/no-eval.js
@@ -22,3 +22,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-ex-assign.js b/tools/eslint/lib/rules/no-ex-assign.js
index 6ea5a223601..e9fd94bb775 100644
--- a/tools/eslint/lib/rules/no-ex-assign.js
+++ b/tools/eslint/lib/rules/no-ex-assign.js
@@ -38,3 +38,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-extend-native.js b/tools/eslint/lib/rules/no-extend-native.js
index a600de09be1..28404194b4d 100644
--- a/tools/eslint/lib/rules/no-extend-native.js
+++ b/tools/eslint/lib/rules/no-extend-native.js
@@ -21,6 +21,16 @@ var BUILTINS = [
module.exports = function(context) {
+ var config = context.options[0] || {};
+ var exceptions = config.exceptions || [];
+ var modifiedBuiltins = BUILTINS;
+
+ if (exceptions.length) {
+ modifiedBuiltins = BUILTINS.filter(function(builtIn) {
+ return exceptions.indexOf(builtIn) === -1;
+ });
+ }
+
return {
// handle the Array.prototype.extra style case
@@ -39,7 +49,7 @@ module.exports = function(context) {
return;
}
- BUILTINS.forEach(function(builtin) {
+ modifiedBuiltins.forEach(function(builtin) {
if (lhs.object.object.name === builtin) {
context.report(node, builtin + " prototype is read only, properties should not be added.");
}
@@ -64,7 +74,7 @@ module.exports = function(context) {
if (object &&
object.type === "Identifier" &&
- (BUILTINS.indexOf(object.name) > -1) &&
+ (modifiedBuiltins.indexOf(object.name) > -1) &&
subject.property.name === "prototype") {
context.report(node, object.name + " prototype is read only, properties should not be added.");
@@ -75,3 +85,19 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [
+ {
+ "type": "object",
+ "properties": {
+ "exceptions": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "uniqueItems": true
+ }
+ },
+ "additionalProperties": false
+ }
+];
diff --git a/tools/eslint/lib/rules/no-extra-bind.js b/tools/eslint/lib/rules/no-extra-bind.js
index b585730633e..58ba05b7418 100644
--- a/tools/eslint/lib/rules/no-extra-bind.js
+++ b/tools/eslint/lib/rules/no-extra-bind.js
@@ -77,3 +77,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-extra-boolean-cast.js b/tools/eslint/lib/rules/no-extra-boolean-cast.js
index 605d7b1210e..d27f3609a9a 100644
--- a/tools/eslint/lib/rules/no-extra-boolean-cast.js
+++ b/tools/eslint/lib/rules/no-extra-boolean-cast.js
@@ -67,3 +67,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-extra-parens.js b/tools/eslint/lib/rules/no-extra-parens.js
index 2ec8647a685..12b4c5d8761 100644
--- a/tools/eslint/lib/rules/no-extra-parens.js
+++ b/tools/eslint/lib/rules/no-extra-parens.js
@@ -1,5 +1,5 @@
/**
- * @fileoverview Disallow parenthesesisng higher precedence subexpressions.
+ * @fileoverview Disallow parenthesising higher precedence subexpressions.
* @author Michael Ficarra
* @copyright 2014 Michael Ficarra. All rights reserved.
*/
@@ -11,6 +11,24 @@
module.exports = function(context) {
+ var ALL_NODES = context.options[0] !== "functions";
+
+ /**
+ * Determines if this rule should be enforced for a node given the current configuration.
+ * @param {ASTNode} node - The node to be checked.
+ * @returns {boolean} True if the rule should be enforced for this node.
+ * @private
+ */
+ function ruleApplies(node) {
+ return ALL_NODES || node.type === "FunctionExpression" || node.type === "ArrowFunctionExpression";
+ }
+
+ /**
+ * Determines if a node is surrounded by parentheses.
+ * @param {ASTNode} node - The node to be checked.
+ * @returns {boolean} True if the node is parenthesised.
+ * @private
+ */
function isParenthesised(node) {
var previousToken = context.getTokenBefore(node),
nextToken = context.getTokenAfter(node);
@@ -20,6 +38,12 @@ module.exports = function(context) {
nextToken.value === ")" && nextToken.range[0] >= node.range[1];
}
+ /**
+ * Determines if a node is surrounded by parentheses twice.
+ * @param {ASTNode} node - The node to be checked.
+ * @returns {boolean} True if the node is doubly parenthesised.
+ * @private
+ */
function isParenthesisedTwice(node) {
var previousToken = context.getTokenBefore(node, 1),
nextToken = context.getTokenAfter(node, 1);
@@ -29,6 +53,27 @@ module.exports = function(context) {
nextToken.value === ")" && nextToken.range[0] >= node.range[1];
}
+ /**
+ * Determines if a node is surrounded by (potentially) invalid parentheses.
+ * @param {ASTNode} node - The node to be checked.
+ * @returns {boolean} True if the node is incorrectly parenthesised.
+ * @private
+ */
+ function hasExcessParens(node) {
+ return ruleApplies(node) && isParenthesised(node);
+ }
+
+ /**
+ * Determines if a node that is expected to be parenthesised is surrounded by
+ * (potentially) invalid extra parentheses.
+ * @param {ASTNode} node - The node to be checked.
+ * @returns {boolean} True if the node is has an unexpected extra pair of parentheses.
+ * @private
+ */
+ function hasDoubleExcessParens(node) {
+ return ruleApplies(node) && isParenthesisedTwice(node);
+ }
+
function precedence(node) {
switch (node.type) {
@@ -110,23 +155,27 @@ module.exports = function(context) {
}
function dryUnaryUpdate(node) {
- if (isParenthesised(node.argument) && precedence(node.argument) >= precedence(node)) {
+ if (hasExcessParens(node.argument) && precedence(node.argument) >= precedence(node)) {
report(node.argument);
}
}
function dryCallNew(node) {
- if (isParenthesised(node.callee) && precedence(node.callee) >= precedence(node) &&
- !(node.type === "CallExpression" && node.callee.type === "FunctionExpression")) {
+ if (hasExcessParens(node.callee) && precedence(node.callee) >= precedence(node) && !(
+ node.type === "CallExpression" &&
+ node.callee.type === "FunctionExpression" &&
+ // One set of parentheses are allowed for a function expression
+ !hasDoubleExcessParens(node.callee)
+ )) {
report(node.callee);
}
if (node.arguments.length === 1) {
- if (isParenthesisedTwice(node.arguments[0]) && precedence(node.arguments[0]) >= precedence({type: "AssignmentExpression"})) {
+ if (hasDoubleExcessParens(node.arguments[0]) && precedence(node.arguments[0]) >= precedence({type: "AssignmentExpression"})) {
report(node.arguments[0]);
}
} else {
[].forEach.call(node.arguments, function(arg) {
- if (isParenthesised(arg) && precedence(arg) >= precedence({type: "AssignmentExpression"})) {
+ if (hasExcessParens(arg) && precedence(arg) >= precedence({type: "AssignmentExpression"})) {
report(arg);
}
});
@@ -135,10 +184,10 @@ module.exports = function(context) {
function dryBinaryLogical(node) {
var prec = precedence(node);
- if (isParenthesised(node.left) && precedence(node.left) >= prec) {
+ if (hasExcessParens(node.left) && precedence(node.left) >= prec) {
report(node.left);
}
- if (isParenthesised(node.right) && precedence(node.right) > prec) {
+ if (hasExcessParens(node.right) && precedence(node.right) > prec) {
report(node.right);
}
}
@@ -146,80 +195,91 @@ module.exports = function(context) {
return {
"ArrayExpression": function(node) {
[].forEach.call(node.elements, function(e) {
- if (e && isParenthesised(e) && precedence(e) >= precedence({type: "AssignmentExpression"})) {
+ if (e && hasExcessParens(e) && precedence(e) >= precedence({type: "AssignmentExpression"})) {
report(e);
}
});
},
"ArrowFunctionExpression": function(node) {
- if (node.body.type !== "BlockStatement" && isParenthesised(node.body) && precedence(node.body) >= precedence({type: "AssignmentExpression"})) {
- report(node.body);
+ if (node.body.type !== "BlockStatement") {
+ if (node.body.type !== "ObjectExpression" && hasExcessParens(node.body) && precedence(node.body) >= precedence({type: "AssignmentExpression"})) {
+ report(node.body);
+ return;
+ }
+
+ // Object literals *must* be parenthesized
+ if (node.body.type === "ObjectExpression" && hasDoubleExcessParens(node.body)) {
+ report(node.body);
+ return;
+ }
}
},
"AssignmentExpression": function(node) {
- if (isParenthesised(node.right) && precedence(node.right) >= precedence(node)) {
+ if (hasExcessParens(node.right) && precedence(node.right) >= precedence(node)) {
report(node.right);
}
},
"BinaryExpression": dryBinaryLogical,
"CallExpression": dryCallNew,
"ConditionalExpression": function(node) {
- if (isParenthesised(node.test) && precedence(node.test) >= precedence({type: "LogicalExpression", operator: "||"})) {
+ if (hasExcessParens(node.test) && precedence(node.test) >= precedence({type: "LogicalExpression", operator: "||"})) {
report(node.test);
}
- if (isParenthesised(node.consequent) && precedence(node.consequent) >= precedence({type: "AssignmentExpression"})) {
+ if (hasExcessParens(node.consequent) && precedence(node.consequent) >= precedence({type: "AssignmentExpression"})) {
report(node.consequent);
}
- if (isParenthesised(node.alternate) && precedence(node.alternate) >= precedence({type: "AssignmentExpression"})) {
+ if (hasExcessParens(node.alternate) && precedence(node.alternate) >= precedence({type: "AssignmentExpression"})) {
report(node.alternate);
}
},
"DoWhileStatement": function(node) {
- if (isParenthesisedTwice(node.test)) {
+ if (hasDoubleExcessParens(node.test)) {
report(node.test);
}
},
"ExpressionStatement": function(node) {
var firstToken;
- if (isParenthesised(node.expression)) {
+ if (hasExcessParens(node.expression) && node.expression.type !== "CallExpression") {
firstToken = context.getFirstToken(node.expression);
- if (firstToken.value !== "function" && firstToken.value !== "{") {
+ // Pure object literals ({}) do not need parentheses but
+ // member expressions do ({}.toString())
+ if (firstToken.value !== "{" || node.expression.type === "ObjectExpression") {
report(node.expression);
}
}
},
"ForInStatement": function(node) {
- if (isParenthesised(node.right)) {
+ if (hasExcessParens(node.right)) {
report(node.right);
}
},
"ForOfStatement": function(node) {
- if (isParenthesised(node.right)) {
+ if (hasExcessParens(node.right)) {
report(node.right);
}
},
"ForStatement": function(node) {
- if (node.init && isParenthesised(node.init)) {
+ if (node.init && hasExcessParens(node.init)) {
report(node.init);
}
- if (node.test && isParenthesised(node.test)) {
+ if (node.test && hasExcessParens(node.test)) {
report(node.test);
}
- if (node.update && isParenthesised(node.update)) {
+ if (node.update && hasExcessParens(node.update)) {
report(node.update);
}
},
"IfStatement": function(node) {
- if (isParenthesisedTwice(node.test)) {
+ if (hasDoubleExcessParens(node.test)) {
report(node.test);
}
},
"LogicalExpression": dryBinaryLogical,
"MemberExpression": function(node) {
if (
- isParenthesised(node.object) &&
+ hasExcessParens(node.object) &&
precedence(node.object) >= precedence(node) &&
(
node.computed ||
@@ -235,18 +295,21 @@ module.exports = function(context) {
) {
report(node.object);
}
+ if (node.computed && hasExcessParens(node.property)) {
+ report(node.property);
+ }
},
"NewExpression": dryCallNew,
"ObjectExpression": function(node) {
[].forEach.call(node.properties, function(e) {
var v = e.value;
- if (v && isParenthesised(v) && precedence(v) >= precedence({type: "AssignmentExpression"})) {
+ if (v && hasExcessParens(v) && precedence(v) >= precedence({type: "AssignmentExpression"})) {
report(v);
}
});
},
"ReturnStatement": function(node) {
- if (node.argument && isParenthesised(node.argument) &&
+ if (node.argument && hasExcessParens(node.argument) &&
// RegExp literal is allowed to have parens (#1589)
!(node.argument.type === "Literal" && node.argument.regex)) {
report(node.argument);
@@ -254,30 +317,30 @@ module.exports = function(context) {
},
"SequenceExpression": function(node) {
[].forEach.call(node.expressions, function(e) {
- if (isParenthesised(e) && precedence(e) >= precedence(node)) {
+ if (hasExcessParens(e) && precedence(e) >= precedence(node)) {
report(e);
}
});
},
"SwitchCase": function(node) {
- if (node.test && isParenthesised(node.test)) {
+ if (node.test && hasExcessParens(node.test)) {
report(node.test);
}
},
"SwitchStatement": function(node) {
- if (isParenthesisedTwice(node.discriminant)) {
+ if (hasDoubleExcessParens(node.discriminant)) {
report(node.discriminant);
}
},
"ThrowStatement": function(node) {
- if (isParenthesised(node.argument)) {
+ if (hasExcessParens(node.argument)) {
report(node.argument);
}
},
"UnaryExpression": dryUnaryUpdate,
"UpdateExpression": dryUnaryUpdate,
"VariableDeclarator": function(node) {
- if (node.init && isParenthesised(node.init) &&
+ if (node.init && hasExcessParens(node.init) &&
precedence(node.init) >= precedence({type: "AssignmentExpression"}) &&
// RegExp literal is allowed to have parens (#1589)
!(node.init.type === "Literal" && node.init.regex)) {
@@ -285,15 +348,21 @@ module.exports = function(context) {
}
},
"WhileStatement": function(node) {
- if (isParenthesisedTwice(node.test)) {
+ if (hasDoubleExcessParens(node.test)) {
report(node.test);
}
},
"WithStatement": function(node) {
- if (isParenthesisedTwice(node.object)) {
+ if (hasDoubleExcessParens(node.object)) {
report(node.object);
}
}
};
};
+
+module.exports.schema = [
+ {
+ "enum": ["all", "functions"]
+ }
+];
diff --git a/tools/eslint/lib/rules/no-extra-semi.js b/tools/eslint/lib/rules/no-extra-semi.js
index e155d982e56..a3897ef2275 100644
--- a/tools/eslint/lib/rules/no-extra-semi.js
+++ b/tools/eslint/lib/rules/no-extra-semi.js
@@ -11,11 +11,60 @@
module.exports = function(context) {
+ /**
+ * Reports an unnecessary semicolon error.
+ * @param {Node|Token} nodeOrToken - A node or a token to be reported.
+ * @returns {void}
+ */
+ function report(nodeOrToken) {
+ context.report(nodeOrToken, "Unnecessary semicolon.");
+ }
+
+ /**
+ * Checks for a part of a class body.
+ * This checks tokens from a specified token to a next MethodDefinition or the end of class body.
+ *
+ * @param {Token} firstToken - The first token to check.
+ * @returns {void}
+ */
+ function checkForPartOfClassBody(firstToken) {
+ for (var token = firstToken;
+ token.type === "Punctuator" && token.value !== "}";
+ token = context.getTokenAfter(token)
+ ) {
+ if (token.value === ";") {
+ report(token);
+ }
+ }
+ }
+
return {
+ /**
+ * Reports this empty statement.
+ * @param {Node} node - A EmptyStatement node to be reported.
+ * @returns {void}
+ */
+ "EmptyStatement": report,
- "EmptyStatement": function(node) {
- context.report(node, "Unnecessary semicolon.");
+ /**
+ * Checks tokens from the head of this class body to the first MethodDefinition or the end of this class body.
+ * @param {Node} node - A ClassBody node to check.
+ * @returns {void}
+ */
+ "ClassBody": function(node) {
+ checkForPartOfClassBody(context.getFirstToken(node, 1)); // 0 is `{`.
+ },
+
+ /**
+ * Checks tokens from this MethodDefinition to the next MethodDefinition or the end of this class body.
+ * @param {Node} node - A MethodDefinition node of the start point.
+ * @returns {void}
+ */
+ "MethodDefinition": function(node) {
+ checkForPartOfClassBody(context.getTokenAfter(node));
}
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-extra-strict.js b/tools/eslint/lib/rules/no-extra-strict.js
index 4c6ac16a427..a6b3bc1855e 100644
--- a/tools/eslint/lib/rules/no-extra-strict.js
+++ b/tools/eslint/lib/rules/no-extra-strict.js
@@ -82,3 +82,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-fallthrough.js b/tools/eslint/lib/rules/no-fallthrough.js
index a137fb3f808..e5974420385 100644
--- a/tools/eslint/lib/rules/no-fallthrough.js
+++ b/tools/eslint/lib/rules/no-fallthrough.js
@@ -93,3 +93,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-floating-decimal.js b/tools/eslint/lib/rules/no-floating-decimal.js
index c6380d54607..61a84f5e46e 100644
--- a/tools/eslint/lib/rules/no-floating-decimal.js
+++ b/tools/eslint/lib/rules/no-floating-decimal.js
@@ -26,3 +26,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-func-assign.js b/tools/eslint/lib/rules/no-func-assign.js
index a9f2858126b..a711f572a1f 100644
--- a/tools/eslint/lib/rules/no-func-assign.js
+++ b/tools/eslint/lib/rules/no-func-assign.js
@@ -79,3 +79,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-implied-eval.js b/tools/eslint/lib/rules/no-implied-eval.js
index f798dcdade4..7fdc2f114de 100644
--- a/tools/eslint/lib/rules/no-implied-eval.js
+++ b/tools/eslint/lib/rules/no-implied-eval.js
@@ -72,3 +72,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-inline-comments.js b/tools/eslint/lib/rules/no-inline-comments.js
index 091ad9bee45..3941fd24c0f 100644
--- a/tools/eslint/lib/rules/no-inline-comments.js
+++ b/tools/eslint/lib/rules/no-inline-comments.js
@@ -45,3 +45,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-inner-declarations.js b/tools/eslint/lib/rules/no-inner-declarations.js
index 664639d575d..f5503eea8e7 100644
--- a/tools/eslint/lib/rules/no-inner-declarations.js
+++ b/tools/eslint/lib/rules/no-inner-declarations.js
@@ -70,3 +70,9 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [
+ {
+ "enum": ["functions", "both"]
+ }
+];
diff --git a/tools/eslint/lib/rules/no-invalid-regexp.js b/tools/eslint/lib/rules/no-invalid-regexp.js
index cea5372f153..63608c6c474 100644
--- a/tools/eslint/lib/rules/no-invalid-regexp.js
+++ b/tools/eslint/lib/rules/no-invalid-regexp.js
@@ -49,3 +49,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-irregular-whitespace.js b/tools/eslint/lib/rules/no-irregular-whitespace.js
index 3599f0cecdf..bfb30b8667b 100644
--- a/tools/eslint/lib/rules/no-irregular-whitespace.js
+++ b/tools/eslint/lib/rules/no-irregular-whitespace.js
@@ -12,7 +12,8 @@
module.exports = function(context) {
- var irregularWhitespace = /[\u0085\u00A0\ufeff\f\v\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u202f\u205f\u3000]+/mg;
+ var irregularWhitespace = /[\u0085\u00A0\ufeff\f\v\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000]+/mg,
+ irregularLineTerminators = /[\u2028\u2029]/mg;
// Module store of errors that we have found
var errors = [];
@@ -30,7 +31,7 @@ module.exports = function(context) {
errors = errors.filter(function (error) {
var errorLoc = error[1];
if (errorLoc.line >= locStart.line && errorLoc.line <= locEnd.line) {
- if (errorLoc.column >= locStart.column && errorLoc.column <= locEnd.column) {
+ if (errorLoc.column >= locStart.column && (errorLoc.column <= locEnd.column || errorLoc.line < locEnd.line)) {
return false;
}
}
@@ -39,7 +40,7 @@ module.exports = function(context) {
}
/**
- * Checks nodes for errors that we are choosing to ignore and calls the relevent methods to remove the errors
+ * Checks nodes for errors that we are choosing to ignore and calls the relevant methods to remove the errors
* @param {ASTNode} node to check for matching errors.
* @returns {void}
* @private
@@ -47,12 +48,65 @@ module.exports = function(context) {
function removeInvalidNodeErrors(node) {
if (typeof node.value === "string") {
// If we have irregular characters remove them from the errors list
- if (node.value.match(irregularWhitespace)) {
+ if (node.raw.match(irregularWhitespace) || node.raw.match(irregularLineTerminators)) {
removeStringError(node);
}
}
}
+ /**
+ * Checks the program source for irregular whitespace
+ * @param {ASTNode} node The program node
+ * @returns {void}
+ * @private
+ */
+ function checkForIrregularWhitespace(node) {
+ var sourceLines = context.getSourceLines();
+
+ sourceLines.forEach(function (sourceLine, lineIndex) {
+ var lineNumber = lineIndex + 1,
+ location,
+ match;
+
+ while ((match = irregularWhitespace.exec(sourceLine)) !== null) {
+ location = {
+ line: lineNumber,
+ column: match.index
+ };
+
+ errors.push([node, location, "Irregular whitespace not allowed"]);
+ }
+ });
+ }
+
+ /**
+ * Checks the program source for irregular line terminators
+ * @param {ASTNode} node The program node
+ * @returns {void}
+ * @private
+ */
+ function checkForIrregularLineTerminators(node) {
+ var source = context.getSource(),
+ sourceLines = context.getSourceLines(),
+ linebreaks = source.match(/\r\n|\r|\n|\u2028|\u2029/g),
+ lastLineIndex = -1,
+ lineIndex,
+ location,
+ match;
+
+ while ((match = irregularLineTerminators.exec(source)) !== null) {
+ lineIndex = linebreaks.indexOf(match[0], lastLineIndex + 1) || 0;
+
+ location = {
+ line: lineIndex + 1,
+ column: sourceLines[lineIndex].length
+ };
+
+ errors.push([node, location, "Irregular whitespace not allowed"]);
+ lastLineIndex = lineIndex;
+ }
+ }
+
return {
"Program": function (node) {
/**
@@ -61,26 +115,13 @@ module.exports = function(context) {
* When writing this code also evaluating per node was missing out connecting tokens in some cases
* We can later filter the errors when they are found to be not an issue in nodes we don't care about
*/
- var sourceLines = context.getSourceLines();
- sourceLines.forEach(function (sourceLine, lineIndex) {
- var location,
- match = irregularWhitespace.exec(sourceLine);
-
- if (match !== null) {
- location = {
- line: lineIndex + 1,
- column: match.index
- };
-
- errors.push([node, location, "Irregular whitespace not allowed"]);
- }
- });
+ checkForIrregularWhitespace(node);
+ checkForIrregularLineTerminators(node);
},
+
"Identifier": removeInvalidNodeErrors,
"Literal": removeInvalidNodeErrors,
- "Statement": removeInvalidNodeErrors,
- "Expression": removeInvalidNodeErrors,
"Program:exit": function () {
// If we have any errors remaining report on them
@@ -90,3 +131,5 @@ module.exports = function(context) {
}
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-iterator.js b/tools/eslint/lib/rules/no-iterator.js
index 564c09abfa6..817980c99f6 100644
--- a/tools/eslint/lib/rules/no-iterator.js
+++ b/tools/eslint/lib/rules/no-iterator.js
@@ -24,3 +24,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-label-var.js b/tools/eslint/lib/rules/no-label-var.js
index b82bd0af608..8aa944e7a85 100644
--- a/tools/eslint/lib/rules/no-label-var.js
+++ b/tools/eslint/lib/rules/no-label-var.js
@@ -60,3 +60,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-labels.js b/tools/eslint/lib/rules/no-labels.js
index 8b5086a2958..c083f032f65 100644
--- a/tools/eslint/lib/rules/no-labels.js
+++ b/tools/eslint/lib/rules/no-labels.js
@@ -40,3 +40,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-lone-blocks.js b/tools/eslint/lib/rules/no-lone-blocks.js
index 25d8c34f00e..22fd1ec064f 100644
--- a/tools/eslint/lib/rules/no-lone-blocks.js
+++ b/tools/eslint/lib/rules/no-lone-blocks.js
@@ -1,6 +1,8 @@
/**
* @fileoverview Rule to flag blocks with no reason to exist
* @author Brandon Mills
+ * @copyright 2015 Roberto Vidal. All rights reserved.
+ * @copyright 2014 Brandon Mills. All rights reserved.
*/
"use strict";
@@ -11,15 +13,94 @@
module.exports = function(context) {
- return {
- "BlockStatement": function (node) {
- // Check for any occurrence of BlockStatement > BlockStatement or
- // Program > BlockStatement
- var parent = context.getAncestors().pop();
- if (parent.type === "BlockStatement" || parent.type === "Program") {
- context.report(node, "Block is nested inside another block.");
+ // A stack of lone blocks to be checked for block-level bindings
+ var loneBlocks = [],
+ ruleDef;
+
+ /**
+ * Reports a node as invalid.
+ * @param {ASTNode} node - The node to be reported.
+ * @returns {void}
+ */
+ function report(node) {
+ var parent = context.getAncestors().pop();
+ context.report(node, parent.type === "Program" ?
+ "Block is redundant." :
+ "Nested block is redundant."
+ );
+ }
+
+ /**
+ * Checks for any ocurrence of BlockStatement > BlockStatement or Program > BlockStatement
+ * @returns {boolean} True if the current node is a lone block.
+ */
+ function isLoneBlock() {
+ var parent = context.getAncestors().pop();
+ return parent.type === "BlockStatement" || parent.type === "Program";
+ }
+
+ /**
+ * Checks the enclosing block of the current node for block-level bindings,
+ * and "marks it" as valid if any.
+ * @returns {void}
+ */
+ function markLoneBlock() {
+ if (loneBlocks.length === 0) {
+ return;
+ }
+
+ var block = context.getAncestors().pop();
+
+ if (loneBlocks[loneBlocks.length - 1] === block) {
+ loneBlocks.pop();
+ }
+ }
+
+ // Default rule definition: report all lone blocks
+ ruleDef = {
+ BlockStatement: function(node) {
+ if (isLoneBlock(node)) {
+ report(node);
}
}
};
+ // ES6: report blocks without block-level bindings
+ if (context.ecmaFeatures.blockBindings || context.ecmaFeatures.classes) {
+ ruleDef = {
+ "BlockStatement": function(node) {
+ if (isLoneBlock(node)) {
+ loneBlocks.push(node);
+ }
+ },
+ "BlockStatement:exit": function(node) {
+ if (loneBlocks.length > 0 && loneBlocks[loneBlocks.length - 1] === node) {
+ loneBlocks.pop();
+ report(node);
+ }
+ }
+ };
+ }
+
+ if (context.ecmaFeatures.blockBindings) {
+ ruleDef.VariableDeclaration = function(node) {
+ if (node.kind === "let" || node.kind === "const") {
+ markLoneBlock(node);
+ }
+ };
+
+ ruleDef.FunctionDeclaration = function(node) {
+ if (context.getScope().isStrict) {
+ markLoneBlock(node);
+ }
+ };
+ }
+
+ if (context.ecmaFeatures.classes) {
+ ruleDef.ClassDeclaration = markLoneBlock;
+ }
+
+ return ruleDef;
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-lonely-if.js b/tools/eslint/lib/rules/no-lonely-if.js
index 59d807da30d..0d8ab9124a6 100644
--- a/tools/eslint/lib/rules/no-lonely-if.js
+++ b/tools/eslint/lib/rules/no-lonely-if.js
@@ -26,3 +26,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-loop-func.js b/tools/eslint/lib/rules/no-loop-func.js
index ec68611b72e..e8f5262090b 100644
--- a/tools/eslint/lib/rules/no-loop-func.js
+++ b/tools/eslint/lib/rules/no-loop-func.js
@@ -11,23 +11,6 @@
//------------------------------------------------------------------------------
module.exports = function(context) {
- var loopNodeTypes = [
- "ForStatement",
- "WhileStatement",
- "ForInStatement",
- "ForOfStatement",
- "DoWhileStatement"
- ];
-
- /**
- * Checks if the given node is a loop.
- * @param {ASTNode} node The AST node to check.
- * @returns {boolean} Whether or not the node is a loop.
- */
- function isLoop(node) {
- return loopNodeTypes.indexOf(node.type) > -1;
- }
-
/**
* Reports if the given node has an ancestor node which is a loop.
* @param {ASTNode} node The AST node to check.
@@ -36,7 +19,31 @@ module.exports = function(context) {
function checkForLoops(node) {
var ancestors = context.getAncestors();
- if (ancestors.some(isLoop)) {
+ /**
+ * Checks if the given node is a loop and current context is in the loop.
+ * @param {ASTNode} ancestor The AST node to check.
+ * @param {number} index The index of ancestor in ancestors.
+ * @returns {boolean} Whether or not the node is a loop and current context is in the loop.
+ */
+ function isInLoop(ancestor, index) {
+ switch (ancestor.type) {
+ case "ForStatement":
+ return ancestor.init !== ancestors[index + 1];
+
+ case "ForInStatement":
+ case "ForOfStatement":
+ return ancestor.right !== ancestors[index + 1];
+
+ case "WhileStatement":
+ case "DoWhileStatement":
+ return true;
+
+ default:
+ return false;
+ }
+ }
+
+ if (ancestors.some(isInLoop)) {
context.report(node, "Don't make functions within a loop");
}
}
@@ -47,3 +54,5 @@ module.exports = function(context) {
"FunctionDeclaration": checkForLoops
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-mixed-requires.js b/tools/eslint/lib/rules/no-mixed-requires.js
index d75fc56abbd..fe2309691c0 100644
--- a/tools/eslint/lib/rules/no-mixed-requires.js
+++ b/tools/eslint/lib/rules/no-mixed-requires.js
@@ -157,3 +157,9 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [
+ {
+ "type": "boolean"
+ }
+];
diff --git a/tools/eslint/lib/rules/no-mixed-spaces-and-tabs.js b/tools/eslint/lib/rules/no-mixed-spaces-and-tabs.js
index 7b76d76db99..b6e29bacf21 100644
--- a/tools/eslint/lib/rules/no-mixed-spaces-and-tabs.js
+++ b/tools/eslint/lib/rules/no-mixed-spaces-and-tabs.js
@@ -66,3 +66,9 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [
+ {
+ "enum": ["smart-tabs", true, false]
+ }
+];
diff --git a/tools/eslint/lib/rules/no-multi-spaces.js b/tools/eslint/lib/rules/no-multi-spaces.js
index 9e247c1533d..f4d469859bd 100644
--- a/tools/eslint/lib/rules/no-multi-spaces.js
+++ b/tools/eslint/lib/rules/no-multi-spaces.js
@@ -99,3 +99,21 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [
+ {
+ "type": "object",
+ "properties": {
+ "exceptions": {
+ "type": "object",
+ "patternProperties": {
+ "^([A-Z][a-z]*)+$": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+ }
+];
diff --git a/tools/eslint/lib/rules/no-multi-str.js b/tools/eslint/lib/rules/no-multi-str.js
index 1d4810b97d7..470c65871ea 100644
--- a/tools/eslint/lib/rules/no-multi-str.js
+++ b/tools/eslint/lib/rules/no-multi-str.js
@@ -39,3 +39,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-multiple-empty-lines.js b/tools/eslint/lib/rules/no-multiple-empty-lines.js
index 9cfea63daab..4b293fac301 100644
--- a/tools/eslint/lib/rules/no-multiple-empty-lines.js
+++ b/tools/eslint/lib/rules/no-multiple-empty-lines.js
@@ -15,6 +15,9 @@ module.exports = function(context) {
// Use options.max or 2 as default
var numLines = 2;
+ // store lines that appear empty but really aren't
+ var notEmpty = [];
+
if (context.options.length) {
numLines = context.options[0].max;
}
@@ -25,7 +28,16 @@ module.exports = function(context) {
return {
- "Program": function checkBlankLines(node) {
+ "TemplateLiteral": function(node) {
+ var start = node.loc.start.line;
+ var end = node.loc.end.line;
+ while (start <= end) {
+ notEmpty.push(start);
+ start++;
+ }
+ },
+
+ "Program:exit": function checkBlankLines(node) {
var lines = context.getSourceLines(),
currentLocation = -1,
lastLocation,
@@ -35,8 +47,21 @@ module.exports = function(context) {
return str.trim();
});
+ // add the notEmpty lines in there with a placeholder
+ notEmpty.forEach(function(x, i) {
+ trimmedLines[i] = x;
+ });
+
+ // swallow the final newline, as some editors add it automatically
+ // and we don't want it to cause an issue
+ if (trimmedLines[trimmedLines.length - 1] === "") {
+ trimmedLines = trimmedLines.slice(0, -1);
+ }
+
// Aggregate and count blank lines
- do {
+ lastLocation = currentLocation;
+ currentLocation = trimmedLines.indexOf("", currentLocation + 1);
+ while (currentLocation !== -1) {
lastLocation = currentLocation;
currentLocation = trimmedLines.indexOf("", currentLocation + 1);
if (lastLocation === currentLocation - 1) {
@@ -53,8 +78,21 @@ module.exports = function(context) {
// Finally, reset the blank counter
blankCounter = 0;
}
- } while (currentLocation !== -1);
+ }
}
};
};
+
+module.exports.schema = [
+ {
+ "type": "object",
+ "properties": {
+ "max": {
+ "type": "integer"
+ }
+ },
+ "required": ["max"],
+ "additionalProperties": false
+ }
+];
diff --git a/tools/eslint/lib/rules/no-native-reassign.js b/tools/eslint/lib/rules/no-native-reassign.js
index 29ff4a3836b..1cbbbcbb850 100644
--- a/tools/eslint/lib/rules/no-native-reassign.js
+++ b/tools/eslint/lib/rules/no-native-reassign.js
@@ -11,27 +11,52 @@
module.exports = function(context) {
- var nativeObjects = ["Array", "Boolean", "Date", "decodeURI",
+ var NATIVE_OBJECTS = ["Array", "Boolean", "Date", "decodeURI",
"decodeURIComponent", "encodeURI", "encodeURIComponent",
"Error", "eval", "EvalError", "Function", "isFinite",
"isNaN", "JSON", "Math", "Number", "Object", "parseInt",
"parseFloat", "RangeError", "ReferenceError", "RegExp",
"String", "SyntaxError", "TypeError", "URIError",
"Map", "NaN", "Set", "WeakMap", "Infinity", "undefined"];
+ var config = context.options[0] || {};
+ var exceptions = config.exceptions || [];
+ var modifiedNativeObjects = NATIVE_OBJECTS;
+
+ if (exceptions.length) {
+ modifiedNativeObjects = NATIVE_OBJECTS.filter(function(builtIn) {
+ return exceptions.indexOf(builtIn) === -1;
+ });
+ }
return {
"AssignmentExpression": function(node) {
- if (nativeObjects.indexOf(node.left.name) >= 0) {
+ if (modifiedNativeObjects.indexOf(node.left.name) >= 0) {
context.report(node, node.left.name + " is a read-only native object.");
}
},
"VariableDeclarator": function(node) {
- if (nativeObjects.indexOf(node.id.name) >= 0) {
+ if (modifiedNativeObjects.indexOf(node.id.name) >= 0) {
context.report(node, "Redefinition of '{{nativeObject}}'.", { nativeObject: node.id.name });
}
}
};
};
+
+module.exports.schema = [
+ {
+ "type": "object",
+ "properties": {
+ "exceptions": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "uniqueItems": true
+ }
+ },
+ "additionalProperties": false
+ }
+];
diff --git a/tools/eslint/lib/rules/no-negated-in-lhs.js b/tools/eslint/lib/rules/no-negated-in-lhs.js
index 75bdf731921..7d476a582a8 100644
--- a/tools/eslint/lib/rules/no-negated-in-lhs.js
+++ b/tools/eslint/lib/rules/no-negated-in-lhs.js
@@ -21,3 +21,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-nested-ternary.js b/tools/eslint/lib/rules/no-nested-ternary.js
index 10b0683f952..2686ebd9814 100644
--- a/tools/eslint/lib/rules/no-nested-ternary.js
+++ b/tools/eslint/lib/rules/no-nested-ternary.js
@@ -20,3 +20,5 @@ module.exports = function(context) {
}
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-new-func.js b/tools/eslint/lib/rules/no-new-func.js
index c0e64350ed4..c7900e0c8f4 100644
--- a/tools/eslint/lib/rules/no-new-func.js
+++ b/tools/eslint/lib/rules/no-new-func.js
@@ -21,3 +21,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-new-object.js b/tools/eslint/lib/rules/no-new-object.js
index 426d7129da6..dd1cd10d758 100644
--- a/tools/eslint/lib/rules/no-new-object.js
+++ b/tools/eslint/lib/rules/no-new-object.js
@@ -21,3 +21,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-new-require.js b/tools/eslint/lib/rules/no-new-require.js
index 27d25d22afb..cd2eec562fc 100644
--- a/tools/eslint/lib/rules/no-new-require.js
+++ b/tools/eslint/lib/rules/no-new-require.js
@@ -21,3 +21,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-new-wrappers.js b/tools/eslint/lib/rules/no-new-wrappers.js
index 4dbc60d5b4f..da609572da3 100644
--- a/tools/eslint/lib/rules/no-new-wrappers.js
+++ b/tools/eslint/lib/rules/no-new-wrappers.js
@@ -22,3 +22,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-new.js b/tools/eslint/lib/rules/no-new.js
index 914a6493039..e431d4fb78e 100644
--- a/tools/eslint/lib/rules/no-new.js
+++ b/tools/eslint/lib/rules/no-new.js
@@ -23,3 +23,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-obj-calls.js b/tools/eslint/lib/rules/no-obj-calls.js
index 246720c2c4a..f3845c508fb 100644
--- a/tools/eslint/lib/rules/no-obj-calls.js
+++ b/tools/eslint/lib/rules/no-obj-calls.js
@@ -24,3 +24,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-octal-escape.js b/tools/eslint/lib/rules/no-octal-escape.js
index d6c75a868db..16e58316dda 100644
--- a/tools/eslint/lib/rules/no-octal-escape.js
+++ b/tools/eslint/lib/rules/no-octal-escape.js
@@ -35,3 +35,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-octal.js b/tools/eslint/lib/rules/no-octal.js
index dae4f7fe94c..5a00c9506ec 100644
--- a/tools/eslint/lib/rules/no-octal.js
+++ b/tools/eslint/lib/rules/no-octal.js
@@ -21,3 +21,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-param-reassign.js b/tools/eslint/lib/rules/no-param-reassign.js
index c38f0ef6f4e..c4252465352 100644
--- a/tools/eslint/lib/rules/no-param-reassign.js
+++ b/tools/eslint/lib/rules/no-param-reassign.js
@@ -83,3 +83,5 @@ module.exports = function(context) {
}
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-path-concat.js b/tools/eslint/lib/rules/no-path-concat.js
index b5555891576..c6d512bc0e7 100644
--- a/tools/eslint/lib/rules/no-path-concat.js
+++ b/tools/eslint/lib/rules/no-path-concat.js
@@ -35,3 +35,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-plusplus.js b/tools/eslint/lib/rules/no-plusplus.js
index 268af7ee647..de8e861034d 100644
--- a/tools/eslint/lib/rules/no-plusplus.js
+++ b/tools/eslint/lib/rules/no-plusplus.js
@@ -20,3 +20,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-process-env.js b/tools/eslint/lib/rules/no-process-env.js
index 54a0cb49285..6a5395e5797 100644
--- a/tools/eslint/lib/rules/no-process-env.js
+++ b/tools/eslint/lib/rules/no-process-env.js
@@ -26,3 +26,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-process-exit.js b/tools/eslint/lib/rules/no-process-exit.js
index 84006f2dbd1..a1fa3b29dae 100644
--- a/tools/eslint/lib/rules/no-process-exit.js
+++ b/tools/eslint/lib/rules/no-process-exit.js
@@ -29,3 +29,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-proto.js b/tools/eslint/lib/rules/no-proto.js
index 0ab434c1f54..f91a46afebf 100644
--- a/tools/eslint/lib/rules/no-proto.js
+++ b/tools/eslint/lib/rules/no-proto.js
@@ -24,3 +24,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-redeclare.js b/tools/eslint/lib/rules/no-redeclare.js
index da1b7bff4c2..80a6783ad5a 100644
--- a/tools/eslint/lib/rules/no-redeclare.js
+++ b/tools/eslint/lib/rules/no-redeclare.js
@@ -19,7 +19,6 @@ module.exports = function(context) {
*/
function findVariablesInScope(scope) {
scope.variables.forEach(function(variable) {
-
if (variable.identifiers && variable.identifiers.length > 1) {
variable.identifiers.sort(function(a, b) {
return a.range[1] - b.range[1];
@@ -50,9 +49,20 @@ module.exports = function(context) {
}
}
- return {
- "Program": findVariables,
- "FunctionExpression": findVariables,
- "FunctionDeclaration": findVariables
- };
+ if (context.ecmaFeatures.blockBindings) {
+ return {
+ "Program": findVariables,
+ "BlockStatement": findVariables,
+ "SwitchStatement": findVariables
+ };
+ } else {
+ return {
+ "Program": findVariables,
+ "FunctionDeclaration": findVariables,
+ "FunctionExpression": findVariables,
+ "ArrowFunctionExpression": findVariables
+ };
+ }
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-regex-spaces.js b/tools/eslint/lib/rules/no-regex-spaces.js
index edbf76d5131..0de9a49f35a 100644
--- a/tools/eslint/lib/rules/no-regex-spaces.js
+++ b/tools/eslint/lib/rules/no-regex-spaces.js
@@ -31,3 +31,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-reserved-keys.js b/tools/eslint/lib/rules/no-reserved-keys.js
index d94dcffb974..9165442b594 100644
--- a/tools/eslint/lib/rules/no-reserved-keys.js
+++ b/tools/eslint/lib/rules/no-reserved-keys.js
@@ -52,3 +52,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-restricted-modules.js b/tools/eslint/lib/rules/no-restricted-modules.js
index a4c13517dfb..b2213ea00db 100644
--- a/tools/eslint/lib/rules/no-restricted-modules.js
+++ b/tools/eslint/lib/rules/no-restricted-modules.js
@@ -70,3 +70,16 @@ module.exports = function (context) {
}
};
};
+
+module.exports.schema = {
+ "type": "array",
+ "items": [
+ {
+ "enum": [0, 1, 2]
+ }
+ ],
+ "additionalItems": {
+ "type": "string"
+ },
+ "uniqueItems": true
+};
diff --git a/tools/eslint/lib/rules/no-return-assign.js b/tools/eslint/lib/rules/no-return-assign.js
index 65a751c0e84..d3133357ad1 100644
--- a/tools/eslint/lib/rules/no-return-assign.js
+++ b/tools/eslint/lib/rules/no-return-assign.js
@@ -5,18 +5,49 @@
"use strict";
//------------------------------------------------------------------------------
+// Helpers
+//------------------------------------------------------------------------------
+
+/**
+ * Checks whether or not a node is an `AssignmentExpression`.
+ * @param {Node|null} node - A node to check.
+ * @returns {boolean} Whether or not the node is an `AssignmentExpression`.
+ */
+function isAssignment(node) {
+ return node != null && node.type === "AssignmentExpression";
+}
+
+/**
+ * Checks whether or not a node is enclosed in parentheses.
+ * @param {Node|null} node - A node to check.
+ * @param {RuleContext} context - The current context.
+ * @returns {boolean} Whether or not the node is enclosed in parentheses.
+ */
+function isEnclosedInParens(node, context) {
+ var prevToken = context.getTokenBefore(node);
+ var nextToken = context.getTokenAfter(node);
+
+ return prevToken.value === "(" && nextToken.value === ")";
+}
+
+//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
module.exports = function(context) {
+ var always = (context.options[0] || "except-parens") !== "except-parens";
return {
-
"ReturnStatement": function(node) {
- if (node.argument && node.argument.type === "AssignmentExpression") {
+ if (isAssignment(node.argument) && (always || !isEnclosedInParens(node.argument, context))) {
context.report(node, "Return statement should not contain assignment.");
}
}
};
-
};
+
+module.exports.schema = [
+ {
+ "enum": ["except-parens", "always"]
+ }
+];
diff --git a/tools/eslint/lib/rules/no-script-url.js b/tools/eslint/lib/rules/no-script-url.js
index 9ae9ba1a3ad..72521aecf19 100644
--- a/tools/eslint/lib/rules/no-script-url.js
+++ b/tools/eslint/lib/rules/no-script-url.js
@@ -30,3 +30,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-self-compare.js b/tools/eslint/lib/rules/no-self-compare.js
index dc68c50046f..6d8e11a5950 100644
--- a/tools/eslint/lib/rules/no-self-compare.js
+++ b/tools/eslint/lib/rules/no-self-compare.js
@@ -25,3 +25,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-sequences.js b/tools/eslint/lib/rules/no-sequences.js
index 7edcd40d700..9f7bfe3e7d1 100644
--- a/tools/eslint/lib/rules/no-sequences.js
+++ b/tools/eslint/lib/rules/no-sequences.js
@@ -90,3 +90,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-shadow-restricted-names.js b/tools/eslint/lib/rules/no-shadow-restricted-names.js
index e720a0a1534..ff3d058ce41 100644
--- a/tools/eslint/lib/rules/no-shadow-restricted-names.js
+++ b/tools/eslint/lib/rules/no-shadow-restricted-names.js
@@ -47,3 +47,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-shadow.js b/tools/eslint/lib/rules/no-shadow.js
index 4906fa58f26..060c668d570 100644
--- a/tools/eslint/lib/rules/no-shadow.js
+++ b/tools/eslint/lib/rules/no-shadow.js
@@ -12,6 +12,81 @@
module.exports = function(context) {
+ var options = {
+ hoist: (context.options[0] && context.options[0].hoist) || "functions"
+ };
+
+ /**
+ * Checks if a variable of the class name in the class scope of ClassDeclaration.
+ *
+ * ClassDeclaration creates two variables of its name into its outer scope and its class scope.
+ * So we should ignore the variable in the class scope.
+ *
+ * @param {Object} variable The variable to check.
+ * @returns {boolean} Whether or not the variable of the class name in the class scope of ClassDeclaration.
+ */
+ function isDuplicatedClassNameVariable(variable) {
+ var block = variable.scope.block;
+ return block.type === "ClassDeclaration" && block.id === variable.identifiers[0];
+ }
+
+ /**
+ * Checks if a variable is inside the initializer of scopeVar.
+ *
+ * To avoid reporting at declarations such as `var a = function a() {};`.
+ * But it should report `var a = function(a) {};` or `var a = function() { function a() {} };`.
+ *
+ * @param {Object} variable The variable to check.
+ * @param {Object} scopeVar The scope variable to look for.
+ * @returns {boolean} Whether or not the variable is inside initializer of scopeVar.
+ */
+ function isOnInitializer(variable, scopeVar) {
+ var outerScope = scopeVar.scope;
+ var outerDef = scopeVar.defs[0];
+ var outer = outerDef && outerDef.parent && outerDef.parent.range;
+ var innerScope = variable.scope;
+ var innerDef = variable.defs[0];
+ var inner = innerDef && innerDef.name.range;
+
+ return (
+ outer != null &&
+ inner != null &&
+ outer[0] < inner[0] &&
+ inner[1] < outer[1] &&
+ ((innerDef.type === "FunctionName" && innerDef.node.type === "FunctionExpression") || innerDef.node.type === "ClassExpression") &&
+ outerScope === innerScope.upper
+ );
+ }
+
+ /**
+ * Get a range of a variable's identifier node.
+ * @param {Object} variable The variable to get.
+ * @returns {Array|undefined} The range of the variable's identifier node.
+ */
+ function getNameRange(variable) {
+ var def = variable.defs[0];
+ return def && def.name.range;
+ }
+
+ /**
+ * Checks if a variable is in TDZ of scopeVar.
+ * @param {Object} variable The variable to check.
+ * @param {Object} scopeVar The variable of TDZ.
+ * @returns {boolean} Whether or not the variable is in TDZ of scopeVar.
+ */
+ function isInTdz(variable, scopeVar) {
+ var outerDef = scopeVar.defs[0];
+ var inner = getNameRange(variable);
+ var outer = getNameRange(scopeVar);
+ return (
+ inner != null &&
+ outer != null &&
+ inner[1] < outer[0] &&
+ // Excepts FunctionDeclaration if is {"hoist":"function"}.
+ (options.hoist !== "functions" || outerDef == null || outerDef.node.type !== "FunctionDeclaration")
+ );
+ }
+
/**
* Checks if a variable is contained in the list of given scope variables.
* @param {Object} variable The variable to check.
@@ -20,10 +95,13 @@ module.exports = function(context) {
*/
function isContainedInScopeVars(variable, scopeVars) {
return scopeVars.some(function (scopeVar) {
- if (scopeVar.identifiers.length > 0) {
- return variable.name === scopeVar.name;
- }
- return false;
+ return (
+ scopeVar.identifiers.length > 0 &&
+ variable.name === scopeVar.name &&
+ !isDuplicatedClassNameVariable(scopeVar) &&
+ !isOnInitializer(variable, scopeVar) &&
+ !(options.hoist !== "all" && isInTdz(variable, scopeVar))
+ );
});
}
@@ -31,42 +109,73 @@ module.exports = function(context) {
* Checks if the given variables are shadowed in the given scope.
* @param {Array} variables The variables to look for
* @param {Object} scope The scope to be checked.
- * @returns {void}
+ * @returns {Array} Variables which are not declared in the given scope.
*/
function checkShadowsInScope(variables, scope) {
+
+ var passedVars = [];
+
variables.forEach(function (variable) {
- if (isContainedInScopeVars(variable, scope.variables) &&
- // "arguments" is a special case that has no identifiers (#1759)
- variable.identifiers.length > 0 &&
-
- // function names are exempt
- variable.defs.length && variable.defs[0].type !== "FunctionName"
- ) {
- context.report(variable.identifiers[0], "{{a}} is already declared in the upper scope.", {a: variable.name});
+ // "arguments" is a special case that has no identifiers (#1759)
+ if (variable.identifiers.length > 0 && isContainedInScopeVars(variable, scope.variables)) {
+ context.report(
+ variable.identifiers[0],
+ "{{name}} is already declared in the upper scope.",
+ {name: variable.name});
+ } else {
+ passedVars.push(variable);
}
});
+
+ return passedVars;
}
/**
* Checks the current context for shadowed variables.
+ * @param {Scope} scope - Fixme
* @returns {void}
*/
- function checkForShadows() {
- var scope = context.getScope(),
- variables = scope.variables;
+ function checkForShadows(scope) {
+ var variables = scope.variables.filter(function(variable) {
+ return (
+ // Skip "arguments".
+ variable.identifiers.length > 0 &&
+ // Skip variables of a class name in the class scope of ClassDeclaration.
+ !isDuplicatedClassNameVariable(variable)
+ );
+ });
// iterate through the array of variables and find duplicates with the upper scope
var upper = scope.upper;
- while (upper) {
- checkShadowsInScope(variables, upper);
+ while (upper && variables.length) {
+ variables = checkShadowsInScope(variables, upper);
upper = upper.upper;
}
}
return {
- "FunctionDeclaration": checkForShadows,
- "FunctionExpression": checkForShadows,
- "ArrowFunctionExpression": checkForShadows
+ "Program:exit": function () {
+ var globalScope = context.getScope(),
+ stack = globalScope.childScopes.slice(),
+ scope;
+
+ while (stack.length) {
+ scope = stack.pop();
+ stack.push.apply(stack, scope.childScopes);
+ checkForShadows(scope);
+ }
+ }
};
};
+
+module.exports.schema = [
+ {
+ "type": "object",
+ "properties": {
+ "hoist": {
+ "enum": ["all", "functions", "never"]
+ }
+ }
+ }
+];
diff --git a/tools/eslint/lib/rules/no-space-before-semi.js b/tools/eslint/lib/rules/no-space-before-semi.js
index 33926741e0b..4c2fffd9027 100644
--- a/tools/eslint/lib/rules/no-space-before-semi.js
+++ b/tools/eslint/lib/rules/no-space-before-semi.js
@@ -94,3 +94,5 @@ module.exports = function(context) {
}
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-spaced-func.js b/tools/eslint/lib/rules/no-spaced-func.js
index 7fb9fc28647..cd3e8f975d3 100644
--- a/tools/eslint/lib/rules/no-spaced-func.js
+++ b/tools/eslint/lib/rules/no-spaced-func.js
@@ -33,3 +33,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-sparse-arrays.js b/tools/eslint/lib/rules/no-sparse-arrays.js
index 143097713f0..808ec99bfc1 100644
--- a/tools/eslint/lib/rules/no-sparse-arrays.js
+++ b/tools/eslint/lib/rules/no-sparse-arrays.js
@@ -29,3 +29,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-sync.js b/tools/eslint/lib/rules/no-sync.js
index 1a9d27d637c..c26e003f6ef 100644
--- a/tools/eslint/lib/rules/no-sync.js
+++ b/tools/eslint/lib/rules/no-sync.js
@@ -26,3 +26,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-ternary.js b/tools/eslint/lib/rules/no-ternary.js
index 6ae8e9a272b..79f8576b5fc 100644
--- a/tools/eslint/lib/rules/no-ternary.js
+++ b/tools/eslint/lib/rules/no-ternary.js
@@ -20,3 +20,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-this-before-super.js b/tools/eslint/lib/rules/no-this-before-super.js
new file mode 100644
index 00000000000..bd0836eec78
--- /dev/null
+++ b/tools/eslint/lib/rules/no-this-before-super.js
@@ -0,0 +1,144 @@
+/**
+ * @fileoverview A rule to disallow using `this`/`super` before `super()`.
+ * @author Toru Nagashima
+ * @copyright 2015 Toru Nagashima. All rights reserved.
+ */
+
+"use strict";
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+module.exports = function(context) {
+
+ /**
+ * Searches a class node that a node is belonging to.
+ * @param {Node} node - A node to start searching.
+ * @returns {ClassDeclaration|ClassExpression|null} the found class node, or `null`.
+ */
+ function getClassInAncestor(node) {
+ while (node != null) {
+ if (node.type === "ClassDeclaration" || node.type === "ClassExpression") {
+ return node;
+ }
+ node = node.parent;
+ }
+ /* istanbul ignore next */
+ return null;
+ }
+
+ /**
+ * Checks whether or not a node is the null literal.
+ * @param {Node} node - A node to check.
+ * @returns {boolean} whether or not a node is the null literal.
+ */
+ function isNullLiteral(node) {
+ return node != null && node.type === "Literal" && node.value === null;
+ }
+
+ /**
+ * Checks whether or not a node is the callee of a call expression.
+ * @param {Node} node - A node to check.
+ * @returns {boolean} whether or not a node is the callee of a call expression.
+ */
+ function isCallee(node) {
+ return node != null && node.parent.type === "CallExpression" && node.parent.callee === node;
+ }
+
+ /**
+ * Checks whether or not the current traversal context is before `super()`.
+ * @param {object} item - A checking context.
+ * @returns {boolean} whether or not the current traversal context is before `super()`.
+ */
+ function isBeforeSuperCalling(item) {
+ return (
+ item != null &&
+ item.scope === context.getScope().variableScope.upper.variableScope &&
+ item.superCalled === false
+ );
+ }
+
+ var stack = [];
+
+ return {
+ /**
+ * Start checking.
+ * @param {MethodDefinition} node - A target node.
+ * @returns {void}
+ */
+ "MethodDefinition": function(node) {
+ if (node.kind !== "constructor") {
+ return;
+ }
+ stack.push({
+ thisOrSuperBeforeSuperCalled: [],
+ superCalled: false,
+ scope: context.getScope().variableScope
+ });
+ },
+
+ /**
+ * Treats the result of checking and reports invalid `this`/`super`.
+ * @param {MethodDefinition} node - A target node.
+ * @returns {void}
+ */
+ "MethodDefinition:exit": function(node) {
+ if (node.kind !== "constructor") {
+ return;
+ }
+ var result = stack.pop();
+
+ // Skip if it has no extends or `extends null`.
+ var classNode = getClassInAncestor(node);
+ if (classNode == null || classNode.superClass == null || isNullLiteral(classNode.superClass)) {
+ return;
+ }
+
+ // Reports.
+ result.thisOrSuperBeforeSuperCalled.forEach(function(thisOrSuper) {
+ var type = (thisOrSuper.type === "Super" ? "super" : "this");
+ context.report(thisOrSuper, "\"{{type}}\" is not allowed before super()", {type: type});
+ });
+ },
+
+ /**
+ * Marks the node if is before `super()`.
+ * @param {ThisExpression} node - A target node.
+ * @returns {void}
+ */
+ "ThisExpression": function(node) {
+ var item = stack[stack.length - 1];
+ if (isBeforeSuperCalling(item)) {
+ item.thisOrSuperBeforeSuperCalled.push(node);
+ }
+ },
+
+ /**
+ * Marks the node if is before `super()`. (exclude `super()` itself)
+ * @param {Super} node - A target node.
+ * @returns {void}
+ */
+ "Super": function(node) {
+ var item = stack[stack.length - 1];
+ if (isBeforeSuperCalling(item) && isCallee(node) === false) {
+ item.thisOrSuperBeforeSuperCalled.push(node);
+ }
+ },
+
+ /**
+ * Marks `super()` called.
+ * To catch `super(this.a);`, marks on `CallExpression:exit`.
+ * @param {CallExpression} node - A target node.
+ * @returns {void}
+ */
+ "CallExpression:exit": function(node) {
+ var item = stack[stack.length - 1];
+ if (isBeforeSuperCalling(item) && node.callee.type === "Super") {
+ item.superCalled = true;
+ }
+ }
+ };
+};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-throw-literal.js b/tools/eslint/lib/rules/no-throw-literal.js
index d02e7786b69..a04784ae8f2 100644
--- a/tools/eslint/lib/rules/no-throw-literal.js
+++ b/tools/eslint/lib/rules/no-throw-literal.js
@@ -29,3 +29,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-trailing-spaces.js b/tools/eslint/lib/rules/no-trailing-spaces.js
index d299eb51512..a54cfe8cce8 100644
--- a/tools/eslint/lib/rules/no-trailing-spaces.js
+++ b/tools/eslint/lib/rules/no-trailing-spaces.js
@@ -1,6 +1,7 @@
/**
* @fileoverview Disallow trailing spaces at the end of lines.
* @author Nodeca Team <https://github.com/nodeca>
+ * @copyright 2015 Greg Cochard
*/
"use strict";
@@ -10,7 +11,13 @@
module.exports = function(context) {
- var TRAILER = "[ \t\u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000]+$";
+ var BLANK_CLASS = "[ \t\u00a0\u2000-\u200b\u2028\u2029\u3000]",
+ SKIP_BLANK = "^" + BLANK_CLASS + "*$",
+ NONBLANK = BLANK_CLASS + "$";
+
+ var options = context.options[0] || {},
+ skipBlankLines = options.skipBlankLines || false;
+
//--------------------------------------------------------------------------
// Public
@@ -20,27 +27,48 @@ module.exports = function(context) {
"Program": function checkTrailingSpaces(node) {
- // Let's hack. Since Esprima does not return whitespace nodes,
- // fetch the source code and do black magic via regexps.
+ // Let's hack. Since Espree does not return whitespace nodes,
+ // fetch the source code and do matching via regexps.
var src = context.getSource(),
- re = new RegExp(TRAILER, "mg"),
- match, lines, location;
+ re = new RegExp(NONBLANK),
+ skipMatch = new RegExp(SKIP_BLANK),
+ matches, lines = src.split(/\r?\n/), location;
+
+ for (var i = 0, ii = lines.length; i < ii; i++) {
- while ((match = re.exec(src)) !== null) {
- lines = src.slice(0, re.lastIndex).split(/\r?\n/g);
+ matches = re.exec(lines[i]);
+ if (matches) {
- location = {
- line: lines.length,
- column: lines[lines.length - 1].length - match[0].length + 1
- };
+ // If the line has only whitespace, and skipBlankLines
+ // is true, don't report it
+ if (skipBlankLines && skipMatch.test(lines[i])) {
+ continue;
+ }
+ location = {
+ line: i + 1,
+ column: lines[i].length - matches[0].length + 1
+ };
- // Passing node is a bit dirty, because message data will contain
- // big text in `source`. But... who cares :) ?
- // One more kludge will not make worse the bloody wizardry of this plugin.
- context.report(node, location, "Trailing spaces not allowed.");
+ // Passing node is a bit dirty, because message data will contain
+ // big text in `source`. But... who cares :) ?
+ // One more kludge will not make worse the bloody wizardry of this plugin.
+ context.report(node, location, "Trailing spaces not allowed.");
+ }
}
}
};
};
+
+module.exports.schema = [
+ {
+ "type": "object",
+ "properties": {
+ "skipBlankLines": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+];
diff --git a/tools/eslint/lib/rules/no-undef-init.js b/tools/eslint/lib/rules/no-undef-init.js
index 60ad5700f87..fc08c9b5088 100644
--- a/tools/eslint/lib/rules/no-undef-init.js
+++ b/tools/eslint/lib/rules/no-undef-init.js
@@ -24,3 +24,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-undef.js b/tools/eslint/lib/rules/no-undef.js
index 5ee07f31247..7e15cfaf21d 100644
--- a/tools/eslint/lib/rules/no-undef.js
+++ b/tools/eslint/lib/rules/no-undef.js
@@ -88,3 +88,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-undefined.js b/tools/eslint/lib/rules/no-undefined.js
index 4d96eb3e925..222be573d22 100644
--- a/tools/eslint/lib/rules/no-undefined.js
+++ b/tools/eslint/lib/rules/no-undefined.js
@@ -23,3 +23,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-underscore-dangle.js b/tools/eslint/lib/rules/no-underscore-dangle.js
index 354c1e4cda2..38ad52f74fc 100644
--- a/tools/eslint/lib/rules/no-underscore-dangle.js
+++ b/tools/eslint/lib/rules/no-underscore-dangle.js
@@ -69,3 +69,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-unexpected-multiline.js b/tools/eslint/lib/rules/no-unexpected-multiline.js
new file mode 100644
index 00000000000..202182c3500
--- /dev/null
+++ b/tools/eslint/lib/rules/no-unexpected-multiline.js
@@ -0,0 +1,58 @@
+/**
+ * @fileoverview Rule to spot scenarios where a newline looks like it is ending a statement, but is not.
+ * @author Glen Mailer
+ * @copyright 2015 Glen Mailer
+ */
+"use strict";
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+module.exports = function(context) {
+
+ var FUNCTION_MESSAGE = "Unexpected newline between function and ( of function call.";
+ var PROPERTY_MESSAGE = "Unexpected newline between object and [ of property access.";
+
+ /**
+ * Check to see if the bracket prior to the node is continuing the previous
+ * line's expression
+ * @param {ASTNode} node The node to check.
+ * @param {string} msg The error message to use.
+ * @returns {void}
+ * @private
+ */
+ function checkForBreakBefore(node, msg) {
+ var tokens = context.getTokensBefore(node, 2);
+ var paren = tokens[1];
+ var before = tokens[0];
+ if (paren.loc.start.line !== before.loc.end.line) {
+ context.report(node, paren.loc.start, msg, { char: paren.value });
+ }
+ }
+
+ //--------------------------------------------------------------------------
+ // Public API
+ //--------------------------------------------------------------------------
+
+ return {
+
+ "MemberExpression": function(node) {
+ if (!node.computed) {
+ return;
+ }
+
+ checkForBreakBefore(node.property, PROPERTY_MESSAGE);
+ },
+
+ "CallExpression": function(node) {
+ if (node.arguments.length === 0) {
+ return;
+ }
+
+ checkForBreakBefore(node.arguments[0], FUNCTION_MESSAGE);
+ }
+ };
+
+};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-unneeded-ternary.js b/tools/eslint/lib/rules/no-unneeded-ternary.js
new file mode 100644
index 00000000000..6aa94467313
--- /dev/null
+++ b/tools/eslint/lib/rules/no-unneeded-ternary.js
@@ -0,0 +1,48 @@
+/**
+ * @fileoverview Rule to flag no-unneeded-ternary
+ * @author Gyandeep Singh
+ * @copyright 2015 Gyandeep Singh. All rights reserved.
+ * @copyright 2015 Michael Ficarra. All rights reserved.
+ */
+
+"use strict";
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+module.exports = function(context) {
+
+ /**
+ * Reports an AST node as a rule violation.
+ * @param {ASTNode} mainNode The node to report.
+ * @param {object} culpritNode - The token which has a problem
+ * @returns {void}
+ * @private
+ */
+ function report(mainNode, culpritNode) {
+ context.report(mainNode, culpritNode.loc.start, "Unnecessary use of boolean literals in conditional expression");
+ }
+
+ /**
+ * Test if the node is a boolean literal
+ * @param {ASTNode} node - The node to report.
+ * @returns {boolean} True if the its a boolean literal
+ * @private
+ */
+ function isBooleanLiteral(node) {
+ return node.type === "Literal" && typeof node.value === "boolean";
+ }
+
+ return {
+
+ "ConditionalExpression": function(node) {
+
+ if (isBooleanLiteral(node.alternate) && isBooleanLiteral(node.consequent)) {
+ report(node, node.consequent);
+ }
+ }
+ };
+};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-unreachable.js b/tools/eslint/lib/rules/no-unreachable.js
index 6606b6adae8..1f169a64d53 100644
--- a/tools/eslint/lib/rules/no-unreachable.js
+++ b/tools/eslint/lib/rules/no-unreachable.js
@@ -94,3 +94,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-unused-expressions.js b/tools/eslint/lib/rules/no-unused-expressions.js
index 7036f90e7c7..f78cf30196b 100644
--- a/tools/eslint/lib/rules/no-unused-expressions.js
+++ b/tools/eslint/lib/rules/no-unused-expressions.js
@@ -72,3 +72,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-unused-vars.js b/tools/eslint/lib/rules/no-unused-vars.js
index d6ec43bf1d6..6b3b7f334e2 100644
--- a/tools/eslint/lib/rules/no-unused-vars.js
+++ b/tools/eslint/lib/rules/no-unused-vars.js
@@ -27,9 +27,14 @@ module.exports = function(context) {
}
}
+ //--------------------------------------------------------------------------
+ // Helpers
+ //--------------------------------------------------------------------------
+
+
/**
* Determines if a given variable is being exported from a module.
- * @param {Variable} variable EScope variable object.
+ * @param {Variable} variable - EScope variable object.
* @returns {boolean} True if the variable is exported, false if not.
* @private
*/
@@ -39,12 +44,14 @@ module.exports = function(context) {
if (definition) {
- definition = definition.node;
- if (definition.type === "VariableDeclarator") {
- definition = definition.parent;
+ var node = definition.node;
+ if (node.type === "VariableDeclarator") {
+ node = node.parent;
+ } else if (definition.type === "Parameter" && node.type === "FunctionDeclaration") {
+ return false;
}
- return definition.parent.type.indexOf("Export") === 0;
+ return node.parent.type.indexOf("Export") === 0;
} else {
return false;
}
@@ -52,7 +59,7 @@ module.exports = function(context) {
/**
* Determines if a reference is a read operation.
- * @param {Reference} ref - an escope Reference
+ * @param {Reference} ref - An escope Reference
* @returns {Boolean} whether the given reference represents a read operation
* @private
*/
@@ -61,120 +68,185 @@ module.exports = function(context) {
}
/**
- * Determine if an identifier is referencing the enclosing function name.
- * @param {Reference} ref The reference to check.
+ * Determine if an identifier is referencing an enclosing function name.
+ * @param {Reference} ref - The reference to check.
+ * @param {ASTNode[]} nodes - The candidate function nodes.
* @returns {boolean} True if it's a self-reference, false if not.
* @private
*/
- function isSelfReference(ref) {
+ function isSelfReference(ref, nodes) {
+ var scope = ref.from;
+
+ while (scope != null) {
+ if (nodes.indexOf(scope.block) >= 0) {
+ return true;
+ }
- if (ref.from.type === "function" && ref.from.block.id) {
- return ref.identifier.name === ref.from.block.id.name;
+ scope = scope.upper;
}
return false;
}
/**
- * Determines if a reference should be counted as a read. A reference should
- * be counted only if it's a read and it's not a reference to the containing
- * function declaration name.
- * @param {Reference} ref The reference to check.
- * @returns {boolean} True if it's a value read reference, false if not.
+ * Determines if the variable is used.
+ * @param {Variable} variable - The variable to check.
+ * @param {Reference[]} references - The variable references to check.
+ * @returns {boolean} True if the variable is used
+ */
+ function isUsedVariable(variable, references) {
+ var functionNodes = variable.defs.filter(function (def) {
+ return def.type === "FunctionName";
+ }).map(function (def) {
+ return def.node;
+ }),
+ isFunctionDefinition = functionNodes.length > 0;
+
+ return references.some(function (ref) {
+ return isReadRef(ref) && !(isFunctionDefinition && isSelfReference(ref, functionNodes));
+ });
+ }
+
+ /**
+ * Gets unresolved references.
+ * They contains var's, function's, and explicit global variable's.
+ * If `config.vars` is not "all", returns empty map.
+ * @param {Scope} scope - the global scope.
+ * @returns {object} Unresolved references. Keys of the object is its variable name. Values of the object is an array of its references.
* @private
*/
- function isValidReadRef(ref) {
- return isReadRef(ref) && !isSelfReference(ref);
+ function collectUnresolvedReferences(scope) {
+ var unresolvedRefs = Object.create(null);
+
+ if (config.vars === "all") {
+ for (var i = 0, l = scope.through.length; i < l; ++i) {
+ var ref = scope.through[i];
+ var name = ref.identifier.name;
+
+ if (isReadRef(ref)) {
+ if (!unresolvedRefs[name]) {
+ unresolvedRefs[name] = [];
+ }
+ unresolvedRefs[name].push(ref);
+ }
+ }
+ }
+
+ return unresolvedRefs;
}
/**
- * Gets an array of local variables without read references.
- * @param {Scope} scope - an escope Scope object
- * @returns {Variable[]} most of the local variables with no read references
+ * Gets an array of variables without read references.
+ * @param {Scope} scope - an escope Scope object.
+ * @param {object} unresolvedRefs - a map of each variable name and its references.
+ * @param {Variable[]} unusedVars - an array that saving result.
+ * @returns {Variable[]} unused variables of the scope and descendant scopes.
* @private
*/
- function getUnusedLocals(scope) {
- var unused = [];
+ function collectUnusedVariables(scope, unresolvedRefs, unusedVars) {
var variables = scope.variables;
+ var childScopes = scope.childScopes;
+ var i, l;
- if (scope.type !== "global" && scope.type !== "TDZ") {
- for (var i = 0, l = variables.length; i < l; ++i) {
+ if (scope.type !== "TDZ" && (scope.type !== "global" || config.vars === "all")) {
+ for (i = 0, l = variables.length; i < l; ++i) {
+ var variable = variables[i];
+ // skip a variable of class itself name in the class scope
+ if (scope.type === "class" && scope.block.id === variable.identifiers[0]) {
+ continue;
+ }
// skip function expression names
- if (scope.functionExpressionScope || variables[i].eslintUsed) {
+ if (scope.functionExpressionScope || variable.eslintUsed) {
continue;
}
// skip implicit "arguments" variable
- if (scope.type === "function" && variables[i].name === "arguments" && variables[i].identifiers.length === 0) {
+ if (scope.type === "function" && variable.name === "arguments" && variable.identifiers.length === 0) {
continue;
}
- var def = variables[i].defs[0],
- type = def.type;
+ // explicit global variables don't have definitions.
+ var def = variable.defs[0];
+ if (def != null) {
+ var type = def.type;
- // skip catch variables
- if (type === "CatchClause") {
- continue;
- }
+ // skip catch variables
+ if (type === "CatchClause") {
+ continue;
+ }
- // skip any setter argument
- if (type === "Parameter" && def.node.parent.type === "Property" && def.node.parent.kind === "set") {
- continue;
- }
+ // skip any setter argument
+ if (type === "Parameter" && def.node.parent.type === "Property" && def.node.parent.kind === "set") {
+ continue;
+ }
- // if "args" option is "none", skip any parameter
- if (config.args === "none" && type === "Parameter") {
- continue;
- }
+ // if "args" option is "none", skip any parameter
+ if (config.args === "none" && type === "Parameter") {
+ continue;
+ }
- // if "args" option is "after-used", skip all but the last parameter
- if (config.args === "after-used" && type === "Parameter" && variables[i].defs[0].index < variables[i].defs[0].node.params.length - 1) {
- continue;
+ // if "args" option is "after-used", skip all but the last parameter
+ if (config.args === "after-used" && type === "Parameter" && def.index < def.node.params.length - 1) {
+ continue;
+ }
}
- if (variables[i].references.filter(isValidReadRef).length === 0 && !isExported(variables[i])) {
- unused.push(variables[i]);
+ // On global, variables without let/const/class are unresolved.
+ var references = (scope.type === "global" ? unresolvedRefs[variable.name] : null) || variable.references;
+ if (!isUsedVariable(variable, references) && !isExported(variable)) {
+ unusedVars.push(variable);
}
}
}
- return [].concat.apply(unused, scope.childScopes.map(getUnusedLocals));
+ for (i = 0, l = childScopes.length; i < l; ++i) {
+ collectUnusedVariables(childScopes[i], unresolvedRefs, unusedVars);
+ }
+
+ return unusedVars;
}
+ //--------------------------------------------------------------------------
+ // Public
+ //--------------------------------------------------------------------------
+
return {
"Program:exit": function(programNode) {
var globalScope = context.getScope();
- var unused = getUnusedLocals(globalScope);
- var i, l;
-
- // determine unused globals
- if (config.vars === "all") {
- var unresolvedRefs = globalScope.through.filter(isValidReadRef).map(function(ref) {
- return ref.identifier.name;
- });
-
- for (i = 0, l = globalScope.variables.length; i < l; ++i) {
- if (unresolvedRefs.indexOf(globalScope.variables[i].name) < 0 &&
- !globalScope.variables[i].eslintUsed && !isExported(globalScope.variables[i])) {
- unused.push(globalScope.variables[i]);
- }
- }
- }
+ var unresolvedRefs = collectUnresolvedReferences(globalScope);
+ var unusedVars = collectUnusedVariables(globalScope, unresolvedRefs, []);
- for (i = 0, l = unused.length; i < l; ++i) {
- if (unused[i].eslintExplicitGlobal) {
- context.report(programNode, MESSAGE, unused[i]);
- } else if (unused[i].defs.length > 0) {
-
- // TODO: Remove when https://github.com/estools/escope/issues/49 is resolved
- if (unused[i].defs[0].type === "ClassName") {
- continue;
- }
+ for (var i = 0, l = unusedVars.length; i < l; ++i) {
+ var unusedVar = unusedVars[i];
- context.report(unused[i].identifiers[0], MESSAGE, unused[i]);
+ if (unusedVar.eslintExplicitGlobal) {
+ context.report(programNode, MESSAGE, unusedVar);
+ } else if (unusedVar.defs.length > 0) {
+ context.report(unusedVar.identifiers[0], MESSAGE, unusedVar);
}
}
}
};
};
+
+module.exports.schema = [
+ {
+ "oneOf": [
+ {
+ "enum": ["all", "local"]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "vars": {
+ "enum": ["all", "local"]
+ },
+ "args": {
+ "enum": ["all", "after-used", "none"]
+ }
+ }
+ }
+ ]
+ }
+];
diff --git a/tools/eslint/lib/rules/no-use-before-define.js b/tools/eslint/lib/rules/no-use-before-define.js
index 3f175dc78b6..baf0780e711 100644
--- a/tools/eslint/lib/rules/no-use-before-define.js
+++ b/tools/eslint/lib/rules/no-use-before-define.js
@@ -18,6 +18,13 @@ var NO_FUNC = "nofunc";
module.exports = function(context) {
+ /**
+ * Finds variable declarations in a given scope.
+ * @param {string} name The variable name to find.
+ * @param {Scope} scope The scope to search in.
+ * @returns {Object} The variable declaration object.
+ * @private
+ */
function findDeclaration(name, scope) {
// try searching in the current scope first
for (var i = 0, l = scope.variables.length; i < l; i++) {
@@ -31,8 +38,13 @@ module.exports = function(context) {
}
}
- function findVariables() {
- var scope = context.getScope();
+ /**
+ * Finds and validates all variables in a given scope.
+ * @param {Scope} scope The scope object.
+ * @returns {void}
+ * @private
+ */
+ function findVariablesInScope(scope) {
var typeOption = context.options[0];
function checkLocationAndReport(reference, declaration) {
@@ -58,10 +70,36 @@ module.exports = function(context) {
});
}
+
+ /**
+ * Validates variables inside of a node's scope.
+ * @param {ASTNode} node The node to check.
+ * @returns {void}
+ * @private
+ */
+ function findVariables() {
+ var scope = context.getScope();
+ findVariablesInScope(scope);
+ }
+
return {
- "Program": findVariables,
+ "Program": function() {
+ var scope = context.getScope();
+ findVariablesInScope(scope);
+
+ // both Node.js and Modules have an extra scope
+ if (context.ecmaFeatures.globalReturn || context.ecmaFeatures.modules) {
+ findVariablesInScope(scope.childScopes[0]);
+ }
+ },
"FunctionExpression": findVariables,
"FunctionDeclaration": findVariables,
"ArrowFunctionExpression": findVariables
};
};
+
+module.exports.schema = [
+ {
+ "enum": ["nofunc"]
+ }
+];
diff --git a/tools/eslint/lib/rules/no-var.js b/tools/eslint/lib/rules/no-var.js
index 6b47b3dab06..53d9cc27ae1 100644
--- a/tools/eslint/lib/rules/no-var.js
+++ b/tools/eslint/lib/rules/no-var.js
@@ -22,3 +22,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-void.js b/tools/eslint/lib/rules/no-void.js
index 11c54af7fc0..858304dd1d5 100644
--- a/tools/eslint/lib/rules/no-void.js
+++ b/tools/eslint/lib/rules/no-void.js
@@ -24,3 +24,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-warning-comments.js b/tools/eslint/lib/rules/no-warning-comments.js
index 58b6764ff1f..5e842bc754f 100644
--- a/tools/eslint/lib/rules/no-warning-comments.js
+++ b/tools/eslint/lib/rules/no-warning-comments.js
@@ -82,3 +82,21 @@ module.exports = function (context) {
"LineComment": checkComment
};
};
+
+module.exports.schema = [
+ {
+ "type": "object",
+ "properties": {
+ "terms": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "location": {
+ "enum": ["start", "anywhere"]
+ }
+ },
+ "additionalProperties": false
+ }
+];
diff --git a/tools/eslint/lib/rules/no-with.js b/tools/eslint/lib/rules/no-with.js
index 1b889dc5f45..beec2554db2 100644
--- a/tools/eslint/lib/rules/no-with.js
+++ b/tools/eslint/lib/rules/no-with.js
@@ -18,3 +18,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/no-wrap-func.js b/tools/eslint/lib/rules/no-wrap-func.js
index a99c09ee384..d69a743c98e 100644
--- a/tools/eslint/lib/rules/no-wrap-func.js
+++ b/tools/eslint/lib/rules/no-wrap-func.js
@@ -19,7 +19,7 @@ module.exports = function(context) {
* @private
*/
function checkFunction(node) {
- var previousToken, nextToken;
+ var previousToken, nextToken, isCall;
if (node.type === "ArrowFunctionExpression" &&
/(?:Call|New|Logical|Binary|Conditional|Update)Expression/.test(node.parent.type)
@@ -27,13 +27,32 @@ module.exports = function(context) {
return;
}
- if (!/CallExpression|NewExpression/.test(node.parent.type)) {
- previousToken = context.getTokenBefore(node);
- nextToken = context.getTokenAfter(node);
- if (previousToken.value === "(" && nextToken.value === ")") {
- context.report(node, "Wrapping non-IIFE function literals in parens is unnecessary.");
+ // (function() {}).foo
+ if (node.parent.type === "MemberExpression" && node.parent.object === node) {
+ return;
+ }
+
+ // (function(){})()
+ isCall = /CallExpression|NewExpression/.test(node.parent.type);
+ if (isCall && node.parent.callee === node) {
+ return;
+ }
+
+ previousToken = context.getTokenBefore(node);
+ nextToken = context.getTokenAfter(node);
+
+ // f(function(){}) and new f(function(){})
+ if (isCall) {
+
+ // if the previousToken is right after the callee
+ if (node.parent.callee.range[1] === previousToken.range[0]) {
+ return;
}
}
+
+ if (previousToken.value === "(" && nextToken.value === ")") {
+ context.report(node, "Wrapping non-IIFE function literals in parens is unnecessary.");
+ }
}
return {
@@ -42,3 +61,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/object-curly-spacing.js b/tools/eslint/lib/rules/object-curly-spacing.js
new file mode 100644
index 00000000000..d4d200d36ee
--- /dev/null
+++ b/tools/eslint/lib/rules/object-curly-spacing.js
@@ -0,0 +1,231 @@
+/**
+ * @fileoverview Disallows or enforces spaces inside of object literals.
+ * @author Jamund Ferguson
+ * @copyright 2014 Brandyn Bennett. All rights reserved.
+ * @copyright 2014 Michael Ficarra. No rights reserved.
+ * @copyright 2014 Vignesh Anand. All rights reserved.
+ * @copyright 2015 Jamund Ferguson. All rights reserved.
+ */
+"use strict";
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+module.exports = function(context) {
+ var spaced = context.options[0] === "always";
+
+ /**
+ * Determines whether an option is set, relative to the spacing option.
+ * If spaced is "always", then check whether option is set to false.
+ * If spaced is "never", then check whether option is set to true.
+ * @param {Object} option - The option to exclude.
+ * @returns {boolean} Whether or not the property is excluded.
+ */
+ function isOptionSet(option) {
+ return context.options[1] != null ? context.options[1][option] === !spaced : false;
+ }
+
+ var options = {
+ spaced: spaced,
+ arraysInObjectsException: isOptionSet("arraysInObjects"),
+ objectsInObjectsException: isOptionSet("objectsInObjects")
+ };
+
+ //--------------------------------------------------------------------------
+ // Helpers
+ //--------------------------------------------------------------------------
+
+ /**
+ * Determines whether two adjacent tokens are have whitespace between them.
+ * @param {Object} left - The left token object.
+ * @param {Object} right - The right token object.
+ * @returns {boolean} Whether or not there is space between the tokens.
+ */
+ function isSpaced(left, right) {
+ return left.range[1] < right.range[0];
+ }
+
+ /**
+ * Determines whether two adjacent tokens are on the same line.
+ * @param {Object} left - The left token object.
+ * @param {Object} right - The right token object.
+ * @returns {boolean} Whether or not the tokens are on the same line.
+ */
+ function isSameLine(left, right) {
+ return left.loc.start.line === right.loc.start.line;
+ }
+
+ /**
+ * Reports that there shouldn't be a space after the first token
+ * @param {ASTNode} node - The node to report in the event of an error.
+ * @param {Token} token - The token to use for the report.
+ * @returns {void}
+ */
+ function reportNoBeginningSpace(node, token) {
+ context.report(node, token.loc.start,
+ "There should be no space after '" + token.value + "'");
+ }
+
+ /**
+ * Reports that there shouldn't be a space before the last token
+ * @param {ASTNode} node - The node to report in the event of an error.
+ * @param {Token} token - The token to use for the report.
+ * @returns {void}
+ */
+ function reportNoEndingSpace(node, token) {
+ context.report(node, token.loc.start,
+ "There should be no space before '" + token.value + "'");
+ }
+
+ /**
+ * Reports that there should be a space after the first token
+ * @param {ASTNode} node - The node to report in the event of an error.
+ * @param {Token} token - The token to use for the report.
+ * @returns {void}
+ */
+ function reportRequiredBeginningSpace(node, token) {
+ context.report(node, token.loc.start,
+ "A space is required after '" + token.value + "'");
+ }
+
+ /**
+ * Reports that there should be a space before the last token
+ * @param {ASTNode} node - The node to report in the event of an error.
+ * @param {Token} token - The token to use for the report.
+ * @returns {void}
+ */
+ function reportRequiredEndingSpace(node, token) {
+ context.report(node, token.loc.start,
+ "A space is required before '" + token.value + "'");
+ }
+
+ /**
+ * Determines if spacing in curly braces is valid.
+ * @param {ASTNode} node The AST node to check.
+ * @param {Token} first The first token to check (should be the opening brace)
+ * @param {Token} second The second token to check (should be first after the opening brace)
+ * @param {Token} penultimate The penultimate token to check (should be last before closing brace)
+ * @param {Token} last The last token to check (should be closing brace)
+ * @returns {void}
+ */
+ function validateBraceSpacing(node, first, second, penultimate, last) {
+ var closingCurlyBraceMustBeSpaced =
+ options.arraysInObjectsException && penultimate.value === "]" ||
+ options.objectsInObjectsException && penultimate.value === "}"
+ ? !options.spaced : options.spaced;
+
+ if (isSameLine(first, second)) {
+ if (options.spaced && !isSpaced(first, second)) {
+ reportRequiredBeginningSpace(node, first);
+ }
+ if (!options.spaced && isSpaced(first, second)) {
+ reportNoBeginningSpace(node, first);
+ }
+ }
+
+ if (isSameLine(penultimate, last)) {
+ if (closingCurlyBraceMustBeSpaced && !isSpaced(penultimate, last)) {
+ reportRequiredEndingSpace(node, last);
+ }
+ if (!closingCurlyBraceMustBeSpaced && isSpaced(penultimate, last)) {
+ reportNoEndingSpace(node, last);
+ }
+ }
+ }
+
+ //--------------------------------------------------------------------------
+ // Public
+ //--------------------------------------------------------------------------
+
+ return {
+
+ // var {x} = y;
+ ObjectPattern: function(node) {
+ var firstSpecifier = node.properties[0],
+ lastSpecifier = node.properties[node.properties.length - 1];
+
+ var first = context.getTokenBefore(firstSpecifier),
+ second = context.getFirstToken(firstSpecifier),
+ penultimate = context.getLastToken(lastSpecifier),
+ last = context.getTokenAfter(lastSpecifier);
+
+ // support trailing commas
+ if (last.value === ",") {
+ penultimate = last;
+ last = context.getTokenAfter(last);
+ }
+
+ validateBraceSpacing(node, first, second, penultimate, last);
+ },
+
+ // import {y} from 'x';
+ ImportDeclaration: function(node) {
+
+ var firstSpecifier = node.specifiers[0],
+ lastSpecifier = node.specifiers[node.specifiers.length - 1];
+
+ // don't do anything for namespace or default imports
+ if (firstSpecifier && lastSpecifier && firstSpecifier.type === "ImportSpecifier" && lastSpecifier.type === "ImportSpecifier") {
+ var first = context.getTokenBefore(firstSpecifier),
+ second = context.getFirstToken(firstSpecifier),
+ penultimate = context.getLastToken(lastSpecifier),
+ last = context.getTokenAfter(lastSpecifier);
+
+ validateBraceSpacing(node, first, second, penultimate, last);
+ }
+
+ },
+
+ // export {name} from 'yo';
+ ExportNamedDeclaration: function(node) {
+ if (!node.specifiers.length) {
+ return;
+ }
+
+ var firstSpecifier = node.specifiers[0],
+ lastSpecifier = node.specifiers[node.specifiers.length - 1],
+ first = context.getTokenBefore(firstSpecifier),
+ second = context.getFirstToken(firstSpecifier),
+ penultimate = context.getLastToken(lastSpecifier),
+ last = context.getTokenAfter(lastSpecifier);
+
+ validateBraceSpacing(node, first, second, penultimate, last);
+
+ },
+
+ // var y = {x: 'y'}
+ ObjectExpression: function(node) {
+ if (node.properties.length === 0) {
+ return;
+ }
+
+ var first = context.getFirstToken(node),
+ second = context.getFirstToken(node, 1),
+ penultimate = context.getLastToken(node, 1),
+ last = context.getLastToken(node);
+
+ validateBraceSpacing(node, first, second, penultimate, last);
+ }
+
+ };
+
+};
+
+module.exports.schema = [
+ {
+ "enum": ["always", "never"]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "arraysInObjects": {
+ "type": "boolean"
+ },
+ "objectsInObjects": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+];
diff --git a/tools/eslint/lib/rules/object-shorthand.js b/tools/eslint/lib/rules/object-shorthand.js
index 548c9245d68..6244332e4f7 100644
--- a/tools/eslint/lib/rules/object-shorthand.js
+++ b/tools/eslint/lib/rules/object-shorthand.js
@@ -44,20 +44,30 @@ module.exports = function(context) {
return;
}
- if (node.value.type === "ArrowFunctionExpression" && APPLY_TO_METHODS) {
+ if (node.kind === "get" || node.kind === "set") {
+ return;
+ }
- // {x: ()=>{}} should be written as {x() {}}
- context.report(node, "Expected method shorthand.");
- } else if (node.value.type === "FunctionExpression" && APPLY_TO_METHODS) {
+ if (node.value.type === "FunctionExpression" && node.value.id == null && APPLY_TO_METHODS) {
// {x: function(){}} should be written as {x() {}}
context.report(node, "Expected method shorthand.");
- } else if (node.key.name === node.value.name && APPLY_TO_PROPS) {
+ } else if (node.value.type === "Identifier" && node.key.name === node.value.name && APPLY_TO_PROPS) {
// {x: x} should be written as {x}
context.report(node, "Expected property shorthand.");
+ } else if (node.value.type === "Identifier" && node.key.type === "Literal" && node.key.value === node.value.name && APPLY_TO_PROPS) {
+
+ // {"x": x} should be written as {x}
+ context.report(node, "Expected property shorthand.");
}
}
};
};
+
+module.exports.schema = [
+ {
+ "enum": ["always", "methods", "properties", "never"]
+ }
+];
diff --git a/tools/eslint/lib/rules/one-var.js b/tools/eslint/lib/rules/one-var.js
index fd28522f0fa..1457e826ccc 100644
--- a/tools/eslint/lib/rules/one-var.js
+++ b/tools/eslint/lib/rules/one-var.js
@@ -1,6 +1,7 @@
/**
- * @fileoverview A rule to ensure the use of a single variable declaration.
+ * @fileoverview A rule to control the use of single variable declarations.
* @author Ian Christian Myers
+ * @copyright 2015 Ian VanSchooten. All rights reserved.
* @copyright 2015 Joey Baker. All rights reserved.
* @copyright 2015 Danny Fritz. All rights reserved.
* @copyright 2013 Ian Christian Myers. All rights reserved.
@@ -14,16 +15,56 @@
module.exports = function(context) {
- var MODE = context.options[0] || "always";
- var options = {};
+ var MODE_ALWAYS = "always",
+ MODE_NEVER = "never";
- // simple options configuration with just a string or no option
- if (typeof context.options[0] === "string" || context.options[0] == null) {
- options.var = MODE;
- options.let = MODE;
- options.const = MODE;
- } else {
- options = context.options[0];
+ var mode = context.options[0];
+
+ var options = {
+ };
+
+ if (typeof mode === "string") { // simple options configuration with just a string
+ options.var = { uninitialized: mode, initialized: mode};
+ options.let = { uninitialized: mode, initialized: mode};
+ options.const = { uninitialized: mode, initialized: mode};
+ } else if (typeof mode === "object") { // options configuration is an object
+ if (mode.hasOwnProperty("var") && typeof mode.var === "string") {
+ options.var = { uninitialized: mode.var, initialized: mode.var};
+ }
+ if (mode.hasOwnProperty("let") && typeof mode.let === "string") {
+ options.let = { uninitialized: mode.let, initialized: mode.let};
+ }
+ if (mode.hasOwnProperty("const") && typeof mode.const === "string") {
+ options.const = { uninitialized: mode.const, initialized: mode.const};
+ }
+ if (mode.hasOwnProperty("uninitialized")) {
+ if (!options.var) {
+ options.var = {};
+ }
+ if (!options.let) {
+ options.let = {};
+ }
+ if (!options.const) {
+ options.const = {};
+ }
+ options.var.uninitialized = mode.uninitialized;
+ options.let.uninitialized = mode.uninitialized;
+ options.const.uninitialized = mode.uninitialized;
+ }
+ if (mode.hasOwnProperty("initialized")) {
+ if (!options.var) {
+ options.var = {};
+ }
+ if (!options.let) {
+ options.let = {};
+ }
+ if (!options.const) {
+ options.const = {};
+ }
+ options.var.initialized = mode.initialized;
+ options.let.initialized = mode.initialized;
+ options.const.initialized = mode.initialized;
+ }
}
//--------------------------------------------------------------------------
@@ -39,7 +80,10 @@ module.exports = function(context) {
* @private
*/
function startBlock() {
- blockStack.push({let: false, const: false});
+ blockStack.push({
+ let: {initialized: false, uninitialized: false},
+ const: {initialized: false, uninitialized: false}
+ });
}
/**
@@ -48,7 +92,7 @@ module.exports = function(context) {
* @private
*/
function startFunction() {
- functionStack.push(false);
+ functionStack.push({initialized: false, uninitialized: false});
startBlock();
}
@@ -72,47 +116,96 @@ module.exports = function(context) {
}
/**
- * Determines if there is more than one var statement in the current scope.
- * @returns {boolean} Returns true if it is the first var declaration, false if not.
+ * Records whether initialized or uninitialized variables are defined in current scope.
+ * @param {string} statementType node.kind, one of: "var", "let", or "const"
+ * @param {ASTNode[]} declarations List of declarations
+ * @param {Object} currentScope The scope being investigated
+ * @returns {void}
* @private
*/
- function hasOnlyOneVar() {
- if (functionStack[functionStack.length - 1]) {
- return true;
- } else {
- functionStack[functionStack.length - 1] = true;
- return false;
+ function recordTypes(statementType, declarations, currentScope) {
+ for (var i = 0; i < declarations.length; i++) {
+ if (declarations[i].init === null) {
+ if (options[statementType] && options[statementType].uninitialized === MODE_ALWAYS) {
+ currentScope.uninitialized = true;
+ }
+ } else {
+ if (options[statementType] && options[statementType].initialized === MODE_ALWAYS) {
+ currentScope.initialized = true;
+ }
+ }
}
}
/**
- * Determines if there is more than one let statement in the current scope.
- * @returns {boolean} Returns true if it is the first let declaration, false if not.
+ * Determines the current scope (function or block)
+ * @param {string} statementType node.kind, one of: "var", "let", or "const"
+ * @returns {Object} The scope associated with statementType
+ */
+ function getCurrentScope(statementType) {
+ var currentScope;
+ if (statementType === "var") {
+ currentScope = functionStack[functionStack.length - 1];
+ } else if (statementType === "let") {
+ currentScope = blockStack[blockStack.length - 1].let;
+ } else if (statementType === "const") {
+ currentScope = blockStack[blockStack.length - 1].const;
+ }
+ return currentScope;
+ }
+
+ /**
+ * Counts the number of initialized and uninitialized declarations in a list of declarations
+ * @param {ASTNode[]} declarations List of declarations
+ * @returns {Object} Counts of 'uninitialized' and 'initialized' declarations
* @private
*/
- function hasOnlyOneLet() {
- if (blockStack[blockStack.length - 1].let) {
- return true;
- } else {
- blockStack[blockStack.length - 1].let = true;
- return false;
+ function countDeclarations(declarations) {
+ var counts = { uninitialized: 0, initialized: 0 };
+ for (var i = 0; i < declarations.length; i++) {
+ if (declarations[i].init === null) {
+ counts.uninitialized++;
+ } else {
+ counts.initialized++;
+ }
}
+ return counts;
}
/**
- * Determines if there is more than one const statement in the current scope.
- * @returns {boolean} Returns true if it is the first const declaration, false if not.
+ * Determines if there is more than one var statement in the current scope.
+ * @param {string} statementType node.kind, one of: "var", "let", or "const"
+ * @param {ASTNode[]} declarations List of declarations
+ * @returns {boolean} Returns true if it is the first var declaration, false if not.
* @private
*/
- function hasOnlyOneConst() {
- if (blockStack[blockStack.length - 1].const) {
- return true;
- } else {
- blockStack[blockStack.length - 1].const = true;
- return false;
+ function hasOnlyOneStatement(statementType, declarations) {
+
+ var declarationCounts = countDeclarations(declarations);
+ var currentOptions = options[statementType] || {};
+ var currentScope = getCurrentScope(statementType);
+
+ if (currentOptions.uninitialized === MODE_ALWAYS && currentOptions.initialized === MODE_ALWAYS) {
+ if (currentScope.uninitialized || currentScope.initialized) {
+ return false;
+ }
+ }
+
+ if (declarationCounts.uninitialized > 0) {
+ if (currentOptions.uninitialized === MODE_ALWAYS && currentScope.uninitialized) {
+ return false;
+ }
}
+ if (declarationCounts.initialized > 0) {
+ if (currentOptions.initialized === MODE_ALWAYS && currentScope.initialized) {
+ return false;
+ }
+ }
+ recordTypes(statementType, declarations, currentScope);
+ return true;
}
+
//--------------------------------------------------------------------------
// Public API
//--------------------------------------------------------------------------
@@ -127,39 +220,45 @@ module.exports = function(context) {
"SwitchStatement": startBlock,
"VariableDeclaration": function(node) {
- var declarationCount = node.declarations.length;
+ var parent = node.parent,
+ type, declarations, declarationCounts;
- if (node.kind === "var") {
- if (options.var === "never") {
- if (declarationCount > 1) {
- context.report(node, "Split 'var' declaration into multiple statements.");
- }
+ type = node.kind;
+ if (!options[type]) {
+ return;
+ }
+
+ declarations = node.declarations;
+ declarationCounts = countDeclarations(declarations);
+
+ // always
+ if (!hasOnlyOneStatement(type, declarations)) {
+ if (options[type].initialized === MODE_ALWAYS && options[type].uninitialized === MODE_ALWAYS) {
+ context.report(node, "Combine this with the previous '" + type + "' statement.");
} else {
- if (hasOnlyOneVar()) {
- context.report(node, "Combine this with the previous 'var' statement.");
- }
- }
- } else if (node.kind === "let") {
- if (options.let === "never") {
- if (declarationCount > 1) {
- context.report(node, "Split 'let' declaration into multiple statements.");
+ if (options[type].initialized === MODE_ALWAYS) {
+ context.report(node, "Combine this with the previous '" + type + "' statement with initialized variables.");
}
- } else {
- if (hasOnlyOneLet()) {
- context.report(node, "Combine this with the previous 'let' statement.");
+ if (options[type].uninitialized === MODE_ALWAYS) {
+ context.report(node, "Combine this with the previous '" + type + "' statement with uninitialized variables.");
}
}
- } else if (node.kind === "const") {
- if (options.const === "never") {
- if (declarationCount > 1) {
- context.report(node, "Split 'const' declaration into multiple statements.");
- }
- } else {
- if (hasOnlyOneConst()) {
- context.report(node, "Combine this with the previous 'const' statement.");
+ }
+ // never
+ if (parent.type !== "ForStatement" || parent.init !== node) {
+ var totalDeclarations = declarationCounts.uninitialized + declarationCounts.initialized;
+ if (totalDeclarations > 1) {
+ // both initialized and uninitialized
+ if (options[type].initialized === MODE_NEVER && options[type].uninitialized === MODE_NEVER) {
+ context.report(node, "Split '" + type + "' declarations into multiple statements.");
+ // initialized
+ } else if (options[type].initialized === MODE_NEVER && declarationCounts.initialized > 0) {
+ context.report(node, "Split initialized '" + type + "' declarations into multiple statements.");
+ // uninitialized
+ } else if (options[type].uninitialized === MODE_NEVER && declarationCounts.uninitialized > 0) {
+ context.report(node, "Split uninitialized '" + type + "' declarations into multiple statements.");
}
}
-
}
},
@@ -173,3 +272,40 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [
+ {
+ "oneOf": [
+ {
+ "enum": ["always", "never"]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "var": {
+ "enum": ["always", "never"]
+ },
+ "let": {
+ "enum": ["always", "never"]
+ },
+ "const": {
+ "enum": ["always", "never"]
+ }
+ },
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "initialized": {
+ "enum": ["always", "never"]
+ },
+ "uninitialized": {
+ "enum": ["always", "never"]
+ }
+ },
+ "additionalProperties": false
+ }
+ ]
+ }
+];
diff --git a/tools/eslint/lib/rules/operator-assignment.js b/tools/eslint/lib/rules/operator-assignment.js
index 7ebb74d2bae..aa9e032ae2b 100644
--- a/tools/eslint/lib/rules/operator-assignment.js
+++ b/tools/eslint/lib/rules/operator-assignment.js
@@ -110,3 +110,9 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [
+ {
+ "enum": ["always", "never"]
+ }
+];
diff --git a/tools/eslint/lib/rules/operator-linebreak.js b/tools/eslint/lib/rules/operator-linebreak.js
index 020c61544c6..c70b09ad5c9 100644
--- a/tools/eslint/lib/rules/operator-linebreak.js
+++ b/tools/eslint/lib/rules/operator-linebreak.js
@@ -80,6 +80,14 @@ module.exports = function(context) {
line: operatorToken.loc.end.line,
column: operatorToken.loc.end.column
}, "'" + operator + "' should be placed at the end of the line.");
+
+ } else if (style === "none") {
+
+ context.report(node, {
+ line: operatorToken.loc.end.line,
+ column: operatorToken.loc.end.column
+ }, "There should be no line break before or after '" + operator + "'");
+
}
}
@@ -98,3 +106,9 @@ module.exports = function(context) {
}
};
};
+
+module.exports.schema = [
+ {
+ "enum": ["after", "before", "none"]
+ }
+];
diff --git a/tools/eslint/lib/rules/padded-blocks.js b/tools/eslint/lib/rules/padded-blocks.js
index 9a5be4df0e3..edb44637bea 100644
--- a/tools/eslint/lib/rules/padded-blocks.js
+++ b/tools/eslint/lib/rules/padded-blocks.js
@@ -90,3 +90,9 @@ module.exports = function (context) {
};
};
+
+module.exports.schema = [
+ {
+ "enum": ["always", "never"]
+ }
+];
diff --git a/tools/eslint/lib/rules/prefer-const.js b/tools/eslint/lib/rules/prefer-const.js
new file mode 100644
index 00000000000..ee7eba14b7b
--- /dev/null
+++ b/tools/eslint/lib/rules/prefer-const.js
@@ -0,0 +1,91 @@
+/**
+ * @fileoverview A rule to suggest using of const declaration for variables that are never modified after declared.
+ * @author Toru Nagashima
+ * @copyright 2015 Toru Nagashima. All rights reserved.
+ */
+
+"use strict";
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+module.exports = function(context) {
+
+ /**
+ * Checks whether a reference is the initializer.
+ * @param {Reference} reference - A reference to check.
+ * @returns {boolean} Whether or not the reference is the initializer.
+ */
+ function isInitializer(reference) {
+ return reference.init === true;
+ }
+
+ /**
+ * Checks whether a reference is read-only or the initializer.
+ * @param {Reference} reference - A reference to check.
+ * @returns {boolean} Whether or not the reference is read-only or the initializer.
+ */
+ function isReadOnlyOrInitializer(reference) {
+ return reference.isReadOnly() || reference.init === true;
+ }
+
+ /**
+ * Searches and reports variables that are never modified after declared.
+ * @param {Scope} scope - A scope of the search domain.
+ * @returns {void}
+ */
+ function checkForVariables(scope) {
+ // Skip the TDZ type.
+ if (scope.type === "TDZ") {
+ return;
+ }
+
+ var variables = scope.variables;
+ for (var i = 0, end = variables.length; i < end; ++i) {
+ var variable = variables[i];
+ var def = variable.defs[0];
+ var declaration = def && def.parent;
+ var statement = declaration && declaration.parent;
+ var references = variable.references;
+ var identifier = variable.identifiers[0];
+
+ if (statement != null &&
+ identifier != null &&
+ declaration.type === "VariableDeclaration" &&
+ declaration.kind === "let" &&
+ (statement.type !== "ForStatement" || statement.init !== declaration) &&
+ references.some(isInitializer) &&
+ references.every(isReadOnlyOrInitializer)
+ ) {
+ context.report(
+ identifier,
+ "`{{name}}` is never modified, use `const` instead.",
+ {name: identifier.name});
+ }
+ }
+ }
+
+ /**
+ * Adds multiple items to the tail of an array.
+ * @param {any[]} array - A destination to add.
+ * @param {any[]} values - Items to be added.
+ * @returns {void}
+ */
+ var pushAll = Function.apply.bind(Array.prototype.push);
+
+ return {
+ "Program:exit": function () {
+ var stack = [context.getScope()];
+ while (stack.length) {
+ var scope = stack.pop();
+ pushAll(stack, scope.childScopes);
+
+ checkForVariables(scope);
+ }
+ }
+ };
+
+};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/quote-props.js b/tools/eslint/lib/rules/quote-props.js
index ccac9478535..225dbfe8f86 100644
--- a/tools/eslint/lib/rules/quote-props.js
+++ b/tools/eslint/lib/rules/quote-props.js
@@ -64,3 +64,9 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [
+ {
+ "enum": ["always", "as-needed"]
+ }
+];
diff --git a/tools/eslint/lib/rules/quotes.js b/tools/eslint/lib/rules/quotes.js
index 2bb10ea5e4a..7d4626b9aed 100644
--- a/tools/eslint/lib/rules/quotes.js
+++ b/tools/eslint/lib/rules/quotes.js
@@ -62,7 +62,7 @@ module.exports = function(context) {
var val = node.value,
rawVal = node.raw,
quoteOption = context.options[0],
- settings = QUOTE_SETTINGS[quoteOption],
+ settings = QUOTE_SETTINGS[quoteOption || "double"],
avoidEscape = context.options[1] === AVOID_ESCAPE,
isValid;
@@ -81,3 +81,12 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [
+ {
+ "enum": ["single", "double", "backtick"]
+ },
+ {
+ "enum": ["avoid-escape"]
+ }
+];
diff --git a/tools/eslint/lib/rules/radix.js b/tools/eslint/lib/rules/radix.js
index a0c7acfb2e3..ac93b9e6078 100644
--- a/tools/eslint/lib/rules/radix.js
+++ b/tools/eslint/lib/rules/radix.js
@@ -37,3 +37,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/semi-spacing.js b/tools/eslint/lib/rules/semi-spacing.js
index 05ced445934..fddebfcf329 100644
--- a/tools/eslint/lib/rules/semi-spacing.js
+++ b/tools/eslint/lib/rules/semi-spacing.js
@@ -26,7 +26,7 @@ module.exports = function (context) {
}
/**
- * Determines whether two adjacent tokens are have whitespace between them.
+ * Determines whether two adjacent tokens have whitespace between them.
* @param {Object} left - The left token object.
* @param {Object} right - The right token object.
* @returns {boolean} Whether or not there is space between the tokens.
@@ -150,3 +150,18 @@ module.exports = function (context) {
}
};
};
+
+module.exports.schema = [
+ {
+ "type": "object",
+ "properties": {
+ "before": {
+ "type": "boolean"
+ },
+ "after": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+];
diff --git a/tools/eslint/lib/rules/semi.js b/tools/eslint/lib/rules/semi.js
index a9f841cd73c..7cd19632f55 100644
--- a/tools/eslint/lib/rules/semi.js
+++ b/tools/eslint/lib/rules/semi.js
@@ -128,3 +128,9 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [
+ {
+ "enum": ["always", "never"]
+ }
+];
diff --git a/tools/eslint/lib/rules/sort-vars.js b/tools/eslint/lib/rules/sort-vars.js
index 8d4b6a8980d..0a699f2ccda 100644
--- a/tools/eslint/lib/rules/sort-vars.js
+++ b/tools/eslint/lib/rules/sort-vars.js
@@ -35,3 +35,15 @@ module.exports = function(context) {
}
};
};
+
+module.exports.schema = [
+ {
+ "type": "object",
+ "properties": {
+ "ignoreCase": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+];
diff --git a/tools/eslint/lib/rules/space-after-function-name.js b/tools/eslint/lib/rules/space-after-function-name.js
index c477768c467..15d2286a2ad 100644
--- a/tools/eslint/lib/rules/space-after-function-name.js
+++ b/tools/eslint/lib/rules/space-after-function-name.js
@@ -41,3 +41,9 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [
+ {
+ "enum": ["always", "never"]
+ }
+];
diff --git a/tools/eslint/lib/rules/space-after-keywords.js b/tools/eslint/lib/rules/space-after-keywords.js
index 3ece8bb065a..007f80ca715 100644
--- a/tools/eslint/lib/rules/space-after-keywords.js
+++ b/tools/eslint/lib/rules/space-after-keywords.js
@@ -59,7 +59,7 @@ module.exports = function(context) {
"DoWhileStatement": function (node) {
check(node);
// check the `while`
- var whileTokens = context.getTokensBefore(node.test, 2);
+ var whileTokens = context.getTokensAfter(node.body, 2);
checkTokens(node, whileTokens[0], whileTokens[1]);
},
"SwitchStatement": check,
@@ -74,3 +74,9 @@ module.exports = function(context) {
"WithStatement": check
};
};
+
+module.exports.schema = [
+ {
+ "enum": ["always", "never"]
+ }
+];
diff --git a/tools/eslint/lib/rules/space-before-blocks.js b/tools/eslint/lib/rules/space-before-blocks.js
index 963ff42598d..799770537dd 100644
--- a/tools/eslint/lib/rules/space-before-blocks.js
+++ b/tools/eslint/lib/rules/space-before-blocks.js
@@ -83,3 +83,9 @@ module.exports = function (context) {
};
};
+
+module.exports.schema = [
+ {
+ "enum": ["always", "never"]
+ }
+];
diff --git a/tools/eslint/lib/rules/space-before-function-paren.js b/tools/eslint/lib/rules/space-before-function-paren.js
index b56409ada09..fde281c88cb 100644
--- a/tools/eslint/lib/rules/space-before-function-paren.js
+++ b/tools/eslint/lib/rules/space-before-function-paren.js
@@ -115,3 +115,25 @@ module.exports = function(context) {
"FunctionExpression": validateSpacingBeforeParentheses
};
};
+
+module.exports.schema = [
+ {
+ "oneOf": [
+ {
+ "enum": ["always", "never"]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "anonymous": {
+ "enum": ["always", "never"]
+ },
+ "named": {
+ "enum": ["always", "never"]
+ }
+ },
+ "additionalProperties": false
+ }
+ ]
+ }
+];
diff --git a/tools/eslint/lib/rules/space-before-function-parentheses.js b/tools/eslint/lib/rules/space-before-function-parentheses.js
index b40351d0b9f..9d275c62887 100644
--- a/tools/eslint/lib/rules/space-before-function-parentheses.js
+++ b/tools/eslint/lib/rules/space-before-function-parentheses.js
@@ -115,3 +115,25 @@ module.exports = function(context) {
"FunctionExpression": validateSpacingBeforeParentheses
};
};
+
+module.exports.schema = [
+ {
+ "oneOf": [
+ {
+ "enum": ["always", "never"]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "anonymous": {
+ "enum": ["always", "never"]
+ },
+ "named": {
+ "enum": ["always", "never"]
+ }
+ },
+ "additionalProperties": false
+ }
+ ]
+ }
+];
diff --git a/tools/eslint/lib/rules/space-in-brackets.js b/tools/eslint/lib/rules/space-in-brackets.js
index 1b5fcec466d..aac889c95d2 100644
--- a/tools/eslint/lib/rules/space-in-brackets.js
+++ b/tools/eslint/lib/rules/space-in-brackets.js
@@ -230,7 +230,7 @@ module.exports = function(context) {
lastSpecifier = node.specifiers[node.specifiers.length - 1];
// don't do anything for namespace or default imports
- if (firstSpecifier.type === "ImportSpecifier" && lastSpecifier.type === "ImportSpecifier") {
+ if (firstSpecifier && lastSpecifier && firstSpecifier.type === "ImportSpecifier" && lastSpecifier.type === "ImportSpecifier") {
var first = context.getTokenBefore(firstSpecifier),
second = context.getFirstToken(firstSpecifier),
penultimate = context.getLastToken(lastSpecifier),
@@ -242,6 +242,9 @@ module.exports = function(context) {
},
ExportNamedDeclaration: function(node) {
+ if (!node.specifiers.length) {
+ return;
+ }
var firstSpecifier = node.specifiers[0],
lastSpecifier = node.specifiers[node.specifiers.length - 1],
@@ -270,3 +273,33 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [
+ {
+ "enum": ["always", "never"]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "singleValue": {
+ "type": "boolean"
+ },
+ "objectsInArrays": {
+ "type": "boolean"
+ },
+ "arraysInArrays": {
+ "type": "boolean"
+ },
+ "arraysInObjects": {
+ "type": "boolean"
+ },
+ "objectsInObjects": {
+ "type": "boolean"
+ },
+ "propertyName": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+];
diff --git a/tools/eslint/lib/rules/space-in-parens.js b/tools/eslint/lib/rules/space-in-parens.js
index ff124c12985..407d763b322 100644
--- a/tools/eslint/lib/rules/space-in-parens.js
+++ b/tools/eslint/lib/rules/space-in-parens.js
@@ -260,3 +260,22 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [
+ {
+ "enum": ["always", "never"]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "exceptions": {
+ "type": "array",
+ "items": {
+ "enum": ["{}", "[]", "()", "empty"]
+ },
+ "uniqueItems": true
+ }
+ },
+ "additionalProperties": false
+ }
+];
diff --git a/tools/eslint/lib/rules/space-infix-ops.js b/tools/eslint/lib/rules/space-infix-ops.js
index a3f3c940ac0..4c094c7280c 100644
--- a/tools/eslint/lib/rules/space-infix-ops.js
+++ b/tools/eslint/lib/rules/space-infix-ops.js
@@ -92,3 +92,15 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [
+ {
+ "type": "object",
+ "properties": {
+ "int32Hint": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+];
diff --git a/tools/eslint/lib/rules/space-return-throw-case.js b/tools/eslint/lib/rules/space-return-throw-case.js
index 27928adec79..8b1bb984cf4 100644
--- a/tools/eslint/lib/rules/space-return-throw-case.js
+++ b/tools/eslint/lib/rules/space-return-throw-case.js
@@ -34,3 +34,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/space-unary-ops.js b/tools/eslint/lib/rules/space-unary-ops.js
index 2fe8a3f4063..48d146b779b 100644
--- a/tools/eslint/lib/rules/space-unary-ops.js
+++ b/tools/eslint/lib/rules/space-unary-ops.js
@@ -26,15 +26,6 @@ module.exports = function(context) {
}
/**
- * Checks if the type is a unary word expression
- * @param {string} type value of AST token
- * @returns {boolean} Whether the word is in the list of known words
- */
- function isWordExpression(type) {
- return ["delete", "new", "typeof", "void"].indexOf(type) !== -1;
- }
-
- /**
* Check if the node's child argument is an "ObjectExpression"
* @param {ASTnode} node AST node
* @returns {boolean} Whether or not the argument's type is "ObjectExpression"
@@ -74,7 +65,7 @@ module.exports = function(context) {
firstToken = tokens[0],
secondToken = tokens[1];
- if (isWordExpression(firstToken.value)) {
+ if ((node.type === "NewExpression" || node.prefix) && firstToken.type === "Keyword") {
checkUnaryWordOperatorForSpaces(node, firstToken, secondToken);
return void 0;
}
@@ -116,3 +107,18 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [
+ {
+ "type": "object",
+ "properties": {
+ "words": {
+ "type": "boolean"
+ },
+ "nonwords": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+];
diff --git a/tools/eslint/lib/rules/spaced-comment.js b/tools/eslint/lib/rules/spaced-comment.js
new file mode 100644
index 00000000000..a57cd8699d0
--- /dev/null
+++ b/tools/eslint/lib/rules/spaced-comment.js
@@ -0,0 +1,143 @@
+/**
+ * @fileoverview Source code for spaced-comments rule
+ * @author Gyandeep Singh
+ * @copyright 2015 Gyandeep Singh. All rights reserved.
+ * @copyright 2014 Greg Cochard. All rights reserved.
+ */
+"use strict";
+
+//------------------------------------------------------------------------------
+// Rule Definition
+//------------------------------------------------------------------------------
+
+module.exports = function(context) {
+
+ // Unless the first option is never, require a space
+ var requireSpace = context.options[0] !== "never";
+
+ // Default to match anything, so all will fail if there are no exceptions
+ var exceptionMatcher = new RegExp(" ");
+ var markerMatcher = new RegExp(" ");
+ var jsDocMatcher = new RegExp("((^(\\*)))[ \\n]");
+
+ // Fetch the options dict
+ var hasOptions = context.options.length === 2;
+ var optionsDict = hasOptions ? context.options[1] : {};
+
+ // Grab the exceptions array and build a RegExp matcher for it
+ var hasExceptions = hasOptions && optionsDict.exceptions && optionsDict.exceptions.length;
+ var unescapedExceptions = hasExceptions ? optionsDict.exceptions : [];
+ var exceptions;
+
+ // Now do the same for markers
+ var hasMarkers = hasOptions && optionsDict.markers && optionsDict.markers.length;
+ var unescapedMarkers = hasMarkers ? optionsDict.markers : [];
+ var markers;
+
+ function escaper(s) {
+ return s.replace(/([.*+?${}()|\^\[\]\/\\])/g, "\\$1");
+ }
+
+ if (hasExceptions) {
+ exceptions = unescapedExceptions.map(escaper);
+ exceptionMatcher = new RegExp("(^(" + exceptions.join(")+$)|(^(") + ")+$)");
+ }
+
+ if (hasMarkers) {
+ markers = unescapedMarkers.map(escaper);
+
+ // the markerMatcher includes any markers in the list, followed by space/tab
+ markerMatcher = new RegExp("((^(" + markers.join("))|(^(") + ")))[ \\t\\n]");
+ }
+
+ /**
+ * Check to see if the block comment is jsDoc comment
+ * @param {ASTNode} node comment node
+ * @returns {boolean} True if its jsdoc comment
+ * @private
+ */
+ function isJsdoc(node) {
+ // make sure comment type is block and it start with /**\n
+ return node.type === "Block" && jsDocMatcher.test(node.value);
+ }
+
+
+ function checkCommentForSpace(node) {
+ var commentIdentifier = node.type === "Block" ? "/*" : "//";
+
+ if (requireSpace) {
+
+ // If length is zero, ignore it
+ if (node.value.length === 0) {
+ return;
+ }
+
+ // if comment is jsdoc style then ignore it
+ if (isJsdoc(node)) {
+ return;
+ }
+
+ // Check for markers now, and short-circuit if found
+ if (hasMarkers && markerMatcher.test(node.value)) {
+ return;
+ }
+
+ // Space expected and not found
+ if (node.value.indexOf(" ") !== 0 && node.value.indexOf("\t") !== 0 && node.value.indexOf("\n") !== 0) {
+
+ /*
+ * Do two tests; one for space starting the line,
+ * and one for a comment comprised only of exceptions
+ */
+ if (hasExceptions && !exceptionMatcher.test(node.value)) {
+ context.report(node, "Expected exception block, space or tab after " + commentIdentifier + " in comment.");
+ } else if (!hasExceptions) {
+ context.report(node, "Expected space or tab after " + commentIdentifier + " in comment.");
+ }
+ }
+
+ } else {
+
+ if (node.value.indexOf(" ") === 0 || node.value.indexOf("\t") === 0) {
+ context.report(node, "Unexpected space or tab after " + commentIdentifier + " in comment.");
+ }
+ // there won't be a space or tab after commentIdentifier here, but check for the markers and whitespace
+ if (hasMarkers && markerMatcher.test(node.value)) {
+ var matches = node.value.match(markerMatcher), match = matches.length ? matches[0] : "";
+
+ context.report(node, "Unexpected space or tab after marker (" + match + ") in comment.");
+ }
+ }
+ }
+
+ return {
+
+ "LineComment": checkCommentForSpace,
+ "BlockComment": checkCommentForSpace
+
+ };
+};
+
+module.exports.schema = [
+ {
+ "enum": ["always", "never"]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "exceptions": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "markers": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ },
+ "additionalProperties": false
+ }
+];
diff --git a/tools/eslint/lib/rules/spaced-line-comment.js b/tools/eslint/lib/rules/spaced-line-comment.js
index af5ba8cdb6a..1e2d952f294 100644
--- a/tools/eslint/lib/rules/spaced-line-comment.js
+++ b/tools/eslint/lib/rules/spaced-line-comment.js
@@ -69,3 +69,21 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [
+ {
+ "enum": ["always", "never"]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "exceptions": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ },
+ "additionalProperties": false
+ }
+];
diff --git a/tools/eslint/lib/rules/strict.js b/tools/eslint/lib/rules/strict.js
index 16d8612891e..a398d7dbecf 100644
--- a/tools/eslint/lib/rules/strict.js
+++ b/tools/eslint/lib/rules/strict.js
@@ -234,3 +234,9 @@ module.exports = function(context) {
return modes[mode || "deprecated"];
};
+
+module.exports.schema = [
+ {
+ "enum": ["never", "global", "function"]
+ }
+];
diff --git a/tools/eslint/lib/rules/use-isnan.js b/tools/eslint/lib/rules/use-isnan.js
index d7a3f537683..f5c327f4bcd 100644
--- a/tools/eslint/lib/rules/use-isnan.js
+++ b/tools/eslint/lib/rules/use-isnan.js
@@ -22,3 +22,5 @@ module.exports = function (context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/valid-jsdoc.js b/tools/eslint/lib/rules/valid-jsdoc.js
index a79bf7fea49..bab6037d176 100644
--- a/tools/eslint/lib/rules/valid-jsdoc.js
+++ b/tools/eslint/lib/rules/valid-jsdoc.js
@@ -21,7 +21,7 @@ module.exports = function(context) {
prefer = options.prefer || {},
// these both default to true, so you have to explicitly make them false
- requireReturn = options.requireReturn === false ? false : true,
+ requireReturn = options.requireReturn !== false,
requireParamDescription = options.requireParamDescription !== false,
requireReturnDescription = options.requireReturnDescription !== false;
@@ -143,7 +143,7 @@ module.exports = function(context) {
});
// check for functions missing @returns
- if (!hasReturns && !hasConstructor) {
+ if (!hasReturns && !hasConstructor && node.parent.kind !== "get") {
if (requireReturn || functionData.returnPresent) {
context.report(jsdocNode, "Missing JSDoc @returns for function.");
}
@@ -189,3 +189,27 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [
+ {
+ "type": "object",
+ "properties": {
+ "prefer": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "requireReturn": {
+ "type": "boolean"
+ },
+ "requireParamDescription": {
+ "type": "boolean"
+ },
+ "requireReturnDescription": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+];
diff --git a/tools/eslint/lib/rules/valid-typeof.js b/tools/eslint/lib/rules/valid-typeof.js
index a108ab360fb..cbeb7b12e8f 100644
--- a/tools/eslint/lib/rules/valid-typeof.js
+++ b/tools/eslint/lib/rules/valid-typeof.js
@@ -38,3 +38,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/vars-on-top.js b/tools/eslint/lib/rules/vars-on-top.js
index 4af70a88033..5917c674ec4 100644
--- a/tools/eslint/lib/rules/vars-on-top.js
+++ b/tools/eslint/lib/rules/vars-on-top.js
@@ -111,3 +111,5 @@ module.exports = function (context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/wrap-iife.js b/tools/eslint/lib/rules/wrap-iife.js
index eb3c5d1dc3f..6291425efb8 100644
--- a/tools/eslint/lib/rules/wrap-iife.js
+++ b/tools/eslint/lib/rules/wrap-iife.js
@@ -40,3 +40,9 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [
+ {
+ "enum": ["outside", "inside", "any"]
+ }
+];
diff --git a/tools/eslint/lib/rules/wrap-regex.js b/tools/eslint/lib/rules/wrap-regex.js
index e2cc7d22532..f2625cc2b98 100644
--- a/tools/eslint/lib/rules/wrap-regex.js
+++ b/tools/eslint/lib/rules/wrap-regex.js
@@ -34,3 +34,5 @@ module.exports = function(context) {
};
};
+
+module.exports.schema = [];
diff --git a/tools/eslint/lib/rules/yoda.js b/tools/eslint/lib/rules/yoda.js
index cdb5bdad083..ab5e7d04c92 100644
--- a/tools/eslint/lib/rules/yoda.js
+++ b/tools/eslint/lib/rules/yoda.js
@@ -20,6 +20,15 @@ function isComparisonOperator(operator) {
}
/**
+ * Determines whether an operator is an equality operator.
+ * @param {String} operator The operator to check.
+ * @returns {boolean} Whether or not it is an equality operator.
+ */
+function isEqualityOperator(operator) {
+ return (/^(==|===)$/).test(operator);
+}
+
+/**
* Determines whether an operator is one used in a range test.
* Allowed operators are `<` and `<=`.
* @param {String} operator The operator to check.
@@ -110,6 +119,7 @@ module.exports = function (context) {
// Default to "never" (!always) if no option
var always = (context.options[0] === "always");
var exceptRange = (context.options[1] && context.options[1].exceptRange);
+ var onlyEquality = (context.options[1] && context.options[1].onlyEquality);
/**
* Determines whether node represents a range test.
@@ -187,6 +197,7 @@ module.exports = function (context) {
// Comparisons must always be yoda-style: if ("blue" === color)
if (
(node.right.type === "Literal" || looksLikeLiteral(node.right)) &&
+ !(!isEqualityOperator(node.operator) && onlyEquality) &&
isComparisonOperator(node.operator) &&
!(exceptRange && isRangeTest(context.getAncestors().pop()))
) {
@@ -198,6 +209,7 @@ module.exports = function (context) {
// Comparisons must never be yoda-style (default)
if (
(node.left.type === "Literal" || looksLikeLiteral(node.left)) &&
+ !(!isEqualityOperator(node.operator) && onlyEquality) &&
isComparisonOperator(node.operator) &&
!(exceptRange && isRangeTest(context.getAncestors().pop()))
) {
@@ -208,3 +220,21 @@ module.exports = function (context) {
};
};
+
+module.exports.schema = [
+ {
+ "enum": ["always", "never"]
+ },
+ {
+ "type": "object",
+ "properties": {
+ "exceptRange": {
+ "type": "boolean"
+ },
+ "onlyEquality": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ }
+];
diff --git a/tools/eslint/node_modules/.bin/esparse b/tools/eslint/node_modules/.bin/esparse
index 4a9984aab05..409161d5acd 100755..120000
--- a/tools/eslint/node_modules/.bin/esparse
+++ b/tools/eslint/node_modules/.bin/esparse
@@ -1,127 +1 @@
-#!/usr/bin/env node
-/*
- Copyright (C) 2012 Ariya Hidayat <ariya.hidayat@gmail.com>
- Copyright (C) 2011 Ariya Hidayat <ariya.hidayat@gmail.com>
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/*jslint sloppy:true node:true rhino:true */
-
-var fs, espree, fname, content, options, syntax;
-
-if (typeof require === 'function') {
- fs = require('fs');
- espree = require('espree');
-} else if (typeof load === 'function') {
- try {
- load('espree.js');
- } catch (e) {
- load('../espree.js');
- }
-}
-
-// Shims to Node.js objects when running under Rhino.
-if (typeof console === 'undefined' && typeof process === 'undefined') {
- console = { log: print };
- fs = { readFileSync: readFile };
- process = { argv: arguments, exit: quit };
- process.argv.unshift('esparse.js');
- process.argv.unshift('rhino');
-}
-
-function showUsage() {
- console.log('Usage:');
- console.log(' esparse [options] file.js');
- console.log();
- console.log('Available options:');
- console.log();
- console.log(' --comment Gather all line and block comments in an array');
- console.log(' --loc Include line-column location info for each syntax node');
- console.log(' --range Include index-based range for each syntax node');
- console.log(' --raw Display the raw value of literals');
- console.log(' --tokens List all tokens in an array');
- console.log(' --tolerant Tolerate errors on a best-effort basis (experimental)');
- console.log(' -v, --version Shows program version');
- console.log();
- process.exit(1);
-}
-
-if (process.argv.length <= 2) {
- showUsage();
-}
-
-options = {};
-
-process.argv.splice(2).forEach(function (entry) {
-
- if (entry === '-h' || entry === '--help') {
- showUsage();
- } else if (entry === '-v' || entry === '--version') {
- console.log('ECMAScript Parser (using espree version', espree.version, ')');
- console.log();
- process.exit(0);
- } else if (entry === '--comment') {
- options.comment = true;
- } else if (entry === '--loc') {
- options.loc = true;
- } else if (entry === '--range') {
- options.range = true;
- } else if (entry === '--raw') {
- options.raw = true;
- } else if (entry === '--tokens') {
- options.tokens = true;
- } else if (entry === '--tolerant') {
- options.tolerant = true;
- } else if (entry.slice(0, 2) === '--') {
- console.log('Error: unknown option ' + entry + '.');
- process.exit(1);
- } else if (typeof fname === 'string') {
- console.log('Error: more than one input file.');
- process.exit(1);
- } else {
- fname = entry;
- }
-});
-
-if (typeof fname !== 'string') {
- console.log('Error: no input file.');
- process.exit(1);
-}
-
-// Special handling for regular expression literal since we need to
-// convert it to a string literal, otherwise it will be decoded
-// as object "{}" and the regular expression would be lost.
-function adjustRegexLiteral(key, value) {
- if (key === 'value' && value instanceof RegExp) {
- value = value.toString();
- }
- return value;
-}
-
-try {
- content = fs.readFileSync(fname, 'utf-8');
- syntax = espree.parse(content, options);
- console.log(JSON.stringify(syntax, adjustRegexLiteral, 4));
-} catch (e) {
- console.log('Error: ' + e.message);
- process.exit(1);
-}
+../espree/bin/esparse.js \ No newline at end of file
diff --git a/tools/eslint/node_modules/.bin/esvalidate b/tools/eslint/node_modules/.bin/esvalidate
index 7631d0a29d6..939b663b96f 100755..120000
--- a/tools/eslint/node_modules/.bin/esvalidate
+++ b/tools/eslint/node_modules/.bin/esvalidate
@@ -1,199 +1 @@
-#!/usr/bin/env node
-/*
- Copyright (C) 2012 Ariya Hidayat <ariya.hidayat@gmail.com>
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/*jslint sloppy:true plusplus:true node:true rhino:true */
-/*global phantom:true */
-
-var fs, system, espree, options, fnames, count;
-
-if (typeof espree === 'undefined') {
- // PhantomJS can only require() relative files
- if (typeof phantom === 'object') {
- fs = require('fs');
- system = require('system');
- espree = require('./espree');
- } else if (typeof require === 'function') {
- fs = require('fs');
- espree = require('espree');
- } else if (typeof load === 'function') {
- try {
- load('espree.js');
- } catch (e) {
- load('../espree.js');
- }
- }
-}
-
-// Shims to Node.js objects when running under PhantomJS 1.7+.
-if (typeof phantom === 'object') {
- fs.readFileSync = fs.read;
- process = {
- argv: [].slice.call(system.args),
- exit: phantom.exit
- };
- process.argv.unshift('phantomjs');
-}
-
-// Shims to Node.js objects when running under Rhino.
-if (typeof console === 'undefined' && typeof process === 'undefined') {
- console = { log: print };
- fs = { readFileSync: readFile };
- process = { argv: arguments, exit: quit };
- process.argv.unshift('esvalidate.js');
- process.argv.unshift('rhino');
-}
-
-function showUsage() {
- console.log('Usage:');
- console.log(' esvalidate [options] file.js');
- console.log();
- console.log('Available options:');
- console.log();
- console.log(' --format=type Set the report format, plain (default) or junit');
- console.log(' -v, --version Print program version');
- console.log();
- process.exit(1);
-}
-
-if (process.argv.length <= 2) {
- showUsage();
-}
-
-options = {
- format: 'plain'
-};
-
-fnames = [];
-
-process.argv.splice(2).forEach(function (entry) {
-
- if (entry === '-h' || entry === '--help') {
- showUsage();
- } else if (entry === '-v' || entry === '--version') {
- console.log('ECMAScript Validator (using espree version', espree.version, ')');
- console.log();
- process.exit(0);
- } else if (entry.slice(0, 9) === '--format=') {
- options.format = entry.slice(9);
- if (options.format !== 'plain' && options.format !== 'junit') {
- console.log('Error: unknown report format ' + options.format + '.');
- process.exit(1);
- }
- } else if (entry.slice(0, 2) === '--') {
- console.log('Error: unknown option ' + entry + '.');
- process.exit(1);
- } else {
- fnames.push(entry);
- }
-});
-
-if (fnames.length === 0) {
- console.log('Error: no input file.');
- process.exit(1);
-}
-
-if (options.format === 'junit') {
- console.log('<?xml version="1.0" encoding="UTF-8"?>');
- console.log('<testsuites>');
-}
-
-count = 0;
-fnames.forEach(function (fname) {
- var content, timestamp, syntax, name;
- try {
- content = fs.readFileSync(fname, 'utf-8');
-
- if (content[0] === '#' && content[1] === '!') {
- content = '//' + content.substr(2, content.length);
- }
-
- timestamp = Date.now();
- syntax = espree.parse(content, { tolerant: true });
-
- if (options.format === 'junit') {
-
- name = fname;
- if (name.lastIndexOf('/') >= 0) {
- name = name.slice(name.lastIndexOf('/') + 1);
- }
-
- console.log('<testsuite name="' + fname + '" errors="0" ' +
- ' failures="' + syntax.errors.length + '" ' +
- ' tests="' + syntax.errors.length + '" ' +
- ' time="' + Math.round((Date.now() - timestamp) / 1000) +
- '">');
-
- syntax.errors.forEach(function (error) {
- var msg = error.message;
- msg = msg.replace(/^Line\ [0-9]*\:\ /, '');
- console.log(' <testcase name="Line ' + error.lineNumber + ': ' + msg + '" ' +
- ' time="0">');
- console.log(' <error type="SyntaxError" message="' + error.message + '">' +
- error.message + '(' + name + ':' + error.lineNumber + ')' +
- '</error>');
- console.log(' </testcase>');
- });
-
- console.log('</testsuite>');
-
- } else if (options.format === 'plain') {
-
- syntax.errors.forEach(function (error) {
- var msg = error.message;
- msg = msg.replace(/^Line\ [0-9]*\:\ /, '');
- msg = fname + ':' + error.lineNumber + ': ' + msg;
- console.log(msg);
- ++count;
- });
-
- }
- } catch (e) {
- ++count;
- if (options.format === 'junit') {
- console.log('<testsuite name="' + fname + '" errors="1" failures="0" tests="1" ' +
- ' time="' + Math.round((Date.now() - timestamp) / 1000) + '">');
- console.log(' <testcase name="' + e.message + '" ' + ' time="0">');
- console.log(' <error type="ParseError" message="' + e.message + '">' +
- e.message + '(' + fname + ((e.lineNumber) ? ':' + e.lineNumber : '') +
- ')</error>');
- console.log(' </testcase>');
- console.log('</testsuite>');
- } else {
- console.log('Error: ' + e.message);
- }
- }
-});
-
-if (options.format === 'junit') {
- console.log('</testsuites>');
-}
-
-if (count > 0) {
- process.exit(1);
-}
-
-if (count === 0 && typeof phantom === 'object') {
- process.exit(0);
-}
+../espree/bin/esvalidate.js \ No newline at end of file
diff --git a/tools/eslint/node_modules/.bin/js-yaml b/tools/eslint/node_modules/.bin/js-yaml
index e6029d64ce2..9dbd010d470 100755..120000
--- a/tools/eslint/node_modules/.bin/js-yaml
+++ b/tools/eslint/node_modules/.bin/js-yaml
@@ -1,142 +1 @@
-#!/usr/bin/env node
-
-
-'use strict';
-
-/*eslint-disable no-console*/
-
-
-// stdlib
-var fs = require('fs');
-
-
-// 3rd-party
-var argparse = require('argparse');
-
-
-// internal
-var yaml = require('..');
-
-
-////////////////////////////////////////////////////////////////////////////////
-
-
-var cli = new argparse.ArgumentParser({
- prog: 'js-yaml',
- version: require('../package.json').version,
- addHelp: true
-});
-
-
-cli.addArgument([ '-c', '--compact' ], {
- help: 'Display errors in compact mode',
- action: 'storeTrue'
-});
-
-
-// deprecated (not needed after we removed output colors)
-// option suppressed, but not completely removed for compatibility
-cli.addArgument([ '-j', '--to-json' ], {
- help: argparse.Const.SUPPRESS,
- dest: 'json',
- action: 'storeTrue'
-});
-
-
-cli.addArgument([ '-t', '--trace' ], {
- help: 'Show stack trace on error',
- action: 'storeTrue'
-});
-
-cli.addArgument([ 'file' ], {
- help: 'File to read, utf-8 encoded without BOM',
- nargs: '?',
- defaultValue: '-'
-});
-
-
-////////////////////////////////////////////////////////////////////////////////
-
-
-var options = cli.parseArgs();
-
-
-////////////////////////////////////////////////////////////////////////////////
-
-function readFile(filename, encoding, callback) {
- if (options.file === '-') {
- // read from stdin
-
- var chunks = [];
-
- process.stdin.on('data', function (chunk) {
- chunks.push(chunk);
- });
-
- process.stdin.on('end', function () {
- return callback(null, Buffer.concat(chunks).toString(encoding));
- });
- } else {
- fs.readFile(filename, encoding, callback);
- }
-}
-
-readFile(options.file, 'utf8', function (error, input) {
- var output, isYaml;
-
- if (error) {
- if (error.code === 'ENOENT') {
- console.error('File not found: ' + options.file);
- process.exit(2);
- }
-
- console.error(
- options.trace && error.stack ||
- error.message ||
- String(error));
-
- process.exit(1);
- }
-
- try {
- output = JSON.parse(input);
- isYaml = false;
- } catch (error) {
- if (error instanceof SyntaxError) {
- try {
- output = [];
- yaml.loadAll(input, function (doc) { output.push(doc); }, {});
- isYaml = true;
-
- if (0 === output.length) {
- output = null;
- } else if (1 === output.length) {
- output = output[0];
- }
- } catch (error) {
- if (options.trace && error.stack) {
- console.error(error.stack);
- } else {
- console.error(error.toString(options.compact));
- }
-
- process.exit(1);
- }
- } else {
- console.error(
- options.trace && error.stack ||
- error.message ||
- String(error));
-
- process.exit(1);
- }
- }
-
- if (isYaml) {
- console.log(JSON.stringify(output, null, ' '));
- } else {
- console.log(yaml.dump(output));
- }
-
- process.exit(0);
-});
+../js-yaml/bin/js-yaml.js \ No newline at end of file
diff --git a/tools/eslint/node_modules/.bin/mkdirp b/tools/eslint/node_modules/.bin/mkdirp
index d95de15ae97..017896cebb1 100755..120000
--- a/tools/eslint/node_modules/.bin/mkdirp
+++ b/tools/eslint/node_modules/.bin/mkdirp
@@ -1,33 +1 @@
-#!/usr/bin/env node
-
-var mkdirp = require('../');
-var minimist = require('minimist');
-var fs = require('fs');
-
-var argv = minimist(process.argv.slice(2), {
- alias: { m: 'mode', h: 'help' },
- string: [ 'mode' ]
-});
-if (argv.help) {
- fs.createReadStream(__dirname + '/usage.txt').pipe(process.stdout);
- return;
-}
-
-var paths = argv._.slice();
-var mode = argv.mode ? parseInt(argv.mode, 8) : undefined;
-
-(function next () {
- if (paths.length === 0) return;
- var p = paths.shift();
-
- if (mode === undefined) mkdirp(p, cb)
- else mkdirp(p, mode, cb)
-
- function cb (err) {
- if (err) {
- console.error(err.message);
- process.exit(1);
- }
- else next();
- }
-})();
+../mkdirp/bin/cmd.js \ No newline at end of file
diff --git a/tools/eslint/node_modules/.bin/strip-json-comments b/tools/eslint/node_modules/.bin/strip-json-comments
index ac4da48457a..63d549f96f3 100755..120000
--- a/tools/eslint/node_modules/.bin/strip-json-comments
+++ b/tools/eslint/node_modules/.bin/strip-json-comments
@@ -1,41 +1 @@
-#!/usr/bin/env node
-'use strict';
-var fs = require('fs');
-var strip = require('./strip-json-comments');
-var input = process.argv[2];
-
-
-function getStdin(cb) {
- var ret = '';
-
- process.stdin.setEncoding('utf8');
-
- process.stdin.on('data', function (data) {
- ret += data;
- });
-
- process.stdin.on('end', function () {
- cb(ret);
- });
-}
-
-if (process.argv.indexOf('-h') !== -1 || process.argv.indexOf('--help') !== -1) {
- console.log('strip-json-comments <input file> > <output file>');
- console.log('or');
- console.log('cat <input file> | strip-json-comments > <output file>');
- return;
-}
-
-if (process.argv.indexOf('-v') !== -1 || process.argv.indexOf('--version') !== -1) {
- console.log(require('./package').version);
- return;
-}
-
-if (input) {
- process.stdout.write(strip(fs.readFileSync(input, 'utf8')));
- return;
-}
-
-getStdin(function (data) {
- process.stdout.write(strip(data));
-});
+../strip-json-comments/cli.js \ No newline at end of file
diff --git a/tools/eslint/node_modules/.bin/user-home b/tools/eslint/node_modules/.bin/user-home
index bacbd22755e..d72d76bb49f 100755..120000
--- a/tools/eslint/node_modules/.bin/user-home
+++ b/tools/eslint/node_modules/.bin/user-home
@@ -1,26 +1 @@
-#!/usr/bin/env node
-'use strict';
-var pkg = require('./package.json');
-var userHome = require('./');
-
-function help() {
- console.log([
- pkg.description,
- '',
- 'Example',
- ' $ user-home',
- ' /Users/sindresorhus'
- ].join('\n'));
-}
-
-if (process.argv.indexOf('--help') !== -1) {
- help();
- return;
-}
-
-if (process.argv.indexOf('--version') !== -1) {
- console.log(pkg.version);
- return;
-}
-
-process.stdout.write(userHome);
+../user-home/cli.js \ No newline at end of file
diff --git a/tools/eslint/node_modules/chalk/node_modules/.bin/has-ansi b/tools/eslint/node_modules/chalk/node_modules/.bin/has-ansi
index 0386a824236..c1e7413f1f6 100755..120000
--- a/tools/eslint/node_modules/chalk/node_modules/.bin/has-ansi
+++ b/tools/eslint/node_modules/chalk/node_modules/.bin/has-ansi
@@ -1,45 +1 @@
-#!/usr/bin/env node
-'use strict';
-var stdin = require('get-stdin');
-var pkg = require('./package.json');
-var hasAnsi = require('./');
-var argv = process.argv.slice(2);
-var input = argv[0];
-
-function help() {
- console.log([
- '',
- ' ' + pkg.description,
- '',
- ' Usage',
- ' has-ansi <string>',
- ' echo <string> | has-ansi',
- '',
- ' Exits with code 0 if input has ANSI escape codes and 1 if not'
- ].join('\n'));
-}
-
-function init(data) {
- process.exit(hasAnsi(data) ? 0 : 1);
-}
-
-if (argv.indexOf('--help') !== -1) {
- help();
- return;
-}
-
-if (argv.indexOf('--version') !== -1) {
- console.log(pkg.version);
- return;
-}
-
-if (process.stdin.isTTY) {
- if (!input) {
- help();
- return;
- }
-
- init(input);
-} else {
- stdin(init);
-}
+../has-ansi/cli.js \ No newline at end of file
diff --git a/tools/eslint/node_modules/chalk/node_modules/.bin/strip-ansi b/tools/eslint/node_modules/chalk/node_modules/.bin/strip-ansi
index b83f63b907e..b65c9f81df9 100755..120000
--- a/tools/eslint/node_modules/chalk/node_modules/.bin/strip-ansi
+++ b/tools/eslint/node_modules/chalk/node_modules/.bin/strip-ansi
@@ -1,47 +1 @@
-#!/usr/bin/env node
-'use strict';
-var fs = require('fs');
-var pkg = require('./package.json');
-var stripAnsi = require('./');
-var argv = process.argv.slice(2);
-var input = argv[0];
-
-function help() {
- console.log([
- '',
- ' ' + pkg.description,
- '',
- ' Usage',
- ' strip-ansi <input-file> > <output-file>',
- ' cat <input-file> | strip-ansi > <output-file>',
- '',
- ' Example',
- ' strip-ansi unicorn.txt > unicorn-stripped.txt'
- ].join('\n'));
-}
-
-function init(data) {
- process.stdout.write(stripAnsi(data));
-}
-
-if (argv.indexOf('--help') !== -1) {
- help();
- return;
-}
-
-if (argv.indexOf('--version') !== -1) {
- console.log(pkg.version);
- return;
-}
-
-if (!input && process.stdin.isTTY) {
- help();
- return;
-}
-
-if (input) {
- init(fs.readFileSync(input, 'utf8'));
-} else {
- process.stdin.setEncoding('utf8');
- process.stdin.on('data', init);
-}
+../strip-ansi/cli.js \ No newline at end of file
diff --git a/tools/eslint/node_modules/chalk/node_modules/.bin/supports-color b/tools/eslint/node_modules/chalk/node_modules/.bin/supports-color
index e746987666d..af0f05efe85 100755..120000
--- a/tools/eslint/node_modules/chalk/node_modules/.bin/supports-color
+++ b/tools/eslint/node_modules/chalk/node_modules/.bin/supports-color
@@ -1,29 +1 @@
-#!/usr/bin/env node
-'use strict';
-var pkg = require('./package.json');
-var supportsColor = require('./');
-var argv = process.argv.slice(2);
-
-function help() {
- console.log([
- '',
- ' ' + pkg.description,
- '',
- ' Usage',
- ' supports-color',
- '',
- ' Exits with code 0 if color is supported and 1 if not'
- ].join('\n'));
-}
-
-if (argv.indexOf('--help') !== -1) {
- help();
- return;
-}
-
-if (argv.indexOf('--version') !== -1) {
- console.log(pkg.version);
- return;
-}
-
-process.exit(supportsColor ? 0 : 1);
+../supports-color/cli.js \ No newline at end of file
diff --git a/tools/eslint/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/package.json b/tools/eslint/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/package.json
index 4b7be0c62ca..3ce9ccdb878 100644
--- a/tools/eslint/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/package.json
+++ b/tools/eslint/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/package.json
@@ -69,7 +69,7 @@
"homepage": "https://github.com/sindresorhus/ansi-regex",
"_id": "ansi-regex@1.1.1",
"_shasum": "41c847194646375e6a1a5d10c3ca054ef9fc980d",
- "_from": "ansi-regex@>=1.0.0 <2.0.0",
+ "_from": "ansi-regex@>=1.1.1 <2.0.0",
"_npmVersion": "2.1.16",
"_nodeVersion": "0.10.35",
"_npmUser": {
diff --git a/tools/eslint/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/package.json b/tools/eslint/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/package.json
index 4b7be0c62ca..3ce9ccdb878 100644
--- a/tools/eslint/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/package.json
+++ b/tools/eslint/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/package.json
@@ -69,7 +69,7 @@
"homepage": "https://github.com/sindresorhus/ansi-regex",
"_id": "ansi-regex@1.1.1",
"_shasum": "41c847194646375e6a1a5d10c3ca054ef9fc980d",
- "_from": "ansi-regex@>=1.0.0 <2.0.0",
+ "_from": "ansi-regex@>=1.1.1 <2.0.0",
"_npmVersion": "2.1.16",
"_nodeVersion": "0.10.35",
"_npmUser": {
diff --git a/tools/eslint/node_modules/concat-stream/.npmignore b/tools/eslint/node_modules/concat-stream/.npmignore
deleted file mode 100644
index b512c09d476..00000000000
--- a/tools/eslint/node_modules/concat-stream/.npmignore
+++ /dev/null
@@ -1 +0,0 @@
-node_modules \ No newline at end of file
diff --git a/tools/eslint/node_modules/concat-stream/node_modules/inherits/package.json b/tools/eslint/node_modules/concat-stream/node_modules/inherits/package.json
index b22bcc0e48a..19fe6841760 100644
--- a/tools/eslint/node_modules/concat-stream/node_modules/inherits/package.json
+++ b/tools/eslint/node_modules/concat-stream/node_modules/inherits/package.json
@@ -29,7 +29,5 @@
},
"homepage": "https://github.com/isaacs/inherits",
"_id": "inherits@2.0.1",
- "_shasum": "b17d08d326b4423e568eff719f91b0b1cbdf69f1",
- "_from": "inherits@>=2.0.1 <2.1.0",
- "_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
+ "_from": "inherits@>=2.0.1 <2.1.0"
}
diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/.travis.yml b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/.travis.yml
new file mode 100644
index 00000000000..a2870dfb162
--- /dev/null
+++ b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/.travis.yml
@@ -0,0 +1,39 @@
+sudo: false
+language: node_js
+before_install:
+ - npm install -g npm
+notifications:
+ email: false
+matrix:
+ include:
+ - node_js: '0.8'
+ env: TASK=test
+ - node_js: '0.10'
+ env: TASK=test
+ - node_js: '0.11'
+ env: TASK=test
+ - node_js: '0.12'
+ env: TASK=test
+ - node_js: 'iojs'
+ env: TASK=test
+ - node_js: 'iojs'
+ env: TASK=browser BROWSER_NAME=opera BROWSER_VERSION="11..latest"
+ - node_js: 'iojs'
+ env: TASK=browser BROWSER_NAME=ie BROWSER_VERSION="9..latest"
+ - node_js: 'iojs'
+ env: TASK=browser BROWSER_NAME=chrome BROWSER_VERSION="39..beta"
+ - node_js: 'iojs'
+ env: TASK=browser BROWSER_NAME=firefox BROWSER_VERSION="34..beta"
+ - node_js: 'iojs'
+ env: TASK=browser BROWSER_NAME=ipad BROWSER_VERSION="6.0..latest"
+ - node_js: 'iojs'
+ env: TASK=browser BROWSER_NAME=iphone BROWSER_VERSION="6.0..latest"
+ - node_js: 'iojs'
+ env: TASK=browser BROWSER_NAME=safari BROWSER_VERSION="5..latest"
+ - node_js: 'iojs'
+ env: TASK=browser BROWSER_NAME=android BROWSER_VERSION="4.0..latest"
+script: "npm run $TASK"
+env:
+ global:
+ - secure: rE2Vvo7vnjabYNULNyLFxOyt98BoJexDqsiOnfiD6kLYYsiQGfr/sbZkPMOFm9qfQG7pjqx+zZWZjGSswhTt+626C0t/njXqug7Yps4c3dFblzGfreQHp7wNX5TFsvrxd6dAowVasMp61sJcRnB2w8cUzoe3RAYUDHyiHktwqMc=
+ - secure: g9YINaKAdMatsJ28G9jCGbSaguXCyxSTy+pBO6Ch0Cf57ZLOTka3HqDj8p3nV28LUIHZ3ut5WO43CeYKwt4AUtLpBS3a0dndHdY6D83uY6b2qh5hXlrcbeQTq2cvw2y95F7hm4D1kwrgZ7ViqaKggRcEupAL69YbJnxeUDKWEdI=
diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/.zuul.yml b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/.zuul.yml
new file mode 100644
index 00000000000..96d9cfbd386
--- /dev/null
+++ b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/.zuul.yml
@@ -0,0 +1 @@
+ui: tape
diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/README.md b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/README.md
index e46b823903d..f9fb5205987 100644
--- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/README.md
+++ b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/README.md
@@ -1,15 +1,36 @@
# readable-stream
-***Node-core streams for userland***
+***Node-core streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream)
+
[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/)
-[![NPM](https://nodei.co/npm-dl/readable-stream.png&months=6&height=3)](https://nodei.co/npm/readable-stream/)
+[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/)
+
+
+[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream)
+
+```bash
+npm install --save readable-stream
+```
+
+***Node-core streams for userland***
-This package is a mirror of the Streams2 and Streams3 implementations in Node-core.
+This package is a mirror of the Streams2 and Streams3 implementations in
+Node-core, including [documentation](doc/stream.markdown).
-If you want to guarantee a stable streams base, regardless of what version of Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core.
+If you want to guarantee a stable streams base, regardless of what version of
+Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html).
-**readable-stream** comes in two major versions, v1.0.x and v1.1.x. The former tracks the Streams2 implementation in Node 0.10, including bug-fixes and minor improvements as they are added. The latter tracks Streams3 as it develops in Node 0.11; we will likely see a v1.2.x branch for Node 0.12.
+As of version 2.0.0 **readable-stream** uses semantic versioning.
-**readable-stream** uses proper patch-level versioning so if you pin to `"~1.0.0"` you’ll get the latest Node 0.10 Streams2 implementation, including any fixes and minor non-breaking improvements. The patch-level versions of 1.0.x and 1.1.x should mirror the patch-level versions of Node-core releases. You should prefer the **1.0.x** releases for now and when you’re ready to start using Streams3, pin to `"~1.1.0"`
+# Streams WG Team Members
+* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) &lt;christopher.s.dickinson@gmail.com&gt;
+ - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B
+* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) &lt;calvin.metcalf@gmail.com&gt;
+ - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242
+* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) &lt;rod@vagg.org&gt;
+ - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D
+* **Sam Newman** ([@sonewman](https://github.com/sonewman)) &lt;newmansam@outlook.com&gt;
+* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) &lt;mathiasbuus@gmail.com&gt;
+* **Domenic Denicola** ([@domenic](https://github.com/domenic)) &lt;d@domenic.me&gt;
diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/doc/stream.markdown b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/doc/stream.markdown
new file mode 100644
index 00000000000..e34dac429bf
--- /dev/null
+++ b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/doc/stream.markdown
@@ -0,0 +1,1651 @@
+# Stream
+
+ Stability: 2 - Stable
+
+A stream is an abstract interface implemented by various objects in
+io.js. For example a [request to an HTTP
+server](https://iojs.org/dist/v2.3.0/doc/api/http.html#http_http_incomingmessage) is a stream, as is
+[stdout][]. Streams are readable, writable, or both. All streams are
+instances of [EventEmitter][]
+
+You can load the Stream base classes by doing `require('stream')`.
+There are base classes provided for [Readable][] streams, [Writable][]
+streams, [Duplex][] streams, and [Transform][] streams.
+
+This document is split up into 3 sections. The first explains the
+parts of the API that you need to be aware of to use streams in your
+programs. If you never implement a streaming API yourself, you can
+stop there.
+
+The second section explains the parts of the API that you need to use
+if you implement your own custom streams yourself. The API is
+designed to make this easy for you to do.
+
+The third section goes into more depth about how streams work,
+including some of the internal mechanisms and functions that you
+should probably not modify unless you definitely know what you are
+doing.
+
+
+## API for Stream Consumers
+
+<!--type=misc-->
+
+Streams can be either [Readable][], [Writable][], or both ([Duplex][]).
+
+All streams are EventEmitters, but they also have other custom methods
+and properties depending on whether they are Readable, Writable, or
+Duplex.
+
+If a stream is both Readable and Writable, then it implements all of
+the methods and events below. So, a [Duplex][] or [Transform][] stream is
+fully described by this API, though their implementation may be
+somewhat different.
+
+It is not necessary to implement Stream interfaces in order to consume
+streams in your programs. If you **are** implementing streaming
+interfaces in your own program, please also refer to
+[API for Stream Implementors][] below.
+
+Almost all io.js programs, no matter how simple, use Streams in some
+way. Here is an example of using Streams in an io.js program:
+
+```javascript
+var http = require('http');
+
+var server = http.createServer(function (req, res) {
+ // req is an http.IncomingMessage, which is a Readable Stream
+ // res is an http.ServerResponse, which is a Writable Stream
+
+ var body = '';
+ // we want to get the data as utf8 strings
+ // If you don't set an encoding, then you'll get Buffer objects
+ req.setEncoding('utf8');
+
+ // Readable streams emit 'data' events once a listener is added
+ req.on('data', function (chunk) {
+ body += chunk;
+ });
+
+ // the end event tells you that you have entire body
+ req.on('end', function () {
+ try {
+ var data = JSON.parse(body);
+ } catch (er) {
+ // uh oh! bad json!
+ res.statusCode = 400;
+ return res.end('error: ' + er.message);
+ }
+
+ // write back something interesting to the user:
+ res.write(typeof data);
+ res.end();
+ });
+});
+
+server.listen(1337);
+
+// $ curl localhost:1337 -d '{}'
+// object
+// $ curl localhost:1337 -d '"foo"'
+// string
+// $ curl localhost:1337 -d 'not json'
+// error: Unexpected token o
+```
+
+### Class: stream.Readable
+
+<!--type=class-->
+
+The Readable stream interface is the abstraction for a *source* of
+data that you are reading from. In other words, data comes *out* of a
+Readable stream.
+
+A Readable stream will not start emitting data until you indicate that
+you are ready to receive it.
+
+Readable streams have two "modes": a **flowing mode** and a **paused
+mode**. When in flowing mode, data is read from the underlying system
+and provided to your program as fast as possible. In paused mode, you
+must explicitly call `stream.read()` to get chunks of data out.
+Streams start out in paused mode.
+
+**Note**: If no data event handlers are attached, and there are no
+[`pipe()`][] destinations, and the stream is switched into flowing
+mode, then data will be lost.
+
+You can switch to flowing mode by doing any of the following:
+
+* Adding a [`'data'` event][] handler to listen for data.
+* Calling the [`resume()`][] method to explicitly open the flow.
+* Calling the [`pipe()`][] method to send the data to a [Writable][].
+
+You can switch back to paused mode by doing either of the following:
+
+* If there are no pipe destinations, by calling the [`pause()`][]
+ method.
+* If there are pipe destinations, by removing any [`'data'` event][]
+ handlers, and removing all pipe destinations by calling the
+ [`unpipe()`][] method.
+
+Note that, for backwards compatibility reasons, removing `'data'`
+event handlers will **not** automatically pause the stream. Also, if
+there are piped destinations, then calling `pause()` will not
+guarantee that the stream will *remain* paused once those
+destinations drain and ask for more data.
+
+Examples of readable streams include:
+
+* [http responses, on the client](https://iojs.org/dist/v2.3.0/doc/api/http.html#http_http_incomingmessage)
+* [http requests, on the server](https://iojs.org/dist/v2.3.0/doc/api/http.html#http_http_incomingmessage)
+* [fs read streams](https://iojs.org/dist/v2.3.0/doc/api/fs.html#fs_class_fs_readstream)
+* [zlib streams][]
+* [crypto streams][]
+* [tcp sockets][]
+* [child process stdout and stderr][]
+* [process.stdin][]
+
+#### Event: 'readable'
+
+When a chunk of data can be read from the stream, it will emit a
+`'readable'` event.
+
+In some cases, listening for a `'readable'` event will cause some data
+to be read into the internal buffer from the underlying system, if it
+hadn't already.
+
+```javascript
+var readable = getReadableStreamSomehow();
+readable.on('readable', function() {
+ // there is some data to read now
+});
+```
+
+Once the internal buffer is drained, a `readable` event will fire
+again when more data is available.
+
+#### Event: 'data'
+
+* `chunk` {Buffer | String} The chunk of data.
+
+Attaching a `data` event listener to a stream that has not been
+explicitly paused will switch the stream into flowing mode. Data will
+then be passed as soon as it is available.
+
+If you just want to get all the data out of the stream as fast as
+possible, this is the best way to do so.
+
+```javascript
+var readable = getReadableStreamSomehow();
+readable.on('data', function(chunk) {
+ console.log('got %d bytes of data', chunk.length);
+});
+```
+
+#### Event: 'end'
+
+This event fires when there will be no more data to read.
+
+Note that the `end` event **will not fire** unless the data is
+completely consumed. This can be done by switching into flowing mode,
+or by calling `read()` repeatedly until you get to the end.
+
+```javascript
+var readable = getReadableStreamSomehow();
+readable.on('data', function(chunk) {
+ console.log('got %d bytes of data', chunk.length);
+});
+readable.on('end', function() {
+ console.log('there will be no more data.');
+});
+```
+
+#### Event: 'close'
+
+Emitted when the underlying resource (for example, the backing file
+descriptor) has been closed. Not all streams will emit this.
+
+#### Event: 'error'
+
+* {Error Object}
+
+Emitted if there was an error receiving data.
+
+#### readable.read([size])
+
+* `size` {Number} Optional argument to specify how much data to read.
+* Return {String | Buffer | null}
+
+The `read()` method pulls some data out of the internal buffer and
+returns it. If there is no data available, then it will return
+`null`.
+
+If you pass in a `size` argument, then it will return that many
+bytes. If `size` bytes are not available, then it will return `null`.
+
+If you do not specify a `size` argument, then it will return all the
+data in the internal buffer.
+
+This method should only be called in paused mode. In flowing mode,
+this method is called automatically until the internal buffer is
+drained.
+
+```javascript
+var readable = getReadableStreamSomehow();
+readable.on('readable', function() {
+ var chunk;
+ while (null !== (chunk = readable.read())) {
+ console.log('got %d bytes of data', chunk.length);
+ }
+});
+```
+
+If this method returns a data chunk, then it will also trigger the
+emission of a [`'data'` event][].
+
+#### readable.setEncoding(encoding)
+
+* `encoding` {String} The encoding to use.
+* Return: `this`
+
+Call this function to cause the stream to return strings of the
+specified encoding instead of Buffer objects. For example, if you do
+`readable.setEncoding('utf8')`, then the output data will be
+interpreted as UTF-8 data, and returned as strings. If you do
+`readable.setEncoding('hex')`, then the data will be encoded in
+hexadecimal string format.
+
+This properly handles multi-byte characters that would otherwise be
+potentially mangled if you simply pulled the Buffers directly and
+called `buf.toString(encoding)` on them. If you want to read the data
+as strings, always use this method.
+
+```javascript
+var readable = getReadableStreamSomehow();
+readable.setEncoding('utf8');
+readable.on('data', function(chunk) {
+ assert.equal(typeof chunk, 'string');
+ console.log('got %d characters of string data', chunk.length);
+});
+```
+
+#### readable.resume()
+
+* Return: `this`
+
+This method will cause the readable stream to resume emitting `data`
+events.
+
+This method will switch the stream into flowing mode. If you do *not*
+want to consume the data from a stream, but you *do* want to get to
+its `end` event, you can call [`readable.resume()`][] to open the flow of
+data.
+
+```javascript
+var readable = getReadableStreamSomehow();
+readable.resume();
+readable.on('end', function() {
+ console.log('got to the end, but did not read anything');
+});
+```
+
+#### readable.pause()
+
+* Return: `this`
+
+This method will cause a stream in flowing mode to stop emitting
+`data` events, switching out of flowing mode. Any data that becomes
+available will remain in the internal buffer.
+
+```javascript
+var readable = getReadableStreamSomehow();
+readable.on('data', function(chunk) {
+ console.log('got %d bytes of data', chunk.length);
+ readable.pause();
+ console.log('there will be no more data for 1 second');
+ setTimeout(function() {
+ console.log('now data will start flowing again');
+ readable.resume();
+ }, 1000);
+});
+```
+
+#### readable.isPaused()
+
+* Return: `Boolean`
+
+This method returns whether or not the `readable` has been **explicitly**
+paused by client code (using `readable.pause()` without a corresponding
+`readable.resume()`).
+
+```javascript
+var readable = new stream.Readable
+
+readable.isPaused() // === false
+readable.pause()
+readable.isPaused() // === true
+readable.resume()
+readable.isPaused() // === false
+```
+
+#### readable.pipe(destination[, options])
+
+* `destination` {[Writable][] Stream} The destination for writing data
+* `options` {Object} Pipe options
+ * `end` {Boolean} End the writer when the reader ends. Default = `true`
+
+This method pulls all the data out of a readable stream, and writes it
+to the supplied destination, automatically managing the flow so that
+the destination is not overwhelmed by a fast readable stream.
+
+Multiple destinations can be piped to safely.
+
+```javascript
+var readable = getReadableStreamSomehow();
+var writable = fs.createWriteStream('file.txt');
+// All the data from readable goes into 'file.txt'
+readable.pipe(writable);
+```
+
+This function returns the destination stream, so you can set up pipe
+chains like so:
+
+```javascript
+var r = fs.createReadStream('file.txt');
+var z = zlib.createGzip();
+var w = fs.createWriteStream('file.txt.gz');
+r.pipe(z).pipe(w);
+```
+
+For example, emulating the Unix `cat` command:
+
+```javascript
+process.stdin.pipe(process.stdout);
+```
+
+By default [`end()`][] is called on the destination when the source stream
+emits `end`, so that `destination` is no longer writable. Pass `{ end:
+false }` as `options` to keep the destination stream open.
+
+This keeps `writer` open so that "Goodbye" can be written at the
+end.
+
+```javascript
+reader.pipe(writer, { end: false });
+reader.on('end', function() {
+ writer.end('Goodbye\n');
+});
+```
+
+Note that `process.stderr` and `process.stdout` are never closed until
+the process exits, regardless of the specified options.
+
+#### readable.unpipe([destination])
+
+* `destination` {[Writable][] Stream} Optional specific stream to unpipe
+
+This method will remove the hooks set up for a previous `pipe()` call.
+
+If the destination is not specified, then all pipes are removed.
+
+If the destination is specified, but no pipe is set up for it, then
+this is a no-op.
+
+```javascript
+var readable = getReadableStreamSomehow();
+var writable = fs.createWriteStream('file.txt');
+// All the data from readable goes into 'file.txt',
+// but only for the first second
+readable.pipe(writable);
+setTimeout(function() {
+ console.log('stop writing to file.txt');
+ readable.unpipe(writable);
+ console.log('manually close the file stream');
+ writable.end();
+}, 1000);
+```
+
+#### readable.unshift(chunk)
+
+* `chunk` {Buffer | String} Chunk of data to unshift onto the read queue
+
+This is useful in certain cases where a stream is being consumed by a
+parser, which needs to "un-consume" some data that it has
+optimistically pulled out of the source, so that the stream can be
+passed on to some other party.
+
+If you find that you must often call `stream.unshift(chunk)` in your
+programs, consider implementing a [Transform][] stream instead. (See API
+for Stream Implementors, below.)
+
+```javascript
+// Pull off a header delimited by \n\n
+// use unshift() if we get too much
+// Call the callback with (error, header, stream)
+var StringDecoder = require('string_decoder').StringDecoder;
+function parseHeader(stream, callback) {
+ stream.on('error', callback);
+ stream.on('readable', onReadable);
+ var decoder = new StringDecoder('utf8');
+ var header = '';
+ function onReadable() {
+ var chunk;
+ while (null !== (chunk = stream.read())) {
+ var str = decoder.write(chunk);
+ if (str.match(/\n\n/)) {
+ // found the header boundary
+ var split = str.split(/\n\n/);
+ header += split.shift();
+ var remaining = split.join('\n\n');
+ var buf = new Buffer(remaining, 'utf8');
+ if (buf.length)
+ stream.unshift(buf);
+ stream.removeListener('error', callback);
+ stream.removeListener('readable', onReadable);
+ // now the body of the message can be read from the stream.
+ callback(null, header, stream);
+ } else {
+ // still reading the header.
+ header += str;
+ }
+ }
+ }
+}
+```
+
+#### readable.wrap(stream)
+
+* `stream` {Stream} An "old style" readable stream
+
+Versions of Node.js prior to v0.10 had streams that did not implement the
+entire Streams API as it is today. (See "Compatibility" below for
+more information.)
+
+If you are using an older io.js library that emits `'data'` events and
+has a [`pause()`][] method that is advisory only, then you can use the
+`wrap()` method to create a [Readable][] stream that uses the old stream
+as its data source.
+
+You will very rarely ever need to call this function, but it exists
+as a convenience for interacting with old io.js programs and libraries.
+
+For example:
+
+```javascript
+var OldReader = require('./old-api-module.js').OldReader;
+var oreader = new OldReader;
+var Readable = require('stream').Readable;
+var myReader = new Readable().wrap(oreader);
+
+myReader.on('readable', function() {
+ myReader.read(); // etc.
+});
+```
+
+
+### Class: stream.Writable
+
+<!--type=class-->
+
+The Writable stream interface is an abstraction for a *destination*
+that you are writing data *to*.
+
+Examples of writable streams include:
+
+* [http requests, on the client](https://iojs.org/dist/v2.3.0/doc/api/http.html#http_class_http_clientrequest)
+* [http responses, on the server](https://iojs.org/dist/v2.3.0/doc/api/http.html#http_class_http_serverresponse)
+* [fs write streams](https://iojs.org/dist/v2.3.0/doc/api/fs.html#fs_class_fs_writestream)
+* [zlib streams][]
+* [crypto streams][]
+* [tcp sockets][]
+* [child process stdin](https://iojs.org/dist/v2.3.0/doc/api/child_process.html#child_process_child_stdin)
+* [process.stdout][], [process.stderr][]
+
+#### writable.write(chunk[, encoding][, callback])
+
+* `chunk` {String | Buffer} The data to write
+* `encoding` {String} The encoding, if `chunk` is a String
+* `callback` {Function} Callback for when this chunk of data is flushed
+* Returns: {Boolean} True if the data was handled completely.
+
+This method writes some data to the underlying system, and calls the
+supplied callback once the data has been fully handled.
+
+The return value indicates if you should continue writing right now.
+If the data had to be buffered internally, then it will return
+`false`. Otherwise, it will return `true`.
+
+This return value is strictly advisory. You MAY continue to write,
+even if it returns `false`. However, writes will be buffered in
+memory, so it is best not to do this excessively. Instead, wait for
+the `drain` event before writing more data.
+
+#### Event: 'drain'
+
+If a [`writable.write(chunk)`][] call returns false, then the `drain`
+event will indicate when it is appropriate to begin writing more data
+to the stream.
+
+```javascript
+// Write the data to the supplied writable stream 1MM times.
+// Be attentive to back-pressure.
+function writeOneMillionTimes(writer, data, encoding, callback) {
+ var i = 1000000;
+ write();
+ function write() {
+ var ok = true;
+ do {
+ i -= 1;
+ if (i === 0) {
+ // last time!
+ writer.write(data, encoding, callback);
+ } else {
+ // see if we should continue, or wait
+ // don't pass the callback, because we're not done yet.
+ ok = writer.write(data, encoding);
+ }
+ } while (i > 0 && ok);
+ if (i > 0) {
+ // had to stop early!
+ // write some more once it drains
+ writer.once('drain', write);
+ }
+ }
+}
+```
+
+#### writable.cork()
+
+Forces buffering of all writes.
+
+Buffered data will be flushed either at `.uncork()` or at `.end()` call.
+
+#### writable.uncork()
+
+Flush all data, buffered since `.cork()` call.
+
+#### writable.setDefaultEncoding(encoding)
+
+* `encoding` {String} The new default encoding
+
+Sets the default encoding for a writable stream.
+
+#### writable.end([chunk][, encoding][, callback])
+
+* `chunk` {String | Buffer} Optional data to write
+* `encoding` {String} The encoding, if `chunk` is a String
+* `callback` {Function} Optional callback for when the stream is finished
+
+Call this method when no more data will be written to the stream. If
+supplied, the callback is attached as a listener on the `finish` event.
+
+Calling [`write()`][] after calling [`end()`][] will raise an error.
+
+```javascript
+// write 'hello, ' and then end with 'world!'
+var file = fs.createWriteStream('example.txt');
+file.write('hello, ');
+file.end('world!');
+// writing more now is not allowed!
+```
+
+#### Event: 'finish'
+
+When the [`end()`][] method has been called, and all data has been flushed
+to the underlying system, this event is emitted.
+
+```javascript
+var writer = getWritableStreamSomehow();
+for (var i = 0; i < 100; i ++) {
+ writer.write('hello, #' + i + '!\n');
+}
+writer.end('this is the end\n');
+writer.on('finish', function() {
+ console.error('all writes are now complete.');
+});
+```
+
+#### Event: 'pipe'
+
+* `src` {[Readable][] Stream} source stream that is piping to this writable
+
+This is emitted whenever the `pipe()` method is called on a readable
+stream, adding this writable to its set of destinations.
+
+```javascript
+var writer = getWritableStreamSomehow();
+var reader = getReadableStreamSomehow();
+writer.on('pipe', function(src) {
+ console.error('something is piping into the writer');
+ assert.equal(src, reader);
+});
+reader.pipe(writer);
+```
+
+#### Event: 'unpipe'
+
+* `src` {[Readable][] Stream} The source stream that [unpiped][] this writable
+
+This is emitted whenever the [`unpipe()`][] method is called on a
+readable stream, removing this writable from its set of destinations.
+
+```javascript
+var writer = getWritableStreamSomehow();
+var reader = getReadableStreamSomehow();
+writer.on('unpipe', function(src) {
+ console.error('something has stopped piping into the writer');
+ assert.equal(src, reader);
+});
+reader.pipe(writer);
+reader.unpipe(writer);
+```
+
+#### Event: 'error'
+
+* {Error object}
+
+Emitted if there was an error when writing or piping data.
+
+### Class: stream.Duplex
+
+Duplex streams are streams that implement both the [Readable][] and
+[Writable][] interfaces. See above for usage.
+
+Examples of Duplex streams include:
+
+* [tcp sockets][]
+* [zlib streams][]
+* [crypto streams][]
+
+
+### Class: stream.Transform
+
+Transform streams are [Duplex][] streams where the output is in some way
+computed from the input. They implement both the [Readable][] and
+[Writable][] interfaces. See above for usage.
+
+Examples of Transform streams include:
+
+* [zlib streams][]
+* [crypto streams][]
+
+
+## API for Stream Implementors
+
+<!--type=misc-->
+
+To implement any sort of stream, the pattern is the same:
+
+1. Extend the appropriate parent class in your own subclass. (The
+ [`util.inherits`][] method is particularly helpful for this.)
+2. Call the appropriate parent class constructor in your constructor,
+ to be sure that the internal mechanisms are set up properly.
+2. Implement one or more specific methods, as detailed below.
+
+The class to extend and the method(s) to implement depend on the sort
+of stream class you are writing:
+
+<table>
+ <thead>
+ <tr>
+ <th>
+ <p>Use-case</p>
+ </th>
+ <th>
+ <p>Class</p>
+ </th>
+ <th>
+ <p>Method(s) to implement</p>
+ </th>
+ </tr>
+ </thead>
+ <tr>
+ <td>
+ <p>Reading only</p>
+ </td>
+ <td>
+ <p>[Readable](#stream_class_stream_readable_1)</p>
+ </td>
+ <td>
+ <p><code>[_read][]</code></p>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <p>Writing only</p>
+ </td>
+ <td>
+ <p>[Writable](#stream_class_stream_writable_1)</p>
+ </td>
+ <td>
+ <p><code>[_write][]</code>, <code>_writev</code></p>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <p>Reading and writing</p>
+ </td>
+ <td>
+ <p>[Duplex](#stream_class_stream_duplex_1)</p>
+ </td>
+ <td>
+ <p><code>[_read][]</code>, <code>[_write][]</code>, <code>_writev</code></p>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <p>Operate on written data, then read the result</p>
+ </td>
+ <td>
+ <p>[Transform](#stream_class_stream_transform_1)</p>
+ </td>
+ <td>
+ <p><code>_transform</code>, <code>_flush</code></p>
+ </td>
+ </tr>
+</table>
+
+In your implementation code, it is very important to never call the
+methods described in [API for Stream Consumers][] above. Otherwise, you
+can potentially cause adverse side effects in programs that consume
+your streaming interfaces.
+
+### Class: stream.Readable
+
+<!--type=class-->
+
+`stream.Readable` is an abstract class designed to be extended with an
+underlying implementation of the [`_read(size)`][] method.
+
+Please see above under [API for Stream Consumers][] for how to consume
+streams in your programs. What follows is an explanation of how to
+implement Readable streams in your programs.
+
+#### Example: A Counting Stream
+
+<!--type=example-->
+
+This is a basic example of a Readable stream. It emits the numerals
+from 1 to 1,000,000 in ascending order, and then ends.
+
+```javascript
+var Readable = require('stream').Readable;
+var util = require('util');
+util.inherits(Counter, Readable);
+
+function Counter(opt) {
+ Readable.call(this, opt);
+ this._max = 1000000;
+ this._index = 1;
+}
+
+Counter.prototype._read = function() {
+ var i = this._index++;
+ if (i > this._max)
+ this.push(null);
+ else {
+ var str = '' + i;
+ var buf = new Buffer(str, 'ascii');
+ this.push(buf);
+ }
+};
+```
+
+#### Example: SimpleProtocol v1 (Sub-optimal)
+
+This is similar to the `parseHeader` function described above, but
+implemented as a custom stream. Also, note that this implementation
+does not convert the incoming data to a string.
+
+However, this would be better implemented as a [Transform][] stream. See
+below for a better implementation.
+
+```javascript
+// A parser for a simple data protocol.
+// The "header" is a JSON object, followed by 2 \n characters, and
+// then a message body.
+//
+// NOTE: This can be done more simply as a Transform stream!
+// Using Readable directly for this is sub-optimal. See the
+// alternative example below under the Transform section.
+
+var Readable = require('stream').Readable;
+var util = require('util');
+
+util.inherits(SimpleProtocol, Readable);
+
+function SimpleProtocol(source, options) {
+ if (!(this instanceof SimpleProtocol))
+ return new SimpleProtocol(source, options);
+
+ Readable.call(this, options);
+ this._inBody = false;
+ this._sawFirstCr = false;
+
+ // source is a readable stream, such as a socket or file
+ this._source = source;
+
+ var self = this;
+ source.on('end', function() {
+ self.push(null);
+ });
+
+ // give it a kick whenever the source is readable
+ // read(0) will not consume any bytes
+ source.on('readable', function() {
+ self.read(0);
+ });
+
+ this._rawHeader = [];
+ this.header = null;
+}
+
+SimpleProtocol.prototype._read = function(n) {
+ if (!this._inBody) {
+ var chunk = this._source.read();
+
+ // if the source doesn't have data, we don't have data yet.
+ if (chunk === null)
+ return this.push('');
+
+ // check if the chunk has a \n\n
+ var split = -1;
+ for (var i = 0; i < chunk.length; i++) {
+ if (chunk[i] === 10) { // '\n'
+ if (this._sawFirstCr) {
+ split = i;
+ break;
+ } else {
+ this._sawFirstCr = true;
+ }
+ } else {
+ this._sawFirstCr = false;
+ }
+ }
+
+ if (split === -1) {
+ // still waiting for the \n\n
+ // stash the chunk, and try again.
+ this._rawHeader.push(chunk);
+ this.push('');
+ } else {
+ this._inBody = true;
+ var h = chunk.slice(0, split);
+ this._rawHeader.push(h);
+ var header = Buffer.concat(this._rawHeader).toString();
+ try {
+ this.header = JSON.parse(header);
+ } catch (er) {
+ this.emit('error', new Error('invalid simple protocol data'));
+ return;
+ }
+ // now, because we got some extra data, unshift the rest
+ // back into the read queue so that our consumer will see it.
+ var b = chunk.slice(split);
+ this.unshift(b);
+
+ // and let them know that we are done parsing the header.
+ this.emit('header', this.header);
+ }
+ } else {
+ // from there on, just provide the data to our consumer.
+ // careful not to push(null), since that would indicate EOF.
+ var chunk = this._source.read();
+ if (chunk) this.push(chunk);
+ }
+};
+
+// Usage:
+// var parser = new SimpleProtocol(source);
+// Now parser is a readable stream that will emit 'header'
+// with the parsed header data.
+```
+
+
+#### new stream.Readable([options])
+
+* `options` {Object}
+ * `highWaterMark` {Number} The maximum number of bytes to store in
+ the internal buffer before ceasing to read from the underlying
+ resource. Default=16kb, or 16 for `objectMode` streams
+ * `encoding` {String} If specified, then buffers will be decoded to
+ strings using the specified encoding. Default=null
+ * `objectMode` {Boolean} Whether this stream should behave
+ as a stream of objects. Meaning that stream.read(n) returns
+ a single value instead of a Buffer of size n. Default=false
+
+In classes that extend the Readable class, make sure to call the
+Readable constructor so that the buffering settings can be properly
+initialized.
+
+#### readable.\_read(size)
+
+* `size` {Number} Number of bytes to read asynchronously
+
+Note: **Implement this function, but do NOT call it directly.**
+
+This function should NOT be called directly. It should be implemented
+by child classes, and only called by the internal Readable class
+methods.
+
+All Readable stream implementations must provide a `_read` method to
+fetch data from the underlying resource.
+
+This method is prefixed with an underscore because it is internal to
+the class that defines it, and should not be called directly by user
+programs. However, you **are** expected to override this method in
+your own extension classes.
+
+When data is available, put it into the read queue by calling
+`readable.push(chunk)`. If `push` returns false, then you should stop
+reading. When `_read` is called again, you should start pushing more
+data.
+
+The `size` argument is advisory. Implementations where a "read" is a
+single call that returns data can use this to know how much data to
+fetch. Implementations where that is not relevant, such as TCP or
+TLS, may ignore this argument, and simply provide data whenever it
+becomes available. There is no need, for example to "wait" until
+`size` bytes are available before calling [`stream.push(chunk)`][].
+
+#### readable.push(chunk[, encoding])
+
+* `chunk` {Buffer | null | String} Chunk of data to push into the read queue
+* `encoding` {String} Encoding of String chunks. Must be a valid
+ Buffer encoding, such as `'utf8'` or `'ascii'`
+* return {Boolean} Whether or not more pushes should be performed
+
+Note: **This function should be called by Readable implementors, NOT
+by consumers of Readable streams.**
+
+The `_read()` function will not be called again until at least one
+`push(chunk)` call is made.
+
+The `Readable` class works by putting data into a read queue to be
+pulled out later by calling the `read()` method when the `'readable'`
+event fires.
+
+The `push()` method will explicitly insert some data into the read
+queue. If it is called with `null` then it will signal the end of the
+data (EOF).
+
+This API is designed to be as flexible as possible. For example,
+you may be wrapping a lower-level source which has some sort of
+pause/resume mechanism, and a data callback. In those cases, you
+could wrap the low-level source object by doing something like this:
+
+```javascript
+// source is an object with readStop() and readStart() methods,
+// and an `ondata` member that gets called when it has data, and
+// an `onend` member that gets called when the data is over.
+
+util.inherits(SourceWrapper, Readable);
+
+function SourceWrapper(options) {
+ Readable.call(this, options);
+
+ this._source = getLowlevelSourceObject();
+ var self = this;
+
+ // Every time there's data, we push it into the internal buffer.
+ this._source.ondata = function(chunk) {
+ // if push() returns false, then we need to stop reading from source
+ if (!self.push(chunk))
+ self._source.readStop();
+ };
+
+ // When the source ends, we push the EOF-signaling `null` chunk
+ this._source.onend = function() {
+ self.push(null);
+ };
+}
+
+// _read will be called when the stream wants to pull more data in
+// the advisory size argument is ignored in this case.
+SourceWrapper.prototype._read = function(size) {
+ this._source.readStart();
+};
+```
+
+
+### Class: stream.Writable
+
+<!--type=class-->
+
+`stream.Writable` is an abstract class designed to be extended with an
+underlying implementation of the [`_write(chunk, encoding, callback)`][] method.
+
+Please see above under [API for Stream Consumers][] for how to consume
+writable streams in your programs. What follows is an explanation of
+how to implement Writable streams in your programs.
+
+#### new stream.Writable([options])
+
+* `options` {Object}
+ * `highWaterMark` {Number} Buffer level when [`write()`][] starts
+ returning false. Default=16kb, or 16 for `objectMode` streams
+ * `decodeStrings` {Boolean} Whether or not to decode strings into
+ Buffers before passing them to [`_write()`][]. Default=true
+ * `objectMode` {Boolean} Whether or not the `write(anyObj)` is
+ a valid operation. If set you can write arbitrary data instead
+ of only `Buffer` / `String` data. Default=false
+
+In classes that extend the Writable class, make sure to call the
+constructor so that the buffering settings can be properly
+initialized.
+
+#### writable.\_write(chunk, encoding, callback)
+
+* `chunk` {Buffer | String} The chunk to be written. Will **always**
+ be a buffer unless the `decodeStrings` option was set to `false`.
+* `encoding` {String} If the chunk is a string, then this is the
+ encoding type. If chunk is a buffer, then this is the special
+ value - 'buffer', ignore it in this case.
+* `callback` {Function} Call this function (optionally with an error
+ argument) when you are done processing the supplied chunk.
+
+All Writable stream implementations must provide a [`_write()`][]
+method to send data to the underlying resource.
+
+Note: **This function MUST NOT be called directly.** It should be
+implemented by child classes, and called by the internal Writable
+class methods only.
+
+Call the callback using the standard `callback(error)` pattern to
+signal that the write completed successfully or with an error.
+
+If the `decodeStrings` flag is set in the constructor options, then
+`chunk` may be a string rather than a Buffer, and `encoding` will
+indicate the sort of string that it is. This is to support
+implementations that have an optimized handling for certain string
+data encodings. If you do not explicitly set the `decodeStrings`
+option to `false`, then you can safely ignore the `encoding` argument,
+and assume that `chunk` will always be a Buffer.
+
+This method is prefixed with an underscore because it is internal to
+the class that defines it, and should not be called directly by user
+programs. However, you **are** expected to override this method in
+your own extension classes.
+
+#### writable.\_writev(chunks, callback)
+
+* `chunks` {Array} The chunks to be written. Each chunk has following
+ format: `{ chunk: ..., encoding: ... }`.
+* `callback` {Function} Call this function (optionally with an error
+ argument) when you are done processing the supplied chunks.
+
+Note: **This function MUST NOT be called directly.** It may be
+implemented by child classes, and called by the internal Writable
+class methods only.
+
+This function is completely optional to implement. In most cases it is
+unnecessary. If implemented, it will be called with all the chunks
+that are buffered in the write queue.
+
+
+### Class: stream.Duplex
+
+<!--type=class-->
+
+A "duplex" stream is one that is both Readable and Writable, such as a
+TCP socket connection.
+
+Note that `stream.Duplex` is an abstract class designed to be extended
+with an underlying implementation of the `_read(size)` and
+[`_write(chunk, encoding, callback)`][] methods as you would with a
+Readable or Writable stream class.
+
+Since JavaScript doesn't have multiple prototypal inheritance, this
+class prototypally inherits from Readable, and then parasitically from
+Writable. It is thus up to the user to implement both the lowlevel
+`_read(n)` method as well as the lowlevel
+[`_write(chunk, encoding, callback)`][] method on extension duplex classes.
+
+#### new stream.Duplex(options)
+
+* `options` {Object} Passed to both Writable and Readable
+ constructors. Also has the following fields:
+ * `allowHalfOpen` {Boolean} Default=true. If set to `false`, then
+ the stream will automatically end the readable side when the
+ writable side ends and vice versa.
+ * `readableObjectMode` {Boolean} Default=false. Sets `objectMode`
+ for readable side of the stream. Has no effect if `objectMode`
+ is `true`.
+ * `writableObjectMode` {Boolean} Default=false. Sets `objectMode`
+ for writable side of the stream. Has no effect if `objectMode`
+ is `true`.
+
+In classes that extend the Duplex class, make sure to call the
+constructor so that the buffering settings can be properly
+initialized.
+
+
+### Class: stream.Transform
+
+A "transform" stream is a duplex stream where the output is causally
+connected in some way to the input, such as a [zlib][] stream or a
+[crypto][] stream.
+
+There is no requirement that the output be the same size as the input,
+the same number of chunks, or arrive at the same time. For example, a
+Hash stream will only ever have a single chunk of output which is
+provided when the input is ended. A zlib stream will produce output
+that is either much smaller or much larger than its input.
+
+Rather than implement the [`_read()`][] and [`_write()`][] methods, Transform
+classes must implement the `_transform()` method, and may optionally
+also implement the `_flush()` method. (See below.)
+
+#### new stream.Transform([options])
+
+* `options` {Object} Passed to both Writable and Readable
+ constructors.
+
+In classes that extend the Transform class, make sure to call the
+constructor so that the buffering settings can be properly
+initialized.
+
+#### transform.\_transform(chunk, encoding, callback)
+
+* `chunk` {Buffer | String} The chunk to be transformed. Will **always**
+ be a buffer unless the `decodeStrings` option was set to `false`.
+* `encoding` {String} If the chunk is a string, then this is the
+ encoding type. If chunk is a buffer, then this is the special
+ value - 'buffer', ignore it in this case.
+* `callback` {Function} Call this function (optionally with an error
+ argument and data) when you are done processing the supplied chunk.
+
+Note: **This function MUST NOT be called directly.** It should be
+implemented by child classes, and called by the internal Transform
+class methods only.
+
+All Transform stream implementations must provide a `_transform`
+method to accept input and produce output.
+
+`_transform` should do whatever has to be done in this specific
+Transform class, to handle the bytes being written, and pass them off
+to the readable portion of the interface. Do asynchronous I/O,
+process things, and so on.
+
+Call `transform.push(outputChunk)` 0 or more times to generate output
+from this input chunk, depending on how much data you want to output
+as a result of this chunk.
+
+Call the callback function only when the current chunk is completely
+consumed. Note that there may or may not be output as a result of any
+particular input chunk. If you supply output as the second argument to the
+callback, it will be passed to push method, in other words the following are
+equivalent:
+
+```javascript
+transform.prototype._transform = function (data, encoding, callback) {
+ this.push(data);
+ callback();
+}
+
+transform.prototype._transform = function (data, encoding, callback) {
+ callback(null, data);
+}
+```
+
+This method is prefixed with an underscore because it is internal to
+the class that defines it, and should not be called directly by user
+programs. However, you **are** expected to override this method in
+your own extension classes.
+
+#### transform.\_flush(callback)
+
+* `callback` {Function} Call this function (optionally with an error
+ argument) when you are done flushing any remaining data.
+
+Note: **This function MUST NOT be called directly.** It MAY be implemented
+by child classes, and if so, will be called by the internal Transform
+class methods only.
+
+In some cases, your transform operation may need to emit a bit more
+data at the end of the stream. For example, a `Zlib` compression
+stream will store up some internal state so that it can optimally
+compress the output. At the end, however, it needs to do the best it
+can with what is left, so that the data will be complete.
+
+In those cases, you can implement a `_flush` method, which will be
+called at the very end, after all the written data is consumed, but
+before emitting `end` to signal the end of the readable side. Just
+like with `_transform`, call `transform.push(chunk)` zero or more
+times, as appropriate, and call `callback` when the flush operation is
+complete.
+
+This method is prefixed with an underscore because it is internal to
+the class that defines it, and should not be called directly by user
+programs. However, you **are** expected to override this method in
+your own extension classes.
+
+#### Events: 'finish' and 'end'
+
+The [`finish`][] and [`end`][] events are from the parent Writable
+and Readable classes respectively. The `finish` event is fired after
+`.end()` is called and all chunks have been processed by `_transform`,
+`end` is fired after all data has been output which is after the callback
+in `_flush` has been called.
+
+#### Example: `SimpleProtocol` parser v2
+
+The example above of a simple protocol parser can be implemented
+simply by using the higher level [Transform][] stream class, similar to
+the `parseHeader` and `SimpleProtocol v1` examples above.
+
+In this example, rather than providing the input as an argument, it
+would be piped into the parser, which is a more idiomatic io.js stream
+approach.
+
+```javascript
+var util = require('util');
+var Transform = require('stream').Transform;
+util.inherits(SimpleProtocol, Transform);
+
+function SimpleProtocol(options) {
+ if (!(this instanceof SimpleProtocol))
+ return new SimpleProtocol(options);
+
+ Transform.call(this, options);
+ this._inBody = false;
+ this._sawFirstCr = false;
+ this._rawHeader = [];
+ this.header = null;
+}
+
+SimpleProtocol.prototype._transform = function(chunk, encoding, done) {
+ if (!this._inBody) {
+ // check if the chunk has a \n\n
+ var split = -1;
+ for (var i = 0; i < chunk.length; i++) {
+ if (chunk[i] === 10) { // '\n'
+ if (this._sawFirstCr) {
+ split = i;
+ break;
+ } else {
+ this._sawFirstCr = true;
+ }
+ } else {
+ this._sawFirstCr = false;
+ }
+ }
+
+ if (split === -1) {
+ // still waiting for the \n\n
+ // stash the chunk, and try again.
+ this._rawHeader.push(chunk);
+ } else {
+ this._inBody = true;
+ var h = chunk.slice(0, split);
+ this._rawHeader.push(h);
+ var header = Buffer.concat(this._rawHeader).toString();
+ try {
+ this.header = JSON.parse(header);
+ } catch (er) {
+ this.emit('error', new Error('invalid simple protocol data'));
+ return;
+ }
+ // and let them know that we are done parsing the header.
+ this.emit('header', this.header);
+
+ // now, because we got some extra data, emit this first.
+ this.push(chunk.slice(split));
+ }
+ } else {
+ // from there on, just provide the data to our consumer as-is.
+ this.push(chunk);
+ }
+ done();
+};
+
+// Usage:
+// var parser = new SimpleProtocol();
+// source.pipe(parser)
+// Now parser is a readable stream that will emit 'header'
+// with the parsed header data.
+```
+
+
+### Class: stream.PassThrough
+
+This is a trivial implementation of a [Transform][] stream that simply
+passes the input bytes across to the output. Its purpose is mainly
+for examples and testing, but there are occasionally use cases where
+it can come in handy as a building block for novel sorts of streams.
+
+
+## Simplified Constructor API
+
+<!--type=misc-->
+
+In simple cases there is now the added benefit of being able to construct a stream without inheritance.
+
+This can be done by passing the appropriate methods as constructor options:
+
+Examples:
+
+### Readable
+```javascript
+var readable = new stream.Readable({
+ read: function(n) {
+ // sets this._read under the hood
+ }
+});
+```
+
+### Writable
+```javascript
+var writable = new stream.Writable({
+ write: function(chunk, encoding, next) {
+ // sets this._write under the hood
+ }
+});
+
+// or
+
+var writable = new stream.Writable({
+ writev: function(chunks, next) {
+ // sets this._writev under the hood
+ }
+});
+```
+
+### Duplex
+```javascript
+var duplex = new stream.Duplex({
+ read: function(n) {
+ // sets this._read under the hood
+ },
+ write: function(chunk, encoding, next) {
+ // sets this._write under the hood
+ }
+});
+
+// or
+
+var duplex = new stream.Duplex({
+ read: function(n) {
+ // sets this._read under the hood
+ },
+ writev: function(chunks, next) {
+ // sets this._writev under the hood
+ }
+});
+```
+
+### Transform
+```javascript
+var transform = new stream.Transform({
+ transform: function(chunk, encoding, next) {
+ // sets this._transform under the hood
+ },
+ flush: function(done) {
+ // sets this._flush under the hood
+ }
+});
+```
+
+## Streams: Under the Hood
+
+<!--type=misc-->
+
+### Buffering
+
+<!--type=misc-->
+
+Both Writable and Readable streams will buffer data on an internal
+object called `_writableState.buffer` or `_readableState.buffer`,
+respectively.
+
+The amount of data that will potentially be buffered depends on the
+`highWaterMark` option which is passed into the constructor.
+
+Buffering in Readable streams happens when the implementation calls
+[`stream.push(chunk)`][]. If the consumer of the Stream does not call
+`stream.read()`, then the data will sit in the internal queue until it
+is consumed.
+
+Buffering in Writable streams happens when the user calls
+[`stream.write(chunk)`][] repeatedly, even when `write()` returns `false`.
+
+The purpose of streams, especially with the `pipe()` method, is to
+limit the buffering of data to acceptable levels, so that sources and
+destinations of varying speed will not overwhelm the available memory.
+
+### `stream.read(0)`
+
+There are some cases where you want to trigger a refresh of the
+underlying readable stream mechanisms, without actually consuming any
+data. In that case, you can call `stream.read(0)`, which will always
+return null.
+
+If the internal read buffer is below the `highWaterMark`, and the
+stream is not currently reading, then calling `read(0)` will trigger
+a low-level `_read` call.
+
+There is almost never a need to do this. However, you will see some
+cases in io.js's internals where this is done, particularly in the
+Readable stream class internals.
+
+### `stream.push('')`
+
+Pushing a zero-byte string or Buffer (when not in [Object mode][]) has an
+interesting side effect. Because it *is* a call to
+[`stream.push()`][], it will end the `reading` process. However, it
+does *not* add any data to the readable buffer, so there's nothing for
+a user to consume.
+
+Very rarely, there are cases where you have no data to provide now,
+but the consumer of your stream (or, perhaps, another bit of your own
+code) will know when to check again, by calling `stream.read(0)`. In
+those cases, you *may* call `stream.push('')`.
+
+So far, the only use case for this functionality is in the
+[tls.CryptoStream][] class, which is deprecated in io.js v1.0. If you
+find that you have to use `stream.push('')`, please consider another
+approach, because it almost certainly indicates that something is
+horribly wrong.
+
+### Compatibility with Older Node.js Versions
+
+<!--type=misc-->
+
+In versions of Node.js prior to v0.10, the Readable stream interface was
+simpler, but also less powerful and less useful.
+
+* Rather than waiting for you to call the `read()` method, `'data'`
+ events would start emitting immediately. If you needed to do some
+ I/O to decide how to handle data, then you had to store the chunks
+ in some kind of buffer so that they would not be lost.
+* The [`pause()`][] method was advisory, rather than guaranteed. This
+ meant that you still had to be prepared to receive `'data'` events
+ even when the stream was in a paused state.
+
+In io.js v1.0 and Node.js v0.10, the Readable class described below was added.
+For backwards compatibility with older Node.js programs, Readable streams
+switch into "flowing mode" when a `'data'` event handler is added, or
+when the [`resume()`][] method is called. The effect is that, even if
+you are not using the new `read()` method and `'readable'` event, you
+no longer have to worry about losing `'data'` chunks.
+
+Most programs will continue to function normally. However, this
+introduces an edge case in the following conditions:
+
+* No [`'data'` event][] handler is added.
+* The [`resume()`][] method is never called.
+* The stream is not piped to any writable destination.
+
+For example, consider the following code:
+
+```javascript
+// WARNING! BROKEN!
+net.createServer(function(socket) {
+
+ // we add an 'end' method, but never consume the data
+ socket.on('end', function() {
+ // It will never get here.
+ socket.end('I got your message (but didnt read it)\n');
+ });
+
+}).listen(1337);
+```
+
+In versions of Node.js prior to v0.10, the incoming message data would be
+simply discarded. However, in io.js v1.0 and Node.js v0.10 and beyond,
+the socket will remain paused forever.
+
+The workaround in this situation is to call the `resume()` method to
+start the flow of data:
+
+```javascript
+// Workaround
+net.createServer(function(socket) {
+
+ socket.on('end', function() {
+ socket.end('I got your message (but didnt read it)\n');
+ });
+
+ // start the flow of data, discarding it.
+ socket.resume();
+
+}).listen(1337);
+```
+
+In addition to new Readable streams switching into flowing mode,
+pre-v0.10 style streams can be wrapped in a Readable class using the
+`wrap()` method.
+
+
+### Object Mode
+
+<!--type=misc-->
+
+Normally, Streams operate on Strings and Buffers exclusively.
+
+Streams that are in **object mode** can emit generic JavaScript values
+other than Buffers and Strings.
+
+A Readable stream in object mode will always return a single item from
+a call to `stream.read(size)`, regardless of what the size argument
+is.
+
+A Writable stream in object mode will always ignore the `encoding`
+argument to `stream.write(data, encoding)`.
+
+The special value `null` still retains its special value for object
+mode streams. That is, for object mode readable streams, `null` as a
+return value from `stream.read()` indicates that there is no more
+data, and [`stream.push(null)`][] will signal the end of stream data
+(`EOF`).
+
+No streams in io.js core are object mode streams. This pattern is only
+used by userland streaming libraries.
+
+You should set `objectMode` in your stream child class constructor on
+the options object. Setting `objectMode` mid-stream is not safe.
+
+For Duplex streams `objectMode` can be set exclusively for readable or
+writable side with `readableObjectMode` and `writableObjectMode`
+respectively. These options can be used to implement parsers and
+serializers with Transform streams.
+
+```javascript
+var util = require('util');
+var StringDecoder = require('string_decoder').StringDecoder;
+var Transform = require('stream').Transform;
+util.inherits(JSONParseStream, Transform);
+
+// Gets \n-delimited JSON string data, and emits the parsed objects
+function JSONParseStream() {
+ if (!(this instanceof JSONParseStream))
+ return new JSONParseStream();
+
+ Transform.call(this, { readableObjectMode : true });
+
+ this._buffer = '';
+ this._decoder = new StringDecoder('utf8');
+}
+
+JSONParseStream.prototype._transform = function(chunk, encoding, cb) {
+ this._buffer += this._decoder.write(chunk);
+ // split on newlines
+ var lines = this._buffer.split(/\r?\n/);
+ // keep the last partial line buffered
+ this._buffer = lines.pop();
+ for (var l = 0; l < lines.length; l++) {
+ var line = lines[l];
+ try {
+ var obj = JSON.parse(line);
+ } catch (er) {
+ this.emit('error', er);
+ return;
+ }
+ // push the parsed object out to the readable consumer
+ this.push(obj);
+ }
+ cb();
+};
+
+JSONParseStream.prototype._flush = function(cb) {
+ // Just handle any leftover
+ var rem = this._buffer.trim();
+ if (rem) {
+ try {
+ var obj = JSON.parse(rem);
+ } catch (er) {
+ this.emit('error', er);
+ return;
+ }
+ // push the parsed object out to the readable consumer
+ this.push(obj);
+ }
+ cb();
+};
+```
+
+
+[EventEmitter]: https://iojs.org/dist/v2.3.0/doc/api/events.html#events_class_events_eventemitter
+[Object mode]: #stream_object_mode
+[`stream.push(chunk)`]: #stream_readable_push_chunk_encoding
+[`stream.push(null)`]: #stream_readable_push_chunk_encoding
+[`stream.push()`]: #stream_readable_push_chunk_encoding
+[`unpipe()`]: #stream_readable_unpipe_destination
+[unpiped]: #stream_readable_unpipe_destination
+[tcp sockets]: https://iojs.org/dist/v2.3.0/doc/api/net.html#net_class_net_socket
+[zlib streams]: zlib.html
+[zlib]: zlib.html
+[crypto streams]: crypto.html
+[crypto]: crypto.html
+[tls.CryptoStream]: https://iojs.org/dist/v2.3.0/doc/api/tls.html#tls_class_cryptostream
+[process.stdin]: https://iojs.org/dist/v2.3.0/doc/api/process.html#process_process_stdin
+[stdout]: https://iojs.org/dist/v2.3.0/doc/api/process.html#process_process_stdout
+[process.stdout]: https://iojs.org/dist/v2.3.0/doc/api/process.html#process_process_stdout
+[process.stderr]: https://iojs.org/dist/v2.3.0/doc/api/process.html#process_process_stderr
+[child process stdout and stderr]: https://iojs.org/dist/v2.3.0/doc/api/child_process.html#child_process_child_stdout
+[API for Stream Consumers]: #stream_api_for_stream_consumers
+[API for Stream Implementors]: #stream_api_for_stream_implementors
+[Readable]: #stream_class_stream_readable
+[Writable]: #stream_class_stream_writable
+[Duplex]: #stream_class_stream_duplex
+[Transform]: #stream_class_stream_transform
+[`end`]: #stream_event_end
+[`finish`]: #stream_event_finish
+[`_read(size)`]: #stream_readable_read_size_1
+[`_read()`]: #stream_readable_read_size_1
+[_read]: #stream_readable_read_size_1
+[`writable.write(chunk)`]: #stream_writable_write_chunk_encoding_callback
+[`write(chunk, encoding, callback)`]: #stream_writable_write_chunk_encoding_callback
+[`write()`]: #stream_writable_write_chunk_encoding_callback
+[`stream.write(chunk)`]: #stream_writable_write_chunk_encoding_callback
+[`_write(chunk, encoding, callback)`]: #stream_writable_write_chunk_encoding_callback_1
+[`_write()`]: #stream_writable_write_chunk_encoding_callback_1
+[_write]: #stream_writable_write_chunk_encoding_callback_1
+[`util.inherits`]: https://iojs.org/dist/v2.3.0/doc/api/util.html#util_util_inherits_constructor_superconstructor
+[`end()`]: #stream_writable_end_chunk_encoding_callback
+[`'data'` event]: #stream_event_data
+[`resume()`]: #stream_readable_resume
+[`readable.resume()`]: #stream_readable_resume
+[`pause()`]: #stream_readable_pause
+[`unpipe()`]: #stream_readable_unpipe_destination
+[`pipe()`]: #stream_readable_pipe_destination_options
diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md
new file mode 100644
index 00000000000..83275f192e4
--- /dev/null
+++ b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md
@@ -0,0 +1,60 @@
+# streams WG Meeting 2015-01-30
+
+## Links
+
+* **Google Hangouts Video**: http://www.youtube.com/watch?v=I9nDOSGfwZg
+* **GitHub Issue**: https://github.com/iojs/readable-stream/issues/106
+* **Original Minutes Google Doc**: https://docs.google.com/document/d/17aTgLnjMXIrfjgNaTUnHQO7m3xgzHR2VXBTmi03Qii4/
+
+## Agenda
+
+Extracted from https://github.com/iojs/readable-stream/labels/wg-agenda prior to meeting.
+
+* adopt a charter [#105](https://github.com/iojs/readable-stream/issues/105)
+* release and versioning strategy [#101](https://github.com/iojs/readable-stream/issues/101)
+* simpler stream creation [#102](https://github.com/iojs/readable-stream/issues/102)
+* proposal: deprecate implicit flowing of streams [#99](https://github.com/iojs/readable-stream/issues/99)
+
+## Minutes
+
+### adopt a charter
+
+* group: +1's all around
+
+### What versioning scheme should be adopted?
+* group: +1’s 3.0.0
+* domenic+group: pulling in patches from other sources where appropriate
+* mikeal: version independently, suggesting versions for io.js
+* mikeal+domenic: work with TC to notify in advance of changes
+simpler stream creation
+
+### streamline creation of streams
+* sam: streamline creation of streams
+* domenic: nice simple solution posted
+ but, we lose the opportunity to change the model
+ may not be backwards incompatible (double check keys)
+
+ **action item:** domenic will check
+
+### remove implicit flowing of streams on(‘data’)
+* add isFlowing / isPaused
+* mikeal: worrying that we’re documenting polyfill methods – confuses users
+* domenic: more reflective API is probably good, with warning labels for users
+* new section for mad scientists (reflective stream access)
+* calvin: name the “third state”
+* mikeal: maybe borrow the name from whatwg?
+* domenic: we’re missing the “third state”
+* consensus: kind of difficult to name the third state
+* mikeal: figure out differences in states / compat
+* mathias: always flow on data – eliminates third state
+ * explore what it breaks
+
+**action items:**
+* ask isaac for ability to list packages by what public io.js APIs they use (esp. Stream)
+* ask rod/build for infrastructure
+* **chris**: explore the “flow on data” approach
+* add isPaused/isFlowing
+* add new docs section
+* move isPaused to that section
+
+
diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/float.patch b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/float.patch
deleted file mode 100644
index b984607a41c..00000000000
--- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/float.patch
+++ /dev/null
@@ -1,923 +0,0 @@
-diff --git a/lib/_stream_duplex.js b/lib/_stream_duplex.js
-index c5a741c..a2e0d8e 100644
---- a/lib/_stream_duplex.js
-+++ b/lib/_stream_duplex.js
-@@ -26,8 +26,8 @@
-
- module.exports = Duplex;
- var util = require('util');
--var Readable = require('_stream_readable');
--var Writable = require('_stream_writable');
-+var Readable = require('./_stream_readable');
-+var Writable = require('./_stream_writable');
-
- util.inherits(Duplex, Readable);
-
-diff --git a/lib/_stream_passthrough.js b/lib/_stream_passthrough.js
-index a5e9864..330c247 100644
---- a/lib/_stream_passthrough.js
-+++ b/lib/_stream_passthrough.js
-@@ -25,7 +25,7 @@
-
- module.exports = PassThrough;
-
--var Transform = require('_stream_transform');
-+var Transform = require('./_stream_transform');
- var util = require('util');
- util.inherits(PassThrough, Transform);
-
-diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js
-index 0c3fe3e..90a8298 100644
---- a/lib/_stream_readable.js
-+++ b/lib/_stream_readable.js
-@@ -23,10 +23,34 @@ module.exports = Readable;
- Readable.ReadableState = ReadableState;
-
- var EE = require('events').EventEmitter;
-+if (!EE.listenerCount) EE.listenerCount = function(emitter, type) {
-+ return emitter.listeners(type).length;
-+};
-+
-+if (!global.setImmediate) global.setImmediate = function setImmediate(fn) {
-+ return setTimeout(fn, 0);
-+};
-+if (!global.clearImmediate) global.clearImmediate = function clearImmediate(i) {
-+ return clearTimeout(i);
-+};
-+
- var Stream = require('stream');
- var util = require('util');
-+if (!util.isUndefined) {
-+ var utilIs = require('core-util-is');
-+ for (var f in utilIs) {
-+ util[f] = utilIs[f];
-+ }
-+}
- var StringDecoder;
--var debug = util.debuglog('stream');
-+var debug;
-+if (util.debuglog)
-+ debug = util.debuglog('stream');
-+else try {
-+ debug = require('debuglog')('stream');
-+} catch (er) {
-+ debug = function() {};
-+}
-
- util.inherits(Readable, Stream);
-
-@@ -380,7 +404,7 @@ function chunkInvalid(state, chunk) {
-
-
- function onEofChunk(stream, state) {
-- if (state.decoder && !state.ended) {
-+ if (state.decoder && !state.ended && state.decoder.end) {
- var chunk = state.decoder.end();
- if (chunk && chunk.length) {
- state.buffer.push(chunk);
-diff --git a/lib/_stream_transform.js b/lib/_stream_transform.js
-index b1f9fcc..b0caf57 100644
---- a/lib/_stream_transform.js
-+++ b/lib/_stream_transform.js
-@@ -64,8 +64,14 @@
-
- module.exports = Transform;
-
--var Duplex = require('_stream_duplex');
-+var Duplex = require('./_stream_duplex');
- var util = require('util');
-+if (!util.isUndefined) {
-+ var utilIs = require('core-util-is');
-+ for (var f in utilIs) {
-+ util[f] = utilIs[f];
-+ }
-+}
- util.inherits(Transform, Duplex);
-
-
-diff --git a/lib/_stream_writable.js b/lib/_stream_writable.js
-index ba2e920..f49288b 100644
---- a/lib/_stream_writable.js
-+++ b/lib/_stream_writable.js
-@@ -27,6 +27,12 @@ module.exports = Writable;
- Writable.WritableState = WritableState;
-
- var util = require('util');
-+if (!util.isUndefined) {
-+ var utilIs = require('core-util-is');
-+ for (var f in utilIs) {
-+ util[f] = utilIs[f];
-+ }
-+}
- var Stream = require('stream');
-
- util.inherits(Writable, Stream);
-@@ -119,7 +125,7 @@ function WritableState(options, stream) {
- function Writable(options) {
- // Writable ctor is applied to Duplexes, though they're not
- // instanceof Writable, they're instanceof Readable.
-- if (!(this instanceof Writable) && !(this instanceof Stream.Duplex))
-+ if (!(this instanceof Writable) && !(this instanceof require('./_stream_duplex')))
- return new Writable(options);
-
- this._writableState = new WritableState(options, this);
-diff --git a/test/simple/test-stream-big-push.js b/test/simple/test-stream-big-push.js
-index e3787e4..8cd2127 100644
---- a/test/simple/test-stream-big-push.js
-+++ b/test/simple/test-stream-big-push.js
-@@ -21,7 +21,7 @@
-
- var common = require('../common');
- var assert = require('assert');
--var stream = require('stream');
-+var stream = require('../../');
- var str = 'asdfasdfasdfasdfasdf';
-
- var r = new stream.Readable({
-diff --git a/test/simple/test-stream-end-paused.js b/test/simple/test-stream-end-paused.js
-index bb73777..d40efc7 100644
---- a/test/simple/test-stream-end-paused.js
-+++ b/test/simple/test-stream-end-paused.js
-@@ -25,7 +25,7 @@ var gotEnd = false;
-
- // Make sure we don't miss the end event for paused 0-length streams
-
--var Readable = require('stream').Readable;
-+var Readable = require('../../').Readable;
- var stream = new Readable();
- var calledRead = false;
- stream._read = function() {
-diff --git a/test/simple/test-stream-pipe-after-end.js b/test/simple/test-stream-pipe-after-end.js
-index b46ee90..0be8366 100644
---- a/test/simple/test-stream-pipe-after-end.js
-+++ b/test/simple/test-stream-pipe-after-end.js
-@@ -22,8 +22,8 @@
- var common = require('../common');
- var assert = require('assert');
-
--var Readable = require('_stream_readable');
--var Writable = require('_stream_writable');
-+var Readable = require('../../lib/_stream_readable');
-+var Writable = require('../../lib/_stream_writable');
- var util = require('util');
-
- util.inherits(TestReadable, Readable);
-diff --git a/test/simple/test-stream-pipe-cleanup.js b/test/simple/test-stream-pipe-cleanup.js
-deleted file mode 100644
-index f689358..0000000
---- a/test/simple/test-stream-pipe-cleanup.js
-+++ /dev/null
-@@ -1,122 +0,0 @@
--// Copyright Joyent, Inc. and other Node contributors.
--//
--// Permission is hereby granted, free of charge, to any person obtaining a
--// copy of this software and associated documentation files (the
--// "Software"), to deal in the Software without restriction, including
--// without limitation the rights to use, copy, modify, merge, publish,
--// distribute, sublicense, and/or sell copies of the Software, and to permit
--// persons to whom the Software is furnished to do so, subject to the
--// following conditions:
--//
--// The above copyright notice and this permission notice shall be included
--// in all copies or substantial portions of the Software.
--//
--// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
--// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
--// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
--// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
--// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
--// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
--// USE OR OTHER DEALINGS IN THE SOFTWARE.
--
--// This test asserts that Stream.prototype.pipe does not leave listeners
--// hanging on the source or dest.
--
--var common = require('../common');
--var stream = require('stream');
--var assert = require('assert');
--var util = require('util');
--
--function Writable() {
-- this.writable = true;
-- this.endCalls = 0;
-- stream.Stream.call(this);
--}
--util.inherits(Writable, stream.Stream);
--Writable.prototype.end = function() {
-- this.endCalls++;
--};
--
--Writable.prototype.destroy = function() {
-- this.endCalls++;
--};
--
--function Readable() {
-- this.readable = true;
-- stream.Stream.call(this);
--}
--util.inherits(Readable, stream.Stream);
--
--function Duplex() {
-- this.readable = true;
-- Writable.call(this);
--}
--util.inherits(Duplex, Writable);
--
--var i = 0;
--var limit = 100;
--
--var w = new Writable();
--
--var r;
--
--for (i = 0; i < limit; i++) {
-- r = new Readable();
-- r.pipe(w);
-- r.emit('end');
--}
--assert.equal(0, r.listeners('end').length);
--assert.equal(limit, w.endCalls);
--
--w.endCalls = 0;
--
--for (i = 0; i < limit; i++) {
-- r = new Readable();
-- r.pipe(w);
-- r.emit('close');
--}
--assert.equal(0, r.listeners('close').length);
--assert.equal(limit, w.endCalls);
--
--w.endCalls = 0;
--
--r = new Readable();
--
--for (i = 0; i < limit; i++) {
-- w = new Writable();
-- r.pipe(w);
-- w.emit('close');
--}
--assert.equal(0, w.listeners('close').length);
--
--r = new Readable();
--w = new Writable();
--var d = new Duplex();
--r.pipe(d); // pipeline A
--d.pipe(w); // pipeline B
--assert.equal(r.listeners('end').length, 2); // A.onend, A.cleanup
--assert.equal(r.listeners('close').length, 2); // A.onclose, A.cleanup
--assert.equal(d.listeners('end').length, 2); // B.onend, B.cleanup
--assert.equal(d.listeners('close').length, 3); // A.cleanup, B.onclose, B.cleanup
--assert.equal(w.listeners('end').length, 0);
--assert.equal(w.listeners('close').length, 1); // B.cleanup
--
--r.emit('end');
--assert.equal(d.endCalls, 1);
--assert.equal(w.endCalls, 0);
--assert.equal(r.listeners('end').length, 0);
--assert.equal(r.listeners('close').length, 0);
--assert.equal(d.listeners('end').length, 2); // B.onend, B.cleanup
--assert.equal(d.listeners('close').length, 2); // B.onclose, B.cleanup
--assert.equal(w.listeners('end').length, 0);
--assert.equal(w.listeners('close').length, 1); // B.cleanup
--
--d.emit('end');
--assert.equal(d.endCalls, 1);
--assert.equal(w.endCalls, 1);
--assert.equal(r.listeners('end').length, 0);
--assert.equal(r.listeners('close').length, 0);
--assert.equal(d.listeners('end').length, 0);
--assert.equal(d.listeners('close').length, 0);
--assert.equal(w.listeners('end').length, 0);
--assert.equal(w.listeners('close').length, 0);
-diff --git a/test/simple/test-stream-pipe-error-handling.js b/test/simple/test-stream-pipe-error-handling.js
-index c5d724b..c7d6b7d 100644
---- a/test/simple/test-stream-pipe-error-handling.js
-+++ b/test/simple/test-stream-pipe-error-handling.js
-@@ -21,7 +21,7 @@
-
- var common = require('../common');
- var assert = require('assert');
--var Stream = require('stream').Stream;
-+var Stream = require('../../').Stream;
-
- (function testErrorListenerCatches() {
- var source = new Stream();
-diff --git a/test/simple/test-stream-pipe-event.js b/test/simple/test-stream-pipe-event.js
-index cb9d5fe..56f8d61 100644
---- a/test/simple/test-stream-pipe-event.js
-+++ b/test/simple/test-stream-pipe-event.js
-@@ -20,7 +20,7 @@
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- var common = require('../common');
--var stream = require('stream');
-+var stream = require('../../');
- var assert = require('assert');
- var util = require('util');
-
-diff --git a/test/simple/test-stream-push-order.js b/test/simple/test-stream-push-order.js
-index f2e6ec2..a5c9bf9 100644
---- a/test/simple/test-stream-push-order.js
-+++ b/test/simple/test-stream-push-order.js
-@@ -20,7 +20,7 @@
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- var common = require('../common.js');
--var Readable = require('stream').Readable;
-+var Readable = require('../../').Readable;
- var assert = require('assert');
-
- var s = new Readable({
-diff --git a/test/simple/test-stream-push-strings.js b/test/simple/test-stream-push-strings.js
-index 06f43dc..1701a9a 100644
---- a/test/simple/test-stream-push-strings.js
-+++ b/test/simple/test-stream-push-strings.js
-@@ -22,7 +22,7 @@
- var common = require('../common');
- var assert = require('assert');
-
--var Readable = require('stream').Readable;
-+var Readable = require('../../').Readable;
- var util = require('util');
-
- util.inherits(MyStream, Readable);
-diff --git a/test/simple/test-stream-readable-event.js b/test/simple/test-stream-readable-event.js
-index ba6a577..a8e6f7b 100644
---- a/test/simple/test-stream-readable-event.js
-+++ b/test/simple/test-stream-readable-event.js
-@@ -22,7 +22,7 @@
- var common = require('../common');
- var assert = require('assert');
-
--var Readable = require('stream').Readable;
-+var Readable = require('../../').Readable;
-
- (function first() {
- // First test, not reading when the readable is added.
-diff --git a/test/simple/test-stream-readable-flow-recursion.js b/test/simple/test-stream-readable-flow-recursion.js
-index 2891ad6..11689ba 100644
---- a/test/simple/test-stream-readable-flow-recursion.js
-+++ b/test/simple/test-stream-readable-flow-recursion.js
-@@ -27,7 +27,7 @@ var assert = require('assert');
- // more data continuously, but without triggering a nextTick
- // warning or RangeError.
-
--var Readable = require('stream').Readable;
-+var Readable = require('../../').Readable;
-
- // throw an error if we trigger a nextTick warning.
- process.throwDeprecation = true;
-diff --git a/test/simple/test-stream-unshift-empty-chunk.js b/test/simple/test-stream-unshift-empty-chunk.js
-index 0c96476..7827538 100644
---- a/test/simple/test-stream-unshift-empty-chunk.js
-+++ b/test/simple/test-stream-unshift-empty-chunk.js
-@@ -24,7 +24,7 @@ var assert = require('assert');
-
- // This test verifies that stream.unshift(Buffer(0)) or
- // stream.unshift('') does not set state.reading=false.
--var Readable = require('stream').Readable;
-+var Readable = require('../../').Readable;
-
- var r = new Readable();
- var nChunks = 10;
-diff --git a/test/simple/test-stream-unshift-read-race.js b/test/simple/test-stream-unshift-read-race.js
-index 83fd9fa..17c18aa 100644
---- a/test/simple/test-stream-unshift-read-race.js
-+++ b/test/simple/test-stream-unshift-read-race.js
-@@ -29,7 +29,7 @@ var assert = require('assert');
- // 3. push() after the EOF signaling null is an error.
- // 4. _read() is not called after pushing the EOF null chunk.
-
--var stream = require('stream');
-+var stream = require('../../');
- var hwm = 10;
- var r = stream.Readable({ highWaterMark: hwm });
- var chunks = 10;
-@@ -51,7 +51,14 @@ r._read = function(n) {
-
- function push(fast) {
- assert(!pushedNull, 'push() after null push');
-- var c = pos >= data.length ? null : data.slice(pos, pos + n);
-+ var c;
-+ if (pos >= data.length)
-+ c = null;
-+ else {
-+ if (n + pos > data.length)
-+ n = data.length - pos;
-+ c = data.slice(pos, pos + n);
-+ }
- pushedNull = c === null;
- if (fast) {
- pos += n;
-diff --git a/test/simple/test-stream-writev.js b/test/simple/test-stream-writev.js
-index 5b49e6e..b5321f3 100644
---- a/test/simple/test-stream-writev.js
-+++ b/test/simple/test-stream-writev.js
-@@ -22,7 +22,7 @@
- var common = require('../common');
- var assert = require('assert');
-
--var stream = require('stream');
-+var stream = require('../../');
-
- var queue = [];
- for (var decode = 0; decode < 2; decode++) {
-diff --git a/test/simple/test-stream2-basic.js b/test/simple/test-stream2-basic.js
-index 3814bf0..248c1be 100644
---- a/test/simple/test-stream2-basic.js
-+++ b/test/simple/test-stream2-basic.js
-@@ -21,7 +21,7 @@
-
-
- var common = require('../common.js');
--var R = require('_stream_readable');
-+var R = require('../../lib/_stream_readable');
- var assert = require('assert');
-
- var util = require('util');
-diff --git a/test/simple/test-stream2-compatibility.js b/test/simple/test-stream2-compatibility.js
-index 6cdd4e9..f0fa84b 100644
---- a/test/simple/test-stream2-compatibility.js
-+++ b/test/simple/test-stream2-compatibility.js
-@@ -21,7 +21,7 @@
-
-
- var common = require('../common.js');
--var R = require('_stream_readable');
-+var R = require('../../lib/_stream_readable');
- var assert = require('assert');
-
- var util = require('util');
-diff --git a/test/simple/test-stream2-finish-pipe.js b/test/simple/test-stream2-finish-pipe.js
-index 39b274f..006a19b 100644
---- a/test/simple/test-stream2-finish-pipe.js
-+++ b/test/simple/test-stream2-finish-pipe.js
-@@ -20,7 +20,7 @@
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- var common = require('../common.js');
--var stream = require('stream');
-+var stream = require('../../');
- var Buffer = require('buffer').Buffer;
-
- var r = new stream.Readable();
-diff --git a/test/simple/test-stream2-fs.js b/test/simple/test-stream2-fs.js
-deleted file mode 100644
-index e162406..0000000
---- a/test/simple/test-stream2-fs.js
-+++ /dev/null
-@@ -1,72 +0,0 @@
--// Copyright Joyent, Inc. and other Node contributors.
--//
--// Permission is hereby granted, free of charge, to any person obtaining a
--// copy of this software and associated documentation files (the
--// "Software"), to deal in the Software without restriction, including
--// without limitation the rights to use, copy, modify, merge, publish,
--// distribute, sublicense, and/or sell copies of the Software, and to permit
--// persons to whom the Software is furnished to do so, subject to the
--// following conditions:
--//
--// The above copyright notice and this permission notice shall be included
--// in all copies or substantial portions of the Software.
--//
--// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
--// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
--// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
--// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
--// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
--// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
--// USE OR OTHER DEALINGS IN THE SOFTWARE.
--
--
--var common = require('../common.js');
--var R = require('_stream_readable');
--var assert = require('assert');
--
--var fs = require('fs');
--var FSReadable = fs.ReadStream;
--
--var path = require('path');
--var file = path.resolve(common.fixturesDir, 'x1024.txt');
--
--var size = fs.statSync(file).size;
--
--var expectLengths = [1024];
--
--var util = require('util');
--var Stream = require('stream');
--
--util.inherits(TestWriter, Stream);
--
--function TestWriter() {
-- Stream.apply(this);
-- this.buffer = [];
-- this.length = 0;
--}
--
--TestWriter.prototype.write = function(c) {
-- this.buffer.push(c.toString());
-- this.length += c.length;
-- return true;
--};
--
--TestWriter.prototype.end = function(c) {
-- if (c) this.buffer.push(c.toString());
-- this.emit('results', this.buffer);
--}
--
--var r = new FSReadable(file);
--var w = new TestWriter();
--
--w.on('results', function(res) {
-- console.error(res, w.length);
-- assert.equal(w.length, size);
-- var l = 0;
-- assert.deepEqual(res.map(function (c) {
-- return c.length;
-- }), expectLengths);
-- console.log('ok');
--});
--
--r.pipe(w);
-diff --git a/test/simple/test-stream2-httpclient-response-end.js b/test/simple/test-stream2-httpclient-response-end.js
-deleted file mode 100644
-index 15cffc2..0000000
---- a/test/simple/test-stream2-httpclient-response-end.js
-+++ /dev/null
-@@ -1,52 +0,0 @@
--// Copyright Joyent, Inc. and other Node contributors.
--//
--// Permission is hereby granted, free of charge, to any person obtaining a
--// copy of this software and associated documentation files (the
--// "Software"), to deal in the Software without restriction, including
--// without limitation the rights to use, copy, modify, merge, publish,
--// distribute, sublicense, and/or sell copies of the Software, and to permit
--// persons to whom the Software is furnished to do so, subject to the
--// following conditions:
--//
--// The above copyright notice and this permission notice shall be included
--// in all copies or substantial portions of the Software.
--//
--// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
--// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
--// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
--// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
--// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
--// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
--// USE OR OTHER DEALINGS IN THE SOFTWARE.
--
--var common = require('../common.js');
--var assert = require('assert');
--var http = require('http');
--var msg = 'Hello';
--var readable_event = false;
--var end_event = false;
--var server = http.createServer(function(req, res) {
-- res.writeHead(200, {'Content-Type': 'text/plain'});
-- res.end(msg);
--}).listen(common.PORT, function() {
-- http.get({port: common.PORT}, function(res) {
-- var data = '';
-- res.on('readable', function() {
-- console.log('readable event');
-- readable_event = true;
-- data += res.read();
-- });
-- res.on('end', function() {
-- console.log('end event');
-- end_event = true;
-- assert.strictEqual(msg, data);
-- server.close();
-- });
-- });
--});
--
--process.on('exit', function() {
-- assert(readable_event);
-- assert(end_event);
--});
--
-diff --git a/test/simple/test-stream2-large-read-stall.js b/test/simple/test-stream2-large-read-stall.js
-index 2fbfbca..667985b 100644
---- a/test/simple/test-stream2-large-read-stall.js
-+++ b/test/simple/test-stream2-large-read-stall.js
-@@ -30,7 +30,7 @@ var PUSHSIZE = 20;
- var PUSHCOUNT = 1000;
- var HWM = 50;
-
--var Readable = require('stream').Readable;
-+var Readable = require('../../').Readable;
- var r = new Readable({
- highWaterMark: HWM
- });
-@@ -39,23 +39,23 @@ var rs = r._readableState;
- r._read = push;
-
- r.on('readable', function() {
-- console.error('>> readable');
-+ //console.error('>> readable');
- do {
-- console.error(' > read(%d)', READSIZE);
-+ //console.error(' > read(%d)', READSIZE);
- var ret = r.read(READSIZE);
-- console.error(' < %j (%d remain)', ret && ret.length, rs.length);
-+ //console.error(' < %j (%d remain)', ret && ret.length, rs.length);
- } while (ret && ret.length === READSIZE);
-
-- console.error('<< after read()',
-- ret && ret.length,
-- rs.needReadable,
-- rs.length);
-+ //console.error('<< after read()',
-+ // ret && ret.length,
-+ // rs.needReadable,
-+ // rs.length);
- });
-
- var endEmitted = false;
- r.on('end', function() {
- endEmitted = true;
-- console.error('end');
-+ //console.error('end');
- });
-
- var pushes = 0;
-@@ -64,11 +64,11 @@ function push() {
- return;
-
- if (pushes++ === PUSHCOUNT) {
-- console.error(' push(EOF)');
-+ //console.error(' push(EOF)');
- return r.push(null);
- }
-
-- console.error(' push #%d', pushes);
-+ //console.error(' push #%d', pushes);
- if (r.push(new Buffer(PUSHSIZE)))
- setTimeout(push);
- }
-diff --git a/test/simple/test-stream2-objects.js b/test/simple/test-stream2-objects.js
-index 3e6931d..ff47d89 100644
---- a/test/simple/test-stream2-objects.js
-+++ b/test/simple/test-stream2-objects.js
-@@ -21,8 +21,8 @@
-
-
- var common = require('../common.js');
--var Readable = require('_stream_readable');
--var Writable = require('_stream_writable');
-+var Readable = require('../../lib/_stream_readable');
-+var Writable = require('../../lib/_stream_writable');
- var assert = require('assert');
-
- // tiny node-tap lookalike.
-diff --git a/test/simple/test-stream2-pipe-error-handling.js b/test/simple/test-stream2-pipe-error-handling.js
-index cf7531c..e3f3e4e 100644
---- a/test/simple/test-stream2-pipe-error-handling.js
-+++ b/test/simple/test-stream2-pipe-error-handling.js
-@@ -21,7 +21,7 @@
-
- var common = require('../common');
- var assert = require('assert');
--var stream = require('stream');
-+var stream = require('../../');
-
- (function testErrorListenerCatches() {
- var count = 1000;
-diff --git a/test/simple/test-stream2-pipe-error-once-listener.js b/test/simple/test-stream2-pipe-error-once-listener.js
-index 5e8e3cb..53b2616 100755
---- a/test/simple/test-stream2-pipe-error-once-listener.js
-+++ b/test/simple/test-stream2-pipe-error-once-listener.js
-@@ -24,7 +24,7 @@ var common = require('../common.js');
- var assert = require('assert');
-
- var util = require('util');
--var stream = require('stream');
-+var stream = require('../../');
-
-
- var Read = function() {
-diff --git a/test/simple/test-stream2-push.js b/test/simple/test-stream2-push.js
-index b63edc3..eb2b0e9 100644
---- a/test/simple/test-stream2-push.js
-+++ b/test/simple/test-stream2-push.js
-@@ -20,7 +20,7 @@
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- var common = require('../common.js');
--var stream = require('stream');
-+var stream = require('../../');
- var Readable = stream.Readable;
- var Writable = stream.Writable;
- var assert = require('assert');
-diff --git a/test/simple/test-stream2-read-sync-stack.js b/test/simple/test-stream2-read-sync-stack.js
-index e8a7305..9740a47 100644
---- a/test/simple/test-stream2-read-sync-stack.js
-+++ b/test/simple/test-stream2-read-sync-stack.js
-@@ -21,7 +21,7 @@
-
- var common = require('../common');
- var assert = require('assert');
--var Readable = require('stream').Readable;
-+var Readable = require('../../').Readable;
- var r = new Readable();
- var N = 256 * 1024;
-
-diff --git a/test/simple/test-stream2-readable-empty-buffer-no-eof.js b/test/simple/test-stream2-readable-empty-buffer-no-eof.js
-index cd30178..4b1659d 100644
---- a/test/simple/test-stream2-readable-empty-buffer-no-eof.js
-+++ b/test/simple/test-stream2-readable-empty-buffer-no-eof.js
-@@ -22,10 +22,9 @@
- var common = require('../common');
- var assert = require('assert');
-
--var Readable = require('stream').Readable;
-+var Readable = require('../../').Readable;
-
- test1();
--test2();
-
- function test1() {
- var r = new Readable();
-@@ -88,31 +87,3 @@ function test1() {
- console.log('ok');
- });
- }
--
--function test2() {
-- var r = new Readable({ encoding: 'base64' });
-- var reads = 5;
-- r._read = function(n) {
-- if (!reads--)
-- return r.push(null); // EOF
-- else
-- return r.push(new Buffer('x'));
-- };
--
-- var results = [];
-- function flow() {
-- var chunk;
-- while (null !== (chunk = r.read()))
-- results.push(chunk + '');
-- }
-- r.on('readable', flow);
-- r.on('end', function() {
-- results.push('EOF');
-- });
-- flow();
--
-- process.on('exit', function() {
-- assert.deepEqual(results, [ 'eHh4', 'eHg=', 'EOF' ]);
-- console.log('ok');
-- });
--}
-diff --git a/test/simple/test-stream2-readable-from-list.js b/test/simple/test-stream2-readable-from-list.js
-index 7c96ffe..04a96f5 100644
---- a/test/simple/test-stream2-readable-from-list.js
-+++ b/test/simple/test-stream2-readable-from-list.js
-@@ -21,7 +21,7 @@
-
- var assert = require('assert');
- var common = require('../common.js');
--var fromList = require('_stream_readable')._fromList;
-+var fromList = require('../../lib/_stream_readable')._fromList;
-
- // tiny node-tap lookalike.
- var tests = [];
-diff --git a/test/simple/test-stream2-readable-legacy-drain.js b/test/simple/test-stream2-readable-legacy-drain.js
-index 675da8e..51fd3d5 100644
---- a/test/simple/test-stream2-readable-legacy-drain.js
-+++ b/test/simple/test-stream2-readable-legacy-drain.js
-@@ -22,7 +22,7 @@
- var common = require('../common');
- var assert = require('assert');
-
--var Stream = require('stream');
-+var Stream = require('../../');
- var Readable = Stream.Readable;
-
- var r = new Readable();
-diff --git a/test/simple/test-stream2-readable-non-empty-end.js b/test/simple/test-stream2-readable-non-empty-end.js
-index 7314ae7..c971898 100644
---- a/test/simple/test-stream2-readable-non-empty-end.js
-+++ b/test/simple/test-stream2-readable-non-empty-end.js
-@@ -21,7 +21,7 @@
-
- var assert = require('assert');
- var common = require('../common.js');
--var Readable = require('_stream_readable');
-+var Readable = require('../../lib/_stream_readable');
-
- var len = 0;
- var chunks = new Array(10);
-diff --git a/test/simple/test-stream2-readable-wrap-empty.js b/test/simple/test-stream2-readable-wrap-empty.js
-index 2e5cf25..fd8a3dc 100644
---- a/test/simple/test-stream2-readable-wrap-empty.js
-+++ b/test/simple/test-stream2-readable-wrap-empty.js
-@@ -22,7 +22,7 @@
- var common = require('../common');
- var assert = require('assert');
-
--var Readable = require('_stream_readable');
-+var Readable = require('../../lib/_stream_readable');
- var EE = require('events').EventEmitter;
-
- var oldStream = new EE();
-diff --git a/test/simple/test-stream2-readable-wrap.js b/test/simple/test-stream2-readable-wrap.js
-index 90eea01..6b177f7 100644
---- a/test/simple/test-stream2-readable-wrap.js
-+++ b/test/simple/test-stream2-readable-wrap.js
-@@ -22,8 +22,8 @@
- var common = require('../common');
- var assert = require('assert');
-
--var Readable = require('_stream_readable');
--var Writable = require('_stream_writable');
-+var Readable = require('../../lib/_stream_readable');
-+var Writable = require('../../lib/_stream_writable');
- var EE = require('events').EventEmitter;
-
- var testRuns = 0, completedRuns = 0;
-diff --git a/test/simple/test-stream2-set-encoding.js b/test/simple/test-stream2-set-encoding.js
-index 5d2c32a..685531b 100644
---- a/test/simple/test-stream2-set-encoding.js
-+++ b/test/simple/test-stream2-set-encoding.js
-@@ -22,7 +22,7 @@
-
- var common = require('../common.js');
- var assert = require('assert');
--var R = require('_stream_readable');
-+var R = require('../../lib/_stream_readable');
- var util = require('util');
-
- // tiny node-tap lookalike.
-diff --git a/test/simple/test-stream2-transform.js b/test/simple/test-stream2-transform.js
-index 9c9ddd8..a0cacc6 100644
---- a/test/simple/test-stream2-transform.js
-+++ b/test/simple/test-stream2-transform.js
-@@ -21,8 +21,8 @@
-
- var assert = require('assert');
- var common = require('../common.js');
--var PassThrough = require('_stream_passthrough');
--var Transform = require('_stream_transform');
-+var PassThrough = require('../../').PassThrough;
-+var Transform = require('../../').Transform;
-
- // tiny node-tap lookalike.
- var tests = [];
-diff --git a/test/simple/test-stream2-unpipe-drain.js b/test/simple/test-stream2-unpipe-drain.js
-index d66dc3c..365b327 100644
---- a/test/simple/test-stream2-unpipe-drain.js
-+++ b/test/simple/test-stream2-unpipe-drain.js
-@@ -22,7 +22,7 @@
-
- var common = require('../common.js');
- var assert = require('assert');
--var stream = require('stream');
-+var stream = require('../../');
- var crypto = require('crypto');
-
- var util = require('util');
-diff --git a/test/simple/test-stream2-unpipe-leak.js b/test/simple/test-stream2-unpipe-leak.js
-index 99f8746..17c92ae 100644
---- a/test/simple/test-stream2-unpipe-leak.js
-+++ b/test/simple/test-stream2-unpipe-leak.js
-@@ -22,7 +22,7 @@
-
- var common = require('../common.js');
- var assert = require('assert');
--var stream = require('stream');
-+var stream = require('../../');
-
- var chunk = new Buffer('hallo');
-
-diff --git a/test/simple/test-stream2-writable.js b/test/simple/test-stream2-writable.js
-index 704100c..209c3a6 100644
---- a/test/simple/test-stream2-writable.js
-+++ b/test/simple/test-stream2-writable.js
-@@ -20,8 +20,8 @@
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- var common = require('../common.js');
--var W = require('_stream_writable');
--var D = require('_stream_duplex');
-+var W = require('../../').Writable;
-+var D = require('../../').Duplex;
- var assert = require('assert');
-
- var util = require('util');
-diff --git a/test/simple/test-stream3-pause-then-read.js b/test/simple/test-stream3-pause-then-read.js
-index b91bde3..2f72c15 100644
---- a/test/simple/test-stream3-pause-then-read.js
-+++ b/test/simple/test-stream3-pause-then-read.js
-@@ -22,7 +22,7 @@
- var common = require('../common');
- var assert = require('assert');
-
--var stream = require('stream');
-+var stream = require('../../');
- var Readable = stream.Readable;
- var Writable = stream.Writable;
-
diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_duplex.js b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_duplex.js
index b513d61a963..69558af037c 100644
--- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_duplex.js
+++ b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_duplex.js
@@ -1,30 +1,9 @@
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to permit
-// persons to whom the Software is furnished to do so, subject to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
// a duplex stream is just a stream that is both readable and writable.
// Since JS doesn't have multiple prototypal inheritance, this class
// prototypally inherits from Readable, and then parasitically from
// Writable.
-module.exports = Duplex;
+'use strict';
/*<replacement>*/
var objectKeys = Object.keys || function (obj) {
@@ -35,6 +14,14 @@ var objectKeys = Object.keys || function (obj) {
/*</replacement>*/
+module.exports = Duplex;
+
+/*<replacement>*/
+var processNextTick = require('process-nextick-args');
+/*</replacement>*/
+
+
+
/*<replacement>*/
var util = require('core-util-is');
util.inherits = require('inherits');
@@ -45,10 +32,12 @@ var Writable = require('./_stream_writable');
util.inherits(Duplex, Readable);
-forEach(objectKeys(Writable.prototype), function(method) {
+var keys = objectKeys(Writable.prototype);
+for (var v = 0; v < keys.length; v++) {
+ var method = keys[v];
if (!Duplex.prototype[method])
Duplex.prototype[method] = Writable.prototype[method];
-});
+}
function Duplex(options) {
if (!(this instanceof Duplex))
@@ -79,7 +68,11 @@ function onend() {
// no more data can be written.
// But allow more writes to happen in this tick.
- process.nextTick(this.end.bind(this));
+ processNextTick(onEndNT, this);
+}
+
+function onEndNT(self) {
+ self.end();
}
function forEach (xs, f) {
diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_passthrough.js b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_passthrough.js
index 895ca50a1d2..bddfdd01537 100644
--- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_passthrough.js
+++ b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_passthrough.js
@@ -1,28 +1,9 @@
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to permit
-// persons to whom the Software is furnished to do so, subject to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
// a passthrough stream.
// basically just the most minimal sort of Transform stream.
// Every written chunk gets output as-is.
+'use strict';
+
module.exports = PassThrough;
var Transform = require('./_stream_transform');
diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_readable.js b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_readable.js
index 19ab3588984..8070e03d8ef 100644
--- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_readable.js
+++ b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_readable.js
@@ -1,27 +1,13 @@
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to permit
-// persons to whom the Software is furnished to do so, subject to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-// USE OR OTHER DEALINGS IN THE SOFTWARE.
+'use strict';
module.exports = Readable;
/*<replacement>*/
+var processNextTick = require('process-nextick-args');
+/*</replacement>*/
+
+
+/*<replacement>*/
var isArray = require('isarray');
/*</replacement>*/
@@ -40,14 +26,22 @@ if (!EE.listenerCount) EE.listenerCount = function(emitter, type) {
};
/*</replacement>*/
-var Stream = require('stream');
+
+
+/*<replacement>*/
+var Stream;
+ (function (){try{
+Stream = require('st' + 'ream');
+}catch(_){Stream = require('events').EventEmitter;}}())
+/*</replacement>*/
+
+var Buffer = require('buffer').Buffer;
/*<replacement>*/
var util = require('core-util-is');
util.inherits = require('inherits');
/*</replacement>*/
-var StringDecoder;
/*<replacement>*/
@@ -59,6 +53,7 @@ if (debug && debug.debuglog) {
}
/*</replacement>*/
+var StringDecoder;
util.inherits(Readable, Stream);
@@ -67,10 +62,17 @@ function ReadableState(options, stream) {
options = options || {};
+ // object stream flag. Used to make read(n) ignore n and to
+ // make all the buffer merging and length checks go away
+ this.objectMode = !!options.objectMode;
+
+ if (stream instanceof Duplex)
+ this.objectMode = this.objectMode || !!options.readableObjectMode;
+
// the point at which it stops calling _read() to fill the buffer
// Note: 0 is a valid value, means "don't call _read preemptively ever"
var hwm = options.highWaterMark;
- var defaultHwm = options.objectMode ? 16 : 16 * 1024;
+ var defaultHwm = this.objectMode ? 16 : 16 * 1024;
this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm;
// cast to ints.
@@ -97,14 +99,6 @@ function ReadableState(options, stream) {
this.emittedReadable = false;
this.readableListening = false;
-
- // object stream flag. Used to make read(n) ignore n and to
- // make all the buffer merging and length checks go away
- this.objectMode = !!options.objectMode;
-
- if (stream instanceof Duplex)
- this.objectMode = this.objectMode || !!options.readableObjectMode;
-
// Crypto is kind of old and crusty. Historically, its default string
// encoding is 'binary' so we have to make this configurable.
// Everything else in the universe uses 'utf8', though.
@@ -141,6 +135,9 @@ function Readable(options) {
// legacy
this.readable = true;
+ if (options && typeof options.read === 'function')
+ this._read = options.read;
+
Stream.call(this);
}
@@ -151,7 +148,7 @@ function Readable(options) {
Readable.prototype.push = function(chunk, encoding) {
var state = this._readableState;
- if (util.isString(chunk) && !state.objectMode) {
+ if (!state.objectMode && typeof chunk === 'string') {
encoding = encoding || state.defaultEncoding;
if (encoding !== state.encoding) {
chunk = new Buffer(chunk, encoding);
@@ -168,14 +165,17 @@ Readable.prototype.unshift = function(chunk) {
return readableAddChunk(this, state, chunk, '', true);
};
+Readable.prototype.isPaused = function() {
+ return this._readableState.flowing === false;
+};
+
function readableAddChunk(stream, state, chunk, encoding, addToFront) {
var er = chunkInvalid(state, chunk);
if (er) {
stream.emit('error', er);
- } else if (util.isNullOrUndefined(chunk)) {
+ } else if (chunk === null) {
state.reading = false;
- if (!state.ended)
- onEofChunk(stream, state);
+ onEofChunk(stream, state);
} else if (state.objectMode || chunk && chunk.length > 0) {
if (state.ended && !addToFront) {
var e = new Error('stream.push() after EOF');
@@ -261,7 +261,7 @@ function howMuchToRead(n, state) {
if (state.objectMode)
return n === 0 ? 0 : 1;
- if (isNaN(n) || util.isNull(n)) {
+ if (n === null || isNaN(n)) {
// only flow one buffer at a time
if (state.flowing && state.buffer.length)
return state.buffer[0].length;
@@ -284,8 +284,9 @@ function howMuchToRead(n, state) {
if (!state.ended) {
state.needReadable = true;
return 0;
- } else
+ } else {
return state.length;
+ }
}
return n;
@@ -297,7 +298,7 @@ Readable.prototype.read = function(n) {
var state = this._readableState;
var nOrig = n;
- if (!util.isNumber(n) || n > 0)
+ if (typeof n !== 'number' || n > 0)
state.emittedReadable = false;
// if we're doing read(0) to trigger a readable event, but we
@@ -385,7 +386,7 @@ Readable.prototype.read = function(n) {
else
ret = null;
- if (util.isNull(ret)) {
+ if (ret === null) {
state.needReadable = true;
n = 0;
}
@@ -401,7 +402,7 @@ Readable.prototype.read = function(n) {
if (nOrig !== n && state.ended && state.length === 0)
endReadable(this);
- if (!util.isNull(ret))
+ if (ret !== null)
this.emit('data', ret);
return ret;
@@ -409,9 +410,10 @@ Readable.prototype.read = function(n) {
function chunkInvalid(state, chunk) {
var er = null;
- if (!util.isBuffer(chunk) &&
- !util.isString(chunk) &&
- !util.isNullOrUndefined(chunk) &&
+ if (!(Buffer.isBuffer(chunk)) &&
+ typeof chunk !== 'string' &&
+ chunk !== null &&
+ chunk !== undefined &&
!state.objectMode) {
er = new TypeError('Invalid non-string/buffer chunk');
}
@@ -420,7 +422,8 @@ function chunkInvalid(state, chunk) {
function onEofChunk(stream, state) {
- if (state.decoder && !state.ended) {
+ if (state.ended) return;
+ if (state.decoder) {
var chunk = state.decoder.end();
if (chunk && chunk.length) {
state.buffer.push(chunk);
@@ -443,9 +446,7 @@ function emitReadable(stream) {
debug('emitReadable', state.flowing);
state.emittedReadable = true;
if (state.sync)
- process.nextTick(function() {
- emitReadable_(stream);
- });
+ processNextTick(emitReadable_, stream);
else
emitReadable_(stream);
}
@@ -467,9 +468,7 @@ function emitReadable_(stream) {
function maybeReadMore(stream, state) {
if (!state.readingMore) {
state.readingMore = true;
- process.nextTick(function() {
- maybeReadMore_(stream, state);
- });
+ processNextTick(maybeReadMore_, stream, state);
}
}
@@ -520,7 +519,7 @@ Readable.prototype.pipe = function(dest, pipeOpts) {
var endFn = doEnd ? onend : cleanup;
if (state.endEmitted)
- process.nextTick(endFn);
+ processNextTick(endFn);
else
src.once('end', endFn);
@@ -715,11 +714,7 @@ Readable.prototype.on = function(ev, fn) {
state.emittedReadable = false;
state.needReadable = true;
if (!state.reading) {
- var self = this;
- process.nextTick(function() {
- debug('readable nexttick read 0');
- self.read(0);
- });
+ processNextTick(nReadingNextTick, this);
} else if (state.length) {
emitReadable(this, state);
}
@@ -730,6 +725,11 @@ Readable.prototype.on = function(ev, fn) {
};
Readable.prototype.addListener = Readable.prototype.on;
+function nReadingNextTick(self) {
+ debug('readable nexttick read 0');
+ self.read(0);
+}
+
// pause() and resume() are remnants of the legacy readable stream API
// If the user uses them, then switch into old mode.
Readable.prototype.resume = function() {
@@ -737,10 +737,6 @@ Readable.prototype.resume = function() {
if (!state.flowing) {
debug('resume');
state.flowing = true;
- if (!state.reading) {
- debug('resume read 0');
- this.read(0);
- }
resume(this, state);
}
return this;
@@ -749,13 +745,16 @@ Readable.prototype.resume = function() {
function resume(stream, state) {
if (!state.resumeScheduled) {
state.resumeScheduled = true;
- process.nextTick(function() {
- resume_(stream, state);
- });
+ processNextTick(resume_, stream, state);
}
}
function resume_(stream, state) {
+ if (!state.reading) {
+ debug('resume read 0');
+ stream.read(0);
+ }
+
state.resumeScheduled = false;
stream.emit('resume');
flow(stream);
@@ -806,7 +805,11 @@ Readable.prototype.wrap = function(stream) {
debug('wrapped data');
if (state.decoder)
chunk = state.decoder.write(chunk);
- if (!chunk || !state.objectMode && !chunk.length)
+
+ // don't skip over falsy values in objectMode
+ if (state.objectMode && (chunk === null || chunk === undefined))
+ return;
+ else if (!state.objectMode && (!chunk || !chunk.length))
return;
var ret = self.push(chunk);
@@ -819,10 +822,10 @@ Readable.prototype.wrap = function(stream) {
// proxy all the other methods.
// important when wrapping filters and duplexes.
for (var i in stream) {
- if (util.isFunction(stream[i]) && util.isUndefined(this[i])) {
+ if (this[i] === undefined && typeof stream[i] === 'function') {
this[i] = function(method) { return function() {
return stream[method].apply(stream, arguments);
- }}(i);
+ }; }(i);
}
}
@@ -926,14 +929,16 @@ function endReadable(stream) {
if (!state.endEmitted) {
state.ended = true;
- process.nextTick(function() {
- // Check that we didn't get one last unshift.
- if (!state.endEmitted && state.length === 0) {
- state.endEmitted = true;
- stream.readable = false;
- stream.emit('end');
- }
- });
+ processNextTick(endReadableNT, state, stream);
+ }
+}
+
+function endReadableNT(state, stream) {
+ // Check that we didn't get one last unshift.
+ if (!state.endEmitted && state.length === 0) {
+ state.endEmitted = true;
+ stream.readable = false;
+ stream.emit('end');
}
}
diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_transform.js b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_transform.js
index 905c5e45075..3675d18d915 100644
--- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_transform.js
+++ b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_transform.js
@@ -1,25 +1,3 @@
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to permit
-// persons to whom the Software is furnished to do so, subject to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
// a transform stream is a readable/writable stream where you do
// something with the data. Sometimes it's called a "filter",
// but that's not a great name for it, since that implies a thing where
@@ -62,6 +40,8 @@
// would be consumed, and then the rest would wait (un-transformed) until
// the results of the previous transformed chunk were consumed.
+'use strict';
+
module.exports = Transform;
var Duplex = require('./_stream_duplex');
@@ -74,7 +54,7 @@ util.inherits = require('inherits');
util.inherits(Transform, Duplex);
-function TransformState(options, stream) {
+function TransformState(stream) {
this.afterTransform = function(er, data) {
return afterTransform(stream, er, data);
};
@@ -97,7 +77,7 @@ function afterTransform(stream, er, data) {
ts.writechunk = null;
ts.writecb = null;
- if (!util.isNullOrUndefined(data))
+ if (data !== null && data !== undefined)
stream.push(data);
if (cb)
@@ -117,7 +97,7 @@ function Transform(options) {
Duplex.call(this, options);
- this._transformState = new TransformState(options, this);
+ this._transformState = new TransformState(this);
// when the writable side finishes, then flush out anything remaining.
var stream = this;
@@ -130,8 +110,16 @@ function Transform(options) {
// sync guard flag.
this._readableState.sync = false;
+ if (options) {
+ if (typeof options.transform === 'function')
+ this._transform = options.transform;
+
+ if (typeof options.flush === 'function')
+ this._flush = options.flush;
+ }
+
this.once('prefinish', function() {
- if (util.isFunction(this._flush))
+ if (typeof this._flush === 'function')
this._flush(function(er) {
done(stream, er);
});
@@ -179,7 +167,7 @@ Transform.prototype._write = function(chunk, encoding, cb) {
Transform.prototype._read = function(n) {
var ts = this._transformState;
- if (!util.isNull(ts.writechunk) && ts.writecb && !ts.transforming) {
+ if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
ts.transforming = true;
this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
} else {
diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js
index db8539cd5b8..41b866d8989 100644
--- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js
+++ b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js
@@ -1,31 +1,17 @@
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to permit
-// persons to whom the Software is furnished to do so, subject to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
// A bit simpler than readable streams.
// Implement an async ._write(chunk, cb), and it'll handle all
// the drain event emission and buffering.
+'use strict';
+
module.exports = Writable;
/*<replacement>*/
+var processNextTick = require('process-nextick-args');
+/*</replacement>*/
+
+
+/*<replacement>*/
var Buffer = require('buffer').Buffer;
/*</replacement>*/
@@ -37,14 +23,26 @@ var util = require('core-util-is');
util.inherits = require('inherits');
/*</replacement>*/
-var Stream = require('stream');
+
+
+/*<replacement>*/
+var Stream;
+ (function (){try{
+Stream = require('st' + 'ream');
+}catch(_){Stream = require('events').EventEmitter;}}())
+/*</replacement>*/
+
+var Buffer = require('buffer').Buffer;
util.inherits(Writable, Stream);
+function nop() {}
+
function WriteReq(chunk, encoding, cb) {
this.chunk = chunk;
this.encoding = encoding;
this.callback = cb;
+ this.next = null;
}
function WritableState(options, stream) {
@@ -52,13 +50,6 @@ function WritableState(options, stream) {
options = options || {};
- // the point at which write() starts returning false
- // Note: 0 is a valid value, means that we always return false if
- // the entire buffer is not flushed immediately on write()
- var hwm = options.highWaterMark;
- var defaultHwm = options.objectMode ? 16 : 16 * 1024;
- this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm;
-
// object stream flag to indicate whether or not this stream
// contains buffers or objects.
this.objectMode = !!options.objectMode;
@@ -66,6 +57,13 @@ function WritableState(options, stream) {
if (stream instanceof Duplex)
this.objectMode = this.objectMode || !!options.writableObjectMode;
+ // the point at which write() starts returning false
+ // Note: 0 is a valid value, means that we always return false if
+ // the entire buffer is not flushed immediately on write()
+ var hwm = options.highWaterMark;
+ var defaultHwm = this.objectMode ? 16 : 16 * 1024;
+ this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm;
+
// cast to ints.
this.highWaterMark = ~~this.highWaterMark;
@@ -121,7 +119,8 @@ function WritableState(options, stream) {
// the amount that is being written when _write is called.
this.writelen = 0;
- this.buffer = [];
+ this.bufferedRequest = null;
+ this.lastBufferedRequest = null;
// number of pending user-supplied write callbacks
// this must be 0 before 'finish' can be emitted
@@ -135,6 +134,26 @@ function WritableState(options, stream) {
this.errorEmitted = false;
}
+WritableState.prototype.getBuffer = function writableStateGetBuffer() {
+ var current = this.bufferedRequest;
+ var out = [];
+ while (current) {
+ out.push(current);
+ current = current.next;
+ }
+ return out;
+};
+
+(function (){try {
+Object.defineProperty(WritableState.prototype, 'buffer', {
+ get: require('util-deprecate')(function() {
+ return this.getBuffer();
+ }, '_writableState.buffer is deprecated. Use ' +
+ '_writableState.getBuffer() instead.')
+});
+}catch(_){}}());
+
+
function Writable(options) {
var Duplex = require('./_stream_duplex');
@@ -148,6 +167,14 @@ function Writable(options) {
// legacy.
this.writable = true;
+ if (options) {
+ if (typeof options.write === 'function')
+ this._write = options.write;
+
+ if (typeof options.writev === 'function')
+ this._writev = options.writev;
+ }
+
Stream.call(this);
}
@@ -157,13 +184,11 @@ Writable.prototype.pipe = function() {
};
-function writeAfterEnd(stream, state, cb) {
+function writeAfterEnd(stream, cb) {
var er = new Error('write after end');
// TODO: defer error events consistently everywhere, not just the cb
stream.emit('error', er);
- process.nextTick(function() {
- cb(er);
- });
+ processNextTick(cb, er);
}
// If we get something that is not a buffer, string, null, or undefined,
@@ -173,15 +198,15 @@ function writeAfterEnd(stream, state, cb) {
// how many bytes or characters.
function validChunk(stream, state, chunk, cb) {
var valid = true;
- if (!util.isBuffer(chunk) &&
- !util.isString(chunk) &&
- !util.isNullOrUndefined(chunk) &&
+
+ if (!(Buffer.isBuffer(chunk)) &&
+ typeof chunk !== 'string' &&
+ chunk !== null &&
+ chunk !== undefined &&
!state.objectMode) {
var er = new TypeError('Invalid non-string/buffer chunk');
stream.emit('error', er);
- process.nextTick(function() {
- cb(er);
- });
+ processNextTick(cb, er);
valid = false;
}
return valid;
@@ -191,21 +216,21 @@ Writable.prototype.write = function(chunk, encoding, cb) {
var state = this._writableState;
var ret = false;
- if (util.isFunction(encoding)) {
+ if (typeof encoding === 'function') {
cb = encoding;
encoding = null;
}
- if (util.isBuffer(chunk))
+ if (Buffer.isBuffer(chunk))
encoding = 'buffer';
else if (!encoding)
encoding = state.defaultEncoding;
- if (!util.isFunction(cb))
- cb = function() {};
+ if (typeof cb !== 'function')
+ cb = nop;
if (state.ended)
- writeAfterEnd(this, state, cb);
+ writeAfterEnd(this, cb);
else if (validChunk(this, state, chunk, cb)) {
state.pendingcb++;
ret = writeOrBuffer(this, state, chunk, encoding, cb);
@@ -230,15 +255,26 @@ Writable.prototype.uncork = function() {
!state.corked &&
!state.finished &&
!state.bufferProcessing &&
- state.buffer.length)
+ state.bufferedRequest)
clearBuffer(this, state);
}
};
+Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
+ // node::ParseEncoding() requires lower case.
+ if (typeof encoding === 'string')
+ encoding = encoding.toLowerCase();
+ if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64',
+'ucs2', 'ucs-2','utf16le', 'utf-16le', 'raw']
+.indexOf((encoding + '').toLowerCase()) > -1))
+ throw new TypeError('Unknown encoding: ' + encoding);
+ this._writableState.defaultEncoding = encoding;
+};
+
function decodeChunk(state, chunk, encoding) {
if (!state.objectMode &&
state.decodeStrings !== false &&
- util.isString(chunk)) {
+ typeof chunk === 'string') {
chunk = new Buffer(chunk, encoding);
}
return chunk;
@@ -249,7 +285,8 @@ function decodeChunk(state, chunk, encoding) {
// If we return false, then we need a drain event, so set that flag.
function writeOrBuffer(stream, state, chunk, encoding, cb) {
chunk = decodeChunk(state, chunk, encoding);
- if (util.isBuffer(chunk))
+
+ if (Buffer.isBuffer(chunk))
encoding = 'buffer';
var len = state.objectMode ? 1 : chunk.length;
@@ -260,10 +297,17 @@ function writeOrBuffer(stream, state, chunk, encoding, cb) {
if (!ret)
state.needDrain = true;
- if (state.writing || state.corked)
- state.buffer.push(new WriteReq(chunk, encoding, cb));
- else
+ if (state.writing || state.corked) {
+ var last = state.lastBufferedRequest;
+ state.lastBufferedRequest = new WriteReq(chunk, encoding, cb);
+ if (last) {
+ last.next = state.lastBufferedRequest;
+ } else {
+ state.bufferedRequest = state.lastBufferedRequest;
+ }
+ } else {
doWrite(stream, state, false, len, chunk, encoding, cb);
+ }
return ret;
}
@@ -281,15 +325,11 @@ function doWrite(stream, state, writev, len, chunk, encoding, cb) {
}
function onwriteError(stream, state, sync, er, cb) {
+ --state.pendingcb;
if (sync)
- process.nextTick(function() {
- state.pendingcb--;
- cb(er);
- });
- else {
- state.pendingcb--;
+ processNextTick(cb, er);
+ else
cb(er);
- }
stream._writableState.errorEmitted = true;
stream.emit('error', er);
@@ -313,19 +353,17 @@ function onwrite(stream, er) {
onwriteError(stream, state, sync, er, cb);
else {
// Check if we're actually ready to finish, but don't emit yet
- var finished = needFinish(stream, state);
+ var finished = needFinish(state);
if (!finished &&
!state.corked &&
!state.bufferProcessing &&
- state.buffer.length) {
+ state.bufferedRequest) {
clearBuffer(stream, state);
}
if (sync) {
- process.nextTick(function() {
- afterWrite(stream, state, finished, cb);
- });
+ processNextTick(afterWrite, stream, state, finished, cb);
} else {
afterWrite(stream, state, finished, cb);
}
@@ -354,17 +392,23 @@ function onwriteDrain(stream, state) {
// if there's something in the buffer waiting, then process it
function clearBuffer(stream, state) {
state.bufferProcessing = true;
+ var entry = state.bufferedRequest;
- if (stream._writev && state.buffer.length > 1) {
+ if (stream._writev && entry && entry.next) {
// Fast case, write everything using _writev()
+ var buffer = [];
var cbs = [];
- for (var c = 0; c < state.buffer.length; c++)
- cbs.push(state.buffer[c].callback);
+ while (entry) {
+ cbs.push(entry.callback);
+ buffer.push(entry);
+ entry = entry.next;
+ }
// count the one we are adding, as well.
// TODO(isaacs) clean this up
state.pendingcb++;
- doWrite(stream, state, true, state.length, state.buffer, '', function(err) {
+ state.lastBufferedRequest = null;
+ doWrite(stream, state, true, state.length, buffer, '', function(err) {
for (var i = 0; i < cbs.length; i++) {
state.pendingcb--;
cbs[i](err);
@@ -372,40 +416,34 @@ function clearBuffer(stream, state) {
});
// Clear buffer
- state.buffer = [];
} else {
// Slow case, write chunks one-by-one
- for (var c = 0; c < state.buffer.length; c++) {
- var entry = state.buffer[c];
+ while (entry) {
var chunk = entry.chunk;
var encoding = entry.encoding;
var cb = entry.callback;
var len = state.objectMode ? 1 : chunk.length;
doWrite(stream, state, false, len, chunk, encoding, cb);
-
+ entry = entry.next;
// if we didn't call the onwrite immediately, then
// it means that we need to wait until it does.
// also, that means that the chunk and cb are currently
// being processed, so move the buffer counter past them.
if (state.writing) {
- c++;
break;
}
}
- if (c < state.buffer.length)
- state.buffer = state.buffer.slice(c);
- else
- state.buffer.length = 0;
+ if (entry === null)
+ state.lastBufferedRequest = null;
}
-
+ state.bufferedRequest = entry;
state.bufferProcessing = false;
}
Writable.prototype._write = function(chunk, encoding, cb) {
cb(new Error('not implemented'));
-
};
Writable.prototype._writev = null;
@@ -413,16 +451,16 @@ Writable.prototype._writev = null;
Writable.prototype.end = function(chunk, encoding, cb) {
var state = this._writableState;
- if (util.isFunction(chunk)) {
+ if (typeof chunk === 'function') {
cb = chunk;
chunk = null;
encoding = null;
- } else if (util.isFunction(encoding)) {
+ } else if (typeof encoding === 'function') {
cb = encoding;
encoding = null;
}
- if (!util.isNullOrUndefined(chunk))
+ if (chunk !== null && chunk !== undefined)
this.write(chunk, encoding);
// .end() fully uncorks
@@ -437,9 +475,10 @@ Writable.prototype.end = function(chunk, encoding, cb) {
};
-function needFinish(stream, state) {
+function needFinish(state) {
return (state.ending &&
state.length === 0 &&
+ state.bufferedRequest === null &&
!state.finished &&
!state.writing);
}
@@ -452,14 +491,15 @@ function prefinish(stream, state) {
}
function finishMaybe(stream, state) {
- var need = needFinish(stream, state);
+ var need = needFinish(state);
if (need) {
if (state.pendingcb === 0) {
prefinish(stream, state);
state.finished = true;
stream.emit('finish');
- } else
+ } else {
prefinish(stream, state);
+ }
}
return need;
}
@@ -469,7 +509,7 @@ function endWritable(stream, state, cb) {
finishMaybe(stream, state);
if (cb) {
if (state.finished)
- process.nextTick(cb);
+ processNextTick(cb);
else
stream.once('finish', cb);
}
diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/package.json b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/package.json
index 9cfaa604cec..89ff535fd78 100644
--- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/package.json
+++ b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/package.json
@@ -31,8 +31,6 @@
"readmeFilename": "README.md",
"homepage": "https://github.com/isaacs/core-util-is",
"_id": "core-util-is@1.0.1",
- "_shasum": "6b07085aef9a3ccac6ee53bf9d3df0c1521a5538",
"_from": "core-util-is@>=1.0.0 <1.1.0",
- "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz",
"scripts": {}
}
diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml
new file mode 100644
index 00000000000..5ac98855343
--- /dev/null
+++ b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml
@@ -0,0 +1,7 @@
+language: node_js
+node_js:
+ - "0.8"
+ - "0.10"
+ - "0.11"
+ - "0.12"
+ - "iojs"
diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/index.js b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/index.js
new file mode 100644
index 00000000000..3eb2f33d0ce
--- /dev/null
+++ b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/index.js
@@ -0,0 +1,13 @@
+'use strict';
+module.exports = nextTick;
+
+function nextTick(fn) {
+ var args = new Array(arguments.length - 1);
+ var i = 0;
+ while (i < arguments.length) {
+ args[i++] = arguments[i];
+ }
+ process.nextTick(function afterTick() {
+ fn.apply(null, args);
+ });
+}
diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/package.json b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/package.json
new file mode 100644
index 00000000000..02e4a2c6546
--- /dev/null
+++ b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/package.json
@@ -0,0 +1,44 @@
+{
+ "name": "process-nextick-args",
+ "version": "1.0.1",
+ "description": "process.nextTick but always with args",
+ "main": "index.js",
+ "scripts": {
+ "test": "node test.js"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/calvinmetcalf/process-nextick-args.git"
+ },
+ "author": "",
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/calvinmetcalf/process-nextick-args/issues"
+ },
+ "homepage": "https://github.com/calvinmetcalf/process-nextick-args",
+ "devDependencies": {
+ "tap": "~0.2.6"
+ },
+ "gitHead": "b7c95b21096503e76a1b7f4f60920d32d8378eeb",
+ "_id": "process-nextick-args@1.0.1",
+ "_shasum": "918a5ab4a7744340b83ff416101ba53c5c531879",
+ "_from": "process-nextick-args@>=1.0.0 <1.1.0",
+ "_npmVersion": "2.0.0",
+ "_npmUser": {
+ "name": "cwmma",
+ "email": "calvin.metcalf@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "cwmma",
+ "email": "calvin.metcalf@gmail.com"
+ }
+ ],
+ "dist": {
+ "shasum": "918a5ab4a7744340b83ff416101ba53c5c531879",
+ "tarball": "http://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.1.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.1.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/readme.md b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/readme.md
new file mode 100644
index 00000000000..71390efbe68
--- /dev/null
+++ b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/readme.md
@@ -0,0 +1,18 @@
+process-nexttick-args
+=====
+
+[![Build Status](https://travis-ci.org/calvinmetcalf/process-nextick-args.svg?branch=master)](https://travis-ci.org/calvinmetcalf/process-nextick-args)
+
+```bash
+npm install --save process-nexttick-args
+```
+
+Always be able to pass arguments to process.nextTick, no matter the platform
+
+```js
+var nextTick = require('process-nexttick-args');
+
+nextTick(function (a, b, c) {
+ console.log(a, b, c);
+}, 'step', 3, 'profit');
+```
diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/test.js b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/test.js
new file mode 100644
index 00000000000..729f775ff50
--- /dev/null
+++ b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/test.js
@@ -0,0 +1,17 @@
+var test = require("tap").test;
+var nextTick = require('./');
+
+test('should work', function (t) {
+ t.plan(5);
+ nextTick(function (a) {
+ t.ok(a);
+ nextTick(function (thing) {
+ t.equals(thing, 7);
+ }, 7);
+ }, true);
+ nextTick(function (a, b, c) {
+ t.equals(a, 'step');
+ t.equals(b, 3);
+ t.equals(c, 'profit');
+ }, 'step', 3, 'profit');
+});
diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/package.json b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/package.json
index 9bd59ae8d5e..0364d54ba46 100644
--- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/package.json
+++ b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/package.json
@@ -22,13 +22,33 @@
"browserify"
],
"license": "MIT",
- "readme": "**string_decoder.js** (`require('string_decoder')`) from Node.js core\n\nCopyright Joyent, Inc. and other Node contributors. See LICENCE file for details.\n\nVersion numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. **Prefer the stable version over the unstable.**\n\nThe *build/* directory contains a build script that will scrape the source from the [joyent/node](https://github.com/joyent/node) repo given a specific Node version.",
- "readmeFilename": "README.md",
+ "gitHead": "d46d4fd87cf1d06e031c23f1ba170ca7d4ade9a0",
"bugs": {
"url": "https://github.com/rvagg/string_decoder/issues"
},
"_id": "string_decoder@0.10.31",
"_shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94",
"_from": "string_decoder@>=0.10.0 <0.11.0",
- "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
+ "_npmVersion": "1.4.23",
+ "_npmUser": {
+ "name": "rvagg",
+ "email": "rod@vagg.org"
+ },
+ "maintainers": [
+ {
+ "name": "substack",
+ "email": "mail@substack.net"
+ },
+ {
+ "name": "rvagg",
+ "email": "rod@vagg.org"
+ }
+ ],
+ "dist": {
+ "shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94",
+ "tarball": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
+ "readme": "ERROR: No README data found!"
}
diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/History.md b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/History.md
new file mode 100644
index 00000000000..ec010299b1b
--- /dev/null
+++ b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/History.md
@@ -0,0 +1,11 @@
+
+1.0.1 / 2014-11-25
+==================
+
+ * browser: use `console.warn()` for deprecation calls
+ * browser: more jsdocs
+
+1.0.0 / 2014-04-30
+==================
+
+ * initial commit
diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/LICENSE b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/LICENSE
new file mode 100644
index 00000000000..6a60e8c225c
--- /dev/null
+++ b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/LICENSE
@@ -0,0 +1,24 @@
+(The MIT License)
+
+Copyright (c) 2014 Nathan Rajlich <nathan@tootallnate.net>
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/README.md b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/README.md
new file mode 100644
index 00000000000..75622fa7c25
--- /dev/null
+++ b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/README.md
@@ -0,0 +1,53 @@
+util-deprecate
+==============
+### The Node.js `util.deprecate()` function with browser support
+
+In Node.js, this module simply re-exports the `util.deprecate()` function.
+
+In the web browser (i.e. via browserify), a browser-specific implementation
+of the `util.deprecate()` function is used.
+
+
+## API
+
+A `deprecate()` function is the only thing exposed by this module.
+
+``` javascript
+// setup:
+exports.foo = deprecate(foo, 'foo() is deprecated, use bar() instead');
+
+
+// users see:
+foo();
+// foo() is deprecated, use bar() instead
+foo();
+foo();
+```
+
+
+## License
+
+(The MIT License)
+
+Copyright (c) 2014 Nathan Rajlich <nathan@tootallnate.net>
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/browser.js b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/browser.js
new file mode 100644
index 00000000000..55fa5a4bc60
--- /dev/null
+++ b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/browser.js
@@ -0,0 +1,62 @@
+
+/**
+ * Module exports.
+ */
+
+module.exports = deprecate;
+
+/**
+ * Mark that a method should not be used.
+ * Returns a modified function which warns once by default.
+ *
+ * If `localStorage.noDeprecation = true` is set, then it is a no-op.
+ *
+ * If `localStorage.throwDeprecation = true` is set, then deprecated functions
+ * will throw an Error when invoked.
+ *
+ * If `localStorage.traceDeprecation = true` is set, then deprecated functions
+ * will invoke `console.trace()` instead of `console.error()`.
+ *
+ * @param {Function} fn - the function to deprecate
+ * @param {String} msg - the string to print to the console when `fn` is invoked
+ * @returns {Function} a new "deprecated" version of `fn`
+ * @api public
+ */
+
+function deprecate (fn, msg) {
+ if (config('noDeprecation')) {
+ return fn;
+ }
+
+ var warned = false;
+ function deprecated() {
+ if (!warned) {
+ if (config('throwDeprecation')) {
+ throw new Error(msg);
+ } else if (config('traceDeprecation')) {
+ console.trace(msg);
+ } else {
+ console.warn(msg);
+ }
+ warned = true;
+ }
+ return fn.apply(this, arguments);
+ }
+
+ return deprecated;
+}
+
+/**
+ * Checks `localStorage` for boolean values for the given `name`.
+ *
+ * @param {String} name
+ * @returns {Boolean}
+ * @api private
+ */
+
+function config (name) {
+ if (!global.localStorage) return false;
+ var val = global.localStorage[name];
+ if (null == val) return false;
+ return String(val).toLowerCase() === 'true';
+}
diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/node.js b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/node.js
new file mode 100644
index 00000000000..5e6fcff5ddd
--- /dev/null
+++ b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/node.js
@@ -0,0 +1,6 @@
+
+/**
+ * For Node.js, simply re-export the core `util.deprecate` function.
+ */
+
+module.exports = require('util').deprecate;
diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/package.json b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/package.json
new file mode 100644
index 00000000000..ea487da0e43
--- /dev/null
+++ b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/package.json
@@ -0,0 +1,53 @@
+{
+ "name": "util-deprecate",
+ "version": "1.0.1",
+ "description": "The Node.js `util.deprecate()` function with browser support",
+ "main": "node.js",
+ "browser": "browser.js",
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/TooTallNate/util-deprecate.git"
+ },
+ "keywords": [
+ "util",
+ "deprecate",
+ "browserify",
+ "browser",
+ "node"
+ ],
+ "author": {
+ "name": "Nathan Rajlich",
+ "email": "nathan@tootallnate.net",
+ "url": "http://n8.io/"
+ },
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/TooTallNate/util-deprecate/issues"
+ },
+ "homepage": "https://github.com/TooTallNate/util-deprecate",
+ "gitHead": "6e923f7d98a0afbe5b9c7db9d0f0029c1936746c",
+ "_id": "util-deprecate@1.0.1",
+ "_shasum": "3556a3d13c4c6aa7983d7e2425478197199b7881",
+ "_from": "util-deprecate@>=1.0.1 <1.1.0",
+ "_npmVersion": "1.4.28",
+ "_npmUser": {
+ "name": "tootallnate",
+ "email": "nathan@tootallnate.net"
+ },
+ "maintainers": [
+ {
+ "name": "tootallnate",
+ "email": "nathan@tootallnate.net"
+ }
+ ],
+ "dist": {
+ "shasum": "3556a3d13c4c6aa7983d7e2425478197199b7881",
+ "tarball": "http://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.1.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.1.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/package.json b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/package.json
index a66aa87f86f..1b3c1718145 100644
--- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/package.json
+++ b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/package.json
@@ -1,23 +1,28 @@
{
"name": "readable-stream",
- "version": "1.1.13",
- "description": "Streams3, a user-land copy of the stream library from Node.js v0.11.x",
+ "version": "2.0.1",
+ "description": "Streams3, a user-land copy of the stream library from iojs v2.x",
"main": "readable.js",
"dependencies": {
"core-util-is": "~1.0.0",
+ "inherits": "~2.0.1",
"isarray": "0.0.1",
+ "process-nextick-args": "~1.0.0",
"string_decoder": "~0.10.x",
- "inherits": "~2.0.1"
+ "util-deprecate": "~1.0.1"
},
"devDependencies": {
- "tap": "~0.2.6"
+ "tap": "~0.2.6",
+ "tape": "~4.0.0",
+ "zuul": "~3.0.0"
},
"scripts": {
- "test": "tap test/simple/*.js"
+ "test": "tap test/parallel/*.js",
+ "browser": "zuul --browser-name $BROWSER_NAME --browser-version $BROWSER_VERSION -- test/browser.js"
},
"repository": {
"type": "git",
- "url": "git://github.com/isaacs/readable-stream.git"
+ "url": "git://github.com/nodejs/readable-stream.git"
},
"keywords": [
"readable",
@@ -27,20 +32,44 @@
"browser": {
"util": false
},
- "author": {
- "name": "Isaac Z. Schlueter",
- "email": "i@izs.me",
- "url": "http://blog.izs.me/"
- },
"license": "MIT",
- "readme": "# readable-stream\n\n***Node-core streams for userland***\n\n[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/)\n[![NPM](https://nodei.co/npm-dl/readable-stream.png&months=6&height=3)](https://nodei.co/npm/readable-stream/)\n\nThis package is a mirror of the Streams2 and Streams3 implementations in Node-core.\n\nIf you want to guarantee a stable streams base, regardless of what version of Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *\"stream\"* module in Node-core.\n\n**readable-stream** comes in two major versions, v1.0.x and v1.1.x. The former tracks the Streams2 implementation in Node 0.10, including bug-fixes and minor improvements as they are added. The latter tracks Streams3 as it develops in Node 0.11; we will likely see a v1.2.x branch for Node 0.12.\n\n**readable-stream** uses proper patch-level versioning so if you pin to `\"~1.0.0\"` you’ll get the latest Node 0.10 Streams2 implementation, including any fixes and minor non-breaking improvements. The patch-level versions of 1.0.x and 1.1.x should mirror the patch-level versions of Node-core releases. You should prefer the **1.0.x** releases for now and when you’re ready to start using Streams3, pin to `\"~1.1.0\"`\n\n",
- "readmeFilename": "README.md",
+ "gitHead": "d175d0f68745a5014fc9c41b25b8e0e959269126",
"bugs": {
- "url": "https://github.com/isaacs/readable-stream/issues"
+ "url": "https://github.com/nodejs/readable-stream/issues"
+ },
+ "homepage": "https://github.com/nodejs/readable-stream#readme",
+ "_id": "readable-stream@2.0.1",
+ "_shasum": "633479b7bd2fbe7a1e869825b40a0b333b9f2bfc",
+ "_from": "readable-stream@>=2.0.0 <2.1.0",
+ "_npmVersion": "2.11.1",
+ "_nodeVersion": "2.3.0",
+ "_npmUser": {
+ "name": "cwmma",
+ "email": "calvin.metcalf@gmail.com"
},
- "homepage": "https://github.com/isaacs/readable-stream",
- "_id": "readable-stream@1.1.13",
- "_shasum": "f6eef764f514c89e2b9e23146a75ba106756d23e",
- "_from": "readable-stream@>=1.1.9 <1.2.0",
- "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.13.tgz"
+ "dist": {
+ "shasum": "633479b7bd2fbe7a1e869825b40a0b333b9f2bfc",
+ "tarball": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.0.1.tgz"
+ },
+ "maintainers": [
+ {
+ "name": "isaacs",
+ "email": "isaacs@npmjs.com"
+ },
+ {
+ "name": "tootallnate",
+ "email": "nathan@tootallnate.net"
+ },
+ {
+ "name": "rvagg",
+ "email": "rod@vagg.org"
+ },
+ {
+ "name": "cwmma",
+ "email": "calvin.metcalf@gmail.com"
+ }
+ ],
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.1.tgz",
+ "readme": "ERROR: No README data found!"
}
diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/readable.js b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/readable.js
index 09b8bf5091a..6222a579864 100644
--- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/readable.js
+++ b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/readable.js
@@ -1,5 +1,10 @@
+var Stream = (function (){
+ try {
+ return require('st' + 'ream'); // hack to fix a circular dependency issue when used with browserify
+ } catch(_){}
+}());
exports = module.exports = require('./lib/_stream_readable.js');
-exports.Stream = require('stream');
+exports.Stream = Stream || exports;
exports.Readable = exports;
exports.Writable = require('./lib/_stream_writable.js');
exports.Duplex = require('./lib/_stream_duplex.js');
diff --git a/tools/eslint/node_modules/concat-stream/node_modules/typedarray/package.json b/tools/eslint/node_modules/concat-stream/node_modules/typedarray/package.json
index b8b59f5c303..fe413b9b80a 100644
--- a/tools/eslint/node_modules/concat-stream/node_modules/typedarray/package.json
+++ b/tools/eslint/node_modules/concat-stream/node_modules/typedarray/package.json
@@ -52,28 +52,13 @@
"android-browser/4.2..latest"
]
},
+ "readme": "# typedarray\n\nTypedArray polyfill ripped from [this\nmodule](https://raw.github.com/inexorabletash/polyfill).\n\n[![build status](https://secure.travis-ci.org/substack/typedarray.png)](http://travis-ci.org/substack/typedarray)\n\n[![testling badge](https://ci.testling.com/substack/typedarray.png)](https://ci.testling.com/substack/typedarray)\n\n# example\n\n``` js\nvar Uint8Array = require('typedarray').Uint8Array;\nvar ua = new Uint8Array(5);\nua[1] = 256 + 55;\nconsole.log(ua[1]);\n```\n\noutput:\n\n```\n55\n```\n\n# methods\n\n``` js\nvar TA = require('typedarray')\n```\n\nThe `TA` object has the following constructors:\n\n* TA.ArrayBuffer\n* TA.DataView\n* TA.Float32Array\n* TA.Float64Array\n* TA.Int8Array\n* TA.Int16Array\n* TA.Int32Array\n* TA.Uint8Array\n* TA.Uint8ClampedArray\n* TA.Uint16Array\n* TA.Uint32Array\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install typedarray\n```\n\nTo use this module in the browser, compile with\n[browserify](http://browserify.org)\nor download a UMD build from browserify CDN:\n\nhttp://wzrd.in/standalone/typedarray@latest\n\n# license\n\nMIT\n",
+ "readmeFilename": "readme.markdown",
"bugs": {
"url": "https://github.com/substack/typedarray/issues"
},
"_id": "typedarray@0.0.6",
- "dist": {
- "shasum": "867ac74e3864187b1d3d47d996a78ec5c8830777",
- "tarball": "http://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz"
- },
- "_from": "typedarray@>=0.0.5 <0.1.0",
- "_npmVersion": "1.4.3",
- "_npmUser": {
- "name": "substack",
- "email": "mail@substack.net"
- },
- "maintainers": [
- {
- "name": "substack",
- "email": "mail@substack.net"
- }
- ],
- "directories": {},
"_shasum": "867ac74e3864187b1d3d47d996a78ec5c8830777",
- "_resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
- "readme": "ERROR: No README data found!"
+ "_from": "typedarray@>=0.0.5 <0.1.0",
+ "_resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz"
}
diff --git a/tools/eslint/node_modules/concat-stream/package.json b/tools/eslint/node_modules/concat-stream/package.json
index 0a5652171d2..caa06817b0e 100644
--- a/tools/eslint/node_modules/concat-stream/package.json
+++ b/tools/eslint/node_modules/concat-stream/package.json
@@ -1,6 +1,6 @@
{
"name": "concat-stream",
- "version": "1.4.8",
+ "version": "1.5.0",
"description": "writable stream that concatenates strings or binary data and calls a callback with the result",
"tags": [
"stream",
@@ -23,6 +23,9 @@
"node >= 0.8"
],
"main": "index.js",
+ "files": [
+ "index.js"
+ ],
"scripts": {
"test": "tape test/*.js test/server/*.js"
},
@@ -30,7 +33,7 @@
"dependencies": {
"inherits": "~2.0.1",
"typedarray": "~0.0.5",
- "readable-stream": "~1.1.9"
+ "readable-stream": "~2.0.0"
},
"devDependencies": {
"tape": "~2.3.2"
@@ -51,13 +54,13 @@
"android-browser/4.2..latest"
]
},
- "gitHead": "1f4ea1a7791b9366a133cab033eb0f3564cb0d92",
- "homepage": "https://github.com/maxogden/concat-stream",
- "_id": "concat-stream@1.4.8",
- "_shasum": "e8325bb89e55000e52b626d97466fde1a28cfe5d",
+ "gitHead": "7cb37c8ddc0fd2ea03c104d07d44d84b83a31185",
+ "homepage": "https://github.com/maxogden/concat-stream#readme",
+ "_id": "concat-stream@1.5.0",
+ "_shasum": "53f7d43c51c5e43f81c8fdd03321c631be68d611",
"_from": "concat-stream@>=1.4.6 <2.0.0",
- "_npmVersion": "2.7.0",
- "_nodeVersion": "1.5.1",
+ "_npmVersion": "2.9.0",
+ "_nodeVersion": "1.8.2",
"_npmUser": {
"name": "maxogden",
"email": "max@maxogden.com"
@@ -69,10 +72,10 @@
}
],
"dist": {
- "shasum": "e8325bb89e55000e52b626d97466fde1a28cfe5d",
- "tarball": "http://registry.npmjs.org/concat-stream/-/concat-stream-1.4.8.tgz"
+ "shasum": "53f7d43c51c5e43f81c8fdd03321c631be68d611",
+ "tarball": "http://registry.npmjs.org/concat-stream/-/concat-stream-1.5.0.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.4.8.tgz",
+ "_resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.0.tgz",
"readme": "ERROR: No README data found!"
}
diff --git a/tools/eslint/node_modules/concat-stream/readme.md b/tools/eslint/node_modules/concat-stream/readme.md
index d028aec3c0c..69234d52a53 100644
--- a/tools/eslint/node_modules/concat-stream/readme.md
+++ b/tools/eslint/node_modules/concat-stream/readme.md
@@ -2,8 +2,18 @@
Writable stream that concatenates strings or binary data and calls a callback with the result. Not a transform stream -- more of a stream sink.
+[![Build Status](https://travis-ci.org/maxogden/concat-stream.svg?branch=master)](https://travis-ci.org/maxogden/concat-stream)
+
[![NPM](https://nodei.co/npm/concat-stream.png)](https://nodei.co/npm/concat-stream/)
+### description
+
+Streams emit many buffers. If you want to collect all of the buffers, and when the stream ends concatenate all of the buffers together and receive a single buffer then this is the module for you.
+
+Only use this if you know you can fit all of the output of your stream into a single Buffer (e.g. in RAM).
+
+There are also `objectMode` streams that emit things other than Buffers, and you can concatenate these too. See below for details.
+
### examples
#### Buffers
diff --git a/tools/eslint/node_modules/concat-stream/test/array.js b/tools/eslint/node_modules/concat-stream/test/array.js
deleted file mode 100644
index 86e7dd43bf3..00000000000
--- a/tools/eslint/node_modules/concat-stream/test/array.js
+++ /dev/null
@@ -1,12 +0,0 @@
-var concat = require('../')
-var test = require('tape')
-
-test('array stream', function (t) {
- t.plan(1)
- var arrays = concat({ encoding: 'array' }, function(out) {
- t.deepEqual(out, [1,2,3,4,5,6])
- })
- arrays.write([1,2,3])
- arrays.write([4,5,6])
- arrays.end()
-})
diff --git a/tools/eslint/node_modules/concat-stream/test/buffer.js b/tools/eslint/node_modules/concat-stream/test/buffer.js
deleted file mode 100644
index d28f5f9c1e2..00000000000
--- a/tools/eslint/node_modules/concat-stream/test/buffer.js
+++ /dev/null
@@ -1,31 +0,0 @@
-var concat = require('../')
-var test = require('tape')
-var TA = require('typedarray')
-var U8 = typeof Uint8Array !== 'undefined' ? Uint8Array : TA.Uint8Array
-
-test('buffer stream', function (t) {
- t.plan(2)
- var buffers = concat(function(out) {
- t.ok(Buffer.isBuffer(out))
- t.equal(out.toString('utf8'), 'pizza Array is not a stringy cat')
- })
- buffers.write(new Buffer('pizza Array is not a ', 'utf8'))
- buffers.write(new Buffer('stringy cat'))
- buffers.end()
-})
-
-test('buffer mixed writes', function (t) {
- t.plan(2)
- var buffers = concat(function(out) {
- t.ok(Buffer.isBuffer(out))
- t.equal(out.toString('utf8'), 'pizza Array is not a stringy cat555')
- })
- buffers.write(new Buffer('pizza'))
- buffers.write(' Array is not a ')
- buffers.write([ 115, 116, 114, 105, 110, 103, 121 ])
- var u8 = new U8(4)
- u8[0] = 32; u8[1] = 99; u8[2] = 97; u8[3] = 116
- buffers.write(u8)
- buffers.write(555)
- buffers.end()
-})
diff --git a/tools/eslint/node_modules/concat-stream/test/infer.js b/tools/eslint/node_modules/concat-stream/test/infer.js
deleted file mode 100644
index 91ab933f458..00000000000
--- a/tools/eslint/node_modules/concat-stream/test/infer.js
+++ /dev/null
@@ -1,15 +0,0 @@
-var concat = require('../')
-var test = require('tape')
-
-test('type inference works as expected', function(t) {
- var stream = concat()
- t.equal(stream.inferEncoding(['hello']), 'array', 'array')
- t.equal(stream.inferEncoding(new Buffer('hello')), 'buffer', 'buffer')
- t.equal(stream.inferEncoding(undefined), 'buffer', 'buffer')
- t.equal(stream.inferEncoding(new Uint8Array(1)), 'uint8array', 'uint8array')
- t.equal(stream.inferEncoding('hello'), 'string', 'string')
- t.equal(stream.inferEncoding(''), 'string', 'string')
- t.equal(stream.inferEncoding({hello: "world"}), 'object', 'object')
- t.equal(stream.inferEncoding(1), 'buffer', 'buffer')
- t.end()
-})
diff --git a/tools/eslint/node_modules/concat-stream/test/nothing.js b/tools/eslint/node_modules/concat-stream/test/nothing.js
deleted file mode 100644
index 6ac60496582..00000000000
--- a/tools/eslint/node_modules/concat-stream/test/nothing.js
+++ /dev/null
@@ -1,25 +0,0 @@
-var concat = require('../')
-var test = require('tape')
-
-test('no callback stream', function (t) {
- var stream = concat()
- stream.write('space')
- stream.end(' cats')
- t.end()
-})
-
-test('no encoding set, no data', function (t) {
- var stream = concat(function(data) {
- t.deepEqual(data, [])
- t.end()
- })
- stream.end()
-})
-
-test('encoding set to string, no data', function (t) {
- var stream = concat({ encoding: 'string' }, function(data) {
- t.deepEqual(data, '')
- t.end()
- })
- stream.end()
-})
diff --git a/tools/eslint/node_modules/concat-stream/test/objects.js b/tools/eslint/node_modules/concat-stream/test/objects.js
deleted file mode 100644
index ad921ed25b9..00000000000
--- a/tools/eslint/node_modules/concat-stream/test/objects.js
+++ /dev/null
@@ -1,29 +0,0 @@
-var concat = require('../')
-var test = require('tape')
-
-test('writing objects', function (t) {
- var stream = concat({encoding: "objects"}, concatted)
- function concatted(objs) {
- t.equal(objs.length, 2)
- t.deepEqual(objs[0], {"foo": "bar"})
- t.deepEqual(objs[1], {"baz": "taco"})
- }
- stream.write({"foo": "bar"})
- stream.write({"baz": "taco"})
- stream.end()
- t.end()
-})
-
-
-test('switch to objects encoding if no encoding specified and objects are written', function (t) {
- var stream = concat(concatted)
- function concatted(objs) {
- t.equal(objs.length, 2)
- t.deepEqual(objs[0], {"foo": "bar"})
- t.deepEqual(objs[1], {"baz": "taco"})
- }
- stream.write({"foo": "bar"})
- stream.write({"baz": "taco"})
- stream.end()
- t.end()
-})
diff --git a/tools/eslint/node_modules/concat-stream/test/server/ls.js b/tools/eslint/node_modules/concat-stream/test/server/ls.js
deleted file mode 100644
index 3258d8ddcbe..00000000000
--- a/tools/eslint/node_modules/concat-stream/test/server/ls.js
+++ /dev/null
@@ -1,16 +0,0 @@
-var concat = require('../../')
-var spawn = require('child_process').spawn
-var exec = require('child_process').exec
-var test = require('tape')
-
-test('ls command', function (t) {
- t.plan(1)
- var cmd = spawn('ls', [ __dirname ])
- cmd.stdout.pipe(
- concat(function(out) {
- exec('ls ' + __dirname, function (err, body) {
- t.equal(out.toString('utf8'), body.toString('utf8'))
- })
- })
- )
-})
diff --git a/tools/eslint/node_modules/concat-stream/test/string.js b/tools/eslint/node_modules/concat-stream/test/string.js
deleted file mode 100644
index 218c522063b..00000000000
--- a/tools/eslint/node_modules/concat-stream/test/string.js
+++ /dev/null
@@ -1,76 +0,0 @@
-var concat = require('../')
-var test = require('tape')
-var TA = require('typedarray')
-var U8 = typeof Uint8Array !== 'undefined' ? Uint8Array : TA.Uint8Array
-
-test('string -> buffer stream', function (t) {
- t.plan(2)
- var strings = concat({ encoding: 'buffer'}, function(out) {
- t.ok(Buffer.isBuffer(out))
- t.equal(out.toString('utf8'), 'nacho dogs')
- })
- strings.write("nacho ")
- strings.write("dogs")
- strings.end()
-})
-
-test('string stream', function (t) {
- t.plan(2)
- var strings = concat({ encoding: 'string' }, function(out) {
- t.equal(typeof out, 'string')
- t.equal(out, 'nacho dogs')
- })
- strings.write("nacho ")
- strings.write("dogs")
- strings.end()
-})
-
-test('end chunk', function (t) {
- t.plan(1)
- var endchunk = concat({ encoding: 'string' }, function(out) {
- t.equal(out, 'this is the end')
- })
- endchunk.write("this ")
- endchunk.write("is the ")
- endchunk.end("end")
-})
-
-test('string from mixed write encodings', function (t) {
- t.plan(2)
- var strings = concat({ encoding: 'string' }, function(out) {
- t.equal(typeof out, 'string')
- t.equal(out, 'nacho dogs')
- })
- strings.write('na')
- strings.write(Buffer('cho'))
- strings.write([ 32, 100 ])
- var u8 = new U8(3)
- u8[0] = 111; u8[1] = 103; u8[2] = 115;
- strings.end(u8)
-})
-
-test('string from buffers with multibyte characters', function (t) {
- t.plan(2)
- var strings = concat({ encoding: 'string' }, function(out) {
- t.equal(typeof out, 'string')
- t.equal(out, '☃☃☃☃☃☃☃☃')
- })
- var snowman = new Buffer('☃')
- for (var i = 0; i < 8; i++) {
- strings.write(snowman.slice(0, 1))
- strings.write(snowman.slice(1))
- }
- strings.end()
-})
-
-test('string infer encoding with empty string chunk', function (t) {
- t.plan(2)
- var strings = concat(function(out) {
- t.equal(typeof out, 'string')
- t.equal(out, 'nacho dogs')
- })
- strings.write("")
- strings.write("nacho ")
- strings.write("dogs")
- strings.end()
-})
diff --git a/tools/eslint/node_modules/concat-stream/test/typedarray.js b/tools/eslint/node_modules/concat-stream/test/typedarray.js
deleted file mode 100644
index ee07110828a..00000000000
--- a/tools/eslint/node_modules/concat-stream/test/typedarray.js
+++ /dev/null
@@ -1,33 +0,0 @@
-var concat = require('../')
-var test = require('tape')
-var TA = require('typedarray')
-var U8 = typeof Uint8Array !== 'undefined' ? Uint8Array : TA.Uint8Array
-
-test('typed array stream', function (t) {
- t.plan(2)
- var a = new U8(5)
- a[0] = 97; a[1] = 98; a[2] = 99; a[3] = 100; a[4] = 101;
- var b = new U8(3)
- b[0] = 32; b[1] = 102; b[2] = 103;
- var c = new U8(4)
- c[0] = 32; c[1] = 120; c[2] = 121; c[3] = 122;
-
- var arrays = concat({ encoding: 'Uint8Array' }, function(out) {
- t.equal(typeof out.subarray, 'function')
- t.deepEqual(Buffer(out).toString('utf8'), 'abcde fg xyz')
- })
- arrays.write(a)
- arrays.write(b)
- arrays.end(c)
-})
-
-test('typed array from strings, buffers, and arrays', function (t) {
- t.plan(2)
- var arrays = concat({ encoding: 'Uint8Array' }, function(out) {
- t.equal(typeof out.subarray, 'function')
- t.deepEqual(Buffer(out).toString('utf8'), 'abcde fg xyz')
- })
- arrays.write('abcde')
- arrays.write(Buffer(' fg '))
- arrays.end([ 120, 121, 122 ])
-})
diff --git a/tools/eslint/node_modules/debug/History.md b/tools/eslint/node_modules/debug/History.md
index 770e4832d92..854c9711c6f 100644
--- a/tools/eslint/node_modules/debug/History.md
+++ b/tools/eslint/node_modules/debug/History.md
@@ -1,4 +1,13 @@
+2.2.0 / 2015-05-09
+==================
+
+ * package: update "ms" to v0.7.1 (#202, @dougwilson)
+ * README: add logging to file example (#193, @DanielOchoa)
+ * README: fixed a typo (#191, @amir-s)
+ * browser: expose `storage` (#190, @stephenmathieson)
+ * Makefile: add a `distclean` target (#189, @stephenmathieson)
+
2.1.3 / 2015-03-13
==================
diff --git a/tools/eslint/node_modules/debug/Makefile b/tools/eslint/node_modules/debug/Makefile
index b0bde6e63f8..5cf4a5962b8 100644
--- a/tools/eslint/node_modules/debug/Makefile
+++ b/tools/eslint/node_modules/debug/Makefile
@@ -16,7 +16,7 @@ all: dist/debug.js
install: node_modules
clean:
- @rm -rf node_modules dist
+ @rm -rf dist
dist:
@mkdir -p $@
@@ -26,8 +26,11 @@ dist/debug.js: node_modules browser.js debug.js dist
--standalone debug \
. > $@
+distclean: clean
+ @rm -rf node_modules
+
node_modules: package.json
@NODE_ENV= $(NPM) install
@touch node_modules
-.PHONY: all install clean
+.PHONY: all install clean distclean
diff --git a/tools/eslint/node_modules/debug/Readme.md b/tools/eslint/node_modules/debug/Readme.md
index 14222e0c247..b4f45e3cc6a 100644
--- a/tools/eslint/node_modules/debug/Readme.md
+++ b/tools/eslint/node_modules/debug/Readme.md
@@ -53,8 +53,8 @@ setInterval(function(){
#### Windows note
- On Windows the environment variable is set using the `set` command.
-
+ On Windows the environment variable is set using the `set` command.
+
```cmd
set DEBUG=*,-not_this
```
@@ -77,7 +77,7 @@ Then, run the program to be debugged as usual.
## Wildcards
- The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect.compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.
+ The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.
You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:".
@@ -147,6 +147,16 @@ error('now goes to stdout via console.info');
log('still goes to stdout, but via console.info now');
```
+### Save debug output to a file
+
+You can save all debug statements to a file by piping them.
+
+Example:
+
+```bash
+$ DEBUG_FD=3 node your-app.js 3> whatever.log
+```
+
## Authors
- TJ Holowaychuk
diff --git a/tools/eslint/node_modules/debug/bower.json b/tools/eslint/node_modules/debug/bower.json
index f7d3f6dc10a..6af573ff5c2 100644
--- a/tools/eslint/node_modules/debug/bower.json
+++ b/tools/eslint/node_modules/debug/bower.json
@@ -1,7 +1,7 @@
{
"name": "visionmedia-debug",
"main": "dist/debug.js",
- "version": "2.1.3",
+ "version": "2.2.0",
"homepage": "https://github.com/visionmedia/debug",
"authors": [
"TJ Holowaychuk <tj@vision-media.ca>"
diff --git a/tools/eslint/node_modules/debug/browser.js b/tools/eslint/node_modules/debug/browser.js
index 55f4cf9261e..7c764522199 100644
--- a/tools/eslint/node_modules/debug/browser.js
+++ b/tools/eslint/node_modules/debug/browser.js
@@ -11,17 +11,10 @@ exports.formatArgs = formatArgs;
exports.save = save;
exports.load = load;
exports.useColors = useColors;
-
-/**
- * Use chrome.storage.local if we are in an app
- */
-
-var storage;
-
-if (typeof chrome !== 'undefined' && typeof chrome.storage !== 'undefined')
- storage = chrome.storage.local;
-else
- storage = localstorage();
+exports.storage = 'undefined' != typeof chrome
+ && 'undefined' != typeof chrome.storage
+ ? chrome.storage.local
+ : localstorage();
/**
* Colors.
@@ -129,9 +122,9 @@ function log() {
function save(namespaces) {
try {
if (null == namespaces) {
- storage.removeItem('debug');
+ exports.storage.removeItem('debug');
} else {
- storage.debug = namespaces;
+ exports.storage.debug = namespaces;
}
} catch(e) {}
}
@@ -146,7 +139,7 @@ function save(namespaces) {
function load() {
var r;
try {
- r = storage.debug;
+ r = exports.storage.debug;
} catch(e) {}
return r;
}
diff --git a/tools/eslint/node_modules/debug/component.json b/tools/eslint/node_modules/debug/component.json
index 52ffd4224ea..ca1063724a4 100644
--- a/tools/eslint/node_modules/debug/component.json
+++ b/tools/eslint/node_modules/debug/component.json
@@ -2,7 +2,7 @@
"name": "debug",
"repo": "visionmedia/debug",
"description": "small debugging utility",
- "version": "2.1.3",
+ "version": "2.2.0",
"keywords": [
"debug",
"log",
@@ -14,6 +14,6 @@
"debug.js"
],
"dependencies": {
- "rauchg/ms.js": "0.7.0"
+ "rauchg/ms.js": "0.7.1"
}
}
diff --git a/tools/eslint/node_modules/debug/node_modules/ms/README.md b/tools/eslint/node_modules/debug/node_modules/ms/README.md
index 0fd54fdc72c..9b4fd03581b 100644
--- a/tools/eslint/node_modules/debug/node_modules/ms/README.md
+++ b/tools/eslint/node_modules/debug/node_modules/ms/README.md
@@ -23,7 +23,7 @@ ms(2 * 60000, { long: true }) // "2 minutes"
ms(ms('10 hours'), { long: true }) // "10 hours"
```
-- Node/Browser compatible. Published as [`ms`](https://www.npmjs.org/package/ms) in [NPM](nodejs.org/download).
+- Node/Browser compatible. Published as [`ms`](https://www.npmjs.org/package/ms) in [NPM](http://nodejs.org/download).
- If a number is supplied to `ms`, a string with a unit is returned.
- If a string that contains the number is supplied, it returns it as
a number (e.g: it returns `100` for `'100'`).
diff --git a/tools/eslint/node_modules/debug/node_modules/ms/index.js b/tools/eslint/node_modules/debug/node_modules/ms/index.js
index e79bfa18c1d..4f927716967 100644
--- a/tools/eslint/node_modules/debug/node_modules/ms/index.js
+++ b/tools/eslint/node_modules/debug/node_modules/ms/index.js
@@ -38,6 +38,8 @@ module.exports = function(val, options){
*/
function parse(str) {
+ str = '' + str;
+ if (str.length > 10000) return;
var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str);
if (!match) return;
var n = parseFloat(match[1]);
diff --git a/tools/eslint/node_modules/debug/node_modules/ms/package.json b/tools/eslint/node_modules/debug/node_modules/ms/package.json
index ec3ea9b0087..253335e6234 100644
--- a/tools/eslint/node_modules/debug/node_modules/ms/package.json
+++ b/tools/eslint/node_modules/debug/node_modules/ms/package.json
@@ -1,6 +1,6 @@
{
"name": "ms",
- "version": "0.7.0",
+ "version": "0.7.1",
"description": "Tiny ms conversion utility",
"repository": {
"type": "git",
@@ -17,16 +17,17 @@
"ms/index.js": "index.js"
}
},
- "gitHead": "1e9cd9b05ef0dc26f765434d2bfee42394376e52",
+ "gitHead": "713dcf26d9e6fd9dbc95affe7eff9783b7f1b909",
"bugs": {
"url": "https://github.com/guille/ms.js/issues"
},
"homepage": "https://github.com/guille/ms.js",
- "_id": "ms@0.7.0",
+ "_id": "ms@0.7.1",
"scripts": {},
- "_shasum": "865be94c2e7397ad8a57da6a633a6e2f30798b83",
- "_from": "ms@0.7.0",
- "_npmVersion": "1.4.21",
+ "_shasum": "9cd13c03adbff25b65effde7ce864ee952017098",
+ "_from": "ms@0.7.1",
+ "_npmVersion": "2.7.5",
+ "_nodeVersion": "0.12.2",
"_npmUser": {
"name": "rauchg",
"email": "rauchg@gmail.com"
@@ -38,10 +39,10 @@
}
],
"dist": {
- "shasum": "865be94c2e7397ad8a57da6a633a6e2f30798b83",
- "tarball": "http://registry.npmjs.org/ms/-/ms-0.7.0.tgz"
+ "shasum": "9cd13c03adbff25b65effde7ce864ee952017098",
+ "tarball": "http://registry.npmjs.org/ms/-/ms-0.7.1.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/ms/-/ms-0.7.0.tgz",
+ "_resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz",
"readme": "ERROR: No README data found!"
}
diff --git a/tools/eslint/node_modules/debug/package.json b/tools/eslint/node_modules/debug/package.json
index e437a94f070..63571929d58 100644
--- a/tools/eslint/node_modules/debug/package.json
+++ b/tools/eslint/node_modules/debug/package.json
@@ -1,6 +1,6 @@
{
"name": "debug",
- "version": "2.1.3",
+ "version": "2.2.0",
"repository": {
"type": "git",
"url": "git://github.com/visionmedia/debug.git"
@@ -24,7 +24,7 @@
],
"license": "MIT",
"dependencies": {
- "ms": "0.7.0"
+ "ms": "0.7.1"
},
"devDependencies": {
"browserify": "9.0.3",
@@ -38,17 +38,17 @@
"debug/debug.js": "debug.js"
}
},
- "gitHead": "0a8e4b7e0d2d1b55ef4e7422498ca24c677ae63a",
+ "gitHead": "b38458422b5aa8aa6d286b10dfe427e8a67e2b35",
"bugs": {
"url": "https://github.com/visionmedia/debug/issues"
},
"homepage": "https://github.com/visionmedia/debug",
- "_id": "debug@2.1.3",
+ "_id": "debug@2.2.0",
"scripts": {},
- "_shasum": "ce8ab1b5ee8fbee2bfa3b633cab93d366b63418e",
+ "_shasum": "f87057e995b1a1f6ae6a4960664137bc56f039da",
"_from": "debug@>=2.1.1 <3.0.0",
- "_npmVersion": "2.5.1",
- "_nodeVersion": "0.12.0",
+ "_npmVersion": "2.7.4",
+ "_nodeVersion": "0.12.2",
"_npmUser": {
"name": "tootallnate",
"email": "nathan@tootallnate.net"
@@ -64,10 +64,10 @@
}
],
"dist": {
- "shasum": "ce8ab1b5ee8fbee2bfa3b633cab93d366b63418e",
- "tarball": "http://registry.npmjs.org/debug/-/debug-2.1.3.tgz"
+ "shasum": "f87057e995b1a1f6ae6a4960664137bc56f039da",
+ "tarball": "http://registry.npmjs.org/debug/-/debug-2.2.0.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/debug/-/debug-2.1.3.tgz",
+ "_resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz",
"readme": "ERROR: No README data found!"
}
diff --git a/tools/eslint/node_modules/escope/gulpfile.js b/tools/eslint/node_modules/escope/gulpfile.js
index f38476b5310..afc68330dd6 100644
--- a/tools/eslint/node_modules/escope/gulpfile.js
+++ b/tools/eslint/node_modules/escope/gulpfile.js
@@ -134,7 +134,9 @@ function inc(importance) {
// read only one file to get the version number
.pipe(filter('package.json'))
// **tag it in the repository**
- .pipe(tagVersion());
+ .pipe(tagVersion({
+ prefix: ''
+ }));
}
gulp.task('patch', [ 'build' ], function () { return inc('patch'); })
diff --git a/tools/eslint/node_modules/escope/lib/reference.js b/tools/eslint/node_modules/escope/lib/reference.js
index 65f45d78dfe..68b6898a8b9 100644
--- a/tools/eslint/node_modules/escope/lib/reference.js
+++ b/tools/eslint/node_modules/escope/lib/reference.js
@@ -38,7 +38,7 @@ var RW = READ | WRITE;
*/
var Reference = (function () {
- function Reference(ident, scope, flag, writeExpr, maybeImplicitGlobal, partial) {
+ function Reference(ident, scope, flag, writeExpr, maybeImplicitGlobal, partial, init) {
_classCallCheck(this, Reference);
/**
@@ -80,6 +80,11 @@ var Reference = (function () {
* @member {boolean} Reference#partial
*/
this.partial = partial;
+ /**
+ * Whether the Reference is to write of initialization.
+ * @member {boolean} Reference#init
+ */
+ this.init = init;
}
this.__maybeImplicitGlobal = maybeImplicitGlobal;
}
@@ -181,4 +186,4 @@ Reference.WRITE = WRITE;
Reference.RW = RW;
/* vim: set sw=4 ts=4 et tw=80 : */
-//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJlZmVyZW5jZS5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUF3QkEsSUFBTSxJQUFJLEdBQUcsQ0FBRyxDQUFDO0FBQ2pCLElBQU0sS0FBSyxHQUFHLENBQUcsQ0FBQztBQUNsQixJQUFNLEVBQUUsR0FBRyxJQUFJLEdBQUcsS0FBSyxDQUFDOzs7Ozs7O0lBTUgsU0FBUztBQUNmLFdBRE0sU0FBUyxDQUNkLEtBQUssRUFBRSxLQUFLLEVBQUUsSUFBSSxFQUFHLFNBQVMsRU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GFydGlhbDtcbiAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICogV2hldGhlciB0aGUgUmVmZXJlbmNlIGlzIHRvIHdyaXRlIG9mIGluaXRpYWxpemF0aW9uLlxuICAgICAgICAgICAgICogQG1lbWJlciB7Ym9vbGVhbn0gUmVmZXJlbmNlI2luaXRcbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgdGhpcy5pbml0ID0gaW5pdDtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLl9fbWF5YmVJbXBsaWNpdEdsb2JhbCA9IG1heWJlSW1wbGljaXRHbG9iYWw7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogV2hldGhlciB0aGUgcmVmZXJlbmNlIGlzIHN0YXRpYy5cbiAgICAgKiBAbWV0aG9kIFJlZmVyZW5jZSNpc1N0YXRpY1xuICAgICAqIEByZXR1cm4ge2Jvb2xlYW59XG4gICAgICovXG4gICAgaXNTdGF0aWMoKSB7XG4gICAgICAgIHJldHVybiAhdGhpcy50YWludGVkICYmIHRoaXMucmVzb2x2ZWQgJiYgdGhpcy5yZXNvbHZlZC5zY29wZS5pc1N0YXRpYygpO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFdoZXRoZXIgdGhlIHJlZmVyZW5jZSBpcyB3cml0ZWFibGUuXG4gICAgICogQG1ldGhvZCBSZWZlcmVuY2UjaXNXcml0ZVxuICAgICAqIEByZXR1cm4ge2Jvb2xlYW59XG4gICAgICovXG4gICAgaXNXcml0ZSgpIHtcbiAgICAgICAgcmV0dXJuICEhKHRoaXMuZmxhZyAmIFJlZmVyZW5jZS5XUklURSk7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogV2hldGhlciB0aGUgcmVmZXJlbmNlIGlzIHJlYWRhYmxlLlxuICAgICAqIEBtZXRob2QgUmVmZXJlbmNlI2lzUmVhZFxuICAgICAqIEByZXR1cm4ge2Jvb2xlYW59XG4gICAgICovXG4gICAgaXNSZWFkKCkge1xuICAgICAgICByZXR1cm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5SV1xuICogQHByaXZhdGVcbiAqL1xuUmVmZXJlbmNlLlJXID0gUlc7XG5cbi8qIHZpbTogc2V0IHN3PTQgdHM9NCBldCB0dz04MCA6ICovXG4iXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0= \ No newline at end of file
diff --git a/tools/eslint/node_modules/escope/lib/referencer.js b/tools/eslint/node_modules/escope/lib/referencer.js
index 91d658dc789..09f59918045 100644
--- a/tools/eslint/node_modules/escope/lib/referencer.js
+++ b/tools/eslint/node_modules/escope/lib/referencer.js
@@ -50,29 +50,28 @@ var Definition = _definition.Definition;
var assert = _interopRequire(require("assert"));
var PatternVisitor = (function (_esrecurse$Visitor) {
- function PatternVisitor(rootPattern, referencer, callback) {
+ function PatternVisitor(rootPattern, callback) {
_classCallCheck(this, PatternVisitor);
_get(Object.getPrototypeOf(PatternVisitor.prototype), "constructor", this).call(this);
- this.referencer = referencer;
+ this.rootPattern = rootPattern;
this.callback = callback;
+ this.assignments = [];
+ this.rightHandNodes = [];
+ this.restElements = [];
}
_inherits(PatternVisitor, _esrecurse$Visitor);
_createClass(PatternVisitor, {
- perform: {
- value: function perform(pattern) {
- if (pattern.type === Syntax.Identifier) {
- this.callback(pattern, true);
- return;
- }
- this.visit(pattern);
- }
- },
Identifier: {
value: function Identifier(pattern) {
- this.callback(pattern, false);
+ var lastRestElement = getLast(this.restElements);
+ this.callback(pattern, {
+ topLevel: pattern === this.rootPattern,
+ rest: lastRestElement != null && lastRestElement.argument === pattern,
+ assignments: this.assignments
+ });
}
},
ObjectPattern: {
@@ -80,10 +79,15 @@ var PatternVisitor = (function (_esrecurse$Visitor) {
var i, iz, property;
for (i = 0, iz = pattern.properties.length; i < iz; ++i) {
property = pattern.properties[i];
- if (property.shorthand) {
- this.visit(property.key);
- continue;
+
+ // Computed property's key is a right hand node.
+ if (property.computed) {
+ this.rightHandNodes.push(property.key);
}
+
+ // If it's shorthand, its key is same as its value.
+ // If it's shorthand and has its default value, its key is same as its value.left (the value is AssignmentPattern).
+ // If it's not shorthand, the name of new variable is its value's.
this.visit(property.value);
}
}
@@ -93,17 +97,83 @@ var PatternVisitor = (function (_esrecurse$Visitor) {
var i, iz, element;
for (i = 0, iz = pattern.elements.length; i < iz; ++i) {
element = pattern.elements[i];
- if (element) {
- this.visit(element);
- }
+ this.visit(element);
}
}
},
AssignmentPattern: {
value: function AssignmentPattern(pattern) {
+ this.assignments.push(pattern);
this.visit(pattern.left);
- // FIXME: Condier TDZ scope.
- this.referencer.visit(pattern.right);
+ this.rightHandNodes.push(pattern.right);
+ this.assignments.pop();
+ }
+ },
+ RestElement: {
+ value: function RestElement(pattern) {
+ this.restElements.push(pattern);
+ this.visit(pattern.argument);
+ this.restElements.pop();
+ }
+ },
+ MemberExpression: {
+ value: function MemberExpression(node) {
+ // Computed property's key is a right hand node.
+ if (node.computed) {
+ this.rightHandNodes.push(node.property);
+ }
+ // the object is only read, write to its property.
+ this.rightHandNodes.push(node.object);
+ }
+ },
+ SpreadElement: {
+
+ //
+ // ForInStatement.left and AssignmentExpression.left are LeftHandSideExpression.
+ // By spec, LeftHandSideExpression is Pattern or MemberExpression.
+ // (see also: https://github.com/estree/estree/pull/20#issuecomment-74584758)
+ // But espree 2.0 and esprima 2.0 parse to ArrayExpression, ObjectExpression, etc...
+ //
+
+ value: function SpreadElement(node) {
+ this.visit(node.argument);
+ }
+ },
+ ArrayExpression: {
+ value: function ArrayExpression(node) {
+ node.elements.forEach(this.visit, this);
+ }
+ },
+ ObjectExpression: {
+ value: function ObjectExpression(node) {
+ var _this = this;
+
+ node.properties.forEach(function (property) {
+ // Computed property's key is a right hand node.
+ if (property.computed) {
+ _this.rightHandNodes.push(property.key);
+ }
+ _this.visit(property.value);
+ });
+ }
+ },
+ AssignmentExpression: {
+ value: function AssignmentExpression(node) {
+ this.assignments.push(node);
+ this.visit(node.left);
+ this.rightHandNodes.push(node.right);
+ this.assignments.pop();
+ }
+ },
+ CallExpression: {
+ value: function CallExpression(node) {
+ var _this = this;
+
+ // arguments are right hand nodes.
+ node.arguments.forEach(function (a) {
+ _this.rightHandNodes.push(a);
+ });
+ this.visit(node.callee);
}
}
});
@@ -111,9 +181,19 @@ var PatternVisitor = (function (_esrecurse$Visitor) {
return PatternVisitor;
})(esrecurse.Visitor);
+function getLast(xs) {
+ return xs[xs.length - 1] || null;
+}
+
function traverseIdentifierInPattern(rootPattern, referencer, callback) {
- var visitor = new PatternVisitor(rootPattern, referencer, callback);
- visitor.perform(rootPattern);
+ // Call the callback at left hand identifier nodes, and Collect right hand nodes.
+ var visitor = new PatternVisitor(rootPattern, callback);
+ visitor.visit(rootPattern);
+
+ // Process the right hand nodes recursively.
+ if (referencer != null) {
+ visitor.rightHandNodes.forEach(referencer.visit, referencer);
+ }
}
function isPattern(node) {
@@ -221,7 +301,7 @@ var Referencer = (function (_esrecurse$Visitor3) {
// http://people.mozilla.org/~jorendorff/es6-draft.html#sec-runtime-semantics-forin-div-ofexpressionevaluation-abstract-operation
// TDZ scope hides the declaration's names.
this.scopeManager.__nestTDZScope(node, iterationNode);
- this.visitVariableDeclaration(this.currentScope(), Variable.TDZ, iterationNode.left, 0);
+ this.visitVariableDeclaration(this.currentScope(), Variable.TDZ, iterationNode.left, 0, true);
}
},
materializeIterationScope: {
@@ -234,13 +314,25 @@ var Referencer = (function (_esrecurse$Visitor3) {
letOrConstDecl = node.left;
this.visitVariableDeclaration(this.currentScope(), Variable.Variable, letOrConstDecl, 0);
this.visitPattern(letOrConstDecl.declarations[0].id, function (pattern) {
- _this.currentScope().__referencing(pattern, Reference.WRITE, node.right, null, true);
+ _this.currentScope().__referencing(pattern, Reference.WRITE, node.right, null, true, true);
+ });
+ }
+ },
+ referencingDefaultValue: {
+ value: function referencingDefaultValue(pattern, assignments, maybeImplicitGlobal, init) {
+ var scope = this.currentScope();
+ assignments.forEach(function (assignment) {
+ scope.__referencing(pattern, Reference.WRITE, assignment.right, maybeImplicitGlobal, pattern !== assignment.left, init);
});
}
},
visitPattern: {
- value: function visitPattern(node, callback) {
- traverseIdentifierInPattern(node, this, callback);
+ value: function visitPattern(node, options, callback) {
+ if (typeof options === "function") {
+ callback = options;
+ options = { processRightHandNodes: false };
+ }
+ traverseIdentifierInPattern(node, options.processRightHandNodes ? this : null, callback);
}
},
visitFunction: {
@@ -267,9 +359,12 @@ var Referencer = (function (_esrecurse$Visitor3) {
// Consider this function is in the MethodDefinition.
this.scopeManager.__nestFunctionScope(node, this.isInnerMethodDefinition);
+ // Process parameter declarations.
for (i = 0, iz = node.params.length; i < iz; ++i) {
- this.visitPattern(node.params[i], function (pattern) {
- _this.currentScope().__define(pattern, new ParameterDefinition(pattern, node, i, false));
+ this.visitPattern(node.params[i], { processRightHandNodes: true }, function (pattern, info) {
+ _this.currentScope().__define(pattern, new ParameterDefinition(pattern, node, i, info.rest));
+
+ _this.referencingDefaultValue(pattern, info.assignments, null, true);
});
}
@@ -345,13 +440,10 @@ var Referencer = (function (_esrecurse$Visitor3) {
if (node.left.type === Syntax.VariableDeclaration) {
this.visit(node.left);
this.visitPattern(node.left.declarations[0].id, function (pattern) {
- _this.currentScope().__referencing(pattern, Reference.WRITE, node.right, null, true);
+ _this.currentScope().__referencing(pattern, Reference.WRITE, node.right, null, true, true);
});
} else {
- if (!isPattern(node.left)) {
- this.visit(node.left);
- }
- this.visitPattern(node.left, function (pattern) {
+ this.visitPattern(node.left, { processRightHandNodes: true }, function (pattern, info) {
var maybeImplicitGlobal = null;
if (!_this.currentScope().isStrict) {
maybeImplicitGlobal = {
@@ -359,7 +451,8 @@ var Referencer = (function (_esrecurse$Visitor3) {
node: node
};
}
- _this.currentScope().__referencing(pattern, Reference.WRITE, node.right, maybeImplicitGlobal, true);
+ _this.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false);
+ _this.currentScope().__referencing(pattern, Reference.WRITE, node.right, maybeImplicitGlobal, true, false);
});
}
this.visit(node.right);
@@ -368,18 +461,22 @@ var Referencer = (function (_esrecurse$Visitor3) {
}
},
visitVariableDeclaration: {
- value: function visitVariableDeclaration(variableTargetScope, type, node, index) {
+ value: function visitVariableDeclaration(variableTargetScope, type, node, index, fromTDZ) {
var _this = this;
+ // If this was called to initialize a TDZ scope, this needs to make definitions, but doesn't make references.
var decl, init;
decl = node.declarations[index];
init = decl.init;
- this.visitPattern(decl.id, function (pattern, toplevel) {
+ this.visitPattern(decl.id, { processRightHandNodes: !fromTDZ }, function (pattern, info) {
variableTargetScope.__define(pattern, new Definition(type, pattern, decl, node, index, node.kind));
+ if (!fromTDZ) {
+ _this.referencingDefaultValue(pattern, info.assignments, null, true);
+ }
if (init) {
- _this.currentScope().__referencing(pattern, Reference.WRITE, init, null, !toplevel);
+ _this.currentScope().__referencing(pattern, Reference.WRITE, init, null, !info.topLevel, true);
}
});
}
@@ -390,7 +487,7 @@ var Referencer = (function (_esrecurse$Visitor3) {
if (isPattern(node.left)) {
if (node.operator === "=") {
- this.visitPattern(node.left, function (pattern, toplevel) {
+ this.visitPattern(node.left, { processRightHandNodes: true }, function (pattern, info) {
var maybeImplicitGlobal = null;
if (!_this.currentScope().isStrict) {
maybeImplicitGlobal = {
@@ -398,7 +495,8 @@ var Referencer = (function (_esrecurse$Visitor3) {
node: node
};
}
- _this.currentScope().__referencing(pattern, Reference.WRITE, node.right, maybeImplicitGlobal, !toplevel);
+ _this.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false);
+ _this.currentScope().__referencing(pattern, Reference.WRITE, node.right, maybeImplicitGlobal, !info.topLevel, false);
});
} else {
this.currentScope().__referencing(node.left, Reference.RW, node.right);
@@ -415,8 +513,9 @@ var Referencer = (function (_esrecurse$Visitor3) {
this.scopeManager.__nestCatchScope(node);
- this.visitPattern(node.param, function (pattern) {
+ this.visitPattern(node.param, { processRightHandNodes: true }, function (pattern, info) {
_this.currentScope().__define(pattern, new Definition(Variable.CatchClause, node.param, node, null, null, null));
+ _this.referencingDefaultValue(pattern, info.assignments, null, true);
});
this.visit(node.body);
@@ -652,4 +751,4 @@ var Referencer = (function (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gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy52aXNpdChwYXR0ZXJuKTtcbiAgICB9XG5cbiAgICBJZGVudGlmaWVyKHBhdHRlcm4pIHtcbiAgICAgICAgdGhpcy5jYWxsYmFjayhwYXR0ZXJuLCBmYWxzZSk7XG4gICAgfVxuXG4gICAgT2JqZWN0UGF0dGVybihwYXR0ZXJuKSB7XG4gICAgICAgIHZhciBpLCBpeiwgcHJvcGVydHk7XG4gICAgICAgIGZvciAoaSA9IDAsIGl6ID0gcGF0dGVybi5wcm9wZXJ0aWVzLmxlbmd0aDsgaSA8IGl6OyArK2kpIHtcbiAgICAgICAgICAgIHByb3BlcnR5ID0gcGF0dGVybi5wcm9wZXJ0aWVzW2ldO1xuICAgICAgICAgICAgaWYgKHByb3BlcnR5LnNob3J0aGFuZCkge1xuICAgICAgICAgICAgICAgIHRoaXMudmlzaXQocHJvcGVydHkua2V5KTtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMudmlzaXQocHJvcGVydHkudmFsdWUpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgQXJyYXlQYXR0ZXJuKHBhdHRlcm4pIHtcbiAgICAgICAgdmFyIGksIGl6LCBlbGVtZW50O1xuICAgICAgICBmb3IgKGkgPSAwLCBpeiA9IHBhdHRlcm4uZWxlbWVudHMubGVuZ3RoOyBpIDwgaXo7ICsraSkge1xuICAgICAgICAgICAgZWxlbWVudCA9IHBhdHRlcm4uZWxlbWVudHNbaV07XG4gICAgICAgICAgICBpZiAoZWxlbWVudCkge1xuICAgICAgICAgICAgICAgIHRoaXMudmlzaXQoZWxlbWVudCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBBc3NpZ25tZW50UGF0dGVybihwYXR0ZXJuKSB7XG4gICAgICAgIHRoaXMudmlzaXQocGF0dGVybi5sZWZ0KTtcbiAgICAgICAgL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BlbnZpcm9ubWVudCwgYmVjYXVzZSB0aGUgY29udGV4dCBpc1xuLy8gaW1wbGVtZW50YXRpb24gZGVwZW5kZW50LlxuXG5jbGFzcyBJbXBvcnRlciBleHRlbmRzIGVzcmVjdXJzZS5WaXNpdG9yIHtcbiAgICBjb25zdHJ1Y3RvcihkZWNsYXJhdGlvbiwgcmVmZXJlbmNlcikge1xuICAgICAgICBzdXBlcigpO1xuICAgICAgICB0aGlzLmRlY2xhcmF0aW9uID0gZGVjbGFyYXRpb247XG4gICAgICAgIHRoaXMucmVmZXJlbmNlciA9IHJlZmVyZW5jZXI7XG4gICAgfVxuXG4gICAgdmlzaXRJbXBvcnQoaWQsIHNwZWNpZmllcikge1xuICAgICAgICB0aGlzLnJlZmVyZW5jZXIudmlzaXRQYXR0ZXJuKGlkLCAocGF0dGVybikgPT4ge1xuICAgICAgICAgICAgdGhpcy5yZWZlcmVuY2VyLmN1cnJlbnRTY29wZSgpLl9fZGVmaW5lKHBhdHRlcm4sXG4gICAgICAgICAgICAgICAgbmV3IERlZmluaXRpb24oXG4gICAgICAgICAgICAgICAgICAgIFZhcmlhYmxlLkltcG9ydEJpbmRpbmcsXG4gICAgICAgICAgICAgICAgICAgIHBhdHRlcm4sXG4gICAgICAgICAgICAgICAgICAgIHNwZWNpZmllcixcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5kZWNsYXJhdGlvbixcbiAgICAgICAgICAgICAgICAgICAgbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgbnVsbFxuICAgICAgICAgICAgICAgICAgICApKTtcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgSW1wb3J0TmFtZXNwYWNlU3BlY2lmaWVyKG5vZGUpIHtcbiAgICAgICAgbGV0IGxvY2FsID0gKG5vZGUubG9jYWwgfHwgbm9kZS5pZCk7XG4gICAgICAgIGlmIChsb2NhbCkge1xuICAgICAgICAgICAgdGhpcy52aXNpdEltcG9ydChsb2NhbCwgbm9kZSk7XG4gICAgICAgIH1c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pbmcgdmFyaWFibGVTY29wZS4gSXQgaXMgaW50ZW5kZWQuXG4gICAgICAgIC8vIFNpbmNlXG4gICAgICAgIC8vICBpbiBFUzUsIEZ1bmN0aW9uRGVjbGFyYXRpb24gc2hvdWxkIGJlIGluIEZ1bmN0aW9uQm9keS5cbiAgICAgICAgLy8gIGluIEVTNiwgRnVuY3Rpb25EZWNsYXJhdGlvbiBzaG91bGQgYmUgYmxvY2sgc2NvcGVkLlxuICAgICAgICBpZiAobm9kZS50eXBlID09PSBTeW50YXguRnVuY3Rpb25EZWNsYXJhdGlvbikge1xuICAgICAgICAgICAgLy8gaWQgaXMgZGVmaW5lZCBpbiB1cHBlciBzY29wZVxuICAgICAgICAgICAgdGhpcy5jdXJyZW50U2NvcGUoKS5fX2RlZmluZShub2RlLmlkLFxuICAgICAgICAgICAgICAgICAgICBuZXcgRGVmaW5pdGlvbihcbiAgICAgICAgICAgICAgICAgICAgICAgIFZhcmlhYmxlLkZ1bmN0aW9uTmFtZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIG5vZGUuaWQsXG4gICAgICAgICAgICAgICAgICAgICAgICBub2RlLFxuICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgICAgICAgICBudWxsXG4gICAgICAgICAgICAgICAgICAgICkpO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gRnVuY3Rpb25FeHByZXNzaW9uIHdpdGggbmFtZSBjcmVhdGVzIGl0cyBzcGVjaWFsIHNjb3BlO1xuICAgICAgICAvLyBGdW5jdGlvbkV4cHJlc3Npb25OYW1lU2NvcGUuXG4gICAgICAgIGlmIChub2RlLnR5cGUgPT09IFN5bnRheC5GdW5jdGlvbkV4cHJlc3Npb24gJiYgbm9kZS5pZCkge1xuICAgICAgICAgICAgdGhpcy5zY29wZU1hbmFnZXIuX19uZXN0RnVuY3Rpb25FeHByZXNzaW9uTmFtZVNjb3BlKG5vZGUpO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gQ29uc2lkZXIgdGhpcyBmdW5jdGlvbiBpcyBpbiB0aGUgTWV0aG9kRGVmaW5pdGlvbi5cbiAgICAgICAgdGhpcy5zY29wZU1hbmFnZXIuX19uZXN0RnVuY3Rpb25TY29wZShub2RlLCB0aGlzLmlzSW5uZXJNZXRob2REZWZpbml0aW9uKTtcblxuICAgICAgICBmb3IgKGkgPSAwLCBpeiA9IG5vZGUucGFyYW1zLmxlbmd0aDsgaSA8IGl6OyArK2kpIHtcbiAgICAgICAgICAgIHRoaXMudmlzaXRQYXR0ZXJuKG5vZGUucGFyYW1zW2ldLCAocGF0dGVybikgPT4ge1xuICAgICAgICAgICAgICAgIHRoaXMuY3VycmVudFNjb3BlKCkuX19kZWZpbmUocGF0dGVybixcbiAgICAgICAgICAgICAgICAgICAgbmV3IFBhcmFtZXRlckRlZmluaXRpb24oXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXR0ZXJuLFxuICAgICAgICAgICAgICAgICAgICAgICAgbm9kZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGksXG4gICAgICAgICAgICAgICAgICAgICAgICBmYWxzZVxuICAgICAgICAgICAgICAgICAgICApKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gaWYgdGhlcmUncyBhIHJlc3QgYXJndW1lbnQsIGFkZCB0aGF0XG4gICAgICAgIGlmIChub2RlLnJlc3QpIHtcbiAgICAgICAgICAgIHRoaXMudmlzaXRQYXR0ZXJuKHtcbiAgICAgICAgICAgICAgICB0eXBlOiAnUmVzdEVsZW1lbnQnLFxuICAgICAgICAgICAgICAgIGFyZ3VtZW50OiBub2RlLnJlc3RcbiAgICAgICAgICAgIH0sIChwYXR0ZXJuKSA9PiB7XG4gICAgICAgICAgICAgICAgdGhpcy5jdXJyZW50U2NvcGUoKS5fX2RlZmluZShwYXR0ZXJuLFxuICAgICAgICAgICAgICAgICAgICBuZXcgUGFyYW1ldGVyRGVmaW5pdGlvbihcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhdHRlcm4sXG4gICAgICAgICAgICAgICAgICAgICAgICBub2RlLFxuICAgICAgICAgICAgICAgICAgICAgICAgbm9kZS5wYXJhbXMubGVuZ3RoLFxuICAgICAgICAgICAgICAgICAgICAgICAgdHJ1ZVxuICAgICAgICAgICAgICAgICAgICApKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gU2tpcCBCbG9ja1N0YXRlbWVudCB0byBwcmV2ZW50IGNyZWF0aW5nIEJsb2NrU3RhdGVtZW50IHNjb3BlLlxuICAgICAgICBpZiAobm9kZS5ib2R5LnR5cGUgPT09IFN5bnRheC5CbG9ja1N0YXRlbWVudCkge1xuICAgICAgICAgICAgdGhpcy52aXNpdENoaWxkcmVuKG5vZGUuYm9keSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLnZpc2l0KG5vZGUuYm9keSk7XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLmNsb3NlKG5vZGUpO1xuICAgIH1cblxuICAgIHZpc2l0Q2xhc3Mobm9kZSkge1xuICAgICAgICBpZiAobm9kZS50eXBlID09PSBTeW50YXguQ2xhc3NEZWNsYXJhdGlvbikge1xuICAgICAgICAgICAgdGhpcy5jdXJyZW50U2NvcGUoKS5fX2RlZmluZShub2RlLmlkLFxuICAgICAgICAgICAgICAgICAgICBuZXcgRGVmaW5pdGlvbihcbiAgICAgICAgICAgICAgICAgICAgICAgIFZhcmlhYmxlLkNsYXNzTmFtZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIG5vZGUuaWQsXG4gICAgICAgICAgICAgICAgICAgICAgICBub2RlLFxuICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgICAgICAgICBudWxsXG4gICAgICAgICAgICAgICAgICAgICkpO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gRklYTUU6IE1heWJlIGNvbnNpZGVyIFREWi5cbiAgICAgICAgdGhpcy52aXNpdChub2RlLnN1cGVyQ2xhc3MpO1xuXG4gICAgICAgIHRoaXMuc2NvcGVNYW5hZ2VyLl9fbmVzdENsYXNzU2NvcGUobm9kZSk7XG5cbiAgICAgICAgaWYgKG5vZGUuaWQpIHtcbiAgICAgICAgICAgIHRoaXMuY3VycmVudFNjb3BlKCkuX19kZWZpbmUobm9kZS5pZCxcbiAgICAgICAgICAgICAgICAgICAgbmV3IERlZmluaXRpb24oXG4gICAgICAgICAgICAgICAgICAgICAgICBWYXJpYWJsZS5DbGFzc05hbWUsXG4gICAgICAgICAgICAgICAgICAgICAgICBub2RlLmlkLFxuICAgICAgICAgICAgICAgICAgICAgICAgbm9kZVxuICAgICAgICAgICAgICAgICAgICApKTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLnZpc2l0KG5vZGUuYm9keSk7XG5cbiAgICAgICAgdGhpcy5jbG9zZShub2RlKTtcbiAgICB9XG5cbiAgICB2aXNpdFByb3BlcnR5KG5vZGUpIHtcbiAgICAgICAgdmFyIHByZXZpb3VzLCBpc01ldGhvZERlZmluaXRpb247XG4gICAgICAgIGlmIChub2RlLmNvbXB1dGVkKSB7XG4gICAgICAgICAgICB0aGlzLnZpc2l0KG5vZGUua2V5KTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlzTWV0aG9kRGVmaW5pdGlvbiA9IG5vZGUudHlwZSA9PT0gU3ludGF4Lk1ldGhvZERlZmluaXRpb24gfHwgbm9kZS5tZXRob2Q7XG4gICAgICAgIGlmIChpc01ldGhvZERlZmluaXRpb24pIHtcbiAgICAgICAgICAgIHByZXZpb3VzID0gdGhpcy5wdXNoSW5uZXJNZXRob2REZWZpbml0aW9uKHRydWUpO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMudmlzaXQobm9kZS52YWx1ZSk7XG4gICAgICAgIGlmIChpc01ldGhvZERlZmluaXRpb24pIHtcbiAgICAgICAgICAgIHRoaXMucG9wSW5uZXJNZXRob2REZWZpbml0aW9uKHByZXZpb3VzKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHZpc2l0Rm9ySW4obm9kZSkge1xuICAgICAgICBpZiAobm9kZS5sZWZ0LnR5cGUgPT09IFN5bnRheC5WYXJpYWJsZURlY2xhcmF0aW9uICYmIG5vZGUubGVmdC5raW5kICE9PSAndmFyJykge1xuICAgICAgICAgICAgdGhpcy5tYXRlcmlhbGl6ZVREWlNjb3BlKG5vZGUucmlnaHQsIG5vZGUpO1xuICAgICAgICAgICAgdGhpcy52aXNpdChub2RlLnJpZ2h0KTtcbiAgICAgICAgICAgIHRoaXMuY2xvc2Uobm9kZS5yaWdodCk7XG5cbiAgICAgICAgICAgIHRoaXMubWF0ZXJpYWxpemVJdGVyYXRpb25TY29wZShub2RlKTtcbiAgICAgICAgICAgIHRoaXMudmlzaXQobm9kZS5ib2R5KTtcbiAgICAgICAgICAgIHRoaXMuY2xvc2Uobm9kZSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAobm9kZS5sZWZ0LnR5cGUgPT09IFN5bnRheC5WYXJpYWJsZURlY2xhcmF0aW9uKSB7XG4gICAgICAgICAgICAgICAgdGhpcy52aXNpdChub2RlLmxlZnQpO1xuICAgICAgICAgICAgICAgIHRoaXMudmlzaXRQYXR0ZXJuKG5vZGUubGVmdC5kZWNsYXJhdGlvbnNbMF0uaWQsIChwYXR0ZXJuKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY3VycmVudFNjb3BlKCkuX19yZWZlcmVuY2luZyhwYXR0ZXJuLCBSZWZlcmVuY2UuV1JJVEUsIG5vZGUucmlnaHQsIG51bGwsIHRydWUpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBpZiAoIWlzUGF0dGVybihub2RlLmxlZnQpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMudmlzaXQobm9kZS5sZWZ0KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdGhpcy52aXNpdFBhdHRlcm4obm9kZS5sZWZ0LCAocGF0dGVybikgPT4ge1xuICAgICAgICAgICAgICAgICAgICB2YXIgbWF5YmVJbXBsaWNpdEdsb2JhbCA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgIGlmICghdGhpcy5jdXJyZW50U2NvcGUoKS5pc1N0cmljdCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbWF5YmVJbXBsaWNpdEdsb2JhbCA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXR0ZXJuOiBwYXR0ZXJuLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vZGU6IG5vZGVcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdGhpcy5jdXJyZW50U2NvcGUoKS5fX3JlZmVyZW5jaW5nKHBhdHRlcm4sIFJlZmVyZW5jZS5XUklURSwgbm9kZS5yaWdodCwgbWF5YmVJbXBsaWNpdEdsb2JhbCwgdHJ1ZSk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aGlzLnZpc2l0KG5vZGUucmlnaHQpO1xuICAgICAgICAgICAgdGhpcy52aXNpdChub2RlLmJvZHkpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgdmlzaXRWYXJpYWJsZURlY2xhcmF0aW9uKHZhcmlhYmxlVGFyZ2V0U2NvcGUsIHR5cGUsIG5vZGUsIGluZGV4KSB7XG4gICAgICAgIHZhciBkZWNsLCBpbml0O1xuXG4gICAgICAgIGRlY2wgPSBub2RlLmRlY2xhcmF0aW9uc1tpbmRleF07XG4gICAgICAgIGluaXQgPSBkZWNsLmluaXQ7XG4gICAgICAgIHRoaXMudmlzaXRQYXR0ZXJuKGRlY2wuaWQsIChwYXR0ZXJuLCB0b3BsZXZlbCkgPT4ge1xuICAgICAgICAgICAgdmFyaWFibGVUYXJnZXRTY29wZS5fX2RlZmluZShwYXR0ZXJuLFxuICAgICAgICAgICAgICAgIG5ldyBEZWZpbml0aW9uKFxuICAgICAgICAgICAgICAgICAgICB0eXBlLFxuICAgICAgICAgICAgICAgICAgICBwYXR0ZXJuLFxuICAgICAgICAgICAgICAgICAgICBkZWNsLFxuICAgICAgICAgICAgICAgICAgICBub2RlLFxuICAgICAgICAgICAgICAgICAgICBpbmRleCxcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5raW5kXG4gICAgICAgICAgICAgICAgKSk7XG5cbiAgICAgICAgICAgIGlmIChpbml0KSB7XG4gICAgICAgICAgICAgICAgdGhpcy5jdXJyZW50U2NvcGUoKS5fX3JlZmVyZW5jaW5nKHBhdHRlcm4sIFJlZmVyZW5jZS5XUklURSwgaW5pdCwgbnVsbCwgIXRvcGxldmVsKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgQXNzaWdubWVudEV4cHJlc3Npb24obm9kZSkge1xuICAgICAgICBpZiAoaXNQYXR0ZXJuKG5vZGUubGVmdCkpIHtcbiAgICAgICAgICAgIGlmIChub2RlLm9wZXJhdG9yID09PSAnPScpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnZpc2l0UGF0dGVybihub2RlLmxlZnQsIChwYXR0ZXJuLCB0b3BsZXZlbCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICB2YXIgbWF5YmVJbXBsaWNpdEdsb2JhbCA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgIGlmICghdGhpcy5jdXJyZW50U2NvcGUoKS5pc1N0cmljdCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbWF5YmVJbXBsaWNpdEdsb2JhbCA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXR0ZXJuOiBwYXR0ZXJuLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vZGU6IG5vZGVcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdGhpcy5jdXJyZW50U2NvcGUoKS5fX3JlZmVyZW5jaW5nKHBhdHRlcm4sIFJlZmVyZW5jZS5XUklURSwgbm9kZS5yaWdodCwgbWF5YmVJbXBsaWNpdEdsb2JhbCwgIXRvcGxldmVsKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy5jdXJyZW50U2NvcGUoKS5fX3JlZmVyZW5jaW5nKG5vZGUubGVmdCwgUmVmZXJlbmNlLlJXLCBub2RlLnJpZ2h0KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMudmlzaXQobm9kZS5sZWZ0KTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLnZpc2l0KG5vZGUucmlnaHQpO1xuICAgIH1cblxuICAgIENhdGNoQ2xhdXNlKG5vZGUpIHtcbiAgICAgICAgdGhpcy5zY29wZU1hbmFnZXIuX19uZXN0Q2F0Y2hTY29wZShub2RlKTtcblxuICAgICAgICB0aGlzLnZpc2l0UGF0dGVybihub2RlLnBhcmFtLCAocGF0dGVybikgPT4ge1xuICAgICAgICAgICAgdGhpcy5jdXJyZW50U2NvcGUoKS5fX2RlZmluZShwYXR0ZXJuLFxuICAgICAgICAgICAgICAgIG5ldyBEZWZpbml0aW9uKFxuICAgICAgICAgICAgICAgICAgICBWYXJpYWJsZS5DYXRjaENsYXVzZSxcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5wYXJhbSxcbiAgICAgICAgICAgICAgICAgICAgbm9kZSxcbiAgICAgICAgICAgICAgICAgICAgbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgbnVsbFxuICAgICAgICAgIC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ZGVjbGFyYXRpb24gPSBkZWNsYXJhdGlvbjtcbiAgICAgICAgdGhpcy5yZWZlcmVuY2VyID0gcmVmZXJlbmNlcjtcbiAgICB9XG5cbiAgICB2aXNpdEltcG9ydChpZCwgc3BlY2lmaWVyKSB7XG4gICAgICAgIHRoaXMucmVmZXJlbmNlci52aXNpdFBhdHRlcm4oaWQsIChwYXR0ZXJuKSA9PiB7XG4gICAgICAgICAgICB0aGlzLnJlZmVyZW5jZXIuY3VycmVudFNjb3BlKCkuX19kZWZpbmUocGF0dGVybixcbiAgICAgICAgICAgICAgICBuZXcgRGVmaW5pdGlvbihcbiAgICAgICAgICAgICAgICAgICAgVmFyaWFibGUuSW1wb3J0QmluZGluZyxcbiAgICAgICAgICAgICAgICAgICAgcGF0dGVybixcbiAgICAgICAgICAgICAgICAgICAgc3BlY2lmaWVyLFxuICAgICAgICAgICAgICAgICAgICB0aGlzLmRlY2xhcmF0aW9uLFxuICAgICAgICAgICAgICAgICAgICBudWxsLFxuICAgICAgICAgICAgICAgICAgICBudWxsXG4gICAgICAgICAgICAgICAgICAgICkpO1xuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBJbXBvcnROYW1lc3BhY2VTcGVjaWZpZXIobm9kZSkge1xuICAgICAgICBsZXQgbG9jYWwgPSAobm9kZS5sb2NhbCB8fCBub2RlLmlkKTtcbiAgICAgICAgaWYgKGxvY2FsKSB7XG4gICAgICAgICAgICB0aGlzLnZpc2l0SW1wb3J0KGxvY2FsLCBub2RlKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIEltcG9ydERlZmF1bHRTcGVjaWZpZXIobm9kZSkge1xuICAgICAgICBsZXQgbG9jYWwgPSAobm9kZS5sb2NhbCB8fCBub2RlLmlkKTtcbiAgICAgICAgdGhpcy52aXNpdEltcG9ydChsb2NhbCwgbm9kZSk7XG4gICAgfVxuXG4gICAgSW1wb3J0U3BlY2lmaWVyKG5vZGUpIHtcbiAgICAgICAgbGV0IGxvY2FsID0gKG5vZG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FyaWFibGUuRnVuY3Rpb25OYW1lLFxuICAgICAgICAgICAgICAgICAgICAgICAgbm9kZS5pZCxcbiAgICAgICAgICAgICAgICAgICAgICAgIG5vZGUsXG4gICAgICAgICAgICAgICAgICAgICAgICBudWxsLFxuICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgICAgIG51bGxcbiAgICAgICAgICAgICAgICAgICAgKSk7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBGdW5jdGlvbkV4cHJlc3Npb24gd2l0aCBuYW1lIGNyZWF0ZXMgaXRzIHNwZWNpYWwgc2NvcGU7XG4gICAgICAgIC8vIEZ1bmN0aW9uRXhwcmVzc2lvbk5hbWVTY29wZS5cbiAgICAgICAgaWYgKG5vZGUudHlwZSA9PT0gU3ludGF4LkZ1bmN0aW9uRXhwcmVzc2lvbiAmJiBub2RlLmlkKSB7XG4gICAgICAgICAgICB0aGlzLnNjb3BlTWFuYWdlci5fX25lc3RGdW5jdGlvbkV4cHJlc3Npb25OYW1lU2NvcGUobm9kZSk7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBDb25zaWRlciB0aGlzIGZ1bmN0aW9uIGlzIGluIHRoZSBNZXRob2REZWZpbml0aW9uLlxuICAgICAgICB0aGlzLnNjb3BlTWFuYWdlci5fX25lc3RGdW5jdGlvblNjb3BlKG5vZGUsIHRoaXMuaXNJbm5lck1ldGhvZERlZmluaXRpb24pO1xuXG4gICAgICAgIC8vIFByb2Nlc3MgcGFyYW1ldGVyIGRlY2xhcmF0aW9ucy5cbiAgICAgICAgZm9yIChpID0gMCwgaXogPSBub2RlLnBhcmFtcy5sZW5ndGg7IGkgPCBpejsgKytpKSB7XG4gICAgICAgICAgICB0aGlzLnZpc2l0UGF0dGVybihub2RlLnBhcmFtc1tpXSwge3Byb2Nlc3NSaWdodEhhbmROb2RlczogdHJ1ZX0sIChwYXR0ZXJuLCBpbmZvKSA9PiB7XG4gICAgICAgICAgICAgICAgdGhpcy5jdXJyZW50U2NvcGUoKS5fX2RlZmluZShwYXR0ZXJuLFxuICAgICAgICAgICAgICAgICAgICBuZXcgUGFyYW1ldGVyRGVmaW5pdGlvbihcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhdHRlcm4sXG4gICAgICAgICAgICAgICAgICAgICAgICBub2RlLFxuICAgICAgICAgICAgICAgICAgICAgICAgaSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGluZm8ucmVzdFxuICAgICAgICAgICAgICAgICAgICApKTtcblxuICAgICAgICAgICAgICAgIHRoaXMucmVmZXJlbmNpbmdEZWZhdWx0VmFsdWUocGF0dGVybiwgaW5mby5hc3NpZ25tZW50cywgbnVsbCwgdHJ1ZSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIGlmIHRoZXJlJ3MgYSByZXN0IGFyZ3VtZW50LCBhZGQgdGhhdFxuICAgICAgICBpZiAobm9kZS5yZXN0KSB7XG4gICAgICAgICAgICB0aGlzLnZpc2l0UGF0dGVybih7XG4gICAgICAgICAgICAgICAgdHlwZTogJ1Jlc3RFbGVtZW50JyxcbiAgICAgICAgICAgICAgICBhcmd1bWVudDogbm9kZS5yZXN0XG4gICAgICAgICAgICB9LCAocGF0dGVybikgPT4ge1xuICAgICAgICAgICAgICAgIHRoaXMuY3VycmVudFNjb3BlKCkuX19kZWZpbmUocGF0dGVybixcbiAgICAgICAgICAgICAgICAgICAgbmV3IFBhcmFtZXRlckRlZmluaXRpb24oXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXR0ZXJuLFxuICAgICAgICAgICAgICAgICAgICAgICAgbm9kZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIG5vZGUucGFyYW1zLmxlbmd0aCxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRydWVcbiAgICAgICAgICAgICAgICAgICAgKSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIFNraXAgQmxvY2tTdGF0ZW1lbnQgdG8gcHJldmVudCBjcmVhdGluZyBCbG9ja1N0YXRlbWVudCBzY29wZS5cbiAgICAgICAgaWYgKG5vZGUuYm9keS50eXBlID09PSBTeW50YXguQmxvY2tTdGF0ZW1lbnQpIHtcbiAgICAgICAgICAgIHRoaXMudmlzaXRDaGlsZHJlbihub2RlLmJvZHkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy52aXNpdChub2RlLmJvZHkpO1xuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy5jbG9zZShub2RlKTtcbiAgICB9XG5cbiAgICB2aXNpdENsYXNzKG5vZGUpIHtcbiAgICAgICAgaWYgKG5vZGUudHlwZSA9PT0gU3ludGF4LkNsYXNzRGVjbGFyYXRpb24pIHtcbiAgICAgICAgICAgIHRoaXMuY3VycmVudFNjb3BlKCkuX19kZWZpbmUobm9kZS5pZCxcbiAgICAgICAgICAgICAgICAgICAgbmV3IERlZmluaXRpb24oXG4gICAgICAgICAgICAgICAgICAgICAgICBWYXJpYWJsZS5DbGFzc05hbWUsXG4gICAgICAgICAgICAgICAgICAgICAgICBub2RlLmlkLFxuICAgICAgICAgICAgICAgICAgICAgICAgbm9kZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgICAgICAgICBudWxsLFxuICAgICAgICAgICAgICAgICAgICAgICAgbnVsbFxuICAgICAgICAgICAgICAgICAgICApKTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIEZJWE1FOiBNYXliZSBjb25zaWRlciBURFouXG4gICAgICAgIHRoaXMudmlzaXQobm9kZS5zdXBlckNsYXNzKTtcblxuICAgICAgICB0aGlzLnNjb3BlTWFuYWdlci5fX25lc3RDbGFzc1Njb3BlKG5vZGUpO1xuXG4gICAgICAgIGlmIChub2RlLmlkKSB7XG4gICAgICAgICAgICB0aGlzLmN1cnJlbnRTY29wZSgpLl9fZGVmaW5lKG5vZGUuaWQsXG4gICAgICAgICAgICAgICAgICAgIG5ldyBEZWZpbml0aW9uKFxuICAgICAgICAgICAgICAgICAgICAgICAgVmFyaWFibGUuQ2xhc3NOYW1lLFxuICAgICAgICAgICAgICAgICAgICAgICAgbm9kZS5pZCxcbiAgICAgICAgICAgICAgICAgICAgICAgIG5vZGVcbiAgICAgICAgICAgICAgICAgICAgKSk7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy52aXNpdChub2RlLmJvZHkpO1xuXG4gICAgICAgIHRoaXMuY2xvc2Uobm9kZSk7XG4gICAgfVxuXG4gICAgdmlzaXRQcm9wZXJ0eShub2RlKSB7XG4gICAgICAgIHZhciBwcmV2aW91cywgaXNNZXRob2REZWZpbml0aW9uO1xuICAgICAgICBpZiAobm9kZS5jb21wdXRlZCkge1xuICAgICAgICAgICAgdGhpcy52aXNpdChub2RlLmtleSk7XG4gICAgICAgIH1cblxuICAgICAgICBpc01ldGhvZERlZmluaXRpb24gPSBub2RlLnR5cGUgPT09IFN5bnRheC5NZXRob2REZWZpbml0aW9uIHx8IG5vZGUubWV0aG9kO1xuICAgICAgICBpZiAoaXNNZXRob2REZWZpbml0aW9uKSB7XG4gICAgICAgICAgICBwcmV2aW91cyA9IHRoaXMucHVzaElubmVyTWV0aG9kRGVmaW5pdGlvbih0cnVlKTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLnZpc2l0KG5vZGUudmFsdWUpO1xuICAgICAgICBpZiAoaXNNZXRob2REZWZpbml0aW9uKSB7XG4gICAgICAgICAgICB0aGlzLnBvcElubmVyTWV0aG9kRGVmaW5pdGlvbihwcmV2aW91cyk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICB2aXNpdEZvckluKG5vZGUpIHtcbiAgICAgICAgaWYgKG5vZGUubGVmdC50eXBlID09PSBTeW50YXguVmFyaWFibGVEZWNsYXJhdGlvbiAmJiBub2RlLmxlZnQua2luZCAhPT0gJ3ZhcicpIHtcbiAgICAgICAgICAgIHRoaXMubWF0ZXJpYWxpemVURFpTY29wZShub2RlLnJpZ2h0LCBub2RlKTtcbiAgICAgICAgICAgIHRoaXMudmlzaXQobm9kZS5yaWdodCk7XG4gICAgICAgICAgICB0aGlzLmNsb3NlKG5vZGUucmlnaHQpO1xuXG4gICAgICAgICAgICB0aGlzLm1hdGVyaWFsaXplSXRlcmF0aW9uU2NvcGUobm9kZSk7XG4gICAgICAgICAgICB0aGlzLnZpc2l0KG5vZGUuYm9keSk7XG4gICAgICAgICAgICB0aGlzLmNsb3NlKG5vZGUpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKG5vZGUubGVmdC50eXBlID09PSBTeW50YXguVmFyaWFibGVEZWNsYXJhdGlvbikge1xuICAgICAgICAgICAgICAgIHRoaXMudmlzaXQobm9kZS5sZWZ0KTtcbiAgICAgICAgICAgICAgICB0aGlzLnZpc2l0UGF0dGVybihub2RlLmxlZnQuZGVjbGFyYXRpb25zWzBdLmlkLCAocGF0dGVybikgPT4ge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmN1cnJlbnRTY29wZSgpLl9fcmVmZXJlbmNpbmcocGF0dGVybiwgUmVmZXJlbmNlLldSSVRFLCBub2RlLnJpZ2h0LCBudWxsLCB0cnVlLCB0cnVlKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy52aXNpdFBhdHRlcm4obm9kZS5sZWZ0LCB7cHJvY2Vzc1JpZ2h0SGFuZE5vZGVzOiB0cnVlfSwgKHBhdHRlcm4sIGluZm8pID0+IHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIG1heWJlSW1wbGljaXRHbG9iYWwgPSBudWxsO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIXRoaXMuY3VycmVudFNjb3BlKCkuaXNTdHJpY3QpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG1heWJlSW1wbGljaXRHbG9iYWwgPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGF0dGVybjogcGF0dGVybixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBub2RlOiBub2RlXG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHRoaXMucmVmZXJlbmNpbmdEZWZhdWx0VmFsdWUocGF0dGVybiwgaW5mby5hc3NpZ25tZW50cywgbWF5YmVJbXBsaWNpdEdsb2JhbCwgZmFsc2UpO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmN1cnJlbnRTY29wZSgpLl9fcmVmZXJlbmNpbmcocGF0dGVybiwgUmVmZXJlbmNlLldSSVRFLCBub2RlLnJpZ2h0LCBtYXliZUltcGxpY2l0R2xvYmFsLCB0cnVlLCBmYWxzZSk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aGlzLnZpc2l0KG5vZGUucmlnaHQpO1xuICAgICAgICAgICAgdGhpcy52aXNpdChub2RlLmJvZHkpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgdmlzaXRWYXJpYWJsZURlY2xhcmF0aW9uKHZhcmlhYmxlVGFyZ2V0U2NvcGUsIHR5cGUsIG5vZGUsIGluZGV4LCBmcm9tVERaKSB7XG4gICAgICAgIC8vIElmIHRoaXMgd2FzIGNhbGxlZCB0byBpbml0aWFsaXplIGEgVERaIHNjb3BlLCB0aGlzIG5lZWRzIHRvIG1ha2UgZGVmaW5pdGlvbnMsIGJ1dCBkb2Vzbid0IG1ha2UgcmVmZXJlbmNlcy5cbiAgICAgICAgdmFyIGRlY2wsIGluaXQ7XG5cbiAgICAgICAgZGVjbCA9IG5vZGUuZGVjbGFyYXRpb25zW2luZGV4XTtcbiAgICAgICAgaW5pdCA9IGRlY2wuaW5pdDtcbiAgICAgICAgdGhpcy52aXNpdFBhdHRlcm4oZGVjbC5pZCwge3Byb2Nlc3NSaWdodEhhbmROb2RlczogIWZyb21URFp9LCAocGF0dGVybiwgaW5mbykgPT4ge1xuICAgICAgICAgICAgdmFyaWFibGVUYXJnZXRTY29wZS5fX2RlZmluZShwYXR0ZXJuLFxuICAgICAgICAgICAgICAgIG5ldyBEZWZpbml0aW9uKFxuICAgICAgICAgICAgICAgICAgICB0eXBlLFxuICAgICAgICAgICAgICAgICAgICBwYXR0ZXJuLFxuICAgICAgICAgICAgICAgICAgICBkZWNsLFxuICAgICAgICAgICAgICAgICAgICBub2RlLFxuICAgICAgICAgICAgICAgICAgICBpbmRleCxcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5raW5kXG4gICAgICAgICAgICAgICAgKSk7XG5cbiAgICAgICAgICAgIGlmICghZnJvbVREWikge1xuICAgICAgICAgICAgICAgIHRoaXMucmVmZXJlbmNpbmdEZWZhdWx0VmFsdWUocGF0dGVybiwgaW5mby5hc3NpZ25tZW50cywgbnVsbCwgdHJ1ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoaW5pdCkge1xuICAgICAgICAgICAgICAgIHRoaXMuY3VycmVudFNjb3BlKCkuX19yZWZlcmVuY2luZyhwYXR0ZXJuLCBSZWZlcmVuY2UuV1JJVEUsIGluaXQsIG51bGwsICFpbmZvLnRvcExldmVsLCB0cnVlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgQXNzaWdubWVudEV4cHJlc3Npb24obm9kZSkge1xuICAgICAgICBpZiAoaXNQYXR0ZXJuKG5vZGUubGVmdCkpIHtcbiAgICAgICAgICAgIGlmIChub2RlLm9wZXJhdG9yID09PSAnPScpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnZpc2l0UGF0dGVybihub2RlLmxlZnQsIHtwcm9jZXNzUmlnaHRIYW5kTm9kZXM6IHRydWV9LCAocGF0dGVybiwgaW5mbykgPT4ge1xuICAgICAgICAgICAgICAgICAgICB2YXIgbWF5YmVJbXBsaWNpdEdsb2JhbCA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgIGlmICghdGhpcy5jdXJyZW50U2NvcGUoKS5pc1N0cmljdCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbWF5YmVJbXBsaWNpdEdsb2JhbCA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXR0ZXJuOiBwYXR0ZXJuLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vZGU6IG5vZGVcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdGhpcy5yZWZlcmVuY2luZ0RlZmF1bHRWYWx1ZShwYXR0ZXJuLCBpbmZvLmFzc2lnbm1lbnRzLCBtYXliZUltcGxpY2l0R2xvYmFsLCBmYWxzZSk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY3VycmVudFNjb3BlKCkuX19yZWZlcmVuY2luZyhwYXR0ZXJuLCBSZWZlcmVuY2UuV1JJVEUsIG5vZGUucmlnaHQsIG1heWJlSW1wbGljaXRHbG9iYWwsICFpbmZvLnRvcExldmVsLCBmYWxzZSk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRoaXMuY3VycmVudFNjb3BlKCkuX19yZWZlcmVuY2luZyhub2RlLmxlZnQsIFJlZmVyZW5jZS5SVywgbm9kZS5yaWdodCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLnZpc2l0KG5vZGUubGVmdCk7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy52aXNpdChub2RlLnJpZ2h0KTtcbiAgICB9XG5cbiAgICBDYXRjaENsYXVzZShub2RlKSB7XG4gICAgICAgIHRoaXMuc2NvcGVNYW5hZ2VyLl9fbmVzdENhdGNoU2NvcGUobm9kZSk7XG5cbiAgICAgICAgdGhpcy52aXNpdFBhdHRlcm4obm9kZS5wYXJhbSwge3Byb2Nlc3NSaWdodEhhbmROb2RlczogdHJ1ZX0sIChwYXR0ZXJuLCBpbmZvKSA9PiB7XG4gICAgICAgICAgICB0aGlzLmN1cnJlbnRTY29wZSgpLl9fZGVmaW5lKHBhdHRlcm4sXG4gICAgICAgICAgICAgICAgbmV3IERlZmluaXRpb24oXG4gICAgICAgICAgICAgICAgICAgIFZhcmlhYmxlLkNhdGNoQ2xhdXNlLFxuICAgICAgICAgICAgICAgICAgICBub2RlLnBhcmFtLFxuICAgICAgICAgICAgICAgICAgICBub2RlLFxuICAgICAgICAgICAgICAgICAgICBudWxsLFxuICAgICAgICAgICAgICAgICAgICBudWxsLFxuICAgICAgICAgICAgICAgICAgICBudWxsXG4gICAgICAgICAgICAgICAgKSk7XG4gICAgICAgICAgICB0aGlzLnJlZmVyZW5jaW5nRGVmYXVsdFZhbHVlKHBhdHRlcm4sIGluZm8uYXNzaWdubWVudHMsIG51bGwsIHRydWUpO1xuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy52aXNpdChub2RlLmJvZHkpO1xuXG4gICAgICAgIHRoaXMuY2xvc2Uobm9kZSk7XG4gICAgfVxuXG4gICAgUHJvZ3JhbShub2RlKSB7XG4gICAgICAgIHRoaXMuc2NvcGVNYW5hZ2VyLl9fbmVzdEdsb2JhbFNjb3BlKG5vZGUpO1xuXG4gICAgICAgIGlmICh0aGlzLnNjb3BlTWFuYWdlci5fX2lzTm9kZWpzU2NvcGUoKSkge1xuICAgICAgICAgICAgLy8gRm9yY2Ugc3RyaWN0bmVzcyBvZiBHbG9iYWxTY29wZSB0byBmYWxzZSB3aGVuIHVzaW5nIG5vZGUuanMgc2NvcGUuXG4gICAgICAgICAgICB0aGlzLmN1cnJlbnRTY29wZSgpLmlzU3RyaWN0ID0gZmFsc2U7XG4gICAgICAgICAgICB0aGlzLnNjb3BlTWFuYWdlci5fX25lc3RGdW5jdGlvblNjb3BlKG5vZGUsIGZhbHNlKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0aGlzLnNjb3BlTWFuYWdlci5fX2lzRVM2KC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7XG4gICAgfVxuXG4gICAgdmlzaXRFeHBvcnREZWNsYXJhdGlvbihub2RlKSB7XG4gICAgICAgIGlmIChub2RlLnNvdXJjZSkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIGlmIChub2RlLmRlY2xhcmF0aW9uKSB7XG4gICAgICAgICAgICB0aGlzLnZpc2l0KG5vZGUuZGVjbGFyYXRpb24pO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy52aXNpdENoaWxkcmVuKG5vZGUpO1xuICAgIH1cblxuICAgIEV4cG9ydERlY2xhcmF0aW9uKG5vZGUpIHtcbiAgICAgICAgdGhpcy52aXNpdEV4cG9ydERlY2xhcmF0aW9uKG5vZGUpO1xuICAgIH1cblxuICAgIEV4cG9ydE5hbWVkRGVjbGFyYXRpb24obm9kZSkge1xuICAgICAgICB0aGlzLnZpc2l0RXhwb3J0RGVjbGFyYXRpb24obm9kZSk7XG4gICAgfVxuXG4gICAgRXhwb3J0U3BlY2lmaWVyKG5vZGUpIHtcbiAgICAgICAgbGV0IGxvY2FsID0gKG5vZGUuaWQgfHwgbm9kZS5sb2NhbCk7XG4gICAgICAgIHRoaXMudmlzaXQobG9jYWwpO1xuICAgIH1cbn1cblxuLyogdmltOiBzZXQgc3c9NCB0cz00IGV0IHR3PTgwIDogKi9cbiJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ== \ No newline at end of file
diff --git a/tools/eslint/node_modules/escope/lib/scope.js b/tools/eslint/node_modules/escope/lib/scope.js
index 362e275474c..ec1547b91fe 100644
--- a/tools/eslint/node_modules/escope/lib/scope.js
+++ b/tools/eslint/node_modules/escope/lib/scope.js
@@ -134,6 +134,10 @@ function registerScope(scopeManager, scope) {
}
}
+function shouldBeStatically(def) {
+ return def.type === Variable.ClassName || def.type === Variable.Variable && def.parent.kind !== "var";
+}
+
/**
* @class Scope
*/
@@ -250,40 +254,65 @@ var Scope = (function () {
return !this.dynamic || scopeManager.__isOptimistic();
}
},
- __staticClose: {
- value: function __staticClose(scopeManager) {
- // static resolve
- for (var i = 0, iz = this.__left.length; i < iz; ++i) {
- var ref = this.__left[i];
- if (!this.__resolve(ref)) {
- this.__delegateToUpperScope(ref);
- }
+ __shouldStaticallyCloseForGlobal: {
+ value: function __shouldStaticallyCloseForGlobal(ref) {
+ // On global scope, let/const/class declarations should be resolved statically.
+ var name = ref.identifier.name;
+ if (!this.set.has(name)) {
+ return false;
}
+
+ var variable = this.set.get(name);
+ var defs = variable.defs;
+ return defs.length > 0 && defs.every(shouldBeStatically);
}
},
- __dynamicClose: {
- value: function __dynamicClose(scopeManager) {
- // This path is for "global" and "function with eval" environment.
- for (var i = 0, iz = this.__left.length; i < iz; ++i) {
- // notify all names are through to global
- var ref = this.__left[i];
- var current = this;
- do {
- current.through.push(ref);
- current = current.upper;
- } while (current);
+ __staticCloseRef: {
+ value: function __staticCloseRef(ref) {
+ if (!this.__resolve(ref)) {
+ this.__delegateToUpperScope(ref);
+ }
+ }
+ },
+ __dynamicCloseRef: {
+ value: function __dynamicCloseRef(ref) {
+ // notify all names are through to global
+ var current = this;
+ do {
+ current.through.push(ref);
+ current = current.upper;
+ } while (current);
+ }
+ },
+ __globalCloseRef: {
+ value: function __globalCloseRef(ref) {
+ // let/const/class declarations should be resolved statically.
+ // others should be resolved dynamically.
+ if (this.__shouldStaticallyCloseForGlobal(ref)) {
+ this.__staticCloseRef(ref);
+ } else {
+ this.__dynamicCloseRef(ref);
}
}
},
__close: {
value: function __close(scopeManager) {
+ var closeRef;
if (this.__shouldStaticallyClose(scopeManager)) {
- this.__staticClose();
+ closeRef = this.__staticCloseRef;
+ } else if (this.type !== "global") {
+ closeRef = this.__dynamicCloseRef;
} else {
- this.__dynamicClose();
+ closeRef = this.__globalCloseRef;
}
+ // Try Resolving all references in this scope.
+ for (var i = 0, iz = this.__left.length; i < iz; ++i) {
+ var ref = this.__left[i];
+ closeRef.call(this, ref);
+ }
this.__left = null;
+
return this.upper;
}
},
@@ -340,7 +369,7 @@ var Scope = (function () {
}
},
__referencing: {
- value: function __referencing(node, assign, writeExpr, maybeImplicitGlobal, partial) {
+ value: function __referencing(node, assign, writeExpr, maybeImplicitGlobal, partial, init) {
// because Array element may be null
if (!node || node.type !== Syntax.Identifier) {
return;
@@ -351,7 +380,7 @@ var Scope = (function () {
return;
}
- var ref = new Reference(node, this, assign || Reference.READ, writeExpr, maybeImplicitGlobal, !!partial);
+ var ref = new Reference(node, this, assign || Reference.READ, writeExpr, maybeImplicitGlobal, !!partial, !!init);
this.references.push(ref);
this.__left.push(ref);
}
@@ -696,4 +725,4 @@ var ClassScope = exports.ClassScope = (function (_Scope11) {
})(Scope);
/* vim: set sw=4 ts=4 et tw=80 : */
-//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNjb3BlLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztJQXdCUyxNQUFNLFdBQVEsWUFBWSxFQUExQixNQUFNOztJQUNSLEdBQUcsMkJBQU0sU0FBUzs7SUFFbEIsU0FBUywyQkFBTSxhQUFhOztJQUM1QixRQUFRLDJCQUFNLFlBQVk7O0lBQzFCLFVBQVUsMkJBQU0sY0FBYzs7SUFDOUIsTUFBTSwyQkFBTSxRQUFROztBQUUzQixTQUFTLGFBQWEsQ0FBQyxLQUFLLEVBQUUsS0FBSyxFQUFFLGtCQUFrQixFQUFFLFlBQVksRUFBRTtBQUNuRSxRQUFJLElBQUksRUFBRSxDQUFDLEVBQUUsRUFBRSxFQUFFLElBQUksRUFBRSxJQUFJLENBQUM7OztBQUc1QixRQUFJLEtBQUssQ0FBQyxLQUFLLElBQUksS0FBSyxDQUFDLEtBQUssQ0FBQyxRQUFRLEVBQUU7QUFDckMsZUFBTyxJQUFJLENBQUM7S0FDZjs7O0FBR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3BlLnVwcGVyLmlzU3RyaWN0KSB7XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgIH1cblxuICAgIC8vIEFycm93RnVuY3Rpb25FeHByZXNzaW9uJ3Mgc2NvcGUgaXMgYWx3YXlzIHN0cmljdCBzY29wZS5cbiAgICBpZiAoYmxvY2sudHlwZSA9PT0gU3ludGF4LkFycm93RnVuY3Rpb25FeHByZXNzaW9uKSB7XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgIH1cblxuICAgIGlmIChpc01ldGhvZERlZmluaXRpb24pIHtcbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgfVxuXG4gICAgaWYgKHNjb3BlLnR5cGUgPT09ICdjbGFzcycgfHwgc2NvcGUudHlwZSA9PT0gJ21vZHVsZScpIHtcbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgfVxuXG4gICAgaWYgKHNjb3BlLnR5cGUgPT09ICdibG9jaycgfHwgc2NvcGUudHlwZSA9PT0gJ3N3aXRjaCcpIHtcbiAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cblxuICAgIGlmIChzY29wZS50eXBlID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgIGlmIChibG9jay50eXBlID09PSAnUHJvZ3JhbScpIHtcbiAgICAgICAgICAgIGJvZHkgPSBibG9jaztcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGJvZHkgPSBibG9jay5ib2R5O1xuICAgICAgICB9XG4gICAgfSBlbHNlIGlmIChzY29wZS50eXBlID09PSAnZ2xvYmFsJykge1xuICAgICAgICBib2R5ID0gYmxvY2s7XG4gICAgfSBlbHNlIHtcbiAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cblxuICAgIC8vIFNlYXJjaCAndXNlIHN0cmljdCcgZGlyZWN0aXZlLlxuICAgIGlmICh1c2VEaXJlY3RpdmUpIHtcbiAgICAgICAgZm9yIChpID0gMCwgaXogPSBib2R5LmJvZHkubGVuZ3RoOyBpIDwgaXo7ICsraSkge1xuICAgICAgICAgICAgc3RtdCA9IGJvZHkuYm9keVtpXTtcbiAgICAgICAgICAgIGlmIChzdG10LnR5cGUgIT09ICdEaXJlY3RpdmVTdGF0ZW1lbnQnKSB7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoc3RtdC5yYXcgPT09ICdcInVzZSBzdHJpY3RcIicgfHwgc3RtdC5yYXcgPT09ICdcXCd1c2Ugc3RyaWN0XFwnJykge1xuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfSBlbHNlIHtcbiAgICAgICAgZm9yIChpID0gMCwgaXogPSBib2R5LmJvZHkubGVuZ3RoOyBpIDwgaXo7ICsraSkge1xuICAgICAgICAgICAgc3RtdCA9IGJvZHkuYm9keVtpXTtcbiAgICAgICAgICAgIGlmIChzdG10LnR5cGUgIT09IFN5bnRheC5FeHByZXNzaW9uU3RhdGVtZW50KSB7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBleHByID0gc3RtdC5leHByZXNzaW9uO1xuICAgICAgICAgICAgaWYgKGV4cHIudHlwZSAhPT0gU3ludGF4LkxpdGVyYWwgfHwgdHlwZW9mIGV4cHIudmFsdWUgIT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoZXhwci5yYXcgIT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIGlmIChleHByLnJhdyA9PT0gJ1widXNlIHN0cmljdFwiJyB8fCBleHByLnJhdyA9PT0gJ1xcJ3VzZSBzdHJpY3RcXCcnKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYgKGV4cHIudm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ICAgICAgICBpZiAoIXRoaXMuX19yZXNvbHZlKHJlZikpIHtcbiAgICAgICAgICAgICAgICB0aGlzLl9fZGVsZWdhdGVUb1VwcGVyU2NvcGUocmVmKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIF9fZHluYW1pY0Nsb3NlKHNjb3BlTWFuYWdlcikge1xuICAgICAgICAvLyBUaGlzIHBhdGggaXMgZm9yIFwiZ2xvYmFsXCIgYW5kIFwiZnVuY3Rpb24gd2l0aCBldmFsXCIgZW52aXJvbm1lbnQuXG4gICAgICAgIGZvciAobGV0IGkgPSAwLCBpeiA9IHRoaXMuX19sZWZ0Lmxlbmd0aDsgaSA8IGl6OyArK2kpIHtcbiAgICAgICAgICAgIC8vIG5vdGlmeSBhbGwgbmFtZXMgYXJlIHRocm91Z2ggdG8gZ2xvYmFsXG4gICAgICAgICAgICBsZXQgcmVmID0gdGhpcy5fX2xlZnRbaV07XG4gICAgICAgICAgICBsZXQgY3VycmVudCA9IHRoaXM7XG4gICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgY3VycmVudC50aHJvdWdoLnB1c2gocmVmKTtcbiAgICAgICAgICAgICAgICBjdXJyZW50ID0gY3VycmVudC51cHBlcjtcbiAgICAgICAgICAgIH0gd2hpbGUgKGN1cnJlbnQpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgX19jbG9zZShzY29wZU1hbmFnZXIpIHtcbiAgICAgICAgaWYgKHRoaXMuX19zaG91bGRTdGF0aWNhbGx5Q2xvc2Uoc2NvcGVNYW5hZ2VyKSkge1xuICAgICAgICAgICAgdGhpcy5fX3N0YXRpY0Nsb3NlKCk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLl9fZHluYW1pY0Nsb3NlKCk7XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLl9fbGVmdCA9IG51bGw7XG4gICAgICAgIHJldHVybiB0aGlzLnVwcGVyO1xuICAgIH1cblxuICAgIF9fcmVzb2x2ZShyZWYpIHtcbiAgICAgICAgdmFyIHZhcmlhYmxlLCBuYW1lO1xuICAgICAgICBuYW1lID0gcmVmLmlkZW50aWZpZXIubmFtZTtcbiAgICAgICAgaWYgKHRoaXMuc2V0LmhhcyhuYW1lKSkge1xuICAgICAgICAgICAgdmFyaWFibGUgPSB0aGlzLnNldC5nZXQobmFtZSk7XG4gICAgICAgICAgICB2YXJpYWJsZS5yZWZlcmVuY2VzLnB1c2gocmVmKTtcbiAgICAgICAgICAgIHZhcmlhYmxlLnN0YWNrID0gdmFyaWFibGUuc3RhY2sgJiYgcmVmLmZyb20udmFyaWFibGVTY29wZSA9PT0gdGhpcy52YXJpYWJsZVNjb3BlO1xuICAgICAgICAgICAgaWYgKHJlZi50YWludGVkKSB7XG4gICAgICAgICAgICAgICAgdmFyaWFibGUudGFpbnRlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgdGhpcy50YWludHMuc2V0KHZhcmlhYmxlLm5hbWUsIHRydWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVmLnJlc29sdmVkID0gdmFyaWFibGU7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuXG4gICAgX19kZWxlZ2F0ZVRvVXBwZXJTY29wZShyZWYpIHtcbiAgICAgICAgaWYgKHRoaXMudXBwZXIpIHtcbiAgICAgICAgICAgIHRoaXMudXBwZXIuX19sZWZ0LnB1c2gocmVmKTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLnRocm91Z2gucHVzaChyZWYpO1xuICAgIH1cblxuICAgIF9fZGVmaW5lR2VuZXJpYyhuYW1lLCBzZXQsIHZhcmlhYmxlcywgbm9kZSwgZGVmKSB7XG4gICAgICAgIHZhciB2YXJpYWJsZTtcblxuICAgICAgICB2YXJpYWJsZSA9IHNldC5nZXQobmFtZSk7XG4gICAgICAgIGlmICghdmFyaWFibGUpIHtcbiAgICAgICAgICAgIHZhcmlhYmxlID0gbmV3IFZhcmlhYmxlKG5hbWUsIHRoaXMpO1xuICAgICAgICAgICAgc2V0LnNldChuYW1lLCB2YXJpYWJsZSk7XG4gICAgICAgICAgICB2YXJpYWJsZXMucHVzaCh2YXJpYWJsZSk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoZGVmKSB7XG4gICAgICAgICAgICB2YXJpYWJsZS5kZWZzLnB1c2goZGVmKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAobm9kZSkge1xuICAgICAgICAgICAgdmFyaWFibGUuaWRlbnRpZmllcnMucHVzaChub2RlKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIF9fZGVmaW5lKG5vZGUsIGRlZikge1xuICAgICAgICBpZiAobm9kZSAmJiBub2RlLnR5cGUgPT09IFN5bnRheC5JZGVudGlmaWVyKSB7XG4gICAgICAgICAgICB0aGlzLl9fZGVmaW5lR2VuZXJpYyhcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5uYW1lLFxuICAgICAgICAgICAgICAgICAgICB0aGlzLnNldCxcbiAgICAgICAgICAgICAgICAgICAgdGhpcy52YXJpYWJsZXMsXG4gICAgICAgICAgICAgICAgICAgIG5vZGUsXG4gICAgICAgICAgICAgICAgICAgIGRlZik7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBfX3JlZmVyZW5jaW5nKG5vZGUsIGFzc2lnbiwgd3JpdGVFeHByLCBtYXliZUltcGxpY2l0R2xvYmFsLCBwYXJ0aWFsKSB7XG4gICAgICAgIC8vIGJlY2F1c2UgQXJyYXkgZWxlbWVudCBtYXkgYmUgbnVsbFxuICAgICAgICBpZiAoIW5vZGUgfHwgbm9kZS50eXBlICE9PSBTeW50YXguSWRlbnRpZmllcikge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gU3BlY2lhbGx5IGhhbmRsZSBsaWtlIGB0aGlzYC5cbiAgICAgICAgaWYgKG5vZGUubmF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ldGhvZCBTY29wZSNpc1RoaXNNYXRlcmlhbGl6ZWRcbiAgICAgKiBAcmV0dXJuIHtib29sZWFufVxuICAgICAqL1xuICAgIGlzVGhpc01hdGVyaWFsaXplZCgpIHtcbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgfVxuXG4gICAgaXNVc2VkTmFtZShuYW1lKSB7XG4gICAgICAgIGlmICh0aGlzLnNldC5oYXMobmFtZSkpIHtcbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICB9XG4gICAgICAgIGZvciAodmFyIGkgPSAwLCBpeiA9IHRoaXMudGhyb3VnaC5sZW5ndGg7IGkgPCBpejsgKytpKSB7XG4gICAgICAgICAgICBpZiAodGhpcy50aHJvdWdoW2ldLmlkZW50aWZpZXIubmFtZSA9PT0gbmFtZSkge1xuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9XG59XG5cbmV4cG9ydCBjbGFzcyBHbG9iYWxTY29wZSBleHRlbmRzIFNjb3BlIHtcbiAgICBjb25zdHJ1Y3RvcihzY29wZU1hbmFnZXIsIGJsb2NrKSB7XG4gICAgICAgIHN1cGVyKHNjb3BlTWFuYWdlciwgJ2dsb2JhbCcsIG51bGwsIGJsb2NrLCBmYWxzZSk7XG4gICAgICAgIHRoaXMuaW1wbGljaXQgPSB7XG4gICAgICAgICAgICBzZXQ6IG5ldyBNYXAoKSxcbiAgICAgICAgICAgIHZhcmlhYmxlczogW10sXG4gICAgICAgICAgICAvKipcbiAgICAgICAgICAgICogTGlzdCBvZiB7QGxpbmsgUmVmZXJlbmNlfXMgdGhhdCBhcmUgbGVmdCB0byBiZSByZXNvbHZlZCAoaS5lLiB3aGljaFxuICAgICAgICAgICAgKiBuZWVkIHRvIGJlIGxpbmtlZCB0byB0aGUgdmFyaWFibGUgdGhleSByZWZlciB0bykuXG4gICAgICAgICAgICAqIEBtZW1iZXIge1JlZmVyZW5jZVtdfSBTY29wZSNpbXBsaWNpdCNsZWZ0XG4gICAgICAgICAgICAqL1xuICAgICAgICAgICAgbGVmdDogW11cbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBfX2Nsb3NlKHNjb3BlTWFuYWdlcikge1xuICAgICAgICBsZXQgaW1wbGljaXQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDAsIGl6ID0gdGhpcy5fX2xlZnQubGVuZ3RoOyBpIDwgaXo7ICsraSkge1xuICAgICAgICAgICAgbGV0IHJlZiA9IHRoaXMuX19sZWZ0W2ldO1xuICAgICAgICAgICAgaWYgKHJlZi5fX21heWJlSW1wbGljaXRHbG9iYWwgJiYgIXRoaXMuc2V0LmhhcyhyZWYuaWRlbnRpZmllci5uYW1lKSkge1xuICAgICAgICAgICAgICAgIGltcGxpY2l0LnB1c2gocmVmLl9fbWF5YmVJbXBsaWNpdEdsb2JhbCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICAvLyBjcmVhdGUgYW4gaW1wbGljaXQgZ2xvYmFsIHZhcmlhYmxlIGZyb20gYXNzaWdubWVudCBleHByZXNzaW9uXG4gICAgICAgIGZvciAobGV0IGkgPSAwLCBpeiA9IGltcGxpY2l0Lmxlbmd0aDsgaSA8IGl6OyArK2kpIHtcbiAgICAgICAgICAgIGxldCBpbmZvID0gaW1wbGljaXRbaV07XG4gICAgICAgICAgICB0aGlzLl9fZGVmaW5lSW1wbGljaXQoaW5mby5wYXR0ZXJuLFxuICAgICAgICAgICAgICAgICAgICBuZXcgRGVmaW5pdGlvbihcbiAgICAgICAgICAgICAgICAgICAgICAgIFZhcmlhYmxlLkltcGxpY2l0R2xvYmFsVmFyaWFibGUsXG4gICAgICAgICAgICAgICAgICAgICAgICBpbmZvLnBhdHRlcm4sXG4gICAgICAgICAgICAgICAgICAgICAgICBpbmZvLm5vZGUsXG4gICAgICAgICAgICAgICAgICAgICAgICBudWxsLFxuICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgICAgIG51bGxcbiAgICAgICAgICAgICAgICAgICAgKSk7XG5cbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMuaW1wbGljaXQubGVmdCA9IHRoaXMuX19sZWZ0O1xuXG4gICAgICAgIHJldHVybiBzdXBlci5fX2Nsb3NlKHNjb3BlTWFuYWdlcik7XG4gICAgfVxuXG4gICAgX19kZWZpbmVJbXBsaWNpdChub2RlLCBkZWYpIHtcbiAgICAgICAgaWYgKG5vZGUgJiYgbm9kZS50eXBlID09PSBTeW50YXguSWRlbnRpZmllcikge1xuICAgICAgICAgICAgdGhpcy5fX2RlZmluZUdlbmVyaWMoXG4gICAgICAgICAgICAgICAgICAgIG5vZGUubmFtZSxcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5pbXBsaWNpdC5zZXQsXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuaW1wbGljaXQudmFyaWFibGVzLFxuICAgICAgICAgICAgICAgICAgICBub2RlLFxuICAgICAgICAgICAgICAgICAgICBkZWYpO1xuICAgICAgICB9XG4gICAgfVxufVxuXG5leHBvcnQgY2xhc3MgTW9kdWxlU2NvcGUgZXh0ZW5kcyBTY29wZSB7XG4gICAgY29uc3RydWN0b3Ioc2NvcGVNYW5hZ2VyLCB1cHBlclNjb3BlLCBibG9jaykge1xuICAgICAgICBzdXBlcihzY29wZU1hbmFnZXIsICdtb2R1bGUnLCB1cHBlclNjb3BlLCBibG9jaywgZmFsc2UpO1xuICAgIH1cbn1cblxuZXhwb3J0IGNsYXNzIEZ1bmN0aW9uRXhwcmVzc2lvbk5hbWVTY29wZSBleHRlbmRzIFNjb3BlIHtcbiAgICBjb25zdHJ1Y3RvcihzY29wZU1hbmFnZXIsIHVwcGVyU2NvcGUsIGJsb2NrKSB7XG4gICAgICAgIHN1cGVyKHNjb3BlTWFuYWdlciwgJ2Z1bmN0aW9uLWV4cHJlc3Npb24tbmFtZScsIHVwcGV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ICAgIHN0bXQgPSBib2R5LmJvZHlbaV07XG4gICAgICAgICAgICBpZiAoc3RtdC50eXBlICE9PSAnRGlyZWN0aXZlU3RhdGVtZW50Jykge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHN0bXQucmF3ID09PSAnXCJ1c2Ugc3RyaWN0XCInIHx8IHN0bXQucmF3ID09PSAnXFwndXNlIHN0cmljdFxcJycpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICAgIGZvciAoaSA9IDAsIGl6ID0gYm9keS5ib2R5Lmxlbmd0aDsgaSA8IGl6OyArK2kpIHtcbiAgICAgICAgICAgIHN0bXQgPSBib2R5LmJvZHlbaV07XG4gICAgICAgICAgICBpZiAoc3RtdC50eXBlICE9PSBTeW50YXguRXhwcmVzc2lvblN0YXRlbWVudCkge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZXhwciA9IHN0bXQuZXhwcmVzc2lvbjtcbiAgICAgICAgICAgIGlmIChleHByLnR5cGUgIT09IFN5bnRheC5MaXRlcmFsIHx8IHR5cGVvZiBleHByLnZhbHVlICE9PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGV4cHIucmF3ICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICBpZiAoZXhwci5yYXcgPT09ICdcInVzZSBzdHJpY3RcIicgfHwgZXhwci5yYXcgPT09ICdcXCd1c2Ugc3RyaWN0XFwnJykge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmIChleHByLnZhbHVlID09PSAndXNlIHN0cmljd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IHJldHVybiB0aGlzLnVwcGVyO1xuICAgIH1cblxuICAgIF9fcmVzb2x2ZShyZWYpIHtcbiAgICAgICAgdmFyIHZhcmlhYmxlLCBuYW1lO1xuICAgICAgICBuYW1lID0gcmVmLmlkZW50aWZpZXIubmFtZTtcbiAgICAgICAgaWYgKHRoaXMuc2V0LmhhcyhuYW1lKSkge1xuICAgICAgICAgICAgdmFyaWFibGUgPSB0aGlzLnNldC5nZXQobmFtZSk7XG4gICAgICAgICAgICB2YXJpYWJsZS5yZWZlcmVuY2VzLnB1c2gocmVmKTtcbiAgICAgICAgICAgIHZhcmlhYmxlLnN0YWNrID0gdmFyaWFibGUuc3RhY2sgJiYgcmVmLmZyb20udmFyaWFibGVTY29wZSA9PT0gdGhpcy52YXJpYWJsZVNjb3BlO1xuICAgICAgICAgICAgaWYgKHJlZi50YWludGVkKSB7XG4gICAgICAgICAgICAgICAgdmFyaWFibGUudGFpbnRlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgdGhpcy50YWludHMuc2V0KHZhcmlhYmxlLm5hbWUsIHRydWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVmLnJlc29sdmVkID0gdmFyaWFibGU7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuXG4gICAgX19kZWxlZ2F0ZVRvVXBwZXJTY29wZShyZWYpIHtcbiAgICAgICAgaWYgKHRoaXMudXBwZXIpIHtcbiAgICAgICAgICAgIHRoaXMudXBwZXIuX19sZWZ0LnB1c2gocmVmKTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLnRocm91Z2gucHVzaChyZWYpO1xuICAgIH1cblxuICAgIF9fZGVmaW5lR2VuZXJpYyhuYW1lLCBzZXQsIHZhcmlhYmxlcywgbm9kZSwgZGVmKSB7XG4gICAgICAgIHZhciB2YXJpYWJsZTtcblxuICAgICAgICB2YXJpYWJsZSA9IHNldC5nZXQobmFtZSk7XG4gICAgICAgIGlmICghdmFyaWFibGUpIHtcbiAgICAgICAgICAgIHZhcmlhYmxlID0gbmV3IFZhcmlhYmxlKG5hbWUsIHRoaXMpO1xuICAgICAgICAgICAgc2V0LnNldChuYW1lLCB2YXJpYWJsZSk7XG4gICAgICAgICAgICB2YXJpYWJsZXMucHVzaCh2YXJpYWJsZSk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoZGVmKSB7XG4gICAgICAgICAgICB2YXJpYWJsZS5kZWZzLnB1c2goZGVmKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAobm9kZSkge1xuICAgICAgICAgICAgdmFyaWFibGUuaWRlbnRpZmllcnMucHVzaChub2RlKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIF9fZGVmaW5lKG5vZGUsIGRlZikge1xuICAgICAgICBpZiAobm9kZSAmJiBub2RlLnR5cGUgPT09IFN5bnRheC5JZGVudGlmaWVyKSB7XG4gICAgICAgICAgICB0aGlzLl9fZGVmaW5lR2VuZXJpYyhcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5uYW1lLFxuICAgICAgICAgICAgICAgICAgICB0aGlzLnNldCxcbiAgICAgICAgICAgICAgICAgICAgdGhpcy52YXJpYWJsZXMsXG4gICAgICAgICAgICAgICAgICAgIG5vZGUsXG4gICAgICAgICAgICAgICAgICAgIGRlZik7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBfX3JlZmVyZW5jaW5nKG5vZGUsIGFzc2lnbiwgd3JpdGVFeHByLCBtYXliZUltcGxpY2l0R2xvYmFsLCBwYXJ0aWFsLCBpbml0KSB7XG4gICAgICAgIC8vIGJlY2F1c2UgQXJyYXkgZWxlbWVudCBtYXkgYmUgbnVsbFxuICAgICAgICBpZiAoIW5vZGUgfHwgbm9kZS50eXBlICE9PSBTeW50YXguSWRlbnRpZmllcikge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gU3BlY2lhbGx5IGhhbmR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gICAgKi9cbiAgICByZXNvbHZlKGlkZW50KSB7XG4gICAgICAgIHZhciByZWYsIGksIGl6O1xuICAgICAgICBhc3NlcnQodGhpcy5fX2lzQ2xvc2VkKCksICdTY29wZSBzaG91bGQgYmUgY2xvc2VkLicpO1xuICAgICAgICBhc3NlcnQoaWRlbnQudHlwZSA9PT0gU3ludGF4LklkZW50aWZpZXIsICdUYXJnZXQgc2hvdWxkIGJlIGlkZW50aWZpZXIuJyk7XG4gICAgICAgIGZvciAoaSA9IDAsIGl6ID0gdGhpcy5yZWZlcmVuY2VzLmxlbmd0aDsgaSA8IGl6OyArK2kpIHtcbiAgICAgICAgICAgIHJlZiA9IHRoaXMucmVmZXJlbmNlc1tpXTtcbiAgICAgICAgICAgIGlmIChyZWYuaWRlbnRpZmllciA9PT0gaWRlbnQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVmO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBudWxsO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIHJldHVybnMgdGhpcyBzY29wZSBpcyBzdGF0aWNcbiAgICAgKiBAbWV0aG9kIFNjb3BlI2lzU3RhdGljXG4gICAgICogQHJldHVybiB7Ym9vbGVhbn1cbiAgICAgKi9cbiAgICBpc1N0YXRpYygpIHtcbiAgICAgICAgcmV0dXJuICF0aGlzLmR5bmFtaWM7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogcmV0dXJucyB0aGlzIHNjb3BlIGhhcyBtYXRlcmlhbGl6ZWQgYXJndW1lbnRzXG4gICAgICogQG1ldGhvZCBTY29wZSNpc0FyZ3VtZW50c01hdGVyaWFsaXplZFxuICAgICAqIEByZXR1cm4ge2Jvb2xlYW59XG4gICAgICovXG4gICAgaXNBcmd1bWVudHNNYXRlcmlhbGl6ZWQoKSB7XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIHJldHVybnMgdGhpcyBzY29wZSBo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bGlua2VkIHRvIHRoZSB2YXJpYWJsZSB0aGV5IHJlZmVyIHRvKS5cbiAgICAgICAgICAgICogQG1lbWJlciB7UmVmZXJlbmNlW119IFNjb3BlI2ltcGxpY2l0I2xlZnRcbiAgICAgICAgICAgICovXG4gICAgICAgICAgICBsZWZ0OiBbXVxuICAgICAgICB9O1xuICAgIH1cblxuICAgIF9fY2xvc2Uoc2NvcGVNYW5hZ2VyKSB7XG4gICAgICAgIGxldCBpbXBsaWNpdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMCwgaXogPSB0aGlzLl9fbGVmdC5sZW5ndGg7IGkgPCBpejsgKytpKSB7XG4gICAgICAgICAgICBsZXQgcmVmID0gdGhpcy5fX2xlZnRbaV07XG4gICAgICAgICAgICBpZiAocmVmLl9fbWF5YmVJbXBsaWNpdEdsb2JhbCAmJiAhdGhpcy5zZXQuaGFzKHJlZi5pZGVudGlmaWVyLm5hbWUpKSB7XG4gICAgICAgICAgICAgICAgaW1wbGljaXQucHVzaChyZWYuX19tYXliZUltcGxpY2l0R2xvYmFsKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIC8vIGNyZWF0ZSBhbiBpbXBsaWNpdCBnbG9iYWwgdmFyaWFibGUgZnJvbSBhc3NpZ25tZW50IGV4cHJlc3Npb25cbiAgICAgICAgZm9yIChsZXQgaSA9IDAsIGl6ID0gaW1wbGljaXQubGVuZ3RoOyBpIDwgaXo7ICsraSkge1xuICAgICAgICAgICAgbGV0IGluZm8gPSBpbXBsaWNpdFtpXTtcbiAgICAgICAgICAgIHRoaXMuX19kZWZpbmVJbXBsaWNpdChpbmZvLnBhdHRlcm4sXG4gICAgICAgICAgICAgICAgICAgIG5ldyBEZWZpbml0aW9uKFxuICAgICAgICAgICAgICAgICAgICAgICAgVmFyaWFibGUuSW1wbGljaXRHbG9iYWxWYXJpYWJsZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGluZm8ucGF0dGVybixcbiAgICAgICAgICAgICAgICAgICAgICAgIGluZm8ubm9kZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgICAgICAgICBudWxsLFxuICAgICAgICAgICAgICAgICAgICAgICAgbnVsbFxuICAgICAgICAgICAgICAgICAgICApKTtcblxuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy5pbXBsaWNpdC5sZWZ0ID0gdGhpcy5fX2xlZnQ7XG5cbiAgICAgICAgcmV0dXJuIHN1cGVyLl9fY2xvc2Uoc2NvcGVNYW5hZ2VyKTtcbiAgICB9XG5cbiAgICBfX2RlZmluZUltcGxpY2l0KG5vZGUsIGRlZikge1xuICAgICAgICBpZiAobm9kZSAmJiBub2RlLnR5cGUgPT09IFN5bnRheC5JZGVudGlmaWVyKSB7XG4gICAgICAgICAgICB0aGlzLl9fZGVmaW5lR2VuZXJpYyhcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5uYW1lLFxuICAgICAgICAgICAgICAgICAgICB0aGlzLmltcGxpY2l0LnNldCxcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5pbXBsaWNpdC52YXJpYWJsZXMsXG4gICAgICAgICAgICAgICAgICAgIG5vZGUsXG4gICAgICAgICAgICAgICAgICAgIGRlZik7XG4gICAgICAgIH1cbiAgICB9XG59XG5cbmV4cG9ydCBjbGFzcyBNb2R1bGVTY29wZSBleHRlbmRzIFNjb3BlIHtcbiAgICBjb25zdHJ1Y3RvcihzY29wZU1hbmFnZXIsIHVwcGVyU2NvcGUsIGJsb2NrKSB7XG4gICAgICAgIHN1cGVyKHNjb3BlTWFuYWdlciwgJ21vZHVsZScsIHVwcGVyU2NvcGUsIGJsb2NrLCBmYWxzZSk7XG4gICAgfVxufVxuXG5leHBvcnQgY2xhc3MgRnVuY3Rpb25FeHByZXNzaW9uTmFtZVNjb3BlIGV4dGVuZHMgU2NvcGUge1xuICAgIGNvbnN0cnVjdG9yKHNjb3BlTWFuYWdlciwgdXBwZXJTY29wZSwgYmxvY2spIHtcbiAgICAgICAgc3VwZXIoc2NvcGVNYW5hZ2VyLCAnZnVuY3Rpb24tZXhwcmVzc2lvbi1uYW1lJywgdXBwZXJTY29wZSwgYmxvY2ssIGZhbHNlKTtcbiAgICAgICAgdGhpcy5fX2RlZmluZShibG9jay5pZCxcbiAgICAgICAgICAgICAgICBuZXcgRGVmaW5pdGlvbihcbiAgICAgICAgICAgICAgICAgICAgVmFyaWFibGUuRnVuY3Rpb25OYW1lLFxuICAgICAgICAgICAgICAgICAgICBibG9jay5pZCxcbiAgICAgICAgICAgICAgICAgICAgYmxvY2ssXG4gICAgICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgICAgIG51bGxcbiAgICAgICAgICAgICAgICApKTtcbiAgICAgICAgdGhpcy5mdW5jdGlvbkV4cHJlc3Npb25TY29wZSA9IHRydWU7XG4gICAgfVxufVxuXG5leHBvcnQgY2xhc3MgQ2F0Y2hTY29wZSBleHRlbmRzIFNjb3BlIHtcbiAgICBjb25zdHJ1Y3RvcihzY29wZU1hbmFnZXIsIHVwcGVyU2NvcGUsIGJsb2NrKSB7XG4gICAgICAgIHN1cGVyKHNjb3BlTWFuYWdlciwgJ2NhdGNoJywgdXBwZXJTY29wZSwgYmxvY2ssIGZhbHNlKTtcbiAgICB9XG59XG5cbmV4cG9ydCBjbGFzcyBXaXRoU2NvcGUgZXh0ZW5kcyBTY29wZSB7XG4gICAgY29uc3RydWN0b3Ioc2NvcGVNYW5hZ2VyLCB1cHBlclNjb3BlLCBibG9jaykge1xuICAgICAgICBzdXBlcihzY29wZU1hbmFnZXIsICd3aXRoJywgdXBwZXJTY29wZSwgYmxvY2ssIGZhbHNlKTtcbiAgICB9XG5cbiAgICBfX2Nsb3NlKHNjb3BlTWFuYWdlcikge1xuICAgICAgICBpZiAodGhpcy5fX3Nob3VsZFN0YXRpY2FsbHlDbG9zZShzY29wZU1hbmFnZXIpKSB7XG4g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gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIXRoaXMuaXNTdGF0aWMoKSkge1xuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgIH1cblxuICAgICAgICBsZXQgdmFyaWFibGUgPSB0aGlzLnNldC5nZXQoJ2FyZ3VtZW50cycpO1xuICAgICAgICBhc3NlcnQodmFyaWFibGUsICdBbHdheXMgaGF2ZSBhcmd1bWVudHMgdmFyaWFibGUuJyk7XG4gICAgICAgIHJldHVybiB2YXJpYWJsZS50YWludGVkIHx8IHZhcmlhYmxlLnJlZmVyZW5jZXMubGVuZ3RoICAhPT0gMDtcbiAgICB9XG5cbiAgICBpc1RoaXNNYXRlcmlhbGl6ZWQoKSB7XG4gICAgICAgIGlmICghdGhpcy5pc1N0YXRpYygpKSB7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy50aGlzRm91bmQ7XG4gICAgfVxuXG4gICAgX19kZWZpbmVBcmd1bWVudHMoKSB7XG4gICAgICAgIHRoaXMuX19kZWZpbmVHZW5lcmljKFxuICAgICAgICAgICAgICAgICdhcmd1bWVudHMnLFxuICAgICAgICAgICAgICAgIHRoaXMuc2V0LFxuICAgICAgICAgICAgICAgIHRoaXMudmFyaWFibGVzLFxuICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgbnVsbCk7XG4gICAgICAgIHRoaXMudGFpbnRzLnNldCgnYXJndW1lbnRzJywgdHJ1ZSk7XG4gICAgfVxufVxuXG5leHBvcnQgY2xhc3MgRm9yU2NvcGUgZXh0ZW5kcyBTY29wZSB7XG4gICAgY29uc3RydWN0b3Ioc2NvcGVNYW5hZ2VyLCB1cHBlclNjb3BlLCBibG9jaykge1xuICAgICAgICBzdXBlcihzY29wZU1hbmFnZXIsICdmb3InLCB1cHBlclNjb3BlLCBibG9jaywgZmFsc2UpO1xuICAgIH1cbn1cblxuZXhwb3J0IGNsYXNzIENsYXNzU2NvcGUgZXh0ZW5kcyBTY29wZSB7XG4gICAgY29uc3RydWN0b3Ioc2NvcGVNYW5hZ2VyLCB1cHBlclNjb3BlLCBibG9jaykge1xuICAgICAgICBzdXBlcihzY29wZU1hbmFnZXIsICdjbGFzcycsIHVwcGVyU2NvcGUsIGJsb2NrLCBmYWxzZSk7XG4gICAgfVxufVxuXG4vKiB2aW06IHNldCBzdz00IHRzPTQgZXQgdHc9ODAgOiAqL1xuIl0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9 \ No newline at end of file
diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/package.json b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/package.json
index 593d080e609..b861638ad5d 100644
--- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/package.json
+++ b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/package.json
@@ -43,7 +43,7 @@
"homepage": "https://github.com/medikoo/es6-iterator",
"_id": "es6-iterator@0.1.3",
"_shasum": "d6f58b8c4fc413c249b4baa19768f8e4d7c8944e",
- "_from": "es6-iterator@>=0.1.1 <0.2.0",
+ "_from": "es6-iterator@>=0.1.3 <0.2.0",
"_npmVersion": "2.3.0",
"_nodeVersion": "0.11.16",
"_npmUser": {
diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/package.json b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/package.json
index 593d080e609..b861638ad5d 100644
--- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/package.json
+++ b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/package.json
@@ -43,7 +43,7 @@
"homepage": "https://github.com/medikoo/es6-iterator",
"_id": "es6-iterator@0.1.3",
"_shasum": "d6f58b8c4fc413c249b4baa19768f8e4d7c8944e",
- "_from": "es6-iterator@>=0.1.1 <0.2.0",
+ "_from": "es6-iterator@>=0.1.3 <0.2.0",
"_npmVersion": "2.3.0",
"_nodeVersion": "0.11.16",
"_npmUser": {
diff --git a/tools/eslint/node_modules/escope/package.json b/tools/eslint/node_modules/escope/package.json
index 1e121993035..b5f1787ade5 100644
--- a/tools/eslint/node_modules/escope/package.json
+++ b/tools/eslint/node_modules/escope/package.json
@@ -1,9 +1,9 @@
{
"name": "escope",
"description": "ECMAScript scope analyzer",
- "homepage": "http://github.com/estools/escope.html",
+ "homepage": "http://github.com/estools/escope",
"main": "lib/index.js",
- "version": "3.0.1",
+ "version": "3.1.0",
"engines": {
"node": ">=0.4.0"
},
@@ -19,7 +19,7 @@
],
"repository": {
"type": "git",
- "url": "git+ssh://git@github.com/estools/escope.git"
+ "url": "git+https://github.com/estools/escope.git"
},
"dependencies": {
"es6-map": "^0.1.1",
@@ -33,7 +33,7 @@
"browserify": "^9.0.3",
"chai": "^2.1.1",
"coffee-script": "^1.9.1",
- "espree": "^1.11.0",
+ "espree": "^2.0.2",
"esprima": "^2.1.0",
"gulp": "~3.8.10",
"gulp-babel": "^4.0.0",
@@ -52,35 +52,31 @@
"minimist": "^1.1.0",
"vinyl-source-stream": "^1.0.0"
},
- "licenses": [
- {
- "type": "BSD",
- "url": "http://github.com/estools/escope/raw/master/LICENSE.BSD"
- }
- ],
+ "license": "BSD-2-Clause",
"scripts": {
"test": "gulp travis",
"unit-test": "gulp test",
"lint": "gulp lint",
"jsdoc": "jsdoc src/*.js README.md"
},
- "gitHead": "cd455a35658733600ebaef603021b90801272a2f",
+ "gitHead": "f237eefd4bfadfcf397e451219c3079e9bc3bb81",
"bugs": {
"url": "https://github.com/estools/escope/issues"
},
- "_id": "escope@3.0.1",
- "_shasum": "cc150f270852c3b68841370b2184739de18b5d61",
- "_from": "escope@>=3.0.0 <4.0.0",
- "_npmVersion": "2.0.0-alpha-5",
+ "_id": "escope@3.1.0",
+ "_shasum": "92ca48f6286b380e4388e09188a904b0fa1d9b7e",
+ "_from": "escope@>=3.1.0 <4.0.0",
+ "_npmVersion": "2.10.1",
+ "_nodeVersion": "2.1.0",
"_npmUser": {
"name": "constellation",
"email": "utatane.tea@gmail.com"
},
"dist": {
- "shasum": "cc150f270852c3b68841370b2184739de18b5d61",
- "tarball": "http://registry.npmjs.org/escope/-/escope-3.0.1.tgz"
+ "shasum": "92ca48f6286b380e4388e09188a904b0fa1d9b7e",
+ "tarball": "http://registry.npmjs.org/escope/-/escope-3.1.0.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/escope/-/escope-3.0.1.tgz",
+ "_resolved": "https://registry.npmjs.org/escope/-/escope-3.1.0.tgz",
"readme": "ERROR: No README data found!"
}
diff --git a/tools/eslint/node_modules/escope/src/reference.js b/tools/eslint/node_modules/escope/src/reference.js
index 36b4d12810b..7f273a363fa 100644
--- a/tools/eslint/node_modules/escope/src/reference.js
+++ b/tools/eslint/node_modules/escope/src/reference.js
@@ -31,7 +31,7 @@ const RW = READ | WRITE;
* @class Reference
*/
export default class Reference {
- constructor(ident, scope, flag, writeExpr, maybeImplicitGlobal, partial) {
+ constructor(ident, scope, flag, writeExpr, maybeImplicitGlobal, partial, init) {
/**
* Identifier syntax node.
* @member {esprima#Identifier} Reference#identifier
@@ -71,6 +71,11 @@ export default class Reference {
* @member {boolean} Reference#partial
*/
this.partial = partial;
+ /**
+ * Whether the Reference is to write of initialization.
+ * @member {boolean} Reference#init
+ */
+ this.init = init;
}
this.__maybeImplicitGlobal = maybeImplicitGlobal;
}
diff --git a/tools/eslint/node_modules/escope/src/referencer.js b/tools/eslint/node_modules/escope/src/referencer.js
index a337be0d455..7f69a1a8560 100644
--- a/tools/eslint/node_modules/escope/src/referencer.js
+++ b/tools/eslint/node_modules/escope/src/referencer.js
@@ -29,32 +29,37 @@ import { ParameterDefinition, Definition } from './definition';
import assert from 'assert';
class PatternVisitor extends esrecurse.Visitor {
- constructor(rootPattern, referencer, callback) {
+ constructor(rootPattern, callback) {
super();
- this.referencer = referencer;
+ this.rootPattern = rootPattern;
this.callback = callback;
- }
-
- perform(pattern) {
- if (pattern.type === Syntax.Identifier) {
- this.callback(pattern, true);
- return;
- }
- this.visit(pattern);
+ this.assignments = [];
+ this.rightHandNodes = [];
+ this.restElements = [];
}
Identifier(pattern) {
- this.callback(pattern, false);
+ const lastRestElement = getLast(this.restElements);
+ this.callback(pattern, {
+ topLevel: pattern === this.rootPattern,
+ rest: lastRestElement != null && lastRestElement.argument === pattern,
+ assignments: this.assignments
+ });
}
ObjectPattern(pattern) {
var i, iz, property;
for (i = 0, iz = pattern.properties.length; i < iz; ++i) {
property = pattern.properties[i];
- if (property.shorthand) {
- this.visit(property.key);
- continue;
+
+ // Computed property's key is a right hand node.
+ if (property.computed) {
+ this.rightHandNodes.push(property.key);
}
+
+ // If it's shorthand, its key is same as its value.
+ // If it's shorthand and has its default value, its key is same as its value.left (the value is AssignmentPattern).
+ // If it's not shorthand, the name of new variable is its value's.
this.visit(property.value);
}
}
@@ -63,27 +68,96 @@ class PatternVisitor extends esrecurse.Visitor {
var i, iz, element;
for (i = 0, iz = pattern.elements.length; i < iz; ++i) {
element = pattern.elements[i];
- if (element) {
- this.visit(element);
- }
+ this.visit(element);
}
}
AssignmentPattern(pattern) {
+ this.assignments.push(pattern);
this.visit(pattern.left);
- // FIXME: Condier TDZ scope.
- this.referencer.visit(pattern.right);
+ this.rightHandNodes.push(pattern.right);
+ this.assignments.pop();
+ }
+
+ RestElement(pattern) {
+ this.restElements.push(pattern);
+ this.visit(pattern.argument);
+ this.restElements.pop();
+ }
+
+ MemberExpression(node) {
+ // Computed property's key is a right hand node.
+ if (node.computed) {
+ this.rightHandNodes.push(node.property);
+ }
+ // the object is only read, write to its property.
+ this.rightHandNodes.push(node.object);
+ }
+
+ //
+ // ForInStatement.left and AssignmentExpression.left are LeftHandSideExpression.
+ // By spec, LeftHandSideExpression is Pattern or MemberExpression.
+ // (see also: https://github.com/estree/estree/pull/20#issuecomment-74584758)
+ // But espree 2.0 and esprima 2.0 parse to ArrayExpression, ObjectExpression, etc...
+ //
+
+ SpreadElement(node) {
+ this.visit(node.argument);
+ }
+
+ ArrayExpression(node) {
+ node.elements.forEach(this.visit, this);
+ }
+
+ ObjectExpression(node) {
+ node.properties.forEach(property => {
+ // Computed property's key is a right hand node.
+ if (property.computed) {
+ this.rightHandNodes.push(property.key);
+ }
+ this.visit(property.value);
+ });
+ }
+
+ AssignmentExpression(node) {
+ this.assignments.push(node);
+ this.visit(node.left);
+ this.rightHandNodes.push(node.right);
+ this.assignments.pop();
+ }
+
+ CallExpression(node) {
+ // arguments are right hand nodes.
+ node.arguments.forEach(a => { this.rightHandNodes.push(a); });
+ this.visit(node.callee);
}
}
+function getLast(xs) {
+ return xs[xs.length - 1] || null;
+}
+
function traverseIdentifierInPattern(rootPattern, referencer, callback) {
- var visitor = new PatternVisitor(rootPattern, referencer, callback);
- visitor.perform(rootPattern);
+ // Call the callback at left hand identifier nodes, and Collect right hand nodes.
+ var visitor = new PatternVisitor(rootPattern, callback);
+ visitor.visit(rootPattern);
+
+ // Process the right hand nodes recursively.
+ if (referencer != null) {
+ visitor.rightHandNodes.forEach(referencer.visit, referencer);
+ }
}
function isPattern(node) {
var nodeType = node.type;
- return nodeType === Syntax.Identifier || nodeType === Syntax.ObjectPattern || nodeType === Syntax.ArrayPattern || nodeType === Syntax.SpreadElement || nodeType === Syntax.RestElement || nodeType === Syntax.AssignmentPattern;
+ return (
+ nodeType === Syntax.Identifier ||
+ nodeType === Syntax.ObjectPattern ||
+ nodeType === Syntax.ArrayPattern ||
+ nodeType === Syntax.SpreadElement ||
+ nodeType === Syntax.RestElement ||
+ nodeType === Syntax.AssignmentPattern
+ );
}
// Importing ImportDeclaration.
@@ -168,7 +242,7 @@ export default class Referencer extends esrecurse.Visitor {
// http://people.mozilla.org/~jorendorff/es6-draft.html#sec-runtime-semantics-forin-div-ofexpressionevaluation-abstract-operation
// TDZ scope hides the declaration's names.
this.scopeManager.__nestTDZScope(node, iterationNode);
- this.visitVariableDeclaration(this.currentScope(), Variable.TDZ, iterationNode.left, 0);
+ this.visitVariableDeclaration(this.currentScope(), Variable.TDZ, iterationNode.left, 0, true);
}
materializeIterationScope(node) {
@@ -178,12 +252,32 @@ export default class Referencer extends esrecurse.Visitor {
letOrConstDecl = node.left;
this.visitVariableDeclaration(this.currentScope(), Variable.Variable, letOrConstDecl, 0);
this.visitPattern(letOrConstDecl.declarations[0].id, (pattern) => {
- this.currentScope().__referencing(pattern, Reference.WRITE, node.right, null, true);
+ this.currentScope().__referencing(pattern, Reference.WRITE, node.right, null, true, true);
+ });
+ }
+
+ referencingDefaultValue(pattern, assignments, maybeImplicitGlobal, init) {
+ const scope = this.currentScope();
+ assignments.forEach(assignment => {
+ scope.__referencing(
+ pattern,
+ Reference.WRITE,
+ assignment.right,
+ maybeImplicitGlobal,
+ pattern !== assignment.left,
+ init);
});
}
- visitPattern(node, callback) {
- traverseIdentifierInPattern(node, this, callback);
+ visitPattern(node, options, callback) {
+ if (typeof options === 'function') {
+ callback = options;
+ options = {processRightHandNodes: false}
+ }
+ traverseIdentifierInPattern(
+ node,
+ options.processRightHandNodes ? this : null,
+ callback);
}
visitFunction(node) {
@@ -215,15 +309,18 @@ export default class Referencer extends esrecurse.Visitor {
// Consider this function is in the MethodDefinition.
this.scopeManager.__nestFunctionScope(node, this.isInnerMethodDefinition);
+ // Process parameter declarations.
for (i = 0, iz = node.params.length; i < iz; ++i) {
- this.visitPattern(node.params[i], (pattern) => {
+ this.visitPattern(node.params[i], {processRightHandNodes: true}, (pattern, info) => {
this.currentScope().__define(pattern,
new ParameterDefinition(
pattern,
node,
i,
- false
+ info.rest
));
+
+ this.referencingDefaultValue(pattern, info.assignments, null, true);
});
}
@@ -313,13 +410,10 @@ export default class Referencer extends esrecurse.Visitor {
if (node.left.type === Syntax.VariableDeclaration) {
this.visit(node.left);
this.visitPattern(node.left.declarations[0].id, (pattern) => {
- this.currentScope().__referencing(pattern, Reference.WRITE, node.right, null, true);
+ this.currentScope().__referencing(pattern, Reference.WRITE, node.right, null, true, true);
});
} else {
- if (!isPattern(node.left)) {
- this.visit(node.left);
- }
- this.visitPattern(node.left, (pattern) => {
+ this.visitPattern(node.left, {processRightHandNodes: true}, (pattern, info) => {
var maybeImplicitGlobal = null;
if (!this.currentScope().isStrict) {
maybeImplicitGlobal = {
@@ -327,7 +421,8 @@ export default class Referencer extends esrecurse.Visitor {
node: node
};
}
- this.currentScope().__referencing(pattern, Reference.WRITE, node.right, maybeImplicitGlobal, true);
+ this.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false);
+ this.currentScope().__referencing(pattern, Reference.WRITE, node.right, maybeImplicitGlobal, true, false);
});
}
this.visit(node.right);
@@ -335,12 +430,13 @@ export default class Referencer extends esrecurse.Visitor {
}
}
- visitVariableDeclaration(variableTargetScope, type, node, index) {
+ visitVariableDeclaration(variableTargetScope, type, node, index, fromTDZ) {
+ // If this was called to initialize a TDZ scope, this needs to make definitions, but doesn't make references.
var decl, init;
decl = node.declarations[index];
init = decl.init;
- this.visitPattern(decl.id, (pattern, toplevel) => {
+ this.visitPattern(decl.id, {processRightHandNodes: !fromTDZ}, (pattern, info) => {
variableTargetScope.__define(pattern,
new Definition(
type,
@@ -351,8 +447,11 @@ export default class Referencer extends esrecurse.Visitor {
node.kind
));
+ if (!fromTDZ) {
+ this.referencingDefaultValue(pattern, info.assignments, null, true);
+ }
if (init) {
- this.currentScope().__referencing(pattern, Reference.WRITE, init, null, !toplevel);
+ this.currentScope().__referencing(pattern, Reference.WRITE, init, null, !info.topLevel, true);
}
});
}
@@ -360,7 +459,7 @@ export default class Referencer extends esrecurse.Visitor {
AssignmentExpression(node) {
if (isPattern(node.left)) {
if (node.operator === '=') {
- this.visitPattern(node.left, (pattern, toplevel) => {
+ this.visitPattern(node.left, {processRightHandNodes: true}, (pattern, info) => {
var maybeImplicitGlobal = null;
if (!this.currentScope().isStrict) {
maybeImplicitGlobal = {
@@ -368,7 +467,8 @@ export default class Referencer extends esrecurse.Visitor {
node: node
};
}
- this.currentScope().__referencing(pattern, Reference.WRITE, node.right, maybeImplicitGlobal, !toplevel);
+ this.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false);
+ this.currentScope().__referencing(pattern, Reference.WRITE, node.right, maybeImplicitGlobal, !info.topLevel, false);
});
} else {
this.currentScope().__referencing(node.left, Reference.RW, node.right);
@@ -382,7 +482,7 @@ export default class Referencer extends esrecurse.Visitor {
CatchClause(node) {
this.scopeManager.__nestCatchScope(node);
- this.visitPattern(node.param, (pattern) => {
+ this.visitPattern(node.param, {processRightHandNodes: true}, (pattern, info) => {
this.currentScope().__define(pattern,
new Definition(
Variable.CatchClause,
@@ -392,6 +492,7 @@ export default class Referencer extends esrecurse.Visitor {
null,
null
));
+ this.referencingDefaultValue(pattern, info.assignments, null, true);
});
this.visit(node.body);
diff --git a/tools/eslint/node_modules/escope/src/scope.js b/tools/eslint/node_modules/escope/src/scope.js
index d48bef54084..57242d7c063 100644
--- a/tools/eslint/node_modules/escope/src/scope.js
+++ b/tools/eslint/node_modules/escope/src/scope.js
@@ -115,6 +115,13 @@ function registerScope(scopeManager, scope) {
}
}
+function shouldBeStatically(def) {
+ return (
+ (def.type === Variable.ClassName) ||
+ (def.type === Variable.Variable && def.parent.kind !== "var")
+ );
+}
+
/**
* @class Scope
*/
@@ -227,37 +234,60 @@ export default class Scope {
return (!this.dynamic || scopeManager.__isOptimistic());
}
- __staticClose(scopeManager) {
- // static resolve
- for (let i = 0, iz = this.__left.length; i < iz; ++i) {
- let ref = this.__left[i];
- if (!this.__resolve(ref)) {
- this.__delegateToUpperScope(ref);
- }
+ __shouldStaticallyCloseForGlobal(ref) {
+ // On global scope, let/const/class declarations should be resolved statically.
+ var name = ref.identifier.name;
+ if (!this.set.has(name)) {
+ return false;
}
+
+ var variable = this.set.get(name);
+ var defs = variable.defs;
+ return defs.length > 0 && defs.every(shouldBeStatically);
}
- __dynamicClose(scopeManager) {
- // This path is for "global" and "function with eval" environment.
- for (let i = 0, iz = this.__left.length; i < iz; ++i) {
- // notify all names are through to global
- let ref = this.__left[i];
- let current = this;
- do {
- current.through.push(ref);
- current = current.upper;
- } while (current);
+ __staticCloseRef(ref) {
+ if (!this.__resolve(ref)) {
+ this.__delegateToUpperScope(ref);
+ }
+ }
+
+ __dynamicCloseRef(ref) {
+ // notify all names are through to global
+ let current = this;
+ do {
+ current.through.push(ref);
+ current = current.upper;
+ } while (current);
+ }
+
+ __globalCloseRef(ref) {
+ // let/const/class declarations should be resolved statically.
+ // others should be resolved dynamically.
+ if (this.__shouldStaticallyCloseForGlobal(ref)) {
+ this.__staticCloseRef(ref);
+ } else {
+ this.__dynamicCloseRef(ref);
}
}
__close(scopeManager) {
+ var closeRef;
if (this.__shouldStaticallyClose(scopeManager)) {
- this.__staticClose();
+ closeRef = this.__staticCloseRef;
+ } else if (this.type !== 'global') {
+ closeRef = this.__dynamicCloseRef;
} else {
- this.__dynamicClose();
+ closeRef = this.__globalCloseRef;
}
+ // Try Resolving all references in this scope.
+ for (let i = 0, iz = this.__left.length; i < iz; ++i) {
+ let ref = this.__left[i];
+ closeRef.call(this, ref);
+ }
this.__left = null;
+
return this.upper;
}
@@ -314,7 +344,7 @@ export default class Scope {
}
}
- __referencing(node, assign, writeExpr, maybeImplicitGlobal, partial) {
+ __referencing(node, assign, writeExpr, maybeImplicitGlobal, partial, init) {
// because Array element may be null
if (!node || node.type !== Syntax.Identifier) {
return;
@@ -325,7 +355,7 @@ export default class Scope {
return;
}
- let ref = new Reference(node, this, assign || Reference.READ, writeExpr, maybeImplicitGlobal, !!partial);
+ let ref = new Reference(node, this, assign || Reference.READ, writeExpr, maybeImplicitGlobal, !!partial, !!init);
this.references.push(ref);
this.__left.push(ref);
}
diff --git a/tools/eslint/node_modules/espree/README.md b/tools/eslint/node_modules/espree/README.md
index fcbb79ab56d..b6c2001f116 100644
--- a/tools/eslint/node_modules/espree/README.md
+++ b/tools/eslint/node_modules/espree/README.md
@@ -56,6 +56,7 @@ var ast = espree.parse(code, {
tolerant: true,
// specify parsing features (default only has blockBindings: true)
+ // setting this option replaces the default values
ecmaFeatures: {
// enable parsing of arrow functions
@@ -112,6 +113,9 @@ var ast = espree.parse(code, {
// enable parsing spread operator
spread: true,
+ // enable super in functions
+ superInFunctions: true,
+
// enable parsing classes
classes: true,
diff --git a/tools/eslint/node_modules/espree/espree.js b/tools/eslint/node_modules/espree/espree.js
index a0d9d480963..7ccf2dd2982 100644
--- a/tools/eslint/node_modules/espree/espree.js
+++ b/tools/eslint/node_modules/espree/espree.js
@@ -2117,7 +2117,7 @@ function throwUnexpected(token) {
if (token.type === Token.Keyword) {
if (syntax.isFutureReservedWord(token.value)) {
throwError(token, Messages.UnexpectedReserved);
- } else if (strict && syntax.isStrictModeReservedWord(token.value)) {
+ } else if (strict && syntax.isStrictModeReservedWord(token.value, extra.ecmaFeatures)) {
throwErrorTolerant(token, Messages.StrictReservedWord);
return;
}
@@ -3594,7 +3594,7 @@ function parseVariableIdentifier() {
token = lex();
if (token.type !== Token.Identifier) {
- if (strict && token.type === Token.Keyword && syntax.isStrictModeReservedWord(token.value)) {
+ if (strict && token.type === Token.Keyword && syntax.isStrictModeReservedWord(token.value, extra.ecmaFeatures)) {
throwErrorTolerant(token, Messages.StrictReservedWord);
} else {
throwUnexpected(token);
@@ -4068,6 +4068,9 @@ function parseSwitchCase() {
break;
}
statement = parseSourceElement();
+ if (typeof statement === "undefined") {
+ break;
+ }
consequent.push(statement);
}
@@ -4399,7 +4402,7 @@ function validateParam(options, param, name) {
if (syntax.isRestrictedWord(name)) {
options.firstRestricted = param;
options.message = Messages.StrictParamName;
- } else if (syntax.isStrictModeReservedWord(name)) {
+ } else if (syntax.isStrictModeReservedWord(name, extra.ecmaFeatures)) {
options.firstRestricted = param;
options.message = Messages.StrictReservedWord;
} else if (options.paramSet.has(name)) {
@@ -4529,7 +4532,7 @@ function parseFunctionDeclaration(identifierIsOptional) {
if (syntax.isRestrictedWord(token.value)) {
firstRestricted = token;
message = Messages.StrictFunctionName;
- } else if (syntax.isStrictModeReservedWord(token.value)) {
+ } else if (syntax.isStrictModeReservedWord(token.value, extra.ecmaFeatures)) {
firstRestricted = token;
message = Messages.StrictReservedWord;
}
@@ -4594,7 +4597,7 @@ function parseFunctionExpression() {
if (syntax.isRestrictedWord(token.value)) {
firstRestricted = token;
message = Messages.StrictFunctionName;
- } else if (syntax.isStrictModeReservedWord(token.value)) {
+ } else if (syntax.isStrictModeReservedWord(token.value, extra.ecmaFeatures)) {
firstRestricted = token;
message = Messages.StrictReservedWord;
}
diff --git a/tools/eslint/node_modules/espree/lib/syntax.js b/tools/eslint/node_modules/espree/lib/syntax.js
index 7cad1afc898..b69754a881d 100644
--- a/tools/eslint/node_modules/espree/lib/syntax.js
+++ b/tools/eslint/node_modules/espree/lib/syntax.js
@@ -113,7 +113,7 @@ module.exports = {
}
},
- isStrictModeReservedWord: function(id) {
+ isStrictModeReservedWord: function(id, ecmaFeatures) {
switch (id) {
case "implements":
case "interface":
@@ -125,6 +125,8 @@ module.exports = {
case "yield":
case "let":
return true;
+ case "await":
+ return ecmaFeatures.modules;
default:
return false;
}
@@ -138,7 +140,7 @@ module.exports = {
isKeyword: function(id, strict, ecmaFeatures) {
- if (strict && this.isStrictModeReservedWord(id)) {
+ if (strict && this.isStrictModeReservedWord(id, ecmaFeatures)) {
return true;
}
diff --git a/tools/eslint/node_modules/espree/package.json b/tools/eslint/node_modules/espree/package.json
index 4fb253a4018..36fa14ff633 100644
--- a/tools/eslint/node_modules/espree/package.json
+++ b/tools/eslint/node_modules/espree/package.json
@@ -11,7 +11,7 @@
"esparse": "./bin/esparse.js",
"esvalidate": "./bin/esvalidate.js"
},
- "version": "2.0.2",
+ "version": "2.0.4",
"files": [
"bin",
"lib",
@@ -83,9 +83,9 @@
"benchmark-quick": "node test/benchmarks.js quick"
},
"dependencies": {},
- "gitHead": "71b433bf1b3f570452b987a06c5db615d11225e6",
- "_id": "espree@2.0.2",
- "_shasum": "adaefd803ad501779e2063b357549ae3366fd14c",
+ "gitHead": "21f73f3178c9c9709c9ee1474641bb8fdad2115c",
+ "_id": "espree@2.0.4",
+ "_shasum": "679289cc5aa99923540437905288a642f21b90e9",
"_from": "espree@>=2.0.1 <3.0.0",
"_npmVersion": "1.4.28",
"_npmUser": {
@@ -99,10 +99,10 @@
}
],
"dist": {
- "shasum": "adaefd803ad501779e2063b357549ae3366fd14c",
- "tarball": "http://registry.npmjs.org/espree/-/espree-2.0.2.tgz"
+ "shasum": "679289cc5aa99923540437905288a642f21b90e9",
+ "tarball": "http://registry.npmjs.org/espree/-/espree-2.0.4.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/espree/-/espree-2.0.2.tgz",
+ "_resolved": "https://registry.npmjs.org/espree/-/espree-2.0.4.tgz",
"readme": "ERROR: No README data found!"
}
diff --git a/tools/eslint/node_modules/estraverse/estraverse.js b/tools/eslint/node_modules/estraverse/estraverse.js
index abc52ce5012..1ea5caf21f0 100644
--- a/tools/eslint/node_modules/estraverse/estraverse.js
+++ b/tools/eslint/node_modules/estraverse/estraverse.js
@@ -185,6 +185,7 @@
LabeledStatement: 'LabeledStatement',
LogicalExpression: 'LogicalExpression',
MemberExpression: 'MemberExpression',
+ MetaProperty: 'MetaProperty',
MethodDefinition: 'MethodDefinition',
ModuleSpecifier: 'ModuleSpecifier',
NewExpression: 'NewExpression',
@@ -196,6 +197,7 @@
ReturnStatement: 'ReturnStatement',
SequenceExpression: 'SequenceExpression',
SpreadElement: 'SpreadElement',
+ Super: 'Super',
SwitchStatement: 'SwitchStatement',
SwitchCase: 'SwitchCase',
TaggedTemplateExpression: 'TaggedTemplateExpression',
@@ -218,7 +220,7 @@
AssignmentPattern: ['left', 'right'],
ArrayExpression: ['elements'],
ArrayPattern: ['elements'],
- ArrowFunctionExpression: ['params', 'defaults', 'rest', 'body'],
+ ArrowFunctionExpression: ['params', 'body'],
AwaitExpression: ['argument'], // CAUTION: It's deferred to ES7.
BlockStatement: ['body'],
BinaryExpression: ['left', 'right'],
@@ -244,8 +246,8 @@
ForStatement: ['init', 'test', 'update', 'body'],
ForInStatement: ['left', 'right', 'body'],
ForOfStatement: ['left', 'right', 'body'],
- FunctionDeclaration: ['id', 'params', 'defaults', 'rest', 'body'],
- FunctionExpression: ['id', 'params', 'defaults', 'rest', 'body'],
+ FunctionDeclaration: ['id', 'params', 'body'],
+ FunctionExpression: ['id', 'params', 'body'],
GeneratorExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7.
Identifier: [],
IfStatement: ['test', 'consequent', 'alternate'],
@@ -257,6 +259,7 @@
LabeledStatement: ['label', 'body'],
LogicalExpression: ['left', 'right'],
MemberExpression: ['object', 'property'],
+ MetaProperty: ['meta', 'property'],
MethodDefinition: ['key', 'value'],
ModuleSpecifier: [],
NewExpression: ['callee', 'arguments'],
@@ -268,6 +271,7 @@
ReturnStatement: ['argument'],
SequenceExpression: ['expressions'],
SpreadElement: ['argument'],
+ Super: [],
SwitchStatement: ['discriminant', 'cases'],
SwitchCase: ['test', 'consequent'],
TaggedTemplateExpression: ['tag', 'quasi'],
@@ -275,7 +279,7 @@
TemplateLiteral: ['quasis', 'expressions'],
ThisExpression: [],
ThrowStatement: ['argument'],
- TryStatement: ['block', 'handlers', 'handler', 'guardedHandlers', 'finalizer'],
+ TryStatement: ['block', 'handler', 'finalizer'],
UnaryExpression: ['argument'],
UpdateExpression: ['argument'],
VariableDeclaration: ['declarations'],
diff --git a/tools/eslint/node_modules/estraverse/package.json b/tools/eslint/node_modules/estraverse/package.json
index 73d905f97d4..c0a8b690c74 100644
--- a/tools/eslint/node_modules/estraverse/package.json
+++ b/tools/eslint/node_modules/estraverse/package.json
@@ -3,7 +3,7 @@
"description": "ECMAScript JS AST traversal functions",
"homepage": "https://github.com/estools/estraverse",
"main": "estraverse.js",
- "version": "2.0.0",
+ "version": "4.1.0",
"engines": {
"node": ">=0.10.0"
},
@@ -11,6 +11,10 @@
{
"name": "constellation",
"email": "utatane.tea@gmail.com"
+ },
+ {
+ "name": "michaelficarra",
+ "email": "npm@michael.ficarra.me"
}
],
"repository": {
@@ -40,23 +44,24 @@
"lint": "jshint estraverse.js",
"unit-test": "mocha --compilers coffee:coffee-script/register"
},
- "gitHead": "d8bc726f126817cc03c7a4e751528edb19db0ffb",
+ "gitHead": "347d52996336719b5910c7ffb5ff3ea8ecb87cf3",
"bugs": {
"url": "https://github.com/estools/estraverse/issues"
},
- "_id": "estraverse@2.0.0",
- "_shasum": "5ae46963243600206674ccb24a09e16674fcdca1",
- "_from": "estraverse@>=2.0.0 <3.0.0",
- "_npmVersion": "2.0.0-alpha-5",
+ "_id": "estraverse@4.1.0",
+ "_shasum": "40f23a76092041be6467d7f235c933b670766e05",
+ "_from": "estraverse@>=4.1.0 <5.0.0",
+ "_npmVersion": "2.8.3",
+ "_nodeVersion": "1.8.1",
"_npmUser": {
"name": "constellation",
"email": "utatane.tea@gmail.com"
},
"dist": {
- "shasum": "5ae46963243600206674ccb24a09e16674fcdca1",
- "tarball": "http://registry.npmjs.org/estraverse/-/estraverse-2.0.0.tgz"
+ "shasum": "40f23a76092041be6467d7f235c933b670766e05",
+ "tarball": "http://registry.npmjs.org/estraverse/-/estraverse-4.1.0.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/estraverse/-/estraverse-2.0.0.tgz",
+ "_resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.1.0.tgz",
"readme": "ERROR: No README data found!"
}
diff --git a/tools/eslint/node_modules/globals/globals.json b/tools/eslint/node_modules/globals/globals.json
index 14f69c313d2..ad5c25f3e83 100644
--- a/tools/eslint/node_modules/globals/globals.json
+++ b/tools/eslint/node_modules/globals/globals.json
@@ -4,12 +4,14 @@
"ArrayBuffer": false,
"Boolean": false,
"constructor": false,
+ "DataView": false,
"Date": false,
"decodeURI": false,
"decodeURIComponent": false,
"encodeURI": false,
"encodeURIComponent": false,
"Error": false,
+ "escape": false,
"eval": false,
"EvalError": false,
"Float32Array": false,
@@ -51,15 +53,12 @@
"Uint8Array": false,
"Uint8ClampedArray": false,
"undefined": false,
+ "unescape": false,
"URIError": false,
"valueOf": false,
"WeakMap": false,
"WeakSet": false
},
- "nonstandard": {
- "escape": false,
- "unescape": false
- },
"browser": {
"addEventListener": false,
"alert": false,
@@ -87,7 +86,6 @@
"crypto": false,
"CSS": false,
"CustomEvent": false,
- "DataView": false,
"Debug": false,
"defaultStatus": false,
"devicePixelRatio": false,
@@ -102,6 +100,8 @@
"ErrorEvent": false,
"event": false,
"Event": false,
+ "EventSource": false,
+ "FileList": false,
"FileReader": false,
"fetch": false,
"find": false,
@@ -459,13 +459,13 @@
"clearInterval": false,
"clearTimeout": false,
"console": false,
- "DataView": false,
"exports": true,
"GLOBAL": false,
"global": false,
"module": false,
"process": false,
"require": false,
+ "root": false,
"setImmediate": false,
"setInterval": false,
"setTimeout": false
@@ -482,6 +482,7 @@
"context": false,
"describe": false,
"it": false,
+ "mocha": false,
"setup": false,
"specify": false,
"suite": false,
diff --git a/tools/eslint/node_modules/globals/package.json b/tools/eslint/node_modules/globals/package.json
index 292823c7b31..a2c763000d2 100644
--- a/tools/eslint/node_modules/globals/package.json
+++ b/tools/eslint/node_modules/globals/package.json
@@ -1,11 +1,11 @@
{
"name": "globals",
- "version": "6.4.1",
+ "version": "8.1.0",
"description": "Global identifiers from different JavaScript environments",
"license": "MIT",
"repository": {
"type": "git",
- "url": "git+https://github.com/sindresorhus/globals.git"
+ "url": "https://github.com/sindresorhus/globals"
},
"author": {
"name": "Sindre Sorhus",
@@ -35,20 +35,24 @@
"devDependencies": {
"mocha": "*"
},
- "gitHead": "c8e9f2aba0eaea2a732452667a386178ddd6bcb7",
+ "gitHead": "f86075648ac672a540e64c2a46de8ef49c15fc0b",
"bugs": {
"url": "https://github.com/sindresorhus/globals/issues"
},
"homepage": "https://github.com/sindresorhus/globals",
- "_id": "globals@6.4.1",
- "_shasum": "8498032b3b6d1cc81eebc5f79690d8fe29fabf4f",
- "_from": "globals@>=6.1.0 <7.0.0",
- "_npmVersion": "2.5.1",
- "_nodeVersion": "0.12.0",
+ "_id": "globals@8.1.0",
+ "_shasum": "f491df47705dfb94e06ff4ff2352babde95e10b8",
+ "_from": "globals@>=8.0.0 <9.0.0",
+ "_npmVersion": "2.10.1",
+ "_nodeVersion": "0.12.4",
"_npmUser": {
"name": "sindresorhus",
"email": "sindresorhus@gmail.com"
},
+ "dist": {
+ "shasum": "f491df47705dfb94e06ff4ff2352babde95e10b8",
+ "tarball": "http://registry.npmjs.org/globals/-/globals-8.1.0.tgz"
+ },
"maintainers": [
{
"name": "sindresorhus",
@@ -63,11 +67,6 @@
"email": "schreck.mathias@gmail.com"
}
],
- "dist": {
- "shasum": "8498032b3b6d1cc81eebc5f79690d8fe29fabf4f",
- "tarball": "http://registry.npmjs.org/globals/-/globals-6.4.1.tgz"
- },
"directories": {},
- "_resolved": "https://registry.npmjs.org/globals/-/globals-6.4.1.tgz",
- "readme": "ERROR: No README data found!"
+ "_resolved": "https://registry.npmjs.org/globals/-/globals-8.1.0.tgz"
}
diff --git a/tools/eslint/node_modules/inquirer/README.md b/tools/eslint/node_modules/inquirer/README.md
new file mode 100644
index 00000000000..3043568ed63
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/README.md
@@ -0,0 +1,295 @@
+Inquirer.js
+===========
+
+[![npm](https://badge.fury.io/js/inquirer.svg)](http://badge.fury.io/js/inquirer) [![tests](https://travis-ci.org/SBoudrias/Inquirer.js.svg?branch=master)](http://travis-ci.org/SBoudrias/Inquirer.js) [![dependencies](https://david-dm.org/SBoudrias/Inquirer.js.svg?theme=shields.io)](https://david-dm.org/SBoudrias/Inquirer.js)
+
+A collection of common interactive command line user interfaces.
+
+
+## Goal and philosophy
+
+<img align="right" alt="Inquirer Logo" src="/assets/inquirer_readme.png" title="Inquirer.js"/>
+
+We strive at providing easily embeddable and beautiful command line interface for Node.js; some hope in becoming the CLI Xanadu.
+
+_**Inquirer**_ should ease the process of asking end user **questions**, **parsing**, **validating** answers, managing **hierarchical prompts** and providing **error feedback**.
+
+_**Inquirer**_ provide the user interface, and the inquiry session flow. If you're searching for a full blown command line program utility, then check out [Commander.js](https://github.com/visionmedia/commander.js) (inspired by).
+
+
+## Documentation
+
+### Installation
+
+``` shell
+npm install inquirer
+```
+
+```javascript
+var inquirer = require("inquirer");
+inquirer.prompt([/* Pass your questions in here */], function( answers ) {
+ // Use user feedback for... whatever!!
+});
+```
+
+
+### Examples (Run it and see it)
+Checkout the `examples/` folder for code and interface examples.
+
+``` shell
+node examples/pizza.js
+node examples/checkbox.js
+# etc...
+```
+
+
+### Methods
+
+`inquirer.prompt( questions, callback )`
+
+Launch the prompt interface (inquiry session)
+
+- **questions** (Array) containing [Question Object](#question) (using the [reactive interface](#reactive-interface), you can also pass a `Rx.Observable` instance)
+- **callback** (Function) first parameter is the [Answers Object](#answers)
+
+
+### Objects
+
+#### Question
+A question object is a `hash` containing question related values:
+
+- **type**: (String) Type of the prompt. Defaults: `input` - Possible values: `input`, `confirm`,
+`list`, `rawlist`, `password`
+- **name**: (String) The name to use when storing the answer in the anwers hash.
+- **message**: (String|Function) The question to print. If defined as a function, the first parameter will be the current inquirer session answers.
+- **default**: (String|Number|Array|Function) Default value(s) to use if nothing is entered, or a function that returns the default value(s). If defined as a function, the first parameter will be the current inquirer session answers.
+- **choices**: (Array|Function) Choices array or a function returning a choices array. If defined as a function, the first parameter will be the current inquirer session answers.
+Array values can be simple `strings`, or `objects` containing a `name` (to display) and a `value` properties (to save in the answers hash). Values can also be [a `Separator`](#separator).
+- **validate**: (Function) Receive the user input and should return `true` if the value is valid, and an error message (`String`) otherwise. If `false` is returned, a default error message is provided.
+- **filter**: (Function) Receive the user input and return the filtered value to be used inside the program. The value returned will be added to the _Answers_ hash.
+- **when**: (Function, Boolean) Receive the current user answers hash and should return `true` or `false` depending on whether or not this question should be asked. The value can also be a simple boolean.
+
+`default`(if defined as a function), `validate`, `filter` and `when` functions can be called asynchronously using `this.async()`. You just have to pass the value you'd normally return to the callback option.
+
+``` javascript
+{
+ validate: function(input) {
+
+ // Declare function as asynchronous, and save the done callback
+ var done = this.async();
+
+ // Do async stuff
+ setTimeout(function() {
+ if (typeof input !== "number") {
+ // Pass the return value in the done callback
+ done("You need to provide a number");
+ return;
+ }
+ // Pass the return value in the done callback
+ done(true);
+ }, 3000);
+ }
+}
+```
+
+### Answers
+A key/value hash containing the client answers in each prompt.
+
+- **Key** The `name` property of the _question_ object
+- **Value** (Depends on the prompt)
+ - `confirm`: (Boolean)
+ - `input` : User input (filtered if `filter` is defined) (String)
+ - `rawlist`, `list` : Selected choice value (or name if no value specified) (String)
+
+### Separator
+A separator can be added to any `choices` array:
+
+```
+// In the question object
+choices: [ "Choice A", new inquirer.Separator(), "choice B" ]
+
+// Which'll be displayed this way
+[?] What do you want to do?
+ > Order a pizza
+ Make a reservation
+ --------
+ Ask opening hours
+ Talk to the receptionnist
+```
+
+The constructor takes a facultative `String` value that'll be use as the separator. If omitted, the separator will be `--------`.
+
+Separator instances have a property `type` equal to `separator`. This should allow tools façading Inquirer interface from detecting separator types in lists.
+
+Prompts type
+---------------------
+
+> **Note:**: _allowed options written inside square brackets (`[]`) are optional. Others are required._
+
+#### List - `{ type: "list" }`
+
+Take `type`, `name`, `message`, `choices`[, `default`, `filter`] properties. (Note that
+default must be the choice `index` in the array or a choice `value`)
+
+![List prompt](https://dl.dropboxusercontent.com/u/59696254/inquirer/list-prompt.png)
+
+---
+
+#### Raw List - `{ type: "rawlist" }`
+
+Take `type`, `name`, `message`, `choices`[, `default`, `filter`] properties. (Note that
+default must the choice `index` in the array)
+
+![Raw list prompt](https://i.cloudup.com/LcRGpXI0CX-3000x3000.png)
+
+---
+
+#### Expand - `{ type: "expand" }`
+
+Take `type`, `name`, `message`, `choices`[, `default`, `filter`] properties. (Note that
+default must be the choice `index` in the array)
+
+Note that the `choices` object will take an extra parameter called `key` for the `expand` prompt. This parameter must be a single (lowercased) character. The `h` option is added by the prompt and shouldn't be defined by the user.
+
+See `examples/expand.js` for a running example.
+
+![Expand prompt closed](https://dl.dropboxusercontent.com/u/59696254/inquirer/expand-prompt-1.png)
+![Expand prompt expanded](https://dl.dropboxusercontent.com/u/59696254/inquirer/expand-prompt-2.png)
+
+---
+
+#### Checkbox - `{ type: "checkbox" }`
+
+Take `type`, `name`, `message`, `choices`[, `filter`, `validate`, `default`] properties. `default` is expected to be an Array of the checked choices value.
+
+Choices marked as `{ checked: true }` will be checked by default.
+
+Choices whose property `disabled` is truthy will be unselectable. If `disabled` is a string, then the string will be outputed next to the disabled choice, otherwise it'll default to `"Disabled"`. The `disabled` property can also be a synchronous function receiving the current answers as argument and returning a boolean or a string.
+
+![Checkbox prompt](https://dl.dropboxusercontent.com/u/59696254/inquirer/checkbox-prompt.png)
+
+---
+
+#### Confirm - `{ type: "confirm" }`
+
+Take `type`, `name`, `message`[, `default`] properties. `default` is expected to be a boolean if used.
+
+![Confirm prompt](https://dl.dropboxusercontent.com/u/59696254/inquirer/confirm-prompt.png)
+
+---
+
+#### Input - `{ type: "input" }`
+
+Take `type`, `name`, `message`[, `default`, `filter`, `validate`] properties.
+
+![Input prompt](https://dl.dropboxusercontent.com/u/59696254/inquirer/input-prompt.png)
+
+---
+
+#### Password - `{ type: "password" }`
+
+Take `type`, `name`, `message`[, `default`, `filter`, `validate`] properties.
+
+![Password prompt](https://dl.dropboxusercontent.com/u/59696254/inquirer/password-prompt.png)
+
+## User Interfaces and layouts
+
+Along with the prompts, Inquirer offers some basic text UI.
+
+#### Bottom Bar - `inquirer.ui.BottomBar`
+
+This UI present a fixed text at the bottom of a free text zone. This is useful to keep a message to the bottom of the screen while outputting command outputs on the higher section.
+
+```javascript
+var ui = new inquirer.ui.BottomBar();
+
+// pipe a Stream to the log zone
+outputStream.pipe( ui.log );
+
+// Or simply write output
+ui.log.write("something just happened.");
+ui.log.write("Almost over, standby!");
+
+// During processing, update the bottom bar content to display a loader
+// or output a progress bar, etc
+ui.updateBottomBar("new bottom bar content");
+```
+
+#### Prompt - `inquirer.ui.Prompt`
+
+This is UI layout used to run prompt. This layout is returned by `inquirer.prompt` and you should probably always use `inquirer.prompt` to interface with this UI.
+
+
+## Reactive interface
+
+Internally, Inquirer uses the [JS reactive extension](https://github.com/Reactive-Extensions/RxJS) to handle events and async flows.
+
+This mean you can take advantage of this feature to provide more advanced flows. For example, you can dynamically add questions to be asked:
+
+```js
+var prompts = Rx.Observable.create(function( obs ) {
+ obs.onNext({ /* question... */ });
+ setTimeout(function () {
+ obs.onNext({ /* question... */ });
+ obs.onCompleted();
+ });
+});
+
+inquirer.prompt(prompts);
+```
+
+And using the `process` property, you have access to more fine grained callbacks:
+
+```js
+inquirer.prompt(prompts).process.subscribe(
+ onEachAnswer,
+ onError,
+ onComplete
+);
+```
+
+## Support (OS Terminals)
+
+You should expect mostly good support for the CLI below. This does not mean we won't
+look at issues found on other command line - feel free to report any!
+
+- **Mac OS**:
+ - Terminal.app
+ - iTerm
+- **Windows**:
+ - cmd.exe
+ - Powershell
+ - Cygwin
+- **Ubuntu**:
+ - Terminal
+
+
+## News on the march (Release notes)
+
+Please refer to the [Github releases section for the changelog](https://github.com/SBoudrias/Inquirer.js/releases)
+
+
+## Contributing
+
+**Style Guide**
+Please brief yourself on [Idiomatic.js](https://github.com/rwldrn/idiomatic.js) style guide with two space indent
+
+**Unit test**
+Unit test are written in [Mocha](http://visionmedia.github.io/mocha/). Please add a unit test for every new feature or bug fix. `npm test` to run the test suite.
+
+**Documentation**
+Add documentation for every API change. Feel free to send corrections
+or better docs!
+
+**Pull Requests**
+Send _fixes_ PR on the `master` branch. Any new features should be send on the `wip`branch.
+
+We're looking to offer good support for multiple prompts and environments. If you want to
+help, we'd like to keep a list of testers for each terminal/OS so we can contact you and
+get feedback before release. Let us know if you want to be added to the list (just tweet
+to @vaxilart) or just add your name to [the wiki](https://github.com/SBoudrias/Inquirer.js/wiki/Testers)
+
+## License
+
+Copyright (c) 2012 Simon Boudrias (twitter: @vaxilart)
+Licensed under the MIT license. \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/lib/inquirer.js b/tools/eslint/node_modules/inquirer/lib/inquirer.js
new file mode 100644
index 00000000000..41e24561365
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/lib/inquirer.js
@@ -0,0 +1,79 @@
+/**
+ * Inquirer.js
+ * A collection of common interactive command line user interfaces.
+ */
+
+var inquirer = module.exports;
+
+
+/**
+ * Client interfaces
+ */
+
+inquirer.prompts = {};
+
+inquirer.Separator = require("./objects/separator");
+
+inquirer.ui = {
+ BottomBar: require("./ui/bottom-bar"),
+ Prompt: require("./ui/prompt")
+};
+
+/**
+ * Create a new self-contained prompt module.
+ */
+inquirer.createPromptModule = function () {
+ var promptModule = function( questions, allDone ) {
+ var ui = new inquirer.ui.Prompt( promptModule.prompts );
+ ui.run( questions, allDone );
+ return ui;
+ };
+ promptModule.prompts = {};
+
+ /**
+ * Register a prompt type
+ * @param {String} name Prompt type name
+ * @param {Function} prompt Prompt constructor
+ * @return {inquirer}
+ */
+
+ promptModule.registerPrompt = function( name, prompt ) {
+ promptModule.prompts[ name ] = prompt;
+ return this;
+ };
+
+ /**
+ * Register the defaults provider prompts
+ */
+
+ promptModule.restoreDefaultPrompts = function () {
+ this.registerPrompt( "list", require("./prompts/list"));
+ this.registerPrompt( "input", require("./prompts/input"));
+ this.registerPrompt( "confirm", require("./prompts/confirm"));
+ this.registerPrompt( "rawlist", require("./prompts/rawlist"));
+ this.registerPrompt( "expand", require("./prompts/expand"));
+ this.registerPrompt( "checkbox", require("./prompts/checkbox"));
+ this.registerPrompt( "password", require("./prompts/password"));
+ };
+
+ promptModule.restoreDefaultPrompts();
+
+ return promptModule;
+};
+
+/**
+ * Public CLI helper interface
+ * @param {Array|Object|rx.Observable} questions - Questions settings array
+ * @param {Function} cb - Callback being passed the user answers
+ * @return {inquirer.ui.Prompt}
+ */
+
+inquirer.prompt = inquirer.createPromptModule();
+
+// Expose helper functions on the top level for easiest usage by common users
+inquirer.registerPrompt = function( name, prompt ) {
+ inquirer.prompt.registerPrompt( name, prompt );
+};
+inquirer.restoreDefaultPrompts = function() {
+ inquirer.prompt.restoreDefaultPrompts();
+};
diff --git a/tools/eslint/node_modules/inquirer/lib/objects/choice.js b/tools/eslint/node_modules/inquirer/lib/objects/choice.js
new file mode 100644
index 00000000000..8461151f875
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/lib/objects/choice.js
@@ -0,0 +1,44 @@
+/**
+ * Choice object
+ * Normalize input as choice object
+ */
+
+var _ = require("lodash");
+
+/**
+ * Module exports
+ */
+
+module.exports = Choice;
+
+
+/**
+ * Choice object
+ * @constructor
+ * @param {String|Object} val Choice value. If an object is passed, it should contains
+ * at least one of `value` or `name` property
+ */
+
+function Choice( val, answers ) {
+
+ // Don't process Choice and Separator object
+ if ( val instanceof Choice || val.type === "separator" ) {
+ return val;
+ }
+
+ if ( _.isString(val) ) {
+ this.name = val;
+ this.value = val;
+ } else {
+ _.extend( this, val, {
+ name: val.name || val.value,
+ value: val.hasOwnProperty("value") ? val.value : val.name
+ });
+ }
+
+ if ( _.isFunction(val.disabled) ) {
+ this.disabled = val.disabled( answers );
+ } else {
+ this.disabled = val.disabled;
+ }
+}
diff --git a/tools/eslint/node_modules/inquirer/lib/objects/choices.js b/tools/eslint/node_modules/inquirer/lib/objects/choices.js
new file mode 100644
index 00000000000..20c651ab2a7
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/lib/objects/choices.js
@@ -0,0 +1,180 @@
+/**
+ * Choices object
+ * Collection of multiple `choice` object
+ */
+
+var _ = require("lodash");
+var chalk = require("chalk");
+var Separator = require("./separator");
+var Choice = require("./choice");
+
+
+/**
+ * Module exports
+ */
+
+module.exports = Choices;
+
+
+/**
+ * Choices collection
+ * @constructor
+ * @param {Array} choices All `choice` to keep in the collection
+ */
+
+function Choices( choices, answers ) {
+ this.choices = _.map( choices, function( val ) {
+ if ( val.type === "separator" ) {
+ if(!(val instanceof Separator)){
+ val = new Separator(val.line);
+ }
+ return val;
+ }
+ return new Choice( val, answers );
+ });
+
+ this.realChoices = this.choices
+ .filter(Separator.exclude)
+ .filter(function( item ) {
+ return !item.disabled;
+ });
+
+ Object.defineProperty( this, "length", {
+ get: function() {
+ return this.choices.length;
+ },
+ set: function( val ) {
+ this.choices.length = val;
+ }
+ });
+
+ Object.defineProperty( this, "realLength", {
+ get: function() {
+ return this.realChoices.length;
+ },
+ set: function() {
+ throw new Error("Cannot set `realLength` of a Choices collection");
+ }
+ });
+
+ // Set pagination state
+ this.pointer = 0;
+ this.lastIndex = 0;
+}
+
+
+/**
+ * Get a valid choice from the collection
+ * @param {Number} selector The selected choice index
+ * @return {Choice|Undefined} Return the matched choice or undefined
+ */
+
+Choices.prototype.getChoice = function( selector ) {
+ if ( _.isNumber(selector) ) {
+ return this.realChoices[ selector ];
+ }
+ return undefined;
+};
+
+
+/**
+ * Get a raw element from the collection
+ * @param {Number} selector The selected index value
+ * @return {Choice|Undefined} Return the matched choice or undefined
+ */
+
+Choices.prototype.get = function( selector ) {
+ if ( _.isNumber(selector) ) {
+ return this.choices[ selector ];
+ }
+ return undefined;
+};
+
+
+/**
+ * Match the valid choices against a where clause
+ * @param {Object} whereClause Lodash `where` clause
+ * @return {Array} Matching choices or empty array
+ */
+
+Choices.prototype.where = function( whereClause ) {
+ return _.where( this.realChoices, whereClause );
+};
+
+
+/**
+ * Pluck a particular key from the choices
+ * @param {String} propertyName Property name to select
+ * @return {Array} Selected properties
+ */
+
+Choices.prototype.pluck = function( propertyName ) {
+ return _.pluck( this.realChoices, propertyName );
+};
+
+
+// Propagate usual Array methods
+Choices.prototype.forEach = function() {
+ return this.choices.forEach.apply( this.choices, arguments );
+};
+Choices.prototype.filter = function() {
+ return this.choices.filter.apply( this.choices, arguments );
+};
+Choices.prototype.push = function() {
+ var objs = _.map( arguments, function( val ) { return new Choice( val ); });
+ this.choices.push.apply( this.choices, objs );
+ this.realChoices = this.choices.filter(Separator.exclude);
+ return this.choices;
+};
+
+
+/**
+ * Render the choices as formatted string
+ * @return {String} formatted content
+ */
+
+Choices.prototype.render = function() {
+ return this.renderingMethod.apply( this, arguments );
+};
+
+
+/**
+ * Set the rendering method
+ * @param {Function} render Function to be use when rendering
+ */
+
+Choices.prototype.setRender = function( render ) {
+ this.renderingMethod = (this.choices.length > 9) ? this.paginateOutput(render) : render;
+};
+
+
+/**
+ * Paginate the output of a render function
+ * @param {Function} render Render function whose content must be paginated
+ * @return {Function} Wrapped render function
+ */
+
+Choices.prototype.paginateOutput = function( render ) {
+ var pageSize = 7;
+
+ return function( active ) {
+ var output = render.apply( this, arguments );
+ var lines = output.split("\n");
+
+ // Make sure there's enough line to paginate
+ if ( lines.length <= pageSize ) return output;
+
+ // Move the pointer only when the user go down and limit it to 3
+ if ( this.pointer < 3 && this.lastIndex < active && active - this.lastIndex < 9 ) {
+ this.pointer = Math.min( 3, this.pointer + active - this.lastIndex);
+ }
+ this.lastIndex = active;
+
+ // Duplicate the lines so it give an infinite list look
+ var infinite = _.flatten([ lines, lines, lines ]);
+ var topIndex = Math.max( 0, active + lines.length - this.pointer );
+
+ var section = infinite.splice( topIndex, pageSize ).join("\n");
+ return section + "\n" + chalk.dim("(Move up and down to reveal more choices)");
+ }.bind(this);
+};
diff --git a/tools/eslint/node_modules/inquirer/lib/objects/separator.js b/tools/eslint/node_modules/inquirer/lib/objects/separator.js
new file mode 100644
index 00000000000..eb4009bf05b
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/lib/objects/separator.js
@@ -0,0 +1,47 @@
+/**
+ * Separator object
+ * Used to space/separate choices group
+ */
+
+var chalk = require("chalk");
+var figures = require("figures");
+
+
+/**
+ * Module exports
+ */
+
+module.exports = Separator;
+
+
+/**
+ * Separator object
+ * @constructor
+ * @param {String} line Separation line content (facultative)
+ */
+
+function Separator( line ) {
+ this.type = "separator";
+ this.line = chalk.dim(line || new Array(15).join(figures.line));
+}
+
+
+/**
+ * Helper function returning false if object is a separator
+ * @param {Object} obj object to test against
+ * @return {Boolean} `false` if object is a separator
+ */
+
+Separator.exclude = function( obj ) {
+ return obj.type !== "separator";
+};
+
+
+/**
+ * Stringify separator
+ * @return {String} the separator display string
+ */
+
+Separator.prototype.toString = function() {
+ return this.line;
+};
diff --git a/tools/eslint/node_modules/inquirer/lib/prompts/base.js b/tools/eslint/node_modules/inquirer/lib/prompts/base.js
new file mode 100644
index 00000000000..34ffed83082
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/lib/prompts/base.js
@@ -0,0 +1,231 @@
+/**
+ * Base prompt implementation
+ * Should be extended by prompt types.
+ */
+
+var rx = require("rx");
+var _ = require("lodash");
+var chalk = require("chalk");
+var ansiRegex = require("ansi-regex");
+var readline = require("readline");
+var cliWidth = require("cli-width");
+var utils = require("../utils/utils");
+var Choices = require("../objects/choices");
+var tty = require("../utils/tty");
+
+/**
+ * Module exports
+ */
+
+module.exports = Prompt;
+
+
+/**
+ * Prompt constructor
+ */
+
+function Prompt( question, rl, answers ) {
+
+ // Setup instance defaults property
+ _.assign( this, {
+ height : 0,
+ status : "pending"
+ });
+
+ // Set defaults prompt options
+ this.opt = _.defaults( _.clone(question), {
+ validate: function() { return true; },
+ filter: function( val ) { return val; },
+ when: function() { return true; }
+ });
+
+ // Check to make sure prompt requirements are there
+ if (!this.opt.message) {
+ this.throwParamError("message");
+ }
+ if (!this.opt.name) {
+ this.throwParamError("name");
+ }
+
+ // Normalize choices
+ if ( _.isArray(this.opt.choices) ) {
+ this.opt.choices = new Choices( this.opt.choices, answers );
+ }
+
+ this.rl = rl;
+
+ return this;
+}
+
+_.extend( Prompt.prototype, tty );
+
+
+/**
+ * Start the Inquiry session and manage output value filtering
+ * @param {Function} cb Callback when prompt is done
+ * @return {this}
+ */
+
+Prompt.prototype.run = function( cb ) {
+ var self = this;
+ this._run(function( value ) {
+ self.filter( value, cb );
+ });
+ return this;
+};
+
+// default noop (this one should be overwritten in prompts)
+Prompt.prototype._run = function( cb ) { cb(); };
+
+
+/**
+ * Throw an error telling a required parameter is missing
+ * @param {String} name Name of the missing param
+ * @return {Throw Error}
+ */
+
+Prompt.prototype.throwParamError = function( name ) {
+ throw new Error("You must provide a `" + name + "` parameter");
+};
+
+
+/**
+ * Write error message
+ * @param {String} Error Error message
+ * @return {Prompt} Self
+ */
+
+Prompt.prototype.error = function( error ) {
+ readline.moveCursor( this.rl.output, -cliWidth(), 0 );
+ readline.clearLine( this.rl.output, 0 );
+
+ var errMsg = chalk.red(">> ") +
+ (error || "Please enter a valid value");
+ this.write( errMsg );
+
+ return this.up();
+};
+
+
+/**
+ * Write hint message
+ * @param {String} Hint Hint message
+ * @return {Prompt} Self
+ */
+
+Prompt.prototype.hint = function( hint ) {
+ readline.moveCursor( this.rl.output, -cliWidth(), 0 );
+ readline.clearLine( this.rl.output, 0 );
+
+ if ( hint.length ) {
+ var hintMsg = chalk.cyan(">> ") + hint;
+ this.write( hintMsg );
+ }
+
+ return this.up();
+};
+
+
+/**
+ * Validate a given input
+ * @param {String} value Input string
+ * @param {Function} callback Pass `true` (if input is valid) or an error message as
+ * parameter.
+ * @return {null}
+ */
+
+Prompt.prototype.validate = function( input, cb ) {
+ utils.runAsync( this.opt.validate, cb, input );
+};
+
+/**
+ * Run the provided validation method each time a submit event occur.
+ * @param {Rx.Observable} submit - submit event flow
+ * @return {Object} Object containing two observables: `success` and `error`
+ */
+Prompt.prototype.handleSubmitEvents = function( submit ) {
+ var self = this;
+ var opt = this.opt;
+ var validation = submit.flatMap(function( value ) {
+ return rx.Observable.create(function( observer ) {
+ utils.runAsync( opt.validate, function( isValid ) {
+ observer.onNext({ isValid: isValid, value: self.getCurrentValue(value) });
+ observer.onCompleted();
+ }, self.getCurrentValue(value) );
+ });
+ }).share();
+
+ var success = validation
+ .filter(function( state ) { return state.isValid === true; })
+ .take(1);
+
+ var error = validation
+ .filter(function( state ) { return state.isValid !== true; })
+ .takeUntil(success);
+
+ return {
+ success: success,
+ error: error
+ };
+};
+
+Prompt.prototype.getCurrentValue = function (value) {
+ return value;
+};
+
+/**
+ * Filter a given input before sending back
+ * @param {String} value Input string
+ * @param {Function} callback Pass the filtered input as parameter.
+ * @return {null}
+ */
+
+Prompt.prototype.filter = function( input, cb ) {
+ utils.runAsync( this.opt.filter, cb, input );
+};
+
+
+/**
+ * Return the prompt line prefix
+ * @param {String} [optionnal] String to concatenate to the prefix
+ * @return {String} prompt prefix
+ */
+
+Prompt.prototype.prefix = function( str ) {
+ str || (str = "");
+ return chalk.green("?") + " " + str;
+};
+
+
+/**
+ * Return the prompt line suffix
+ * @param {String} [optionnal] String to concatenate to the suffix
+ * @return {String} prompt suffix
+ */
+
+var reStrEnd = new RegExp("(?:" + ansiRegex().source + ")$|$");
+
+Prompt.prototype.suffix = function( str ) {
+ str || (str = "");
+ return (str.length < 1 || /[a-z1-9]$/i.test(chalk.stripColor(str)) ?
+ // make sure we get the `:` inside the styles
+ str.replace(reStrEnd, ":$&") : str).trim() + " ";
+};
+
+
+/**
+ * Generate the prompt question string
+ * @return {String} prompt question string
+ */
+
+Prompt.prototype.getQuestion = function() {
+
+ var message = _.compose(this.prefix, this.suffix)(chalk.bold(this.opt.message));
+
+ // Append the default if available, and if question isn't answered
+ if ( this.opt.default != null && this.status !== "answered" ) {
+ message += chalk.dim("("+ this.opt.default + ") ");
+ }
+
+ return message;
+};
diff --git a/tools/eslint/node_modules/inquirer/lib/prompts/checkbox.js b/tools/eslint/node_modules/inquirer/lib/prompts/checkbox.js
new file mode 100644
index 00000000000..e2737ab6f02
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/lib/prompts/checkbox.js
@@ -0,0 +1,258 @@
+/**
+ * `list` type prompt
+ */
+
+var _ = require("lodash");
+var util = require("util");
+var chalk = require("chalk");
+var Base = require("./base");
+var utils = require("../utils/utils");
+var observe = require("../utils/events");
+
+
+/**
+ * Module exports
+ */
+
+module.exports = Prompt;
+
+
+/**
+ * Constructor
+ */
+
+function Prompt() {
+ Base.apply( this, arguments );
+
+ if (!this.opt.choices) {
+ this.throwParamError("choices");
+ }
+
+ if ( _.isArray(this.opt.default) ) {
+ this.opt.choices.forEach(function( choice ) {
+ if ( this.opt.default.indexOf(choice.value) >= 0 ) {
+ choice.checked = true;
+ }
+ }, this);
+ }
+
+ this.firstRender = true;
+ this.pointer = 0;
+
+ this.opt.choices.setRender( renderChoices );
+
+ // Make sure no default is set (so it won't be printed)
+ this.opt.default = null;
+
+ return this;
+}
+util.inherits( Prompt, Base );
+
+
+/**
+ * Start the Inquiry session
+ * @param {Function} cb Callback when prompt is done
+ * @return {this}
+ */
+
+Prompt.prototype._run = function( cb ) {
+ this.done = cb;
+
+ var events = observe(this.rl);
+
+ var validation = this.handleSubmitEvents( events.line );
+ validation.success.forEach( this.onEnd.bind(this) );
+ validation.error.forEach( this.onError.bind(this) );
+
+ events.normalizedUpKey.takeUntil( validation.success ).forEach( this.onUpKey.bind(this) );
+ events.normalizedDownKey.takeUntil( validation.success ).forEach( this.onDownKey.bind(this) );
+ events.numberKey.takeUntil( validation.success ).forEach( this.onNumberKey.bind(this) );
+ events.spaceKey.takeUntil( validation.success ).forEach( this.onSpaceKey.bind(this) );
+
+ // Init the prompt
+ this.render();
+ this.hideCursor();
+
+ // Prevent user from writing
+ this.rl.output.mute();
+
+ return this;
+};
+
+
+/**
+ * Render the prompt to screen
+ * @return {Prompt} self
+ */
+
+Prompt.prototype.render = function() {
+ // Render question
+ var message = this.getQuestion();
+ var choicesStr = "\n" + this.opt.choices.render( this.pointer );
+
+ if ( this.firstRender ) {
+ message += "(Press <space> to select)";
+ }
+
+ // Render choices or answer depending on the state
+ if ( this.status === "answered" ) {
+ message += chalk.cyan( this.selection.join(", ") ) + "\n";
+ } else {
+ message += choicesStr;
+ }
+
+ this.firstRender = false;
+
+ utils.writeMessage( this, message );
+
+ return this;
+};
+
+
+/**
+ * When user press `enter` key
+ */
+
+Prompt.prototype.onEnd = function( state ) {
+ this.rl.output.unmute();
+ this.showCursor();
+
+ this.status = "answered";
+
+ // Rerender prompt (and clean subline error)
+ this.down().clean(1).render();
+
+ this.done( state.value );
+};
+
+Prompt.prototype.onError = function ( state ) {
+ this.rl.output.unmute();
+ this.showCursor();
+
+ this.down().error( state.isValid ).clean().render();
+ this.hideCursor();
+ this.rl.output.mute();
+};
+
+Prompt.prototype.getCurrentValue = function () {
+ var choices = this.opt.choices.filter(function( choice ) {
+ return !!choice.checked && !choice.disabled;
+ });
+
+ this.selection = _.pluck(choices, "name");
+ return _.pluck(choices, "value");
+};
+
+/**
+ * When user press a key
+ */
+
+Prompt.prototype.onKeypress = function( s, key ) {
+ // Only process up, down, space, j, k and 1-9 keys
+ var keyWhitelist = [ "up", "down", "space", "j", "k" ];
+ if ( key && !_.contains(keyWhitelist, key.name) ) return;
+ if ( key && (key.name === "space" || key.name === "j" || key.name === "k") ) s = undefined;
+ if ( s && "123456789".indexOf(s) < 0 ) return;
+
+ var len = this.opt.choices.realLength;
+ this.rl.output.unmute();
+
+ var shortcut = Number(s);
+ if ( shortcut <= len && shortcut > 0 ) {
+ this.pointer = shortcut - 1;
+ key = { name: "space" };
+ }
+
+ if ( key && key.name === "space" ) {
+ var checked = this.opt.choices.getChoice(this.pointer).checked;
+ this.opt.choices.getChoice(this.pointer).checked = !checked;
+ } else if ( key && (key.name === "up" || key.name === "k") ) {
+ (this.pointer > 0) ? this.pointer-- : (this.pointer = len - 1);
+ } else if ( key && (key.name === "down" || key.name === "j") ) {
+ (this.pointer < len - 1) ? this.pointer++ : (this.pointer = 0);
+ }
+
+ // Rerender
+ this.clean().render();
+
+ this.rl.output.mute();
+};
+
+Prompt.prototype.handleKeypress = function(action) {
+ this.rl.output.unmute();
+
+ action();
+
+ // Rerender
+ this.clean().render();
+
+ this.rl.output.mute();
+};
+
+Prompt.prototype.onUpKey = function() {
+ this.handleKeypress(function() {
+ var len = this.opt.choices.realLength;
+ this.pointer = (this.pointer > 0) ? this.pointer - 1 : len - 1;
+ }.bind(this));
+};
+
+Prompt.prototype.onDownKey = function() {
+ this.handleKeypress(function() {
+ var len = this.opt.choices.realLength;
+ this.pointer = (this.pointer < len - 1) ? this.pointer + 1 : 0;
+ }.bind(this));
+};
+
+Prompt.prototype.onNumberKey = function( input ) {
+ this.handleKeypress(function() {
+ if ( input <= this.opt.choices.realLength ) {
+ this.pointer = input - 1;
+ this.toggleChoice( this.pointer );
+ }
+ }.bind(this));
+};
+
+Prompt.prototype.onSpaceKey = function( input ) {
+ this.handleKeypress(function() {
+ this.toggleChoice(this.pointer);
+ }.bind(this));
+};
+
+Prompt.prototype.toggleChoice = function( index ) {
+ var checked = this.opt.choices.getChoice(index).checked;
+ this.opt.choices.getChoice(index).checked = !checked;
+};
+
+
+/**
+ * Function for rendering checkbox choices
+ * @param {Number} pointer Position of the pointer
+ * @return {String} Rendered content
+ */
+
+function renderChoices( pointer ) {
+ var output = "";
+ var separatorOffset = 0;
+
+ this.choices.forEach(function( choice, i ) {
+ if ( choice.type === "separator" ) {
+ separatorOffset++;
+ output += " " + choice + "\n";
+ return;
+ }
+
+ if ( choice.disabled ) {
+ separatorOffset++;
+ output += " - " + choice.name;
+ output += " (" + (_.isString(choice.disabled) ? choice.disabled : "Disabled") + ")";
+ } else {
+ var isSelected = (i - separatorOffset === pointer);
+ output += isSelected ? chalk.cyan(utils.getPointer()) : " ";
+ output += utils.getCheckbox( choice.checked, choice.name );
+ }
+
+ output += "\n";
+ }.bind(this));
+
+ return output.replace(/\n$/, "");
+}
diff --git a/tools/eslint/node_modules/inquirer/lib/prompts/confirm.js b/tools/eslint/node_modules/inquirer/lib/prompts/confirm.js
new file mode 100644
index 00000000000..65a6dbd8667
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/lib/prompts/confirm.js
@@ -0,0 +1,105 @@
+/**
+ * `confirm` type prompt
+ */
+
+var _ = require("lodash");
+var util = require("util");
+var chalk = require("chalk");
+var Base = require("./base");
+var utils = require("../utils/utils");
+var observe = require("../utils/events");
+
+
+/**
+ * Module exports
+ */
+
+module.exports = Prompt;
+
+
+/**
+ * Constructor
+ */
+
+function Prompt() {
+ Base.apply( this, arguments );
+
+ var rawDefault = true;
+
+ _.extend( this.opt, {
+ filter: function( input ) {
+ var value = rawDefault;
+ if ( input != null && input !== "" ) {
+ value = /^y(es)?/i.test(input);
+ }
+ return value;
+ }.bind(this)
+ });
+
+ if ( _.isBoolean(this.opt.default) ) {
+ rawDefault = this.opt.default;
+ }
+
+ this.opt.default = rawDefault ? "Y/n" : "y/N";
+
+ return this;
+}
+util.inherits( Prompt, Base );
+
+
+/**
+ * Start the Inquiry session
+ * @param {Function} cb Callback when prompt is done
+ * @return {this}
+ */
+
+Prompt.prototype._run = function( cb ) {
+ this.done = cb;
+
+ // Once user confirm (enter key)
+ var events = observe(this.rl);
+ events.keypress.takeUntil( events.line ).forEach( this.onKeypress.bind(this) );
+
+ events.line.take(1).forEach( this.onEnd.bind(this) );
+
+ // Init
+ this.render();
+
+ return this;
+};
+
+
+/**
+ * Render the prompt to screen
+ * @return {Prompt} self
+ */
+
+Prompt.prototype.render = function() {
+ var message = this.getQuestion();
+ utils.writeMessage( this, message );
+
+ return this;
+};
+
+/**
+ * When user press `enter` key
+ */
+
+Prompt.prototype.onEnd = function( input ) {
+ this.status = "answered";
+
+ var output = this.opt.filter( input );
+
+ this.clean(1).render();
+ this.write( chalk.cyan(output ? "Yes" : "No") + "\n" );
+
+ this.done( input ); // send "input" because the master class will refilter
+};
+
+/**
+ * When user press a key
+ */
+
+Prompt.prototype.onKeypress = function() {
+ this.clean().render().write( this.rl.line );
+};
diff --git a/tools/eslint/node_modules/inquirer/lib/prompts/expand.js b/tools/eslint/node_modules/inquirer/lib/prompts/expand.js
new file mode 100644
index 00000000000..6f969154ff4
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/lib/prompts/expand.js
@@ -0,0 +1,258 @@
+/**
+ * `rawlist` type prompt
+ */
+
+var _ = require("lodash");
+var util = require("util");
+var chalk = require("chalk");
+var Base = require("./base");
+var utils = require("../utils/utils");
+var Separator = require("../objects/separator");
+var observe = require("../utils/events");
+
+
+/**
+ * Module exports
+ */
+
+module.exports = Prompt;
+
+
+/**
+ * Constructor
+ */
+
+function Prompt() {
+ Base.apply( this, arguments );
+
+ if ( !this.opt.choices ) {
+ this.throwParamError("choices");
+ }
+
+ this.validateChoices( this.opt.choices );
+
+ // Add the default `help` (/expand) option
+ this.opt.choices.push({
+ key : "h",
+ name : "Help, list all options",
+ value : "help"
+ });
+
+ this.opt.choices.setRender( renderChoice );
+
+ // Setup the default string (capitalize the default key)
+ this.opt.default = this.generateChoicesString( this.opt.choices, this.opt.default );
+
+ return this;
+}
+util.inherits( Prompt, Base );
+
+
+/**
+ * Start the Inquiry session
+ * @param {Function} cb Callback when prompt is done
+ * @return {this}
+ */
+
+Prompt.prototype._run = function( cb ) {
+ this.done = cb;
+
+ // Save user answer and update prompt to show selected option.
+ var events = observe(this.rl);
+ this.lineObs = events.line.forEach( this.onSubmit.bind(this) );
+ this.keypressObs = events.keypress.forEach( this.onKeypress.bind(this) );
+
+ // Init the prompt
+ this.render();
+
+ return this;
+};
+
+
+/**
+ * Render the prompt to screen
+ * @return {Prompt} self
+ */
+
+Prompt.prototype.render = function() {
+
+ // Render question
+ var message = this.getQuestion();
+
+ if ( this.status === "answered" ) {
+ message += chalk.cyan( this.selected.name ) + "\n";
+ } else if ( this.status === "expanded" ) {
+ message += this.opt.choices.render( this.selectedKey );
+ message += "\n Answer: ";
+ }
+
+ utils.writeMessage( this, message );
+
+ return this;
+};
+
+
+/**
+ * Generate the prompt choices string
+ * @return {String} Choices string
+ */
+
+Prompt.prototype.getChoices = function() {
+ var output = "";
+
+ this.opt.choices.forEach(function( choice, i ) {
+ output += "\n ";
+
+ if ( choice.type === "separator" ) {
+ output += " " + choice;
+ return;
+ }
+
+ var choiceStr = choice.key + ") " + choice.name;
+ if ( this.selectedKey === choice.key ) {
+ choiceStr = chalk.cyan( choiceStr );
+ }
+ output += choiceStr;
+ }.bind(this));
+
+ return output;
+};
+
+
+/**
+ * When user press `enter` key
+ */
+
+Prompt.prototype.onSubmit = function( input ) {
+ if ( input == null || input === "" ) {
+ input = this.rawDefault;
+ }
+
+ var selected = this.opt.choices.where({ key : input.toLowerCase() })[0];
+
+ if ( selected != null && selected.key === "h" ) {
+ this.selectedKey = "";
+ this.status = "expanded";
+ this.down().clean(2).render();
+ return;
+ }
+
+ if ( selected != null ) {
+ this.status = "answered";
+ this.selected = selected;
+
+ // Re-render prompt
+ this.down().clean(2).render();
+
+ this.lineObs.dispose();
+ this.keypressObs.dispose();
+ this.done( this.selected.value );
+ return;
+ }
+
+ // Input is invalid
+ this
+ .error("Please enter a valid command")
+ .clean()
+ .render();
+};
+
+
+/**
+ * When user press a key
+ */
+
+Prompt.prototype.onKeypress = function( s, key ) {
+ this.selectedKey = this.rl.line.toLowerCase();
+ var selected = this.opt.choices.where({ key : this.selectedKey })[0];
+ this.cacheCursorPos();
+ if ( this.status === "expanded" ) {
+ this.clean().render();
+ } else {
+ this
+ .down()
+ .hint( selected ? selected.name : "" )
+ .clean()
+ .render();
+ }
+
+ this.write( this.rl.line ).restoreCursorPos();
+};
+
+
+/**
+ * Validate the choices
+ * @param {Array} choices
+ */
+
+Prompt.prototype.validateChoices = function( choices ) {
+ var formatError;
+ var errors = [];
+ var keymap = {};
+ choices.filter(Separator.exclude).map(function( choice ) {
+ if ( !choice.key || choice.key.length !== 1 ) {
+ formatError = true;
+ }
+ if ( keymap[choice.key] ) {
+ errors.push(choice.key);
+ }
+ keymap[ choice.key ] = true;
+ choice.key = String( choice.key ).toLowerCase();
+ });
+
+ if ( formatError ) {
+ throw new Error("Format error: `key` param must be a single letter and is required.");
+ }
+ if ( keymap.h ) {
+ throw new Error("Reserved key error: `key` param cannot be `h` - this value is reserved.");
+ }
+ if ( errors.length ) {
+ throw new Error( "Duplicate key error: `key` param must be unique. Duplicates: " +
+ _.uniq(errors).join(", ") );
+ }
+};
+
+/**
+ * Generate a string out of the choices keys
+ * @param {Array} choices
+ * @param {Number} defaultIndex - the choice index to capitalize
+ * @return {String} The rendered choices key string
+ */
+Prompt.prototype.generateChoicesString = function( choices, defaultIndex ) {
+ var defIndex = 0;
+ if ( _.isNumber(defaultIndex) && this.opt.choices.getChoice(defaultIndex) ) {
+ defIndex = defaultIndex;
+ }
+ var defStr = this.opt.choices.pluck("key");
+ this.rawDefault = defStr[ defIndex ];
+ defStr[ defIndex ] = String( defStr[defIndex] ).toUpperCase();
+ return defStr.join("");
+};
+
+
+/**
+ * Function for rendering checkbox choices
+ * @param {String} pointer Selected key
+ * @return {String} Rendered content
+ */
+
+function renderChoice( pointer ) {
+ var output = "";
+
+ this.choices.forEach(function( choice, i ) {
+ output += "\n ";
+
+ if ( choice.type === "separator" ) {
+ output += " " + choice;
+ return;
+ }
+
+ var choiceStr = choice.key + ") " + choice.name;
+ if ( pointer === choice.key ) {
+ choiceStr = chalk.cyan( choiceStr );
+ }
+ output += choiceStr;
+ }.bind(this));
+
+ return output;
+}
diff --git a/tools/eslint/node_modules/inquirer/lib/prompts/input.js b/tools/eslint/node_modules/inquirer/lib/prompts/input.js
new file mode 100644
index 00000000000..78e04ab60bc
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/lib/prompts/input.js
@@ -0,0 +1,106 @@
+/**
+ * `input` type prompt
+ */
+
+var _ = require("lodash");
+var util = require("util");
+var chalk = require("chalk");
+var Base = require("./base");
+var utils = require("../utils/utils");
+var observe = require("../utils/events");
+
+
+/**
+ * Module exports
+ */
+
+module.exports = Prompt;
+
+
+/**
+ * Constructor
+ */
+
+function Prompt() {
+ return Base.apply( this, arguments );
+}
+util.inherits( Prompt, Base );
+
+
+/**
+ * Start the Inquiry session
+ * @param {Function} cb Callback when prompt is done
+ * @return {this}
+ */
+
+Prompt.prototype._run = function( cb ) {
+ this.done = cb;
+
+ // Once user confirm (enter key)
+ var events = observe(this.rl);
+ var submit = events.line.map( this.filterInput.bind(this) );
+
+ var validation = this.handleSubmitEvents( submit );
+ validation.success.forEach( this.onEnd.bind(this) );
+ validation.error.forEach( this.onError.bind(this) );
+
+ events.keypress.takeUntil( validation.success ).forEach( this.onKeypress.bind(this) );
+
+ // Init
+ this.render();
+
+ return this;
+};
+
+
+/**
+ * Render the prompt to screen
+ * @return {Prompt} self
+ */
+
+Prompt.prototype.render = function() {
+ var message = this.getQuestion();
+ utils.writeMessage( this, message );
+
+ return this;
+};
+
+
+/**
+ * When user press `enter` key
+ */
+
+Prompt.prototype.filterInput = function( input ) {
+ if ( !input ) {
+ return this.opt.default != null ? this.opt.default : "";
+ }
+ return input;
+};
+
+Prompt.prototype.onEnd = function( state ) {
+ this.filter( state.value, function( filteredValue ) {
+ this.status = "answered";
+
+ // Re-render prompt
+ this.clean(1).render();
+
+ // Render answer
+ this.write( chalk.cyan(filteredValue) + "\n" );
+
+ this.done( state.value );
+ }.bind(this));
+};
+
+Prompt.prototype.onError = function( state ) {
+ this.error( state.isValid ).clean().render();
+};
+
+/**
+ * When user press a key
+ */
+
+Prompt.prototype.onKeypress = function() {
+ this.cacheCursorPos();
+ this.clean().render().write( this.rl.line );
+ this.restoreCursorPos();
+};
diff --git a/tools/eslint/node_modules/inquirer/lib/prompts/list.js b/tools/eslint/node_modules/inquirer/lib/prompts/list.js
new file mode 100644
index 00000000000..e5e7c177e47
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/lib/prompts/list.js
@@ -0,0 +1,194 @@
+/**
+ * `list` type prompt
+ */
+
+var _ = require("lodash");
+var util = require("util");
+var chalk = require("chalk");
+var Base = require("./base");
+var utils = require("../utils/utils");
+var observe = require("../utils/events");
+
+
+/**
+ * Module exports
+ */
+
+module.exports = Prompt;
+
+
+/**
+ * Constructor
+ */
+
+function Prompt() {
+ Base.apply( this, arguments );
+
+ if (!this.opt.choices) {
+ this.throwParamError("choices");
+ }
+
+ this.firstRender = true;
+ this.selected = 0;
+
+ var def = this.opt.default;
+
+ // Default being a Number
+ if ( _.isNumber(def) && def >= 0 && def < this.opt.choices.realLength ) {
+ this.selected = def;
+ }
+
+ // Default being a String
+ if ( _.isString(def) ) {
+ this.selected = this.opt.choices.pluck("value").indexOf( def );
+ }
+
+ this.opt.choices.setRender( listRender );
+
+ // Make sure no default is set (so it won't be printed)
+ this.opt.default = null;
+
+ return this;
+}
+util.inherits( Prompt, Base );
+
+
+/**
+ * Start the Inquiry session
+ * @param {Function} cb Callback when prompt is done
+ * @return {this}
+ */
+
+Prompt.prototype._run = function( cb ) {
+ this.done = cb;
+
+ var events = observe(this.rl);
+ events.normalizedUpKey.takeUntil( events.line ).forEach( this.onUpKey.bind(this) );
+ events.normalizedDownKey.takeUntil( events.line ).forEach( this.onDownKey.bind(this) );
+ events.numberKey.takeUntil( events.line ).forEach( this.onNumberKey.bind(this) );
+ events.line.take(1).forEach( this.onSubmit.bind(this) );
+
+ // Init the prompt
+ this.render();
+ this.hideCursor();
+
+ // Prevent user from writing
+ this.rl.output.mute();
+
+ return this;
+};
+
+
+/**
+ * Render the prompt to screen
+ * @return {Prompt} self
+ */
+
+Prompt.prototype.render = function() {
+
+ // Render question
+ var message = this.getQuestion();
+ var choicesStr = "\n" + this.opt.choices.render( this.selected );
+
+ if ( this.firstRender ) {
+ message += chalk.dim( "(Use arrow keys)" );
+ }
+
+ // Render choices or answer depending on the state
+ if ( this.status === "answered" ) {
+ message += chalk.cyan( this.opt.choices.getChoice(this.selected).name ) + "\n";
+ } else {
+ message += choicesStr;
+ }
+
+ this.firstRender = false;
+
+ utils.writeMessage( this, message );
+
+ return this;
+};
+
+
+/**
+ * When user press `enter` key
+ */
+
+Prompt.prototype.onSubmit = function() {
+ var choice = this.opt.choices.getChoice( this.selected );
+ this.status = "answered";
+
+ // Rerender prompt
+ this.rl.output.unmute();
+ this.clean().render();
+
+ this.showCursor();
+
+ this.done( choice.value );
+};
+
+
+/**
+ * When user press a key
+ */
+
+Prompt.prototype.handleKeypress = function(action) {
+ this.rl.output.unmute();
+
+ action();
+
+ // Rerender
+ this.clean().render();
+
+ this.rl.output.mute();
+};
+
+Prompt.prototype.onUpKey = function() {
+ this.handleKeypress(function() {
+ var len = this.opt.choices.realLength;
+ this.selected = (this.selected > 0) ? this.selected - 1 : len - 1;
+ }.bind(this));
+};
+
+Prompt.prototype.onDownKey = function() {
+ this.handleKeypress(function() {
+ var len = this.opt.choices.realLength;
+ this.selected = (this.selected < len - 1) ? this.selected + 1 : 0;
+ }.bind(this));
+};
+
+Prompt.prototype.onNumberKey = function( input ) {
+ this.handleKeypress(function() {
+ if ( input <= this.opt.choices.realLength ) {
+ this.selected = input - 1;
+ }
+ }.bind(this));
+};
+
+
+/**
+ * Function for rendering list choices
+ * @param {Number} pointer Position of the pointer
+ * @return {String} Rendered content
+ */
+
+function listRender( pointer ) {
+ var output = "";
+ var separatorOffset = 0;
+
+ this.choices.forEach(function( choice, i ) {
+ if ( choice.type === "separator" ) {
+ separatorOffset++;
+ output += " " + choice + "\n";
+ return;
+ }
+
+ var isSelected = (i - separatorOffset === pointer);
+ var line = (isSelected ? utils.getPointer() + " " : " ") + choice.name;
+ if ( isSelected ) {
+ line = chalk.cyan( line );
+ }
+ output += line + " \n";
+ }.bind(this));
+
+ return output.replace(/\n$/, "");
+}
diff --git a/tools/eslint/node_modules/inquirer/lib/prompts/password.js b/tools/eslint/node_modules/inquirer/lib/prompts/password.js
new file mode 100644
index 00000000000..6994dcc2241
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/lib/prompts/password.js
@@ -0,0 +1,153 @@
+/**
+ * `password` type prompt
+ */
+
+var _ = require("lodash");
+var util = require("util");
+var chalk = require("chalk");
+var Base = require("./base");
+var utils = require("../utils/utils");
+var observe = require("../utils/events");
+
+/**
+ * Module exports
+ */
+
+module.exports = Prompt;
+
+
+/**
+ * Constructor
+ */
+
+function Prompt() {
+ return Base.apply( this, arguments );
+}
+util.inherits( Prompt, Base );
+
+
+/**
+ * Start the Inquiry session
+ * @param {Function} cb Callback when prompt is done
+ * @return {this}
+ */
+
+Prompt.prototype._run = function( cb ) {
+ this.done = cb;
+
+ var events = observe(this.rl);
+
+ // Once user confirm (enter key)
+ var submit = events.line.map( this.filterInput.bind(this) );
+
+ var validation = this.handleSubmitEvents( submit );
+ validation.success.forEach( this.onEnd.bind(this) );
+ validation.error.forEach( this.onError.bind(this) );
+
+ events.keypress.takeUntil( validation.success ).forEach( this.onKeypress.bind(this) );
+
+ // Init
+ this.render();
+ this.rl.output.mute();
+
+ return this;
+};
+
+
+/**
+ * Render the prompt to screen
+ * @return {Prompt} self
+ */
+
+Prompt.prototype.render = function() {
+ var message = this.getQuestion();
+ utils.writeMessage( this, message );
+
+ return this;
+};
+
+
+/**
+ * When user press `enter` key
+ */
+
+Prompt.prototype.onSubmit = function( input ) {
+ var value = input;
+ if ( !value ) {
+ var value = this.opt.default != null ? this.opt.default : "";
+ }
+
+ this.rl.output.unmute();
+ this.write("\n"); // manually output the line return as the readline was muted
+
+ this.validate( value, function( isValid ) {
+ if ( isValid === true ) {
+ this.status = "answered";
+
+ // Re-render prompt
+ this.clean(1).render();
+
+ // Mask answer
+ var mask = new Array( value.toString().length + 1 ).join("*");
+
+ // Render answer
+ this.write( chalk.cyan(mask) + "\n" );
+
+ this.lineObs.dispose();
+ this.keypressObs.dispose();
+ this.done( value );
+ } else {
+ this.error( isValid ).clean().render();
+ this.rl.output.mute();
+ }
+ }.bind(this));
+};
+
+/**
+ * When user press `enter` key
+ */
+
+Prompt.prototype.filterInput = function( input ) {
+ if ( !input ) {
+ return this.opt.default != null ? this.opt.default : "";
+ }
+ return input;
+};
+
+Prompt.prototype.onEnd = function( state ) {
+ this.rl.output.unmute();
+ this.write("\n"); // manually output the line return as the readline was muted
+
+ this.status = "answered";
+
+ // Re-render prompt
+ this.clean(1).render();
+
+ // Mask answer
+ var mask = new Array( state.value.toString().length + 1 ).join("*");
+
+ // Render answer
+ this.write( chalk.cyan(mask) + "\n" );
+
+ this.done( state.value );
+};
+
+Prompt.prototype.onError = function( state ) {
+ this.rl.output.unmute();
+ this.write("\n"); // manually output the line return as the readline was muted
+
+ this.error( state.isValid ).clean().render();
+ this.rl.output.mute();
+};
+
+/**
+ * When user type
+ */
+
+Prompt.prototype.onKeypress = function() {
+ this.rl.output.unmute();
+ this.cacheCursorPos().clean().render();
+ var mask = new Array( this.rl.line.length + 1 ).join("*");
+ this.write(mask).restoreCursorPos();
+ this.rl.output.mute();
+};
diff --git a/tools/eslint/node_modules/inquirer/lib/prompts/rawlist.js b/tools/eslint/node_modules/inquirer/lib/prompts/rawlist.js
new file mode 100644
index 00000000000..18247cfb9f5
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/lib/prompts/rawlist.js
@@ -0,0 +1,191 @@
+/**
+ * `rawlist` type prompt
+ */
+
+var _ = require("lodash");
+var util = require("util");
+var chalk = require("chalk");
+var Base = require("./base");
+var utils = require("../utils/utils");
+var Separator = require("../objects/separator");
+var observe = require("../utils/events");
+
+
+/**
+ * Module exports
+ */
+
+module.exports = Prompt;
+
+
+/**
+ * Constructor
+ */
+
+function Prompt() {
+ Base.apply( this, arguments );
+
+ if (!this.opt.choices) {
+ this.throwParamError("choices");
+ }
+
+ this.opt.validChoices = this.opt.choices.filter(Separator.exclude);
+
+ this.selected = 0;
+ this.rawDefault = 0;
+
+ this.opt.choices.setRender( renderChoices );
+
+ _.extend(this.opt, {
+ validate: function( index ) {
+ return this.opt.choices.getChoice( index ) != null;
+ }.bind(this)
+ });
+
+ var def = this.opt.default;
+ if ( _.isNumber(def) && def >= 0 && def < this.opt.choices.realLength ) {
+ this.selected = this.rawDefault = def;
+ }
+
+ // Make sure no default is set (so it won't be printed)
+ this.opt.default = null;
+
+ return this;
+}
+util.inherits( Prompt, Base );
+
+
+/**
+ * Start the Inquiry session
+ * @param {Function} cb Callback when prompt is done
+ * @return {this}
+ */
+
+Prompt.prototype._run = function( cb ) {
+ this.done = cb;
+
+ // Once user confirm (enter key)
+ var events = observe(this.rl);
+ var submit = events.line.map( this.filterInput.bind(this) );
+
+ var validation = this.handleSubmitEvents( submit );
+ validation.success.forEach( this.onEnd.bind(this) );
+ validation.error.forEach( this.onError.bind(this) );
+
+ events.keypress.takeUntil( validation.success ).forEach( this.onKeypress.bind(this) );
+
+ // Init the prompt
+ this.render();
+
+ return this;
+};
+
+
+/**
+ * Render the prompt to screen
+ * @return {Prompt} self
+ */
+
+Prompt.prototype.render = function() {
+ // Render question
+ var message = this.getQuestion();
+ var choicesStr = this.opt.choices.render( this.selected );
+
+ if ( this.status === "answered" ) {
+ message += chalk.cyan(this.opt.choices.getChoice(this.selected).name) + "\n";
+ } else {
+ message += choicesStr;
+ message += "\n Answer: ";
+ }
+
+ utils.writeMessage( this, message );
+
+ return this;
+};
+
+/**
+ * When user press `enter` key
+ */
+
+Prompt.prototype.filterInput = function( input ) {
+ if ( input == null || input === "" ) {
+ return this.rawDefault;
+ } else {
+ return input - 1;
+ }
+};
+
+Prompt.prototype.onEnd = function( state ) {
+ this.status = "answered";
+ this.selected = state.value;
+
+ var selectedChoice = this.opt.choices.getChoice( this.selected );
+
+ // Re-render prompt
+ this.down().clean(2).render();
+
+ this.done( selectedChoice.value );
+};
+
+Prompt.prototype.onError = function() {
+ this.hasError = true;
+ this
+ .error("Please enter a valid index")
+ .clean()
+ .render();
+};
+
+/**
+ * When user press a key
+ */
+
+Prompt.prototype.onKeypress = function() {
+ var index = this.rl.line.length ? Number(this.rl.line) - 1 : 0;
+
+ if ( this.opt.choices.getChoice(index) ) {
+ this.selected = index;
+ } else {
+ this.selected = undefined;
+ }
+
+ this.cacheCursorPos();
+
+ if ( this.hasError ) {
+ this.down().clean(1);
+ } else {
+ this.clean();
+ }
+
+ this.render().write( this.rl.line ).restoreCursorPos();
+};
+
+
+/**
+ * Function for rendering list choices
+ * @param {Number} pointer Position of the pointer
+ * @return {String} Rendered content
+ */
+
+function renderChoices( pointer ) {
+ var output = "";
+ var separatorOffset = 0;
+
+ this.choices.forEach(function( choice, i ) {
+ output += "\n ";
+
+ if ( choice.type === "separator" ) {
+ separatorOffset++;
+ output += " " + choice;
+ return;
+ }
+
+ var index = i - separatorOffset;
+ var display = (index + 1) + ") " + choice.name;
+ if ( index === pointer ) {
+ display = chalk.cyan( display );
+ }
+ output += display;
+ }.bind(this));
+
+ return output;
+}
diff --git a/tools/eslint/node_modules/inquirer/lib/ui/baseUI.js b/tools/eslint/node_modules/inquirer/lib/ui/baseUI.js
new file mode 100644
index 00000000000..d1a2452c094
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/lib/ui/baseUI.js
@@ -0,0 +1,83 @@
+/**
+ * Base interface class other can inherits from
+ */
+
+var _ = require("lodash");
+var tty = require("../utils/tty");
+var readlineFacade = require("readline2");
+
+
+/**
+ * Module exports
+ */
+
+module.exports = UI;
+
+/**
+ * Constructor
+ */
+
+function UI( opt ) {
+ // Instantiate the Readline interface
+ // @Note: Don't reassign if already present (allow test to override the Stream)
+ this.rl || (this.rl = readlineFacade.createInterface());
+ this.rl.resume();
+
+ this.onForceClose = this.onForceClose.bind(this);
+ this.onKeypress = this.onKeypress.bind(this);
+
+ // Make sure new prompt start on a newline when closing
+ this.rl.on( "SIGINT", this.onForceClose );
+ process.on( "exit", this.onForceClose );
+
+ // Propagate keypress events directly on the readline
+ process.stdin.addListener( "keypress", this.onKeypress );
+}
+_.extend( UI.prototype, tty );
+
+
+/**
+ * Handle the ^C exit
+ * @return {null}
+ */
+
+UI.prototype.onForceClose = function() {
+ this.close();
+ console.log("\n"); // Line return
+};
+
+
+/**
+ * Close the interface and cleanup listeners
+ */
+
+UI.prototype.close = function() {
+ // Remove events listeners
+ this.rl.removeListener( "SIGINT", this.onForceClose );
+ process.stdin.removeListener( "keypress", this.onKeypress );
+ process.removeListener( "exit", this.onForceClose );
+
+ // Restore prompt functionnalities
+ this.rl.output.unmute();
+ process.stdout.write("\x1B[?25h"); // show cursor
+
+ // Close the readline
+ this.rl.output.end();
+ this.rl.pause();
+ this.rl.close();
+ this.rl = null;
+};
+
+
+/**
+ * Handle and propagate keypress events
+ */
+
+UI.prototype.onKeypress = function( s, key ) {
+ // Ignore `enter` key (readline `line` event is the only one we care for)
+ if ( key && (key.name === "enter" || key.name === "return") ) return;
+
+ if ( this.rl ) {
+ this.rl.emit( "keypress", s, key );
+ }
+};
diff --git a/tools/eslint/node_modules/inquirer/lib/ui/bottom-bar.js b/tools/eslint/node_modules/inquirer/lib/ui/bottom-bar.js
new file mode 100644
index 00000000000..838741dcaed
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/lib/ui/bottom-bar.js
@@ -0,0 +1,77 @@
+/**
+ * Sticky bottom bar user interface
+ */
+
+var util = require("util");
+var through = require("through");
+var Base = require("./baseUI");
+var utils = require("../utils/utils");
+
+
+/**
+ * Module exports
+ */
+
+module.exports = Prompt;
+
+/**
+ * Constructor
+ */
+
+function Prompt( opt ) {
+ opt || (opt = {});
+
+ Base.apply( this, arguments );
+
+ this.log = through( this.writeLog.bind(this) );
+ this.bottomBar = opt.bottomBar || "";
+ this.render();
+}
+util.inherits( Prompt, Base );
+
+
+/**
+ * Render the prompt to screen
+ * @return {Prompt} self
+ */
+
+Prompt.prototype.render = function() {
+ utils.writeMessage ( this, this.bottomBar );
+
+ return this;
+};
+
+
+/**
+ * Update the bottom bar content and rerender
+ * @param {String} bottomBar Bottom bar content
+ * @return {Prompt} self
+ */
+
+Prompt.prototype.updateBottomBar = function( bottomBar ) {
+ this.bottomBar = bottomBar;
+ return this.clean().render();
+};
+
+
+/**
+ * Rerender the prompt
+ * @return {Prompt} self
+ */
+
+Prompt.prototype.writeLog = function( data ) {
+ this.clean();
+ this.write.call( this, this.enforceLF(data.toString()) );
+ return this.render();
+};
+
+
+/**
+ * Make sure line end on a line feed
+ * @param {String} str Input string
+ * @return {String} The input string with a final line feed
+ */
+
+Prompt.prototype.enforceLF = function( str ) {
+ return str.match(/[\r\n]$/) ? str : str + "\n";
+};
diff --git a/tools/eslint/node_modules/inquirer/lib/ui/prompt.js b/tools/eslint/node_modules/inquirer/lib/ui/prompt.js
new file mode 100644
index 00000000000..7139169ef3d
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/lib/ui/prompt.js
@@ -0,0 +1,136 @@
+/**
+ * Base interface class other can inherits from
+ */
+
+var _ = require("lodash");
+var rx = require("rx");
+var util = require("util");
+var utils = require("../utils/utils");
+var Base = require("./baseUI");
+
+var inquirer = require("../inquirer");
+
+
+/**
+ * Module exports
+ */
+
+module.exports = PromptUI;
+
+
+/**
+ * Constructor
+ */
+
+function PromptUI( prompts ) {
+ Base.call(this);
+ this.prompts = prompts;
+}
+util.inherits( PromptUI, Base );
+
+PromptUI.prototype.run = function( questions, allDone ) {
+ // Keep global reference to the answers
+ this.answers = {};
+ this.completed = allDone;
+
+ // Make sure questions is an array.
+ if ( _.isPlainObject(questions) ) {
+ questions = [questions];
+ }
+
+ // Create an observable, unless we received one as parameter.
+ // Note: As this is a public interface, we cannot do an instanceof check as we won't
+ // be using the exact same object in memory.
+ var obs = _.isArray( questions ) ? rx.Observable.fromArray( questions ) : questions;
+
+ // Start running the questions
+ this.process = obs.concatMap( this.processQuestion.bind(this) );
+
+ this.process.forEach(
+ function() {},
+ function( err ) {
+ throw err;
+ },
+ this.onCompletion.bind(this)
+ );
+
+ return this.process;
+};
+
+
+/**
+ * Once all prompt are over
+ */
+
+PromptUI.prototype.onCompletion = function() {
+ this.close();
+
+ if ( _.isFunction(this.completed) ) {
+ this.completed( this.answers );
+ }
+};
+
+PromptUI.prototype.processQuestion = function( question ) {
+ return rx.Observable.defer(function() {
+ var obs = rx.Observable.create(function(obs) {
+ obs.onNext( question );
+ obs.onCompleted();
+ });
+
+ return obs
+ .concatMap( this.setDefaultType.bind(this) )
+ .concatMap( this.filterIfRunnable.bind(this) )
+ .concatMap( utils.fetchAsyncQuestionProperty.bind( null, question, "message", this.answers ) )
+ .concatMap( utils.fetchAsyncQuestionProperty.bind( null, question, "default", this.answers ) )
+ .concatMap( utils.fetchAsyncQuestionProperty.bind( null, question, "choices", this.answers ) )
+ .concatMap( this.fetchAnswer.bind(this) );
+ }.bind(this));
+};
+
+PromptUI.prototype.fetchAnswer = function( question ) {
+ var Prompt = this.prompts[question.type];
+ var prompt = new Prompt( question, this.rl, this.answers );
+ var answers = this.answers;
+ return utils.createObservableFromAsync(function() {
+ var done = this.async();
+ prompt.run(function( answer ) {
+ answers[question.name] = answer;
+ done({ name: question.name, answer: answer });
+ });
+ });
+};
+
+PromptUI.prototype.setDefaultType = function( question ) {
+ // Default type to input
+ if ( !this.prompts[question.type] ) {
+ question.type = "input";
+ }
+ return rx.Observable.defer(function() {
+ return rx.Observable.return( question );
+ });
+};
+
+PromptUI.prototype.filterIfRunnable = function( question ) {
+ if ( question.when == null ) return rx.Observable.return(question);
+
+ var handleResult = function( obs, shouldRun ) {
+ if ( shouldRun ) {
+ obs.onNext( question );
+ }
+ obs.onCompleted();
+ };
+
+ var answers = this.answers;
+ return rx.Observable.defer(function() {
+ return rx.Observable.create(function( obs ) {
+ if ( _.isBoolean(question.when) ) {
+ handleResult( obs, question.when );
+ return;
+ }
+
+ utils.runAsync( question.when, function( shouldRun ) {
+ handleResult( obs, shouldRun );
+ }, answers );
+ });
+ });
+};
diff --git a/tools/eslint/node_modules/inquirer/lib/utils/events.js b/tools/eslint/node_modules/inquirer/lib/utils/events.js
new file mode 100644
index 00000000000..0778d51c783
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/lib/utils/events.js
@@ -0,0 +1,32 @@
+var rx = require("rx");
+
+function normalizeKeypressEvents(args) {
+ return { value: args[0], key: args[1] };
+}
+
+module.exports = function(rl) {
+ return {
+ line: rx.Observable.fromEvent(rl, "line"),
+
+ keypress: rx.Observable.fromEvent(rl, "keypress", normalizeKeypressEvents),
+
+ normalizedUpKey: rx.Observable.fromEvent(rl, "keypress", normalizeKeypressEvents).filter(function (e) {
+ return e.key && (e.key.name === "up" || e.key.name === "k");
+ }).share(),
+
+ normalizedDownKey: rx.Observable.fromEvent(rl, "keypress", normalizeKeypressEvents).filter(function (e) {
+ return e.key && (e.key.name === "down" || e.key.name === "j");
+ }).share(),
+
+ numberKey: rx.Observable.fromEvent(rl, "keypress", normalizeKeypressEvents).filter(function (e) {
+ return e.value && "123456789".indexOf(e.value) >= 0;
+ }).map(function(e) {
+ return Number(e.value);
+ }).share(),
+
+ spaceKey: rx.Observable.fromEvent(rl, "keypress", normalizeKeypressEvents).filter(function (e) {
+ return e.key && e.key.name === "space";
+ }).share(),
+
+ };
+};
diff --git a/tools/eslint/node_modules/inquirer/lib/utils/tty.js b/tools/eslint/node_modules/inquirer/lib/utils/tty.js
new file mode 100644
index 00000000000..a1c0c5c6385
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/lib/utils/tty.js
@@ -0,0 +1,130 @@
+/**
+ * TTY mixin helpers
+ */
+
+var _ = require("lodash");
+var readline = require("readline");
+var cliWidth = require("cli-width");
+
+var tty = module.exports;
+
+
+/**
+ * Remove the prompt from screen
+ * @param {Number} Extra lines to remove (probably to compensate the "enter" key line
+ * return)
+ * @return {Prompt} self
+ */
+
+tty.clean = function( extra ) {
+ _.isNumber(extra) || (extra = 0);
+ var len = this.height + extra;
+
+ while ( len-- ) {
+ readline.moveCursor(this.rl.output, -cliWidth(), 0);
+ readline.clearLine(this.rl.output, 0);
+ if ( len ) readline.moveCursor(this.rl.output, 0, -1);
+ }
+ return this;
+};
+
+
+/**
+ * Move cursor down by `x`
+ * @param {Number} x How far to go down (default to 1)
+ * @return {Prompt} self
+ */
+
+tty.down = function( x ) {
+ _.isNumber(x) || (x = 1);
+
+ // @bug: Write new lines instead of moving cursor as unix system don't allocate a new
+ // line when the cursor is moved over there.
+ while ( x-- ) {
+ this.write("\n");
+ }
+
+ return this;
+};
+
+
+/**
+ * Move cursor up by `x`
+ * @param {Number} x How far to go up (default to 1)
+ * @return {Prompt} self
+ */
+
+tty.up = function( x ) {
+ _.isNumber(x) || (x = 1);
+ readline.moveCursor( this.rl.output, 0, -x );
+ return this;
+};
+
+/**
+ * Move cursor left by `x`
+ * @param {Number} x How far to go left (default to 1)
+ * @return {Prompt} self
+ */
+
+tty.left = function( x ) {
+ _.isNumber(x) || (x = 1);
+ readline.moveCursor (this.rl.output, -x, 0);
+ return this;
+};
+
+
+/**
+ * Write a string to the stdout
+ * @return {Self}
+ */
+
+tty.write = function( str ) {
+ this.rl.output.write( str );
+ return this;
+};
+
+
+/**
+ * Hide cursor
+ * @return {Prompt} self
+ */
+
+tty.hideCursor = function() {
+ return this.write("\x1B[?25l");
+};
+
+
+/**
+ * Show cursor
+ * @return {Prompt} self
+ */
+
+tty.showCursor = function() {
+ return this.write("\x1B[?25h");
+};
+
+
+/**
+ * Remember the cursor position
+ * @return {Prompt} Self
+ */
+
+tty.cacheCursorPos = function() {
+ this.cursorPos = this.rl._getCursorPos();
+ return this;
+};
+
+
+/**
+ * Restore the cursor position to where it has been previously stored.
+ * @return {Prompt} Self
+ */
+
+tty.restoreCursorPos = function() {
+ if ( !this.cursorPos ) return;
+ var line = this.rl._prompt + this.rl.line;
+ readline.moveCursor(this.rl.output, -line.length, 0);
+ readline.moveCursor(this.rl.output, this.cursorPos.cols, 0);
+ this.cursorPos = null;
+ return this;
+};
diff --git a/tools/eslint/node_modules/inquirer/lib/utils/utils.js b/tools/eslint/node_modules/inquirer/lib/utils/utils.js
new file mode 100644
index 00000000000..a91e108667a
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/lib/utils/utils.js
@@ -0,0 +1,123 @@
+/**
+ * Utility functions
+ */
+
+"use strict";
+var _ = require("lodash");
+var chalk = require("chalk");
+var rx = require("rx");
+var figures = require("figures");
+
+
+/**
+ * Module exports
+ */
+
+var utils = module.exports;
+
+
+/**
+ * Run a function asynchronously or synchronously
+ * @param {Function} func Function to run
+ * @param {Function} cb Callback function passed the `func` returned value
+ * @...rest {Mixed} rest Arguments to pass to `func`
+ * @return {Null}
+ */
+
+utils.runAsync = function( func, cb ) {
+ var async = false;
+ var isValid = func.apply({
+ async: function() {
+ async = true;
+ return _.once(cb);
+ }
+ }, Array.prototype.slice.call(arguments, 2) );
+
+ if ( !async ) {
+ cb(isValid);
+ }
+};
+
+
+/**
+ * Create an oversable returning the result of a function runned in sync or async mode.
+ * @param {Function} func Function to run
+ * @return {rx.Observable} Observable emitting when value is known
+ */
+
+utils.createObservableFromAsync = function( func ) {
+ return rx.Observable.defer(function() {
+ return rx.Observable.create(function( obs ) {
+ utils.runAsync( func, function( value ) {
+ obs.onNext( value );
+ obs.onCompleted();
+ });
+ });
+ });
+};
+
+
+/**
+ * Resolve a question property value if it is passed as a function.
+ * This method will overwrite the property on the question object with the received value.
+ * @param {Object} question - Question object
+ * @param {String} prop - Property to fetch name
+ * @param {Object} answers - Answers object
+ * @...rest {Mixed} rest - Arguments to pass to `func`
+ * @return {rx.Obsersable} - Observable emitting once value is known
+ */
+
+utils.fetchAsyncQuestionProperty = function( question, prop, answers ) {
+ if ( !_.isFunction(question[prop]) ) return rx.Observable.return(question);
+
+ return utils.createObservableFromAsync(function() {
+ var done = this.async();
+ utils.runAsync( question[prop], function( value ) {
+ question[prop] = value;
+ done( question );
+ }, answers );
+ });
+};
+
+
+/**
+ * Get the pointer char
+ * @return {String} the pointer char
+ */
+
+utils.getPointer = function() {
+ return figures.pointer;
+};
+
+
+/**
+ * Get the checkbox
+ * @param {Boolean} checked - add a X or not to the checkbox
+ * @param {String} after - Text to append after the check char
+ * @return {String} - Composited checkbox string
+ */
+
+utils.getCheckbox = function( checked, after ) {
+ var checked = checked ? chalk.green( figures.radioOn ) : figures.radioOff;
+ return checked + " " + ( after || "" );
+};
+
+/**
+ * Helper for writing message in Prompt
+ * @param {Prompt} prompt - The Prompt object that extends tty
+ * @param {String} message - The message to be output
+ */
+utils.writeMessage = function ( prompt, message ) {
+ var msgLines = message.split(/\n/);
+ prompt.height = msgLines.length;
+
+ // Write message to screen and setPrompt to control backspace
+ prompt.rl.setPrompt( _.last(msgLines) );
+
+ if ( process.stdout.rows === 0 && process.stdout.columns === 0 ) {
+ /* When it's a tty through serial port there's no terminal info and the render will malfunction,
+ so we need enforce the cursor to locate to the leftmost position for rendering. */
+ prompt.left( message.length + prompt.rl.line.length );
+ }
+ prompt.write( message );
+};
diff --git a/tools/eslint/node_modules/inquirer/node_modules/ansi-regex/index.js b/tools/eslint/node_modules/inquirer/node_modules/ansi-regex/index.js
new file mode 100644
index 00000000000..2fcdd1e472f
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/ansi-regex/index.js
@@ -0,0 +1,4 @@
+'use strict';
+module.exports = function () {
+ return /(?:(?:\u001b\[)|\u009b)(?:(?:[0-9]{1,3})?(?:(?:;[0-9]{0,3})*)?[A-M|f-m])|\u001b[A-M]/g;
+};
diff --git a/tools/eslint/node_modules/inquirer/node_modules/ansi-regex/license b/tools/eslint/node_modules/inquirer/node_modules/ansi-regex/license
new file mode 100644
index 00000000000..654d0bfe943
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/ansi-regex/license
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/tools/eslint/node_modules/inquirer/node_modules/ansi-regex/package.json b/tools/eslint/node_modules/inquirer/node_modules/ansi-regex/package.json
new file mode 100644
index 00000000000..3ce9ccdb878
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/ansi-regex/package.json
@@ -0,0 +1,86 @@
+{
+ "name": "ansi-regex",
+ "version": "1.1.1",
+ "description": "Regular expression for matching ANSI escape codes",
+ "license": "MIT",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/sindresorhus/ansi-regex.git"
+ },
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "http://sindresorhus.com"
+ },
+ "maintainers": [
+ {
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
+ },
+ {
+ "name": "jbnicolai",
+ "email": "jappelman@xebia.com"
+ }
+ ],
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "scripts": {
+ "test": "mocha test/test.js",
+ "view-supported": "node test/viewCodes.js"
+ },
+ "files": [
+ "index.js"
+ ],
+ "keywords": [
+ "ansi",
+ "styles",
+ "color",
+ "colour",
+ "colors",
+ "terminal",
+ "console",
+ "cli",
+ "string",
+ "tty",
+ "escape",
+ "formatting",
+ "rgb",
+ "256",
+ "shell",
+ "xterm",
+ "command-line",
+ "text",
+ "regex",
+ "regexp",
+ "re",
+ "match",
+ "test",
+ "find",
+ "pattern"
+ ],
+ "devDependencies": {
+ "mocha": "*"
+ },
+ "gitHead": "47fb974630af70998157b30fad6eb5e5bd7c7cd6",
+ "bugs": {
+ "url": "https://github.com/sindresorhus/ansi-regex/issues"
+ },
+ "homepage": "https://github.com/sindresorhus/ansi-regex",
+ "_id": "ansi-regex@1.1.1",
+ "_shasum": "41c847194646375e6a1a5d10c3ca054ef9fc980d",
+ "_from": "ansi-regex@>=1.1.1 <2.0.0",
+ "_npmVersion": "2.1.16",
+ "_nodeVersion": "0.10.35",
+ "_npmUser": {
+ "name": "jbnicolai",
+ "email": "jappelman@xebia.com"
+ },
+ "dist": {
+ "shasum": "41c847194646375e6a1a5d10c3ca054ef9fc980d",
+ "tarball": "http://registry.npmjs.org/ansi-regex/-/ansi-regex-1.1.1.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-1.1.1.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/tools/eslint/node_modules/inquirer/node_modules/ansi-regex/readme.md b/tools/eslint/node_modules/inquirer/node_modules/ansi-regex/readme.md
new file mode 100644
index 00000000000..ae876e7292f
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/ansi-regex/readme.md
@@ -0,0 +1,33 @@
+# ansi-regex [![Build Status](https://travis-ci.org/sindresorhus/ansi-regex.svg?branch=master)](https://travis-ci.org/sindresorhus/ansi-regex)
+
+> Regular expression for matching [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code)
+
+
+## Install
+
+```sh
+$ npm install --save ansi-regex
+```
+
+
+## Usage
+
+```js
+var ansiRegex = require('ansi-regex');
+
+ansiRegex().test('\u001b[4mcake\u001b[0m');
+//=> true
+
+ansiRegex().test('cake');
+//=> false
+
+'\u001b[4mcake\u001b[0m'.match(ansiRegex());
+//=> ['\u001b[4m', '\u001b[0m']
+```
+
+*It's a function so you can create multiple instances. Regexes with the global flag will have the `.lastIndex` property changed for each call to methods on the instance. Therefore reusing the instance with multiple calls will not work as expected for `.test()`.*
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/tools/eslint/node_modules/inquirer/node_modules/cli-width/.npmignore b/tools/eslint/node_modules/inquirer/node_modules/cli-width/.npmignore
new file mode 100644
index 00000000000..73ecdc8a12a
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/cli-width/.npmignore
@@ -0,0 +1,3 @@
+node_modules
+*.log
+*.swp
diff --git a/tools/eslint/node_modules/inquirer/node_modules/cli-width/README.md b/tools/eslint/node_modules/inquirer/node_modules/cli-width/README.md
new file mode 100644
index 00000000000..050280efd01
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/cli-width/README.md
@@ -0,0 +1,28 @@
+cli-width
+=========
+
+Get stdout window width, with two fallbacks, `tty` and then a default.
+
+## Usage
+
+```
+npm install --save cli-width
+```
+
+```js
+'use stict';
+
+var cliWidth = require('cli-width');
+
+cliWidth(); // maybe 204 :)
+```
+
+If none of the methods are supported, the default is `0` and
+can be changed via `cliWidth.defaultWidth = 200;`.
+
+## Tests
+
+```bash
+npm install
+npm test
+```
diff --git a/tools/eslint/node_modules/inquirer/node_modules/cli-width/index.js b/tools/eslint/node_modules/inquirer/node_modules/cli-width/index.js
new file mode 100644
index 00000000000..1299c319053
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/cli-width/index.js
@@ -0,0 +1,20 @@
+'use strict';
+
+exports = module.exports = cliWidth;
+exports.defaultWidth = 0;
+
+function cliWidth() {
+ if (process.stdout.getWindowSize) {
+ return process.stdout.getWindowSize()[0];
+ }
+ else {
+ var tty = require('tty');
+
+ if (tty.getWindowSize) {
+ return tty.getWindowSize()[1];
+ }
+ else {
+ return exports.defaultWidth;
+ }
+ }
+};
diff --git a/tools/eslint/node_modules/inquirer/node_modules/cli-width/package.json b/tools/eslint/node_modules/inquirer/node_modules/cli-width/package.json
new file mode 100644
index 00000000000..0006924e147
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/cli-width/package.json
@@ -0,0 +1,49 @@
+{
+ "name": "cli-width",
+ "version": "1.0.1",
+ "description": "Get stdout window width, with two fallbacks, tty and then a default.",
+ "main": "index.js",
+ "scripts": {
+ "test": "node test | tap-spec"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+ssh://git@github.com/knownasilya/cli-width.git"
+ },
+ "author": {
+ "name": "Ilya Radchenko",
+ "email": "ilya@burstcreations.com"
+ },
+ "license": "ISC",
+ "bugs": {
+ "url": "https://github.com/knownasilya/cli-width/issues"
+ },
+ "homepage": "https://github.com/knownasilya/cli-width",
+ "devDependencies": {
+ "tap-spec": "^2.2.0",
+ "tape": "^3.4.0"
+ },
+ "gitHead": "4448d9599eee5a85da34e24baad39cfddfc1d807",
+ "_id": "cli-width@1.0.1",
+ "_shasum": "14d4f6870234d91e97f7dd81e76be8271410a1ef",
+ "_from": "cli-width@>=1.0.1 <2.0.0",
+ "_npmVersion": "2.1.2",
+ "_nodeVersion": "0.10.26",
+ "_npmUser": {
+ "name": "knownasilya",
+ "email": "ilya@burstcreations.com"
+ },
+ "maintainers": [
+ {
+ "name": "knownasilya",
+ "email": "ilya@burstcreations.com"
+ }
+ ],
+ "dist": {
+ "shasum": "14d4f6870234d91e97f7dd81e76be8271410a1ef",
+ "tarball": "http://registry.npmjs.org/cli-width/-/cli-width-1.0.1.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/cli-width/-/cli-width-1.0.1.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/tools/eslint/node_modules/inquirer/node_modules/cli-width/test/index.js b/tools/eslint/node_modules/inquirer/node_modules/cli-width/test/index.js
new file mode 100644
index 00000000000..acccd386177
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/cli-width/test/index.js
@@ -0,0 +1,40 @@
+'use strict';
+
+var tty = require('tty');
+var test = require('tape');
+var lib = require('../');
+
+
+test('uses process.stdout.getWindowSize', function (t) {
+ // mock stdout.getWindowSize
+ process.stdout.getWindowSize = function () {
+ return [100];
+ };
+
+ t.equal(lib(), 100, 'equal to mocked, 100');
+ t.end();
+});
+
+test('uses tty.getWindowSize', function (t) {
+ process.stdout.getWindowSize = undefined;
+ tty.getWindowSize = function () {
+ return [3, 5];
+ };
+
+ t.equal(lib(), 5, 'equal to mocked, 5');
+ t.end();
+});
+
+test('uses default', function (t) {
+ tty.getWindowSize = undefined;
+
+ t.equal(lib(), 0, 'default unset value, 0');
+ t.end();
+});
+
+test('uses overridden default', function (t) {
+ lib.defaultWidth = 10;
+
+ t.equal(lib(), 10, 'user-set default value, 10');
+ t.end();
+});
diff --git a/tools/eslint/node_modules/inquirer/node_modules/figures/index.js b/tools/eslint/node_modules/inquirer/node_modules/figures/index.js
new file mode 100644
index 00000000000..3083de17c6e
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/figures/index.js
@@ -0,0 +1,87 @@
+'use strict';
+var platform = process.platform;
+
+var main = {
+ tick: '✔',
+ cross: '✖',
+ star: '★',
+ square: '▇',
+ squareSmall: '◻',
+ squareSmallFilled: '◼',
+ circle: '◯',
+ circleFilled: '◉',
+ circleDotted: '◌',
+ circleDouble: '◎',
+ circleCircle: 'ⓞ',
+ circleCross: 'ⓧ',
+ circlePipe: 'Ⓘ',
+ circleQuestionMark: '?⃝',
+ bullet: '●',
+ dot: '․',
+ line: '─',
+ ellipsis: '…',
+ pointer: '❯',
+ info: 'ℹ',
+ warning: '⚠',
+ hamburger: '☰',
+ smiley: '㋡',
+ mustache: '෴',
+ heart: '♥',
+ arrowUp: '↑',
+ arrowDown: '↓',
+ arrowLeft: '←',
+ arrowRight: '→',
+ radioOn: '◉',
+ radioOff: '◯',
+ checkboxOn: '☒',
+ checkboxOff: '☐',
+ checkboxCircleOn: 'ⓧ',
+ checkboxCircleOff: 'Ⓘ',
+ questionMarkPrefix: '?⃝',
+};
+
+var win = {
+ tick: '√',
+ cross: '×',
+ star: '*',
+ square: '█',
+ squareSmall: '[ ]',
+ squareSmallFilled: '[█]',
+ circle: '( )',
+ circleFilled: '(*)',
+ circleDotted: '( )',
+ circleDouble: '( )',
+ circleCircle: '(○)',
+ circleCross: '(×)',
+ circlePipe: '(│)',
+ circleQuestionMark: '(?)',
+ bullet: '*',
+ dot: '.',
+ line: '─',
+ ellipsis: '...',
+ pointer: '>',
+ info: 'i',
+ warning: '‼',
+ hamburger: '≡',
+ smiley: '☺',
+ mustache: '┌─┐',
+ heart: main.heart,
+ arrowUp: main.arrowUp,
+ arrowDown: main.arrowDown,
+ arrowLeft: main.arrowLeft,
+ arrowRight: main.arrowRight,
+ radioOn: '(*)',
+ radioOff: '( )',
+ checkboxOn: '[×]',
+ checkboxOff: '[ ]',
+ checkboxCircleOn: '(×)',
+ checkboxCircleOff: '( )',
+ questionMarkPrefix: '?'
+};
+
+if (platform === 'linux') {
+ // the main one doesn't look that good on Ubuntu
+ main.questionMarkPrefix = '?';
+}
+
+module.exports = platform === 'win32' ? win : main;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/figures/package.json b/tools/eslint/node_modules/inquirer/node_modules/figures/package.json
new file mode 100644
index 00000000000..bf9d5d0c297
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/figures/package.json
@@ -0,0 +1,67 @@
+{
+ "name": "figures",
+ "version": "1.3.5",
+ "description": "Unicode symbols with Windows CMD fallbacks",
+ "license": "MIT",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/sindresorhus/figures.git"
+ },
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "http://sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "scripts": {
+ "test": "node test.js"
+ },
+ "files": [
+ "index.js"
+ ],
+ "keywords": [
+ "unicode",
+ "cli",
+ "cmd",
+ "command-line",
+ "characters",
+ "char",
+ "symbol",
+ "symbols",
+ "figure",
+ "figures",
+ "fallback"
+ ],
+ "devDependencies": {
+ "ava": "0.0.4"
+ },
+ "gitHead": "5dd6a2d3320c904b69e5d59ee9c5099fa1cd6f1e",
+ "bugs": {
+ "url": "https://github.com/sindresorhus/figures/issues"
+ },
+ "homepage": "https://github.com/sindresorhus/figures",
+ "_id": "figures@1.3.5",
+ "_shasum": "d1a31f4e1d2c2938ecde5c06aa16134cf29f4771",
+ "_from": "figures@>=1.3.5 <2.0.0",
+ "_npmVersion": "2.1.5",
+ "_nodeVersion": "0.10.32",
+ "_npmUser": {
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
+ }
+ ],
+ "dist": {
+ "shasum": "d1a31f4e1d2c2938ecde5c06aa16134cf29f4771",
+ "tarball": "http://registry.npmjs.org/figures/-/figures-1.3.5.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/figures/-/figures-1.3.5.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/tools/eslint/node_modules/inquirer/node_modules/figures/readme.md b/tools/eslint/node_modules/inquirer/node_modules/figures/readme.md
new file mode 100644
index 00000000000..839a309ee0c
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/figures/readme.md
@@ -0,0 +1,34 @@
+# figures [![Build Status](https://travis-ci.org/sindresorhus/figures.svg?branch=master)](https://travis-ci.org/sindresorhus/figures)
+
+> Unicode symbols with Windows CMD fallbacks
+
+[![](screenshot.png)](index.js)
+
+[*and more...*](index.js)
+
+Windows CMD only supports a [limited character set](http://en.wikipedia.org/wiki/Code_page_437).
+
+
+## Install
+
+```sh
+$ npm install --save figures
+```
+
+
+## Usage
+
+See the [source](index.js) for supported symbols.
+
+```js
+var figures = require('figures');
+
+console.log(figures.tick);
+// On real OSes: ✔︎
+// On Windows: √
+```
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/LICENSE.txt b/tools/eslint/node_modules/inquirer/node_modules/lodash/LICENSE.txt
new file mode 100644
index 00000000000..9cd87e5dcef
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/LICENSE.txt
@@ -0,0 +1,22 @@
+Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
+Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas,
+DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/README.md b/tools/eslint/node_modules/inquirer/node_modules/lodash/README.md
new file mode 100644
index 00000000000..cd0fe0cebb7
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/README.md
@@ -0,0 +1,120 @@
+# lodash v3.9.3
+
+The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash](https://lodash.com/) exported as [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) modules.
+
+Generated using [lodash-cli](https://www.npmjs.com/package/lodash-cli):
+```bash
+$ lodash modularize modern exports=node -o ./
+$ lodash modern -d -o ./index.js
+```
+
+## Installation
+
+Using npm:
+
+```bash
+$ {sudo -H} npm i -g npm
+$ npm i --save lodash
+```
+
+In Node.js/io.js:
+
+```js
+// load the modern build
+var _ = require('lodash');
+// or a method category
+var array = require('lodash/array');
+// or a method (great for smaller builds with browserify/webpack)
+var chunk = require('lodash/array/chunk');
+```
+
+See the [package source](https://github.com/lodash/lodash/tree/3.9.3-npm) for more details.
+
+**Note:**<br>
+Don’t assign values to the [special variable](http://nodejs.org/api/repl.html#repl_repl_features) `_` when in the REPL.<br>
+Install [n_](https://www.npmjs.com/package/n_) for a REPL that includes lodash by default.
+
+## Module formats
+
+lodash is also available in a variety of other builds & module formats.
+
+ * npm packages for [modern](https://www.npmjs.com/package/lodash), [compatibility](https://www.npmjs.com/package/lodash-compat), & [per method](https://www.npmjs.com/browse/keyword/lodash-modularized) builds
+ * AMD modules for [modern](https://github.com/lodash/lodash/tree/3.9.3-amd) & [compatibility](https://github.com/lodash/lodash-compat/tree/3.9.3-amd) builds
+ * ES modules for the [modern](https://github.com/lodash/lodash/tree/3.9.3-es) build
+
+## Further Reading
+
+ * [API Documentation](https://lodash.com/docs)
+ * [Build Differences](https://github.com/lodash/lodash/wiki/Build-Differences)
+ * [Changelog](https://github.com/lodash/lodash/wiki/Changelog)
+ * [Release Notes](https://github.com/lodash/lodash/releases)
+ * [Roadmap](https://github.com/lodash/lodash/wiki/Roadmap)
+ * [More Resources](https://github.com/lodash/lodash/wiki/Resources)
+
+## Features
+
+ * ~100% [code coverage](https://coveralls.io/r/lodash)
+ * Follows [semantic versioning](http://semver.org/) for releases
+ * [Lazily evaluated](http://filimanjaro.com/blog/2014/introducing-lazy-evaluation/) chaining
+ * [_(…)](https://lodash.com/docs#_) supports intuitive chaining
+ * [_.add](https://lodash.com/docs#add) for mathematical composition
+ * [_.ary](https://lodash.com/docs#ary) & [_.rearg](https://lodash.com/docs#rearg) to change function argument limits & order
+ * [_.at](https://lodash.com/docs#at) for cherry-picking collection values
+ * [_.attempt](https://lodash.com/docs#attempt) to execute functions which may error without a try-catch
+ * [_.before](https://lodash.com/docs#before) to complement [_.after](https://lodash.com/docs#after)
+ * [_.bindKey](https://lodash.com/docs#bindKey) for binding [*“lazy”*](http://michaux.ca/articles/lazy-function-definition-pattern) defined methods
+ * [_.chunk](https://lodash.com/docs#chunk) for splitting an array into chunks of a given size
+ * [_.clone](https://lodash.com/docs#clone) supports shallow cloning of `Date` & `RegExp` objects
+ * [_.cloneDeep](https://lodash.com/docs#cloneDeep) for deep cloning arrays & objects
+ * [_.curry](https://lodash.com/docs#curry) & [_.curryRight](https://lodash.com/docs#curryRight) for creating [curried](http://hughfdjackson.com/javascript/why-curry-helps/) functions
+ * [_.debounce](https://lodash.com/docs#debounce) & [_.throttle](https://lodash.com/docs#throttle) are cancelable & accept options for more control
+ * [_.fill](https://lodash.com/docs#fill) to fill arrays with values
+ * [_.findKey](https://lodash.com/docs#findKey) for finding keys
+ * [_.flow](https://lodash.com/docs#flow) to complement [_.flowRight](https://lodash.com/docs#flowRight) (a.k.a `_.compose`)
+ * [_.forEach](https://lodash.com/docs#forEach) supports exiting early
+ * [_.forIn](https://lodash.com/docs#forIn) for iterating all enumerable properties
+ * [_.forOwn](https://lodash.com/docs#forOwn) for iterating own properties
+ * [_.get](https://lodash.com/docs#get) & [_.set](https://lodash.com/docs#set) for deep property getting & setting
+ * [_.gt](https://lodash.com/docs#gt), [_.gte](https://lodash.com/docs#gte), [_.lt](https://lodash.com/docs#lt), & [_.lte](https://lodash.com/docs#lte) relational methods
+ * [_.inRange](https://lodash.com/docs#inRange) for checking whether a number is within a given range
+ * [_.isNative](https://lodash.com/docs#isNative) to check for native functions
+ * [_.isPlainObject](https://lodash.com/docs#isPlainObject) & [_.toPlainObject](https://lodash.com/docs#toPlainObject) to check for & convert to `Object` objects
+ * [_.isTypedArray](https://lodash.com/docs#isTypedArray) to check for typed arrays
+ * [_.mapKeys](https://lodash.com/docs#mapKeys) for mapping keys to an object
+ * [_.matches](https://lodash.com/docs#matches) supports deep object comparisons
+ * [_.matchesProperty](https://lodash.com/docs#matchesProperty) to complement [_.matches](https://lodash.com/docs#matches) & [_.property](https://lodash.com/docs#property)
+ * [_.method](https://lodash.com/docs#method) & [_.methodOf](https://lodash.com/docs#methodOf) to create functions that invoke methods
+ * [_.merge](https://lodash.com/docs#merge) for a deep [_.extend](https://lodash.com/docs#extend)
+ * [_.parseInt](https://lodash.com/docs#parseInt) for consistent cross-environment behavior
+ * [_.pull](https://lodash.com/docs#pull), [_.pullAt](https://lodash.com/docs#pullAt), & [_.remove](https://lodash.com/docs#remove) for mutating arrays
+ * [_.random](https://lodash.com/docs#random) supports returning floating-point numbers
+ * [_.restParam](https://lodash.com/docs#restParam) & [_.spread](https://lodash.com/docs#spread) for applying rest parameters & spreading arguments to functions
+ * [_.runInContext](https://lodash.com/docs#runInContext) for collisionless mixins & easier mocking
+ * [_.slice](https://lodash.com/docs#slice) for creating subsets of array-like values
+ * [_.sortByAll](https://lodash.com/docs#sortByAll) & [_.sortByOrder](https://lodash.com/docs#sortByOrder) for sorting by multiple properties & orders
+ * [_.sum](https://lodash.com/docs#sum) to get the sum of values
+ * [_.support](https://lodash.com/docs#support) for flagging environment features
+ * [_.template](https://lodash.com/docs#template) supports [*“imports”*](https://lodash.com/docs#templateSettings-imports) options & [ES template delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-template-literal-lexical-components)
+ * [_.transform](https://lodash.com/docs#transform) as a powerful alternative to [_.reduce](https://lodash.com/docs#reduce) for transforming objects
+ * [_.unzipWith](https://lodash.com/docs#unzipWith) & [_.zipWith](https://lodash.com/docs#zipWith) to specify how grouped values should be combined
+ * [_.xor](https://lodash.com/docs#xor) to complement [_.difference](https://lodash.com/docs#difference), [_.intersection](https://lodash.com/docs#intersection), & [_.union](https://lodash.com/docs#union)
+ * [_.valuesIn](https://lodash.com/docs#valuesIn) for getting values of all enumerable properties
+ * [_.bind](https://lodash.com/docs#bind), [_.curry](https://lodash.com/docs#curry), [_.partial](https://lodash.com/docs#partial), &
+ [more](https://lodash.com/docs "_.bindKey, _.curryRight, _.partialRight") support customizable argument placeholders
+ * [_.capitalize](https://lodash.com/docs#capitalize), [_.trim](https://lodash.com/docs#trim), &
+ [more](https://lodash.com/docs "_.camelCase, _.deburr, _.endsWith, _.escapeRegExp, _.kebabCase, _.pad, _.padLeft, _.padRight, _.repeat, _.snakeCase, _.startCase, _.startsWith, _.trimLeft, _.trimRight, _.trunc, _.words") string methods
+ * [_.clone](https://lodash.com/docs#clone), [_.isEqual](https://lodash.com/docs#isEqual), &
+ [more](https://lodash.com/docs "_.assign, _.cloneDeep, _.merge") accept customizer callbacks
+ * [_.dropWhile](https://lodash.com/docs#dropWhile), [_.takeWhile](https://lodash.com/docs#takeWhile), &
+ [more](https://lodash.com/docs "_.drop, _.dropRight, _.dropRightWhile, _.take, _.takeRight, _.takeRightWhile") to complement [_.first](https://lodash.com/docs#first), [_.initial](https://lodash.com/docs#initial), [_.last](https://lodash.com/docs#last), & [_.rest](https://lodash.com/docs#rest)
+ * [_.findLast](https://lodash.com/docs#findLast), [_.findLastKey](https://lodash.com/docs#findLastKey), &
+ [more](https://lodash.com/docs "_.curryRight, _.dropRight, _.dropRightWhile, _.flowRight, _.forEachRight, _.forInRight, _.forOwnRight, _.padRight, partialRight, _.takeRight, _.trimRight, _.takeRightWhile") right-associative methods
+ * [_.includes](https://lodash.com/docs#includes), [_.toArray](https://lodash.com/docs#toArray), &
+ [more](https://lodash.com/docs "_.at, _.countBy, _.every, _.filter, _.find, _.findLast, _.findWhere, _.forEach, _.forEachRight, _.groupBy, _.indexBy, _.invoke, _.map, _.max, _.min, _.partition, _.pluck, _.reduce, _.reduceRight, _.reject, _.shuffle, _.size, _.some, _.sortBy, _.sortByAll, _.sortByOrder, _.sum, _.where") accept strings
+ * [_#commit](https://lodash.com/docs#prototype-commit) & [_#plant](https://lodash.com/docs#prototype-plant) for working with chain sequences
+ * [_#thru](https://lodash.com/docs#thru) to pass values thru a chain sequence
+
+## Support
+
+Tested in Chrome 41-42, Firefox 37-38, IE 6-11, MS Edge, Opera 28-29, Safari 5-8, ChakraNode 0.12.2, io.js 2.1.0, Node.js 0.8.28, 0.10.38, & 0.12.4, PhantomJS 1.9.8, RingoJS 0.11, & Rhino 1.7.6
+Automated [browser](https://saucelabs.com/u/lodash) & [CI](https://travis-ci.org/lodash/lodash/) test runs are available. Special thanks to [Sauce Labs](https://saucelabs.com/) for providing automated browser testing.
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array.js
new file mode 100644
index 00000000000..e5121fa52ec
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array.js
@@ -0,0 +1,44 @@
+module.exports = {
+ 'chunk': require('./array/chunk'),
+ 'compact': require('./array/compact'),
+ 'difference': require('./array/difference'),
+ 'drop': require('./array/drop'),
+ 'dropRight': require('./array/dropRight'),
+ 'dropRightWhile': require('./array/dropRightWhile'),
+ 'dropWhile': require('./array/dropWhile'),
+ 'fill': require('./array/fill'),
+ 'findIndex': require('./array/findIndex'),
+ 'findLastIndex': require('./array/findLastIndex'),
+ 'first': require('./array/first'),
+ 'flatten': require('./array/flatten'),
+ 'flattenDeep': require('./array/flattenDeep'),
+ 'head': require('./array/head'),
+ 'indexOf': require('./array/indexOf'),
+ 'initial': require('./array/initial'),
+ 'intersection': require('./array/intersection'),
+ 'last': require('./array/last'),
+ 'lastIndexOf': require('./array/lastIndexOf'),
+ 'object': require('./array/object'),
+ 'pull': require('./array/pull'),
+ 'pullAt': require('./array/pullAt'),
+ 'remove': require('./array/remove'),
+ 'rest': require('./array/rest'),
+ 'slice': require('./array/slice'),
+ 'sortedIndex': require('./array/sortedIndex'),
+ 'sortedLastIndex': require('./array/sortedLastIndex'),
+ 'tail': require('./array/tail'),
+ 'take': require('./array/take'),
+ 'takeRight': require('./array/takeRight'),
+ 'takeRightWhile': require('./array/takeRightWhile'),
+ 'takeWhile': require('./array/takeWhile'),
+ 'union': require('./array/union'),
+ 'uniq': require('./array/uniq'),
+ 'unique': require('./array/unique'),
+ 'unzip': require('./array/unzip'),
+ 'unzipWith': require('./array/unzipWith'),
+ 'without': require('./array/without'),
+ 'xor': require('./array/xor'),
+ 'zip': require('./array/zip'),
+ 'zipObject': require('./array/zipObject'),
+ 'zipWith': require('./array/zipWith')
+};
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/chunk.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/chunk.js
new file mode 100644
index 00000000000..4de9b396184
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/chunk.js
@@ -0,0 +1,47 @@
+var baseSlice = require('../internal/baseSlice'),
+ isIterateeCall = require('../internal/isIterateeCall');
+
+/** Native method references. */
+var ceil = Math.ceil;
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max;
+
+/**
+ * Creates an array of elements split into groups the length of `size`.
+ * If `collection` can't be split evenly, the final chunk will be the remaining
+ * elements.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to process.
+ * @param {number} [size=1] The length of each chunk.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {Array} Returns the new array containing chunks.
+ * @example
+ *
+ * _.chunk(['a', 'b', 'c', 'd'], 2);
+ * // => [['a', 'b'], ['c', 'd']]
+ *
+ * _.chunk(['a', 'b', 'c', 'd'], 3);
+ * // => [['a', 'b', 'c'], ['d']]
+ */
+function chunk(array, size, guard) {
+ if (guard ? isIterateeCall(array, size, guard) : size == null) {
+ size = 1;
+ } else {
+ size = nativeMax(+size || 1, 1);
+ }
+ var index = 0,
+ length = array ? array.length : 0,
+ resIndex = -1,
+ result = Array(ceil(length / size));
+
+ while (index < length) {
+ result[++resIndex] = baseSlice(array, index, (index += size));
+ }
+ return result;
+}
+
+module.exports = chunk;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/compact.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/compact.js
new file mode 100644
index 00000000000..1dc1c55e8f1
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/compact.js
@@ -0,0 +1,30 @@
+/**
+ * Creates an array with all falsey values removed. The values `false`, `null`,
+ * `0`, `""`, `undefined`, and `NaN` are falsey.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to compact.
+ * @returns {Array} Returns the new array of filtered values.
+ * @example
+ *
+ * _.compact([0, 1, false, 2, '', 3]);
+ * // => [1, 2, 3]
+ */
+function compact(array) {
+ var index = -1,
+ length = array ? array.length : 0,
+ resIndex = -1,
+ result = [];
+
+ while (++index < length) {
+ var value = array[index];
+ if (value) {
+ result[++resIndex] = value;
+ }
+ }
+ return result;
+}
+
+module.exports = compact;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/difference.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/difference.js
new file mode 100644
index 00000000000..5049337e5f3
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/difference.js
@@ -0,0 +1,28 @@
+var baseDifference = require('../internal/baseDifference'),
+ baseFlatten = require('../internal/baseFlatten'),
+ isArrayLike = require('../internal/isArrayLike'),
+ restParam = require('../function/restParam');
+
+/**
+ * Creates an array of unique `array` values not included in the other
+ * provided arrays using [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
+ * for equality comparisons.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to inspect.
+ * @param {...Array} [values] The arrays of values to exclude.
+ * @returns {Array} Returns the new array of filtered values.
+ * @example
+ *
+ * _.difference([1, 2, 3], [4, 2]);
+ * // => [1, 3]
+ */
+var difference = restParam(function(array, values) {
+ return isArrayLike(array)
+ ? baseDifference(array, baseFlatten(values, false, true))
+ : [];
+});
+
+module.exports = difference;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/drop.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/drop.js
new file mode 100644
index 00000000000..039a0b5fdcd
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/drop.js
@@ -0,0 +1,39 @@
+var baseSlice = require('../internal/baseSlice'),
+ isIterateeCall = require('../internal/isIterateeCall');
+
+/**
+ * Creates a slice of `array` with `n` elements dropped from the beginning.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to query.
+ * @param {number} [n=1] The number of elements to drop.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {Array} Returns the slice of `array`.
+ * @example
+ *
+ * _.drop([1, 2, 3]);
+ * // => [2, 3]
+ *
+ * _.drop([1, 2, 3], 2);
+ * // => [3]
+ *
+ * _.drop([1, 2, 3], 5);
+ * // => []
+ *
+ * _.drop([1, 2, 3], 0);
+ * // => [1, 2, 3]
+ */
+function drop(array, n, guard) {
+ var length = array ? array.length : 0;
+ if (!length) {
+ return [];
+ }
+ if (guard ? isIterateeCall(array, n, guard) : n == null) {
+ n = 1;
+ }
+ return baseSlice(array, n < 0 ? 0 : n);
+}
+
+module.exports = drop;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/dropRight.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/dropRight.js
new file mode 100644
index 00000000000..14b5eb6f0a1
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/dropRight.js
@@ -0,0 +1,40 @@
+var baseSlice = require('../internal/baseSlice'),
+ isIterateeCall = require('../internal/isIterateeCall');
+
+/**
+ * Creates a slice of `array` with `n` elements dropped from the end.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to query.
+ * @param {number} [n=1] The number of elements to drop.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {Array} Returns the slice of `array`.
+ * @example
+ *
+ * _.dropRight([1, 2, 3]);
+ * // => [1, 2]
+ *
+ * _.dropRight([1, 2, 3], 2);
+ * // => [1]
+ *
+ * _.dropRight([1, 2, 3], 5);
+ * // => []
+ *
+ * _.dropRight([1, 2, 3], 0);
+ * // => [1, 2, 3]
+ */
+function dropRight(array, n, guard) {
+ var length = array ? array.length : 0;
+ if (!length) {
+ return [];
+ }
+ if (guard ? isIterateeCall(array, n, guard) : n == null) {
+ n = 1;
+ }
+ n = length - (+n || 0);
+ return baseSlice(array, 0, n < 0 ? 0 : n);
+}
+
+module.exports = dropRight;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/dropRightWhile.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/dropRightWhile.js
new file mode 100644
index 00000000000..be158bd5fa9
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/dropRightWhile.js
@@ -0,0 +1,59 @@
+var baseCallback = require('../internal/baseCallback'),
+ baseWhile = require('../internal/baseWhile');
+
+/**
+ * Creates a slice of `array` excluding elements dropped from the end.
+ * Elements are dropped until `predicate` returns falsey. The predicate is
+ * bound to `thisArg` and invoked with three arguments: (value, index, array).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that match the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to query.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {Array} Returns the slice of `array`.
+ * @example
+ *
+ * _.dropRightWhile([1, 2, 3], function(n) {
+ * return n > 1;
+ * });
+ * // => [1]
+ *
+ * var users = [
+ * { 'user': 'barney', 'active': true },
+ * { 'user': 'fred', 'active': false },
+ * { 'user': 'pebbles', 'active': false }
+ * ];
+ *
+ * // using the `_.matches` callback shorthand
+ * _.pluck(_.dropRightWhile(users, { 'user': 'pebbles', 'active': false }), 'user');
+ * // => ['barney', 'fred']
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.pluck(_.dropRightWhile(users, 'active', false), 'user');
+ * // => ['barney']
+ *
+ * // using the `_.property` callback shorthand
+ * _.pluck(_.dropRightWhile(users, 'active'), 'user');
+ * // => ['barney', 'fred', 'pebbles']
+ */
+function dropRightWhile(array, predicate, thisArg) {
+ return (array && array.length)
+ ? baseWhile(array, baseCallback(predicate, thisArg, 3), true, true)
+ : [];
+}
+
+module.exports = dropRightWhile;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/dropWhile.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/dropWhile.js
new file mode 100644
index 00000000000..d9eabae9fac
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/dropWhile.js
@@ -0,0 +1,59 @@
+var baseCallback = require('../internal/baseCallback'),
+ baseWhile = require('../internal/baseWhile');
+
+/**
+ * Creates a slice of `array` excluding elements dropped from the beginning.
+ * Elements are dropped until `predicate` returns falsey. The predicate is
+ * bound to `thisArg` and invoked with three arguments: (value, index, array).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to query.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {Array} Returns the slice of `array`.
+ * @example
+ *
+ * _.dropWhile([1, 2, 3], function(n) {
+ * return n < 3;
+ * });
+ * // => [3]
+ *
+ * var users = [
+ * { 'user': 'barney', 'active': false },
+ * { 'user': 'fred', 'active': false },
+ * { 'user': 'pebbles', 'active': true }
+ * ];
+ *
+ * // using the `_.matches` callback shorthand
+ * _.pluck(_.dropWhile(users, { 'user': 'barney', 'active': false }), 'user');
+ * // => ['fred', 'pebbles']
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.pluck(_.dropWhile(users, 'active', false), 'user');
+ * // => ['pebbles']
+ *
+ * // using the `_.property` callback shorthand
+ * _.pluck(_.dropWhile(users, 'active'), 'user');
+ * // => ['barney', 'fred', 'pebbles']
+ */
+function dropWhile(array, predicate, thisArg) {
+ return (array && array.length)
+ ? baseWhile(array, baseCallback(predicate, thisArg, 3), true)
+ : [];
+}
+
+module.exports = dropWhile;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/fill.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/fill.js
new file mode 100644
index 00000000000..2c8f6da71d0
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/fill.js
@@ -0,0 +1,44 @@
+var baseFill = require('../internal/baseFill'),
+ isIterateeCall = require('../internal/isIterateeCall');
+
+/**
+ * Fills elements of `array` with `value` from `start` up to, but not
+ * including, `end`.
+ *
+ * **Note:** This method mutates `array`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to fill.
+ * @param {*} value The value to fill `array` with.
+ * @param {number} [start=0] The start position.
+ * @param {number} [end=array.length] The end position.
+ * @returns {Array} Returns `array`.
+ * @example
+ *
+ * var array = [1, 2, 3];
+ *
+ * _.fill(array, 'a');
+ * console.log(array);
+ * // => ['a', 'a', 'a']
+ *
+ * _.fill(Array(3), 2);
+ * // => [2, 2, 2]
+ *
+ * _.fill([4, 6, 8], '*', 1, 2);
+ * // => [4, '*', 8]
+ */
+function fill(array, value, start, end) {
+ var length = array ? array.length : 0;
+ if (!length) {
+ return [];
+ }
+ if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
+ start = 0;
+ end = length;
+ }
+ return baseFill(array, value, start, end);
+}
+
+module.exports = fill;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/findIndex.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/findIndex.js
new file mode 100644
index 00000000000..2a6b8e14bac
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/findIndex.js
@@ -0,0 +1,53 @@
+var createFindIndex = require('../internal/createFindIndex');
+
+/**
+ * This method is like `_.find` except that it returns the index of the first
+ * element `predicate` returns truthy for instead of the element itself.
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to search.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {number} Returns the index of the found element, else `-1`.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'active': false },
+ * { 'user': 'fred', 'active': false },
+ * { 'user': 'pebbles', 'active': true }
+ * ];
+ *
+ * _.findIndex(users, function(chr) {
+ * return chr.user == 'barney';
+ * });
+ * // => 0
+ *
+ * // using the `_.matches` callback shorthand
+ * _.findIndex(users, { 'user': 'fred', 'active': false });
+ * // => 1
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.findIndex(users, 'active', false);
+ * // => 0
+ *
+ * // using the `_.property` callback shorthand
+ * _.findIndex(users, 'active');
+ * // => 2
+ */
+var findIndex = createFindIndex();
+
+module.exports = findIndex;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/findLastIndex.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/findLastIndex.js
new file mode 100644
index 00000000000..d6d8eca6df7
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/findLastIndex.js
@@ -0,0 +1,53 @@
+var createFindIndex = require('../internal/createFindIndex');
+
+/**
+ * This method is like `_.findIndex` except that it iterates over elements
+ * of `collection` from right to left.
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to search.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {number} Returns the index of the found element, else `-1`.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'active': true },
+ * { 'user': 'fred', 'active': false },
+ * { 'user': 'pebbles', 'active': false }
+ * ];
+ *
+ * _.findLastIndex(users, function(chr) {
+ * return chr.user == 'pebbles';
+ * });
+ * // => 2
+ *
+ * // using the `_.matches` callback shorthand
+ * _.findLastIndex(users, { 'user': 'barney', 'active': true });
+ * // => 0
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.findLastIndex(users, 'active', false);
+ * // => 2
+ *
+ * // using the `_.property` callback shorthand
+ * _.findLastIndex(users, 'active');
+ * // => 0
+ */
+var findLastIndex = createFindIndex(true);
+
+module.exports = findLastIndex;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/first.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/first.js
new file mode 100644
index 00000000000..b3b9c79c7bb
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/first.js
@@ -0,0 +1,22 @@
+/**
+ * Gets the first element of `array`.
+ *
+ * @static
+ * @memberOf _
+ * @alias head
+ * @category Array
+ * @param {Array} array The array to query.
+ * @returns {*} Returns the first element of `array`.
+ * @example
+ *
+ * _.first([1, 2, 3]);
+ * // => 1
+ *
+ * _.first([]);
+ * // => undefined
+ */
+function first(array) {
+ return array ? array[0] : undefined;
+}
+
+module.exports = first;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/flatten.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/flatten.js
new file mode 100644
index 00000000000..65bbeefb775
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/flatten.js
@@ -0,0 +1,32 @@
+var baseFlatten = require('../internal/baseFlatten'),
+ isIterateeCall = require('../internal/isIterateeCall');
+
+/**
+ * Flattens a nested array. If `isDeep` is `true` the array is recursively
+ * flattened, otherwise it is only flattened a single level.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to flatten.
+ * @param {boolean} [isDeep] Specify a deep flatten.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {Array} Returns the new flattened array.
+ * @example
+ *
+ * _.flatten([1, [2, 3, [4]]]);
+ * // => [1, 2, 3, [4]]
+ *
+ * // using `isDeep`
+ * _.flatten([1, [2, 3, [4]]], true);
+ * // => [1, 2, 3, 4]
+ */
+function flatten(array, isDeep, guard) {
+ var length = array ? array.length : 0;
+ if (guard && isIterateeCall(array, isDeep, guard)) {
+ isDeep = false;
+ }
+ return length ? baseFlatten(array, isDeep) : [];
+}
+
+module.exports = flatten;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/flattenDeep.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/flattenDeep.js
new file mode 100644
index 00000000000..9f775febe2a
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/flattenDeep.js
@@ -0,0 +1,21 @@
+var baseFlatten = require('../internal/baseFlatten');
+
+/**
+ * Recursively flattens a nested array.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to recursively flatten.
+ * @returns {Array} Returns the new flattened array.
+ * @example
+ *
+ * _.flattenDeep([1, [2, 3, [4]]]);
+ * // => [1, 2, 3, 4]
+ */
+function flattenDeep(array) {
+ var length = array ? array.length : 0;
+ return length ? baseFlatten(array, true) : [];
+}
+
+module.exports = flattenDeep;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/head.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/head.js
new file mode 100644
index 00000000000..1961b08c7eb
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/head.js
@@ -0,0 +1 @@
+module.exports = require('./first');
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/indexOf.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/indexOf.js
new file mode 100644
index 00000000000..f8f6c9fc2cd
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/indexOf.js
@@ -0,0 +1,54 @@
+var baseIndexOf = require('../internal/baseIndexOf'),
+ binaryIndex = require('../internal/binaryIndex');
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max;
+
+/**
+ * Gets the index at which the first occurrence of `value` is found in `array`
+ * using [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
+ * for equality comparisons. If `fromIndex` is negative, it is used as the offset
+ * from the end of `array`. If `array` is sorted providing `true` for `fromIndex`
+ * performs a faster binary search.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to search.
+ * @param {*} value The value to search for.
+ * @param {boolean|number} [fromIndex=0] The index to search from or `true`
+ * to perform a binary search on a sorted array.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ * @example
+ *
+ * _.indexOf([1, 2, 1, 2], 2);
+ * // => 1
+ *
+ * // using `fromIndex`
+ * _.indexOf([1, 2, 1, 2], 2, 2);
+ * // => 3
+ *
+ * // performing a binary search
+ * _.indexOf([1, 1, 2, 2], 2, true);
+ * // => 2
+ */
+function indexOf(array, value, fromIndex) {
+ var length = array ? array.length : 0;
+ if (!length) {
+ return -1;
+ }
+ if (typeof fromIndex == 'number') {
+ fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex;
+ } else if (fromIndex) {
+ var index = binaryIndex(array, value),
+ other = array[index];
+
+ if (value === value ? (value === other) : (other !== other)) {
+ return index;
+ }
+ return -1;
+ }
+ return baseIndexOf(array, value, fromIndex || 0);
+}
+
+module.exports = indexOf;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/initial.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/initial.js
new file mode 100644
index 00000000000..59b7a7d96df
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/initial.js
@@ -0,0 +1,20 @@
+var dropRight = require('./dropRight');
+
+/**
+ * Gets all but the last element of `array`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to query.
+ * @returns {Array} Returns the slice of `array`.
+ * @example
+ *
+ * _.initial([1, 2, 3]);
+ * // => [1, 2]
+ */
+function initial(array) {
+ return dropRight(array, 1);
+}
+
+module.exports = initial;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/intersection.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/intersection.js
new file mode 100644
index 00000000000..ec5b7f9b6ce
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/intersection.js
@@ -0,0 +1,58 @@
+var baseIndexOf = require('../internal/baseIndexOf'),
+ cacheIndexOf = require('../internal/cacheIndexOf'),
+ createCache = require('../internal/createCache'),
+ isArrayLike = require('../internal/isArrayLike'),
+ restParam = require('../function/restParam');
+
+/**
+ * Creates an array of unique values that are included in all of the provided
+ * arrays using [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
+ * for equality comparisons.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {...Array} [arrays] The arrays to inspect.
+ * @returns {Array} Returns the new array of shared values.
+ * @example
+ * _.intersection([1, 2], [4, 2], [2, 1]);
+ * // => [2]
+ */
+var intersection = restParam(function(arrays) {
+ var othLength = arrays.length,
+ othIndex = othLength,
+ caches = Array(length),
+ indexOf = baseIndexOf,
+ isCommon = true,
+ result = [];
+
+ while (othIndex--) {
+ var value = arrays[othIndex] = isArrayLike(value = arrays[othIndex]) ? value : [];
+ caches[othIndex] = (isCommon && value.length >= 120) ? createCache(othIndex && value) : null;
+ }
+ var array = arrays[0],
+ index = -1,
+ length = array ? array.length : 0,
+ seen = caches[0];
+
+ outer:
+ while (++index < length) {
+ value = array[index];
+ if ((seen ? cacheIndexOf(seen, value) : indexOf(result, value, 0)) < 0) {
+ var othIndex = othLength;
+ while (--othIndex) {
+ var cache = caches[othIndex];
+ if ((cache ? cacheIndexOf(cache, value) : indexOf(arrays[othIndex], value, 0)) < 0) {
+ continue outer;
+ }
+ }
+ if (seen) {
+ seen.push(value);
+ }
+ result.push(value);
+ }
+ }
+ return result;
+});
+
+module.exports = intersection;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/last.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/last.js
new file mode 100644
index 00000000000..299af3146ca
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/last.js
@@ -0,0 +1,19 @@
+/**
+ * Gets the last element of `array`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to query.
+ * @returns {*} Returns the last element of `array`.
+ * @example
+ *
+ * _.last([1, 2, 3]);
+ * // => 3
+ */
+function last(array) {
+ var length = array ? array.length : 0;
+ return length ? array[length - 1] : undefined;
+}
+
+module.exports = last;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/lastIndexOf.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/lastIndexOf.js
new file mode 100644
index 00000000000..02b806269bd
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/lastIndexOf.js
@@ -0,0 +1,60 @@
+var binaryIndex = require('../internal/binaryIndex'),
+ indexOfNaN = require('../internal/indexOfNaN');
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max,
+ nativeMin = Math.min;
+
+/**
+ * This method is like `_.indexOf` except that it iterates over elements of
+ * `array` from right to left.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to search.
+ * @param {*} value The value to search for.
+ * @param {boolean|number} [fromIndex=array.length-1] The index to search from
+ * or `true` to perform a binary search on a sorted array.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ * @example
+ *
+ * _.lastIndexOf([1, 2, 1, 2], 2);
+ * // => 3
+ *
+ * // using `fromIndex`
+ * _.lastIndexOf([1, 2, 1, 2], 2, 2);
+ * // => 1
+ *
+ * // performing a binary search
+ * _.lastIndexOf([1, 1, 2, 2], 2, true);
+ * // => 3
+ */
+function lastIndexOf(array, value, fromIndex) {
+ var length = array ? array.length : 0;
+ if (!length) {
+ return -1;
+ }
+ var index = length;
+ if (typeof fromIndex == 'number') {
+ index = (fromIndex < 0 ? nativeMax(length + fromIndex, 0) : nativeMin(fromIndex || 0, length - 1)) + 1;
+ } else if (fromIndex) {
+ index = binaryIndex(array, value, true) - 1;
+ var other = array[index];
+ if (value === value ? (value === other) : (other !== other)) {
+ return index;
+ }
+ return -1;
+ }
+ if (value !== value) {
+ return indexOfNaN(array, index, true);
+ }
+ while (index--) {
+ if (array[index] === value) {
+ return index;
+ }
+ }
+ return -1;
+}
+
+module.exports = lastIndexOf;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/object.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/object.js
new file mode 100644
index 00000000000..f4a34531b13
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/object.js
@@ -0,0 +1 @@
+module.exports = require('./zipObject');
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/pull.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/pull.js
new file mode 100644
index 00000000000..746f196f830
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/pull.js
@@ -0,0 +1,52 @@
+var baseIndexOf = require('../internal/baseIndexOf');
+
+/** Used for native method references. */
+var arrayProto = Array.prototype;
+
+/** Native method references. */
+var splice = arrayProto.splice;
+
+/**
+ * Removes all provided values from `array` using
+ * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
+ * for equality comparisons.
+ *
+ * **Note:** Unlike `_.without`, this method mutates `array`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to modify.
+ * @param {...*} [values] The values to remove.
+ * @returns {Array} Returns `array`.
+ * @example
+ *
+ * var array = [1, 2, 3, 1, 2, 3];
+ *
+ * _.pull(array, 2, 3);
+ * console.log(array);
+ * // => [1, 1]
+ */
+function pull() {
+ var args = arguments,
+ array = args[0];
+
+ if (!(array && array.length)) {
+ return array;
+ }
+ var index = 0,
+ indexOf = baseIndexOf,
+ length = args.length;
+
+ while (++index < length) {
+ var fromIndex = 0,
+ value = args[index];
+
+ while ((fromIndex = indexOf(array, value, fromIndex)) > -1) {
+ splice.call(array, fromIndex, 1);
+ }
+ }
+ return array;
+}
+
+module.exports = pull;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/pullAt.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/pullAt.js
new file mode 100644
index 00000000000..4ca2476f0e1
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/pullAt.js
@@ -0,0 +1,40 @@
+var baseAt = require('../internal/baseAt'),
+ baseCompareAscending = require('../internal/baseCompareAscending'),
+ baseFlatten = require('../internal/baseFlatten'),
+ basePullAt = require('../internal/basePullAt'),
+ restParam = require('../function/restParam');
+
+/**
+ * Removes elements from `array` corresponding to the given indexes and returns
+ * an array of the removed elements. Indexes may be specified as an array of
+ * indexes or as individual arguments.
+ *
+ * **Note:** Unlike `_.at`, this method mutates `array`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to modify.
+ * @param {...(number|number[])} [indexes] The indexes of elements to remove,
+ * specified as individual indexes or arrays of indexes.
+ * @returns {Array} Returns the new array of removed elements.
+ * @example
+ *
+ * var array = [5, 10, 15, 20];
+ * var evens = _.pullAt(array, 1, 3);
+ *
+ * console.log(array);
+ * // => [5, 15]
+ *
+ * console.log(evens);
+ * // => [10, 20]
+ */
+var pullAt = restParam(function(array, indexes) {
+ indexes = baseFlatten(indexes);
+
+ var result = baseAt(array, indexes);
+ basePullAt(array, indexes.sort(baseCompareAscending));
+ return result;
+});
+
+module.exports = pullAt;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/remove.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/remove.js
new file mode 100644
index 00000000000..0cf979bda0b
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/remove.js
@@ -0,0 +1,64 @@
+var baseCallback = require('../internal/baseCallback'),
+ basePullAt = require('../internal/basePullAt');
+
+/**
+ * Removes all elements from `array` that `predicate` returns truthy for
+ * and returns an array of the removed elements. The predicate is bound to
+ * `thisArg` and invoked with three arguments: (value, index, array).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * **Note:** Unlike `_.filter`, this method mutates `array`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to modify.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {Array} Returns the new array of removed elements.
+ * @example
+ *
+ * var array = [1, 2, 3, 4];
+ * var evens = _.remove(array, function(n) {
+ * return n % 2 == 0;
+ * });
+ *
+ * console.log(array);
+ * // => [1, 3]
+ *
+ * console.log(evens);
+ * // => [2, 4]
+ */
+function remove(array, predicate, thisArg) {
+ var result = [];
+ if (!(array && array.length)) {
+ return result;
+ }
+ var index = -1,
+ indexes = [],
+ length = array.length;
+
+ predicate = baseCallback(predicate, thisArg, 3);
+ while (++index < length) {
+ var value = array[index];
+ if (predicate(value, index, array)) {
+ result.push(value);
+ indexes.push(index);
+ }
+ }
+ basePullAt(array, indexes);
+ return result;
+}
+
+module.exports = remove;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/rest.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/rest.js
new file mode 100644
index 00000000000..9bfb734f1fb
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/rest.js
@@ -0,0 +1,21 @@
+var drop = require('./drop');
+
+/**
+ * Gets all but the first element of `array`.
+ *
+ * @static
+ * @memberOf _
+ * @alias tail
+ * @category Array
+ * @param {Array} array The array to query.
+ * @returns {Array} Returns the slice of `array`.
+ * @example
+ *
+ * _.rest([1, 2, 3]);
+ * // => [2, 3]
+ */
+function rest(array) {
+ return drop(array, 1);
+}
+
+module.exports = rest;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/slice.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/slice.js
new file mode 100644
index 00000000000..48ef1a1a280
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/slice.js
@@ -0,0 +1,30 @@
+var baseSlice = require('../internal/baseSlice'),
+ isIterateeCall = require('../internal/isIterateeCall');
+
+/**
+ * Creates a slice of `array` from `start` up to, but not including, `end`.
+ *
+ * **Note:** This method is used instead of `Array#slice` to support node
+ * lists in IE < 9 and to ensure dense arrays are returned.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to slice.
+ * @param {number} [start=0] The start position.
+ * @param {number} [end=array.length] The end position.
+ * @returns {Array} Returns the slice of `array`.
+ */
+function slice(array, start, end) {
+ var length = array ? array.length : 0;
+ if (!length) {
+ return [];
+ }
+ if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
+ start = 0;
+ end = length;
+ }
+ return baseSlice(array, start, end);
+}
+
+module.exports = slice;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/sortedIndex.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/sortedIndex.js
new file mode 100644
index 00000000000..51d150e3b3a
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/sortedIndex.js
@@ -0,0 +1,53 @@
+var createSortedIndex = require('../internal/createSortedIndex');
+
+/**
+ * Uses a binary search to determine the lowest index at which `value` should
+ * be inserted into `array` in order to maintain its sort order. If an iteratee
+ * function is provided it is invoked for `value` and each element of `array`
+ * to compute their sort ranking. The iteratee is bound to `thisArg` and
+ * invoked with one argument; (value).
+ *
+ * If a property name is provided for `iteratee` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `iteratee` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The sorted array to inspect.
+ * @param {*} value The value to evaluate.
+ * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {number} Returns the index at which `value` should be inserted
+ * into `array`.
+ * @example
+ *
+ * _.sortedIndex([30, 50], 40);
+ * // => 1
+ *
+ * _.sortedIndex([4, 4, 5, 5], 5);
+ * // => 2
+ *
+ * var dict = { 'data': { 'thirty': 30, 'forty': 40, 'fifty': 50 } };
+ *
+ * // using an iteratee function
+ * _.sortedIndex(['thirty', 'fifty'], 'forty', function(word) {
+ * return this.data[word];
+ * }, dict);
+ * // => 1
+ *
+ * // using the `_.property` callback shorthand
+ * _.sortedIndex([{ 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x');
+ * // => 1
+ */
+var sortedIndex = createSortedIndex();
+
+module.exports = sortedIndex;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/sortedLastIndex.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/sortedLastIndex.js
new file mode 100644
index 00000000000..81a4a8689e8
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/sortedLastIndex.js
@@ -0,0 +1,25 @@
+var createSortedIndex = require('../internal/createSortedIndex');
+
+/**
+ * This method is like `_.sortedIndex` except that it returns the highest
+ * index at which `value` should be inserted into `array` in order to
+ * maintain its sort order.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The sorted array to inspect.
+ * @param {*} value The value to evaluate.
+ * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {number} Returns the index at which `value` should be inserted
+ * into `array`.
+ * @example
+ *
+ * _.sortedLastIndex([4, 4, 5, 5], 5);
+ * // => 4
+ */
+var sortedLastIndex = createSortedIndex(true);
+
+module.exports = sortedLastIndex;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/tail.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/tail.js
new file mode 100644
index 00000000000..c5dfe779d6f
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/tail.js
@@ -0,0 +1 @@
+module.exports = require('./rest');
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/take.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/take.js
new file mode 100644
index 00000000000..875917a7466
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/take.js
@@ -0,0 +1,39 @@
+var baseSlice = require('../internal/baseSlice'),
+ isIterateeCall = require('../internal/isIterateeCall');
+
+/**
+ * Creates a slice of `array` with `n` elements taken from the beginning.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to query.
+ * @param {number} [n=1] The number of elements to take.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {Array} Returns the slice of `array`.
+ * @example
+ *
+ * _.take([1, 2, 3]);
+ * // => [1]
+ *
+ * _.take([1, 2, 3], 2);
+ * // => [1, 2]
+ *
+ * _.take([1, 2, 3], 5);
+ * // => [1, 2, 3]
+ *
+ * _.take([1, 2, 3], 0);
+ * // => []
+ */
+function take(array, n, guard) {
+ var length = array ? array.length : 0;
+ if (!length) {
+ return [];
+ }
+ if (guard ? isIterateeCall(array, n, guard) : n == null) {
+ n = 1;
+ }
+ return baseSlice(array, 0, n < 0 ? 0 : n);
+}
+
+module.exports = take;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/takeRight.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/takeRight.js
new file mode 100644
index 00000000000..6e89c874801
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/takeRight.js
@@ -0,0 +1,40 @@
+var baseSlice = require('../internal/baseSlice'),
+ isIterateeCall = require('../internal/isIterateeCall');
+
+/**
+ * Creates a slice of `array` with `n` elements taken from the end.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to query.
+ * @param {number} [n=1] The number of elements to take.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {Array} Returns the slice of `array`.
+ * @example
+ *
+ * _.takeRight([1, 2, 3]);
+ * // => [3]
+ *
+ * _.takeRight([1, 2, 3], 2);
+ * // => [2, 3]
+ *
+ * _.takeRight([1, 2, 3], 5);
+ * // => [1, 2, 3]
+ *
+ * _.takeRight([1, 2, 3], 0);
+ * // => []
+ */
+function takeRight(array, n, guard) {
+ var length = array ? array.length : 0;
+ if (!length) {
+ return [];
+ }
+ if (guard ? isIterateeCall(array, n, guard) : n == null) {
+ n = 1;
+ }
+ n = length - (+n || 0);
+ return baseSlice(array, n < 0 ? 0 : n);
+}
+
+module.exports = takeRight;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/takeRightWhile.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/takeRightWhile.js
new file mode 100644
index 00000000000..5464d13b7fa
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/takeRightWhile.js
@@ -0,0 +1,59 @@
+var baseCallback = require('../internal/baseCallback'),
+ baseWhile = require('../internal/baseWhile');
+
+/**
+ * Creates a slice of `array` with elements taken from the end. Elements are
+ * taken until `predicate` returns falsey. The predicate is bound to `thisArg`
+ * and invoked with three arguments: (value, index, array).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to query.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {Array} Returns the slice of `array`.
+ * @example
+ *
+ * _.takeRightWhile([1, 2, 3], function(n) {
+ * return n > 1;
+ * });
+ * // => [2, 3]
+ *
+ * var users = [
+ * { 'user': 'barney', 'active': true },
+ * { 'user': 'fred', 'active': false },
+ * { 'user': 'pebbles', 'active': false }
+ * ];
+ *
+ * // using the `_.matches` callback shorthand
+ * _.pluck(_.takeRightWhile(users, { 'user': 'pebbles', 'active': false }), 'user');
+ * // => ['pebbles']
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.pluck(_.takeRightWhile(users, 'active', false), 'user');
+ * // => ['fred', 'pebbles']
+ *
+ * // using the `_.property` callback shorthand
+ * _.pluck(_.takeRightWhile(users, 'active'), 'user');
+ * // => []
+ */
+function takeRightWhile(array, predicate, thisArg) {
+ return (array && array.length)
+ ? baseWhile(array, baseCallback(predicate, thisArg, 3), false, true)
+ : [];
+}
+
+module.exports = takeRightWhile;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/takeWhile.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/takeWhile.js
new file mode 100644
index 00000000000..f7e28a1d423
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/takeWhile.js
@@ -0,0 +1,59 @@
+var baseCallback = require('../internal/baseCallback'),
+ baseWhile = require('../internal/baseWhile');
+
+/**
+ * Creates a slice of `array` with elements taken from the beginning. Elements
+ * are taken until `predicate` returns falsey. The predicate is bound to
+ * `thisArg` and invoked with three arguments: (value, index, array).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to query.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {Array} Returns the slice of `array`.
+ * @example
+ *
+ * _.takeWhile([1, 2, 3], function(n) {
+ * return n < 3;
+ * });
+ * // => [1, 2]
+ *
+ * var users = [
+ * { 'user': 'barney', 'active': false },
+ * { 'user': 'fred', 'active': false},
+ * { 'user': 'pebbles', 'active': true }
+ * ];
+ *
+ * // using the `_.matches` callback shorthand
+ * _.pluck(_.takeWhile(users, { 'user': 'barney', 'active': false }), 'user');
+ * // => ['barney']
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.pluck(_.takeWhile(users, 'active', false), 'user');
+ * // => ['barney', 'fred']
+ *
+ * // using the `_.property` callback shorthand
+ * _.pluck(_.takeWhile(users, 'active'), 'user');
+ * // => []
+ */
+function takeWhile(array, predicate, thisArg) {
+ return (array && array.length)
+ ? baseWhile(array, baseCallback(predicate, thisArg, 3))
+ : [];
+}
+
+module.exports = takeWhile;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/union.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/union.js
new file mode 100644
index 00000000000..05101ca1c2d
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/union.js
@@ -0,0 +1,24 @@
+var baseFlatten = require('../internal/baseFlatten'),
+ baseUniq = require('../internal/baseUniq'),
+ restParam = require('../function/restParam');
+
+/**
+ * Creates an array of unique values, in order, from all of the provided arrays
+ * using [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
+ * for equality comparisons.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {...Array} [arrays] The arrays to inspect.
+ * @returns {Array} Returns the new array of combined values.
+ * @example
+ *
+ * _.union([1, 2], [4, 2], [2, 1]);
+ * // => [1, 2, 4]
+ */
+var union = restParam(function(arrays) {
+ return baseUniq(baseFlatten(arrays, false, true));
+});
+
+module.exports = union;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/uniq.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/uniq.js
new file mode 100644
index 00000000000..91ae46e244d
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/uniq.js
@@ -0,0 +1,71 @@
+var baseCallback = require('../internal/baseCallback'),
+ baseUniq = require('../internal/baseUniq'),
+ isIterateeCall = require('../internal/isIterateeCall'),
+ sortedUniq = require('../internal/sortedUniq');
+
+/**
+ * Creates a duplicate-free version of an array, using
+ * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
+ * for equality comparisons, in which only the first occurence of each element
+ * is kept. Providing `true` for `isSorted` performs a faster search algorithm
+ * for sorted arrays. If an iteratee function is provided it is invoked for
+ * each element in the array to generate the criterion by which uniqueness
+ * is computed. The `iteratee` is bound to `thisArg` and invoked with three
+ * arguments: (value, index, array).
+ *
+ * If a property name is provided for `iteratee` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `iteratee` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @alias unique
+ * @category Array
+ * @param {Array} array The array to inspect.
+ * @param {boolean} [isSorted] Specify the array is sorted.
+ * @param {Function|Object|string} [iteratee] The function invoked per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Array} Returns the new duplicate-value-free array.
+ * @example
+ *
+ * _.uniq([2, 1, 2]);
+ * // => [2, 1]
+ *
+ * // using `isSorted`
+ * _.uniq([1, 1, 2], true);
+ * // => [1, 2]
+ *
+ * // using an iteratee function
+ * _.uniq([1, 2.5, 1.5, 2], function(n) {
+ * return this.floor(n);
+ * }, Math);
+ * // => [1, 2.5]
+ *
+ * // using the `_.property` callback shorthand
+ * _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
+ * // => [{ 'x': 1 }, { 'x': 2 }]
+ */
+function uniq(array, isSorted, iteratee, thisArg) {
+ var length = array ? array.length : 0;
+ if (!length) {
+ return [];
+ }
+ if (isSorted != null && typeof isSorted != 'boolean') {
+ thisArg = iteratee;
+ iteratee = isIterateeCall(array, isSorted, thisArg) ? null : isSorted;
+ isSorted = false;
+ }
+ iteratee = iteratee == null ? iteratee : baseCallback(iteratee, thisArg, 3);
+ return (isSorted)
+ ? sortedUniq(array, iteratee)
+ : baseUniq(array, iteratee);
+}
+
+module.exports = uniq;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/unique.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/unique.js
new file mode 100644
index 00000000000..396de1b8046
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/unique.js
@@ -0,0 +1 @@
+module.exports = require('./uniq');
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/unzip.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/unzip.js
new file mode 100644
index 00000000000..0a539fa6315
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/unzip.js
@@ -0,0 +1,47 @@
+var arrayFilter = require('../internal/arrayFilter'),
+ arrayMap = require('../internal/arrayMap'),
+ baseProperty = require('../internal/baseProperty'),
+ isArrayLike = require('../internal/isArrayLike');
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max;
+
+/**
+ * This method is like `_.zip` except that it accepts an array of grouped
+ * elements and creates an array regrouping the elements to their pre-zip
+ * configuration.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array of grouped elements to process.
+ * @returns {Array} Returns the new array of regrouped elements.
+ * @example
+ *
+ * var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]);
+ * // => [['fred', 30, true], ['barney', 40, false]]
+ *
+ * _.unzip(zipped);
+ * // => [['fred', 'barney'], [30, 40], [true, false]]
+ */
+function unzip(array) {
+ if (!(array && array.length)) {
+ return [];
+ }
+ var index = -1,
+ length = 0;
+
+ array = arrayFilter(array, function(group) {
+ if (isArrayLike(group)) {
+ length = nativeMax(group.length, length);
+ return true;
+ }
+ });
+ var result = Array(length);
+ while (++index < length) {
+ result[index] = arrayMap(array, baseProperty(index));
+ }
+ return result;
+}
+
+module.exports = unzip;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/unzipWith.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/unzipWith.js
new file mode 100644
index 00000000000..324a2b1db28
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/unzipWith.js
@@ -0,0 +1,41 @@
+var arrayMap = require('../internal/arrayMap'),
+ arrayReduce = require('../internal/arrayReduce'),
+ bindCallback = require('../internal/bindCallback'),
+ unzip = require('./unzip');
+
+/**
+ * This method is like `_.unzip` except that it accepts an iteratee to specify
+ * how regrouped values should be combined. The `iteratee` is bound to `thisArg`
+ * and invoked with four arguments: (accumulator, value, index, group).
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array of grouped elements to process.
+ * @param {Function} [iteratee] The function to combine regrouped values.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Array} Returns the new array of regrouped elements.
+ * @example
+ *
+ * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
+ * // => [[1, 10, 100], [2, 20, 200]]
+ *
+ * _.unzipWith(zipped, _.add);
+ * // => [3, 30, 300]
+ */
+function unzipWith(array, iteratee, thisArg) {
+ var length = array ? array.length : 0;
+ if (!length) {
+ return [];
+ }
+ var result = unzip(array);
+ if (iteratee == null) {
+ return result;
+ }
+ iteratee = bindCallback(iteratee, thisArg, 4);
+ return arrayMap(result, function(group) {
+ return arrayReduce(group, iteratee, undefined, true);
+ });
+}
+
+module.exports = unzipWith;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/without.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/without.js
new file mode 100644
index 00000000000..19b78491af6
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/without.js
@@ -0,0 +1,27 @@
+var baseDifference = require('../internal/baseDifference'),
+ isArrayLike = require('../internal/isArrayLike'),
+ restParam = require('../function/restParam');
+
+/**
+ * Creates an array excluding all provided values using
+ * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
+ * for equality comparisons.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to filter.
+ * @param {...*} [values] The values to exclude.
+ * @returns {Array} Returns the new array of filtered values.
+ * @example
+ *
+ * _.without([1, 2, 1, 3], 1, 2);
+ * // => [3]
+ */
+var without = restParam(function(array, values) {
+ return isArrayLike(array)
+ ? baseDifference(array, values)
+ : [];
+});
+
+module.exports = without;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/xor.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/xor.js
new file mode 100644
index 00000000000..3bdf9df1218
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/xor.js
@@ -0,0 +1,34 @@
+var baseDifference = require('../internal/baseDifference'),
+ baseUniq = require('../internal/baseUniq'),
+ isArrayLike = require('../internal/isArrayLike');
+
+/**
+ * Creates an array of unique values that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
+ * of the provided arrays.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {...Array} [arrays] The arrays to inspect.
+ * @returns {Array} Returns the new array of values.
+ * @example
+ *
+ * _.xor([1, 2], [4, 2]);
+ * // => [1, 4]
+ */
+function xor() {
+ var index = -1,
+ length = arguments.length;
+
+ while (++index < length) {
+ var array = arguments[index];
+ if (isArrayLike(array)) {
+ var result = result
+ ? baseDifference(result, array).concat(baseDifference(array, result))
+ : array;
+ }
+ }
+ return result ? baseUniq(result) : [];
+}
+
+module.exports = xor;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/zip.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/zip.js
new file mode 100644
index 00000000000..53a6f699121
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/zip.js
@@ -0,0 +1,21 @@
+var restParam = require('../function/restParam'),
+ unzip = require('./unzip');
+
+/**
+ * Creates an array of grouped elements, the first of which contains the first
+ * elements of the given arrays, the second of which contains the second elements
+ * of the given arrays, and so on.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {...Array} [arrays] The arrays to process.
+ * @returns {Array} Returns the new array of grouped elements.
+ * @example
+ *
+ * _.zip(['fred', 'barney'], [30, 40], [true, false]);
+ * // => [['fred', 30, true], ['barney', 40, false]]
+ */
+var zip = restParam(unzip);
+
+module.exports = zip;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/zipObject.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/zipObject.js
new file mode 100644
index 00000000000..dec7a211b74
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/zipObject.js
@@ -0,0 +1,43 @@
+var isArray = require('../lang/isArray');
+
+/**
+ * The inverse of `_.pairs`; this method returns an object composed from arrays
+ * of property names and values. Provide either a single two dimensional array,
+ * e.g. `[[key1, value1], [key2, value2]]` or two arrays, one of property names
+ * and one of corresponding values.
+ *
+ * @static
+ * @memberOf _
+ * @alias object
+ * @category Array
+ * @param {Array} props The property names.
+ * @param {Array} [values=[]] The property values.
+ * @returns {Object} Returns the new object.
+ * @example
+ *
+ * _.zipObject([['fred', 30], ['barney', 40]]);
+ * // => { 'fred': 30, 'barney': 40 }
+ *
+ * _.zipObject(['fred', 'barney'], [30, 40]);
+ * // => { 'fred': 30, 'barney': 40 }
+ */
+function zipObject(props, values) {
+ var index = -1,
+ length = props ? props.length : 0,
+ result = {};
+
+ if (length && !values && !isArray(props[0])) {
+ values = [];
+ }
+ while (++index < length) {
+ var key = props[index];
+ if (values) {
+ result[key] = values[index];
+ } else if (key) {
+ result[key[0]] = key[1];
+ }
+ }
+ return result;
+}
+
+module.exports = zipObject;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/zipWith.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/zipWith.js
new file mode 100644
index 00000000000..ad103742cd1
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/zipWith.js
@@ -0,0 +1,36 @@
+var restParam = require('../function/restParam'),
+ unzipWith = require('./unzipWith');
+
+/**
+ * This method is like `_.zip` except that it accepts an iteratee to specify
+ * how grouped values should be combined. The `iteratee` is bound to `thisArg`
+ * and invoked with four arguments: (accumulator, value, index, group).
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {...Array} [arrays] The arrays to process.
+ * @param {Function} [iteratee] The function to combine grouped values.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Array} Returns the new array of grouped elements.
+ * @example
+ *
+ * _.zipWith([1, 2], [10, 20], [100, 200], _.add);
+ * // => [111, 222]
+ */
+var zipWith = restParam(function(arrays) {
+ var length = arrays.length,
+ iteratee = length > 2 ? arrays[length - 2] : undefined,
+ thisArg = length > 1 ? arrays[length - 1] : undefined;
+
+ if (length > 2 && typeof iteratee == 'function') {
+ length -= 2;
+ } else {
+ iteratee = (length > 1 && typeof thisArg == 'function') ? (--length, thisArg) : undefined;
+ thisArg = undefined;
+ }
+ arrays.length = length;
+ return unzipWith(arrays, iteratee, thisArg);
+});
+
+module.exports = zipWith;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain.js
new file mode 100644
index 00000000000..7992b733e23
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain.js
@@ -0,0 +1,15 @@
+module.exports = {
+ 'chain': require('./chain/chain'),
+ 'commit': require('./chain/commit'),
+ 'lodash': require('./chain/lodash'),
+ 'plant': require('./chain/plant'),
+ 'reverse': require('./chain/reverse'),
+ 'run': require('./chain/run'),
+ 'tap': require('./chain/tap'),
+ 'thru': require('./chain/thru'),
+ 'toJSON': require('./chain/toJSON'),
+ 'toString': require('./chain/toString'),
+ 'value': require('./chain/value'),
+ 'valueOf': require('./chain/valueOf'),
+ 'wrapperChain': require('./chain/wrapperChain')
+};
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/chain.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/chain.js
new file mode 100644
index 00000000000..453ba1eb5e8
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/chain.js
@@ -0,0 +1,35 @@
+var lodash = require('./lodash');
+
+/**
+ * Creates a `lodash` object that wraps `value` with explicit method
+ * chaining enabled.
+ *
+ * @static
+ * @memberOf _
+ * @category Chain
+ * @param {*} value The value to wrap.
+ * @returns {Object} Returns the new `lodash` wrapper instance.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36 },
+ * { 'user': 'fred', 'age': 40 },
+ * { 'user': 'pebbles', 'age': 1 }
+ * ];
+ *
+ * var youngest = _.chain(users)
+ * .sortBy('age')
+ * .map(function(chr) {
+ * return chr.user + ' is ' + chr.age;
+ * })
+ * .first()
+ * .value();
+ * // => 'pebbles is 1'
+ */
+function chain(value) {
+ var result = lodash(value);
+ result.__chain__ = true;
+ return result;
+}
+
+module.exports = chain;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/commit.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/commit.js
new file mode 100644
index 00000000000..c732d1bf913
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/commit.js
@@ -0,0 +1 @@
+module.exports = require('./wrapperCommit');
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/lodash.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/lodash.js
new file mode 100644
index 00000000000..3241ed89f22
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/lodash.js
@@ -0,0 +1,123 @@
+var LazyWrapper = require('../internal/LazyWrapper'),
+ LodashWrapper = require('../internal/LodashWrapper'),
+ baseLodash = require('../internal/baseLodash'),
+ isArray = require('../lang/isArray'),
+ isObjectLike = require('../internal/isObjectLike'),
+ wrapperClone = require('../internal/wrapperClone');
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Creates a `lodash` object which wraps `value` to enable implicit chaining.
+ * Methods that operate on and return arrays, collections, and functions can
+ * be chained together. Methods that return a boolean or single value will
+ * automatically end the chain returning the unwrapped value. Explicit chaining
+ * may be enabled using `_.chain`. The execution of chained methods is lazy,
+ * that is, execution is deferred until `_#value` is implicitly or explicitly
+ * called.
+ *
+ * Lazy evaluation allows several methods to support shortcut fusion. Shortcut
+ * fusion is an optimization that merges iteratees to avoid creating intermediate
+ * arrays and reduce the number of iteratee executions.
+ *
+ * Chaining is supported in custom builds as long as the `_#value` method is
+ * directly or indirectly included in the build.
+ *
+ * In addition to lodash methods, wrappers have `Array` and `String` methods.
+ *
+ * The wrapper `Array` methods are:
+ * `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`,
+ * `splice`, and `unshift`
+ *
+ * The wrapper `String` methods are:
+ * `replace` and `split`
+ *
+ * The wrapper methods that support shortcut fusion are:
+ * `compact`, `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `filter`,
+ * `first`, `initial`, `last`, `map`, `pluck`, `reject`, `rest`, `reverse`,
+ * `slice`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `toArray`,
+ * and `where`
+ *
+ * The chainable wrapper methods are:
+ * `after`, `ary`, `assign`, `at`, `before`, `bind`, `bindAll`, `bindKey`,
+ * `callback`, `chain`, `chunk`, `commit`, `compact`, `concat`, `constant`,
+ * `countBy`, `create`, `curry`, `debounce`, `defaults`, `defer`, `delay`,
+ * `difference`, `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `fill`,
+ * `filter`, `flatten`, `flattenDeep`, `flow`, `flowRight`, `forEach`,
+ * `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `functions`,
+ * `groupBy`, `indexBy`, `initial`, `intersection`, `invert`, `invoke`, `keys`,
+ * `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
+ * `memoize`, `merge`, `method`, `methodOf`, `mixin`, `negate`, `omit`, `once`,
+ * `pairs`, `partial`, `partialRight`, `partition`, `pick`, `plant`, `pluck`,
+ * `property`, `propertyOf`, `pull`, `pullAt`, `push`, `range`, `rearg`,
+ * `reject`, `remove`, `rest`, `restParam`, `reverse`, `set`, `shuffle`,
+ * `slice`, `sort`, `sortBy`, `sortByAll`, `sortByOrder`, `splice`, `spread`,
+ * `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `tap`, `throttle`,
+ * `thru`, `times`, `toArray`, `toPlainObject`, `transform`, `union`, `uniq`,
+ * `unshift`, `unzip`, `unzipWith`, `values`, `valuesIn`, `where`, `without`,
+ * `wrap`, `xor`, `zip`, `zipObject`, `zipWith`
+ *
+ * The wrapper methods that are **not** chainable by default are:
+ * `add`, `attempt`, `camelCase`, `capitalize`, `clone`, `cloneDeep`, `deburr`,
+ * `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`,
+ * `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`, `get`,
+ * `gt`, `gte`, `has`, `identity`, `includes`, `indexOf`, `inRange`, `isArguments`,
+ * `isArray`, `isBoolean`, `isDate`, `isElement`, `isEmpty`, `isEqual`, `isError`,
+ * `isFinite` `isFunction`, `isMatch`, `isNative`, `isNaN`, `isNull`, `isNumber`,
+ * `isObject`, `isPlainObject`, `isRegExp`, `isString`, `isUndefined`,
+ * `isTypedArray`, `join`, `kebabCase`, `last`, `lastIndexOf`, `lt`, `lte`,
+ * `max`, `min`, `noConflict`, `noop`, `now`, `pad`, `padLeft`, `padRight`,
+ * `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`,
+ * `runInContext`, `shift`, `size`, `snakeCase`, `some`, `sortedIndex`,
+ * `sortedLastIndex`, `startCase`, `startsWith`, `sum`, `template`, `trim`,
+ * `trimLeft`, `trimRight`, `trunc`, `unescape`, `uniqueId`, `value`, and `words`
+ *
+ * The wrapper method `sample` will return a wrapped value when `n` is provided,
+ * otherwise an unwrapped value is returned.
+ *
+ * @name _
+ * @constructor
+ * @category Chain
+ * @param {*} value The value to wrap in a `lodash` instance.
+ * @returns {Object} Returns the new `lodash` wrapper instance.
+ * @example
+ *
+ * var wrapped = _([1, 2, 3]);
+ *
+ * // returns an unwrapped value
+ * wrapped.reduce(function(total, n) {
+ * return total + n;
+ * });
+ * // => 6
+ *
+ * // returns a wrapped value
+ * var squares = wrapped.map(function(n) {
+ * return n * n;
+ * });
+ *
+ * _.isArray(squares);
+ * // => false
+ *
+ * _.isArray(squares.value());
+ * // => true
+ */
+function lodash(value) {
+ if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
+ if (value instanceof LodashWrapper) {
+ return value;
+ }
+ if (hasOwnProperty.call(value, '__chain__') && hasOwnProperty.call(value, '__wrapped__')) {
+ return wrapperClone(value);
+ }
+ }
+ return new LodashWrapper(value);
+}
+
+// Ensure wrappers are instances of `baseLodash`.
+lodash.prototype = baseLodash.prototype;
+
+module.exports = lodash;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/plant.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/plant.js
new file mode 100644
index 00000000000..04099f23865
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/plant.js
@@ -0,0 +1 @@
+module.exports = require('./wrapperPlant');
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/reverse.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/reverse.js
new file mode 100644
index 00000000000..f72a64a19b9
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/reverse.js
@@ -0,0 +1 @@
+module.exports = require('./wrapperReverse');
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/run.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/run.js
new file mode 100644
index 00000000000..5e751a2c32e
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/run.js
@@ -0,0 +1 @@
+module.exports = require('./wrapperValue');
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/tap.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/tap.js
new file mode 100644
index 00000000000..3d0257ecfde
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/tap.js
@@ -0,0 +1,29 @@
+/**
+ * This method invokes `interceptor` and returns `value`. The interceptor is
+ * bound to `thisArg` and invoked with one argument; (value). The purpose of
+ * this method is to "tap into" a method chain in order to perform operations
+ * on intermediate results within the chain.
+ *
+ * @static
+ * @memberOf _
+ * @category Chain
+ * @param {*} value The value to provide to `interceptor`.
+ * @param {Function} interceptor The function to invoke.
+ * @param {*} [thisArg] The `this` binding of `interceptor`.
+ * @returns {*} Returns `value`.
+ * @example
+ *
+ * _([1, 2, 3])
+ * .tap(function(array) {
+ * array.pop();
+ * })
+ * .reverse()
+ * .value();
+ * // => [2, 1]
+ */
+function tap(value, interceptor, thisArg) {
+ interceptor.call(thisArg, value);
+ return value;
+}
+
+module.exports = tap;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/thru.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/thru.js
new file mode 100644
index 00000000000..a7157803769
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/thru.js
@@ -0,0 +1,26 @@
+/**
+ * This method is like `_.tap` except that it returns the result of `interceptor`.
+ *
+ * @static
+ * @memberOf _
+ * @category Chain
+ * @param {*} value The value to provide to `interceptor`.
+ * @param {Function} interceptor The function to invoke.
+ * @param {*} [thisArg] The `this` binding of `interceptor`.
+ * @returns {*} Returns the result of `interceptor`.
+ * @example
+ *
+ * _(' abc ')
+ * .chain()
+ * .trim()
+ * .thru(function(value) {
+ * return [value];
+ * })
+ * .value();
+ * // => ['abc']
+ */
+function thru(value, interceptor, thisArg) {
+ return interceptor.call(thisArg, value);
+}
+
+module.exports = thru;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/toJSON.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/toJSON.js
new file mode 100644
index 00000000000..5e751a2c32e
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/toJSON.js
@@ -0,0 +1 @@
+module.exports = require('./wrapperValue');
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/toString.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/toString.js
new file mode 100644
index 00000000000..c7bcbf9a543
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/toString.js
@@ -0,0 +1 @@
+module.exports = require('./wrapperToString');
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/value.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/value.js
new file mode 100644
index 00000000000..5e751a2c32e
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/value.js
@@ -0,0 +1 @@
+module.exports = require('./wrapperValue');
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/valueOf.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/valueOf.js
new file mode 100644
index 00000000000..5e751a2c32e
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/valueOf.js
@@ -0,0 +1 @@
+module.exports = require('./wrapperValue');
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperChain.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperChain.js
new file mode 100644
index 00000000000..38234819ba0
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperChain.js
@@ -0,0 +1,32 @@
+var chain = require('./chain');
+
+/**
+ * Enables explicit method chaining on the wrapper object.
+ *
+ * @name chain
+ * @memberOf _
+ * @category Chain
+ * @returns {Object} Returns the new `lodash` wrapper instance.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36 },
+ * { 'user': 'fred', 'age': 40 }
+ * ];
+ *
+ * // without explicit chaining
+ * _(users).first();
+ * // => { 'user': 'barney', 'age': 36 }
+ *
+ * // with explicit chaining
+ * _(users).chain()
+ * .first()
+ * .pick('user')
+ * .value();
+ * // => { 'user': 'barney' }
+ */
+function wrapperChain() {
+ return chain(this);
+}
+
+module.exports = wrapperChain;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperCommit.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperCommit.js
new file mode 100644
index 00000000000..c46a787e97d
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperCommit.js
@@ -0,0 +1,32 @@
+var LodashWrapper = require('../internal/LodashWrapper');
+
+/**
+ * Executes the chained sequence and returns the wrapped result.
+ *
+ * @name commit
+ * @memberOf _
+ * @category Chain
+ * @returns {Object} Returns the new `lodash` wrapper instance.
+ * @example
+ *
+ * var array = [1, 2];
+ * var wrapper = _(array).push(3);
+ *
+ * console.log(array);
+ * // => [1, 2]
+ *
+ * wrapper = wrapper.commit();
+ * console.log(array);
+ * // => [1, 2, 3]
+ *
+ * wrapper.last();
+ * // => 3
+ *
+ * console.log(array);
+ * // => [1, 2, 3]
+ */
+function wrapperCommit() {
+ return new LodashWrapper(this.value(), this.__chain__);
+}
+
+module.exports = wrapperCommit;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperPlant.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperPlant.js
new file mode 100644
index 00000000000..a3de146b13d
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperPlant.js
@@ -0,0 +1,45 @@
+var baseLodash = require('../internal/baseLodash'),
+ wrapperClone = require('../internal/wrapperClone');
+
+/**
+ * Creates a clone of the chained sequence planting `value` as the wrapped value.
+ *
+ * @name plant
+ * @memberOf _
+ * @category Chain
+ * @returns {Object} Returns the new `lodash` wrapper instance.
+ * @example
+ *
+ * var array = [1, 2];
+ * var wrapper = _(array).map(function(value) {
+ * return Math.pow(value, 2);
+ * });
+ *
+ * var other = [3, 4];
+ * var otherWrapper = wrapper.plant(other);
+ *
+ * otherWrapper.value();
+ * // => [9, 16]
+ *
+ * wrapper.value();
+ * // => [1, 4]
+ */
+function wrapperPlant(value) {
+ var result,
+ parent = this;
+
+ while (parent instanceof baseLodash) {
+ var clone = wrapperClone(parent);
+ if (result) {
+ previous.__wrapped__ = clone;
+ } else {
+ result = clone;
+ }
+ var previous = clone;
+ parent = parent.__wrapped__;
+ }
+ previous.__wrapped__ = value;
+ return result;
+}
+
+module.exports = wrapperPlant;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperReverse.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperReverse.js
new file mode 100644
index 00000000000..4518b3ed286
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperReverse.js
@@ -0,0 +1,38 @@
+var LazyWrapper = require('../internal/LazyWrapper'),
+ LodashWrapper = require('../internal/LodashWrapper'),
+ thru = require('./thru');
+
+/**
+ * Reverses the wrapped array so the first element becomes the last, the
+ * second element becomes the second to last, and so on.
+ *
+ * **Note:** This method mutates the wrapped array.
+ *
+ * @name reverse
+ * @memberOf _
+ * @category Chain
+ * @returns {Object} Returns the new reversed `lodash` wrapper instance.
+ * @example
+ *
+ * var array = [1, 2, 3];
+ *
+ * _(array).reverse().value()
+ * // => [3, 2, 1]
+ *
+ * console.log(array);
+ * // => [3, 2, 1]
+ */
+function wrapperReverse() {
+ var value = this.__wrapped__;
+ if (value instanceof LazyWrapper) {
+ if (this.__actions__.length) {
+ value = new LazyWrapper(this);
+ }
+ return new LodashWrapper(value.reverse(), this.__chain__);
+ }
+ return this.thru(function(value) {
+ return value.reverse();
+ });
+}
+
+module.exports = wrapperReverse;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperToString.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperToString.js
new file mode 100644
index 00000000000..db975a5a354
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperToString.js
@@ -0,0 +1,17 @@
+/**
+ * Produces the result of coercing the unwrapped value to a string.
+ *
+ * @name toString
+ * @memberOf _
+ * @category Chain
+ * @returns {string} Returns the coerced string value.
+ * @example
+ *
+ * _([1, 2, 3]).toString();
+ * // => '1,2,3'
+ */
+function wrapperToString() {
+ return (this.value() + '');
+}
+
+module.exports = wrapperToString;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperValue.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperValue.js
new file mode 100644
index 00000000000..2734e41c4a9
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperValue.js
@@ -0,0 +1,20 @@
+var baseWrapperValue = require('../internal/baseWrapperValue');
+
+/**
+ * Executes the chained sequence to extract the unwrapped value.
+ *
+ * @name value
+ * @memberOf _
+ * @alias run, toJSON, valueOf
+ * @category Chain
+ * @returns {*} Returns the resolved unwrapped value.
+ * @example
+ *
+ * _([1, 2, 3]).value();
+ * // => [1, 2, 3]
+ */
+function wrapperValue() {
+ return baseWrapperValue(this.__wrapped__, this.__actions__);
+}
+
+module.exports = wrapperValue;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection.js
new file mode 100644
index 00000000000..03388571c31
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection.js
@@ -0,0 +1,44 @@
+module.exports = {
+ 'all': require('./collection/all'),
+ 'any': require('./collection/any'),
+ 'at': require('./collection/at'),
+ 'collect': require('./collection/collect'),
+ 'contains': require('./collection/contains'),
+ 'countBy': require('./collection/countBy'),
+ 'detect': require('./collection/detect'),
+ 'each': require('./collection/each'),
+ 'eachRight': require('./collection/eachRight'),
+ 'every': require('./collection/every'),
+ 'filter': require('./collection/filter'),
+ 'find': require('./collection/find'),
+ 'findLast': require('./collection/findLast'),
+ 'findWhere': require('./collection/findWhere'),
+ 'foldl': require('./collection/foldl'),
+ 'foldr': require('./collection/foldr'),
+ 'forEach': require('./collection/forEach'),
+ 'forEachRight': require('./collection/forEachRight'),
+ 'groupBy': require('./collection/groupBy'),
+ 'include': require('./collection/include'),
+ 'includes': require('./collection/includes'),
+ 'indexBy': require('./collection/indexBy'),
+ 'inject': require('./collection/inject'),
+ 'invoke': require('./collection/invoke'),
+ 'map': require('./collection/map'),
+ 'max': require('./math/max'),
+ 'min': require('./math/min'),
+ 'partition': require('./collection/partition'),
+ 'pluck': require('./collection/pluck'),
+ 'reduce': require('./collection/reduce'),
+ 'reduceRight': require('./collection/reduceRight'),
+ 'reject': require('./collection/reject'),
+ 'sample': require('./collection/sample'),
+ 'select': require('./collection/select'),
+ 'shuffle': require('./collection/shuffle'),
+ 'size': require('./collection/size'),
+ 'some': require('./collection/some'),
+ 'sortBy': require('./collection/sortBy'),
+ 'sortByAll': require('./collection/sortByAll'),
+ 'sortByOrder': require('./collection/sortByOrder'),
+ 'sum': require('./math/sum'),
+ 'where': require('./collection/where')
+};
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/all.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/all.js
new file mode 100644
index 00000000000..d0839f77ed7
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/all.js
@@ -0,0 +1 @@
+module.exports = require('./every');
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/any.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/any.js
new file mode 100644
index 00000000000..900ac25e836
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/any.js
@@ -0,0 +1 @@
+module.exports = require('./some');
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/at.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/at.js
new file mode 100644
index 00000000000..29236e577df
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/at.js
@@ -0,0 +1,29 @@
+var baseAt = require('../internal/baseAt'),
+ baseFlatten = require('../internal/baseFlatten'),
+ restParam = require('../function/restParam');
+
+/**
+ * Creates an array of elements corresponding to the given keys, or indexes,
+ * of `collection`. Keys may be specified as individual arguments or as arrays
+ * of keys.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {...(number|number[]|string|string[])} [props] The property names
+ * or indexes of elements to pick, specified individually or in arrays.
+ * @returns {Array} Returns the new array of picked elements.
+ * @example
+ *
+ * _.at(['a', 'b', 'c'], [0, 2]);
+ * // => ['a', 'c']
+ *
+ * _.at(['barney', 'fred', 'pebbles'], 0, 2);
+ * // => ['barney', 'pebbles']
+ */
+var at = restParam(function(collection, props) {
+ return baseAt(collection, baseFlatten(props));
+});
+
+module.exports = at;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/collect.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/collect.js
new file mode 100644
index 00000000000..0d1e1abfaf9
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/collect.js
@@ -0,0 +1 @@
+module.exports = require('./map');
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/contains.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/contains.js
new file mode 100644
index 00000000000..594722af59a
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/contains.js
@@ -0,0 +1 @@
+module.exports = require('./includes');
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/countBy.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/countBy.js
new file mode 100644
index 00000000000..e97dbb749d1
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/countBy.js
@@ -0,0 +1,54 @@
+var createAggregator = require('../internal/createAggregator');
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Creates an object composed of keys generated from the results of running
+ * each element of `collection` through `iteratee`. The corresponding value
+ * of each key is the number of times the key was returned by `iteratee`.
+ * The `iteratee` is bound to `thisArg` and invoked with three arguments:
+ * (value, index|key, collection).
+ *
+ * If a property name is provided for `iteratee` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `iteratee` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Object} Returns the composed aggregate object.
+ * @example
+ *
+ * _.countBy([4.3, 6.1, 6.4], function(n) {
+ * return Math.floor(n);
+ * });
+ * // => { '4': 1, '6': 2 }
+ *
+ * _.countBy([4.3, 6.1, 6.4], function(n) {
+ * return this.floor(n);
+ * }, Math);
+ * // => { '4': 1, '6': 2 }
+ *
+ * _.countBy(['one', 'two', 'three'], 'length');
+ * // => { '3': 2, '5': 1 }
+ */
+var countBy = createAggregator(function(result, value, key) {
+ hasOwnProperty.call(result, key) ? ++result[key] : (result[key] = 1);
+});
+
+module.exports = countBy;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/detect.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/detect.js
new file mode 100644
index 00000000000..2fb6303efb4
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/detect.js
@@ -0,0 +1 @@
+module.exports = require('./find');
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/each.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/each.js
new file mode 100644
index 00000000000..8800f42046e
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/each.js
@@ -0,0 +1 @@
+module.exports = require('./forEach');
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/eachRight.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/eachRight.js
new file mode 100644
index 00000000000..3252b2aba32
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/eachRight.js
@@ -0,0 +1 @@
+module.exports = require('./forEachRight');
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/every.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/every.js
new file mode 100644
index 00000000000..a04d3db6377
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/every.js
@@ -0,0 +1,66 @@
+var arrayEvery = require('../internal/arrayEvery'),
+ baseCallback = require('../internal/baseCallback'),
+ baseEvery = require('../internal/baseEvery'),
+ isArray = require('../lang/isArray'),
+ isIterateeCall = require('../internal/isIterateeCall');
+
+/**
+ * Checks if `predicate` returns truthy for **all** elements of `collection`.
+ * The predicate is bound to `thisArg` and invoked with three arguments:
+ * (value, index|key, collection).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @alias all
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {boolean} Returns `true` if all elements pass the predicate check,
+ * else `false`.
+ * @example
+ *
+ * _.every([true, 1, null, 'yes'], Boolean);
+ * // => false
+ *
+ * var users = [
+ * { 'user': 'barney', 'active': false },
+ * { 'user': 'fred', 'active': false }
+ * ];
+ *
+ * // using the `_.matches` callback shorthand
+ * _.every(users, { 'user': 'barney', 'active': false });
+ * // => false
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.every(users, 'active', false);
+ * // => true
+ *
+ * // using the `_.property` callback shorthand
+ * _.every(users, 'active');
+ * // => false
+ */
+function every(collection, predicate, thisArg) {
+ var func = isArray(collection) ? arrayEvery : baseEvery;
+ if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
+ predicate = null;
+ }
+ if (typeof predicate != 'function' || thisArg !== undefined) {
+ predicate = baseCallback(predicate, thisArg, 3);
+ }
+ return func(collection, predicate);
+}
+
+module.exports = every;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/filter.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/filter.js
new file mode 100644
index 00000000000..7620aa76195
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/filter.js
@@ -0,0 +1,61 @@
+var arrayFilter = require('../internal/arrayFilter'),
+ baseCallback = require('../internal/baseCallback'),
+ baseFilter = require('../internal/baseFilter'),
+ isArray = require('../lang/isArray');
+
+/**
+ * Iterates over elements of `collection`, returning an array of all elements
+ * `predicate` returns truthy for. The predicate is bound to `thisArg` and
+ * invoked with three arguments: (value, index|key, collection).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @alias select
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {Array} Returns the new filtered array.
+ * @example
+ *
+ * _.filter([4, 5, 6], function(n) {
+ * return n % 2 == 0;
+ * });
+ * // => [4, 6]
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36, 'active': true },
+ * { 'user': 'fred', 'age': 40, 'active': false }
+ * ];
+ *
+ * // using the `_.matches` callback shorthand
+ * _.pluck(_.filter(users, { 'age': 36, 'active': true }), 'user');
+ * // => ['barney']
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.pluck(_.filter(users, 'active', false), 'user');
+ * // => ['fred']
+ *
+ * // using the `_.property` callback shorthand
+ * _.pluck(_.filter(users, 'active'), 'user');
+ * // => ['barney']
+ */
+function filter(collection, predicate, thisArg) {
+ var func = isArray(collection) ? arrayFilter : baseFilter;
+ predicate = baseCallback(predicate, thisArg, 3);
+ return func(collection, predicate);
+}
+
+module.exports = filter;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/find.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/find.js
new file mode 100644
index 00000000000..7358cfe86cb
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/find.js
@@ -0,0 +1,56 @@
+var baseEach = require('../internal/baseEach'),
+ createFind = require('../internal/createFind');
+
+/**
+ * Iterates over elements of `collection`, returning the first element
+ * `predicate` returns truthy for. The predicate is bound to `thisArg` and
+ * invoked with three arguments: (value, index|key, collection).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @alias detect
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to search.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {*} Returns the matched element, else `undefined`.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36, 'active': true },
+ * { 'user': 'fred', 'age': 40, 'active': false },
+ * { 'user': 'pebbles', 'age': 1, 'active': true }
+ * ];
+ *
+ * _.result(_.find(users, function(chr) {
+ * return chr.age < 40;
+ * }), 'user');
+ * // => 'barney'
+ *
+ * // using the `_.matches` callback shorthand
+ * _.result(_.find(users, { 'age': 1, 'active': true }), 'user');
+ * // => 'pebbles'
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.result(_.find(users, 'active', false), 'user');
+ * // => 'fred'
+ *
+ * // using the `_.property` callback shorthand
+ * _.result(_.find(users, 'active'), 'user');
+ * // => 'barney'
+ */
+var find = createFind(baseEach);
+
+module.exports = find;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/findLast.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/findLast.js
new file mode 100644
index 00000000000..75dbadca240
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/findLast.js
@@ -0,0 +1,25 @@
+var baseEachRight = require('../internal/baseEachRight'),
+ createFind = require('../internal/createFind');
+
+/**
+ * This method is like `_.find` except that it iterates over elements of
+ * `collection` from right to left.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to search.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {*} Returns the matched element, else `undefined`.
+ * @example
+ *
+ * _.findLast([1, 2, 3, 4], function(n) {
+ * return n % 2 == 1;
+ * });
+ * // => 3
+ */
+var findLast = createFind(baseEachRight, true);
+
+module.exports = findLast;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/findWhere.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/findWhere.js
new file mode 100644
index 00000000000..2d620655ed4
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/findWhere.js
@@ -0,0 +1,37 @@
+var baseMatches = require('../internal/baseMatches'),
+ find = require('./find');
+
+/**
+ * Performs a deep comparison between each element in `collection` and the
+ * source object, returning the first element that has equivalent property
+ * values.
+ *
+ * **Note:** This method supports comparing arrays, booleans, `Date` objects,
+ * numbers, `Object` objects, regexes, and strings. Objects are compared by
+ * their own, not inherited, enumerable properties. For comparing a single
+ * own or inherited property value see `_.matchesProperty`.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to search.
+ * @param {Object} source The object of property values to match.
+ * @returns {*} Returns the matched element, else `undefined`.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36, 'active': true },
+ * { 'user': 'fred', 'age': 40, 'active': false }
+ * ];
+ *
+ * _.result(_.findWhere(users, { 'age': 36, 'active': true }), 'user');
+ * // => 'barney'
+ *
+ * _.result(_.findWhere(users, { 'age': 40, 'active': false }), 'user');
+ * // => 'fred'
+ */
+function findWhere(collection, source) {
+ return find(collection, baseMatches(source));
+}
+
+module.exports = findWhere;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/foldl.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/foldl.js
new file mode 100644
index 00000000000..26f53cf7b26
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/foldl.js
@@ -0,0 +1 @@
+module.exports = require('./reduce');
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/foldr.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/foldr.js
new file mode 100644
index 00000000000..8fb199eda60
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/foldr.js
@@ -0,0 +1 @@
+module.exports = require('./reduceRight');
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/forEach.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/forEach.js
new file mode 100644
index 00000000000..05a8e2140eb
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/forEach.js
@@ -0,0 +1,37 @@
+var arrayEach = require('../internal/arrayEach'),
+ baseEach = require('../internal/baseEach'),
+ createForEach = require('../internal/createForEach');
+
+/**
+ * Iterates over elements of `collection` invoking `iteratee` for each element.
+ * The `iteratee` is bound to `thisArg` and invoked with three arguments:
+ * (value, index|key, collection). Iteratee functions may exit iteration early
+ * by explicitly returning `false`.
+ *
+ * **Note:** As with other "Collections" methods, objects with a "length" property
+ * are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn`
+ * may be used for object iteration.
+ *
+ * @static
+ * @memberOf _
+ * @alias each
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Array|Object|string} Returns `collection`.
+ * @example
+ *
+ * _([1, 2]).forEach(function(n) {
+ * console.log(n);
+ * }).value();
+ * // => logs each value from left to right and returns the array
+ *
+ * _.forEach({ 'a': 1, 'b': 2 }, function(n, key) {
+ * console.log(n, key);
+ * });
+ * // => logs each value-key pair and returns the object (iteration order is not guaranteed)
+ */
+var forEach = createForEach(arrayEach, baseEach);
+
+module.exports = forEach;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/forEachRight.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/forEachRight.js
new file mode 100644
index 00000000000..34997110024
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/forEachRight.js
@@ -0,0 +1,26 @@
+var arrayEachRight = require('../internal/arrayEachRight'),
+ baseEachRight = require('../internal/baseEachRight'),
+ createForEach = require('../internal/createForEach');
+
+/**
+ * This method is like `_.forEach` except that it iterates over elements of
+ * `collection` from right to left.
+ *
+ * @static
+ * @memberOf _
+ * @alias eachRight
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Array|Object|string} Returns `collection`.
+ * @example
+ *
+ * _([1, 2]).forEachRight(function(n) {
+ * console.log(n);
+ * }).value();
+ * // => logs each value from right to left and returns the array
+ */
+var forEachRight = createForEach(arrayEachRight, baseEachRight);
+
+module.exports = forEachRight;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/groupBy.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/groupBy.js
new file mode 100644
index 00000000000..a925c894a0d
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/groupBy.js
@@ -0,0 +1,59 @@
+var createAggregator = require('../internal/createAggregator');
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Creates an object composed of keys generated from the results of running
+ * each element of `collection` through `iteratee`. The corresponding value
+ * of each key is an array of the elements responsible for generating the key.
+ * The `iteratee` is bound to `thisArg` and invoked with three arguments:
+ * (value, index|key, collection).
+ *
+ * If a property name is provided for `iteratee` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `iteratee` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Object} Returns the composed aggregate object.
+ * @example
+ *
+ * _.groupBy([4.2, 6.1, 6.4], function(n) {
+ * return Math.floor(n);
+ * });
+ * // => { '4': [4.2], '6': [6.1, 6.4] }
+ *
+ * _.groupBy([4.2, 6.1, 6.4], function(n) {
+ * return this.floor(n);
+ * }, Math);
+ * // => { '4': [4.2], '6': [6.1, 6.4] }
+ *
+ * // using the `_.property` callback shorthand
+ * _.groupBy(['one', 'two', 'three'], 'length');
+ * // => { '3': ['one', 'two'], '5': ['three'] }
+ */
+var groupBy = createAggregator(function(result, value, key) {
+ if (hasOwnProperty.call(result, key)) {
+ result[key].push(value);
+ } else {
+ result[key] = [value];
+ }
+});
+
+module.exports = groupBy;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/include.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/include.js
new file mode 100644
index 00000000000..594722af59a
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/include.js
@@ -0,0 +1 @@
+module.exports = require('./includes');
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/includes.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/includes.js
new file mode 100644
index 00000000000..80c90e1e3fd
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/includes.js
@@ -0,0 +1,60 @@
+var baseIndexOf = require('../internal/baseIndexOf'),
+ getLength = require('../internal/getLength'),
+ isArray = require('../lang/isArray'),
+ isIterateeCall = require('../internal/isIterateeCall'),
+ isLength = require('../internal/isLength'),
+ isString = require('../lang/isString'),
+ values = require('../object/values');
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max;
+
+/**
+ * Checks if `value` is in `collection` using
+ * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
+ * for equality comparisons. If `fromIndex` is negative, it is used as the offset
+ * from the end of `collection`.
+ *
+ * @static
+ * @memberOf _
+ * @alias contains, include
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to search.
+ * @param {*} target The value to search for.
+ * @param {number} [fromIndex=0] The index to search from.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`.
+ * @returns {boolean} Returns `true` if a matching element is found, else `false`.
+ * @example
+ *
+ * _.includes([1, 2, 3], 1);
+ * // => true
+ *
+ * _.includes([1, 2, 3], 1, 2);
+ * // => false
+ *
+ * _.includes({ 'user': 'fred', 'age': 40 }, 'fred');
+ * // => true
+ *
+ * _.includes('pebbles', 'eb');
+ * // => true
+ */
+function includes(collection, target, fromIndex, guard) {
+ var length = collection ? getLength(collection) : 0;
+ if (!isLength(length)) {
+ collection = values(collection);
+ length = collection.length;
+ }
+ if (!length) {
+ return false;
+ }
+ if (typeof fromIndex != 'number' || (guard && isIterateeCall(target, fromIndex, guard))) {
+ fromIndex = 0;
+ } else {
+ fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0);
+ }
+ return (typeof collection == 'string' || !isArray(collection) && isString(collection))
+ ? (fromIndex < length && collection.indexOf(target, fromIndex) > -1)
+ : (baseIndexOf(collection, target, fromIndex) > -1);
+}
+
+module.exports = includes;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/indexBy.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/indexBy.js
new file mode 100644
index 00000000000..34a941e7290
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/indexBy.js
@@ -0,0 +1,53 @@
+var createAggregator = require('../internal/createAggregator');
+
+/**
+ * Creates an object composed of keys generated from the results of running
+ * each element of `collection` through `iteratee`. The corresponding value
+ * of each key is the last element responsible for generating the key. The
+ * iteratee function is bound to `thisArg` and invoked with three arguments:
+ * (value, index|key, collection).
+ *
+ * If a property name is provided for `iteratee` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `iteratee` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Object} Returns the composed aggregate object.
+ * @example
+ *
+ * var keyData = [
+ * { 'dir': 'left', 'code': 97 },
+ * { 'dir': 'right', 'code': 100 }
+ * ];
+ *
+ * _.indexBy(keyData, 'dir');
+ * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
+ *
+ * _.indexBy(keyData, function(object) {
+ * return String.fromCharCode(object.code);
+ * });
+ * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
+ *
+ * _.indexBy(keyData, function(object) {
+ * return this.fromCharCode(object.code);
+ * }, String);
+ * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
+ */
+var indexBy = createAggregator(function(result, value, key) {
+ result[key] = value;
+});
+
+module.exports = indexBy;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/inject.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/inject.js
new file mode 100644
index 00000000000..26f53cf7b26
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/inject.js
@@ -0,0 +1 @@
+module.exports = require('./reduce');
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/invoke.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/invoke.js
new file mode 100644
index 00000000000..0a0a84cdbe2
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/invoke.js
@@ -0,0 +1,42 @@
+var baseEach = require('../internal/baseEach'),
+ invokePath = require('../internal/invokePath'),
+ isArrayLike = require('../internal/isArrayLike'),
+ isKey = require('../internal/isKey'),
+ restParam = require('../function/restParam');
+
+/**
+ * Invokes the method at `path` of each element in `collection`, returning
+ * an array of the results of each invoked method. Any additional arguments
+ * are provided to each invoked method. If `methodName` is a function it is
+ * invoked for, and `this` bound to, each element in `collection`.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Array|Function|string} path The path of the method to invoke or
+ * the function invoked per iteration.
+ * @param {...*} [args] The arguments to invoke the method with.
+ * @returns {Array} Returns the array of results.
+ * @example
+ *
+ * _.invoke([[5, 1, 7], [3, 2, 1]], 'sort');
+ * // => [[1, 5, 7], [1, 2, 3]]
+ *
+ * _.invoke([123, 456], String.prototype.split, '');
+ * // => [['1', '2', '3'], ['4', '5', '6']]
+ */
+var invoke = restParam(function(collection, path, args) {
+ var index = -1,
+ isFunc = typeof path == 'function',
+ isProp = isKey(path),
+ result = isArrayLike(collection) ? Array(collection.length) : [];
+
+ baseEach(collection, function(value) {
+ var func = isFunc ? path : ((isProp && value != null) ? value[path] : null);
+ result[++index] = func ? func.apply(value, args) : invokePath(value, path, args);
+ });
+ return result;
+});
+
+module.exports = invoke;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/map.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/map.js
new file mode 100644
index 00000000000..5381110df12
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/map.js
@@ -0,0 +1,68 @@
+var arrayMap = require('../internal/arrayMap'),
+ baseCallback = require('../internal/baseCallback'),
+ baseMap = require('../internal/baseMap'),
+ isArray = require('../lang/isArray');
+
+/**
+ * Creates an array of values by running each element in `collection` through
+ * `iteratee`. The `iteratee` is bound to `thisArg` and invoked with three
+ * arguments: (value, index|key, collection).
+ *
+ * If a property name is provided for `iteratee` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `iteratee` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * Many lodash methods are guarded to work as iteratees for methods like
+ * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
+ *
+ * The guarded methods are:
+ * `ary`, `callback`, `chunk`, `clone`, `create`, `curry`, `curryRight`,
+ * `drop`, `dropRight`, `every`, `fill`, `flatten`, `invert`, `max`, `min`,
+ * `parseInt`, `slice`, `sortBy`, `take`, `takeRight`, `template`, `trim`,
+ * `trimLeft`, `trimRight`, `trunc`, `random`, `range`, `sample`, `some`,
+ * `sum`, `uniq`, and `words`
+ *
+ * @static
+ * @memberOf _
+ * @alias collect
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Array} Returns the new mapped array.
+ * @example
+ *
+ * function timesThree(n) {
+ * return n * 3;
+ * }
+ *
+ * _.map([1, 2], timesThree);
+ * // => [3, 6]
+ *
+ * _.map({ 'a': 1, 'b': 2 }, timesThree);
+ * // => [3, 6] (iteration order is not guaranteed)
+ *
+ * var users = [
+ * { 'user': 'barney' },
+ * { 'user': 'fred' }
+ * ];
+ *
+ * // using the `_.property` callback shorthand
+ * _.map(users, 'user');
+ * // => ['barney', 'fred']
+ */
+function map(collection, iteratee, thisArg) {
+ var func = isArray(collection) ? arrayMap : baseMap;
+ iteratee = baseCallback(iteratee, thisArg, 3);
+ return func(collection, iteratee);
+}
+
+module.exports = map;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/max.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/max.js
new file mode 100644
index 00000000000..bb1d213c33b
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/max.js
@@ -0,0 +1 @@
+module.exports = require('../math/max');
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/min.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/min.js
new file mode 100644
index 00000000000..eef13d02b8a
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/min.js
@@ -0,0 +1 @@
+module.exports = require('../math/min');
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/partition.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/partition.js
new file mode 100644
index 00000000000..ee35f27d930
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/partition.js
@@ -0,0 +1,66 @@
+var createAggregator = require('../internal/createAggregator');
+
+/**
+ * Creates an array of elements split into two groups, the first of which
+ * contains elements `predicate` returns truthy for, while the second of which
+ * contains elements `predicate` returns falsey for. The predicate is bound
+ * to `thisArg` and invoked with three arguments: (value, index|key, collection).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {Array} Returns the array of grouped elements.
+ * @example
+ *
+ * _.partition([1, 2, 3], function(n) {
+ * return n % 2;
+ * });
+ * // => [[1, 3], [2]]
+ *
+ * _.partition([1.2, 2.3, 3.4], function(n) {
+ * return this.floor(n) % 2;
+ * }, Math);
+ * // => [[1.2, 3.4], [2.3]]
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36, 'active': false },
+ * { 'user': 'fred', 'age': 40, 'active': true },
+ * { 'user': 'pebbles', 'age': 1, 'active': false }
+ * ];
+ *
+ * var mapper = function(array) {
+ * return _.pluck(array, 'user');
+ * };
+ *
+ * // using the `_.matches` callback shorthand
+ * _.map(_.partition(users, { 'age': 1, 'active': false }), mapper);
+ * // => [['pebbles'], ['barney', 'fred']]
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.map(_.partition(users, 'active', false), mapper);
+ * // => [['barney', 'pebbles'], ['fred']]
+ *
+ * // using the `_.property` callback shorthand
+ * _.map(_.partition(users, 'active'), mapper);
+ * // => [['fred'], ['barney', 'pebbles']]
+ */
+var partition = createAggregator(function(result, value, key) {
+ result[key ? 0 : 1].push(value);
+}, function() { return [[], []]; });
+
+module.exports = partition;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/pluck.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/pluck.js
new file mode 100644
index 00000000000..5ee1ec84eec
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/pluck.js
@@ -0,0 +1,31 @@
+var map = require('./map'),
+ property = require('../utility/property');
+
+/**
+ * Gets the property value of `path` from all elements in `collection`.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Array|string} path The path of the property to pluck.
+ * @returns {Array} Returns the property values.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36 },
+ * { 'user': 'fred', 'age': 40 }
+ * ];
+ *
+ * _.pluck(users, 'user');
+ * // => ['barney', 'fred']
+ *
+ * var userIndex = _.indexBy(users, 'user');
+ * _.pluck(userIndex, 'age');
+ * // => [36, 40] (iteration order is not guaranteed)
+ */
+function pluck(collection, path) {
+ return map(collection, property(path));
+}
+
+module.exports = pluck;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/reduce.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/reduce.js
new file mode 100644
index 00000000000..da97655c198
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/reduce.js
@@ -0,0 +1,43 @@
+var arrayReduce = require('../internal/arrayReduce'),
+ baseEach = require('../internal/baseEach'),
+ createReduce = require('../internal/createReduce');
+
+/**
+ * Reduces `collection` to a value which is the accumulated result of running
+ * each element in `collection` through `iteratee`, where each successive
+ * invocation is supplied the return value of the previous. If `accumulator`
+ * is not provided the first element of `collection` is used as the initial
+ * value. The `iteratee` is bound to `thisArg` and invoked with four arguments:
+ * (accumulator, value, index|key, collection).
+ *
+ * Many lodash methods are guarded to work as iteratees for methods like
+ * `_.reduce`, `_.reduceRight`, and `_.transform`.
+ *
+ * The guarded methods are:
+ * `assign`, `defaults`, `includes`, `merge`, `sortByAll`, and `sortByOrder`
+ *
+ * @static
+ * @memberOf _
+ * @alias foldl, inject
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @param {*} [accumulator] The initial value.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {*} Returns the accumulated value.
+ * @example
+ *
+ * _.reduce([1, 2], function(total, n) {
+ * return total + n;
+ * });
+ * // => 3
+ *
+ * _.reduce({ 'a': 1, 'b': 2 }, function(result, n, key) {
+ * result[key] = n * 3;
+ * return result;
+ * }, {});
+ * // => { 'a': 3, 'b': 6 } (iteration order is not guaranteed)
+ */
+var reduce = createReduce(arrayReduce, baseEach);
+
+module.exports = reduce;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/reduceRight.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/reduceRight.js
new file mode 100644
index 00000000000..5a5753b9c21
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/reduceRight.js
@@ -0,0 +1,29 @@
+var arrayReduceRight = require('../internal/arrayReduceRight'),
+ baseEachRight = require('../internal/baseEachRight'),
+ createReduce = require('../internal/createReduce');
+
+/**
+ * This method is like `_.reduce` except that it iterates over elements of
+ * `collection` from right to left.
+ *
+ * @static
+ * @memberOf _
+ * @alias foldr
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @param {*} [accumulator] The initial value.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {*} Returns the accumulated value.
+ * @example
+ *
+ * var array = [[0, 1], [2, 3], [4, 5]];
+ *
+ * _.reduceRight(array, function(flattened, other) {
+ * return flattened.concat(other);
+ * }, []);
+ * // => [4, 5, 2, 3, 0, 1]
+ */
+var reduceRight = createReduce(arrayReduceRight, baseEachRight);
+
+module.exports = reduceRight;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/reject.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/reject.js
new file mode 100644
index 00000000000..55924539b52
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/reject.js
@@ -0,0 +1,50 @@
+var arrayFilter = require('../internal/arrayFilter'),
+ baseCallback = require('../internal/baseCallback'),
+ baseFilter = require('../internal/baseFilter'),
+ isArray = require('../lang/isArray');
+
+/**
+ * The opposite of `_.filter`; this method returns the elements of `collection`
+ * that `predicate` does **not** return truthy for.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {Array} Returns the new filtered array.
+ * @example
+ *
+ * _.reject([1, 2, 3, 4], function(n) {
+ * return n % 2 == 0;
+ * });
+ * // => [1, 3]
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36, 'active': false },
+ * { 'user': 'fred', 'age': 40, 'active': true }
+ * ];
+ *
+ * // using the `_.matches` callback shorthand
+ * _.pluck(_.reject(users, { 'age': 40, 'active': true }), 'user');
+ * // => ['barney']
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.pluck(_.reject(users, 'active', false), 'user');
+ * // => ['fred']
+ *
+ * // using the `_.property` callback shorthand
+ * _.pluck(_.reject(users, 'active'), 'user');
+ * // => ['barney']
+ */
+function reject(collection, predicate, thisArg) {
+ var func = isArray(collection) ? arrayFilter : baseFilter;
+ predicate = baseCallback(predicate, thisArg, 3);
+ return func(collection, function(value, index, collection) {
+ return !predicate(value, index, collection);
+ });
+}
+
+module.exports = reject;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/sample.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/sample.js
new file mode 100644
index 00000000000..8e015330162
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/sample.js
@@ -0,0 +1,50 @@
+var baseRandom = require('../internal/baseRandom'),
+ isIterateeCall = require('../internal/isIterateeCall'),
+ toArray = require('../lang/toArray'),
+ toIterable = require('../internal/toIterable');
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMin = Math.min;
+
+/**
+ * Gets a random element or `n` random elements from a collection.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to sample.
+ * @param {number} [n] The number of elements to sample.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {*} Returns the random sample(s).
+ * @example
+ *
+ * _.sample([1, 2, 3, 4]);
+ * // => 2
+ *
+ * _.sample([1, 2, 3, 4], 2);
+ * // => [3, 1]
+ */
+function sample(collection, n, guard) {
+ if (guard ? isIterateeCall(collection, n, guard) : n == null) {
+ collection = toIterable(collection);
+ var length = collection.length;
+ return length > 0 ? collection[baseRandom(0, length - 1)] : undefined;
+ }
+ var index = -1,
+ result = toArray(collection),
+ length = result.length,
+ lastIndex = length - 1;
+
+ n = nativeMin(n < 0 ? 0 : (+n || 0), length);
+ while (++index < n) {
+ var rand = baseRandom(index, lastIndex),
+ value = result[rand];
+
+ result[rand] = result[index];
+ result[index] = value;
+ }
+ result.length = n;
+ return result;
+}
+
+module.exports = sample;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/select.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/select.js
new file mode 100644
index 00000000000..ade80f6fbae
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/select.js
@@ -0,0 +1 @@
+module.exports = require('./filter');
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/shuffle.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/shuffle.js
new file mode 100644
index 00000000000..949689c5fc7
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/shuffle.js
@@ -0,0 +1,24 @@
+var sample = require('./sample');
+
+/** Used as references for `-Infinity` and `Infinity`. */
+var POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
+
+/**
+ * Creates an array of shuffled values, using a version of the
+ * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to shuffle.
+ * @returns {Array} Returns the new shuffled array.
+ * @example
+ *
+ * _.shuffle([1, 2, 3, 4]);
+ * // => [4, 1, 3, 2]
+ */
+function shuffle(collection) {
+ return sample(collection, POSITIVE_INFINITY);
+}
+
+module.exports = shuffle;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/size.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/size.js
new file mode 100644
index 00000000000..78dcf4ce9be
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/size.js
@@ -0,0 +1,30 @@
+var getLength = require('../internal/getLength'),
+ isLength = require('../internal/isLength'),
+ keys = require('../object/keys');
+
+/**
+ * Gets the size of `collection` by returning its length for array-like
+ * values or the number of own enumerable properties for objects.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to inspect.
+ * @returns {number} Returns the size of `collection`.
+ * @example
+ *
+ * _.size([1, 2, 3]);
+ * // => 3
+ *
+ * _.size({ 'a': 1, 'b': 2 });
+ * // => 2
+ *
+ * _.size('pebbles');
+ * // => 7
+ */
+function size(collection) {
+ var length = collection ? getLength(collection) : 0;
+ return isLength(length) ? length : keys(collection).length;
+}
+
+module.exports = size;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/some.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/some.js
new file mode 100644
index 00000000000..2b866b464b6
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/some.js
@@ -0,0 +1,67 @@
+var arraySome = require('../internal/arraySome'),
+ baseCallback = require('../internal/baseCallback'),
+ baseSome = require('../internal/baseSome'),
+ isArray = require('../lang/isArray'),
+ isIterateeCall = require('../internal/isIterateeCall');
+
+/**
+ * Checks if `predicate` returns truthy for **any** element of `collection`.
+ * The function returns as soon as it finds a passing value and does not iterate
+ * over the entire collection. The predicate is bound to `thisArg` and invoked
+ * with three arguments: (value, index|key, collection).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @alias any
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {boolean} Returns `true` if any element passes the predicate check,
+ * else `false`.
+ * @example
+ *
+ * _.some([null, 0, 'yes', false], Boolean);
+ * // => true
+ *
+ * var users = [
+ * { 'user': 'barney', 'active': true },
+ * { 'user': 'fred', 'active': false }
+ * ];
+ *
+ * // using the `_.matches` callback shorthand
+ * _.some(users, { 'user': 'barney', 'active': false });
+ * // => false
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.some(users, 'active', false);
+ * // => true
+ *
+ * // using the `_.property` callback shorthand
+ * _.some(users, 'active');
+ * // => true
+ */
+function some(collection, predicate, thisArg) {
+ var func = isArray(collection) ? arraySome : baseSome;
+ if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
+ predicate = null;
+ }
+ if (typeof predicate != 'function' || thisArg !== undefined) {
+ predicate = baseCallback(predicate, thisArg, 3);
+ }
+ return func(collection, predicate);
+}
+
+module.exports = some;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/sortBy.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/sortBy.js
new file mode 100644
index 00000000000..28d75f56dac
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/sortBy.js
@@ -0,0 +1,71 @@
+var baseCallback = require('../internal/baseCallback'),
+ baseMap = require('../internal/baseMap'),
+ baseSortBy = require('../internal/baseSortBy'),
+ compareAscending = require('../internal/compareAscending'),
+ isIterateeCall = require('../internal/isIterateeCall');
+
+/**
+ * Creates an array of elements, sorted in ascending order by the results of
+ * running each element in a collection through `iteratee`. This method performs
+ * a stable sort, that is, it preserves the original sort order of equal elements.
+ * The `iteratee` is bound to `thisArg` and invoked with three arguments:
+ * (value, index|key, collection).
+ *
+ * If a property name is provided for `iteratee` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `iteratee` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Array} Returns the new sorted array.
+ * @example
+ *
+ * _.sortBy([1, 2, 3], function(n) {
+ * return Math.sin(n);
+ * });
+ * // => [3, 1, 2]
+ *
+ * _.sortBy([1, 2, 3], function(n) {
+ * return this.sin(n);
+ * }, Math);
+ * // => [3, 1, 2]
+ *
+ * var users = [
+ * { 'user': 'fred' },
+ * { 'user': 'pebbles' },
+ * { 'user': 'barney' }
+ * ];
+ *
+ * // using the `_.property` callback shorthand
+ * _.pluck(_.sortBy(users, 'user'), 'user');
+ * // => ['barney', 'fred', 'pebbles']
+ */
+function sortBy(collection, iteratee, thisArg) {
+ if (collection == null) {
+ return [];
+ }
+ if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
+ iteratee = null;
+ }
+ var index = -1;
+ iteratee = baseCallback(iteratee, thisArg, 3);
+
+ var result = baseMap(collection, function(value, key, collection) {
+ return { 'criteria': iteratee(value, key, collection), 'index': ++index, 'value': value };
+ });
+ return baseSortBy(result, compareAscending);
+}
+
+module.exports = sortBy;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/sortByAll.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/sortByAll.js
new file mode 100644
index 00000000000..4766c209855
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/sortByAll.js
@@ -0,0 +1,52 @@
+var baseFlatten = require('../internal/baseFlatten'),
+ baseSortByOrder = require('../internal/baseSortByOrder'),
+ isIterateeCall = require('../internal/isIterateeCall'),
+ restParam = require('../function/restParam');
+
+/**
+ * This method is like `_.sortBy` except that it can sort by multiple iteratees
+ * or property names.
+ *
+ * If a property name is provided for an iteratee the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If an object is provided for an iteratee the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {...(Function|Function[]|Object|Object[]|string|string[])} iteratees
+ * The iteratees to sort by, specified as individual values or arrays of values.
+ * @returns {Array} Returns the new sorted array.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'fred', 'age': 48 },
+ * { 'user': 'barney', 'age': 36 },
+ * { 'user': 'fred', 'age': 42 },
+ * { 'user': 'barney', 'age': 34 }
+ * ];
+ *
+ * _.map(_.sortByAll(users, ['user', 'age']), _.values);
+ * // => [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]]
+ *
+ * _.map(_.sortByAll(users, 'user', function(chr) {
+ * return Math.floor(chr.age / 10);
+ * }), _.values);
+ * // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]
+ */
+var sortByAll = restParam(function(collection, iteratees) {
+ if (collection == null) {
+ return [];
+ }
+ var guard = iteratees[2];
+ if (guard && isIterateeCall(iteratees[0], iteratees[1], guard)) {
+ iteratees.length = 1;
+ }
+ return baseSortByOrder(collection, baseFlatten(iteratees), []);
+});
+
+module.exports = sortByAll;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/sortByOrder.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/sortByOrder.js
new file mode 100644
index 00000000000..c704eeb61f2
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/sortByOrder.js
@@ -0,0 +1,55 @@
+var baseSortByOrder = require('../internal/baseSortByOrder'),
+ isArray = require('../lang/isArray'),
+ isIterateeCall = require('../internal/isIterateeCall');
+
+/**
+ * This method is like `_.sortByAll` except that it allows specifying the
+ * sort orders of the iteratees to sort by. A truthy value in `orders` will
+ * sort the corresponding property name in ascending order while a falsey
+ * value will sort it in descending order.
+ *
+ * If a property name is provided for an iteratee the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If an object is provided for an iteratee the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
+ * @param {boolean[]} orders The sort orders of `iteratees`.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`.
+ * @returns {Array} Returns the new sorted array.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'fred', 'age': 48 },
+ * { 'user': 'barney', 'age': 34 },
+ * { 'user': 'fred', 'age': 42 },
+ * { 'user': 'barney', 'age': 36 }
+ * ];
+ *
+ * // sort by `user` in ascending order and by `age` in descending order
+ * _.map(_.sortByOrder(users, ['user', 'age'], [true, false]), _.values);
+ * // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]
+ */
+function sortByOrder(collection, iteratees, orders, guard) {
+ if (collection == null) {
+ return [];
+ }
+ if (guard && isIterateeCall(iteratees, orders, guard)) {
+ orders = null;
+ }
+ if (!isArray(iteratees)) {
+ iteratees = iteratees == null ? [] : [iteratees];
+ }
+ if (!isArray(orders)) {
+ orders = orders == null ? [] : [orders];
+ }
+ return baseSortByOrder(collection, iteratees, orders);
+}
+
+module.exports = sortByOrder;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/sum.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/sum.js
new file mode 100644
index 00000000000..a2e93808ae8
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/sum.js
@@ -0,0 +1 @@
+module.exports = require('../math/sum');
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/where.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/where.js
new file mode 100644
index 00000000000..f603bf8ce49
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/where.js
@@ -0,0 +1,37 @@
+var baseMatches = require('../internal/baseMatches'),
+ filter = require('./filter');
+
+/**
+ * Performs a deep comparison between each element in `collection` and the
+ * source object, returning an array of all elements that have equivalent
+ * property values.
+ *
+ * **Note:** This method supports comparing arrays, booleans, `Date` objects,
+ * numbers, `Object` objects, regexes, and strings. Objects are compared by
+ * their own, not inherited, enumerable properties. For comparing a single
+ * own or inherited property value see `_.matchesProperty`.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to search.
+ * @param {Object} source The object of property values to match.
+ * @returns {Array} Returns the new filtered array.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36, 'active': false, 'pets': ['hoppy'] },
+ * { 'user': 'fred', 'age': 40, 'active': true, 'pets': ['baby puss', 'dino'] }
+ * ];
+ *
+ * _.pluck(_.where(users, { 'age': 36, 'active': false }), 'user');
+ * // => ['barney']
+ *
+ * _.pluck(_.where(users, { 'pets': ['dino'] }), 'user');
+ * // => ['fred']
+ */
+function where(collection, source) {
+ return filter(collection, baseMatches(source));
+}
+
+module.exports = where;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/date.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/date.js
new file mode 100644
index 00000000000..195366e7776
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/date.js
@@ -0,0 +1,3 @@
+module.exports = {
+ 'now': require('./date/now')
+};
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/date/now.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/date/now.js
new file mode 100644
index 00000000000..ffe3060e5b9
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/date/now.js
@@ -0,0 +1,24 @@
+var getNative = require('../internal/getNative');
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeNow = getNative(Date, 'now');
+
+/**
+ * Gets the number of milliseconds that have elapsed since the Unix epoch
+ * (1 January 1970 00:00:00 UTC).
+ *
+ * @static
+ * @memberOf _
+ * @category Date
+ * @example
+ *
+ * _.defer(function(stamp) {
+ * console.log(_.now() - stamp);
+ * }, _.now());
+ * // => logs the number of milliseconds it took for the deferred function to be invoked
+ */
+var now = nativeNow || function() {
+ return new Date().getTime();
+};
+
+module.exports = now;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function.js
new file mode 100644
index 00000000000..2cacde1ee59
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/function.js
@@ -0,0 +1,27 @@
+module.exports = {
+ 'after': require('./function/after'),
+ 'ary': require('./function/ary'),
+ 'backflow': require('./function/backflow'),
+ 'before': require('./function/before'),
+ 'bind': require('./function/bind'),
+ 'bindAll': require('./function/bindAll'),
+ 'bindKey': require('./function/bindKey'),
+ 'compose': require('./function/compose'),
+ 'curry': require('./function/curry'),
+ 'curryRight': require('./function/curryRight'),
+ 'debounce': require('./function/debounce'),
+ 'defer': require('./function/defer'),
+ 'delay': require('./function/delay'),
+ 'flow': require('./function/flow'),
+ 'flowRight': require('./function/flowRight'),
+ 'memoize': require('./function/memoize'),
+ 'negate': require('./function/negate'),
+ 'once': require('./function/once'),
+ 'partial': require('./function/partial'),
+ 'partialRight': require('./function/partialRight'),
+ 'rearg': require('./function/rearg'),
+ 'restParam': require('./function/restParam'),
+ 'spread': require('./function/spread'),
+ 'throttle': require('./function/throttle'),
+ 'wrap': require('./function/wrap')
+};
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/after.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/after.js
new file mode 100644
index 00000000000..e6a5de407a7
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/after.js
@@ -0,0 +1,48 @@
+/** Used as the `TypeError` message for "Functions" methods. */
+var FUNC_ERROR_TEXT = 'Expected a function';
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeIsFinite = global.isFinite;
+
+/**
+ * The opposite of `_.before`; this method creates a function that invokes
+ * `func` once it is called `n` or more times.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {number} n The number of calls before `func` is invoked.
+ * @param {Function} func The function to restrict.
+ * @returns {Function} Returns the new restricted function.
+ * @example
+ *
+ * var saves = ['profile', 'settings'];
+ *
+ * var done = _.after(saves.length, function() {
+ * console.log('done saving!');
+ * });
+ *
+ * _.forEach(saves, function(type) {
+ * asyncSave({ 'type': type, 'complete': done });
+ * });
+ * // => logs 'done saving!' after the two async saves have completed
+ */
+function after(n, func) {
+ if (typeof func != 'function') {
+ if (typeof n == 'function') {
+ var temp = n;
+ n = func;
+ func = temp;
+ } else {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ }
+ n = nativeIsFinite(n = +n) ? n : 0;
+ return function() {
+ if (--n < 1) {
+ return func.apply(this, arguments);
+ }
+ };
+}
+
+module.exports = after;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/ary.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/ary.js
new file mode 100644
index 00000000000..1bcb6a720d3
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/ary.js
@@ -0,0 +1,34 @@
+var createWrapper = require('../internal/createWrapper'),
+ isIterateeCall = require('../internal/isIterateeCall');
+
+/** Used to compose bitmasks for wrapper metadata. */
+var ARY_FLAG = 128;
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max;
+
+/**
+ * Creates a function that accepts up to `n` arguments ignoring any
+ * additional arguments.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to cap arguments for.
+ * @param {number} [n=func.length] The arity cap.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * _.map(['6', '8', '10'], _.ary(parseInt, 1));
+ * // => [6, 8, 10]
+ */
+function ary(func, n, guard) {
+ if (guard && isIterateeCall(func, n, guard)) {
+ n = null;
+ }
+ n = (func && n == null) ? func.length : nativeMax(+n || 0, 0);
+ return createWrapper(func, ARY_FLAG, null, null, null, null, n);
+}
+
+module.exports = ary;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/backflow.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/backflow.js
new file mode 100644
index 00000000000..1954e942397
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/backflow.js
@@ -0,0 +1 @@
+module.exports = require('./flowRight');
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/before.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/before.js
new file mode 100644
index 00000000000..4afd1e60af1
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/before.js
@@ -0,0 +1,42 @@
+/** Used as the `TypeError` message for "Functions" methods. */
+var FUNC_ERROR_TEXT = 'Expected a function';
+
+/**
+ * Creates a function that invokes `func`, with the `this` binding and arguments
+ * of the created function, while it is called less than `n` times. Subsequent
+ * calls to the created function return the result of the last `func` invocation.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {number} n The number of calls at which `func` is no longer invoked.
+ * @param {Function} func The function to restrict.
+ * @returns {Function} Returns the new restricted function.
+ * @example
+ *
+ * jQuery('#add').on('click', _.before(5, addContactToList));
+ * // => allows adding up to 4 contacts to the list
+ */
+function before(n, func) {
+ var result;
+ if (typeof func != 'function') {
+ if (typeof n == 'function') {
+ var temp = n;
+ n = func;
+ func = temp;
+ } else {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ }
+ return function() {
+ if (--n > 0) {
+ result = func.apply(this, arguments);
+ }
+ if (n <= 1) {
+ func = null;
+ }
+ return result;
+ };
+}
+
+module.exports = before;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/bind.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/bind.js
new file mode 100644
index 00000000000..0de126ae359
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/bind.js
@@ -0,0 +1,56 @@
+var createWrapper = require('../internal/createWrapper'),
+ replaceHolders = require('../internal/replaceHolders'),
+ restParam = require('./restParam');
+
+/** Used to compose bitmasks for wrapper metadata. */
+var BIND_FLAG = 1,
+ PARTIAL_FLAG = 32;
+
+/**
+ * Creates a function that invokes `func` with the `this` binding of `thisArg`
+ * and prepends any additional `_.bind` arguments to those provided to the
+ * bound function.
+ *
+ * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
+ * may be used as a placeholder for partially applied arguments.
+ *
+ * **Note:** Unlike native `Function#bind` this method does not set the "length"
+ * property of bound functions.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to bind.
+ * @param {*} thisArg The `this` binding of `func`.
+ * @param {...*} [partials] The arguments to be partially applied.
+ * @returns {Function} Returns the new bound function.
+ * @example
+ *
+ * var greet = function(greeting, punctuation) {
+ * return greeting + ' ' + this.user + punctuation;
+ * };
+ *
+ * var object = { 'user': 'fred' };
+ *
+ * var bound = _.bind(greet, object, 'hi');
+ * bound('!');
+ * // => 'hi fred!'
+ *
+ * // using placeholders
+ * var bound = _.bind(greet, object, _, '!');
+ * bound('hi');
+ * // => 'hi fred!'
+ */
+var bind = restParam(function(func, thisArg, partials) {
+ var bitmask = BIND_FLAG;
+ if (partials.length) {
+ var holders = replaceHolders(partials, bind.placeholder);
+ bitmask |= PARTIAL_FLAG;
+ }
+ return createWrapper(func, bitmask, thisArg, partials, holders);
+});
+
+// Assign default placeholders.
+bind.placeholder = {};
+
+module.exports = bind;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/bindAll.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/bindAll.js
new file mode 100644
index 00000000000..a09e9485248
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/bindAll.js
@@ -0,0 +1,50 @@
+var baseFlatten = require('../internal/baseFlatten'),
+ createWrapper = require('../internal/createWrapper'),
+ functions = require('../object/functions'),
+ restParam = require('./restParam');
+
+/** Used to compose bitmasks for wrapper metadata. */
+var BIND_FLAG = 1;
+
+/**
+ * Binds methods of an object to the object itself, overwriting the existing
+ * method. Method names may be specified as individual arguments or as arrays
+ * of method names. If no method names are provided all enumerable function
+ * properties, own and inherited, of `object` are bound.
+ *
+ * **Note:** This method does not set the "length" property of bound functions.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Object} object The object to bind and assign the bound methods to.
+ * @param {...(string|string[])} [methodNames] The object method names to bind,
+ * specified as individual method names or arrays of method names.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * var view = {
+ * 'label': 'docs',
+ * 'onClick': function() {
+ * console.log('clicked ' + this.label);
+ * }
+ * };
+ *
+ * _.bindAll(view);
+ * jQuery('#docs').on('click', view.onClick);
+ * // => logs 'clicked docs' when the element is clicked
+ */
+var bindAll = restParam(function(object, methodNames) {
+ methodNames = methodNames.length ? baseFlatten(methodNames) : functions(object);
+
+ var index = -1,
+ length = methodNames.length;
+
+ while (++index < length) {
+ var key = methodNames[index];
+ object[key] = createWrapper(object[key], BIND_FLAG, object);
+ }
+ return object;
+});
+
+module.exports = bindAll;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/bindKey.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/bindKey.js
new file mode 100644
index 00000000000..b787fe70227
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/bindKey.js
@@ -0,0 +1,66 @@
+var createWrapper = require('../internal/createWrapper'),
+ replaceHolders = require('../internal/replaceHolders'),
+ restParam = require('./restParam');
+
+/** Used to compose bitmasks for wrapper metadata. */
+var BIND_FLAG = 1,
+ BIND_KEY_FLAG = 2,
+ PARTIAL_FLAG = 32;
+
+/**
+ * Creates a function that invokes the method at `object[key]` and prepends
+ * any additional `_.bindKey` arguments to those provided to the bound function.
+ *
+ * This method differs from `_.bind` by allowing bound functions to reference
+ * methods that may be redefined or don't yet exist.
+ * See [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
+ * for more details.
+ *
+ * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
+ * builds, may be used as a placeholder for partially applied arguments.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Object} object The object the method belongs to.
+ * @param {string} key The key of the method.
+ * @param {...*} [partials] The arguments to be partially applied.
+ * @returns {Function} Returns the new bound function.
+ * @example
+ *
+ * var object = {
+ * 'user': 'fred',
+ * 'greet': function(greeting, punctuation) {
+ * return greeting + ' ' + this.user + punctuation;
+ * }
+ * };
+ *
+ * var bound = _.bindKey(object, 'greet', 'hi');
+ * bound('!');
+ * // => 'hi fred!'
+ *
+ * object.greet = function(greeting, punctuation) {
+ * return greeting + 'ya ' + this.user + punctuation;
+ * };
+ *
+ * bound('!');
+ * // => 'hiya fred!'
+ *
+ * // using placeholders
+ * var bound = _.bindKey(object, 'greet', _, '!');
+ * bound('hi');
+ * // => 'hiya fred!'
+ */
+var bindKey = restParam(function(object, key, partials) {
+ var bitmask = BIND_FLAG | BIND_KEY_FLAG;
+ if (partials.length) {
+ var holders = replaceHolders(partials, bindKey.placeholder);
+ bitmask |= PARTIAL_FLAG;
+ }
+ return createWrapper(key, bitmask, object, partials, holders);
+});
+
+// Assign default placeholders.
+bindKey.placeholder = {};
+
+module.exports = bindKey;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/compose.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/compose.js
new file mode 100644
index 00000000000..1954e942397
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/compose.js
@@ -0,0 +1 @@
+module.exports = require('./flowRight');
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/curry.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/curry.js
new file mode 100644
index 00000000000..b7db3fdad8a
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/curry.js
@@ -0,0 +1,51 @@
+var createCurry = require('../internal/createCurry');
+
+/** Used to compose bitmasks for wrapper metadata. */
+var CURRY_FLAG = 8;
+
+/**
+ * Creates a function that accepts one or more arguments of `func` that when
+ * called either invokes `func` returning its result, if all `func` arguments
+ * have been provided, or returns a function that accepts one or more of the
+ * remaining `func` arguments, and so on. The arity of `func` may be specified
+ * if `func.length` is not sufficient.
+ *
+ * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
+ * may be used as a placeholder for provided arguments.
+ *
+ * **Note:** This method does not set the "length" property of curried functions.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to curry.
+ * @param {number} [arity=func.length] The arity of `func`.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {Function} Returns the new curried function.
+ * @example
+ *
+ * var abc = function(a, b, c) {
+ * return [a, b, c];
+ * };
+ *
+ * var curried = _.curry(abc);
+ *
+ * curried(1)(2)(3);
+ * // => [1, 2, 3]
+ *
+ * curried(1, 2)(3);
+ * // => [1, 2, 3]
+ *
+ * curried(1, 2, 3);
+ * // => [1, 2, 3]
+ *
+ * // using placeholders
+ * curried(1)(_, 3)(2);
+ * // => [1, 2, 3]
+ */
+var curry = createCurry(CURRY_FLAG);
+
+// Assign default placeholders.
+curry.placeholder = {};
+
+module.exports = curry;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/curryRight.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/curryRight.js
new file mode 100644
index 00000000000..11c540393b3
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/curryRight.js
@@ -0,0 +1,48 @@
+var createCurry = require('../internal/createCurry');
+
+/** Used to compose bitmasks for wrapper metadata. */
+var CURRY_RIGHT_FLAG = 16;
+
+/**
+ * This method is like `_.curry` except that arguments are applied to `func`
+ * in the manner of `_.partialRight` instead of `_.partial`.
+ *
+ * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
+ * builds, may be used as a placeholder for provided arguments.
+ *
+ * **Note:** This method does not set the "length" property of curried functions.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to curry.
+ * @param {number} [arity=func.length] The arity of `func`.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {Function} Returns the new curried function.
+ * @example
+ *
+ * var abc = function(a, b, c) {
+ * return [a, b, c];
+ * };
+ *
+ * var curried = _.curryRight(abc);
+ *
+ * curried(3)(2)(1);
+ * // => [1, 2, 3]
+ *
+ * curried(2, 3)(1);
+ * // => [1, 2, 3]
+ *
+ * curried(1, 2, 3);
+ * // => [1, 2, 3]
+ *
+ * // using placeholders
+ * curried(3)(1, _)(2);
+ * // => [1, 2, 3]
+ */
+var curryRight = createCurry(CURRY_RIGHT_FLAG);
+
+// Assign default placeholders.
+curryRight.placeholder = {};
+
+module.exports = curryRight;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/debounce.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/debounce.js
new file mode 100644
index 00000000000..5df81e71a60
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/debounce.js
@@ -0,0 +1,187 @@
+var isObject = require('../lang/isObject'),
+ now = require('../date/now');
+
+/** Used as the `TypeError` message for "Functions" methods. */
+var FUNC_ERROR_TEXT = 'Expected a function';
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max;
+
+/**
+ * Creates a debounced function that delays invoking `func` until after `wait`
+ * milliseconds have elapsed since the last time the debounced function was
+ * invoked. The debounced function comes with a `cancel` method to cancel
+ * delayed invocations. Provide an options object to indicate that `func`
+ * should be invoked on the leading and/or trailing edge of the `wait` timeout.
+ * Subsequent calls to the debounced function return the result of the last
+ * `func` invocation.
+ *
+ * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
+ * on the trailing edge of the timeout only if the the debounced function is
+ * invoked more than once during the `wait` timeout.
+ *
+ * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
+ * for details over the differences between `_.debounce` and `_.throttle`.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to debounce.
+ * @param {number} [wait=0] The number of milliseconds to delay.
+ * @param {Object} [options] The options object.
+ * @param {boolean} [options.leading=false] Specify invoking on the leading
+ * edge of the timeout.
+ * @param {number} [options.maxWait] The maximum time `func` is allowed to be
+ * delayed before it is invoked.
+ * @param {boolean} [options.trailing=true] Specify invoking on the trailing
+ * edge of the timeout.
+ * @returns {Function} Returns the new debounced function.
+ * @example
+ *
+ * // avoid costly calculations while the window size is in flux
+ * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
+ *
+ * // invoke `sendMail` when the click event is fired, debouncing subsequent calls
+ * jQuery('#postbox').on('click', _.debounce(sendMail, 300, {
+ * 'leading': true,
+ * 'trailing': false
+ * }));
+ *
+ * // ensure `batchLog` is invoked once after 1 second of debounced calls
+ * var source = new EventSource('/stream');
+ * jQuery(source).on('message', _.debounce(batchLog, 250, {
+ * 'maxWait': 1000
+ * }));
+ *
+ * // cancel a debounced call
+ * var todoChanges = _.debounce(batchLog, 1000);
+ * Object.observe(models.todo, todoChanges);
+ *
+ * Object.observe(models, function(changes) {
+ * if (_.find(changes, { 'user': 'todo', 'type': 'delete'})) {
+ * todoChanges.cancel();
+ * }
+ * }, ['delete']);
+ *
+ * // ...at some point `models.todo` is changed
+ * models.todo.completed = true;
+ *
+ * // ...before 1 second has passed `models.todo` is deleted
+ * // which cancels the debounced `todoChanges` call
+ * delete models.todo;
+ */
+function debounce(func, wait, options) {
+ var args,
+ maxTimeoutId,
+ result,
+ stamp,
+ thisArg,
+ timeoutId,
+ trailingCall,
+ lastCalled = 0,
+ maxWait = false,
+ trailing = true;
+
+ if (typeof func != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ wait = wait < 0 ? 0 : (+wait || 0);
+ if (options === true) {
+ var leading = true;
+ trailing = false;
+ } else if (isObject(options)) {
+ leading = options.leading;
+ maxWait = 'maxWait' in options && nativeMax(+options.maxWait || 0, wait);
+ trailing = 'trailing' in options ? options.trailing : trailing;
+ }
+
+ function cancel() {
+ if (timeoutId) {
+ clearTimeout(timeoutId);
+ }
+ if (maxTimeoutId) {
+ clearTimeout(maxTimeoutId);
+ }
+ maxTimeoutId = timeoutId = trailingCall = undefined;
+ }
+
+ function delayed() {
+ var remaining = wait - (now() - stamp);
+ if (remaining <= 0 || remaining > wait) {
+ if (maxTimeoutId) {
+ clearTimeout(maxTimeoutId);
+ }
+ var isCalled = trailingCall;
+ maxTimeoutId = timeoutId = trailingCall = undefined;
+ if (isCalled) {
+ lastCalled = now();
+ result = func.apply(thisArg, args);
+ if (!timeoutId && !maxTimeoutId) {
+ args = thisArg = null;
+ }
+ }
+ } else {
+ timeoutId = setTimeout(delayed, remaining);
+ }
+ }
+
+ function maxDelayed() {
+ if (timeoutId) {
+ clearTimeout(timeoutId);
+ }
+ maxTimeoutId = timeoutId = trailingCall = undefined;
+ if (trailing || (maxWait !== wait)) {
+ lastCalled = now();
+ result = func.apply(thisArg, args);
+ if (!timeoutId && !maxTimeoutId) {
+ args = thisArg = null;
+ }
+ }
+ }
+
+ function debounced() {
+ args = arguments;
+ stamp = now();
+ thisArg = this;
+ trailingCall = trailing && (timeoutId || !leading);
+
+ if (maxWait === false) {
+ var leadingCall = leading && !timeoutId;
+ } else {
+ if (!maxTimeoutId && !leading) {
+ lastCalled = stamp;
+ }
+ var remaining = maxWait - (stamp - lastCalled),
+ isCalled = remaining <= 0 || remaining > maxWait;
+
+ if (isCalled) {
+ if (maxTimeoutId) {
+ maxTimeoutId = clearTimeout(maxTimeoutId);
+ }
+ lastCalled = stamp;
+ result = func.apply(thisArg, args);
+ }
+ else if (!maxTimeoutId) {
+ maxTimeoutId = setTimeout(maxDelayed, remaining);
+ }
+ }
+ if (isCalled && timeoutId) {
+ timeoutId = clearTimeout(timeoutId);
+ }
+ else if (!timeoutId && wait !== maxWait) {
+ timeoutId = setTimeout(delayed, wait);
+ }
+ if (leadingCall) {
+ isCalled = true;
+ result = func.apply(thisArg, args);
+ }
+ if (isCalled && !timeoutId && !maxTimeoutId) {
+ args = thisArg = null;
+ }
+ return result;
+ }
+ debounced.cancel = cancel;
+ return debounced;
+}
+
+module.exports = debounce;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/defer.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/defer.js
new file mode 100644
index 00000000000..369790ce64f
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/defer.js
@@ -0,0 +1,25 @@
+var baseDelay = require('../internal/baseDelay'),
+ restParam = require('./restParam');
+
+/**
+ * Defers invoking the `func` until the current call stack has cleared. Any
+ * additional arguments are provided to `func` when it is invoked.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to defer.
+ * @param {...*} [args] The arguments to invoke the function with.
+ * @returns {number} Returns the timer id.
+ * @example
+ *
+ * _.defer(function(text) {
+ * console.log(text);
+ * }, 'deferred');
+ * // logs 'deferred' after one or more milliseconds
+ */
+var defer = restParam(function(func, args) {
+ return baseDelay(func, 1, args);
+});
+
+module.exports = defer;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/delay.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/delay.js
new file mode 100644
index 00000000000..955b059e7fa
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/delay.js
@@ -0,0 +1,26 @@
+var baseDelay = require('../internal/baseDelay'),
+ restParam = require('./restParam');
+
+/**
+ * Invokes `func` after `wait` milliseconds. Any additional arguments are
+ * provided to `func` when it is invoked.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to delay.
+ * @param {number} wait The number of milliseconds to delay invocation.
+ * @param {...*} [args] The arguments to invoke the function with.
+ * @returns {number} Returns the timer id.
+ * @example
+ *
+ * _.delay(function(text) {
+ * console.log(text);
+ * }, 1000, 'later');
+ * // => logs 'later' after one second
+ */
+var delay = restParam(function(func, wait, args) {
+ return baseDelay(func, wait, args);
+});
+
+module.exports = delay;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/flow.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/flow.js
new file mode 100644
index 00000000000..a435a3d878f
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/flow.js
@@ -0,0 +1,25 @@
+var createFlow = require('../internal/createFlow');
+
+/**
+ * Creates a function that returns the result of invoking the provided
+ * functions with the `this` binding of the created function, where each
+ * successive invocation is supplied the return value of the previous.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {...Function} [funcs] Functions to invoke.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * function square(n) {
+ * return n * n;
+ * }
+ *
+ * var addSquare = _.flow(_.add, square);
+ * addSquare(1, 2);
+ * // => 9
+ */
+var flow = createFlow();
+
+module.exports = flow;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/flowRight.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/flowRight.js
new file mode 100644
index 00000000000..23b9d76b58e
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/flowRight.js
@@ -0,0 +1,25 @@
+var createFlow = require('../internal/createFlow');
+
+/**
+ * This method is like `_.flow` except that it creates a function that
+ * invokes the provided functions from right to left.
+ *
+ * @static
+ * @memberOf _
+ * @alias backflow, compose
+ * @category Function
+ * @param {...Function} [funcs] Functions to invoke.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * function square(n) {
+ * return n * n;
+ * }
+ *
+ * var addSquare = _.flowRight(square, _.add);
+ * addSquare(1, 2);
+ * // => 9
+ */
+var flowRight = createFlow(true);
+
+module.exports = flowRight;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/memoize.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/memoize.js
new file mode 100644
index 00000000000..1088e4be656
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/memoize.js
@@ -0,0 +1,80 @@
+var MapCache = require('../internal/MapCache');
+
+/** Used as the `TypeError` message for "Functions" methods. */
+var FUNC_ERROR_TEXT = 'Expected a function';
+
+/**
+ * Creates a function that memoizes the result of `func`. If `resolver` is
+ * provided it determines the cache key for storing the result based on the
+ * arguments provided to the memoized function. By default, the first argument
+ * provided to the memoized function is coerced to a string and used as the
+ * cache key. The `func` is invoked with the `this` binding of the memoized
+ * function.
+ *
+ * **Note:** The cache is exposed as the `cache` property on the memoized
+ * function. Its creation may be customized by replacing the `_.memoize.Cache`
+ * constructor with one whose instances implement the [`Map`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-properties-of-the-map-prototype-object)
+ * method interface of `get`, `has`, and `set`.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to have its output memoized.
+ * @param {Function} [resolver] The function to resolve the cache key.
+ * @returns {Function} Returns the new memoizing function.
+ * @example
+ *
+ * var upperCase = _.memoize(function(string) {
+ * return string.toUpperCase();
+ * });
+ *
+ * upperCase('fred');
+ * // => 'FRED'
+ *
+ * // modifying the result cache
+ * upperCase.cache.set('fred', 'BARNEY');
+ * upperCase('fred');
+ * // => 'BARNEY'
+ *
+ * // replacing `_.memoize.Cache`
+ * var object = { 'user': 'fred' };
+ * var other = { 'user': 'barney' };
+ * var identity = _.memoize(_.identity);
+ *
+ * identity(object);
+ * // => { 'user': 'fred' }
+ * identity(other);
+ * // => { 'user': 'fred' }
+ *
+ * _.memoize.Cache = WeakMap;
+ * var identity = _.memoize(_.identity);
+ *
+ * identity(object);
+ * // => { 'user': 'fred' }
+ * identity(other);
+ * // => { 'user': 'barney' }
+ */
+function memoize(func, resolver) {
+ if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ var memoized = function() {
+ var args = arguments,
+ key = resolver ? resolver.apply(this, args) : args[0],
+ cache = memoized.cache;
+
+ if (cache.has(key)) {
+ return cache.get(key);
+ }
+ var result = func.apply(this, args);
+ memoized.cache = cache.set(key, result);
+ return result;
+ };
+ memoized.cache = new memoize.Cache;
+ return memoized;
+}
+
+// Assign cache to `_.memoize`.
+memoize.Cache = MapCache;
+
+module.exports = memoize;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/negate.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/negate.js
new file mode 100644
index 00000000000..82479390ad7
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/negate.js
@@ -0,0 +1,32 @@
+/** Used as the `TypeError` message for "Functions" methods. */
+var FUNC_ERROR_TEXT = 'Expected a function';
+
+/**
+ * Creates a function that negates the result of the predicate `func`. The
+ * `func` predicate is invoked with the `this` binding and arguments of the
+ * created function.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} predicate The predicate to negate.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * function isEven(n) {
+ * return n % 2 == 0;
+ * }
+ *
+ * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
+ * // => [1, 3, 5]
+ */
+function negate(predicate) {
+ if (typeof predicate != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ return function() {
+ return !predicate.apply(this, arguments);
+ };
+}
+
+module.exports = negate;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/once.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/once.js
new file mode 100644
index 00000000000..0b5bd853cb4
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/once.js
@@ -0,0 +1,24 @@
+var before = require('./before');
+
+/**
+ * Creates a function that is restricted to invoking `func` once. Repeat calls
+ * to the function return the value of the first call. The `func` is invoked
+ * with the `this` binding and arguments of the created function.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to restrict.
+ * @returns {Function} Returns the new restricted function.
+ * @example
+ *
+ * var initialize = _.once(createApplication);
+ * initialize();
+ * initialize();
+ * // `initialize` invokes `createApplication` once
+ */
+function once(func) {
+ return before(2, func);
+}
+
+module.exports = once;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/partial.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/partial.js
new file mode 100644
index 00000000000..fb1d04fb6c5
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/partial.js
@@ -0,0 +1,43 @@
+var createPartial = require('../internal/createPartial');
+
+/** Used to compose bitmasks for wrapper metadata. */
+var PARTIAL_FLAG = 32;
+
+/**
+ * Creates a function that invokes `func` with `partial` arguments prepended
+ * to those provided to the new function. This method is like `_.bind` except
+ * it does **not** alter the `this` binding.
+ *
+ * The `_.partial.placeholder` value, which defaults to `_` in monolithic
+ * builds, may be used as a placeholder for partially applied arguments.
+ *
+ * **Note:** This method does not set the "length" property of partially
+ * applied functions.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to partially apply arguments to.
+ * @param {...*} [partials] The arguments to be partially applied.
+ * @returns {Function} Returns the new partially applied function.
+ * @example
+ *
+ * var greet = function(greeting, name) {
+ * return greeting + ' ' + name;
+ * };
+ *
+ * var sayHelloTo = _.partial(greet, 'hello');
+ * sayHelloTo('fred');
+ * // => 'hello fred'
+ *
+ * // using placeholders
+ * var greetFred = _.partial(greet, _, 'fred');
+ * greetFred('hi');
+ * // => 'hi fred'
+ */
+var partial = createPartial(PARTIAL_FLAG);
+
+// Assign default placeholders.
+partial.placeholder = {};
+
+module.exports = partial;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/partialRight.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/partialRight.js
new file mode 100644
index 00000000000..634e6a4c40c
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/partialRight.js
@@ -0,0 +1,42 @@
+var createPartial = require('../internal/createPartial');
+
+/** Used to compose bitmasks for wrapper metadata. */
+var PARTIAL_RIGHT_FLAG = 64;
+
+/**
+ * This method is like `_.partial` except that partially applied arguments
+ * are appended to those provided to the new function.
+ *
+ * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
+ * builds, may be used as a placeholder for partially applied arguments.
+ *
+ * **Note:** This method does not set the "length" property of partially
+ * applied functions.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to partially apply arguments to.
+ * @param {...*} [partials] The arguments to be partially applied.
+ * @returns {Function} Returns the new partially applied function.
+ * @example
+ *
+ * var greet = function(greeting, name) {
+ * return greeting + ' ' + name;
+ * };
+ *
+ * var greetFred = _.partialRight(greet, 'fred');
+ * greetFred('hi');
+ * // => 'hi fred'
+ *
+ * // using placeholders
+ * var sayHelloTo = _.partialRight(greet, 'hello', _);
+ * sayHelloTo('fred');
+ * // => 'hello fred'
+ */
+var partialRight = createPartial(PARTIAL_RIGHT_FLAG);
+
+// Assign default placeholders.
+partialRight.placeholder = {};
+
+module.exports = partialRight;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/rearg.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/rearg.js
new file mode 100644
index 00000000000..0a4bf8fa6d6
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/rearg.js
@@ -0,0 +1,40 @@
+var baseFlatten = require('../internal/baseFlatten'),
+ createWrapper = require('../internal/createWrapper'),
+ restParam = require('./restParam');
+
+/** Used to compose bitmasks for wrapper metadata. */
+var REARG_FLAG = 256;
+
+/**
+ * Creates a function that invokes `func` with arguments arranged according
+ * to the specified indexes where the argument value at the first index is
+ * provided as the first argument, the argument value at the second index is
+ * provided as the second argument, and so on.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to rearrange arguments for.
+ * @param {...(number|number[])} indexes The arranged argument indexes,
+ * specified as individual indexes or arrays of indexes.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var rearged = _.rearg(function(a, b, c) {
+ * return [a, b, c];
+ * }, 2, 0, 1);
+ *
+ * rearged('b', 'c', 'a')
+ * // => ['a', 'b', 'c']
+ *
+ * var map = _.rearg(_.map, [1, 0]);
+ * map(function(n) {
+ * return n * 3;
+ * }, [1, 2, 3]);
+ * // => [3, 6, 9]
+ */
+var rearg = restParam(function(func, indexes) {
+ return createWrapper(func, REARG_FLAG, null, null, null, baseFlatten(indexes));
+});
+
+module.exports = rearg;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/restParam.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/restParam.js
new file mode 100644
index 00000000000..3a1c15707c7
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/restParam.js
@@ -0,0 +1,58 @@
+/** Used as the `TypeError` message for "Functions" methods. */
+var FUNC_ERROR_TEXT = 'Expected a function';
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max;
+
+/**
+ * Creates a function that invokes `func` with the `this` binding of the
+ * created function and arguments from `start` and beyond provided as an array.
+ *
+ * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters).
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to apply a rest parameter to.
+ * @param {number} [start=func.length-1] The start position of the rest parameter.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var say = _.restParam(function(what, names) {
+ * return what + ' ' + _.initial(names).join(', ') +
+ * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
+ * });
+ *
+ * say('hello', 'fred', 'barney', 'pebbles');
+ * // => 'hello fred, barney, & pebbles'
+ */
+function restParam(func, start) {
+ if (typeof func != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0);
+ return function() {
+ var args = arguments,
+ index = -1,
+ length = nativeMax(args.length - start, 0),
+ rest = Array(length);
+
+ while (++index < length) {
+ rest[index] = args[start + index];
+ }
+ switch (start) {
+ case 0: return func.call(this, rest);
+ case 1: return func.call(this, args[0], rest);
+ case 2: return func.call(this, args[0], args[1], rest);
+ }
+ var otherArgs = Array(start + 1);
+ index = -1;
+ while (++index < start) {
+ otherArgs[index] = args[index];
+ }
+ otherArgs[start] = rest;
+ return func.apply(this, otherArgs);
+ };
+}
+
+module.exports = restParam;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/spread.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/spread.js
new file mode 100644
index 00000000000..aad4b7147f2
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/spread.js
@@ -0,0 +1,44 @@
+/** Used as the `TypeError` message for "Functions" methods. */
+var FUNC_ERROR_TEXT = 'Expected a function';
+
+/**
+ * Creates a function that invokes `func` with the `this` binding of the created
+ * function and an array of arguments much like [`Function#apply`](https://es5.github.io/#x15.3.4.3).
+ *
+ * **Note:** This method is based on the [spread operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator).
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to spread arguments over.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var say = _.spread(function(who, what) {
+ * return who + ' says ' + what;
+ * });
+ *
+ * say(['fred', 'hello']);
+ * // => 'fred says hello'
+ *
+ * // with a Promise
+ * var numbers = Promise.all([
+ * Promise.resolve(40),
+ * Promise.resolve(36)
+ * ]);
+ *
+ * numbers.then(_.spread(function(x, y) {
+ * return x + y;
+ * }));
+ * // => a Promise of 76
+ */
+function spread(func) {
+ if (typeof func != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ return function(array) {
+ return func.apply(this, array);
+ };
+}
+
+module.exports = spread;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/throttle.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/throttle.js
new file mode 100644
index 00000000000..5e8f0ef5611
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/throttle.js
@@ -0,0 +1,72 @@
+var debounce = require('./debounce'),
+ isObject = require('../lang/isObject');
+
+/** Used as the `TypeError` message for "Functions" methods. */
+var FUNC_ERROR_TEXT = 'Expected a function';
+
+/** Used as an internal `_.debounce` options object by `_.throttle`. */
+var debounceOptions = {
+ 'leading': false,
+ 'maxWait': 0,
+ 'trailing': false
+};
+
+/**
+ * Creates a throttled function that only invokes `func` at most once per
+ * every `wait` milliseconds. The throttled function comes with a `cancel`
+ * method to cancel delayed invocations. Provide an options object to indicate
+ * that `func` should be invoked on the leading and/or trailing edge of the
+ * `wait` timeout. Subsequent calls to the throttled function return the
+ * result of the last `func` call.
+ *
+ * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
+ * on the trailing edge of the timeout only if the the throttled function is
+ * invoked more than once during the `wait` timeout.
+ *
+ * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
+ * for details over the differences between `_.throttle` and `_.debounce`.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to throttle.
+ * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
+ * @param {Object} [options] The options object.
+ * @param {boolean} [options.leading=true] Specify invoking on the leading
+ * edge of the timeout.
+ * @param {boolean} [options.trailing=true] Specify invoking on the trailing
+ * edge of the timeout.
+ * @returns {Function} Returns the new throttled function.
+ * @example
+ *
+ * // avoid excessively updating the position while scrolling
+ * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
+ *
+ * // invoke `renewToken` when the click event is fired, but not more than once every 5 minutes
+ * jQuery('.interactive').on('click', _.throttle(renewToken, 300000, {
+ * 'trailing': false
+ * }));
+ *
+ * // cancel a trailing throttled call
+ * jQuery(window).on('popstate', throttled.cancel);
+ */
+function throttle(func, wait, options) {
+ var leading = true,
+ trailing = true;
+
+ if (typeof func != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ if (options === false) {
+ leading = false;
+ } else if (isObject(options)) {
+ leading = 'leading' in options ? !!options.leading : leading;
+ trailing = 'trailing' in options ? !!options.trailing : trailing;
+ }
+ debounceOptions.leading = leading;
+ debounceOptions.maxWait = +wait;
+ debounceOptions.trailing = trailing;
+ return debounce(func, wait, debounceOptions);
+}
+
+module.exports = throttle;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/wrap.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/wrap.js
new file mode 100644
index 00000000000..68b09af2386
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/wrap.js
@@ -0,0 +1,33 @@
+var createWrapper = require('../internal/createWrapper'),
+ identity = require('../utility/identity');
+
+/** Used to compose bitmasks for wrapper metadata. */
+var PARTIAL_FLAG = 32;
+
+/**
+ * Creates a function that provides `value` to the wrapper function as its
+ * first argument. Any additional arguments provided to the function are
+ * appended to those provided to the wrapper function. The wrapper is invoked
+ * with the `this` binding of the created function.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {*} value The value to wrap.
+ * @param {Function} wrapper The wrapper function.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var p = _.wrap(_.escape, function(func, text) {
+ * return '<p>' + func(text) + '</p>';
+ * });
+ *
+ * p('fred, barney, & pebbles');
+ * // => '<p>fred, barney, &amp; pebbles</p>'
+ */
+function wrap(value, wrapper) {
+ wrapper = wrapper == null ? identity : wrapper;
+ return createWrapper(wrapper, PARTIAL_FLAG, null, [value], []);
+}
+
+module.exports = wrap;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/index.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/index.js
new file mode 100644
index 00000000000..deb66539d44
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/index.js
@@ -0,0 +1,12235 @@
+/**
+ * @license
+ * lodash 3.9.3 (Custom Build) <https://lodash.com/>
+ * Build: `lodash modern -d -o ./index.js`
+ * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
+ * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+ * Available under MIT license <https://lodash.com/license>
+ */
+;(function() {
+
+ /** Used as a safe reference for `undefined` in pre-ES5 environments. */
+ var undefined;
+
+ /** Used as the semantic version number. */
+ var VERSION = '3.9.3';
+
+ /** Used to compose bitmasks for wrapper metadata. */
+ var BIND_FLAG = 1,
+ BIND_KEY_FLAG = 2,
+ CURRY_BOUND_FLAG = 4,
+ CURRY_FLAG = 8,
+ CURRY_RIGHT_FLAG = 16,
+ PARTIAL_FLAG = 32,
+ PARTIAL_RIGHT_FLAG = 64,
+ ARY_FLAG = 128,
+ REARG_FLAG = 256;
+
+ /** Used as default options for `_.trunc`. */
+ var DEFAULT_TRUNC_LENGTH = 30,
+ DEFAULT_TRUNC_OMISSION = '...';
+
+ /** Used to detect when a function becomes hot. */
+ var HOT_COUNT = 150,
+ HOT_SPAN = 16;
+
+ /** Used to indicate the type of lazy iteratees. */
+ var LAZY_DROP_WHILE_FLAG = 0,
+ LAZY_FILTER_FLAG = 1,
+ LAZY_MAP_FLAG = 2;
+
+ /** Used as the `TypeError` message for "Functions" methods. */
+ var FUNC_ERROR_TEXT = 'Expected a function';
+
+ /** Used as the internal argument placeholder. */
+ var PLACEHOLDER = '__lodash_placeholder__';
+
+ /** `Object#toString` result references. */
+ var argsTag = '[object Arguments]',
+ arrayTag = '[object Array]',
+ boolTag = '[object Boolean]',
+ dateTag = '[object Date]',
+ errorTag = '[object Error]',
+ funcTag = '[object Function]',
+ mapTag = '[object Map]',
+ numberTag = '[object Number]',
+ objectTag = '[object Object]',
+ regexpTag = '[object RegExp]',
+ setTag = '[object Set]',
+ stringTag = '[object String]',
+ weakMapTag = '[object WeakMap]';
+
+ var arrayBufferTag = '[object ArrayBuffer]',
+ float32Tag = '[object Float32Array]',
+ float64Tag = '[object Float64Array]',
+ int8Tag = '[object Int8Array]',
+ int16Tag = '[object Int16Array]',
+ int32Tag = '[object Int32Array]',
+ uint8Tag = '[object Uint8Array]',
+ uint8ClampedTag = '[object Uint8ClampedArray]',
+ uint16Tag = '[object Uint16Array]',
+ uint32Tag = '[object Uint32Array]';
+
+ /** Used to match empty string literals in compiled template source. */
+ var reEmptyStringLeading = /\b__p \+= '';/g,
+ reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
+ reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
+
+ /** Used to match HTML entities and HTML characters. */
+ var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g,
+ reUnescapedHtml = /[&<>"'`]/g,
+ reHasEscapedHtml = RegExp(reEscapedHtml.source),
+ reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
+
+ /** Used to match template delimiters. */
+ var reEscape = /<%-([\s\S]+?)%>/g,
+ reEvaluate = /<%([\s\S]+?)%>/g,
+ reInterpolate = /<%=([\s\S]+?)%>/g;
+
+ /** Used to match property names within property paths. */
+ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,
+ reIsPlainProp = /^\w*$/,
+ rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g;
+
+ /**
+ * Used to match `RegExp` [special characters](http://www.regular-expressions.info/characters.html#special).
+ * In addition to special characters the forward slash is escaped to allow for
+ * easier `eval` use and `Function` compilation.
+ */
+ var reRegExpChars = /[.*+?^${}()|[\]\/\\]/g,
+ reHasRegExpChars = RegExp(reRegExpChars.source);
+
+ /** Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). */
+ var reComboMark = /[\u0300-\u036f\ufe20-\ufe23]/g;
+
+ /** Used to match backslashes in property paths. */
+ var reEscapeChar = /\\(\\)?/g;
+
+ /** Used to match [ES template delimiters](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-template-literal-lexical-components). */
+ var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
+
+ /** Used to match `RegExp` flags from their coerced string values. */
+ var reFlags = /\w*$/;
+
+ /** Used to detect hexadecimal string values. */
+ var reHasHexPrefix = /^0[xX]/;
+
+ /** Used to detect host constructors (Safari > 5). */
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
+
+ /** Used to detect unsigned integer values. */
+ var reIsUint = /^\d+$/;
+
+ /** Used to match latin-1 supplementary letters (excluding mathematical operators). */
+ var reLatin1 = /[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g;
+
+ /** Used to ensure capturing order of template delimiters. */
+ var reNoMatch = /($^)/;
+
+ /** Used to match unescaped characters in compiled string literals. */
+ var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
+
+ /** Used to match words to create compound words. */
+ var reWords = (function() {
+ var upper = '[A-Z\\xc0-\\xd6\\xd8-\\xde]',
+ lower = '[a-z\\xdf-\\xf6\\xf8-\\xff]+';
+
+ return RegExp(upper + '+(?=' + upper + lower + ')|' + upper + '?' + lower + '|' + upper + '+|[0-9]+', 'g');
+ }());
+
+ /** Used to detect and test for whitespace. */
+ var whitespace = (
+ // Basic whitespace characters.
+ ' \t\x0b\f\xa0\ufeff' +
+
+ // Line terminators.
+ '\n\r\u2028\u2029' +
+
+ // Unicode category "Zs" space separators.
+ '\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000'
+ );
+
+ /** Used to assign default `context` object properties. */
+ var contextProps = [
+ 'Array', 'ArrayBuffer', 'Date', 'Error', 'Float32Array', 'Float64Array',
+ 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Math', 'Number',
+ 'Object', 'RegExp', 'Set', 'String', '_', 'clearTimeout', 'document',
+ 'isFinite', 'parseFloat', 'parseInt', 'setTimeout', 'TypeError', 'Uint8Array',
+ 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', 'window'
+ ];
+
+ /** Used to make template sourceURLs easier to identify. */
+ var templateCounter = -1;
+
+ /** Used to identify `toStringTag` values of typed arrays. */
+ var typedArrayTags = {};
+ typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
+ typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
+ typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
+ typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
+ typedArrayTags[uint32Tag] = true;
+ typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
+ typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
+ typedArrayTags[dateTag] = typedArrayTags[errorTag] =
+ typedArrayTags[funcTag] = typedArrayTags[mapTag] =
+ typedArrayTags[numberTag] = typedArrayTags[objectTag] =
+ typedArrayTags[regexpTag] = typedArrayTags[setTag] =
+ typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
+
+ /** Used to identify `toStringTag` values supported by `_.clone`. */
+ var cloneableTags = {};
+ cloneableTags[argsTag] = cloneableTags[arrayTag] =
+ cloneableTags[arrayBufferTag] = cloneableTags[boolTag] =
+ cloneableTags[dateTag] = cloneableTags[float32Tag] =
+ cloneableTags[float64Tag] = cloneableTags[int8Tag] =
+ cloneableTags[int16Tag] = cloneableTags[int32Tag] =
+ cloneableTags[numberTag] = cloneableTags[objectTag] =
+ cloneableTags[regexpTag] = cloneableTags[stringTag] =
+ cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
+ cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
+ cloneableTags[errorTag] = cloneableTags[funcTag] =
+ cloneableTags[mapTag] = cloneableTags[setTag] =
+ cloneableTags[weakMapTag] = false;
+
+ /** Used as an internal `_.debounce` options object by `_.throttle`. */
+ var debounceOptions = {
+ 'leading': false,
+ 'maxWait': 0,
+ 'trailing': false
+ };
+
+ /** Used to map latin-1 supplementary letters to basic latin letters. */
+ var deburredLetters = {
+ '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
+ '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
+ '\xc7': 'C', '\xe7': 'c',
+ '\xd0': 'D', '\xf0': 'd',
+ '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
+ '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
+ '\xcC': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
+ '\xeC': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
+ '\xd1': 'N', '\xf1': 'n',
+ '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
+ '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
+ '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
+ '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
+ '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
+ '\xc6': 'Ae', '\xe6': 'ae',
+ '\xde': 'Th', '\xfe': 'th',
+ '\xdf': 'ss'
+ };
+
+ /** Used to map characters to HTML entities. */
+ var htmlEscapes = {
+ '&': '&amp;',
+ '<': '&lt;',
+ '>': '&gt;',
+ '"': '&quot;',
+ "'": '&#39;',
+ '`': '&#96;'
+ };
+
+ /** Used to map HTML entities to characters. */
+ var htmlUnescapes = {
+ '&amp;': '&',
+ '&lt;': '<',
+ '&gt;': '>',
+ '&quot;': '"',
+ '&#39;': "'",
+ '&#96;': '`'
+ };
+
+ /** Used to determine if values are of the language type `Object`. */
+ var objectTypes = {
+ 'function': true,
+ 'object': true
+ };
+
+ /** Used to escape characters for inclusion in compiled string literals. */
+ var stringEscapes = {
+ '\\': '\\',
+ "'": "'",
+ '\n': 'n',
+ '\r': 'r',
+ '\u2028': 'u2028',
+ '\u2029': 'u2029'
+ };
+
+ /** Detect free variable `exports`. */
+ var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports;
+
+ /** Detect free variable `module`. */
+ var freeModule = objectTypes[typeof module] && module && !module.nodeType && module;
+
+ /** Detect free variable `global` from Node.js. */
+ var freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global;
+
+ /** Detect free variable `self`. */
+ var freeSelf = objectTypes[typeof self] && self && self.Object && self;
+
+ /** Detect free variable `window`. */
+ var freeWindow = objectTypes[typeof window] && window && window.Object && window;
+
+ /** Detect the popular CommonJS extension `module.exports`. */
+ var moduleExports = freeModule && freeModule.exports === freeExports && freeExports;
+
+ /**
+ * Used as a reference to the global object.
+ *
+ * The `this` value is used if it's the global object to avoid Greasemonkey's
+ * restricted `window` object, otherwise the `window` object is used.
+ */
+ var root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;
+
+ /*--------------------------------------------------------------------------*/
+
+ /**
+ * The base implementation of `compareAscending` which compares values and
+ * sorts them in ascending order without guaranteeing a stable sort.
+ *
+ * @private
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @returns {number} Returns the sort order indicator for `value`.
+ */
+ function baseCompareAscending(value, other) {
+ if (value !== other) {
+ var valIsNull = value === null,
+ valIsUndef = value === undefined,
+ valIsReflexive = value === value;
+
+ var othIsNull = other === null,
+ othIsUndef = other === undefined,
+ othIsReflexive = other === other;
+
+ if ((value > other && !othIsNull) || !valIsReflexive ||
+ (valIsNull && !othIsUndef && othIsReflexive) ||
+ (valIsUndef && othIsReflexive)) {
+ return 1;
+ }
+ if ((value < other && !valIsNull) || !othIsReflexive ||
+ (othIsNull && !valIsUndef && valIsReflexive) ||
+ (othIsUndef && valIsReflexive)) {
+ return -1;
+ }
+ }
+ return 0;
+ }
+
+ /**
+ * The base implementation of `_.findIndex` and `_.findLastIndex` without
+ * support for callback shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to search.
+ * @param {Function} predicate The function invoked per iteration.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ */
+ function baseFindIndex(array, predicate, fromRight) {
+ var length = array.length,
+ index = fromRight ? length : -1;
+
+ while ((fromRight ? index-- : ++index < length)) {
+ if (predicate(array[index], index, array)) {
+ return index;
+ }
+ }
+ return -1;
+ }
+
+ /**
+ * The base implementation of `_.indexOf` without support for binary searches.
+ *
+ * @private
+ * @param {Array} array The array to search.
+ * @param {*} value The value to search for.
+ * @param {number} fromIndex The index to search from.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ */
+ function baseIndexOf(array, value, fromIndex) {
+ if (value !== value) {
+ return indexOfNaN(array, fromIndex);
+ }
+ var index = fromIndex - 1,
+ length = array.length;
+
+ while (++index < length) {
+ if (array[index] === value) {
+ return index;
+ }
+ }
+ return -1;
+ }
+
+ /**
+ * The base implementation of `_.isFunction` without support for environments
+ * with incorrect `typeof` results.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ */
+ function baseIsFunction(value) {
+ // Avoid a Chakra JIT bug in compatibility modes of IE 11.
+ // See https://github.com/jashkenas/underscore/issues/1621 for more details.
+ return typeof value == 'function' || false;
+ }
+
+ /**
+ * Converts `value` to a string if it's not one. An empty string is returned
+ * for `null` or `undefined` values.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {string} Returns the string.
+ */
+ function baseToString(value) {
+ if (typeof value == 'string') {
+ return value;
+ }
+ return value == null ? '' : (value + '');
+ }
+
+ /**
+ * Used by `_.trim` and `_.trimLeft` to get the index of the first character
+ * of `string` that is not found in `chars`.
+ *
+ * @private
+ * @param {string} string The string to inspect.
+ * @param {string} chars The characters to find.
+ * @returns {number} Returns the index of the first character not found in `chars`.
+ */
+ function charsLeftIndex(string, chars) {
+ var index = -1,
+ length = string.length;
+
+ while (++index < length && chars.indexOf(string.charAt(index)) > -1) {}
+ return index;
+ }
+
+ /**
+ * Used by `_.trim` and `_.trimRight` to get the index of the last character
+ * of `string` that is not found in `chars`.
+ *
+ * @private
+ * @param {string} string The string to inspect.
+ * @param {string} chars The characters to find.
+ * @returns {number} Returns the index of the last character not found in `chars`.
+ */
+ function charsRightIndex(string, chars) {
+ var index = string.length;
+
+ while (index-- && chars.indexOf(string.charAt(index)) > -1) {}
+ return index;
+ }
+
+ /**
+ * Used by `_.sortBy` to compare transformed elements of a collection and stable
+ * sort them in ascending order.
+ *
+ * @private
+ * @param {Object} object The object to compare to `other`.
+ * @param {Object} other The object to compare to `object`.
+ * @returns {number} Returns the sort order indicator for `object`.
+ */
+ function compareAscending(object, other) {
+ return baseCompareAscending(object.criteria, other.criteria) || (object.index - other.index);
+ }
+
+ /**
+ * Used by `_.sortByOrder` to compare multiple properties of each element
+ * in a collection and stable sort them in the following order:
+ *
+ * If `orders` is unspecified, sort in ascending order for all properties.
+ * Otherwise, for each property, sort in ascending order if its corresponding value in
+ * orders is true, and descending order if false.
+ *
+ * @private
+ * @param {Object} object The object to compare to `other`.
+ * @param {Object} other The object to compare to `object`.
+ * @param {boolean[]} orders The order to sort by for each property.
+ * @returns {number} Returns the sort order indicator for `object`.
+ */
+ function compareMultiple(object, other, orders) {
+ var index = -1,
+ objCriteria = object.criteria,
+ othCriteria = other.criteria,
+ length = objCriteria.length,
+ ordersLength = orders.length;
+
+ while (++index < length) {
+ var result = baseCompareAscending(objCriteria[index], othCriteria[index]);
+ if (result) {
+ if (index >= ordersLength) {
+ return result;
+ }
+ return result * (orders[index] ? 1 : -1);
+ }
+ }
+ // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
+ // that causes it, under certain circumstances, to provide the same value for
+ // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
+ // for more details.
+ //
+ // This also ensures a stable sort in V8 and other engines.
+ // See https://code.google.com/p/v8/issues/detail?id=90 for more details.
+ return object.index - other.index;
+ }
+
+ /**
+ * Used by `_.deburr` to convert latin-1 supplementary letters to basic latin letters.
+ *
+ * @private
+ * @param {string} letter The matched letter to deburr.
+ * @returns {string} Returns the deburred letter.
+ */
+ function deburrLetter(letter) {
+ return deburredLetters[letter];
+ }
+
+ /**
+ * Used by `_.escape` to convert characters to HTML entities.
+ *
+ * @private
+ * @param {string} chr The matched character to escape.
+ * @returns {string} Returns the escaped character.
+ */
+ function escapeHtmlChar(chr) {
+ return htmlEscapes[chr];
+ }
+
+ /**
+ * Used by `_.template` to escape characters for inclusion in compiled
+ * string literals.
+ *
+ * @private
+ * @param {string} chr The matched character to escape.
+ * @returns {string} Returns the escaped character.
+ */
+ function escapeStringChar(chr) {
+ return '\\' + stringEscapes[chr];
+ }
+
+ /**
+ * Gets the index at which the first occurrence of `NaN` is found in `array`.
+ *
+ * @private
+ * @param {Array} array The array to search.
+ * @param {number} fromIndex The index to search from.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {number} Returns the index of the matched `NaN`, else `-1`.
+ */
+ function indexOfNaN(array, fromIndex, fromRight) {
+ var length = array.length,
+ index = fromIndex + (fromRight ? 0 : -1);
+
+ while ((fromRight ? index-- : ++index < length)) {
+ var other = array[index];
+ if (other !== other) {
+ return index;
+ }
+ }
+ return -1;
+ }
+
+ /**
+ * Checks if `value` is object-like.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
+ */
+ function isObjectLike(value) {
+ return !!value && typeof value == 'object';
+ }
+
+ /**
+ * Used by `trimmedLeftIndex` and `trimmedRightIndex` to determine if a
+ * character code is whitespace.
+ *
+ * @private
+ * @param {number} charCode The character code to inspect.
+ * @returns {boolean} Returns `true` if `charCode` is whitespace, else `false`.
+ */
+ function isSpace(charCode) {
+ return ((charCode <= 160 && (charCode >= 9 && charCode <= 13) || charCode == 32 || charCode == 160) || charCode == 5760 || charCode == 6158 ||
+ (charCode >= 8192 && (charCode <= 8202 || charCode == 8232 || charCode == 8233 || charCode == 8239 || charCode == 8287 || charCode == 12288 || charCode == 65279)));
+ }
+
+ /**
+ * Replaces all `placeholder` elements in `array` with an internal placeholder
+ * and returns an array of their indexes.
+ *
+ * @private
+ * @param {Array} array The array to modify.
+ * @param {*} placeholder The placeholder to replace.
+ * @returns {Array} Returns the new array of placeholder indexes.
+ */
+ function replaceHolders(array, placeholder) {
+ var index = -1,
+ length = array.length,
+ resIndex = -1,
+ result = [];
+
+ while (++index < length) {
+ if (array[index] === placeholder) {
+ array[index] = PLACEHOLDER;
+ result[++resIndex] = index;
+ }
+ }
+ return result;
+ }
+
+ /**
+ * An implementation of `_.uniq` optimized for sorted arrays without support
+ * for callback shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {Function} [iteratee] The function invoked per iteration.
+ * @returns {Array} Returns the new duplicate-value-free array.
+ */
+ function sortedUniq(array, iteratee) {
+ var seen,
+ index = -1,
+ length = array.length,
+ resIndex = -1,
+ result = [];
+
+ while (++index < length) {
+ var value = array[index],
+ computed = iteratee ? iteratee(value, index, array) : value;
+
+ if (!index || seen !== computed) {
+ seen = computed;
+ result[++resIndex] = value;
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Used by `_.trim` and `_.trimLeft` to get the index of the first non-whitespace
+ * character of `string`.
+ *
+ * @private
+ * @param {string} string The string to inspect.
+ * @returns {number} Returns the index of the first non-whitespace character.
+ */
+ function trimmedLeftIndex(string) {
+ var index = -1,
+ length = string.length;
+
+ while (++index < length && isSpace(string.charCodeAt(index))) {}
+ return index;
+ }
+
+ /**
+ * Used by `_.trim` and `_.trimRight` to get the index of the last non-whitespace
+ * character of `string`.
+ *
+ * @private
+ * @param {string} string The string to inspect.
+ * @returns {number} Returns the index of the last non-whitespace character.
+ */
+ function trimmedRightIndex(string) {
+ var index = string.length;
+
+ while (index-- && isSpace(string.charCodeAt(index))) {}
+ return index;
+ }
+
+ /**
+ * Used by `_.unescape` to convert HTML entities to characters.
+ *
+ * @private
+ * @param {string} chr The matched character to unescape.
+ * @returns {string} Returns the unescaped character.
+ */
+ function unescapeHtmlChar(chr) {
+ return htmlUnescapes[chr];
+ }
+
+ /*--------------------------------------------------------------------------*/
+
+ /**
+ * Create a new pristine `lodash` function using the given `context` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {Object} [context=root] The context object.
+ * @returns {Function} Returns a new `lodash` function.
+ * @example
+ *
+ * _.mixin({ 'foo': _.constant('foo') });
+ *
+ * var lodash = _.runInContext();
+ * lodash.mixin({ 'bar': lodash.constant('bar') });
+ *
+ * _.isFunction(_.foo);
+ * // => true
+ * _.isFunction(_.bar);
+ * // => false
+ *
+ * lodash.isFunction(lodash.foo);
+ * // => false
+ * lodash.isFunction(lodash.bar);
+ * // => true
+ *
+ * // using `context` to mock `Date#getTime` use in `_.now`
+ * var mock = _.runInContext({
+ * 'Date': function() {
+ * return { 'getTime': getTimeMock };
+ * }
+ * });
+ *
+ * // or creating a suped-up `defer` in Node.js
+ * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
+ */
+ function runInContext(context) {
+ // Avoid issues with some ES3 environments that attempt to use values, named
+ // after built-in constructors like `Object`, for the creation of literals.
+ // ES5 clears this up by stating that literals must use built-in constructors.
+ // See https://es5.github.io/#x11.1.5 for more details.
+ context = context ? _.defaults(root.Object(), context, _.pick(root, contextProps)) : root;
+
+ /** Native constructor references. */
+ var Array = context.Array,
+ Date = context.Date,
+ Error = context.Error,
+ Function = context.Function,
+ Math = context.Math,
+ Number = context.Number,
+ Object = context.Object,
+ RegExp = context.RegExp,
+ String = context.String,
+ TypeError = context.TypeError;
+
+ /** Used for native method references. */
+ var arrayProto = Array.prototype,
+ objectProto = Object.prototype,
+ stringProto = String.prototype;
+
+ /** Used to detect DOM support. */
+ var document = (document = context.window) ? document.document : null;
+
+ /** Used to resolve the decompiled source of functions. */
+ var fnToString = Function.prototype.toString;
+
+ /** Used to check objects for own properties. */
+ var hasOwnProperty = objectProto.hasOwnProperty;
+
+ /** Used to generate unique IDs. */
+ var idCounter = 0;
+
+ /**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+ var objToString = objectProto.toString;
+
+ /** Used to restore the original `_` reference in `_.noConflict`. */
+ var oldDash = context._;
+
+ /** Used to detect if a method is native. */
+ var reIsNative = RegExp('^' +
+ escapeRegExp(fnToString.call(hasOwnProperty))
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
+ );
+
+ /** Native method references. */
+ var ArrayBuffer = getNative(context, 'ArrayBuffer'),
+ bufferSlice = getNative(ArrayBuffer && new ArrayBuffer(0), 'slice'),
+ ceil = Math.ceil,
+ clearTimeout = context.clearTimeout,
+ floor = Math.floor,
+ getPrototypeOf = getNative(Object, 'getPrototypeOf'),
+ parseFloat = context.parseFloat,
+ push = arrayProto.push,
+ Set = getNative(context, 'Set'),
+ setTimeout = context.setTimeout,
+ splice = arrayProto.splice,
+ Uint8Array = getNative(context, 'Uint8Array'),
+ WeakMap = getNative(context, 'WeakMap');
+
+ /** Used to clone array buffers. */
+ var Float64Array = (function() {
+ // Safari 5 errors when using an array buffer to initialize a typed array
+ // where the array buffer's `byteLength` is not a multiple of the typed
+ // array's `BYTES_PER_ELEMENT`.
+ try {
+ var func = getNative(context, 'Float64Array'),
+ result = new func(new ArrayBuffer(10), 0, 1) && func;
+ } catch(e) {}
+ return result || null;
+ }());
+
+ /* Native method references for those with the same name as other `lodash` methods. */
+ var nativeCreate = getNative(Object, 'create'),
+ nativeIsArray = getNative(Array, 'isArray'),
+ nativeIsFinite = context.isFinite,
+ nativeKeys = getNative(Object, 'keys'),
+ nativeMax = Math.max,
+ nativeMin = Math.min,
+ nativeNow = getNative(Date, 'now'),
+ nativeNumIsFinite = getNative(Number, 'isFinite'),
+ nativeParseInt = context.parseInt,
+ nativeRandom = Math.random;
+
+ /** Used as references for `-Infinity` and `Infinity`. */
+ var NEGATIVE_INFINITY = Number.NEGATIVE_INFINITY,
+ POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
+
+ /** Used as references for the maximum length and index of an array. */
+ var MAX_ARRAY_LENGTH = 4294967295,
+ MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
+ HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
+
+ /** Used as the size, in bytes, of each `Float64Array` element. */
+ var FLOAT64_BYTES_PER_ELEMENT = Float64Array ? Float64Array.BYTES_PER_ELEMENT : 0;
+
+ /**
+ * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer)
+ * of an array-like value.
+ */
+ var MAX_SAFE_INTEGER = 9007199254740991;
+
+ /** Used to store function metadata. */
+ var metaMap = WeakMap && new WeakMap;
+
+ /** Used to lookup unminified function names. */
+ var realNames = {};
+
+ /*------------------------------------------------------------------------*/
+
+ /**
+ * Creates a `lodash` object which wraps `value` to enable implicit chaining.
+ * Methods that operate on and return arrays, collections, and functions can
+ * be chained together. Methods that return a boolean or single value will
+ * automatically end the chain returning the unwrapped value. Explicit chaining
+ * may be enabled using `_.chain`. The execution of chained methods is lazy,
+ * that is, execution is deferred until `_#value` is implicitly or explicitly
+ * called.
+ *
+ * Lazy evaluation allows several methods to support shortcut fusion. Shortcut
+ * fusion is an optimization that merges iteratees to avoid creating intermediate
+ * arrays and reduce the number of iteratee executions.
+ *
+ * Chaining is supported in custom builds as long as the `_#value` method is
+ * directly or indirectly included in the build.
+ *
+ * In addition to lodash methods, wrappers have `Array` and `String` methods.
+ *
+ * The wrapper `Array` methods are:
+ * `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`,
+ * `splice`, and `unshift`
+ *
+ * The wrapper `String` methods are:
+ * `replace` and `split`
+ *
+ * The wrapper methods that support shortcut fusion are:
+ * `compact`, `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `filter`,
+ * `first`, `initial`, `last`, `map`, `pluck`, `reject`, `rest`, `reverse`,
+ * `slice`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `toArray`,
+ * and `where`
+ *
+ * The chainable wrapper methods are:
+ * `after`, `ary`, `assign`, `at`, `before`, `bind`, `bindAll`, `bindKey`,
+ * `callback`, `chain`, `chunk`, `commit`, `compact`, `concat`, `constant`,
+ * `countBy`, `create`, `curry`, `debounce`, `defaults`, `defer`, `delay`,
+ * `difference`, `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `fill`,
+ * `filter`, `flatten`, `flattenDeep`, `flow`, `flowRight`, `forEach`,
+ * `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `functions`,
+ * `groupBy`, `indexBy`, `initial`, `intersection`, `invert`, `invoke`, `keys`,
+ * `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
+ * `memoize`, `merge`, `method`, `methodOf`, `mixin`, `negate`, `omit`, `once`,
+ * `pairs`, `partial`, `partialRight`, `partition`, `pick`, `plant`, `pluck`,
+ * `property`, `propertyOf`, `pull`, `pullAt`, `push`, `range`, `rearg`,
+ * `reject`, `remove`, `rest`, `restParam`, `reverse`, `set`, `shuffle`,
+ * `slice`, `sort`, `sortBy`, `sortByAll`, `sortByOrder`, `splice`, `spread`,
+ * `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `tap`, `throttle`,
+ * `thru`, `times`, `toArray`, `toPlainObject`, `transform`, `union`, `uniq`,
+ * `unshift`, `unzip`, `unzipWith`, `values`, `valuesIn`, `where`, `without`,
+ * `wrap`, `xor`, `zip`, `zipObject`, `zipWith`
+ *
+ * The wrapper methods that are **not** chainable by default are:
+ * `add`, `attempt`, `camelCase`, `capitalize`, `clone`, `cloneDeep`, `deburr`,
+ * `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`,
+ * `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`, `get`,
+ * `gt`, `gte`, `has`, `identity`, `includes`, `indexOf`, `inRange`, `isArguments`,
+ * `isArray`, `isBoolean`, `isDate`, `isElement`, `isEmpty`, `isEqual`, `isError`,
+ * `isFinite` `isFunction`, `isMatch`, `isNative`, `isNaN`, `isNull`, `isNumber`,
+ * `isObject`, `isPlainObject`, `isRegExp`, `isString`, `isUndefined`,
+ * `isTypedArray`, `join`, `kebabCase`, `last`, `lastIndexOf`, `lt`, `lte`,
+ * `max`, `min`, `noConflict`, `noop`, `now`, `pad`, `padLeft`, `padRight`,
+ * `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`,
+ * `runInContext`, `shift`, `size`, `snakeCase`, `some`, `sortedIndex`,
+ * `sortedLastIndex`, `startCase`, `startsWith`, `sum`, `template`, `trim`,
+ * `trimLeft`, `trimRight`, `trunc`, `unescape`, `uniqueId`, `value`, and `words`
+ *
+ * The wrapper method `sample` will return a wrapped value when `n` is provided,
+ * otherwise an unwrapped value is returned.
+ *
+ * @name _
+ * @constructor
+ * @category Chain
+ * @param {*} value The value to wrap in a `lodash` instance.
+ * @returns {Object} Returns the new `lodash` wrapper instance.
+ * @example
+ *
+ * var wrapped = _([1, 2, 3]);
+ *
+ * // returns an unwrapped value
+ * wrapped.reduce(function(total, n) {
+ * return total + n;
+ * });
+ * // => 6
+ *
+ * // returns a wrapped value
+ * var squares = wrapped.map(function(n) {
+ * return n * n;
+ * });
+ *
+ * _.isArray(squares);
+ * // => false
+ *
+ * _.isArray(squares.value());
+ * // => true
+ */
+ function lodash(value) {
+ if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
+ if (value instanceof LodashWrapper) {
+ return value;
+ }
+ if (hasOwnProperty.call(value, '__chain__') && hasOwnProperty.call(value, '__wrapped__')) {
+ return wrapperClone(value);
+ }
+ }
+ return new LodashWrapper(value);
+ }
+
+ /**
+ * The function whose prototype all chaining wrappers inherit from.
+ *
+ * @private
+ */
+ function baseLodash() {
+ // No operation performed.
+ }
+
+ /**
+ * The base constructor for creating `lodash` wrapper objects.
+ *
+ * @private
+ * @param {*} value The value to wrap.
+ * @param {boolean} [chainAll] Enable chaining for all wrapper methods.
+ * @param {Array} [actions=[]] Actions to peform to resolve the unwrapped value.
+ */
+ function LodashWrapper(value, chainAll, actions) {
+ this.__wrapped__ = value;
+ this.__actions__ = actions || [];
+ this.__chain__ = !!chainAll;
+ }
+
+ /**
+ * An object environment feature flags.
+ *
+ * @static
+ * @memberOf _
+ * @type Object
+ */
+ var support = lodash.support = {};
+
+ (function(x) {
+ var Ctor = function() { this.x = x; },
+ object = { '0': x, 'length': x },
+ props = [];
+
+ Ctor.prototype = { 'valueOf': x, 'y': x };
+ for (var key in new Ctor) { props.push(key); }
+
+ /**
+ * Detect if the DOM is supported.
+ *
+ * @memberOf _.support
+ * @type boolean
+ */
+ try {
+ support.dom = document.createDocumentFragment().nodeType === 11;
+ } catch(e) {
+ support.dom = false;
+ }
+ }(1, 0));
+
+ /**
+ * By default, the template delimiters used by lodash are like those in
+ * embedded Ruby (ERB). Change the following template settings to use
+ * alternative delimiters.
+ *
+ * @static
+ * @memberOf _
+ * @type Object
+ */
+ lodash.templateSettings = {
+
+ /**
+ * Used to detect `data` property values to be HTML-escaped.
+ *
+ * @memberOf _.templateSettings
+ * @type RegExp
+ */
+ 'escape': reEscape,
+
+ /**
+ * Used to detect code to be evaluated.
+ *
+ * @memberOf _.templateSettings
+ * @type RegExp
+ */
+ 'evaluate': reEvaluate,
+
+ /**
+ * Used to detect `data` property values to inject.
+ *
+ * @memberOf _.templateSettings
+ * @type RegExp
+ */
+ 'interpolate': reInterpolate,
+
+ /**
+ * Used to reference the data object in the template text.
+ *
+ * @memberOf _.templateSettings
+ * @type string
+ */
+ 'variable': '',
+
+ /**
+ * Used to import variables into the compiled template.
+ *
+ * @memberOf _.templateSettings
+ * @type Object
+ */
+ 'imports': {
+
+ /**
+ * A reference to the `lodash` function.
+ *
+ * @memberOf _.templateSettings.imports
+ * @type Function
+ */
+ '_': lodash
+ }
+ };
+
+ /*------------------------------------------------------------------------*/
+
+ /**
+ * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
+ *
+ * @private
+ * @param {*} value The value to wrap.
+ */
+ function LazyWrapper(value) {
+ this.__wrapped__ = value;
+ this.__actions__ = null;
+ this.__dir__ = 1;
+ this.__dropCount__ = 0;
+ this.__filtered__ = false;
+ this.__iteratees__ = null;
+ this.__takeCount__ = POSITIVE_INFINITY;
+ this.__views__ = null;
+ }
+
+ /**
+ * Creates a clone of the lazy wrapper object.
+ *
+ * @private
+ * @name clone
+ * @memberOf LazyWrapper
+ * @returns {Object} Returns the cloned `LazyWrapper` object.
+ */
+ function lazyClone() {
+ var actions = this.__actions__,
+ iteratees = this.__iteratees__,
+ views = this.__views__,
+ result = new LazyWrapper(this.__wrapped__);
+
+ result.__actions__ = actions ? arrayCopy(actions) : null;
+ result.__dir__ = this.__dir__;
+ result.__filtered__ = this.__filtered__;
+ result.__iteratees__ = iteratees ? arrayCopy(iteratees) : null;
+ result.__takeCount__ = this.__takeCount__;
+ result.__views__ = views ? arrayCopy(views) : null;
+ return result;
+ }
+
+ /**
+ * Reverses the direction of lazy iteration.
+ *
+ * @private
+ * @name reverse
+ * @memberOf LazyWrapper
+ * @returns {Object} Returns the new reversed `LazyWrapper` object.
+ */
+ function lazyReverse() {
+ if (this.__filtered__) {
+ var result = new LazyWrapper(this);
+ result.__dir__ = -1;
+ result.__filtered__ = true;
+ } else {
+ result = this.clone();
+ result.__dir__ *= -1;
+ }
+ return result;
+ }
+
+ /**
+ * Extracts the unwrapped value from its lazy wrapper.
+ *
+ * @private
+ * @name value
+ * @memberOf LazyWrapper
+ * @returns {*} Returns the unwrapped value.
+ */
+ function lazyValue() {
+ var array = this.__wrapped__.value();
+ if (!isArray(array)) {
+ return baseWrapperValue(array, this.__actions__);
+ }
+ var dir = this.__dir__,
+ isRight = dir < 0,
+ view = getView(0, array.length, this.__views__),
+ start = view.start,
+ end = view.end,
+ length = end - start,
+ index = isRight ? end : (start - 1),
+ takeCount = nativeMin(length, this.__takeCount__),
+ iteratees = this.__iteratees__,
+ iterLength = iteratees ? iteratees.length : 0,
+ resIndex = 0,
+ result = [];
+
+ outer:
+ while (length-- && resIndex < takeCount) {
+ index += dir;
+
+ var iterIndex = -1,
+ value = array[index];
+
+ while (++iterIndex < iterLength) {
+ var data = iteratees[iterIndex],
+ iteratee = data.iteratee,
+ type = data.type;
+
+ if (type == LAZY_DROP_WHILE_FLAG) {
+ if (data.done && (isRight ? (index > data.index) : (index < data.index))) {
+ data.count = 0;
+ data.done = false;
+ }
+ data.index = index;
+ if (!data.done) {
+ var limit = data.limit;
+ if (!(data.done = limit > -1 ? (data.count++ >= limit) : !iteratee(value))) {
+ continue outer;
+ }
+ }
+ } else {
+ var computed = iteratee(value);
+ if (type == LAZY_MAP_FLAG) {
+ value = computed;
+ } else if (!computed) {
+ if (type == LAZY_FILTER_FLAG) {
+ continue outer;
+ } else {
+ break outer;
+ }
+ }
+ }
+ }
+ result[resIndex++] = value;
+ }
+ return result;
+ }
+
+ /*------------------------------------------------------------------------*/
+
+ /**
+ * Creates a cache object to store key/value pairs.
+ *
+ * @private
+ * @static
+ * @name Cache
+ * @memberOf _.memoize
+ */
+ function MapCache() {
+ this.__data__ = {};
+ }
+
+ /**
+ * Removes `key` and its value from the cache.
+ *
+ * @private
+ * @name delete
+ * @memberOf _.memoize.Cache
+ * @param {string} key The key of the value to remove.
+ * @returns {boolean} Returns `true` if the entry was removed successfully, else `false`.
+ */
+ function mapDelete(key) {
+ return this.has(key) && delete this.__data__[key];
+ }
+
+ /**
+ * Gets the cached value for `key`.
+ *
+ * @private
+ * @name get
+ * @memberOf _.memoize.Cache
+ * @param {string} key The key of the value to get.
+ * @returns {*} Returns the cached value.
+ */
+ function mapGet(key) {
+ return key == '__proto__' ? undefined : this.__data__[key];
+ }
+
+ /**
+ * Checks if a cached value for `key` exists.
+ *
+ * @private
+ * @name has
+ * @memberOf _.memoize.Cache
+ * @param {string} key The key of the entry to check.
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
+ */
+ function mapHas(key) {
+ return key != '__proto__' && hasOwnProperty.call(this.__data__, key);
+ }
+
+ /**
+ * Sets `value` to `key` of the cache.
+ *
+ * @private
+ * @name set
+ * @memberOf _.memoize.Cache
+ * @param {string} key The key of the value to cache.
+ * @param {*} value The value to cache.
+ * @returns {Object} Returns the cache object.
+ */
+ function mapSet(key, value) {
+ if (key != '__proto__') {
+ this.__data__[key] = value;
+ }
+ return this;
+ }
+
+ /*------------------------------------------------------------------------*/
+
+ /**
+ *
+ * Creates a cache object to store unique values.
+ *
+ * @private
+ * @param {Array} [values] The values to cache.
+ */
+ function SetCache(values) {
+ var length = values ? values.length : 0;
+
+ this.data = { 'hash': nativeCreate(null), 'set': new Set };
+ while (length--) {
+ this.push(values[length]);
+ }
+ }
+
+ /**
+ * Checks if `value` is in `cache` mimicking the return signature of
+ * `_.indexOf` by returning `0` if the value is found, else `-1`.
+ *
+ * @private
+ * @param {Object} cache The cache to search.
+ * @param {*} value The value to search for.
+ * @returns {number} Returns `0` if `value` is found, else `-1`.
+ */
+ function cacheIndexOf(cache, value) {
+ var data = cache.data,
+ result = (typeof value == 'string' || isObject(value)) ? data.set.has(value) : data.hash[value];
+
+ return result ? 0 : -1;
+ }
+
+ /**
+ * Adds `value` to the cache.
+ *
+ * @private
+ * @name push
+ * @memberOf SetCache
+ * @param {*} value The value to cache.
+ */
+ function cachePush(value) {
+ var data = this.data;
+ if (typeof value == 'string' || isObject(value)) {
+ data.set.add(value);
+ } else {
+ data.hash[value] = true;
+ }
+ }
+
+ /*------------------------------------------------------------------------*/
+
+ /**
+ * Copies the values of `source` to `array`.
+ *
+ * @private
+ * @param {Array} source The array to copy values from.
+ * @param {Array} [array=[]] The array to copy values to.
+ * @returns {Array} Returns `array`.
+ */
+ function arrayCopy(source, array) {
+ var index = -1,
+ length = source.length;
+
+ array || (array = Array(length));
+ while (++index < length) {
+ array[index] = source[index];
+ }
+ return array;
+ }
+
+ /**
+ * A specialized version of `_.forEach` for arrays without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns `array`.
+ */
+ function arrayEach(array, iteratee) {
+ var index = -1,
+ length = array.length;
+
+ while (++index < length) {
+ if (iteratee(array[index], index, array) === false) {
+ break;
+ }
+ }
+ return array;
+ }
+
+ /**
+ * A specialized version of `_.forEachRight` for arrays without support for
+ * callback shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns `array`.
+ */
+ function arrayEachRight(array, iteratee) {
+ var length = array.length;
+
+ while (length--) {
+ if (iteratee(array[length], length, array) === false) {
+ break;
+ }
+ }
+ return array;
+ }
+
+ /**
+ * A specialized version of `_.every` for arrays without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {boolean} Returns `true` if all elements pass the predicate check,
+ * else `false`.
+ */
+ function arrayEvery(array, predicate) {
+ var index = -1,
+ length = array.length;
+
+ while (++index < length) {
+ if (!predicate(array[index], index, array)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * A specialized version of `baseExtremum` for arrays which invokes `iteratee`
+ * with one argument: (value).
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {Function} comparator The function used to compare values.
+ * @param {*} exValue The initial extremum value.
+ * @returns {*} Returns the extremum value.
+ */
+ function arrayExtremum(array, iteratee, comparator, exValue) {
+ var index = -1,
+ length = array.length,
+ computed = exValue,
+ result = computed;
+
+ while (++index < length) {
+ var value = array[index],
+ current = +iteratee(value);
+
+ if (comparator(current, computed)) {
+ computed = current;
+ result = value;
+ }
+ }
+ return result;
+ }
+
+ /**
+ * A specialized version of `_.filter` for arrays without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {Array} Returns the new filtered array.
+ */
+ function arrayFilter(array, predicate) {
+ var index = -1,
+ length = array.length,
+ resIndex = -1,
+ result = [];
+
+ while (++index < length) {
+ var value = array[index];
+ if (predicate(value, index, array)) {
+ result[++resIndex] = value;
+ }
+ }
+ return result;
+ }
+
+ /**
+ * A specialized version of `_.map` for arrays without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns the new mapped array.
+ */
+ function arrayMap(array, iteratee) {
+ var index = -1,
+ length = array.length,
+ result = Array(length);
+
+ while (++index < length) {
+ result[index] = iteratee(array[index], index, array);
+ }
+ return result;
+ }
+
+ /**
+ * A specialized version of `_.reduce` for arrays without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {*} [accumulator] The initial value.
+ * @param {boolean} [initFromArray] Specify using the first element of `array`
+ * as the initial value.
+ * @returns {*} Returns the accumulated value.
+ */
+ function arrayReduce(array, iteratee, accumulator, initFromArray) {
+ var index = -1,
+ length = array.length;
+
+ if (initFromArray && length) {
+ accumulator = array[++index];
+ }
+ while (++index < length) {
+ accumulator = iteratee(accumulator, array[index], index, array);
+ }
+ return accumulator;
+ }
+
+ /**
+ * A specialized version of `_.reduceRight` for arrays without support for
+ * callback shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {*} [accumulator] The initial value.
+ * @param {boolean} [initFromArray] Specify using the last element of `array`
+ * as the initial value.
+ * @returns {*} Returns the accumulated value.
+ */
+ function arrayReduceRight(array, iteratee, accumulator, initFromArray) {
+ var length = array.length;
+ if (initFromArray && length) {
+ accumulator = array[--length];
+ }
+ while (length--) {
+ accumulator = iteratee(accumulator, array[length], length, array);
+ }
+ return accumulator;
+ }
+
+ /**
+ * A specialized version of `_.some` for arrays without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {boolean} Returns `true` if any element passes the predicate check,
+ * else `false`.
+ */
+ function arraySome(array, predicate) {
+ var index = -1,
+ length = array.length;
+
+ while (++index < length) {
+ if (predicate(array[index], index, array)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * A specialized version of `_.sum` for arrays without support for iteratees.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @returns {number} Returns the sum.
+ */
+ function arraySum(array) {
+ var length = array.length,
+ result = 0;
+
+ while (length--) {
+ result += +array[length] || 0;
+ }
+ return result;
+ }
+
+ /**
+ * Used by `_.defaults` to customize its `_.assign` use.
+ *
+ * @private
+ * @param {*} objectValue The destination object property value.
+ * @param {*} sourceValue The source object property value.
+ * @returns {*} Returns the value to assign to the destination object.
+ */
+ function assignDefaults(objectValue, sourceValue) {
+ return objectValue === undefined ? sourceValue : objectValue;
+ }
+
+ /**
+ * Used by `_.template` to customize its `_.assign` use.
+ *
+ * **Note:** This function is like `assignDefaults` except that it ignores
+ * inherited property values when checking if a property is `undefined`.
+ *
+ * @private
+ * @param {*} objectValue The destination object property value.
+ * @param {*} sourceValue The source object property value.
+ * @param {string} key The key associated with the object and source values.
+ * @param {Object} object The destination object.
+ * @returns {*} Returns the value to assign to the destination object.
+ */
+ function assignOwnDefaults(objectValue, sourceValue, key, object) {
+ return (objectValue === undefined || !hasOwnProperty.call(object, key))
+ ? sourceValue
+ : objectValue;
+ }
+
+ /**
+ * A specialized version of `_.assign` for customizing assigned values without
+ * support for argument juggling, multiple sources, and `this` binding `customizer`
+ * functions.
+ *
+ * @private
+ * @param {Object} object The destination object.
+ * @param {Object} source The source object.
+ * @param {Function} customizer The function to customize assigned values.
+ * @returns {Object} Returns `object`.
+ */
+ function assignWith(object, source, customizer) {
+ var index = -1,
+ props = keys(source),
+ length = props.length;
+
+ while (++index < length) {
+ var key = props[index],
+ value = object[key],
+ result = customizer(value, source[key], key, object, source);
+
+ if ((result === result ? (result !== value) : (value === value)) ||
+ (value === undefined && !(key in object))) {
+ object[key] = result;
+ }
+ }
+ return object;
+ }
+
+ /**
+ * The base implementation of `_.assign` without support for argument juggling,
+ * multiple sources, and `customizer` functions.
+ *
+ * @private
+ * @param {Object} object The destination object.
+ * @param {Object} source The source object.
+ * @returns {Object} Returns `object`.
+ */
+ function baseAssign(object, source) {
+ return source == null
+ ? object
+ : baseCopy(source, keys(source), object);
+ }
+
+ /**
+ * The base implementation of `_.at` without support for string collections
+ * and individual key arguments.
+ *
+ * @private
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {number[]|string[]} props The property names or indexes of elements to pick.
+ * @returns {Array} Returns the new array of picked elements.
+ */
+ function baseAt(collection, props) {
+ var index = -1,
+ isNil = collection == null,
+ isArr = !isNil && isArrayLike(collection),
+ length = isArr ? collection.length : 0,
+ propsLength = props.length,
+ result = Array(propsLength);
+
+ while(++index < propsLength) {
+ var key = props[index];
+ if (isArr) {
+ result[index] = isIndex(key, length) ? collection[key] : undefined;
+ } else {
+ result[index] = isNil ? undefined : collection[key];
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Copies properties of `source` to `object`.
+ *
+ * @private
+ * @param {Object} source The object to copy properties from.
+ * @param {Array} props The property names to copy.
+ * @param {Object} [object={}] The object to copy properties to.
+ * @returns {Object} Returns `object`.
+ */
+ function baseCopy(source, props, object) {
+ object || (object = {});
+
+ var index = -1,
+ length = props.length;
+
+ while (++index < length) {
+ var key = props[index];
+ object[key] = source[key];
+ }
+ return object;
+ }
+
+ /**
+ * The base implementation of `_.callback` which supports specifying the
+ * number of arguments to provide to `func`.
+ *
+ * @private
+ * @param {*} [func=_.identity] The value to convert to a callback.
+ * @param {*} [thisArg] The `this` binding of `func`.
+ * @param {number} [argCount] The number of arguments to provide to `func`.
+ * @returns {Function} Returns the callback.
+ */
+ function baseCallback(func, thisArg, argCount) {
+ var type = typeof func;
+ if (type == 'function') {
+ return thisArg === undefined
+ ? func
+ : bindCallback(func, thisArg, argCount);
+ }
+ if (func == null) {
+ return identity;
+ }
+ if (type == 'object') {
+ return baseMatches(func);
+ }
+ return thisArg === undefined
+ ? property(func)
+ : baseMatchesProperty(func, thisArg);
+ }
+
+ /**
+ * The base implementation of `_.clone` without support for argument juggling
+ * and `this` binding `customizer` functions.
+ *
+ * @private
+ * @param {*} value The value to clone.
+ * @param {boolean} [isDeep] Specify a deep clone.
+ * @param {Function} [customizer] The function to customize cloning values.
+ * @param {string} [key] The key of `value`.
+ * @param {Object} [object] The object `value` belongs to.
+ * @param {Array} [stackA=[]] Tracks traversed source objects.
+ * @param {Array} [stackB=[]] Associates clones with source counterparts.
+ * @returns {*} Returns the cloned value.
+ */
+ function baseClone(value, isDeep, customizer, key, object, stackA, stackB) {
+ var result;
+ if (customizer) {
+ result = object ? customizer(value, key, object) : customizer(value);
+ }
+ if (result !== undefined) {
+ return result;
+ }
+ if (!isObject(value)) {
+ return value;
+ }
+ var isArr = isArray(value);
+ if (isArr) {
+ result = initCloneArray(value);
+ if (!isDeep) {
+ return arrayCopy(value, result);
+ }
+ } else {
+ var tag = objToString.call(value),
+ isFunc = tag == funcTag;
+
+ if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
+ result = initCloneObject(isFunc ? {} : value);
+ if (!isDeep) {
+ return baseAssign(result, value);
+ }
+ } else {
+ return cloneableTags[tag]
+ ? initCloneByTag(value, tag, isDeep)
+ : (object ? value : {});
+ }
+ }
+ // Check for circular references and return corresponding clone.
+ stackA || (stackA = []);
+ stackB || (stackB = []);
+
+ var length = stackA.length;
+ while (length--) {
+ if (stackA[length] == value) {
+ return stackB[length];
+ }
+ }
+ // Add the source value to the stack of traversed objects and associate it with its clone.
+ stackA.push(value);
+ stackB.push(result);
+
+ // Recursively populate clone (susceptible to call stack limits).
+ (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) {
+ result[key] = baseClone(subValue, isDeep, customizer, key, value, stackA, stackB);
+ });
+ return result;
+ }
+
+ /**
+ * The base implementation of `_.create` without support for assigning
+ * properties to the created object.
+ *
+ * @private
+ * @param {Object} prototype The object to inherit from.
+ * @returns {Object} Returns the new object.
+ */
+ var baseCreate = (function() {
+ function object() {}
+ return function(prototype) {
+ if (isObject(prototype)) {
+ object.prototype = prototype;
+ var result = new object;
+ object.prototype = null;
+ }
+ return result || {};
+ };
+ }());
+
+ /**
+ * The base implementation of `_.delay` and `_.defer` which accepts an index
+ * of where to slice the arguments to provide to `func`.
+ *
+ * @private
+ * @param {Function} func The function to delay.
+ * @param {number} wait The number of milliseconds to delay invocation.
+ * @param {Object} args The arguments provide to `func`.
+ * @returns {number} Returns the timer id.
+ */
+ function baseDelay(func, wait, args) {
+ if (typeof func != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ return setTimeout(function() { func.apply(undefined, args); }, wait);
+ }
+
+ /**
+ * The base implementation of `_.difference` which accepts a single array
+ * of values to exclude.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {Array} values The values to exclude.
+ * @returns {Array} Returns the new array of filtered values.
+ */
+ function baseDifference(array, values) {
+ var length = array ? array.length : 0,
+ result = [];
+
+ if (!length) {
+ return result;
+ }
+ var index = -1,
+ indexOf = getIndexOf(),
+ isCommon = indexOf == baseIndexOf,
+ cache = (isCommon && values.length >= 200) ? createCache(values) : null,
+ valuesLength = values.length;
+
+ if (cache) {
+ indexOf = cacheIndexOf;
+ isCommon = false;
+ values = cache;
+ }
+ outer:
+ while (++index < length) {
+ var value = array[index];
+
+ if (isCommon && value === value) {
+ var valuesIndex = valuesLength;
+ while (valuesIndex--) {
+ if (values[valuesIndex] === value) {
+ continue outer;
+ }
+ }
+ result.push(value);
+ }
+ else if (indexOf(values, value, 0) < 0) {
+ result.push(value);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * The base implementation of `_.forEach` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array|Object|string} Returns `collection`.
+ */
+ var baseEach = createBaseEach(baseForOwn);
+
+ /**
+ * The base implementation of `_.forEachRight` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array|Object|string} Returns `collection`.
+ */
+ var baseEachRight = createBaseEach(baseForOwnRight, true);
+
+ /**
+ * The base implementation of `_.every` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {boolean} Returns `true` if all elements pass the predicate check,
+ * else `false`
+ */
+ function baseEvery(collection, predicate) {
+ var result = true;
+ baseEach(collection, function(value, index, collection) {
+ result = !!predicate(value, index, collection);
+ return result;
+ });
+ return result;
+ }
+
+ /**
+ * Gets the extremum value of `collection` invoking `iteratee` for each value
+ * in `collection` to generate the criterion by which the value is ranked.
+ * The `iteratee` is invoked with three arguments: (value, index|key, collection).
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {Function} comparator The function used to compare values.
+ * @param {*} exValue The initial extremum value.
+ * @returns {*} Returns the extremum value.
+ */
+ function baseExtremum(collection, iteratee, comparator, exValue) {
+ var computed = exValue,
+ result = computed;
+
+ baseEach(collection, function(value, index, collection) {
+ var current = +iteratee(value, index, collection);
+ if (comparator(current, computed) || (current === exValue && current === result)) {
+ computed = current;
+ result = value;
+ }
+ });
+ return result;
+ }
+
+ /**
+ * The base implementation of `_.fill` without an iteratee call guard.
+ *
+ * @private
+ * @param {Array} array The array to fill.
+ * @param {*} value The value to fill `array` with.
+ * @param {number} [start=0] The start position.
+ * @param {number} [end=array.length] The end position.
+ * @returns {Array} Returns `array`.
+ */
+ function baseFill(array, value, start, end) {
+ var length = array.length;
+
+ start = start == null ? 0 : (+start || 0);
+ if (start < 0) {
+ start = -start > length ? 0 : (length + start);
+ }
+ end = (end === undefined || end > length) ? length : (+end || 0);
+ if (end < 0) {
+ end += length;
+ }
+ length = start > end ? 0 : (end >>> 0);
+ start >>>= 0;
+
+ while (start < length) {
+ array[start++] = value;
+ }
+ return array;
+ }
+
+ /**
+ * The base implementation of `_.filter` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {Array} Returns the new filtered array.
+ */
+ function baseFilter(collection, predicate) {
+ var result = [];
+ baseEach(collection, function(value, index, collection) {
+ if (predicate(value, index, collection)) {
+ result.push(value);
+ }
+ });
+ return result;
+ }
+
+ /**
+ * The base implementation of `_.find`, `_.findLast`, `_.findKey`, and `_.findLastKey`,
+ * without support for callback shorthands and `this` binding, which iterates
+ * over `collection` using the provided `eachFunc`.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to search.
+ * @param {Function} predicate The function invoked per iteration.
+ * @param {Function} eachFunc The function to iterate over `collection`.
+ * @param {boolean} [retKey] Specify returning the key of the found element
+ * instead of the element itself.
+ * @returns {*} Returns the found element or its key, else `undefined`.
+ */
+ function baseFind(collection, predicate, eachFunc, retKey) {
+ var result;
+ eachFunc(collection, function(value, key, collection) {
+ if (predicate(value, key, collection)) {
+ result = retKey ? key : value;
+ return false;
+ }
+ });
+ return result;
+ }
+
+ /**
+ * The base implementation of `_.flatten` with added support for restricting
+ * flattening and specifying the start index.
+ *
+ * @private
+ * @param {Array} array The array to flatten.
+ * @param {boolean} [isDeep] Specify a deep flatten.
+ * @param {boolean} [isStrict] Restrict flattening to arrays-like objects.
+ * @returns {Array} Returns the new flattened array.
+ */
+ function baseFlatten(array, isDeep, isStrict) {
+ var index = -1,
+ length = array.length,
+ resIndex = -1,
+ result = [];
+
+ while (++index < length) {
+ var value = array[index];
+ if (isObjectLike(value) && isArrayLike(value) &&
+ (isStrict || isArray(value) || isArguments(value))) {
+ if (isDeep) {
+ // Recursively flatten arrays (susceptible to call stack limits).
+ value = baseFlatten(value, isDeep, isStrict);
+ }
+ var valIndex = -1,
+ valLength = value.length;
+
+ while (++valIndex < valLength) {
+ result[++resIndex] = value[valIndex];
+ }
+ } else if (!isStrict) {
+ result[++resIndex] = value;
+ }
+ }
+ return result;
+ }
+
+ /**
+ * The base implementation of `baseForIn` and `baseForOwn` which iterates
+ * over `object` properties returned by `keysFunc` invoking `iteratee` for
+ * each property. Iteratee functions may exit iteration early by explicitly
+ * returning `false`.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {Function} keysFunc The function to get the keys of `object`.
+ * @returns {Object} Returns `object`.
+ */
+ var baseFor = createBaseFor();
+
+ /**
+ * This function is like `baseFor` except that it iterates over properties
+ * in the opposite order.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {Function} keysFunc The function to get the keys of `object`.
+ * @returns {Object} Returns `object`.
+ */
+ var baseForRight = createBaseFor(true);
+
+ /**
+ * The base implementation of `_.forIn` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Object} Returns `object`.
+ */
+ function baseForIn(object, iteratee) {
+ return baseFor(object, iteratee, keysIn);
+ }
+
+ /**
+ * The base implementation of `_.forOwn` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Object} Returns `object`.
+ */
+ function baseForOwn(object, iteratee) {
+ return baseFor(object, iteratee, keys);
+ }
+
+ /**
+ * The base implementation of `_.forOwnRight` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Object} Returns `object`.
+ */
+ function baseForOwnRight(object, iteratee) {
+ return baseForRight(object, iteratee, keys);
+ }
+
+ /**
+ * The base implementation of `_.functions` which creates an array of
+ * `object` function property names filtered from those provided.
+ *
+ * @private
+ * @param {Object} object The object to inspect.
+ * @param {Array} props The property names to filter.
+ * @returns {Array} Returns the new array of filtered property names.
+ */
+ function baseFunctions(object, props) {
+ var index = -1,
+ length = props.length,
+ resIndex = -1,
+ result = [];
+
+ while (++index < length) {
+ var key = props[index];
+ if (isFunction(object[key])) {
+ result[++resIndex] = key;
+ }
+ }
+ return result;
+ }
+
+ /**
+ * The base implementation of `get` without support for string paths
+ * and default values.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {Array} path The path of the property to get.
+ * @param {string} [pathKey] The key representation of path.
+ * @returns {*} Returns the resolved value.
+ */
+ function baseGet(object, path, pathKey) {
+ if (object == null) {
+ return;
+ }
+ if (pathKey !== undefined && pathKey in toObject(object)) {
+ path = [pathKey];
+ }
+ var index = 0,
+ length = path.length;
+
+ while (object != null && index < length) {
+ object = object[path[index++]];
+ }
+ return (index && index == length) ? object : undefined;
+ }
+
+ /**
+ * The base implementation of `_.isEqual` without support for `this` binding
+ * `customizer` functions.
+ *
+ * @private
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @param {Function} [customizer] The function to customize comparing values.
+ * @param {boolean} [isLoose] Specify performing partial comparisons.
+ * @param {Array} [stackA] Tracks traversed `value` objects.
+ * @param {Array} [stackB] Tracks traversed `other` objects.
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
+ */
+ function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) {
+ if (value === other) {
+ return true;
+ }
+ if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {
+ return value !== value && other !== other;
+ }
+ return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB);
+ }
+
+ /**
+ * A specialized version of `baseIsEqual` for arrays and objects which performs
+ * deep comparisons and tracks traversed objects enabling objects with circular
+ * references to be compared.
+ *
+ * @private
+ * @param {Object} object The object to compare.
+ * @param {Object} other The other object to compare.
+ * @param {Function} equalFunc The function to determine equivalents of values.
+ * @param {Function} [customizer] The function to customize comparing objects.
+ * @param {boolean} [isLoose] Specify performing partial comparisons.
+ * @param {Array} [stackA=[]] Tracks traversed `value` objects.
+ * @param {Array} [stackB=[]] Tracks traversed `other` objects.
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+ */
+ function baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
+ var objIsArr = isArray(object),
+ othIsArr = isArray(other),
+ objTag = arrayTag,
+ othTag = arrayTag;
+
+ if (!objIsArr) {
+ objTag = objToString.call(object);
+ if (objTag == argsTag) {
+ objTag = objectTag;
+ } else if (objTag != objectTag) {
+ objIsArr = isTypedArray(object);
+ }
+ }
+ if (!othIsArr) {
+ othTag = objToString.call(other);
+ if (othTag == argsTag) {
+ othTag = objectTag;
+ } else if (othTag != objectTag) {
+ othIsArr = isTypedArray(other);
+ }
+ }
+ var objIsObj = objTag == objectTag,
+ othIsObj = othTag == objectTag,
+ isSameTag = objTag == othTag;
+
+ if (isSameTag && !(objIsArr || objIsObj)) {
+ return equalByTag(object, other, objTag);
+ }
+ if (!isLoose) {
+ var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
+ othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
+
+ if (objIsWrapped || othIsWrapped) {
+ return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, isLoose, stackA, stackB);
+ }
+ }
+ if (!isSameTag) {
+ return false;
+ }
+ // Assume cyclic values are equal.
+ // For more information on detecting circular references see https://es5.github.io/#JO.
+ stackA || (stackA = []);
+ stackB || (stackB = []);
+
+ var length = stackA.length;
+ while (length--) {
+ if (stackA[length] == object) {
+ return stackB[length] == other;
+ }
+ }
+ // Add `object` and `other` to the stack of traversed objects.
+ stackA.push(object);
+ stackB.push(other);
+
+ var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB);
+
+ stackA.pop();
+ stackB.pop();
+
+ return result;
+ }
+
+ /**
+ * The base implementation of `_.isMatch` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Object} object The object to inspect.
+ * @param {Array} matchData The propery names, values, and compare flags to match.
+ * @param {Function} [customizer] The function to customize comparing objects.
+ * @returns {boolean} Returns `true` if `object` is a match, else `false`.
+ */
+ function baseIsMatch(object, matchData, customizer) {
+ var index = matchData.length,
+ length = index,
+ noCustomizer = !customizer;
+
+ if (object == null) {
+ return !length;
+ }
+ object = toObject(object);
+ while (index--) {
+ var data = matchData[index];
+ if ((noCustomizer && data[2])
+ ? data[1] !== object[data[0]]
+ : !(data[0] in object)
+ ) {
+ return false;
+ }
+ }
+ while (++index < length) {
+ data = matchData[index];
+ var key = data[0],
+ objValue = object[key],
+ srcValue = data[1];
+
+ if (noCustomizer && data[2]) {
+ if (objValue === undefined && !(key in object)) {
+ return false;
+ }
+ } else {
+ var result = customizer ? customizer(objValue, srcValue, key) : undefined;
+ if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, true) : result)) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ /**
+ * The base implementation of `_.map` without support for callback shorthands
+ * and `this` binding.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns the new mapped array.
+ */
+ function baseMap(collection, iteratee) {
+ var index = -1,
+ result = isArrayLike(collection) ? Array(collection.length) : [];
+
+ baseEach(collection, function(value, key, collection) {
+ result[++index] = iteratee(value, key, collection);
+ });
+ return result;
+ }
+
+ /**
+ * The base implementation of `_.matches` which does not clone `source`.
+ *
+ * @private
+ * @param {Object} source The object of property values to match.
+ * @returns {Function} Returns the new function.
+ */
+ function baseMatches(source) {
+ var matchData = getMatchData(source);
+ if (matchData.length == 1 && matchData[0][2]) {
+ var key = matchData[0][0],
+ value = matchData[0][1];
+
+ return function(object) {
+ if (object == null) {
+ return false;
+ }
+ return object[key] === value && (value !== undefined || (key in toObject(object)));
+ };
+ }
+ return function(object) {
+ return baseIsMatch(object, matchData);
+ };
+ }
+
+ /**
+ * The base implementation of `_.matchesProperty` which does not clone `srcValue`.
+ *
+ * @private
+ * @param {string} path The path of the property to get.
+ * @param {*} srcValue The value to compare.
+ * @returns {Function} Returns the new function.
+ */
+ function baseMatchesProperty(path, srcValue) {
+ var isArr = isArray(path),
+ isCommon = isKey(path) && isStrictComparable(srcValue),
+ pathKey = (path + '');
+
+ path = toPath(path);
+ return function(object) {
+ if (object == null) {
+ return false;
+ }
+ var key = pathKey;
+ object = toObject(object);
+ if ((isArr || !isCommon) && !(key in object)) {
+ object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
+ if (object == null) {
+ return false;
+ }
+ key = last(path);
+ object = toObject(object);
+ }
+ return object[key] === srcValue
+ ? (srcValue !== undefined || (key in object))
+ : baseIsEqual(srcValue, object[key], undefined, true);
+ };
+ }
+
+ /**
+ * The base implementation of `_.merge` without support for argument juggling,
+ * multiple sources, and `this` binding `customizer` functions.
+ *
+ * @private
+ * @param {Object} object The destination object.
+ * @param {Object} source The source object.
+ * @param {Function} [customizer] The function to customize merging properties.
+ * @param {Array} [stackA=[]] Tracks traversed source objects.
+ * @param {Array} [stackB=[]] Associates values with source counterparts.
+ * @returns {Object} Returns `object`.
+ */
+ function baseMerge(object, source, customizer, stackA, stackB) {
+ if (!isObject(object)) {
+ return object;
+ }
+ var isSrcArr = isArrayLike(source) && (isArray(source) || isTypedArray(source)),
+ props = isSrcArr ? null : keys(source);
+
+ arrayEach(props || source, function(srcValue, key) {
+ if (props) {
+ key = srcValue;
+ srcValue = source[key];
+ }
+ if (isObjectLike(srcValue)) {
+ stackA || (stackA = []);
+ stackB || (stackB = []);
+ baseMergeDeep(object, source, key, baseMerge, customizer, stackA, stackB);
+ }
+ else {
+ var value = object[key],
+ result = customizer ? customizer(value, srcValue, key, object, source) : undefined,
+ isCommon = result === undefined;
+
+ if (isCommon) {
+ result = srcValue;
+ }
+ if ((result !== undefined || (isSrcArr && !(key in object))) &&
+ (isCommon || (result === result ? (result !== value) : (value === value)))) {
+ object[key] = result;
+ }
+ }
+ });
+ return object;
+ }
+
+ /**
+ * A specialized version of `baseMerge` for arrays and objects which performs
+ * deep merges and tracks traversed objects enabling objects with circular
+ * references to be merged.
+ *
+ * @private
+ * @param {Object} object The destination object.
+ * @param {Object} source The source object.
+ * @param {string} key The key of the value to merge.
+ * @param {Function} mergeFunc The function to merge values.
+ * @param {Function} [customizer] The function to customize merging properties.
+ * @param {Array} [stackA=[]] Tracks traversed source objects.
+ * @param {Array} [stackB=[]] Associates values with source counterparts.
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+ */
+ function baseMergeDeep(object, source, key, mergeFunc, customizer, stackA, stackB) {
+ var length = stackA.length,
+ srcValue = source[key];
+
+ while (length--) {
+ if (stackA[length] == srcValue) {
+ object[key] = stackB[length];
+ return;
+ }
+ }
+ var value = object[key],
+ result = customizer ? customizer(value, srcValue, key, object, source) : undefined,
+ isCommon = result === undefined;
+
+ if (isCommon) {
+ result = srcValue;
+ if (isArrayLike(srcValue) && (isArray(srcValue) || isTypedArray(srcValue))) {
+ result = isArray(value)
+ ? value
+ : (isArrayLike(value) ? arrayCopy(value) : []);
+ }
+ else if (isPlainObject(srcValue) || isArguments(srcValue)) {
+ result = isArguments(value)
+ ? toPlainObject(value)
+ : (isPlainObject(value) ? value : {});
+ }
+ else {
+ isCommon = false;
+ }
+ }
+ // Add the source value to the stack of traversed objects and associate
+ // it with its merged value.
+ stackA.push(srcValue);
+ stackB.push(result);
+
+ if (isCommon) {
+ // Recursively merge objects and arrays (susceptible to call stack limits).
+ object[key] = mergeFunc(result, srcValue, customizer, stackA, stackB);
+ } else if (result === result ? (result !== value) : (value === value)) {
+ object[key] = result;
+ }
+ }
+
+ /**
+ * The base implementation of `_.property` without support for deep paths.
+ *
+ * @private
+ * @param {string} key The key of the property to get.
+ * @returns {Function} Returns the new function.
+ */
+ function baseProperty(key) {
+ return function(object) {
+ return object == null ? undefined : object[key];
+ };
+ }
+
+ /**
+ * A specialized version of `baseProperty` which supports deep paths.
+ *
+ * @private
+ * @param {Array|string} path The path of the property to get.
+ * @returns {Function} Returns the new function.
+ */
+ function basePropertyDeep(path) {
+ var pathKey = (path + '');
+ path = toPath(path);
+ return function(object) {
+ return baseGet(object, path, pathKey);
+ };
+ }
+
+ /**
+ * The base implementation of `_.pullAt` without support for individual
+ * index arguments and capturing the removed elements.
+ *
+ * @private
+ * @param {Array} array The array to modify.
+ * @param {number[]} indexes The indexes of elements to remove.
+ * @returns {Array} Returns `array`.
+ */
+ function basePullAt(array, indexes) {
+ var length = array ? indexes.length : 0;
+ while (length--) {
+ var index = indexes[length];
+ if (index != previous && isIndex(index)) {
+ var previous = index;
+ splice.call(array, index, 1);
+ }
+ }
+ return array;
+ }
+
+ /**
+ * The base implementation of `_.random` without support for argument juggling
+ * and returning floating-point numbers.
+ *
+ * @private
+ * @param {number} min The minimum possible value.
+ * @param {number} max The maximum possible value.
+ * @returns {number} Returns the random number.
+ */
+ function baseRandom(min, max) {
+ return min + floor(nativeRandom() * (max - min + 1));
+ }
+
+ /**
+ * The base implementation of `_.reduce` and `_.reduceRight` without support
+ * for callback shorthands and `this` binding, which iterates over `collection`
+ * using the provided `eachFunc`.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {*} accumulator The initial value.
+ * @param {boolean} initFromCollection Specify using the first or last element
+ * of `collection` as the initial value.
+ * @param {Function} eachFunc The function to iterate over `collection`.
+ * @returns {*} Returns the accumulated value.
+ */
+ function baseReduce(collection, iteratee, accumulator, initFromCollection, eachFunc) {
+ eachFunc(collection, function(value, index, collection) {
+ accumulator = initFromCollection
+ ? (initFromCollection = false, value)
+ : iteratee(accumulator, value, index, collection);
+ });
+ return accumulator;
+ }
+
+ /**
+ * The base implementation of `setData` without support for hot loop detection.
+ *
+ * @private
+ * @param {Function} func The function to associate metadata with.
+ * @param {*} data The metadata.
+ * @returns {Function} Returns `func`.
+ */
+ var baseSetData = !metaMap ? identity : function(func, data) {
+ metaMap.set(func, data);
+ return func;
+ };
+
+ /**
+ * The base implementation of `_.slice` without an iteratee call guard.
+ *
+ * @private
+ * @param {Array} array The array to slice.
+ * @param {number} [start=0] The start position.
+ * @param {number} [end=array.length] The end position.
+ * @returns {Array} Returns the slice of `array`.
+ */
+ function baseSlice(array, start, end) {
+ var index = -1,
+ length = array.length;
+
+ start = start == null ? 0 : (+start || 0);
+ if (start < 0) {
+ start = -start > length ? 0 : (length + start);
+ }
+ end = (end === undefined || end > length) ? length : (+end || 0);
+ if (end < 0) {
+ end += length;
+ }
+ length = start > end ? 0 : ((end - start) >>> 0);
+ start >>>= 0;
+
+ var result = Array(length);
+ while (++index < length) {
+ result[index] = array[index + start];
+ }
+ return result;
+ }
+
+ /**
+ * The base implementation of `_.some` without support for callback shorthands
+ * and `this` binding.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {boolean} Returns `true` if any element passes the predicate check,
+ * else `false`.
+ */
+ function baseSome(collection, predicate) {
+ var result;
+
+ baseEach(collection, function(value, index, collection) {
+ result = predicate(value, index, collection);
+ return !result;
+ });
+ return !!result;
+ }
+
+ /**
+ * The base implementation of `_.sortBy` which uses `comparer` to define
+ * the sort order of `array` and replaces criteria objects with their
+ * corresponding values.
+ *
+ * @private
+ * @param {Array} array The array to sort.
+ * @param {Function} comparer The function to define sort order.
+ * @returns {Array} Returns `array`.
+ */
+ function baseSortBy(array, comparer) {
+ var length = array.length;
+
+ array.sort(comparer);
+ while (length--) {
+ array[length] = array[length].value;
+ }
+ return array;
+ }
+
+ /**
+ * The base implementation of `_.sortByOrder` without param guards.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
+ * @param {boolean[]} orders The sort orders of `iteratees`.
+ * @returns {Array} Returns the new sorted array.
+ */
+ function baseSortByOrder(collection, iteratees, orders) {
+ var callback = getCallback(),
+ index = -1;
+
+ iteratees = arrayMap(iteratees, function(iteratee) { return callback(iteratee); });
+
+ var result = baseMap(collection, function(value) {
+ var criteria = arrayMap(iteratees, function(iteratee) { return iteratee(value); });
+ return { 'criteria': criteria, 'index': ++index, 'value': value };
+ });
+
+ return baseSortBy(result, function(object, other) {
+ return compareMultiple(object, other, orders);
+ });
+ }
+
+ /**
+ * The base implementation of `_.sum` without support for callback shorthands
+ * and `this` binding.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {number} Returns the sum.
+ */
+ function baseSum(collection, iteratee) {
+ var result = 0;
+ baseEach(collection, function(value, index, collection) {
+ result += +iteratee(value, index, collection) || 0;
+ });
+ return result;
+ }
+
+ /**
+ * The base implementation of `_.uniq` without support for callback shorthands
+ * and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {Function} [iteratee] The function invoked per iteration.
+ * @returns {Array} Returns the new duplicate-value-free array.
+ */
+ function baseUniq(array, iteratee) {
+ var index = -1,
+ indexOf = getIndexOf(),
+ length = array.length,
+ isCommon = indexOf == baseIndexOf,
+ isLarge = isCommon && length >= 200,
+ seen = isLarge ? createCache() : null,
+ result = [];
+
+ if (seen) {
+ indexOf = cacheIndexOf;
+ isCommon = false;
+ } else {
+ isLarge = false;
+ seen = iteratee ? [] : result;
+ }
+ outer:
+ while (++index < length) {
+ var value = array[index],
+ computed = iteratee ? iteratee(value, index, array) : value;
+
+ if (isCommon && value === value) {
+ var seenIndex = seen.length;
+ while (seenIndex--) {
+ if (seen[seenIndex] === computed) {
+ continue outer;
+ }
+ }
+ if (iteratee) {
+ seen.push(computed);
+ }
+ result.push(value);
+ }
+ else if (indexOf(seen, computed, 0) < 0) {
+ if (iteratee || isLarge) {
+ seen.push(computed);
+ }
+ result.push(value);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * The base implementation of `_.values` and `_.valuesIn` which creates an
+ * array of `object` property values corresponding to the property names
+ * of `props`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {Array} props The property names to get values for.
+ * @returns {Object} Returns the array of property values.
+ */
+ function baseValues(object, props) {
+ var index = -1,
+ length = props.length,
+ result = Array(length);
+
+ while (++index < length) {
+ result[index] = object[props[index]];
+ }
+ return result;
+ }
+
+ /**
+ * The base implementation of `_.dropRightWhile`, `_.dropWhile`, `_.takeRightWhile`,
+ * and `_.takeWhile` without support for callback shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to query.
+ * @param {Function} predicate The function invoked per iteration.
+ * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Array} Returns the slice of `array`.
+ */
+ function baseWhile(array, predicate, isDrop, fromRight) {
+ var length = array.length,
+ index = fromRight ? length : -1;
+
+ while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) {}
+ return isDrop
+ ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
+ : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
+ }
+
+ /**
+ * The base implementation of `wrapperValue` which returns the result of
+ * performing a sequence of actions on the unwrapped `value`, where each
+ * successive action is supplied the return value of the previous.
+ *
+ * @private
+ * @param {*} value The unwrapped value.
+ * @param {Array} actions Actions to peform to resolve the unwrapped value.
+ * @returns {*} Returns the resolved value.
+ */
+ function baseWrapperValue(value, actions) {
+ var result = value;
+ if (result instanceof LazyWrapper) {
+ result = result.value();
+ }
+ var index = -1,
+ length = actions.length;
+
+ while (++index < length) {
+ var args = [result],
+ action = actions[index];
+
+ push.apply(args, action.args);
+ result = action.func.apply(action.thisArg, args);
+ }
+ return result;
+ }
+
+ /**
+ * Performs a binary search of `array` to determine the index at which `value`
+ * should be inserted into `array` in order to maintain its sort order.
+ *
+ * @private
+ * @param {Array} array The sorted array to inspect.
+ * @param {*} value The value to evaluate.
+ * @param {boolean} [retHighest] Specify returning the highest qualified index.
+ * @returns {number} Returns the index at which `value` should be inserted
+ * into `array`.
+ */
+ function binaryIndex(array, value, retHighest) {
+ var low = 0,
+ high = array ? array.length : low;
+
+ if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
+ while (low < high) {
+ var mid = (low + high) >>> 1,
+ computed = array[mid];
+
+ if ((retHighest ? (computed <= value) : (computed < value)) && computed !== null) {
+ low = mid + 1;
+ } else {
+ high = mid;
+ }
+ }
+ return high;
+ }
+ return binaryIndexBy(array, value, identity, retHighest);
+ }
+
+ /**
+ * This function is like `binaryIndex` except that it invokes `iteratee` for
+ * `value` and each element of `array` to compute their sort ranking. The
+ * iteratee is invoked with one argument; (value).
+ *
+ * @private
+ * @param {Array} array The sorted array to inspect.
+ * @param {*} value The value to evaluate.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {boolean} [retHighest] Specify returning the highest qualified index.
+ * @returns {number} Returns the index at which `value` should be inserted
+ * into `array`.
+ */
+ function binaryIndexBy(array, value, iteratee, retHighest) {
+ value = iteratee(value);
+
+ var low = 0,
+ high = array ? array.length : 0,
+ valIsNaN = value !== value,
+ valIsNull = value === null,
+ valIsUndef = value === undefined;
+
+ while (low < high) {
+ var mid = floor((low + high) / 2),
+ computed = iteratee(array[mid]),
+ isDef = computed !== undefined,
+ isReflexive = computed === computed;
+
+ if (valIsNaN) {
+ var setLow = isReflexive || retHighest;
+ } else if (valIsNull) {
+ setLow = isReflexive && isDef && (retHighest || computed != null);
+ } else if (valIsUndef) {
+ setLow = isReflexive && (retHighest || isDef);
+ } else if (computed == null) {
+ setLow = false;
+ } else {
+ setLow = retHighest ? (computed <= value) : (computed < value);
+ }
+ if (setLow) {
+ low = mid + 1;
+ } else {
+ high = mid;
+ }
+ }
+ return nativeMin(high, MAX_ARRAY_INDEX);
+ }
+
+ /**
+ * A specialized version of `baseCallback` which only supports `this` binding
+ * and specifying the number of arguments to provide to `func`.
+ *
+ * @private
+ * @param {Function} func The function to bind.
+ * @param {*} thisArg The `this` binding of `func`.
+ * @param {number} [argCount] The number of arguments to provide to `func`.
+ * @returns {Function} Returns the callback.
+ */
+ function bindCallback(func, thisArg, argCount) {
+ if (typeof func != 'function') {
+ return identity;
+ }
+ if (thisArg === undefined) {
+ return func;
+ }
+ switch (argCount) {
+ case 1: return function(value) {
+ return func.call(thisArg, value);
+ };
+ case 3: return function(value, index, collection) {
+ return func.call(thisArg, value, index, collection);
+ };
+ case 4: return function(accumulator, value, index, collection) {
+ return func.call(thisArg, accumulator, value, index, collection);
+ };
+ case 5: return function(value, other, key, object, source) {
+ return func.call(thisArg, value, other, key, object, source);
+ };
+ }
+ return function() {
+ return func.apply(thisArg, arguments);
+ };
+ }
+
+ /**
+ * Creates a clone of the given array buffer.
+ *
+ * @private
+ * @param {ArrayBuffer} buffer The array buffer to clone.
+ * @returns {ArrayBuffer} Returns the cloned array buffer.
+ */
+ function bufferClone(buffer) {
+ return bufferSlice.call(buffer, 0);
+ }
+ if (!bufferSlice) {
+ // PhantomJS has `ArrayBuffer` and `Uint8Array` but not `Float64Array`.
+ bufferClone = !(ArrayBuffer && Uint8Array) ? constant(null) : function(buffer) {
+ var byteLength = buffer.byteLength,
+ floatLength = Float64Array ? floor(byteLength / FLOAT64_BYTES_PER_ELEMENT) : 0,
+ offset = floatLength * FLOAT64_BYTES_PER_ELEMENT,
+ result = new ArrayBuffer(byteLength);
+
+ if (floatLength) {
+ var view = new Float64Array(result, 0, floatLength);
+ view.set(new Float64Array(buffer, 0, floatLength));
+ }
+ if (byteLength != offset) {
+ view = new Uint8Array(result, offset);
+ view.set(new Uint8Array(buffer, offset));
+ }
+ return result;
+ };
+ }
+
+ /**
+ * Creates an array that is the composition of partially applied arguments,
+ * placeholders, and provided arguments into a single array of arguments.
+ *
+ * @private
+ * @param {Array|Object} args The provided arguments.
+ * @param {Array} partials The arguments to prepend to those provided.
+ * @param {Array} holders The `partials` placeholder indexes.
+ * @returns {Array} Returns the new array of composed arguments.
+ */
+ function composeArgs(args, partials, holders) {
+ var holdersLength = holders.length,
+ argsIndex = -1,
+ argsLength = nativeMax(args.length - holdersLength, 0),
+ leftIndex = -1,
+ leftLength = partials.length,
+ result = Array(argsLength + leftLength);
+
+ while (++leftIndex < leftLength) {
+ result[leftIndex] = partials[leftIndex];
+ }
+ while (++argsIndex < holdersLength) {
+ result[holders[argsIndex]] = args[argsIndex];
+ }
+ while (argsLength--) {
+ result[leftIndex++] = args[argsIndex++];
+ }
+ return result;
+ }
+
+ /**
+ * This function is like `composeArgs` except that the arguments composition
+ * is tailored for `_.partialRight`.
+ *
+ * @private
+ * @param {Array|Object} args The provided arguments.
+ * @param {Array} partials The arguments to append to those provided.
+ * @param {Array} holders The `partials` placeholder indexes.
+ * @returns {Array} Returns the new array of composed arguments.
+ */
+ function composeArgsRight(args, partials, holders) {
+ var holdersIndex = -1,
+ holdersLength = holders.length,
+ argsIndex = -1,
+ argsLength = nativeMax(args.length - holdersLength, 0),
+ rightIndex = -1,
+ rightLength = partials.length,
+ result = Array(argsLength + rightLength);
+
+ while (++argsIndex < argsLength) {
+ result[argsIndex] = args[argsIndex];
+ }
+ var offset = argsIndex;
+ while (++rightIndex < rightLength) {
+ result[offset + rightIndex] = partials[rightIndex];
+ }
+ while (++holdersIndex < holdersLength) {
+ result[offset + holders[holdersIndex]] = args[argsIndex++];
+ }
+ return result;
+ }
+
+ /**
+ * Creates a function that aggregates a collection, creating an accumulator
+ * object composed from the results of running each element in the collection
+ * through an iteratee.
+ *
+ * **Note:** This function is used to create `_.countBy`, `_.groupBy`, `_.indexBy`,
+ * and `_.partition`.
+ *
+ * @private
+ * @param {Function} setter The function to set keys and values of the accumulator object.
+ * @param {Function} [initializer] The function to initialize the accumulator object.
+ * @returns {Function} Returns the new aggregator function.
+ */
+ function createAggregator(setter, initializer) {
+ return function(collection, iteratee, thisArg) {
+ var result = initializer ? initializer() : {};
+ iteratee = getCallback(iteratee, thisArg, 3);
+
+ if (isArray(collection)) {
+ var index = -1,
+ length = collection.length;
+
+ while (++index < length) {
+ var value = collection[index];
+ setter(result, value, iteratee(value, index, collection), collection);
+ }
+ } else {
+ baseEach(collection, function(value, key, collection) {
+ setter(result, value, iteratee(value, key, collection), collection);
+ });
+ }
+ return result;
+ };
+ }
+
+ /**
+ * Creates a function that assigns properties of source object(s) to a given
+ * destination object.
+ *
+ * **Note:** This function is used to create `_.assign`, `_.defaults`, and `_.merge`.
+ *
+ * @private
+ * @param {Function} assigner The function to assign values.
+ * @returns {Function} Returns the new assigner function.
+ */
+ function createAssigner(assigner) {
+ return restParam(function(object, sources) {
+ var index = -1,
+ length = object == null ? 0 : sources.length,
+ customizer = length > 2 ? sources[length - 2] : undefined,
+ guard = length > 2 ? sources[2] : undefined,
+ thisArg = length > 1 ? sources[length - 1] : undefined;
+
+ if (typeof customizer == 'function') {
+ customizer = bindCallback(customizer, thisArg, 5);
+ length -= 2;
+ } else {
+ customizer = typeof thisArg == 'function' ? thisArg : undefined;
+ length -= (customizer ? 1 : 0);
+ }
+ if (guard && isIterateeCall(sources[0], sources[1], guard)) {
+ customizer = length < 3 ? undefined : customizer;
+ length = 1;
+ }
+ while (++index < length) {
+ var source = sources[index];
+ if (source) {
+ assigner(object, source, customizer);
+ }
+ }
+ return object;
+ });
+ }
+
+ /**
+ * Creates a `baseEach` or `baseEachRight` function.
+ *
+ * @private
+ * @param {Function} eachFunc The function to iterate over a collection.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Function} Returns the new base function.
+ */
+ function createBaseEach(eachFunc, fromRight) {
+ return function(collection, iteratee) {
+ var length = collection ? getLength(collection) : 0;
+ if (!isLength(length)) {
+ return eachFunc(collection, iteratee);
+ }
+ var index = fromRight ? length : -1,
+ iterable = toObject(collection);
+
+ while ((fromRight ? index-- : ++index < length)) {
+ if (iteratee(iterable[index], index, iterable) === false) {
+ break;
+ }
+ }
+ return collection;
+ };
+ }
+
+ /**
+ * Creates a base function for `_.forIn` or `_.forInRight`.
+ *
+ * @private
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Function} Returns the new base function.
+ */
+ function createBaseFor(fromRight) {
+ return function(object, iteratee, keysFunc) {
+ var iterable = toObject(object),
+ props = keysFunc(object),
+ length = props.length,
+ index = fromRight ? length : -1;
+
+ while ((fromRight ? index-- : ++index < length)) {
+ var key = props[index];
+ if (iteratee(iterable[key], key, iterable) === false) {
+ break;
+ }
+ }
+ return object;
+ };
+ }
+
+ /**
+ * Creates a function that wraps `func` and invokes it with the `this`
+ * binding of `thisArg`.
+ *
+ * @private
+ * @param {Function} func The function to bind.
+ * @param {*} [thisArg] The `this` binding of `func`.
+ * @returns {Function} Returns the new bound function.
+ */
+ function createBindWrapper(func, thisArg) {
+ var Ctor = createCtorWrapper(func);
+
+ function wrapper() {
+ var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
+ return fn.apply(thisArg, arguments);
+ }
+ return wrapper;
+ }
+
+ /**
+ * Creates a `Set` cache object to optimize linear searches of large arrays.
+ *
+ * @private
+ * @param {Array} [values] The values to cache.
+ * @returns {null|Object} Returns the new cache object if `Set` is supported, else `null`.
+ */
+ var createCache = !(nativeCreate && Set) ? constant(null) : function(values) {
+ return new SetCache(values);
+ };
+
+ /**
+ * Creates a function that produces compound words out of the words in a
+ * given string.
+ *
+ * @private
+ * @param {Function} callback The function to combine each word.
+ * @returns {Function} Returns the new compounder function.
+ */
+ function createCompounder(callback) {
+ return function(string) {
+ var index = -1,
+ array = words(deburr(string)),
+ length = array.length,
+ result = '';
+
+ while (++index < length) {
+ result = callback(result, array[index], index);
+ }
+ return result;
+ };
+ }
+
+ /**
+ * Creates a function that produces an instance of `Ctor` regardless of
+ * whether it was invoked as part of a `new` expression or by `call` or `apply`.
+ *
+ * @private
+ * @param {Function} Ctor The constructor to wrap.
+ * @returns {Function} Returns the new wrapped function.
+ */
+ function createCtorWrapper(Ctor) {
+ return function() {
+ // Use a `switch` statement to work with class constructors.
+ // See https://people.mozilla.org/~jorendorff/es6-draft.html#sec-ecmascript-function-objects-call-thisargument-argumentslist
+ // for more details.
+ var args = arguments;
+ switch (args.length) {
+ case 0: return new Ctor;
+ case 1: return new Ctor(args[0]);
+ case 2: return new Ctor(args[0], args[1]);
+ case 3: return new Ctor(args[0], args[1], args[2]);
+ case 4: return new Ctor(args[0], args[1], args[2], args[3]);
+ case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
+ }
+ var thisBinding = baseCreate(Ctor.prototype),
+ result = Ctor.apply(thisBinding, args);
+
+ // Mimic the constructor's `return` behavior.
+ // See https://es5.github.io/#x13.2.2 for more details.
+ return isObject(result) ? result : thisBinding;
+ };
+ }
+
+ /**
+ * Creates a `_.curry` or `_.curryRight` function.
+ *
+ * @private
+ * @param {boolean} flag The curry bit flag.
+ * @returns {Function} Returns the new curry function.
+ */
+ function createCurry(flag) {
+ function curryFunc(func, arity, guard) {
+ if (guard && isIterateeCall(func, arity, guard)) {
+ arity = null;
+ }
+ var result = createWrapper(func, flag, null, null, null, null, null, arity);
+ result.placeholder = curryFunc.placeholder;
+ return result;
+ }
+ return curryFunc;
+ }
+
+ /**
+ * Creates a `_.max` or `_.min` function.
+ *
+ * @private
+ * @param {Function} comparator The function used to compare values.
+ * @param {*} exValue The initial extremum value.
+ * @returns {Function} Returns the new extremum function.
+ */
+ function createExtremum(comparator, exValue) {
+ return function(collection, iteratee, thisArg) {
+ if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
+ iteratee = null;
+ }
+ iteratee = getCallback(iteratee, thisArg, 3);
+ if (iteratee.length == 1) {
+ collection = toIterable(collection);
+ var result = arrayExtremum(collection, iteratee, comparator, exValue);
+ if (!(collection.length && result === exValue)) {
+ return result;
+ }
+ }
+ return baseExtremum(collection, iteratee, comparator, exValue);
+ };
+ }
+
+ /**
+ * Creates a `_.find` or `_.findLast` function.
+ *
+ * @private
+ * @param {Function} eachFunc The function to iterate over a collection.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Function} Returns the new find function.
+ */
+ function createFind(eachFunc, fromRight) {
+ return function(collection, predicate, thisArg) {
+ predicate = getCallback(predicate, thisArg, 3);
+ if (isArray(collection)) {
+ var index = baseFindIndex(collection, predicate, fromRight);
+ return index > -1 ? collection[index] : undefined;
+ }
+ return baseFind(collection, predicate, eachFunc);
+ };
+ }
+
+ /**
+ * Creates a `_.findIndex` or `_.findLastIndex` function.
+ *
+ * @private
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Function} Returns the new find function.
+ */
+ function createFindIndex(fromRight) {
+ return function(array, predicate, thisArg) {
+ if (!(array && array.length)) {
+ return -1;
+ }
+ predicate = getCallback(predicate, thisArg, 3);
+ return baseFindIndex(array, predicate, fromRight);
+ };
+ }
+
+ /**
+ * Creates a `_.findKey` or `_.findLastKey` function.
+ *
+ * @private
+ * @param {Function} objectFunc The function to iterate over an object.
+ * @returns {Function} Returns the new find function.
+ */
+ function createFindKey(objectFunc) {
+ return function(object, predicate, thisArg) {
+ predicate = getCallback(predicate, thisArg, 3);
+ return baseFind(object, predicate, objectFunc, true);
+ };
+ }
+
+ /**
+ * Creates a `_.flow` or `_.flowRight` function.
+ *
+ * @private
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Function} Returns the new flow function.
+ */
+ function createFlow(fromRight) {
+ return function() {
+ var wrapper,
+ length = arguments.length,
+ index = fromRight ? length : -1,
+ leftIndex = 0,
+ funcs = Array(length);
+
+ while ((fromRight ? index-- : ++index < length)) {
+ var func = funcs[leftIndex++] = arguments[index];
+ if (typeof func != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ if (!wrapper && LodashWrapper.prototype.thru && getFuncName(func) == 'wrapper') {
+ wrapper = new LodashWrapper([]);
+ }
+ }
+ index = wrapper ? -1 : length;
+ while (++index < length) {
+ func = funcs[index];
+
+ var funcName = getFuncName(func),
+ data = funcName == 'wrapper' ? getData(func) : null;
+
+ if (data && isLaziable(data[0]) && data[1] == (ARY_FLAG | CURRY_FLAG | PARTIAL_FLAG | REARG_FLAG) && !data[4].length && data[9] == 1) {
+ wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
+ } else {
+ wrapper = (func.length == 1 && isLaziable(func)) ? wrapper[funcName]() : wrapper.thru(func);
+ }
+ }
+ return function() {
+ var args = arguments;
+ if (wrapper && args.length == 1 && isArray(args[0])) {
+ return wrapper.plant(args[0]).value();
+ }
+ var index = 0,
+ result = length ? funcs[index].apply(this, args) : args[0];
+
+ while (++index < length) {
+ result = funcs[index].call(this, result);
+ }
+ return result;
+ };
+ };
+ }
+
+ /**
+ * Creates a function for `_.forEach` or `_.forEachRight`.
+ *
+ * @private
+ * @param {Function} arrayFunc The function to iterate over an array.
+ * @param {Function} eachFunc The function to iterate over a collection.
+ * @returns {Function} Returns the new each function.
+ */
+ function createForEach(arrayFunc, eachFunc) {
+ return function(collection, iteratee, thisArg) {
+ return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection))
+ ? arrayFunc(collection, iteratee)
+ : eachFunc(collection, bindCallback(iteratee, thisArg, 3));
+ };
+ }
+
+ /**
+ * Creates a function for `_.forIn` or `_.forInRight`.
+ *
+ * @private
+ * @param {Function} objectFunc The function to iterate over an object.
+ * @returns {Function} Returns the new each function.
+ */
+ function createForIn(objectFunc) {
+ return function(object, iteratee, thisArg) {
+ if (typeof iteratee != 'function' || thisArg !== undefined) {
+ iteratee = bindCallback(iteratee, thisArg, 3);
+ }
+ return objectFunc(object, iteratee, keysIn);
+ };
+ }
+
+ /**
+ * Creates a function for `_.forOwn` or `_.forOwnRight`.
+ *
+ * @private
+ * @param {Function} objectFunc The function to iterate over an object.
+ * @returns {Function} Returns the new each function.
+ */
+ function createForOwn(objectFunc) {
+ return function(object, iteratee, thisArg) {
+ if (typeof iteratee != 'function' || thisArg !== undefined) {
+ iteratee = bindCallback(iteratee, thisArg, 3);
+ }
+ return objectFunc(object, iteratee);
+ };
+ }
+
+ /**
+ * Creates a function for `_.mapKeys` or `_.mapValues`.
+ *
+ * @private
+ * @param {boolean} [isMapKeys] Specify mapping keys instead of values.
+ * @returns {Function} Returns the new map function.
+ */
+ function createObjectMapper(isMapKeys) {
+ return function(object, iteratee, thisArg) {
+ var result = {};
+ iteratee = getCallback(iteratee, thisArg, 3);
+
+ baseForOwn(object, function(value, key, object) {
+ var mapped = iteratee(value, key, object);
+ key = isMapKeys ? mapped : key;
+ value = isMapKeys ? value : mapped;
+ result[key] = value;
+ });
+ return result;
+ };
+ }
+
+ /**
+ * Creates a function for `_.padLeft` or `_.padRight`.
+ *
+ * @private
+ * @param {boolean} [fromRight] Specify padding from the right.
+ * @returns {Function} Returns the new pad function.
+ */
+ function createPadDir(fromRight) {
+ return function(string, length, chars) {
+ string = baseToString(string);
+ return (fromRight ? string : '') + createPadding(string, length, chars) + (fromRight ? '' : string);
+ };
+ }
+
+ /**
+ * Creates a `_.partial` or `_.partialRight` function.
+ *
+ * @private
+ * @param {boolean} flag The partial bit flag.
+ * @returns {Function} Returns the new partial function.
+ */
+ function createPartial(flag) {
+ var partialFunc = restParam(function(func, partials) {
+ var holders = replaceHolders(partials, partialFunc.placeholder);
+ return createWrapper(func, flag, null, partials, holders);
+ });
+ return partialFunc;
+ }
+
+ /**
+ * Creates a function for `_.reduce` or `_.reduceRight`.
+ *
+ * @private
+ * @param {Function} arrayFunc The function to iterate over an array.
+ * @param {Function} eachFunc The function to iterate over a collection.
+ * @returns {Function} Returns the new each function.
+ */
+ function createReduce(arrayFunc, eachFunc) {
+ return function(collection, iteratee, accumulator, thisArg) {
+ var initFromArray = arguments.length < 3;
+ return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection))
+ ? arrayFunc(collection, iteratee, accumulator, initFromArray)
+ : baseReduce(collection, getCallback(iteratee, thisArg, 4), accumulator, initFromArray, eachFunc);
+ };
+ }
+
+ /**
+ * Creates a function that wraps `func` and invokes it with optional `this`
+ * binding of, partial application, and currying.
+ *
+ * @private
+ * @param {Function|string} func The function or method name to reference.
+ * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details.
+ * @param {*} [thisArg] The `this` binding of `func`.
+ * @param {Array} [partials] The arguments to prepend to those provided to the new function.
+ * @param {Array} [holders] The `partials` placeholder indexes.
+ * @param {Array} [partialsRight] The arguments to append to those provided to the new function.
+ * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
+ * @param {Array} [argPos] The argument positions of the new function.
+ * @param {number} [ary] The arity cap of `func`.
+ * @param {number} [arity] The arity of `func`.
+ * @returns {Function} Returns the new wrapped function.
+ */
+ function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
+ var isAry = bitmask & ARY_FLAG,
+ isBind = bitmask & BIND_FLAG,
+ isBindKey = bitmask & BIND_KEY_FLAG,
+ isCurry = bitmask & CURRY_FLAG,
+ isCurryBound = bitmask & CURRY_BOUND_FLAG,
+ isCurryRight = bitmask & CURRY_RIGHT_FLAG,
+ Ctor = isBindKey ? null : createCtorWrapper(func);
+
+ function wrapper() {
+ // Avoid `arguments` object use disqualifying optimizations by
+ // converting it to an array before providing it to other functions.
+ var length = arguments.length,
+ index = length,
+ args = Array(length);
+
+ while (index--) {
+ args[index] = arguments[index];
+ }
+ if (partials) {
+ args = composeArgs(args, partials, holders);
+ }
+ if (partialsRight) {
+ args = composeArgsRight(args, partialsRight, holdersRight);
+ }
+ if (isCurry || isCurryRight) {
+ var placeholder = wrapper.placeholder,
+ argsHolders = replaceHolders(args, placeholder);
+
+ length -= argsHolders.length;
+ if (length < arity) {
+ var newArgPos = argPos ? arrayCopy(argPos) : null,
+ newArity = nativeMax(arity - length, 0),
+ newsHolders = isCurry ? argsHolders : null,
+ newHoldersRight = isCurry ? null : argsHolders,
+ newPartials = isCurry ? args : null,
+ newPartialsRight = isCurry ? null : args;
+
+ bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG);
+ bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG);
+
+ if (!isCurryBound) {
+ bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG);
+ }
+ var newData = [func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, newArity],
+ result = createHybridWrapper.apply(undefined, newData);
+
+ if (isLaziable(func)) {
+ setData(result, newData);
+ }
+ result.placeholder = placeholder;
+ return result;
+ }
+ }
+ var thisBinding = isBind ? thisArg : this,
+ fn = isBindKey ? thisBinding[func] : func;
+
+ if (argPos) {
+ args = reorder(args, argPos);
+ }
+ if (isAry && ary < args.length) {
+ args.length = ary;
+ }
+ if (this && this !== root && this instanceof wrapper) {
+ fn = Ctor || createCtorWrapper(func);
+ }
+ return fn.apply(thisBinding, args);
+ }
+ return wrapper;
+ }
+
+ /**
+ * Creates the padding required for `string` based on the given `length`.
+ * The `chars` string is truncated if the number of characters exceeds `length`.
+ *
+ * @private
+ * @param {string} string The string to create padding for.
+ * @param {number} [length=0] The padding length.
+ * @param {string} [chars=' '] The string used as padding.
+ * @returns {string} Returns the pad for `string`.
+ */
+ function createPadding(string, length, chars) {
+ var strLength = string.length;
+ length = +length;
+
+ if (strLength >= length || !nativeIsFinite(length)) {
+ return '';
+ }
+ var padLength = length - strLength;
+ chars = chars == null ? ' ' : (chars + '');
+ return repeat(chars, ceil(padLength / chars.length)).slice(0, padLength);
+ }
+
+ /**
+ * Creates a function that wraps `func` and invokes it with the optional `this`
+ * binding of `thisArg` and the `partials` prepended to those provided to
+ * the wrapper.
+ *
+ * @private
+ * @param {Function} func The function to partially apply arguments to.
+ * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details.
+ * @param {*} thisArg The `this` binding of `func`.
+ * @param {Array} partials The arguments to prepend to those provided to the new function.
+ * @returns {Function} Returns the new bound function.
+ */
+ function createPartialWrapper(func, bitmask, thisArg, partials) {
+ var isBind = bitmask & BIND_FLAG,
+ Ctor = createCtorWrapper(func);
+
+ function wrapper() {
+ // Avoid `arguments` object use disqualifying optimizations by
+ // converting it to an array before providing it `func`.
+ var argsIndex = -1,
+ argsLength = arguments.length,
+ leftIndex = -1,
+ leftLength = partials.length,
+ args = Array(argsLength + leftLength);
+
+ while (++leftIndex < leftLength) {
+ args[leftIndex] = partials[leftIndex];
+ }
+ while (argsLength--) {
+ args[leftIndex++] = arguments[++argsIndex];
+ }
+ var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
+ return fn.apply(isBind ? thisArg : this, args);
+ }
+ return wrapper;
+ }
+
+ /**
+ * Creates a `_.sortedIndex` or `_.sortedLastIndex` function.
+ *
+ * @private
+ * @param {boolean} [retHighest] Specify returning the highest qualified index.
+ * @returns {Function} Returns the new index function.
+ */
+ function createSortedIndex(retHighest) {
+ return function(array, value, iteratee, thisArg) {
+ var callback = getCallback(iteratee);
+ return (iteratee == null && callback === baseCallback)
+ ? binaryIndex(array, value, retHighest)
+ : binaryIndexBy(array, value, callback(iteratee, thisArg, 1), retHighest);
+ };
+ }
+
+ /**
+ * Creates a function that either curries or invokes `func` with optional
+ * `this` binding and partially applied arguments.
+ *
+ * @private
+ * @param {Function|string} func The function or method name to reference.
+ * @param {number} bitmask The bitmask of flags.
+ * The bitmask may be composed of the following flags:
+ * 1 - `_.bind`
+ * 2 - `_.bindKey`
+ * 4 - `_.curry` or `_.curryRight` of a bound function
+ * 8 - `_.curry`
+ * 16 - `_.curryRight`
+ * 32 - `_.partial`
+ * 64 - `_.partialRight`
+ * 128 - `_.rearg`
+ * 256 - `_.ary`
+ * @param {*} [thisArg] The `this` binding of `func`.
+ * @param {Array} [partials] The arguments to be partially applied.
+ * @param {Array} [holders] The `partials` placeholder indexes.
+ * @param {Array} [argPos] The argument positions of the new function.
+ * @param {number} [ary] The arity cap of `func`.
+ * @param {number} [arity] The arity of `func`.
+ * @returns {Function} Returns the new wrapped function.
+ */
+ function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
+ var isBindKey = bitmask & BIND_KEY_FLAG;
+ if (!isBindKey && typeof func != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ var length = partials ? partials.length : 0;
+ if (!length) {
+ bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG);
+ partials = holders = null;
+ }
+ length -= (holders ? holders.length : 0);
+ if (bitmask & PARTIAL_RIGHT_FLAG) {
+ var partialsRight = partials,
+ holdersRight = holders;
+
+ partials = holders = null;
+ }
+ var data = isBindKey ? null : getData(func),
+ newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity];
+
+ if (data) {
+ mergeData(newData, data);
+ bitmask = newData[1];
+ arity = newData[9];
+ }
+ newData[9] = arity == null
+ ? (isBindKey ? 0 : func.length)
+ : (nativeMax(arity - length, 0) || 0);
+
+ if (bitmask == BIND_FLAG) {
+ var result = createBindWrapper(newData[0], newData[2]);
+ } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !newData[4].length) {
+ result = createPartialWrapper.apply(undefined, newData);
+ } else {
+ result = createHybridWrapper.apply(undefined, newData);
+ }
+ var setter = data ? baseSetData : setData;
+ return setter(result, newData);
+ }
+
+ /**
+ * A specialized version of `baseIsEqualDeep` for arrays with support for
+ * partial deep comparisons.
+ *
+ * @private
+ * @param {Array} array The array to compare.
+ * @param {Array} other The other array to compare.
+ * @param {Function} equalFunc The function to determine equivalents of values.
+ * @param {Function} [customizer] The function to customize comparing arrays.
+ * @param {boolean} [isLoose] Specify performing partial comparisons.
+ * @param {Array} [stackA] Tracks traversed `value` objects.
+ * @param {Array} [stackB] Tracks traversed `other` objects.
+ * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
+ */
+ function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) {
+ var index = -1,
+ arrLength = array.length,
+ othLength = other.length;
+
+ if (arrLength != othLength && !(isLoose && othLength > arrLength)) {
+ return false;
+ }
+ // Ignore non-index properties.
+ while (++index < arrLength) {
+ var arrValue = array[index],
+ othValue = other[index],
+ result = customizer ? customizer(isLoose ? othValue : arrValue, isLoose ? arrValue : othValue, index) : undefined;
+
+ if (result !== undefined) {
+ if (result) {
+ continue;
+ }
+ return false;
+ }
+ // Recursively compare arrays (susceptible to call stack limits).
+ if (isLoose) {
+ if (!arraySome(other, function(othValue) {
+ return arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);
+ })) {
+ return false;
+ }
+ } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB))) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * A specialized version of `baseIsEqualDeep` for comparing objects of
+ * the same `toStringTag`.
+ *
+ * **Note:** This function only supports comparing values with tags of
+ * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
+ *
+ * @private
+ * @param {Object} value The object to compare.
+ * @param {Object} other The other object to compare.
+ * @param {string} tag The `toStringTag` of the objects to compare.
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+ */
+ function equalByTag(object, other, tag) {
+ switch (tag) {
+ case boolTag:
+ case dateTag:
+ // Coerce dates and booleans to numbers, dates to milliseconds and booleans
+ // to `1` or `0` treating invalid dates coerced to `NaN` as not equal.
+ return +object == +other;
+
+ case errorTag:
+ return object.name == other.name && object.message == other.message;
+
+ case numberTag:
+ // Treat `NaN` vs. `NaN` as equal.
+ return (object != +object)
+ ? other != +other
+ : object == +other;
+
+ case regexpTag:
+ case stringTag:
+ // Coerce regexes to strings and treat strings primitives and string
+ // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details.
+ return object == (other + '');
+ }
+ return false;
+ }
+
+ /**
+ * A specialized version of `baseIsEqualDeep` for objects with support for
+ * partial deep comparisons.
+ *
+ * @private
+ * @param {Object} object The object to compare.
+ * @param {Object} other The other object to compare.
+ * @param {Function} equalFunc The function to determine equivalents of values.
+ * @param {Function} [customizer] The function to customize comparing values.
+ * @param {boolean} [isLoose] Specify performing partial comparisons.
+ * @param {Array} [stackA] Tracks traversed `value` objects.
+ * @param {Array} [stackB] Tracks traversed `other` objects.
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+ */
+ function equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
+ var objProps = keys(object),
+ objLength = objProps.length,
+ othProps = keys(other),
+ othLength = othProps.length;
+
+ if (objLength != othLength && !isLoose) {
+ return false;
+ }
+ var index = objLength;
+ while (index--) {
+ var key = objProps[index];
+ if (!(isLoose ? key in other : hasOwnProperty.call(other, key))) {
+ return false;
+ }
+ }
+ var skipCtor = isLoose;
+ while (++index < objLength) {
+ key = objProps[index];
+ var objValue = object[key],
+ othValue = other[key],
+ result = customizer ? customizer(isLoose ? othValue : objValue, isLoose? objValue : othValue, key) : undefined;
+
+ // Recursively compare objects (susceptible to call stack limits).
+ if (!(result === undefined ? equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB) : result)) {
+ return false;
+ }
+ skipCtor || (skipCtor = key == 'constructor');
+ }
+ if (!skipCtor) {
+ var objCtor = object.constructor,
+ othCtor = other.constructor;
+
+ // Non `Object` object instances with different constructors are not equal.
+ if (objCtor != othCtor &&
+ ('constructor' in object && 'constructor' in other) &&
+ !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
+ typeof othCtor == 'function' && othCtor instanceof othCtor)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Gets the appropriate "callback" function. If the `_.callback` method is
+ * customized this function returns the custom method, otherwise it returns
+ * the `baseCallback` function. If arguments are provided the chosen function
+ * is invoked with them and its result is returned.
+ *
+ * @private
+ * @returns {Function} Returns the chosen function or its result.
+ */
+ function getCallback(func, thisArg, argCount) {
+ var result = lodash.callback || callback;
+ result = result === callback ? baseCallback : result;
+ return argCount ? result(func, thisArg, argCount) : result;
+ }
+
+ /**
+ * Gets metadata for `func`.
+ *
+ * @private
+ * @param {Function} func The function to query.
+ * @returns {*} Returns the metadata for `func`.
+ */
+ var getData = !metaMap ? noop : function(func) {
+ return metaMap.get(func);
+ };
+
+ /**
+ * Gets the name of `func`.
+ *
+ * @private
+ * @param {Function} func The function to query.
+ * @returns {string} Returns the function name.
+ */
+ function getFuncName(func) {
+ var result = func.name,
+ array = realNames[result],
+ length = array ? array.length : 0;
+
+ while (length--) {
+ var data = array[length],
+ otherFunc = data.func;
+ if (otherFunc == null || otherFunc == func) {
+ return data.name;
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Gets the appropriate "indexOf" function. If the `_.indexOf` method is
+ * customized this function returns the custom method, otherwise it returns
+ * the `baseIndexOf` function. If arguments are provided the chosen function
+ * is invoked with them and its result is returned.
+ *
+ * @private
+ * @returns {Function|number} Returns the chosen function or its result.
+ */
+ function getIndexOf(collection, target, fromIndex) {
+ var result = lodash.indexOf || indexOf;
+ result = result === indexOf ? baseIndexOf : result;
+ return collection ? result(collection, target, fromIndex) : result;
+ }
+
+ /**
+ * Gets the "length" property value of `object`.
+ *
+ * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
+ * that affects Safari on at least iOS 8.1-8.3 ARM64.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {*} Returns the "length" value.
+ */
+ var getLength = baseProperty('length');
+
+ /**
+ * Gets the propery names, values, and compare flags of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the match data of `object`.
+ */
+ function getMatchData(object) {
+ var result = pairs(object),
+ length = result.length;
+
+ while (length--) {
+ result[length][2] = isStrictComparable(result[length][1]);
+ }
+ return result;
+ }
+
+ /**
+ * Gets the native function at `key` of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {string} key The key of the method to get.
+ * @returns {*} Returns the function if it's native, else `undefined`.
+ */
+ function getNative(object, key) {
+ var value = object == null ? undefined : object[key];
+ return isNative(value) ? value : undefined;
+ }
+
+ /**
+ * Gets the view, applying any `transforms` to the `start` and `end` positions.
+ *
+ * @private
+ * @param {number} start The start of the view.
+ * @param {number} end The end of the view.
+ * @param {Array} [transforms] The transformations to apply to the view.
+ * @returns {Object} Returns an object containing the `start` and `end`
+ * positions of the view.
+ */
+ function getView(start, end, transforms) {
+ var index = -1,
+ length = transforms ? transforms.length : 0;
+
+ while (++index < length) {
+ var data = transforms[index],
+ size = data.size;
+
+ switch (data.type) {
+ case 'drop': start += size; break;
+ case 'dropRight': end -= size; break;
+ case 'take': end = nativeMin(end, start + size); break;
+ case 'takeRight': start = nativeMax(start, end - size); break;
+ }
+ }
+ return { 'start': start, 'end': end };
+ }
+
+ /**
+ * Initializes an array clone.
+ *
+ * @private
+ * @param {Array} array The array to clone.
+ * @returns {Array} Returns the initialized clone.
+ */
+ function initCloneArray(array) {
+ var length = array.length,
+ result = new array.constructor(length);
+
+ // Add array properties assigned by `RegExp#exec`.
+ if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
+ result.index = array.index;
+ result.input = array.input;
+ }
+ return result;
+ }
+
+ /**
+ * Initializes an object clone.
+ *
+ * @private
+ * @param {Object} object The object to clone.
+ * @returns {Object} Returns the initialized clone.
+ */
+ function initCloneObject(object) {
+ var Ctor = object.constructor;
+ if (!(typeof Ctor == 'function' && Ctor instanceof Ctor)) {
+ Ctor = Object;
+ }
+ return new Ctor;
+ }
+
+ /**
+ * Initializes an object clone based on its `toStringTag`.
+ *
+ * **Note:** This function only supports cloning values with tags of
+ * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
+ *
+ * @private
+ * @param {Object} object The object to clone.
+ * @param {string} tag The `toStringTag` of the object to clone.
+ * @param {boolean} [isDeep] Specify a deep clone.
+ * @returns {Object} Returns the initialized clone.
+ */
+ function initCloneByTag(object, tag, isDeep) {
+ var Ctor = object.constructor;
+ switch (tag) {
+ case arrayBufferTag:
+ return bufferClone(object);
+
+ case boolTag:
+ case dateTag:
+ return new Ctor(+object);
+
+ case float32Tag: case float64Tag:
+ case int8Tag: case int16Tag: case int32Tag:
+ case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
+ var buffer = object.buffer;
+ return new Ctor(isDeep ? bufferClone(buffer) : buffer, object.byteOffset, object.length);
+
+ case numberTag:
+ case stringTag:
+ return new Ctor(object);
+
+ case regexpTag:
+ var result = new Ctor(object.source, reFlags.exec(object));
+ result.lastIndex = object.lastIndex;
+ }
+ return result;
+ }
+
+ /**
+ * Invokes the method at `path` on `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {Array|string} path The path of the method to invoke.
+ * @param {Array} args The arguments to invoke the method with.
+ * @returns {*} Returns the result of the invoked method.
+ */
+ function invokePath(object, path, args) {
+ if (object != null && !isKey(path, object)) {
+ path = toPath(path);
+ object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
+ path = last(path);
+ }
+ var func = object == null ? object : object[path];
+ return func == null ? undefined : func.apply(object, args);
+ }
+
+ /**
+ * Checks if `value` is array-like.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
+ */
+ function isArrayLike(value) {
+ return value != null && isLength(getLength(value));
+ }
+
+ /**
+ * Checks if `value` is a valid array-like index.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
+ */
+ function isIndex(value, length) {
+ value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
+ length = length == null ? MAX_SAFE_INTEGER : length;
+ return value > -1 && value % 1 == 0 && value < length;
+ }
+
+ /**
+ * Checks if the provided arguments are from an iteratee call.
+ *
+ * @private
+ * @param {*} value The potential iteratee value argument.
+ * @param {*} index The potential iteratee index or key argument.
+ * @param {*} object The potential iteratee object argument.
+ * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.
+ */
+ function isIterateeCall(value, index, object) {
+ if (!isObject(object)) {
+ return false;
+ }
+ var type = typeof index;
+ if (type == 'number'
+ ? (isArrayLike(object) && isIndex(index, object.length))
+ : (type == 'string' && index in object)) {
+ var other = object[index];
+ return value === value ? (value === other) : (other !== other);
+ }
+ return false;
+ }
+
+ /**
+ * Checks if `value` is a property name and not a property path.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @param {Object} [object] The object to query keys on.
+ * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
+ */
+ function isKey(value, object) {
+ var type = typeof value;
+ if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') {
+ return true;
+ }
+ if (isArray(value)) {
+ return false;
+ }
+ var result = !reIsDeepProp.test(value);
+ return result || (object != null && value in toObject(object));
+ }
+
+ /**
+ * Checks if `func` has a lazy counterpart.
+ *
+ * @private
+ * @param {Function} func The function to check.
+ * @returns {boolean} Returns `true` if `func` has a lazy counterpart, else `false`.
+ */
+ function isLaziable(func) {
+ var funcName = getFuncName(func);
+ if (!(funcName in LazyWrapper.prototype)) {
+ return false;
+ }
+ var other = lodash[funcName];
+ if (func === other) {
+ return true;
+ }
+ var data = getData(other);
+ return !!data && func === data[0];
+ }
+
+ /**
+ * Checks if `value` is a valid array-like length.
+ *
+ * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength).
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
+ */
+ function isLength(value) {
+ return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
+ }
+
+ /**
+ * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` if suitable for strict
+ * equality comparisons, else `false`.
+ */
+ function isStrictComparable(value) {
+ return value === value && !isObject(value);
+ }
+
+ /**
+ * Merges the function metadata of `source` into `data`.
+ *
+ * Merging metadata reduces the number of wrappers required to invoke a function.
+ * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
+ * may be applied regardless of execution order. Methods like `_.ary` and `_.rearg`
+ * augment function arguments, making the order in which they are executed important,
+ * preventing the merging of metadata. However, we make an exception for a safe
+ * common case where curried functions have `_.ary` and or `_.rearg` applied.
+ *
+ * @private
+ * @param {Array} data The destination metadata.
+ * @param {Array} source The source metadata.
+ * @returns {Array} Returns `data`.
+ */
+ function mergeData(data, source) {
+ var bitmask = data[1],
+ srcBitmask = source[1],
+ newBitmask = bitmask | srcBitmask,
+ isCommon = newBitmask < ARY_FLAG;
+
+ var isCombo =
+ (srcBitmask == ARY_FLAG && bitmask == CURRY_FLAG) ||
+ (srcBitmask == ARY_FLAG && bitmask == REARG_FLAG && data[7].length <= source[8]) ||
+ (srcBitmask == (ARY_FLAG | REARG_FLAG) && bitmask == CURRY_FLAG);
+
+ // Exit early if metadata can't be merged.
+ if (!(isCommon || isCombo)) {
+ return data;
+ }
+ // Use source `thisArg` if available.
+ if (srcBitmask & BIND_FLAG) {
+ data[2] = source[2];
+ // Set when currying a bound function.
+ newBitmask |= (bitmask & BIND_FLAG) ? 0 : CURRY_BOUND_FLAG;
+ }
+ // Compose partial arguments.
+ var value = source[3];
+ if (value) {
+ var partials = data[3];
+ data[3] = partials ? composeArgs(partials, value, source[4]) : arrayCopy(value);
+ data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : arrayCopy(source[4]);
+ }
+ // Compose partial right arguments.
+ value = source[5];
+ if (value) {
+ partials = data[5];
+ data[5] = partials ? composeArgsRight(partials, value, source[6]) : arrayCopy(value);
+ data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : arrayCopy(source[6]);
+ }
+ // Use source `argPos` if available.
+ value = source[7];
+ if (value) {
+ data[7] = arrayCopy(value);
+ }
+ // Use source `ary` if it's smaller.
+ if (srcBitmask & ARY_FLAG) {
+ data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
+ }
+ // Use source `arity` if one is not provided.
+ if (data[9] == null) {
+ data[9] = source[9];
+ }
+ // Use source `func` and merge bitmasks.
+ data[0] = source[0];
+ data[1] = newBitmask;
+
+ return data;
+ }
+
+ /**
+ * A specialized version of `_.pick` which picks `object` properties specified
+ * by `props`.
+ *
+ * @private
+ * @param {Object} object The source object.
+ * @param {string[]} props The property names to pick.
+ * @returns {Object} Returns the new object.
+ */
+ function pickByArray(object, props) {
+ object = toObject(object);
+
+ var index = -1,
+ length = props.length,
+ result = {};
+
+ while (++index < length) {
+ var key = props[index];
+ if (key in object) {
+ result[key] = object[key];
+ }
+ }
+ return result;
+ }
+
+ /**
+ * A specialized version of `_.pick` which picks `object` properties `predicate`
+ * returns truthy for.
+ *
+ * @private
+ * @param {Object} object The source object.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {Object} Returns the new object.
+ */
+ function pickByCallback(object, predicate) {
+ var result = {};
+ baseForIn(object, function(value, key, object) {
+ if (predicate(value, key, object)) {
+ result[key] = value;
+ }
+ });
+ return result;
+ }
+
+ /**
+ * Reorder `array` according to the specified indexes where the element at
+ * the first index is assigned as the first element, the element at
+ * the second index is assigned as the second element, and so on.
+ *
+ * @private
+ * @param {Array} array The array to reorder.
+ * @param {Array} indexes The arranged array indexes.
+ * @returns {Array} Returns `array`.
+ */
+ function reorder(array, indexes) {
+ var arrLength = array.length,
+ length = nativeMin(indexes.length, arrLength),
+ oldArray = arrayCopy(array);
+
+ while (length--) {
+ var index = indexes[length];
+ array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
+ }
+ return array;
+ }
+
+ /**
+ * Sets metadata for `func`.
+ *
+ * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
+ * period of time, it will trip its breaker and transition to an identity function
+ * to avoid garbage collection pauses in V8. See [V8 issue 2070](https://code.google.com/p/v8/issues/detail?id=2070)
+ * for more details.
+ *
+ * @private
+ * @param {Function} func The function to associate metadata with.
+ * @param {*} data The metadata.
+ * @returns {Function} Returns `func`.
+ */
+ var setData = (function() {
+ var count = 0,
+ lastCalled = 0;
+
+ return function(key, value) {
+ var stamp = now(),
+ remaining = HOT_SPAN - (stamp - lastCalled);
+
+ lastCalled = stamp;
+ if (remaining > 0) {
+ if (++count >= HOT_COUNT) {
+ return key;
+ }
+ } else {
+ count = 0;
+ }
+ return baseSetData(key, value);
+ };
+ }());
+
+ /**
+ * A fallback implementation of `_.isPlainObject` which checks if `value`
+ * is an object created by the `Object` constructor or has a `[[Prototype]]`
+ * of `null`.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
+ */
+ function shimIsPlainObject(value) {
+ var Ctor,
+ support = lodash.support;
+
+ // Exit early for non `Object` objects.
+ if (!(isObjectLike(value) && objToString.call(value) == objectTag) ||
+ (!hasOwnProperty.call(value, 'constructor') &&
+ (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) {
+ return false;
+ }
+ // IE < 9 iterates inherited properties before own properties. If the first
+ // iterated property is an object's own property then there are no inherited
+ // enumerable properties.
+ var result;
+ // In most environments an object's own properties are iterated before
+ // its inherited properties. If the last iterated property is an object's
+ // own property then there are no inherited enumerable properties.
+ baseForIn(value, function(subValue, key) {
+ result = key;
+ });
+ return result === undefined || hasOwnProperty.call(value, result);
+ }
+
+ /**
+ * A fallback implementation of `Object.keys` which creates an array of the
+ * own enumerable property names of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ */
+ function shimKeys(object) {
+ var props = keysIn(object),
+ propsLength = props.length,
+ length = propsLength && object.length;
+
+ var allowIndexes = !!length && isLength(length) &&
+ (isArray(object) || isArguments(object));
+
+ var index = -1,
+ result = [];
+
+ while (++index < propsLength) {
+ var key = props[index];
+ if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {
+ result.push(key);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Converts `value` to an array-like object if it's not one.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {Array|Object} Returns the array-like object.
+ */
+ function toIterable(value) {
+ if (value == null) {
+ return [];
+ }
+ if (!isArrayLike(value)) {
+ return values(value);
+ }
+ return isObject(value) ? value : Object(value);
+ }
+
+ /**
+ * Converts `value` to an object if it's not one.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {Object} Returns the object.
+ */
+ function toObject(value) {
+ return isObject(value) ? value : Object(value);
+ }
+
+ /**
+ * Converts `value` to property path array if it's not one.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {Array} Returns the property path array.
+ */
+ function toPath(value) {
+ if (isArray(value)) {
+ return value;
+ }
+ var result = [];
+ baseToString(value).replace(rePropName, function(match, number, quote, string) {
+ result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
+ });
+ return result;
+ }
+
+ /**
+ * Creates a clone of `wrapper`.
+ *
+ * @private
+ * @param {Object} wrapper The wrapper to clone.
+ * @returns {Object} Returns the cloned wrapper.
+ */
+ function wrapperClone(wrapper) {
+ return wrapper instanceof LazyWrapper
+ ? wrapper.clone()
+ : new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__, arrayCopy(wrapper.__actions__));
+ }
+
+ /*------------------------------------------------------------------------*/
+
+ /**
+ * Creates an array of elements split into groups the length of `size`.
+ * If `collection` can't be split evenly, the final chunk will be the remaining
+ * elements.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to process.
+ * @param {number} [size=1] The length of each chunk.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {Array} Returns the new array containing chunks.
+ * @example
+ *
+ * _.chunk(['a', 'b', 'c', 'd'], 2);
+ * // => [['a', 'b'], ['c', 'd']]
+ *
+ * _.chunk(['a', 'b', 'c', 'd'], 3);
+ * // => [['a', 'b', 'c'], ['d']]
+ */
+ function chunk(array, size, guard) {
+ if (guard ? isIterateeCall(array, size, guard) : size == null) {
+ size = 1;
+ } else {
+ size = nativeMax(+size || 1, 1);
+ }
+ var index = 0,
+ length = array ? array.length : 0,
+ resIndex = -1,
+ result = Array(ceil(length / size));
+
+ while (index < length) {
+ result[++resIndex] = baseSlice(array, index, (index += size));
+ }
+ return result;
+ }
+
+ /**
+ * Creates an array with all falsey values removed. The values `false`, `null`,
+ * `0`, `""`, `undefined`, and `NaN` are falsey.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to compact.
+ * @returns {Array} Returns the new array of filtered values.
+ * @example
+ *
+ * _.compact([0, 1, false, 2, '', 3]);
+ * // => [1, 2, 3]
+ */
+ function compact(array) {
+ var index = -1,
+ length = array ? array.length : 0,
+ resIndex = -1,
+ result = [];
+
+ while (++index < length) {
+ var value = array[index];
+ if (value) {
+ result[++resIndex] = value;
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Creates an array of unique `array` values not included in the other
+ * provided arrays using [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
+ * for equality comparisons.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to inspect.
+ * @param {...Array} [values] The arrays of values to exclude.
+ * @returns {Array} Returns the new array of filtered values.
+ * @example
+ *
+ * _.difference([1, 2, 3], [4, 2]);
+ * // => [1, 3]
+ */
+ var difference = restParam(function(array, values) {
+ return isArrayLike(array)
+ ? baseDifference(array, baseFlatten(values, false, true))
+ : [];
+ });
+
+ /**
+ * Creates a slice of `array` with `n` elements dropped from the beginning.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to query.
+ * @param {number} [n=1] The number of elements to drop.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {Array} Returns the slice of `array`.
+ * @example
+ *
+ * _.drop([1, 2, 3]);
+ * // => [2, 3]
+ *
+ * _.drop([1, 2, 3], 2);
+ * // => [3]
+ *
+ * _.drop([1, 2, 3], 5);
+ * // => []
+ *
+ * _.drop([1, 2, 3], 0);
+ * // => [1, 2, 3]
+ */
+ function drop(array, n, guard) {
+ var length = array ? array.length : 0;
+ if (!length) {
+ return [];
+ }
+ if (guard ? isIterateeCall(array, n, guard) : n == null) {
+ n = 1;
+ }
+ return baseSlice(array, n < 0 ? 0 : n);
+ }
+
+ /**
+ * Creates a slice of `array` with `n` elements dropped from the end.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to query.
+ * @param {number} [n=1] The number of elements to drop.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {Array} Returns the slice of `array`.
+ * @example
+ *
+ * _.dropRight([1, 2, 3]);
+ * // => [1, 2]
+ *
+ * _.dropRight([1, 2, 3], 2);
+ * // => [1]
+ *
+ * _.dropRight([1, 2, 3], 5);
+ * // => []
+ *
+ * _.dropRight([1, 2, 3], 0);
+ * // => [1, 2, 3]
+ */
+ function dropRight(array, n, guard) {
+ var length = array ? array.length : 0;
+ if (!length) {
+ return [];
+ }
+ if (guard ? isIterateeCall(array, n, guard) : n == null) {
+ n = 1;
+ }
+ n = length - (+n || 0);
+ return baseSlice(array, 0, n < 0 ? 0 : n);
+ }
+
+ /**
+ * Creates a slice of `array` excluding elements dropped from the end.
+ * Elements are dropped until `predicate` returns falsey. The predicate is
+ * bound to `thisArg` and invoked with three arguments: (value, index, array).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that match the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to query.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {Array} Returns the slice of `array`.
+ * @example
+ *
+ * _.dropRightWhile([1, 2, 3], function(n) {
+ * return n > 1;
+ * });
+ * // => [1]
+ *
+ * var users = [
+ * { 'user': 'barney', 'active': true },
+ * { 'user': 'fred', 'active': false },
+ * { 'user': 'pebbles', 'active': false }
+ * ];
+ *
+ * // using the `_.matches` callback shorthand
+ * _.pluck(_.dropRightWhile(users, { 'user': 'pebbles', 'active': false }), 'user');
+ * // => ['barney', 'fred']
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.pluck(_.dropRightWhile(users, 'active', false), 'user');
+ * // => ['barney']
+ *
+ * // using the `_.property` callback shorthand
+ * _.pluck(_.dropRightWhile(users, 'active'), 'user');
+ * // => ['barney', 'fred', 'pebbles']
+ */
+ function dropRightWhile(array, predicate, thisArg) {
+ return (array && array.length)
+ ? baseWhile(array, getCallback(predicate, thisArg, 3), true, true)
+ : [];
+ }
+
+ /**
+ * Creates a slice of `array` excluding elements dropped from the beginning.
+ * Elements are dropped until `predicate` returns falsey. The predicate is
+ * bound to `thisArg` and invoked with three arguments: (value, index, array).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to query.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {Array} Returns the slice of `array`.
+ * @example
+ *
+ * _.dropWhile([1, 2, 3], function(n) {
+ * return n < 3;
+ * });
+ * // => [3]
+ *
+ * var users = [
+ * { 'user': 'barney', 'active': false },
+ * { 'user': 'fred', 'active': false },
+ * { 'user': 'pebbles', 'active': true }
+ * ];
+ *
+ * // using the `_.matches` callback shorthand
+ * _.pluck(_.dropWhile(users, { 'user': 'barney', 'active': false }), 'user');
+ * // => ['fred', 'pebbles']
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.pluck(_.dropWhile(users, 'active', false), 'user');
+ * // => ['pebbles']
+ *
+ * // using the `_.property` callback shorthand
+ * _.pluck(_.dropWhile(users, 'active'), 'user');
+ * // => ['barney', 'fred', 'pebbles']
+ */
+ function dropWhile(array, predicate, thisArg) {
+ return (array && array.length)
+ ? baseWhile(array, getCallback(predicate, thisArg, 3), true)
+ : [];
+ }
+
+ /**
+ * Fills elements of `array` with `value` from `start` up to, but not
+ * including, `end`.
+ *
+ * **Note:** This method mutates `array`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to fill.
+ * @param {*} value The value to fill `array` with.
+ * @param {number} [start=0] The start position.
+ * @param {number} [end=array.length] The end position.
+ * @returns {Array} Returns `array`.
+ * @example
+ *
+ * var array = [1, 2, 3];
+ *
+ * _.fill(array, 'a');
+ * console.log(array);
+ * // => ['a', 'a', 'a']
+ *
+ * _.fill(Array(3), 2);
+ * // => [2, 2, 2]
+ *
+ * _.fill([4, 6, 8], '*', 1, 2);
+ * // => [4, '*', 8]
+ */
+ function fill(array, value, start, end) {
+ var length = array ? array.length : 0;
+ if (!length) {
+ return [];
+ }
+ if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
+ start = 0;
+ end = length;
+ }
+ return baseFill(array, value, start, end);
+ }
+
+ /**
+ * This method is like `_.find` except that it returns the index of the first
+ * element `predicate` returns truthy for instead of the element itself.
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to search.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {number} Returns the index of the found element, else `-1`.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'active': false },
+ * { 'user': 'fred', 'active': false },
+ * { 'user': 'pebbles', 'active': true }
+ * ];
+ *
+ * _.findIndex(users, function(chr) {
+ * return chr.user == 'barney';
+ * });
+ * // => 0
+ *
+ * // using the `_.matches` callback shorthand
+ * _.findIndex(users, { 'user': 'fred', 'active': false });
+ * // => 1
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.findIndex(users, 'active', false);
+ * // => 0
+ *
+ * // using the `_.property` callback shorthand
+ * _.findIndex(users, 'active');
+ * // => 2
+ */
+ var findIndex = createFindIndex();
+
+ /**
+ * This method is like `_.findIndex` except that it iterates over elements
+ * of `collection` from right to left.
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to search.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {number} Returns the index of the found element, else `-1`.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'active': true },
+ * { 'user': 'fred', 'active': false },
+ * { 'user': 'pebbles', 'active': false }
+ * ];
+ *
+ * _.findLastIndex(users, function(chr) {
+ * return chr.user == 'pebbles';
+ * });
+ * // => 2
+ *
+ * // using the `_.matches` callback shorthand
+ * _.findLastIndex(users, { 'user': 'barney', 'active': true });
+ * // => 0
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.findLastIndex(users, 'active', false);
+ * // => 2
+ *
+ * // using the `_.property` callback shorthand
+ * _.findLastIndex(users, 'active');
+ * // => 0
+ */
+ var findLastIndex = createFindIndex(true);
+
+ /**
+ * Gets the first element of `array`.
+ *
+ * @static
+ * @memberOf _
+ * @alias head
+ * @category Array
+ * @param {Array} array The array to query.
+ * @returns {*} Returns the first element of `array`.
+ * @example
+ *
+ * _.first([1, 2, 3]);
+ * // => 1
+ *
+ * _.first([]);
+ * // => undefined
+ */
+ function first(array) {
+ return array ? array[0] : undefined;
+ }
+
+ /**
+ * Flattens a nested array. If `isDeep` is `true` the array is recursively
+ * flattened, otherwise it is only flattened a single level.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to flatten.
+ * @param {boolean} [isDeep] Specify a deep flatten.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {Array} Returns the new flattened array.
+ * @example
+ *
+ * _.flatten([1, [2, 3, [4]]]);
+ * // => [1, 2, 3, [4]]
+ *
+ * // using `isDeep`
+ * _.flatten([1, [2, 3, [4]]], true);
+ * // => [1, 2, 3, 4]
+ */
+ function flatten(array, isDeep, guard) {
+ var length = array ? array.length : 0;
+ if (guard && isIterateeCall(array, isDeep, guard)) {
+ isDeep = false;
+ }
+ return length ? baseFlatten(array, isDeep) : [];
+ }
+
+ /**
+ * Recursively flattens a nested array.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to recursively flatten.
+ * @returns {Array} Returns the new flattened array.
+ * @example
+ *
+ * _.flattenDeep([1, [2, 3, [4]]]);
+ * // => [1, 2, 3, 4]
+ */
+ function flattenDeep(array) {
+ var length = array ? array.length : 0;
+ return length ? baseFlatten(array, true) : [];
+ }
+
+ /**
+ * Gets the index at which the first occurrence of `value` is found in `array`
+ * using [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
+ * for equality comparisons. If `fromIndex` is negative, it is used as the offset
+ * from the end of `array`. If `array` is sorted providing `true` for `fromIndex`
+ * performs a faster binary search.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to search.
+ * @param {*} value The value to search for.
+ * @param {boolean|number} [fromIndex=0] The index to search from or `true`
+ * to perform a binary search on a sorted array.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ * @example
+ *
+ * _.indexOf([1, 2, 1, 2], 2);
+ * // => 1
+ *
+ * // using `fromIndex`
+ * _.indexOf([1, 2, 1, 2], 2, 2);
+ * // => 3
+ *
+ * // performing a binary search
+ * _.indexOf([1, 1, 2, 2], 2, true);
+ * // => 2
+ */
+ function indexOf(array, value, fromIndex) {
+ var length = array ? array.length : 0;
+ if (!length) {
+ return -1;
+ }
+ if (typeof fromIndex == 'number') {
+ fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex;
+ } else if (fromIndex) {
+ var index = binaryIndex(array, value),
+ other = array[index];
+
+ if (value === value ? (value === other) : (other !== other)) {
+ return index;
+ }
+ return -1;
+ }
+ return baseIndexOf(array, value, fromIndex || 0);
+ }
+
+ /**
+ * Gets all but the last element of `array`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to query.
+ * @returns {Array} Returns the slice of `array`.
+ * @example
+ *
+ * _.initial([1, 2, 3]);
+ * // => [1, 2]
+ */
+ function initial(array) {
+ return dropRight(array, 1);
+ }
+
+ /**
+ * Creates an array of unique values that are included in all of the provided
+ * arrays using [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
+ * for equality comparisons.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {...Array} [arrays] The arrays to inspect.
+ * @returns {Array} Returns the new array of shared values.
+ * @example
+ * _.intersection([1, 2], [4, 2], [2, 1]);
+ * // => [2]
+ */
+ var intersection = restParam(function(arrays) {
+ var othLength = arrays.length,
+ othIndex = othLength,
+ caches = Array(length),
+ indexOf = getIndexOf(),
+ isCommon = indexOf == baseIndexOf,
+ result = [];
+
+ while (othIndex--) {
+ var value = arrays[othIndex] = isArrayLike(value = arrays[othIndex]) ? value : [];
+ caches[othIndex] = (isCommon && value.length >= 120) ? createCache(othIndex && value) : null;
+ }
+ var array = arrays[0],
+ index = -1,
+ length = array ? array.length : 0,
+ seen = caches[0];
+
+ outer:
+ while (++index < length) {
+ value = array[index];
+ if ((seen ? cacheIndexOf(seen, value) : indexOf(result, value, 0)) < 0) {
+ var othIndex = othLength;
+ while (--othIndex) {
+ var cache = caches[othIndex];
+ if ((cache ? cacheIndexOf(cache, value) : indexOf(arrays[othIndex], value, 0)) < 0) {
+ continue outer;
+ }
+ }
+ if (seen) {
+ seen.push(value);
+ }
+ result.push(value);
+ }
+ }
+ return result;
+ });
+
+ /**
+ * Gets the last element of `array`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to query.
+ * @returns {*} Returns the last element of `array`.
+ * @example
+ *
+ * _.last([1, 2, 3]);
+ * // => 3
+ */
+ function last(array) {
+ var length = array ? array.length : 0;
+ return length ? array[length - 1] : undefined;
+ }
+
+ /**
+ * This method is like `_.indexOf` except that it iterates over elements of
+ * `array` from right to left.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to search.
+ * @param {*} value The value to search for.
+ * @param {boolean|number} [fromIndex=array.length-1] The index to search from
+ * or `true` to perform a binary search on a sorted array.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ * @example
+ *
+ * _.lastIndexOf([1, 2, 1, 2], 2);
+ * // => 3
+ *
+ * // using `fromIndex`
+ * _.lastIndexOf([1, 2, 1, 2], 2, 2);
+ * // => 1
+ *
+ * // performing a binary search
+ * _.lastIndexOf([1, 1, 2, 2], 2, true);
+ * // => 3
+ */
+ function lastIndexOf(array, value, fromIndex) {
+ var length = array ? array.length : 0;
+ if (!length) {
+ return -1;
+ }
+ var index = length;
+ if (typeof fromIndex == 'number') {
+ index = (fromIndex < 0 ? nativeMax(length + fromIndex, 0) : nativeMin(fromIndex || 0, length - 1)) + 1;
+ } else if (fromIndex) {
+ index = binaryIndex(array, value, true) - 1;
+ var other = array[index];
+ if (value === value ? (value === other) : (other !== other)) {
+ return index;
+ }
+ return -1;
+ }
+ if (value !== value) {
+ return indexOfNaN(array, index, true);
+ }
+ while (index--) {
+ if (array[index] === value) {
+ return index;
+ }
+ }
+ return -1;
+ }
+
+ /**
+ * Removes all provided values from `array` using
+ * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
+ * for equality comparisons.
+ *
+ * **Note:** Unlike `_.without`, this method mutates `array`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to modify.
+ * @param {...*} [values] The values to remove.
+ * @returns {Array} Returns `array`.
+ * @example
+ *
+ * var array = [1, 2, 3, 1, 2, 3];
+ *
+ * _.pull(array, 2, 3);
+ * console.log(array);
+ * // => [1, 1]
+ */
+ function pull() {
+ var args = arguments,
+ array = args[0];
+
+ if (!(array && array.length)) {
+ return array;
+ }
+ var index = 0,
+ indexOf = getIndexOf(),
+ length = args.length;
+
+ while (++index < length) {
+ var fromIndex = 0,
+ value = args[index];
+
+ while ((fromIndex = indexOf(array, value, fromIndex)) > -1) {
+ splice.call(array, fromIndex, 1);
+ }
+ }
+ return array;
+ }
+
+ /**
+ * Removes elements from `array` corresponding to the given indexes and returns
+ * an array of the removed elements. Indexes may be specified as an array of
+ * indexes or as individual arguments.
+ *
+ * **Note:** Unlike `_.at`, this method mutates `array`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to modify.
+ * @param {...(number|number[])} [indexes] The indexes of elements to remove,
+ * specified as individual indexes or arrays of indexes.
+ * @returns {Array} Returns the new array of removed elements.
+ * @example
+ *
+ * var array = [5, 10, 15, 20];
+ * var evens = _.pullAt(array, 1, 3);
+ *
+ * console.log(array);
+ * // => [5, 15]
+ *
+ * console.log(evens);
+ * // => [10, 20]
+ */
+ var pullAt = restParam(function(array, indexes) {
+ indexes = baseFlatten(indexes);
+
+ var result = baseAt(array, indexes);
+ basePullAt(array, indexes.sort(baseCompareAscending));
+ return result;
+ });
+
+ /**
+ * Removes all elements from `array` that `predicate` returns truthy for
+ * and returns an array of the removed elements. The predicate is bound to
+ * `thisArg` and invoked with three arguments: (value, index, array).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * **Note:** Unlike `_.filter`, this method mutates `array`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to modify.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {Array} Returns the new array of removed elements.
+ * @example
+ *
+ * var array = [1, 2, 3, 4];
+ * var evens = _.remove(array, function(n) {
+ * return n % 2 == 0;
+ * });
+ *
+ * console.log(array);
+ * // => [1, 3]
+ *
+ * console.log(evens);
+ * // => [2, 4]
+ */
+ function remove(array, predicate, thisArg) {
+ var result = [];
+ if (!(array && array.length)) {
+ return result;
+ }
+ var index = -1,
+ indexes = [],
+ length = array.length;
+
+ predicate = getCallback(predicate, thisArg, 3);
+ while (++index < length) {
+ var value = array[index];
+ if (predicate(value, index, array)) {
+ result.push(value);
+ indexes.push(index);
+ }
+ }
+ basePullAt(array, indexes);
+ return result;
+ }
+
+ /**
+ * Gets all but the first element of `array`.
+ *
+ * @static
+ * @memberOf _
+ * @alias tail
+ * @category Array
+ * @param {Array} array The array to query.
+ * @returns {Array} Returns the slice of `array`.
+ * @example
+ *
+ * _.rest([1, 2, 3]);
+ * // => [2, 3]
+ */
+ function rest(array) {
+ return drop(array, 1);
+ }
+
+ /**
+ * Creates a slice of `array` from `start` up to, but not including, `end`.
+ *
+ * **Note:** This method is used instead of `Array#slice` to support node
+ * lists in IE < 9 and to ensure dense arrays are returned.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to slice.
+ * @param {number} [start=0] The start position.
+ * @param {number} [end=array.length] The end position.
+ * @returns {Array} Returns the slice of `array`.
+ */
+ function slice(array, start, end) {
+ var length = array ? array.length : 0;
+ if (!length) {
+ return [];
+ }
+ if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
+ start = 0;
+ end = length;
+ }
+ return baseSlice(array, start, end);
+ }
+
+ /**
+ * Uses a binary search to determine the lowest index at which `value` should
+ * be inserted into `array` in order to maintain its sort order. If an iteratee
+ * function is provided it is invoked for `value` and each element of `array`
+ * to compute their sort ranking. The iteratee is bound to `thisArg` and
+ * invoked with one argument; (value).
+ *
+ * If a property name is provided for `iteratee` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `iteratee` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The sorted array to inspect.
+ * @param {*} value The value to evaluate.
+ * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {number} Returns the index at which `value` should be inserted
+ * into `array`.
+ * @example
+ *
+ * _.sortedIndex([30, 50], 40);
+ * // => 1
+ *
+ * _.sortedIndex([4, 4, 5, 5], 5);
+ * // => 2
+ *
+ * var dict = { 'data': { 'thirty': 30, 'forty': 40, 'fifty': 50 } };
+ *
+ * // using an iteratee function
+ * _.sortedIndex(['thirty', 'fifty'], 'forty', function(word) {
+ * return this.data[word];
+ * }, dict);
+ * // => 1
+ *
+ * // using the `_.property` callback shorthand
+ * _.sortedIndex([{ 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x');
+ * // => 1
+ */
+ var sortedIndex = createSortedIndex();
+
+ /**
+ * This method is like `_.sortedIndex` except that it returns the highest
+ * index at which `value` should be inserted into `array` in order to
+ * maintain its sort order.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The sorted array to inspect.
+ * @param {*} value The value to evaluate.
+ * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {number} Returns the index at which `value` should be inserted
+ * into `array`.
+ * @example
+ *
+ * _.sortedLastIndex([4, 4, 5, 5], 5);
+ * // => 4
+ */
+ var sortedLastIndex = createSortedIndex(true);
+
+ /**
+ * Creates a slice of `array` with `n` elements taken from the beginning.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to query.
+ * @param {number} [n=1] The number of elements to take.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {Array} Returns the slice of `array`.
+ * @example
+ *
+ * _.take([1, 2, 3]);
+ * // => [1]
+ *
+ * _.take([1, 2, 3], 2);
+ * // => [1, 2]
+ *
+ * _.take([1, 2, 3], 5);
+ * // => [1, 2, 3]
+ *
+ * _.take([1, 2, 3], 0);
+ * // => []
+ */
+ function take(array, n, guard) {
+ var length = array ? array.length : 0;
+ if (!length) {
+ return [];
+ }
+ if (guard ? isIterateeCall(array, n, guard) : n == null) {
+ n = 1;
+ }
+ return baseSlice(array, 0, n < 0 ? 0 : n);
+ }
+
+ /**
+ * Creates a slice of `array` with `n` elements taken from the end.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to query.
+ * @param {number} [n=1] The number of elements to take.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {Array} Returns the slice of `array`.
+ * @example
+ *
+ * _.takeRight([1, 2, 3]);
+ * // => [3]
+ *
+ * _.takeRight([1, 2, 3], 2);
+ * // => [2, 3]
+ *
+ * _.takeRight([1, 2, 3], 5);
+ * // => [1, 2, 3]
+ *
+ * _.takeRight([1, 2, 3], 0);
+ * // => []
+ */
+ function takeRight(array, n, guard) {
+ var length = array ? array.length : 0;
+ if (!length) {
+ return [];
+ }
+ if (guard ? isIterateeCall(array, n, guard) : n == null) {
+ n = 1;
+ }
+ n = length - (+n || 0);
+ return baseSlice(array, n < 0 ? 0 : n);
+ }
+
+ /**
+ * Creates a slice of `array` with elements taken from the end. Elements are
+ * taken until `predicate` returns falsey. The predicate is bound to `thisArg`
+ * and invoked with three arguments: (value, index, array).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to query.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {Array} Returns the slice of `array`.
+ * @example
+ *
+ * _.takeRightWhile([1, 2, 3], function(n) {
+ * return n > 1;
+ * });
+ * // => [2, 3]
+ *
+ * var users = [
+ * { 'user': 'barney', 'active': true },
+ * { 'user': 'fred', 'active': false },
+ * { 'user': 'pebbles', 'active': false }
+ * ];
+ *
+ * // using the `_.matches` callback shorthand
+ * _.pluck(_.takeRightWhile(users, { 'user': 'pebbles', 'active': false }), 'user');
+ * // => ['pebbles']
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.pluck(_.takeRightWhile(users, 'active', false), 'user');
+ * // => ['fred', 'pebbles']
+ *
+ * // using the `_.property` callback shorthand
+ * _.pluck(_.takeRightWhile(users, 'active'), 'user');
+ * // => []
+ */
+ function takeRightWhile(array, predicate, thisArg) {
+ return (array && array.length)
+ ? baseWhile(array, getCallback(predicate, thisArg, 3), false, true)
+ : [];
+ }
+
+ /**
+ * Creates a slice of `array` with elements taken from the beginning. Elements
+ * are taken until `predicate` returns falsey. The predicate is bound to
+ * `thisArg` and invoked with three arguments: (value, index, array).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to query.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {Array} Returns the slice of `array`.
+ * @example
+ *
+ * _.takeWhile([1, 2, 3], function(n) {
+ * return n < 3;
+ * });
+ * // => [1, 2]
+ *
+ * var users = [
+ * { 'user': 'barney', 'active': false },
+ * { 'user': 'fred', 'active': false},
+ * { 'user': 'pebbles', 'active': true }
+ * ];
+ *
+ * // using the `_.matches` callback shorthand
+ * _.pluck(_.takeWhile(users, { 'user': 'barney', 'active': false }), 'user');
+ * // => ['barney']
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.pluck(_.takeWhile(users, 'active', false), 'user');
+ * // => ['barney', 'fred']
+ *
+ * // using the `_.property` callback shorthand
+ * _.pluck(_.takeWhile(users, 'active'), 'user');
+ * // => []
+ */
+ function takeWhile(array, predicate, thisArg) {
+ return (array && array.length)
+ ? baseWhile(array, getCallback(predicate, thisArg, 3))
+ : [];
+ }
+
+ /**
+ * Creates an array of unique values, in order, from all of the provided arrays
+ * using [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
+ * for equality comparisons.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {...Array} [arrays] The arrays to inspect.
+ * @returns {Array} Returns the new array of combined values.
+ * @example
+ *
+ * _.union([1, 2], [4, 2], [2, 1]);
+ * // => [1, 2, 4]
+ */
+ var union = restParam(function(arrays) {
+ return baseUniq(baseFlatten(arrays, false, true));
+ });
+
+ /**
+ * Creates a duplicate-free version of an array, using
+ * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
+ * for equality comparisons, in which only the first occurence of each element
+ * is kept. Providing `true` for `isSorted` performs a faster search algorithm
+ * for sorted arrays. If an iteratee function is provided it is invoked for
+ * each element in the array to generate the criterion by which uniqueness
+ * is computed. The `iteratee` is bound to `thisArg` and invoked with three
+ * arguments: (value, index, array).
+ *
+ * If a property name is provided for `iteratee` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `iteratee` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @alias unique
+ * @category Array
+ * @param {Array} array The array to inspect.
+ * @param {boolean} [isSorted] Specify the array is sorted.
+ * @param {Function|Object|string} [iteratee] The function invoked per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Array} Returns the new duplicate-value-free array.
+ * @example
+ *
+ * _.uniq([2, 1, 2]);
+ * // => [2, 1]
+ *
+ * // using `isSorted`
+ * _.uniq([1, 1, 2], true);
+ * // => [1, 2]
+ *
+ * // using an iteratee function
+ * _.uniq([1, 2.5, 1.5, 2], function(n) {
+ * return this.floor(n);
+ * }, Math);
+ * // => [1, 2.5]
+ *
+ * // using the `_.property` callback shorthand
+ * _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
+ * // => [{ 'x': 1 }, { 'x': 2 }]
+ */
+ function uniq(array, isSorted, iteratee, thisArg) {
+ var length = array ? array.length : 0;
+ if (!length) {
+ return [];
+ }
+ if (isSorted != null && typeof isSorted != 'boolean') {
+ thisArg = iteratee;
+ iteratee = isIterateeCall(array, isSorted, thisArg) ? null : isSorted;
+ isSorted = false;
+ }
+ var callback = getCallback();
+ if (!(iteratee == null && callback === baseCallback)) {
+ iteratee = callback(iteratee, thisArg, 3);
+ }
+ return (isSorted && getIndexOf() == baseIndexOf)
+ ? sortedUniq(array, iteratee)
+ : baseUniq(array, iteratee);
+ }
+
+ /**
+ * This method is like `_.zip` except that it accepts an array of grouped
+ * elements and creates an array regrouping the elements to their pre-zip
+ * configuration.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array of grouped elements to process.
+ * @returns {Array} Returns the new array of regrouped elements.
+ * @example
+ *
+ * var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]);
+ * // => [['fred', 30, true], ['barney', 40, false]]
+ *
+ * _.unzip(zipped);
+ * // => [['fred', 'barney'], [30, 40], [true, false]]
+ */
+ function unzip(array) {
+ if (!(array && array.length)) {
+ return [];
+ }
+ var index = -1,
+ length = 0;
+
+ array = arrayFilter(array, function(group) {
+ if (isArrayLike(group)) {
+ length = nativeMax(group.length, length);
+ return true;
+ }
+ });
+ var result = Array(length);
+ while (++index < length) {
+ result[index] = arrayMap(array, baseProperty(index));
+ }
+ return result;
+ }
+
+ /**
+ * This method is like `_.unzip` except that it accepts an iteratee to specify
+ * how regrouped values should be combined. The `iteratee` is bound to `thisArg`
+ * and invoked with four arguments: (accumulator, value, index, group).
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array of grouped elements to process.
+ * @param {Function} [iteratee] The function to combine regrouped values.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Array} Returns the new array of regrouped elements.
+ * @example
+ *
+ * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
+ * // => [[1, 10, 100], [2, 20, 200]]
+ *
+ * _.unzipWith(zipped, _.add);
+ * // => [3, 30, 300]
+ */
+ function unzipWith(array, iteratee, thisArg) {
+ var length = array ? array.length : 0;
+ if (!length) {
+ return [];
+ }
+ var result = unzip(array);
+ if (iteratee == null) {
+ return result;
+ }
+ iteratee = bindCallback(iteratee, thisArg, 4);
+ return arrayMap(result, function(group) {
+ return arrayReduce(group, iteratee, undefined, true);
+ });
+ }
+
+ /**
+ * Creates an array excluding all provided values using
+ * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
+ * for equality comparisons.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to filter.
+ * @param {...*} [values] The values to exclude.
+ * @returns {Array} Returns the new array of filtered values.
+ * @example
+ *
+ * _.without([1, 2, 1, 3], 1, 2);
+ * // => [3]
+ */
+ var without = restParam(function(array, values) {
+ return isArrayLike(array)
+ ? baseDifference(array, values)
+ : [];
+ });
+
+ /**
+ * Creates an array of unique values that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
+ * of the provided arrays.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {...Array} [arrays] The arrays to inspect.
+ * @returns {Array} Returns the new array of values.
+ * @example
+ *
+ * _.xor([1, 2], [4, 2]);
+ * // => [1, 4]
+ */
+ function xor() {
+ var index = -1,
+ length = arguments.length;
+
+ while (++index < length) {
+ var array = arguments[index];
+ if (isArrayLike(array)) {
+ var result = result
+ ? baseDifference(result, array).concat(baseDifference(array, result))
+ : array;
+ }
+ }
+ return result ? baseUniq(result) : [];
+ }
+
+ /**
+ * Creates an array of grouped elements, the first of which contains the first
+ * elements of the given arrays, the second of which contains the second elements
+ * of the given arrays, and so on.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {...Array} [arrays] The arrays to process.
+ * @returns {Array} Returns the new array of grouped elements.
+ * @example
+ *
+ * _.zip(['fred', 'barney'], [30, 40], [true, false]);
+ * // => [['fred', 30, true], ['barney', 40, false]]
+ */
+ var zip = restParam(unzip);
+
+ /**
+ * The inverse of `_.pairs`; this method returns an object composed from arrays
+ * of property names and values. Provide either a single two dimensional array,
+ * e.g. `[[key1, value1], [key2, value2]]` or two arrays, one of property names
+ * and one of corresponding values.
+ *
+ * @static
+ * @memberOf _
+ * @alias object
+ * @category Array
+ * @param {Array} props The property names.
+ * @param {Array} [values=[]] The property values.
+ * @returns {Object} Returns the new object.
+ * @example
+ *
+ * _.zipObject([['fred', 30], ['barney', 40]]);
+ * // => { 'fred': 30, 'barney': 40 }
+ *
+ * _.zipObject(['fred', 'barney'], [30, 40]);
+ * // => { 'fred': 30, 'barney': 40 }
+ */
+ function zipObject(props, values) {
+ var index = -1,
+ length = props ? props.length : 0,
+ result = {};
+
+ if (length && !values && !isArray(props[0])) {
+ values = [];
+ }
+ while (++index < length) {
+ var key = props[index];
+ if (values) {
+ result[key] = values[index];
+ } else if (key) {
+ result[key[0]] = key[1];
+ }
+ }
+ return result;
+ }
+
+ /**
+ * This method is like `_.zip` except that it accepts an iteratee to specify
+ * how grouped values should be combined. The `iteratee` is bound to `thisArg`
+ * and invoked with four arguments: (accumulator, value, index, group).
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {...Array} [arrays] The arrays to process.
+ * @param {Function} [iteratee] The function to combine grouped values.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Array} Returns the new array of grouped elements.
+ * @example
+ *
+ * _.zipWith([1, 2], [10, 20], [100, 200], _.add);
+ * // => [111, 222]
+ */
+ var zipWith = restParam(function(arrays) {
+ var length = arrays.length,
+ iteratee = length > 2 ? arrays[length - 2] : undefined,
+ thisArg = length > 1 ? arrays[length - 1] : undefined;
+
+ if (length > 2 && typeof iteratee == 'function') {
+ length -= 2;
+ } else {
+ iteratee = (length > 1 && typeof thisArg == 'function') ? (--length, thisArg) : undefined;
+ thisArg = undefined;
+ }
+ arrays.length = length;
+ return unzipWith(arrays, iteratee, thisArg);
+ });
+
+ /*------------------------------------------------------------------------*/
+
+ /**
+ * Creates a `lodash` object that wraps `value` with explicit method
+ * chaining enabled.
+ *
+ * @static
+ * @memberOf _
+ * @category Chain
+ * @param {*} value The value to wrap.
+ * @returns {Object} Returns the new `lodash` wrapper instance.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36 },
+ * { 'user': 'fred', 'age': 40 },
+ * { 'user': 'pebbles', 'age': 1 }
+ * ];
+ *
+ * var youngest = _.chain(users)
+ * .sortBy('age')
+ * .map(function(chr) {
+ * return chr.user + ' is ' + chr.age;
+ * })
+ * .first()
+ * .value();
+ * // => 'pebbles is 1'
+ */
+ function chain(value) {
+ var result = lodash(value);
+ result.__chain__ = true;
+ return result;
+ }
+
+ /**
+ * This method invokes `interceptor` and returns `value`. The interceptor is
+ * bound to `thisArg` and invoked with one argument; (value). The purpose of
+ * this method is to "tap into" a method chain in order to perform operations
+ * on intermediate results within the chain.
+ *
+ * @static
+ * @memberOf _
+ * @category Chain
+ * @param {*} value The value to provide to `interceptor`.
+ * @param {Function} interceptor The function to invoke.
+ * @param {*} [thisArg] The `this` binding of `interceptor`.
+ * @returns {*} Returns `value`.
+ * @example
+ *
+ * _([1, 2, 3])
+ * .tap(function(array) {
+ * array.pop();
+ * })
+ * .reverse()
+ * .value();
+ * // => [2, 1]
+ */
+ function tap(value, interceptor, thisArg) {
+ interceptor.call(thisArg, value);
+ return value;
+ }
+
+ /**
+ * This method is like `_.tap` except that it returns the result of `interceptor`.
+ *
+ * @static
+ * @memberOf _
+ * @category Chain
+ * @param {*} value The value to provide to `interceptor`.
+ * @param {Function} interceptor The function to invoke.
+ * @param {*} [thisArg] The `this` binding of `interceptor`.
+ * @returns {*} Returns the result of `interceptor`.
+ * @example
+ *
+ * _(' abc ')
+ * .chain()
+ * .trim()
+ * .thru(function(value) {
+ * return [value];
+ * })
+ * .value();
+ * // => ['abc']
+ */
+ function thru(value, interceptor, thisArg) {
+ return interceptor.call(thisArg, value);
+ }
+
+ /**
+ * Enables explicit method chaining on the wrapper object.
+ *
+ * @name chain
+ * @memberOf _
+ * @category Chain
+ * @returns {Object} Returns the new `lodash` wrapper instance.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36 },
+ * { 'user': 'fred', 'age': 40 }
+ * ];
+ *
+ * // without explicit chaining
+ * _(users).first();
+ * // => { 'user': 'barney', 'age': 36 }
+ *
+ * // with explicit chaining
+ * _(users).chain()
+ * .first()
+ * .pick('user')
+ * .value();
+ * // => { 'user': 'barney' }
+ */
+ function wrapperChain() {
+ return chain(this);
+ }
+
+ /**
+ * Executes the chained sequence and returns the wrapped result.
+ *
+ * @name commit
+ * @memberOf _
+ * @category Chain
+ * @returns {Object} Returns the new `lodash` wrapper instance.
+ * @example
+ *
+ * var array = [1, 2];
+ * var wrapper = _(array).push(3);
+ *
+ * console.log(array);
+ * // => [1, 2]
+ *
+ * wrapper = wrapper.commit();
+ * console.log(array);
+ * // => [1, 2, 3]
+ *
+ * wrapper.last();
+ * // => 3
+ *
+ * console.log(array);
+ * // => [1, 2, 3]
+ */
+ function wrapperCommit() {
+ return new LodashWrapper(this.value(), this.__chain__);
+ }
+
+ /**
+ * Creates a clone of the chained sequence planting `value` as the wrapped value.
+ *
+ * @name plant
+ * @memberOf _
+ * @category Chain
+ * @returns {Object} Returns the new `lodash` wrapper instance.
+ * @example
+ *
+ * var array = [1, 2];
+ * var wrapper = _(array).map(function(value) {
+ * return Math.pow(value, 2);
+ * });
+ *
+ * var other = [3, 4];
+ * var otherWrapper = wrapper.plant(other);
+ *
+ * otherWrapper.value();
+ * // => [9, 16]
+ *
+ * wrapper.value();
+ * // => [1, 4]
+ */
+ function wrapperPlant(value) {
+ var result,
+ parent = this;
+
+ while (parent instanceof baseLodash) {
+ var clone = wrapperClone(parent);
+ if (result) {
+ previous.__wrapped__ = clone;
+ } else {
+ result = clone;
+ }
+ var previous = clone;
+ parent = parent.__wrapped__;
+ }
+ previous.__wrapped__ = value;
+ return result;
+ }
+
+ /**
+ * Reverses the wrapped array so the first element becomes the last, the
+ * second element becomes the second to last, and so on.
+ *
+ * **Note:** This method mutates the wrapped array.
+ *
+ * @name reverse
+ * @memberOf _
+ * @category Chain
+ * @returns {Object} Returns the new reversed `lodash` wrapper instance.
+ * @example
+ *
+ * var array = [1, 2, 3];
+ *
+ * _(array).reverse().value()
+ * // => [3, 2, 1]
+ *
+ * console.log(array);
+ * // => [3, 2, 1]
+ */
+ function wrapperReverse() {
+ var value = this.__wrapped__;
+ if (value instanceof LazyWrapper) {
+ if (this.__actions__.length) {
+ value = new LazyWrapper(this);
+ }
+ return new LodashWrapper(value.reverse(), this.__chain__);
+ }
+ return this.thru(function(value) {
+ return value.reverse();
+ });
+ }
+
+ /**
+ * Produces the result of coercing the unwrapped value to a string.
+ *
+ * @name toString
+ * @memberOf _
+ * @category Chain
+ * @returns {string} Returns the coerced string value.
+ * @example
+ *
+ * _([1, 2, 3]).toString();
+ * // => '1,2,3'
+ */
+ function wrapperToString() {
+ return (this.value() + '');
+ }
+
+ /**
+ * Executes the chained sequence to extract the unwrapped value.
+ *
+ * @name value
+ * @memberOf _
+ * @alias run, toJSON, valueOf
+ * @category Chain
+ * @returns {*} Returns the resolved unwrapped value.
+ * @example
+ *
+ * _([1, 2, 3]).value();
+ * // => [1, 2, 3]
+ */
+ function wrapperValue() {
+ return baseWrapperValue(this.__wrapped__, this.__actions__);
+ }
+
+ /*------------------------------------------------------------------------*/
+
+ /**
+ * Creates an array of elements corresponding to the given keys, or indexes,
+ * of `collection`. Keys may be specified as individual arguments or as arrays
+ * of keys.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {...(number|number[]|string|string[])} [props] The property names
+ * or indexes of elements to pick, specified individually or in arrays.
+ * @returns {Array} Returns the new array of picked elements.
+ * @example
+ *
+ * _.at(['a', 'b', 'c'], [0, 2]);
+ * // => ['a', 'c']
+ *
+ * _.at(['barney', 'fred', 'pebbles'], 0, 2);
+ * // => ['barney', 'pebbles']
+ */
+ var at = restParam(function(collection, props) {
+ return baseAt(collection, baseFlatten(props));
+ });
+
+ /**
+ * Creates an object composed of keys generated from the results of running
+ * each element of `collection` through `iteratee`. The corresponding value
+ * of each key is the number of times the key was returned by `iteratee`.
+ * The `iteratee` is bound to `thisArg` and invoked with three arguments:
+ * (value, index|key, collection).
+ *
+ * If a property name is provided for `iteratee` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `iteratee` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Object} Returns the composed aggregate object.
+ * @example
+ *
+ * _.countBy([4.3, 6.1, 6.4], function(n) {
+ * return Math.floor(n);
+ * });
+ * // => { '4': 1, '6': 2 }
+ *
+ * _.countBy([4.3, 6.1, 6.4], function(n) {
+ * return this.floor(n);
+ * }, Math);
+ * // => { '4': 1, '6': 2 }
+ *
+ * _.countBy(['one', 'two', 'three'], 'length');
+ * // => { '3': 2, '5': 1 }
+ */
+ var countBy = createAggregator(function(result, value, key) {
+ hasOwnProperty.call(result, key) ? ++result[key] : (result[key] = 1);
+ });
+
+ /**
+ * Checks if `predicate` returns truthy for **all** elements of `collection`.
+ * The predicate is bound to `thisArg` and invoked with three arguments:
+ * (value, index|key, collection).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @alias all
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {boolean} Returns `true` if all elements pass the predicate check,
+ * else `false`.
+ * @example
+ *
+ * _.every([true, 1, null, 'yes'], Boolean);
+ * // => false
+ *
+ * var users = [
+ * { 'user': 'barney', 'active': false },
+ * { 'user': 'fred', 'active': false }
+ * ];
+ *
+ * // using the `_.matches` callback shorthand
+ * _.every(users, { 'user': 'barney', 'active': false });
+ * // => false
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.every(users, 'active', false);
+ * // => true
+ *
+ * // using the `_.property` callback shorthand
+ * _.every(users, 'active');
+ * // => false
+ */
+ function every(collection, predicate, thisArg) {
+ var func = isArray(collection) ? arrayEvery : baseEvery;
+ if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
+ predicate = null;
+ }
+ if (typeof predicate != 'function' || thisArg !== undefined) {
+ predicate = getCallback(predicate, thisArg, 3);
+ }
+ return func(collection, predicate);
+ }
+
+ /**
+ * Iterates over elements of `collection`, returning an array of all elements
+ * `predicate` returns truthy for. The predicate is bound to `thisArg` and
+ * invoked with three arguments: (value, index|key, collection).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @alias select
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {Array} Returns the new filtered array.
+ * @example
+ *
+ * _.filter([4, 5, 6], function(n) {
+ * return n % 2 == 0;
+ * });
+ * // => [4, 6]
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36, 'active': true },
+ * { 'user': 'fred', 'age': 40, 'active': false }
+ * ];
+ *
+ * // using the `_.matches` callback shorthand
+ * _.pluck(_.filter(users, { 'age': 36, 'active': true }), 'user');
+ * // => ['barney']
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.pluck(_.filter(users, 'active', false), 'user');
+ * // => ['fred']
+ *
+ * // using the `_.property` callback shorthand
+ * _.pluck(_.filter(users, 'active'), 'user');
+ * // => ['barney']
+ */
+ function filter(collection, predicate, thisArg) {
+ var func = isArray(collection) ? arrayFilter : baseFilter;
+ predicate = getCallback(predicate, thisArg, 3);
+ return func(collection, predicate);
+ }
+
+ /**
+ * Iterates over elements of `collection`, returning the first element
+ * `predicate` returns truthy for. The predicate is bound to `thisArg` and
+ * invoked with three arguments: (value, index|key, collection).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @alias detect
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to search.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {*} Returns the matched element, else `undefined`.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36, 'active': true },
+ * { 'user': 'fred', 'age': 40, 'active': false },
+ * { 'user': 'pebbles', 'age': 1, 'active': true }
+ * ];
+ *
+ * _.result(_.find(users, function(chr) {
+ * return chr.age < 40;
+ * }), 'user');
+ * // => 'barney'
+ *
+ * // using the `_.matches` callback shorthand
+ * _.result(_.find(users, { 'age': 1, 'active': true }), 'user');
+ * // => 'pebbles'
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.result(_.find(users, 'active', false), 'user');
+ * // => 'fred'
+ *
+ * // using the `_.property` callback shorthand
+ * _.result(_.find(users, 'active'), 'user');
+ * // => 'barney'
+ */
+ var find = createFind(baseEach);
+
+ /**
+ * This method is like `_.find` except that it iterates over elements of
+ * `collection` from right to left.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to search.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {*} Returns the matched element, else `undefined`.
+ * @example
+ *
+ * _.findLast([1, 2, 3, 4], function(n) {
+ * return n % 2 == 1;
+ * });
+ * // => 3
+ */
+ var findLast = createFind(baseEachRight, true);
+
+ /**
+ * Performs a deep comparison between each element in `collection` and the
+ * source object, returning the first element that has equivalent property
+ * values.
+ *
+ * **Note:** This method supports comparing arrays, booleans, `Date` objects,
+ * numbers, `Object` objects, regexes, and strings. Objects are compared by
+ * their own, not inherited, enumerable properties. For comparing a single
+ * own or inherited property value see `_.matchesProperty`.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to search.
+ * @param {Object} source The object of property values to match.
+ * @returns {*} Returns the matched element, else `undefined`.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36, 'active': true },
+ * { 'user': 'fred', 'age': 40, 'active': false }
+ * ];
+ *
+ * _.result(_.findWhere(users, { 'age': 36, 'active': true }), 'user');
+ * // => 'barney'
+ *
+ * _.result(_.findWhere(users, { 'age': 40, 'active': false }), 'user');
+ * // => 'fred'
+ */
+ function findWhere(collection, source) {
+ return find(collection, baseMatches(source));
+ }
+
+ /**
+ * Iterates over elements of `collection` invoking `iteratee` for each element.
+ * The `iteratee` is bound to `thisArg` and invoked with three arguments:
+ * (value, index|key, collection). Iteratee functions may exit iteration early
+ * by explicitly returning `false`.
+ *
+ * **Note:** As with other "Collections" methods, objects with a "length" property
+ * are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn`
+ * may be used for object iteration.
+ *
+ * @static
+ * @memberOf _
+ * @alias each
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Array|Object|string} Returns `collection`.
+ * @example
+ *
+ * _([1, 2]).forEach(function(n) {
+ * console.log(n);
+ * }).value();
+ * // => logs each value from left to right and returns the array
+ *
+ * _.forEach({ 'a': 1, 'b': 2 }, function(n, key) {
+ * console.log(n, key);
+ * });
+ * // => logs each value-key pair and returns the object (iteration order is not guaranteed)
+ */
+ var forEach = createForEach(arrayEach, baseEach);
+
+ /**
+ * This method is like `_.forEach` except that it iterates over elements of
+ * `collection` from right to left.
+ *
+ * @static
+ * @memberOf _
+ * @alias eachRight
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Array|Object|string} Returns `collection`.
+ * @example
+ *
+ * _([1, 2]).forEachRight(function(n) {
+ * console.log(n);
+ * }).value();
+ * // => logs each value from right to left and returns the array
+ */
+ var forEachRight = createForEach(arrayEachRight, baseEachRight);
+
+ /**
+ * Creates an object composed of keys generated from the results of running
+ * each element of `collection` through `iteratee`. The corresponding value
+ * of each key is an array of the elements responsible for generating the key.
+ * The `iteratee` is bound to `thisArg` and invoked with three arguments:
+ * (value, index|key, collection).
+ *
+ * If a property name is provided for `iteratee` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `iteratee` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Object} Returns the composed aggregate object.
+ * @example
+ *
+ * _.groupBy([4.2, 6.1, 6.4], function(n) {
+ * return Math.floor(n);
+ * });
+ * // => { '4': [4.2], '6': [6.1, 6.4] }
+ *
+ * _.groupBy([4.2, 6.1, 6.4], function(n) {
+ * return this.floor(n);
+ * }, Math);
+ * // => { '4': [4.2], '6': [6.1, 6.4] }
+ *
+ * // using the `_.property` callback shorthand
+ * _.groupBy(['one', 'two', 'three'], 'length');
+ * // => { '3': ['one', 'two'], '5': ['three'] }
+ */
+ var groupBy = createAggregator(function(result, value, key) {
+ if (hasOwnProperty.call(result, key)) {
+ result[key].push(value);
+ } else {
+ result[key] = [value];
+ }
+ });
+
+ /**
+ * Checks if `value` is in `collection` using
+ * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
+ * for equality comparisons. If `fromIndex` is negative, it is used as the offset
+ * from the end of `collection`.
+ *
+ * @static
+ * @memberOf _
+ * @alias contains, include
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to search.
+ * @param {*} target The value to search for.
+ * @param {number} [fromIndex=0] The index to search from.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`.
+ * @returns {boolean} Returns `true` if a matching element is found, else `false`.
+ * @example
+ *
+ * _.includes([1, 2, 3], 1);
+ * // => true
+ *
+ * _.includes([1, 2, 3], 1, 2);
+ * // => false
+ *
+ * _.includes({ 'user': 'fred', 'age': 40 }, 'fred');
+ * // => true
+ *
+ * _.includes('pebbles', 'eb');
+ * // => true
+ */
+ function includes(collection, target, fromIndex, guard) {
+ var length = collection ? getLength(collection) : 0;
+ if (!isLength(length)) {
+ collection = values(collection);
+ length = collection.length;
+ }
+ if (!length) {
+ return false;
+ }
+ if (typeof fromIndex != 'number' || (guard && isIterateeCall(target, fromIndex, guard))) {
+ fromIndex = 0;
+ } else {
+ fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0);
+ }
+ return (typeof collection == 'string' || !isArray(collection) && isString(collection))
+ ? (fromIndex < length && collection.indexOf(target, fromIndex) > -1)
+ : (getIndexOf(collection, target, fromIndex) > -1);
+ }
+
+ /**
+ * Creates an object composed of keys generated from the results of running
+ * each element of `collection` through `iteratee`. The corresponding value
+ * of each key is the last element responsible for generating the key. The
+ * iteratee function is bound to `thisArg` and invoked with three arguments:
+ * (value, index|key, collection).
+ *
+ * If a property name is provided for `iteratee` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `iteratee` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Object} Returns the composed aggregate object.
+ * @example
+ *
+ * var keyData = [
+ * { 'dir': 'left', 'code': 97 },
+ * { 'dir': 'right', 'code': 100 }
+ * ];
+ *
+ * _.indexBy(keyData, 'dir');
+ * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
+ *
+ * _.indexBy(keyData, function(object) {
+ * return String.fromCharCode(object.code);
+ * });
+ * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
+ *
+ * _.indexBy(keyData, function(object) {
+ * return this.fromCharCode(object.code);
+ * }, String);
+ * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
+ */
+ var indexBy = createAggregator(function(result, value, key) {
+ result[key] = value;
+ });
+
+ /**
+ * Invokes the method at `path` of each element in `collection`, returning
+ * an array of the results of each invoked method. Any additional arguments
+ * are provided to each invoked method. If `methodName` is a function it is
+ * invoked for, and `this` bound to, each element in `collection`.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Array|Function|string} path The path of the method to invoke or
+ * the function invoked per iteration.
+ * @param {...*} [args] The arguments to invoke the method with.
+ * @returns {Array} Returns the array of results.
+ * @example
+ *
+ * _.invoke([[5, 1, 7], [3, 2, 1]], 'sort');
+ * // => [[1, 5, 7], [1, 2, 3]]
+ *
+ * _.invoke([123, 456], String.prototype.split, '');
+ * // => [['1', '2', '3'], ['4', '5', '6']]
+ */
+ var invoke = restParam(function(collection, path, args) {
+ var index = -1,
+ isFunc = typeof path == 'function',
+ isProp = isKey(path),
+ result = isArrayLike(collection) ? Array(collection.length) : [];
+
+ baseEach(collection, function(value) {
+ var func = isFunc ? path : ((isProp && value != null) ? value[path] : null);
+ result[++index] = func ? func.apply(value, args) : invokePath(value, path, args);
+ });
+ return result;
+ });
+
+ /**
+ * Creates an array of values by running each element in `collection` through
+ * `iteratee`. The `iteratee` is bound to `thisArg` and invoked with three
+ * arguments: (value, index|key, collection).
+ *
+ * If a property name is provided for `iteratee` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `iteratee` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * Many lodash methods are guarded to work as iteratees for methods like
+ * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
+ *
+ * The guarded methods are:
+ * `ary`, `callback`, `chunk`, `clone`, `create`, `curry`, `curryRight`,
+ * `drop`, `dropRight`, `every`, `fill`, `flatten`, `invert`, `max`, `min`,
+ * `parseInt`, `slice`, `sortBy`, `take`, `takeRight`, `template`, `trim`,
+ * `trimLeft`, `trimRight`, `trunc`, `random`, `range`, `sample`, `some`,
+ * `sum`, `uniq`, and `words`
+ *
+ * @static
+ * @memberOf _
+ * @alias collect
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Array} Returns the new mapped array.
+ * @example
+ *
+ * function timesThree(n) {
+ * return n * 3;
+ * }
+ *
+ * _.map([1, 2], timesThree);
+ * // => [3, 6]
+ *
+ * _.map({ 'a': 1, 'b': 2 }, timesThree);
+ * // => [3, 6] (iteration order is not guaranteed)
+ *
+ * var users = [
+ * { 'user': 'barney' },
+ * { 'user': 'fred' }
+ * ];
+ *
+ * // using the `_.property` callback shorthand
+ * _.map(users, 'user');
+ * // => ['barney', 'fred']
+ */
+ function map(collection, iteratee, thisArg) {
+ var func = isArray(collection) ? arrayMap : baseMap;
+ iteratee = getCallback(iteratee, thisArg, 3);
+ return func(collection, iteratee);
+ }
+
+ /**
+ * Creates an array of elements split into two groups, the first of which
+ * contains elements `predicate` returns truthy for, while the second of which
+ * contains elements `predicate` returns falsey for. The predicate is bound
+ * to `thisArg` and invoked with three arguments: (value, index|key, collection).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {Array} Returns the array of grouped elements.
+ * @example
+ *
+ * _.partition([1, 2, 3], function(n) {
+ * return n % 2;
+ * });
+ * // => [[1, 3], [2]]
+ *
+ * _.partition([1.2, 2.3, 3.4], function(n) {
+ * return this.floor(n) % 2;
+ * }, Math);
+ * // => [[1.2, 3.4], [2.3]]
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36, 'active': false },
+ * { 'user': 'fred', 'age': 40, 'active': true },
+ * { 'user': 'pebbles', 'age': 1, 'active': false }
+ * ];
+ *
+ * var mapper = function(array) {
+ * return _.pluck(array, 'user');
+ * };
+ *
+ * // using the `_.matches` callback shorthand
+ * _.map(_.partition(users, { 'age': 1, 'active': false }), mapper);
+ * // => [['pebbles'], ['barney', 'fred']]
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.map(_.partition(users, 'active', false), mapper);
+ * // => [['barney', 'pebbles'], ['fred']]
+ *
+ * // using the `_.property` callback shorthand
+ * _.map(_.partition(users, 'active'), mapper);
+ * // => [['fred'], ['barney', 'pebbles']]
+ */
+ var partition = createAggregator(function(result, value, key) {
+ result[key ? 0 : 1].push(value);
+ }, function() { return [[], []]; });
+
+ /**
+ * Gets the property value of `path` from all elements in `collection`.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Array|string} path The path of the property to pluck.
+ * @returns {Array} Returns the property values.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36 },
+ * { 'user': 'fred', 'age': 40 }
+ * ];
+ *
+ * _.pluck(users, 'user');
+ * // => ['barney', 'fred']
+ *
+ * var userIndex = _.indexBy(users, 'user');
+ * _.pluck(userIndex, 'age');
+ * // => [36, 40] (iteration order is not guaranteed)
+ */
+ function pluck(collection, path) {
+ return map(collection, property(path));
+ }
+
+ /**
+ * Reduces `collection` to a value which is the accumulated result of running
+ * each element in `collection` through `iteratee`, where each successive
+ * invocation is supplied the return value of the previous. If `accumulator`
+ * is not provided the first element of `collection` is used as the initial
+ * value. The `iteratee` is bound to `thisArg` and invoked with four arguments:
+ * (accumulator, value, index|key, collection).
+ *
+ * Many lodash methods are guarded to work as iteratees for methods like
+ * `_.reduce`, `_.reduceRight`, and `_.transform`.
+ *
+ * The guarded methods are:
+ * `assign`, `defaults`, `includes`, `merge`, `sortByAll`, and `sortByOrder`
+ *
+ * @static
+ * @memberOf _
+ * @alias foldl, inject
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @param {*} [accumulator] The initial value.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {*} Returns the accumulated value.
+ * @example
+ *
+ * _.reduce([1, 2], function(total, n) {
+ * return total + n;
+ * });
+ * // => 3
+ *
+ * _.reduce({ 'a': 1, 'b': 2 }, function(result, n, key) {
+ * result[key] = n * 3;
+ * return result;
+ * }, {});
+ * // => { 'a': 3, 'b': 6 } (iteration order is not guaranteed)
+ */
+ var reduce = createReduce(arrayReduce, baseEach);
+
+ /**
+ * This method is like `_.reduce` except that it iterates over elements of
+ * `collection` from right to left.
+ *
+ * @static
+ * @memberOf _
+ * @alias foldr
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @param {*} [accumulator] The initial value.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {*} Returns the accumulated value.
+ * @example
+ *
+ * var array = [[0, 1], [2, 3], [4, 5]];
+ *
+ * _.reduceRight(array, function(flattened, other) {
+ * return flattened.concat(other);
+ * }, []);
+ * // => [4, 5, 2, 3, 0, 1]
+ */
+ var reduceRight = createReduce(arrayReduceRight, baseEachRight);
+
+ /**
+ * The opposite of `_.filter`; this method returns the elements of `collection`
+ * that `predicate` does **not** return truthy for.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {Array} Returns the new filtered array.
+ * @example
+ *
+ * _.reject([1, 2, 3, 4], function(n) {
+ * return n % 2 == 0;
+ * });
+ * // => [1, 3]
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36, 'active': false },
+ * { 'user': 'fred', 'age': 40, 'active': true }
+ * ];
+ *
+ * // using the `_.matches` callback shorthand
+ * _.pluck(_.reject(users, { 'age': 40, 'active': true }), 'user');
+ * // => ['barney']
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.pluck(_.reject(users, 'active', false), 'user');
+ * // => ['fred']
+ *
+ * // using the `_.property` callback shorthand
+ * _.pluck(_.reject(users, 'active'), 'user');
+ * // => ['barney']
+ */
+ function reject(collection, predicate, thisArg) {
+ var func = isArray(collection) ? arrayFilter : baseFilter;
+ predicate = getCallback(predicate, thisArg, 3);
+ return func(collection, function(value, index, collection) {
+ return !predicate(value, index, collection);
+ });
+ }
+
+ /**
+ * Gets a random element or `n` random elements from a collection.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to sample.
+ * @param {number} [n] The number of elements to sample.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {*} Returns the random sample(s).
+ * @example
+ *
+ * _.sample([1, 2, 3, 4]);
+ * // => 2
+ *
+ * _.sample([1, 2, 3, 4], 2);
+ * // => [3, 1]
+ */
+ function sample(collection, n, guard) {
+ if (guard ? isIterateeCall(collection, n, guard) : n == null) {
+ collection = toIterable(collection);
+ var length = collection.length;
+ return length > 0 ? collection[baseRandom(0, length - 1)] : undefined;
+ }
+ var index = -1,
+ result = toArray(collection),
+ length = result.length,
+ lastIndex = length - 1;
+
+ n = nativeMin(n < 0 ? 0 : (+n || 0), length);
+ while (++index < n) {
+ var rand = baseRandom(index, lastIndex),
+ value = result[rand];
+
+ result[rand] = result[index];
+ result[index] = value;
+ }
+ result.length = n;
+ return result;
+ }
+
+ /**
+ * Creates an array of shuffled values, using a version of the
+ * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to shuffle.
+ * @returns {Array} Returns the new shuffled array.
+ * @example
+ *
+ * _.shuffle([1, 2, 3, 4]);
+ * // => [4, 1, 3, 2]
+ */
+ function shuffle(collection) {
+ return sample(collection, POSITIVE_INFINITY);
+ }
+
+ /**
+ * Gets the size of `collection` by returning its length for array-like
+ * values or the number of own enumerable properties for objects.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to inspect.
+ * @returns {number} Returns the size of `collection`.
+ * @example
+ *
+ * _.size([1, 2, 3]);
+ * // => 3
+ *
+ * _.size({ 'a': 1, 'b': 2 });
+ * // => 2
+ *
+ * _.size('pebbles');
+ * // => 7
+ */
+ function size(collection) {
+ var length = collection ? getLength(collection) : 0;
+ return isLength(length) ? length : keys(collection).length;
+ }
+
+ /**
+ * Checks if `predicate` returns truthy for **any** element of `collection`.
+ * The function returns as soon as it finds a passing value and does not iterate
+ * over the entire collection. The predicate is bound to `thisArg` and invoked
+ * with three arguments: (value, index|key, collection).
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @alias any
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {boolean} Returns `true` if any element passes the predicate check,
+ * else `false`.
+ * @example
+ *
+ * _.some([null, 0, 'yes', false], Boolean);
+ * // => true
+ *
+ * var users = [
+ * { 'user': 'barney', 'active': true },
+ * { 'user': 'fred', 'active': false }
+ * ];
+ *
+ * // using the `_.matches` callback shorthand
+ * _.some(users, { 'user': 'barney', 'active': false });
+ * // => false
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.some(users, 'active', false);
+ * // => true
+ *
+ * // using the `_.property` callback shorthand
+ * _.some(users, 'active');
+ * // => true
+ */
+ function some(collection, predicate, thisArg) {
+ var func = isArray(collection) ? arraySome : baseSome;
+ if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
+ predicate = null;
+ }
+ if (typeof predicate != 'function' || thisArg !== undefined) {
+ predicate = getCallback(predicate, thisArg, 3);
+ }
+ return func(collection, predicate);
+ }
+
+ /**
+ * Creates an array of elements, sorted in ascending order by the results of
+ * running each element in a collection through `iteratee`. This method performs
+ * a stable sort, that is, it preserves the original sort order of equal elements.
+ * The `iteratee` is bound to `thisArg` and invoked with three arguments:
+ * (value, index|key, collection).
+ *
+ * If a property name is provided for `iteratee` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `iteratee` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Array} Returns the new sorted array.
+ * @example
+ *
+ * _.sortBy([1, 2, 3], function(n) {
+ * return Math.sin(n);
+ * });
+ * // => [3, 1, 2]
+ *
+ * _.sortBy([1, 2, 3], function(n) {
+ * return this.sin(n);
+ * }, Math);
+ * // => [3, 1, 2]
+ *
+ * var users = [
+ * { 'user': 'fred' },
+ * { 'user': 'pebbles' },
+ * { 'user': 'barney' }
+ * ];
+ *
+ * // using the `_.property` callback shorthand
+ * _.pluck(_.sortBy(users, 'user'), 'user');
+ * // => ['barney', 'fred', 'pebbles']
+ */
+ function sortBy(collection, iteratee, thisArg) {
+ if (collection == null) {
+ return [];
+ }
+ if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
+ iteratee = null;
+ }
+ var index = -1;
+ iteratee = getCallback(iteratee, thisArg, 3);
+
+ var result = baseMap(collection, function(value, key, collection) {
+ return { 'criteria': iteratee(value, key, collection), 'index': ++index, 'value': value };
+ });
+ return baseSortBy(result, compareAscending);
+ }
+
+ /**
+ * This method is like `_.sortBy` except that it can sort by multiple iteratees
+ * or property names.
+ *
+ * If a property name is provided for an iteratee the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If an object is provided for an iteratee the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {...(Function|Function[]|Object|Object[]|string|string[])} iteratees
+ * The iteratees to sort by, specified as individual values or arrays of values.
+ * @returns {Array} Returns the new sorted array.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'fred', 'age': 48 },
+ * { 'user': 'barney', 'age': 36 },
+ * { 'user': 'fred', 'age': 42 },
+ * { 'user': 'barney', 'age': 34 }
+ * ];
+ *
+ * _.map(_.sortByAll(users, ['user', 'age']), _.values);
+ * // => [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]]
+ *
+ * _.map(_.sortByAll(users, 'user', function(chr) {
+ * return Math.floor(chr.age / 10);
+ * }), _.values);
+ * // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]
+ */
+ var sortByAll = restParam(function(collection, iteratees) {
+ if (collection == null) {
+ return [];
+ }
+ var guard = iteratees[2];
+ if (guard && isIterateeCall(iteratees[0], iteratees[1], guard)) {
+ iteratees.length = 1;
+ }
+ return baseSortByOrder(collection, baseFlatten(iteratees), []);
+ });
+
+ /**
+ * This method is like `_.sortByAll` except that it allows specifying the
+ * sort orders of the iteratees to sort by. A truthy value in `orders` will
+ * sort the corresponding property name in ascending order while a falsey
+ * value will sort it in descending order.
+ *
+ * If a property name is provided for an iteratee the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If an object is provided for an iteratee the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
+ * @param {boolean[]} orders The sort orders of `iteratees`.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`.
+ * @returns {Array} Returns the new sorted array.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'fred', 'age': 48 },
+ * { 'user': 'barney', 'age': 34 },
+ * { 'user': 'fred', 'age': 42 },
+ * { 'user': 'barney', 'age': 36 }
+ * ];
+ *
+ * // sort by `user` in ascending order and by `age` in descending order
+ * _.map(_.sortByOrder(users, ['user', 'age'], [true, false]), _.values);
+ * // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]
+ */
+ function sortByOrder(collection, iteratees, orders, guard) {
+ if (collection == null) {
+ return [];
+ }
+ if (guard && isIterateeCall(iteratees, orders, guard)) {
+ orders = null;
+ }
+ if (!isArray(iteratees)) {
+ iteratees = iteratees == null ? [] : [iteratees];
+ }
+ if (!isArray(orders)) {
+ orders = orders == null ? [] : [orders];
+ }
+ return baseSortByOrder(collection, iteratees, orders);
+ }
+
+ /**
+ * Performs a deep comparison between each element in `collection` and the
+ * source object, returning an array of all elements that have equivalent
+ * property values.
+ *
+ * **Note:** This method supports comparing arrays, booleans, `Date` objects,
+ * numbers, `Object` objects, regexes, and strings. Objects are compared by
+ * their own, not inherited, enumerable properties. For comparing a single
+ * own or inherited property value see `_.matchesProperty`.
+ *
+ * @static
+ * @memberOf _
+ * @category Collection
+ * @param {Array|Object|string} collection The collection to search.
+ * @param {Object} source The object of property values to match.
+ * @returns {Array} Returns the new filtered array.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36, 'active': false, 'pets': ['hoppy'] },
+ * { 'user': 'fred', 'age': 40, 'active': true, 'pets': ['baby puss', 'dino'] }
+ * ];
+ *
+ * _.pluck(_.where(users, { 'age': 36, 'active': false }), 'user');
+ * // => ['barney']
+ *
+ * _.pluck(_.where(users, { 'pets': ['dino'] }), 'user');
+ * // => ['fred']
+ */
+ function where(collection, source) {
+ return filter(collection, baseMatches(source));
+ }
+
+ /*------------------------------------------------------------------------*/
+
+ /**
+ * Gets the number of milliseconds that have elapsed since the Unix epoch
+ * (1 January 1970 00:00:00 UTC).
+ *
+ * @static
+ * @memberOf _
+ * @category Date
+ * @example
+ *
+ * _.defer(function(stamp) {
+ * console.log(_.now() - stamp);
+ * }, _.now());
+ * // => logs the number of milliseconds it took for the deferred function to be invoked
+ */
+ var now = nativeNow || function() {
+ return new Date().getTime();
+ };
+
+ /*------------------------------------------------------------------------*/
+
+ /**
+ * The opposite of `_.before`; this method creates a function that invokes
+ * `func` once it is called `n` or more times.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {number} n The number of calls before `func` is invoked.
+ * @param {Function} func The function to restrict.
+ * @returns {Function} Returns the new restricted function.
+ * @example
+ *
+ * var saves = ['profile', 'settings'];
+ *
+ * var done = _.after(saves.length, function() {
+ * console.log('done saving!');
+ * });
+ *
+ * _.forEach(saves, function(type) {
+ * asyncSave({ 'type': type, 'complete': done });
+ * });
+ * // => logs 'done saving!' after the two async saves have completed
+ */
+ function after(n, func) {
+ if (typeof func != 'function') {
+ if (typeof n == 'function') {
+ var temp = n;
+ n = func;
+ func = temp;
+ } else {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ }
+ n = nativeIsFinite(n = +n) ? n : 0;
+ return function() {
+ if (--n < 1) {
+ return func.apply(this, arguments);
+ }
+ };
+ }
+
+ /**
+ * Creates a function that accepts up to `n` arguments ignoring any
+ * additional arguments.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to cap arguments for.
+ * @param {number} [n=func.length] The arity cap.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * _.map(['6', '8', '10'], _.ary(parseInt, 1));
+ * // => [6, 8, 10]
+ */
+ function ary(func, n, guard) {
+ if (guard && isIterateeCall(func, n, guard)) {
+ n = null;
+ }
+ n = (func && n == null) ? func.length : nativeMax(+n || 0, 0);
+ return createWrapper(func, ARY_FLAG, null, null, null, null, n);
+ }
+
+ /**
+ * Creates a function that invokes `func`, with the `this` binding and arguments
+ * of the created function, while it is called less than `n` times. Subsequent
+ * calls to the created function return the result of the last `func` invocation.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {number} n The number of calls at which `func` is no longer invoked.
+ * @param {Function} func The function to restrict.
+ * @returns {Function} Returns the new restricted function.
+ * @example
+ *
+ * jQuery('#add').on('click', _.before(5, addContactToList));
+ * // => allows adding up to 4 contacts to the list
+ */
+ function before(n, func) {
+ var result;
+ if (typeof func != 'function') {
+ if (typeof n == 'function') {
+ var temp = n;
+ n = func;
+ func = temp;
+ } else {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ }
+ return function() {
+ if (--n > 0) {
+ result = func.apply(this, arguments);
+ }
+ if (n <= 1) {
+ func = null;
+ }
+ return result;
+ };
+ }
+
+ /**
+ * Creates a function that invokes `func` with the `this` binding of `thisArg`
+ * and prepends any additional `_.bind` arguments to those provided to the
+ * bound function.
+ *
+ * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
+ * may be used as a placeholder for partially applied arguments.
+ *
+ * **Note:** Unlike native `Function#bind` this method does not set the "length"
+ * property of bound functions.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to bind.
+ * @param {*} thisArg The `this` binding of `func`.
+ * @param {...*} [partials] The arguments to be partially applied.
+ * @returns {Function} Returns the new bound function.
+ * @example
+ *
+ * var greet = function(greeting, punctuation) {
+ * return greeting + ' ' + this.user + punctuation;
+ * };
+ *
+ * var object = { 'user': 'fred' };
+ *
+ * var bound = _.bind(greet, object, 'hi');
+ * bound('!');
+ * // => 'hi fred!'
+ *
+ * // using placeholders
+ * var bound = _.bind(greet, object, _, '!');
+ * bound('hi');
+ * // => 'hi fred!'
+ */
+ var bind = restParam(function(func, thisArg, partials) {
+ var bitmask = BIND_FLAG;
+ if (partials.length) {
+ var holders = replaceHolders(partials, bind.placeholder);
+ bitmask |= PARTIAL_FLAG;
+ }
+ return createWrapper(func, bitmask, thisArg, partials, holders);
+ });
+
+ /**
+ * Binds methods of an object to the object itself, overwriting the existing
+ * method. Method names may be specified as individual arguments or as arrays
+ * of method names. If no method names are provided all enumerable function
+ * properties, own and inherited, of `object` are bound.
+ *
+ * **Note:** This method does not set the "length" property of bound functions.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Object} object The object to bind and assign the bound methods to.
+ * @param {...(string|string[])} [methodNames] The object method names to bind,
+ * specified as individual method names or arrays of method names.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * var view = {
+ * 'label': 'docs',
+ * 'onClick': function() {
+ * console.log('clicked ' + this.label);
+ * }
+ * };
+ *
+ * _.bindAll(view);
+ * jQuery('#docs').on('click', view.onClick);
+ * // => logs 'clicked docs' when the element is clicked
+ */
+ var bindAll = restParam(function(object, methodNames) {
+ methodNames = methodNames.length ? baseFlatten(methodNames) : functions(object);
+
+ var index = -1,
+ length = methodNames.length;
+
+ while (++index < length) {
+ var key = methodNames[index];
+ object[key] = createWrapper(object[key], BIND_FLAG, object);
+ }
+ return object;
+ });
+
+ /**
+ * Creates a function that invokes the method at `object[key]` and prepends
+ * any additional `_.bindKey` arguments to those provided to the bound function.
+ *
+ * This method differs from `_.bind` by allowing bound functions to reference
+ * methods that may be redefined or don't yet exist.
+ * See [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
+ * for more details.
+ *
+ * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
+ * builds, may be used as a placeholder for partially applied arguments.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Object} object The object the method belongs to.
+ * @param {string} key The key of the method.
+ * @param {...*} [partials] The arguments to be partially applied.
+ * @returns {Function} Returns the new bound function.
+ * @example
+ *
+ * var object = {
+ * 'user': 'fred',
+ * 'greet': function(greeting, punctuation) {
+ * return greeting + ' ' + this.user + punctuation;
+ * }
+ * };
+ *
+ * var bound = _.bindKey(object, 'greet', 'hi');
+ * bound('!');
+ * // => 'hi fred!'
+ *
+ * object.greet = function(greeting, punctuation) {
+ * return greeting + 'ya ' + this.user + punctuation;
+ * };
+ *
+ * bound('!');
+ * // => 'hiya fred!'
+ *
+ * // using placeholders
+ * var bound = _.bindKey(object, 'greet', _, '!');
+ * bound('hi');
+ * // => 'hiya fred!'
+ */
+ var bindKey = restParam(function(object, key, partials) {
+ var bitmask = BIND_FLAG | BIND_KEY_FLAG;
+ if (partials.length) {
+ var holders = replaceHolders(partials, bindKey.placeholder);
+ bitmask |= PARTIAL_FLAG;
+ }
+ return createWrapper(key, bitmask, object, partials, holders);
+ });
+
+ /**
+ * Creates a function that accepts one or more arguments of `func` that when
+ * called either invokes `func` returning its result, if all `func` arguments
+ * have been provided, or returns a function that accepts one or more of the
+ * remaining `func` arguments, and so on. The arity of `func` may be specified
+ * if `func.length` is not sufficient.
+ *
+ * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
+ * may be used as a placeholder for provided arguments.
+ *
+ * **Note:** This method does not set the "length" property of curried functions.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to curry.
+ * @param {number} [arity=func.length] The arity of `func`.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {Function} Returns the new curried function.
+ * @example
+ *
+ * var abc = function(a, b, c) {
+ * return [a, b, c];
+ * };
+ *
+ * var curried = _.curry(abc);
+ *
+ * curried(1)(2)(3);
+ * // => [1, 2, 3]
+ *
+ * curried(1, 2)(3);
+ * // => [1, 2, 3]
+ *
+ * curried(1, 2, 3);
+ * // => [1, 2, 3]
+ *
+ * // using placeholders
+ * curried(1)(_, 3)(2);
+ * // => [1, 2, 3]
+ */
+ var curry = createCurry(CURRY_FLAG);
+
+ /**
+ * This method is like `_.curry` except that arguments are applied to `func`
+ * in the manner of `_.partialRight` instead of `_.partial`.
+ *
+ * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
+ * builds, may be used as a placeholder for provided arguments.
+ *
+ * **Note:** This method does not set the "length" property of curried functions.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to curry.
+ * @param {number} [arity=func.length] The arity of `func`.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {Function} Returns the new curried function.
+ * @example
+ *
+ * var abc = function(a, b, c) {
+ * return [a, b, c];
+ * };
+ *
+ * var curried = _.curryRight(abc);
+ *
+ * curried(3)(2)(1);
+ * // => [1, 2, 3]
+ *
+ * curried(2, 3)(1);
+ * // => [1, 2, 3]
+ *
+ * curried(1, 2, 3);
+ * // => [1, 2, 3]
+ *
+ * // using placeholders
+ * curried(3)(1, _)(2);
+ * // => [1, 2, 3]
+ */
+ var curryRight = createCurry(CURRY_RIGHT_FLAG);
+
+ /**
+ * Creates a debounced function that delays invoking `func` until after `wait`
+ * milliseconds have elapsed since the last time the debounced function was
+ * invoked. The debounced function comes with a `cancel` method to cancel
+ * delayed invocations. Provide an options object to indicate that `func`
+ * should be invoked on the leading and/or trailing edge of the `wait` timeout.
+ * Subsequent calls to the debounced function return the result of the last
+ * `func` invocation.
+ *
+ * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
+ * on the trailing edge of the timeout only if the the debounced function is
+ * invoked more than once during the `wait` timeout.
+ *
+ * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
+ * for details over the differences between `_.debounce` and `_.throttle`.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to debounce.
+ * @param {number} [wait=0] The number of milliseconds to delay.
+ * @param {Object} [options] The options object.
+ * @param {boolean} [options.leading=false] Specify invoking on the leading
+ * edge of the timeout.
+ * @param {number} [options.maxWait] The maximum time `func` is allowed to be
+ * delayed before it is invoked.
+ * @param {boolean} [options.trailing=true] Specify invoking on the trailing
+ * edge of the timeout.
+ * @returns {Function} Returns the new debounced function.
+ * @example
+ *
+ * // avoid costly calculations while the window size is in flux
+ * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
+ *
+ * // invoke `sendMail` when the click event is fired, debouncing subsequent calls
+ * jQuery('#postbox').on('click', _.debounce(sendMail, 300, {
+ * 'leading': true,
+ * 'trailing': false
+ * }));
+ *
+ * // ensure `batchLog` is invoked once after 1 second of debounced calls
+ * var source = new EventSource('/stream');
+ * jQuery(source).on('message', _.debounce(batchLog, 250, {
+ * 'maxWait': 1000
+ * }));
+ *
+ * // cancel a debounced call
+ * var todoChanges = _.debounce(batchLog, 1000);
+ * Object.observe(models.todo, todoChanges);
+ *
+ * Object.observe(models, function(changes) {
+ * if (_.find(changes, { 'user': 'todo', 'type': 'delete'})) {
+ * todoChanges.cancel();
+ * }
+ * }, ['delete']);
+ *
+ * // ...at some point `models.todo` is changed
+ * models.todo.completed = true;
+ *
+ * // ...before 1 second has passed `models.todo` is deleted
+ * // which cancels the debounced `todoChanges` call
+ * delete models.todo;
+ */
+ function debounce(func, wait, options) {
+ var args,
+ maxTimeoutId,
+ result,
+ stamp,
+ thisArg,
+ timeoutId,
+ trailingCall,
+ lastCalled = 0,
+ maxWait = false,
+ trailing = true;
+
+ if (typeof func != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ wait = wait < 0 ? 0 : (+wait || 0);
+ if (options === true) {
+ var leading = true;
+ trailing = false;
+ } else if (isObject(options)) {
+ leading = options.leading;
+ maxWait = 'maxWait' in options && nativeMax(+options.maxWait || 0, wait);
+ trailing = 'trailing' in options ? options.trailing : trailing;
+ }
+
+ function cancel() {
+ if (timeoutId) {
+ clearTimeout(timeoutId);
+ }
+ if (maxTimeoutId) {
+ clearTimeout(maxTimeoutId);
+ }
+ maxTimeoutId = timeoutId = trailingCall = undefined;
+ }
+
+ function delayed() {
+ var remaining = wait - (now() - stamp);
+ if (remaining <= 0 || remaining > wait) {
+ if (maxTimeoutId) {
+ clearTimeout(maxTimeoutId);
+ }
+ var isCalled = trailingCall;
+ maxTimeoutId = timeoutId = trailingCall = undefined;
+ if (isCalled) {
+ lastCalled = now();
+ result = func.apply(thisArg, args);
+ if (!timeoutId && !maxTimeoutId) {
+ args = thisArg = null;
+ }
+ }
+ } else {
+ timeoutId = setTimeout(delayed, remaining);
+ }
+ }
+
+ function maxDelayed() {
+ if (timeoutId) {
+ clearTimeout(timeoutId);
+ }
+ maxTimeoutId = timeoutId = trailingCall = undefined;
+ if (trailing || (maxWait !== wait)) {
+ lastCalled = now();
+ result = func.apply(thisArg, args);
+ if (!timeoutId && !maxTimeoutId) {
+ args = thisArg = null;
+ }
+ }
+ }
+
+ function debounced() {
+ args = arguments;
+ stamp = now();
+ thisArg = this;
+ trailingCall = trailing && (timeoutId || !leading);
+
+ if (maxWait === false) {
+ var leadingCall = leading && !timeoutId;
+ } else {
+ if (!maxTimeoutId && !leading) {
+ lastCalled = stamp;
+ }
+ var remaining = maxWait - (stamp - lastCalled),
+ isCalled = remaining <= 0 || remaining > maxWait;
+
+ if (isCalled) {
+ if (maxTimeoutId) {
+ maxTimeoutId = clearTimeout(maxTimeoutId);
+ }
+ lastCalled = stamp;
+ result = func.apply(thisArg, args);
+ }
+ else if (!maxTimeoutId) {
+ maxTimeoutId = setTimeout(maxDelayed, remaining);
+ }
+ }
+ if (isCalled && timeoutId) {
+ timeoutId = clearTimeout(timeoutId);
+ }
+ else if (!timeoutId && wait !== maxWait) {
+ timeoutId = setTimeout(delayed, wait);
+ }
+ if (leadingCall) {
+ isCalled = true;
+ result = func.apply(thisArg, args);
+ }
+ if (isCalled && !timeoutId && !maxTimeoutId) {
+ args = thisArg = null;
+ }
+ return result;
+ }
+ debounced.cancel = cancel;
+ return debounced;
+ }
+
+ /**
+ * Defers invoking the `func` until the current call stack has cleared. Any
+ * additional arguments are provided to `func` when it is invoked.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to defer.
+ * @param {...*} [args] The arguments to invoke the function with.
+ * @returns {number} Returns the timer id.
+ * @example
+ *
+ * _.defer(function(text) {
+ * console.log(text);
+ * }, 'deferred');
+ * // logs 'deferred' after one or more milliseconds
+ */
+ var defer = restParam(function(func, args) {
+ return baseDelay(func, 1, args);
+ });
+
+ /**
+ * Invokes `func` after `wait` milliseconds. Any additional arguments are
+ * provided to `func` when it is invoked.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to delay.
+ * @param {number} wait The number of milliseconds to delay invocation.
+ * @param {...*} [args] The arguments to invoke the function with.
+ * @returns {number} Returns the timer id.
+ * @example
+ *
+ * _.delay(function(text) {
+ * console.log(text);
+ * }, 1000, 'later');
+ * // => logs 'later' after one second
+ */
+ var delay = restParam(function(func, wait, args) {
+ return baseDelay(func, wait, args);
+ });
+
+ /**
+ * Creates a function that returns the result of invoking the provided
+ * functions with the `this` binding of the created function, where each
+ * successive invocation is supplied the return value of the previous.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {...Function} [funcs] Functions to invoke.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * function square(n) {
+ * return n * n;
+ * }
+ *
+ * var addSquare = _.flow(_.add, square);
+ * addSquare(1, 2);
+ * // => 9
+ */
+ var flow = createFlow();
+
+ /**
+ * This method is like `_.flow` except that it creates a function that
+ * invokes the provided functions from right to left.
+ *
+ * @static
+ * @memberOf _
+ * @alias backflow, compose
+ * @category Function
+ * @param {...Function} [funcs] Functions to invoke.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * function square(n) {
+ * return n * n;
+ * }
+ *
+ * var addSquare = _.flowRight(square, _.add);
+ * addSquare(1, 2);
+ * // => 9
+ */
+ var flowRight = createFlow(true);
+
+ /**
+ * Creates a function that memoizes the result of `func`. If `resolver` is
+ * provided it determines the cache key for storing the result based on the
+ * arguments provided to the memoized function. By default, the first argument
+ * provided to the memoized function is coerced to a string and used as the
+ * cache key. The `func` is invoked with the `this` binding of the memoized
+ * function.
+ *
+ * **Note:** The cache is exposed as the `cache` property on the memoized
+ * function. Its creation may be customized by replacing the `_.memoize.Cache`
+ * constructor with one whose instances implement the [`Map`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-properties-of-the-map-prototype-object)
+ * method interface of `get`, `has`, and `set`.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to have its output memoized.
+ * @param {Function} [resolver] The function to resolve the cache key.
+ * @returns {Function} Returns the new memoizing function.
+ * @example
+ *
+ * var upperCase = _.memoize(function(string) {
+ * return string.toUpperCase();
+ * });
+ *
+ * upperCase('fred');
+ * // => 'FRED'
+ *
+ * // modifying the result cache
+ * upperCase.cache.set('fred', 'BARNEY');
+ * upperCase('fred');
+ * // => 'BARNEY'
+ *
+ * // replacing `_.memoize.Cache`
+ * var object = { 'user': 'fred' };
+ * var other = { 'user': 'barney' };
+ * var identity = _.memoize(_.identity);
+ *
+ * identity(object);
+ * // => { 'user': 'fred' }
+ * identity(other);
+ * // => { 'user': 'fred' }
+ *
+ * _.memoize.Cache = WeakMap;
+ * var identity = _.memoize(_.identity);
+ *
+ * identity(object);
+ * // => { 'user': 'fred' }
+ * identity(other);
+ * // => { 'user': 'barney' }
+ */
+ function memoize(func, resolver) {
+ if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ var memoized = function() {
+ var args = arguments,
+ key = resolver ? resolver.apply(this, args) : args[0],
+ cache = memoized.cache;
+
+ if (cache.has(key)) {
+ return cache.get(key);
+ }
+ var result = func.apply(this, args);
+ memoized.cache = cache.set(key, result);
+ return result;
+ };
+ memoized.cache = new memoize.Cache;
+ return memoized;
+ }
+
+ /**
+ * Creates a function that negates the result of the predicate `func`. The
+ * `func` predicate is invoked with the `this` binding and arguments of the
+ * created function.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} predicate The predicate to negate.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * function isEven(n) {
+ * return n % 2 == 0;
+ * }
+ *
+ * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
+ * // => [1, 3, 5]
+ */
+ function negate(predicate) {
+ if (typeof predicate != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ return function() {
+ return !predicate.apply(this, arguments);
+ };
+ }
+
+ /**
+ * Creates a function that is restricted to invoking `func` once. Repeat calls
+ * to the function return the value of the first call. The `func` is invoked
+ * with the `this` binding and arguments of the created function.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to restrict.
+ * @returns {Function} Returns the new restricted function.
+ * @example
+ *
+ * var initialize = _.once(createApplication);
+ * initialize();
+ * initialize();
+ * // `initialize` invokes `createApplication` once
+ */
+ function once(func) {
+ return before(2, func);
+ }
+
+ /**
+ * Creates a function that invokes `func` with `partial` arguments prepended
+ * to those provided to the new function. This method is like `_.bind` except
+ * it does **not** alter the `this` binding.
+ *
+ * The `_.partial.placeholder` value, which defaults to `_` in monolithic
+ * builds, may be used as a placeholder for partially applied arguments.
+ *
+ * **Note:** This method does not set the "length" property of partially
+ * applied functions.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to partially apply arguments to.
+ * @param {...*} [partials] The arguments to be partially applied.
+ * @returns {Function} Returns the new partially applied function.
+ * @example
+ *
+ * var greet = function(greeting, name) {
+ * return greeting + ' ' + name;
+ * };
+ *
+ * var sayHelloTo = _.partial(greet, 'hello');
+ * sayHelloTo('fred');
+ * // => 'hello fred'
+ *
+ * // using placeholders
+ * var greetFred = _.partial(greet, _, 'fred');
+ * greetFred('hi');
+ * // => 'hi fred'
+ */
+ var partial = createPartial(PARTIAL_FLAG);
+
+ /**
+ * This method is like `_.partial` except that partially applied arguments
+ * are appended to those provided to the new function.
+ *
+ * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
+ * builds, may be used as a placeholder for partially applied arguments.
+ *
+ * **Note:** This method does not set the "length" property of partially
+ * applied functions.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to partially apply arguments to.
+ * @param {...*} [partials] The arguments to be partially applied.
+ * @returns {Function} Returns the new partially applied function.
+ * @example
+ *
+ * var greet = function(greeting, name) {
+ * return greeting + ' ' + name;
+ * };
+ *
+ * var greetFred = _.partialRight(greet, 'fred');
+ * greetFred('hi');
+ * // => 'hi fred'
+ *
+ * // using placeholders
+ * var sayHelloTo = _.partialRight(greet, 'hello', _);
+ * sayHelloTo('fred');
+ * // => 'hello fred'
+ */
+ var partialRight = createPartial(PARTIAL_RIGHT_FLAG);
+
+ /**
+ * Creates a function that invokes `func` with arguments arranged according
+ * to the specified indexes where the argument value at the first index is
+ * provided as the first argument, the argument value at the second index is
+ * provided as the second argument, and so on.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to rearrange arguments for.
+ * @param {...(number|number[])} indexes The arranged argument indexes,
+ * specified as individual indexes or arrays of indexes.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var rearged = _.rearg(function(a, b, c) {
+ * return [a, b, c];
+ * }, 2, 0, 1);
+ *
+ * rearged('b', 'c', 'a')
+ * // => ['a', 'b', 'c']
+ *
+ * var map = _.rearg(_.map, [1, 0]);
+ * map(function(n) {
+ * return n * 3;
+ * }, [1, 2, 3]);
+ * // => [3, 6, 9]
+ */
+ var rearg = restParam(function(func, indexes) {
+ return createWrapper(func, REARG_FLAG, null, null, null, baseFlatten(indexes));
+ });
+
+ /**
+ * Creates a function that invokes `func` with the `this` binding of the
+ * created function and arguments from `start` and beyond provided as an array.
+ *
+ * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters).
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to apply a rest parameter to.
+ * @param {number} [start=func.length-1] The start position of the rest parameter.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var say = _.restParam(function(what, names) {
+ * return what + ' ' + _.initial(names).join(', ') +
+ * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
+ * });
+ *
+ * say('hello', 'fred', 'barney', 'pebbles');
+ * // => 'hello fred, barney, & pebbles'
+ */
+ function restParam(func, start) {
+ if (typeof func != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0);
+ return function() {
+ var args = arguments,
+ index = -1,
+ length = nativeMax(args.length - start, 0),
+ rest = Array(length);
+
+ while (++index < length) {
+ rest[index] = args[start + index];
+ }
+ switch (start) {
+ case 0: return func.call(this, rest);
+ case 1: return func.call(this, args[0], rest);
+ case 2: return func.call(this, args[0], args[1], rest);
+ }
+ var otherArgs = Array(start + 1);
+ index = -1;
+ while (++index < start) {
+ otherArgs[index] = args[index];
+ }
+ otherArgs[start] = rest;
+ return func.apply(this, otherArgs);
+ };
+ }
+
+ /**
+ * Creates a function that invokes `func` with the `this` binding of the created
+ * function and an array of arguments much like [`Function#apply`](https://es5.github.io/#x15.3.4.3).
+ *
+ * **Note:** This method is based on the [spread operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator).
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to spread arguments over.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var say = _.spread(function(who, what) {
+ * return who + ' says ' + what;
+ * });
+ *
+ * say(['fred', 'hello']);
+ * // => 'fred says hello'
+ *
+ * // with a Promise
+ * var numbers = Promise.all([
+ * Promise.resolve(40),
+ * Promise.resolve(36)
+ * ]);
+ *
+ * numbers.then(_.spread(function(x, y) {
+ * return x + y;
+ * }));
+ * // => a Promise of 76
+ */
+ function spread(func) {
+ if (typeof func != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ return function(array) {
+ return func.apply(this, array);
+ };
+ }
+
+ /**
+ * Creates a throttled function that only invokes `func` at most once per
+ * every `wait` milliseconds. The throttled function comes with a `cancel`
+ * method to cancel delayed invocations. Provide an options object to indicate
+ * that `func` should be invoked on the leading and/or trailing edge of the
+ * `wait` timeout. Subsequent calls to the throttled function return the
+ * result of the last `func` call.
+ *
+ * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
+ * on the trailing edge of the timeout only if the the throttled function is
+ * invoked more than once during the `wait` timeout.
+ *
+ * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
+ * for details over the differences between `_.throttle` and `_.debounce`.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {Function} func The function to throttle.
+ * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
+ * @param {Object} [options] The options object.
+ * @param {boolean} [options.leading=true] Specify invoking on the leading
+ * edge of the timeout.
+ * @param {boolean} [options.trailing=true] Specify invoking on the trailing
+ * edge of the timeout.
+ * @returns {Function} Returns the new throttled function.
+ * @example
+ *
+ * // avoid excessively updating the position while scrolling
+ * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
+ *
+ * // invoke `renewToken` when the click event is fired, but not more than once every 5 minutes
+ * jQuery('.interactive').on('click', _.throttle(renewToken, 300000, {
+ * 'trailing': false
+ * }));
+ *
+ * // cancel a trailing throttled call
+ * jQuery(window).on('popstate', throttled.cancel);
+ */
+ function throttle(func, wait, options) {
+ var leading = true,
+ trailing = true;
+
+ if (typeof func != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ if (options === false) {
+ leading = false;
+ } else if (isObject(options)) {
+ leading = 'leading' in options ? !!options.leading : leading;
+ trailing = 'trailing' in options ? !!options.trailing : trailing;
+ }
+ debounceOptions.leading = leading;
+ debounceOptions.maxWait = +wait;
+ debounceOptions.trailing = trailing;
+ return debounce(func, wait, debounceOptions);
+ }
+
+ /**
+ * Creates a function that provides `value` to the wrapper function as its
+ * first argument. Any additional arguments provided to the function are
+ * appended to those provided to the wrapper function. The wrapper is invoked
+ * with the `this` binding of the created function.
+ *
+ * @static
+ * @memberOf _
+ * @category Function
+ * @param {*} value The value to wrap.
+ * @param {Function} wrapper The wrapper function.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var p = _.wrap(_.escape, function(func, text) {
+ * return '<p>' + func(text) + '</p>';
+ * });
+ *
+ * p('fred, barney, & pebbles');
+ * // => '<p>fred, barney, &amp; pebbles</p>'
+ */
+ function wrap(value, wrapper) {
+ wrapper = wrapper == null ? identity : wrapper;
+ return createWrapper(wrapper, PARTIAL_FLAG, null, [value], []);
+ }
+
+ /*------------------------------------------------------------------------*/
+
+ /**
+ * Creates a clone of `value`. If `isDeep` is `true` nested objects are cloned,
+ * otherwise they are assigned by reference. If `customizer` is provided it is
+ * invoked to produce the cloned values. If `customizer` returns `undefined`
+ * cloning is handled by the method instead. The `customizer` is bound to
+ * `thisArg` and invoked with two argument; (value [, index|key, object]).
+ *
+ * **Note:** This method is loosely based on the
+ * [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm).
+ * The enumerable properties of `arguments` objects and objects created by
+ * constructors other than `Object` are cloned to plain `Object` objects. An
+ * empty object is returned for uncloneable values such as functions, DOM nodes,
+ * Maps, Sets, and WeakMaps.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to clone.
+ * @param {boolean} [isDeep] Specify a deep clone.
+ * @param {Function} [customizer] The function to customize cloning values.
+ * @param {*} [thisArg] The `this` binding of `customizer`.
+ * @returns {*} Returns the cloned value.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney' },
+ * { 'user': 'fred' }
+ * ];
+ *
+ * var shallow = _.clone(users);
+ * shallow[0] === users[0];
+ * // => true
+ *
+ * var deep = _.clone(users, true);
+ * deep[0] === users[0];
+ * // => false
+ *
+ * // using a customizer callback
+ * var el = _.clone(document.body, function(value) {
+ * if (_.isElement(value)) {
+ * return value.cloneNode(false);
+ * }
+ * });
+ *
+ * el === document.body
+ * // => false
+ * el.nodeName
+ * // => BODY
+ * el.childNodes.length;
+ * // => 0
+ */
+ function clone(value, isDeep, customizer, thisArg) {
+ if (isDeep && typeof isDeep != 'boolean' && isIterateeCall(value, isDeep, customizer)) {
+ isDeep = false;
+ }
+ else if (typeof isDeep == 'function') {
+ thisArg = customizer;
+ customizer = isDeep;
+ isDeep = false;
+ }
+ return typeof customizer == 'function'
+ ? baseClone(value, isDeep, bindCallback(customizer, thisArg, 1))
+ : baseClone(value, isDeep);
+ }
+
+ /**
+ * Creates a deep clone of `value`. If `customizer` is provided it is invoked
+ * to produce the cloned values. If `customizer` returns `undefined` cloning
+ * is handled by the method instead. The `customizer` is bound to `thisArg`
+ * and invoked with two argument; (value [, index|key, object]).
+ *
+ * **Note:** This method is loosely based on the
+ * [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm).
+ * The enumerable properties of `arguments` objects and objects created by
+ * constructors other than `Object` are cloned to plain `Object` objects. An
+ * empty object is returned for uncloneable values such as functions, DOM nodes,
+ * Maps, Sets, and WeakMaps.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to deep clone.
+ * @param {Function} [customizer] The function to customize cloning values.
+ * @param {*} [thisArg] The `this` binding of `customizer`.
+ * @returns {*} Returns the deep cloned value.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney' },
+ * { 'user': 'fred' }
+ * ];
+ *
+ * var deep = _.cloneDeep(users);
+ * deep[0] === users[0];
+ * // => false
+ *
+ * // using a customizer callback
+ * var el = _.cloneDeep(document.body, function(value) {
+ * if (_.isElement(value)) {
+ * return value.cloneNode(true);
+ * }
+ * });
+ *
+ * el === document.body
+ * // => false
+ * el.nodeName
+ * // => BODY
+ * el.childNodes.length;
+ * // => 20
+ */
+ function cloneDeep(value, customizer, thisArg) {
+ return typeof customizer == 'function'
+ ? baseClone(value, true, bindCallback(customizer, thisArg, 1))
+ : baseClone(value, true);
+ }
+
+ /**
+ * Checks if `value` is greater than `other`.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @returns {boolean} Returns `true` if `value` is greater than `other`, else `false`.
+ * @example
+ *
+ * _.gt(3, 1);
+ * // => true
+ *
+ * _.gt(3, 3);
+ * // => false
+ *
+ * _.gt(1, 3);
+ * // => false
+ */
+ function gt(value, other) {
+ return value > other;
+ }
+
+ /**
+ * Checks if `value` is greater than or equal to `other`.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @returns {boolean} Returns `true` if `value` is greater than or equal to `other`, else `false`.
+ * @example
+ *
+ * _.gte(3, 1);
+ * // => true
+ *
+ * _.gte(3, 3);
+ * // => true
+ *
+ * _.gte(1, 3);
+ * // => false
+ */
+ function gte(value, other) {
+ return value >= other;
+ }
+
+ /**
+ * Checks if `value` is classified as an `arguments` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isArguments(function() { return arguments; }());
+ * // => true
+ *
+ * _.isArguments([1, 2, 3]);
+ * // => false
+ */
+ function isArguments(value) {
+ return isObjectLike(value) && isArrayLike(value) && objToString.call(value) == argsTag;
+ }
+
+ /**
+ * Checks if `value` is classified as an `Array` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isArray([1, 2, 3]);
+ * // => true
+ *
+ * _.isArray(function() { return arguments; }());
+ * // => false
+ */
+ var isArray = nativeIsArray || function(value) {
+ return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;
+ };
+
+ /**
+ * Checks if `value` is classified as a boolean primitive or object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isBoolean(false);
+ * // => true
+ *
+ * _.isBoolean(null);
+ * // => false
+ */
+ function isBoolean(value) {
+ return value === true || value === false || (isObjectLike(value) && objToString.call(value) == boolTag);
+ }
+
+ /**
+ * Checks if `value` is classified as a `Date` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isDate(new Date);
+ * // => true
+ *
+ * _.isDate('Mon April 23 2012');
+ * // => false
+ */
+ function isDate(value) {
+ return isObjectLike(value) && objToString.call(value) == dateTag;
+ }
+
+ /**
+ * Checks if `value` is a DOM element.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
+ * @example
+ *
+ * _.isElement(document.body);
+ * // => true
+ *
+ * _.isElement('<body>');
+ * // => false
+ */
+ function isElement(value) {
+ return !!value && value.nodeType === 1 && isObjectLike(value) &&
+ (objToString.call(value).indexOf('Element') > -1);
+ }
+ // Fallback for environments without DOM support.
+ if (!support.dom) {
+ isElement = function(value) {
+ return !!value && value.nodeType === 1 && isObjectLike(value) && !isPlainObject(value);
+ };
+ }
+
+ /**
+ * Checks if `value` is empty. A value is considered empty unless it is an
+ * `arguments` object, array, string, or jQuery-like collection with a length
+ * greater than `0` or an object with own enumerable properties.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {Array|Object|string} value The value to inspect.
+ * @returns {boolean} Returns `true` if `value` is empty, else `false`.
+ * @example
+ *
+ * _.isEmpty(null);
+ * // => true
+ *
+ * _.isEmpty(true);
+ * // => true
+ *
+ * _.isEmpty(1);
+ * // => true
+ *
+ * _.isEmpty([1, 2, 3]);
+ * // => false
+ *
+ * _.isEmpty({ 'a': 1 });
+ * // => false
+ */
+ function isEmpty(value) {
+ if (value == null) {
+ return true;
+ }
+ if (isArrayLike(value) && (isArray(value) || isString(value) || isArguments(value) ||
+ (isObjectLike(value) && isFunction(value.splice)))) {
+ return !value.length;
+ }
+ return !keys(value).length;
+ }
+
+ /**
+ * Performs a deep comparison between two values to determine if they are
+ * equivalent. If `customizer` is provided it is invoked to compare values.
+ * If `customizer` returns `undefined` comparisons are handled by the method
+ * instead. The `customizer` is bound to `thisArg` and invoked with three
+ * arguments: (value, other [, index|key]).
+ *
+ * **Note:** This method supports comparing arrays, booleans, `Date` objects,
+ * numbers, `Object` objects, regexes, and strings. Objects are compared by
+ * their own, not inherited, enumerable properties. Functions and DOM nodes
+ * are **not** supported. Provide a customizer function to extend support
+ * for comparing other values.
+ *
+ * @static
+ * @memberOf _
+ * @alias eq
+ * @category Lang
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @param {Function} [customizer] The function to customize value comparisons.
+ * @param {*} [thisArg] The `this` binding of `customizer`.
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
+ * @example
+ *
+ * var object = { 'user': 'fred' };
+ * var other = { 'user': 'fred' };
+ *
+ * object == other;
+ * // => false
+ *
+ * _.isEqual(object, other);
+ * // => true
+ *
+ * // using a customizer callback
+ * var array = ['hello', 'goodbye'];
+ * var other = ['hi', 'goodbye'];
+ *
+ * _.isEqual(array, other, function(value, other) {
+ * if (_.every([value, other], RegExp.prototype.test, /^h(?:i|ello)$/)) {
+ * return true;
+ * }
+ * });
+ * // => true
+ */
+ function isEqual(value, other, customizer, thisArg) {
+ customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined;
+ var result = customizer ? customizer(value, other) : undefined;
+ return result === undefined ? baseIsEqual(value, other, customizer) : !!result;
+ }
+
+ /**
+ * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
+ * `SyntaxError`, `TypeError`, or `URIError` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
+ * @example
+ *
+ * _.isError(new Error);
+ * // => true
+ *
+ * _.isError(Error);
+ * // => false
+ */
+ function isError(value) {
+ return isObjectLike(value) && typeof value.message == 'string' && objToString.call(value) == errorTag;
+ }
+
+ /**
+ * Checks if `value` is a finite primitive number.
+ *
+ * **Note:** This method is based on [`Number.isFinite`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isfinite).
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
+ * @example
+ *
+ * _.isFinite(10);
+ * // => true
+ *
+ * _.isFinite('10');
+ * // => false
+ *
+ * _.isFinite(true);
+ * // => false
+ *
+ * _.isFinite(Object(10));
+ * // => false
+ *
+ * _.isFinite(Infinity);
+ * // => false
+ */
+ var isFinite = nativeNumIsFinite || function(value) {
+ return typeof value == 'number' && nativeIsFinite(value);
+ };
+
+ /**
+ * Checks if `value` is classified as a `Function` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isFunction(_);
+ * // => true
+ *
+ * _.isFunction(/abc/);
+ * // => false
+ */
+ var isFunction = !(baseIsFunction(/x/) || (Uint8Array && !baseIsFunction(Uint8Array))) ? baseIsFunction : function(value) {
+ // The use of `Object#toString` avoids issues with the `typeof` operator
+ // in older versions of Chrome and Safari which return 'function' for regexes
+ // and Safari 8 equivalents which return 'object' for typed array constructors.
+ return objToString.call(value) == funcTag;
+ };
+
+ /**
+ * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
+ * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
+ * @example
+ *
+ * _.isObject({});
+ * // => true
+ *
+ * _.isObject([1, 2, 3]);
+ * // => true
+ *
+ * _.isObject(1);
+ * // => false
+ */
+ function isObject(value) {
+ // Avoid a V8 JIT bug in Chrome 19-20.
+ // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
+ var type = typeof value;
+ return !!value && (type == 'object' || type == 'function');
+ }
+
+ /**
+ * Performs a deep comparison between `object` and `source` to determine if
+ * `object` contains equivalent property values. If `customizer` is provided
+ * it is invoked to compare values. If `customizer` returns `undefined`
+ * comparisons are handled by the method instead. The `customizer` is bound
+ * to `thisArg` and invoked with three arguments: (value, other, index|key).
+ *
+ * **Note:** This method supports comparing properties of arrays, booleans,
+ * `Date` objects, numbers, `Object` objects, regexes, and strings. Functions
+ * and DOM nodes are **not** supported. Provide a customizer function to extend
+ * support for comparing other values.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {Object} object The object to inspect.
+ * @param {Object} source The object of property values to match.
+ * @param {Function} [customizer] The function to customize value comparisons.
+ * @param {*} [thisArg] The `this` binding of `customizer`.
+ * @returns {boolean} Returns `true` if `object` is a match, else `false`.
+ * @example
+ *
+ * var object = { 'user': 'fred', 'age': 40 };
+ *
+ * _.isMatch(object, { 'age': 40 });
+ * // => true
+ *
+ * _.isMatch(object, { 'age': 36 });
+ * // => false
+ *
+ * // using a customizer callback
+ * var object = { 'greeting': 'hello' };
+ * var source = { 'greeting': 'hi' };
+ *
+ * _.isMatch(object, source, function(value, other) {
+ * return _.every([value, other], RegExp.prototype.test, /^h(?:i|ello)$/) || undefined;
+ * });
+ * // => true
+ */
+ function isMatch(object, source, customizer, thisArg) {
+ customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined;
+ return baseIsMatch(object, getMatchData(source), customizer);
+ }
+
+ /**
+ * Checks if `value` is `NaN`.
+ *
+ * **Note:** This method is not the same as [`isNaN`](https://es5.github.io/#x15.1.2.4)
+ * which returns `true` for `undefined` and other non-numeric values.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
+ * @example
+ *
+ * _.isNaN(NaN);
+ * // => true
+ *
+ * _.isNaN(new Number(NaN));
+ * // => true
+ *
+ * isNaN(undefined);
+ * // => true
+ *
+ * _.isNaN(undefined);
+ * // => false
+ */
+ function isNaN(value) {
+ // An `NaN` primitive is the only value that is not equal to itself.
+ // Perform the `toStringTag` check first to avoid errors with some host objects in IE.
+ return isNumber(value) && value != +value;
+ }
+
+ /**
+ * Checks if `value` is a native function.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a native function, else `false`.
+ * @example
+ *
+ * _.isNative(Array.prototype.push);
+ * // => true
+ *
+ * _.isNative(_);
+ * // => false
+ */
+ function isNative(value) {
+ if (value == null) {
+ return false;
+ }
+ if (objToString.call(value) == funcTag) {
+ return reIsNative.test(fnToString.call(value));
+ }
+ return isObjectLike(value) && reIsHostCtor.test(value);
+ }
+
+ /**
+ * Checks if `value` is `null`.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
+ * @example
+ *
+ * _.isNull(null);
+ * // => true
+ *
+ * _.isNull(void 0);
+ * // => false
+ */
+ function isNull(value) {
+ return value === null;
+ }
+
+ /**
+ * Checks if `value` is classified as a `Number` primitive or object.
+ *
+ * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified
+ * as numbers, use the `_.isFinite` method.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isNumber(8.4);
+ * // => true
+ *
+ * _.isNumber(NaN);
+ * // => true
+ *
+ * _.isNumber('8.4');
+ * // => false
+ */
+ function isNumber(value) {
+ return typeof value == 'number' || (isObjectLike(value) && objToString.call(value) == numberTag);
+ }
+
+ /**
+ * Checks if `value` is a plain object, that is, an object created by the
+ * `Object` constructor or one with a `[[Prototype]]` of `null`.
+ *
+ * **Note:** This method assumes objects created by the `Object` constructor
+ * have no inherited enumerable properties.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * }
+ *
+ * _.isPlainObject(new Foo);
+ * // => false
+ *
+ * _.isPlainObject([1, 2, 3]);
+ * // => false
+ *
+ * _.isPlainObject({ 'x': 0, 'y': 0 });
+ * // => true
+ *
+ * _.isPlainObject(Object.create(null));
+ * // => true
+ */
+ var isPlainObject = !getPrototypeOf ? shimIsPlainObject : function(value) {
+ if (!(value && objToString.call(value) == objectTag)) {
+ return false;
+ }
+ var valueOf = getNative(value, 'valueOf'),
+ objProto = valueOf && (objProto = getPrototypeOf(valueOf)) && getPrototypeOf(objProto);
+
+ return objProto
+ ? (value == objProto || getPrototypeOf(value) == objProto)
+ : shimIsPlainObject(value);
+ };
+
+ /**
+ * Checks if `value` is classified as a `RegExp` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isRegExp(/abc/);
+ * // => true
+ *
+ * _.isRegExp('/abc/');
+ * // => false
+ */
+ function isRegExp(value) {
+ return isObjectLike(value) && objToString.call(value) == regexpTag;
+ }
+
+ /**
+ * Checks if `value` is classified as a `String` primitive or object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isString('abc');
+ * // => true
+ *
+ * _.isString(1);
+ * // => false
+ */
+ function isString(value) {
+ return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag);
+ }
+
+ /**
+ * Checks if `value` is classified as a typed array.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isTypedArray(new Uint8Array);
+ * // => true
+ *
+ * _.isTypedArray([]);
+ * // => false
+ */
+ function isTypedArray(value) {
+ return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)];
+ }
+
+ /**
+ * Checks if `value` is `undefined`.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
+ * @example
+ *
+ * _.isUndefined(void 0);
+ * // => true
+ *
+ * _.isUndefined(null);
+ * // => false
+ */
+ function isUndefined(value) {
+ return value === undefined;
+ }
+
+ /**
+ * Checks if `value` is less than `other`.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @returns {boolean} Returns `true` if `value` is less than `other`, else `false`.
+ * @example
+ *
+ * _.lt(1, 3);
+ * // => true
+ *
+ * _.lt(3, 3);
+ * // => false
+ *
+ * _.lt(3, 1);
+ * // => false
+ */
+ function lt(value, other) {
+ return value < other;
+ }
+
+ /**
+ * Checks if `value` is less than or equal to `other`.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @returns {boolean} Returns `true` if `value` is less than or equal to `other`, else `false`.
+ * @example
+ *
+ * _.lte(1, 3);
+ * // => true
+ *
+ * _.lte(3, 3);
+ * // => true
+ *
+ * _.lte(3, 1);
+ * // => false
+ */
+ function lte(value, other) {
+ return value <= other;
+ }
+
+ /**
+ * Converts `value` to an array.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to convert.
+ * @returns {Array} Returns the converted array.
+ * @example
+ *
+ * (function() {
+ * return _.toArray(arguments).slice(1);
+ * }(1, 2, 3));
+ * // => [2, 3]
+ */
+ function toArray(value) {
+ var length = value ? getLength(value) : 0;
+ if (!isLength(length)) {
+ return values(value);
+ }
+ if (!length) {
+ return [];
+ }
+ return arrayCopy(value);
+ }
+
+ /**
+ * Converts `value` to a plain object flattening inherited enumerable
+ * properties of `value` to own properties of the plain object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to convert.
+ * @returns {Object} Returns the converted plain object.
+ * @example
+ *
+ * function Foo() {
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.assign({ 'a': 1 }, new Foo);
+ * // => { 'a': 1, 'b': 2 }
+ *
+ * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
+ * // => { 'a': 1, 'b': 2, 'c': 3 }
+ */
+ function toPlainObject(value) {
+ return baseCopy(value, keysIn(value));
+ }
+
+ /*------------------------------------------------------------------------*/
+
+ /**
+ * Assigns own enumerable properties of source object(s) to the destination
+ * object. Subsequent sources overwrite property assignments of previous sources.
+ * If `customizer` is provided it is invoked to produce the assigned values.
+ * The `customizer` is bound to `thisArg` and invoked with five arguments:
+ * (objectValue, sourceValue, key, object, source).
+ *
+ * **Note:** This method mutates `object` and is based on
+ * [`Object.assign`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign).
+ *
+ * @static
+ * @memberOf _
+ * @alias extend
+ * @category Object
+ * @param {Object} object The destination object.
+ * @param {...Object} [sources] The source objects.
+ * @param {Function} [customizer] The function to customize assigned values.
+ * @param {*} [thisArg] The `this` binding of `customizer`.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' });
+ * // => { 'user': 'fred', 'age': 40 }
+ *
+ * // using a customizer callback
+ * var defaults = _.partialRight(_.assign, function(value, other) {
+ * return _.isUndefined(value) ? other : value;
+ * });
+ *
+ * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });
+ * // => { 'user': 'barney', 'age': 36 }
+ */
+ var assign = createAssigner(function(object, source, customizer) {
+ return customizer
+ ? assignWith(object, source, customizer)
+ : baseAssign(object, source);
+ });
+
+ /**
+ * Creates an object that inherits from the given `prototype` object. If a
+ * `properties` object is provided its own enumerable properties are assigned
+ * to the created object.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} prototype The object to inherit from.
+ * @param {Object} [properties] The properties to assign to the object.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {Object} Returns the new object.
+ * @example
+ *
+ * function Shape() {
+ * this.x = 0;
+ * this.y = 0;
+ * }
+ *
+ * function Circle() {
+ * Shape.call(this);
+ * }
+ *
+ * Circle.prototype = _.create(Shape.prototype, {
+ * 'constructor': Circle
+ * });
+ *
+ * var circle = new Circle;
+ * circle instanceof Circle;
+ * // => true
+ *
+ * circle instanceof Shape;
+ * // => true
+ */
+ function create(prototype, properties, guard) {
+ var result = baseCreate(prototype);
+ if (guard && isIterateeCall(prototype, properties, guard)) {
+ properties = null;
+ }
+ return properties ? baseAssign(result, properties) : result;
+ }
+
+ /**
+ * Assigns own enumerable properties of source object(s) to the destination
+ * object for all destination properties that resolve to `undefined`. Once a
+ * property is set, additional values of the same property are ignored.
+ *
+ * **Note:** This method mutates `object`.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The destination object.
+ * @param {...Object} [sources] The source objects.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });
+ * // => { 'user': 'barney', 'age': 36 }
+ */
+ var defaults = restParam(function(args) {
+ var object = args[0];
+ if (object == null) {
+ return object;
+ }
+ args.push(assignDefaults);
+ return assign.apply(undefined, args);
+ });
+
+ /**
+ * This method is like `_.find` except that it returns the key of the first
+ * element `predicate` returns truthy for instead of the element itself.
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to search.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {string|undefined} Returns the key of the matched element, else `undefined`.
+ * @example
+ *
+ * var users = {
+ * 'barney': { 'age': 36, 'active': true },
+ * 'fred': { 'age': 40, 'active': false },
+ * 'pebbles': { 'age': 1, 'active': true }
+ * };
+ *
+ * _.findKey(users, function(chr) {
+ * return chr.age < 40;
+ * });
+ * // => 'barney' (iteration order is not guaranteed)
+ *
+ * // using the `_.matches` callback shorthand
+ * _.findKey(users, { 'age': 1, 'active': true });
+ * // => 'pebbles'
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.findKey(users, 'active', false);
+ * // => 'fred'
+ *
+ * // using the `_.property` callback shorthand
+ * _.findKey(users, 'active');
+ * // => 'barney'
+ */
+ var findKey = createFindKey(baseForOwn);
+
+ /**
+ * This method is like `_.findKey` except that it iterates over elements of
+ * a collection in the opposite order.
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to search.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {string|undefined} Returns the key of the matched element, else `undefined`.
+ * @example
+ *
+ * var users = {
+ * 'barney': { 'age': 36, 'active': true },
+ * 'fred': { 'age': 40, 'active': false },
+ * 'pebbles': { 'age': 1, 'active': true }
+ * };
+ *
+ * _.findLastKey(users, function(chr) {
+ * return chr.age < 40;
+ * });
+ * // => returns `pebbles` assuming `_.findKey` returns `barney`
+ *
+ * // using the `_.matches` callback shorthand
+ * _.findLastKey(users, { 'age': 36, 'active': true });
+ * // => 'barney'
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.findLastKey(users, 'active', false);
+ * // => 'fred'
+ *
+ * // using the `_.property` callback shorthand
+ * _.findLastKey(users, 'active');
+ * // => 'pebbles'
+ */
+ var findLastKey = createFindKey(baseForOwnRight);
+
+ /**
+ * Iterates over own and inherited enumerable properties of an object invoking
+ * `iteratee` for each property. The `iteratee` is bound to `thisArg` and invoked
+ * with three arguments: (value, key, object). Iteratee functions may exit
+ * iteration early by explicitly returning `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.forIn(new Foo, function(value, key) {
+ * console.log(key);
+ * });
+ * // => logs 'a', 'b', and 'c' (iteration order is not guaranteed)
+ */
+ var forIn = createForIn(baseFor);
+
+ /**
+ * This method is like `_.forIn` except that it iterates over properties of
+ * `object` in the opposite order.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.forInRight(new Foo, function(value, key) {
+ * console.log(key);
+ * });
+ * // => logs 'c', 'b', and 'a' assuming `_.forIn ` logs 'a', 'b', and 'c'
+ */
+ var forInRight = createForIn(baseForRight);
+
+ /**
+ * Iterates over own enumerable properties of an object invoking `iteratee`
+ * for each property. The `iteratee` is bound to `thisArg` and invoked with
+ * three arguments: (value, key, object). Iteratee functions may exit iteration
+ * early by explicitly returning `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.forOwn(new Foo, function(value, key) {
+ * console.log(key);
+ * });
+ * // => logs 'a' and 'b' (iteration order is not guaranteed)
+ */
+ var forOwn = createForOwn(baseForOwn);
+
+ /**
+ * This method is like `_.forOwn` except that it iterates over properties of
+ * `object` in the opposite order.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.forOwnRight(new Foo, function(value, key) {
+ * console.log(key);
+ * });
+ * // => logs 'b' and 'a' assuming `_.forOwn` logs 'a' and 'b'
+ */
+ var forOwnRight = createForOwn(baseForOwnRight);
+
+ /**
+ * Creates an array of function property names from all enumerable properties,
+ * own and inherited, of `object`.
+ *
+ * @static
+ * @memberOf _
+ * @alias methods
+ * @category Object
+ * @param {Object} object The object to inspect.
+ * @returns {Array} Returns the new array of property names.
+ * @example
+ *
+ * _.functions(_);
+ * // => ['after', 'ary', 'assign', ...]
+ */
+ function functions(object) {
+ return baseFunctions(object, keysIn(object));
+ }
+
+ /**
+ * Gets the property value at `path` of `object`. If the resolved value is
+ * `undefined` the `defaultValue` is used in its place.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @param {Array|string} path The path of the property to get.
+ * @param {*} [defaultValue] The value returned if the resolved value is `undefined`.
+ * @returns {*} Returns the resolved value.
+ * @example
+ *
+ * var object = { 'a': [{ 'b': { 'c': 3 } }] };
+ *
+ * _.get(object, 'a[0].b.c');
+ * // => 3
+ *
+ * _.get(object, ['a', '0', 'b', 'c']);
+ * // => 3
+ *
+ * _.get(object, 'a.b.c', 'default');
+ * // => 'default'
+ */
+ function get(object, path, defaultValue) {
+ var result = object == null ? undefined : baseGet(object, toPath(path), path + '');
+ return result === undefined ? defaultValue : result;
+ }
+
+ /**
+ * Checks if `path` is a direct property.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @param {Array|string} path The path to check.
+ * @returns {boolean} Returns `true` if `path` is a direct property, else `false`.
+ * @example
+ *
+ * var object = { 'a': { 'b': { 'c': 3 } } };
+ *
+ * _.has(object, 'a');
+ * // => true
+ *
+ * _.has(object, 'a.b.c');
+ * // => true
+ *
+ * _.has(object, ['a', 'b', 'c']);
+ * // => true
+ */
+ function has(object, path) {
+ if (object == null) {
+ return false;
+ }
+ var result = hasOwnProperty.call(object, path);
+ if (!result && !isKey(path)) {
+ path = toPath(path);
+ object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
+ if (object == null) {
+ return false;
+ }
+ path = last(path);
+ result = hasOwnProperty.call(object, path);
+ }
+ return result || (isLength(object.length) && isIndex(path, object.length) &&
+ (isArray(object) || isArguments(object)));
+ }
+
+ /**
+ * Creates an object composed of the inverted keys and values of `object`.
+ * If `object` contains duplicate values, subsequent values overwrite property
+ * assignments of previous values unless `multiValue` is `true`.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to invert.
+ * @param {boolean} [multiValue] Allow multiple values per key.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {Object} Returns the new inverted object.
+ * @example
+ *
+ * var object = { 'a': 1, 'b': 2, 'c': 1 };
+ *
+ * _.invert(object);
+ * // => { '1': 'c', '2': 'b' }
+ *
+ * // with `multiValue`
+ * _.invert(object, true);
+ * // => { '1': ['a', 'c'], '2': ['b'] }
+ */
+ function invert(object, multiValue, guard) {
+ if (guard && isIterateeCall(object, multiValue, guard)) {
+ multiValue = null;
+ }
+ var index = -1,
+ props = keys(object),
+ length = props.length,
+ result = {};
+
+ while (++index < length) {
+ var key = props[index],
+ value = object[key];
+
+ if (multiValue) {
+ if (hasOwnProperty.call(result, value)) {
+ result[value].push(key);
+ } else {
+ result[value] = [key];
+ }
+ }
+ else {
+ result[value] = key;
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Creates an array of the own enumerable property names of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects. See the
+ * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.keys)
+ * for more details.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.keys(new Foo);
+ * // => ['a', 'b'] (iteration order is not guaranteed)
+ *
+ * _.keys('hi');
+ * // => ['0', '1']
+ */
+ var keys = !nativeKeys ? shimKeys : function(object) {
+ var Ctor = object == null ? null : object.constructor;
+ if ((typeof Ctor == 'function' && Ctor.prototype === object) ||
+ (typeof object != 'function' && isArrayLike(object))) {
+ return shimKeys(object);
+ }
+ return isObject(object) ? nativeKeys(object) : [];
+ };
+
+ /**
+ * Creates an array of the own and inherited enumerable property names of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.keysIn(new Foo);
+ * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
+ */
+ function keysIn(object) {
+ if (object == null) {
+ return [];
+ }
+ if (!isObject(object)) {
+ object = Object(object);
+ }
+ var length = object.length;
+ length = (length && isLength(length) &&
+ (isArray(object) || isArguments(object)) && length) || 0;
+
+ var Ctor = object.constructor,
+ index = -1,
+ isProto = typeof Ctor == 'function' && Ctor.prototype === object,
+ result = Array(length),
+ skipIndexes = length > 0;
+
+ while (++index < length) {
+ result[index] = (index + '');
+ }
+ for (var key in object) {
+ if (!(skipIndexes && isIndex(key, length)) &&
+ !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
+ result.push(key);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * The opposite of `_.mapValues`; this method creates an object with the
+ * same values as `object` and keys generated by running each own enumerable
+ * property of `object` through `iteratee`.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to iterate over.
+ * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Object} Returns the new mapped object.
+ * @example
+ *
+ * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
+ * return key + value;
+ * });
+ * // => { 'a1': 1, 'b2': 2 }
+ */
+ var mapKeys = createObjectMapper(true);
+
+ /**
+ * Creates an object with the same keys as `object` and values generated by
+ * running each own enumerable property of `object` through `iteratee`. The
+ * iteratee function is bound to `thisArg` and invoked with three arguments:
+ * (value, key, object).
+ *
+ * If a property name is provided for `iteratee` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `iteratee` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to iterate over.
+ * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Object} Returns the new mapped object.
+ * @example
+ *
+ * _.mapValues({ 'a': 1, 'b': 2 }, function(n) {
+ * return n * 3;
+ * });
+ * // => { 'a': 3, 'b': 6 }
+ *
+ * var users = {
+ * 'fred': { 'user': 'fred', 'age': 40 },
+ * 'pebbles': { 'user': 'pebbles', 'age': 1 }
+ * };
+ *
+ * // using the `_.property` callback shorthand
+ * _.mapValues(users, 'age');
+ * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
+ */
+ var mapValues = createObjectMapper();
+
+ /**
+ * Recursively merges own enumerable properties of the source object(s), that
+ * don't resolve to `undefined` into the destination object. Subsequent sources
+ * overwrite property assignments of previous sources. If `customizer` is
+ * provided it is invoked to produce the merged values of the destination and
+ * source properties. If `customizer` returns `undefined` merging is handled
+ * by the method instead. The `customizer` is bound to `thisArg` and invoked
+ * with five arguments: (objectValue, sourceValue, key, object, source).
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The destination object.
+ * @param {...Object} [sources] The source objects.
+ * @param {Function} [customizer] The function to customize assigned values.
+ * @param {*} [thisArg] The `this` binding of `customizer`.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * var users = {
+ * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }]
+ * };
+ *
+ * var ages = {
+ * 'data': [{ 'age': 36 }, { 'age': 40 }]
+ * };
+ *
+ * _.merge(users, ages);
+ * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] }
+ *
+ * // using a customizer callback
+ * var object = {
+ * 'fruits': ['apple'],
+ * 'vegetables': ['beet']
+ * };
+ *
+ * var other = {
+ * 'fruits': ['banana'],
+ * 'vegetables': ['carrot']
+ * };
+ *
+ * _.merge(object, other, function(a, b) {
+ * if (_.isArray(a)) {
+ * return a.concat(b);
+ * }
+ * });
+ * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] }
+ */
+ var merge = createAssigner(baseMerge);
+
+ /**
+ * The opposite of `_.pick`; this method creates an object composed of the
+ * own and inherited enumerable properties of `object` that are not omitted.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The source object.
+ * @param {Function|...(string|string[])} [predicate] The function invoked per
+ * iteration or property names to omit, specified as individual property
+ * names or arrays of property names.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {Object} Returns the new object.
+ * @example
+ *
+ * var object = { 'user': 'fred', 'age': 40 };
+ *
+ * _.omit(object, 'age');
+ * // => { 'user': 'fred' }
+ *
+ * _.omit(object, _.isNumber);
+ * // => { 'user': 'fred' }
+ */
+ var omit = restParam(function(object, props) {
+ if (object == null) {
+ return {};
+ }
+ if (typeof props[0] != 'function') {
+ var props = arrayMap(baseFlatten(props), String);
+ return pickByArray(object, baseDifference(keysIn(object), props));
+ }
+ var predicate = bindCallback(props[0], props[1], 3);
+ return pickByCallback(object, function(value, key, object) {
+ return !predicate(value, key, object);
+ });
+ });
+
+ /**
+ * Creates a two dimensional array of the key-value pairs for `object`,
+ * e.g. `[[key1, value1], [key2, value2]]`.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the new array of key-value pairs.
+ * @example
+ *
+ * _.pairs({ 'barney': 36, 'fred': 40 });
+ * // => [['barney', 36], ['fred', 40]] (iteration order is not guaranteed)
+ */
+ function pairs(object) {
+ object = toObject(object);
+
+ var index = -1,
+ props = keys(object),
+ length = props.length,
+ result = Array(length);
+
+ while (++index < length) {
+ var key = props[index];
+ result[index] = [key, object[key]];
+ }
+ return result;
+ }
+
+ /**
+ * Creates an object composed of the picked `object` properties. Property
+ * names may be specified as individual arguments or as arrays of property
+ * names. If `predicate` is provided it is invoked for each property of `object`
+ * picking the properties `predicate` returns truthy for. The predicate is
+ * bound to `thisArg` and invoked with three arguments: (value, key, object).
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The source object.
+ * @param {Function|...(string|string[])} [predicate] The function invoked per
+ * iteration or property names to pick, specified as individual property
+ * names or arrays of property names.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {Object} Returns the new object.
+ * @example
+ *
+ * var object = { 'user': 'fred', 'age': 40 };
+ *
+ * _.pick(object, 'user');
+ * // => { 'user': 'fred' }
+ *
+ * _.pick(object, _.isString);
+ * // => { 'user': 'fred' }
+ */
+ var pick = restParam(function(object, props) {
+ if (object == null) {
+ return {};
+ }
+ return typeof props[0] == 'function'
+ ? pickByCallback(object, bindCallback(props[0], props[1], 3))
+ : pickByArray(object, baseFlatten(props));
+ });
+
+ /**
+ * This method is like `_.get` except that if the resolved value is a function
+ * it is invoked with the `this` binding of its parent object and its result
+ * is returned.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @param {Array|string} path The path of the property to resolve.
+ * @param {*} [defaultValue] The value returned if the resolved value is `undefined`.
+ * @returns {*} Returns the resolved value.
+ * @example
+ *
+ * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
+ *
+ * _.result(object, 'a[0].b.c1');
+ * // => 3
+ *
+ * _.result(object, 'a[0].b.c2');
+ * // => 4
+ *
+ * _.result(object, 'a.b.c', 'default');
+ * // => 'default'
+ *
+ * _.result(object, 'a.b.c', _.constant('default'));
+ * // => 'default'
+ */
+ function result(object, path, defaultValue) {
+ var result = object == null ? undefined : object[path];
+ if (result === undefined) {
+ if (object != null && !isKey(path, object)) {
+ path = toPath(path);
+ object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
+ result = object == null ? undefined : object[last(path)];
+ }
+ result = result === undefined ? defaultValue : result;
+ }
+ return isFunction(result) ? result.call(object) : result;
+ }
+
+ /**
+ * Sets the property value of `path` on `object`. If a portion of `path`
+ * does not exist it is created.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to augment.
+ * @param {Array|string} path The path of the property to set.
+ * @param {*} value The value to set.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * var object = { 'a': [{ 'b': { 'c': 3 } }] };
+ *
+ * _.set(object, 'a[0].b.c', 4);
+ * console.log(object.a[0].b.c);
+ * // => 4
+ *
+ * _.set(object, 'x[0].y.z', 5);
+ * console.log(object.x[0].y.z);
+ * // => 5
+ */
+ function set(object, path, value) {
+ if (object == null) {
+ return object;
+ }
+ var pathKey = (path + '');
+ path = (object[pathKey] != null || isKey(path, object)) ? [pathKey] : toPath(path);
+
+ var index = -1,
+ length = path.length,
+ lastIndex = length - 1,
+ nested = object;
+
+ while (nested != null && ++index < length) {
+ var key = path[index];
+ if (isObject(nested)) {
+ if (index == lastIndex) {
+ nested[key] = value;
+ } else if (nested[key] == null) {
+ nested[key] = isIndex(path[index + 1]) ? [] : {};
+ }
+ }
+ nested = nested[key];
+ }
+ return object;
+ }
+
+ /**
+ * An alternative to `_.reduce`; this method transforms `object` to a new
+ * `accumulator` object which is the result of running each of its own enumerable
+ * properties through `iteratee`, with each invocation potentially mutating
+ * the `accumulator` object. The `iteratee` is bound to `thisArg` and invoked
+ * with four arguments: (accumulator, value, key, object). Iteratee functions
+ * may exit iteration early by explicitly returning `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Array|Object} object The object to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @param {*} [accumulator] The custom accumulator value.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {*} Returns the accumulated value.
+ * @example
+ *
+ * _.transform([2, 3, 4], function(result, n) {
+ * result.push(n *= n);
+ * return n % 2 == 0;
+ * });
+ * // => [4, 9]
+ *
+ * _.transform({ 'a': 1, 'b': 2 }, function(result, n, key) {
+ * result[key] = n * 3;
+ * });
+ * // => { 'a': 3, 'b': 6 }
+ */
+ function transform(object, iteratee, accumulator, thisArg) {
+ var isArr = isArray(object) || isTypedArray(object);
+ iteratee = getCallback(iteratee, thisArg, 4);
+
+ if (accumulator == null) {
+ if (isArr || isObject(object)) {
+ var Ctor = object.constructor;
+ if (isArr) {
+ accumulator = isArray(object) ? new Ctor : [];
+ } else {
+ accumulator = baseCreate(isFunction(Ctor) ? Ctor.prototype : null);
+ }
+ } else {
+ accumulator = {};
+ }
+ }
+ (isArr ? arrayEach : baseForOwn)(object, function(value, index, object) {
+ return iteratee(accumulator, value, index, object);
+ });
+ return accumulator;
+ }
+
+ /**
+ * Creates an array of the own enumerable property values of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property values.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.values(new Foo);
+ * // => [1, 2] (iteration order is not guaranteed)
+ *
+ * _.values('hi');
+ * // => ['h', 'i']
+ */
+ function values(object) {
+ return baseValues(object, keys(object));
+ }
+
+ /**
+ * Creates an array of the own and inherited enumerable property values
+ * of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property values.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.valuesIn(new Foo);
+ * // => [1, 2, 3] (iteration order is not guaranteed)
+ */
+ function valuesIn(object) {
+ return baseValues(object, keysIn(object));
+ }
+
+ /*------------------------------------------------------------------------*/
+
+ /**
+ * Checks if `n` is between `start` and up to but not including, `end`. If
+ * `end` is not specified it is set to `start` with `start` then set to `0`.
+ *
+ * @static
+ * @memberOf _
+ * @category Number
+ * @param {number} n The number to check.
+ * @param {number} [start=0] The start of the range.
+ * @param {number} end The end of the range.
+ * @returns {boolean} Returns `true` if `n` is in the range, else `false`.
+ * @example
+ *
+ * _.inRange(3, 2, 4);
+ * // => true
+ *
+ * _.inRange(4, 8);
+ * // => true
+ *
+ * _.inRange(4, 2);
+ * // => false
+ *
+ * _.inRange(2, 2);
+ * // => false
+ *
+ * _.inRange(1.2, 2);
+ * // => true
+ *
+ * _.inRange(5.2, 4);
+ * // => false
+ */
+ function inRange(value, start, end) {
+ start = +start || 0;
+ if (typeof end === 'undefined') {
+ end = start;
+ start = 0;
+ } else {
+ end = +end || 0;
+ }
+ return value >= nativeMin(start, end) && value < nativeMax(start, end);
+ }
+
+ /**
+ * Produces a random number between `min` and `max` (inclusive). If only one
+ * argument is provided a number between `0` and the given number is returned.
+ * If `floating` is `true`, or either `min` or `max` are floats, a floating-point
+ * number is returned instead of an integer.
+ *
+ * @static
+ * @memberOf _
+ * @category Number
+ * @param {number} [min=0] The minimum possible value.
+ * @param {number} [max=1] The maximum possible value.
+ * @param {boolean} [floating] Specify returning a floating-point number.
+ * @returns {number} Returns the random number.
+ * @example
+ *
+ * _.random(0, 5);
+ * // => an integer between 0 and 5
+ *
+ * _.random(5);
+ * // => also an integer between 0 and 5
+ *
+ * _.random(5, true);
+ * // => a floating-point number between 0 and 5
+ *
+ * _.random(1.2, 5.2);
+ * // => a floating-point number between 1.2 and 5.2
+ */
+ function random(min, max, floating) {
+ if (floating && isIterateeCall(min, max, floating)) {
+ max = floating = null;
+ }
+ var noMin = min == null,
+ noMax = max == null;
+
+ if (floating == null) {
+ if (noMax && typeof min == 'boolean') {
+ floating = min;
+ min = 1;
+ }
+ else if (typeof max == 'boolean') {
+ floating = max;
+ noMax = true;
+ }
+ }
+ if (noMin && noMax) {
+ max = 1;
+ noMax = false;
+ }
+ min = +min || 0;
+ if (noMax) {
+ max = min;
+ min = 0;
+ } else {
+ max = +max || 0;
+ }
+ if (floating || min % 1 || max % 1) {
+ var rand = nativeRandom();
+ return nativeMin(min + (rand * (max - min + parseFloat('1e-' + ((rand + '').length - 1)))), max);
+ }
+ return baseRandom(min, max);
+ }
+
+ /*------------------------------------------------------------------------*/
+
+ /**
+ * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to convert.
+ * @returns {string} Returns the camel cased string.
+ * @example
+ *
+ * _.camelCase('Foo Bar');
+ * // => 'fooBar'
+ *
+ * _.camelCase('--foo-bar');
+ * // => 'fooBar'
+ *
+ * _.camelCase('__foo_bar__');
+ * // => 'fooBar'
+ */
+ var camelCase = createCompounder(function(result, word, index) {
+ word = word.toLowerCase();
+ return result + (index ? (word.charAt(0).toUpperCase() + word.slice(1)) : word);
+ });
+
+ /**
+ * Capitalizes the first character of `string`.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to capitalize.
+ * @returns {string} Returns the capitalized string.
+ * @example
+ *
+ * _.capitalize('fred');
+ * // => 'Fred'
+ */
+ function capitalize(string) {
+ string = baseToString(string);
+ return string && (string.charAt(0).toUpperCase() + string.slice(1));
+ }
+
+ /**
+ * Deburrs `string` by converting [latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
+ * to basic latin letters and removing [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to deburr.
+ * @returns {string} Returns the deburred string.
+ * @example
+ *
+ * _.deburr('déjà vu');
+ * // => 'deja vu'
+ */
+ function deburr(string) {
+ string = baseToString(string);
+ return string && string.replace(reLatin1, deburrLetter).replace(reComboMark, '');
+ }
+
+ /**
+ * Checks if `string` ends with the given target string.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to search.
+ * @param {string} [target] The string to search for.
+ * @param {number} [position=string.length] The position to search from.
+ * @returns {boolean} Returns `true` if `string` ends with `target`, else `false`.
+ * @example
+ *
+ * _.endsWith('abc', 'c');
+ * // => true
+ *
+ * _.endsWith('abc', 'b');
+ * // => false
+ *
+ * _.endsWith('abc', 'b', 2);
+ * // => true
+ */
+ function endsWith(string, target, position) {
+ string = baseToString(string);
+ target = (target + '');
+
+ var length = string.length;
+ position = position === undefined
+ ? length
+ : nativeMin(position < 0 ? 0 : (+position || 0), length);
+
+ position -= target.length;
+ return position >= 0 && string.indexOf(target, position) == position;
+ }
+
+ /**
+ * Converts the characters "&", "<", ">", '"', "'", and "\`", in `string` to
+ * their corresponding HTML entities.
+ *
+ * **Note:** No other characters are escaped. To escape additional characters
+ * use a third-party library like [_he_](https://mths.be/he).
+ *
+ * Though the ">" character is escaped for symmetry, characters like
+ * ">" and "/" don't need escaping in HTML and have no special meaning
+ * unless they're part of a tag or unquoted attribute value.
+ * See [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
+ * (under "semi-related fun fact") for more details.
+ *
+ * Backticks are escaped because in Internet Explorer < 9, they can break out
+ * of attribute values or HTML comments. See [#59](https://html5sec.org/#59),
+ * [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and
+ * [#133](https://html5sec.org/#133) of the [HTML5 Security Cheatsheet](https://html5sec.org/)
+ * for more details.
+ *
+ * When working with HTML you should always [quote attribute values](http://wonko.com/post/html-escaping)
+ * to reduce XSS vectors.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to escape.
+ * @returns {string} Returns the escaped string.
+ * @example
+ *
+ * _.escape('fred, barney, & pebbles');
+ * // => 'fred, barney, &amp; pebbles'
+ */
+ function escape(string) {
+ // Reset `lastIndex` because in IE < 9 `String#replace` does not.
+ string = baseToString(string);
+ return (string && reHasUnescapedHtml.test(string))
+ ? string.replace(reUnescapedHtml, escapeHtmlChar)
+ : string;
+ }
+
+ /**
+ * Escapes the `RegExp` special characters "\", "/", "^", "$", ".", "|", "?",
+ * "*", "+", "(", ")", "[", "]", "{" and "}" in `string`.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to escape.
+ * @returns {string} Returns the escaped string.
+ * @example
+ *
+ * _.escapeRegExp('[lodash](https://lodash.com/)');
+ * // => '\[lodash\]\(https:\/\/lodash\.com\/\)'
+ */
+ function escapeRegExp(string) {
+ string = baseToString(string);
+ return (string && reHasRegExpChars.test(string))
+ ? string.replace(reRegExpChars, '\\$&')
+ : string;
+ }
+
+ /**
+ * Converts `string` to [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to convert.
+ * @returns {string} Returns the kebab cased string.
+ * @example
+ *
+ * _.kebabCase('Foo Bar');
+ * // => 'foo-bar'
+ *
+ * _.kebabCase('fooBar');
+ * // => 'foo-bar'
+ *
+ * _.kebabCase('__foo_bar__');
+ * // => 'foo-bar'
+ */
+ var kebabCase = createCompounder(function(result, word, index) {
+ return result + (index ? '-' : '') + word.toLowerCase();
+ });
+
+ /**
+ * Pads `string` on the left and right sides if it's shorter than `length`.
+ * Padding characters are truncated if they can't be evenly divided by `length`.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to pad.
+ * @param {number} [length=0] The padding length.
+ * @param {string} [chars=' '] The string used as padding.
+ * @returns {string} Returns the padded string.
+ * @example
+ *
+ * _.pad('abc', 8);
+ * // => ' abc '
+ *
+ * _.pad('abc', 8, '_-');
+ * // => '_-abc_-_'
+ *
+ * _.pad('abc', 3);
+ * // => 'abc'
+ */
+ function pad(string, length, chars) {
+ string = baseToString(string);
+ length = +length;
+
+ var strLength = string.length;
+ if (strLength >= length || !nativeIsFinite(length)) {
+ return string;
+ }
+ var mid = (length - strLength) / 2,
+ leftLength = floor(mid),
+ rightLength = ceil(mid);
+
+ chars = createPadding('', rightLength, chars);
+ return chars.slice(0, leftLength) + string + chars;
+ }
+
+ /**
+ * Pads `string` on the left side if it's shorter than `length`. Padding
+ * characters are truncated if they exceed `length`.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to pad.
+ * @param {number} [length=0] The padding length.
+ * @param {string} [chars=' '] The string used as padding.
+ * @returns {string} Returns the padded string.
+ * @example
+ *
+ * _.padLeft('abc', 6);
+ * // => ' abc'
+ *
+ * _.padLeft('abc', 6, '_-');
+ * // => '_-_abc'
+ *
+ * _.padLeft('abc', 3);
+ * // => 'abc'
+ */
+ var padLeft = createPadDir();
+
+ /**
+ * Pads `string` on the right side if it's shorter than `length`. Padding
+ * characters are truncated if they exceed `length`.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to pad.
+ * @param {number} [length=0] The padding length.
+ * @param {string} [chars=' '] The string used as padding.
+ * @returns {string} Returns the padded string.
+ * @example
+ *
+ * _.padRight('abc', 6);
+ * // => 'abc '
+ *
+ * _.padRight('abc', 6, '_-');
+ * // => 'abc_-_'
+ *
+ * _.padRight('abc', 3);
+ * // => 'abc'
+ */
+ var padRight = createPadDir(true);
+
+ /**
+ * Converts `string` to an integer of the specified radix. If `radix` is
+ * `undefined` or `0`, a `radix` of `10` is used unless `value` is a hexadecimal,
+ * in which case a `radix` of `16` is used.
+ *
+ * **Note:** This method aligns with the [ES5 implementation](https://es5.github.io/#E)
+ * of `parseInt`.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} string The string to convert.
+ * @param {number} [radix] The radix to interpret `value` by.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {number} Returns the converted integer.
+ * @example
+ *
+ * _.parseInt('08');
+ * // => 8
+ *
+ * _.map(['6', '08', '10'], _.parseInt);
+ * // => [6, 8, 10]
+ */
+ function parseInt(string, radix, guard) {
+ if (guard && isIterateeCall(string, radix, guard)) {
+ radix = 0;
+ }
+ return nativeParseInt(string, radix);
+ }
+ // Fallback for environments with pre-ES5 implementations.
+ if (nativeParseInt(whitespace + '08') != 8) {
+ parseInt = function(string, radix, guard) {
+ // Firefox < 21 and Opera < 15 follow ES3 for `parseInt`.
+ // Chrome fails to trim leading <BOM> whitespace characters.
+ // See https://code.google.com/p/v8/issues/detail?id=3109 for more details.
+ if (guard ? isIterateeCall(string, radix, guard) : radix == null) {
+ radix = 0;
+ } else if (radix) {
+ radix = +radix;
+ }
+ string = trim(string);
+ return nativeParseInt(string, radix || (reHasHexPrefix.test(string) ? 16 : 10));
+ };
+ }
+
+ /**
+ * Repeats the given string `n` times.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to repeat.
+ * @param {number} [n=0] The number of times to repeat the string.
+ * @returns {string} Returns the repeated string.
+ * @example
+ *
+ * _.repeat('*', 3);
+ * // => '***'
+ *
+ * _.repeat('abc', 2);
+ * // => 'abcabc'
+ *
+ * _.repeat('abc', 0);
+ * // => ''
+ */
+ function repeat(string, n) {
+ var result = '';
+ string = baseToString(string);
+ n = +n;
+ if (n < 1 || !string || !nativeIsFinite(n)) {
+ return result;
+ }
+ // Leverage the exponentiation by squaring algorithm for a faster repeat.
+ // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
+ do {
+ if (n % 2) {
+ result += string;
+ }
+ n = floor(n / 2);
+ string += string;
+ } while (n);
+
+ return result;
+ }
+
+ /**
+ * Converts `string` to [snake case](https://en.wikipedia.org/wiki/Snake_case).
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to convert.
+ * @returns {string} Returns the snake cased string.
+ * @example
+ *
+ * _.snakeCase('Foo Bar');
+ * // => 'foo_bar'
+ *
+ * _.snakeCase('fooBar');
+ * // => 'foo_bar'
+ *
+ * _.snakeCase('--foo-bar');
+ * // => 'foo_bar'
+ */
+ var snakeCase = createCompounder(function(result, word, index) {
+ return result + (index ? '_' : '') + word.toLowerCase();
+ });
+
+ /**
+ * Converts `string` to [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to convert.
+ * @returns {string} Returns the start cased string.
+ * @example
+ *
+ * _.startCase('--foo-bar');
+ * // => 'Foo Bar'
+ *
+ * _.startCase('fooBar');
+ * // => 'Foo Bar'
+ *
+ * _.startCase('__foo_bar__');
+ * // => 'Foo Bar'
+ */
+ var startCase = createCompounder(function(result, word, index) {
+ return result + (index ? ' ' : '') + (word.charAt(0).toUpperCase() + word.slice(1));
+ });
+
+ /**
+ * Checks if `string` starts with the given target string.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to search.
+ * @param {string} [target] The string to search for.
+ * @param {number} [position=0] The position to search from.
+ * @returns {boolean} Returns `true` if `string` starts with `target`, else `false`.
+ * @example
+ *
+ * _.startsWith('abc', 'a');
+ * // => true
+ *
+ * _.startsWith('abc', 'b');
+ * // => false
+ *
+ * _.startsWith('abc', 'b', 1);
+ * // => true
+ */
+ function startsWith(string, target, position) {
+ string = baseToString(string);
+ position = position == null
+ ? 0
+ : nativeMin(position < 0 ? 0 : (+position || 0), string.length);
+
+ return string.lastIndexOf(target, position) == position;
+ }
+
+ /**
+ * Creates a compiled template function that can interpolate data properties
+ * in "interpolate" delimiters, HTML-escape interpolated data properties in
+ * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
+ * properties may be accessed as free variables in the template. If a setting
+ * object is provided it takes precedence over `_.templateSettings` values.
+ *
+ * **Note:** In the development build `_.template` utilizes
+ * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
+ * for easier debugging.
+ *
+ * For more information on precompiling templates see
+ * [lodash's custom builds documentation](https://lodash.com/custom-builds).
+ *
+ * For more information on Chrome extension sandboxes see
+ * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The template string.
+ * @param {Object} [options] The options object.
+ * @param {RegExp} [options.escape] The HTML "escape" delimiter.
+ * @param {RegExp} [options.evaluate] The "evaluate" delimiter.
+ * @param {Object} [options.imports] An object to import into the template as free variables.
+ * @param {RegExp} [options.interpolate] The "interpolate" delimiter.
+ * @param {string} [options.sourceURL] The sourceURL of the template's compiled source.
+ * @param {string} [options.variable] The data object variable name.
+ * @param- {Object} [otherOptions] Enables the legacy `options` param signature.
+ * @returns {Function} Returns the compiled template function.
+ * @example
+ *
+ * // using the "interpolate" delimiter to create a compiled template
+ * var compiled = _.template('hello <%= user %>!');
+ * compiled({ 'user': 'fred' });
+ * // => 'hello fred!'
+ *
+ * // using the HTML "escape" delimiter to escape data property values
+ * var compiled = _.template('<b><%- value %></b>');
+ * compiled({ 'value': '<script>' });
+ * // => '<b>&lt;script&gt;</b>'
+ *
+ * // using the "evaluate" delimiter to execute JavaScript and generate HTML
+ * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
+ * compiled({ 'users': ['fred', 'barney'] });
+ * // => '<li>fred</li><li>barney</li>'
+ *
+ * // using the internal `print` function in "evaluate" delimiters
+ * var compiled = _.template('<% print("hello " + user); %>!');
+ * compiled({ 'user': 'barney' });
+ * // => 'hello barney!'
+ *
+ * // using the ES delimiter as an alternative to the default "interpolate" delimiter
+ * var compiled = _.template('hello ${ user }!');
+ * compiled({ 'user': 'pebbles' });
+ * // => 'hello pebbles!'
+ *
+ * // using custom template delimiters
+ * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
+ * var compiled = _.template('hello {{ user }}!');
+ * compiled({ 'user': 'mustache' });
+ * // => 'hello mustache!'
+ *
+ * // using backslashes to treat delimiters as plain text
+ * var compiled = _.template('<%= "\\<%- value %\\>" %>');
+ * compiled({ 'value': 'ignored' });
+ * // => '<%- value %>'
+ *
+ * // using the `imports` option to import `jQuery` as `jq`
+ * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
+ * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
+ * compiled({ 'users': ['fred', 'barney'] });
+ * // => '<li>fred</li><li>barney</li>'
+ *
+ * // using the `sourceURL` option to specify a custom sourceURL for the template
+ * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
+ * compiled(data);
+ * // => find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector
+ *
+ * // using the `variable` option to ensure a with-statement isn't used in the compiled template
+ * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
+ * compiled.source;
+ * // => function(data) {
+ * // var __t, __p = '';
+ * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
+ * // return __p;
+ * // }
+ *
+ * // using the `source` property to inline compiled templates for meaningful
+ * // line numbers in error messages and a stack trace
+ * fs.writeFileSync(path.join(cwd, 'jst.js'), '\
+ * var JST = {\
+ * "main": ' + _.template(mainText).source + '\
+ * };\
+ * ');
+ */
+ function template(string, options, otherOptions) {
+ // Based on John Resig's `tmpl` implementation (http://ejohn.org/blog/javascript-micro-templating/)
+ // and Laura Doktorova's doT.js (https://github.com/olado/doT).
+ var settings = lodash.templateSettings;
+
+ if (otherOptions && isIterateeCall(string, options, otherOptions)) {
+ options = otherOptions = null;
+ }
+ string = baseToString(string);
+ options = assignWith(baseAssign({}, otherOptions || options), settings, assignOwnDefaults);
+
+ var imports = assignWith(baseAssign({}, options.imports), settings.imports, assignOwnDefaults),
+ importsKeys = keys(imports),
+ importsValues = baseValues(imports, importsKeys);
+
+ var isEscaping,
+ isEvaluating,
+ index = 0,
+ interpolate = options.interpolate || reNoMatch,
+ source = "__p += '";
+
+ // Compile the regexp to match each delimiter.
+ var reDelimiters = RegExp(
+ (options.escape || reNoMatch).source + '|' +
+ interpolate.source + '|' +
+ (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
+ (options.evaluate || reNoMatch).source + '|$'
+ , 'g');
+
+ // Use a sourceURL for easier debugging.
+ var sourceURL = '//# sourceURL=' +
+ ('sourceURL' in options
+ ? options.sourceURL
+ : ('lodash.templateSources[' + (++templateCounter) + ']')
+ ) + '\n';
+
+ string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
+ interpolateValue || (interpolateValue = esTemplateValue);
+
+ // Escape characters that can't be included in string literals.
+ source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
+
+ // Replace delimiters with snippets.
+ if (escapeValue) {
+ isEscaping = true;
+ source += "' +\n__e(" + escapeValue + ") +\n'";
+ }
+ if (evaluateValue) {
+ isEvaluating = true;
+ source += "';\n" + evaluateValue + ";\n__p += '";
+ }
+ if (interpolateValue) {
+ source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
+ }
+ index = offset + match.length;
+
+ // The JS engine embedded in Adobe products requires returning the `match`
+ // string in order to produce the correct `offset` value.
+ return match;
+ });
+
+ source += "';\n";
+
+ // If `variable` is not specified wrap a with-statement around the generated
+ // code to add the data object to the top of the scope chain.
+ var variable = options.variable;
+ if (!variable) {
+ source = 'with (obj) {\n' + source + '\n}\n';
+ }
+ // Cleanup code by stripping empty strings.
+ source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
+ .replace(reEmptyStringMiddle, '$1')
+ .replace(reEmptyStringTrailing, '$1;');
+
+ // Frame code as the function body.
+ source = 'function(' + (variable || 'obj') + ') {\n' +
+ (variable
+ ? ''
+ : 'obj || (obj = {});\n'
+ ) +
+ "var __t, __p = ''" +
+ (isEscaping
+ ? ', __e = _.escape'
+ : ''
+ ) +
+ (isEvaluating
+ ? ', __j = Array.prototype.join;\n' +
+ "function print() { __p += __j.call(arguments, '') }\n"
+ : ';\n'
+ ) +
+ source +
+ 'return __p\n}';
+
+ var result = attempt(function() {
+ return Function(importsKeys, sourceURL + 'return ' + source).apply(undefined, importsValues);
+ });
+
+ // Provide the compiled function's source by its `toString` method or
+ // the `source` property as a convenience for inlining compiled templates.
+ result.source = source;
+ if (isError(result)) {
+ throw result;
+ }
+ return result;
+ }
+
+ /**
+ * Removes leading and trailing whitespace or specified characters from `string`.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to trim.
+ * @param {string} [chars=whitespace] The characters to trim.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {string} Returns the trimmed string.
+ * @example
+ *
+ * _.trim(' abc ');
+ * // => 'abc'
+ *
+ * _.trim('-_-abc-_-', '_-');
+ * // => 'abc'
+ *
+ * _.map([' foo ', ' bar '], _.trim);
+ * // => ['foo', 'bar']
+ */
+ function trim(string, chars, guard) {
+ var value = string;
+ string = baseToString(string);
+ if (!string) {
+ return string;
+ }
+ if (guard ? isIterateeCall(value, chars, guard) : chars == null) {
+ return string.slice(trimmedLeftIndex(string), trimmedRightIndex(string) + 1);
+ }
+ chars = (chars + '');
+ return string.slice(charsLeftIndex(string, chars), charsRightIndex(string, chars) + 1);
+ }
+
+ /**
+ * Removes leading whitespace or specified characters from `string`.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to trim.
+ * @param {string} [chars=whitespace] The characters to trim.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {string} Returns the trimmed string.
+ * @example
+ *
+ * _.trimLeft(' abc ');
+ * // => 'abc '
+ *
+ * _.trimLeft('-_-abc-_-', '_-');
+ * // => 'abc-_-'
+ */
+ function trimLeft(string, chars, guard) {
+ var value = string;
+ string = baseToString(string);
+ if (!string) {
+ return string;
+ }
+ if (guard ? isIterateeCall(value, chars, guard) : chars == null) {
+ return string.slice(trimmedLeftIndex(string));
+ }
+ return string.slice(charsLeftIndex(string, (chars + '')));
+ }
+
+ /**
+ * Removes trailing whitespace or specified characters from `string`.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to trim.
+ * @param {string} [chars=whitespace] The characters to trim.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {string} Returns the trimmed string.
+ * @example
+ *
+ * _.trimRight(' abc ');
+ * // => ' abc'
+ *
+ * _.trimRight('-_-abc-_-', '_-');
+ * // => '-_-abc'
+ */
+ function trimRight(string, chars, guard) {
+ var value = string;
+ string = baseToString(string);
+ if (!string) {
+ return string;
+ }
+ if (guard ? isIterateeCall(value, chars, guard) : chars == null) {
+ return string.slice(0, trimmedRightIndex(string) + 1);
+ }
+ return string.slice(0, charsRightIndex(string, (chars + '')) + 1);
+ }
+
+ /**
+ * Truncates `string` if it's longer than the given maximum string length.
+ * The last characters of the truncated string are replaced with the omission
+ * string which defaults to "...".
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to truncate.
+ * @param {Object|number} [options] The options object or maximum string length.
+ * @param {number} [options.length=30] The maximum string length.
+ * @param {string} [options.omission='...'] The string to indicate text is omitted.
+ * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {string} Returns the truncated string.
+ * @example
+ *
+ * _.trunc('hi-diddly-ho there, neighborino');
+ * // => 'hi-diddly-ho there, neighbo...'
+ *
+ * _.trunc('hi-diddly-ho there, neighborino', 24);
+ * // => 'hi-diddly-ho there, n...'
+ *
+ * _.trunc('hi-diddly-ho there, neighborino', {
+ * 'length': 24,
+ * 'separator': ' '
+ * });
+ * // => 'hi-diddly-ho there,...'
+ *
+ * _.trunc('hi-diddly-ho there, neighborino', {
+ * 'length': 24,
+ * 'separator': /,? +/
+ * });
+ * // => 'hi-diddly-ho there...'
+ *
+ * _.trunc('hi-diddly-ho there, neighborino', {
+ * 'omission': ' [...]'
+ * });
+ * // => 'hi-diddly-ho there, neig [...]'
+ */
+ function trunc(string, options, guard) {
+ if (guard && isIterateeCall(string, options, guard)) {
+ options = null;
+ }
+ var length = DEFAULT_TRUNC_LENGTH,
+ omission = DEFAULT_TRUNC_OMISSION;
+
+ if (options != null) {
+ if (isObject(options)) {
+ var separator = 'separator' in options ? options.separator : separator;
+ length = 'length' in options ? (+options.length || 0) : length;
+ omission = 'omission' in options ? baseToString(options.omission) : omission;
+ } else {
+ length = +options || 0;
+ }
+ }
+ string = baseToString(string);
+ if (length >= string.length) {
+ return string;
+ }
+ var end = length - omission.length;
+ if (end < 1) {
+ return omission;
+ }
+ var result = string.slice(0, end);
+ if (separator == null) {
+ return result + omission;
+ }
+ if (isRegExp(separator)) {
+ if (string.slice(end).search(separator)) {
+ var match,
+ newEnd,
+ substring = string.slice(0, end);
+
+ if (!separator.global) {
+ separator = RegExp(separator.source, (reFlags.exec(separator) || '') + 'g');
+ }
+ separator.lastIndex = 0;
+ while ((match = separator.exec(substring))) {
+ newEnd = match.index;
+ }
+ result = result.slice(0, newEnd == null ? end : newEnd);
+ }
+ } else if (string.indexOf(separator, end) != end) {
+ var index = result.lastIndexOf(separator);
+ if (index > -1) {
+ result = result.slice(0, index);
+ }
+ }
+ return result + omission;
+ }
+
+ /**
+ * The inverse of `_.escape`; this method converts the HTML entities
+ * `&amp;`, `&lt;`, `&gt;`, `&quot;`, `&#39;`, and `&#96;` in `string` to their
+ * corresponding characters.
+ *
+ * **Note:** No other HTML entities are unescaped. To unescape additional HTML
+ * entities use a third-party library like [_he_](https://mths.be/he).
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to unescape.
+ * @returns {string} Returns the unescaped string.
+ * @example
+ *
+ * _.unescape('fred, barney, &amp; pebbles');
+ * // => 'fred, barney, & pebbles'
+ */
+ function unescape(string) {
+ string = baseToString(string);
+ return (string && reHasEscapedHtml.test(string))
+ ? string.replace(reEscapedHtml, unescapeHtmlChar)
+ : string;
+ }
+
+ /**
+ * Splits `string` into an array of its words.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to inspect.
+ * @param {RegExp|string} [pattern] The pattern to match words.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {Array} Returns the words of `string`.
+ * @example
+ *
+ * _.words('fred, barney, & pebbles');
+ * // => ['fred', 'barney', 'pebbles']
+ *
+ * _.words('fred, barney, & pebbles', /[^, ]+/g);
+ * // => ['fred', 'barney', '&', 'pebbles']
+ */
+ function words(string, pattern, guard) {
+ if (guard && isIterateeCall(string, pattern, guard)) {
+ pattern = null;
+ }
+ string = baseToString(string);
+ return string.match(pattern || reWords) || [];
+ }
+
+ /*------------------------------------------------------------------------*/
+
+ /**
+ * Attempts to invoke `func`, returning either the result or the caught error
+ * object. Any additional arguments are provided to `func` when it is invoked.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {Function} func The function to attempt.
+ * @returns {*} Returns the `func` result or error object.
+ * @example
+ *
+ * // avoid throwing errors for invalid selectors
+ * var elements = _.attempt(function(selector) {
+ * return document.querySelectorAll(selector);
+ * }, '>_>');
+ *
+ * if (_.isError(elements)) {
+ * elements = [];
+ * }
+ */
+ var attempt = restParam(function(func, args) {
+ try {
+ return func.apply(undefined, args);
+ } catch(e) {
+ return isError(e) ? e : new Error(e);
+ }
+ });
+
+ /**
+ * Creates a function that invokes `func` with the `this` binding of `thisArg`
+ * and arguments of the created function. If `func` is a property name the
+ * created callback returns the property value for a given element. If `func`
+ * is an object the created callback returns `true` for elements that contain
+ * the equivalent object properties, otherwise it returns `false`.
+ *
+ * @static
+ * @memberOf _
+ * @alias iteratee
+ * @category Utility
+ * @param {*} [func=_.identity] The value to convert to a callback.
+ * @param {*} [thisArg] The `this` binding of `func`.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {Function} Returns the callback.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36 },
+ * { 'user': 'fred', 'age': 40 }
+ * ];
+ *
+ * // wrap to create custom callback shorthands
+ * _.callback = _.wrap(_.callback, function(callback, func, thisArg) {
+ * var match = /^(.+?)__([gl]t)(.+)$/.exec(func);
+ * if (!match) {
+ * return callback(func, thisArg);
+ * }
+ * return function(object) {
+ * return match[2] == 'gt'
+ * ? object[match[1]] > match[3]
+ * : object[match[1]] < match[3];
+ * };
+ * });
+ *
+ * _.filter(users, 'age__gt36');
+ * // => [{ 'user': 'fred', 'age': 40 }]
+ */
+ function callback(func, thisArg, guard) {
+ if (guard && isIterateeCall(func, thisArg, guard)) {
+ thisArg = null;
+ }
+ return isObjectLike(func)
+ ? matches(func)
+ : baseCallback(func, thisArg);
+ }
+
+ /**
+ * Creates a function that returns `value`.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {*} value The value to return from the new function.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var object = { 'user': 'fred' };
+ * var getter = _.constant(object);
+ *
+ * getter() === object;
+ * // => true
+ */
+ function constant(value) {
+ return function() {
+ return value;
+ };
+ }
+
+ /**
+ * This method returns the first argument provided to it.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {*} value Any value.
+ * @returns {*} Returns `value`.
+ * @example
+ *
+ * var object = { 'user': 'fred' };
+ *
+ * _.identity(object) === object;
+ * // => true
+ */
+ function identity(value) {
+ return value;
+ }
+
+ /**
+ * Creates a function that performs a deep comparison between a given object
+ * and `source`, returning `true` if the given object has equivalent property
+ * values, else `false`.
+ *
+ * **Note:** This method supports comparing arrays, booleans, `Date` objects,
+ * numbers, `Object` objects, regexes, and strings. Objects are compared by
+ * their own, not inherited, enumerable properties. For comparing a single
+ * own or inherited property value see `_.matchesProperty`.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {Object} source The object of property values to match.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36, 'active': true },
+ * { 'user': 'fred', 'age': 40, 'active': false }
+ * ];
+ *
+ * _.filter(users, _.matches({ 'age': 40, 'active': false }));
+ * // => [{ 'user': 'fred', 'age': 40, 'active': false }]
+ */
+ function matches(source) {
+ return baseMatches(baseClone(source, true));
+ }
+
+ /**
+ * Creates a function that compares the property value of `path` on a given
+ * object to `value`.
+ *
+ * **Note:** This method supports comparing arrays, booleans, `Date` objects,
+ * numbers, `Object` objects, regexes, and strings. Objects are compared by
+ * their own, not inherited, enumerable properties.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {Array|string} path The path of the property to get.
+ * @param {*} srcValue The value to match.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney' },
+ * { 'user': 'fred' }
+ * ];
+ *
+ * _.find(users, _.matchesProperty('user', 'fred'));
+ * // => { 'user': 'fred' }
+ */
+ function matchesProperty(path, srcValue) {
+ return baseMatchesProperty(path, baseClone(srcValue, true));
+ }
+
+ /**
+ * Creates a function that invokes the method at `path` on a given object.
+ * Any additional arguments are provided to the invoked method.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {Array|string} path The path of the method to invoke.
+ * @param {...*} [args] The arguments to invoke the method with.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var objects = [
+ * { 'a': { 'b': { 'c': _.constant(2) } } },
+ * { 'a': { 'b': { 'c': _.constant(1) } } }
+ * ];
+ *
+ * _.map(objects, _.method('a.b.c'));
+ * // => [2, 1]
+ *
+ * _.invoke(_.sortBy(objects, _.method(['a', 'b', 'c'])), 'a.b.c');
+ * // => [1, 2]
+ */
+ var method = restParam(function(path, args) {
+ return function(object) {
+ return invokePath(object, path, args);
+ };
+ });
+
+ /**
+ * The opposite of `_.method`; this method creates a function that invokes
+ * the method at a given path on `object`. Any additional arguments are
+ * provided to the invoked method.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {Object} object The object to query.
+ * @param {...*} [args] The arguments to invoke the method with.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var array = _.times(3, _.constant),
+ * object = { 'a': array, 'b': array, 'c': array };
+ *
+ * _.map(['a[2]', 'c[0]'], _.methodOf(object));
+ * // => [2, 0]
+ *
+ * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
+ * // => [2, 0]
+ */
+ var methodOf = restParam(function(object, args) {
+ return function(path) {
+ return invokePath(object, path, args);
+ };
+ });
+
+ /**
+ * Adds all own enumerable function properties of a source object to the
+ * destination object. If `object` is a function then methods are added to
+ * its prototype as well.
+ *
+ * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
+ * avoid conflicts caused by modifying the original.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {Function|Object} [object=lodash] The destination object.
+ * @param {Object} source The object of functions to add.
+ * @param {Object} [options] The options object.
+ * @param {boolean} [options.chain=true] Specify whether the functions added
+ * are chainable.
+ * @returns {Function|Object} Returns `object`.
+ * @example
+ *
+ * function vowels(string) {
+ * return _.filter(string, function(v) {
+ * return /[aeiou]/i.test(v);
+ * });
+ * }
+ *
+ * _.mixin({ 'vowels': vowels });
+ * _.vowels('fred');
+ * // => ['e']
+ *
+ * _('fred').vowels().value();
+ * // => ['e']
+ *
+ * _.mixin({ 'vowels': vowels }, { 'chain': false });
+ * _('fred').vowels();
+ * // => ['e']
+ */
+ function mixin(object, source, options) {
+ if (options == null) {
+ var isObj = isObject(source),
+ props = isObj ? keys(source) : null,
+ methodNames = (props && props.length) ? baseFunctions(source, props) : null;
+
+ if (!(methodNames ? methodNames.length : isObj)) {
+ methodNames = false;
+ options = source;
+ source = object;
+ object = this;
+ }
+ }
+ if (!methodNames) {
+ methodNames = baseFunctions(source, keys(source));
+ }
+ var chain = true,
+ index = -1,
+ isFunc = isFunction(object),
+ length = methodNames.length;
+
+ if (options === false) {
+ chain = false;
+ } else if (isObject(options) && 'chain' in options) {
+ chain = options.chain;
+ }
+ while (++index < length) {
+ var methodName = methodNames[index],
+ func = source[methodName];
+
+ object[methodName] = func;
+ if (isFunc) {
+ object.prototype[methodName] = (function(func) {
+ return function() {
+ var chainAll = this.__chain__;
+ if (chain || chainAll) {
+ var result = object(this.__wrapped__),
+ actions = result.__actions__ = arrayCopy(this.__actions__);
+
+ actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
+ result.__chain__ = chainAll;
+ return result;
+ }
+ var args = [this.value()];
+ push.apply(args, arguments);
+ return func.apply(object, args);
+ };
+ }(func));
+ }
+ }
+ return object;
+ }
+
+ /**
+ * Reverts the `_` variable to its previous value and returns a reference to
+ * the `lodash` function.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @returns {Function} Returns the `lodash` function.
+ * @example
+ *
+ * var lodash = _.noConflict();
+ */
+ function noConflict() {
+ context._ = oldDash;
+ return this;
+ }
+
+ /**
+ * A no-operation function that returns `undefined` regardless of the
+ * arguments it receives.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @example
+ *
+ * var object = { 'user': 'fred' };
+ *
+ * _.noop(object) === undefined;
+ * // => true
+ */
+ function noop() {
+ // No operation performed.
+ }
+
+ /**
+ * Creates a function that returns the property value at `path` on a
+ * given object.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {Array|string} path The path of the property to get.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var objects = [
+ * { 'a': { 'b': { 'c': 2 } } },
+ * { 'a': { 'b': { 'c': 1 } } }
+ * ];
+ *
+ * _.map(objects, _.property('a.b.c'));
+ * // => [2, 1]
+ *
+ * _.pluck(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c');
+ * // => [1, 2]
+ */
+ function property(path) {
+ return isKey(path) ? baseProperty(path) : basePropertyDeep(path);
+ }
+
+ /**
+ * The opposite of `_.property`; this method creates a function that returns
+ * the property value at a given path on `object`.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {Object} object The object to query.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var array = [0, 1, 2],
+ * object = { 'a': array, 'b': array, 'c': array };
+ *
+ * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
+ * // => [2, 0]
+ *
+ * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
+ * // => [2, 0]
+ */
+ function propertyOf(object) {
+ return function(path) {
+ return baseGet(object, toPath(path), path + '');
+ };
+ }
+
+ /**
+ * Creates an array of numbers (positive and/or negative) progressing from
+ * `start` up to, but not including, `end`. If `end` is not specified it is
+ * set to `start` with `start` then set to `0`. If `end` is less than `start`
+ * a zero-length range is created unless a negative `step` is specified.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {number} [start=0] The start of the range.
+ * @param {number} end The end of the range.
+ * @param {number} [step=1] The value to increment or decrement by.
+ * @returns {Array} Returns the new array of numbers.
+ * @example
+ *
+ * _.range(4);
+ * // => [0, 1, 2, 3]
+ *
+ * _.range(1, 5);
+ * // => [1, 2, 3, 4]
+ *
+ * _.range(0, 20, 5);
+ * // => [0, 5, 10, 15]
+ *
+ * _.range(0, -4, -1);
+ * // => [0, -1, -2, -3]
+ *
+ * _.range(1, 4, 0);
+ * // => [1, 1, 1]
+ *
+ * _.range(0);
+ * // => []
+ */
+ function range(start, end, step) {
+ if (step && isIterateeCall(start, end, step)) {
+ end = step = null;
+ }
+ start = +start || 0;
+ step = step == null ? 1 : (+step || 0);
+
+ if (end == null) {
+ end = start;
+ start = 0;
+ } else {
+ end = +end || 0;
+ }
+ // Use `Array(length)` so engines like Chakra and V8 avoid slower modes.
+ // See https://youtu.be/XAqIpGU8ZZk#t=17m25s for more details.
+ var index = -1,
+ length = nativeMax(ceil((end - start) / (step || 1)), 0),
+ result = Array(length);
+
+ while (++index < length) {
+ result[index] = start;
+ start += step;
+ }
+ return result;
+ }
+
+ /**
+ * Invokes the iteratee function `n` times, returning an array of the results
+ * of each invocation. The `iteratee` is bound to `thisArg` and invoked with
+ * one argument; (index).
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {number} n The number of times to invoke `iteratee`.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Array} Returns the array of results.
+ * @example
+ *
+ * var diceRolls = _.times(3, _.partial(_.random, 1, 6, false));
+ * // => [3, 6, 4]
+ *
+ * _.times(3, function(n) {
+ * mage.castSpell(n);
+ * });
+ * // => invokes `mage.castSpell(n)` three times with `n` of `0`, `1`, and `2`
+ *
+ * _.times(3, function(n) {
+ * this.cast(n);
+ * }, mage);
+ * // => also invokes `mage.castSpell(n)` three times
+ */
+ function times(n, iteratee, thisArg) {
+ n = floor(n);
+
+ // Exit early to avoid a JSC JIT bug in Safari 8
+ // where `Array(0)` is treated as `Array(1)`.
+ if (n < 1 || !nativeIsFinite(n)) {
+ return [];
+ }
+ var index = -1,
+ result = Array(nativeMin(n, MAX_ARRAY_LENGTH));
+
+ iteratee = bindCallback(iteratee, thisArg, 1);
+ while (++index < n) {
+ if (index < MAX_ARRAY_LENGTH) {
+ result[index] = iteratee(index);
+ } else {
+ iteratee(index);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Generates a unique ID. If `prefix` is provided the ID is appended to it.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {string} [prefix] The value to prefix the ID with.
+ * @returns {string} Returns the unique ID.
+ * @example
+ *
+ * _.uniqueId('contact_');
+ * // => 'contact_104'
+ *
+ * _.uniqueId();
+ * // => '105'
+ */
+ function uniqueId(prefix) {
+ var id = ++idCounter;
+ return baseToString(prefix) + id;
+ }
+
+ /*------------------------------------------------------------------------*/
+
+ /**
+ * Adds two numbers.
+ *
+ * @static
+ * @memberOf _
+ * @category Math
+ * @param {number} augend The first number to add.
+ * @param {number} addend The second number to add.
+ * @returns {number} Returns the sum.
+ * @example
+ *
+ * _.add(6, 4);
+ * // => 10
+ */
+ function add(augend, addend) {
+ return (+augend || 0) + (+addend || 0);
+ }
+
+ /**
+ * Gets the maximum value of `collection`. If `collection` is empty or falsey
+ * `-Infinity` is returned. If an iteratee function is provided it is invoked
+ * for each value in `collection` to generate the criterion by which the value
+ * is ranked. The `iteratee` is bound to `thisArg` and invoked with three
+ * arguments: (value, index, collection).
+ *
+ * If a property name is provided for `iteratee` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `iteratee` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Math
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [iteratee] The function invoked per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {*} Returns the maximum value.
+ * @example
+ *
+ * _.max([4, 2, 8, 6]);
+ * // => 8
+ *
+ * _.max([]);
+ * // => -Infinity
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36 },
+ * { 'user': 'fred', 'age': 40 }
+ * ];
+ *
+ * _.max(users, function(chr) {
+ * return chr.age;
+ * });
+ * // => { 'user': 'fred', 'age': 40 }
+ *
+ * // using the `_.property` callback shorthand
+ * _.max(users, 'age');
+ * // => { 'user': 'fred', 'age': 40 }
+ */
+ var max = createExtremum(gt, NEGATIVE_INFINITY);
+
+ /**
+ * Gets the minimum value of `collection`. If `collection` is empty or falsey
+ * `Infinity` is returned. If an iteratee function is provided it is invoked
+ * for each value in `collection` to generate the criterion by which the value
+ * is ranked. The `iteratee` is bound to `thisArg` and invoked with three
+ * arguments: (value, index, collection).
+ *
+ * If a property name is provided for `iteratee` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `iteratee` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Math
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [iteratee] The function invoked per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {*} Returns the minimum value.
+ * @example
+ *
+ * _.min([4, 2, 8, 6]);
+ * // => 2
+ *
+ * _.min([]);
+ * // => Infinity
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36 },
+ * { 'user': 'fred', 'age': 40 }
+ * ];
+ *
+ * _.min(users, function(chr) {
+ * return chr.age;
+ * });
+ * // => { 'user': 'barney', 'age': 36 }
+ *
+ * // using the `_.property` callback shorthand
+ * _.min(users, 'age');
+ * // => { 'user': 'barney', 'age': 36 }
+ */
+ var min = createExtremum(lt, POSITIVE_INFINITY);
+
+ /**
+ * Gets the sum of the values in `collection`.
+ *
+ * @static
+ * @memberOf _
+ * @category Math
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [iteratee] The function invoked per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {number} Returns the sum.
+ * @example
+ *
+ * _.sum([4, 6]);
+ * // => 10
+ *
+ * _.sum({ 'a': 4, 'b': 6 });
+ * // => 10
+ *
+ * var objects = [
+ * { 'n': 4 },
+ * { 'n': 6 }
+ * ];
+ *
+ * _.sum(objects, function(object) {
+ * return object.n;
+ * });
+ * // => 10
+ *
+ * // using the `_.property` callback shorthand
+ * _.sum(objects, 'n');
+ * // => 10
+ */
+ function sum(collection, iteratee, thisArg) {
+ if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
+ iteratee = null;
+ }
+ var callback = getCallback(),
+ noIteratee = iteratee == null;
+
+ if (!(noIteratee && callback === baseCallback)) {
+ noIteratee = false;
+ iteratee = callback(iteratee, thisArg, 3);
+ }
+ return noIteratee
+ ? arraySum(isArray(collection) ? collection : toIterable(collection))
+ : baseSum(collection, iteratee);
+ }
+
+ /*------------------------------------------------------------------------*/
+
+ // Ensure wrappers are instances of `baseLodash`.
+ lodash.prototype = baseLodash.prototype;
+
+ LodashWrapper.prototype = baseCreate(baseLodash.prototype);
+ LodashWrapper.prototype.constructor = LodashWrapper;
+
+ LazyWrapper.prototype = baseCreate(baseLodash.prototype);
+ LazyWrapper.prototype.constructor = LazyWrapper;
+
+ // Add functions to the `Map` cache.
+ MapCache.prototype['delete'] = mapDelete;
+ MapCache.prototype.get = mapGet;
+ MapCache.prototype.has = mapHas;
+ MapCache.prototype.set = mapSet;
+
+ // Add functions to the `Set` cache.
+ SetCache.prototype.push = cachePush;
+
+ // Assign cache to `_.memoize`.
+ memoize.Cache = MapCache;
+
+ // Add functions that return wrapped values when chaining.
+ lodash.after = after;
+ lodash.ary = ary;
+ lodash.assign = assign;
+ lodash.at = at;
+ lodash.before = before;
+ lodash.bind = bind;
+ lodash.bindAll = bindAll;
+ lodash.bindKey = bindKey;
+ lodash.callback = callback;
+ lodash.chain = chain;
+ lodash.chunk = chunk;
+ lodash.compact = compact;
+ lodash.constant = constant;
+ lodash.countBy = countBy;
+ lodash.create = create;
+ lodash.curry = curry;
+ lodash.curryRight = curryRight;
+ lodash.debounce = debounce;
+ lodash.defaults = defaults;
+ lodash.defer = defer;
+ lodash.delay = delay;
+ lodash.difference = difference;
+ lodash.drop = drop;
+ lodash.dropRight = dropRight;
+ lodash.dropRightWhile = dropRightWhile;
+ lodash.dropWhile = dropWhile;
+ lodash.fill = fill;
+ lodash.filter = filter;
+ lodash.flatten = flatten;
+ lodash.flattenDeep = flattenDeep;
+ lodash.flow = flow;
+ lodash.flowRight = flowRight;
+ lodash.forEach = forEach;
+ lodash.forEachRight = forEachRight;
+ lodash.forIn = forIn;
+ lodash.forInRight = forInRight;
+ lodash.forOwn = forOwn;
+ lodash.forOwnRight = forOwnRight;
+ lodash.functions = functions;
+ lodash.groupBy = groupBy;
+ lodash.indexBy = indexBy;
+ lodash.initial = initial;
+ lodash.intersection = intersection;
+ lodash.invert = invert;
+ lodash.invoke = invoke;
+ lodash.keys = keys;
+ lodash.keysIn = keysIn;
+ lodash.map = map;
+ lodash.mapKeys = mapKeys;
+ lodash.mapValues = mapValues;
+ lodash.matches = matches;
+ lodash.matchesProperty = matchesProperty;
+ lodash.memoize = memoize;
+ lodash.merge = merge;
+ lodash.method = method;
+ lodash.methodOf = methodOf;
+ lodash.mixin = mixin;
+ lodash.negate = negate;
+ lodash.omit = omit;
+ lodash.once = once;
+ lodash.pairs = pairs;
+ lodash.partial = partial;
+ lodash.partialRight = partialRight;
+ lodash.partition = partition;
+ lodash.pick = pick;
+ lodash.pluck = pluck;
+ lodash.property = property;
+ lodash.propertyOf = propertyOf;
+ lodash.pull = pull;
+ lodash.pullAt = pullAt;
+ lodash.range = range;
+ lodash.rearg = rearg;
+ lodash.reject = reject;
+ lodash.remove = remove;
+ lodash.rest = rest;
+ lodash.restParam = restParam;
+ lodash.set = set;
+ lodash.shuffle = shuffle;
+ lodash.slice = slice;
+ lodash.sortBy = sortBy;
+ lodash.sortByAll = sortByAll;
+ lodash.sortByOrder = sortByOrder;
+ lodash.spread = spread;
+ lodash.take = take;
+ lodash.takeRight = takeRight;
+ lodash.takeRightWhile = takeRightWhile;
+ lodash.takeWhile = takeWhile;
+ lodash.tap = tap;
+ lodash.throttle = throttle;
+ lodash.thru = thru;
+ lodash.times = times;
+ lodash.toArray = toArray;
+ lodash.toPlainObject = toPlainObject;
+ lodash.transform = transform;
+ lodash.union = union;
+ lodash.uniq = uniq;
+ lodash.unzip = unzip;
+ lodash.unzipWith = unzipWith;
+ lodash.values = values;
+ lodash.valuesIn = valuesIn;
+ lodash.where = where;
+ lodash.without = without;
+ lodash.wrap = wrap;
+ lodash.xor = xor;
+ lodash.zip = zip;
+ lodash.zipObject = zipObject;
+ lodash.zipWith = zipWith;
+
+ // Add aliases.
+ lodash.backflow = flowRight;
+ lodash.collect = map;
+ lodash.compose = flowRight;
+ lodash.each = forEach;
+ lodash.eachRight = forEachRight;
+ lodash.extend = assign;
+ lodash.iteratee = callback;
+ lodash.methods = functions;
+ lodash.object = zipObject;
+ lodash.select = filter;
+ lodash.tail = rest;
+ lodash.unique = uniq;
+
+ // Add functions to `lodash.prototype`.
+ mixin(lodash, lodash);
+
+ /*------------------------------------------------------------------------*/
+
+ // Add functions that return unwrapped values when chaining.
+ lodash.add = add;
+ lodash.attempt = attempt;
+ lodash.camelCase = camelCase;
+ lodash.capitalize = capitalize;
+ lodash.clone = clone;
+ lodash.cloneDeep = cloneDeep;
+ lodash.deburr = deburr;
+ lodash.endsWith = endsWith;
+ lodash.escape = escape;
+ lodash.escapeRegExp = escapeRegExp;
+ lodash.every = every;
+ lodash.find = find;
+ lodash.findIndex = findIndex;
+ lodash.findKey = findKey;
+ lodash.findLast = findLast;
+ lodash.findLastIndex = findLastIndex;
+ lodash.findLastKey = findLastKey;
+ lodash.findWhere = findWhere;
+ lodash.first = first;
+ lodash.get = get;
+ lodash.gt = gt;
+ lodash.gte = gte;
+ lodash.has = has;
+ lodash.identity = identity;
+ lodash.includes = includes;
+ lodash.indexOf = indexOf;
+ lodash.inRange = inRange;
+ lodash.isArguments = isArguments;
+ lodash.isArray = isArray;
+ lodash.isBoolean = isBoolean;
+ lodash.isDate = isDate;
+ lodash.isElement = isElement;
+ lodash.isEmpty = isEmpty;
+ lodash.isEqual = isEqual;
+ lodash.isError = isError;
+ lodash.isFinite = isFinite;
+ lodash.isFunction = isFunction;
+ lodash.isMatch = isMatch;
+ lodash.isNaN = isNaN;
+ lodash.isNative = isNative;
+ lodash.isNull = isNull;
+ lodash.isNumber = isNumber;
+ lodash.isObject = isObject;
+ lodash.isPlainObject = isPlainObject;
+ lodash.isRegExp = isRegExp;
+ lodash.isString = isString;
+ lodash.isTypedArray = isTypedArray;
+ lodash.isUndefined = isUndefined;
+ lodash.kebabCase = kebabCase;
+ lodash.last = last;
+ lodash.lastIndexOf = lastIndexOf;
+ lodash.lt = lt;
+ lodash.lte = lte;
+ lodash.max = max;
+ lodash.min = min;
+ lodash.noConflict = noConflict;
+ lodash.noop = noop;
+ lodash.now = now;
+ lodash.pad = pad;
+ lodash.padLeft = padLeft;
+ lodash.padRight = padRight;
+ lodash.parseInt = parseInt;
+ lodash.random = random;
+ lodash.reduce = reduce;
+ lodash.reduceRight = reduceRight;
+ lodash.repeat = repeat;
+ lodash.result = result;
+ lodash.runInContext = runInContext;
+ lodash.size = size;
+ lodash.snakeCase = snakeCase;
+ lodash.some = some;
+ lodash.sortedIndex = sortedIndex;
+ lodash.sortedLastIndex = sortedLastIndex;
+ lodash.startCase = startCase;
+ lodash.startsWith = startsWith;
+ lodash.sum = sum;
+ lodash.template = template;
+ lodash.trim = trim;
+ lodash.trimLeft = trimLeft;
+ lodash.trimRight = trimRight;
+ lodash.trunc = trunc;
+ lodash.unescape = unescape;
+ lodash.uniqueId = uniqueId;
+ lodash.words = words;
+
+ // Add aliases.
+ lodash.all = every;
+ lodash.any = some;
+ lodash.contains = includes;
+ lodash.eq = isEqual;
+ lodash.detect = find;
+ lodash.foldl = reduce;
+ lodash.foldr = reduceRight;
+ lodash.head = first;
+ lodash.include = includes;
+ lodash.inject = reduce;
+
+ mixin(lodash, (function() {
+ var source = {};
+ baseForOwn(lodash, function(func, methodName) {
+ if (!lodash.prototype[methodName]) {
+ source[methodName] = func;
+ }
+ });
+ return source;
+ }()), false);
+
+ /*------------------------------------------------------------------------*/
+
+ // Add functions capable of returning wrapped and unwrapped values when chaining.
+ lodash.sample = sample;
+
+ lodash.prototype.sample = function(n) {
+ if (!this.__chain__ && n == null) {
+ return sample(this.value());
+ }
+ return this.thru(function(value) {
+ return sample(value, n);
+ });
+ };
+
+ /*------------------------------------------------------------------------*/
+
+ /**
+ * The semantic version number.
+ *
+ * @static
+ * @memberOf _
+ * @type string
+ */
+ lodash.VERSION = VERSION;
+
+ // Assign default placeholders.
+ arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
+ lodash[methodName].placeholder = lodash;
+ });
+
+ // Add `LazyWrapper` methods that accept an `iteratee` value.
+ arrayEach(['dropWhile', 'filter', 'map', 'takeWhile'], function(methodName, type) {
+ var isFilter = type != LAZY_MAP_FLAG,
+ isDropWhile = type == LAZY_DROP_WHILE_FLAG;
+
+ LazyWrapper.prototype[methodName] = function(iteratee, thisArg) {
+ var filtered = this.__filtered__,
+ result = (filtered && isDropWhile) ? new LazyWrapper(this) : this.clone(),
+ iteratees = result.__iteratees__ || (result.__iteratees__ = []);
+
+ iteratees.push({
+ 'done': false,
+ 'count': 0,
+ 'index': 0,
+ 'iteratee': getCallback(iteratee, thisArg, 1),
+ 'limit': -1,
+ 'type': type
+ });
+
+ result.__filtered__ = filtered || isFilter;
+ return result;
+ };
+ });
+
+ // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
+ arrayEach(['drop', 'take'], function(methodName, index) {
+ var whileName = methodName + 'While';
+
+ LazyWrapper.prototype[methodName] = function(n) {
+ var filtered = this.__filtered__,
+ result = (filtered && !index) ? this.dropWhile() : this.clone();
+
+ n = n == null ? 1 : nativeMax(floor(n) || 0, 0);
+ if (filtered) {
+ if (index) {
+ result.__takeCount__ = nativeMin(result.__takeCount__, n);
+ } else {
+ last(result.__iteratees__).limit = n;
+ }
+ } else {
+ var views = result.__views__ || (result.__views__ = []);
+ views.push({ 'size': n, 'type': methodName + (result.__dir__ < 0 ? 'Right' : '') });
+ }
+ return result;
+ };
+
+ LazyWrapper.prototype[methodName + 'Right'] = function(n) {
+ return this.reverse()[methodName](n).reverse();
+ };
+
+ LazyWrapper.prototype[methodName + 'RightWhile'] = function(predicate, thisArg) {
+ return this.reverse()[whileName](predicate, thisArg).reverse();
+ };
+ });
+
+ // Add `LazyWrapper` methods for `_.first` and `_.last`.
+ arrayEach(['first', 'last'], function(methodName, index) {
+ var takeName = 'take' + (index ? 'Right' : '');
+
+ LazyWrapper.prototype[methodName] = function() {
+ return this[takeName](1).value()[0];
+ };
+ });
+
+ // Add `LazyWrapper` methods for `_.initial` and `_.rest`.
+ arrayEach(['initial', 'rest'], function(methodName, index) {
+ var dropName = 'drop' + (index ? '' : 'Right');
+
+ LazyWrapper.prototype[methodName] = function() {
+ return this[dropName](1);
+ };
+ });
+
+ // Add `LazyWrapper` methods for `_.pluck` and `_.where`.
+ arrayEach(['pluck', 'where'], function(methodName, index) {
+ var operationName = index ? 'filter' : 'map',
+ createCallback = index ? baseMatches : property;
+
+ LazyWrapper.prototype[methodName] = function(value) {
+ return this[operationName](createCallback(value));
+ };
+ });
+
+ LazyWrapper.prototype.compact = function() {
+ return this.filter(identity);
+ };
+
+ LazyWrapper.prototype.reject = function(predicate, thisArg) {
+ predicate = getCallback(predicate, thisArg, 1);
+ return this.filter(function(value) {
+ return !predicate(value);
+ });
+ };
+
+ LazyWrapper.prototype.slice = function(start, end) {
+ start = start == null ? 0 : (+start || 0);
+
+ var result = this;
+ if (start < 0) {
+ result = this.takeRight(-start);
+ } else if (start) {
+ result = this.drop(start);
+ }
+ if (end !== undefined) {
+ end = (+end || 0);
+ result = end < 0 ? result.dropRight(-end) : result.take(end - start);
+ }
+ return result;
+ };
+
+ LazyWrapper.prototype.toArray = function() {
+ return this.drop(0);
+ };
+
+ // Add `LazyWrapper` methods to `lodash.prototype`.
+ baseForOwn(LazyWrapper.prototype, function(func, methodName) {
+ var lodashFunc = lodash[methodName];
+ if (!lodashFunc) {
+ return;
+ }
+ var checkIteratee = /^(?:filter|map|reject)|While$/.test(methodName),
+ retUnwrapped = /^(?:first|last)$/.test(methodName);
+
+ lodash.prototype[methodName] = function() {
+ var args = arguments,
+ chainAll = this.__chain__,
+ value = this.__wrapped__,
+ isHybrid = !!this.__actions__.length,
+ isLazy = value instanceof LazyWrapper,
+ iteratee = args[0],
+ useLazy = isLazy || isArray(value);
+
+ if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
+ // avoid lazy use if the iteratee has a "length" value other than `1`
+ isLazy = useLazy = false;
+ }
+ var onlyLazy = isLazy && !isHybrid;
+ if (retUnwrapped && !chainAll) {
+ return onlyLazy
+ ? func.call(value)
+ : lodashFunc.call(lodash, this.value());
+ }
+ var interceptor = function(value) {
+ var otherArgs = [value];
+ push.apply(otherArgs, args);
+ return lodashFunc.apply(lodash, otherArgs);
+ };
+ if (useLazy) {
+ var wrapper = onlyLazy ? value : new LazyWrapper(this),
+ result = func.apply(wrapper, args);
+
+ if (!retUnwrapped && (isHybrid || result.__actions__)) {
+ var actions = result.__actions__ || (result.__actions__ = []);
+ actions.push({ 'func': thru, 'args': [interceptor], 'thisArg': lodash });
+ }
+ return new LodashWrapper(result, chainAll);
+ }
+ return this.thru(interceptor);
+ };
+ });
+
+ // Add `Array` and `String` methods to `lodash.prototype`.
+ arrayEach(['concat', 'join', 'pop', 'push', 'replace', 'shift', 'sort', 'splice', 'split', 'unshift'], function(methodName) {
+ var func = (/^(?:replace|split)$/.test(methodName) ? stringProto : arrayProto)[methodName],
+ chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
+ retUnwrapped = /^(?:join|pop|replace|shift)$/.test(methodName);
+
+ lodash.prototype[methodName] = function() {
+ var args = arguments;
+ if (retUnwrapped && !this.__chain__) {
+ return func.apply(this.value(), args);
+ }
+ return this[chainName](function(value) {
+ return func.apply(value, args);
+ });
+ };
+ });
+
+ // Map minified function names to their real names.
+ baseForOwn(LazyWrapper.prototype, function(func, methodName) {
+ var lodashFunc = lodash[methodName];
+ if (lodashFunc) {
+ var key = lodashFunc.name,
+ names = realNames[key] || (realNames[key] = []);
+
+ names.push({ 'name': methodName, 'func': lodashFunc });
+ }
+ });
+
+ realNames[createHybridWrapper(null, BIND_KEY_FLAG).name] = [{ 'name': 'wrapper', 'func': null }];
+
+ // Add functions to the lazy wrapper.
+ LazyWrapper.prototype.clone = lazyClone;
+ LazyWrapper.prototype.reverse = lazyReverse;
+ LazyWrapper.prototype.value = lazyValue;
+
+ // Add chaining functions to the `lodash` wrapper.
+ lodash.prototype.chain = wrapperChain;
+ lodash.prototype.commit = wrapperCommit;
+ lodash.prototype.plant = wrapperPlant;
+ lodash.prototype.reverse = wrapperReverse;
+ lodash.prototype.toString = wrapperToString;
+ lodash.prototype.run = lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
+
+ // Add function aliases to the `lodash` wrapper.
+ lodash.prototype.collect = lodash.prototype.map;
+ lodash.prototype.head = lodash.prototype.first;
+ lodash.prototype.select = lodash.prototype.filter;
+ lodash.prototype.tail = lodash.prototype.rest;
+
+ return lodash;
+ }
+
+ /*--------------------------------------------------------------------------*/
+
+ // Export lodash.
+ var _ = runInContext();
+
+ // Some AMD build optimizers like r.js check for condition patterns like the following:
+ if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
+ // Expose lodash to the global object when an AMD loader is present to avoid
+ // errors in cases where lodash is loaded by a script tag and not intended
+ // as an AMD module. See http://requirejs.org/docs/errors.html#mismatch for
+ // more details.
+ root._ = _;
+
+ // Define as an anonymous module so, through path mapping, it can be
+ // referenced as the "underscore" module.
+ define(function() {
+ return _;
+ });
+ }
+ // Check for `exports` after `define` in case a build optimizer adds an `exports` object.
+ else if (freeExports && freeModule) {
+ // Export for Node.js or RingoJS.
+ if (moduleExports) {
+ (freeModule.exports = _)._ = _;
+ }
+ // Export for Rhino with CommonJS support.
+ else {
+ freeExports._ = _;
+ }
+ }
+ else {
+ // Export for a browser or Rhino.
+ root._ = _;
+ }
+}.call(this));
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/LazyWrapper.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/LazyWrapper.js
new file mode 100644
index 00000000000..4c370973401
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/LazyWrapper.js
@@ -0,0 +1,27 @@
+var baseCreate = require('./baseCreate'),
+ baseLodash = require('./baseLodash');
+
+/** Used as references for `-Infinity` and `Infinity`. */
+var POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
+
+/**
+ * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
+ *
+ * @private
+ * @param {*} value The value to wrap.
+ */
+function LazyWrapper(value) {
+ this.__wrapped__ = value;
+ this.__actions__ = null;
+ this.__dir__ = 1;
+ this.__dropCount__ = 0;
+ this.__filtered__ = false;
+ this.__iteratees__ = null;
+ this.__takeCount__ = POSITIVE_INFINITY;
+ this.__views__ = null;
+}
+
+LazyWrapper.prototype = baseCreate(baseLodash.prototype);
+LazyWrapper.prototype.constructor = LazyWrapper;
+
+module.exports = LazyWrapper;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/LodashWrapper.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/LodashWrapper.js
new file mode 100644
index 00000000000..ab06bc76145
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/LodashWrapper.js
@@ -0,0 +1,21 @@
+var baseCreate = require('./baseCreate'),
+ baseLodash = require('./baseLodash');
+
+/**
+ * The base constructor for creating `lodash` wrapper objects.
+ *
+ * @private
+ * @param {*} value The value to wrap.
+ * @param {boolean} [chainAll] Enable chaining for all wrapper methods.
+ * @param {Array} [actions=[]] Actions to peform to resolve the unwrapped value.
+ */
+function LodashWrapper(value, chainAll, actions) {
+ this.__wrapped__ = value;
+ this.__actions__ = actions || [];
+ this.__chain__ = !!chainAll;
+}
+
+LodashWrapper.prototype = baseCreate(baseLodash.prototype);
+LodashWrapper.prototype.constructor = LodashWrapper;
+
+module.exports = LodashWrapper;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/MapCache.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/MapCache.js
new file mode 100644
index 00000000000..1d7ab98171f
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/MapCache.js
@@ -0,0 +1,24 @@
+var mapDelete = require('./mapDelete'),
+ mapGet = require('./mapGet'),
+ mapHas = require('./mapHas'),
+ mapSet = require('./mapSet');
+
+/**
+ * Creates a cache object to store key/value pairs.
+ *
+ * @private
+ * @static
+ * @name Cache
+ * @memberOf _.memoize
+ */
+function MapCache() {
+ this.__data__ = {};
+}
+
+// Add functions to the `Map` cache.
+MapCache.prototype['delete'] = mapDelete;
+MapCache.prototype.get = mapGet;
+MapCache.prototype.has = mapHas;
+MapCache.prototype.set = mapSet;
+
+module.exports = MapCache;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/SetCache.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/SetCache.js
new file mode 100644
index 00000000000..ae29c55bf3a
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/SetCache.js
@@ -0,0 +1,29 @@
+var cachePush = require('./cachePush'),
+ getNative = require('./getNative');
+
+/** Native method references. */
+var Set = getNative(global, 'Set');
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeCreate = getNative(Object, 'create');
+
+/**
+ *
+ * Creates a cache object to store unique values.
+ *
+ * @private
+ * @param {Array} [values] The values to cache.
+ */
+function SetCache(values) {
+ var length = values ? values.length : 0;
+
+ this.data = { 'hash': nativeCreate(null), 'set': new Set };
+ while (length--) {
+ this.push(values[length]);
+ }
+}
+
+// Add functions to the `Set` cache.
+SetCache.prototype.push = cachePush;
+
+module.exports = SetCache;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arrayCopy.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arrayCopy.js
new file mode 100644
index 00000000000..fa7067f9fa2
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arrayCopy.js
@@ -0,0 +1,20 @@
+/**
+ * Copies the values of `source` to `array`.
+ *
+ * @private
+ * @param {Array} source The array to copy values from.
+ * @param {Array} [array=[]] The array to copy values to.
+ * @returns {Array} Returns `array`.
+ */
+function arrayCopy(source, array) {
+ var index = -1,
+ length = source.length;
+
+ array || (array = Array(length));
+ while (++index < length) {
+ array[index] = source[index];
+ }
+ return array;
+}
+
+module.exports = arrayCopy;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arrayEach.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arrayEach.js
new file mode 100644
index 00000000000..0f513824240
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arrayEach.js
@@ -0,0 +1,22 @@
+/**
+ * A specialized version of `_.forEach` for arrays without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns `array`.
+ */
+function arrayEach(array, iteratee) {
+ var index = -1,
+ length = array.length;
+
+ while (++index < length) {
+ if (iteratee(array[index], index, array) === false) {
+ break;
+ }
+ }
+ return array;
+}
+
+module.exports = arrayEach;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arrayEachRight.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arrayEachRight.js
new file mode 100644
index 00000000000..367e066d80c
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arrayEachRight.js
@@ -0,0 +1,21 @@
+/**
+ * A specialized version of `_.forEachRight` for arrays without support for
+ * callback shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns `array`.
+ */
+function arrayEachRight(array, iteratee) {
+ var length = array.length;
+
+ while (length--) {
+ if (iteratee(array[length], length, array) === false) {
+ break;
+ }
+ }
+ return array;
+}
+
+module.exports = arrayEachRight;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arrayEvery.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arrayEvery.js
new file mode 100644
index 00000000000..3fe6ed2771c
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arrayEvery.js
@@ -0,0 +1,23 @@
+/**
+ * A specialized version of `_.every` for arrays without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {boolean} Returns `true` if all elements pass the predicate check,
+ * else `false`.
+ */
+function arrayEvery(array, predicate) {
+ var index = -1,
+ length = array.length;
+
+ while (++index < length) {
+ if (!predicate(array[index], index, array)) {
+ return false;
+ }
+ }
+ return true;
+}
+
+module.exports = arrayEvery;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arrayExtremum.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arrayExtremum.js
new file mode 100644
index 00000000000..e45badbda1b
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arrayExtremum.js
@@ -0,0 +1,30 @@
+/**
+ * A specialized version of `baseExtremum` for arrays which invokes `iteratee`
+ * with one argument: (value).
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {Function} comparator The function used to compare values.
+ * @param {*} exValue The initial extremum value.
+ * @returns {*} Returns the extremum value.
+ */
+function arrayExtremum(array, iteratee, comparator, exValue) {
+ var index = -1,
+ length = array.length,
+ computed = exValue,
+ result = computed;
+
+ while (++index < length) {
+ var value = array[index],
+ current = +iteratee(value);
+
+ if (comparator(current, computed)) {
+ computed = current;
+ result = value;
+ }
+ }
+ return result;
+}
+
+module.exports = arrayExtremum;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arrayFilter.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arrayFilter.js
new file mode 100644
index 00000000000..e14fe06900e
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arrayFilter.js
@@ -0,0 +1,25 @@
+/**
+ * A specialized version of `_.filter` for arrays without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {Array} Returns the new filtered array.
+ */
+function arrayFilter(array, predicate) {
+ var index = -1,
+ length = array.length,
+ resIndex = -1,
+ result = [];
+
+ while (++index < length) {
+ var value = array[index];
+ if (predicate(value, index, array)) {
+ result[++resIndex] = value;
+ }
+ }
+ return result;
+}
+
+module.exports = arrayFilter;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arrayMap.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arrayMap.js
new file mode 100644
index 00000000000..777c7c9f356
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arrayMap.js
@@ -0,0 +1,21 @@
+/**
+ * A specialized version of `_.map` for arrays without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns the new mapped array.
+ */
+function arrayMap(array, iteratee) {
+ var index = -1,
+ length = array.length,
+ result = Array(length);
+
+ while (++index < length) {
+ result[index] = iteratee(array[index], index, array);
+ }
+ return result;
+}
+
+module.exports = arrayMap;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arrayReduce.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arrayReduce.js
new file mode 100644
index 00000000000..f948c8e5284
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arrayReduce.js
@@ -0,0 +1,26 @@
+/**
+ * A specialized version of `_.reduce` for arrays without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {*} [accumulator] The initial value.
+ * @param {boolean} [initFromArray] Specify using the first element of `array`
+ * as the initial value.
+ * @returns {*} Returns the accumulated value.
+ */
+function arrayReduce(array, iteratee, accumulator, initFromArray) {
+ var index = -1,
+ length = array.length;
+
+ if (initFromArray && length) {
+ accumulator = array[++index];
+ }
+ while (++index < length) {
+ accumulator = iteratee(accumulator, array[index], index, array);
+ }
+ return accumulator;
+}
+
+module.exports = arrayReduce;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arrayReduceRight.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arrayReduceRight.js
new file mode 100644
index 00000000000..d4d68dff014
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arrayReduceRight.js
@@ -0,0 +1,24 @@
+/**
+ * A specialized version of `_.reduceRight` for arrays without support for
+ * callback shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {*} [accumulator] The initial value.
+ * @param {boolean} [initFromArray] Specify using the last element of `array`
+ * as the initial value.
+ * @returns {*} Returns the accumulated value.
+ */
+function arrayReduceRight(array, iteratee, accumulator, initFromArray) {
+ var length = array.length;
+ if (initFromArray && length) {
+ accumulator = array[--length];
+ }
+ while (length--) {
+ accumulator = iteratee(accumulator, array[length], length, array);
+ }
+ return accumulator;
+}
+
+module.exports = arrayReduceRight;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arraySome.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arraySome.js
new file mode 100644
index 00000000000..f7a0bb58efd
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arraySome.js
@@ -0,0 +1,23 @@
+/**
+ * A specialized version of `_.some` for arrays without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {boolean} Returns `true` if any element passes the predicate check,
+ * else `false`.
+ */
+function arraySome(array, predicate) {
+ var index = -1,
+ length = array.length;
+
+ while (++index < length) {
+ if (predicate(array[index], index, array)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+module.exports = arraySome;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arraySum.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arraySum.js
new file mode 100644
index 00000000000..59ccd999c3d
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/arraySum.js
@@ -0,0 +1,18 @@
+/**
+ * A specialized version of `_.sum` for arrays without support for iteratees.
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @returns {number} Returns the sum.
+ */
+function arraySum(array) {
+ var length = array.length,
+ result = 0;
+
+ while (length--) {
+ result += +array[length] || 0;
+ }
+ return result;
+}
+
+module.exports = arraySum;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/assignDefaults.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/assignDefaults.js
new file mode 100644
index 00000000000..affd993ad15
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/assignDefaults.js
@@ -0,0 +1,13 @@
+/**
+ * Used by `_.defaults` to customize its `_.assign` use.
+ *
+ * @private
+ * @param {*} objectValue The destination object property value.
+ * @param {*} sourceValue The source object property value.
+ * @returns {*} Returns the value to assign to the destination object.
+ */
+function assignDefaults(objectValue, sourceValue) {
+ return objectValue === undefined ? sourceValue : objectValue;
+}
+
+module.exports = assignDefaults;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/assignOwnDefaults.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/assignOwnDefaults.js
new file mode 100644
index 00000000000..682c460d721
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/assignOwnDefaults.js
@@ -0,0 +1,26 @@
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Used by `_.template` to customize its `_.assign` use.
+ *
+ * **Note:** This function is like `assignDefaults` except that it ignores
+ * inherited property values when checking if a property is `undefined`.
+ *
+ * @private
+ * @param {*} objectValue The destination object property value.
+ * @param {*} sourceValue The source object property value.
+ * @param {string} key The key associated with the object and source values.
+ * @param {Object} object The destination object.
+ * @returns {*} Returns the value to assign to the destination object.
+ */
+function assignOwnDefaults(objectValue, sourceValue, key, object) {
+ return (objectValue === undefined || !hasOwnProperty.call(object, key))
+ ? sourceValue
+ : objectValue;
+}
+
+module.exports = assignOwnDefaults;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/assignWith.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/assignWith.js
new file mode 100644
index 00000000000..d2b261ad2bb
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/assignWith.js
@@ -0,0 +1,32 @@
+var keys = require('../object/keys');
+
+/**
+ * A specialized version of `_.assign` for customizing assigned values without
+ * support for argument juggling, multiple sources, and `this` binding `customizer`
+ * functions.
+ *
+ * @private
+ * @param {Object} object The destination object.
+ * @param {Object} source The source object.
+ * @param {Function} customizer The function to customize assigned values.
+ * @returns {Object} Returns `object`.
+ */
+function assignWith(object, source, customizer) {
+ var index = -1,
+ props = keys(source),
+ length = props.length;
+
+ while (++index < length) {
+ var key = props[index],
+ value = object[key],
+ result = customizer(value, source[key], key, object, source);
+
+ if ((result === result ? (result !== value) : (value === value)) ||
+ (value === undefined && !(key in object))) {
+ object[key] = result;
+ }
+ }
+ return object;
+}
+
+module.exports = assignWith;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseAssign.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseAssign.js
new file mode 100644
index 00000000000..cfad6e0c304
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseAssign.js
@@ -0,0 +1,19 @@
+var baseCopy = require('./baseCopy'),
+ keys = require('../object/keys');
+
+/**
+ * The base implementation of `_.assign` without support for argument juggling,
+ * multiple sources, and `customizer` functions.
+ *
+ * @private
+ * @param {Object} object The destination object.
+ * @param {Object} source The source object.
+ * @returns {Object} Returns `object`.
+ */
+function baseAssign(object, source) {
+ return source == null
+ ? object
+ : baseCopy(source, keys(source), object);
+}
+
+module.exports = baseAssign;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseAt.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseAt.js
new file mode 100644
index 00000000000..bbafd1d5ad2
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseAt.js
@@ -0,0 +1,32 @@
+var isArrayLike = require('./isArrayLike'),
+ isIndex = require('./isIndex');
+
+/**
+ * The base implementation of `_.at` without support for string collections
+ * and individual key arguments.
+ *
+ * @private
+ * @param {Array|Object} collection The collection to iterate over.
+ * @param {number[]|string[]} props The property names or indexes of elements to pick.
+ * @returns {Array} Returns the new array of picked elements.
+ */
+function baseAt(collection, props) {
+ var index = -1,
+ isNil = collection == null,
+ isArr = !isNil && isArrayLike(collection),
+ length = isArr ? collection.length : 0,
+ propsLength = props.length,
+ result = Array(propsLength);
+
+ while(++index < propsLength) {
+ var key = props[index];
+ if (isArr) {
+ result[index] = isIndex(key, length) ? collection[key] : undefined;
+ } else {
+ result[index] = isNil ? undefined : collection[key];
+ }
+ }
+ return result;
+}
+
+module.exports = baseAt;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseCallback.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseCallback.js
new file mode 100644
index 00000000000..67fe087c4ac
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseCallback.js
@@ -0,0 +1,35 @@
+var baseMatches = require('./baseMatches'),
+ baseMatchesProperty = require('./baseMatchesProperty'),
+ bindCallback = require('./bindCallback'),
+ identity = require('../utility/identity'),
+ property = require('../utility/property');
+
+/**
+ * The base implementation of `_.callback` which supports specifying the
+ * number of arguments to provide to `func`.
+ *
+ * @private
+ * @param {*} [func=_.identity] The value to convert to a callback.
+ * @param {*} [thisArg] The `this` binding of `func`.
+ * @param {number} [argCount] The number of arguments to provide to `func`.
+ * @returns {Function} Returns the callback.
+ */
+function baseCallback(func, thisArg, argCount) {
+ var type = typeof func;
+ if (type == 'function') {
+ return thisArg === undefined
+ ? func
+ : bindCallback(func, thisArg, argCount);
+ }
+ if (func == null) {
+ return identity;
+ }
+ if (type == 'object') {
+ return baseMatches(func);
+ }
+ return thisArg === undefined
+ ? property(func)
+ : baseMatchesProperty(func, thisArg);
+}
+
+module.exports = baseCallback;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseClone.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseClone.js
new file mode 100644
index 00000000000..a747e85b26a
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseClone.js
@@ -0,0 +1,128 @@
+var arrayCopy = require('./arrayCopy'),
+ arrayEach = require('./arrayEach'),
+ baseAssign = require('./baseAssign'),
+ baseForOwn = require('./baseForOwn'),
+ initCloneArray = require('./initCloneArray'),
+ initCloneByTag = require('./initCloneByTag'),
+ initCloneObject = require('./initCloneObject'),
+ isArray = require('../lang/isArray'),
+ isObject = require('../lang/isObject');
+
+/** `Object#toString` result references. */
+var argsTag = '[object Arguments]',
+ arrayTag = '[object Array]',
+ boolTag = '[object Boolean]',
+ dateTag = '[object Date]',
+ errorTag = '[object Error]',
+ funcTag = '[object Function]',
+ mapTag = '[object Map]',
+ numberTag = '[object Number]',
+ objectTag = '[object Object]',
+ regexpTag = '[object RegExp]',
+ setTag = '[object Set]',
+ stringTag = '[object String]',
+ weakMapTag = '[object WeakMap]';
+
+var arrayBufferTag = '[object ArrayBuffer]',
+ float32Tag = '[object Float32Array]',
+ float64Tag = '[object Float64Array]',
+ int8Tag = '[object Int8Array]',
+ int16Tag = '[object Int16Array]',
+ int32Tag = '[object Int32Array]',
+ uint8Tag = '[object Uint8Array]',
+ uint8ClampedTag = '[object Uint8ClampedArray]',
+ uint16Tag = '[object Uint16Array]',
+ uint32Tag = '[object Uint32Array]';
+
+/** Used to identify `toStringTag` values supported by `_.clone`. */
+var cloneableTags = {};
+cloneableTags[argsTag] = cloneableTags[arrayTag] =
+cloneableTags[arrayBufferTag] = cloneableTags[boolTag] =
+cloneableTags[dateTag] = cloneableTags[float32Tag] =
+cloneableTags[float64Tag] = cloneableTags[int8Tag] =
+cloneableTags[int16Tag] = cloneableTags[int32Tag] =
+cloneableTags[numberTag] = cloneableTags[objectTag] =
+cloneableTags[regexpTag] = cloneableTags[stringTag] =
+cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
+cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
+cloneableTags[errorTag] = cloneableTags[funcTag] =
+cloneableTags[mapTag] = cloneableTags[setTag] =
+cloneableTags[weakMapTag] = false;
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * The base implementation of `_.clone` without support for argument juggling
+ * and `this` binding `customizer` functions.
+ *
+ * @private
+ * @param {*} value The value to clone.
+ * @param {boolean} [isDeep] Specify a deep clone.
+ * @param {Function} [customizer] The function to customize cloning values.
+ * @param {string} [key] The key of `value`.
+ * @param {Object} [object] The object `value` belongs to.
+ * @param {Array} [stackA=[]] Tracks traversed source objects.
+ * @param {Array} [stackB=[]] Associates clones with source counterparts.
+ * @returns {*} Returns the cloned value.
+ */
+function baseClone(value, isDeep, customizer, key, object, stackA, stackB) {
+ var result;
+ if (customizer) {
+ result = object ? customizer(value, key, object) : customizer(value);
+ }
+ if (result !== undefined) {
+ return result;
+ }
+ if (!isObject(value)) {
+ return value;
+ }
+ var isArr = isArray(value);
+ if (isArr) {
+ result = initCloneArray(value);
+ if (!isDeep) {
+ return arrayCopy(value, result);
+ }
+ } else {
+ var tag = objToString.call(value),
+ isFunc = tag == funcTag;
+
+ if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
+ result = initCloneObject(isFunc ? {} : value);
+ if (!isDeep) {
+ return baseAssign(result, value);
+ }
+ } else {
+ return cloneableTags[tag]
+ ? initCloneByTag(value, tag, isDeep)
+ : (object ? value : {});
+ }
+ }
+ // Check for circular references and return corresponding clone.
+ stackA || (stackA = []);
+ stackB || (stackB = []);
+
+ var length = stackA.length;
+ while (length--) {
+ if (stackA[length] == value) {
+ return stackB[length];
+ }
+ }
+ // Add the source value to the stack of traversed objects and associate it with its clone.
+ stackA.push(value);
+ stackB.push(result);
+
+ // Recursively populate clone (susceptible to call stack limits).
+ (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) {
+ result[key] = baseClone(subValue, isDeep, customizer, key, value, stackA, stackB);
+ });
+ return result;
+}
+
+module.exports = baseClone;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseCompareAscending.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseCompareAscending.js
new file mode 100644
index 00000000000..c8259c72dc7
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseCompareAscending.js
@@ -0,0 +1,34 @@
+/**
+ * The base implementation of `compareAscending` which compares values and
+ * sorts them in ascending order without guaranteeing a stable sort.
+ *
+ * @private
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @returns {number} Returns the sort order indicator for `value`.
+ */
+function baseCompareAscending(value, other) {
+ if (value !== other) {
+ var valIsNull = value === null,
+ valIsUndef = value === undefined,
+ valIsReflexive = value === value;
+
+ var othIsNull = other === null,
+ othIsUndef = other === undefined,
+ othIsReflexive = other === other;
+
+ if ((value > other && !othIsNull) || !valIsReflexive ||
+ (valIsNull && !othIsUndef && othIsReflexive) ||
+ (valIsUndef && othIsReflexive)) {
+ return 1;
+ }
+ if ((value < other && !valIsNull) || !othIsReflexive ||
+ (othIsNull && !valIsUndef && valIsReflexive) ||
+ (othIsUndef && valIsReflexive)) {
+ return -1;
+ }
+ }
+ return 0;
+}
+
+module.exports = baseCompareAscending;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseCopy.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseCopy.js
new file mode 100644
index 00000000000..15059f312a7
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseCopy.js
@@ -0,0 +1,23 @@
+/**
+ * Copies properties of `source` to `object`.
+ *
+ * @private
+ * @param {Object} source The object to copy properties from.
+ * @param {Array} props The property names to copy.
+ * @param {Object} [object={}] The object to copy properties to.
+ * @returns {Object} Returns `object`.
+ */
+function baseCopy(source, props, object) {
+ object || (object = {});
+
+ var index = -1,
+ length = props.length;
+
+ while (++index < length) {
+ var key = props[index];
+ object[key] = source[key];
+ }
+ return object;
+}
+
+module.exports = baseCopy;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseCreate.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseCreate.js
new file mode 100644
index 00000000000..8f36becd341
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseCreate.js
@@ -0,0 +1,23 @@
+var isObject = require('../lang/isObject');
+
+/**
+ * The base implementation of `_.create` without support for assigning
+ * properties to the created object.
+ *
+ * @private
+ * @param {Object} prototype The object to inherit from.
+ * @returns {Object} Returns the new object.
+ */
+var baseCreate = (function() {
+ function object() {}
+ return function(prototype) {
+ if (isObject(prototype)) {
+ object.prototype = prototype;
+ var result = new object;
+ object.prototype = null;
+ }
+ return result || {};
+ };
+}());
+
+module.exports = baseCreate;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseDelay.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseDelay.js
new file mode 100644
index 00000000000..c405c37b692
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseDelay.js
@@ -0,0 +1,21 @@
+/** Used as the `TypeError` message for "Functions" methods. */
+var FUNC_ERROR_TEXT = 'Expected a function';
+
+/**
+ * The base implementation of `_.delay` and `_.defer` which accepts an index
+ * of where to slice the arguments to provide to `func`.
+ *
+ * @private
+ * @param {Function} func The function to delay.
+ * @param {number} wait The number of milliseconds to delay invocation.
+ * @param {Object} args The arguments provide to `func`.
+ * @returns {number} Returns the timer id.
+ */
+function baseDelay(func, wait, args) {
+ if (typeof func != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ return setTimeout(function() { func.apply(undefined, args); }, wait);
+}
+
+module.exports = baseDelay;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseDifference.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseDifference.js
new file mode 100644
index 00000000000..97853edabe5
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseDifference.js
@@ -0,0 +1,52 @@
+var baseIndexOf = require('./baseIndexOf'),
+ cacheIndexOf = require('./cacheIndexOf'),
+ createCache = require('./createCache');
+
+/**
+ * The base implementation of `_.difference` which accepts a single array
+ * of values to exclude.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {Array} values The values to exclude.
+ * @returns {Array} Returns the new array of filtered values.
+ */
+function baseDifference(array, values) {
+ var length = array ? array.length : 0,
+ result = [];
+
+ if (!length) {
+ return result;
+ }
+ var index = -1,
+ indexOf = baseIndexOf,
+ isCommon = true,
+ cache = (isCommon && values.length >= 200) ? createCache(values) : null,
+ valuesLength = values.length;
+
+ if (cache) {
+ indexOf = cacheIndexOf;
+ isCommon = false;
+ values = cache;
+ }
+ outer:
+ while (++index < length) {
+ var value = array[index];
+
+ if (isCommon && value === value) {
+ var valuesIndex = valuesLength;
+ while (valuesIndex--) {
+ if (values[valuesIndex] === value) {
+ continue outer;
+ }
+ }
+ result.push(value);
+ }
+ else if (indexOf(values, value, 0) < 0) {
+ result.push(value);
+ }
+ }
+ return result;
+}
+
+module.exports = baseDifference;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseEach.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseEach.js
new file mode 100644
index 00000000000..09ef5a3a4c7
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseEach.js
@@ -0,0 +1,15 @@
+var baseForOwn = require('./baseForOwn'),
+ createBaseEach = require('./createBaseEach');
+
+/**
+ * The base implementation of `_.forEach` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array|Object|string} Returns `collection`.
+ */
+var baseEach = createBaseEach(baseForOwn);
+
+module.exports = baseEach;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseEachRight.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseEachRight.js
new file mode 100644
index 00000000000..f0520a8b4f0
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseEachRight.js
@@ -0,0 +1,15 @@
+var baseForOwnRight = require('./baseForOwnRight'),
+ createBaseEach = require('./createBaseEach');
+
+/**
+ * The base implementation of `_.forEachRight` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array|Object|string} Returns `collection`.
+ */
+var baseEachRight = createBaseEach(baseForOwnRight, true);
+
+module.exports = baseEachRight;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseEvery.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseEvery.js
new file mode 100644
index 00000000000..a1fc1f35126
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseEvery.js
@@ -0,0 +1,22 @@
+var baseEach = require('./baseEach');
+
+/**
+ * The base implementation of `_.every` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {boolean} Returns `true` if all elements pass the predicate check,
+ * else `false`
+ */
+function baseEvery(collection, predicate) {
+ var result = true;
+ baseEach(collection, function(value, index, collection) {
+ result = !!predicate(value, index, collection);
+ return result;
+ });
+ return result;
+}
+
+module.exports = baseEvery;
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/extremumBy.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseExtremum.js
index ddbfe0ca409..b0efff6f9c2 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/extremumBy.js
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseExtremum.js
@@ -1,30 +1,24 @@
var baseEach = require('./baseEach');
-/** Used as references for `-Infinity` and `Infinity`. */
-var NEGATIVE_INFINITY = Number.NEGATIVE_INFINITY,
- POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
-
/**
* Gets the extremum value of `collection` invoking `iteratee` for each value
* in `collection` to generate the criterion by which the value is ranked.
- * The `iteratee` is invoked with three arguments: (value, index, collection).
+ * The `iteratee` is invoked with three arguments: (value, index|key, collection).
*
* @private
* @param {Array|Object|string} collection The collection to iterate over.
* @param {Function} iteratee The function invoked per iteration.
- * @param {boolean} [isMin] Specify returning the minimum, instead of the
- * maximum, extremum value.
+ * @param {Function} comparator The function used to compare values.
+ * @param {*} exValue The initial extremum value.
* @returns {*} Returns the extremum value.
*/
-function extremumBy(collection, iteratee, isMin) {
- var exValue = isMin ? POSITIVE_INFINITY : NEGATIVE_INFINITY,
- computed = exValue,
+function baseExtremum(collection, iteratee, comparator, exValue) {
+ var computed = exValue,
result = computed;
baseEach(collection, function(value, index, collection) {
- var current = iteratee(value, index, collection);
- if ((isMin ? (current < computed) : (current > computed)) ||
- (current === exValue && current === result)) {
+ var current = +iteratee(value, index, collection);
+ if (comparator(current, computed) || (current === exValue && current === result)) {
computed = current;
result = value;
}
@@ -32,4 +26,4 @@ function extremumBy(collection, iteratee, isMin) {
return result;
}
-module.exports = extremumBy;
+module.exports = baseExtremum;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseFill.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseFill.js
new file mode 100644
index 00000000000..ef1a2fa1623
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseFill.js
@@ -0,0 +1,31 @@
+/**
+ * The base implementation of `_.fill` without an iteratee call guard.
+ *
+ * @private
+ * @param {Array} array The array to fill.
+ * @param {*} value The value to fill `array` with.
+ * @param {number} [start=0] The start position.
+ * @param {number} [end=array.length] The end position.
+ * @returns {Array} Returns `array`.
+ */
+function baseFill(array, value, start, end) {
+ var length = array.length;
+
+ start = start == null ? 0 : (+start || 0);
+ if (start < 0) {
+ start = -start > length ? 0 : (length + start);
+ }
+ end = (end === undefined || end > length) ? length : (+end || 0);
+ if (end < 0) {
+ end += length;
+ }
+ length = start > end ? 0 : (end >>> 0);
+ start >>>= 0;
+
+ while (start < length) {
+ array[start++] = value;
+ }
+ return array;
+}
+
+module.exports = baseFill;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseFilter.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseFilter.js
new file mode 100644
index 00000000000..27773a47e1c
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseFilter.js
@@ -0,0 +1,22 @@
+var baseEach = require('./baseEach');
+
+/**
+ * The base implementation of `_.filter` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {Array} Returns the new filtered array.
+ */
+function baseFilter(collection, predicate) {
+ var result = [];
+ baseEach(collection, function(value, index, collection) {
+ if (predicate(value, index, collection)) {
+ result.push(value);
+ }
+ });
+ return result;
+}
+
+module.exports = baseFilter;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseFind.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseFind.js
new file mode 100644
index 00000000000..be5848fbf13
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseFind.js
@@ -0,0 +1,25 @@
+/**
+ * The base implementation of `_.find`, `_.findLast`, `_.findKey`, and `_.findLastKey`,
+ * without support for callback shorthands and `this` binding, which iterates
+ * over `collection` using the provided `eachFunc`.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to search.
+ * @param {Function} predicate The function invoked per iteration.
+ * @param {Function} eachFunc The function to iterate over `collection`.
+ * @param {boolean} [retKey] Specify returning the key of the found element
+ * instead of the element itself.
+ * @returns {*} Returns the found element or its key, else `undefined`.
+ */
+function baseFind(collection, predicate, eachFunc, retKey) {
+ var result;
+ eachFunc(collection, function(value, key, collection) {
+ if (predicate(value, key, collection)) {
+ result = retKey ? key : value;
+ return false;
+ }
+ });
+ return result;
+}
+
+module.exports = baseFind;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseFindIndex.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseFindIndex.js
new file mode 100644
index 00000000000..7d4b5024859
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseFindIndex.js
@@ -0,0 +1,23 @@
+/**
+ * The base implementation of `_.findIndex` and `_.findLastIndex` without
+ * support for callback shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to search.
+ * @param {Function} predicate The function invoked per iteration.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ */
+function baseFindIndex(array, predicate, fromRight) {
+ var length = array.length,
+ index = fromRight ? length : -1;
+
+ while ((fromRight ? index-- : ++index < length)) {
+ if (predicate(array[index], index, array)) {
+ return index;
+ }
+ }
+ return -1;
+}
+
+module.exports = baseFindIndex;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseFlatten.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseFlatten.js
new file mode 100644
index 00000000000..aa8702bceba
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseFlatten.js
@@ -0,0 +1,43 @@
+var isArguments = require('../lang/isArguments'),
+ isArray = require('../lang/isArray'),
+ isArrayLike = require('./isArrayLike'),
+ isObjectLike = require('./isObjectLike');
+
+/**
+ * The base implementation of `_.flatten` with added support for restricting
+ * flattening and specifying the start index.
+ *
+ * @private
+ * @param {Array} array The array to flatten.
+ * @param {boolean} [isDeep] Specify a deep flatten.
+ * @param {boolean} [isStrict] Restrict flattening to arrays-like objects.
+ * @returns {Array} Returns the new flattened array.
+ */
+function baseFlatten(array, isDeep, isStrict) {
+ var index = -1,
+ length = array.length,
+ resIndex = -1,
+ result = [];
+
+ while (++index < length) {
+ var value = array[index];
+ if (isObjectLike(value) && isArrayLike(value) &&
+ (isStrict || isArray(value) || isArguments(value))) {
+ if (isDeep) {
+ // Recursively flatten arrays (susceptible to call stack limits).
+ value = baseFlatten(value, isDeep, isStrict);
+ }
+ var valIndex = -1,
+ valLength = value.length;
+
+ while (++valIndex < valLength) {
+ result[++resIndex] = value[valIndex];
+ }
+ } else if (!isStrict) {
+ result[++resIndex] = value;
+ }
+ }
+ return result;
+}
+
+module.exports = baseFlatten;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseFor.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseFor.js
new file mode 100644
index 00000000000..94ee03f9253
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseFor.js
@@ -0,0 +1,17 @@
+var createBaseFor = require('./createBaseFor');
+
+/**
+ * The base implementation of `baseForIn` and `baseForOwn` which iterates
+ * over `object` properties returned by `keysFunc` invoking `iteratee` for
+ * each property. Iteratee functions may exit iteration early by explicitly
+ * returning `false`.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {Function} keysFunc The function to get the keys of `object`.
+ * @returns {Object} Returns `object`.
+ */
+var baseFor = createBaseFor();
+
+module.exports = baseFor;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseForIn.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseForIn.js
new file mode 100644
index 00000000000..47d622c3846
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseForIn.js
@@ -0,0 +1,17 @@
+var baseFor = require('./baseFor'),
+ keysIn = require('../object/keysIn');
+
+/**
+ * The base implementation of `_.forIn` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Object} Returns `object`.
+ */
+function baseForIn(object, iteratee) {
+ return baseFor(object, iteratee, keysIn);
+}
+
+module.exports = baseForIn;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseForOwn.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseForOwn.js
new file mode 100644
index 00000000000..bef4d4c35fa
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseForOwn.js
@@ -0,0 +1,17 @@
+var baseFor = require('./baseFor'),
+ keys = require('../object/keys');
+
+/**
+ * The base implementation of `_.forOwn` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Object} Returns `object`.
+ */
+function baseForOwn(object, iteratee) {
+ return baseFor(object, iteratee, keys);
+}
+
+module.exports = baseForOwn;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseForOwnRight.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseForOwnRight.js
new file mode 100644
index 00000000000..bb916bc75a0
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseForOwnRight.js
@@ -0,0 +1,17 @@
+var baseForRight = require('./baseForRight'),
+ keys = require('../object/keys');
+
+/**
+ * The base implementation of `_.forOwnRight` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Object} Returns `object`.
+ */
+function baseForOwnRight(object, iteratee) {
+ return baseForRight(object, iteratee, keys);
+}
+
+module.exports = baseForOwnRight;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseForRight.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseForRight.js
new file mode 100644
index 00000000000..5ddd191325e
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseForRight.js
@@ -0,0 +1,15 @@
+var createBaseFor = require('./createBaseFor');
+
+/**
+ * This function is like `baseFor` except that it iterates over properties
+ * in the opposite order.
+ *
+ * @private
+ * @param {Object} object The object to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {Function} keysFunc The function to get the keys of `object`.
+ * @returns {Object} Returns `object`.
+ */
+var baseForRight = createBaseFor(true);
+
+module.exports = baseForRight;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseFunctions.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseFunctions.js
new file mode 100644
index 00000000000..d56ea9c5dcc
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseFunctions.js
@@ -0,0 +1,27 @@
+var isFunction = require('../lang/isFunction');
+
+/**
+ * The base implementation of `_.functions` which creates an array of
+ * `object` function property names filtered from those provided.
+ *
+ * @private
+ * @param {Object} object The object to inspect.
+ * @param {Array} props The property names to filter.
+ * @returns {Array} Returns the new array of filtered property names.
+ */
+function baseFunctions(object, props) {
+ var index = -1,
+ length = props.length,
+ resIndex = -1,
+ result = [];
+
+ while (++index < length) {
+ var key = props[index];
+ if (isFunction(object[key])) {
+ result[++resIndex] = key;
+ }
+ }
+ return result;
+}
+
+module.exports = baseFunctions;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseGet.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseGet.js
new file mode 100644
index 00000000000..ad9b1ee11ba
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseGet.js
@@ -0,0 +1,29 @@
+var toObject = require('./toObject');
+
+/**
+ * The base implementation of `get` without support for string paths
+ * and default values.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {Array} path The path of the property to get.
+ * @param {string} [pathKey] The key representation of path.
+ * @returns {*} Returns the resolved value.
+ */
+function baseGet(object, path, pathKey) {
+ if (object == null) {
+ return;
+ }
+ if (pathKey !== undefined && pathKey in toObject(object)) {
+ path = [pathKey];
+ }
+ var index = 0,
+ length = path.length;
+
+ while (object != null && index < length) {
+ object = object[path[index++]];
+ }
+ return (index && index == length) ? object : undefined;
+}
+
+module.exports = baseGet;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseIndexOf.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseIndexOf.js
new file mode 100644
index 00000000000..6b479bce1e4
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseIndexOf.js
@@ -0,0 +1,27 @@
+var indexOfNaN = require('./indexOfNaN');
+
+/**
+ * The base implementation of `_.indexOf` without support for binary searches.
+ *
+ * @private
+ * @param {Array} array The array to search.
+ * @param {*} value The value to search for.
+ * @param {number} fromIndex The index to search from.
+ * @returns {number} Returns the index of the matched value, else `-1`.
+ */
+function baseIndexOf(array, value, fromIndex) {
+ if (value !== value) {
+ return indexOfNaN(array, fromIndex);
+ }
+ var index = fromIndex - 1,
+ length = array.length;
+
+ while (++index < length) {
+ if (array[index] === value) {
+ return index;
+ }
+ }
+ return -1;
+}
+
+module.exports = baseIndexOf;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseIsEqual.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseIsEqual.js
new file mode 100644
index 00000000000..87e14ac5569
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseIsEqual.js
@@ -0,0 +1,28 @@
+var baseIsEqualDeep = require('./baseIsEqualDeep'),
+ isObject = require('../lang/isObject'),
+ isObjectLike = require('./isObjectLike');
+
+/**
+ * The base implementation of `_.isEqual` without support for `this` binding
+ * `customizer` functions.
+ *
+ * @private
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @param {Function} [customizer] The function to customize comparing values.
+ * @param {boolean} [isLoose] Specify performing partial comparisons.
+ * @param {Array} [stackA] Tracks traversed `value` objects.
+ * @param {Array} [stackB] Tracks traversed `other` objects.
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
+ */
+function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) {
+ if (value === other) {
+ return true;
+ }
+ if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {
+ return value !== value && other !== other;
+ }
+ return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB);
+}
+
+module.exports = baseIsEqual;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseIsEqualDeep.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseIsEqualDeep.js
new file mode 100644
index 00000000000..586ebcd1c0a
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseIsEqualDeep.js
@@ -0,0 +1,102 @@
+var equalArrays = require('./equalArrays'),
+ equalByTag = require('./equalByTag'),
+ equalObjects = require('./equalObjects'),
+ isArray = require('../lang/isArray'),
+ isTypedArray = require('../lang/isTypedArray');
+
+/** `Object#toString` result references. */
+var argsTag = '[object Arguments]',
+ arrayTag = '[object Array]',
+ objectTag = '[object Object]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * A specialized version of `baseIsEqual` for arrays and objects which performs
+ * deep comparisons and tracks traversed objects enabling objects with circular
+ * references to be compared.
+ *
+ * @private
+ * @param {Object} object The object to compare.
+ * @param {Object} other The other object to compare.
+ * @param {Function} equalFunc The function to determine equivalents of values.
+ * @param {Function} [customizer] The function to customize comparing objects.
+ * @param {boolean} [isLoose] Specify performing partial comparisons.
+ * @param {Array} [stackA=[]] Tracks traversed `value` objects.
+ * @param {Array} [stackB=[]] Tracks traversed `other` objects.
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+ */
+function baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
+ var objIsArr = isArray(object),
+ othIsArr = isArray(other),
+ objTag = arrayTag,
+ othTag = arrayTag;
+
+ if (!objIsArr) {
+ objTag = objToString.call(object);
+ if (objTag == argsTag) {
+ objTag = objectTag;
+ } else if (objTag != objectTag) {
+ objIsArr = isTypedArray(object);
+ }
+ }
+ if (!othIsArr) {
+ othTag = objToString.call(other);
+ if (othTag == argsTag) {
+ othTag = objectTag;
+ } else if (othTag != objectTag) {
+ othIsArr = isTypedArray(other);
+ }
+ }
+ var objIsObj = objTag == objectTag,
+ othIsObj = othTag == objectTag,
+ isSameTag = objTag == othTag;
+
+ if (isSameTag && !(objIsArr || objIsObj)) {
+ return equalByTag(object, other, objTag);
+ }
+ if (!isLoose) {
+ var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
+ othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
+
+ if (objIsWrapped || othIsWrapped) {
+ return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, isLoose, stackA, stackB);
+ }
+ }
+ if (!isSameTag) {
+ return false;
+ }
+ // Assume cyclic values are equal.
+ // For more information on detecting circular references see https://es5.github.io/#JO.
+ stackA || (stackA = []);
+ stackB || (stackB = []);
+
+ var length = stackA.length;
+ while (length--) {
+ if (stackA[length] == object) {
+ return stackB[length] == other;
+ }
+ }
+ // Add `object` and `other` to the stack of traversed objects.
+ stackA.push(object);
+ stackB.push(other);
+
+ var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB);
+
+ stackA.pop();
+ stackB.pop();
+
+ return result;
+}
+
+module.exports = baseIsEqualDeep;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseIsFunction.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseIsFunction.js
new file mode 100644
index 00000000000..cd92db30f32
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseIsFunction.js
@@ -0,0 +1,15 @@
+/**
+ * The base implementation of `_.isFunction` without support for environments
+ * with incorrect `typeof` results.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ */
+function baseIsFunction(value) {
+ // Avoid a Chakra JIT bug in compatibility modes of IE 11.
+ // See https://github.com/jashkenas/underscore/issues/1621 for more details.
+ return typeof value == 'function' || false;
+}
+
+module.exports = baseIsFunction;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseIsMatch.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseIsMatch.js
new file mode 100644
index 00000000000..ea48bb65674
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseIsMatch.js
@@ -0,0 +1,52 @@
+var baseIsEqual = require('./baseIsEqual'),
+ toObject = require('./toObject');
+
+/**
+ * The base implementation of `_.isMatch` without support for callback
+ * shorthands and `this` binding.
+ *
+ * @private
+ * @param {Object} object The object to inspect.
+ * @param {Array} matchData The propery names, values, and compare flags to match.
+ * @param {Function} [customizer] The function to customize comparing objects.
+ * @returns {boolean} Returns `true` if `object` is a match, else `false`.
+ */
+function baseIsMatch(object, matchData, customizer) {
+ var index = matchData.length,
+ length = index,
+ noCustomizer = !customizer;
+
+ if (object == null) {
+ return !length;
+ }
+ object = toObject(object);
+ while (index--) {
+ var data = matchData[index];
+ if ((noCustomizer && data[2])
+ ? data[1] !== object[data[0]]
+ : !(data[0] in object)
+ ) {
+ return false;
+ }
+ }
+ while (++index < length) {
+ data = matchData[index];
+ var key = data[0],
+ objValue = object[key],
+ srcValue = data[1];
+
+ if (noCustomizer && data[2]) {
+ if (objValue === undefined && !(key in object)) {
+ return false;
+ }
+ } else {
+ var result = customizer ? customizer(objValue, srcValue, key) : undefined;
+ if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, true) : result)) {
+ return false;
+ }
+ }
+ }
+ return true;
+}
+
+module.exports = baseIsMatch;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseLodash.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseLodash.js
new file mode 100644
index 00000000000..15b79d3f7b9
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseLodash.js
@@ -0,0 +1,10 @@
+/**
+ * The function whose prototype all chaining wrappers inherit from.
+ *
+ * @private
+ */
+function baseLodash() {
+ // No operation performed.
+}
+
+module.exports = baseLodash;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseMap.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseMap.js
new file mode 100644
index 00000000000..2906b518f9e
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseMap.js
@@ -0,0 +1,23 @@
+var baseEach = require('./baseEach'),
+ isArrayLike = require('./isArrayLike');
+
+/**
+ * The base implementation of `_.map` without support for callback shorthands
+ * and `this` binding.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {Array} Returns the new mapped array.
+ */
+function baseMap(collection, iteratee) {
+ var index = -1,
+ result = isArrayLike(collection) ? Array(collection.length) : [];
+
+ baseEach(collection, function(value, key, collection) {
+ result[++index] = iteratee(value, key, collection);
+ });
+ return result;
+}
+
+module.exports = baseMap;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseMatches.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseMatches.js
new file mode 100644
index 00000000000..5f76c67dcd0
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseMatches.js
@@ -0,0 +1,30 @@
+var baseIsMatch = require('./baseIsMatch'),
+ getMatchData = require('./getMatchData'),
+ toObject = require('./toObject');
+
+/**
+ * The base implementation of `_.matches` which does not clone `source`.
+ *
+ * @private
+ * @param {Object} source The object of property values to match.
+ * @returns {Function} Returns the new function.
+ */
+function baseMatches(source) {
+ var matchData = getMatchData(source);
+ if (matchData.length == 1 && matchData[0][2]) {
+ var key = matchData[0][0],
+ value = matchData[0][1];
+
+ return function(object) {
+ if (object == null) {
+ return false;
+ }
+ return object[key] === value && (value !== undefined || (key in toObject(object)));
+ };
+ }
+ return function(object) {
+ return baseIsMatch(object, matchData);
+ };
+}
+
+module.exports = baseMatches;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseMatchesProperty.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseMatchesProperty.js
new file mode 100644
index 00000000000..8f9005ce0fc
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseMatchesProperty.js
@@ -0,0 +1,45 @@
+var baseGet = require('./baseGet'),
+ baseIsEqual = require('./baseIsEqual'),
+ baseSlice = require('./baseSlice'),
+ isArray = require('../lang/isArray'),
+ isKey = require('./isKey'),
+ isStrictComparable = require('./isStrictComparable'),
+ last = require('../array/last'),
+ toObject = require('./toObject'),
+ toPath = require('./toPath');
+
+/**
+ * The base implementation of `_.matchesProperty` which does not clone `srcValue`.
+ *
+ * @private
+ * @param {string} path The path of the property to get.
+ * @param {*} srcValue The value to compare.
+ * @returns {Function} Returns the new function.
+ */
+function baseMatchesProperty(path, srcValue) {
+ var isArr = isArray(path),
+ isCommon = isKey(path) && isStrictComparable(srcValue),
+ pathKey = (path + '');
+
+ path = toPath(path);
+ return function(object) {
+ if (object == null) {
+ return false;
+ }
+ var key = pathKey;
+ object = toObject(object);
+ if ((isArr || !isCommon) && !(key in object)) {
+ object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
+ if (object == null) {
+ return false;
+ }
+ key = last(path);
+ object = toObject(object);
+ }
+ return object[key] === srcValue
+ ? (srcValue !== undefined || (key in object))
+ : baseIsEqual(srcValue, object[key], undefined, true);
+ };
+}
+
+module.exports = baseMatchesProperty;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseMerge.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseMerge.js
new file mode 100644
index 00000000000..28a871069bf
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseMerge.js
@@ -0,0 +1,56 @@
+var arrayEach = require('./arrayEach'),
+ baseMergeDeep = require('./baseMergeDeep'),
+ isArray = require('../lang/isArray'),
+ isArrayLike = require('./isArrayLike'),
+ isObject = require('../lang/isObject'),
+ isObjectLike = require('./isObjectLike'),
+ isTypedArray = require('../lang/isTypedArray'),
+ keys = require('../object/keys');
+
+/**
+ * The base implementation of `_.merge` without support for argument juggling,
+ * multiple sources, and `this` binding `customizer` functions.
+ *
+ * @private
+ * @param {Object} object The destination object.
+ * @param {Object} source The source object.
+ * @param {Function} [customizer] The function to customize merging properties.
+ * @param {Array} [stackA=[]] Tracks traversed source objects.
+ * @param {Array} [stackB=[]] Associates values with source counterparts.
+ * @returns {Object} Returns `object`.
+ */
+function baseMerge(object, source, customizer, stackA, stackB) {
+ if (!isObject(object)) {
+ return object;
+ }
+ var isSrcArr = isArrayLike(source) && (isArray(source) || isTypedArray(source)),
+ props = isSrcArr ? null : keys(source);
+
+ arrayEach(props || source, function(srcValue, key) {
+ if (props) {
+ key = srcValue;
+ srcValue = source[key];
+ }
+ if (isObjectLike(srcValue)) {
+ stackA || (stackA = []);
+ stackB || (stackB = []);
+ baseMergeDeep(object, source, key, baseMerge, customizer, stackA, stackB);
+ }
+ else {
+ var value = object[key],
+ result = customizer ? customizer(value, srcValue, key, object, source) : undefined,
+ isCommon = result === undefined;
+
+ if (isCommon) {
+ result = srcValue;
+ }
+ if ((result !== undefined || (isSrcArr && !(key in object))) &&
+ (isCommon || (result === result ? (result !== value) : (value === value)))) {
+ object[key] = result;
+ }
+ }
+ });
+ return object;
+}
+
+module.exports = baseMerge;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseMergeDeep.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseMergeDeep.js
new file mode 100644
index 00000000000..daf1788d617
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseMergeDeep.js
@@ -0,0 +1,67 @@
+var arrayCopy = require('./arrayCopy'),
+ isArguments = require('../lang/isArguments'),
+ isArray = require('../lang/isArray'),
+ isArrayLike = require('./isArrayLike'),
+ isPlainObject = require('../lang/isPlainObject'),
+ isTypedArray = require('../lang/isTypedArray'),
+ toPlainObject = require('../lang/toPlainObject');
+
+/**
+ * A specialized version of `baseMerge` for arrays and objects which performs
+ * deep merges and tracks traversed objects enabling objects with circular
+ * references to be merged.
+ *
+ * @private
+ * @param {Object} object The destination object.
+ * @param {Object} source The source object.
+ * @param {string} key The key of the value to merge.
+ * @param {Function} mergeFunc The function to merge values.
+ * @param {Function} [customizer] The function to customize merging properties.
+ * @param {Array} [stackA=[]] Tracks traversed source objects.
+ * @param {Array} [stackB=[]] Associates values with source counterparts.
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+ */
+function baseMergeDeep(object, source, key, mergeFunc, customizer, stackA, stackB) {
+ var length = stackA.length,
+ srcValue = source[key];
+
+ while (length--) {
+ if (stackA[length] == srcValue) {
+ object[key] = stackB[length];
+ return;
+ }
+ }
+ var value = object[key],
+ result = customizer ? customizer(value, srcValue, key, object, source) : undefined,
+ isCommon = result === undefined;
+
+ if (isCommon) {
+ result = srcValue;
+ if (isArrayLike(srcValue) && (isArray(srcValue) || isTypedArray(srcValue))) {
+ result = isArray(value)
+ ? value
+ : (isArrayLike(value) ? arrayCopy(value) : []);
+ }
+ else if (isPlainObject(srcValue) || isArguments(srcValue)) {
+ result = isArguments(value)
+ ? toPlainObject(value)
+ : (isPlainObject(value) ? value : {});
+ }
+ else {
+ isCommon = false;
+ }
+ }
+ // Add the source value to the stack of traversed objects and associate
+ // it with its merged value.
+ stackA.push(srcValue);
+ stackB.push(result);
+
+ if (isCommon) {
+ // Recursively merge objects and arrays (susceptible to call stack limits).
+ object[key] = mergeFunc(result, srcValue, customizer, stackA, stackB);
+ } else if (result === result ? (result !== value) : (value === value)) {
+ object[key] = result;
+ }
+}
+
+module.exports = baseMergeDeep;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseProperty.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseProperty.js
new file mode 100644
index 00000000000..e515941c166
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseProperty.js
@@ -0,0 +1,14 @@
+/**
+ * The base implementation of `_.property` without support for deep paths.
+ *
+ * @private
+ * @param {string} key The key of the property to get.
+ * @returns {Function} Returns the new function.
+ */
+function baseProperty(key) {
+ return function(object) {
+ return object == null ? undefined : object[key];
+ };
+}
+
+module.exports = baseProperty;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/basePropertyDeep.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/basePropertyDeep.js
new file mode 100644
index 00000000000..1b6ce40a179
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/basePropertyDeep.js
@@ -0,0 +1,19 @@
+var baseGet = require('./baseGet'),
+ toPath = require('./toPath');
+
+/**
+ * A specialized version of `baseProperty` which supports deep paths.
+ *
+ * @private
+ * @param {Array|string} path The path of the property to get.
+ * @returns {Function} Returns the new function.
+ */
+function basePropertyDeep(path) {
+ var pathKey = (path + '');
+ path = toPath(path);
+ return function(object) {
+ return baseGet(object, path, pathKey);
+ };
+}
+
+module.exports = basePropertyDeep;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/basePullAt.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/basePullAt.js
new file mode 100644
index 00000000000..6c4ff84200b
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/basePullAt.js
@@ -0,0 +1,30 @@
+var isIndex = require('./isIndex');
+
+/** Used for native method references. */
+var arrayProto = Array.prototype;
+
+/** Native method references. */
+var splice = arrayProto.splice;
+
+/**
+ * The base implementation of `_.pullAt` without support for individual
+ * index arguments and capturing the removed elements.
+ *
+ * @private
+ * @param {Array} array The array to modify.
+ * @param {number[]} indexes The indexes of elements to remove.
+ * @returns {Array} Returns `array`.
+ */
+function basePullAt(array, indexes) {
+ var length = array ? indexes.length : 0;
+ while (length--) {
+ var index = indexes[length];
+ if (index != previous && isIndex(index)) {
+ var previous = index;
+ splice.call(array, index, 1);
+ }
+ }
+ return array;
+}
+
+module.exports = basePullAt;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseRandom.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseRandom.js
new file mode 100644
index 00000000000..d71bb16520c
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseRandom.js
@@ -0,0 +1,20 @@
+/** Native method references. */
+var floor = Math.floor;
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeRandom = Math.random;
+
+/**
+ * The base implementation of `_.random` without support for argument juggling
+ * and returning floating-point numbers.
+ *
+ * @private
+ * @param {number} min The minimum possible value.
+ * @param {number} max The maximum possible value.
+ * @returns {number} Returns the random number.
+ */
+function baseRandom(min, max) {
+ return min + floor(nativeRandom() * (max - min + 1));
+}
+
+module.exports = baseRandom;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseReduce.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseReduce.js
new file mode 100644
index 00000000000..5e6ae555f95
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseReduce.js
@@ -0,0 +1,24 @@
+/**
+ * The base implementation of `_.reduce` and `_.reduceRight` without support
+ * for callback shorthands and `this` binding, which iterates over `collection`
+ * using the provided `eachFunc`.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {*} accumulator The initial value.
+ * @param {boolean} initFromCollection Specify using the first or last element
+ * of `collection` as the initial value.
+ * @param {Function} eachFunc The function to iterate over `collection`.
+ * @returns {*} Returns the accumulated value.
+ */
+function baseReduce(collection, iteratee, accumulator, initFromCollection, eachFunc) {
+ eachFunc(collection, function(value, index, collection) {
+ accumulator = initFromCollection
+ ? (initFromCollection = false, value)
+ : iteratee(accumulator, value, index, collection);
+ });
+ return accumulator;
+}
+
+module.exports = baseReduce;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseSetData.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseSetData.js
new file mode 100644
index 00000000000..5c98622d8df
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseSetData.js
@@ -0,0 +1,17 @@
+var identity = require('../utility/identity'),
+ metaMap = require('./metaMap');
+
+/**
+ * The base implementation of `setData` without support for hot loop detection.
+ *
+ * @private
+ * @param {Function} func The function to associate metadata with.
+ * @param {*} data The metadata.
+ * @returns {Function} Returns `func`.
+ */
+var baseSetData = !metaMap ? identity : function(func, data) {
+ metaMap.set(func, data);
+ return func;
+};
+
+module.exports = baseSetData;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseSlice.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseSlice.js
new file mode 100644
index 00000000000..9d1012efa83
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseSlice.js
@@ -0,0 +1,32 @@
+/**
+ * The base implementation of `_.slice` without an iteratee call guard.
+ *
+ * @private
+ * @param {Array} array The array to slice.
+ * @param {number} [start=0] The start position.
+ * @param {number} [end=array.length] The end position.
+ * @returns {Array} Returns the slice of `array`.
+ */
+function baseSlice(array, start, end) {
+ var index = -1,
+ length = array.length;
+
+ start = start == null ? 0 : (+start || 0);
+ if (start < 0) {
+ start = -start > length ? 0 : (length + start);
+ }
+ end = (end === undefined || end > length) ? length : (+end || 0);
+ if (end < 0) {
+ end += length;
+ }
+ length = start > end ? 0 : ((end - start) >>> 0);
+ start >>>= 0;
+
+ var result = Array(length);
+ while (++index < length) {
+ result[index] = array[index + start];
+ }
+ return result;
+}
+
+module.exports = baseSlice;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseSome.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseSome.js
new file mode 100644
index 00000000000..39a005880dc
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseSome.js
@@ -0,0 +1,23 @@
+var baseEach = require('./baseEach');
+
+/**
+ * The base implementation of `_.some` without support for callback shorthands
+ * and `this` binding.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {boolean} Returns `true` if any element passes the predicate check,
+ * else `false`.
+ */
+function baseSome(collection, predicate) {
+ var result;
+
+ baseEach(collection, function(value, index, collection) {
+ result = predicate(value, index, collection);
+ return !result;
+ });
+ return !!result;
+}
+
+module.exports = baseSome;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseSortBy.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseSortBy.js
new file mode 100644
index 00000000000..fec0afeb78f
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseSortBy.js
@@ -0,0 +1,21 @@
+/**
+ * The base implementation of `_.sortBy` which uses `comparer` to define
+ * the sort order of `array` and replaces criteria objects with their
+ * corresponding values.
+ *
+ * @private
+ * @param {Array} array The array to sort.
+ * @param {Function} comparer The function to define sort order.
+ * @returns {Array} Returns `array`.
+ */
+function baseSortBy(array, comparer) {
+ var length = array.length;
+
+ array.sort(comparer);
+ while (length--) {
+ array[length] = array[length].value;
+ }
+ return array;
+}
+
+module.exports = baseSortBy;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseSortByOrder.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseSortByOrder.js
new file mode 100644
index 00000000000..0a9ef20796c
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseSortByOrder.js
@@ -0,0 +1,31 @@
+var arrayMap = require('./arrayMap'),
+ baseCallback = require('./baseCallback'),
+ baseMap = require('./baseMap'),
+ baseSortBy = require('./baseSortBy'),
+ compareMultiple = require('./compareMultiple');
+
+/**
+ * The base implementation of `_.sortByOrder` without param guards.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
+ * @param {boolean[]} orders The sort orders of `iteratees`.
+ * @returns {Array} Returns the new sorted array.
+ */
+function baseSortByOrder(collection, iteratees, orders) {
+ var index = -1;
+
+ iteratees = arrayMap(iteratees, function(iteratee) { return baseCallback(iteratee); });
+
+ var result = baseMap(collection, function(value) {
+ var criteria = arrayMap(iteratees, function(iteratee) { return iteratee(value); });
+ return { 'criteria': criteria, 'index': ++index, 'value': value };
+ });
+
+ return baseSortBy(result, function(object, other) {
+ return compareMultiple(object, other, orders);
+ });
+}
+
+module.exports = baseSortByOrder;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseSum.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseSum.js
new file mode 100644
index 00000000000..019e5ae6ee5
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseSum.js
@@ -0,0 +1,20 @@
+var baseEach = require('./baseEach');
+
+/**
+ * The base implementation of `_.sum` without support for callback shorthands
+ * and `this` binding.
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @returns {number} Returns the sum.
+ */
+function baseSum(collection, iteratee) {
+ var result = 0;
+ baseEach(collection, function(value, index, collection) {
+ result += +iteratee(value, index, collection) || 0;
+ });
+ return result;
+}
+
+module.exports = baseSum;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseToString.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseToString.js
new file mode 100644
index 00000000000..4de76a7eec4
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseToString.js
@@ -0,0 +1,16 @@
+/**
+ * Converts `value` to a string if it's not one. An empty string is returned
+ * for `null` or `undefined` values.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {string} Returns the string.
+ */
+function baseToString(value) {
+ if (typeof value == 'string') {
+ return value;
+ }
+ return value == null ? '' : (value + '');
+}
+
+module.exports = baseToString;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseUniq.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseUniq.js
new file mode 100644
index 00000000000..a70c8cb3835
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseUniq.js
@@ -0,0 +1,57 @@
+var baseIndexOf = require('./baseIndexOf'),
+ cacheIndexOf = require('./cacheIndexOf'),
+ createCache = require('./createCache');
+
+/**
+ * The base implementation of `_.uniq` without support for callback shorthands
+ * and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {Function} [iteratee] The function invoked per iteration.
+ * @returns {Array} Returns the new duplicate-value-free array.
+ */
+function baseUniq(array, iteratee) {
+ var index = -1,
+ indexOf = baseIndexOf,
+ length = array.length,
+ isCommon = true,
+ isLarge = isCommon && length >= 200,
+ seen = isLarge ? createCache() : null,
+ result = [];
+
+ if (seen) {
+ indexOf = cacheIndexOf;
+ isCommon = false;
+ } else {
+ isLarge = false;
+ seen = iteratee ? [] : result;
+ }
+ outer:
+ while (++index < length) {
+ var value = array[index],
+ computed = iteratee ? iteratee(value, index, array) : value;
+
+ if (isCommon && value === value) {
+ var seenIndex = seen.length;
+ while (seenIndex--) {
+ if (seen[seenIndex] === computed) {
+ continue outer;
+ }
+ }
+ if (iteratee) {
+ seen.push(computed);
+ }
+ result.push(value);
+ }
+ else if (indexOf(seen, computed, 0) < 0) {
+ if (iteratee || isLarge) {
+ seen.push(computed);
+ }
+ result.push(value);
+ }
+ }
+ return result;
+}
+
+module.exports = baseUniq;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseValues.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseValues.js
new file mode 100644
index 00000000000..e8d3ac72fe1
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseValues.js
@@ -0,0 +1,22 @@
+/**
+ * The base implementation of `_.values` and `_.valuesIn` which creates an
+ * array of `object` property values corresponding to the property names
+ * of `props`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {Array} props The property names to get values for.
+ * @returns {Object} Returns the array of property values.
+ */
+function baseValues(object, props) {
+ var index = -1,
+ length = props.length,
+ result = Array(length);
+
+ while (++index < length) {
+ result[index] = object[props[index]];
+ }
+ return result;
+}
+
+module.exports = baseValues;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseWhile.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseWhile.js
new file mode 100644
index 00000000000..c24e9bd9d9c
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseWhile.js
@@ -0,0 +1,24 @@
+var baseSlice = require('./baseSlice');
+
+/**
+ * The base implementation of `_.dropRightWhile`, `_.dropWhile`, `_.takeRightWhile`,
+ * and `_.takeWhile` without support for callback shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to query.
+ * @param {Function} predicate The function invoked per iteration.
+ * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Array} Returns the slice of `array`.
+ */
+function baseWhile(array, predicate, isDrop, fromRight) {
+ var length = array.length,
+ index = fromRight ? length : -1;
+
+ while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) {}
+ return isDrop
+ ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
+ : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
+}
+
+module.exports = baseWhile;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseWrapperValue.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseWrapperValue.js
new file mode 100644
index 00000000000..49c14fb2e8e
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseWrapperValue.js
@@ -0,0 +1,37 @@
+var LazyWrapper = require('./LazyWrapper');
+
+/** Used for native method references. */
+var arrayProto = Array.prototype;
+
+/** Native method references. */
+var push = arrayProto.push;
+
+/**
+ * The base implementation of `wrapperValue` which returns the result of
+ * performing a sequence of actions on the unwrapped `value`, where each
+ * successive action is supplied the return value of the previous.
+ *
+ * @private
+ * @param {*} value The unwrapped value.
+ * @param {Array} actions Actions to peform to resolve the unwrapped value.
+ * @returns {*} Returns the resolved value.
+ */
+function baseWrapperValue(value, actions) {
+ var result = value;
+ if (result instanceof LazyWrapper) {
+ result = result.value();
+ }
+ var index = -1,
+ length = actions.length;
+
+ while (++index < length) {
+ var args = [result],
+ action = actions[index];
+
+ push.apply(args, action.args);
+ result = action.func.apply(action.thisArg, args);
+ }
+ return result;
+}
+
+module.exports = baseWrapperValue;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/binaryIndex.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/binaryIndex.js
new file mode 100644
index 00000000000..af419a26f28
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/binaryIndex.js
@@ -0,0 +1,39 @@
+var binaryIndexBy = require('./binaryIndexBy'),
+ identity = require('../utility/identity');
+
+/** Used as references for the maximum length and index of an array. */
+var MAX_ARRAY_LENGTH = 4294967295,
+ HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
+
+/**
+ * Performs a binary search of `array` to determine the index at which `value`
+ * should be inserted into `array` in order to maintain its sort order.
+ *
+ * @private
+ * @param {Array} array The sorted array to inspect.
+ * @param {*} value The value to evaluate.
+ * @param {boolean} [retHighest] Specify returning the highest qualified index.
+ * @returns {number} Returns the index at which `value` should be inserted
+ * into `array`.
+ */
+function binaryIndex(array, value, retHighest) {
+ var low = 0,
+ high = array ? array.length : low;
+
+ if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
+ while (low < high) {
+ var mid = (low + high) >>> 1,
+ computed = array[mid];
+
+ if ((retHighest ? (computed <= value) : (computed < value)) && computed !== null) {
+ low = mid + 1;
+ } else {
+ high = mid;
+ }
+ }
+ return high;
+ }
+ return binaryIndexBy(array, value, identity, retHighest);
+}
+
+module.exports = binaryIndex;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/binaryIndexBy.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/binaryIndexBy.js
new file mode 100644
index 00000000000..5bcd7a74422
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/binaryIndexBy.js
@@ -0,0 +1,59 @@
+/** Native method references. */
+var floor = Math.floor;
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMin = Math.min;
+
+/** Used as references for the maximum length and index of an array. */
+var MAX_ARRAY_LENGTH = 4294967295,
+ MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1;
+
+/**
+ * This function is like `binaryIndex` except that it invokes `iteratee` for
+ * `value` and each element of `array` to compute their sort ranking. The
+ * iteratee is invoked with one argument; (value).
+ *
+ * @private
+ * @param {Array} array The sorted array to inspect.
+ * @param {*} value The value to evaluate.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {boolean} [retHighest] Specify returning the highest qualified index.
+ * @returns {number} Returns the index at which `value` should be inserted
+ * into `array`.
+ */
+function binaryIndexBy(array, value, iteratee, retHighest) {
+ value = iteratee(value);
+
+ var low = 0,
+ high = array ? array.length : 0,
+ valIsNaN = value !== value,
+ valIsNull = value === null,
+ valIsUndef = value === undefined;
+
+ while (low < high) {
+ var mid = floor((low + high) / 2),
+ computed = iteratee(array[mid]),
+ isDef = computed !== undefined,
+ isReflexive = computed === computed;
+
+ if (valIsNaN) {
+ var setLow = isReflexive || retHighest;
+ } else if (valIsNull) {
+ setLow = isReflexive && isDef && (retHighest || computed != null);
+ } else if (valIsUndef) {
+ setLow = isReflexive && (retHighest || isDef);
+ } else if (computed == null) {
+ setLow = false;
+ } else {
+ setLow = retHighest ? (computed <= value) : (computed < value);
+ }
+ if (setLow) {
+ low = mid + 1;
+ } else {
+ high = mid;
+ }
+ }
+ return nativeMin(high, MAX_ARRAY_INDEX);
+}
+
+module.exports = binaryIndexBy;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/bindCallback.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/bindCallback.js
new file mode 100644
index 00000000000..cdc7f49aea7
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/bindCallback.js
@@ -0,0 +1,39 @@
+var identity = require('../utility/identity');
+
+/**
+ * A specialized version of `baseCallback` which only supports `this` binding
+ * and specifying the number of arguments to provide to `func`.
+ *
+ * @private
+ * @param {Function} func The function to bind.
+ * @param {*} thisArg The `this` binding of `func`.
+ * @param {number} [argCount] The number of arguments to provide to `func`.
+ * @returns {Function} Returns the callback.
+ */
+function bindCallback(func, thisArg, argCount) {
+ if (typeof func != 'function') {
+ return identity;
+ }
+ if (thisArg === undefined) {
+ return func;
+ }
+ switch (argCount) {
+ case 1: return function(value) {
+ return func.call(thisArg, value);
+ };
+ case 3: return function(value, index, collection) {
+ return func.call(thisArg, value, index, collection);
+ };
+ case 4: return function(accumulator, value, index, collection) {
+ return func.call(thisArg, accumulator, value, index, collection);
+ };
+ case 5: return function(value, other, key, object, source) {
+ return func.call(thisArg, value, other, key, object, source);
+ };
+ }
+ return function() {
+ return func.apply(thisArg, arguments);
+ };
+}
+
+module.exports = bindCallback;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/bufferClone.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/bufferClone.js
new file mode 100644
index 00000000000..ba10802db05
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/bufferClone.js
@@ -0,0 +1,55 @@
+var constant = require('../utility/constant'),
+ getNative = require('./getNative');
+
+/** Native method references. */
+var ArrayBuffer = getNative(global, 'ArrayBuffer'),
+ bufferSlice = getNative(ArrayBuffer && new ArrayBuffer(0), 'slice'),
+ floor = Math.floor,
+ Uint8Array = getNative(global, 'Uint8Array');
+
+/** Used to clone array buffers. */
+var Float64Array = (function() {
+ // Safari 5 errors when using an array buffer to initialize a typed array
+ // where the array buffer's `byteLength` is not a multiple of the typed
+ // array's `BYTES_PER_ELEMENT`.
+ try {
+ var func = getNative(global, 'Float64Array'),
+ result = new func(new ArrayBuffer(10), 0, 1) && func;
+ } catch(e) {}
+ return result || null;
+}());
+
+/** Used as the size, in bytes, of each `Float64Array` element. */
+var FLOAT64_BYTES_PER_ELEMENT = Float64Array ? Float64Array.BYTES_PER_ELEMENT : 0;
+
+/**
+ * Creates a clone of the given array buffer.
+ *
+ * @private
+ * @param {ArrayBuffer} buffer The array buffer to clone.
+ * @returns {ArrayBuffer} Returns the cloned array buffer.
+ */
+function bufferClone(buffer) {
+ return bufferSlice.call(buffer, 0);
+}
+if (!bufferSlice) {
+ // PhantomJS has `ArrayBuffer` and `Uint8Array` but not `Float64Array`.
+ bufferClone = !(ArrayBuffer && Uint8Array) ? constant(null) : function(buffer) {
+ var byteLength = buffer.byteLength,
+ floatLength = Float64Array ? floor(byteLength / FLOAT64_BYTES_PER_ELEMENT) : 0,
+ offset = floatLength * FLOAT64_BYTES_PER_ELEMENT,
+ result = new ArrayBuffer(byteLength);
+
+ if (floatLength) {
+ var view = new Float64Array(result, 0, floatLength);
+ view.set(new Float64Array(buffer, 0, floatLength));
+ }
+ if (byteLength != offset) {
+ view = new Uint8Array(result, offset);
+ view.set(new Uint8Array(buffer, offset));
+ }
+ return result;
+ };
+}
+
+module.exports = bufferClone;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/cacheIndexOf.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/cacheIndexOf.js
new file mode 100644
index 00000000000..09f698ab8b9
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/cacheIndexOf.js
@@ -0,0 +1,19 @@
+var isObject = require('../lang/isObject');
+
+/**
+ * Checks if `value` is in `cache` mimicking the return signature of
+ * `_.indexOf` by returning `0` if the value is found, else `-1`.
+ *
+ * @private
+ * @param {Object} cache The cache to search.
+ * @param {*} value The value to search for.
+ * @returns {number} Returns `0` if `value` is found, else `-1`.
+ */
+function cacheIndexOf(cache, value) {
+ var data = cache.data,
+ result = (typeof value == 'string' || isObject(value)) ? data.set.has(value) : data.hash[value];
+
+ return result ? 0 : -1;
+}
+
+module.exports = cacheIndexOf;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/cachePush.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/cachePush.js
new file mode 100644
index 00000000000..ba03a1528a2
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/cachePush.js
@@ -0,0 +1,20 @@
+var isObject = require('../lang/isObject');
+
+/**
+ * Adds `value` to the cache.
+ *
+ * @private
+ * @name push
+ * @memberOf SetCache
+ * @param {*} value The value to cache.
+ */
+function cachePush(value) {
+ var data = this.data;
+ if (typeof value == 'string' || isObject(value)) {
+ data.set.add(value);
+ } else {
+ data.hash[value] = true;
+ }
+}
+
+module.exports = cachePush;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/charsLeftIndex.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/charsLeftIndex.js
new file mode 100644
index 00000000000..a6d1d81c038
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/charsLeftIndex.js
@@ -0,0 +1,18 @@
+/**
+ * Used by `_.trim` and `_.trimLeft` to get the index of the first character
+ * of `string` that is not found in `chars`.
+ *
+ * @private
+ * @param {string} string The string to inspect.
+ * @param {string} chars The characters to find.
+ * @returns {number} Returns the index of the first character not found in `chars`.
+ */
+function charsLeftIndex(string, chars) {
+ var index = -1,
+ length = string.length;
+
+ while (++index < length && chars.indexOf(string.charAt(index)) > -1) {}
+ return index;
+}
+
+module.exports = charsLeftIndex;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/charsRightIndex.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/charsRightIndex.js
new file mode 100644
index 00000000000..1251dcb2a2e
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/charsRightIndex.js
@@ -0,0 +1,17 @@
+/**
+ * Used by `_.trim` and `_.trimRight` to get the index of the last character
+ * of `string` that is not found in `chars`.
+ *
+ * @private
+ * @param {string} string The string to inspect.
+ * @param {string} chars The characters to find.
+ * @returns {number} Returns the index of the last character not found in `chars`.
+ */
+function charsRightIndex(string, chars) {
+ var index = string.length;
+
+ while (index-- && chars.indexOf(string.charAt(index)) > -1) {}
+ return index;
+}
+
+module.exports = charsRightIndex;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/compareAscending.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/compareAscending.js
new file mode 100644
index 00000000000..07f0019af79
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/compareAscending.js
@@ -0,0 +1,16 @@
+var baseCompareAscending = require('./baseCompareAscending');
+
+/**
+ * Used by `_.sortBy` to compare transformed elements of a collection and stable
+ * sort them in ascending order.
+ *
+ * @private
+ * @param {Object} object The object to compare to `other`.
+ * @param {Object} other The object to compare to `object`.
+ * @returns {number} Returns the sort order indicator for `object`.
+ */
+function compareAscending(object, other) {
+ return baseCompareAscending(object.criteria, other.criteria) || (object.index - other.index);
+}
+
+module.exports = compareAscending;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/compareMultiple.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/compareMultiple.js
new file mode 100644
index 00000000000..cc6c86c0301
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/compareMultiple.js
@@ -0,0 +1,43 @@
+var baseCompareAscending = require('./baseCompareAscending');
+
+/**
+ * Used by `_.sortByOrder` to compare multiple properties of each element
+ * in a collection and stable sort them in the following order:
+ *
+ * If `orders` is unspecified, sort in ascending order for all properties.
+ * Otherwise, for each property, sort in ascending order if its corresponding value in
+ * orders is true, and descending order if false.
+ *
+ * @private
+ * @param {Object} object The object to compare to `other`.
+ * @param {Object} other The object to compare to `object`.
+ * @param {boolean[]} orders The order to sort by for each property.
+ * @returns {number} Returns the sort order indicator for `object`.
+ */
+function compareMultiple(object, other, orders) {
+ var index = -1,
+ objCriteria = object.criteria,
+ othCriteria = other.criteria,
+ length = objCriteria.length,
+ ordersLength = orders.length;
+
+ while (++index < length) {
+ var result = baseCompareAscending(objCriteria[index], othCriteria[index]);
+ if (result) {
+ if (index >= ordersLength) {
+ return result;
+ }
+ return result * (orders[index] ? 1 : -1);
+ }
+ }
+ // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
+ // that causes it, under certain circumstances, to provide the same value for
+ // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
+ // for more details.
+ //
+ // This also ensures a stable sort in V8 and other engines.
+ // See https://code.google.com/p/v8/issues/detail?id=90 for more details.
+ return object.index - other.index;
+}
+
+module.exports = compareMultiple;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/composeArgs.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/composeArgs.js
new file mode 100644
index 00000000000..f5a98d5ee79
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/composeArgs.js
@@ -0,0 +1,34 @@
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max;
+
+/**
+ * Creates an array that is the composition of partially applied arguments,
+ * placeholders, and provided arguments into a single array of arguments.
+ *
+ * @private
+ * @param {Array|Object} args The provided arguments.
+ * @param {Array} partials The arguments to prepend to those provided.
+ * @param {Array} holders The `partials` placeholder indexes.
+ * @returns {Array} Returns the new array of composed arguments.
+ */
+function composeArgs(args, partials, holders) {
+ var holdersLength = holders.length,
+ argsIndex = -1,
+ argsLength = nativeMax(args.length - holdersLength, 0),
+ leftIndex = -1,
+ leftLength = partials.length,
+ result = Array(argsLength + leftLength);
+
+ while (++leftIndex < leftLength) {
+ result[leftIndex] = partials[leftIndex];
+ }
+ while (++argsIndex < holdersLength) {
+ result[holders[argsIndex]] = args[argsIndex];
+ }
+ while (argsLength--) {
+ result[leftIndex++] = args[argsIndex++];
+ }
+ return result;
+}
+
+module.exports = composeArgs;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/composeArgsRight.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/composeArgsRight.js
new file mode 100644
index 00000000000..38ab1392b2e
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/composeArgsRight.js
@@ -0,0 +1,36 @@
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max;
+
+/**
+ * This function is like `composeArgs` except that the arguments composition
+ * is tailored for `_.partialRight`.
+ *
+ * @private
+ * @param {Array|Object} args The provided arguments.
+ * @param {Array} partials The arguments to append to those provided.
+ * @param {Array} holders The `partials` placeholder indexes.
+ * @returns {Array} Returns the new array of composed arguments.
+ */
+function composeArgsRight(args, partials, holders) {
+ var holdersIndex = -1,
+ holdersLength = holders.length,
+ argsIndex = -1,
+ argsLength = nativeMax(args.length - holdersLength, 0),
+ rightIndex = -1,
+ rightLength = partials.length,
+ result = Array(argsLength + rightLength);
+
+ while (++argsIndex < argsLength) {
+ result[argsIndex] = args[argsIndex];
+ }
+ var offset = argsIndex;
+ while (++rightIndex < rightLength) {
+ result[offset + rightIndex] = partials[rightIndex];
+ }
+ while (++holdersIndex < holdersLength) {
+ result[offset + holders[holdersIndex]] = args[argsIndex++];
+ }
+ return result;
+}
+
+module.exports = composeArgsRight;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createAggregator.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createAggregator.js
new file mode 100644
index 00000000000..5137861a0d3
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createAggregator.js
@@ -0,0 +1,40 @@
+var baseCallback = require('./baseCallback'),
+ baseEach = require('./baseEach'),
+ isArray = require('../lang/isArray');
+
+/**
+ * Creates a function that aggregates a collection, creating an accumulator
+ * object composed from the results of running each element in the collection
+ * through an iteratee.
+ *
+ * **Note:** This function is used to create `_.countBy`, `_.groupBy`, `_.indexBy`,
+ * and `_.partition`.
+ *
+ * @private
+ * @param {Function} setter The function to set keys and values of the accumulator object.
+ * @param {Function} [initializer] The function to initialize the accumulator object.
+ * @returns {Function} Returns the new aggregator function.
+ */
+function createAggregator(setter, initializer) {
+ return function(collection, iteratee, thisArg) {
+ var result = initializer ? initializer() : {};
+ iteratee = baseCallback(iteratee, thisArg, 3);
+
+ if (isArray(collection)) {
+ var index = -1,
+ length = collection.length;
+
+ while (++index < length) {
+ var value = collection[index];
+ setter(result, value, iteratee(value, index, collection), collection);
+ }
+ } else {
+ baseEach(collection, function(value, key, collection) {
+ setter(result, value, iteratee(value, key, collection), collection);
+ });
+ }
+ return result;
+ };
+}
+
+module.exports = createAggregator;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createAssigner.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createAssigner.js
new file mode 100644
index 00000000000..e06c1b1b764
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createAssigner.js
@@ -0,0 +1,44 @@
+var bindCallback = require('./bindCallback'),
+ isIterateeCall = require('./isIterateeCall'),
+ restParam = require('../function/restParam');
+
+/**
+ * Creates a function that assigns properties of source object(s) to a given
+ * destination object.
+ *
+ * **Note:** This function is used to create `_.assign`, `_.defaults`, and `_.merge`.
+ *
+ * @private
+ * @param {Function} assigner The function to assign values.
+ * @returns {Function} Returns the new assigner function.
+ */
+function createAssigner(assigner) {
+ return restParam(function(object, sources) {
+ var index = -1,
+ length = object == null ? 0 : sources.length,
+ customizer = length > 2 ? sources[length - 2] : undefined,
+ guard = length > 2 ? sources[2] : undefined,
+ thisArg = length > 1 ? sources[length - 1] : undefined;
+
+ if (typeof customizer == 'function') {
+ customizer = bindCallback(customizer, thisArg, 5);
+ length -= 2;
+ } else {
+ customizer = typeof thisArg == 'function' ? thisArg : undefined;
+ length -= (customizer ? 1 : 0);
+ }
+ if (guard && isIterateeCall(sources[0], sources[1], guard)) {
+ customizer = length < 3 ? undefined : customizer;
+ length = 1;
+ }
+ while (++index < length) {
+ var source = sources[index];
+ if (source) {
+ assigner(object, source, customizer);
+ }
+ }
+ return object;
+ });
+}
+
+module.exports = createAssigner;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createBaseEach.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createBaseEach.js
new file mode 100644
index 00000000000..b55c39ba1cb
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createBaseEach.js
@@ -0,0 +1,31 @@
+var getLength = require('./getLength'),
+ isLength = require('./isLength'),
+ toObject = require('./toObject');
+
+/**
+ * Creates a `baseEach` or `baseEachRight` function.
+ *
+ * @private
+ * @param {Function} eachFunc The function to iterate over a collection.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Function} Returns the new base function.
+ */
+function createBaseEach(eachFunc, fromRight) {
+ return function(collection, iteratee) {
+ var length = collection ? getLength(collection) : 0;
+ if (!isLength(length)) {
+ return eachFunc(collection, iteratee);
+ }
+ var index = fromRight ? length : -1,
+ iterable = toObject(collection);
+
+ while ((fromRight ? index-- : ++index < length)) {
+ if (iteratee(iterable[index], index, iterable) === false) {
+ break;
+ }
+ }
+ return collection;
+ };
+}
+
+module.exports = createBaseEach;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createBaseFor.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createBaseFor.js
new file mode 100644
index 00000000000..3c2cac510e0
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createBaseFor.js
@@ -0,0 +1,27 @@
+var toObject = require('./toObject');
+
+/**
+ * Creates a base function for `_.forIn` or `_.forInRight`.
+ *
+ * @private
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Function} Returns the new base function.
+ */
+function createBaseFor(fromRight) {
+ return function(object, iteratee, keysFunc) {
+ var iterable = toObject(object),
+ props = keysFunc(object),
+ length = props.length,
+ index = fromRight ? length : -1;
+
+ while ((fromRight ? index-- : ++index < length)) {
+ var key = props[index];
+ if (iteratee(iterable[key], key, iterable) === false) {
+ break;
+ }
+ }
+ return object;
+ };
+}
+
+module.exports = createBaseFor;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createBindWrapper.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createBindWrapper.js
new file mode 100644
index 00000000000..54086ee88cd
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createBindWrapper.js
@@ -0,0 +1,22 @@
+var createCtorWrapper = require('./createCtorWrapper');
+
+/**
+ * Creates a function that wraps `func` and invokes it with the `this`
+ * binding of `thisArg`.
+ *
+ * @private
+ * @param {Function} func The function to bind.
+ * @param {*} [thisArg] The `this` binding of `func`.
+ * @returns {Function} Returns the new bound function.
+ */
+function createBindWrapper(func, thisArg) {
+ var Ctor = createCtorWrapper(func);
+
+ function wrapper() {
+ var fn = (this && this !== global && this instanceof wrapper) ? Ctor : func;
+ return fn.apply(thisArg, arguments);
+ }
+ return wrapper;
+}
+
+module.exports = createBindWrapper;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createCache.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createCache.js
new file mode 100644
index 00000000000..012cab1b63a
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createCache.js
@@ -0,0 +1,22 @@
+var SetCache = require('./SetCache'),
+ constant = require('../utility/constant'),
+ getNative = require('./getNative');
+
+/** Native method references. */
+var Set = getNative(global, 'Set');
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeCreate = getNative(Object, 'create');
+
+/**
+ * Creates a `Set` cache object to optimize linear searches of large arrays.
+ *
+ * @private
+ * @param {Array} [values] The values to cache.
+ * @returns {null|Object} Returns the new cache object if `Set` is supported, else `null`.
+ */
+var createCache = !(nativeCreate && Set) ? constant(null) : function(values) {
+ return new SetCache(values);
+};
+
+module.exports = createCache;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createCompounder.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createCompounder.js
new file mode 100644
index 00000000000..4c755120c6d
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createCompounder.js
@@ -0,0 +1,26 @@
+var deburr = require('../string/deburr'),
+ words = require('../string/words');
+
+/**
+ * Creates a function that produces compound words out of the words in a
+ * given string.
+ *
+ * @private
+ * @param {Function} callback The function to combine each word.
+ * @returns {Function} Returns the new compounder function.
+ */
+function createCompounder(callback) {
+ return function(string) {
+ var index = -1,
+ array = words(deburr(string)),
+ length = array.length,
+ result = '';
+
+ while (++index < length) {
+ result = callback(result, array[index], index);
+ }
+ return result;
+ };
+}
+
+module.exports = createCompounder;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createCtorWrapper.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createCtorWrapper.js
new file mode 100644
index 00000000000..f1a12d14e85
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createCtorWrapper.js
@@ -0,0 +1,35 @@
+var baseCreate = require('./baseCreate'),
+ isObject = require('../lang/isObject');
+
+/**
+ * Creates a function that produces an instance of `Ctor` regardless of
+ * whether it was invoked as part of a `new` expression or by `call` or `apply`.
+ *
+ * @private
+ * @param {Function} Ctor The constructor to wrap.
+ * @returns {Function} Returns the new wrapped function.
+ */
+function createCtorWrapper(Ctor) {
+ return function() {
+ // Use a `switch` statement to work with class constructors.
+ // See https://people.mozilla.org/~jorendorff/es6-draft.html#sec-ecmascript-function-objects-call-thisargument-argumentslist
+ // for more details.
+ var args = arguments;
+ switch (args.length) {
+ case 0: return new Ctor;
+ case 1: return new Ctor(args[0]);
+ case 2: return new Ctor(args[0], args[1]);
+ case 3: return new Ctor(args[0], args[1], args[2]);
+ case 4: return new Ctor(args[0], args[1], args[2], args[3]);
+ case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
+ }
+ var thisBinding = baseCreate(Ctor.prototype),
+ result = Ctor.apply(thisBinding, args);
+
+ // Mimic the constructor's `return` behavior.
+ // See https://es5.github.io/#x13.2.2 for more details.
+ return isObject(result) ? result : thisBinding;
+ };
+}
+
+module.exports = createCtorWrapper;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createCurry.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createCurry.js
new file mode 100644
index 00000000000..e140e711f8d
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createCurry.js
@@ -0,0 +1,23 @@
+var createWrapper = require('./createWrapper'),
+ isIterateeCall = require('./isIterateeCall');
+
+/**
+ * Creates a `_.curry` or `_.curryRight` function.
+ *
+ * @private
+ * @param {boolean} flag The curry bit flag.
+ * @returns {Function} Returns the new curry function.
+ */
+function createCurry(flag) {
+ function curryFunc(func, arity, guard) {
+ if (guard && isIterateeCall(func, arity, guard)) {
+ arity = null;
+ }
+ var result = createWrapper(func, flag, null, null, null, null, null, arity);
+ result.placeholder = curryFunc.placeholder;
+ return result;
+ }
+ return curryFunc;
+}
+
+module.exports = createCurry;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createExtremum.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createExtremum.js
new file mode 100644
index 00000000000..60f0b79191e
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createExtremum.js
@@ -0,0 +1,32 @@
+var arrayExtremum = require('./arrayExtremum'),
+ baseCallback = require('./baseCallback'),
+ baseExtremum = require('./baseExtremum'),
+ isIterateeCall = require('./isIterateeCall'),
+ toIterable = require('./toIterable');
+
+/**
+ * Creates a `_.max` or `_.min` function.
+ *
+ * @private
+ * @param {Function} comparator The function used to compare values.
+ * @param {*} exValue The initial extremum value.
+ * @returns {Function} Returns the new extremum function.
+ */
+function createExtremum(comparator, exValue) {
+ return function(collection, iteratee, thisArg) {
+ if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
+ iteratee = null;
+ }
+ iteratee = baseCallback(iteratee, thisArg, 3);
+ if (iteratee.length == 1) {
+ collection = toIterable(collection);
+ var result = arrayExtremum(collection, iteratee, comparator, exValue);
+ if (!(collection.length && result === exValue)) {
+ return result;
+ }
+ }
+ return baseExtremum(collection, iteratee, comparator, exValue);
+ };
+}
+
+module.exports = createExtremum;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createFind.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createFind.js
new file mode 100644
index 00000000000..29bf580fb56
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createFind.js
@@ -0,0 +1,25 @@
+var baseCallback = require('./baseCallback'),
+ baseFind = require('./baseFind'),
+ baseFindIndex = require('./baseFindIndex'),
+ isArray = require('../lang/isArray');
+
+/**
+ * Creates a `_.find` or `_.findLast` function.
+ *
+ * @private
+ * @param {Function} eachFunc The function to iterate over a collection.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Function} Returns the new find function.
+ */
+function createFind(eachFunc, fromRight) {
+ return function(collection, predicate, thisArg) {
+ predicate = baseCallback(predicate, thisArg, 3);
+ if (isArray(collection)) {
+ var index = baseFindIndex(collection, predicate, fromRight);
+ return index > -1 ? collection[index] : undefined;
+ }
+ return baseFind(collection, predicate, eachFunc);
+ };
+}
+
+module.exports = createFind;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createFindIndex.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createFindIndex.js
new file mode 100644
index 00000000000..3947bea9ae5
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createFindIndex.js
@@ -0,0 +1,21 @@
+var baseCallback = require('./baseCallback'),
+ baseFindIndex = require('./baseFindIndex');
+
+/**
+ * Creates a `_.findIndex` or `_.findLastIndex` function.
+ *
+ * @private
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Function} Returns the new find function.
+ */
+function createFindIndex(fromRight) {
+ return function(array, predicate, thisArg) {
+ if (!(array && array.length)) {
+ return -1;
+ }
+ predicate = baseCallback(predicate, thisArg, 3);
+ return baseFindIndex(array, predicate, fromRight);
+ };
+}
+
+module.exports = createFindIndex;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createFindKey.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createFindKey.js
new file mode 100644
index 00000000000..0ce85e4cbb0
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createFindKey.js
@@ -0,0 +1,18 @@
+var baseCallback = require('./baseCallback'),
+ baseFind = require('./baseFind');
+
+/**
+ * Creates a `_.findKey` or `_.findLastKey` function.
+ *
+ * @private
+ * @param {Function} objectFunc The function to iterate over an object.
+ * @returns {Function} Returns the new find function.
+ */
+function createFindKey(objectFunc) {
+ return function(object, predicate, thisArg) {
+ predicate = baseCallback(predicate, thisArg, 3);
+ return baseFind(object, predicate, objectFunc, true);
+ };
+}
+
+module.exports = createFindKey;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createFlow.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createFlow.js
new file mode 100644
index 00000000000..f1821835f4f
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createFlow.js
@@ -0,0 +1,69 @@
+var LodashWrapper = require('./LodashWrapper'),
+ getData = require('./getData'),
+ getFuncName = require('./getFuncName'),
+ isArray = require('../lang/isArray'),
+ isLaziable = require('./isLaziable');
+
+/** Used to compose bitmasks for wrapper metadata. */
+var CURRY_FLAG = 8,
+ PARTIAL_FLAG = 32,
+ ARY_FLAG = 128,
+ REARG_FLAG = 256;
+
+/** Used as the `TypeError` message for "Functions" methods. */
+var FUNC_ERROR_TEXT = 'Expected a function';
+
+/**
+ * Creates a `_.flow` or `_.flowRight` function.
+ *
+ * @private
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Function} Returns the new flow function.
+ */
+function createFlow(fromRight) {
+ return function() {
+ var wrapper,
+ length = arguments.length,
+ index = fromRight ? length : -1,
+ leftIndex = 0,
+ funcs = Array(length);
+
+ while ((fromRight ? index-- : ++index < length)) {
+ var func = funcs[leftIndex++] = arguments[index];
+ if (typeof func != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ if (!wrapper && LodashWrapper.prototype.thru && getFuncName(func) == 'wrapper') {
+ wrapper = new LodashWrapper([]);
+ }
+ }
+ index = wrapper ? -1 : length;
+ while (++index < length) {
+ func = funcs[index];
+
+ var funcName = getFuncName(func),
+ data = funcName == 'wrapper' ? getData(func) : null;
+
+ if (data && isLaziable(data[0]) && data[1] == (ARY_FLAG | CURRY_FLAG | PARTIAL_FLAG | REARG_FLAG) && !data[4].length && data[9] == 1) {
+ wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
+ } else {
+ wrapper = (func.length == 1 && isLaziable(func)) ? wrapper[funcName]() : wrapper.thru(func);
+ }
+ }
+ return function() {
+ var args = arguments;
+ if (wrapper && args.length == 1 && isArray(args[0])) {
+ return wrapper.plant(args[0]).value();
+ }
+ var index = 0,
+ result = length ? funcs[index].apply(this, args) : args[0];
+
+ while (++index < length) {
+ result = funcs[index].call(this, result);
+ }
+ return result;
+ };
+ };
+}
+
+module.exports = createFlow;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createForEach.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createForEach.js
new file mode 100644
index 00000000000..2aad11c5f7d
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createForEach.js
@@ -0,0 +1,20 @@
+var bindCallback = require('./bindCallback'),
+ isArray = require('../lang/isArray');
+
+/**
+ * Creates a function for `_.forEach` or `_.forEachRight`.
+ *
+ * @private
+ * @param {Function} arrayFunc The function to iterate over an array.
+ * @param {Function} eachFunc The function to iterate over a collection.
+ * @returns {Function} Returns the new each function.
+ */
+function createForEach(arrayFunc, eachFunc) {
+ return function(collection, iteratee, thisArg) {
+ return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection))
+ ? arrayFunc(collection, iteratee)
+ : eachFunc(collection, bindCallback(iteratee, thisArg, 3));
+ };
+}
+
+module.exports = createForEach;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createForIn.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createForIn.js
new file mode 100644
index 00000000000..f63ffa0baf0
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createForIn.js
@@ -0,0 +1,20 @@
+var bindCallback = require('./bindCallback'),
+ keysIn = require('../object/keysIn');
+
+/**
+ * Creates a function for `_.forIn` or `_.forInRight`.
+ *
+ * @private
+ * @param {Function} objectFunc The function to iterate over an object.
+ * @returns {Function} Returns the new each function.
+ */
+function createForIn(objectFunc) {
+ return function(object, iteratee, thisArg) {
+ if (typeof iteratee != 'function' || thisArg !== undefined) {
+ iteratee = bindCallback(iteratee, thisArg, 3);
+ }
+ return objectFunc(object, iteratee, keysIn);
+ };
+}
+
+module.exports = createForIn;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createForOwn.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createForOwn.js
new file mode 100644
index 00000000000..b9a83c3b529
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createForOwn.js
@@ -0,0 +1,19 @@
+var bindCallback = require('./bindCallback');
+
+/**
+ * Creates a function for `_.forOwn` or `_.forOwnRight`.
+ *
+ * @private
+ * @param {Function} objectFunc The function to iterate over an object.
+ * @returns {Function} Returns the new each function.
+ */
+function createForOwn(objectFunc) {
+ return function(object, iteratee, thisArg) {
+ if (typeof iteratee != 'function' || thisArg !== undefined) {
+ iteratee = bindCallback(iteratee, thisArg, 3);
+ }
+ return objectFunc(object, iteratee);
+ };
+}
+
+module.exports = createForOwn;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createHybridWrapper.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createHybridWrapper.js
new file mode 100644
index 00000000000..d7de9ade712
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createHybridWrapper.js
@@ -0,0 +1,111 @@
+var arrayCopy = require('./arrayCopy'),
+ composeArgs = require('./composeArgs'),
+ composeArgsRight = require('./composeArgsRight'),
+ createCtorWrapper = require('./createCtorWrapper'),
+ isLaziable = require('./isLaziable'),
+ reorder = require('./reorder'),
+ replaceHolders = require('./replaceHolders'),
+ setData = require('./setData');
+
+/** Used to compose bitmasks for wrapper metadata. */
+var BIND_FLAG = 1,
+ BIND_KEY_FLAG = 2,
+ CURRY_BOUND_FLAG = 4,
+ CURRY_FLAG = 8,
+ CURRY_RIGHT_FLAG = 16,
+ PARTIAL_FLAG = 32,
+ PARTIAL_RIGHT_FLAG = 64,
+ ARY_FLAG = 128;
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max;
+
+/**
+ * Creates a function that wraps `func` and invokes it with optional `this`
+ * binding of, partial application, and currying.
+ *
+ * @private
+ * @param {Function|string} func The function or method name to reference.
+ * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details.
+ * @param {*} [thisArg] The `this` binding of `func`.
+ * @param {Array} [partials] The arguments to prepend to those provided to the new function.
+ * @param {Array} [holders] The `partials` placeholder indexes.
+ * @param {Array} [partialsRight] The arguments to append to those provided to the new function.
+ * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
+ * @param {Array} [argPos] The argument positions of the new function.
+ * @param {number} [ary] The arity cap of `func`.
+ * @param {number} [arity] The arity of `func`.
+ * @returns {Function} Returns the new wrapped function.
+ */
+function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
+ var isAry = bitmask & ARY_FLAG,
+ isBind = bitmask & BIND_FLAG,
+ isBindKey = bitmask & BIND_KEY_FLAG,
+ isCurry = bitmask & CURRY_FLAG,
+ isCurryBound = bitmask & CURRY_BOUND_FLAG,
+ isCurryRight = bitmask & CURRY_RIGHT_FLAG,
+ Ctor = isBindKey ? null : createCtorWrapper(func);
+
+ function wrapper() {
+ // Avoid `arguments` object use disqualifying optimizations by
+ // converting it to an array before providing it to other functions.
+ var length = arguments.length,
+ index = length,
+ args = Array(length);
+
+ while (index--) {
+ args[index] = arguments[index];
+ }
+ if (partials) {
+ args = composeArgs(args, partials, holders);
+ }
+ if (partialsRight) {
+ args = composeArgsRight(args, partialsRight, holdersRight);
+ }
+ if (isCurry || isCurryRight) {
+ var placeholder = wrapper.placeholder,
+ argsHolders = replaceHolders(args, placeholder);
+
+ length -= argsHolders.length;
+ if (length < arity) {
+ var newArgPos = argPos ? arrayCopy(argPos) : null,
+ newArity = nativeMax(arity - length, 0),
+ newsHolders = isCurry ? argsHolders : null,
+ newHoldersRight = isCurry ? null : argsHolders,
+ newPartials = isCurry ? args : null,
+ newPartialsRight = isCurry ? null : args;
+
+ bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG);
+ bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG);
+
+ if (!isCurryBound) {
+ bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG);
+ }
+ var newData = [func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, newArity],
+ result = createHybridWrapper.apply(undefined, newData);
+
+ if (isLaziable(func)) {
+ setData(result, newData);
+ }
+ result.placeholder = placeholder;
+ return result;
+ }
+ }
+ var thisBinding = isBind ? thisArg : this,
+ fn = isBindKey ? thisBinding[func] : func;
+
+ if (argPos) {
+ args = reorder(args, argPos);
+ }
+ if (isAry && ary < args.length) {
+ args.length = ary;
+ }
+ if (this && this !== global && this instanceof wrapper) {
+ fn = Ctor || createCtorWrapper(func);
+ }
+ return fn.apply(thisBinding, args);
+ }
+ return wrapper;
+}
+
+module.exports = createHybridWrapper;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createObjectMapper.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createObjectMapper.js
new file mode 100644
index 00000000000..06d6a87399f
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createObjectMapper.js
@@ -0,0 +1,26 @@
+var baseCallback = require('./baseCallback'),
+ baseForOwn = require('./baseForOwn');
+
+/**
+ * Creates a function for `_.mapKeys` or `_.mapValues`.
+ *
+ * @private
+ * @param {boolean} [isMapKeys] Specify mapping keys instead of values.
+ * @returns {Function} Returns the new map function.
+ */
+function createObjectMapper(isMapKeys) {
+ return function(object, iteratee, thisArg) {
+ var result = {};
+ iteratee = baseCallback(iteratee, thisArg, 3);
+
+ baseForOwn(object, function(value, key, object) {
+ var mapped = iteratee(value, key, object);
+ key = isMapKeys ? mapped : key;
+ value = isMapKeys ? value : mapped;
+ result[key] = value;
+ });
+ return result;
+ };
+}
+
+module.exports = createObjectMapper;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createPadDir.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createPadDir.js
new file mode 100644
index 00000000000..da0ebf1dd96
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createPadDir.js
@@ -0,0 +1,18 @@
+var baseToString = require('./baseToString'),
+ createPadding = require('./createPadding');
+
+/**
+ * Creates a function for `_.padLeft` or `_.padRight`.
+ *
+ * @private
+ * @param {boolean} [fromRight] Specify padding from the right.
+ * @returns {Function} Returns the new pad function.
+ */
+function createPadDir(fromRight) {
+ return function(string, length, chars) {
+ string = baseToString(string);
+ return (fromRight ? string : '') + createPadding(string, length, chars) + (fromRight ? '' : string);
+ };
+}
+
+module.exports = createPadDir;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createPadding.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createPadding.js
new file mode 100644
index 00000000000..57979926f1b
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createPadding.js
@@ -0,0 +1,31 @@
+var repeat = require('../string/repeat');
+
+/** Native method references. */
+var ceil = Math.ceil;
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeIsFinite = global.isFinite;
+
+/**
+ * Creates the padding required for `string` based on the given `length`.
+ * The `chars` string is truncated if the number of characters exceeds `length`.
+ *
+ * @private
+ * @param {string} string The string to create padding for.
+ * @param {number} [length=0] The padding length.
+ * @param {string} [chars=' '] The string used as padding.
+ * @returns {string} Returns the pad for `string`.
+ */
+function createPadding(string, length, chars) {
+ var strLength = string.length;
+ length = +length;
+
+ if (strLength >= length || !nativeIsFinite(length)) {
+ return '';
+ }
+ var padLength = length - strLength;
+ chars = chars == null ? ' ' : (chars + '');
+ return repeat(chars, ceil(padLength / chars.length)).slice(0, padLength);
+}
+
+module.exports = createPadding;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createPartial.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createPartial.js
new file mode 100644
index 00000000000..c0e42b61578
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createPartial.js
@@ -0,0 +1,20 @@
+var createWrapper = require('./createWrapper'),
+ replaceHolders = require('./replaceHolders'),
+ restParam = require('../function/restParam');
+
+/**
+ * Creates a `_.partial` or `_.partialRight` function.
+ *
+ * @private
+ * @param {boolean} flag The partial bit flag.
+ * @returns {Function} Returns the new partial function.
+ */
+function createPartial(flag) {
+ var partialFunc = restParam(function(func, partials) {
+ var holders = replaceHolders(partials, partialFunc.placeholder);
+ return createWrapper(func, flag, null, partials, holders);
+ });
+ return partialFunc;
+}
+
+module.exports = createPartial;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createPartialWrapper.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createPartialWrapper.js
new file mode 100644
index 00000000000..10af97cbdd5
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createPartialWrapper.js
@@ -0,0 +1,43 @@
+var createCtorWrapper = require('./createCtorWrapper');
+
+/** Used to compose bitmasks for wrapper metadata. */
+var BIND_FLAG = 1;
+
+/**
+ * Creates a function that wraps `func` and invokes it with the optional `this`
+ * binding of `thisArg` and the `partials` prepended to those provided to
+ * the wrapper.
+ *
+ * @private
+ * @param {Function} func The function to partially apply arguments to.
+ * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details.
+ * @param {*} thisArg The `this` binding of `func`.
+ * @param {Array} partials The arguments to prepend to those provided to the new function.
+ * @returns {Function} Returns the new bound function.
+ */
+function createPartialWrapper(func, bitmask, thisArg, partials) {
+ var isBind = bitmask & BIND_FLAG,
+ Ctor = createCtorWrapper(func);
+
+ function wrapper() {
+ // Avoid `arguments` object use disqualifying optimizations by
+ // converting it to an array before providing it `func`.
+ var argsIndex = -1,
+ argsLength = arguments.length,
+ leftIndex = -1,
+ leftLength = partials.length,
+ args = Array(argsLength + leftLength);
+
+ while (++leftIndex < leftLength) {
+ args[leftIndex] = partials[leftIndex];
+ }
+ while (argsLength--) {
+ args[leftIndex++] = arguments[++argsIndex];
+ }
+ var fn = (this && this !== global && this instanceof wrapper) ? Ctor : func;
+ return fn.apply(isBind ? thisArg : this, args);
+ }
+ return wrapper;
+}
+
+module.exports = createPartialWrapper;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createReduce.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createReduce.js
new file mode 100644
index 00000000000..816f4ce71be
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createReduce.js
@@ -0,0 +1,22 @@
+var baseCallback = require('./baseCallback'),
+ baseReduce = require('./baseReduce'),
+ isArray = require('../lang/isArray');
+
+/**
+ * Creates a function for `_.reduce` or `_.reduceRight`.
+ *
+ * @private
+ * @param {Function} arrayFunc The function to iterate over an array.
+ * @param {Function} eachFunc The function to iterate over a collection.
+ * @returns {Function} Returns the new each function.
+ */
+function createReduce(arrayFunc, eachFunc) {
+ return function(collection, iteratee, accumulator, thisArg) {
+ var initFromArray = arguments.length < 3;
+ return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection))
+ ? arrayFunc(collection, iteratee, accumulator, initFromArray)
+ : baseReduce(collection, baseCallback(iteratee, thisArg, 4), accumulator, initFromArray, eachFunc);
+ };
+}
+
+module.exports = createReduce;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createSortedIndex.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createSortedIndex.js
new file mode 100644
index 00000000000..86c78520c9b
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createSortedIndex.js
@@ -0,0 +1,20 @@
+var baseCallback = require('./baseCallback'),
+ binaryIndex = require('./binaryIndex'),
+ binaryIndexBy = require('./binaryIndexBy');
+
+/**
+ * Creates a `_.sortedIndex` or `_.sortedLastIndex` function.
+ *
+ * @private
+ * @param {boolean} [retHighest] Specify returning the highest qualified index.
+ * @returns {Function} Returns the new index function.
+ */
+function createSortedIndex(retHighest) {
+ return function(array, value, iteratee, thisArg) {
+ return iteratee == null
+ ? binaryIndex(array, value, retHighest)
+ : binaryIndexBy(array, value, baseCallback(iteratee, thisArg, 1), retHighest);
+ };
+}
+
+module.exports = createSortedIndex;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createWrapper.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createWrapper.js
new file mode 100644
index 00000000000..6b5379917df
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/createWrapper.js
@@ -0,0 +1,86 @@
+var baseSetData = require('./baseSetData'),
+ createBindWrapper = require('./createBindWrapper'),
+ createHybridWrapper = require('./createHybridWrapper'),
+ createPartialWrapper = require('./createPartialWrapper'),
+ getData = require('./getData'),
+ mergeData = require('./mergeData'),
+ setData = require('./setData');
+
+/** Used to compose bitmasks for wrapper metadata. */
+var BIND_FLAG = 1,
+ BIND_KEY_FLAG = 2,
+ PARTIAL_FLAG = 32,
+ PARTIAL_RIGHT_FLAG = 64;
+
+/** Used as the `TypeError` message for "Functions" methods. */
+var FUNC_ERROR_TEXT = 'Expected a function';
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max;
+
+/**
+ * Creates a function that either curries or invokes `func` with optional
+ * `this` binding and partially applied arguments.
+ *
+ * @private
+ * @param {Function|string} func The function or method name to reference.
+ * @param {number} bitmask The bitmask of flags.
+ * The bitmask may be composed of the following flags:
+ * 1 - `_.bind`
+ * 2 - `_.bindKey`
+ * 4 - `_.curry` or `_.curryRight` of a bound function
+ * 8 - `_.curry`
+ * 16 - `_.curryRight`
+ * 32 - `_.partial`
+ * 64 - `_.partialRight`
+ * 128 - `_.rearg`
+ * 256 - `_.ary`
+ * @param {*} [thisArg] The `this` binding of `func`.
+ * @param {Array} [partials] The arguments to be partially applied.
+ * @param {Array} [holders] The `partials` placeholder indexes.
+ * @param {Array} [argPos] The argument positions of the new function.
+ * @param {number} [ary] The arity cap of `func`.
+ * @param {number} [arity] The arity of `func`.
+ * @returns {Function} Returns the new wrapped function.
+ */
+function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
+ var isBindKey = bitmask & BIND_KEY_FLAG;
+ if (!isBindKey && typeof func != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ var length = partials ? partials.length : 0;
+ if (!length) {
+ bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG);
+ partials = holders = null;
+ }
+ length -= (holders ? holders.length : 0);
+ if (bitmask & PARTIAL_RIGHT_FLAG) {
+ var partialsRight = partials,
+ holdersRight = holders;
+
+ partials = holders = null;
+ }
+ var data = isBindKey ? null : getData(func),
+ newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity];
+
+ if (data) {
+ mergeData(newData, data);
+ bitmask = newData[1];
+ arity = newData[9];
+ }
+ newData[9] = arity == null
+ ? (isBindKey ? 0 : func.length)
+ : (nativeMax(arity - length, 0) || 0);
+
+ if (bitmask == BIND_FLAG) {
+ var result = createBindWrapper(newData[0], newData[2]);
+ } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !newData[4].length) {
+ result = createPartialWrapper.apply(undefined, newData);
+ } else {
+ result = createHybridWrapper.apply(undefined, newData);
+ }
+ var setter = data ? baseSetData : setData;
+ return setter(result, newData);
+}
+
+module.exports = createWrapper;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/deburrLetter.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/deburrLetter.js
new file mode 100644
index 00000000000..e559dbea7a4
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/deburrLetter.js
@@ -0,0 +1,33 @@
+/** Used to map latin-1 supplementary letters to basic latin letters. */
+var deburredLetters = {
+ '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
+ '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
+ '\xc7': 'C', '\xe7': 'c',
+ '\xd0': 'D', '\xf0': 'd',
+ '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
+ '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
+ '\xcC': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
+ '\xeC': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
+ '\xd1': 'N', '\xf1': 'n',
+ '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
+ '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
+ '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
+ '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
+ '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
+ '\xc6': 'Ae', '\xe6': 'ae',
+ '\xde': 'Th', '\xfe': 'th',
+ '\xdf': 'ss'
+};
+
+/**
+ * Used by `_.deburr` to convert latin-1 supplementary letters to basic latin letters.
+ *
+ * @private
+ * @param {string} letter The matched letter to deburr.
+ * @returns {string} Returns the deburred letter.
+ */
+function deburrLetter(letter) {
+ return deburredLetters[letter];
+}
+
+module.exports = deburrLetter;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/equalArrays.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/equalArrays.js
new file mode 100644
index 00000000000..e0bb2d32a81
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/equalArrays.js
@@ -0,0 +1,51 @@
+var arraySome = require('./arraySome');
+
+/**
+ * A specialized version of `baseIsEqualDeep` for arrays with support for
+ * partial deep comparisons.
+ *
+ * @private
+ * @param {Array} array The array to compare.
+ * @param {Array} other The other array to compare.
+ * @param {Function} equalFunc The function to determine equivalents of values.
+ * @param {Function} [customizer] The function to customize comparing arrays.
+ * @param {boolean} [isLoose] Specify performing partial comparisons.
+ * @param {Array} [stackA] Tracks traversed `value` objects.
+ * @param {Array} [stackB] Tracks traversed `other` objects.
+ * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
+ */
+function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) {
+ var index = -1,
+ arrLength = array.length,
+ othLength = other.length;
+
+ if (arrLength != othLength && !(isLoose && othLength > arrLength)) {
+ return false;
+ }
+ // Ignore non-index properties.
+ while (++index < arrLength) {
+ var arrValue = array[index],
+ othValue = other[index],
+ result = customizer ? customizer(isLoose ? othValue : arrValue, isLoose ? arrValue : othValue, index) : undefined;
+
+ if (result !== undefined) {
+ if (result) {
+ continue;
+ }
+ return false;
+ }
+ // Recursively compare arrays (susceptible to call stack limits).
+ if (isLoose) {
+ if (!arraySome(other, function(othValue) {
+ return arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);
+ })) {
+ return false;
+ }
+ } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB))) {
+ return false;
+ }
+ }
+ return true;
+}
+
+module.exports = equalArrays;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/equalByTag.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/equalByTag.js
new file mode 100644
index 00000000000..addc3df0e04
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/equalByTag.js
@@ -0,0 +1,48 @@
+/** `Object#toString` result references. */
+var boolTag = '[object Boolean]',
+ dateTag = '[object Date]',
+ errorTag = '[object Error]',
+ numberTag = '[object Number]',
+ regexpTag = '[object RegExp]',
+ stringTag = '[object String]';
+
+/**
+ * A specialized version of `baseIsEqualDeep` for comparing objects of
+ * the same `toStringTag`.
+ *
+ * **Note:** This function only supports comparing values with tags of
+ * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
+ *
+ * @private
+ * @param {Object} value The object to compare.
+ * @param {Object} other The other object to compare.
+ * @param {string} tag The `toStringTag` of the objects to compare.
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+ */
+function equalByTag(object, other, tag) {
+ switch (tag) {
+ case boolTag:
+ case dateTag:
+ // Coerce dates and booleans to numbers, dates to milliseconds and booleans
+ // to `1` or `0` treating invalid dates coerced to `NaN` as not equal.
+ return +object == +other;
+
+ case errorTag:
+ return object.name == other.name && object.message == other.message;
+
+ case numberTag:
+ // Treat `NaN` vs. `NaN` as equal.
+ return (object != +object)
+ ? other != +other
+ : object == +other;
+
+ case regexpTag:
+ case stringTag:
+ // Coerce regexes to strings and treat strings primitives and string
+ // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details.
+ return object == (other + '');
+ }
+ return false;
+}
+
+module.exports = equalByTag;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/equalObjects.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/equalObjects.js
new file mode 100644
index 00000000000..1297a3b2afe
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/equalObjects.js
@@ -0,0 +1,67 @@
+var keys = require('../object/keys');
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * A specialized version of `baseIsEqualDeep` for objects with support for
+ * partial deep comparisons.
+ *
+ * @private
+ * @param {Object} object The object to compare.
+ * @param {Object} other The other object to compare.
+ * @param {Function} equalFunc The function to determine equivalents of values.
+ * @param {Function} [customizer] The function to customize comparing values.
+ * @param {boolean} [isLoose] Specify performing partial comparisons.
+ * @param {Array} [stackA] Tracks traversed `value` objects.
+ * @param {Array} [stackB] Tracks traversed `other` objects.
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+ */
+function equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
+ var objProps = keys(object),
+ objLength = objProps.length,
+ othProps = keys(other),
+ othLength = othProps.length;
+
+ if (objLength != othLength && !isLoose) {
+ return false;
+ }
+ var index = objLength;
+ while (index--) {
+ var key = objProps[index];
+ if (!(isLoose ? key in other : hasOwnProperty.call(other, key))) {
+ return false;
+ }
+ }
+ var skipCtor = isLoose;
+ while (++index < objLength) {
+ key = objProps[index];
+ var objValue = object[key],
+ othValue = other[key],
+ result = customizer ? customizer(isLoose ? othValue : objValue, isLoose? objValue : othValue, key) : undefined;
+
+ // Recursively compare objects (susceptible to call stack limits).
+ if (!(result === undefined ? equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB) : result)) {
+ return false;
+ }
+ skipCtor || (skipCtor = key == 'constructor');
+ }
+ if (!skipCtor) {
+ var objCtor = object.constructor,
+ othCtor = other.constructor;
+
+ // Non `Object` object instances with different constructors are not equal.
+ if (objCtor != othCtor &&
+ ('constructor' in object && 'constructor' in other) &&
+ !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
+ typeof othCtor == 'function' && othCtor instanceof othCtor)) {
+ return false;
+ }
+ }
+ return true;
+}
+
+module.exports = equalObjects;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/escapeHtmlChar.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/escapeHtmlChar.js
new file mode 100644
index 00000000000..b21e452b5b7
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/escapeHtmlChar.js
@@ -0,0 +1,22 @@
+/** Used to map characters to HTML entities. */
+var htmlEscapes = {
+ '&': '&amp;',
+ '<': '&lt;',
+ '>': '&gt;',
+ '"': '&quot;',
+ "'": '&#39;',
+ '`': '&#96;'
+};
+
+/**
+ * Used by `_.escape` to convert characters to HTML entities.
+ *
+ * @private
+ * @param {string} chr The matched character to escape.
+ * @returns {string} Returns the escaped character.
+ */
+function escapeHtmlChar(chr) {
+ return htmlEscapes[chr];
+}
+
+module.exports = escapeHtmlChar;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/escapeStringChar.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/escapeStringChar.js
new file mode 100644
index 00000000000..c8fba0dcacb
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/escapeStringChar.js
@@ -0,0 +1,23 @@
+/** Used to escape characters for inclusion in compiled string literals. */
+var stringEscapes = {
+ '\\': '\\',
+ "'": "'",
+ '\n': 'n',
+ '\r': 'r',
+ '\u2028': 'u2028',
+ '\u2029': 'u2029'
+};
+
+/**
+ * Used by `_.template` to escape characters for inclusion in compiled
+ * string literals.
+ *
+ * @private
+ * @param {string} chr The matched character to escape.
+ * @returns {string} Returns the escaped character.
+ */
+function escapeStringChar(chr) {
+ return '\\' + stringEscapes[chr];
+}
+
+module.exports = escapeStringChar;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/getData.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/getData.js
new file mode 100644
index 00000000000..5bb4f466e7f
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/getData.js
@@ -0,0 +1,15 @@
+var metaMap = require('./metaMap'),
+ noop = require('../utility/noop');
+
+/**
+ * Gets metadata for `func`.
+ *
+ * @private
+ * @param {Function} func The function to query.
+ * @returns {*} Returns the metadata for `func`.
+ */
+var getData = !metaMap ? noop : function(func) {
+ return metaMap.get(func);
+};
+
+module.exports = getData;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/getFuncName.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/getFuncName.js
new file mode 100644
index 00000000000..2ea73a6cd5c
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/getFuncName.js
@@ -0,0 +1,25 @@
+var realNames = require('./realNames');
+
+/**
+ * Gets the name of `func`.
+ *
+ * @private
+ * @param {Function} func The function to query.
+ * @returns {string} Returns the function name.
+ */
+function getFuncName(func) {
+ var result = func.name,
+ array = realNames[result],
+ length = array ? array.length : 0;
+
+ while (length--) {
+ var data = array[length],
+ otherFunc = data.func;
+ if (otherFunc == null || otherFunc == func) {
+ return data.name;
+ }
+ }
+ return result;
+}
+
+module.exports = getFuncName;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/getLength.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/getLength.js
new file mode 100644
index 00000000000..48d75ae1359
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/getLength.js
@@ -0,0 +1,15 @@
+var baseProperty = require('./baseProperty');
+
+/**
+ * Gets the "length" property value of `object`.
+ *
+ * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
+ * that affects Safari on at least iOS 8.1-8.3 ARM64.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {*} Returns the "length" value.
+ */
+var getLength = baseProperty('length');
+
+module.exports = getLength;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/getMatchData.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/getMatchData.js
new file mode 100644
index 00000000000..6d235b91675
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/getMatchData.js
@@ -0,0 +1,21 @@
+var isStrictComparable = require('./isStrictComparable'),
+ pairs = require('../object/pairs');
+
+/**
+ * Gets the propery names, values, and compare flags of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the match data of `object`.
+ */
+function getMatchData(object) {
+ var result = pairs(object),
+ length = result.length;
+
+ while (length--) {
+ result[length][2] = isStrictComparable(result[length][1]);
+ }
+ return result;
+}
+
+module.exports = getMatchData;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/getNative.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/getNative.js
new file mode 100644
index 00000000000..bceb317fd73
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/getNative.js
@@ -0,0 +1,16 @@
+var isNative = require('../lang/isNative');
+
+/**
+ * Gets the native function at `key` of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {string} key The key of the method to get.
+ * @returns {*} Returns the function if it's native, else `undefined`.
+ */
+function getNative(object, key) {
+ var value = object == null ? undefined : object[key];
+ return isNative(value) ? value : undefined;
+}
+
+module.exports = getNative;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/getView.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/getView.js
new file mode 100644
index 00000000000..8cc291b97cd
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/getView.js
@@ -0,0 +1,33 @@
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max,
+ nativeMin = Math.min;
+
+/**
+ * Gets the view, applying any `transforms` to the `start` and `end` positions.
+ *
+ * @private
+ * @param {number} start The start of the view.
+ * @param {number} end The end of the view.
+ * @param {Array} [transforms] The transformations to apply to the view.
+ * @returns {Object} Returns an object containing the `start` and `end`
+ * positions of the view.
+ */
+function getView(start, end, transforms) {
+ var index = -1,
+ length = transforms ? transforms.length : 0;
+
+ while (++index < length) {
+ var data = transforms[index],
+ size = data.size;
+
+ switch (data.type) {
+ case 'drop': start += size; break;
+ case 'dropRight': end -= size; break;
+ case 'take': end = nativeMin(end, start + size); break;
+ case 'takeRight': start = nativeMax(start, end - size); break;
+ }
+ }
+ return { 'start': start, 'end': end };
+}
+
+module.exports = getView;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/indexOfNaN.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/indexOfNaN.js
new file mode 100644
index 00000000000..05b8207d7c7
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/indexOfNaN.js
@@ -0,0 +1,23 @@
+/**
+ * Gets the index at which the first occurrence of `NaN` is found in `array`.
+ *
+ * @private
+ * @param {Array} array The array to search.
+ * @param {number} fromIndex The index to search from.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {number} Returns the index of the matched `NaN`, else `-1`.
+ */
+function indexOfNaN(array, fromIndex, fromRight) {
+ var length = array.length,
+ index = fromIndex + (fromRight ? 0 : -1);
+
+ while ((fromRight ? index-- : ++index < length)) {
+ var other = array[index];
+ if (other !== other) {
+ return index;
+ }
+ }
+ return -1;
+}
+
+module.exports = indexOfNaN;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/initCloneArray.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/initCloneArray.js
new file mode 100644
index 00000000000..c92dfa24074
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/initCloneArray.js
@@ -0,0 +1,26 @@
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Initializes an array clone.
+ *
+ * @private
+ * @param {Array} array The array to clone.
+ * @returns {Array} Returns the initialized clone.
+ */
+function initCloneArray(array) {
+ var length = array.length,
+ result = new array.constructor(length);
+
+ // Add array properties assigned by `RegExp#exec`.
+ if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
+ result.index = array.index;
+ result.input = array.input;
+ }
+ return result;
+}
+
+module.exports = initCloneArray;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/initCloneByTag.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/initCloneByTag.js
new file mode 100644
index 00000000000..8e3afc63f43
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/initCloneByTag.js
@@ -0,0 +1,63 @@
+var bufferClone = require('./bufferClone');
+
+/** `Object#toString` result references. */
+var boolTag = '[object Boolean]',
+ dateTag = '[object Date]',
+ numberTag = '[object Number]',
+ regexpTag = '[object RegExp]',
+ stringTag = '[object String]';
+
+var arrayBufferTag = '[object ArrayBuffer]',
+ float32Tag = '[object Float32Array]',
+ float64Tag = '[object Float64Array]',
+ int8Tag = '[object Int8Array]',
+ int16Tag = '[object Int16Array]',
+ int32Tag = '[object Int32Array]',
+ uint8Tag = '[object Uint8Array]',
+ uint8ClampedTag = '[object Uint8ClampedArray]',
+ uint16Tag = '[object Uint16Array]',
+ uint32Tag = '[object Uint32Array]';
+
+/** Used to match `RegExp` flags from their coerced string values. */
+var reFlags = /\w*$/;
+
+/**
+ * Initializes an object clone based on its `toStringTag`.
+ *
+ * **Note:** This function only supports cloning values with tags of
+ * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
+ *
+ * @private
+ * @param {Object} object The object to clone.
+ * @param {string} tag The `toStringTag` of the object to clone.
+ * @param {boolean} [isDeep] Specify a deep clone.
+ * @returns {Object} Returns the initialized clone.
+ */
+function initCloneByTag(object, tag, isDeep) {
+ var Ctor = object.constructor;
+ switch (tag) {
+ case arrayBufferTag:
+ return bufferClone(object);
+
+ case boolTag:
+ case dateTag:
+ return new Ctor(+object);
+
+ case float32Tag: case float64Tag:
+ case int8Tag: case int16Tag: case int32Tag:
+ case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
+ var buffer = object.buffer;
+ return new Ctor(isDeep ? bufferClone(buffer) : buffer, object.byteOffset, object.length);
+
+ case numberTag:
+ case stringTag:
+ return new Ctor(object);
+
+ case regexpTag:
+ var result = new Ctor(object.source, reFlags.exec(object));
+ result.lastIndex = object.lastIndex;
+ }
+ return result;
+}
+
+module.exports = initCloneByTag;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/initCloneObject.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/initCloneObject.js
new file mode 100644
index 00000000000..48c4a23d1ce
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/initCloneObject.js
@@ -0,0 +1,16 @@
+/**
+ * Initializes an object clone.
+ *
+ * @private
+ * @param {Object} object The object to clone.
+ * @returns {Object} Returns the initialized clone.
+ */
+function initCloneObject(object) {
+ var Ctor = object.constructor;
+ if (!(typeof Ctor == 'function' && Ctor instanceof Ctor)) {
+ Ctor = Object;
+ }
+ return new Ctor;
+}
+
+module.exports = initCloneObject;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/invokePath.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/invokePath.js
new file mode 100644
index 00000000000..935110fd120
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/invokePath.js
@@ -0,0 +1,26 @@
+var baseGet = require('./baseGet'),
+ baseSlice = require('./baseSlice'),
+ isKey = require('./isKey'),
+ last = require('../array/last'),
+ toPath = require('./toPath');
+
+/**
+ * Invokes the method at `path` on `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {Array|string} path The path of the method to invoke.
+ * @param {Array} args The arguments to invoke the method with.
+ * @returns {*} Returns the result of the invoked method.
+ */
+function invokePath(object, path, args) {
+ if (object != null && !isKey(path, object)) {
+ path = toPath(path);
+ object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
+ path = last(path);
+ }
+ var func = object == null ? object : object[path];
+ return func == null ? undefined : func.apply(object, args);
+}
+
+module.exports = invokePath;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/isArrayLike.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/isArrayLike.js
new file mode 100644
index 00000000000..72443cde10e
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/isArrayLike.js
@@ -0,0 +1,15 @@
+var getLength = require('./getLength'),
+ isLength = require('./isLength');
+
+/**
+ * Checks if `value` is array-like.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
+ */
+function isArrayLike(value) {
+ return value != null && isLength(getLength(value));
+}
+
+module.exports = isArrayLike;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/isIndex.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/isIndex.js
new file mode 100644
index 00000000000..142bde7fb63
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/isIndex.js
@@ -0,0 +1,24 @@
+/** Used to detect unsigned integer values. */
+var reIsUint = /^\d+$/;
+
+/**
+ * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer)
+ * of an array-like value.
+ */
+var MAX_SAFE_INTEGER = 9007199254740991;
+
+/**
+ * Checks if `value` is a valid array-like index.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
+ */
+function isIndex(value, length) {
+ value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
+ length = length == null ? MAX_SAFE_INTEGER : length;
+ return value > -1 && value % 1 == 0 && value < length;
+}
+
+module.exports = isIndex;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/isIterateeCall.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/isIterateeCall.js
new file mode 100644
index 00000000000..07490f2e428
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/isIterateeCall.js
@@ -0,0 +1,28 @@
+var isArrayLike = require('./isArrayLike'),
+ isIndex = require('./isIndex'),
+ isObject = require('../lang/isObject');
+
+/**
+ * Checks if the provided arguments are from an iteratee call.
+ *
+ * @private
+ * @param {*} value The potential iteratee value argument.
+ * @param {*} index The potential iteratee index or key argument.
+ * @param {*} object The potential iteratee object argument.
+ * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.
+ */
+function isIterateeCall(value, index, object) {
+ if (!isObject(object)) {
+ return false;
+ }
+ var type = typeof index;
+ if (type == 'number'
+ ? (isArrayLike(object) && isIndex(index, object.length))
+ : (type == 'string' && index in object)) {
+ var other = object[index];
+ return value === value ? (value === other) : (other !== other);
+ }
+ return false;
+}
+
+module.exports = isIterateeCall;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/isKey.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/isKey.js
new file mode 100644
index 00000000000..44ccfd4894d
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/isKey.js
@@ -0,0 +1,28 @@
+var isArray = require('../lang/isArray'),
+ toObject = require('./toObject');
+
+/** Used to match property names within property paths. */
+var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,
+ reIsPlainProp = /^\w*$/;
+
+/**
+ * Checks if `value` is a property name and not a property path.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @param {Object} [object] The object to query keys on.
+ * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
+ */
+function isKey(value, object) {
+ var type = typeof value;
+ if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') {
+ return true;
+ }
+ if (isArray(value)) {
+ return false;
+ }
+ var result = !reIsDeepProp.test(value);
+ return result || (object != null && value in toObject(object));
+}
+
+module.exports = isKey;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/isLaziable.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/isLaziable.js
new file mode 100644
index 00000000000..a0f14702bfa
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/isLaziable.js
@@ -0,0 +1,26 @@
+var LazyWrapper = require('./LazyWrapper'),
+ getData = require('./getData'),
+ getFuncName = require('./getFuncName'),
+ lodash = require('../chain/lodash');
+
+/**
+ * Checks if `func` has a lazy counterpart.
+ *
+ * @private
+ * @param {Function} func The function to check.
+ * @returns {boolean} Returns `true` if `func` has a lazy counterpart, else `false`.
+ */
+function isLaziable(func) {
+ var funcName = getFuncName(func);
+ if (!(funcName in LazyWrapper.prototype)) {
+ return false;
+ }
+ var other = lodash[funcName];
+ if (func === other) {
+ return true;
+ }
+ var data = getData(other);
+ return !!data && func === data[0];
+}
+
+module.exports = isLaziable;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/isLength.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/isLength.js
new file mode 100644
index 00000000000..39c85022fbf
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/isLength.js
@@ -0,0 +1,20 @@
+/**
+ * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer)
+ * of an array-like value.
+ */
+var MAX_SAFE_INTEGER = 9007199254740991;
+
+/**
+ * Checks if `value` is a valid array-like length.
+ *
+ * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength).
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
+ */
+function isLength(value) {
+ return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
+}
+
+module.exports = isLength;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/isObjectLike.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/isObjectLike.js
new file mode 100644
index 00000000000..8ca0585b7b1
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/isObjectLike.js
@@ -0,0 +1,12 @@
+/**
+ * Checks if `value` is object-like.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
+ */
+function isObjectLike(value) {
+ return !!value && typeof value == 'object';
+}
+
+module.exports = isObjectLike;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/isSpace.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/isSpace.js
new file mode 100644
index 00000000000..16ea6f3d430
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/isSpace.js
@@ -0,0 +1,14 @@
+/**
+ * Used by `trimmedLeftIndex` and `trimmedRightIndex` to determine if a
+ * character code is whitespace.
+ *
+ * @private
+ * @param {number} charCode The character code to inspect.
+ * @returns {boolean} Returns `true` if `charCode` is whitespace, else `false`.
+ */
+function isSpace(charCode) {
+ return ((charCode <= 160 && (charCode >= 9 && charCode <= 13) || charCode == 32 || charCode == 160) || charCode == 5760 || charCode == 6158 ||
+ (charCode >= 8192 && (charCode <= 8202 || charCode == 8232 || charCode == 8233 || charCode == 8239 || charCode == 8287 || charCode == 12288 || charCode == 65279)));
+}
+
+module.exports = isSpace;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/isStrictComparable.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/isStrictComparable.js
new file mode 100644
index 00000000000..0a53eba5ee0
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/isStrictComparable.js
@@ -0,0 +1,15 @@
+var isObject = require('../lang/isObject');
+
+/**
+ * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` if suitable for strict
+ * equality comparisons, else `false`.
+ */
+function isStrictComparable(value) {
+ return value === value && !isObject(value);
+}
+
+module.exports = isStrictComparable;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/lazyClone.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/lazyClone.js
new file mode 100644
index 00000000000..20cc8edd256
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/lazyClone.js
@@ -0,0 +1,27 @@
+var LazyWrapper = require('./LazyWrapper'),
+ arrayCopy = require('./arrayCopy');
+
+/**
+ * Creates a clone of the lazy wrapper object.
+ *
+ * @private
+ * @name clone
+ * @memberOf LazyWrapper
+ * @returns {Object} Returns the cloned `LazyWrapper` object.
+ */
+function lazyClone() {
+ var actions = this.__actions__,
+ iteratees = this.__iteratees__,
+ views = this.__views__,
+ result = new LazyWrapper(this.__wrapped__);
+
+ result.__actions__ = actions ? arrayCopy(actions) : null;
+ result.__dir__ = this.__dir__;
+ result.__filtered__ = this.__filtered__;
+ result.__iteratees__ = iteratees ? arrayCopy(iteratees) : null;
+ result.__takeCount__ = this.__takeCount__;
+ result.__views__ = views ? arrayCopy(views) : null;
+ return result;
+}
+
+module.exports = lazyClone;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/lazyReverse.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/lazyReverse.js
new file mode 100644
index 00000000000..c658402f94d
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/lazyReverse.js
@@ -0,0 +1,23 @@
+var LazyWrapper = require('./LazyWrapper');
+
+/**
+ * Reverses the direction of lazy iteration.
+ *
+ * @private
+ * @name reverse
+ * @memberOf LazyWrapper
+ * @returns {Object} Returns the new reversed `LazyWrapper` object.
+ */
+function lazyReverse() {
+ if (this.__filtered__) {
+ var result = new LazyWrapper(this);
+ result.__dir__ = -1;
+ result.__filtered__ = true;
+ } else {
+ result = this.clone();
+ result.__dir__ *= -1;
+ }
+ return result;
+}
+
+module.exports = lazyReverse;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/lazyValue.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/lazyValue.js
new file mode 100644
index 00000000000..f0e34251970
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/lazyValue.js
@@ -0,0 +1,81 @@
+var baseWrapperValue = require('./baseWrapperValue'),
+ getView = require('./getView'),
+ isArray = require('../lang/isArray');
+
+/** Used to indicate the type of lazy iteratees. */
+var LAZY_DROP_WHILE_FLAG = 0,
+ LAZY_FILTER_FLAG = 1,
+ LAZY_MAP_FLAG = 2;
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMin = Math.min;
+
+/**
+ * Extracts the unwrapped value from its lazy wrapper.
+ *
+ * @private
+ * @name value
+ * @memberOf LazyWrapper
+ * @returns {*} Returns the unwrapped value.
+ */
+function lazyValue() {
+ var array = this.__wrapped__.value();
+ if (!isArray(array)) {
+ return baseWrapperValue(array, this.__actions__);
+ }
+ var dir = this.__dir__,
+ isRight = dir < 0,
+ view = getView(0, array.length, this.__views__),
+ start = view.start,
+ end = view.end,
+ length = end - start,
+ index = isRight ? end : (start - 1),
+ takeCount = nativeMin(length, this.__takeCount__),
+ iteratees = this.__iteratees__,
+ iterLength = iteratees ? iteratees.length : 0,
+ resIndex = 0,
+ result = [];
+
+ outer:
+ while (length-- && resIndex < takeCount) {
+ index += dir;
+
+ var iterIndex = -1,
+ value = array[index];
+
+ while (++iterIndex < iterLength) {
+ var data = iteratees[iterIndex],
+ iteratee = data.iteratee,
+ type = data.type;
+
+ if (type == LAZY_DROP_WHILE_FLAG) {
+ if (data.done && (isRight ? (index > data.index) : (index < data.index))) {
+ data.count = 0;
+ data.done = false;
+ }
+ data.index = index;
+ if (!data.done) {
+ var limit = data.limit;
+ if (!(data.done = limit > -1 ? (data.count++ >= limit) : !iteratee(value))) {
+ continue outer;
+ }
+ }
+ } else {
+ var computed = iteratee(value);
+ if (type == LAZY_MAP_FLAG) {
+ value = computed;
+ } else if (!computed) {
+ if (type == LAZY_FILTER_FLAG) {
+ continue outer;
+ } else {
+ break outer;
+ }
+ }
+ }
+ }
+ result[resIndex++] = value;
+ }
+ return result;
+}
+
+module.exports = lazyValue;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/mapDelete.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/mapDelete.js
new file mode 100644
index 00000000000..8b7fd535311
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/mapDelete.js
@@ -0,0 +1,14 @@
+/**
+ * Removes `key` and its value from the cache.
+ *
+ * @private
+ * @name delete
+ * @memberOf _.memoize.Cache
+ * @param {string} key The key of the value to remove.
+ * @returns {boolean} Returns `true` if the entry was removed successfully, else `false`.
+ */
+function mapDelete(key) {
+ return this.has(key) && delete this.__data__[key];
+}
+
+module.exports = mapDelete;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/mapGet.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/mapGet.js
new file mode 100644
index 00000000000..1f222957234
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/mapGet.js
@@ -0,0 +1,14 @@
+/**
+ * Gets the cached value for `key`.
+ *
+ * @private
+ * @name get
+ * @memberOf _.memoize.Cache
+ * @param {string} key The key of the value to get.
+ * @returns {*} Returns the cached value.
+ */
+function mapGet(key) {
+ return key == '__proto__' ? undefined : this.__data__[key];
+}
+
+module.exports = mapGet;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/mapHas.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/mapHas.js
new file mode 100644
index 00000000000..6d94ce441d9
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/mapHas.js
@@ -0,0 +1,20 @@
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Checks if a cached value for `key` exists.
+ *
+ * @private
+ * @name has
+ * @memberOf _.memoize.Cache
+ * @param {string} key The key of the entry to check.
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
+ */
+function mapHas(key) {
+ return key != '__proto__' && hasOwnProperty.call(this.__data__, key);
+}
+
+module.exports = mapHas;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/mapSet.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/mapSet.js
new file mode 100644
index 00000000000..0434c3f307d
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/mapSet.js
@@ -0,0 +1,18 @@
+/**
+ * Sets `value` to `key` of the cache.
+ *
+ * @private
+ * @name set
+ * @memberOf _.memoize.Cache
+ * @param {string} key The key of the value to cache.
+ * @param {*} value The value to cache.
+ * @returns {Object} Returns the cache object.
+ */
+function mapSet(key, value) {
+ if (key != '__proto__') {
+ this.__data__[key] = value;
+ }
+ return this;
+}
+
+module.exports = mapSet;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/mergeData.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/mergeData.js
new file mode 100644
index 00000000000..29297c78aa9
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/mergeData.js
@@ -0,0 +1,89 @@
+var arrayCopy = require('./arrayCopy'),
+ composeArgs = require('./composeArgs'),
+ composeArgsRight = require('./composeArgsRight'),
+ replaceHolders = require('./replaceHolders');
+
+/** Used to compose bitmasks for wrapper metadata. */
+var BIND_FLAG = 1,
+ CURRY_BOUND_FLAG = 4,
+ CURRY_FLAG = 8,
+ ARY_FLAG = 128,
+ REARG_FLAG = 256;
+
+/** Used as the internal argument placeholder. */
+var PLACEHOLDER = '__lodash_placeholder__';
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMin = Math.min;
+
+/**
+ * Merges the function metadata of `source` into `data`.
+ *
+ * Merging metadata reduces the number of wrappers required to invoke a function.
+ * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
+ * may be applied regardless of execution order. Methods like `_.ary` and `_.rearg`
+ * augment function arguments, making the order in which they are executed important,
+ * preventing the merging of metadata. However, we make an exception for a safe
+ * common case where curried functions have `_.ary` and or `_.rearg` applied.
+ *
+ * @private
+ * @param {Array} data The destination metadata.
+ * @param {Array} source The source metadata.
+ * @returns {Array} Returns `data`.
+ */
+function mergeData(data, source) {
+ var bitmask = data[1],
+ srcBitmask = source[1],
+ newBitmask = bitmask | srcBitmask,
+ isCommon = newBitmask < ARY_FLAG;
+
+ var isCombo =
+ (srcBitmask == ARY_FLAG && bitmask == CURRY_FLAG) ||
+ (srcBitmask == ARY_FLAG && bitmask == REARG_FLAG && data[7].length <= source[8]) ||
+ (srcBitmask == (ARY_FLAG | REARG_FLAG) && bitmask == CURRY_FLAG);
+
+ // Exit early if metadata can't be merged.
+ if (!(isCommon || isCombo)) {
+ return data;
+ }
+ // Use source `thisArg` if available.
+ if (srcBitmask & BIND_FLAG) {
+ data[2] = source[2];
+ // Set when currying a bound function.
+ newBitmask |= (bitmask & BIND_FLAG) ? 0 : CURRY_BOUND_FLAG;
+ }
+ // Compose partial arguments.
+ var value = source[3];
+ if (value) {
+ var partials = data[3];
+ data[3] = partials ? composeArgs(partials, value, source[4]) : arrayCopy(value);
+ data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : arrayCopy(source[4]);
+ }
+ // Compose partial right arguments.
+ value = source[5];
+ if (value) {
+ partials = data[5];
+ data[5] = partials ? composeArgsRight(partials, value, source[6]) : arrayCopy(value);
+ data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : arrayCopy(source[6]);
+ }
+ // Use source `argPos` if available.
+ value = source[7];
+ if (value) {
+ data[7] = arrayCopy(value);
+ }
+ // Use source `ary` if it's smaller.
+ if (srcBitmask & ARY_FLAG) {
+ data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
+ }
+ // Use source `arity` if one is not provided.
+ if (data[9] == null) {
+ data[9] = source[9];
+ }
+ // Use source `func` and merge bitmasks.
+ data[0] = source[0];
+ data[1] = newBitmask;
+
+ return data;
+}
+
+module.exports = mergeData;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/metaMap.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/metaMap.js
new file mode 100644
index 00000000000..59bfd5f96e7
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/metaMap.js
@@ -0,0 +1,9 @@
+var getNative = require('./getNative');
+
+/** Native method references. */
+var WeakMap = getNative(global, 'WeakMap');
+
+/** Used to store function metadata. */
+var metaMap = WeakMap && new WeakMap;
+
+module.exports = metaMap;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/pickByArray.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/pickByArray.js
new file mode 100644
index 00000000000..0999d90af46
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/pickByArray.js
@@ -0,0 +1,28 @@
+var toObject = require('./toObject');
+
+/**
+ * A specialized version of `_.pick` which picks `object` properties specified
+ * by `props`.
+ *
+ * @private
+ * @param {Object} object The source object.
+ * @param {string[]} props The property names to pick.
+ * @returns {Object} Returns the new object.
+ */
+function pickByArray(object, props) {
+ object = toObject(object);
+
+ var index = -1,
+ length = props.length,
+ result = {};
+
+ while (++index < length) {
+ var key = props[index];
+ if (key in object) {
+ result[key] = object[key];
+ }
+ }
+ return result;
+}
+
+module.exports = pickByArray;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/pickByCallback.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/pickByCallback.js
new file mode 100644
index 00000000000..79d3cdc8370
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/pickByCallback.js
@@ -0,0 +1,22 @@
+var baseForIn = require('./baseForIn');
+
+/**
+ * A specialized version of `_.pick` which picks `object` properties `predicate`
+ * returns truthy for.
+ *
+ * @private
+ * @param {Object} object The source object.
+ * @param {Function} predicate The function invoked per iteration.
+ * @returns {Object} Returns the new object.
+ */
+function pickByCallback(object, predicate) {
+ var result = {};
+ baseForIn(object, function(value, key, object) {
+ if (predicate(value, key, object)) {
+ result[key] = value;
+ }
+ });
+ return result;
+}
+
+module.exports = pickByCallback;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/reEscape.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/reEscape.js
new file mode 100644
index 00000000000..7f47eda68f4
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/reEscape.js
@@ -0,0 +1,4 @@
+/** Used to match template delimiters. */
+var reEscape = /<%-([\s\S]+?)%>/g;
+
+module.exports = reEscape;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/reEvaluate.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/reEvaluate.js
new file mode 100644
index 00000000000..6adfc312c8f
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/reEvaluate.js
@@ -0,0 +1,4 @@
+/** Used to match template delimiters. */
+var reEvaluate = /<%([\s\S]+?)%>/g;
+
+module.exports = reEvaluate;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/reInterpolate.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/reInterpolate.js
new file mode 100644
index 00000000000..d02ff0b29a3
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/reInterpolate.js
@@ -0,0 +1,4 @@
+/** Used to match template delimiters. */
+var reInterpolate = /<%=([\s\S]+?)%>/g;
+
+module.exports = reInterpolate;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/realNames.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/realNames.js
new file mode 100644
index 00000000000..aa0d5292612
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/realNames.js
@@ -0,0 +1,4 @@
+/** Used to lookup unminified function names. */
+var realNames = {};
+
+module.exports = realNames;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/reorder.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/reorder.js
new file mode 100644
index 00000000000..9424927db73
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/reorder.js
@@ -0,0 +1,29 @@
+var arrayCopy = require('./arrayCopy'),
+ isIndex = require('./isIndex');
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMin = Math.min;
+
+/**
+ * Reorder `array` according to the specified indexes where the element at
+ * the first index is assigned as the first element, the element at
+ * the second index is assigned as the second element, and so on.
+ *
+ * @private
+ * @param {Array} array The array to reorder.
+ * @param {Array} indexes The arranged array indexes.
+ * @returns {Array} Returns `array`.
+ */
+function reorder(array, indexes) {
+ var arrLength = array.length,
+ length = nativeMin(indexes.length, arrLength),
+ oldArray = arrayCopy(array);
+
+ while (length--) {
+ var index = indexes[length];
+ array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
+ }
+ return array;
+}
+
+module.exports = reorder;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/replaceHolders.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/replaceHolders.js
new file mode 100644
index 00000000000..3089e75e94d
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/replaceHolders.js
@@ -0,0 +1,28 @@
+/** Used as the internal argument placeholder. */
+var PLACEHOLDER = '__lodash_placeholder__';
+
+/**
+ * Replaces all `placeholder` elements in `array` with an internal placeholder
+ * and returns an array of their indexes.
+ *
+ * @private
+ * @param {Array} array The array to modify.
+ * @param {*} placeholder The placeholder to replace.
+ * @returns {Array} Returns the new array of placeholder indexes.
+ */
+function replaceHolders(array, placeholder) {
+ var index = -1,
+ length = array.length,
+ resIndex = -1,
+ result = [];
+
+ while (++index < length) {
+ if (array[index] === placeholder) {
+ array[index] = PLACEHOLDER;
+ result[++resIndex] = index;
+ }
+ }
+ return result;
+}
+
+module.exports = replaceHolders;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/setData.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/setData.js
new file mode 100644
index 00000000000..7eb3f40b838
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/setData.js
@@ -0,0 +1,41 @@
+var baseSetData = require('./baseSetData'),
+ now = require('../date/now');
+
+/** Used to detect when a function becomes hot. */
+var HOT_COUNT = 150,
+ HOT_SPAN = 16;
+
+/**
+ * Sets metadata for `func`.
+ *
+ * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
+ * period of time, it will trip its breaker and transition to an identity function
+ * to avoid garbage collection pauses in V8. See [V8 issue 2070](https://code.google.com/p/v8/issues/detail?id=2070)
+ * for more details.
+ *
+ * @private
+ * @param {Function} func The function to associate metadata with.
+ * @param {*} data The metadata.
+ * @returns {Function} Returns `func`.
+ */
+var setData = (function() {
+ var count = 0,
+ lastCalled = 0;
+
+ return function(key, value) {
+ var stamp = now(),
+ remaining = HOT_SPAN - (stamp - lastCalled);
+
+ lastCalled = stamp;
+ if (remaining > 0) {
+ if (++count >= HOT_COUNT) {
+ return key;
+ }
+ } else {
+ count = 0;
+ }
+ return baseSetData(key, value);
+ };
+}());
+
+module.exports = setData;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/shimIsPlainObject.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/shimIsPlainObject.js
new file mode 100644
index 00000000000..9821286d6e5
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/shimIsPlainObject.js
@@ -0,0 +1,50 @@
+var baseForIn = require('./baseForIn'),
+ isObjectLike = require('./isObjectLike');
+
+/** `Object#toString` result references. */
+var objectTag = '[object Object]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * A fallback implementation of `_.isPlainObject` which checks if `value`
+ * is an object created by the `Object` constructor or has a `[[Prototype]]`
+ * of `null`.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
+ */
+function shimIsPlainObject(value) {
+ var Ctor;
+
+ // Exit early for non `Object` objects.
+ if (!(isObjectLike(value) && objToString.call(value) == objectTag) ||
+ (!hasOwnProperty.call(value, 'constructor') &&
+ (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) {
+ return false;
+ }
+ // IE < 9 iterates inherited properties before own properties. If the first
+ // iterated property is an object's own property then there are no inherited
+ // enumerable properties.
+ var result;
+ // In most environments an object's own properties are iterated before
+ // its inherited properties. If the last iterated property is an object's
+ // own property then there are no inherited enumerable properties.
+ baseForIn(value, function(subValue, key) {
+ result = key;
+ });
+ return result === undefined || hasOwnProperty.call(value, result);
+}
+
+module.exports = shimIsPlainObject;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/shimKeys.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/shimKeys.js
new file mode 100644
index 00000000000..189e492b762
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/shimKeys.js
@@ -0,0 +1,41 @@
+var isArguments = require('../lang/isArguments'),
+ isArray = require('../lang/isArray'),
+ isIndex = require('./isIndex'),
+ isLength = require('./isLength'),
+ keysIn = require('../object/keysIn');
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * A fallback implementation of `Object.keys` which creates an array of the
+ * own enumerable property names of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ */
+function shimKeys(object) {
+ var props = keysIn(object),
+ propsLength = props.length,
+ length = propsLength && object.length;
+
+ var allowIndexes = !!length && isLength(length) &&
+ (isArray(object) || isArguments(object));
+
+ var index = -1,
+ result = [];
+
+ while (++index < propsLength) {
+ var key = props[index];
+ if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {
+ result.push(key);
+ }
+ }
+ return result;
+}
+
+module.exports = shimKeys;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/sortedUniq.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/sortedUniq.js
new file mode 100644
index 00000000000..22887eb28cc
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/sortedUniq.js
@@ -0,0 +1,29 @@
+/**
+ * An implementation of `_.uniq` optimized for sorted arrays without support
+ * for callback shorthands and `this` binding.
+ *
+ * @private
+ * @param {Array} array The array to inspect.
+ * @param {Function} [iteratee] The function invoked per iteration.
+ * @returns {Array} Returns the new duplicate-value-free array.
+ */
+function sortedUniq(array, iteratee) {
+ var seen,
+ index = -1,
+ length = array.length,
+ resIndex = -1,
+ result = [];
+
+ while (++index < length) {
+ var value = array[index],
+ computed = iteratee ? iteratee(value, index, array) : value;
+
+ if (!index || seen !== computed) {
+ seen = computed;
+ result[++resIndex] = value;
+ }
+ }
+ return result;
+}
+
+module.exports = sortedUniq;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/toIterable.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/toIterable.js
new file mode 100644
index 00000000000..c0a5b2885f2
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/toIterable.js
@@ -0,0 +1,22 @@
+var isArrayLike = require('./isArrayLike'),
+ isObject = require('../lang/isObject'),
+ values = require('../object/values');
+
+/**
+ * Converts `value` to an array-like object if it's not one.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {Array|Object} Returns the array-like object.
+ */
+function toIterable(value) {
+ if (value == null) {
+ return [];
+ }
+ if (!isArrayLike(value)) {
+ return values(value);
+ }
+ return isObject(value) ? value : Object(value);
+}
+
+module.exports = toIterable;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/toObject.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/toObject.js
new file mode 100644
index 00000000000..da4a008d7b4
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/toObject.js
@@ -0,0 +1,14 @@
+var isObject = require('../lang/isObject');
+
+/**
+ * Converts `value` to an object if it's not one.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {Object} Returns the object.
+ */
+function toObject(value) {
+ return isObject(value) ? value : Object(value);
+}
+
+module.exports = toObject;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/toPath.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/toPath.js
new file mode 100644
index 00000000000..d29f1eb5283
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/toPath.js
@@ -0,0 +1,28 @@
+var baseToString = require('./baseToString'),
+ isArray = require('../lang/isArray');
+
+/** Used to match property names within property paths. */
+var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g;
+
+/** Used to match backslashes in property paths. */
+var reEscapeChar = /\\(\\)?/g;
+
+/**
+ * Converts `value` to property path array if it's not one.
+ *
+ * @private
+ * @param {*} value The value to process.
+ * @returns {Array} Returns the property path array.
+ */
+function toPath(value) {
+ if (isArray(value)) {
+ return value;
+ }
+ var result = [];
+ baseToString(value).replace(rePropName, function(match, number, quote, string) {
+ result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
+ });
+ return result;
+}
+
+module.exports = toPath;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/trimmedLeftIndex.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/trimmedLeftIndex.js
new file mode 100644
index 00000000000..08aeb13607f
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/trimmedLeftIndex.js
@@ -0,0 +1,19 @@
+var isSpace = require('./isSpace');
+
+/**
+ * Used by `_.trim` and `_.trimLeft` to get the index of the first non-whitespace
+ * character of `string`.
+ *
+ * @private
+ * @param {string} string The string to inspect.
+ * @returns {number} Returns the index of the first non-whitespace character.
+ */
+function trimmedLeftIndex(string) {
+ var index = -1,
+ length = string.length;
+
+ while (++index < length && isSpace(string.charCodeAt(index))) {}
+ return index;
+}
+
+module.exports = trimmedLeftIndex;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/trimmedRightIndex.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/trimmedRightIndex.js
new file mode 100644
index 00000000000..71b9e38a62b
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/trimmedRightIndex.js
@@ -0,0 +1,18 @@
+var isSpace = require('./isSpace');
+
+/**
+ * Used by `_.trim` and `_.trimRight` to get the index of the last non-whitespace
+ * character of `string`.
+ *
+ * @private
+ * @param {string} string The string to inspect.
+ * @returns {number} Returns the index of the last non-whitespace character.
+ */
+function trimmedRightIndex(string) {
+ var index = string.length;
+
+ while (index-- && isSpace(string.charCodeAt(index))) {}
+ return index;
+}
+
+module.exports = trimmedRightIndex;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/unescapeHtmlChar.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/unescapeHtmlChar.js
new file mode 100644
index 00000000000..28b345498db
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/unescapeHtmlChar.js
@@ -0,0 +1,22 @@
+/** Used to map HTML entities to characters. */
+var htmlUnescapes = {
+ '&amp;': '&',
+ '&lt;': '<',
+ '&gt;': '>',
+ '&quot;': '"',
+ '&#39;': "'",
+ '&#96;': '`'
+};
+
+/**
+ * Used by `_.unescape` to convert HTML entities to characters.
+ *
+ * @private
+ * @param {string} chr The matched character to unescape.
+ * @returns {string} Returns the unescaped character.
+ */
+function unescapeHtmlChar(chr) {
+ return htmlUnescapes[chr];
+}
+
+module.exports = unescapeHtmlChar;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/wrapperClone.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/wrapperClone.js
new file mode 100644
index 00000000000..e5e10dac65a
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/wrapperClone.js
@@ -0,0 +1,18 @@
+var LazyWrapper = require('./LazyWrapper'),
+ LodashWrapper = require('./LodashWrapper'),
+ arrayCopy = require('./arrayCopy');
+
+/**
+ * Creates a clone of `wrapper`.
+ *
+ * @private
+ * @param {Object} wrapper The wrapper to clone.
+ * @returns {Object} Returns the cloned wrapper.
+ */
+function wrapperClone(wrapper) {
+ return wrapper instanceof LazyWrapper
+ ? wrapper.clone()
+ : new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__, arrayCopy(wrapper.__actions__));
+}
+
+module.exports = wrapperClone;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/lang.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang.js
new file mode 100644
index 00000000000..8f0a364322a
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang.js
@@ -0,0 +1,32 @@
+module.exports = {
+ 'clone': require('./lang/clone'),
+ 'cloneDeep': require('./lang/cloneDeep'),
+ 'eq': require('./lang/eq'),
+ 'gt': require('./lang/gt'),
+ 'gte': require('./lang/gte'),
+ 'isArguments': require('./lang/isArguments'),
+ 'isArray': require('./lang/isArray'),
+ 'isBoolean': require('./lang/isBoolean'),
+ 'isDate': require('./lang/isDate'),
+ 'isElement': require('./lang/isElement'),
+ 'isEmpty': require('./lang/isEmpty'),
+ 'isEqual': require('./lang/isEqual'),
+ 'isError': require('./lang/isError'),
+ 'isFinite': require('./lang/isFinite'),
+ 'isFunction': require('./lang/isFunction'),
+ 'isMatch': require('./lang/isMatch'),
+ 'isNaN': require('./lang/isNaN'),
+ 'isNative': require('./lang/isNative'),
+ 'isNull': require('./lang/isNull'),
+ 'isNumber': require('./lang/isNumber'),
+ 'isObject': require('./lang/isObject'),
+ 'isPlainObject': require('./lang/isPlainObject'),
+ 'isRegExp': require('./lang/isRegExp'),
+ 'isString': require('./lang/isString'),
+ 'isTypedArray': require('./lang/isTypedArray'),
+ 'isUndefined': require('./lang/isUndefined'),
+ 'lt': require('./lang/lt'),
+ 'lte': require('./lang/lte'),
+ 'toArray': require('./lang/toArray'),
+ 'toPlainObject': require('./lang/toPlainObject')
+};
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/clone.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/clone.js
new file mode 100644
index 00000000000..0a972eae5bf
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/clone.js
@@ -0,0 +1,70 @@
+var baseClone = require('../internal/baseClone'),
+ bindCallback = require('../internal/bindCallback'),
+ isIterateeCall = require('../internal/isIterateeCall');
+
+/**
+ * Creates a clone of `value`. If `isDeep` is `true` nested objects are cloned,
+ * otherwise they are assigned by reference. If `customizer` is provided it is
+ * invoked to produce the cloned values. If `customizer` returns `undefined`
+ * cloning is handled by the method instead. The `customizer` is bound to
+ * `thisArg` and invoked with two argument; (value [, index|key, object]).
+ *
+ * **Note:** This method is loosely based on the
+ * [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm).
+ * The enumerable properties of `arguments` objects and objects created by
+ * constructors other than `Object` are cloned to plain `Object` objects. An
+ * empty object is returned for uncloneable values such as functions, DOM nodes,
+ * Maps, Sets, and WeakMaps.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to clone.
+ * @param {boolean} [isDeep] Specify a deep clone.
+ * @param {Function} [customizer] The function to customize cloning values.
+ * @param {*} [thisArg] The `this` binding of `customizer`.
+ * @returns {*} Returns the cloned value.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney' },
+ * { 'user': 'fred' }
+ * ];
+ *
+ * var shallow = _.clone(users);
+ * shallow[0] === users[0];
+ * // => true
+ *
+ * var deep = _.clone(users, true);
+ * deep[0] === users[0];
+ * // => false
+ *
+ * // using a customizer callback
+ * var el = _.clone(document.body, function(value) {
+ * if (_.isElement(value)) {
+ * return value.cloneNode(false);
+ * }
+ * });
+ *
+ * el === document.body
+ * // => false
+ * el.nodeName
+ * // => BODY
+ * el.childNodes.length;
+ * // => 0
+ */
+function clone(value, isDeep, customizer, thisArg) {
+ if (isDeep && typeof isDeep != 'boolean' && isIterateeCall(value, isDeep, customizer)) {
+ isDeep = false;
+ }
+ else if (typeof isDeep == 'function') {
+ thisArg = customizer;
+ customizer = isDeep;
+ isDeep = false;
+ }
+ return typeof customizer == 'function'
+ ? baseClone(value, isDeep, bindCallback(customizer, thisArg, 1))
+ : baseClone(value, isDeep);
+}
+
+module.exports = clone;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/cloneDeep.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/cloneDeep.js
new file mode 100644
index 00000000000..a458141e8d7
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/cloneDeep.js
@@ -0,0 +1,55 @@
+var baseClone = require('../internal/baseClone'),
+ bindCallback = require('../internal/bindCallback');
+
+/**
+ * Creates a deep clone of `value`. If `customizer` is provided it is invoked
+ * to produce the cloned values. If `customizer` returns `undefined` cloning
+ * is handled by the method instead. The `customizer` is bound to `thisArg`
+ * and invoked with two argument; (value [, index|key, object]).
+ *
+ * **Note:** This method is loosely based on the
+ * [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm).
+ * The enumerable properties of `arguments` objects and objects created by
+ * constructors other than `Object` are cloned to plain `Object` objects. An
+ * empty object is returned for uncloneable values such as functions, DOM nodes,
+ * Maps, Sets, and WeakMaps.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to deep clone.
+ * @param {Function} [customizer] The function to customize cloning values.
+ * @param {*} [thisArg] The `this` binding of `customizer`.
+ * @returns {*} Returns the deep cloned value.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney' },
+ * { 'user': 'fred' }
+ * ];
+ *
+ * var deep = _.cloneDeep(users);
+ * deep[0] === users[0];
+ * // => false
+ *
+ * // using a customizer callback
+ * var el = _.cloneDeep(document.body, function(value) {
+ * if (_.isElement(value)) {
+ * return value.cloneNode(true);
+ * }
+ * });
+ *
+ * el === document.body
+ * // => false
+ * el.nodeName
+ * // => BODY
+ * el.childNodes.length;
+ * // => 20
+ */
+function cloneDeep(value, customizer, thisArg) {
+ return typeof customizer == 'function'
+ ? baseClone(value, true, bindCallback(customizer, thisArg, 1))
+ : baseClone(value, true);
+}
+
+module.exports = cloneDeep;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/eq.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/eq.js
new file mode 100644
index 00000000000..e6a5ce0caf7
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/eq.js
@@ -0,0 +1 @@
+module.exports = require('./isEqual');
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/gt.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/gt.js
new file mode 100644
index 00000000000..ddaf5ea0671
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/gt.js
@@ -0,0 +1,25 @@
+/**
+ * Checks if `value` is greater than `other`.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @returns {boolean} Returns `true` if `value` is greater than `other`, else `false`.
+ * @example
+ *
+ * _.gt(3, 1);
+ * // => true
+ *
+ * _.gt(3, 3);
+ * // => false
+ *
+ * _.gt(1, 3);
+ * // => false
+ */
+function gt(value, other) {
+ return value > other;
+}
+
+module.exports = gt;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/gte.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/gte.js
new file mode 100644
index 00000000000..4a5ffb5cdce
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/gte.js
@@ -0,0 +1,25 @@
+/**
+ * Checks if `value` is greater than or equal to `other`.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @returns {boolean} Returns `true` if `value` is greater than or equal to `other`, else `false`.
+ * @example
+ *
+ * _.gte(3, 1);
+ * // => true
+ *
+ * _.gte(3, 3);
+ * // => true
+ *
+ * _.gte(1, 3);
+ * // => false
+ */
+function gte(value, other) {
+ return value >= other;
+}
+
+module.exports = gte;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isArguments.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isArguments.js
new file mode 100644
index 00000000000..db90713193b
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isArguments.js
@@ -0,0 +1,36 @@
+var isArrayLike = require('../internal/isArrayLike'),
+ isObjectLike = require('../internal/isObjectLike');
+
+/** `Object#toString` result references. */
+var argsTag = '[object Arguments]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * Checks if `value` is classified as an `arguments` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isArguments(function() { return arguments; }());
+ * // => true
+ *
+ * _.isArguments([1, 2, 3]);
+ * // => false
+ */
+function isArguments(value) {
+ return isObjectLike(value) && isArrayLike(value) && objToString.call(value) == argsTag;
+}
+
+module.exports = isArguments;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isArray.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isArray.js
new file mode 100644
index 00000000000..6826854c764
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isArray.js
@@ -0,0 +1,40 @@
+var getNative = require('../internal/getNative'),
+ isLength = require('../internal/isLength'),
+ isObjectLike = require('../internal/isObjectLike');
+
+/** `Object#toString` result references. */
+var arrayTag = '[object Array]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeIsArray = getNative(Array, 'isArray');
+
+/**
+ * Checks if `value` is classified as an `Array` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isArray([1, 2, 3]);
+ * // => true
+ *
+ * _.isArray(function() { return arguments; }());
+ * // => false
+ */
+var isArray = nativeIsArray || function(value) {
+ return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;
+};
+
+module.exports = isArray;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isBoolean.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isBoolean.js
new file mode 100644
index 00000000000..8999da34c0f
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isBoolean.js
@@ -0,0 +1,35 @@
+var isObjectLike = require('../internal/isObjectLike');
+
+/** `Object#toString` result references. */
+var boolTag = '[object Boolean]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * Checks if `value` is classified as a boolean primitive or object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isBoolean(false);
+ * // => true
+ *
+ * _.isBoolean(null);
+ * // => false
+ */
+function isBoolean(value) {
+ return value === true || value === false || (isObjectLike(value) && objToString.call(value) == boolTag);
+}
+
+module.exports = isBoolean;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isDate.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isDate.js
new file mode 100644
index 00000000000..5d80e3dc4b2
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isDate.js
@@ -0,0 +1,35 @@
+var isObjectLike = require('../internal/isObjectLike');
+
+/** `Object#toString` result references. */
+var dateTag = '[object Date]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * Checks if `value` is classified as a `Date` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isDate(new Date);
+ * // => true
+ *
+ * _.isDate('Mon April 23 2012');
+ * // => false
+ */
+function isDate(value) {
+ return isObjectLike(value) && objToString.call(value) == dateTag;
+}
+
+module.exports = isDate;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isElement.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isElement.js
new file mode 100644
index 00000000000..4a1e312250f
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isElement.js
@@ -0,0 +1,41 @@
+var isObjectLike = require('../internal/isObjectLike'),
+ isPlainObject = require('./isPlainObject'),
+ support = require('../support');
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * Checks if `value` is a DOM element.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
+ * @example
+ *
+ * _.isElement(document.body);
+ * // => true
+ *
+ * _.isElement('<body>');
+ * // => false
+ */
+function isElement(value) {
+ return !!value && value.nodeType === 1 && isObjectLike(value) &&
+ (objToString.call(value).indexOf('Element') > -1);
+}
+// Fallback for environments without DOM support.
+if (!support.dom) {
+ isElement = function(value) {
+ return !!value && value.nodeType === 1 && isObjectLike(value) && !isPlainObject(value);
+ };
+}
+
+module.exports = isElement;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isEmpty.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isEmpty.js
new file mode 100644
index 00000000000..2144afd949e
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isEmpty.js
@@ -0,0 +1,47 @@
+var isArguments = require('./isArguments'),
+ isArray = require('./isArray'),
+ isArrayLike = require('../internal/isArrayLike'),
+ isFunction = require('./isFunction'),
+ isObjectLike = require('../internal/isObjectLike'),
+ isString = require('./isString'),
+ keys = require('../object/keys');
+
+/**
+ * Checks if `value` is empty. A value is considered empty unless it is an
+ * `arguments` object, array, string, or jQuery-like collection with a length
+ * greater than `0` or an object with own enumerable properties.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {Array|Object|string} value The value to inspect.
+ * @returns {boolean} Returns `true` if `value` is empty, else `false`.
+ * @example
+ *
+ * _.isEmpty(null);
+ * // => true
+ *
+ * _.isEmpty(true);
+ * // => true
+ *
+ * _.isEmpty(1);
+ * // => true
+ *
+ * _.isEmpty([1, 2, 3]);
+ * // => false
+ *
+ * _.isEmpty({ 'a': 1 });
+ * // => false
+ */
+function isEmpty(value) {
+ if (value == null) {
+ return true;
+ }
+ if (isArrayLike(value) && (isArray(value) || isString(value) || isArguments(value) ||
+ (isObjectLike(value) && isFunction(value.splice)))) {
+ return !value.length;
+ }
+ return !keys(value).length;
+}
+
+module.exports = isEmpty;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isEqual.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isEqual.js
new file mode 100644
index 00000000000..f2cb5d863a7
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isEqual.js
@@ -0,0 +1,54 @@
+var baseIsEqual = require('../internal/baseIsEqual'),
+ bindCallback = require('../internal/bindCallback');
+
+/**
+ * Performs a deep comparison between two values to determine if they are
+ * equivalent. If `customizer` is provided it is invoked to compare values.
+ * If `customizer` returns `undefined` comparisons are handled by the method
+ * instead. The `customizer` is bound to `thisArg` and invoked with three
+ * arguments: (value, other [, index|key]).
+ *
+ * **Note:** This method supports comparing arrays, booleans, `Date` objects,
+ * numbers, `Object` objects, regexes, and strings. Objects are compared by
+ * their own, not inherited, enumerable properties. Functions and DOM nodes
+ * are **not** supported. Provide a customizer function to extend support
+ * for comparing other values.
+ *
+ * @static
+ * @memberOf _
+ * @alias eq
+ * @category Lang
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @param {Function} [customizer] The function to customize value comparisons.
+ * @param {*} [thisArg] The `this` binding of `customizer`.
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
+ * @example
+ *
+ * var object = { 'user': 'fred' };
+ * var other = { 'user': 'fred' };
+ *
+ * object == other;
+ * // => false
+ *
+ * _.isEqual(object, other);
+ * // => true
+ *
+ * // using a customizer callback
+ * var array = ['hello', 'goodbye'];
+ * var other = ['hi', 'goodbye'];
+ *
+ * _.isEqual(array, other, function(value, other) {
+ * if (_.every([value, other], RegExp.prototype.test, /^h(?:i|ello)$/)) {
+ * return true;
+ * }
+ * });
+ * // => true
+ */
+function isEqual(value, other, customizer, thisArg) {
+ customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined;
+ var result = customizer ? customizer(value, other) : undefined;
+ return result === undefined ? baseIsEqual(value, other, customizer) : !!result;
+}
+
+module.exports = isEqual;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isError.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isError.js
new file mode 100644
index 00000000000..4ec836db43d
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isError.js
@@ -0,0 +1,36 @@
+var isObjectLike = require('../internal/isObjectLike');
+
+/** `Object#toString` result references. */
+var errorTag = '[object Error]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
+ * `SyntaxError`, `TypeError`, or `URIError` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
+ * @example
+ *
+ * _.isError(new Error);
+ * // => true
+ *
+ * _.isError(Error);
+ * // => false
+ */
+function isError(value) {
+ return isObjectLike(value) && typeof value.message == 'string' && objToString.call(value) == errorTag;
+}
+
+module.exports = isError;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isFinite.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isFinite.js
new file mode 100644
index 00000000000..3a1c9059a6e
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isFinite.js
@@ -0,0 +1,38 @@
+var getNative = require('../internal/getNative');
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeIsFinite = global.isFinite,
+ nativeNumIsFinite = getNative(Number, 'isFinite');
+
+/**
+ * Checks if `value` is a finite primitive number.
+ *
+ * **Note:** This method is based on [`Number.isFinite`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isfinite).
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
+ * @example
+ *
+ * _.isFinite(10);
+ * // => true
+ *
+ * _.isFinite('10');
+ * // => false
+ *
+ * _.isFinite(true);
+ * // => false
+ *
+ * _.isFinite(Object(10));
+ * // => false
+ *
+ * _.isFinite(Infinity);
+ * // => false
+ */
+var isFinite = nativeNumIsFinite || function(value) {
+ return typeof value == 'number' && nativeIsFinite(value);
+};
+
+module.exports = isFinite;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isFunction.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isFunction.js
new file mode 100644
index 00000000000..114a4dff568
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isFunction.js
@@ -0,0 +1,42 @@
+var baseIsFunction = require('../internal/baseIsFunction'),
+ getNative = require('../internal/getNative');
+
+/** `Object#toString` result references. */
+var funcTag = '[object Function]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/** Native method references. */
+var Uint8Array = getNative(global, 'Uint8Array');
+
+/**
+ * Checks if `value` is classified as a `Function` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isFunction(_);
+ * // => true
+ *
+ * _.isFunction(/abc/);
+ * // => false
+ */
+var isFunction = !(baseIsFunction(/x/) || (Uint8Array && !baseIsFunction(Uint8Array))) ? baseIsFunction : function(value) {
+ // The use of `Object#toString` avoids issues with the `typeof` operator
+ // in older versions of Chrome and Safari which return 'function' for regexes
+ // and Safari 8 equivalents which return 'object' for typed array constructors.
+ return objToString.call(value) == funcTag;
+};
+
+module.exports = isFunction;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isMatch.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isMatch.js
new file mode 100644
index 00000000000..cb48436a438
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isMatch.js
@@ -0,0 +1,49 @@
+var baseIsMatch = require('../internal/baseIsMatch'),
+ bindCallback = require('../internal/bindCallback'),
+ getMatchData = require('../internal/getMatchData');
+
+/**
+ * Performs a deep comparison between `object` and `source` to determine if
+ * `object` contains equivalent property values. If `customizer` is provided
+ * it is invoked to compare values. If `customizer` returns `undefined`
+ * comparisons are handled by the method instead. The `customizer` is bound
+ * to `thisArg` and invoked with three arguments: (value, other, index|key).
+ *
+ * **Note:** This method supports comparing properties of arrays, booleans,
+ * `Date` objects, numbers, `Object` objects, regexes, and strings. Functions
+ * and DOM nodes are **not** supported. Provide a customizer function to extend
+ * support for comparing other values.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {Object} object The object to inspect.
+ * @param {Object} source The object of property values to match.
+ * @param {Function} [customizer] The function to customize value comparisons.
+ * @param {*} [thisArg] The `this` binding of `customizer`.
+ * @returns {boolean} Returns `true` if `object` is a match, else `false`.
+ * @example
+ *
+ * var object = { 'user': 'fred', 'age': 40 };
+ *
+ * _.isMatch(object, { 'age': 40 });
+ * // => true
+ *
+ * _.isMatch(object, { 'age': 36 });
+ * // => false
+ *
+ * // using a customizer callback
+ * var object = { 'greeting': 'hello' };
+ * var source = { 'greeting': 'hi' };
+ *
+ * _.isMatch(object, source, function(value, other) {
+ * return _.every([value, other], RegExp.prototype.test, /^h(?:i|ello)$/) || undefined;
+ * });
+ * // => true
+ */
+function isMatch(object, source, customizer, thisArg) {
+ customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined;
+ return baseIsMatch(object, getMatchData(source), customizer);
+}
+
+module.exports = isMatch;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isNaN.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isNaN.js
new file mode 100644
index 00000000000..cf83d566374
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isNaN.js
@@ -0,0 +1,34 @@
+var isNumber = require('./isNumber');
+
+/**
+ * Checks if `value` is `NaN`.
+ *
+ * **Note:** This method is not the same as [`isNaN`](https://es5.github.io/#x15.1.2.4)
+ * which returns `true` for `undefined` and other non-numeric values.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
+ * @example
+ *
+ * _.isNaN(NaN);
+ * // => true
+ *
+ * _.isNaN(new Number(NaN));
+ * // => true
+ *
+ * isNaN(undefined);
+ * // => true
+ *
+ * _.isNaN(undefined);
+ * // => false
+ */
+function isNaN(value) {
+ // An `NaN` primitive is the only value that is not equal to itself.
+ // Perform the `toStringTag` check first to avoid errors with some host objects in IE.
+ return isNumber(value) && value != +value;
+}
+
+module.exports = isNaN;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isNative.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isNative.js
new file mode 100644
index 00000000000..cc2de0d310b
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isNative.js
@@ -0,0 +1,57 @@
+var escapeRegExp = require('../string/escapeRegExp'),
+ isObjectLike = require('../internal/isObjectLike');
+
+/** `Object#toString` result references. */
+var funcTag = '[object Function]';
+
+/** Used to detect host constructors (Safari > 5). */
+var reIsHostCtor = /^\[object .+?Constructor\]$/;
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to resolve the decompiled source of functions. */
+var fnToString = Function.prototype.toString;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/** Used to detect if a method is native. */
+var reIsNative = RegExp('^' +
+ escapeRegExp(fnToString.call(hasOwnProperty))
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
+);
+
+/**
+ * Checks if `value` is a native function.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a native function, else `false`.
+ * @example
+ *
+ * _.isNative(Array.prototype.push);
+ * // => true
+ *
+ * _.isNative(_);
+ * // => false
+ */
+function isNative(value) {
+ if (value == null) {
+ return false;
+ }
+ if (objToString.call(value) == funcTag) {
+ return reIsNative.test(fnToString.call(value));
+ }
+ return isObjectLike(value) && reIsHostCtor.test(value);
+}
+
+module.exports = isNative;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isNull.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isNull.js
new file mode 100644
index 00000000000..ec66c4d8d8f
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isNull.js
@@ -0,0 +1,21 @@
+/**
+ * Checks if `value` is `null`.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
+ * @example
+ *
+ * _.isNull(null);
+ * // => true
+ *
+ * _.isNull(void 0);
+ * // => false
+ */
+function isNull(value) {
+ return value === null;
+}
+
+module.exports = isNull;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isNumber.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isNumber.js
new file mode 100644
index 00000000000..9404dc851fa
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isNumber.js
@@ -0,0 +1,41 @@
+var isObjectLike = require('../internal/isObjectLike');
+
+/** `Object#toString` result references. */
+var numberTag = '[object Number]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * Checks if `value` is classified as a `Number` primitive or object.
+ *
+ * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified
+ * as numbers, use the `_.isFinite` method.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isNumber(8.4);
+ * // => true
+ *
+ * _.isNumber(NaN);
+ * // => true
+ *
+ * _.isNumber('8.4');
+ * // => false
+ */
+function isNumber(value) {
+ return typeof value == 'number' || (isObjectLike(value) && objToString.call(value) == numberTag);
+}
+
+module.exports = isNumber;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isObject.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isObject.js
new file mode 100644
index 00000000000..6db59987203
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isObject.js
@@ -0,0 +1,28 @@
+/**
+ * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
+ * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
+ * @example
+ *
+ * _.isObject({});
+ * // => true
+ *
+ * _.isObject([1, 2, 3]);
+ * // => true
+ *
+ * _.isObject(1);
+ * // => false
+ */
+function isObject(value) {
+ // Avoid a V8 JIT bug in Chrome 19-20.
+ // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
+ var type = typeof value;
+ return !!value && (type == 'object' || type == 'function');
+}
+
+module.exports = isObject;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isPlainObject.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isPlainObject.js
new file mode 100644
index 00000000000..67e0a8abdce
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isPlainObject.js
@@ -0,0 +1,61 @@
+var getNative = require('../internal/getNative'),
+ shimIsPlainObject = require('../internal/shimIsPlainObject');
+
+/** `Object#toString` result references. */
+var objectTag = '[object Object]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/** Native method references. */
+var getPrototypeOf = getNative(Object, 'getPrototypeOf');
+
+/**
+ * Checks if `value` is a plain object, that is, an object created by the
+ * `Object` constructor or one with a `[[Prototype]]` of `null`.
+ *
+ * **Note:** This method assumes objects created by the `Object` constructor
+ * have no inherited enumerable properties.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * }
+ *
+ * _.isPlainObject(new Foo);
+ * // => false
+ *
+ * _.isPlainObject([1, 2, 3]);
+ * // => false
+ *
+ * _.isPlainObject({ 'x': 0, 'y': 0 });
+ * // => true
+ *
+ * _.isPlainObject(Object.create(null));
+ * // => true
+ */
+var isPlainObject = !getPrototypeOf ? shimIsPlainObject : function(value) {
+ if (!(value && objToString.call(value) == objectTag)) {
+ return false;
+ }
+ var valueOf = getNative(value, 'valueOf'),
+ objProto = valueOf && (objProto = getPrototypeOf(valueOf)) && getPrototypeOf(objProto);
+
+ return objProto
+ ? (value == objProto || getPrototypeOf(value) == objProto)
+ : shimIsPlainObject(value);
+};
+
+module.exports = isPlainObject;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isRegExp.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isRegExp.js
new file mode 100644
index 00000000000..54ddf11a92e
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isRegExp.js
@@ -0,0 +1,35 @@
+var isObjectLike = require('../internal/isObjectLike');
+
+/** `Object#toString` result references. */
+var regexpTag = '[object RegExp]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * Checks if `value` is classified as a `RegExp` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isRegExp(/abc/);
+ * // => true
+ *
+ * _.isRegExp('/abc/');
+ * // => false
+ */
+function isRegExp(value) {
+ return isObjectLike(value) && objToString.call(value) == regexpTag;
+}
+
+module.exports = isRegExp;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isString.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isString.js
new file mode 100644
index 00000000000..f4155dcb071
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isString.js
@@ -0,0 +1,35 @@
+var isObjectLike = require('../internal/isObjectLike');
+
+/** `Object#toString` result references. */
+var stringTag = '[object String]';
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * Checks if `value` is classified as a `String` primitive or object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isString('abc');
+ * // => true
+ *
+ * _.isString(1);
+ * // => false
+ */
+function isString(value) {
+ return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag);
+}
+
+module.exports = isString;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isTypedArray.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isTypedArray.js
new file mode 100644
index 00000000000..4642c7a40ba
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isTypedArray.js
@@ -0,0 +1,74 @@
+var isLength = require('../internal/isLength'),
+ isObjectLike = require('../internal/isObjectLike');
+
+/** `Object#toString` result references. */
+var argsTag = '[object Arguments]',
+ arrayTag = '[object Array]',
+ boolTag = '[object Boolean]',
+ dateTag = '[object Date]',
+ errorTag = '[object Error]',
+ funcTag = '[object Function]',
+ mapTag = '[object Map]',
+ numberTag = '[object Number]',
+ objectTag = '[object Object]',
+ regexpTag = '[object RegExp]',
+ setTag = '[object Set]',
+ stringTag = '[object String]',
+ weakMapTag = '[object WeakMap]';
+
+var arrayBufferTag = '[object ArrayBuffer]',
+ float32Tag = '[object Float32Array]',
+ float64Tag = '[object Float64Array]',
+ int8Tag = '[object Int8Array]',
+ int16Tag = '[object Int16Array]',
+ int32Tag = '[object Int32Array]',
+ uint8Tag = '[object Uint8Array]',
+ uint8ClampedTag = '[object Uint8ClampedArray]',
+ uint16Tag = '[object Uint16Array]',
+ uint32Tag = '[object Uint32Array]';
+
+/** Used to identify `toStringTag` values of typed arrays. */
+var typedArrayTags = {};
+typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
+typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
+typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
+typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
+typedArrayTags[uint32Tag] = true;
+typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
+typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
+typedArrayTags[dateTag] = typedArrayTags[errorTag] =
+typedArrayTags[funcTag] = typedArrayTags[mapTag] =
+typedArrayTags[numberTag] = typedArrayTags[objectTag] =
+typedArrayTags[regexpTag] = typedArrayTags[setTag] =
+typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
+ * of values.
+ */
+var objToString = objectProto.toString;
+
+/**
+ * Checks if `value` is classified as a typed array.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isTypedArray(new Uint8Array);
+ * // => true
+ *
+ * _.isTypedArray([]);
+ * // => false
+ */
+function isTypedArray(value) {
+ return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)];
+}
+
+module.exports = isTypedArray;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isUndefined.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isUndefined.js
new file mode 100644
index 00000000000..d64e560c66a
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/isUndefined.js
@@ -0,0 +1,21 @@
+/**
+ * Checks if `value` is `undefined`.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
+ * @example
+ *
+ * _.isUndefined(void 0);
+ * // => true
+ *
+ * _.isUndefined(null);
+ * // => false
+ */
+function isUndefined(value) {
+ return value === undefined;
+}
+
+module.exports = isUndefined;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/lt.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/lt.js
new file mode 100644
index 00000000000..4439870a318
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/lt.js
@@ -0,0 +1,25 @@
+/**
+ * Checks if `value` is less than `other`.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @returns {boolean} Returns `true` if `value` is less than `other`, else `false`.
+ * @example
+ *
+ * _.lt(1, 3);
+ * // => true
+ *
+ * _.lt(3, 3);
+ * // => false
+ *
+ * _.lt(3, 1);
+ * // => false
+ */
+function lt(value, other) {
+ return value < other;
+}
+
+module.exports = lt;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/lte.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/lte.js
new file mode 100644
index 00000000000..e2b8ab15a06
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/lte.js
@@ -0,0 +1,25 @@
+/**
+ * Checks if `value` is less than or equal to `other`.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @returns {boolean} Returns `true` if `value` is less than or equal to `other`, else `false`.
+ * @example
+ *
+ * _.lte(1, 3);
+ * // => true
+ *
+ * _.lte(3, 3);
+ * // => true
+ *
+ * _.lte(3, 1);
+ * // => false
+ */
+function lte(value, other) {
+ return value <= other;
+}
+
+module.exports = lte;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/toArray.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/toArray.js
new file mode 100644
index 00000000000..72b0b46e180
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/toArray.js
@@ -0,0 +1,32 @@
+var arrayCopy = require('../internal/arrayCopy'),
+ getLength = require('../internal/getLength'),
+ isLength = require('../internal/isLength'),
+ values = require('../object/values');
+
+/**
+ * Converts `value` to an array.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to convert.
+ * @returns {Array} Returns the converted array.
+ * @example
+ *
+ * (function() {
+ * return _.toArray(arguments).slice(1);
+ * }(1, 2, 3));
+ * // => [2, 3]
+ */
+function toArray(value) {
+ var length = value ? getLength(value) : 0;
+ if (!isLength(length)) {
+ return values(value);
+ }
+ if (!length) {
+ return [];
+ }
+ return arrayCopy(value);
+}
+
+module.exports = toArray;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/toPlainObject.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/toPlainObject.js
new file mode 100644
index 00000000000..6315176ecb6
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/toPlainObject.js
@@ -0,0 +1,31 @@
+var baseCopy = require('../internal/baseCopy'),
+ keysIn = require('../object/keysIn');
+
+/**
+ * Converts `value` to a plain object flattening inherited enumerable
+ * properties of `value` to own properties of the plain object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to convert.
+ * @returns {Object} Returns the converted plain object.
+ * @example
+ *
+ * function Foo() {
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.assign({ 'a': 1 }, new Foo);
+ * // => { 'a': 1, 'b': 2 }
+ *
+ * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
+ * // => { 'a': 1, 'b': 2, 'c': 3 }
+ */
+function toPlainObject(value) {
+ return baseCopy(value, keysIn(value));
+}
+
+module.exports = toPlainObject;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/math.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/math.js
new file mode 100644
index 00000000000..3e551b23aa8
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/math.js
@@ -0,0 +1,6 @@
+module.exports = {
+ 'add': require('./math/add'),
+ 'max': require('./math/max'),
+ 'min': require('./math/min'),
+ 'sum': require('./math/sum')
+};
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/math/add.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/math/add.js
new file mode 100644
index 00000000000..59ced2fb6e7
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/math/add.js
@@ -0,0 +1,19 @@
+/**
+ * Adds two numbers.
+ *
+ * @static
+ * @memberOf _
+ * @category Math
+ * @param {number} augend The first number to add.
+ * @param {number} addend The second number to add.
+ * @returns {number} Returns the sum.
+ * @example
+ *
+ * _.add(6, 4);
+ * // => 10
+ */
+function add(augend, addend) {
+ return (+augend || 0) + (+addend || 0);
+}
+
+module.exports = add;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/math/max.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/math/max.js
new file mode 100644
index 00000000000..194c800692f
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/math/max.js
@@ -0,0 +1,56 @@
+var createExtremum = require('../internal/createExtremum'),
+ gt = require('../lang/gt');
+
+/** Used as references for `-Infinity` and `Infinity`. */
+var NEGATIVE_INFINITY = Number.NEGATIVE_INFINITY;
+
+/**
+ * Gets the maximum value of `collection`. If `collection` is empty or falsey
+ * `-Infinity` is returned. If an iteratee function is provided it is invoked
+ * for each value in `collection` to generate the criterion by which the value
+ * is ranked. The `iteratee` is bound to `thisArg` and invoked with three
+ * arguments: (value, index, collection).
+ *
+ * If a property name is provided for `iteratee` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `iteratee` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Math
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [iteratee] The function invoked per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {*} Returns the maximum value.
+ * @example
+ *
+ * _.max([4, 2, 8, 6]);
+ * // => 8
+ *
+ * _.max([]);
+ * // => -Infinity
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36 },
+ * { 'user': 'fred', 'age': 40 }
+ * ];
+ *
+ * _.max(users, function(chr) {
+ * return chr.age;
+ * });
+ * // => { 'user': 'fred', 'age': 40 }
+ *
+ * // using the `_.property` callback shorthand
+ * _.max(users, 'age');
+ * // => { 'user': 'fred', 'age': 40 }
+ */
+var max = createExtremum(gt, NEGATIVE_INFINITY);
+
+module.exports = max;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/math/min.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/math/min.js
new file mode 100644
index 00000000000..8a98a85aae1
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/math/min.js
@@ -0,0 +1,56 @@
+var createExtremum = require('../internal/createExtremum'),
+ lt = require('../lang/lt');
+
+/** Used as references for `-Infinity` and `Infinity`. */
+var POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
+
+/**
+ * Gets the minimum value of `collection`. If `collection` is empty or falsey
+ * `Infinity` is returned. If an iteratee function is provided it is invoked
+ * for each value in `collection` to generate the criterion by which the value
+ * is ranked. The `iteratee` is bound to `thisArg` and invoked with three
+ * arguments: (value, index, collection).
+ *
+ * If a property name is provided for `iteratee` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `iteratee` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Math
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [iteratee] The function invoked per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {*} Returns the minimum value.
+ * @example
+ *
+ * _.min([4, 2, 8, 6]);
+ * // => 2
+ *
+ * _.min([]);
+ * // => Infinity
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36 },
+ * { 'user': 'fred', 'age': 40 }
+ * ];
+ *
+ * _.min(users, function(chr) {
+ * return chr.age;
+ * });
+ * // => { 'user': 'barney', 'age': 36 }
+ *
+ * // using the `_.property` callback shorthand
+ * _.min(users, 'age');
+ * // => { 'user': 'barney', 'age': 36 }
+ */
+var min = createExtremum(lt, POSITIVE_INFINITY);
+
+module.exports = min;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/math/sum.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/math/sum.js
new file mode 100644
index 00000000000..0e187805409
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/math/sum.js
@@ -0,0 +1,52 @@
+var arraySum = require('../internal/arraySum'),
+ baseCallback = require('../internal/baseCallback'),
+ baseSum = require('../internal/baseSum'),
+ isArray = require('../lang/isArray'),
+ isIterateeCall = require('../internal/isIterateeCall'),
+ toIterable = require('../internal/toIterable');
+
+/**
+ * Gets the sum of the values in `collection`.
+ *
+ * @static
+ * @memberOf _
+ * @category Math
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function|Object|string} [iteratee] The function invoked per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {number} Returns the sum.
+ * @example
+ *
+ * _.sum([4, 6]);
+ * // => 10
+ *
+ * _.sum({ 'a': 4, 'b': 6 });
+ * // => 10
+ *
+ * var objects = [
+ * { 'n': 4 },
+ * { 'n': 6 }
+ * ];
+ *
+ * _.sum(objects, function(object) {
+ * return object.n;
+ * });
+ * // => 10
+ *
+ * // using the `_.property` callback shorthand
+ * _.sum(objects, 'n');
+ * // => 10
+ */
+function sum(collection, iteratee, thisArg) {
+ if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
+ iteratee = null;
+ }
+ var noIteratee = iteratee == null;
+
+ iteratee = noIteratee ? iteratee : baseCallback(iteratee, thisArg, 3);
+ return noIteratee
+ ? arraySum(isArray(collection) ? collection : toIterable(collection))
+ : baseSum(collection, iteratee);
+}
+
+module.exports = sum;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/number.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/number.js
new file mode 100644
index 00000000000..afab9d99569
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/number.js
@@ -0,0 +1,4 @@
+module.exports = {
+ 'inRange': require('./number/inRange'),
+ 'random': require('./number/random')
+};
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/number/inRange.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/number/inRange.js
new file mode 100644
index 00000000000..4e5cc88b07c
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/number/inRange.js
@@ -0,0 +1,47 @@
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max,
+ nativeMin = Math.min;
+
+/**
+ * Checks if `n` is between `start` and up to but not including, `end`. If
+ * `end` is not specified it is set to `start` with `start` then set to `0`.
+ *
+ * @static
+ * @memberOf _
+ * @category Number
+ * @param {number} n The number to check.
+ * @param {number} [start=0] The start of the range.
+ * @param {number} end The end of the range.
+ * @returns {boolean} Returns `true` if `n` is in the range, else `false`.
+ * @example
+ *
+ * _.inRange(3, 2, 4);
+ * // => true
+ *
+ * _.inRange(4, 8);
+ * // => true
+ *
+ * _.inRange(4, 2);
+ * // => false
+ *
+ * _.inRange(2, 2);
+ * // => false
+ *
+ * _.inRange(1.2, 2);
+ * // => true
+ *
+ * _.inRange(5.2, 4);
+ * // => false
+ */
+function inRange(value, start, end) {
+ start = +start || 0;
+ if (typeof end === 'undefined') {
+ end = start;
+ start = 0;
+ } else {
+ end = +end || 0;
+ }
+ return value >= nativeMin(start, end) && value < nativeMax(start, end);
+}
+
+module.exports = inRange;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/number/random.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/number/random.js
new file mode 100644
index 00000000000..4212c2bb2c8
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/number/random.js
@@ -0,0 +1,70 @@
+var baseRandom = require('../internal/baseRandom'),
+ isIterateeCall = require('../internal/isIterateeCall');
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMin = Math.min,
+ nativeRandom = Math.random;
+
+/**
+ * Produces a random number between `min` and `max` (inclusive). If only one
+ * argument is provided a number between `0` and the given number is returned.
+ * If `floating` is `true`, or either `min` or `max` are floats, a floating-point
+ * number is returned instead of an integer.
+ *
+ * @static
+ * @memberOf _
+ * @category Number
+ * @param {number} [min=0] The minimum possible value.
+ * @param {number} [max=1] The maximum possible value.
+ * @param {boolean} [floating] Specify returning a floating-point number.
+ * @returns {number} Returns the random number.
+ * @example
+ *
+ * _.random(0, 5);
+ * // => an integer between 0 and 5
+ *
+ * _.random(5);
+ * // => also an integer between 0 and 5
+ *
+ * _.random(5, true);
+ * // => a floating-point number between 0 and 5
+ *
+ * _.random(1.2, 5.2);
+ * // => a floating-point number between 1.2 and 5.2
+ */
+function random(min, max, floating) {
+ if (floating && isIterateeCall(min, max, floating)) {
+ max = floating = null;
+ }
+ var noMin = min == null,
+ noMax = max == null;
+
+ if (floating == null) {
+ if (noMax && typeof min == 'boolean') {
+ floating = min;
+ min = 1;
+ }
+ else if (typeof max == 'boolean') {
+ floating = max;
+ noMax = true;
+ }
+ }
+ if (noMin && noMax) {
+ max = 1;
+ noMax = false;
+ }
+ min = +min || 0;
+ if (noMax) {
+ max = min;
+ min = 0;
+ } else {
+ max = +max || 0;
+ }
+ if (floating || min % 1 || max % 1) {
+ var rand = nativeRandom();
+ return nativeMin(min + (rand * (max - min + parseFloat('1e-' + ((rand + '').length - 1)))), max);
+ }
+ return baseRandom(min, max);
+}
+
+module.exports = random;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/object.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/object.js
new file mode 100644
index 00000000000..a1e0703e0c1
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/object.js
@@ -0,0 +1,30 @@
+module.exports = {
+ 'assign': require('./object/assign'),
+ 'create': require('./object/create'),
+ 'defaults': require('./object/defaults'),
+ 'extend': require('./object/extend'),
+ 'findKey': require('./object/findKey'),
+ 'findLastKey': require('./object/findLastKey'),
+ 'forIn': require('./object/forIn'),
+ 'forInRight': require('./object/forInRight'),
+ 'forOwn': require('./object/forOwn'),
+ 'forOwnRight': require('./object/forOwnRight'),
+ 'functions': require('./object/functions'),
+ 'get': require('./object/get'),
+ 'has': require('./object/has'),
+ 'invert': require('./object/invert'),
+ 'keys': require('./object/keys'),
+ 'keysIn': require('./object/keysIn'),
+ 'mapKeys': require('./object/mapKeys'),
+ 'mapValues': require('./object/mapValues'),
+ 'merge': require('./object/merge'),
+ 'methods': require('./object/methods'),
+ 'omit': require('./object/omit'),
+ 'pairs': require('./object/pairs'),
+ 'pick': require('./object/pick'),
+ 'result': require('./object/result'),
+ 'set': require('./object/set'),
+ 'transform': require('./object/transform'),
+ 'values': require('./object/values'),
+ 'valuesIn': require('./object/valuesIn')
+};
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/object/assign.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/assign.js
new file mode 100644
index 00000000000..a01c757199d
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/assign.js
@@ -0,0 +1,43 @@
+var assignWith = require('../internal/assignWith'),
+ baseAssign = require('../internal/baseAssign'),
+ createAssigner = require('../internal/createAssigner');
+
+/**
+ * Assigns own enumerable properties of source object(s) to the destination
+ * object. Subsequent sources overwrite property assignments of previous sources.
+ * If `customizer` is provided it is invoked to produce the assigned values.
+ * The `customizer` is bound to `thisArg` and invoked with five arguments:
+ * (objectValue, sourceValue, key, object, source).
+ *
+ * **Note:** This method mutates `object` and is based on
+ * [`Object.assign`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign).
+ *
+ * @static
+ * @memberOf _
+ * @alias extend
+ * @category Object
+ * @param {Object} object The destination object.
+ * @param {...Object} [sources] The source objects.
+ * @param {Function} [customizer] The function to customize assigned values.
+ * @param {*} [thisArg] The `this` binding of `customizer`.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' });
+ * // => { 'user': 'fred', 'age': 40 }
+ *
+ * // using a customizer callback
+ * var defaults = _.partialRight(_.assign, function(value, other) {
+ * return _.isUndefined(value) ? other : value;
+ * });
+ *
+ * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });
+ * // => { 'user': 'barney', 'age': 36 }
+ */
+var assign = createAssigner(function(object, source, customizer) {
+ return customizer
+ ? assignWith(object, source, customizer)
+ : baseAssign(object, source);
+});
+
+module.exports = assign;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/object/create.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/create.js
new file mode 100644
index 00000000000..a11d75be6f5
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/create.js
@@ -0,0 +1,47 @@
+var baseAssign = require('../internal/baseAssign'),
+ baseCreate = require('../internal/baseCreate'),
+ isIterateeCall = require('../internal/isIterateeCall');
+
+/**
+ * Creates an object that inherits from the given `prototype` object. If a
+ * `properties` object is provided its own enumerable properties are assigned
+ * to the created object.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} prototype The object to inherit from.
+ * @param {Object} [properties] The properties to assign to the object.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {Object} Returns the new object.
+ * @example
+ *
+ * function Shape() {
+ * this.x = 0;
+ * this.y = 0;
+ * }
+ *
+ * function Circle() {
+ * Shape.call(this);
+ * }
+ *
+ * Circle.prototype = _.create(Shape.prototype, {
+ * 'constructor': Circle
+ * });
+ *
+ * var circle = new Circle;
+ * circle instanceof Circle;
+ * // => true
+ *
+ * circle instanceof Shape;
+ * // => true
+ */
+function create(prototype, properties, guard) {
+ var result = baseCreate(prototype);
+ if (guard && isIterateeCall(prototype, properties, guard)) {
+ properties = null;
+ }
+ return properties ? baseAssign(result, properties) : result;
+}
+
+module.exports = create;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/object/defaults.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/defaults.js
new file mode 100644
index 00000000000..bcbd9f46b75
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/defaults.js
@@ -0,0 +1,32 @@
+var assign = require('./assign'),
+ assignDefaults = require('../internal/assignDefaults'),
+ restParam = require('../function/restParam');
+
+/**
+ * Assigns own enumerable properties of source object(s) to the destination
+ * object for all destination properties that resolve to `undefined`. Once a
+ * property is set, additional values of the same property are ignored.
+ *
+ * **Note:** This method mutates `object`.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The destination object.
+ * @param {...Object} [sources] The source objects.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });
+ * // => { 'user': 'barney', 'age': 36 }
+ */
+var defaults = restParam(function(args) {
+ var object = args[0];
+ if (object == null) {
+ return object;
+ }
+ args.push(assignDefaults);
+ return assign.apply(undefined, args);
+});
+
+module.exports = defaults;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/object/extend.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/extend.js
new file mode 100644
index 00000000000..dd0ca941c85
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/extend.js
@@ -0,0 +1 @@
+module.exports = require('./assign');
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/object/findKey.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/findKey.js
new file mode 100644
index 00000000000..1359df3406e
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/findKey.js
@@ -0,0 +1,54 @@
+var baseForOwn = require('../internal/baseForOwn'),
+ createFindKey = require('../internal/createFindKey');
+
+/**
+ * This method is like `_.find` except that it returns the key of the first
+ * element `predicate` returns truthy for instead of the element itself.
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to search.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {string|undefined} Returns the key of the matched element, else `undefined`.
+ * @example
+ *
+ * var users = {
+ * 'barney': { 'age': 36, 'active': true },
+ * 'fred': { 'age': 40, 'active': false },
+ * 'pebbles': { 'age': 1, 'active': true }
+ * };
+ *
+ * _.findKey(users, function(chr) {
+ * return chr.age < 40;
+ * });
+ * // => 'barney' (iteration order is not guaranteed)
+ *
+ * // using the `_.matches` callback shorthand
+ * _.findKey(users, { 'age': 1, 'active': true });
+ * // => 'pebbles'
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.findKey(users, 'active', false);
+ * // => 'fred'
+ *
+ * // using the `_.property` callback shorthand
+ * _.findKey(users, 'active');
+ * // => 'barney'
+ */
+var findKey = createFindKey(baseForOwn);
+
+module.exports = findKey;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/object/findLastKey.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/findLastKey.js
new file mode 100644
index 00000000000..42893a4b71b
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/findLastKey.js
@@ -0,0 +1,54 @@
+var baseForOwnRight = require('../internal/baseForOwnRight'),
+ createFindKey = require('../internal/createFindKey');
+
+/**
+ * This method is like `_.findKey` except that it iterates over elements of
+ * a collection in the opposite order.
+ *
+ * If a property name is provided for `predicate` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `predicate` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to search.
+ * @param {Function|Object|string} [predicate=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {string|undefined} Returns the key of the matched element, else `undefined`.
+ * @example
+ *
+ * var users = {
+ * 'barney': { 'age': 36, 'active': true },
+ * 'fred': { 'age': 40, 'active': false },
+ * 'pebbles': { 'age': 1, 'active': true }
+ * };
+ *
+ * _.findLastKey(users, function(chr) {
+ * return chr.age < 40;
+ * });
+ * // => returns `pebbles` assuming `_.findKey` returns `barney`
+ *
+ * // using the `_.matches` callback shorthand
+ * _.findLastKey(users, { 'age': 36, 'active': true });
+ * // => 'barney'
+ *
+ * // using the `_.matchesProperty` callback shorthand
+ * _.findLastKey(users, 'active', false);
+ * // => 'fred'
+ *
+ * // using the `_.property` callback shorthand
+ * _.findLastKey(users, 'active');
+ * // => 'pebbles'
+ */
+var findLastKey = createFindKey(baseForOwnRight);
+
+module.exports = findLastKey;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/object/forIn.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/forIn.js
new file mode 100644
index 00000000000..52d34af8eab
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/forIn.js
@@ -0,0 +1,33 @@
+var baseFor = require('../internal/baseFor'),
+ createForIn = require('../internal/createForIn');
+
+/**
+ * Iterates over own and inherited enumerable properties of an object invoking
+ * `iteratee` for each property. The `iteratee` is bound to `thisArg` and invoked
+ * with three arguments: (value, key, object). Iteratee functions may exit
+ * iteration early by explicitly returning `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.forIn(new Foo, function(value, key) {
+ * console.log(key);
+ * });
+ * // => logs 'a', 'b', and 'c' (iteration order is not guaranteed)
+ */
+var forIn = createForIn(baseFor);
+
+module.exports = forIn;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/object/forInRight.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/forInRight.js
new file mode 100644
index 00000000000..6780b929784
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/forInRight.js
@@ -0,0 +1,31 @@
+var baseForRight = require('../internal/baseForRight'),
+ createForIn = require('../internal/createForIn');
+
+/**
+ * This method is like `_.forIn` except that it iterates over properties of
+ * `object` in the opposite order.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.forInRight(new Foo, function(value, key) {
+ * console.log(key);
+ * });
+ * // => logs 'c', 'b', and 'a' assuming `_.forIn ` logs 'a', 'b', and 'c'
+ */
+var forInRight = createForIn(baseForRight);
+
+module.exports = forInRight;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/object/forOwn.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/forOwn.js
new file mode 100644
index 00000000000..747bb7651b6
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/forOwn.js
@@ -0,0 +1,33 @@
+var baseForOwn = require('../internal/baseForOwn'),
+ createForOwn = require('../internal/createForOwn');
+
+/**
+ * Iterates over own enumerable properties of an object invoking `iteratee`
+ * for each property. The `iteratee` is bound to `thisArg` and invoked with
+ * three arguments: (value, key, object). Iteratee functions may exit iteration
+ * early by explicitly returning `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.forOwn(new Foo, function(value, key) {
+ * console.log(key);
+ * });
+ * // => logs 'a' and 'b' (iteration order is not guaranteed)
+ */
+var forOwn = createForOwn(baseForOwn);
+
+module.exports = forOwn;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/object/forOwnRight.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/forOwnRight.js
new file mode 100644
index 00000000000..8122338b373
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/forOwnRight.js
@@ -0,0 +1,31 @@
+var baseForOwnRight = require('../internal/baseForOwnRight'),
+ createForOwn = require('../internal/createForOwn');
+
+/**
+ * This method is like `_.forOwn` except that it iterates over properties of
+ * `object` in the opposite order.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.forOwnRight(new Foo, function(value, key) {
+ * console.log(key);
+ * });
+ * // => logs 'b' and 'a' assuming `_.forOwn` logs 'a' and 'b'
+ */
+var forOwnRight = createForOwn(baseForOwnRight);
+
+module.exports = forOwnRight;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/object/functions.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/functions.js
new file mode 100644
index 00000000000..10799becd3c
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/functions.js
@@ -0,0 +1,23 @@
+var baseFunctions = require('../internal/baseFunctions'),
+ keysIn = require('./keysIn');
+
+/**
+ * Creates an array of function property names from all enumerable properties,
+ * own and inherited, of `object`.
+ *
+ * @static
+ * @memberOf _
+ * @alias methods
+ * @category Object
+ * @param {Object} object The object to inspect.
+ * @returns {Array} Returns the new array of property names.
+ * @example
+ *
+ * _.functions(_);
+ * // => ['after', 'ary', 'assign', ...]
+ */
+function functions(object) {
+ return baseFunctions(object, keysIn(object));
+}
+
+module.exports = functions;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/object/get.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/get.js
new file mode 100644
index 00000000000..0bb59b8dca4
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/get.js
@@ -0,0 +1,33 @@
+var baseGet = require('../internal/baseGet'),
+ toPath = require('../internal/toPath');
+
+/**
+ * Gets the property value at `path` of `object`. If the resolved value is
+ * `undefined` the `defaultValue` is used in its place.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @param {Array|string} path The path of the property to get.
+ * @param {*} [defaultValue] The value returned if the resolved value is `undefined`.
+ * @returns {*} Returns the resolved value.
+ * @example
+ *
+ * var object = { 'a': [{ 'b': { 'c': 3 } }] };
+ *
+ * _.get(object, 'a[0].b.c');
+ * // => 3
+ *
+ * _.get(object, ['a', '0', 'b', 'c']);
+ * // => 3
+ *
+ * _.get(object, 'a.b.c', 'default');
+ * // => 'default'
+ */
+function get(object, path, defaultValue) {
+ var result = object == null ? undefined : baseGet(object, toPath(path), path + '');
+ return result === undefined ? defaultValue : result;
+}
+
+module.exports = get;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/object/has.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/has.js
new file mode 100644
index 00000000000..f356243eba6
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/has.js
@@ -0,0 +1,57 @@
+var baseGet = require('../internal/baseGet'),
+ baseSlice = require('../internal/baseSlice'),
+ isArguments = require('../lang/isArguments'),
+ isArray = require('../lang/isArray'),
+ isIndex = require('../internal/isIndex'),
+ isKey = require('../internal/isKey'),
+ isLength = require('../internal/isLength'),
+ last = require('../array/last'),
+ toPath = require('../internal/toPath');
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Checks if `path` is a direct property.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @param {Array|string} path The path to check.
+ * @returns {boolean} Returns `true` if `path` is a direct property, else `false`.
+ * @example
+ *
+ * var object = { 'a': { 'b': { 'c': 3 } } };
+ *
+ * _.has(object, 'a');
+ * // => true
+ *
+ * _.has(object, 'a.b.c');
+ * // => true
+ *
+ * _.has(object, ['a', 'b', 'c']);
+ * // => true
+ */
+function has(object, path) {
+ if (object == null) {
+ return false;
+ }
+ var result = hasOwnProperty.call(object, path);
+ if (!result && !isKey(path)) {
+ path = toPath(path);
+ object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
+ if (object == null) {
+ return false;
+ }
+ path = last(path);
+ result = hasOwnProperty.call(object, path);
+ }
+ return result || (isLength(object.length) && isIndex(path, object.length) &&
+ (isArray(object) || isArguments(object)));
+}
+
+module.exports = has;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/object/invert.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/invert.js
new file mode 100644
index 00000000000..de02c08e886
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/invert.js
@@ -0,0 +1,60 @@
+var isIterateeCall = require('../internal/isIterateeCall'),
+ keys = require('./keys');
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Creates an object composed of the inverted keys and values of `object`.
+ * If `object` contains duplicate values, subsequent values overwrite property
+ * assignments of previous values unless `multiValue` is `true`.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to invert.
+ * @param {boolean} [multiValue] Allow multiple values per key.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {Object} Returns the new inverted object.
+ * @example
+ *
+ * var object = { 'a': 1, 'b': 2, 'c': 1 };
+ *
+ * _.invert(object);
+ * // => { '1': 'c', '2': 'b' }
+ *
+ * // with `multiValue`
+ * _.invert(object, true);
+ * // => { '1': ['a', 'c'], '2': ['b'] }
+ */
+function invert(object, multiValue, guard) {
+ if (guard && isIterateeCall(object, multiValue, guard)) {
+ multiValue = null;
+ }
+ var index = -1,
+ props = keys(object),
+ length = props.length,
+ result = {};
+
+ while (++index < length) {
+ var key = props[index],
+ value = object[key];
+
+ if (multiValue) {
+ if (hasOwnProperty.call(result, value)) {
+ result[value].push(key);
+ } else {
+ result[value] = [key];
+ }
+ }
+ else {
+ result[value] = key;
+ }
+ }
+ return result;
+}
+
+module.exports = invert;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/object/keys.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/keys.js
new file mode 100644
index 00000000000..a87551439f3
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/keys.js
@@ -0,0 +1,45 @@
+var getNative = require('../internal/getNative'),
+ isArrayLike = require('../internal/isArrayLike'),
+ isObject = require('../lang/isObject'),
+ shimKeys = require('../internal/shimKeys');
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeKeys = getNative(Object, 'keys');
+
+/**
+ * Creates an array of the own enumerable property names of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects. See the
+ * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.keys)
+ * for more details.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.keys(new Foo);
+ * // => ['a', 'b'] (iteration order is not guaranteed)
+ *
+ * _.keys('hi');
+ * // => ['0', '1']
+ */
+var keys = !nativeKeys ? shimKeys : function(object) {
+ var Ctor = object == null ? null : object.constructor;
+ if ((typeof Ctor == 'function' && Ctor.prototype === object) ||
+ (typeof object != 'function' && isArrayLike(object))) {
+ return shimKeys(object);
+ }
+ return isObject(object) ? nativeKeys(object) : [];
+};
+
+module.exports = keys;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/object/keysIn.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/keysIn.js
new file mode 100644
index 00000000000..45a85d79546
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/keysIn.js
@@ -0,0 +1,64 @@
+var isArguments = require('../lang/isArguments'),
+ isArray = require('../lang/isArray'),
+ isIndex = require('../internal/isIndex'),
+ isLength = require('../internal/isLength'),
+ isObject = require('../lang/isObject');
+
+/** Used for native method references. */
+var objectProto = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
+/**
+ * Creates an array of the own and inherited enumerable property names of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property names.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.keysIn(new Foo);
+ * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
+ */
+function keysIn(object) {
+ if (object == null) {
+ return [];
+ }
+ if (!isObject(object)) {
+ object = Object(object);
+ }
+ var length = object.length;
+ length = (length && isLength(length) &&
+ (isArray(object) || isArguments(object)) && length) || 0;
+
+ var Ctor = object.constructor,
+ index = -1,
+ isProto = typeof Ctor == 'function' && Ctor.prototype === object,
+ result = Array(length),
+ skipIndexes = length > 0;
+
+ while (++index < length) {
+ result[index] = (index + '');
+ }
+ for (var key in object) {
+ if (!(skipIndexes && isIndex(key, length)) &&
+ !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
+ result.push(key);
+ }
+ }
+ return result;
+}
+
+module.exports = keysIn;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/object/mapKeys.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/mapKeys.js
new file mode 100644
index 00000000000..680b29b5ffb
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/mapKeys.js
@@ -0,0 +1,25 @@
+var createObjectMapper = require('../internal/createObjectMapper');
+
+/**
+ * The opposite of `_.mapValues`; this method creates an object with the
+ * same values as `object` and keys generated by running each own enumerable
+ * property of `object` through `iteratee`.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to iterate over.
+ * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Object} Returns the new mapped object.
+ * @example
+ *
+ * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
+ * return key + value;
+ * });
+ * // => { 'a1': 1, 'b2': 2 }
+ */
+var mapKeys = createObjectMapper(true);
+
+module.exports = mapKeys;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/object/mapValues.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/mapValues.js
new file mode 100644
index 00000000000..2afe6bac700
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/mapValues.js
@@ -0,0 +1,46 @@
+var createObjectMapper = require('../internal/createObjectMapper');
+
+/**
+ * Creates an object with the same keys as `object` and values generated by
+ * running each own enumerable property of `object` through `iteratee`. The
+ * iteratee function is bound to `thisArg` and invoked with three arguments:
+ * (value, key, object).
+ *
+ * If a property name is provided for `iteratee` the created `_.property`
+ * style callback returns the property value of the given element.
+ *
+ * If a value is also provided for `thisArg` the created `_.matchesProperty`
+ * style callback returns `true` for elements that have a matching property
+ * value, else `false`.
+ *
+ * If an object is provided for `iteratee` the created `_.matches` style
+ * callback returns `true` for elements that have the properties of the given
+ * object, else `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to iterate over.
+ * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+ * per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Object} Returns the new mapped object.
+ * @example
+ *
+ * _.mapValues({ 'a': 1, 'b': 2 }, function(n) {
+ * return n * 3;
+ * });
+ * // => { 'a': 3, 'b': 6 }
+ *
+ * var users = {
+ * 'fred': { 'user': 'fred', 'age': 40 },
+ * 'pebbles': { 'user': 'pebbles', 'age': 1 }
+ * };
+ *
+ * // using the `_.property` callback shorthand
+ * _.mapValues(users, 'age');
+ * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
+ */
+var mapValues = createObjectMapper();
+
+module.exports = mapValues;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/object/merge.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/merge.js
new file mode 100644
index 00000000000..dc0b95eff42
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/merge.js
@@ -0,0 +1,54 @@
+var baseMerge = require('../internal/baseMerge'),
+ createAssigner = require('../internal/createAssigner');
+
+/**
+ * Recursively merges own enumerable properties of the source object(s), that
+ * don't resolve to `undefined` into the destination object. Subsequent sources
+ * overwrite property assignments of previous sources. If `customizer` is
+ * provided it is invoked to produce the merged values of the destination and
+ * source properties. If `customizer` returns `undefined` merging is handled
+ * by the method instead. The `customizer` is bound to `thisArg` and invoked
+ * with five arguments: (objectValue, sourceValue, key, object, source).
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The destination object.
+ * @param {...Object} [sources] The source objects.
+ * @param {Function} [customizer] The function to customize assigned values.
+ * @param {*} [thisArg] The `this` binding of `customizer`.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * var users = {
+ * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }]
+ * };
+ *
+ * var ages = {
+ * 'data': [{ 'age': 36 }, { 'age': 40 }]
+ * };
+ *
+ * _.merge(users, ages);
+ * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] }
+ *
+ * // using a customizer callback
+ * var object = {
+ * 'fruits': ['apple'],
+ * 'vegetables': ['beet']
+ * };
+ *
+ * var other = {
+ * 'fruits': ['banana'],
+ * 'vegetables': ['carrot']
+ * };
+ *
+ * _.merge(object, other, function(a, b) {
+ * if (_.isArray(a)) {
+ * return a.concat(b);
+ * }
+ * });
+ * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] }
+ */
+var merge = createAssigner(baseMerge);
+
+module.exports = merge;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/object/methods.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/methods.js
new file mode 100644
index 00000000000..8a304feed1f
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/methods.js
@@ -0,0 +1 @@
+module.exports = require('./functions');
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/object/omit.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/omit.js
new file mode 100644
index 00000000000..fe3f48538bb
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/omit.js
@@ -0,0 +1,47 @@
+var arrayMap = require('../internal/arrayMap'),
+ baseDifference = require('../internal/baseDifference'),
+ baseFlatten = require('../internal/baseFlatten'),
+ bindCallback = require('../internal/bindCallback'),
+ keysIn = require('./keysIn'),
+ pickByArray = require('../internal/pickByArray'),
+ pickByCallback = require('../internal/pickByCallback'),
+ restParam = require('../function/restParam');
+
+/**
+ * The opposite of `_.pick`; this method creates an object composed of the
+ * own and inherited enumerable properties of `object` that are not omitted.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The source object.
+ * @param {Function|...(string|string[])} [predicate] The function invoked per
+ * iteration or property names to omit, specified as individual property
+ * names or arrays of property names.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {Object} Returns the new object.
+ * @example
+ *
+ * var object = { 'user': 'fred', 'age': 40 };
+ *
+ * _.omit(object, 'age');
+ * // => { 'user': 'fred' }
+ *
+ * _.omit(object, _.isNumber);
+ * // => { 'user': 'fred' }
+ */
+var omit = restParam(function(object, props) {
+ if (object == null) {
+ return {};
+ }
+ if (typeof props[0] != 'function') {
+ var props = arrayMap(baseFlatten(props), String);
+ return pickByArray(object, baseDifference(keysIn(object), props));
+ }
+ var predicate = bindCallback(props[0], props[1], 3);
+ return pickByCallback(object, function(value, key, object) {
+ return !predicate(value, key, object);
+ });
+});
+
+module.exports = omit;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/object/pairs.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/pairs.js
new file mode 100644
index 00000000000..fd4644cea2c
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/pairs.js
@@ -0,0 +1,33 @@
+var keys = require('./keys'),
+ toObject = require('../internal/toObject');
+
+/**
+ * Creates a two dimensional array of the key-value pairs for `object`,
+ * e.g. `[[key1, value1], [key2, value2]]`.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the new array of key-value pairs.
+ * @example
+ *
+ * _.pairs({ 'barney': 36, 'fred': 40 });
+ * // => [['barney', 36], ['fred', 40]] (iteration order is not guaranteed)
+ */
+function pairs(object) {
+ object = toObject(object);
+
+ var index = -1,
+ props = keys(object),
+ length = props.length,
+ result = Array(length);
+
+ while (++index < length) {
+ var key = props[index];
+ result[index] = [key, object[key]];
+ }
+ return result;
+}
+
+module.exports = pairs;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/object/pick.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/pick.js
new file mode 100644
index 00000000000..c880c319b96
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/pick.js
@@ -0,0 +1,42 @@
+var baseFlatten = require('../internal/baseFlatten'),
+ bindCallback = require('../internal/bindCallback'),
+ pickByArray = require('../internal/pickByArray'),
+ pickByCallback = require('../internal/pickByCallback'),
+ restParam = require('../function/restParam');
+
+/**
+ * Creates an object composed of the picked `object` properties. Property
+ * names may be specified as individual arguments or as arrays of property
+ * names. If `predicate` is provided it is invoked for each property of `object`
+ * picking the properties `predicate` returns truthy for. The predicate is
+ * bound to `thisArg` and invoked with three arguments: (value, key, object).
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The source object.
+ * @param {Function|...(string|string[])} [predicate] The function invoked per
+ * iteration or property names to pick, specified as individual property
+ * names or arrays of property names.
+ * @param {*} [thisArg] The `this` binding of `predicate`.
+ * @returns {Object} Returns the new object.
+ * @example
+ *
+ * var object = { 'user': 'fred', 'age': 40 };
+ *
+ * _.pick(object, 'user');
+ * // => { 'user': 'fred' }
+ *
+ * _.pick(object, _.isString);
+ * // => { 'user': 'fred' }
+ */
+var pick = restParam(function(object, props) {
+ if (object == null) {
+ return {};
+ }
+ return typeof props[0] == 'function'
+ ? pickByCallback(object, bindCallback(props[0], props[1], 3))
+ : pickByArray(object, baseFlatten(props));
+});
+
+module.exports = pick;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/object/result.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/result.js
new file mode 100644
index 00000000000..05ca6df66a9
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/result.js
@@ -0,0 +1,49 @@
+var baseGet = require('../internal/baseGet'),
+ baseSlice = require('../internal/baseSlice'),
+ isFunction = require('../lang/isFunction'),
+ isKey = require('../internal/isKey'),
+ last = require('../array/last'),
+ toPath = require('../internal/toPath');
+
+/**
+ * This method is like `_.get` except that if the resolved value is a function
+ * it is invoked with the `this` binding of its parent object and its result
+ * is returned.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @param {Array|string} path The path of the property to resolve.
+ * @param {*} [defaultValue] The value returned if the resolved value is `undefined`.
+ * @returns {*} Returns the resolved value.
+ * @example
+ *
+ * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
+ *
+ * _.result(object, 'a[0].b.c1');
+ * // => 3
+ *
+ * _.result(object, 'a[0].b.c2');
+ * // => 4
+ *
+ * _.result(object, 'a.b.c', 'default');
+ * // => 'default'
+ *
+ * _.result(object, 'a.b.c', _.constant('default'));
+ * // => 'default'
+ */
+function result(object, path, defaultValue) {
+ var result = object == null ? undefined : object[path];
+ if (result === undefined) {
+ if (object != null && !isKey(path, object)) {
+ path = toPath(path);
+ object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
+ result = object == null ? undefined : object[last(path)];
+ }
+ result = result === undefined ? defaultValue : result;
+ }
+ return isFunction(result) ? result.call(object) : result;
+}
+
+module.exports = result;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/object/set.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/set.js
new file mode 100644
index 00000000000..423faab8248
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/set.js
@@ -0,0 +1,55 @@
+var isIndex = require('../internal/isIndex'),
+ isKey = require('../internal/isKey'),
+ isObject = require('../lang/isObject'),
+ toPath = require('../internal/toPath');
+
+/**
+ * Sets the property value of `path` on `object`. If a portion of `path`
+ * does not exist it is created.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to augment.
+ * @param {Array|string} path The path of the property to set.
+ * @param {*} value The value to set.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * var object = { 'a': [{ 'b': { 'c': 3 } }] };
+ *
+ * _.set(object, 'a[0].b.c', 4);
+ * console.log(object.a[0].b.c);
+ * // => 4
+ *
+ * _.set(object, 'x[0].y.z', 5);
+ * console.log(object.x[0].y.z);
+ * // => 5
+ */
+function set(object, path, value) {
+ if (object == null) {
+ return object;
+ }
+ var pathKey = (path + '');
+ path = (object[pathKey] != null || isKey(path, object)) ? [pathKey] : toPath(path);
+
+ var index = -1,
+ length = path.length,
+ lastIndex = length - 1,
+ nested = object;
+
+ while (nested != null && ++index < length) {
+ var key = path[index];
+ if (isObject(nested)) {
+ if (index == lastIndex) {
+ nested[key] = value;
+ } else if (nested[key] == null) {
+ nested[key] = isIndex(path[index + 1]) ? [] : {};
+ }
+ }
+ nested = nested[key];
+ }
+ return object;
+}
+
+module.exports = set;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/object/transform.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/transform.js
new file mode 100644
index 00000000000..9f6b8ce7ed7
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/transform.js
@@ -0,0 +1,61 @@
+var arrayEach = require('../internal/arrayEach'),
+ baseCallback = require('../internal/baseCallback'),
+ baseCreate = require('../internal/baseCreate'),
+ baseForOwn = require('../internal/baseForOwn'),
+ isArray = require('../lang/isArray'),
+ isFunction = require('../lang/isFunction'),
+ isObject = require('../lang/isObject'),
+ isTypedArray = require('../lang/isTypedArray');
+
+/**
+ * An alternative to `_.reduce`; this method transforms `object` to a new
+ * `accumulator` object which is the result of running each of its own enumerable
+ * properties through `iteratee`, with each invocation potentially mutating
+ * the `accumulator` object. The `iteratee` is bound to `thisArg` and invoked
+ * with four arguments: (accumulator, value, key, object). Iteratee functions
+ * may exit iteration early by explicitly returning `false`.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Array|Object} object The object to iterate over.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @param {*} [accumulator] The custom accumulator value.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {*} Returns the accumulated value.
+ * @example
+ *
+ * _.transform([2, 3, 4], function(result, n) {
+ * result.push(n *= n);
+ * return n % 2 == 0;
+ * });
+ * // => [4, 9]
+ *
+ * _.transform({ 'a': 1, 'b': 2 }, function(result, n, key) {
+ * result[key] = n * 3;
+ * });
+ * // => { 'a': 3, 'b': 6 }
+ */
+function transform(object, iteratee, accumulator, thisArg) {
+ var isArr = isArray(object) || isTypedArray(object);
+ iteratee = baseCallback(iteratee, thisArg, 4);
+
+ if (accumulator == null) {
+ if (isArr || isObject(object)) {
+ var Ctor = object.constructor;
+ if (isArr) {
+ accumulator = isArray(object) ? new Ctor : [];
+ } else {
+ accumulator = baseCreate(isFunction(Ctor) ? Ctor.prototype : null);
+ }
+ } else {
+ accumulator = {};
+ }
+ }
+ (isArr ? arrayEach : baseForOwn)(object, function(value, index, object) {
+ return iteratee(accumulator, value, index, object);
+ });
+ return accumulator;
+}
+
+module.exports = transform;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/object/values.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/values.js
new file mode 100644
index 00000000000..0171515055b
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/values.js
@@ -0,0 +1,33 @@
+var baseValues = require('../internal/baseValues'),
+ keys = require('./keys');
+
+/**
+ * Creates an array of the own enumerable property values of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property values.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.values(new Foo);
+ * // => [1, 2] (iteration order is not guaranteed)
+ *
+ * _.values('hi');
+ * // => ['h', 'i']
+ */
+function values(object) {
+ return baseValues(object, keys(object));
+}
+
+module.exports = values;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/object/valuesIn.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/valuesIn.js
new file mode 100644
index 00000000000..5f067c060be
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/object/valuesIn.js
@@ -0,0 +1,31 @@
+var baseValues = require('../internal/baseValues'),
+ keysIn = require('./keysIn');
+
+/**
+ * Creates an array of the own and inherited enumerable property values
+ * of `object`.
+ *
+ * **Note:** Non-object values are coerced to objects.
+ *
+ * @static
+ * @memberOf _
+ * @category Object
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the array of property values.
+ * @example
+ *
+ * function Foo() {
+ * this.a = 1;
+ * this.b = 2;
+ * }
+ *
+ * Foo.prototype.c = 3;
+ *
+ * _.valuesIn(new Foo);
+ * // => [1, 2, 3] (iteration order is not guaranteed)
+ */
+function valuesIn(object) {
+ return baseValues(object, keysIn(object));
+}
+
+module.exports = valuesIn;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/package.json b/tools/eslint/node_modules/inquirer/node_modules/lodash/package.json
new file mode 100644
index 00000000000..6ad849cb6a5
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/package.json
@@ -0,0 +1,94 @@
+{
+ "name": "lodash",
+ "version": "3.9.3",
+ "description": "The modern build of lodash modular utilities.",
+ "homepage": "https://lodash.com/",
+ "icon": "https://lodash.com/icon.svg",
+ "license": "MIT",
+ "main": "index.js",
+ "keywords": [
+ "modules",
+ "stdlib",
+ "util"
+ ],
+ "author": {
+ "name": "John-David Dalton",
+ "email": "john.david.dalton@gmail.com",
+ "url": "http://allyoucanleet.com/"
+ },
+ "contributors": [
+ {
+ "name": "John-David Dalton",
+ "email": "john.david.dalton@gmail.com",
+ "url": "http://allyoucanleet.com/"
+ },
+ {
+ "name": "Benjamin Tan",
+ "email": "demoneaux@gmail.com",
+ "url": "https://d10.github.io/"
+ },
+ {
+ "name": "Blaine Bublitz",
+ "email": "blaine@iceddev.com",
+ "url": "http://www.iceddev.com/"
+ },
+ {
+ "name": "Kit Cambridge",
+ "email": "github@kitcambridge.be",
+ "url": "http://kitcambridge.be/"
+ },
+ {
+ "name": "Mathias Bynens",
+ "email": "mathias@qiwi.be",
+ "url": "https://mathiasbynens.be/"
+ }
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/lodash/lodash.git"
+ },
+ "scripts": {
+ "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\""
+ },
+ "bugs": {
+ "url": "https://github.com/lodash/lodash/issues"
+ },
+ "_id": "lodash@3.9.3",
+ "_shasum": "0159e86832feffc6d61d852b12a953b99496bd32",
+ "_from": "lodash@>=3.3.1 <4.0.0",
+ "_npmVersion": "2.10.1",
+ "_nodeVersion": "2.0.2",
+ "_npmUser": {
+ "name": "jdalton",
+ "email": "john.david.dalton@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "jdalton",
+ "email": "john.david.dalton@gmail.com"
+ },
+ {
+ "name": "mathias",
+ "email": "mathias@qiwi.be"
+ },
+ {
+ "name": "phated",
+ "email": "blaine@iceddev.com"
+ },
+ {
+ "name": "kitcambridge",
+ "email": "github@kitcambridge.be"
+ },
+ {
+ "name": "d10",
+ "email": "demoneaux@gmail.com"
+ }
+ ],
+ "dist": {
+ "shasum": "0159e86832feffc6d61d852b12a953b99496bd32",
+ "tarball": "http://registry.npmjs.org/lodash/-/lodash-3.9.3.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/lodash/-/lodash-3.9.3.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/string.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/string.js
new file mode 100644
index 00000000000..f7779453023
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/string.js
@@ -0,0 +1,25 @@
+module.exports = {
+ 'camelCase': require('./string/camelCase'),
+ 'capitalize': require('./string/capitalize'),
+ 'deburr': require('./string/deburr'),
+ 'endsWith': require('./string/endsWith'),
+ 'escape': require('./string/escape'),
+ 'escapeRegExp': require('./string/escapeRegExp'),
+ 'kebabCase': require('./string/kebabCase'),
+ 'pad': require('./string/pad'),
+ 'padLeft': require('./string/padLeft'),
+ 'padRight': require('./string/padRight'),
+ 'parseInt': require('./string/parseInt'),
+ 'repeat': require('./string/repeat'),
+ 'snakeCase': require('./string/snakeCase'),
+ 'startCase': require('./string/startCase'),
+ 'startsWith': require('./string/startsWith'),
+ 'template': require('./string/template'),
+ 'templateSettings': require('./string/templateSettings'),
+ 'trim': require('./string/trim'),
+ 'trimLeft': require('./string/trimLeft'),
+ 'trimRight': require('./string/trimRight'),
+ 'trunc': require('./string/trunc'),
+ 'unescape': require('./string/unescape'),
+ 'words': require('./string/words')
+};
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/string/camelCase.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/camelCase.js
new file mode 100644
index 00000000000..2d438f4aac4
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/camelCase.js
@@ -0,0 +1,27 @@
+var createCompounder = require('../internal/createCompounder');
+
+/**
+ * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to convert.
+ * @returns {string} Returns the camel cased string.
+ * @example
+ *
+ * _.camelCase('Foo Bar');
+ * // => 'fooBar'
+ *
+ * _.camelCase('--foo-bar');
+ * // => 'fooBar'
+ *
+ * _.camelCase('__foo_bar__');
+ * // => 'fooBar'
+ */
+var camelCase = createCompounder(function(result, word, index) {
+ word = word.toLowerCase();
+ return result + (index ? (word.charAt(0).toUpperCase() + word.slice(1)) : word);
+});
+
+module.exports = camelCase;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/string/capitalize.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/capitalize.js
new file mode 100644
index 00000000000..f9222dc2ebf
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/capitalize.js
@@ -0,0 +1,21 @@
+var baseToString = require('../internal/baseToString');
+
+/**
+ * Capitalizes the first character of `string`.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to capitalize.
+ * @returns {string} Returns the capitalized string.
+ * @example
+ *
+ * _.capitalize('fred');
+ * // => 'Fred'
+ */
+function capitalize(string) {
+ string = baseToString(string);
+ return string && (string.charAt(0).toUpperCase() + string.slice(1));
+}
+
+module.exports = capitalize;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/string/deburr.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/deburr.js
new file mode 100644
index 00000000000..0bd03e62dcf
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/deburr.js
@@ -0,0 +1,29 @@
+var baseToString = require('../internal/baseToString'),
+ deburrLetter = require('../internal/deburrLetter');
+
+/** Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). */
+var reComboMark = /[\u0300-\u036f\ufe20-\ufe23]/g;
+
+/** Used to match latin-1 supplementary letters (excluding mathematical operators). */
+var reLatin1 = /[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g;
+
+/**
+ * Deburrs `string` by converting [latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
+ * to basic latin letters and removing [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to deburr.
+ * @returns {string} Returns the deburred string.
+ * @example
+ *
+ * _.deburr('déjà vu');
+ * // => 'deja vu'
+ */
+function deburr(string) {
+ string = baseToString(string);
+ return string && string.replace(reLatin1, deburrLetter).replace(reComboMark, '');
+}
+
+module.exports = deburr;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/string/endsWith.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/endsWith.js
new file mode 100644
index 00000000000..26821e26613
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/endsWith.js
@@ -0,0 +1,40 @@
+var baseToString = require('../internal/baseToString');
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMin = Math.min;
+
+/**
+ * Checks if `string` ends with the given target string.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to search.
+ * @param {string} [target] The string to search for.
+ * @param {number} [position=string.length] The position to search from.
+ * @returns {boolean} Returns `true` if `string` ends with `target`, else `false`.
+ * @example
+ *
+ * _.endsWith('abc', 'c');
+ * // => true
+ *
+ * _.endsWith('abc', 'b');
+ * // => false
+ *
+ * _.endsWith('abc', 'b', 2);
+ * // => true
+ */
+function endsWith(string, target, position) {
+ string = baseToString(string);
+ target = (target + '');
+
+ var length = string.length;
+ position = position === undefined
+ ? length
+ : nativeMin(position < 0 ? 0 : (+position || 0), length);
+
+ position -= target.length;
+ return position >= 0 && string.indexOf(target, position) == position;
+}
+
+module.exports = endsWith;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/string/escape.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/escape.js
new file mode 100644
index 00000000000..cd08a5ddfbd
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/escape.js
@@ -0,0 +1,48 @@
+var baseToString = require('../internal/baseToString'),
+ escapeHtmlChar = require('../internal/escapeHtmlChar');
+
+/** Used to match HTML entities and HTML characters. */
+var reUnescapedHtml = /[&<>"'`]/g,
+ reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
+
+/**
+ * Converts the characters "&", "<", ">", '"', "'", and "\`", in `string` to
+ * their corresponding HTML entities.
+ *
+ * **Note:** No other characters are escaped. To escape additional characters
+ * use a third-party library like [_he_](https://mths.be/he).
+ *
+ * Though the ">" character is escaped for symmetry, characters like
+ * ">" and "/" don't need escaping in HTML and have no special meaning
+ * unless they're part of a tag or unquoted attribute value.
+ * See [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
+ * (under "semi-related fun fact") for more details.
+ *
+ * Backticks are escaped because in Internet Explorer < 9, they can break out
+ * of attribute values or HTML comments. See [#59](https://html5sec.org/#59),
+ * [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and
+ * [#133](https://html5sec.org/#133) of the [HTML5 Security Cheatsheet](https://html5sec.org/)
+ * for more details.
+ *
+ * When working with HTML you should always [quote attribute values](http://wonko.com/post/html-escaping)
+ * to reduce XSS vectors.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to escape.
+ * @returns {string} Returns the escaped string.
+ * @example
+ *
+ * _.escape('fred, barney, & pebbles');
+ * // => 'fred, barney, &amp; pebbles'
+ */
+function escape(string) {
+ // Reset `lastIndex` because in IE < 9 `String#replace` does not.
+ string = baseToString(string);
+ return (string && reHasUnescapedHtml.test(string))
+ ? string.replace(reUnescapedHtml, escapeHtmlChar)
+ : string;
+}
+
+module.exports = escape;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/string/escapeRegExp.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/escapeRegExp.js
new file mode 100644
index 00000000000..0234d67f58f
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/escapeRegExp.js
@@ -0,0 +1,32 @@
+var baseToString = require('../internal/baseToString');
+
+/**
+ * Used to match `RegExp` [special characters](http://www.regular-expressions.info/characters.html#special).
+ * In addition to special characters the forward slash is escaped to allow for
+ * easier `eval` use and `Function` compilation.
+ */
+var reRegExpChars = /[.*+?^${}()|[\]\/\\]/g,
+ reHasRegExpChars = RegExp(reRegExpChars.source);
+
+/**
+ * Escapes the `RegExp` special characters "\", "/", "^", "$", ".", "|", "?",
+ * "*", "+", "(", ")", "[", "]", "{" and "}" in `string`.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to escape.
+ * @returns {string} Returns the escaped string.
+ * @example
+ *
+ * _.escapeRegExp('[lodash](https://lodash.com/)');
+ * // => '\[lodash\]\(https:\/\/lodash\.com\/\)'
+ */
+function escapeRegExp(string) {
+ string = baseToString(string);
+ return (string && reHasRegExpChars.test(string))
+ ? string.replace(reRegExpChars, '\\$&')
+ : string;
+}
+
+module.exports = escapeRegExp;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/string/kebabCase.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/kebabCase.js
new file mode 100644
index 00000000000..d29c2f908a1
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/kebabCase.js
@@ -0,0 +1,26 @@
+var createCompounder = require('../internal/createCompounder');
+
+/**
+ * Converts `string` to [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to convert.
+ * @returns {string} Returns the kebab cased string.
+ * @example
+ *
+ * _.kebabCase('Foo Bar');
+ * // => 'foo-bar'
+ *
+ * _.kebabCase('fooBar');
+ * // => 'foo-bar'
+ *
+ * _.kebabCase('__foo_bar__');
+ * // => 'foo-bar'
+ */
+var kebabCase = createCompounder(function(result, word, index) {
+ return result + (index ? '-' : '') + word.toLowerCase();
+});
+
+module.exports = kebabCase;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/string/pad.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/pad.js
new file mode 100644
index 00000000000..60b5c1332d6
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/pad.js
@@ -0,0 +1,49 @@
+var baseToString = require('../internal/baseToString'),
+ createPadding = require('../internal/createPadding');
+
+/** Native method references. */
+var ceil = Math.ceil,
+ floor = Math.floor;
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeIsFinite = global.isFinite;
+
+/**
+ * Pads `string` on the left and right sides if it's shorter than `length`.
+ * Padding characters are truncated if they can't be evenly divided by `length`.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to pad.
+ * @param {number} [length=0] The padding length.
+ * @param {string} [chars=' '] The string used as padding.
+ * @returns {string} Returns the padded string.
+ * @example
+ *
+ * _.pad('abc', 8);
+ * // => ' abc '
+ *
+ * _.pad('abc', 8, '_-');
+ * // => '_-abc_-_'
+ *
+ * _.pad('abc', 3);
+ * // => 'abc'
+ */
+function pad(string, length, chars) {
+ string = baseToString(string);
+ length = +length;
+
+ var strLength = string.length;
+ if (strLength >= length || !nativeIsFinite(length)) {
+ return string;
+ }
+ var mid = (length - strLength) / 2,
+ leftLength = floor(mid),
+ rightLength = ceil(mid);
+
+ chars = createPadding('', rightLength, chars);
+ return chars.slice(0, leftLength) + string + chars;
+}
+
+module.exports = pad;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/string/padLeft.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/padLeft.js
new file mode 100644
index 00000000000..bb0c94d0cdf
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/padLeft.js
@@ -0,0 +1,27 @@
+var createPadDir = require('../internal/createPadDir');
+
+/**
+ * Pads `string` on the left side if it's shorter than `length`. Padding
+ * characters are truncated if they exceed `length`.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to pad.
+ * @param {number} [length=0] The padding length.
+ * @param {string} [chars=' '] The string used as padding.
+ * @returns {string} Returns the padded string.
+ * @example
+ *
+ * _.padLeft('abc', 6);
+ * // => ' abc'
+ *
+ * _.padLeft('abc', 6, '_-');
+ * // => '_-_abc'
+ *
+ * _.padLeft('abc', 3);
+ * // => 'abc'
+ */
+var padLeft = createPadDir();
+
+module.exports = padLeft;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/string/padRight.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/padRight.js
new file mode 100644
index 00000000000..dc12f55993a
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/padRight.js
@@ -0,0 +1,27 @@
+var createPadDir = require('../internal/createPadDir');
+
+/**
+ * Pads `string` on the right side if it's shorter than `length`. Padding
+ * characters are truncated if they exceed `length`.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to pad.
+ * @param {number} [length=0] The padding length.
+ * @param {string} [chars=' '] The string used as padding.
+ * @returns {string} Returns the padded string.
+ * @example
+ *
+ * _.padRight('abc', 6);
+ * // => 'abc '
+ *
+ * _.padRight('abc', 6, '_-');
+ * // => 'abc_-_'
+ *
+ * _.padRight('abc', 3);
+ * // => 'abc'
+ */
+var padRight = createPadDir(true);
+
+module.exports = padRight;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/string/parseInt.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/parseInt.js
new file mode 100644
index 00000000000..c4cf71a9609
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/parseInt.js
@@ -0,0 +1,67 @@
+var isIterateeCall = require('../internal/isIterateeCall'),
+ trim = require('./trim');
+
+/** Used to detect hexadecimal string values. */
+var reHasHexPrefix = /^0[xX]/;
+
+/** Used to detect and test for whitespace. */
+var whitespace = (
+ // Basic whitespace characters.
+ ' \t\x0b\f\xa0\ufeff' +
+
+ // Line terminators.
+ '\n\r\u2028\u2029' +
+
+ // Unicode category "Zs" space separators.
+ '\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000'
+);
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeParseInt = global.parseInt;
+
+/**
+ * Converts `string` to an integer of the specified radix. If `radix` is
+ * `undefined` or `0`, a `radix` of `10` is used unless `value` is a hexadecimal,
+ * in which case a `radix` of `16` is used.
+ *
+ * **Note:** This method aligns with the [ES5 implementation](https://es5.github.io/#E)
+ * of `parseInt`.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} string The string to convert.
+ * @param {number} [radix] The radix to interpret `value` by.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {number} Returns the converted integer.
+ * @example
+ *
+ * _.parseInt('08');
+ * // => 8
+ *
+ * _.map(['6', '08', '10'], _.parseInt);
+ * // => [6, 8, 10]
+ */
+function parseInt(string, radix, guard) {
+ if (guard && isIterateeCall(string, radix, guard)) {
+ radix = 0;
+ }
+ return nativeParseInt(string, radix);
+}
+// Fallback for environments with pre-ES5 implementations.
+if (nativeParseInt(whitespace + '08') != 8) {
+ parseInt = function(string, radix, guard) {
+ // Firefox < 21 and Opera < 15 follow ES3 for `parseInt`.
+ // Chrome fails to trim leading <BOM> whitespace characters.
+ // See https://code.google.com/p/v8/issues/detail?id=3109 for more details.
+ if (guard ? isIterateeCall(string, radix, guard) : radix == null) {
+ radix = 0;
+ } else if (radix) {
+ radix = +radix;
+ }
+ string = trim(string);
+ return nativeParseInt(string, radix || (reHasHexPrefix.test(string) ? 16 : 10));
+ };
+}
+
+module.exports = parseInt;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/string/repeat.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/repeat.js
new file mode 100644
index 00000000000..271156b4279
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/repeat.js
@@ -0,0 +1,49 @@
+var baseToString = require('../internal/baseToString');
+
+/** Native method references. */
+var floor = Math.floor;
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeIsFinite = global.isFinite;
+
+/**
+ * Repeats the given string `n` times.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to repeat.
+ * @param {number} [n=0] The number of times to repeat the string.
+ * @returns {string} Returns the repeated string.
+ * @example
+ *
+ * _.repeat('*', 3);
+ * // => '***'
+ *
+ * _.repeat('abc', 2);
+ * // => 'abcabc'
+ *
+ * _.repeat('abc', 0);
+ * // => ''
+ */
+function repeat(string, n) {
+ var result = '';
+ string = baseToString(string);
+ n = +n;
+ if (n < 1 || !string || !nativeIsFinite(n)) {
+ return result;
+ }
+ // Leverage the exponentiation by squaring algorithm for a faster repeat.
+ // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
+ do {
+ if (n % 2) {
+ result += string;
+ }
+ n = floor(n / 2);
+ string += string;
+ } while (n);
+
+ return result;
+}
+
+module.exports = repeat;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/string/snakeCase.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/snakeCase.js
new file mode 100644
index 00000000000..c9ebffd9131
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/snakeCase.js
@@ -0,0 +1,26 @@
+var createCompounder = require('../internal/createCompounder');
+
+/**
+ * Converts `string` to [snake case](https://en.wikipedia.org/wiki/Snake_case).
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to convert.
+ * @returns {string} Returns the snake cased string.
+ * @example
+ *
+ * _.snakeCase('Foo Bar');
+ * // => 'foo_bar'
+ *
+ * _.snakeCase('fooBar');
+ * // => 'foo_bar'
+ *
+ * _.snakeCase('--foo-bar');
+ * // => 'foo_bar'
+ */
+var snakeCase = createCompounder(function(result, word, index) {
+ return result + (index ? '_' : '') + word.toLowerCase();
+});
+
+module.exports = snakeCase;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/string/startCase.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/startCase.js
new file mode 100644
index 00000000000..740d48a513c
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/startCase.js
@@ -0,0 +1,26 @@
+var createCompounder = require('../internal/createCompounder');
+
+/**
+ * Converts `string` to [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to convert.
+ * @returns {string} Returns the start cased string.
+ * @example
+ *
+ * _.startCase('--foo-bar');
+ * // => 'Foo Bar'
+ *
+ * _.startCase('fooBar');
+ * // => 'Foo Bar'
+ *
+ * _.startCase('__foo_bar__');
+ * // => 'Foo Bar'
+ */
+var startCase = createCompounder(function(result, word, index) {
+ return result + (index ? ' ' : '') + (word.charAt(0).toUpperCase() + word.slice(1));
+});
+
+module.exports = startCase;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/string/startsWith.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/startsWith.js
new file mode 100644
index 00000000000..65fae2a4622
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/startsWith.js
@@ -0,0 +1,36 @@
+var baseToString = require('../internal/baseToString');
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMin = Math.min;
+
+/**
+ * Checks if `string` starts with the given target string.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to search.
+ * @param {string} [target] The string to search for.
+ * @param {number} [position=0] The position to search from.
+ * @returns {boolean} Returns `true` if `string` starts with `target`, else `false`.
+ * @example
+ *
+ * _.startsWith('abc', 'a');
+ * // => true
+ *
+ * _.startsWith('abc', 'b');
+ * // => false
+ *
+ * _.startsWith('abc', 'b', 1);
+ * // => true
+ */
+function startsWith(string, target, position) {
+ string = baseToString(string);
+ position = position == null
+ ? 0
+ : nativeMin(position < 0 ? 0 : (+position || 0), string.length);
+
+ return string.lastIndexOf(target, position) == position;
+}
+
+module.exports = startsWith;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/string/template.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/template.js
new file mode 100644
index 00000000000..b3910481ef8
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/template.js
@@ -0,0 +1,226 @@
+var assignOwnDefaults = require('../internal/assignOwnDefaults'),
+ assignWith = require('../internal/assignWith'),
+ attempt = require('../utility/attempt'),
+ baseAssign = require('../internal/baseAssign'),
+ baseToString = require('../internal/baseToString'),
+ baseValues = require('../internal/baseValues'),
+ escapeStringChar = require('../internal/escapeStringChar'),
+ isError = require('../lang/isError'),
+ isIterateeCall = require('../internal/isIterateeCall'),
+ keys = require('../object/keys'),
+ reInterpolate = require('../internal/reInterpolate'),
+ templateSettings = require('./templateSettings');
+
+/** Used to match empty string literals in compiled template source. */
+var reEmptyStringLeading = /\b__p \+= '';/g,
+ reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
+ reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
+
+/** Used to match [ES template delimiters](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-template-literal-lexical-components). */
+var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
+
+/** Used to ensure capturing order of template delimiters. */
+var reNoMatch = /($^)/;
+
+/** Used to match unescaped characters in compiled string literals. */
+var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
+
+/**
+ * Creates a compiled template function that can interpolate data properties
+ * in "interpolate" delimiters, HTML-escape interpolated data properties in
+ * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
+ * properties may be accessed as free variables in the template. If a setting
+ * object is provided it takes precedence over `_.templateSettings` values.
+ *
+ * **Note:** In the development build `_.template` utilizes
+ * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
+ * for easier debugging.
+ *
+ * For more information on precompiling templates see
+ * [lodash's custom builds documentation](https://lodash.com/custom-builds).
+ *
+ * For more information on Chrome extension sandboxes see
+ * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The template string.
+ * @param {Object} [options] The options object.
+ * @param {RegExp} [options.escape] The HTML "escape" delimiter.
+ * @param {RegExp} [options.evaluate] The "evaluate" delimiter.
+ * @param {Object} [options.imports] An object to import into the template as free variables.
+ * @param {RegExp} [options.interpolate] The "interpolate" delimiter.
+ * @param {string} [options.sourceURL] The sourceURL of the template's compiled source.
+ * @param {string} [options.variable] The data object variable name.
+ * @param- {Object} [otherOptions] Enables the legacy `options` param signature.
+ * @returns {Function} Returns the compiled template function.
+ * @example
+ *
+ * // using the "interpolate" delimiter to create a compiled template
+ * var compiled = _.template('hello <%= user %>!');
+ * compiled({ 'user': 'fred' });
+ * // => 'hello fred!'
+ *
+ * // using the HTML "escape" delimiter to escape data property values
+ * var compiled = _.template('<b><%- value %></b>');
+ * compiled({ 'value': '<script>' });
+ * // => '<b>&lt;script&gt;</b>'
+ *
+ * // using the "evaluate" delimiter to execute JavaScript and generate HTML
+ * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
+ * compiled({ 'users': ['fred', 'barney'] });
+ * // => '<li>fred</li><li>barney</li>'
+ *
+ * // using the internal `print` function in "evaluate" delimiters
+ * var compiled = _.template('<% print("hello " + user); %>!');
+ * compiled({ 'user': 'barney' });
+ * // => 'hello barney!'
+ *
+ * // using the ES delimiter as an alternative to the default "interpolate" delimiter
+ * var compiled = _.template('hello ${ user }!');
+ * compiled({ 'user': 'pebbles' });
+ * // => 'hello pebbles!'
+ *
+ * // using custom template delimiters
+ * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
+ * var compiled = _.template('hello {{ user }}!');
+ * compiled({ 'user': 'mustache' });
+ * // => 'hello mustache!'
+ *
+ * // using backslashes to treat delimiters as plain text
+ * var compiled = _.template('<%= "\\<%- value %\\>" %>');
+ * compiled({ 'value': 'ignored' });
+ * // => '<%- value %>'
+ *
+ * // using the `imports` option to import `jQuery` as `jq`
+ * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
+ * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
+ * compiled({ 'users': ['fred', 'barney'] });
+ * // => '<li>fred</li><li>barney</li>'
+ *
+ * // using the `sourceURL` option to specify a custom sourceURL for the template
+ * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
+ * compiled(data);
+ * // => find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector
+ *
+ * // using the `variable` option to ensure a with-statement isn't used in the compiled template
+ * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
+ * compiled.source;
+ * // => function(data) {
+ * // var __t, __p = '';
+ * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
+ * // return __p;
+ * // }
+ *
+ * // using the `source` property to inline compiled templates for meaningful
+ * // line numbers in error messages and a stack trace
+ * fs.writeFileSync(path.join(cwd, 'jst.js'), '\
+ * var JST = {\
+ * "main": ' + _.template(mainText).source + '\
+ * };\
+ * ');
+ */
+function template(string, options, otherOptions) {
+ // Based on John Resig's `tmpl` implementation (http://ejohn.org/blog/javascript-micro-templating/)
+ // and Laura Doktorova's doT.js (https://github.com/olado/doT).
+ var settings = templateSettings.imports._.templateSettings || templateSettings;
+
+ if (otherOptions && isIterateeCall(string, options, otherOptions)) {
+ options = otherOptions = null;
+ }
+ string = baseToString(string);
+ options = assignWith(baseAssign({}, otherOptions || options), settings, assignOwnDefaults);
+
+ var imports = assignWith(baseAssign({}, options.imports), settings.imports, assignOwnDefaults),
+ importsKeys = keys(imports),
+ importsValues = baseValues(imports, importsKeys);
+
+ var isEscaping,
+ isEvaluating,
+ index = 0,
+ interpolate = options.interpolate || reNoMatch,
+ source = "__p += '";
+
+ // Compile the regexp to match each delimiter.
+ var reDelimiters = RegExp(
+ (options.escape || reNoMatch).source + '|' +
+ interpolate.source + '|' +
+ (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
+ (options.evaluate || reNoMatch).source + '|$'
+ , 'g');
+
+ // Use a sourceURL for easier debugging.
+ var sourceURL = 'sourceURL' in options ? '//# sourceURL=' + options.sourceURL + '\n' : '';
+
+ string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
+ interpolateValue || (interpolateValue = esTemplateValue);
+
+ // Escape characters that can't be included in string literals.
+ source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
+
+ // Replace delimiters with snippets.
+ if (escapeValue) {
+ isEscaping = true;
+ source += "' +\n__e(" + escapeValue + ") +\n'";
+ }
+ if (evaluateValue) {
+ isEvaluating = true;
+ source += "';\n" + evaluateValue + ";\n__p += '";
+ }
+ if (interpolateValue) {
+ source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
+ }
+ index = offset + match.length;
+
+ // The JS engine embedded in Adobe products requires returning the `match`
+ // string in order to produce the correct `offset` value.
+ return match;
+ });
+
+ source += "';\n";
+
+ // If `variable` is not specified wrap a with-statement around the generated
+ // code to add the data object to the top of the scope chain.
+ var variable = options.variable;
+ if (!variable) {
+ source = 'with (obj) {\n' + source + '\n}\n';
+ }
+ // Cleanup code by stripping empty strings.
+ source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
+ .replace(reEmptyStringMiddle, '$1')
+ .replace(reEmptyStringTrailing, '$1;');
+
+ // Frame code as the function body.
+ source = 'function(' + (variable || 'obj') + ') {\n' +
+ (variable
+ ? ''
+ : 'obj || (obj = {});\n'
+ ) +
+ "var __t, __p = ''" +
+ (isEscaping
+ ? ', __e = _.escape'
+ : ''
+ ) +
+ (isEvaluating
+ ? ', __j = Array.prototype.join;\n' +
+ "function print() { __p += __j.call(arguments, '') }\n"
+ : ';\n'
+ ) +
+ source +
+ 'return __p\n}';
+
+ var result = attempt(function() {
+ return Function(importsKeys, sourceURL + 'return ' + source).apply(undefined, importsValues);
+ });
+
+ // Provide the compiled function's source by its `toString` method or
+ // the `source` property as a convenience for inlining compiled templates.
+ result.source = source;
+ if (isError(result)) {
+ throw result;
+ }
+ return result;
+}
+
+module.exports = template;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/string/templateSettings.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/templateSettings.js
new file mode 100644
index 00000000000..cdcef9ba212
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/templateSettings.js
@@ -0,0 +1,67 @@
+var escape = require('./escape'),
+ reEscape = require('../internal/reEscape'),
+ reEvaluate = require('../internal/reEvaluate'),
+ reInterpolate = require('../internal/reInterpolate');
+
+/**
+ * By default, the template delimiters used by lodash are like those in
+ * embedded Ruby (ERB). Change the following template settings to use
+ * alternative delimiters.
+ *
+ * @static
+ * @memberOf _
+ * @type Object
+ */
+var templateSettings = {
+
+ /**
+ * Used to detect `data` property values to be HTML-escaped.
+ *
+ * @memberOf _.templateSettings
+ * @type RegExp
+ */
+ 'escape': reEscape,
+
+ /**
+ * Used to detect code to be evaluated.
+ *
+ * @memberOf _.templateSettings
+ * @type RegExp
+ */
+ 'evaluate': reEvaluate,
+
+ /**
+ * Used to detect `data` property values to inject.
+ *
+ * @memberOf _.templateSettings
+ * @type RegExp
+ */
+ 'interpolate': reInterpolate,
+
+ /**
+ * Used to reference the data object in the template text.
+ *
+ * @memberOf _.templateSettings
+ * @type string
+ */
+ 'variable': '',
+
+ /**
+ * Used to import variables into the compiled template.
+ *
+ * @memberOf _.templateSettings
+ * @type Object
+ */
+ 'imports': {
+
+ /**
+ * A reference to the `lodash` function.
+ *
+ * @memberOf _.templateSettings.imports
+ * @type Function
+ */
+ '_': { 'escape': escape }
+ }
+};
+
+module.exports = templateSettings;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/string/trim.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/trim.js
new file mode 100644
index 00000000000..22cd38a5b2a
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/trim.js
@@ -0,0 +1,42 @@
+var baseToString = require('../internal/baseToString'),
+ charsLeftIndex = require('../internal/charsLeftIndex'),
+ charsRightIndex = require('../internal/charsRightIndex'),
+ isIterateeCall = require('../internal/isIterateeCall'),
+ trimmedLeftIndex = require('../internal/trimmedLeftIndex'),
+ trimmedRightIndex = require('../internal/trimmedRightIndex');
+
+/**
+ * Removes leading and trailing whitespace or specified characters from `string`.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to trim.
+ * @param {string} [chars=whitespace] The characters to trim.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {string} Returns the trimmed string.
+ * @example
+ *
+ * _.trim(' abc ');
+ * // => 'abc'
+ *
+ * _.trim('-_-abc-_-', '_-');
+ * // => 'abc'
+ *
+ * _.map([' foo ', ' bar '], _.trim);
+ * // => ['foo', 'bar']
+ */
+function trim(string, chars, guard) {
+ var value = string;
+ string = baseToString(string);
+ if (!string) {
+ return string;
+ }
+ if (guard ? isIterateeCall(value, chars, guard) : chars == null) {
+ return string.slice(trimmedLeftIndex(string), trimmedRightIndex(string) + 1);
+ }
+ chars = (chars + '');
+ return string.slice(charsLeftIndex(string, chars), charsRightIndex(string, chars) + 1);
+}
+
+module.exports = trim;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/string/trimLeft.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/trimLeft.js
new file mode 100644
index 00000000000..29299677a06
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/trimLeft.js
@@ -0,0 +1,36 @@
+var baseToString = require('../internal/baseToString'),
+ charsLeftIndex = require('../internal/charsLeftIndex'),
+ isIterateeCall = require('../internal/isIterateeCall'),
+ trimmedLeftIndex = require('../internal/trimmedLeftIndex');
+
+/**
+ * Removes leading whitespace or specified characters from `string`.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to trim.
+ * @param {string} [chars=whitespace] The characters to trim.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {string} Returns the trimmed string.
+ * @example
+ *
+ * _.trimLeft(' abc ');
+ * // => 'abc '
+ *
+ * _.trimLeft('-_-abc-_-', '_-');
+ * // => 'abc-_-'
+ */
+function trimLeft(string, chars, guard) {
+ var value = string;
+ string = baseToString(string);
+ if (!string) {
+ return string;
+ }
+ if (guard ? isIterateeCall(value, chars, guard) : chars == null) {
+ return string.slice(trimmedLeftIndex(string));
+ }
+ return string.slice(charsLeftIndex(string, (chars + '')));
+}
+
+module.exports = trimLeft;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/string/trimRight.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/trimRight.js
new file mode 100644
index 00000000000..0f9be71fbe6
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/trimRight.js
@@ -0,0 +1,36 @@
+var baseToString = require('../internal/baseToString'),
+ charsRightIndex = require('../internal/charsRightIndex'),
+ isIterateeCall = require('../internal/isIterateeCall'),
+ trimmedRightIndex = require('../internal/trimmedRightIndex');
+
+/**
+ * Removes trailing whitespace or specified characters from `string`.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to trim.
+ * @param {string} [chars=whitespace] The characters to trim.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {string} Returns the trimmed string.
+ * @example
+ *
+ * _.trimRight(' abc ');
+ * // => ' abc'
+ *
+ * _.trimRight('-_-abc-_-', '_-');
+ * // => '-_-abc'
+ */
+function trimRight(string, chars, guard) {
+ var value = string;
+ string = baseToString(string);
+ if (!string) {
+ return string;
+ }
+ if (guard ? isIterateeCall(value, chars, guard) : chars == null) {
+ return string.slice(0, trimmedRightIndex(string) + 1);
+ }
+ return string.slice(0, charsRightIndex(string, (chars + '')) + 1);
+}
+
+module.exports = trimRight;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/string/trunc.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/trunc.js
new file mode 100644
index 00000000000..8d9b309b9b2
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/trunc.js
@@ -0,0 +1,105 @@
+var baseToString = require('../internal/baseToString'),
+ isIterateeCall = require('../internal/isIterateeCall'),
+ isObject = require('../lang/isObject'),
+ isRegExp = require('../lang/isRegExp');
+
+/** Used as default options for `_.trunc`. */
+var DEFAULT_TRUNC_LENGTH = 30,
+ DEFAULT_TRUNC_OMISSION = '...';
+
+/** Used to match `RegExp` flags from their coerced string values. */
+var reFlags = /\w*$/;
+
+/**
+ * Truncates `string` if it's longer than the given maximum string length.
+ * The last characters of the truncated string are replaced with the omission
+ * string which defaults to "...".
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to truncate.
+ * @param {Object|number} [options] The options object or maximum string length.
+ * @param {number} [options.length=30] The maximum string length.
+ * @param {string} [options.omission='...'] The string to indicate text is omitted.
+ * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {string} Returns the truncated string.
+ * @example
+ *
+ * _.trunc('hi-diddly-ho there, neighborino');
+ * // => 'hi-diddly-ho there, neighbo...'
+ *
+ * _.trunc('hi-diddly-ho there, neighborino', 24);
+ * // => 'hi-diddly-ho there, n...'
+ *
+ * _.trunc('hi-diddly-ho there, neighborino', {
+ * 'length': 24,
+ * 'separator': ' '
+ * });
+ * // => 'hi-diddly-ho there,...'
+ *
+ * _.trunc('hi-diddly-ho there, neighborino', {
+ * 'length': 24,
+ * 'separator': /,? +/
+ * });
+ * // => 'hi-diddly-ho there...'
+ *
+ * _.trunc('hi-diddly-ho there, neighborino', {
+ * 'omission': ' [...]'
+ * });
+ * // => 'hi-diddly-ho there, neig [...]'
+ */
+function trunc(string, options, guard) {
+ if (guard && isIterateeCall(string, options, guard)) {
+ options = null;
+ }
+ var length = DEFAULT_TRUNC_LENGTH,
+ omission = DEFAULT_TRUNC_OMISSION;
+
+ if (options != null) {
+ if (isObject(options)) {
+ var separator = 'separator' in options ? options.separator : separator;
+ length = 'length' in options ? (+options.length || 0) : length;
+ omission = 'omission' in options ? baseToString(options.omission) : omission;
+ } else {
+ length = +options || 0;
+ }
+ }
+ string = baseToString(string);
+ if (length >= string.length) {
+ return string;
+ }
+ var end = length - omission.length;
+ if (end < 1) {
+ return omission;
+ }
+ var result = string.slice(0, end);
+ if (separator == null) {
+ return result + omission;
+ }
+ if (isRegExp(separator)) {
+ if (string.slice(end).search(separator)) {
+ var match,
+ newEnd,
+ substring = string.slice(0, end);
+
+ if (!separator.global) {
+ separator = RegExp(separator.source, (reFlags.exec(separator) || '') + 'g');
+ }
+ separator.lastIndex = 0;
+ while ((match = separator.exec(substring))) {
+ newEnd = match.index;
+ }
+ result = result.slice(0, newEnd == null ? end : newEnd);
+ }
+ } else if (string.indexOf(separator, end) != end) {
+ var index = result.lastIndexOf(separator);
+ if (index > -1) {
+ result = result.slice(0, index);
+ }
+ }
+ return result + omission;
+}
+
+module.exports = trunc;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/string/unescape.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/unescape.js
new file mode 100644
index 00000000000..b0266a7ac41
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/unescape.js
@@ -0,0 +1,33 @@
+var baseToString = require('../internal/baseToString'),
+ unescapeHtmlChar = require('../internal/unescapeHtmlChar');
+
+/** Used to match HTML entities and HTML characters. */
+var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g,
+ reHasEscapedHtml = RegExp(reEscapedHtml.source);
+
+/**
+ * The inverse of `_.escape`; this method converts the HTML entities
+ * `&amp;`, `&lt;`, `&gt;`, `&quot;`, `&#39;`, and `&#96;` in `string` to their
+ * corresponding characters.
+ *
+ * **Note:** No other HTML entities are unescaped. To unescape additional HTML
+ * entities use a third-party library like [_he_](https://mths.be/he).
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to unescape.
+ * @returns {string} Returns the unescaped string.
+ * @example
+ *
+ * _.unescape('fred, barney, &amp; pebbles');
+ * // => 'fred, barney, & pebbles'
+ */
+function unescape(string) {
+ string = baseToString(string);
+ return (string && reHasEscapedHtml.test(string))
+ ? string.replace(reEscapedHtml, unescapeHtmlChar)
+ : string;
+}
+
+module.exports = unescape;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/string/words.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/words.js
new file mode 100644
index 00000000000..364e971de49
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/string/words.js
@@ -0,0 +1,38 @@
+var baseToString = require('../internal/baseToString'),
+ isIterateeCall = require('../internal/isIterateeCall');
+
+/** Used to match words to create compound words. */
+var reWords = (function() {
+ var upper = '[A-Z\\xc0-\\xd6\\xd8-\\xde]',
+ lower = '[a-z\\xdf-\\xf6\\xf8-\\xff]+';
+
+ return RegExp(upper + '+(?=' + upper + lower + ')|' + upper + '?' + lower + '|' + upper + '+|[0-9]+', 'g');
+}());
+
+/**
+ * Splits `string` into an array of its words.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to inspect.
+ * @param {RegExp|string} [pattern] The pattern to match words.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {Array} Returns the words of `string`.
+ * @example
+ *
+ * _.words('fred, barney, & pebbles');
+ * // => ['fred', 'barney', 'pebbles']
+ *
+ * _.words('fred, barney, & pebbles', /[^, ]+/g);
+ * // => ['fred', 'barney', '&', 'pebbles']
+ */
+function words(string, pattern, guard) {
+ if (guard && isIterateeCall(string, pattern, guard)) {
+ pattern = null;
+ }
+ string = baseToString(string);
+ return string.match(pattern || reWords) || [];
+}
+
+module.exports = words;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/support.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/support.js
new file mode 100644
index 00000000000..12c97f51c40
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/support.js
@@ -0,0 +1,34 @@
+/** Used to detect DOM support. */
+var document = (document = global.window) ? document.document : null;
+
+/**
+ * An object environment feature flags.
+ *
+ * @static
+ * @memberOf _
+ * @type Object
+ */
+var support = {};
+
+(function(x) {
+ var Ctor = function() { this.x = x; },
+ object = { '0': x, 'length': x },
+ props = [];
+
+ Ctor.prototype = { 'valueOf': x, 'y': x };
+ for (var key in new Ctor) { props.push(key); }
+
+ /**
+ * Detect if the DOM is supported.
+ *
+ * @memberOf _.support
+ * @type boolean
+ */
+ try {
+ support.dom = document.createDocumentFragment().nodeType === 11;
+ } catch(e) {
+ support.dom = false;
+ }
+}(1, 0));
+
+module.exports = support;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/utility.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/utility.js
new file mode 100644
index 00000000000..25311faefc3
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/utility.js
@@ -0,0 +1,18 @@
+module.exports = {
+ 'attempt': require('./utility/attempt'),
+ 'callback': require('./utility/callback'),
+ 'constant': require('./utility/constant'),
+ 'identity': require('./utility/identity'),
+ 'iteratee': require('./utility/iteratee'),
+ 'matches': require('./utility/matches'),
+ 'matchesProperty': require('./utility/matchesProperty'),
+ 'method': require('./utility/method'),
+ 'methodOf': require('./utility/methodOf'),
+ 'mixin': require('./utility/mixin'),
+ 'noop': require('./utility/noop'),
+ 'property': require('./utility/property'),
+ 'propertyOf': require('./utility/propertyOf'),
+ 'range': require('./utility/range'),
+ 'times': require('./utility/times'),
+ 'uniqueId': require('./utility/uniqueId')
+};
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/attempt.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/attempt.js
new file mode 100644
index 00000000000..80afe6924c7
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/attempt.js
@@ -0,0 +1,32 @@
+var isError = require('../lang/isError'),
+ restParam = require('../function/restParam');
+
+/**
+ * Attempts to invoke `func`, returning either the result or the caught error
+ * object. Any additional arguments are provided to `func` when it is invoked.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {Function} func The function to attempt.
+ * @returns {*} Returns the `func` result or error object.
+ * @example
+ *
+ * // avoid throwing errors for invalid selectors
+ * var elements = _.attempt(function(selector) {
+ * return document.querySelectorAll(selector);
+ * }, '>_>');
+ *
+ * if (_.isError(elements)) {
+ * elements = [];
+ * }
+ */
+var attempt = restParam(function(func, args) {
+ try {
+ return func.apply(undefined, args);
+ } catch(e) {
+ return isError(e) ? e : new Error(e);
+ }
+});
+
+module.exports = attempt;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/callback.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/callback.js
new file mode 100644
index 00000000000..d864d46c5cc
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/callback.js
@@ -0,0 +1,53 @@
+var baseCallback = require('../internal/baseCallback'),
+ isIterateeCall = require('../internal/isIterateeCall'),
+ isObjectLike = require('../internal/isObjectLike'),
+ matches = require('./matches');
+
+/**
+ * Creates a function that invokes `func` with the `this` binding of `thisArg`
+ * and arguments of the created function. If `func` is a property name the
+ * created callback returns the property value for a given element. If `func`
+ * is an object the created callback returns `true` for elements that contain
+ * the equivalent object properties, otherwise it returns `false`.
+ *
+ * @static
+ * @memberOf _
+ * @alias iteratee
+ * @category Utility
+ * @param {*} [func=_.identity] The value to convert to a callback.
+ * @param {*} [thisArg] The `this` binding of `func`.
+ * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+ * @returns {Function} Returns the callback.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36 },
+ * { 'user': 'fred', 'age': 40 }
+ * ];
+ *
+ * // wrap to create custom callback shorthands
+ * _.callback = _.wrap(_.callback, function(callback, func, thisArg) {
+ * var match = /^(.+?)__([gl]t)(.+)$/.exec(func);
+ * if (!match) {
+ * return callback(func, thisArg);
+ * }
+ * return function(object) {
+ * return match[2] == 'gt'
+ * ? object[match[1]] > match[3]
+ * : object[match[1]] < match[3];
+ * };
+ * });
+ *
+ * _.filter(users, 'age__gt36');
+ * // => [{ 'user': 'fred', 'age': 40 }]
+ */
+function callback(func, thisArg, guard) {
+ if (guard && isIterateeCall(func, thisArg, guard)) {
+ thisArg = null;
+ }
+ return isObjectLike(func)
+ ? matches(func)
+ : baseCallback(func, thisArg);
+}
+
+module.exports = callback;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/constant.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/constant.js
new file mode 100644
index 00000000000..6919b763282
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/constant.js
@@ -0,0 +1,23 @@
+/**
+ * Creates a function that returns `value`.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {*} value The value to return from the new function.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var object = { 'user': 'fred' };
+ * var getter = _.constant(object);
+ *
+ * getter() === object;
+ * // => true
+ */
+function constant(value) {
+ return function() {
+ return value;
+ };
+}
+
+module.exports = constant;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/identity.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/identity.js
new file mode 100644
index 00000000000..3a1d1d4c9cf
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/identity.js
@@ -0,0 +1,20 @@
+/**
+ * This method returns the first argument provided to it.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {*} value Any value.
+ * @returns {*} Returns `value`.
+ * @example
+ *
+ * var object = { 'user': 'fred' };
+ *
+ * _.identity(object) === object;
+ * // => true
+ */
+function identity(value) {
+ return value;
+}
+
+module.exports = identity;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/iteratee.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/iteratee.js
new file mode 100644
index 00000000000..fcfa2021052
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/iteratee.js
@@ -0,0 +1 @@
+module.exports = require('./callback');
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/matches.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/matches.js
new file mode 100644
index 00000000000..a182637bdb5
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/matches.js
@@ -0,0 +1,33 @@
+var baseClone = require('../internal/baseClone'),
+ baseMatches = require('../internal/baseMatches');
+
+/**
+ * Creates a function that performs a deep comparison between a given object
+ * and `source`, returning `true` if the given object has equivalent property
+ * values, else `false`.
+ *
+ * **Note:** This method supports comparing arrays, booleans, `Date` objects,
+ * numbers, `Object` objects, regexes, and strings. Objects are compared by
+ * their own, not inherited, enumerable properties. For comparing a single
+ * own or inherited property value see `_.matchesProperty`.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {Object} source The object of property values to match.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36, 'active': true },
+ * { 'user': 'fred', 'age': 40, 'active': false }
+ * ];
+ *
+ * _.filter(users, _.matches({ 'age': 40, 'active': false }));
+ * // => [{ 'user': 'fred', 'age': 40, 'active': false }]
+ */
+function matches(source) {
+ return baseMatches(baseClone(source, true));
+}
+
+module.exports = matches;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/matchesProperty.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/matchesProperty.js
new file mode 100644
index 00000000000..91e51a56cbf
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/matchesProperty.js
@@ -0,0 +1,32 @@
+var baseClone = require('../internal/baseClone'),
+ baseMatchesProperty = require('../internal/baseMatchesProperty');
+
+/**
+ * Creates a function that compares the property value of `path` on a given
+ * object to `value`.
+ *
+ * **Note:** This method supports comparing arrays, booleans, `Date` objects,
+ * numbers, `Object` objects, regexes, and strings. Objects are compared by
+ * their own, not inherited, enumerable properties.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {Array|string} path The path of the property to get.
+ * @param {*} srcValue The value to match.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney' },
+ * { 'user': 'fred' }
+ * ];
+ *
+ * _.find(users, _.matchesProperty('user', 'fred'));
+ * // => { 'user': 'fred' }
+ */
+function matchesProperty(path, srcValue) {
+ return baseMatchesProperty(path, baseClone(srcValue, true));
+}
+
+module.exports = matchesProperty;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/method.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/method.js
new file mode 100644
index 00000000000..e315b7f355c
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/method.js
@@ -0,0 +1,33 @@
+var invokePath = require('../internal/invokePath'),
+ restParam = require('../function/restParam');
+
+/**
+ * Creates a function that invokes the method at `path` on a given object.
+ * Any additional arguments are provided to the invoked method.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {Array|string} path The path of the method to invoke.
+ * @param {...*} [args] The arguments to invoke the method with.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var objects = [
+ * { 'a': { 'b': { 'c': _.constant(2) } } },
+ * { 'a': { 'b': { 'c': _.constant(1) } } }
+ * ];
+ *
+ * _.map(objects, _.method('a.b.c'));
+ * // => [2, 1]
+ *
+ * _.invoke(_.sortBy(objects, _.method(['a', 'b', 'c'])), 'a.b.c');
+ * // => [1, 2]
+ */
+var method = restParam(function(path, args) {
+ return function(object) {
+ return invokePath(object, path, args);
+ };
+});
+
+module.exports = method;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/methodOf.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/methodOf.js
new file mode 100644
index 00000000000..f61b7822723
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/methodOf.js
@@ -0,0 +1,32 @@
+var invokePath = require('../internal/invokePath'),
+ restParam = require('../function/restParam');
+
+/**
+ * The opposite of `_.method`; this method creates a function that invokes
+ * the method at a given path on `object`. Any additional arguments are
+ * provided to the invoked method.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {Object} object The object to query.
+ * @param {...*} [args] The arguments to invoke the method with.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var array = _.times(3, _.constant),
+ * object = { 'a': array, 'b': array, 'c': array };
+ *
+ * _.map(['a[2]', 'c[0]'], _.methodOf(object));
+ * // => [2, 0]
+ *
+ * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
+ * // => [2, 0]
+ */
+var methodOf = restParam(function(object, args) {
+ return function(path) {
+ return invokePath(object, path, args);
+ };
+});
+
+module.exports = methodOf;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/mixin.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/mixin.js
new file mode 100644
index 00000000000..1340464b42c
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/mixin.js
@@ -0,0 +1,89 @@
+var arrayCopy = require('../internal/arrayCopy'),
+ baseFunctions = require('../internal/baseFunctions'),
+ isFunction = require('../lang/isFunction'),
+ isObject = require('../lang/isObject'),
+ keys = require('../object/keys');
+
+/** Used for native method references. */
+var arrayProto = Array.prototype;
+
+/** Native method references. */
+var push = arrayProto.push;
+
+/**
+ * Adds all own enumerable function properties of a source object to the
+ * destination object. If `object` is a function then methods are added to
+ * its prototype as well.
+ *
+ * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
+ * avoid conflicts caused by modifying the original.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {Function|Object} [object=lodash] The destination object.
+ * @param {Object} source The object of functions to add.
+ * @param {Object} [options] The options object.
+ * @param {boolean} [options.chain=true] Specify whether the functions added
+ * are chainable.
+ * @returns {Function|Object} Returns `object`.
+ * @example
+ *
+ * function vowels(string) {
+ * return _.filter(string, function(v) {
+ * return /[aeiou]/i.test(v);
+ * });
+ * }
+ *
+ * _.mixin({ 'vowels': vowels });
+ * _.vowels('fred');
+ * // => ['e']
+ *
+ * _('fred').vowels().value();
+ * // => ['e']
+ *
+ * _.mixin({ 'vowels': vowels }, { 'chain': false });
+ * _('fred').vowels();
+ * // => ['e']
+ */
+function mixin(object, source, options) {
+ var methodNames = baseFunctions(source, keys(source));
+
+ var chain = true,
+ index = -1,
+ isFunc = isFunction(object),
+ length = methodNames.length;
+
+ if (options === false) {
+ chain = false;
+ } else if (isObject(options) && 'chain' in options) {
+ chain = options.chain;
+ }
+ while (++index < length) {
+ var methodName = methodNames[index],
+ func = source[methodName];
+
+ object[methodName] = func;
+ if (isFunc) {
+ object.prototype[methodName] = (function(func) {
+ return function() {
+ var chainAll = this.__chain__;
+ if (chain || chainAll) {
+ var result = object(this.__wrapped__),
+ actions = result.__actions__ = arrayCopy(this.__actions__);
+
+ actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
+ result.__chain__ = chainAll;
+ return result;
+ }
+ var args = [this.value()];
+ push.apply(args, arguments);
+ return func.apply(object, args);
+ };
+ }(func));
+ }
+ }
+ return object;
+}
+
+module.exports = mixin;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/noop.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/noop.js
new file mode 100644
index 00000000000..56d651344aa
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/noop.js
@@ -0,0 +1,19 @@
+/**
+ * A no-operation function that returns `undefined` regardless of the
+ * arguments it receives.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @example
+ *
+ * var object = { 'user': 'fred' };
+ *
+ * _.noop(object) === undefined;
+ * // => true
+ */
+function noop() {
+ // No operation performed.
+}
+
+module.exports = noop;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/property.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/property.js
new file mode 100644
index 00000000000..ddfd59798fa
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/property.js
@@ -0,0 +1,31 @@
+var baseProperty = require('../internal/baseProperty'),
+ basePropertyDeep = require('../internal/basePropertyDeep'),
+ isKey = require('../internal/isKey');
+
+/**
+ * Creates a function that returns the property value at `path` on a
+ * given object.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {Array|string} path The path of the property to get.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var objects = [
+ * { 'a': { 'b': { 'c': 2 } } },
+ * { 'a': { 'b': { 'c': 1 } } }
+ * ];
+ *
+ * _.map(objects, _.property('a.b.c'));
+ * // => [2, 1]
+ *
+ * _.pluck(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c');
+ * // => [1, 2]
+ */
+function property(path) {
+ return isKey(path) ? baseProperty(path) : basePropertyDeep(path);
+}
+
+module.exports = property;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/propertyOf.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/propertyOf.js
new file mode 100644
index 00000000000..093c65978b1
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/propertyOf.js
@@ -0,0 +1,30 @@
+var baseGet = require('../internal/baseGet'),
+ toPath = require('../internal/toPath');
+
+/**
+ * The opposite of `_.property`; this method creates a function that returns
+ * the property value at a given path on `object`.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {Object} object The object to query.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var array = [0, 1, 2],
+ * object = { 'a': array, 'b': array, 'c': array };
+ *
+ * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
+ * // => [2, 0]
+ *
+ * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
+ * // => [2, 0]
+ */
+function propertyOf(object) {
+ return function(path) {
+ return baseGet(object, toPath(path), path + '');
+ };
+}
+
+module.exports = propertyOf;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/range.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/range.js
new file mode 100644
index 00000000000..fad70a42f72
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/range.js
@@ -0,0 +1,68 @@
+var isIterateeCall = require('../internal/isIterateeCall');
+
+/** Native method references. */
+var ceil = Math.ceil;
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max;
+
+/**
+ * Creates an array of numbers (positive and/or negative) progressing from
+ * `start` up to, but not including, `end`. If `end` is not specified it is
+ * set to `start` with `start` then set to `0`. If `end` is less than `start`
+ * a zero-length range is created unless a negative `step` is specified.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {number} [start=0] The start of the range.
+ * @param {number} end The end of the range.
+ * @param {number} [step=1] The value to increment or decrement by.
+ * @returns {Array} Returns the new array of numbers.
+ * @example
+ *
+ * _.range(4);
+ * // => [0, 1, 2, 3]
+ *
+ * _.range(1, 5);
+ * // => [1, 2, 3, 4]
+ *
+ * _.range(0, 20, 5);
+ * // => [0, 5, 10, 15]
+ *
+ * _.range(0, -4, -1);
+ * // => [0, -1, -2, -3]
+ *
+ * _.range(1, 4, 0);
+ * // => [1, 1, 1]
+ *
+ * _.range(0);
+ * // => []
+ */
+function range(start, end, step) {
+ if (step && isIterateeCall(start, end, step)) {
+ end = step = null;
+ }
+ start = +start || 0;
+ step = step == null ? 1 : (+step || 0);
+
+ if (end == null) {
+ end = start;
+ start = 0;
+ } else {
+ end = +end || 0;
+ }
+ // Use `Array(length)` so engines like Chakra and V8 avoid slower modes.
+ // See https://youtu.be/XAqIpGU8ZZk#t=17m25s for more details.
+ var index = -1,
+ length = nativeMax(ceil((end - start) / (step || 1)), 0),
+ result = Array(length);
+
+ while (++index < length) {
+ result[index] = start;
+ start += step;
+ }
+ return result;
+}
+
+module.exports = range;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/times.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/times.js
new file mode 100644
index 00000000000..dba31290156
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/times.js
@@ -0,0 +1,62 @@
+var bindCallback = require('../internal/bindCallback');
+
+/** Native method references. */
+var floor = Math.floor;
+
+/* Native method references for those with the same name as other `lodash` methods. */
+var nativeIsFinite = global.isFinite,
+ nativeMin = Math.min;
+
+/** Used as references for the maximum length and index of an array. */
+var MAX_ARRAY_LENGTH = 4294967295;
+
+/**
+ * Invokes the iteratee function `n` times, returning an array of the results
+ * of each invocation. The `iteratee` is bound to `thisArg` and invoked with
+ * one argument; (index).
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {number} n The number of times to invoke `iteratee`.
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+ * @param {*} [thisArg] The `this` binding of `iteratee`.
+ * @returns {Array} Returns the array of results.
+ * @example
+ *
+ * var diceRolls = _.times(3, _.partial(_.random, 1, 6, false));
+ * // => [3, 6, 4]
+ *
+ * _.times(3, function(n) {
+ * mage.castSpell(n);
+ * });
+ * // => invokes `mage.castSpell(n)` three times with `n` of `0`, `1`, and `2`
+ *
+ * _.times(3, function(n) {
+ * this.cast(n);
+ * }, mage);
+ * // => also invokes `mage.castSpell(n)` three times
+ */
+function times(n, iteratee, thisArg) {
+ n = floor(n);
+
+ // Exit early to avoid a JSC JIT bug in Safari 8
+ // where `Array(0)` is treated as `Array(1)`.
+ if (n < 1 || !nativeIsFinite(n)) {
+ return [];
+ }
+ var index = -1,
+ result = Array(nativeMin(n, MAX_ARRAY_LENGTH));
+
+ iteratee = bindCallback(iteratee, thisArg, 1);
+ while (++index < n) {
+ if (index < MAX_ARRAY_LENGTH) {
+ result[index] = iteratee(index);
+ } else {
+ iteratee(index);
+ }
+ }
+ return result;
+}
+
+module.exports = times;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/uniqueId.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/uniqueId.js
new file mode 100644
index 00000000000..88e02bf300a
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/lodash/utility/uniqueId.js
@@ -0,0 +1,27 @@
+var baseToString = require('../internal/baseToString');
+
+/** Used to generate unique IDs. */
+var idCounter = 0;
+
+/**
+ * Generates a unique ID. If `prefix` is provided the ID is appended to it.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {string} [prefix] The value to prefix the ID with.
+ * @returns {string} Returns the unique ID.
+ * @example
+ *
+ * _.uniqueId('contact_');
+ * // => 'contact_104'
+ *
+ * _.uniqueId();
+ * // => '105'
+ */
+function uniqueId(prefix) {
+ var id = ++idCounter;
+ return baseToString(prefix) + id;
+}
+
+module.exports = uniqueId;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/readline2/README.md b/tools/eslint/node_modules/inquirer/node_modules/readline2/README.md
new file mode 100644
index 00000000000..a4ae0ba4778
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/readline2/README.md
@@ -0,0 +1,32 @@
+readline2 [![Build Status](https://travis-ci.org/SBoudrias/readline2.png?branch=master)](https://travis-ci.org/SBoudrias/readline2)
+=========
+
+Node.js (v0.8 and v0.10) had some bugs and issues with the default [Readline](http://nodejs.org/api/readline.html) module.
+
+This module include fixes seen in later version (0.11) and ease some undesirable behavior one could see using the readline to create interatives prompts. This means `readline2` change some behaviors and as so is **not** meant to be a drop-in replacement.
+
+This project is extracted from the core of [Inquirer.js interactive prompt interface](https://github.com/SBoudrias/Inquirer.js) to be available as a standalone module.
+
+
+Documentation
+-------------
+
+**Installation**: `npm install --save readline2`
+
+### readline2.createInterface( options ); -> {Interface}
+
+Present the same API as [Node.js `readline.createInterface()`](http://nodejs.org/api/readline.html)
+
+#### Improvements
+- Default `options.input` as `process.stdin`
+- Default `options.output` as `process.stdout`
+- `interface.stdout` is wrapped in a [MuteStream](https://github.com/isaacs/mute-stream)
+- Prevent `up` and `down` keys from moving through history inside the readline
+- Fix cursor position after a line refresh when the `Interface` prompt contains ANSI colors
+
+
+License
+-------------
+
+Copyright (c) 2012 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))
+Licensed under the MIT license.
diff --git a/tools/eslint/node_modules/inquirer/node_modules/readline2/index.js b/tools/eslint/node_modules/inquirer/node_modules/readline2/index.js
new file mode 100644
index 00000000000..023e7f1b133
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/readline2/index.js
@@ -0,0 +1,171 @@
+/**
+ * Readline API façade to fix some issues
+ * @Note: May look a bit like Monkey patching... if you know a better way let me know.
+ */
+
+"use strict";
+var readline = require("readline");
+var MuteStream = require("mute-stream");
+var stripAnsi = require("strip-ansi");
+
+
+/**
+ * Module export
+ */
+
+var Interface = module.exports = {};
+
+
+/**
+ * Create a readline interface
+ * @param {Object} opt Readline option hash
+ * @return {readline} the new readline interface
+ */
+
+Interface.createInterface = function( opt ) {
+ opt || (opt = {});
+ var filteredOpt = opt;
+
+ // Default `input` to stdin
+ filteredOpt.input = opt.input || process.stdin;
+
+ // Add mute capabilities to the output
+ var ms = new MuteStream();
+ ms.pipe( opt.output || process.stdout );
+ filteredOpt.output = ms;
+
+ // Create the readline
+ var rl = readline.createInterface( filteredOpt );
+
+ // Fix bug with refreshLine
+ var _refreshLine = rl._refreshLine;
+ rl._refreshLine = function() {
+ _refreshLine.call(rl);
+
+ var line = this._prompt + this.line;
+ var cursorPos = this._getCursorPos();
+
+ readline.moveCursor(this.output, -line.length, 0);
+ readline.moveCursor(this.output, cursorPos.cols, 0);
+ };
+
+ // Returns current cursor's position and line
+ rl._getCursorPos = function() {
+ var columns = this.columns;
+ var strBeforeCursor = this._prompt + this.line.substring(0, this.cursor);
+ var dispPos = this._getDisplayPos(strBeforeCursor);
+ var cols = dispPos.cols;
+ var rows = dispPos.rows;
+ // If the cursor is on a full-width character which steps over the line,
+ // move the cursor to the beginning of the next line.
+ if (cols + 1 === columns &&
+ this.cursor < this.line.length &&
+ isFullWidthCodePoint(codePointAt(this.line, this.cursor))) {
+ rows++;
+ cols = 0;
+ }
+ return {cols: cols, rows: rows};
+ };
+
+ // Returns the last character's display position of the given string
+ rl._getDisplayPos = function(str) {
+ var offset = 0;
+ var col = this.columns;
+ var code;
+ str = stripAnsi(str);
+ for (var i = 0, len = str.length; i < len; i++) {
+ code = codePointAt(str, i);
+ if (code >= 0x10000) { // surrogates
+ i++;
+ }
+ if (isFullWidthCodePoint(code)) {
+ if ((offset + 1) % col === 0) {
+ offset++;
+ }
+ offset += 2;
+ } else {
+ offset++;
+ }
+ }
+ var cols = offset % col;
+ var rows = (offset - cols) / col;
+ return {cols: cols, rows: rows};
+ };
+
+ // Prevent arrows from breaking the question line
+ var origWrite = rl._ttyWrite;
+ rl._ttyWrite = function( s, key ) {
+ key || (key = {});
+
+ if ( key.name === "up" ) return;
+ if ( key.name === "down" ) return;
+
+ origWrite.apply( this, arguments );
+ };
+
+ return rl;
+};
+
+/**
+ * Returns the Unicode code point for the character at the
+ * given index in the given string. Similar to String.charCodeAt(),
+ * but this function handles surrogates (code point >= 0x10000).
+ */
+
+function codePointAt(str, index) {
+ var code = str.charCodeAt(index);
+ var low;
+ if (0xd800 <= code && code <= 0xdbff) { // High surrogate
+ low = str.charCodeAt(index + 1);
+ if (!isNaN(low)) {
+ code = 0x10000 + (code - 0xd800) * 0x400 + (low - 0xdc00);
+ }
+ }
+ return code;
+}
+
+/**
+ * Returns true if the character represented by a given
+ * Unicode code point is full-width. Otherwise returns false.
+ */
+
+function isFullWidthCodePoint(code) {
+ if (isNaN(code)) {
+ return false;
+ }
+
+ // Code points are derived from:
+ // http://www.unicode.org/Public/UNIDATA/EastAsianWidth.txt
+ if (code >= 0x1100 && (
+ code <= 0x115f || // Hangul Jamo
+ 0x2329 === code || // LEFT-POINTING ANGLE BRACKET
+ 0x232a === code || // RIGHT-POINTING ANGLE BRACKET
+ // CJK Radicals Supplement .. Enclosed CJK Letters and Months
+ (0x2e80 <= code && code <= 0x3247 && code !== 0x303f) ||
+ // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A
+ 0x3250 <= code && code <= 0x4dbf ||
+ // CJK Unified Ideographs .. Yi Radicals
+ 0x4e00 <= code && code <= 0xa4c6 ||
+ // Hangul Jamo Extended-A
+ 0xa960 <= code && code <= 0xa97c ||
+ // Hangul Syllables
+ 0xac00 <= code && code <= 0xd7a3 ||
+ // CJK Compatibility Ideographs
+ 0xf900 <= code && code <= 0xfaff ||
+ // Vertical Forms
+ 0xfe10 <= code && code <= 0xfe19 ||
+ // CJK Compatibility Forms .. Small Form Variants
+ 0xfe30 <= code && code <= 0xfe6b ||
+ // Halfwidth and Fullwidth Forms
+ 0xff01 <= code && code <= 0xff60 ||
+ 0xffe0 <= code && code <= 0xffe6 ||
+ // Kana Supplement
+ 0x1b000 <= code && code <= 0x1b001 ||
+ // Enclosed Ideographic Supplement
+ 0x1f200 <= code && code <= 0x1f251 ||
+ // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
+ 0x20000 <= code && code <= 0x3fffd)) {
+ return true;
+ }
+ return false;
+}
diff --git a/tools/eslint/node_modules/inquirer/node_modules/readline2/node_modules/.bin/strip-ansi b/tools/eslint/node_modules/inquirer/node_modules/readline2/node_modules/.bin/strip-ansi
new file mode 120000
index 00000000000..b65c9f81df9
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/readline2/node_modules/.bin/strip-ansi
@@ -0,0 +1 @@
+../strip-ansi/cli.js \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/node_modules/readline2/node_modules/mute-stream/LICENSE b/tools/eslint/node_modules/inquirer/node_modules/readline2/node_modules/mute-stream/LICENSE
new file mode 100644
index 00000000000..0c44ae716db
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/readline2/node_modules/mute-stream/LICENSE
@@ -0,0 +1,27 @@
+Copyright (c) Isaac Z. Schlueter ("Author")
+All rights reserved.
+
+The BSD License
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/tools/eslint/node_modules/inquirer/node_modules/readline2/node_modules/mute-stream/README.md b/tools/eslint/node_modules/inquirer/node_modules/readline2/node_modules/mute-stream/README.md
new file mode 100644
index 00000000000..8ab1238e46d
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/readline2/node_modules/mute-stream/README.md
@@ -0,0 +1,68 @@
+# mute-stream
+
+Bytes go in, but they don't come out (when muted).
+
+This is a basic pass-through stream, but when muted, the bytes are
+silently dropped, rather than being passed through.
+
+## Usage
+
+```javascript
+var MuteStream = require('mute-stream')
+
+var ms = new MuteStream(options)
+
+ms.pipe(process.stdout)
+ms.write('foo') // writes 'foo' to stdout
+ms.mute()
+ms.write('bar') // does not write 'bar'
+ms.unmute()
+ms.write('baz') // writes 'baz' to stdout
+
+// can also be used to mute incoming data
+var ms = new MuteStream
+input.pipe(ms)
+
+ms.on('data', function (c) {
+ console.log('data: ' + c)
+})
+
+input.emit('data', 'foo') // logs 'foo'
+ms.mute()
+input.emit('data', 'bar') // does not log 'bar'
+ms.unmute()
+input.emit('data', 'baz') // logs 'baz'
+```
+
+## Options
+
+All options are optional.
+
+* `replace` Set to a string to replace each character with the
+ specified string when muted. (So you can show `****` instead of the
+ password, for example.)
+
+* `prompt` If you are using a replacement char, and also using a
+ prompt with a readline stream (as for a `Password: *****` input),
+ then specify what the prompt is so that backspace will work
+ properly. Otherwise, pressing backspace will overwrite the prompt
+ with the replacement character, which is weird.
+
+## ms.mute()
+
+Set `muted` to `true`. Turns `.write()` into a no-op.
+
+## ms.unmute()
+
+Set `muted` to `false`
+
+## ms.isTTY
+
+True if the pipe destination is a TTY, or if the incoming pipe source is
+a TTY.
+
+## Other stream methods...
+
+The other standard readable and writable stream methods are all
+available. The MuteStream object acts as a facade to its pipe source
+and destination.
diff --git a/tools/eslint/node_modules/inquirer/node_modules/readline2/node_modules/mute-stream/mute.js b/tools/eslint/node_modules/inquirer/node_modules/readline2/node_modules/mute-stream/mute.js
new file mode 100644
index 00000000000..42eac31e1af
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/readline2/node_modules/mute-stream/mute.js
@@ -0,0 +1,140 @@
+var Stream = require('stream')
+
+module.exports = MuteStream
+
+// var out = new MuteStream(process.stdout)
+// argument auto-pipes
+function MuteStream (opts) {
+ Stream.apply(this)
+ opts = opts || {}
+ this.writable = this.readable = true
+ this.muted = false
+ this.on('pipe', this._onpipe)
+ this.replace = opts.replace
+
+ // For readline-type situations
+ // This much at the start of a line being redrawn after a ctrl char
+ // is seen (such as backspace) won't be redrawn as the replacement
+ this._prompt = opts.prompt || null
+ this._hadControl = false
+}
+
+MuteStream.prototype = Object.create(Stream.prototype)
+
+Object.defineProperty(MuteStream.prototype, 'constructor', {
+ value: MuteStream,
+ enumerable: false
+})
+
+MuteStream.prototype.mute = function () {
+ this.muted = true
+}
+
+MuteStream.prototype.unmute = function () {
+ this.muted = false
+}
+
+Object.defineProperty(MuteStream.prototype, '_onpipe', {
+ value: onPipe,
+ enumerable: false,
+ writable: true,
+ configurable: true
+})
+
+function onPipe (src) {
+ this._src = src
+}
+
+Object.defineProperty(MuteStream.prototype, 'isTTY', {
+ get: getIsTTY,
+ set: setIsTTY,
+ enumerable: true,
+ configurable: true
+})
+
+function getIsTTY () {
+ return( (this._dest) ? this._dest.isTTY
+ : (this._src) ? this._src.isTTY
+ : false
+ )
+}
+
+// basically just get replace the getter/setter with a regular value
+function setIsTTY (isTTY) {
+ Object.defineProperty(this, 'isTTY', {
+ value: isTTY,
+ enumerable: true,
+ writable: true,
+ configurable: true
+ })
+}
+
+Object.defineProperty(MuteStream.prototype, 'rows', {
+ get: function () {
+ return( this._dest ? this._dest.rows
+ : this._src ? this._src.rows
+ : undefined )
+ }, enumerable: true, configurable: true })
+
+Object.defineProperty(MuteStream.prototype, 'columns', {
+ get: function () {
+ return( this._dest ? this._dest.columns
+ : this._src ? this._src.columns
+ : undefined )
+ }, enumerable: true, configurable: true })
+
+
+MuteStream.prototype.pipe = function (dest) {
+ this._dest = dest
+ return Stream.prototype.pipe.call(this, dest)
+}
+
+MuteStream.prototype.pause = function () {
+ if (this._src) return this._src.pause()
+}
+
+MuteStream.prototype.resume = function () {
+ if (this._src) return this._src.resume()
+}
+
+MuteStream.prototype.write = function (c) {
+ if (this.muted) {
+ if (!this.replace) return true
+ if (c.match(/^\u001b/)) {
+ this._hadControl = true
+ return this.emit('data', c)
+ } else {
+ if (this._prompt && this._hadControl &&
+ c.indexOf(this._prompt) === 0) {
+ this._hadControl = false
+ this.emit('data', this._prompt)
+ c = c.substr(this._prompt.length)
+ }
+ c = c.toString().replace(/./g, this.replace)
+ }
+ }
+ this.emit('data', c)
+}
+
+MuteStream.prototype.end = function (c) {
+ if (this.muted) {
+ if (c && this.replace) {
+ c = c.toString().replace(/./g, this.replace)
+ } else {
+ c = null
+ }
+ }
+ if (c) this.emit('data', c)
+ this.emit('end')
+}
+
+function proxy (fn) { return function () {
+ var d = this._dest
+ var s = this._src
+ if (d && d[fn]) d[fn].apply(d, arguments)
+ if (s && s[fn]) s[fn].apply(s, arguments)
+}}
+
+MuteStream.prototype.destroy = proxy('destroy')
+MuteStream.prototype.destroySoon = proxy('destroySoon')
+MuteStream.prototype.close = proxy('close')
diff --git a/tools/eslint/node_modules/inquirer/node_modules/readline2/node_modules/mute-stream/package.json b/tools/eslint/node_modules/inquirer/node_modules/readline2/node_modules/mute-stream/package.json
new file mode 100644
index 00000000000..2623c7700c5
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/readline2/node_modules/mute-stream/package.json
@@ -0,0 +1,55 @@
+{
+ "name": "mute-stream",
+ "version": "0.0.4",
+ "main": "mute.js",
+ "directories": {
+ "test": "test"
+ },
+ "devDependencies": {
+ "tap": "~0.2.5"
+ },
+ "scripts": {
+ "test": "tap test/*.js"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/isaacs/mute-stream.git"
+ },
+ "keywords": [
+ "mute",
+ "stream",
+ "pipe"
+ ],
+ "author": {
+ "name": "Isaac Z. Schlueter",
+ "email": "i@izs.me",
+ "url": "http://blog.izs.me/"
+ },
+ "license": "BSD",
+ "description": "Bytes go in, but they don't come out (when muted).",
+ "bugs": {
+ "url": "https://github.com/isaacs/mute-stream/issues"
+ },
+ "_id": "mute-stream@0.0.4",
+ "dist": {
+ "shasum": "a9219960a6d5d5d046597aee51252c6655f7177e",
+ "tarball": "http://registry.npmjs.org/mute-stream/-/mute-stream-0.0.4.tgz"
+ },
+ "_from": "mute-stream@0.0.4",
+ "_npmVersion": "1.3.4",
+ "_npmUser": {
+ "name": "isaacs",
+ "email": "i@izs.me"
+ },
+ "maintainers": [
+ {
+ "name": "isaacs",
+ "email": "i@izs.me"
+ }
+ ],
+ "_shasum": "a9219960a6d5d5d046597aee51252c6655f7177e",
+ "_resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.4.tgz",
+ "readme": "# mute-stream\n\nBytes go in, but they don't come out (when muted).\n\nThis is a basic pass-through stream, but when muted, the bytes are\nsilently dropped, rather than being passed through.\n\n## Usage\n\n```javascript\nvar MuteStream = require('mute-stream')\n\nvar ms = new MuteStream(options)\n\nms.pipe(process.stdout)\nms.write('foo') // writes 'foo' to stdout\nms.mute()\nms.write('bar') // does not write 'bar'\nms.unmute()\nms.write('baz') // writes 'baz' to stdout\n\n// can also be used to mute incoming data\nvar ms = new MuteStream\ninput.pipe(ms)\n\nms.on('data', function (c) {\n console.log('data: ' + c)\n})\n\ninput.emit('data', 'foo') // logs 'foo'\nms.mute()\ninput.emit('data', 'bar') // does not log 'bar'\nms.unmute()\ninput.emit('data', 'baz') // logs 'baz'\n```\n\n## Options\n\nAll options are optional.\n\n* `replace` Set to a string to replace each character with the\n specified string when muted. (So you can show `****` instead of the\n password, for example.)\n\n* `prompt` If you are using a replacement char, and also using a\n prompt with a readline stream (as for a `Password: *****` input),\n then specify what the prompt is so that backspace will work\n properly. Otherwise, pressing backspace will overwrite the prompt\n with the replacement character, which is weird.\n\n## ms.mute()\n\nSet `muted` to `true`. Turns `.write()` into a no-op.\n\n## ms.unmute()\n\nSet `muted` to `false`\n\n## ms.isTTY\n\nTrue if the pipe destination is a TTY, or if the incoming pipe source is\na TTY.\n\n## Other stream methods...\n\nThe other standard readable and writable stream methods are all\navailable. The MuteStream object acts as a facade to its pipe source\nand destination.\n",
+ "readmeFilename": "README.md",
+ "homepage": "https://github.com/isaacs/mute-stream#readme"
+}
diff --git a/tools/eslint/node_modules/inquirer/node_modules/readline2/node_modules/mute-stream/test/basic.js b/tools/eslint/node_modules/inquirer/node_modules/readline2/node_modules/mute-stream/test/basic.js
new file mode 100644
index 00000000000..41f9e10c385
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/readline2/node_modules/mute-stream/test/basic.js
@@ -0,0 +1,207 @@
+var Stream = require('stream')
+var tap = require('tap')
+var MS = require('../mute.js')
+
+// some marker objects
+var END = {}
+var PAUSE = {}
+var RESUME = {}
+
+function PassThrough () {
+ Stream.call(this)
+ this.readable = this.writable = true
+}
+
+PassThrough.prototype = Object.create(Stream.prototype, {
+ constructor: {
+ value: PassThrough
+ },
+ write: {
+ value: function (c) {
+ this.emit('data', c)
+ return true
+ }
+ },
+ end: {
+ value: function (c) {
+ if (c) this.write(c)
+ this.emit('end')
+ }
+ },
+ pause: {
+ value: function () {
+ this.emit('pause')
+ }
+ },
+ resume: {
+ value: function () {
+ this.emit('resume')
+ }
+ }
+})
+
+tap.test('incoming', function (t) {
+ var ms = new MS
+ var str = new PassThrough
+ str.pipe(ms)
+
+ var expect = ['foo', 'boo', END]
+ ms.on('data', function (c) {
+ t.equal(c, expect.shift())
+ })
+ ms.on('end', function () {
+ t.equal(END, expect.shift())
+ t.end()
+ })
+ str.write('foo')
+ ms.mute()
+ str.write('bar')
+ ms.unmute()
+ str.write('boo')
+ ms.mute()
+ str.write('blaz')
+ str.end('grelb')
+})
+
+tap.test('outgoing', function (t) {
+ var ms = new MS
+ var str = new PassThrough
+ ms.pipe(str)
+
+ var expect = ['foo', 'boo', END]
+ str.on('data', function (c) {
+ t.equal(c, expect.shift())
+ })
+ str.on('end', function () {
+ t.equal(END, expect.shift())
+ t.end()
+ })
+
+ ms.write('foo')
+ ms.mute()
+ ms.write('bar')
+ ms.unmute()
+ ms.write('boo')
+ ms.mute()
+ ms.write('blaz')
+ ms.end('grelb')
+})
+
+tap.test('isTTY', function (t) {
+ var str = new PassThrough
+ str.isTTY = true
+ str.columns=80
+ str.rows=24
+
+ var ms = new MS
+ t.equal(ms.isTTY, false)
+ t.equal(ms.columns, undefined)
+ t.equal(ms.rows, undefined)
+ ms.pipe(str)
+ t.equal(ms.isTTY, true)
+ t.equal(ms.columns, 80)
+ t.equal(ms.rows, 24)
+ str.isTTY = false
+ t.equal(ms.isTTY, false)
+ t.equal(ms.columns, 80)
+ t.equal(ms.rows, 24)
+ str.isTTY = true
+ t.equal(ms.isTTY, true)
+ t.equal(ms.columns, 80)
+ t.equal(ms.rows, 24)
+ ms.isTTY = false
+ t.equal(ms.isTTY, false)
+ t.equal(ms.columns, 80)
+ t.equal(ms.rows, 24)
+
+ ms = new MS
+ t.equal(ms.isTTY, false)
+ str.pipe(ms)
+ t.equal(ms.isTTY, true)
+ str.isTTY = false
+ t.equal(ms.isTTY, false)
+ str.isTTY = true
+ t.equal(ms.isTTY, true)
+ ms.isTTY = false
+ t.equal(ms.isTTY, false)
+
+ t.end()
+})
+
+tap.test('pause/resume incoming', function (t) {
+ var str = new PassThrough
+ var ms = new MS
+ str.on('pause', function () {
+ t.equal(PAUSE, expect.shift())
+ })
+ str.on('resume', function () {
+ t.equal(RESUME, expect.shift())
+ })
+ var expect = [PAUSE, RESUME, PAUSE, RESUME]
+ str.pipe(ms)
+ ms.pause()
+ ms.resume()
+ ms.pause()
+ ms.resume()
+ t.equal(expect.length, 0, 'saw all events')
+ t.end()
+})
+
+tap.test('replace with *', function (t) {
+ var str = new PassThrough
+ var ms = new MS({replace: '*'})
+ str.pipe(ms)
+ var expect = ['foo', '*****', 'bar', '***', 'baz', 'boo', '**', '****']
+
+ ms.on('data', function (c) {
+ t.equal(c, expect.shift())
+ })
+
+ str.write('foo')
+ ms.mute()
+ str.write('12345')
+ ms.unmute()
+ str.write('bar')
+ ms.mute()
+ str.write('baz')
+ ms.unmute()
+ str.write('baz')
+ str.write('boo')
+ ms.mute()
+ str.write('xy')
+ str.write('xyzΩ')
+
+ t.equal(expect.length, 0)
+ t.end()
+})
+
+tap.test('replace with ~YARG~', function (t) {
+ var str = new PassThrough
+ var ms = new MS({replace: '~YARG~'})
+ str.pipe(ms)
+ var expect = ['foo', '~YARG~~YARG~~YARG~~YARG~~YARG~', 'bar',
+ '~YARG~~YARG~~YARG~', 'baz', 'boo', '~YARG~~YARG~',
+ '~YARG~~YARG~~YARG~~YARG~']
+
+ ms.on('data', function (c) {
+ t.equal(c, expect.shift())
+ })
+
+ // also throw some unicode in there, just for good measure.
+ str.write('foo')
+ ms.mute()
+ str.write('ΩΩ')
+ ms.unmute()
+ str.write('bar')
+ ms.mute()
+ str.write('Ω')
+ ms.unmute()
+ str.write('baz')
+ str.write('boo')
+ ms.mute()
+ str.write('Ω')
+ str.write('ΩΩ')
+
+ t.equal(expect.length, 0)
+ t.end()
+})
diff --git a/tools/eslint/node_modules/inquirer/node_modules/readline2/node_modules/strip-ansi/cli.js b/tools/eslint/node_modules/inquirer/node_modules/readline2/node_modules/strip-ansi/cli.js
new file mode 100755
index 00000000000..b83f63b907e
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/readline2/node_modules/strip-ansi/cli.js
@@ -0,0 +1,47 @@
+#!/usr/bin/env node
+'use strict';
+var fs = require('fs');
+var pkg = require('./package.json');
+var stripAnsi = require('./');
+var argv = process.argv.slice(2);
+var input = argv[0];
+
+function help() {
+ console.log([
+ '',
+ ' ' + pkg.description,
+ '',
+ ' Usage',
+ ' strip-ansi <input-file> > <output-file>',
+ ' cat <input-file> | strip-ansi > <output-file>',
+ '',
+ ' Example',
+ ' strip-ansi unicorn.txt > unicorn-stripped.txt'
+ ].join('\n'));
+}
+
+function init(data) {
+ process.stdout.write(stripAnsi(data));
+}
+
+if (argv.indexOf('--help') !== -1) {
+ help();
+ return;
+}
+
+if (argv.indexOf('--version') !== -1) {
+ console.log(pkg.version);
+ return;
+}
+
+if (!input && process.stdin.isTTY) {
+ help();
+ return;
+}
+
+if (input) {
+ init(fs.readFileSync(input, 'utf8'));
+} else {
+ process.stdin.setEncoding('utf8');
+ process.stdin.on('data', init);
+}
diff --git a/tools/eslint/node_modules/inquirer/node_modules/readline2/node_modules/strip-ansi/index.js b/tools/eslint/node_modules/inquirer/node_modules/readline2/node_modules/strip-ansi/index.js
new file mode 100644
index 00000000000..099480fbfc5
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/readline2/node_modules/strip-ansi/index.js
@@ -0,0 +1,6 @@
+'use strict';
+var ansiRegex = require('ansi-regex')();
+
+module.exports = function (str) {
+ return typeof str === 'string' ? str.replace(ansiRegex, '') : str;
+};
diff --git a/tools/eslint/node_modules/inquirer/node_modules/readline2/node_modules/strip-ansi/package.json b/tools/eslint/node_modules/inquirer/node_modules/readline2/node_modules/strip-ansi/package.json
new file mode 100644
index 00000000000..1645e0d62d8
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/readline2/node_modules/strip-ansi/package.json
@@ -0,0 +1,89 @@
+{
+ "name": "strip-ansi",
+ "version": "2.0.1",
+ "description": "Strip ANSI escape codes",
+ "license": "MIT",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/sindresorhus/strip-ansi.git"
+ },
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "http://sindresorhus.com"
+ },
+ "bin": {
+ "strip-ansi": "cli.js"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "scripts": {
+ "test": "mocha"
+ },
+ "files": [
+ "index.js",
+ "cli.js"
+ ],
+ "keywords": [
+ "strip",
+ "trim",
+ "remove",
+ "ansi",
+ "styles",
+ "color",
+ "colour",
+ "colors",
+ "terminal",
+ "console",
+ "cli",
+ "string",
+ "tty",
+ "escape",
+ "formatting",
+ "rgb",
+ "256",
+ "shell",
+ "xterm",
+ "log",
+ "logging",
+ "command-line",
+ "text"
+ ],
+ "dependencies": {
+ "ansi-regex": "^1.0.0"
+ },
+ "devDependencies": {
+ "mocha": "*"
+ },
+ "gitHead": "1eff0936c01f89efa312d9d51deed137259871a1",
+ "bugs": {
+ "url": "https://github.com/sindresorhus/strip-ansi/issues"
+ },
+ "homepage": "https://github.com/sindresorhus/strip-ansi",
+ "_id": "strip-ansi@2.0.1",
+ "_shasum": "df62c1aa94ed2f114e1d0f21fd1d50482b79a60e",
+ "_from": "strip-ansi@>=2.0.1 <3.0.0",
+ "_npmVersion": "1.4.28",
+ "_npmUser": {
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
+ },
+ {
+ "name": "jbnicolai",
+ "email": "jappelman@xebia.com"
+ }
+ ],
+ "dist": {
+ "shasum": "df62c1aa94ed2f114e1d0f21fd1d50482b79a60e",
+ "tarball": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-2.0.1.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-2.0.1.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/tools/eslint/node_modules/inquirer/node_modules/readline2/node_modules/strip-ansi/readme.md b/tools/eslint/node_modules/inquirer/node_modules/readline2/node_modules/strip-ansi/readme.md
new file mode 100644
index 00000000000..53ec26436ca
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/readline2/node_modules/strip-ansi/readme.md
@@ -0,0 +1,43 @@
+# strip-ansi [![Build Status](https://travis-ci.org/sindresorhus/strip-ansi.svg?branch=master)](https://travis-ci.org/sindresorhus/strip-ansi)
+
+> Strip [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code)
+
+
+## Install
+
+```sh
+$ npm install --save strip-ansi
+```
+
+
+## Usage
+
+```js
+var stripAnsi = require('strip-ansi');
+
+stripAnsi('\u001b[4mcake\u001b[0m');
+//=> 'cake'
+```
+
+
+## CLI
+
+```sh
+$ npm install --global strip-ansi
+```
+
+```sh
+$ strip-ansi --help
+
+ Usage
+ strip-ansi <input-file> > <output-file>
+ cat <input-file> | strip-ansi > <output-file>
+
+ Example
+ strip-ansi unicorn.txt > unicorn-stripped.txt
+```
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/tools/eslint/node_modules/inquirer/node_modules/readline2/package.json b/tools/eslint/node_modules/inquirer/node_modules/readline2/package.json
new file mode 100644
index 00000000000..68a0847ca56
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/readline2/package.json
@@ -0,0 +1,63 @@
+{
+ "name": "readline2",
+ "version": "0.1.1",
+ "description": "Readline Façade fixing bugs and issues found in releases 0.8 and 0.10",
+ "scripts": {
+ "test": "mocha -R spec"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/SBoudrias/readline2.git"
+ },
+ "keywords": [
+ "cli",
+ "terminal",
+ "readline",
+ "tty",
+ "ansi"
+ ],
+ "author": {
+ "name": "Simon Boudrias",
+ "email": "admin@simonboudrias.com"
+ },
+ "license": "MIT",
+ "files": [
+ "index.js"
+ ],
+ "dependencies": {
+ "mute-stream": "0.0.4",
+ "strip-ansi": "^2.0.1"
+ },
+ "devDependencies": {
+ "chalk": "^0.5.1",
+ "mocha": "^2.1.0",
+ "sinon": "^1.7.3"
+ },
+ "gitHead": "a7299990e47e56d892e3a5e532b62f124110d3ee",
+ "bugs": {
+ "url": "https://github.com/SBoudrias/readline2/issues"
+ },
+ "homepage": "https://github.com/SBoudrias/readline2",
+ "_id": "readline2@0.1.1",
+ "_shasum": "99443ba6e83b830ef3051bfd7dc241a82728d568",
+ "_from": "readline2@>=0.1.1 <0.2.0",
+ "_npmVersion": "2.1.18",
+ "_nodeVersion": "0.10.32",
+ "_npmUser": {
+ "name": "sboudrias",
+ "email": "admin@simonboudrias.com"
+ },
+ "maintainers": [
+ {
+ "name": "sboudrias",
+ "email": "admin@simonboudrias.com"
+ }
+ ],
+ "dist": {
+ "shasum": "99443ba6e83b830ef3051bfd7dc241a82728d568",
+ "tarball": "http://registry.npmjs.org/readline2/-/readline2-0.1.1.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/readline2/-/readline2-0.1.1.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/.coveralls.yml b/tools/eslint/node_modules/inquirer/node_modules/rx/.coveralls.yml
new file mode 100644
index 00000000000..d54ecd3dda7
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/.coveralls.yml
@@ -0,0 +1,2 @@
+service_name: travis-pro
+repo_token: 8YyWggHYCJrQmm4qdV2f5LVvo3vBD7Xsa
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/.jamignore b/tools/eslint/node_modules/inquirer/node_modules/rx/.jamignore
new file mode 100644
index 00000000000..6707d2f2782
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/.jamignore
@@ -0,0 +1,14 @@
+.*
+*.bat
+*.md
+*.min.*
+*.txt
+*.log
+package.json
+node_modules
+doc
+examples
+src
+tests
+.nuget
+nuget
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/.jscsrc b/tools/eslint/node_modules/inquirer/node_modules/rx/.jscsrc
new file mode 100644
index 00000000000..4a8c3849eb7
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/.jscsrc
@@ -0,0 +1,54 @@
+{
+ "excludeFiles": [
+ "src/core/asyncintro.js",
+ "src/core/intro.js",
+ "src/core/outro.js",
+ "src/core/suboutro.js",
+ "src/core/subintro.js",
+ "src/core/testintro.js"
+ ],
+ "requireCurlyBraces": [
+ "if",
+ "else",
+ "for",
+ "while",
+ "do",
+ "try",
+ "catch"
+ ],
+ "requireOperatorBeforeLineBreak": true,
+ "requireCamelCaseOrUpperCaseIdentifiers": true,
+ "disallowMultipleLineStrings": true,
+ "disallowMixedSpacesAndTabs": true,
+ "disallowTrailingWhitespace": true,
+ "disallowSpaceAfterPrefixUnaryOperators": true,
+ "requireSpaceAfterKeywords": [
+ "if",
+ "else",
+ "for",
+ "while",
+ "do",
+ "switch",
+ "return",
+ "try",
+ "catch"
+ ],
+ "requireSpaceBeforeBinaryOperators": [
+ "=", "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=",
+ "&=", "|=", "^=", "+=",
+
+ "+", "-", "*", "/", "%", "<<", ">>", ">>>", "&",
+ "|", "^", "&&", "||", "===", "==", ">=",
+ "<=", "<", ">", "!=", "!=="
+ ],
+ "requireSpaceAfterBinaryOperators": true,
+ "requireSpacesInConditionalExpression": true,
+ "requireSpaceBeforeBlockStatements": true,
+ "requireLineFeedAtFileEnd": true,
+ "requireSpacesInFunctionExpression": {
+ "beforeOpeningCurlyBrace": true
+ },
+ "disallowSpacesInsideParentheses": true,
+ "disallowMultipleLineBreaks": true,
+ "disallowNewlineBeforeBlockStatements": true
+} \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/.jscsrc.todo b/tools/eslint/node_modules/inquirer/node_modules/rx/.jscsrc.todo
new file mode 100644
index 00000000000..c1f21dbf180
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/.jscsrc.todo
@@ -0,0 +1,19 @@
+{
+ "maximumLineLength": {
+ "value": 80,
+ "allowComments": true,
+ "allowRegex": true
+ },
+ "validateIndentation": 2,
+ "validateQuoteMarks": "'",
+ "disallowMultipleVarDecl": true,
+ "disallowSpacesInAnonymousFunctionExpression": {
+ "beforeOpeningRoundBrace": true
+ },
+ "disallowSpacesInsideObjectBrackets": "all",
+ "disallowSpacesInsideArrayBrackets": "all",
+ "validateJSDoc": {
+ "checkParamNames": true,
+ "requireParamTypes": true
+ }
+} \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/authors.txt b/tools/eslint/node_modules/inquirer/node_modules/rx/authors.txt
new file mode 100644
index 00000000000..15090236273
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/authors.txt
@@ -0,0 +1,3 @@
+Matthew Podwysocki <matthewp@microsoft.com>
+Bart de Smet <bartde@microsoft.com>
+Erik Meijer <emeijer@microsoft.com>
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/bower.json b/tools/eslint/node_modules/inquirer/node_modules/rx/bower.json
new file mode 100644
index 00000000000..3684d355273
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/bower.json
@@ -0,0 +1,37 @@
+{
+ "name": "rxjs",
+ "version": "2.5.3",
+ "main": [
+ "dist/rx.all.js",
+ "dist/rx.all.compat.js",
+ "dist/rx.js",
+ "dist/rx.compat.js",
+ "dist/rx.aggregates.js",
+ "dist/rx.async.js",
+ "dist/rx.async.compat.js",
+ "dist/rx.backpressure.js",
+ "dist/rx.binding.js",
+ "dist/rx.coincidence.js",
+ "dist/rx.experimental.js",
+ "dist/rx.lite.js",
+ "dist/rx.lite.compat.js",
+ "dist/rx.joinpatterns.js",
+ "dist/rx.testing.js",
+ "dist/rx.time.js",
+ "dist/rx.virtualtime.js",
+ ],
+ "ignore": [
+ ".sh",
+ ".*",
+ "*.bat",
+ "*.md",
+ "*.txt",
+ "*.log",
+ "package.json",
+ "node_modules",
+ "doc",
+ "examples",
+ "src",
+ "tests"
+ ]
+}
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/component.json b/tools/eslint/node_modules/inquirer/node_modules/rx/component.json
new file mode 100644
index 00000000000..1771bfade6d
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/component.json
@@ -0,0 +1,62 @@
+{
+ "name": "rx",
+ "scripts": [
+ "dist/rx.aggregates.js",
+ "dist/rx.aggregates.map",
+ "dist/rx.aggregates.min.js",
+ "dist/rx.all.compat.js",
+ "dist/rx.all.compat.map",
+ "dist/rx.all.compat.min.js",
+ "dist/rx.all.js",
+ "dist/rx.all.min.js",
+ "dist/rx.all.map",
+ "dist/rx.async.js",
+ "dist/rx.async.map",
+ "dist/rx.async.min.js",
+ "dist/rx.async.compat.js",
+ "dist/rx.async.compat.map",
+ "dist/rx.async.compat.min.js",
+ "dist/rx.backpressure.js",
+ "dist/rx.backpressure.map",
+ "dist/rx.backpressure.min.js",
+ "dist/rx.backpressure.js",
+ "dist/rx.backpressure.map",
+ "dist/rx.backpressure.min.js",
+ "dist/rx.binding.js",
+ "dist/rx.binding.map",
+ "dist/rx.binding.min.js",
+ "dist/rx.coincidence.js",
+ "dist/rx.coincidence.map",
+ "dist/rx.coincidence.min.js",
+ "dist/rx.js",
+ "dist/rx.map",
+ "dist/rx.min.js",
+ "dist/rx.compat.js",
+ "dist/rx.compat.map",
+ "dist/rx.compat.min.js",
+ "dist/rx.experimental.js",
+ "dist/rx.experimental.map",
+ "dist/rx.experimental.min.js",
+ "dist/rx.joinpatterns.js",
+ "dist/rx.joinpatterns.map",
+ "dist/rx.joinpatterns.min.js",
+ "dist/rx.lite.js",
+ "dist/rx.lite.map",
+ "dist/rx.lite.min.js",
+ "dist/rx.lite.compat.js",
+ "dist/rx.lite.compat.map",
+ "dist/rx.lite.compat.min.js",
+ "dist/rx.lite.extras.js",
+ "dist/rx.lite.extras.map",
+ "dist/rx.lite.extras.min.js",
+ "dist/rx.testing.js",
+ "dist/rx.testing.map",
+ "dist/rx.testing.min.js",
+ "dist/rx.time.js",
+ "dist/rx.time.map",
+ "dist/rx.time.min.js",
+ "dist/rx.virtualtime.js",
+ "dist/rx.virtualtime.map",
+ "dist/rx.virtualtime.min.js"
+ ]
+}
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.aggregates.js b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.aggregates.js
new file mode 100644
index 00000000000..e13f4183a66
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.aggregates.js
@@ -0,0 +1,838 @@
+// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
+
+;(function (factory) {
+ var objectTypes = {
+ 'boolean': false,
+ 'function': true,
+ 'object': true,
+ 'number': false,
+ 'string': false,
+ 'undefined': false
+ };
+
+ var root = (objectTypes[typeof window] && window) || this,
+ freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
+ freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
+ moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
+ freeGlobal = objectTypes[typeof global] && global;
+
+ if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) {
+ root = freeGlobal;
+ }
+
+ // Because of build optimizers
+ if (typeof define === 'function' && define.amd) {
+ define(['rx'], function (Rx, exports) {
+ return factory(root, exports, Rx);
+ });
+ } else if (typeof module === 'object' && module && module.exports === freeExports) {
+ module.exports = factory(root, module.exports, require('./rx'));
+ } else {
+ root.Rx = factory(root, {}, root.Rx);
+ }
+}.call(this, function (root, exp, Rx, undefined) {
+
+ // References
+ var Observable = Rx.Observable,
+ observableProto = Observable.prototype,
+ CompositeDisposable = Rx.CompositeDisposable,
+ AnonymousObservable = Rx.AnonymousObservable,
+ disposableEmpty = Rx.Disposable.empty,
+ isEqual = Rx.internals.isEqual,
+ helpers = Rx.helpers,
+ not = helpers.not,
+ defaultComparer = helpers.defaultComparer,
+ identity = helpers.identity,
+ defaultSubComparer = helpers.defaultSubComparer,
+ isFunction = helpers.isFunction,
+ isPromise = helpers.isPromise,
+ isArrayLike = helpers.isArrayLike,
+ isIterable = helpers.isIterable,
+ inherits = Rx.internals.inherits,
+ observableFromPromise = Observable.fromPromise,
+ observableFrom = Observable.from,
+ bindCallback = Rx.internals.bindCallback,
+ EmptyError = Rx.EmptyError,
+ ObservableBase = Rx.ObservableBase,
+ ArgumentOutOfRangeError = Rx.ArgumentOutOfRangeError;
+
+ var errorObj = {e: {}};
+ var tryCatchTarget;
+ function tryCatcher() {
+ try {
+ return tryCatchTarget.apply(this, arguments);
+ } catch (e) {
+ errorObj.e = e;
+ return errorObj;
+ }
+ }
+ function tryCatch(fn) {
+ if (!isFunction(fn)) { throw new TypeError('fn must be a function'); }
+ tryCatchTarget = fn;
+ return tryCatcher;
+ }
+ function thrower(e) {
+ throw e;
+ }
+
+ function extremaBy(source, keySelector, comparer) {
+ return new AnonymousObservable(function (o) {
+ var hasValue = false, lastKey = null, list = [];
+ return source.subscribe(function (x) {
+ var comparison, key;
+ try {
+ key = keySelector(x);
+ } catch (ex) {
+ o.onError(ex);
+ return;
+ }
+ comparison = 0;
+ if (!hasValue) {
+ hasValue = true;
+ lastKey = key;
+ } else {
+ try {
+ comparison = comparer(key, lastKey);
+ } catch (ex1) {
+ o.onError(ex1);
+ return;
+ }
+ }
+ if (comparison > 0) {
+ lastKey = key;
+ list = [];
+ }
+ if (comparison >= 0) { list.push(x); }
+ }, function (e) { o.onError(e); }, function () {
+ o.onNext(list);
+ o.onCompleted();
+ });
+ }, source);
+ }
+
+ function firstOnly(x) {
+ if (x.length === 0) { throw new EmptyError(); }
+ return x[0];
+ }
+
+ /**
+ * Applies an accumulator function over an observable sequence, returning the result of the aggregation as a single element in the result sequence. The specified seed value is used as the initial accumulator value.
+ * For aggregation behavior with incremental intermediate results, see Observable.scan.
+ * @deprecated Use #reduce instead
+ * @param {Mixed} [seed] The initial accumulator value.
+ * @param {Function} accumulator An accumulator function to be invoked on each element.
+ * @returns {Observable} An observable sequence containing a single element with the final accumulator value.
+ */
+ observableProto.aggregate = function () {
+ var hasSeed = false, accumulator, seed, source = this;
+ if (arguments.length === 2) {
+ hasSeed = true;
+ seed = arguments[0];
+ accumulator = arguments[1];
+ } else {
+ accumulator = arguments[0];
+ }
+ return new AnonymousObservable(function (o) {
+ var hasAccumulation, accumulation, hasValue;
+ return source.subscribe (
+ function (x) {
+ !hasValue && (hasValue = true);
+ try {
+ if (hasAccumulation) {
+ accumulation = accumulator(accumulation, x);
+ } else {
+ accumulation = hasSeed ? accumulator(seed, x) : x;
+ hasAccumulation = true;
+ }
+ } catch (e) {
+ return o.onError(e);
+ }
+ },
+ function (e) { o.onError(e); },
+ function () {
+ hasValue && o.onNext(accumulation);
+ !hasValue && hasSeed && o.onNext(seed);
+ !hasValue && !hasSeed && o.onError(new EmptyError());
+ o.onCompleted();
+ }
+ );
+ }, source);
+ };
+
+ var ReduceObservable = (function(__super__) {
+ inherits(ReduceObservable, __super__);
+ function ReduceObservable(source, acc, hasSeed, seed) {
+ this.source = source;
+ this.acc = acc;
+ this.hasSeed = hasSeed;
+ this.seed = seed;
+ __super__.call(this);
+ }
+
+ ReduceObservable.prototype.subscribeCore = function(observer) {
+ return this.source.subscribe(new InnerObserver(observer,this));
+ };
+
+ function InnerObserver(o, parent) {
+ this.o = o;
+ this.acc = parent.acc;
+ this.hasSeed = parent.hasSeed;
+ this.seed = parent.seed;
+ this.hasAccumulation = false;
+ this.result = null;
+ this.hasValue = false;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) {
+ if (this.isStopped) { return; }
+ !this.hasValue && (this.hasValue = true);
+ if (this.hasAccumulation) {
+ this.result = tryCatch(this.acc)(this.result, x);
+ } else {
+ this.result = this.hasSeed ? tryCatch(this.acc)(this.seed, x) : x;
+ this.hasAccumulation = true;
+ }
+ if (this.result === errorObj) { this.o.onError(this.result.e); }
+ };
+ InnerObserver.prototype.onError = function (e) {
+ if (!this.isStopped) { this.isStopped = true; this.o.onError(e); }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.hasValue && this.o.onNext(this.result);
+ !this.hasValue && this.hasSeed && this.o.onNext(this.seed);
+ !this.hasValue && !this.hasSeed && this.o.onError(new EmptyError());
+ this.o.onCompleted();
+ }
+ };
+ InnerObserver.prototype.dispose = function () { this.isStopped = true; };
+ InnerObserver.prototype.fail = function(e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ return ReduceObservable;
+ }(ObservableBase));
+
+ /**
+ * Applies an accumulator function over an observable sequence, returning the result of the aggregation as a single element in the result sequence. The specified seed value is used as the initial accumulator value.
+ * For aggregation behavior with incremental intermediate results, see Observable.scan.
+ * @param {Function} accumulator An accumulator function to be invoked on each element.
+ * @param {Any} [seed] The initial accumulator value.
+ * @returns {Observable} An observable sequence containing a single element with the final accumulator value.
+ */
+ observableProto.reduce = function (accumulator) {
+ var hasSeed = false;
+ if (arguments.length === 2) {
+ hasSeed = true;
+ var seed = arguments[1];
+ }
+ return new ReduceObservable(this, accumulator, hasSeed, seed);
+ };
+
+ /**
+ * Determines whether any element of an observable sequence satisfies a condition if present, else if any items are in the sequence.
+ * @param {Function} [predicate] A function to test each element for a condition.
+ * @returns {Observable} An observable sequence containing a single element determining whether any elements in the source sequence pass the test in the specified predicate if given, else if any items are in the sequence.
+ */
+ observableProto.some = function (predicate, thisArg) {
+ var source = this;
+ return predicate ?
+ source.filter(predicate, thisArg).some() :
+ new AnonymousObservable(function (observer) {
+ return source.subscribe(function () {
+ observer.onNext(true);
+ observer.onCompleted();
+ }, function (e) { observer.onError(e); }, function () {
+ observer.onNext(false);
+ observer.onCompleted();
+ });
+ }, source);
+ };
+
+ /** @deprecated use #some instead */
+ observableProto.any = function () {
+ //deprecate('any', 'some');
+ return this.some.apply(this, arguments);
+ };
+
+ /**
+ * Determines whether an observable sequence is empty.
+ * @returns {Observable} An observable sequence containing a single element determining whether the source sequence is empty.
+ */
+ observableProto.isEmpty = function () {
+ return this.any().map(not);
+ };
+
+ /**
+ * Determines whether all elements of an observable sequence satisfy a condition.
+ * @param {Function} [predicate] A function to test each element for a condition.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence containing a single element determining whether all elements in the source sequence pass the test in the specified predicate.
+ */
+ observableProto.every = function (predicate, thisArg) {
+ return this.filter(function (v) { return !predicate(v); }, thisArg).some().map(not);
+ };
+
+ /** @deprecated use #every instead */
+ observableProto.all = function () {
+ //deprecate('all', 'every');
+ return this.every.apply(this, arguments);
+ };
+
+ /**
+ * Determines whether an observable sequence includes a specified element with an optional equality comparer.
+ * @param searchElement The value to locate in the source sequence.
+ * @param {Number} [fromIndex] An equality comparer to compare elements.
+ * @returns {Observable} An observable sequence containing a single element determining whether the source sequence includes an element that has the specified value from the given index.
+ */
+ observableProto.includes = function (searchElement, fromIndex) {
+ var source = this;
+ function comparer(a, b) {
+ return (a === 0 && b === 0) || (a === b || (isNaN(a) && isNaN(b)));
+ }
+ return new AnonymousObservable(function (o) {
+ var i = 0, n = +fromIndex || 0;
+ Math.abs(n) === Infinity && (n = 0);
+ if (n < 0) {
+ o.onNext(false);
+ o.onCompleted();
+ return disposableEmpty;
+ }
+ return source.subscribe(
+ function (x) {
+ if (i++ >= n && comparer(x, searchElement)) {
+ o.onNext(true);
+ o.onCompleted();
+ }
+ },
+ function (e) { o.onError(e); },
+ function () {
+ o.onNext(false);
+ o.onCompleted();
+ });
+ }, this);
+ };
+
+ /**
+ * @deprecated use #includes instead.
+ */
+ observableProto.contains = function (searchElement, fromIndex) {
+ //deprecate('contains', 'includes');
+ observableProto.includes(searchElement, fromIndex);
+ };
+
+ /**
+ * Returns an observable sequence containing a value that represents how many elements in the specified observable sequence satisfy a condition if provided, else the count of items.
+ * @example
+ * res = source.count();
+ * res = source.count(function (x) { return x > 3; });
+ * @param {Function} [predicate]A function to test each element for a condition.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence containing a single element with a number that represents how many elements in the input sequence satisfy the condition in the predicate function if provided, else the count of items in the sequence.
+ */
+ observableProto.count = function (predicate, thisArg) {
+ return predicate ?
+ this.filter(predicate, thisArg).count() :
+ this.reduce(function (count) { return count + 1; }, 0);
+ };
+
+ /**
+ * Returns the first index at which a given element can be found in the observable sequence, or -1 if it is not present.
+ * @param {Any} searchElement Element to locate in the array.
+ * @param {Number} [fromIndex] The index to start the search. If not specified, defaults to 0.
+ * @returns {Observable} And observable sequence containing the first index at which a given element can be found in the observable sequence, or -1 if it is not present.
+ */
+ observableProto.indexOf = function(searchElement, fromIndex) {
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var i = 0, n = +fromIndex || 0;
+ Math.abs(n) === Infinity && (n = 0);
+ if (n < 0) {
+ o.onNext(-1);
+ o.onCompleted();
+ return disposableEmpty;
+ }
+ return source.subscribe(
+ function (x) {
+ if (i >= n && x === searchElement) {
+ o.onNext(i);
+ o.onCompleted();
+ }
+ i++;
+ },
+ function (e) { o.onError(e); },
+ function () {
+ o.onNext(-1);
+ o.onCompleted();
+ });
+ }, source);
+ };
+
+ /**
+ * Computes the sum of a sequence of values that are obtained by invoking an optional transform function on each element of the input sequence, else if not specified computes the sum on each item in the sequence.
+ * @param {Function} [selector] A transform function to apply to each element.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence containing a single element with the sum of the values in the source sequence.
+ */
+ observableProto.sum = function (keySelector, thisArg) {
+ return keySelector && isFunction(keySelector) ?
+ this.map(keySelector, thisArg).sum() :
+ this.reduce(function (prev, curr) { return prev + curr; }, 0);
+ };
+
+ /**
+ * Returns the elements in an observable sequence with the minimum key value according to the specified comparer.
+ * @example
+ * var res = source.minBy(function (x) { return x.value; });
+ * var res = source.minBy(function (x) { return x.value; }, function (x, y) { return x - y; });
+ * @param {Function} keySelector Key selector function.
+ * @param {Function} [comparer] Comparer used to compare key values.
+ * @returns {Observable} An observable sequence containing a list of zero or more elements that have a minimum key value.
+ */
+ observableProto.minBy = function (keySelector, comparer) {
+ comparer || (comparer = defaultSubComparer);
+ return extremaBy(this, keySelector, function (x, y) { return comparer(x, y) * -1; });
+ };
+
+ /**
+ * Returns the minimum element in an observable sequence according to the optional comparer else a default greater than less than check.
+ * @example
+ * var res = source.min();
+ * var res = source.min(function (x, y) { return x.value - y.value; });
+ * @param {Function} [comparer] Comparer used to compare elements.
+ * @returns {Observable} An observable sequence containing a single element with the minimum element in the source sequence.
+ */
+ observableProto.min = function (comparer) {
+ return this.minBy(identity, comparer).map(function (x) { return firstOnly(x); });
+ };
+
+ /**
+ * Returns the elements in an observable sequence with the maximum key value according to the specified comparer.
+ * @example
+ * var res = source.maxBy(function (x) { return x.value; });
+ * var res = source.maxBy(function (x) { return x.value; }, function (x, y) { return x - y;; });
+ * @param {Function} keySelector Key selector function.
+ * @param {Function} [comparer] Comparer used to compare key values.
+ * @returns {Observable} An observable sequence containing a list of zero or more elements that have a maximum key value.
+ */
+ observableProto.maxBy = function (keySelector, comparer) {
+ comparer || (comparer = defaultSubComparer);
+ return extremaBy(this, keySelector, comparer);
+ };
+
+ /**
+ * Returns the maximum value in an observable sequence according to the specified comparer.
+ * @example
+ * var res = source.max();
+ * var res = source.max(function (x, y) { return x.value - y.value; });
+ * @param {Function} [comparer] Comparer used to compare elements.
+ * @returns {Observable} An observable sequence containing a single element with the maximum element in the source sequence.
+ */
+ observableProto.max = function (comparer) {
+ return this.maxBy(identity, comparer).map(function (x) { return firstOnly(x); });
+ };
+
+ /**
+ * Computes the average of an observable sequence of values that are in the sequence or obtained by invoking a transform function on each element of the input sequence if present.
+ * @param {Function} [selector] A transform function to apply to each element.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence containing a single element with the average of the sequence of values.
+ */
+ observableProto.average = function (keySelector, thisArg) {
+ return keySelector && isFunction(keySelector) ?
+ this.map(keySelector, thisArg).average() :
+ this.reduce(function (prev, cur) {
+ return {
+ sum: prev.sum + cur,
+ count: prev.count + 1
+ };
+ }, {sum: 0, count: 0 }).map(function (s) {
+ if (s.count === 0) { throw new EmptyError(); }
+ return s.sum / s.count;
+ });
+ };
+
+ /**
+ * Determines whether two sequences are equal by comparing the elements pairwise using a specified equality comparer.
+ *
+ * @example
+ * var res = res = source.sequenceEqual([1,2,3]);
+ * var res = res = source.sequenceEqual([{ value: 42 }], function (x, y) { return x.value === y.value; });
+ * 3 - res = source.sequenceEqual(Rx.Observable.returnValue(42));
+ * 4 - res = source.sequenceEqual(Rx.Observable.returnValue({ value: 42 }), function (x, y) { return x.value === y.value; });
+ * @param {Observable} second Second observable sequence or array to compare.
+ * @param {Function} [comparer] Comparer used to compare elements of both sequences.
+ * @returns {Observable} An observable sequence that contains a single element which indicates whether both sequences are of equal length and their corresponding elements are equal according to the specified equality comparer.
+ */
+ observableProto.sequenceEqual = function (second, comparer) {
+ var first = this;
+ comparer || (comparer = defaultComparer);
+ return new AnonymousObservable(function (o) {
+ var donel = false, doner = false, ql = [], qr = [];
+ var subscription1 = first.subscribe(function (x) {
+ var equal, v;
+ if (qr.length > 0) {
+ v = qr.shift();
+ try {
+ equal = comparer(v, x);
+ } catch (e) {
+ o.onError(e);
+ return;
+ }
+ if (!equal) {
+ o.onNext(false);
+ o.onCompleted();
+ }
+ } else if (doner) {
+ o.onNext(false);
+ o.onCompleted();
+ } else {
+ ql.push(x);
+ }
+ }, function(e) { o.onError(e); }, function () {
+ donel = true;
+ if (ql.length === 0) {
+ if (qr.length > 0) {
+ o.onNext(false);
+ o.onCompleted();
+ } else if (doner) {
+ o.onNext(true);
+ o.onCompleted();
+ }
+ }
+ });
+
+ (isArrayLike(second) || isIterable(second)) && (second = observableFrom(second));
+ isPromise(second) && (second = observableFromPromise(second));
+ var subscription2 = second.subscribe(function (x) {
+ var equal;
+ if (ql.length > 0) {
+ var v = ql.shift();
+ try {
+ equal = comparer(v, x);
+ } catch (exception) {
+ o.onError(exception);
+ return;
+ }
+ if (!equal) {
+ o.onNext(false);
+ o.onCompleted();
+ }
+ } else if (donel) {
+ o.onNext(false);
+ o.onCompleted();
+ } else {
+ qr.push(x);
+ }
+ }, function(e) { o.onError(e); }, function () {
+ doner = true;
+ if (qr.length === 0) {
+ if (ql.length > 0) {
+ o.onNext(false);
+ o.onCompleted();
+ } else if (donel) {
+ o.onNext(true);
+ o.onCompleted();
+ }
+ }
+ });
+ return new CompositeDisposable(subscription1, subscription2);
+ }, first);
+ };
+
+ function elementAtOrDefault(source, index, hasDefault, defaultValue) {
+ if (index < 0) { throw new ArgumentOutOfRangeError(); }
+ return new AnonymousObservable(function (o) {
+ var i = index;
+ return source.subscribe(function (x) {
+ if (i-- === 0) {
+ o.onNext(x);
+ o.onCompleted();
+ }
+ }, function (e) { o.onError(e); }, function () {
+ if (!hasDefault) {
+ o.onError(new ArgumentOutOfRangeError());
+ } else {
+ o.onNext(defaultValue);
+ o.onCompleted();
+ }
+ });
+ }, source);
+ }
+
+ /**
+ * Returns the element at a specified index in a sequence.
+ * @example
+ * var res = source.elementAt(5);
+ * @param {Number} index The zero-based index of the element to retrieve.
+ * @returns {Observable} An observable sequence that produces the element at the specified position in the source sequence.
+ */
+ observableProto.elementAt = function (index) {
+ return elementAtOrDefault(this, index, false);
+ };
+
+ /**
+ * Returns the element at a specified index in a sequence or a default value if the index is out of range.
+ * @example
+ * var res = source.elementAtOrDefault(5);
+ * var res = source.elementAtOrDefault(5, 0);
+ * @param {Number} index The zero-based index of the element to retrieve.
+ * @param [defaultValue] The default value if the index is outside the bounds of the source sequence.
+ * @returns {Observable} An observable sequence that produces the element at the specified position in the source sequence, or a default value if the index is outside the bounds of the source sequence.
+ */
+ observableProto.elementAtOrDefault = function (index, defaultValue) {
+ return elementAtOrDefault(this, index, true, defaultValue);
+ };
+
+ function singleOrDefaultAsync(source, hasDefault, defaultValue) {
+ return new AnonymousObservable(function (o) {
+ var value = defaultValue, seenValue = false;
+ return source.subscribe(function (x) {
+ if (seenValue) {
+ o.onError(new Error('Sequence contains more than one element'));
+ } else {
+ value = x;
+ seenValue = true;
+ }
+ }, function (e) { o.onError(e); }, function () {
+ if (!seenValue && !hasDefault) {
+ o.onError(new EmptyError());
+ } else {
+ o.onNext(value);
+ o.onCompleted();
+ }
+ });
+ }, source);
+ }
+
+ /**
+ * Returns the only element of an observable sequence that satisfies the condition in the optional predicate, and reports an exception if there is not exactly one element in the observable sequence.
+ * @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence.
+ * @param {Any} [thisArg] Object to use as `this` when executing the predicate.
+ * @returns {Observable} Sequence containing the single element in the observable sequence that satisfies the condition in the predicate.
+ */
+ observableProto.single = function (predicate, thisArg) {
+ return predicate && isFunction(predicate) ?
+ this.where(predicate, thisArg).single() :
+ singleOrDefaultAsync(this, false);
+ };
+
+ /**
+ * Returns the only element of an observable sequence that matches the predicate, or a default value if no such element exists; this method reports an exception if there is more than one element in the observable sequence.
+ * @example
+ * var res = res = source.singleOrDefault();
+ * var res = res = source.singleOrDefault(function (x) { return x === 42; });
+ * res = source.singleOrDefault(function (x) { return x === 42; }, 0);
+ * res = source.singleOrDefault(null, 0);
+ * @memberOf Observable#
+ * @param {Function} predicate A predicate function to evaluate for elements in the source sequence.
+ * @param [defaultValue] The default value if the index is outside the bounds of the source sequence.
+ * @param {Any} [thisArg] Object to use as `this` when executing the predicate.
+ * @returns {Observable} Sequence containing the single element in the observable sequence that satisfies the condition in the predicate, or a default value if no such element exists.
+ */
+ observableProto.singleOrDefault = function (predicate, defaultValue, thisArg) {
+ return predicate && isFunction(predicate) ?
+ this.filter(predicate, thisArg).singleOrDefault(null, defaultValue) :
+ singleOrDefaultAsync(this, true, defaultValue);
+ };
+
+ function firstOrDefaultAsync(source, hasDefault, defaultValue) {
+ return new AnonymousObservable(function (o) {
+ return source.subscribe(function (x) {
+ o.onNext(x);
+ o.onCompleted();
+ }, function (e) { o.onError(e); }, function () {
+ if (!hasDefault) {
+ o.onError(new EmptyError());
+ } else {
+ o.onNext(defaultValue);
+ o.onCompleted();
+ }
+ });
+ }, source);
+ }
+
+ /**
+ * Returns the first element of an observable sequence that satisfies the condition in the predicate if present else the first item in the sequence.
+ * @example
+ * var res = res = source.first();
+ * var res = res = source.first(function (x) { return x > 3; });
+ * @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence.
+ * @param {Any} [thisArg] Object to use as `this` when executing the predicate.
+ * @returns {Observable} Sequence containing the first element in the observable sequence that satisfies the condition in the predicate if provided, else the first item in the sequence.
+ */
+ observableProto.first = function (predicate, thisArg) {
+ return predicate ?
+ this.where(predicate, thisArg).first() :
+ firstOrDefaultAsync(this, false);
+ };
+
+ /**
+ * Returns the first element of an observable sequence that satisfies the condition in the predicate, or a default value if no such element exists.
+ * @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence.
+ * @param {Any} [defaultValue] The default value if no such element exists. If not specified, defaults to null.
+ * @param {Any} [thisArg] Object to use as `this` when executing the predicate.
+ * @returns {Observable} Sequence containing the first element in the observable sequence that satisfies the condition in the predicate, or a default value if no such element exists.
+ */
+ observableProto.firstOrDefault = function (predicate, defaultValue, thisArg) {
+ return predicate ?
+ this.where(predicate).firstOrDefault(null, defaultValue) :
+ firstOrDefaultAsync(this, true, defaultValue);
+ };
+
+ function lastOrDefaultAsync(source, hasDefault, defaultValue) {
+ return new AnonymousObservable(function (o) {
+ var value = defaultValue, seenValue = false;
+ return source.subscribe(function (x) {
+ value = x;
+ seenValue = true;
+ }, function (e) { o.onError(e); }, function () {
+ if (!seenValue && !hasDefault) {
+ o.onError(new EmptyError());
+ } else {
+ o.onNext(value);
+ o.onCompleted();
+ }
+ });
+ }, source);
+ }
+
+ /**
+ * Returns the last element of an observable sequence that satisfies the condition in the predicate if specified, else the last element.
+ * @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence.
+ * @param {Any} [thisArg] Object to use as `this` when executing the predicate.
+ * @returns {Observable} Sequence containing the last element in the observable sequence that satisfies the condition in the predicate.
+ */
+ observableProto.last = function (predicate, thisArg) {
+ return predicate ?
+ this.where(predicate, thisArg).last() :
+ lastOrDefaultAsync(this, false);
+ };
+
+ /**
+ * Returns the last element of an observable sequence that satisfies the condition in the predicate, or a default value if no such element exists.
+ * @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence.
+ * @param [defaultValue] The default value if no such element exists. If not specified, defaults to null.
+ * @param {Any} [thisArg] Object to use as `this` when executing the predicate.
+ * @returns {Observable} Sequence containing the last element in the observable sequence that satisfies the condition in the predicate, or a default value if no such element exists.
+ */
+ observableProto.lastOrDefault = function (predicate, defaultValue, thisArg) {
+ return predicate ?
+ this.where(predicate, thisArg).lastOrDefault(null, defaultValue) :
+ lastOrDefaultAsync(this, true, defaultValue);
+ };
+
+ function findValue (source, predicate, thisArg, yieldIndex) {
+ var callback = bindCallback(predicate, thisArg, 3);
+ return new AnonymousObservable(function (o) {
+ var i = 0;
+ return source.subscribe(function (x) {
+ var shouldRun;
+ try {
+ shouldRun = callback(x, i, source);
+ } catch (e) {
+ o.onError(e);
+ return;
+ }
+ if (shouldRun) {
+ o.onNext(yieldIndex ? i : x);
+ o.onCompleted();
+ } else {
+ i++;
+ }
+ }, function (e) { o.onError(e); }, function () {
+ o.onNext(yieldIndex ? -1 : undefined);
+ o.onCompleted();
+ });
+ }, source);
+ }
+
+ /**
+ * Searches for an element that matches the conditions defined by the specified predicate, and returns the first occurrence within the entire Observable sequence.
+ * @param {Function} predicate The predicate that defines the conditions of the element to search for.
+ * @param {Any} [thisArg] Object to use as `this` when executing the predicate.
+ * @returns {Observable} An Observable sequence with the first element that matches the conditions defined by the specified predicate, if found; otherwise, undefined.
+ */
+ observableProto.find = function (predicate, thisArg) {
+ return findValue(this, predicate, thisArg, false);
+ };
+
+ /**
+ * Searches for an element that matches the conditions defined by the specified predicate, and returns
+ * an Observable sequence with the zero-based index of the first occurrence within the entire Observable sequence.
+ * @param {Function} predicate The predicate that defines the conditions of the element to search for.
+ * @param {Any} [thisArg] Object to use as `this` when executing the predicate.
+ * @returns {Observable} An Observable sequence with the zero-based index of the first occurrence of an element that matches the conditions defined by match, if found; otherwise, –1.
+ */
+ observableProto.findIndex = function (predicate, thisArg) {
+ return findValue(this, predicate, thisArg, true);
+ };
+
+ /**
+ * Converts the observable sequence to a Set if it exists.
+ * @returns {Observable} An observable sequence with a single value of a Set containing the values from the observable sequence.
+ */
+ observableProto.toSet = function () {
+ if (typeof root.Set === 'undefined') { throw new TypeError(); }
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var s = new root.Set();
+ return source.subscribe(
+ function (x) { s.add(x); },
+ function (e) { o.onError(e); },
+ function () {
+ o.onNext(s);
+ o.onCompleted();
+ });
+ }, source);
+ };
+
+ /**
+ * Converts the observable sequence to a Map if it exists.
+ * @param {Function} keySelector A function which produces the key for the Map.
+ * @param {Function} [elementSelector] An optional function which produces the element for the Map. If not present, defaults to the value from the observable sequence.
+ * @returns {Observable} An observable sequence with a single value of a Map containing the values from the observable sequence.
+ */
+ observableProto.toMap = function (keySelector, elementSelector) {
+ if (typeof root.Map === 'undefined') { throw new TypeError(); }
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var m = new root.Map();
+ return source.subscribe(
+ function (x) {
+ var key;
+ try {
+ key = keySelector(x);
+ } catch (e) {
+ o.onError(e);
+ return;
+ }
+
+ var element = x;
+ if (elementSelector) {
+ try {
+ element = elementSelector(x);
+ } catch (e) {
+ o.onError(e);
+ return;
+ }
+ }
+
+ m.set(key, element);
+ },
+ function (e) { o.onError(e); },
+ function () {
+ o.onNext(m);
+ o.onCompleted();
+ });
+ }, source);
+ };
+
+ return Rx;
+}));
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.aggregates.map b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.aggregates.map
new file mode 100644
index 00000000000..abc8a4e395e
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.aggregates.map
@@ -0,0 +1 @@
+{"version":3,"file":"rx.aggregates.min.js","sources":["rx.aggregates.js"],"names":["factory","objectTypes","boolean","function","object","number","string","undefined","root","window","this","freeExports","exports","nodeType","freeModule","module","freeGlobal","global","define","amd","Rx","require","call","exp","tryCatcher","tryCatchTarget","apply","arguments","e","errorObj","tryCatch","fn","isFunction","TypeError","extremaBy","source","keySelector","comparer","AnonymousObservable","o","hasValue","lastKey","list","subscribe","x","comparison","key","ex","onError","ex1","push","onNext","onCompleted","firstOnly","length","EmptyError","elementAtOrDefault","index","hasDefault","defaultValue","ArgumentOutOfRangeError","i","singleOrDefaultAsync","value","seenValue","Error","firstOrDefaultAsync","lastOrDefaultAsync","findValue","predicate","thisArg","yieldIndex","callback","bindCallback","shouldRun","Observable","observableProto","prototype","CompositeDisposable","disposableEmpty","Disposable","empty","helpers","internals","isEqual","not","defaultComparer","identity","defaultSubComparer","isPromise","isArrayLike","isIterable","inherits","observableFromPromise","fromPromise","observableFrom","from","ObservableBase","aggregate","accumulator","seed","hasSeed","hasAccumulation","accumulation","ReduceObservable","__super__","acc","InnerObserver","parent","result","isStopped","subscribeCore","observer","dispose","fail","reduce","some","filter","any","isEmpty","map","every","v","all","includes","searchElement","fromIndex","a","b","isNaN","n","Math","abs","Infinity","contains","count","indexOf","sum","prev","curr","minBy","y","min","maxBy","max","average","cur","s","sequenceEqual","second","first","donel","doner","ql","qr","subscription1","equal","shift","subscription2","exception","elementAt","single","where","singleOrDefault","firstOrDefault","last","lastOrDefault","find","findIndex","toSet","Set","add","toMap","elementSelector","Map","m","element","set"],"mappings":";CAEE,SAAUA,GACR,GAAIC,IACAC,WAAW,EACXC,YAAY,EACZC,QAAU,EACVC,QAAU,EACVC,QAAU,EACVC,WAAa,GAGbC,EAAQP,QAAmBQ,UAAWA,QAAWC,KACjDC,E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cW,GACjE,MAAOD,GACL3D,KAAKwJ,MAAM7F,EAAWC,GAASgG,cAAc,KAAM3G,GACnDQ,EAAmBzD,MAAM,EAAMiD,IAkCnCiB,EAAgB2F,KAAO,SAAUlG,EAAWC,GAC1C,MAAOF,GAAU1D,KAAM2D,EAAWC,GAAS,IAU7CM,EAAgB4F,UAAY,SAAUnG,EAAWC,GAC/C,MAAOF,GAAU1D,KAAM2D,EAAWC,GAAS,IAO7CM,EAAgB6F,MAAQ,WACtB,GAAwB,mBAAbjK,GAAKkK,IAAuB,KAAM,IAAIzI,UACjD,IAAIE,GAASzB,IACb,OAAO,IAAI4B,GAAoB,SAAUC,GACvC,GAAI4G,GAAI,GAAI3I,GAAKkK,GACjB,OAAOvI,GAAOQ,UACZ,SAAUC,GAAKuG,EAAEwB,IAAI/H,IACrB,SAAUhB,GAAKW,EAAES,QAAQpB,IACzB,WACEW,EAAEY,OAAOgG,GACT5G,EAAEa,iBAELjB,IASLyC,EAAgBgG,MAAQ,SAAUxI,EAAayI,GAC7C,GAAwB,mBAAbrK,GAAKsK,IAAuB,KAAM,IAAI7I,UACjD,IAAIE,GAASzB,IACb,OAAO,IAAI4B,GAAoB,SAAUC,GACvC,GAAIwI,GAAI,GAAIvK,GAAKsK,GACjB,OAAO3I,GAAOQ,UACZ,SAAUC,GACR,GAAIE,EACJ,KACEA,EAAMV,EAAYQ,GAClB,MAAOhB,GAEP,WADAW,GAAES,QAAQpB,GAIZ,GAAIoJ,GAAUpI,CACd,IAAIiI,EACF,IACEG,EAAUH,EAAgBjI,GAC1B,MAAOhB,GAEP,WADAW,GAAES,QAAQpB,GAKdmJ,EAAEE,IAAInI,EAAKkI,IAEb,SAAUpJ,GAAKW,EAAES,QAAQpB,IACzB,WACEW,EAAEY,OAAO4H,GACTxI,EAAEa,iBAELjB,IAGIf"} \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.aggregates.min.js b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.aggregates.min.js
new file mode 100644
index 00000000000..c333383c368
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.aggregates.min.js
@@ -0,0 +1,3 @@
+/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
+(function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx"],function(b,d){return a(c,d,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){function e(){try{return n.apply(this,arguments)}catch(a){return J.e=a,J}}function f(a){if(!y(a))throw new TypeError("fn must be a function");return n=a,e}function g(a,b,c){return new r(function(d){var e=!1,f=null,g=[];return a.subscribe(function(a){var h,i;try{i=b(a)}catch(j){return void d.onError(j)}if(h=0,e)try{h=c(i,f)}catch(k){return void d.onError(k)}else e=!0,f=i;h>0&&(f=i,g=[]),h>=0&&g.push(a)},function(a){d.onError(a)},function(){d.onNext(g),d.onCompleted()})},a)}function h(a){if(0===a.length)throw new G;return a[0]}function i(a,b,c,d){if(0>b)throw new I;return new r(function(e){var f=b;return a.subscribe(function(a){0===f--&&(e.onNext(a),e.onCompleted())},function(a){e.onError(a)},function(){c?(e.onNext(d),e.onCompleted()):e.onError(new I)})},a)}function j(a,b,c){return new r(function(d){var e=c,f=!1;return a.subscribe(function(a){f?d.onError(new Error("Sequence contains more than one element")):(e=a,f=!0)},function(a){d.onError(a)},function(){f||b?(d.onNext(e),d.onCompleted()):d.onError(new G)})},a)}function k(a,b,c){return new r(function(d){return a.subscribe(function(a){d.onNext(a),d.onCompleted()},function(a){d.onError(a)},function(){b?(d.onNext(c),d.onCompleted()):d.onError(new G)})},a)}function l(a,b,c){return new r(function(d){var e=c,f=!1;return a.subscribe(function(a){e=a,f=!0},function(a){d.onError(a)},function(){f||b?(d.onNext(e),d.onCompleted()):d.onError(new G)})},a)}function m(a,b,c,e){var f=F(b,c,3);return new r(function(b){var c=0;return a.subscribe(function(d){var g;try{g=f(d,c,a)}catch(h){return void b.onError(h)}g?(b.onNext(e?c:d),b.onCompleted()):c++},function(a){b.onError(a)},function(){b.onNext(e?-1:d),b.onCompleted()})},a)}var n,o=c.Observable,p=o.prototype,q=c.CompositeDisposable,r=c.AnonymousObservable,s=c.Disposable.empty,t=(c.internals.isEqual,c.helpers),u=t.not,v=t.defaultComparer,w=t.identity,x=t.defaultSubComparer,y=t.isFunction,z=t.isPromise,A=t.isArrayLike,B=t.isIterable,C=c.internals.inherits,D=o.fromPromise,E=o.from,F=c.internals.bindCallback,G=c.EmptyError,H=c.ObservableBase,I=c.ArgumentOutOfRangeError,J={e:{}};p.aggregate=function(){var a,b,c=!1,d=this;return 2===arguments.length?(c=!0,b=arguments[0],a=arguments[1]):a=arguments[0],new r(function(e){var f,g,h;return d.subscribe(function(d){!h&&(h=!0);try{f?g=a(g,d):(g=c?a(b,d):d,f=!0)}catch(i){return e.onError(i)}},function(a){e.onError(a)},function(){h&&e.onNext(g),!h&&c&&e.onNext(b),!h&&!c&&e.onError(new G),e.onCompleted()})},d)};var K=function(a){function b(b,c,d,e){this.source=b,this.acc=c,this.hasSeed=d,this.seed=e,a.call(this)}function c(a,b){this.o=a,this.acc=b.acc,this.hasSeed=b.hasSeed,this.seed=b.seed,this.hasAccumulation=!1,this.result=null,this.hasValue=!1,this.isStopped=!1}return C(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this))},c.prototype.onNext=function(a){this.isStopped||(!this.hasValue&&(this.hasValue=!0),this.hasAccumulation?this.result=f(this.acc)(this.result,a):(this.result=this.hasSeed?f(this.acc)(this.seed,a):a,this.hasAccumulation=!0),this.result===J&&this.o.onError(this.result.e))},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.hasValue&&this.o.onNext(this.result),!this.hasValue&&this.hasSeed&&this.o.onNext(this.seed),!this.hasValue&&!this.hasSeed&&this.o.onError(new G),this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(H);return p.reduce=function(a){var b=!1;if(2===arguments.length){b=!0;var c=arguments[1]}return new K(this,a,b,c)},p.some=function(a,b){var c=this;return a?c.filter(a,b).some():new r(function(a){return c.subscribe(function(){a.onNext(!0),a.onCompleted()},function(b){a.onError(b)},function(){a.onNext(!1),a.onCompleted()})},c)},p.any=function(){return this.some.apply(this,arguments)},p.isEmpty=function(){return this.any().map(u)},p.every=function(a,b){return this.filter(function(b){return!a(b)},b).some().map(u)},p.all=function(){return this.every.apply(this,arguments)},p.includes=function(a,b){function c(a,b){return 0===a&&0===b||a===b||isNaN(a)&&isNaN(b)}var d=this;return new r(function(e){var f=0,g=+b||0;return Math.abs(g)===1/0&&(g=0),0>g?(e.onNext(!1),e.onCompleted(),s):d.subscribe(function(b){f++>=g&&c(b,a)&&(e.onNext(!0),e.onCompleted())},function(a){e.onError(a)},function(){e.onNext(!1),e.onCompleted()})},this)},p.contains=function(a,b){p.includes(a,b)},p.count=function(a,b){return a?this.filter(a,b).count():this.reduce(function(a){return a+1},0)},p.indexOf=function(a,b){var c=this;return new r(function(d){var e=0,f=+b||0;return Math.abs(f)===1/0&&(f=0),0>f?(d.onNext(-1),d.onCompleted(),s):c.subscribe(function(b){e>=f&&b===a&&(d.onNext(e),d.onCompleted()),e++},function(a){d.onError(a)},function(){d.onNext(-1),d.onCompleted()})},c)},p.sum=function(a,b){return a&&y(a)?this.map(a,b).sum():this.reduce(function(a,b){return a+b},0)},p.minBy=function(a,b){return b||(b=x),g(this,a,function(a,c){return-1*b(a,c)})},p.min=function(a){return this.minBy(w,a).map(function(a){return h(a)})},p.maxBy=function(a,b){return b||(b=x),g(this,a,b)},p.max=function(a){return this.maxBy(w,a).map(function(a){return h(a)})},p.average=function(a,b){return a&&y(a)?this.map(a,b).average():this.reduce(function(a,b){return{sum:a.sum+b,count:a.count+1}},{sum:0,count:0}).map(function(a){if(0===a.count)throw new G;return a.sum/a.count})},p.sequenceEqual=function(a,b){var c=this;return b||(b=v),new r(function(d){var e=!1,f=!1,g=[],h=[],i=c.subscribe(function(a){var c,e;if(h.length>0){e=h.shift();try{c=b(e,a)}catch(i){return void d.onError(i)}c||(d.onNext(!1),d.onCompleted())}else f?(d.onNext(!1),d.onCompleted()):g.push(a)},function(a){d.onError(a)},function(){e=!0,0===g.length&&(h.length>0?(d.onNext(!1),d.onCompleted()):f&&(d.onNext(!0),d.onCompleted()))});(A(a)||B(a))&&(a=E(a)),z(a)&&(a=D(a));var j=a.subscribe(function(a){var c;if(g.length>0){var f=g.shift();try{c=b(f,a)}catch(i){return void d.onError(i)}c||(d.onNext(!1),d.onCompleted())}else e?(d.onNext(!1),d.onCompleted()):h.push(a)},function(a){d.onError(a)},function(){f=!0,0===h.length&&(g.length>0?(d.onNext(!1),d.onCompleted()):e&&(d.onNext(!0),d.onCompleted()))});return new q(i,j)},c)},p.elementAt=function(a){return i(this,a,!1)},p.elementAtOrDefault=function(a,b){return i(this,a,!0,b)},p.single=function(a,b){return a&&y(a)?this.where(a,b).single():j(this,!1)},p.singleOrDefault=function(a,b,c){return a&&y(a)?this.filter(a,c).singleOrDefault(null,b):j(this,!0,b)},p.first=function(a,b){return a?this.where(a,b).first():k(this,!1)},p.firstOrDefault=function(a,b,c){return a?this.where(a).firstOrDefault(null,b):k(this,!0,b)},p.last=function(a,b){return a?this.where(a,b).last():l(this,!1)},p.lastOrDefault=function(a,b,c){return a?this.where(a,c).lastOrDefault(null,b):l(this,!0,b)},p.find=function(a,b){return m(this,a,b,!1)},p.findIndex=function(a,b){return m(this,a,b,!0)},p.toSet=function(){if("undefined"==typeof a.Set)throw new TypeError;var b=this;return new r(function(c){var d=new a.Set;return b.subscribe(function(a){d.add(a)},function(a){c.onError(a)},function(){c.onNext(d),c.onCompleted()})},b)},p.toMap=function(b,c){if("undefined"==typeof a.Map)throw new TypeError;var d=this;return new r(function(e){var f=new a.Map;return d.subscribe(function(a){var d;try{d=b(a)}catch(g){return void e.onError(g)}var h=a;if(c)try{h=c(a)}catch(g){return void e.onError(g)}f.set(d,h)},function(a){e.onError(a)},function(){e.onNext(f),e.onCompleted()})},d)},c});
+//# sourceMappingURL=rx.aggregates.map \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.all.compat.js b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.all.compat.js
new file mode 100644
index 00000000000..3bd0e349ea0
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.all.compat.js
@@ -0,0 +1,10945 @@
+// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
+
+;(function (undefined) {
+
+ var objectTypes = {
+ 'boolean': false,
+ 'function': true,
+ 'object': true,
+ 'number': false,
+ 'string': false,
+ 'undefined': false
+ };
+
+ var root = (objectTypes[typeof window] && window) || this,
+ freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
+ freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
+ moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
+ freeGlobal = objectTypes[typeof global] && global;
+
+ if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) {
+ root = freeGlobal;
+ }
+
+ var Rx = {
+ internals: {},
+ config: {
+ Promise: root.Promise
+ },
+ helpers: { }
+ };
+
+ // Defaults
+ var noop = Rx.helpers.noop = function () { },
+ notDefined = Rx.helpers.notDefined = function (x) { return typeof x === 'undefined'; },
+ identity = Rx.helpers.identity = function (x) { return x; },
+ pluck = Rx.helpers.pluck = function (property) { return function (x) { return x[property]; }; },
+ just = Rx.helpers.just = function (value) { return function () { return value; }; },
+ defaultNow = Rx.helpers.defaultNow = (function () { return !!Date.now ? Date.now : function () { return +new Date; }; }()),
+ defaultComparer = Rx.helpers.defaultComparer = function (x, y) { return isEqual(x, y); },
+ defaultSubComparer = Rx.helpers.defaultSubComparer = function (x, y) { return x > y ? 1 : (x < y ? -1 : 0); },
+ defaultKeySerializer = Rx.helpers.defaultKeySerializer = function (x) { return x.toString(); },
+ defaultError = Rx.helpers.defaultError = function (err) { throw err; },
+ isPromise = Rx.helpers.isPromise = function (p) { return !!p && typeof p.subscribe !== 'function' && typeof p.then === 'function'; },
+ asArray = Rx.helpers.asArray = function () { return Array.prototype.slice.call(arguments); },
+ not = Rx.helpers.not = function (a) { return !a; },
+ isFunction = Rx.helpers.isFunction = (function () {
+ var isFn = function (value) {
+ return typeof value == 'function' || false;
+ }
+
+ // fallback for older versions of Chrome and Safari
+ if (isFn(/x/)) {
+ isFn = function(value) {
+ return typeof value == 'function' && toString.call(value) == '[object Function]';
+ };
+ }
+ return isFn;
+ }());
+
+ function cloneArray(arr) {
+ var len = arr.length, a = new Array(len);
+ for(var i = 0; i < len; i++) { a[i] = arr[i]; }
+ return a;
+ }
+
+ Rx.config.longStackSupport = false;
+ var hasStacks = false;
+ try {
+ throw new Error();
+ } catch (e) {
+ hasStacks = !!e.stack;
+ }
+
+ // All code after this point will be filtered from stack traces reported by RxJS
+ var rStartingLine = captureLine(), rFileName;
+
+ var STACK_JUMP_SEPARATOR = "From previous event:";
+
+ function makeStackTraceLong(error, observable) {
+ // If possible, transform the error stack trace by removing Node and RxJS
+ // cruft, then concatenating with the stack trace of `observable`.
+ if (hasStacks &&
+ observable.stack &&
+ typeof error === "object" &&
+ error !== null &&
+ error.stack &&
+ error.stack.indexOf(STACK_JUMP_SEPARATOR) === -1
+ ) {
+ var stacks = [];
+ for (var o = observable; !!o; o = o.source) {
+ if (o.stack) {
+ stacks.unshift(o.stack);
+ }
+ }
+ stacks.unshift(error.stack);
+
+ var concatedStacks = stacks.join("\n" + STACK_JUMP_SEPARATOR + "\n");
+ error.stack = filterStackString(concatedStacks);
+ }
+ }
+
+ function filterStackString(stackString) {
+ var lines = stackString.split("\n"),
+ desiredLines = [];
+ for (var i = 0, len = lines.length; i < len; i++) {
+ var line = lines[i];
+
+ if (!isInternalFrame(line) && !isNodeFrame(line) && line) {
+ desiredLines.push(line);
+ }
+ }
+ return desiredLines.join("\n");
+ }
+
+ function isInternalFrame(stackLine) {
+ var fileNameAndLineNumber = getFileNameAndLineNumber(stackLine);
+ if (!fileNameAndLineNumber) {
+ return false;
+ }
+ var fileName = fileNameAndLineNumber[0], lineNumber = fileNameAndLineNumber[1];
+
+ return fileName === rFileName &&
+ lineNumber >= rStartingLine &&
+ lineNumber <= rEndingLine;
+ }
+
+ function isNodeFrame(stackLine) {
+ return stackLine.indexOf("(module.js:") !== -1 ||
+ stackLine.indexOf("(node.js:") !== -1;
+ }
+
+ function captureLine() {
+ if (!hasStacks) { return; }
+
+ try {
+ throw new Error();
+ } catch (e) {
+ var lines = e.stack.split("\n");
+ var firstLine = lines[0].indexOf("@") > 0 ? lines[1] : lines[2];
+ var fileNameAndLineNumber = getFileNameAndLineNumber(firstLine);
+ if (!fileNameAndLineNumber) { return; }
+
+ rFileName = fileNameAndLineNumber[0];
+ return fileNameAndLineNumber[1];
+ }
+ }
+
+ function getFileNameAndLineNumber(stackLine) {
+ // Named functions: "at functionName (filename:lineNumber:columnNumber)"
+ var attempt1 = /at .+ \((.+):(\d+):(?:\d+)\)$/.exec(stackLine);
+ if (attempt1) { return [attempt1[1], Number(attempt1[2])]; }
+
+ // Anonymous functions: "at filename:lineNumber:columnNumber"
+ var attempt2 = /at ([^ ]+):(\d+):(?:\d+)$/.exec(stackLine);
+ if (attempt2) { return [attempt2[1], Number(attempt2[2])]; }
+
+ // Firefox style: "function@filename:lineNumber or @filename:lineNumber"
+ var attempt3 = /.*@(.+):(\d+)$/.exec(stackLine);
+ if (attempt3) { return [attempt3[1], Number(attempt3[2])]; }
+ }
+
+ var EmptyError = Rx.EmptyError = function() {
+ this.message = 'Sequence contains no elements.';
+ Error.call(this);
+ };
+ EmptyError.prototype = Error.prototype;
+
+ var ObjectDisposedError = Rx.ObjectDisposedError = function() {
+ this.message = 'Object has been disposed';
+ Error.call(this);
+ };
+ ObjectDisposedError.prototype = Error.prototype;
+
+ var ArgumentOutOfRangeError = Rx.ArgumentOutOfRangeError = function () {
+ this.message = 'Argument out of range';
+ Error.call(this);
+ };
+ ArgumentOutOfRangeError.prototype = Error.prototype;
+
+ var NotSupportedError = Rx.NotSupportedError = function (message) {
+ this.message = message || 'This operation is not supported';
+ Error.call(this);
+ };
+ NotSupportedError.prototype = Error.prototype;
+
+ var NotImplementedError = Rx.NotImplementedError = function (message) {
+ this.message = message || 'This operation is not implemented';
+ Error.call(this);
+ };
+ NotImplementedError.prototype = Error.prototype;
+
+ var notImplemented = Rx.helpers.notImplemented = function () {
+ throw new NotImplementedError();
+ };
+
+ var notSupported = Rx.helpers.notSupported = function () {
+ throw new NotSupportedError();
+ };
+
+ // Shim in iterator support
+ var $iterator$ = (typeof Symbol === 'function' && Symbol.iterator) ||
+ '_es6shim_iterator_';
+ // Bug for mozilla version
+ if (root.Set && typeof new root.Set()['@@iterator'] === 'function') {
+ $iterator$ = '@@iterator';
+ }
+
+ var doneEnumerator = Rx.doneEnumerator = { done: true, value: undefined };
+
+ var isIterable = Rx.helpers.isIterable = function (o) {
+ return o[$iterator$] !== undefined;
+ }
+
+ var isArrayLike = Rx.helpers.isArrayLike = function (o) {
+ return o && o.length !== undefined;
+ }
+
+ Rx.helpers.iterator = $iterator$;
+
+ var bindCallback = Rx.internals.bindCallback = function (func, thisArg, argCount) {
+ if (typeof thisArg === 'undefined') { return func; }
+ switch(argCount) {
+ case 0:
+ return function() {
+ return func.call(thisArg)
+ };
+ case 1:
+ return function(arg) {
+ return func.call(thisArg, arg);
+ }
+ case 2:
+ return function(value, index) {
+ return func.call(thisArg, value, index);
+ };
+ case 3:
+ return function(value, index, collection) {
+ return func.call(thisArg, value, index, collection);
+ };
+ }
+
+ return function() {
+ return func.apply(thisArg, arguments);
+ };
+ };
+
+ /** Used to determine if values are of the language type Object */
+ var dontEnums = ['toString',
+ 'toLocaleString',
+ 'valueOf',
+ 'hasOwnProperty',
+ 'isPrototypeOf',
+ 'propertyIsEnumerable',
+ 'constructor'],
+ dontEnumsLength = dontEnums.length;
+
+ /** `Object#toString` result shortcuts */
+ var argsClass = '[object Arguments]',
+ arrayClass = '[object Array]',
+ boolClass = '[object Boolean]',
+ dateClass = '[object Date]',
+ errorClass = '[object Error]',
+ funcClass = '[object Function]',
+ numberClass = '[object Number]',
+ objectClass = '[object Object]',
+ regexpClass = '[object RegExp]',
+ stringClass = '[object String]';
+
+ var toString = Object.prototype.toString,
+ hasOwnProperty = Object.prototype.hasOwnProperty,
+ supportsArgsClass = toString.call(arguments) == argsClass, // For less <IE9 && FF<4
+ supportNodeClass,
+ errorProto = Error.prototype,
+ objectProto = Object.prototype,
+ stringProto = String.prototype,
+ propertyIsEnumerable = objectProto.propertyIsEnumerable;
+
+ try {
+ supportNodeClass = !(toString.call(document) == objectClass && !({ 'toString': 0 } + ''));
+ } catch (e) {
+ supportNodeClass = true;
+ }
+
+ var nonEnumProps = {};
+ nonEnumProps[arrayClass] = nonEnumProps[dateClass] = nonEnumProps[numberClass] = { 'constructor': true, 'toLocaleString': true, 'toString': true, 'valueOf': true };
+ nonEnumProps[boolClass] = nonEnumProps[stringClass] = { 'constructor': true, 'toString': true, 'valueOf': true };
+ nonEnumProps[errorClass] = nonEnumProps[funcClass] = nonEnumProps[regexpClass] = { 'constructor': true, 'toString': true };
+ nonEnumProps[objectClass] = { 'constructor': true };
+
+ var support = {};
+ (function () {
+ var ctor = function() { this.x = 1; },
+ props = [];
+
+ ctor.prototype = { 'valueOf': 1, 'y': 1 };
+ for (var key in new ctor) { props.push(key); }
+ for (key in arguments) { }
+
+ // Detect if `name` or `message` properties of `Error.prototype` are enumerable by default.
+ support.enumErrorProps = propertyIsEnumerable.call(errorProto, 'message') || propertyIsEnumerable.call(errorProto, 'name');
+
+ // Detect if `prototype` properties are enumerable by default.
+ support.enumPrototypes = propertyIsEnumerable.call(ctor, 'prototype');
+
+ // Detect if `arguments` object indexes are non-enumerable
+ support.nonEnumArgs = key != 0;
+
+ // Detect if properties shadowing those on `Object.prototype` are non-enumerable.
+ support.nonEnumShadows = !/valueOf/.test(props);
+ }(1));
+
+ var isObject = Rx.internals.isObject = function(value) {
+ var type = typeof value;
+ return value && (type == 'function' || type == 'object') || false;
+ };
+
+ function keysIn(object) {
+ var result = [];
+ if (!isObject(object)) {
+ return result;
+ }
+ if (support.nonEnumArgs && object.length && isArguments(object)) {
+ object = slice.call(object);
+ }
+ var skipProto = support.enumPrototypes && typeof object == 'function',
+ skipErrorProps = support.enumErrorProps && (object === errorProto || object instanceof Error);
+
+ for (var key in object) {
+ if (!(skipProto && key == 'prototype') &&
+ !(skipErrorProps && (key == 'message' || key == 'name'))) {
+ result.push(key);
+ }
+ }
+
+ if (support.nonEnumShadows && object !== objectProto) {
+ var ctor = object.constructor,
+ index = -1,
+ length = dontEnumsLength;
+
+ if (object === (ctor && ctor.prototype)) {
+ var className = object === stringProto ? stringClass : object === errorProto ? errorClass : toString.call(object),
+ nonEnum = nonEnumProps[className];
+ }
+ while (++index < length) {
+ key = dontEnums[index];
+ if (!(nonEnum && nonEnum[key]) && hasOwnProperty.call(object, key)) {
+ result.push(key);
+ }
+ }
+ }
+ return result;
+ }
+
+ function internalFor(object, callback, keysFunc) {
+ var index = -1,
+ props = keysFunc(object),
+ length = props.length;
+
+ while (++index < length) {
+ var key = props[index];
+ if (callback(object[key], key, object) === false) {
+ break;
+ }
+ }
+ return object;
+ }
+
+ function internalForIn(object, callback) {
+ return internalFor(object, callback, keysIn);
+ }
+
+ function isNode(value) {
+ // IE < 9 presents DOM nodes as `Object` objects except they have `toString`
+ // methods that are `typeof` "string" and still can coerce nodes to strings
+ return typeof value.toString != 'function' && typeof (value + '') == 'string';
+ }
+
+ var isArguments = function(value) {
+ return (value && typeof value == 'object') ? toString.call(value) == argsClass : false;
+ }
+
+ // fallback for browsers that can't detect `arguments` objects by [[Class]]
+ if (!supportsArgsClass) {
+ isArguments = function(value) {
+ return (value && typeof value == 'object') ? hasOwnProperty.call(value, 'callee') : false;
+ };
+ }
+
+ var isEqual = Rx.internals.isEqual = function (x, y) {
+ return deepEquals(x, y, [], []);
+ };
+
+ /** @private
+ * Used for deep comparison
+ **/
+ function deepEquals(a, b, stackA, stackB) {
+ // exit early for identical values
+ if (a === b) {
+ // treat `+0` vs. `-0` as not equal
+ return a !== 0 || (1 / a == 1 / b);
+ }
+
+ var type = typeof a,
+ otherType = typeof b;
+
+ // exit early for unlike primitive values
+ if (a === a && (a == null || b == null ||
+ (type != 'function' && type != 'object' && otherType != 'function' && otherType != 'object'))) {
+ return false;
+ }
+
+ // compare [[Class]] names
+ var className = toString.call(a),
+ otherClass = toString.call(b);
+
+ if (className == argsClass) {
+ className = objectClass;
+ }
+ if (otherClass == argsClass) {
+ otherClass = objectClass;
+ }
+ if (className != otherClass) {
+ return false;
+ }
+ switch (className) {
+ case boolClass:
+ case dateClass:
+ // coerce dates and booleans to numbers, dates to milliseconds and booleans
+ // to `1` or `0` treating invalid dates coerced to `NaN` as not equal
+ return +a == +b;
+
+ case numberClass:
+ // treat `NaN` vs. `NaN` as equal
+ return (a != +a) ?
+ b != +b :
+ // but treat `-0` vs. `+0` as not equal
+ (a == 0 ? (1 / a == 1 / b) : a == +b);
+
+ case regexpClass:
+ case stringClass:
+ // coerce regexes to strings (http://es5.github.io/#x15.10.6.4)
+ // treat string primitives and their corresponding object instances as equal
+ return a == String(b);
+ }
+ var isArr = className == arrayClass;
+ if (!isArr) {
+
+ // exit for functions and DOM nodes
+ if (className != objectClass || (!support.nodeClass && (isNode(a) || isNode(b)))) {
+ return false;
+ }
+ // in older versions of Opera, `arguments` objects have `Array` constructors
+ var ctorA = !support.argsObject && isArguments(a) ? Object : a.constructor,
+ ctorB = !support.argsObject && isArguments(b) ? Object : b.constructor;
+
+ // non `Object` object instances with different constructors are not equal
+ if (ctorA != ctorB &&
+ !(hasOwnProperty.call(a, 'constructor') && hasOwnProperty.call(b, 'constructor')) &&
+ !(isFunction(ctorA) && ctorA instanceof ctorA && isFunction(ctorB) && ctorB instanceof ctorB) &&
+ ('constructor' in a && 'constructor' in b)
+ ) {
+ return false;
+ }
+ }
+ // assume cyclic structures are equal
+ // the algorithm for detecting cyclic structures is adapted from ES 5.1
+ // section 15.12.3, abstract operation `JO` (http://es5.github.io/#x15.12.3)
+ var initedStack = !stackA;
+ stackA || (stackA = []);
+ stackB || (stackB = []);
+
+ var length = stackA.length;
+ while (length--) {
+ if (stackA[length] == a) {
+ return stackB[length] == b;
+ }
+ }
+ var size = 0;
+ var result = true;
+
+ // add `a` and `b` to the stack of traversed objects
+ stackA.push(a);
+ stackB.push(b);
+
+ // recursively compare objects and arrays (susceptible to call stack limits)
+ if (isArr) {
+ // compare lengths to determine if a deep comparison is necessary
+ length = a.length;
+ size = b.length;
+ result = size == length;
+
+ if (result) {
+ // deep compare the contents, ignoring non-numeric properties
+ while (size--) {
+ var index = length,
+ value = b[size];
+
+ if (!(result = deepEquals(a[size], value, stackA, stackB))) {
+ break;
+ }
+ }
+ }
+ }
+ else {
+ // deep compare objects using `forIn`, instead of `forOwn`, to avoid `Object.keys`
+ // which, in this case, is more costly
+ internalForIn(b, function(value, key, b) {
+ if (hasOwnProperty.call(b, key)) {
+ // count the number of properties.
+ size++;
+ // deep compare each property value.
+ return (result = hasOwnProperty.call(a, key) && deepEquals(a[key], value, stackA, stackB));
+ }
+ });
+
+ if (result) {
+ // ensure both objects have the same number of properties
+ internalForIn(a, function(value, key, a) {
+ if (hasOwnProperty.call(a, key)) {
+ // `size` will be `-1` if `a` has more properties than `b`
+ return (result = --size > -1);
+ }
+ });
+ }
+ }
+ stackA.pop();
+ stackB.pop();
+
+ return result;
+ }
+
+ var hasProp = {}.hasOwnProperty,
+ slice = Array.prototype.slice;
+
+ var inherits = this.inherits = Rx.internals.inherits = function (child, parent) {
+ function __() { this.constructor = child; }
+ __.prototype = parent.prototype;
+ child.prototype = new __();
+ };
+
+ var addProperties = Rx.internals.addProperties = function (obj) {
+ for(var sources = [], i = 1, len = arguments.length; i < len; i++) { sources.push(arguments[i]); }
+ for (var idx = 0, ln = sources.length; idx < ln; idx++) {
+ var source = sources[idx];
+ for (var prop in source) {
+ obj[prop] = source[prop];
+ }
+ }
+ };
+
+ // Rx Utils
+ var addRef = Rx.internals.addRef = function (xs, r) {
+ return new AnonymousObservable(function (observer) {
+ return new CompositeDisposable(r.getDisposable(), xs.subscribe(observer));
+ });
+ };
+
+ function arrayInitialize(count, factory) {
+ var a = new Array(count);
+ for (var i = 0; i < count; i++) {
+ a[i] = factory();
+ }
+ return a;
+ }
+
+ var errorObj = {e: {}};
+ var tryCatchTarget;
+ function tryCatcher() {
+ try {
+ return tryCatchTarget.apply(this, arguments);
+ } catch (e) {
+ errorObj.e = e;
+ return errorObj;
+ }
+ }
+ function tryCatch(fn) {
+ if (!isFunction(fn)) { throw new TypeError('fn must be a function'); }
+ tryCatchTarget = fn;
+ return tryCatcher;
+ }
+ function thrower(e) {
+ throw e;
+ }
+
+ // Utilities
+ if (!Function.prototype.bind) {
+ Function.prototype.bind = function (that) {
+ var target = this,
+ args = slice.call(arguments, 1);
+ var bound = function () {
+ if (this instanceof bound) {
+ function F() { }
+ F.prototype = target.prototype;
+ var self = new F();
+ var result = target.apply(self, args.concat(slice.call(arguments)));
+ if (Object(result) === result) {
+ return result;
+ }
+ return self;
+ } else {
+ return target.apply(that, args.concat(slice.call(arguments)));
+ }
+ };
+
+ return bound;
+ };
+ }
+
+ if (!Array.prototype.forEach) {
+ Array.prototype.forEach = function (callback, thisArg) {
+ var T, k;
+
+ if (this == null) {
+ throw new TypeError(" this is null or not defined");
+ }
+
+ var O = Object(this);
+ var len = O.length >>> 0;
+
+ if (typeof callback !== "function") {
+ throw new TypeError(callback + " is not a function");
+ }
+
+ if (arguments.length > 1) {
+ T = thisArg;
+ }
+
+ k = 0;
+ while (k < len) {
+ var kValue;
+ if (k in O) {
+ kValue = O[k];
+ callback.call(T, kValue, k, O);
+ }
+ k++;
+ }
+ };
+ }
+
+ var boxedString = Object("a"),
+ splitString = boxedString[0] != "a" || !(0 in boxedString);
+ if (!Array.prototype.every) {
+ Array.prototype.every = function every(fun /*, thisp */) {
+ var object = Object(this),
+ self = splitString && {}.toString.call(this) == stringClass ?
+ this.split("") :
+ object,
+ length = self.length >>> 0,
+ thisp = arguments[1];
+
+ if ({}.toString.call(fun) != funcClass) {
+ throw new TypeError(fun + " is not a function");
+ }
+
+ for (var i = 0; i < length; i++) {
+ if (i in self && !fun.call(thisp, self[i], i, object)) {
+ return false;
+ }
+ }
+ return true;
+ };
+ }
+
+ if (!Array.prototype.map) {
+ Array.prototype.map = function map(fun /*, thisp*/) {
+ var object = Object(this),
+ self = splitString && {}.toString.call(this) == stringClass ?
+ this.split("") :
+ object,
+ length = self.length >>> 0,
+ result = Array(length),
+ thisp = arguments[1];
+
+ if ({}.toString.call(fun) != funcClass) {
+ throw new TypeError(fun + " is not a function");
+ }
+
+ for (var i = 0; i < length; i++) {
+ if (i in self) {
+ result[i] = fun.call(thisp, self[i], i, object);
+ }
+ }
+ return result;
+ };
+ }
+
+ if (!Array.prototype.filter) {
+ Array.prototype.filter = function (predicate) {
+ var results = [], item, t = new Object(this);
+ for (var i = 0, len = t.length >>> 0; i < len; i++) {
+ item = t[i];
+ if (i in t && predicate.call(arguments[1], item, i, t)) {
+ results.push(item);
+ }
+ }
+ return results;
+ };
+ }
+
+ if (!Array.isArray) {
+ Array.isArray = function (arg) {
+ return {}.toString.call(arg) == arrayClass;
+ };
+ }
+
+ if (!Array.prototype.indexOf) {
+ Array.prototype.indexOf = function indexOf(searchElement) {
+ var t = Object(this);
+ var len = t.length >>> 0;
+ if (len === 0) {
+ return -1;
+ }
+ var n = 0;
+ if (arguments.length > 1) {
+ n = Number(arguments[1]);
+ if (n !== n) {
+ n = 0;
+ } else if (n !== 0 && n != Infinity && n !== -Infinity) {
+ n = (n > 0 || -1) * Math.floor(Math.abs(n));
+ }
+ }
+ if (n >= len) {
+ return -1;
+ }
+ var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0);
+ for (; k < len; k++) {
+ if (k in t && t[k] === searchElement) {
+ return k;
+ }
+ }
+ return -1;
+ };
+ }
+
+ // Fix for Tessel
+ if (!Object.prototype.propertyIsEnumerable) {
+ Object.prototype.propertyIsEnumerable = function (key) {
+ for (var k in this) { if (k === key) { return true; } }
+ return false;
+ };
+ }
+
+ if (!Object.keys) {
+ Object.keys = (function() {
+ 'use strict';
+ var hasOwnProperty = Object.prototype.hasOwnProperty,
+ hasDontEnumBug = !({ toString: null }).propertyIsEnumerable('toString');
+
+ return function(obj) {
+ if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) {
+ throw new TypeError('Object.keys called on non-object');
+ }
+
+ var result = [], prop, i;
+
+ for (prop in obj) {
+ if (hasOwnProperty.call(obj, prop)) {
+ result.push(prop);
+ }
+ }
+
+ if (hasDontEnumBug) {
+ for (i = 0; i < dontEnumsLength; i++) {
+ if (hasOwnProperty.call(obj, dontEnums[i])) {
+ result.push(dontEnums[i]);
+ }
+ }
+ }
+ return result;
+ };
+ }());
+ }
+
+ // Collections
+ function IndexedItem(id, value) {
+ this.id = id;
+ this.value = value;
+ }
+
+ IndexedItem.prototype.compareTo = function (other) {
+ var c = this.value.compareTo(other.value);
+ c === 0 && (c = this.id - other.id);
+ return c;
+ };
+
+ // Priority Queue for Scheduling
+ var PriorityQueue = Rx.internals.PriorityQueue = function (capacity) {
+ this.items = new Array(capacity);
+ this.length = 0;
+ };
+
+ var priorityProto = PriorityQueue.prototype;
+ priorityProto.isHigherPriority = function (left, right) {
+ return this.items[left].compareTo(this.items[right]) < 0;
+ };
+
+ priorityProto.percolate = function (index) {
+ if (index >= this.length || index < 0) { return; }
+ var parent = index - 1 >> 1;
+ if (parent < 0 || parent === index) { return; }
+ if (this.isHigherPriority(index, parent)) {
+ var temp = this.items[index];
+ this.items[index] = this.items[parent];
+ this.items[parent] = temp;
+ this.percolate(parent);
+ }
+ };
+
+ priorityProto.heapify = function (index) {
+ +index || (index = 0);
+ if (index >= this.length || index < 0) { return; }
+ var left = 2 * index + 1,
+ right = 2 * index + 2,
+ first = index;
+ if (left < this.length && this.isHigherPriority(left, first)) {
+ first = left;
+ }
+ if (right < this.length && this.isHigherPriority(right, first)) {
+ first = right;
+ }
+ if (first !== index) {
+ var temp = this.items[index];
+ this.items[index] = this.items[first];
+ this.items[first] = temp;
+ this.heapify(first);
+ }
+ };
+
+ priorityProto.peek = function () { return this.items[0].value; };
+
+ priorityProto.removeAt = function (index) {
+ this.items[index] = this.items[--this.length];
+ this.items[this.length] = undefined;
+ this.heapify();
+ };
+
+ priorityProto.dequeue = function () {
+ var result = this.peek();
+ this.removeAt(0);
+ return result;
+ };
+
+ priorityProto.enqueue = function (item) {
+ var index = this.length++;
+ this.items[index] = new IndexedItem(PriorityQueue.count++, item);
+ this.percolate(index);
+ };
+
+ priorityProto.remove = function (item) {
+ for (var i = 0; i < this.length; i++) {
+ if (this.items[i].value === item) {
+ this.removeAt(i);
+ return true;
+ }
+ }
+ return false;
+ };
+ PriorityQueue.count = 0;
+
+ /**
+ * Represents a group of disposable resources that are disposed together.
+ * @constructor
+ */
+ var CompositeDisposable = Rx.CompositeDisposable = function () {
+ var args = [], i, len;
+ if (Array.isArray(arguments[0])) {
+ args = arguments[0];
+ len = args.length;
+ } else {
+ len = arguments.length;
+ args = new Array(len);
+ for(i = 0; i < len; i++) { args[i] = arguments[i]; }
+ }
+ for(i = 0; i < len; i++) {
+ if (!isDisposable(args[i])) { throw new TypeError('Not a disposable'); }
+ }
+ this.disposables = args;
+ this.isDisposed = false;
+ this.length = args.length;
+ };
+
+ var CompositeDisposablePrototype = CompositeDisposable.prototype;
+
+ /**
+ * Adds a disposable to the CompositeDisposable or disposes the disposable if the CompositeDisposable is disposed.
+ * @param {Mixed} item Disposable to add.
+ */
+ CompositeDisposablePrototype.add = function (item) {
+ if (this.isDisposed) {
+ item.dispose();
+ } else {
+ this.disposables.push(item);
+ this.length++;
+ }
+ };
+
+ /**
+ * Removes and disposes the first occurrence of a disposable from the CompositeDisposable.
+ * @param {Mixed} item Disposable to remove.
+ * @returns {Boolean} true if found; false otherwise.
+ */
+ CompositeDisposablePrototype.remove = function (item) {
+ var shouldDispose = false;
+ if (!this.isDisposed) {
+ var idx = this.disposables.indexOf(item);
+ if (idx !== -1) {
+ shouldDispose = true;
+ this.disposables.splice(idx, 1);
+ this.length--;
+ item.dispose();
+ }
+ }
+ return shouldDispose;
+ };
+
+ /**
+ * Disposes all disposables in the group and removes them from the group.
+ */
+ CompositeDisposablePrototype.dispose = function () {
+ if (!this.isDisposed) {
+ this.isDisposed = true;
+ var len = this.disposables.length, currentDisposables = new Array(len);
+ for(var i = 0; i < len; i++) { currentDisposables[i] = this.disposables[i]; }
+ this.disposables = [];
+ this.length = 0;
+
+ for (i = 0; i < len; i++) {
+ currentDisposables[i].dispose();
+ }
+ }
+ };
+
+ /**
+ * Provides a set of static methods for creating Disposables.
+ * @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once.
+ */
+ var Disposable = Rx.Disposable = function (action) {
+ this.isDisposed = false;
+ this.action = action || noop;
+ };
+
+ /** Performs the task of cleaning up resources. */
+ Disposable.prototype.dispose = function () {
+ if (!this.isDisposed) {
+ this.action();
+ this.isDisposed = true;
+ }
+ };
+
+ /**
+ * Creates a disposable object that invokes the specified action when disposed.
+ * @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once.
+ * @return {Disposable} The disposable object that runs the given action upon disposal.
+ */
+ var disposableCreate = Disposable.create = function (action) { return new Disposable(action); };
+
+ /**
+ * Gets the disposable that does nothing when disposed.
+ */
+ var disposableEmpty = Disposable.empty = { dispose: noop };
+
+ /**
+ * Validates whether the given object is a disposable
+ * @param {Object} Object to test whether it has a dispose method
+ * @returns {Boolean} true if a disposable object, else false.
+ */
+ var isDisposable = Disposable.isDisposable = function (d) {
+ return d && isFunction(d.dispose);
+ };
+
+ var checkDisposed = Disposable.checkDisposed = function (disposable) {
+ if (disposable.isDisposed) { throw new ObjectDisposedError(); }
+ };
+
+ // Single assignment
+ var SingleAssignmentDisposable = Rx.SingleAssignmentDisposable = function () {
+ this.isDisposed = false;
+ this.current = null;
+ };
+ SingleAssignmentDisposable.prototype.getDisposable = function () {
+ return this.current;
+ };
+ SingleAssignmentDisposable.prototype.setDisposable = function (value) {
+ if (this.current) { throw new Error('Disposable has already been assigned'); }
+ var shouldDispose = this.isDisposed;
+ !shouldDispose && (this.current = value);
+ shouldDispose && value && value.dispose();
+ };
+ SingleAssignmentDisposable.prototype.dispose = function () {
+ if (!this.isDisposed) {
+ this.isDisposed = true;
+ var old = this.current;
+ this.current = null;
+ }
+ old && old.dispose();
+ };
+
+ // Multiple assignment disposable
+ var SerialDisposable = Rx.SerialDisposable = function () {
+ this.isDisposed = false;
+ this.current = null;
+ };
+ SerialDisposable.prototype.getDisposable = function () {
+ return this.current;
+ };
+ SerialDisposable.prototype.setDisposable = function (value) {
+ var shouldDispose = this.isDisposed;
+ if (!shouldDispose) {
+ var old = this.current;
+ this.current = value;
+ }
+ old && old.dispose();
+ shouldDispose && value && value.dispose();
+ };
+ SerialDisposable.prototype.dispose = function () {
+ if (!this.isDisposed) {
+ this.isDisposed = true;
+ var old = this.current;
+ this.current = null;
+ }
+ old && old.dispose();
+ };
+
+ /**
+ * Represents a disposable resource that only disposes its underlying disposable resource when all dependent disposable objects have been disposed.
+ */
+ var RefCountDisposable = Rx.RefCountDisposable = (function () {
+
+ function InnerDisposable(disposable) {
+ this.disposable = disposable;
+ this.disposable.count++;
+ this.isInnerDisposed = false;
+ }
+
+ InnerDisposable.prototype.dispose = function () {
+ if (!this.disposable.isDisposed && !this.isInnerDisposed) {
+ this.isInnerDisposed = true;
+ this.disposable.count--;
+ if (this.disposable.count === 0 && this.disposable.isPrimaryDisposed) {
+ this.disposable.isDisposed = true;
+ this.disposable.underlyingDisposable.dispose();
+ }
+ }
+ };
+
+ /**
+ * Initializes a new instance of the RefCountDisposable with the specified disposable.
+ * @constructor
+ * @param {Disposable} disposable Underlying disposable.
+ */
+ function RefCountDisposable(disposable) {
+ this.underlyingDisposable = disposable;
+ this.isDisposed = false;
+ this.isPrimaryDisposed = false;
+ this.count = 0;
+ }
+
+ /**
+ * Disposes the underlying disposable only when all dependent disposables have been disposed
+ */
+ RefCountDisposable.prototype.dispose = function () {
+ if (!this.isDisposed && !this.isPrimaryDisposed) {
+ this.isPrimaryDisposed = true;
+ if (this.count === 0) {
+ this.isDisposed = true;
+ this.underlyingDisposable.dispose();
+ }
+ }
+ };
+
+ /**
+ * Returns a dependent disposable that when disposed decreases the refcount on the underlying disposable.
+ * @returns {Disposable} A dependent disposable contributing to the reference count that manages the underlying disposable's lifetime.
+ */
+ RefCountDisposable.prototype.getDisposable = function () {
+ return this.isDisposed ? disposableEmpty : new InnerDisposable(this);
+ };
+
+ return RefCountDisposable;
+ })();
+
+ function ScheduledDisposable(scheduler, disposable) {
+ this.scheduler = scheduler;
+ this.disposable = disposable;
+ this.isDisposed = false;
+ }
+
+ function scheduleItem(s, self) {
+ if (!self.isDisposed) {
+ self.isDisposed = true;
+ self.disposable.dispose();
+ }
+ }
+
+ ScheduledDisposable.prototype.dispose = function () {
+ this.scheduler.scheduleWithState(this, scheduleItem);
+ };
+
+ var ScheduledItem = Rx.internals.ScheduledItem = function (scheduler, state, action, dueTime, comparer) {
+ this.scheduler = scheduler;
+ this.state = state;
+ this.action = action;
+ this.dueTime = dueTime;
+ this.comparer = comparer || defaultSubComparer;
+ this.disposable = new SingleAssignmentDisposable();
+ }
+
+ ScheduledItem.prototype.invoke = function () {
+ this.disposable.setDisposable(this.invokeCore());
+ };
+
+ ScheduledItem.prototype.compareTo = function (other) {
+ return this.comparer(this.dueTime, other.dueTime);
+ };
+
+ ScheduledItem.prototype.isCancelled = function () {
+ return this.disposable.isDisposed;
+ };
+
+ ScheduledItem.prototype.invokeCore = function () {
+ return this.action(this.scheduler, this.state);
+ };
+
+ /** Provides a set of static properties to access commonly used schedulers. */
+ var Scheduler = Rx.Scheduler = (function () {
+
+ function Scheduler(now, schedule, scheduleRelative, scheduleAbsolute) {
+ this.now = now;
+ this._schedule = schedule;
+ this._scheduleRelative = scheduleRelative;
+ this._scheduleAbsolute = scheduleAbsolute;
+ }
+
+ /** Determines whether the given object is a scheduler */
+ Scheduler.isScheduler = function (s) {
+ return s instanceof Scheduler;
+ }
+
+ function invokeAction(scheduler, action) {
+ action();
+ return disposableEmpty;
+ }
+
+ var schedulerProto = Scheduler.prototype;
+
+ /**
+ * Schedules an action to be executed.
+ * @param {Function} action Action to execute.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.schedule = function (action) {
+ return this._schedule(action, invokeAction);
+ };
+
+ /**
+ * Schedules an action to be executed.
+ * @param state State passed to the action to be executed.
+ * @param {Function} action Action to be executed.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleWithState = function (state, action) {
+ return this._schedule(state, action);
+ };
+
+ /**
+ * Schedules an action to be executed after the specified relative due time.
+ * @param {Function} action Action to execute.
+ * @param {Number} dueTime Relative time after which to execute the action.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleWithRelative = function (dueTime, action) {
+ return this._scheduleRelative(action, dueTime, invokeAction);
+ };
+
+ /**
+ * Schedules an action to be executed after dueTime.
+ * @param state State passed to the action to be executed.
+ * @param {Function} action Action to be executed.
+ * @param {Number} dueTime Relative time after which to execute the action.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleWithRelativeAndState = function (state, dueTime, action) {
+ return this._scheduleRelative(state, dueTime, action);
+ };
+
+ /**
+ * Schedules an action to be executed at the specified absolute due time.
+ * @param {Function} action Action to execute.
+ * @param {Number} dueTime Absolute time at which to execute the action.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleWithAbsolute = function (dueTime, action) {
+ return this._scheduleAbsolute(action, dueTime, invokeAction);
+ };
+
+ /**
+ * Schedules an action to be executed at dueTime.
+ * @param {Mixed} state State passed to the action to be executed.
+ * @param {Function} action Action to be executed.
+ * @param {Number}dueTime Absolute time at which to execute the action.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleWithAbsoluteAndState = function (state, dueTime, action) {
+ return this._scheduleAbsolute(state, dueTime, action);
+ };
+
+ /** Gets the current time according to the local machine's system clock. */
+ Scheduler.now = defaultNow;
+
+ /**
+ * Normalizes the specified TimeSpan value to a positive value.
+ * @param {Number} timeSpan The time span value to normalize.
+ * @returns {Number} The specified TimeSpan value if it is zero or positive; otherwise, 0
+ */
+ Scheduler.normalize = function (timeSpan) {
+ timeSpan < 0 && (timeSpan = 0);
+ return timeSpan;
+ };
+
+ return Scheduler;
+ }());
+
+ var normalizeTime = Scheduler.normalize, isScheduler = Scheduler.isScheduler;
+
+ (function (schedulerProto) {
+
+ function invokeRecImmediate(scheduler, pair) {
+ var state = pair[0], action = pair[1], group = new CompositeDisposable();
+
+ function recursiveAction(state1) {
+ action(state1, function (state2) {
+ var isAdded = false, isDone = false,
+ d = scheduler.scheduleWithState(state2, function (scheduler1, state3) {
+ if (isAdded) {
+ group.remove(d);
+ } else {
+ isDone = true;
+ }
+ recursiveAction(state3);
+ return disposableEmpty;
+ });
+ if (!isDone) {
+ group.add(d);
+ isAdded = true;
+ }
+ });
+ }
+ recursiveAction(state);
+ return group;
+ }
+
+ function invokeRecDate(scheduler, pair, method) {
+ var state = pair[0], action = pair[1], group = new CompositeDisposable();
+ function recursiveAction(state1) {
+ action(state1, function (state2, dueTime1) {
+ var isAdded = false, isDone = false,
+ d = scheduler[method](state2, dueTime1, function (scheduler1, state3) {
+ if (isAdded) {
+ group.remove(d);
+ } else {
+ isDone = true;
+ }
+ recursiveAction(state3);
+ return disposableEmpty;
+ });
+ if (!isDone) {
+ group.add(d);
+ isAdded = true;
+ }
+ });
+ };
+ recursiveAction(state);
+ return group;
+ }
+
+ function scheduleInnerRecursive(action, self) {
+ action(function(dt) { self(action, dt); });
+ }
+
+ /**
+ * Schedules an action to be executed recursively.
+ * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleRecursive = function (action) {
+ return this.scheduleRecursiveWithState(action, scheduleInnerRecursive);
+ };
+
+ /**
+ * Schedules an action to be executed recursively.
+ * @param {Mixed} state State passed to the action to be executed.
+ * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in recursive invocation state.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleRecursiveWithState = function (state, action) {
+ return this.scheduleWithState([state, action], invokeRecImmediate);
+ };
+
+ /**
+ * Schedules an action to be executed recursively after a specified relative due time.
+ * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified relative time.
+ * @param {Number}dueTime Relative time after which to execute the action for the first time.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleRecursiveWithRelative = function (dueTime, action) {
+ return this.scheduleRecursiveWithRelativeAndState(action, dueTime, scheduleInnerRecursive);
+ };
+
+ /**
+ * Schedules an action to be executed recursively after a specified relative due time.
+ * @param {Mixed} state State passed to the action to be executed.
+ * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state.
+ * @param {Number}dueTime Relative time after which to execute the action for the first time.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleRecursiveWithRelativeAndState = function (state, dueTime, action) {
+ return this._scheduleRelative([state, action], dueTime, function (s, p) {
+ return invokeRecDate(s, p, 'scheduleWithRelativeAndState');
+ });
+ };
+
+ /**
+ * Schedules an action to be executed recursively at a specified absolute due time.
+ * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified absolute time.
+ * @param {Number}dueTime Absolute time at which to execute the action for the first time.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleRecursiveWithAbsolute = function (dueTime, action) {
+ return this.scheduleRecursiveWithAbsoluteAndState(action, dueTime, scheduleInnerRecursive);
+ };
+
+ /**
+ * Schedules an action to be executed recursively at a specified absolute due time.
+ * @param {Mixed} state State passed to the action to be executed.
+ * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state.
+ * @param {Number}dueTime Absolute time at which to execute the action for the first time.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleRecursiveWithAbsoluteAndState = function (state, dueTime, action) {
+ return this._scheduleAbsolute([state, action], dueTime, function (s, p) {
+ return invokeRecDate(s, p, 'scheduleWithAbsoluteAndState');
+ });
+ };
+ }(Scheduler.prototype));
+
+ (function (schedulerProto) {
+
+ /**
+ * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation.
+ * @param {Number} period Period for running the work periodically.
+ * @param {Function} action Action to be executed.
+ * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort).
+ */
+ Scheduler.prototype.schedulePeriodic = function (period, action) {
+ return this.schedulePeriodicWithState(null, period, action);
+ };
+
+ /**
+ * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation.
+ * @param {Mixed} state Initial state passed to the action upon the first iteration.
+ * @param {Number} period Period for running the work periodically.
+ * @param {Function} action Action to be executed, potentially updating the state.
+ * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort).
+ */
+ Scheduler.prototype.schedulePeriodicWithState = function(state, period, action) {
+ if (typeof root.setInterval === 'undefined') { throw new NotSupportedError(); }
+ period = normalizeTime(period);
+ var s = state, id = root.setInterval(function () { s = action(s); }, period);
+ return disposableCreate(function () { root.clearInterval(id); });
+ };
+
+ }(Scheduler.prototype));
+
+ (function (schedulerProto) {
+ /**
+ * Returns a scheduler that wraps the original scheduler, adding exception handling for scheduled actions.
+ * @param {Function} handler Handler that's run if an exception is caught. The exception will be rethrown if the handler returns false.
+ * @returns {Scheduler} Wrapper around the original scheduler, enforcing exception handling.
+ */
+ schedulerProto.catchError = schedulerProto['catch'] = function (handler) {
+ return new CatchScheduler(this, handler);
+ };
+ }(Scheduler.prototype));
+
+ var SchedulePeriodicRecursive = Rx.internals.SchedulePeriodicRecursive = (function () {
+ function tick(command, recurse) {
+ recurse(0, this._period);
+ try {
+ this._state = this._action(this._state);
+ } catch (e) {
+ this._cancel.dispose();
+ throw e;
+ }
+ }
+
+ function SchedulePeriodicRecursive(scheduler, state, period, action) {
+ this._scheduler = scheduler;
+ this._state = state;
+ this._period = period;
+ this._action = action;
+ }
+
+ SchedulePeriodicRecursive.prototype.start = function () {
+ var d = new SingleAssignmentDisposable();
+ this._cancel = d;
+ d.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0, this._period, tick.bind(this)));
+
+ return d;
+ };
+
+ return SchedulePeriodicRecursive;
+ }());
+
+ /** Gets a scheduler that schedules work immediately on the current thread. */
+ var immediateScheduler = Scheduler.immediate = (function () {
+ function scheduleNow(state, action) { return action(this, state); }
+ return new Scheduler(defaultNow, scheduleNow, notSupported, notSupported);
+ }());
+
+ /**
+ * Gets a scheduler that schedules work as soon as possible on the current thread.
+ */
+ var currentThreadScheduler = Scheduler.currentThread = (function () {
+ var queue;
+
+ function runTrampoline () {
+ while (queue.length > 0) {
+ var item = queue.dequeue();
+ !item.isCancelled() && item.invoke();
+ }
+ }
+
+ function scheduleNow(state, action) {
+ var si = new ScheduledItem(this, state, action, this.now());
+
+ if (!queue) {
+ queue = new PriorityQueue(4);
+ queue.enqueue(si);
+
+ var result = tryCatch(runTrampoline)();
+ queue = null;
+ if (result === errorObj) { return thrower(result.e); }
+ } else {
+ queue.enqueue(si);
+ }
+ return si.disposable;
+ }
+
+ var currentScheduler = new Scheduler(defaultNow, scheduleNow, notSupported, notSupported);
+ currentScheduler.scheduleRequired = function () { return !queue; };
+
+ return currentScheduler;
+ }());
+
+ var scheduleMethod, clearMethod;
+
+ var localTimer = (function () {
+ var localSetTimeout, localClearTimeout = noop;
+ if (!!root.setTimeout) {
+ localSetTimeout = root.setTimeout;
+ localClearTimeout = root.clearTimeout;
+ } else if (!!root.WScript) {
+ localSetTimeout = function (fn, time) {
+ root.WScript.Sleep(time);
+ fn();
+ };
+ } else {
+ throw new NotSupportedError();
+ }
+
+ return {
+ setTimeout: localSetTimeout,
+ clearTimeout: localClearTimeout
+ };
+ }());
+ var localSetTimeout = localTimer.setTimeout,
+ localClearTimeout = localTimer.clearTimeout;
+
+ (function () {
+
+ var nextHandle = 1, tasksByHandle = {}, currentlyRunning = false;
+
+ clearMethod = function (handle) {
+ delete tasksByHandle[handle];
+ };
+
+ function runTask(handle) {
+ if (currentlyRunning) {
+ localSetTimeout(function () { runTask(handle) }, 0);
+ } else {
+ var task = tasksByHandle[handle];
+ if (task) {
+ currentlyRunning = true;
+ var result = tryCatch(task)();
+ clearMethod(handle);
+ currentlyRunning = false;
+ if (result === errorObj) { return thrower(result.e); }
+ }
+ }
+ }
+
+ var reNative = RegExp('^' +
+ String(toString)
+ .replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
+ .replace(/toString| for [^\]]+/g, '.*?') + '$'
+ );
+
+ var setImmediate = typeof (setImmediate = freeGlobal && moduleExports && freeGlobal.setImmediate) == 'function' &&
+ !reNative.test(setImmediate) && setImmediate;
+
+ function postMessageSupported () {
+ // Ensure not in a worker
+ if (!root.postMessage || root.importScripts) { return false; }
+ var isAsync = false, oldHandler = root.onmessage;
+ // Test for async
+ root.onmessage = function () { isAsync = true; };
+ root.postMessage('', '*');
+ root.onmessage = oldHandler;
+
+ return isAsync;
+ }
+
+ // Use in order, setImmediate, nextTick, postMessage, MessageChannel, script readystatechanged, setTimeout
+ if (isFunction(setImmediate)) {
+ scheduleMethod = function (action) {
+ var id = nextHandle++;
+ tasksByHandle[id] = action;
+ setImmediate(function () { runTask(id); });
+
+ return id;
+ };
+ } else if (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]') {
+ scheduleMethod = function (action) {
+ var id = nextHandle++;
+ tasksByHandle[id] = action;
+ process.nextTick(function () { runTask(id); });
+
+ return id;
+ };
+ } else if (postMessageSupported()) {
+ var MSG_PREFIX = 'ms.rx.schedule' + Math.random();
+
+ function onGlobalPostMessage(event) {
+ // Only if we're a match to avoid any other global events
+ if (typeof event.data === 'string' && event.data.substring(0, MSG_PREFIX.length) === MSG_PREFIX) {
+ runTask(event.data.substring(MSG_PREFIX.length));
+ }
+ }
+
+ if (root.addEventListener) {
+ root.addEventListener('message', onGlobalPostMessage, false);
+ } else if (root.attachEvent) {
+ root.attachEvent('onmessage', onGlobalPostMessage);
+ } else {
+ root.onmessage = onGlobalPostMessage;
+ }
+
+ scheduleMethod = function (action) {
+ var id = nextHandle++;
+ tasksByHandle[id] = action;
+ root.postMessage(MSG_PREFIX + currentId, '*');
+ return id;
+ };
+ } else if (!!root.MessageChannel) {
+ var channel = new root.MessageChannel();
+
+ channel.port1.onmessage = function (e) { runTask(e.data); };
+
+ scheduleMethod = function (action) {
+ var id = nextHandle++;
+ tasksByHandle[id] = action;
+ channel.port2.postMessage(id);
+ return id;
+ };
+ } else if ('document' in root && 'onreadystatechange' in root.document.createElement('script')) {
+
+ scheduleMethod = function (action) {
+ var scriptElement = root.document.createElement('script');
+ var id = nextHandle++;
+ tasksByHandle[id] = action;
+
+ scriptElement.onreadystatechange = function () {
+ runTask(id);
+ scriptElement.onreadystatechange = null;
+ scriptElement.parentNode.removeChild(scriptElement);
+ scriptElement = null;
+ };
+ root.document.documentElement.appendChild(scriptElement);
+ return id;
+ };
+
+ } else {
+ scheduleMethod = function (action) {
+ var id = nextHandle++;
+ tasksByHandle[id] = action;
+ localSetTimeout(function () {
+ runTask(id);
+ }, 0);
+
+ return id;
+ };
+ }
+ }());
+
+ /**
+ * Gets a scheduler that schedules work via a timed callback based upon platform.
+ */
+ var timeoutScheduler = Scheduler.timeout = Scheduler['default'] = (function () {
+
+ function scheduleNow(state, action) {
+ var scheduler = this, disposable = new SingleAssignmentDisposable();
+ var id = scheduleMethod(function () {
+ !disposable.isDisposed && disposable.setDisposable(action(scheduler, state));
+ });
+ return new CompositeDisposable(disposable, disposableCreate(function () {
+ clearMethod(id);
+ }));
+ }
+
+ function scheduleRelative(state, dueTime, action) {
+ var scheduler = this, dt = Scheduler.normalize(dueTime), disposable = new SingleAssignmentDisposable();
+ if (dt === 0) { return scheduler.scheduleWithState(state, action); }
+ var id = localSetTimeout(function () {
+ !disposable.isDisposed && disposable.setDisposable(action(scheduler, state));
+ }, dt);
+ return new CompositeDisposable(disposable, disposableCreate(function () {
+ localClearTimeout(id);
+ }));
+ }
+
+ function scheduleAbsolute(state, dueTime, action) {
+ return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action);
+ }
+
+ return new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute);
+ })();
+
+ var CatchScheduler = (function (__super__) {
+
+ function scheduleNow(state, action) {
+ return this._scheduler.scheduleWithState(state, this._wrap(action));
+ }
+
+ function scheduleRelative(state, dueTime, action) {
+ return this._scheduler.scheduleWithRelativeAndState(state, dueTime, this._wrap(action));
+ }
+
+ function scheduleAbsolute(state, dueTime, action) {
+ return this._scheduler.scheduleWithAbsoluteAndState(state, dueTime, this._wrap(action));
+ }
+
+ inherits(CatchScheduler, __super__);
+
+ function CatchScheduler(scheduler, handler) {
+ this._scheduler = scheduler;
+ this._handler = handler;
+ this._recursiveOriginal = null;
+ this._recursiveWrapper = null;
+ __super__.call(this, this._scheduler.now.bind(this._scheduler), scheduleNow, scheduleRelative, scheduleAbsolute);
+ }
+
+ CatchScheduler.prototype._clone = function (scheduler) {
+ return new CatchScheduler(scheduler, this._handler);
+ };
+
+ CatchScheduler.prototype._wrap = function (action) {
+ var parent = this;
+ return function (self, state) {
+ try {
+ return action(parent._getRecursiveWrapper(self), state);
+ } catch (e) {
+ if (!parent._handler(e)) { throw e; }
+ return disposableEmpty;
+ }
+ };
+ };
+
+ CatchScheduler.prototype._getRecursiveWrapper = function (scheduler) {
+ if (this._recursiveOriginal !== scheduler) {
+ this._recursiveOriginal = scheduler;
+ var wrapper = this._clone(scheduler);
+ wrapper._recursiveOriginal = scheduler;
+ wrapper._recursiveWrapper = wrapper;
+ this._recursiveWrapper = wrapper;
+ }
+ return this._recursiveWrapper;
+ };
+
+ CatchScheduler.prototype.schedulePeriodicWithState = function (state, period, action) {
+ var self = this, failed = false, d = new SingleAssignmentDisposable();
+
+ d.setDisposable(this._scheduler.schedulePeriodicWithState(state, period, function (state1) {
+ if (failed) { return null; }
+ try {
+ return action(state1);
+ } catch (e) {
+ failed = true;
+ if (!self._handler(e)) { throw e; }
+ d.dispose();
+ return null;
+ }
+ }));
+
+ return d;
+ };
+
+ return CatchScheduler;
+ }(Scheduler));
+
+ /**
+ * Represents a notification to an observer.
+ */
+ var Notification = Rx.Notification = (function () {
+ function Notification(kind, value, exception, accept, acceptObservable, toString) {
+ this.kind = kind;
+ this.value = value;
+ this.exception = exception;
+ this._accept = accept;
+ this._acceptObservable = acceptObservable;
+ this.toString = toString;
+ }
+
+ /**
+ * Invokes the delegate corresponding to the notification or the observer's method corresponding to the notification and returns the produced result.
+ *
+ * @memberOf Notification
+ * @param {Any} observerOrOnNext Delegate to invoke for an OnNext notification or Observer to invoke the notification on..
+ * @param {Function} onError Delegate to invoke for an OnError notification.
+ * @param {Function} onCompleted Delegate to invoke for an OnCompleted notification.
+ * @returns {Any} Result produced by the observation.
+ */
+ Notification.prototype.accept = function (observerOrOnNext, onError, onCompleted) {
+ return observerOrOnNext && typeof observerOrOnNext === 'object' ?
+ this._acceptObservable(observerOrOnNext) :
+ this._accept(observerOrOnNext, onError, onCompleted);
+ };
+
+ /**
+ * Returns an observable sequence with a single notification.
+ *
+ * @memberOf Notifications
+ * @param {Scheduler} [scheduler] Scheduler to send out the notification calls on.
+ * @returns {Observable} The observable sequence that surfaces the behavior of the notification upon subscription.
+ */
+ Notification.prototype.toObservable = function (scheduler) {
+ var self = this;
+ isScheduler(scheduler) || (scheduler = immediateScheduler);
+ return new AnonymousObservable(function (observer) {
+ return scheduler.scheduleWithState(self, function (_, notification) {
+ notification._acceptObservable(observer);
+ notification.kind === 'N' && observer.onCompleted();
+ });
+ });
+ };
+
+ return Notification;
+ })();
+
+ /**
+ * Creates an object that represents an OnNext notification to an observer.
+ * @param {Any} value The value contained in the notification.
+ * @returns {Notification} The OnNext notification containing the value.
+ */
+ var notificationCreateOnNext = Notification.createOnNext = (function () {
+ function _accept(onNext) { return onNext(this.value); }
+ function _acceptObservable(observer) { return observer.onNext(this.value); }
+ function toString() { return 'OnNext(' + this.value + ')'; }
+
+ return function (value) {
+ return new Notification('N', value, null, _accept, _acceptObservable, toString);
+ };
+ }());
+
+ /**
+ * Creates an object that represents an OnError notification to an observer.
+ * @param {Any} error The exception contained in the notification.
+ * @returns {Notification} The OnError notification containing the exception.
+ */
+ var notificationCreateOnError = Notification.createOnError = (function () {
+ function _accept (onNext, onError) { return onError(this.exception); }
+ function _acceptObservable(observer) { return observer.onError(this.exception); }
+ function toString () { return 'OnError(' + this.exception + ')'; }
+
+ return function (e) {
+ return new Notification('E', null, e, _accept, _acceptObservable, toString);
+ };
+ }());
+
+ /**
+ * Creates an object that represents an OnCompleted notification to an observer.
+ * @returns {Notification} The OnCompleted notification.
+ */
+ var notificationCreateOnCompleted = Notification.createOnCompleted = (function () {
+ function _accept (onNext, onError, onCompleted) { return onCompleted(); }
+ function _acceptObservable(observer) { return observer.onCompleted(); }
+ function toString () { return 'OnCompleted()'; }
+
+ return function () {
+ return new Notification('C', null, null, _accept, _acceptObservable, toString);
+ };
+ }());
+
+ /**
+ * Supports push-style iteration over an observable sequence.
+ */
+ var Observer = Rx.Observer = function () { };
+
+ /**
+ * Creates a notification callback from an observer.
+ * @returns The action that forwards its input notification to the underlying observer.
+ */
+ Observer.prototype.toNotifier = function () {
+ var observer = this;
+ return function (n) { return n.accept(observer); };
+ };
+
+ /**
+ * Hides the identity of an observer.
+ * @returns An observer that hides the identity of the specified observer.
+ */
+ Observer.prototype.asObserver = function () {
+ return new AnonymousObserver(this.onNext.bind(this), this.onError.bind(this), this.onCompleted.bind(this));
+ };
+
+ /**
+ * Checks access to the observer for grammar violations. This includes checking for multiple OnError or OnCompleted calls, as well as reentrancy in any of the observer methods.
+ * If a violation is detected, an Error is thrown from the offending observer method call.
+ * @returns An observer that checks callbacks invocations against the observer grammar and, if the checks pass, forwards those to the specified observer.
+ */
+ Observer.prototype.checked = function () { return new CheckedObserver(this); };
+
+ /**
+ * Creates an observer from the specified OnNext, along with optional OnError, and OnCompleted actions.
+ * @param {Function} [onNext] Observer's OnNext action implementation.
+ * @param {Function} [onError] Observer's OnError action implementation.
+ * @param {Function} [onCompleted] Observer's OnCompleted action implementation.
+ * @returns {Observer} The observer object implemented using the given actions.
+ */
+ var observerCreate = Observer.create = function (onNext, onError, onCompleted) {
+ onNext || (onNext = noop);
+ onError || (onError = defaultError);
+ onCompleted || (onCompleted = noop);
+ return new AnonymousObserver(onNext, onError, onCompleted);
+ };
+
+ /**
+ * Creates an observer from a notification callback.
+ *
+ * @static
+ * @memberOf Observer
+ * @param {Function} handler Action that handles a notification.
+ * @returns The observer object that invokes the specified handler using a notification corresponding to each message it receives.
+ */
+ Observer.fromNotifier = function (handler, thisArg) {
+ return new AnonymousObserver(function (x) {
+ return handler.call(thisArg, notificationCreateOnNext(x));
+ }, function (e) {
+ return handler.call(thisArg, notificationCreateOnError(e));
+ }, function () {
+ return handler.call(thisArg, notificationCreateOnCompleted());
+ });
+ };
+
+ /**
+ * Schedules the invocation of observer methods on the given scheduler.
+ * @param {Scheduler} scheduler Scheduler to schedule observer messages on.
+ * @returns {Observer} Observer whose messages are scheduled on the given scheduler.
+ */
+ Observer.prototype.notifyOn = function (scheduler) {
+ return new ObserveOnObserver(scheduler, this);
+ };
+
+ Observer.prototype.makeSafe = function(disposable) {
+ return new AnonymousSafeObserver(this._onNext, this._onError, this._onCompleted, disposable);
+ };
+
+ /**
+ * Abstract base class for implementations of the Observer class.
+ * This base class enforces the grammar of observers where OnError and OnCompleted are terminal messages.
+ */
+ var AbstractObserver = Rx.internals.AbstractObserver = (function (__super__) {
+ inherits(AbstractObserver, __super__);
+
+ /**
+ * Creates a new observer in a non-stopped state.
+ */
+ function AbstractObserver() {
+ this.isStopped = false;
+ __super__.call(this);
+ }
+
+ // Must be implemented by other observers
+ AbstractObserver.prototype.next = notImplemented;
+ AbstractObserver.prototype.error = notImplemented;
+ AbstractObserver.prototype.completed = notImplemented;
+
+ /**
+ * Notifies the observer of a new element in the sequence.
+ * @param {Any} value Next element in the sequence.
+ */
+ AbstractObserver.prototype.onNext = function (value) {
+ if (!this.isStopped) { this.next(value); }
+ };
+
+ /**
+ * Notifies the observer that an exception has occurred.
+ * @param {Any} error The error that has occurred.
+ */
+ AbstractObserver.prototype.onError = function (error) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.error(error);
+ }
+ };
+
+ /**
+ * Notifies the observer of the end of the sequence.
+ */
+ AbstractObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.completed();
+ }
+ };
+
+ /**
+ * Disposes the observer, causing it to transition to the stopped state.
+ */
+ AbstractObserver.prototype.dispose = function () {
+ this.isStopped = true;
+ };
+
+ AbstractObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.error(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ return AbstractObserver;
+ }(Observer));
+
+ /**
+ * Class to create an Observer instance from delegate-based implementations of the on* methods.
+ */
+ var AnonymousObserver = Rx.AnonymousObserver = (function (__super__) {
+ inherits(AnonymousObserver, __super__);
+
+ /**
+ * Creates an observer from the specified OnNext, OnError, and OnCompleted actions.
+ * @param {Any} onNext Observer's OnNext action implementation.
+ * @param {Any} onError Observer's OnError action implementation.
+ * @param {Any} onCompleted Observer's OnCompleted action implementation.
+ */
+ function AnonymousObserver(onNext, onError, onCompleted) {
+ __super__.call(this);
+ this._onNext = onNext;
+ this._onError = onError;
+ this._onCompleted = onCompleted;
+ }
+
+ /**
+ * Calls the onNext action.
+ * @param {Any} value Next element in the sequence.
+ */
+ AnonymousObserver.prototype.next = function (value) {
+ this._onNext(value);
+ };
+
+ /**
+ * Calls the onError action.
+ * @param {Any} error The error that has occurred.
+ */
+ AnonymousObserver.prototype.error = function (error) {
+ this._onError(error);
+ };
+
+ /**
+ * Calls the onCompleted action.
+ */
+ AnonymousObserver.prototype.completed = function () {
+ this._onCompleted();
+ };
+
+ return AnonymousObserver;
+ }(AbstractObserver));
+
+ var CheckedObserver = (function (__super__) {
+ inherits(CheckedObserver, __super__);
+
+ function CheckedObserver(observer) {
+ __super__.call(this);
+ this._observer = observer;
+ this._state = 0; // 0 - idle, 1 - busy, 2 - done
+ }
+
+ var CheckedObserverPrototype = CheckedObserver.prototype;
+
+ CheckedObserverPrototype.onNext = function (value) {
+ this.checkAccess();
+ var res = tryCatch(this._observer.onNext).call(this._observer, value);
+ this._state = 0;
+ res === errorObj && thrower(res.e);
+ };
+
+ CheckedObserverPrototype.onError = function (err) {
+ this.checkAccess();
+ var res = tryCatch(this._observer.onError).call(this._observer, err);
+ this._state = 2;
+ res === errorObj && thrower(res.e);
+ };
+
+ CheckedObserverPrototype.onCompleted = function () {
+ this.checkAccess();
+ var res = tryCatch(this._observer.onCompleted).call(this._observer);
+ this._state = 2;
+ res === errorObj && thrower(res.e);
+ };
+
+ CheckedObserverPrototype.checkAccess = function () {
+ if (this._state === 1) { throw new Error('Re-entrancy detected'); }
+ if (this._state === 2) { throw new Error('Observer completed'); }
+ if (this._state === 0) { this._state = 1; }
+ };
+
+ return CheckedObserver;
+ }(Observer));
+
+ var ScheduledObserver = Rx.internals.ScheduledObserver = (function (__super__) {
+ inherits(ScheduledObserver, __super__);
+
+ function ScheduledObserver(scheduler, observer) {
+ __super__.call(this);
+ this.scheduler = scheduler;
+ this.observer = observer;
+ this.isAcquired = false;
+ this.hasFaulted = false;
+ this.queue = [];
+ this.disposable = new SerialDisposable();
+ }
+
+ ScheduledObserver.prototype.next = function (value) {
+ var self = this;
+ this.queue.push(function () { self.observer.onNext(value); });
+ };
+
+ ScheduledObserver.prototype.error = function (e) {
+ var self = this;
+ this.queue.push(function () { self.observer.onError(e); });
+ };
+
+ ScheduledObserver.prototype.completed = function () {
+ var self = this;
+ this.queue.push(function () { self.observer.onCompleted(); });
+ };
+
+ ScheduledObserver.prototype.ensureActive = function () {
+ var isOwner = false, parent = this;
+ if (!this.hasFaulted && this.queue.length > 0) {
+ isOwner = !this.isAcquired;
+ this.isAcquired = true;
+ }
+ if (isOwner) {
+ this.disposable.setDisposable(this.scheduler.scheduleRecursive(function (self) {
+ var work;
+ if (parent.queue.length > 0) {
+ work = parent.queue.shift();
+ } else {
+ parent.isAcquired = false;
+ return;
+ }
+ try {
+ work();
+ } catch (ex) {
+ parent.queue = [];
+ parent.hasFaulted = true;
+ throw ex;
+ }
+ self();
+ }));
+ }
+ };
+
+ ScheduledObserver.prototype.dispose = function () {
+ __super__.prototype.dispose.call(this);
+ this.disposable.dispose();
+ };
+
+ return ScheduledObserver;
+ }(AbstractObserver));
+
+ var ObserveOnObserver = (function (__super__) {
+ inherits(ObserveOnObserver, __super__);
+
+ function ObserveOnObserver(scheduler, observer, cancel) {
+ __super__.call(this, scheduler, observer);
+ this._cancel = cancel;
+ }
+
+ ObserveOnObserver.prototype.next = function (value) {
+ __super__.prototype.next.call(this, value);
+ this.ensureActive();
+ };
+
+ ObserveOnObserver.prototype.error = function (e) {
+ __super__.prototype.error.call(this, e);
+ this.ensureActive();
+ };
+
+ ObserveOnObserver.prototype.completed = function () {
+ __super__.prototype.completed.call(this);
+ this.ensureActive();
+ };
+
+ ObserveOnObserver.prototype.dispose = function () {
+ __super__.prototype.dispose.call(this);
+ this._cancel && this._cancel.dispose();
+ this._cancel = null;
+ };
+
+ return ObserveOnObserver;
+ })(ScheduledObserver);
+
+ var observableProto;
+
+ /**
+ * Represents a push-style collection.
+ */
+ var Observable = Rx.Observable = (function () {
+
+ function Observable(subscribe) {
+ if (Rx.config.longStackSupport && hasStacks) {
+ try {
+ throw new Error();
+ } catch (e) {
+ this.stack = e.stack.substring(e.stack.indexOf("\n") + 1);
+ }
+
+ var self = this;
+ this._subscribe = function (observer) {
+ var oldOnError = observer.onError.bind(observer);
+
+ observer.onError = function (err) {
+ makeStackTraceLong(err, self);
+ oldOnError(err);
+ };
+
+ return subscribe.call(self, observer);
+ };
+ } else {
+ this._subscribe = subscribe;
+ }
+ }
+
+ observableProto = Observable.prototype;
+
+ /**
+ * Subscribes an observer to the observable sequence.
+ * @param {Mixed} [observerOrOnNext] The object that is to receive notifications or an action to invoke for each element in the observable sequence.
+ * @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence.
+ * @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence.
+ * @returns {Diposable} A disposable handling the subscriptions and unsubscriptions.
+ */
+ observableProto.subscribe = observableProto.forEach = function (observerOrOnNext, onError, onCompleted) {
+ return this._subscribe(typeof observerOrOnNext === 'object' ?
+ observerOrOnNext :
+ observerCreate(observerOrOnNext, onError, onCompleted));
+ };
+
+ /**
+ * Subscribes to the next value in the sequence with an optional "this" argument.
+ * @param {Function} onNext The function to invoke on each element in the observable sequence.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions.
+ */
+ observableProto.subscribeOnNext = function (onNext, thisArg) {
+ return this._subscribe(observerCreate(typeof thisArg !== 'undefined' ? function(x) { onNext.call(thisArg, x); } : onNext));
+ };
+
+ /**
+ * Subscribes to an exceptional condition in the sequence with an optional "this" argument.
+ * @param {Function} onError The function to invoke upon exceptional termination of the observable sequence.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions.
+ */
+ observableProto.subscribeOnError = function (onError, thisArg) {
+ return this._subscribe(observerCreate(null, typeof thisArg !== 'undefined' ? function(e) { onError.call(thisArg, e); } : onError));
+ };
+
+ /**
+ * Subscribes to the next value in the sequence with an optional "this" argument.
+ * @param {Function} onCompleted The function to invoke upon graceful termination of the observable sequence.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions.
+ */
+ observableProto.subscribeOnCompleted = function (onCompleted, thisArg) {
+ return this._subscribe(observerCreate(null, null, typeof thisArg !== 'undefined' ? function() { onCompleted.call(thisArg); } : onCompleted));
+ };
+
+ return Observable;
+ })();
+
+ var ObservableBase = Rx.ObservableBase = (function (__super__) {
+ inherits(ObservableBase, __super__);
+
+ function fixSubscriber(subscriber) {
+ return subscriber && isFunction(subscriber.dispose) ? subscriber :
+ isFunction(subscriber) ? disposableCreate(subscriber) : disposableEmpty;
+ }
+
+ function setDisposable(s, state) {
+ var ado = state[0], self = state[1];
+ var sub = tryCatch(self.subscribeCore).call(self, ado);
+
+ if (sub === errorObj) {
+ if(!ado.fail(errorObj.e)) { return thrower(errorObj.e); }
+ }
+ ado.setDisposable(fixSubscriber(sub));
+ }
+
+ function subscribe(observer) {
+ var ado = new AutoDetachObserver(observer), state = [ado, this];
+
+ if (currentThreadScheduler.scheduleRequired()) {
+ currentThreadScheduler.scheduleWithState(state, setDisposable);
+ } else {
+ setDisposable(null, state);
+ }
+ return ado;
+ }
+
+ function ObservableBase() {
+ __super__.call(this, subscribe);
+ }
+
+ ObservableBase.prototype.subscribeCore = notImplemented;
+
+ return ObservableBase;
+ }(Observable));
+
+ var Enumerable = Rx.internals.Enumerable = function () { };
+
+ var ConcatEnumerableObservable = (function(__super__) {
+ inherits(ConcatEnumerableObservable, __super__);
+ function ConcatEnumerableObservable(sources) {
+ this.sources = sources;
+ __super__.call(this);
+ }
+
+ ConcatEnumerableObservable.prototype.subscribeCore = function (o) {
+ var isDisposed, subscription = new SerialDisposable();
+ var cancelable = immediateScheduler.scheduleRecursiveWithState(this.sources[$iterator$](), function (e, self) {
+ if (isDisposed) { return; }
+ var currentItem = tryCatch(e.next).call(e);
+ if (currentItem === errorObj) { return o.onError(currentItem.e); }
+
+ if (currentItem.done) {
+ return o.onCompleted();
+ }
+
+ // Check if promise
+ var currentValue = currentItem.value;
+ isPromise(currentValue) && (currentValue = observableFromPromise(currentValue));
+
+ var d = new SingleAssignmentDisposable();
+ subscription.setDisposable(d);
+ d.setDisposable(currentValue.subscribe(new InnerObserver(o, self, e)));
+ });
+
+ return new CompositeDisposable(subscription, cancelable, disposableCreate(function () {
+ isDisposed = true;
+ }));
+ };
+
+ function InnerObserver(o, s, e) {
+ this.o = o;
+ this.s = s;
+ this.e = e;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) { if(!this.isStopped) { this.o.onNext(x); } };
+ InnerObserver.prototype.onError = function (err) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(err);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.s(this.e);
+ }
+ };
+ InnerObserver.prototype.dispose = function () { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (err) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(err);
+ return true;
+ }
+ return false;
+ };
+
+ return ConcatEnumerableObservable;
+ }(ObservableBase));
+
+ Enumerable.prototype.concat = function () {
+ return new ConcatEnumerableObservable(this);
+ };
+
+ var CatchErrorObservable = (function(__super__) {
+ inherits(CatchErrorObservable, __super__);
+ function CatchErrorObservable(sources) {
+ this.sources = sources;
+ __super__.call(this);
+ }
+
+ CatchErrorObservable.prototype.subscribeCore = function (o) {
+ var e = this.sources[$iterator$]();
+
+ var isDisposed, subscription = new SerialDisposable();
+ var cancelable = immediateScheduler.scheduleRecursiveWithState(null, function (lastException, self) {
+ if (isDisposed) { return; }
+ var currentItem = tryCatch(e.next).call(e);
+ if (currentItem === errorObj) { return o.onError(currentItem.e); }
+
+ if (currentItem.done) {
+ return lastException !== null ? o.onError(lastException) : o.onCompleted();
+ }
+
+ // Check if promise
+ var currentValue = currentItem.value;
+ isPromise(currentValue) && (currentValue = observableFromPromise(currentValue));
+
+ var d = new SingleAssignmentDisposable();
+ subscription.setDisposable(d);
+ d.setDisposable(currentValue.subscribe(
+ function(x) { o.onNext(x); },
+ self,
+ function() { o.onCompleted(); }));
+ });
+ return new CompositeDisposable(subscription, cancelable, disposableCreate(function () {
+ isDisposed = true;
+ }));
+ };
+
+ return CatchErrorObservable;
+ }(ObservableBase));
+
+ Enumerable.prototype.catchError = function () {
+ return new CatchErrorObservable(this);
+ };
+
+ Enumerable.prototype.catchErrorWhen = function (notificationHandler) {
+ var sources = this;
+ return new AnonymousObservable(function (o) {
+ var exceptions = new Subject(),
+ notifier = new Subject(),
+ handled = notificationHandler(exceptions),
+ notificationDisposable = handled.subscribe(notifier);
+
+ var e = sources[$iterator$]();
+
+ var isDisposed,
+ lastException,
+ subscription = new SerialDisposable();
+ var cancelable = immediateScheduler.scheduleRecursive(function (self) {
+ if (isDisposed) { return; }
+ var currentItem = tryCatch(e.next).call(e);
+ if (currentItem === errorObj) { return o.onError(currentItem.e); }
+
+ if (currentItem.done) {
+ if (lastException) {
+ o.onError(lastException);
+ } else {
+ o.onCompleted();
+ }
+ return;
+ }
+
+ // Check if promise
+ var currentValue = currentItem.value;
+ isPromise(currentValue) && (currentValue = observableFromPromise(currentValue));
+
+ var outer = new SingleAssignmentDisposable();
+ var inner = new SingleAssignmentDisposable();
+ subscription.setDisposable(new CompositeDisposable(inner, outer));
+ outer.setDisposable(currentValue.subscribe(
+ function(x) { o.onNext(x); },
+ function (exn) {
+ inner.setDisposable(notifier.subscribe(self, function(ex) {
+ o.onError(ex);
+ }, function() {
+ o.onCompleted();
+ }));
+
+ exceptions.onNext(exn);
+ },
+ function() { o.onCompleted(); }));
+ });
+
+ return new CompositeDisposable(notificationDisposable, subscription, cancelable, disposableCreate(function () {
+ isDisposed = true;
+ }));
+ });
+ };
+
+ var RepeatEnumerable = (function (__super__) {
+ inherits(RepeatEnumerable, __super__);
+
+ function RepeatEnumerable(v, c) {
+ this.v = v;
+ this.c = c == null ? -1 : c;
+ }
+ RepeatEnumerable.prototype[$iterator$] = function () {
+ return new RepeatEnumerator(this);
+ };
+
+ function RepeatEnumerator(p) {
+ this.v = p.v;
+ this.l = p.c;
+ }
+ RepeatEnumerator.prototype.next = function () {
+ if (this.l === 0) { return doneEnumerator; }
+ if (this.l > 0) { this.l--; }
+ return { done: false, value: this.v };
+ };
+
+ return RepeatEnumerable;
+ }(Enumerable));
+
+ var enumerableRepeat = Enumerable.repeat = function (value, repeatCount) {
+ return new RepeatEnumerable(value, repeatCount);
+ };
+
+ var OfEnumerable = (function(__super__) {
+ inherits(OfEnumerable, __super__);
+ function OfEnumerable(s, fn, thisArg) {
+ this.s = s;
+ this.fn = fn ? bindCallback(fn, thisArg, 3) : null;
+ }
+ OfEnumerable.prototype[$iterator$] = function () {
+ return new OfEnumerator(this);
+ };
+
+ function OfEnumerator(p) {
+ this.i = -1;
+ this.s = p.s;
+ this.l = this.s.length;
+ this.fn = p.fn;
+ }
+ OfEnumerator.prototype.next = function () {
+ return ++this.i < this.l ?
+ { done: false, value: !this.fn ? this.s[this.i] : this.fn(this.s[this.i], this.i, this.s) } :
+ doneEnumerator;
+ };
+
+ return OfEnumerable;
+ }(Enumerable));
+
+ var enumerableOf = Enumerable.of = function (source, selector, thisArg) {
+ return new OfEnumerable(source, selector, thisArg);
+ };
+
+ /**
+ * Wraps the source sequence in order to run its observer callbacks on the specified scheduler.
+ *
+ * This only invokes observer callbacks on a scheduler. In case the subscription and/or unsubscription actions have side-effects
+ * that require to be run on a scheduler, use subscribeOn.
+ *
+ * @param {Scheduler} scheduler Scheduler to notify observers on.
+ * @returns {Observable} The source sequence whose observations happen on the specified scheduler.
+ */
+ observableProto.observeOn = function (scheduler) {
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ return source.subscribe(new ObserveOnObserver(scheduler, observer));
+ }, source);
+ };
+
+ /**
+ * Wraps the source sequence in order to run its subscription and unsubscription logic on the specified scheduler. This operation is not commonly used;
+ * see the remarks section for more information on the distinction between subscribeOn and observeOn.
+
+ * This only performs the side-effects of subscription and unsubscription on the specified scheduler. In order to invoke observer
+ * callbacks on a scheduler, use observeOn.
+
+ * @param {Scheduler} scheduler Scheduler to perform subscription and unsubscription actions on.
+ * @returns {Observable} The source sequence whose subscriptions and unsubscriptions happen on the specified scheduler.
+ */
+ observableProto.subscribeOn = function (scheduler) {
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ var m = new SingleAssignmentDisposable(), d = new SerialDisposable();
+ d.setDisposable(m);
+ m.setDisposable(scheduler.schedule(function () {
+ d.setDisposable(new ScheduledDisposable(scheduler, source.subscribe(observer)));
+ }));
+ return d;
+ }, source);
+ };
+
+ var FromPromiseObservable = (function(__super__) {
+ inherits(FromPromiseObservable, __super__);
+ function FromPromiseObservable(p) {
+ this.p = p;
+ __super__.call(this);
+ }
+
+ FromPromiseObservable.prototype.subscribeCore = function(o) {
+ this.p.then(function (data) {
+ o.onNext(data);
+ o.onCompleted();
+ }, function (err) { o.onError(err); });
+ return disposableEmpty;
+ };
+
+ return FromPromiseObservable;
+ }(ObservableBase));
+
+ /**
+ * Converts a Promise to an Observable sequence
+ * @param {Promise} An ES6 Compliant promise.
+ * @returns {Observable} An Observable sequence which wraps the existing promise success and failure.
+ */
+ var observableFromPromise = Observable.fromPromise = function (promise) {
+ return new FromPromiseObservable(promise);
+ };
+ /*
+ * Converts an existing observable sequence to an ES6 Compatible Promise
+ * @example
+ * var promise = Rx.Observable.return(42).toPromise(RSVP.Promise);
+ *
+ * // With config
+ * Rx.config.Promise = RSVP.Promise;
+ * var promise = Rx.Observable.return(42).toPromise();
+ * @param {Function} [promiseCtor] The constructor of the promise. If not provided, it looks for it in Rx.config.Promise.
+ * @returns {Promise} An ES6 compatible promise with the last value from the observable sequence.
+ */
+ observableProto.toPromise = function (promiseCtor) {
+ promiseCtor || (promiseCtor = Rx.config.Promise);
+ if (!promiseCtor) { throw new NotSupportedError('Promise type not provided nor in Rx.config.Promise'); }
+ var source = this;
+ return new promiseCtor(function (resolve, reject) {
+ // No cancellation can be done
+ var value, hasValue = false;
+ source.subscribe(function (v) {
+ value = v;
+ hasValue = true;
+ }, reject, function () {
+ hasValue && resolve(value);
+ });
+ });
+ };
+
+ var ToArrayObservable = (function(__super__) {
+ inherits(ToArrayObservable, __super__);
+ function ToArrayObservable(source) {
+ this.source = source;
+ __super__.call(this);
+ }
+
+ ToArrayObservable.prototype.subscribeCore = function(o) {
+ return this.source.subscribe(new InnerObserver(o));
+ };
+
+ function InnerObserver(o) {
+ this.o = o;
+ this.a = [];
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) { if(!this.isStopped) { this.a.push(x); } };
+ InnerObserver.prototype.onError = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onNext(this.a);
+ this.o.onCompleted();
+ }
+ };
+ InnerObserver.prototype.dispose = function () { this.isStopped = true; }
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ return ToArrayObservable;
+ }(ObservableBase));
+
+ /**
+ * Creates an array from an observable sequence.
+ * @returns {Observable} An observable sequence containing a single element with a list containing all the elements of the source sequence.
+ */
+ observableProto.toArray = function () {
+ return new ToArrayObservable(this);
+ };
+
+ /**
+ * Creates an observable sequence from a specified subscribe method implementation.
+ * @example
+ * var res = Rx.Observable.create(function (observer) { return function () { } );
+ * var res = Rx.Observable.create(function (observer) { return Rx.Disposable.empty; } );
+ * var res = Rx.Observable.create(function (observer) { } );
+ * @param {Function} subscribe Implementation of the resulting observable sequence's subscribe method, returning a function that will be wrapped in a Disposable.
+ * @returns {Observable} The observable sequence with the specified implementation for the Subscribe method.
+ */
+ Observable.create = Observable.createWithDisposable = function (subscribe, parent) {
+ return new AnonymousObservable(subscribe, parent);
+ };
+
+ /**
+ * Returns an observable sequence that invokes the specified factory function whenever a new observer subscribes.
+ *
+ * @example
+ * var res = Rx.Observable.defer(function () { return Rx.Observable.fromArray([1,2,3]); });
+ * @param {Function} observableFactory Observable factory function to invoke for each observer that subscribes to the resulting sequence or Promise.
+ * @returns {Observable} An observable sequence whose observers trigger an invocation of the given observable factory function.
+ */
+ var observableDefer = Observable.defer = function (observableFactory) {
+ return new AnonymousObservable(function (observer) {
+ var result;
+ try {
+ result = observableFactory();
+ } catch (e) {
+ return observableThrow(e).subscribe(observer);
+ }
+ isPromise(result) && (result = observableFromPromise(result));
+ return result.subscribe(observer);
+ });
+ };
+
+ var EmptyObservable = (function(__super__) {
+ inherits(EmptyObservable, __super__);
+ function EmptyObservable(scheduler) {
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ EmptyObservable.prototype.subscribeCore = function (observer) {
+ var sink = new EmptySink(observer, this);
+ return sink.run();
+ };
+
+ function EmptySink(observer, parent) {
+ this.observer = observer;
+ this.parent = parent;
+ }
+
+ function scheduleItem(s, state) {
+ state.onCompleted();
+ }
+
+ EmptySink.prototype.run = function () {
+ return this.parent.scheduler.scheduleWithState(this.observer, scheduleItem);
+ };
+
+ return EmptyObservable;
+ }(ObservableBase));
+
+ /**
+ * Returns an empty observable sequence, using the specified scheduler to send out the single OnCompleted message.
+ *
+ * @example
+ * var res = Rx.Observable.empty();
+ * var res = Rx.Observable.empty(Rx.Scheduler.timeout);
+ * @param {Scheduler} [scheduler] Scheduler to send the termination call on.
+ * @returns {Observable} An observable sequence with no elements.
+ */
+ var observableEmpty = Observable.empty = function (scheduler) {
+ isScheduler(scheduler) || (scheduler = immediateScheduler);
+ return new EmptyObservable(scheduler);
+ };
+
+ var FromObservable = (function(__super__) {
+ inherits(FromObservable, __super__);
+ function FromObservable(iterable, mapper, scheduler) {
+ this.iterable = iterable;
+ this.mapper = mapper;
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ FromObservable.prototype.subscribeCore = function (observer) {
+ var sink = new FromSink(observer, this);
+ return sink.run();
+ };
+
+ return FromObservable;
+ }(ObservableBase));
+
+ var FromSink = (function () {
+ function FromSink(observer, parent) {
+ this.observer = observer;
+ this.parent = parent;
+ }
+
+ FromSink.prototype.run = function () {
+ var list = Object(this.parent.iterable),
+ it = getIterable(list),
+ observer = this.observer,
+ mapper = this.parent.mapper;
+
+ function loopRecursive(i, recurse) {
+ try {
+ var next = it.next();
+ } catch (e) {
+ return observer.onError(e);
+ }
+ if (next.done) {
+ return observer.onCompleted();
+ }
+
+ var result = next.value;
+
+ if (mapper) {
+ try {
+ result = mapper(result, i);
+ } catch (e) {
+ return observer.onError(e);
+ }
+ }
+
+ observer.onNext(result);
+ recurse(i + 1);
+ }
+
+ return this.parent.scheduler.scheduleRecursiveWithState(0, loopRecursive);
+ };
+
+ return FromSink;
+ }());
+
+ var maxSafeInteger = Math.pow(2, 53) - 1;
+
+ function StringIterable(str) {
+ this._s = s;
+ }
+
+ StringIterable.prototype[$iterator$] = function () {
+ return new StringIterator(this._s);
+ };
+
+ function StringIterator(str) {
+ this._s = s;
+ this._l = s.length;
+ this._i = 0;
+ }
+
+ StringIterator.prototype[$iterator$] = function () {
+ return this;
+ };
+
+ StringIterator.prototype.next = function () {
+ return this._i < this._l ? { done: false, value: this._s.charAt(this._i++) } : doneEnumerator;
+ };
+
+ function ArrayIterable(a) {
+ this._a = a;
+ }
+
+ ArrayIterable.prototype[$iterator$] = function () {
+ return new ArrayIterator(this._a);
+ };
+
+ function ArrayIterator(a) {
+ this._a = a;
+ this._l = toLength(a);
+ this._i = 0;
+ }
+
+ ArrayIterator.prototype[$iterator$] = function () {
+ return this;
+ };
+
+ ArrayIterator.prototype.next = function () {
+ return this._i < this._l ? { done: false, value: this._a[this._i++] } : doneEnumerator;
+ };
+
+ function numberIsFinite(value) {
+ return typeof value === 'number' && root.isFinite(value);
+ }
+
+ function isNan(n) {
+ return n !== n;
+ }
+
+ function getIterable(o) {
+ var i = o[$iterator$], it;
+ if (!i && typeof o === 'string') {
+ it = new StringIterable(o);
+ return it[$iterator$]();
+ }
+ if (!i && o.length !== undefined) {
+ it = new ArrayIterable(o);
+ return it[$iterator$]();
+ }
+ if (!i) { throw new TypeError('Object is not iterable'); }
+ return o[$iterator$]();
+ }
+
+ function sign(value) {
+ var number = +value;
+ if (number === 0) { return number; }
+ if (isNaN(number)) { return number; }
+ return number < 0 ? -1 : 1;
+ }
+
+ function toLength(o) {
+ var len = +o.length;
+ if (isNaN(len)) { return 0; }
+ if (len === 0 || !numberIsFinite(len)) { return len; }
+ len = sign(len) * Math.floor(Math.abs(len));
+ if (len <= 0) { return 0; }
+ if (len > maxSafeInteger) { return maxSafeInteger; }
+ return len;
+ }
+
+ /**
+ * This method creates a new Observable sequence from an array-like or iterable object.
+ * @param {Any} arrayLike An array-like or iterable object to convert to an Observable sequence.
+ * @param {Function} [mapFn] Map function to call on every element of the array.
+ * @param {Any} [thisArg] The context to use calling the mapFn if provided.
+ * @param {Scheduler} [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread.
+ */
+ var observableFrom = Observable.from = function (iterable, mapFn, thisArg, scheduler) {
+ if (iterable == null) {
+ throw new Error('iterable cannot be null.')
+ }
+ if (mapFn && !isFunction(mapFn)) {
+ throw new Error('mapFn when provided must be a function');
+ }
+ if (mapFn) {
+ var mapper = bindCallback(mapFn, thisArg, 2);
+ }
+ isScheduler(scheduler) || (scheduler = currentThreadScheduler);
+ return new FromObservable(iterable, mapper, scheduler);
+ }
+
+ var FromArrayObservable = (function(__super__) {
+ inherits(FromArrayObservable, __super__);
+ function FromArrayObservable(args, scheduler) {
+ this.args = args;
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ FromArrayObservable.prototype.subscribeCore = function (observer) {
+ var sink = new FromArraySink(observer, this);
+ return sink.run();
+ };
+
+ return FromArrayObservable;
+ }(ObservableBase));
+
+ function FromArraySink(observer, parent) {
+ this.observer = observer;
+ this.parent = parent;
+ }
+
+ FromArraySink.prototype.run = function () {
+ var observer = this.observer, args = this.parent.args, len = args.length;
+ function loopRecursive(i, recurse) {
+ if (i < len) {
+ observer.onNext(args[i]);
+ recurse(i + 1);
+ } else {
+ observer.onCompleted();
+ }
+ }
+
+ return this.parent.scheduler.scheduleRecursiveWithState(0, loopRecursive);
+ };
+
+ /**
+ * Converts an array to an observable sequence, using an optional scheduler to enumerate the array.
+ * @deprecated use Observable.from or Observable.of
+ * @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on.
+ * @returns {Observable} The observable sequence whose elements are pulled from the given enumerable sequence.
+ */
+ var observableFromArray = Observable.fromArray = function (array, scheduler) {
+ isScheduler(scheduler) || (scheduler = currentThreadScheduler);
+ return new FromArrayObservable(array, scheduler)
+ };
+
+ /**
+ * Generates an observable sequence by running a state-driven loop producing the sequence's elements, using the specified scheduler to send out observer messages.
+ *
+ * @example
+ * var res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; });
+ * var res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; }, Rx.Scheduler.timeout);
+ * @param {Mixed} initialState Initial state.
+ * @param {Function} condition Condition to terminate generation (upon returning false).
+ * @param {Function} iterate Iteration step function.
+ * @param {Function} resultSelector Selector function for results produced in the sequence.
+ * @param {Scheduler} [scheduler] Scheduler on which to run the generator loop. If not provided, defaults to Scheduler.currentThread.
+ * @returns {Observable} The generated sequence.
+ */
+ Observable.generate = function (initialState, condition, iterate, resultSelector, scheduler) {
+ isScheduler(scheduler) || (scheduler = currentThreadScheduler);
+ return new AnonymousObservable(function (o) {
+ var first = true;
+ return scheduler.scheduleRecursiveWithState(initialState, function (state, self) {
+ var hasResult, result;
+ try {
+ if (first) {
+ first = false;
+ } else {
+ state = iterate(state);
+ }
+ hasResult = condition(state);
+ hasResult && (result = resultSelector(state));
+ } catch (e) {
+ return o.onError(e);
+ }
+ if (hasResult) {
+ o.onNext(result);
+ self(state);
+ } else {
+ o.onCompleted();
+ }
+ });
+ });
+ };
+
+ function observableOf (scheduler, array) {
+ isScheduler(scheduler) || (scheduler = currentThreadScheduler);
+ return new FromArrayObservable(array, scheduler);
+ }
+
+ /**
+ * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments.
+ * @returns {Observable} The observable sequence whose elements are pulled from the given arguments.
+ */
+ Observable.of = function () {
+ var len = arguments.length, args = new Array(len);
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+ return new FromArrayObservable(args, currentThreadScheduler);
+ };
+
+ /**
+ * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments.
+ * @param {Scheduler} scheduler A scheduler to use for scheduling the arguments.
+ * @returns {Observable} The observable sequence whose elements are pulled from the given arguments.
+ */
+ Observable.ofWithScheduler = function (scheduler) {
+ var len = arguments.length, args = new Array(len - 1);
+ for(var i = 1; i < len; i++) { args[i - 1] = arguments[i]; }
+ return new FromArrayObservable(args, scheduler);
+ };
+
+ var NeverObservable = (function(__super__) {
+ inherits(NeverObservable, __super__);
+ function NeverObservable() {
+ __super__.call(this);
+ }
+
+ NeverObservable.prototype.subscribeCore = function (observer) {
+ return disposableEmpty;
+ };
+
+ return NeverObservable;
+ }(ObservableBase));
+
+ /**
+ * Returns a non-terminating observable sequence, which can be used to denote an infinite duration (e.g. when using reactive joins).
+ * @returns {Observable} An observable sequence whose observers will never get called.
+ */
+ var observableNever = Observable.never = function () {
+ return new NeverObservable();
+ };
+
+ var PairsObservable = (function(__super__) {
+ inherits(PairsObservable, __super__);
+ function PairsObservable(obj, scheduler) {
+ this.obj = obj;
+ this.keys = Object.keys(obj);
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ PairsObservable.prototype.subscribeCore = function (observer) {
+ var sink = new PairsSink(observer, this);
+ return sink.run();
+ };
+
+ return PairsObservable;
+ }(ObservableBase));
+
+ function PairsSink(observer, parent) {
+ this.observer = observer;
+ this.parent = parent;
+ }
+
+ PairsSink.prototype.run = function () {
+ var observer = this.observer, obj = this.parent.obj, keys = this.parent.keys, len = keys.length;
+ function loopRecursive(i, recurse) {
+ if (i < len) {
+ var key = keys[i];
+ observer.onNext([key, obj[key]]);
+ recurse(i + 1);
+ } else {
+ observer.onCompleted();
+ }
+ }
+
+ return this.parent.scheduler.scheduleRecursiveWithState(0, loopRecursive);
+ };
+
+ /**
+ * Convert an object into an observable sequence of [key, value] pairs.
+ * @param {Object} obj The object to inspect.
+ * @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on.
+ * @returns {Observable} An observable sequence of [key, value] pairs from the object.
+ */
+ Observable.pairs = function (obj, scheduler) {
+ scheduler || (scheduler = currentThreadScheduler);
+ return new PairsObservable(obj, scheduler);
+ };
+
+ var RangeObservable = (function(__super__) {
+ inherits(RangeObservable, __super__);
+ function RangeObservable(start, count, scheduler) {
+ this.start = start;
+ this.rangeCount = count;
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ RangeObservable.prototype.subscribeCore = function (observer) {
+ var sink = new RangeSink(observer, this);
+ return sink.run();
+ };
+
+ return RangeObservable;
+ }(ObservableBase));
+
+ var RangeSink = (function () {
+ function RangeSink(observer, parent) {
+ this.observer = observer;
+ this.parent = parent;
+ }
+
+ RangeSink.prototype.run = function () {
+ var start = this.parent.start, count = this.parent.rangeCount, observer = this.observer;
+ function loopRecursive(i, recurse) {
+ if (i < count) {
+ observer.onNext(start + i);
+ recurse(i + 1);
+ } else {
+ observer.onCompleted();
+ }
+ }
+
+ return this.parent.scheduler.scheduleRecursiveWithState(0, loopRecursive);
+ };
+
+ return RangeSink;
+ }());
+
+ /**
+ * Generates an observable sequence of integral numbers within a specified range, using the specified scheduler to send out observer messages.
+ * @param {Number} start The value of the first integer in the sequence.
+ * @param {Number} count The number of sequential integers to generate.
+ * @param {Scheduler} [scheduler] Scheduler to run the generator loop on. If not specified, defaults to Scheduler.currentThread.
+ * @returns {Observable} An observable sequence that contains a range of sequential integral numbers.
+ */
+ Observable.range = function (start, count, scheduler) {
+ isScheduler(scheduler) || (scheduler = currentThreadScheduler);
+ return new RangeObservable(start, count, scheduler);
+ };
+
+ var RepeatObservable = (function(__super__) {
+ inherits(RepeatObservable, __super__);
+ function RepeatObservable(value, repeatCount, scheduler) {
+ this.value = value;
+ this.repeatCount = repeatCount == null ? -1 : repeatCount;
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ RepeatObservable.prototype.subscribeCore = function (observer) {
+ var sink = new RepeatSink(observer, this);
+ return sink.run();
+ };
+
+ return RepeatObservable;
+ }(ObservableBase));
+
+ function RepeatSink(observer, parent) {
+ this.observer = observer;
+ this.parent = parent;
+ }
+
+ RepeatSink.prototype.run = function () {
+ var observer = this.observer, value = this.parent.value;
+ function loopRecursive(i, recurse) {
+ if (i === -1 || i > 0) {
+ observer.onNext(value);
+ i > 0 && i--;
+ }
+ if (i === 0) { return observer.onCompleted(); }
+ recurse(i);
+ }
+
+ return this.parent.scheduler.scheduleRecursiveWithState(this.parent.repeatCount, loopRecursive);
+ };
+
+ /**
+ * Generates an observable sequence that repeats the given element the specified number of times, using the specified scheduler to send out observer messages.
+ * @param {Mixed} value Element to repeat.
+ * @param {Number} repeatCount [Optiona] Number of times to repeat the element. If not specified, repeats indefinitely.
+ * @param {Scheduler} scheduler Scheduler to run the producer loop on. If not specified, defaults to Scheduler.immediate.
+ * @returns {Observable} An observable sequence that repeats the given element the specified number of times.
+ */
+ Observable.repeat = function (value, repeatCount, scheduler) {
+ isScheduler(scheduler) || (scheduler = currentThreadScheduler);
+ return new RepeatObservable(value, repeatCount, scheduler);
+ };
+
+ var JustObservable = (function(__super__) {
+ inherits(JustObservable, __super__);
+ function JustObservable(value, scheduler) {
+ this.value = value;
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ JustObservable.prototype.subscribeCore = function (observer) {
+ var sink = new JustSink(observer, this);
+ return sink.run();
+ };
+
+ function JustSink(observer, parent) {
+ this.observer = observer;
+ this.parent = parent;
+ }
+
+ function scheduleItem(s, state) {
+ var value = state[0], observer = state[1];
+ observer.onNext(value);
+ observer.onCompleted();
+ }
+
+ JustSink.prototype.run = function () {
+ return this.parent.scheduler.scheduleWithState([this.parent.value, this.observer], scheduleItem);
+ };
+
+ return JustObservable;
+ }(ObservableBase));
+
+ /**
+ * Returns an observable sequence that contains a single element, using the specified scheduler to send out observer messages.
+ * There is an alias called 'just' or browsers <IE9.
+ * @param {Mixed} value Single element in the resulting observable sequence.
+ * @param {Scheduler} scheduler Scheduler to send the single element on. If not specified, defaults to Scheduler.immediate.
+ * @returns {Observable} An observable sequence containing the single specified element.
+ */
+ var observableReturn = Observable['return'] = Observable.just = Observable.returnValue = function (value, scheduler) {
+ isScheduler(scheduler) || (scheduler = immediateScheduler);
+ return new JustObservable(value, scheduler);
+ };
+
+ var ThrowObservable = (function(__super__) {
+ inherits(ThrowObservable, __super__);
+ function ThrowObservable(error, scheduler) {
+ this.error = error;
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ ThrowObservable.prototype.subscribeCore = function (o) {
+ var sink = new ThrowSink(o, this);
+ return sink.run();
+ };
+
+ function ThrowSink(o, p) {
+ this.o = o;
+ this.p = p;
+ }
+
+ function scheduleItem(s, state) {
+ var e = state[0], o = state[1];
+ o.onError(e);
+ }
+
+ ThrowSink.prototype.run = function () {
+ return this.p.scheduler.scheduleWithState([this.p.error, this.o], scheduleItem);
+ };
+
+ return ThrowObservable;
+ }(ObservableBase));
+
+ /**
+ * Returns an observable sequence that terminates with an exception, using the specified scheduler to send out the single onError message.
+ * There is an alias to this method called 'throwError' for browsers <IE9.
+ * @param {Mixed} error An object used for the sequence's termination.
+ * @param {Scheduler} scheduler Scheduler to send the exceptional termination call on. If not specified, defaults to Scheduler.immediate.
+ * @returns {Observable} The observable sequence that terminates exceptionally with the specified exception object.
+ */
+ var observableThrow = Observable['throw'] = Observable.throwError = Observable.throwException = function (error, scheduler) {
+ isScheduler(scheduler) || (scheduler = immediateScheduler);
+ return new ThrowObservable(error, scheduler);
+ };
+
+ /**
+ * Constructs an observable sequence that depends on a resource object, whose lifetime is tied to the resulting observable sequence's lifetime.
+ * @param {Function} resourceFactory Factory function to obtain a resource object.
+ * @param {Function} observableFactory Factory function to obtain an observable sequence that depends on the obtained resource.
+ * @returns {Observable} An observable sequence whose lifetime controls the lifetime of the dependent resource object.
+ */
+ Observable.using = function (resourceFactory, observableFactory) {
+ return new AnonymousObservable(function (observer) {
+ var disposable = disposableEmpty, resource, source;
+ try {
+ resource = resourceFactory();
+ resource && (disposable = resource);
+ source = observableFactory(resource);
+ } catch (exception) {
+ return new CompositeDisposable(observableThrow(exception).subscribe(observer), disposable);
+ }
+ return new CompositeDisposable(source.subscribe(observer), disposable);
+ });
+ };
+
+ /**
+ * Propagates the observable sequence or Promise that reacts first.
+ * @param {Observable} rightSource Second observable sequence or Promise.
+ * @returns {Observable} {Observable} An observable sequence that surfaces either of the given sequences, whichever reacted first.
+ */
+ observableProto.amb = function (rightSource) {
+ var leftSource = this;
+ return new AnonymousObservable(function (observer) {
+ var choice,
+ leftChoice = 'L', rightChoice = 'R',
+ leftSubscription = new SingleAssignmentDisposable(),
+ rightSubscription = new SingleAssignmentDisposable();
+
+ isPromise(rightSource) && (rightSource = observableFromPromise(rightSource));
+
+ function choiceL() {
+ if (!choice) {
+ choice = leftChoice;
+ rightSubscription.dispose();
+ }
+ }
+
+ function choiceR() {
+ if (!choice) {
+ choice = rightChoice;
+ leftSubscription.dispose();
+ }
+ }
+
+ leftSubscription.setDisposable(leftSource.subscribe(function (left) {
+ choiceL();
+ choice === leftChoice && observer.onNext(left);
+ }, function (err) {
+ choiceL();
+ choice === leftChoice && observer.onError(err);
+ }, function () {
+ choiceL();
+ choice === leftChoice && observer.onCompleted();
+ }));
+
+ rightSubscription.setDisposable(rightSource.subscribe(function (right) {
+ choiceR();
+ choice === rightChoice && observer.onNext(right);
+ }, function (err) {
+ choiceR();
+ choice === rightChoice && observer.onError(err);
+ }, function () {
+ choiceR();
+ choice === rightChoice && observer.onCompleted();
+ }));
+
+ return new CompositeDisposable(leftSubscription, rightSubscription);
+ });
+ };
+
+ /**
+ * Propagates the observable sequence or Promise that reacts first.
+ *
+ * @example
+ * var = Rx.Observable.amb(xs, ys, zs);
+ * @returns {Observable} An observable sequence that surfaces any of the given sequences, whichever reacted first.
+ */
+ Observable.amb = function () {
+ var acc = observableNever(), items = [];
+ if (Array.isArray(arguments[0])) {
+ items = arguments[0];
+ } else {
+ for(var i = 0, len = arguments.length; i < len; i++) { items.push(arguments[i]); }
+ }
+
+ function func(previous, current) {
+ return previous.amb(current);
+ }
+ for (var i = 0, len = items.length; i < len; i++) {
+ acc = func(acc, items[i]);
+ }
+ return acc;
+ };
+
+ function observableCatchHandler(source, handler) {
+ return new AnonymousObservable(function (o) {
+ var d1 = new SingleAssignmentDisposable(), subscription = new SerialDisposable();
+ subscription.setDisposable(d1);
+ d1.setDisposable(source.subscribe(function (x) { o.onNext(x); }, function (e) {
+ try {
+ var result = handler(e);
+ } catch (ex) {
+ return o.onError(ex);
+ }
+ isPromise(result) && (result = observableFromPromise(result));
+
+ var d = new SingleAssignmentDisposable();
+ subscription.setDisposable(d);
+ d.setDisposable(result.subscribe(o));
+ }, function (x) { o.onCompleted(x); }));
+
+ return subscription;
+ }, source);
+ }
+
+ /**
+ * Continues an observable sequence that is terminated by an exception with the next observable sequence.
+ * @example
+ * 1 - xs.catchException(ys)
+ * 2 - xs.catchException(function (ex) { return ys(ex); })
+ * @param {Mixed} handlerOrSecond Exception handler function that returns an observable sequence given the error that occurred in the first sequence, or a second observable sequence used to produce results when an error occurred in the first sequence.
+ * @returns {Observable} An observable sequence containing the first sequence's elements, followed by the elements of the handler sequence in case an exception occurred.
+ */
+ observableProto['catch'] = observableProto.catchError = observableProto.catchException = function (handlerOrSecond) {
+ return typeof handlerOrSecond === 'function' ?
+ observableCatchHandler(this, handlerOrSecond) :
+ observableCatch([this, handlerOrSecond]);
+ };
+
+ /**
+ * Continues an observable sequence that is terminated by an exception with the next observable sequence.
+ * @param {Array | Arguments} args Arguments or an array to use as the next sequence if an error occurs.
+ * @returns {Observable} An observable sequence containing elements from consecutive source sequences until a source sequence terminates successfully.
+ */
+ var observableCatch = Observable.catchError = Observable['catch'] = Observable.catchException = function () {
+ var items = [];
+ if (Array.isArray(arguments[0])) {
+ items = arguments[0];
+ } else {
+ for(var i = 0, len = arguments.length; i < len; i++) { items.push(arguments[i]); }
+ }
+ return enumerableOf(items).catchError();
+ };
+
+ /**
+ * Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element.
+ * This can be in the form of an argument list of observables or an array.
+ *
+ * @example
+ * 1 - obs = observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
+ * 2 - obs = observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
+ * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
+ */
+ observableProto.combineLatest = function () {
+ var len = arguments.length, args = new Array(len);
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+ if (Array.isArray(args[0])) {
+ args[0].unshift(this);
+ } else {
+ args.unshift(this);
+ }
+ return combineLatest.apply(this, args);
+ };
+
+ /**
+ * Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element.
+ *
+ * @example
+ * 1 - obs = Rx.Observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
+ * 2 - obs = Rx.Observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
+ * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
+ */
+ var combineLatest = Observable.combineLatest = function () {
+ var len = arguments.length, args = new Array(len);
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+ var resultSelector = args.pop();
+ Array.isArray(args[0]) && (args = args[0]);
+
+ return new AnonymousObservable(function (o) {
+ var n = args.length,
+ falseFactory = function () { return false; },
+ hasValue = arrayInitialize(n, falseFactory),
+ hasValueAll = false,
+ isDone = arrayInitialize(n, falseFactory),
+ values = new Array(n);
+
+ function next(i) {
+ hasValue[i] = true;
+ if (hasValueAll || (hasValueAll = hasValue.every(identity))) {
+ try {
+ var res = resultSelector.apply(null, values);
+ } catch (e) {
+ return o.onError(e);
+ }
+ o.onNext(res);
+ } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) {
+ o.onCompleted();
+ }
+ }
+
+ function done (i) {
+ isDone[i] = true;
+ isDone.every(identity) && o.onCompleted();
+ }
+
+ var subscriptions = new Array(n);
+ for (var idx = 0; idx < n; idx++) {
+ (function (i) {
+ var source = args[i], sad = new SingleAssignmentDisposable();
+ isPromise(source) && (source = observableFromPromise(source));
+ sad.setDisposable(source.subscribe(function (x) {
+ values[i] = x;
+ next(i);
+ },
+ function(e) { o.onError(e); },
+ function () { done(i); }
+ ));
+ subscriptions[i] = sad;
+ }(idx));
+ }
+
+ return new CompositeDisposable(subscriptions);
+ }, this);
+ };
+
+ /**
+ * Concatenates all the observable sequences. This takes in either an array or variable arguments to concatenate.
+ * @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order.
+ */
+ observableProto.concat = function () {
+ for(var args = [], i = 0, len = arguments.length; i < len; i++) { args.push(arguments[i]); }
+ args.unshift(this);
+ return observableConcat.apply(null, args);
+ };
+
+ var ConcatObservable = (function(__super__) {
+ inherits(ConcatObservable, __super__);
+ function ConcatObservable(sources) {
+ this.sources = sources;
+ __super__.call(this);
+ }
+
+ ConcatObservable.prototype.subscribeCore = function(o) {
+ var sink = new ConcatSink(this.sources, o);
+ return sink.run();
+ };
+
+ function ConcatSink(sources, o) {
+ this.sources = sources;
+ this.o = o;
+ }
+ ConcatSink.prototype.run = function () {
+ var isDisposed, subscription = new SerialDisposable(), sources = this.sources, length = sources.length, o = this.o;
+ var cancelable = immediateScheduler.scheduleRecursiveWithState(0, function (i, self) {
+ if (isDisposed) { return; }
+ if (i === length) {
+ return o.onCompleted();
+ }
+
+ // Check if promise
+ var currentValue = sources[i];
+ isPromise(currentValue) && (currentValue = observableFromPromise(currentValue));
+
+ var d = new SingleAssignmentDisposable();
+ subscription.setDisposable(d);
+ d.setDisposable(currentValue.subscribe(
+ function (x) { o.onNext(x); },
+ function (e) { o.onError(e); },
+ function () { self(i + 1); }
+ ));
+ });
+
+ return new CompositeDisposable(subscription, cancelable, disposableCreate(function () {
+ isDisposed = true;
+ }));
+ };
+
+
+ return ConcatObservable;
+ }(ObservableBase));
+
+ /**
+ * Concatenates all the observable sequences.
+ * @param {Array | Arguments} args Arguments or an array to concat to the observable sequence.
+ * @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order.
+ */
+ var observableConcat = Observable.concat = function () {
+ var args;
+ if (Array.isArray(arguments[0])) {
+ args = arguments[0];
+ } else {
+ args = new Array(arguments.length);
+ for(var i = 0, len = arguments.length; i < len; i++) { args[i] = arguments[i]; }
+ }
+ return new ConcatObservable(args);
+ };
+
+ /**
+ * Concatenates an observable sequence of observable sequences.
+ * @returns {Observable} An observable sequence that contains the elements of each observed inner sequence, in sequential order.
+ */
+ observableProto.concatAll = observableProto.concatObservable = function () {
+ return this.merge(1);
+ };
+
+ var MergeObservable = (function (__super__) {
+ inherits(MergeObservable, __super__);
+
+ function MergeObservable(source, maxConcurrent) {
+ this.source = source;
+ this.maxConcurrent = maxConcurrent;
+ __super__.call(this);
+ }
+
+ MergeObservable.prototype.subscribeCore = function(observer) {
+ var g = new CompositeDisposable();
+ g.add(this.source.subscribe(new MergeObserver(observer, this.maxConcurrent, g)));
+ return g;
+ };
+
+ return MergeObservable;
+
+ }(ObservableBase));
+
+ var MergeObserver = (function () {
+ function MergeObserver(o, max, g) {
+ this.o = o;
+ this.max = max;
+ this.g = g;
+ this.done = false;
+ this.q = [];
+ this.activeCount = 0;
+ this.isStopped = false;
+ }
+ MergeObserver.prototype.handleSubscribe = function (xs) {
+ var sad = new SingleAssignmentDisposable();
+ this.g.add(sad);
+ isPromise(xs) && (xs = observableFromPromise(xs));
+ sad.setDisposable(xs.subscribe(new InnerObserver(this, sad)));
+ };
+ MergeObserver.prototype.onNext = function (innerSource) {
+ if (this.isStopped) { return; }
+ if(this.activeCount < this.max) {
+ this.activeCount++;
+ this.handleSubscribe(innerSource);
+ } else {
+ this.q.push(innerSource);
+ }
+ };
+ MergeObserver.prototype.onError = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ }
+ };
+ MergeObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.done = true;
+ this.activeCount === 0 && this.o.onCompleted();
+ }
+ };
+ MergeObserver.prototype.dispose = function() { this.isStopped = true; };
+ MergeObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ function InnerObserver(parent, sad) {
+ this.parent = parent;
+ this.sad = sad;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) { if(!this.isStopped) { this.parent.o.onNext(x); } };
+ InnerObserver.prototype.onError = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.parent.o.onError(e);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ var parent = this.parent;
+ parent.g.remove(this.sad);
+ if (parent.q.length > 0) {
+ parent.handleSubscribe(parent.q.shift());
+ } else {
+ parent.activeCount--;
+ parent.done && parent.activeCount === 0 && parent.o.onCompleted();
+ }
+ }
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.parent.o.onError(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ return MergeObserver;
+ }());
+
+
+
+
+
+ /**
+ * Merges an observable sequence of observable sequences into an observable sequence, limiting the number of concurrent subscriptions to inner sequences.
+ * Or merges two observable sequences into a single observable sequence.
+ *
+ * @example
+ * 1 - merged = sources.merge(1);
+ * 2 - merged = source.merge(otherSource);
+ * @param {Mixed} [maxConcurrentOrOther] Maximum number of inner observable sequences being subscribed to concurrently or the second observable sequence.
+ * @returns {Observable} The observable sequence that merges the elements of the inner sequences.
+ */
+ observableProto.merge = function (maxConcurrentOrOther) {
+ return typeof maxConcurrentOrOther !== 'number' ?
+ observableMerge(this, maxConcurrentOrOther) :
+ new MergeObservable(this, maxConcurrentOrOther);
+ };
+
+ /**
+ * Merges all the observable sequences into a single observable sequence.
+ * The scheduler is optional and if not specified, the immediate scheduler is used.
+ * @returns {Observable} The observable sequence that merges the elements of the observable sequences.
+ */
+ var observableMerge = Observable.merge = function () {
+ var scheduler, sources = [], i, len = arguments.length;
+ if (!arguments[0]) {
+ scheduler = immediateScheduler;
+ for(i = 1; i < len; i++) { sources.push(arguments[i]); }
+ } else if (isScheduler(arguments[0])) {
+ scheduler = arguments[0];
+ for(i = 1; i < len; i++) { sources.push(arguments[i]); }
+ } else {
+ scheduler = immediateScheduler;
+ for(i = 0; i < len; i++) { sources.push(arguments[i]); }
+ }
+ if (Array.isArray(sources[0])) {
+ sources = sources[0];
+ }
+ return observableOf(scheduler, sources).mergeAll();
+ };
+
+ var MergeAllObservable = (function (__super__) {
+ inherits(MergeAllObservable, __super__);
+
+ function MergeAllObservable(source) {
+ this.source = source;
+ __super__.call(this);
+ }
+
+ MergeAllObservable.prototype.subscribeCore = function (observer) {
+ var g = new CompositeDisposable(), m = new SingleAssignmentDisposable();
+ g.add(m);
+ m.setDisposable(this.source.subscribe(new MergeAllObserver(observer, g)));
+ return g;
+ };
+
+ function MergeAllObserver(o, g) {
+ this.o = o;
+ this.g = g;
+ this.isStopped = false;
+ this.done = false;
+ }
+ MergeAllObserver.prototype.onNext = function(innerSource) {
+ if(this.isStopped) { return; }
+ var sad = new SingleAssignmentDisposable();
+ this.g.add(sad);
+
+ isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
+
+ sad.setDisposable(innerSource.subscribe(new InnerObserver(this, this.g, sad)));
+ };
+ MergeAllObserver.prototype.onError = function (e) {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ }
+ };
+ MergeAllObserver.prototype.onCompleted = function () {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ this.done = true;
+ this.g.length === 1 && this.o.onCompleted();
+ }
+ };
+ MergeAllObserver.prototype.dispose = function() { this.isStopped = true; };
+ MergeAllObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ function InnerObserver(parent, g, sad) {
+ this.parent = parent;
+ this.g = g;
+ this.sad = sad;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) { if (!this.isStopped) { this.parent.o.onNext(x); } };
+ InnerObserver.prototype.onError = function (e) {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ this.parent.o.onError(e);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if(!this.isStopped) {
+ var parent = this.parent;
+ this.isStopped = true;
+ parent.g.remove(this.sad);
+ parent.done && parent.g.length === 1 && parent.o.onCompleted();
+ }
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.parent.o.onError(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ return MergeAllObservable;
+ }(ObservableBase));
+
+ /**
+ * Merges an observable sequence of observable sequences into an observable sequence.
+ * @returns {Observable} The observable sequence that merges the elements of the inner sequences.
+ */
+ observableProto.mergeAll = observableProto.mergeObservable = function () {
+ return new MergeAllObservable(this);
+ };
+
+ var CompositeError = Rx.CompositeError = function(errors) {
+ this.name = "NotImplementedError";
+ this.innerErrors = errors;
+ this.message = 'This contains multiple errors. Check the innerErrors';
+ Error.call(this);
+ }
+ CompositeError.prototype = Error.prototype;
+
+ /**
+ * Flattens an Observable that emits Observables into one Observable, in a way that allows an Observer to
+ * receive all successfully emitted items from all of the source Observables without being interrupted by
+ * an error notification from one of them.
+ *
+ * This behaves like Observable.prototype.mergeAll except that if any of the merged Observables notify of an
+ * error via the Observer's onError, mergeDelayError will refrain from propagating that
+ * error notification until all of the merged Observables have finished emitting items.
+ * @param {Array | Arguments} args Arguments or an array to merge.
+ * @returns {Observable} an Observable that emits all of the items emitted by the Observables emitted by the Observable
+ */
+ Observable.mergeDelayError = function() {
+ var args;
+ if (Array.isArray(arguments[0])) {
+ args = arguments[0];
+ } else {
+ var len = arguments.length;
+ args = new Array(len);
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+ }
+ var source = observableOf(null, args);
+
+ return new AnonymousObservable(function (o) {
+ var group = new CompositeDisposable(),
+ m = new SingleAssignmentDisposable(),
+ isStopped = false,
+ errors = [];
+
+ function setCompletion() {
+ if (errors.length === 0) {
+ o.onCompleted();
+ } else if (errors.length === 1) {
+ o.onError(errors[0]);
+ } else {
+ o.onError(new CompositeError(errors));
+ }
+ }
+
+ group.add(m);
+
+ m.setDisposable(source.subscribe(
+ function (innerSource) {
+ var innerSubscription = new SingleAssignmentDisposable();
+ group.add(innerSubscription);
+
+ // Check for promises support
+ isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
+
+ innerSubscription.setDisposable(innerSource.subscribe(
+ function (x) { o.onNext(x); },
+ function (e) {
+ errors.push(e);
+ group.remove(innerSubscription);
+ isStopped && group.length === 1 && setCompletion();
+ },
+ function () {
+ group.remove(innerSubscription);
+ isStopped && group.length === 1 && setCompletion();
+ }));
+ },
+ function (e) {
+ errors.push(e);
+ isStopped = true;
+ group.length === 1 && setCompletion();
+ },
+ function () {
+ isStopped = true;
+ group.length === 1 && setCompletion();
+ }));
+ return group;
+ });
+ };
+
+ /**
+ * Continues an observable sequence that is terminated normally or by an exception with the next observable sequence.
+ * @param {Observable} second Second observable sequence used to produce results after the first sequence terminates.
+ * @returns {Observable} An observable sequence that concatenates the first and second sequence, even if the first sequence terminates exceptionally.
+ */
+ observableProto.onErrorResumeNext = function (second) {
+ if (!second) { throw new Error('Second observable is required'); }
+ return onErrorResumeNext([this, second]);
+ };
+
+ /**
+ * Continues an observable sequence that is terminated normally or by an exception with the next observable sequence.
+ *
+ * @example
+ * 1 - res = Rx.Observable.onErrorResumeNext(xs, ys, zs);
+ * 1 - res = Rx.Observable.onErrorResumeNext([xs, ys, zs]);
+ * @returns {Observable} An observable sequence that concatenates the source sequences, even if a sequence terminates exceptionally.
+ */
+ var onErrorResumeNext = Observable.onErrorResumeNext = function () {
+ var sources = [];
+ if (Array.isArray(arguments[0])) {
+ sources = arguments[0];
+ } else {
+ for(var i = 0, len = arguments.length; i < len; i++) { sources.push(arguments[i]); }
+ }
+ return new AnonymousObservable(function (observer) {
+ var pos = 0, subscription = new SerialDisposable(),
+ cancelable = immediateScheduler.scheduleRecursive(function (self) {
+ var current, d;
+ if (pos < sources.length) {
+ current = sources[pos++];
+ isPromise(current) && (current = observableFromPromise(current));
+ d = new SingleAssignmentDisposable();
+ subscription.setDisposable(d);
+ d.setDisposable(current.subscribe(observer.onNext.bind(observer), self, self));
+ } else {
+ observer.onCompleted();
+ }
+ });
+ return new CompositeDisposable(subscription, cancelable);
+ });
+ };
+
+ /**
+ * Returns the values from the source observable sequence only after the other observable sequence produces a value.
+ * @param {Observable | Promise} other The observable sequence or Promise that triggers propagation of elements of the source sequence.
+ * @returns {Observable} An observable sequence containing the elements of the source sequence starting from the point the other sequence triggered propagation.
+ */
+ observableProto.skipUntil = function (other) {
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var isOpen = false;
+ var disposables = new CompositeDisposable(source.subscribe(function (left) {
+ isOpen && o.onNext(left);
+ }, function (e) { o.onError(e); }, function () {
+ isOpen && o.onCompleted();
+ }));
+
+ isPromise(other) && (other = observableFromPromise(other));
+
+ var rightSubscription = new SingleAssignmentDisposable();
+ disposables.add(rightSubscription);
+ rightSubscription.setDisposable(other.subscribe(function () {
+ isOpen = true;
+ rightSubscription.dispose();
+ }, function (e) { o.onError(e); }, function () {
+ rightSubscription.dispose();
+ }));
+
+ return disposables;
+ }, source);
+ };
+
+ var SwitchObservable = (function(__super__) {
+ inherits(SwitchObservable, __super__);
+ function SwitchObservable(source) {
+ this.source = source;
+ __super__.call(this);
+ }
+
+ SwitchObservable.prototype.subscribeCore = function (o) {
+ var inner = new SerialDisposable(), s = this.source.subscribe(new SwitchObserver(o, inner));
+ return new CompositeDisposable(s, inner);
+ };
+
+ function SwitchObserver(o, inner) {
+ this.o = o;
+ this.inner = inner;
+ this.stopped = false;
+ this.latest = 0;
+ this.hasLatest = false;
+ this.isStopped = false;
+ }
+ SwitchObserver.prototype.onNext = function (innerSource) {
+ if (this.isStopped) { return; }
+ var d = new SingleAssignmentDisposable(), id = ++this.latest;
+ this.hasLatest = true;
+ this.inner.setDisposable(d);
+ isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
+ d.setDisposable(innerSource.subscribe(new InnerObserver(this, id)));
+ };
+ SwitchObserver.prototype.onError = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ }
+ };
+ SwitchObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.stopped = true;
+ !this.hasLatest && this.o.onCompleted();
+ }
+ };
+ SwitchObserver.prototype.dispose = function () { this.isStopped = true; };
+ SwitchObserver.prototype.fail = function (e) {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ function InnerObserver(parent, id) {
+ this.parent = parent;
+ this.id = id;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) {
+ if (this.isStopped) { return; }
+ this.parent.latest === this.id && this.parent.o.onNext(x);
+ };
+ InnerObserver.prototype.onError = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.parent.latest === this.id && this.parent.o.onError(e);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ if (this.parent.latest === this.id) {
+ this.parent.hasLatest = false;
+ this.parent.isStopped && this.parent.o.onCompleted();
+ }
+ }
+ };
+ InnerObserver.prototype.dispose = function () { this.isStopped = true; }
+ InnerObserver.prototype.fail = function (e) {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ this.parent.o.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ return SwitchObservable;
+ }(ObservableBase));
+
+ /**
+ * Transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
+ * @returns {Observable} The observable sequence that at any point in time produces the elements of the most recent inner observable sequence that has been received.
+ */
+ observableProto['switch'] = observableProto.switchLatest = function () {
+ return new SwitchObservable(this);
+ };
+
+ var TakeUntilObservable = (function(__super__) {
+ inherits(TakeUntilObservable, __super__);
+
+ function TakeUntilObservable(source, other) {
+ this.source = source;
+ this.other = isPromise(other) ? observableFromPromise(other) : other;
+ __super__.call(this);
+ }
+
+ TakeUntilObservable.prototype.subscribeCore = function(o) {
+ return new CompositeDisposable(
+ this.source.subscribe(o),
+ this.other.subscribe(new InnerObserver(o))
+ );
+ };
+
+ function InnerObserver(o) {
+ this.o = o;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) {
+ if (this.isStopped) { return; }
+ this.o.onCompleted();
+ };
+ InnerObserver.prototype.onError = function (err) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(err);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ !this.isStopped && (this.isStopped = true);
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ return TakeUntilObservable;
+ }(ObservableBase));
+
+ /**
+ * Returns the values from the source observable sequence until the other observable sequence produces a value.
+ * @param {Observable | Promise} other Observable sequence or Promise that terminates propagation of elements of the source sequence.
+ * @returns {Observable} An observable sequence containing the elements of the source sequence up to the point the other sequence interrupted further propagation.
+ */
+ observableProto.takeUntil = function (other) {
+ return new TakeUntilObservable(this, other);
+ };
+
+ function falseFactory() { return false; }
+
+ /**
+ * Merges the specified observable sequences into one observable sequence by using the selector function only when the (first) source observable sequence produces an element.
+ * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
+ */
+ observableProto.withLatestFrom = function () {
+ var len = arguments.length, args = new Array(len)
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+ var resultSelector = args.pop(), source = this;
+ Array.isArray(args[0]) && (args = args[0]);
+
+ return new AnonymousObservable(function (observer) {
+ var n = args.length,
+ hasValue = arrayInitialize(n, falseFactory),
+ hasValueAll = false,
+ values = new Array(n);
+
+ var subscriptions = new Array(n + 1);
+ for (var idx = 0; idx < n; idx++) {
+ (function (i) {
+ var other = args[i], sad = new SingleAssignmentDisposable();
+ isPromise(other) && (other = observableFromPromise(other));
+ sad.setDisposable(other.subscribe(function (x) {
+ values[i] = x;
+ hasValue[i] = true;
+ hasValueAll = hasValue.every(identity);
+ }, function (e) { observer.onError(e); }, noop));
+ subscriptions[i] = sad;
+ }(idx));
+ }
+
+ var sad = new SingleAssignmentDisposable();
+ sad.setDisposable(source.subscribe(function (x) {
+ var allValues = [x].concat(values);
+ if (!hasValueAll) { return; }
+ var res = tryCatch(resultSelector).apply(null, allValues);
+ if (res === errorObj) { return observer.onError(res.e); }
+ observer.onNext(res);
+ }, function (e) { observer.onError(e); }, function () {
+ observer.onCompleted();
+ }));
+ subscriptions[n] = sad;
+
+ return new CompositeDisposable(subscriptions);
+ }, this);
+ };
+
+ function zipArray(second, resultSelector) {
+ var first = this;
+ return new AnonymousObservable(function (o) {
+ var index = 0, len = second.length;
+ return first.subscribe(function (left) {
+ if (index < len) {
+ var right = second[index++], res = tryCatch(resultSelector)(left, right);
+ if (res === errorObj) { return o.onError(res.e); }
+ o.onNext(res);
+ } else {
+ o.onCompleted();
+ }
+ }, function (e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, first);
+ }
+
+ function falseFactory() { return false; }
+ function emptyArrayFactory() { return []; }
+
+ /**
+ * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences or an array have produced an element at a corresponding index.
+ * The last element in the arguments must be a function to invoke for each series of elements at corresponding indexes in the args.
+ * @returns {Observable} An observable sequence containing the result of combining elements of the args using the specified result selector function.
+ */
+ observableProto.zip = function () {
+ if (Array.isArray(arguments[0])) { return zipArray.apply(this, arguments); }
+ var len = arguments.length, args = new Array(len);
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+
+ var parent = this, resultSelector = args.pop();
+ args.unshift(parent);
+ return new AnonymousObservable(function (o) {
+ var n = args.length,
+ queues = arrayInitialize(n, emptyArrayFactory),
+ isDone = arrayInitialize(n, falseFactory);
+
+ var subscriptions = new Array(n);
+ for (var idx = 0; idx < n; idx++) {
+ (function (i) {
+ var source = args[i], sad = new SingleAssignmentDisposable();
+ isPromise(source) && (source = observableFromPromise(source));
+ sad.setDisposable(source.subscribe(function (x) {
+ queues[i].push(x);
+ if (queues.every(function (x) { return x.length > 0; })) {
+ var queuedValues = queues.map(function (x) { return x.shift(); }),
+ res = tryCatch(resultSelector).apply(parent, queuedValues);
+ if (res === errorObj) { return o.onError(res.e); }
+ o.onNext(res);
+ } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) {
+ o.onCompleted();
+ }
+ }, function (e) { o.onError(e); }, function () {
+ isDone[i] = true;
+ isDone.every(identity) && o.onCompleted();
+ }));
+ subscriptions[i] = sad;
+ })(idx);
+ }
+
+ return new CompositeDisposable(subscriptions);
+ }, parent);
+ };
+
+ /**
+ * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index.
+ * @param arguments Observable sources.
+ * @param {Function} resultSelector Function to invoke for each series of elements at corresponding indexes in the sources.
+ * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
+ */
+ Observable.zip = function () {
+ var len = arguments.length, args = new Array(len);
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+ var first = args.shift();
+ return first.zip.apply(first, args);
+ };
+
+ function falseFactory() { return false; }
+ function arrayFactory() { return []; }
+
+ /**
+ * Merges the specified observable sequences into one observable sequence by emitting a list with the elements of the observable sequences at corresponding indexes.
+ * @param arguments Observable sources.
+ * @returns {Observable} An observable sequence containing lists of elements at corresponding indexes.
+ */
+ Observable.zipArray = function () {
+ var sources;
+ if (Array.isArray(arguments[0])) {
+ sources = arguments[0];
+ } else {
+ var len = arguments.length;
+ sources = new Array(len);
+ for(var i = 0; i < len; i++) { sources[i] = arguments[i]; }
+ }
+ return new AnonymousObservable(function (o) {
+ var n = sources.length,
+ queues = arrayInitialize(n, arrayFactory),
+ isDone = arrayInitialize(n, falseFactory);
+
+ var subscriptions = new Array(n);
+ for (var idx = 0; idx < n; idx++) {
+ (function (i) {
+ subscriptions[i] = new SingleAssignmentDisposable();
+ subscriptions[i].setDisposable(sources[i].subscribe(function (x) {
+ queues[i].push(x);
+ if (queues.every(function (x) { return x.length > 0; })) {
+ var res = queues.map(function (x) { return x.shift(); });
+ o.onNext(res);
+ } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) {
+ return o.onCompleted();
+ }
+ }, function (e) { o.onError(e); }, function () {
+ isDone[i] = true;
+ isDone.every(identity) && o.onCompleted();
+ }));
+ })(idx);
+ }
+
+ return new CompositeDisposable(subscriptions);
+ });
+ };
+
+ /**
+ * Hides the identity of an observable sequence.
+ * @returns {Observable} An observable sequence that hides the identity of the source sequence.
+ */
+ observableProto.asObservable = function () {
+ var source = this;
+ return new AnonymousObservable(function (o) { return source.subscribe(o); }, source);
+ };
+
+ /**
+ * Projects each element of an observable sequence into zero or more buffers which are produced based on element count information.
+ *
+ * @example
+ * var res = xs.bufferWithCount(10);
+ * var res = xs.bufferWithCount(10, 1);
+ * @param {Number} count Length of each buffer.
+ * @param {Number} [skip] Number of elements to skip between creation of consecutive buffers. If not provided, defaults to the count.
+ * @returns {Observable} An observable sequence of buffers.
+ */
+ observableProto.bufferWithCount = function (count, skip) {
+ if (typeof skip !== 'number') {
+ skip = count;
+ }
+ return this.windowWithCount(count, skip).selectMany(function (x) {
+ return x.toArray();
+ }).where(function (x) {
+ return x.length > 0;
+ });
+ };
+
+ /**
+ * Dematerializes the explicit notification values of an observable sequence as implicit notifications.
+ * @returns {Observable} An observable sequence exhibiting the behavior corresponding to the source sequence's notification values.
+ */
+ observableProto.dematerialize = function () {
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ return source.subscribe(function (x) { return x.accept(o); }, function(e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, this);
+ };
+
+ /**
+ * Returns an observable sequence that contains only distinct contiguous elements according to the keySelector and the comparer.
+ *
+ * var obs = observable.distinctUntilChanged();
+ * var obs = observable.distinctUntilChanged(function (x) { return x.id; });
+ * var obs = observable.distinctUntilChanged(function (x) { return x.id; }, function (x, y) { return x === y; });
+ *
+ * @param {Function} [keySelector] A function to compute the comparison key for each element. If not provided, it projects the value.
+ * @param {Function} [comparer] Equality comparer for computed key values. If not provided, defaults to an equality comparer function.
+ * @returns {Observable} An observable sequence only containing the distinct contiguous elements, based on a computed key value, from the source sequence.
+ */
+ observableProto.distinctUntilChanged = function (keySelector, comparer) {
+ var source = this;
+ comparer || (comparer = defaultComparer);
+ return new AnonymousObservable(function (o) {
+ var hasCurrentKey = false, currentKey;
+ return source.subscribe(function (value) {
+ var key = value;
+ if (keySelector) {
+ key = tryCatch(keySelector)(value);
+ if (key === errorObj) { return o.onError(key.e); }
+ }
+ if (hasCurrentKey) {
+ var comparerEquals = tryCatch(comparer)(currentKey, key);
+ if (comparerEquals === errorObj) { return o.onError(comparerEquals.e); }
+ }
+ if (!hasCurrentKey || !comparerEquals) {
+ hasCurrentKey = true;
+ currentKey = key;
+ o.onNext(value);
+ }
+ }, function (e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, this);
+ };
+
+ var TapObservable = (function(__super__) {
+ inherits(TapObservable,__super__);
+ function TapObservable(source, observerOrOnNext, onError, onCompleted) {
+ this.source = source;
+ this.t = !observerOrOnNext || isFunction(observerOrOnNext) ?
+ observerCreate(observerOrOnNext || noop, onError || noop, onCompleted || noop) :
+ observerOrOnNext;
+ __super__.call(this);
+ }
+
+ TapObservable.prototype.subscribeCore = function(o) {
+ return this.source.subscribe(new InnerObserver(o, this.t));
+ };
+
+ function InnerObserver(o, t) {
+ this.o = o;
+ this.t = t;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function(x) {
+ if (this.isStopped) { return; }
+ var res = tryCatch(this.t.onNext).call(this.t, x);
+ if (res === errorObj) { this.o.onError(res.e); }
+ this.o.onNext(x);
+ };
+ InnerObserver.prototype.onError = function(err) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ var res = tryCatch(this.t.onError).call(this.t, err);
+ if (res === errorObj) { return this.o.onError(res.e); }
+ this.o.onError(err);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function() {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ var res = tryCatch(this.t.onCompleted).call(this.t);
+ if (res === errorObj) { return this.o.onError(res.e); }
+ this.o.onCompleted();
+ }
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ return TapObservable;
+ }(ObservableBase));
+
+ /**
+ * Invokes an action for each element in the observable sequence and invokes an action upon graceful or exceptional termination of the observable sequence.
+ * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
+ * @param {Function | Observer} observerOrOnNext Action to invoke for each element in the observable sequence or an o.
+ * @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function.
+ * @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function.
+ * @returns {Observable} The source sequence with the side-effecting behavior applied.
+ */
+ observableProto['do'] = observableProto.tap = observableProto.doAction = function (observerOrOnNext, onError, onCompleted) {
+ return new TapObservable(this, observerOrOnNext, onError, onCompleted);
+ };
+
+ /**
+ * Invokes an action for each element in the observable sequence.
+ * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
+ * @param {Function} onNext Action to invoke for each element in the observable sequence.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} The source sequence with the side-effecting behavior applied.
+ */
+ observableProto.doOnNext = observableProto.tapOnNext = function (onNext, thisArg) {
+ return this.tap(typeof thisArg !== 'undefined' ? function (x) { onNext.call(thisArg, x); } : onNext);
+ };
+
+ /**
+ * Invokes an action upon exceptional termination of the observable sequence.
+ * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
+ * @param {Function} onError Action to invoke upon exceptional termination of the observable sequence.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} The source sequence with the side-effecting behavior applied.
+ */
+ observableProto.doOnError = observableProto.tapOnError = function (onError, thisArg) {
+ return this.tap(noop, typeof thisArg !== 'undefined' ? function (e) { onError.call(thisArg, e); } : onError);
+ };
+
+ /**
+ * Invokes an action upon graceful termination of the observable sequence.
+ * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
+ * @param {Function} onCompleted Action to invoke upon graceful termination of the observable sequence.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} The source sequence with the side-effecting behavior applied.
+ */
+ observableProto.doOnCompleted = observableProto.tapOnCompleted = function (onCompleted, thisArg) {
+ return this.tap(noop, null, typeof thisArg !== 'undefined' ? function () { onCompleted.call(thisArg); } : onCompleted);
+ };
+
+ /**
+ * Invokes a specified action after the source observable sequence terminates gracefully or exceptionally.
+ * @param {Function} finallyAction Action to invoke after the source observable sequence terminates.
+ * @returns {Observable} Source sequence with the action-invoking termination behavior applied.
+ */
+ observableProto['finally'] = observableProto.ensure = function (action) {
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ var subscription;
+ try {
+ subscription = source.subscribe(observer);
+ } catch (e) {
+ action();
+ throw e;
+ }
+ return disposableCreate(function () {
+ try {
+ subscription.dispose();
+ } catch (e) {
+ throw e;
+ } finally {
+ action();
+ }
+ });
+ }, this);
+ };
+
+ /**
+ * @deprecated use #finally or #ensure instead.
+ */
+ observableProto.finallyAction = function (action) {
+ //deprecate('finallyAction', 'finally or ensure');
+ return this.ensure(action);
+ };
+
+ var IgnoreElementsObservable = (function(__super__) {
+ inherits(IgnoreElementsObservable, __super__);
+
+ function IgnoreElementsObservable(source) {
+ this.source = source;
+ __super__.call(this);
+ }
+
+ IgnoreElementsObservable.prototype.subscribeCore = function (o) {
+ return this.source.subscribe(new InnerObserver(o));
+ };
+
+ function InnerObserver(o) {
+ this.o = o;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = noop;
+ InnerObserver.prototype.onError = function (err) {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(err);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ this.o.onCompleted();
+ }
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.observer.onError(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ return IgnoreElementsObservable;
+ }(ObservableBase));
+
+ /**
+ * Ignores all elements in an observable sequence leaving only the termination messages.
+ * @returns {Observable} An empty observable sequence that signals termination, successful or exceptional, of the source sequence.
+ */
+ observableProto.ignoreElements = function () {
+ return new IgnoreElementsObservable(this);
+ };
+
+ /**
+ * Materializes the implicit notifications of an observable sequence as explicit notification values.
+ * @returns {Observable} An observable sequence containing the materialized notification values from the source sequence.
+ */
+ observableProto.materialize = function () {
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ return source.subscribe(function (value) {
+ observer.onNext(notificationCreateOnNext(value));
+ }, function (e) {
+ observer.onNext(notificationCreateOnError(e));
+ observer.onCompleted();
+ }, function () {
+ observer.onNext(notificationCreateOnCompleted());
+ observer.onCompleted();
+ });
+ }, source);
+ };
+
+ /**
+ * Repeats the observable sequence a specified number of times. If the repeat count is not specified, the sequence repeats indefinitely.
+ * @param {Number} [repeatCount] Number of times to repeat the sequence. If not provided, repeats the sequence indefinitely.
+ * @returns {Observable} The observable sequence producing the elements of the given sequence repeatedly.
+ */
+ observableProto.repeat = function (repeatCount) {
+ return enumerableRepeat(this, repeatCount).concat();
+ };
+
+ /**
+ * Repeats the source observable sequence the specified number of times or until it successfully terminates. If the retry count is not specified, it retries indefinitely.
+ * Note if you encounter an error and want it to retry once, then you must use .retry(2);
+ *
+ * @example
+ * var res = retried = retry.repeat();
+ * var res = retried = retry.repeat(2);
+ * @param {Number} [retryCount] Number of times to retry the sequence. If not provided, retry the sequence indefinitely.
+ * @returns {Observable} An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully.
+ */
+ observableProto.retry = function (retryCount) {
+ return enumerableRepeat(this, retryCount).catchError();
+ };
+
+ /**
+ * Repeats the source observable sequence upon error each time the notifier emits or until it successfully terminates.
+ * if the notifier completes, the observable sequence completes.
+ *
+ * @example
+ * var timer = Observable.timer(500);
+ * var source = observable.retryWhen(timer);
+ * @param {Observable} [notifier] An observable that triggers the retries or completes the observable with onNext or onCompleted respectively.
+ * @returns {Observable} An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully.
+ */
+ observableProto.retryWhen = function (notifier) {
+ return enumerableRepeat(this).catchErrorWhen(notifier);
+ };
+ var ScanObservable = (function(__super__) {
+ inherits(ScanObservable, __super__);
+ function ScanObservable(source, accumulator, hasSeed, seed) {
+ this.source = source;
+ this.accumulator = accumulator;
+ this.hasSeed = hasSeed;
+ this.seed = seed;
+ __super__.call(this);
+ }
+
+ ScanObservable.prototype.subscribeCore = function(observer) {
+ return this.source.subscribe(new ScanObserver(observer,this));
+ };
+
+ return ScanObservable;
+ }(ObservableBase));
+
+ function ScanObserver(observer, parent) {
+ this.observer = observer;
+ this.accumulator = parent.accumulator;
+ this.hasSeed = parent.hasSeed;
+ this.seed = parent.seed;
+ this.hasAccumulation = false;
+ this.accumulation = null;
+ this.hasValue = false;
+ this.isStopped = false;
+ }
+ ScanObserver.prototype.onNext = function (x) {
+ if (this.isStopped) { return; }
+ !this.hasValue && (this.hasValue = true);
+ try {
+ if (this.hasAccumulation) {
+ this.accumulation = this.accumulator(this.accumulation, x);
+ } else {
+ this.accumulation = this.hasSeed ? this.accumulator(this.seed, x) : x;
+ this.hasAccumulation = true;
+ }
+ } catch (e) {
+ return this.observer.onError(e);
+ }
+ this.observer.onNext(this.accumulation);
+ };
+ ScanObserver.prototype.onError = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.observer.onError(e);
+ }
+ };
+ ScanObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ !this.hasValue && this.hasSeed && this.observer.onNext(this.seed);
+ this.observer.onCompleted();
+ }
+ };
+ ScanObserver.prototype.dispose = function() { this.isStopped = true; };
+ ScanObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.observer.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ /**
+ * Applies an accumulator function over an observable sequence and returns each intermediate result. The optional seed value is used as the initial accumulator value.
+ * For aggregation behavior with no intermediate results, see Observable.aggregate.
+ * @param {Mixed} [seed] The initial accumulator value.
+ * @param {Function} accumulator An accumulator function to be invoked on each element.
+ * @returns {Observable} An observable sequence containing the accumulated values.
+ */
+ observableProto.scan = function () {
+ var hasSeed = false, seed, accumulator, source = this;
+ if (arguments.length === 2) {
+ hasSeed = true;
+ seed = arguments[0];
+ accumulator = arguments[1];
+ } else {
+ accumulator = arguments[0];
+ }
+ return new ScanObservable(this, accumulator, hasSeed, seed);
+ };
+
+ /**
+ * Bypasses a specified number of elements at the end of an observable sequence.
+ * @description
+ * This operator accumulates a queue with a length enough to store the first `count` elements. As more elements are
+ * received, elements are taken from the front of the queue and produced on the result sequence. This causes elements to be delayed.
+ * @param count Number of elements to bypass at the end of the source sequence.
+ * @returns {Observable} An observable sequence containing the source sequence elements except for the bypassed ones at the end.
+ */
+ observableProto.skipLast = function (count) {
+ if (count < 0) { throw new ArgumentOutOfRangeError(); }
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var q = [];
+ return source.subscribe(function (x) {
+ q.push(x);
+ q.length > count && o.onNext(q.shift());
+ }, function (e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, source);
+ };
+
+ /**
+ * Prepends a sequence of values to an observable sequence with an optional scheduler and an argument list of values to prepend.
+ * @example
+ * var res = source.startWith(1, 2, 3);
+ * var res = source.startWith(Rx.Scheduler.timeout, 1, 2, 3);
+ * @param {Arguments} args The specified values to prepend to the observable sequence
+ * @returns {Observable} The source sequence prepended with the specified values.
+ */
+ observableProto.startWith = function () {
+ var values, scheduler, start = 0;
+ if (!!arguments.length && isScheduler(arguments[0])) {
+ scheduler = arguments[0];
+ start = 1;
+ } else {
+ scheduler = immediateScheduler;
+ }
+ for(var args = [], i = start, len = arguments.length; i < len; i++) { args.push(arguments[i]); }
+ return enumerableOf([observableFromArray(args, scheduler), this]).concat();
+ };
+
+ /**
+ * Returns a specified number of contiguous elements from the end of an observable sequence.
+ * @description
+ * This operator accumulates a buffer with a length enough to store elements count elements. Upon completion of
+ * the source sequence, this buffer is drained on the result sequence. This causes the elements to be delayed.
+ * @param {Number} count Number of elements to take from the end of the source sequence.
+ * @returns {Observable} An observable sequence containing the specified number of elements from the end of the source sequence.
+ */
+ observableProto.takeLast = function (count) {
+ if (count < 0) { throw new ArgumentOutOfRangeError(); }
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var q = [];
+ return source.subscribe(function (x) {
+ q.push(x);
+ q.length > count && q.shift();
+ }, function (e) { o.onError(e); }, function () {
+ while (q.length > 0) { o.onNext(q.shift()); }
+ o.onCompleted();
+ });
+ }, source);
+ };
+
+ /**
+ * Returns an array with the specified number of contiguous elements from the end of an observable sequence.
+ *
+ * @description
+ * This operator accumulates a buffer with a length enough to store count elements. Upon completion of the
+ * source sequence, this buffer is produced on the result sequence.
+ * @param {Number} count Number of elements to take from the end of the source sequence.
+ * @returns {Observable} An observable sequence containing a single array with the specified number of elements from the end of the source sequence.
+ */
+ observableProto.takeLastBuffer = function (count) {
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var q = [];
+ return source.subscribe(function (x) {
+ q.push(x);
+ q.length > count && q.shift();
+ }, function (e) { o.onError(e); }, function () {
+ o.onNext(q);
+ o.onCompleted();
+ });
+ }, source);
+ };
+
+ /**
+ * Projects each element of an observable sequence into zero or more windows which are produced based on element count information.
+ *
+ * var res = xs.windowWithCount(10);
+ * var res = xs.windowWithCount(10, 1);
+ * @param {Number} count Length of each window.
+ * @param {Number} [skip] Number of elements to skip between creation of consecutive windows. If not specified, defaults to the count.
+ * @returns {Observable} An observable sequence of windows.
+ */
+ observableProto.windowWithCount = function (count, skip) {
+ var source = this;
+ +count || (count = 0);
+ Math.abs(count) === Infinity && (count = 0);
+ if (count <= 0) { throw new ArgumentOutOfRangeError(); }
+ skip == null && (skip = count);
+ +skip || (skip = 0);
+ Math.abs(skip) === Infinity && (skip = 0);
+
+ if (skip <= 0) { throw new ArgumentOutOfRangeError(); }
+ return new AnonymousObservable(function (observer) {
+ var m = new SingleAssignmentDisposable(),
+ refCountDisposable = new RefCountDisposable(m),
+ n = 0,
+ q = [];
+
+ function createWindow () {
+ var s = new Subject();
+ q.push(s);
+ observer.onNext(addRef(s, refCountDisposable));
+ }
+
+ createWindow();
+
+ m.setDisposable(source.subscribe(
+ function (x) {
+ for (var i = 0, len = q.length; i < len; i++) { q[i].onNext(x); }
+ var c = n - count + 1;
+ c >= 0 && c % skip === 0 && q.shift().onCompleted();
+ ++n % skip === 0 && createWindow();
+ },
+ function (e) {
+ while (q.length > 0) { q.shift().onError(e); }
+ observer.onError(e);
+ },
+ function () {
+ while (q.length > 0) { q.shift().onCompleted(); }
+ observer.onCompleted();
+ }
+ ));
+ return refCountDisposable;
+ }, source);
+ };
+
+ function concatMap(source, selector, thisArg) {
+ var selectorFunc = bindCallback(selector, thisArg, 3);
+ return source.map(function (x, i) {
+ var result = selectorFunc(x, i, source);
+ isPromise(result) && (result = observableFromPromise(result));
+ (isArrayLike(result) || isIterable(result)) && (result = observableFrom(result));
+ return result;
+ }).concatAll();
+ }
+
+ /**
+ * One of the Following:
+ * Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
+ *
+ * @example
+ * var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); });
+ * Or:
+ * Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
+ *
+ * var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
+ * Or:
+ * Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
+ *
+ * var res = source.concatMap(Rx.Observable.fromArray([1,2,3]));
+ * @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the
+ * source sequence onto which could be either an observable or Promise.
+ * @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
+ * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
+ */
+ observableProto.selectConcat = observableProto.concatMap = function (selector, resultSelector, thisArg) {
+ if (isFunction(selector) && isFunction(resultSelector)) {
+ return this.concatMap(function (x, i) {
+ var selectorResult = selector(x, i);
+ isPromise(selectorResult) && (selectorResult = observableFromPromise(selectorResult));
+ (isArrayLike(selectorResult) || isIterable(selectorResult)) && (selectorResult = observableFrom(selectorResult));
+
+ return selectorResult.map(function (y, i2) {
+ return resultSelector(x, y, i, i2);
+ });
+ });
+ }
+ return isFunction(selector) ?
+ concatMap(this, selector, thisArg) :
+ concatMap(this, function () { return selector; });
+ };
+
+ /**
+ * Projects each notification of an observable sequence to an observable sequence and concats the resulting observable sequences into one observable sequence.
+ * @param {Function} onNext A transform function to apply to each element; the second parameter of the function represents the index of the source element.
+ * @param {Function} onError A transform function to apply when an error occurs in the source sequence.
+ * @param {Function} onCompleted A transform function to apply when the end of the source sequence is reached.
+ * @param {Any} [thisArg] An optional "this" to use to invoke each transform.
+ * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function corresponding to each notification in the input sequence.
+ */
+ observableProto.concatMapObserver = observableProto.selectConcatObserver = function(onNext, onError, onCompleted, thisArg) {
+ var source = this,
+ onNextFunc = bindCallback(onNext, thisArg, 2),
+ onErrorFunc = bindCallback(onError, thisArg, 1),
+ onCompletedFunc = bindCallback(onCompleted, thisArg, 0);
+ return new AnonymousObservable(function (observer) {
+ var index = 0;
+ return source.subscribe(
+ function (x) {
+ var result;
+ try {
+ result = onNextFunc(x, index++);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+ isPromise(result) && (result = observableFromPromise(result));
+ observer.onNext(result);
+ },
+ function (err) {
+ var result;
+ try {
+ result = onErrorFunc(err);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+ isPromise(result) && (result = observableFromPromise(result));
+ observer.onNext(result);
+ observer.onCompleted();
+ },
+ function () {
+ var result;
+ try {
+ result = onCompletedFunc();
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+ isPromise(result) && (result = observableFromPromise(result));
+ observer.onNext(result);
+ observer.onCompleted();
+ });
+ }, this).concatAll();
+ };
+
+ /**
+ * Returns the elements of the specified sequence or the specified value in a singleton sequence if the sequence is empty.
+ *
+ * var res = obs = xs.defaultIfEmpty();
+ * 2 - obs = xs.defaultIfEmpty(false);
+ *
+ * @memberOf Observable#
+ * @param defaultValue The value to return if the sequence is empty. If not provided, this defaults to null.
+ * @returns {Observable} An observable sequence that contains the specified default value if the source is empty; otherwise, the elements of the source itself.
+ */
+ observableProto.defaultIfEmpty = function (defaultValue) {
+ var source = this;
+ defaultValue === undefined && (defaultValue = null);
+ return new AnonymousObservable(function (observer) {
+ var found = false;
+ return source.subscribe(function (x) {
+ found = true;
+ observer.onNext(x);
+ },
+ function (e) { observer.onError(e); },
+ function () {
+ !found && observer.onNext(defaultValue);
+ observer.onCompleted();
+ });
+ }, source);
+ };
+
+ // Swap out for Array.findIndex
+ function arrayIndexOfComparer(array, item, comparer) {
+ for (var i = 0, len = array.length; i < len; i++) {
+ if (comparer(array[i], item)) { return i; }
+ }
+ return -1;
+ }
+
+ function HashSet(comparer) {
+ this.comparer = comparer;
+ this.set = [];
+ }
+ HashSet.prototype.push = function(value) {
+ var retValue = arrayIndexOfComparer(this.set, value, this.comparer) === -1;
+ retValue && this.set.push(value);
+ return retValue;
+ };
+
+ /**
+ * Returns an observable sequence that contains only distinct elements according to the keySelector and the comparer.
+ * Usage of this operator should be considered carefully due to the maintenance of an internal lookup structure which can grow large.
+ *
+ * @example
+ * var res = obs = xs.distinct();
+ * 2 - obs = xs.distinct(function (x) { return x.id; });
+ * 2 - obs = xs.distinct(function (x) { return x.id; }, function (a,b) { return a === b; });
+ * @param {Function} [keySelector] A function to compute the comparison key for each element.
+ * @param {Function} [comparer] Used to compare items in the collection.
+ * @returns {Observable} An observable sequence only containing the distinct elements, based on a computed key value, from the source sequence.
+ */
+ observableProto.distinct = function (keySelector, comparer) {
+ var source = this;
+ comparer || (comparer = defaultComparer);
+ return new AnonymousObservable(function (o) {
+ var hashSet = new HashSet(comparer);
+ return source.subscribe(function (x) {
+ var key = x;
+
+ if (keySelector) {
+ try {
+ key = keySelector(x);
+ } catch (e) {
+ o.onError(e);
+ return;
+ }
+ }
+ hashSet.push(key) && o.onNext(x);
+ },
+ function (e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, this);
+ };
+
+ /**
+ * Groups the elements of an observable sequence according to a specified key selector function and comparer and selects the resulting elements by using a specified function.
+ *
+ * @example
+ * var res = observable.groupBy(function (x) { return x.id; });
+ * 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; });
+ * 3 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function (x) { return x.toString(); });
+ * @param {Function} keySelector A function to extract the key for each element.
+ * @param {Function} [elementSelector] A function to map each source element to an element in an observable group.
+ * @param {Function} [comparer] Used to determine whether the objects are equal.
+ * @returns {Observable} A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value.
+ */
+ observableProto.groupBy = function (keySelector, elementSelector, comparer) {
+ return this.groupByUntil(keySelector, elementSelector, observableNever, comparer);
+ };
+
+ /**
+ * Groups the elements of an observable sequence according to a specified key selector function.
+ * A duration selector function is used to control the lifetime of groups. When a group expires, it receives an OnCompleted notification. When a new element with the same
+ * key value as a reclaimed group occurs, the group will be reborn with a new lifetime request.
+ *
+ * @example
+ * var res = observable.groupByUntil(function (x) { return x.id; }, null, function () { return Rx.Observable.never(); });
+ * 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function () { return Rx.Observable.never(); });
+ * 3 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function () { return Rx.Observable.never(); }, function (x) { return x.toString(); });
+ * @param {Function} keySelector A function to extract the key for each element.
+ * @param {Function} durationSelector A function to signal the expiration of a group.
+ * @param {Function} [comparer] Used to compare objects. When not specified, the default comparer is used.
+ * @returns {Observable}
+ * A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value.
+ * If a group's lifetime expires, a new group with the same key value can be created once an element with such a key value is encoutered.
+ *
+ */
+ observableProto.groupByUntil = function (keySelector, elementSelector, durationSelector, comparer) {
+ var source = this;
+ elementSelector || (elementSelector = identity);
+ comparer || (comparer = defaultComparer);
+ return new AnonymousObservable(function (observer) {
+ function handleError(e) { return function (item) { item.onError(e); }; }
+ var map = new Dictionary(0, comparer),
+ groupDisposable = new CompositeDisposable(),
+ refCountDisposable = new RefCountDisposable(groupDisposable);
+
+ groupDisposable.add(source.subscribe(function (x) {
+ var key;
+ try {
+ key = keySelector(x);
+ } catch (e) {
+ map.getValues().forEach(handleError(e));
+ observer.onError(e);
+ return;
+ }
+
+ var fireNewMapEntry = false,
+ writer = map.tryGetValue(key);
+ if (!writer) {
+ writer = new Subject();
+ map.set(key, writer);
+ fireNewMapEntry = true;
+ }
+
+ if (fireNewMapEntry) {
+ var group = new GroupedObservable(key, writer, refCountDisposable),
+ durationGroup = new GroupedObservable(key, writer);
+ try {
+ duration = durationSelector(durationGroup);
+ } catch (e) {
+ map.getValues().forEach(handleError(e));
+ observer.onError(e);
+ return;
+ }
+
+ observer.onNext(group);
+
+ var md = new SingleAssignmentDisposable();
+ groupDisposable.add(md);
+
+ var expire = function () {
+ map.remove(key) && writer.onCompleted();
+ groupDisposable.remove(md);
+ };
+
+ md.setDisposable(duration.take(1).subscribe(
+ noop,
+ function (exn) {
+ map.getValues().forEach(handleError(exn));
+ observer.onError(exn);
+ },
+ expire)
+ );
+ }
+
+ var element;
+ try {
+ element = elementSelector(x);
+ } catch (e) {
+ map.getValues().forEach(handleError(e));
+ observer.onError(e);
+ return;
+ }
+
+ writer.onNext(element);
+ }, function (ex) {
+ map.getValues().forEach(handleError(ex));
+ observer.onError(ex);
+ }, function () {
+ map.getValues().forEach(function (item) { item.onCompleted(); });
+ observer.onCompleted();
+ }));
+
+ return refCountDisposable;
+ }, source);
+ };
+
+ var MapObservable = (function (__super__) {
+ inherits(MapObservable, __super__);
+
+ function MapObservable(source, selector, thisArg) {
+ this.source = source;
+ this.selector = bindCallback(selector, thisArg, 3);
+ __super__.call(this);
+ }
+
+ function innerMap(selector, self) {
+ return function (x, i, o) { return selector.call(this, self.selector(x, i, o), i, o); }
+ }
+
+ MapObservable.prototype.internalMap = function (selector, thisArg) {
+ return new MapObservable(this.source, innerMap(selector, this), thisArg);
+ };
+
+ MapObservable.prototype.subscribeCore = function (o) {
+ return this.source.subscribe(new InnerObserver(o, this.selector, this));
+ };
+
+ function InnerObserver(o, selector, source) {
+ this.o = o;
+ this.selector = selector;
+ this.source = source;
+ this.i = 0;
+ this.isStopped = false;
+ }
+
+ InnerObserver.prototype.onNext = function(x) {
+ if (this.isStopped) { return; }
+ var result = tryCatch(this.selector)(x, this.i++, this.source);
+ if (result === errorObj) {
+ return this.o.onError(result.e);
+ }
+ this.o.onNext(result);
+ };
+ InnerObserver.prototype.onError = function (e) {
+ if(!this.isStopped) { this.isStopped = true; this.o.onError(e); }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if(!this.isStopped) { this.isStopped = true; this.o.onCompleted(); }
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ return MapObservable;
+
+ }(ObservableBase));
+
+ /**
+ * Projects each element of an observable sequence into a new form by incorporating the element's index.
+ * @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source.
+ */
+ observableProto.map = observableProto.select = function (selector, thisArg) {
+ var selectorFn = typeof selector === 'function' ? selector : function () { return selector; };
+ return this instanceof MapObservable ?
+ this.internalMap(selectorFn, thisArg) :
+ new MapObservable(this, selectorFn, thisArg);
+ };
+
+ /**
+ * Retrieves the value of a specified nested property from all elements in
+ * the Observable sequence.
+ * @param {Arguments} arguments The nested properties to pluck.
+ * @returns {Observable} Returns a new Observable sequence of property values.
+ */
+ observableProto.pluck = function () {
+ var args = arguments, len = arguments.length;
+ if (len === 0) { throw new Error('List of properties cannot be empty.'); }
+ return this.map(function (x) {
+ var currentProp = x;
+ for (var i = 0; i < len; i++) {
+ var p = currentProp[args[i]];
+ if (typeof p !== 'undefined') {
+ currentProp = p;
+ } else {
+ return undefined;
+ }
+ }
+ return currentProp;
+ });
+ };
+
+ function flatMap(source, selector, thisArg) {
+ var selectorFunc = bindCallback(selector, thisArg, 3);
+ return source.map(function (x, i) {
+ var result = selectorFunc(x, i, source);
+ isPromise(result) && (result = observableFromPromise(result));
+ (isArrayLike(result) || isIterable(result)) && (result = observableFrom(result));
+ return result;
+ }).mergeAll();
+ }
+
+ /**
+ * One of the Following:
+ * Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
+ *
+ * @example
+ * var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); });
+ * Or:
+ * Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
+ *
+ * var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
+ * Or:
+ * Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
+ *
+ * var res = source.selectMany(Rx.Observable.fromArray([1,2,3]));
+ * @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the source sequence onto which could be either an observable or Promise.
+ * @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
+ */
+ observableProto.selectMany = observableProto.flatMap = function (selector, resultSelector, thisArg) {
+ if (isFunction(selector) && isFunction(resultSelector)) {
+ return this.flatMap(function (x, i) {
+ var selectorResult = selector(x, i);
+ isPromise(selectorResult) && (selectorResult = observableFromPromise(selectorResult));
+ (isArrayLike(selectorResult) || isIterable(selectorResult)) && (selectorResult = observableFrom(selectorResult));
+
+ return selectorResult.map(function (y, i2) {
+ return resultSelector(x, y, i, i2);
+ });
+ }, thisArg);
+ }
+ return isFunction(selector) ?
+ flatMap(this, selector, thisArg) :
+ flatMap(this, function () { return selector; });
+ };
+
+ /**
+ * Projects each notification of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
+ * @param {Function} onNext A transform function to apply to each element; the second parameter of the function represents the index of the source element.
+ * @param {Function} onError A transform function to apply when an error occurs in the source sequence.
+ * @param {Function} onCompleted A transform function to apply when the end of the source sequence is reached.
+ * @param {Any} [thisArg] An optional "this" to use to invoke each transform.
+ * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function corresponding to each notification in the input sequence.
+ */
+ observableProto.flatMapObserver = observableProto.selectManyObserver = function (onNext, onError, onCompleted, thisArg) {
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ var index = 0;
+
+ return source.subscribe(
+ function (x) {
+ var result;
+ try {
+ result = onNext.call(thisArg, x, index++);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+ isPromise(result) && (result = observableFromPromise(result));
+ observer.onNext(result);
+ },
+ function (err) {
+ var result;
+ try {
+ result = onError.call(thisArg, err);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+ isPromise(result) && (result = observableFromPromise(result));
+ observer.onNext(result);
+ observer.onCompleted();
+ },
+ function () {
+ var result;
+ try {
+ result = onCompleted.call(thisArg);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+ isPromise(result) && (result = observableFromPromise(result));
+ observer.onNext(result);
+ observer.onCompleted();
+ });
+ }, source).mergeAll();
+ };
+
+ /**
+ * Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then
+ * transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
+ * @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences
+ * and that at any point in time produces the elements of the most recent inner observable sequence that has been received.
+ */
+ observableProto.selectSwitch = observableProto.flatMapLatest = observableProto.switchMap = function (selector, thisArg) {
+ return this.select(selector, thisArg).switchLatest();
+ };
+
+ var SkipObservable = (function(__super__) {
+ inherits(SkipObservable, __super__);
+ function SkipObservable(source, count) {
+ this.source = source;
+ this.skipCount = count;
+ __super__.call(this);
+ }
+
+ SkipObservable.prototype.subscribeCore = function (o) {
+ return this.source.subscribe(new InnerObserver(o, this.skipCount));
+ };
+
+ function InnerObserver(o, c) {
+ this.c = c;
+ this.r = c;
+ this.o = o;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) {
+ if (this.isStopped) { return; }
+ if (this.r <= 0) {
+ this.o.onNext(x);
+ } else {
+ this.r--;
+ }
+ };
+ InnerObserver.prototype.onError = function(e) {
+ if (!this.isStopped) { this.isStopped = true; this.o.onError(e); }
+ };
+ InnerObserver.prototype.onCompleted = function() {
+ if (!this.isStopped) { this.isStopped = true; this.o.onCompleted(); }
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function(e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ return SkipObservable;
+ }(ObservableBase));
+
+ /**
+ * Bypasses a specified number of elements in an observable sequence and then returns the remaining elements.
+ * @param {Number} count The number of elements to skip before returning the remaining elements.
+ * @returns {Observable} An observable sequence that contains the elements that occur after the specified index in the input sequence.
+ */
+ observableProto.skip = function (count) {
+ if (count < 0) { throw new ArgumentOutOfRangeError(); }
+ return new SkipObservable(this, count);
+ };
+ /**
+ * Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements.
+ * The element's index is used in the logic of the predicate function.
+ *
+ * var res = source.skipWhile(function (value) { return value < 10; });
+ * var res = source.skipWhile(function (value, index) { return value < 10 || index < 10; });
+ * @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate.
+ */
+ observableProto.skipWhile = function (predicate, thisArg) {
+ var source = this,
+ callback = bindCallback(predicate, thisArg, 3);
+ return new AnonymousObservable(function (o) {
+ var i = 0, running = false;
+ return source.subscribe(function (x) {
+ if (!running) {
+ try {
+ running = !callback(x, i++, source);
+ } catch (e) {
+ o.onError(e);
+ return;
+ }
+ }
+ running && o.onNext(x);
+ }, function (e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, source);
+ };
+
+ /**
+ * Returns a specified number of contiguous elements from the start of an observable sequence, using the specified scheduler for the edge case of take(0).
+ *
+ * var res = source.take(5);
+ * var res = source.take(0, Rx.Scheduler.timeout);
+ * @param {Number} count The number of elements to return.
+ * @param {Scheduler} [scheduler] Scheduler used to produce an OnCompleted message in case <paramref name="count count</paramref> is set to 0.
+ * @returns {Observable} An observable sequence that contains the specified number of elements from the start of the input sequence.
+ */
+ observableProto.take = function (count, scheduler) {
+ if (count < 0) { throw new ArgumentOutOfRangeError(); }
+ if (count === 0) { return observableEmpty(scheduler); }
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var remaining = count;
+ return source.subscribe(function (x) {
+ if (remaining-- > 0) {
+ o.onNext(x);
+ remaining <= 0 && o.onCompleted();
+ }
+ }, function (e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, source);
+ };
+
+ /**
+ * Returns elements from an observable sequence as long as a specified condition is true.
+ * The element's index is used in the logic of the predicate function.
+ * @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence that contains the elements from the input sequence that occur before the element at which the test no longer passes.
+ */
+ observableProto.takeWhile = function (predicate, thisArg) {
+ var source = this,
+ callback = bindCallback(predicate, thisArg, 3);
+ return new AnonymousObservable(function (o) {
+ var i = 0, running = true;
+ return source.subscribe(function (x) {
+ if (running) {
+ try {
+ running = callback(x, i++, source);
+ } catch (e) {
+ o.onError(e);
+ return;
+ }
+ if (running) {
+ o.onNext(x);
+ } else {
+ o.onCompleted();
+ }
+ }
+ }, function (e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, source);
+ };
+
+ var FilterObservable = (function (__super__) {
+ inherits(FilterObservable, __super__);
+
+ function FilterObservable(source, predicate, thisArg) {
+ this.source = source;
+ this.predicate = bindCallback(predicate, thisArg, 3);
+ __super__.call(this);
+ }
+
+ FilterObservable.prototype.subscribeCore = function (o) {
+ return this.source.subscribe(new InnerObserver(o, this.predicate, this));
+ };
+
+ function innerPredicate(predicate, self) {
+ return function(x, i, o) { return self.predicate(x, i, o) && predicate.call(this, x, i, o); }
+ }
+
+ FilterObservable.prototype.internalFilter = function(predicate, thisArg) {
+ return new FilterObservable(this.source, innerPredicate(predicate, this), thisArg);
+ };
+
+ function InnerObserver(o, predicate, source) {
+ this.o = o;
+ this.predicate = predicate;
+ this.source = source;
+ this.i = 0;
+ this.isStopped = false;
+ }
+
+ InnerObserver.prototype.onNext = function(x) {
+ if (this.isStopped) { return; }
+ var shouldYield = tryCatch(this.predicate)(x, this.i++, this.source);
+ if (shouldYield === errorObj) {
+ return this.o.onError(shouldYield.e);
+ }
+ shouldYield && this.o.onNext(x);
+ };
+ InnerObserver.prototype.onError = function (e) {
+ if(!this.isStopped) { this.isStopped = true; this.o.onError(e); }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if(!this.isStopped) { this.isStopped = true; this.o.onCompleted(); }
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ return FilterObservable;
+
+ }(ObservableBase));
+
+ /**
+ * Filters the elements of an observable sequence based on a predicate by incorporating the element's index.
+ * @param {Function} predicate A function to test each source element for a condition; the second parameter of the function represents the index of the source element.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence that contains elements from the input sequence that satisfy the condition.
+ */
+ observableProto.filter = observableProto.where = function (predicate, thisArg) {
+ return this instanceof FilterObservable ? this.internalFilter(predicate, thisArg) :
+ new FilterObservable(this, predicate, thisArg);
+ };
+
+ function extremaBy(source, keySelector, comparer) {
+ return new AnonymousObservable(function (o) {
+ var hasValue = false, lastKey = null, list = [];
+ return source.subscribe(function (x) {
+ var comparison, key;
+ try {
+ key = keySelector(x);
+ } catch (ex) {
+ o.onError(ex);
+ return;
+ }
+ comparison = 0;
+ if (!hasValue) {
+ hasValue = true;
+ lastKey = key;
+ } else {
+ try {
+ comparison = comparer(key, lastKey);
+ } catch (ex1) {
+ o.onError(ex1);
+ return;
+ }
+ }
+ if (comparison > 0) {
+ lastKey = key;
+ list = [];
+ }
+ if (comparison >= 0) { list.push(x); }
+ }, function (e) { o.onError(e); }, function () {
+ o.onNext(list);
+ o.onCompleted();
+ });
+ }, source);
+ }
+
+ function firstOnly(x) {
+ if (x.length === 0) { throw new EmptyError(); }
+ return x[0];
+ }
+
+ /**
+ * Applies an accumulator function over an observable sequence, returning the result of the aggregation as a single element in the result sequence. The specified seed value is used as the initial accumulator value.
+ * For aggregation behavior with incremental intermediate results, see Observable.scan.
+ * @deprecated Use #reduce instead
+ * @param {Mixed} [seed] The initial accumulator value.
+ * @param {Function} accumulator An accumulator function to be invoked on each element.
+ * @returns {Observable} An observable sequence containing a single element with the final accumulator value.
+ */
+ observableProto.aggregate = function () {
+ var hasSeed = false, accumulator, seed, source = this;
+ if (arguments.length === 2) {
+ hasSeed = true;
+ seed = arguments[0];
+ accumulator = arguments[1];
+ } else {
+ accumulator = arguments[0];
+ }
+ return new AnonymousObservable(function (o) {
+ var hasAccumulation, accumulation, hasValue;
+ return source.subscribe (
+ function (x) {
+ !hasValue && (hasValue = true);
+ try {
+ if (hasAccumulation) {
+ accumulation = accumulator(accumulation, x);
+ } else {
+ accumulation = hasSeed ? accumulator(seed, x) : x;
+ hasAccumulation = true;
+ }
+ } catch (e) {
+ return o.onError(e);
+ }
+ },
+ function (e) { o.onError(e); },
+ function () {
+ hasValue && o.onNext(accumulation);
+ !hasValue && hasSeed && o.onNext(seed);
+ !hasValue && !hasSeed && o.onError(new EmptyError());
+ o.onCompleted();
+ }
+ );
+ }, source);
+ };
+
+ var ReduceObservable = (function(__super__) {
+ inherits(ReduceObservable, __super__);
+ function ReduceObservable(source, acc, hasSeed, seed) {
+ this.source = source;
+ this.acc = acc;
+ this.hasSeed = hasSeed;
+ this.seed = seed;
+ __super__.call(this);
+ }
+
+ ReduceObservable.prototype.subscribeCore = function(observer) {
+ return this.source.subscribe(new InnerObserver(observer,this));
+ };
+
+ function InnerObserver(o, parent) {
+ this.o = o;
+ this.acc = parent.acc;
+ this.hasSeed = parent.hasSeed;
+ this.seed = parent.seed;
+ this.hasAccumulation = false;
+ this.result = null;
+ this.hasValue = false;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) {
+ if (this.isStopped) { return; }
+ !this.hasValue && (this.hasValue = true);
+ if (this.hasAccumulation) {
+ this.result = tryCatch(this.acc)(this.result, x);
+ } else {
+ this.result = this.hasSeed ? tryCatch(this.acc)(this.seed, x) : x;
+ this.hasAccumulation = true;
+ }
+ if (this.result === errorObj) { this.o.onError(this.result.e); }
+ };
+ InnerObserver.prototype.onError = function (e) {
+ if (!this.isStopped) { this.isStopped = true; this.o.onError(e); }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.hasValue && this.o.onNext(this.result);
+ !this.hasValue && this.hasSeed && this.o.onNext(this.seed);
+ !this.hasValue && !this.hasSeed && this.o.onError(new EmptyError());
+ this.o.onCompleted();
+ }
+ };
+ InnerObserver.prototype.dispose = function () { this.isStopped = true; };
+ InnerObserver.prototype.fail = function(e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ return ReduceObservable;
+ }(ObservableBase));
+
+ /**
+ * Applies an accumulator function over an observable sequence, returning the result of the aggregation as a single element in the result sequence. The specified seed value is used as the initial accumulator value.
+ * For aggregation behavior with incremental intermediate results, see Observable.scan.
+ * @param {Function} accumulator An accumulator function to be invoked on each element.
+ * @param {Any} [seed] The initial accumulator value.
+ * @returns {Observable} An observable sequence containing a single element with the final accumulator value.
+ */
+ observableProto.reduce = function (accumulator) {
+ var hasSeed = false;
+ if (arguments.length === 2) {
+ hasSeed = true;
+ var seed = arguments[1];
+ }
+ return new ReduceObservable(this, accumulator, hasSeed, seed);
+ };
+
+ /**
+ * Determines whether any element of an observable sequence satisfies a condition if present, else if any items are in the sequence.
+ * @param {Function} [predicate] A function to test each element for a condition.
+ * @returns {Observable} An observable sequence containing a single element determining whether any elements in the source sequence pass the test in the specified predicate if given, else if any items are in the sequence.
+ */
+ observableProto.some = function (predicate, thisArg) {
+ var source = this;
+ return predicate ?
+ source.filter(predicate, thisArg).some() :
+ new AnonymousObservable(function (observer) {
+ return source.subscribe(function () {
+ observer.onNext(true);
+ observer.onCompleted();
+ }, function (e) { observer.onError(e); }, function () {
+ observer.onNext(false);
+ observer.onCompleted();
+ });
+ }, source);
+ };
+
+ /** @deprecated use #some instead */
+ observableProto.any = function () {
+ //deprecate('any', 'some');
+ return this.some.apply(this, arguments);
+ };
+
+ /**
+ * Determines whether an observable sequence is empty.
+ * @returns {Observable} An observable sequence containing a single element determining whether the source sequence is empty.
+ */
+ observableProto.isEmpty = function () {
+ return this.any().map(not);
+ };
+
+ /**
+ * Determines whether all elements of an observable sequence satisfy a condition.
+ * @param {Function} [predicate] A function to test each element for a condition.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence containing a single element determining whether all elements in the source sequence pass the test in the specified predicate.
+ */
+ observableProto.every = function (predicate, thisArg) {
+ return this.filter(function (v) { return !predicate(v); }, thisArg).some().map(not);
+ };
+
+ /** @deprecated use #every instead */
+ observableProto.all = function () {
+ //deprecate('all', 'every');
+ return this.every.apply(this, arguments);
+ };
+
+ /**
+ * Determines whether an observable sequence includes a specified element with an optional equality comparer.
+ * @param searchElement The value to locate in the source sequence.
+ * @param {Number} [fromIndex] An equality comparer to compare elements.
+ * @returns {Observable} An observable sequence containing a single element determining whether the source sequence includes an element that has the specified value from the given index.
+ */
+ observableProto.includes = function (searchElement, fromIndex) {
+ var source = this;
+ function comparer(a, b) {
+ return (a === 0 && b === 0) || (a === b || (isNaN(a) && isNaN(b)));
+ }
+ return new AnonymousObservable(function (o) {
+ var i = 0, n = +fromIndex || 0;
+ Math.abs(n) === Infinity && (n = 0);
+ if (n < 0) {
+ o.onNext(false);
+ o.onCompleted();
+ return disposableEmpty;
+ }
+ return source.subscribe(
+ function (x) {
+ if (i++ >= n && comparer(x, searchElement)) {
+ o.onNext(true);
+ o.onCompleted();
+ }
+ },
+ function (e) { o.onError(e); },
+ function () {
+ o.onNext(false);
+ o.onCompleted();
+ });
+ }, this);
+ };
+
+ /**
+ * @deprecated use #includes instead.
+ */
+ observableProto.contains = function (searchElement, fromIndex) {
+ //deprecate('contains', 'includes');
+ observableProto.includes(searchElement, fromIndex);
+ };
+
+ /**
+ * Returns an observable sequence containing a value that represents how many elements in the specified observable sequence satisfy a condition if provided, else the count of items.
+ * @example
+ * res = source.count();
+ * res = source.count(function (x) { return x > 3; });
+ * @param {Function} [predicate]A function to test each element for a condition.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence containing a single element with a number that represents how many elements in the input sequence satisfy the condition in the predicate function if provided, else the count of items in the sequence.
+ */
+ observableProto.count = function (predicate, thisArg) {
+ return predicate ?
+ this.filter(predicate, thisArg).count() :
+ this.reduce(function (count) { return count + 1; }, 0);
+ };
+
+ /**
+ * Returns the first index at which a given element can be found in the observable sequence, or -1 if it is not present.
+ * @param {Any} searchElement Element to locate in the array.
+ * @param {Number} [fromIndex] The index to start the search. If not specified, defaults to 0.
+ * @returns {Observable} And observable sequence containing the first index at which a given element can be found in the observable sequence, or -1 if it is not present.
+ */
+ observableProto.indexOf = function(searchElement, fromIndex) {
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var i = 0, n = +fromIndex || 0;
+ Math.abs(n) === Infinity && (n = 0);
+ if (n < 0) {
+ o.onNext(-1);
+ o.onCompleted();
+ return disposableEmpty;
+ }
+ return source.subscribe(
+ function (x) {
+ if (i >= n && x === searchElement) {
+ o.onNext(i);
+ o.onCompleted();
+ }
+ i++;
+ },
+ function (e) { o.onError(e); },
+ function () {
+ o.onNext(-1);
+ o.onCompleted();
+ });
+ }, source);
+ };
+
+ /**
+ * Computes the sum of a sequence of values that are obtained by invoking an optional transform function on each element of the input sequence, else if not specified computes the sum on each item in the sequence.
+ * @param {Function} [selector] A transform function to apply to each element.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence containing a single element with the sum of the values in the source sequence.
+ */
+ observableProto.sum = function (keySelector, thisArg) {
+ return keySelector && isFunction(keySelector) ?
+ this.map(keySelector, thisArg).sum() :
+ this.reduce(function (prev, curr) { return prev + curr; }, 0);
+ };
+
+ /**
+ * Returns the elements in an observable sequence with the minimum key value according to the specified comparer.
+ * @example
+ * var res = source.minBy(function (x) { return x.value; });
+ * var res = source.minBy(function (x) { return x.value; }, function (x, y) { return x - y; });
+ * @param {Function} keySelector Key selector function.
+ * @param {Function} [comparer] Comparer used to compare key values.
+ * @returns {Observable} An observable sequence containing a list of zero or more elements that have a minimum key value.
+ */
+ observableProto.minBy = function (keySelector, comparer) {
+ comparer || (comparer = defaultSubComparer);
+ return extremaBy(this, keySelector, function (x, y) { return comparer(x, y) * -1; });
+ };
+
+ /**
+ * Returns the minimum element in an observable sequence according to the optional comparer else a default greater than less than check.
+ * @example
+ * var res = source.min();
+ * var res = source.min(function (x, y) { return x.value - y.value; });
+ * @param {Function} [comparer] Comparer used to compare elements.
+ * @returns {Observable} An observable sequence containing a single element with the minimum element in the source sequence.
+ */
+ observableProto.min = function (comparer) {
+ return this.minBy(identity, comparer).map(function (x) { return firstOnly(x); });
+ };
+
+ /**
+ * Returns the elements in an observable sequence with the maximum key value according to the specified comparer.
+ * @example
+ * var res = source.maxBy(function (x) { return x.value; });
+ * var res = source.maxBy(function (x) { return x.value; }, function (x, y) { return x - y;; });
+ * @param {Function} keySelector Key selector function.
+ * @param {Function} [comparer] Comparer used to compare key values.
+ * @returns {Observable} An observable sequence containing a list of zero or more elements that have a maximum key value.
+ */
+ observableProto.maxBy = function (keySelector, comparer) {
+ comparer || (comparer = defaultSubComparer);
+ return extremaBy(this, keySelector, comparer);
+ };
+
+ /**
+ * Returns the maximum value in an observable sequence according to the specified comparer.
+ * @example
+ * var res = source.max();
+ * var res = source.max(function (x, y) { return x.value - y.value; });
+ * @param {Function} [comparer] Comparer used to compare elements.
+ * @returns {Observable} An observable sequence containing a single element with the maximum element in the source sequence.
+ */
+ observableProto.max = function (comparer) {
+ return this.maxBy(identity, comparer).map(function (x) { return firstOnly(x); });
+ };
+
+ /**
+ * Computes the average of an observable sequence of values that are in the sequence or obtained by invoking a transform function on each element of the input sequence if present.
+ * @param {Function} [selector] A transform function to apply to each element.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence containing a single element with the average of the sequence of values.
+ */
+ observableProto.average = function (keySelector, thisArg) {
+ return keySelector && isFunction(keySelector) ?
+ this.map(keySelector, thisArg).average() :
+ this.reduce(function (prev, cur) {
+ return {
+ sum: prev.sum + cur,
+ count: prev.count + 1
+ };
+ }, {sum: 0, count: 0 }).map(function (s) {
+ if (s.count === 0) { throw new EmptyError(); }
+ return s.sum / s.count;
+ });
+ };
+
+ /**
+ * Determines whether two sequences are equal by comparing the elements pairwise using a specified equality comparer.
+ *
+ * @example
+ * var res = res = source.sequenceEqual([1,2,3]);
+ * var res = res = source.sequenceEqual([{ value: 42 }], function (x, y) { return x.value === y.value; });
+ * 3 - res = source.sequenceEqual(Rx.Observable.returnValue(42));
+ * 4 - res = source.sequenceEqual(Rx.Observable.returnValue({ value: 42 }), function (x, y) { return x.value === y.value; });
+ * @param {Observable} second Second observable sequence or array to compare.
+ * @param {Function} [comparer] Comparer used to compare elements of both sequences.
+ * @returns {Observable} An observable sequence that contains a single element which indicates whether both sequences are of equal length and their corresponding elements are equal according to the specified equality comparer.
+ */
+ observableProto.sequenceEqual = function (second, comparer) {
+ var first = this;
+ comparer || (comparer = defaultComparer);
+ return new AnonymousObservable(function (o) {
+ var donel = false, doner = false, ql = [], qr = [];
+ var subscription1 = first.subscribe(function (x) {
+ var equal, v;
+ if (qr.length > 0) {
+ v = qr.shift();
+ try {
+ equal = comparer(v, x);
+ } catch (e) {
+ o.onError(e);
+ return;
+ }
+ if (!equal) {
+ o.onNext(false);
+ o.onCompleted();
+ }
+ } else if (doner) {
+ o.onNext(false);
+ o.onCompleted();
+ } else {
+ ql.push(x);
+ }
+ }, function(e) { o.onError(e); }, function () {
+ donel = true;
+ if (ql.length === 0) {
+ if (qr.length > 0) {
+ o.onNext(false);
+ o.onCompleted();
+ } else if (doner) {
+ o.onNext(true);
+ o.onCompleted();
+ }
+ }
+ });
+
+ (isArrayLike(second) || isIterable(second)) && (second = observableFrom(second));
+ isPromise(second) && (second = observableFromPromise(second));
+ var subscription2 = second.subscribe(function (x) {
+ var equal;
+ if (ql.length > 0) {
+ var v = ql.shift();
+ try {
+ equal = comparer(v, x);
+ } catch (exception) {
+ o.onError(exception);
+ return;
+ }
+ if (!equal) {
+ o.onNext(false);
+ o.onCompleted();
+ }
+ } else if (donel) {
+ o.onNext(false);
+ o.onCompleted();
+ } else {
+ qr.push(x);
+ }
+ }, function(e) { o.onError(e); }, function () {
+ doner = true;
+ if (qr.length === 0) {
+ if (ql.length > 0) {
+ o.onNext(false);
+ o.onCompleted();
+ } else if (donel) {
+ o.onNext(true);
+ o.onCompleted();
+ }
+ }
+ });
+ return new CompositeDisposable(subscription1, subscription2);
+ }, first);
+ };
+
+ function elementAtOrDefault(source, index, hasDefault, defaultValue) {
+ if (index < 0) { throw new ArgumentOutOfRangeError(); }
+ return new AnonymousObservable(function (o) {
+ var i = index;
+ return source.subscribe(function (x) {
+ if (i-- === 0) {
+ o.onNext(x);
+ o.onCompleted();
+ }
+ }, function (e) { o.onError(e); }, function () {
+ if (!hasDefault) {
+ o.onError(new ArgumentOutOfRangeError());
+ } else {
+ o.onNext(defaultValue);
+ o.onCompleted();
+ }
+ });
+ }, source);
+ }
+
+ /**
+ * Returns the element at a specified index in a sequence.
+ * @example
+ * var res = source.elementAt(5);
+ * @param {Number} index The zero-based index of the element to retrieve.
+ * @returns {Observable} An observable sequence that produces the element at the specified position in the source sequence.
+ */
+ observableProto.elementAt = function (index) {
+ return elementAtOrDefault(this, index, false);
+ };
+
+ /**
+ * Returns the element at a specified index in a sequence or a default value if the index is out of range.
+ * @example
+ * var res = source.elementAtOrDefault(5);
+ * var res = source.elementAtOrDefault(5, 0);
+ * @param {Number} index The zero-based index of the element to retrieve.
+ * @param [defaultValue] The default value if the index is outside the bounds of the source sequence.
+ * @returns {Observable} An observable sequence that produces the element at the specified position in the source sequence, or a default value if the index is outside the bounds of the source sequence.
+ */
+ observableProto.elementAtOrDefault = function (index, defaultValue) {
+ return elementAtOrDefault(this, index, true, defaultValue);
+ };
+
+ function singleOrDefaultAsync(source, hasDefault, defaultValue) {
+ return new AnonymousObservable(function (o) {
+ var value = defaultValue, seenValue = false;
+ return source.subscribe(function (x) {
+ if (seenValue) {
+ o.onError(new Error('Sequence contains more than one element'));
+ } else {
+ value = x;
+ seenValue = true;
+ }
+ }, function (e) { o.onError(e); }, function () {
+ if (!seenValue && !hasDefault) {
+ o.onError(new EmptyError());
+ } else {
+ o.onNext(value);
+ o.onCompleted();
+ }
+ });
+ }, source);
+ }
+
+ /**
+ * Returns the only element of an observable sequence that satisfies the condition in the optional predicate, and reports an exception if there is not exactly one element in the observable sequence.
+ * @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence.
+ * @param {Any} [thisArg] Object to use as `this` when executing the predicate.
+ * @returns {Observable} Sequence containing the single element in the observable sequence that satisfies the condition in the predicate.
+ */
+ observableProto.single = function (predicate, thisArg) {
+ return predicate && isFunction(predicate) ?
+ this.where(predicate, thisArg).single() :
+ singleOrDefaultAsync(this, false);
+ };
+
+ /**
+ * Returns the only element of an observable sequence that matches the predicate, or a default value if no such element exists; this method reports an exception if there is more than one element in the observable sequence.
+ * @example
+ * var res = res = source.singleOrDefault();
+ * var res = res = source.singleOrDefault(function (x) { return x === 42; });
+ * res = source.singleOrDefault(function (x) { return x === 42; }, 0);
+ * res = source.singleOrDefault(null, 0);
+ * @memberOf Observable#
+ * @param {Function} predicate A predicate function to evaluate for elements in the source sequence.
+ * @param [defaultValue] The default value if the index is outside the bounds of the source sequence.
+ * @param {Any} [thisArg] Object to use as `this` when executing the predicate.
+ * @returns {Observable} Sequence containing the single element in the observable sequence that satisfies the condition in the predicate, or a default value if no such element exists.
+ */
+ observableProto.singleOrDefault = function (predicate, defaultValue, thisArg) {
+ return predicate && isFunction(predicate) ?
+ this.filter(predicate, thisArg).singleOrDefault(null, defaultValue) :
+ singleOrDefaultAsync(this, true, defaultValue);
+ };
+
+ function firstOrDefaultAsync(source, hasDefault, defaultValue) {
+ return new AnonymousObservable(function (o) {
+ return source.subscribe(function (x) {
+ o.onNext(x);
+ o.onCompleted();
+ }, function (e) { o.onError(e); }, function () {
+ if (!hasDefault) {
+ o.onError(new EmptyError());
+ } else {
+ o.onNext(defaultValue);
+ o.onCompleted();
+ }
+ });
+ }, source);
+ }
+
+ /**
+ * Returns the first element of an observable sequence that satisfies the condition in the predicate if present else the first item in the sequence.
+ * @example
+ * var res = res = source.first();
+ * var res = res = source.first(function (x) { return x > 3; });
+ * @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence.
+ * @param {Any} [thisArg] Object to use as `this` when executing the predicate.
+ * @returns {Observable} Sequence containing the first element in the observable sequence that satisfies the condition in the predicate if provided, else the first item in the sequence.
+ */
+ observableProto.first = function (predicate, thisArg) {
+ return predicate ?
+ this.where(predicate, thisArg).first() :
+ firstOrDefaultAsync(this, false);
+ };
+
+ /**
+ * Returns the first element of an observable sequence that satisfies the condition in the predicate, or a default value if no such element exists.
+ * @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence.
+ * @param {Any} [defaultValue] The default value if no such element exists. If not specified, defaults to null.
+ * @param {Any} [thisArg] Object to use as `this` when executing the predicate.
+ * @returns {Observable} Sequence containing the first element in the observable sequence that satisfies the condition in the predicate, or a default value if no such element exists.
+ */
+ observableProto.firstOrDefault = function (predicate, defaultValue, thisArg) {
+ return predicate ?
+ this.where(predicate).firstOrDefault(null, defaultValue) :
+ firstOrDefaultAsync(this, true, defaultValue);
+ };
+
+ function lastOrDefaultAsync(source, hasDefault, defaultValue) {
+ return new AnonymousObservable(function (o) {
+ var value = defaultValue, seenValue = false;
+ return source.subscribe(function (x) {
+ value = x;
+ seenValue = true;
+ }, function (e) { o.onError(e); }, function () {
+ if (!seenValue && !hasDefault) {
+ o.onError(new EmptyError());
+ } else {
+ o.onNext(value);
+ o.onCompleted();
+ }
+ });
+ }, source);
+ }
+
+ /**
+ * Returns the last element of an observable sequence that satisfies the condition in the predicate if specified, else the last element.
+ * @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence.
+ * @param {Any} [thisArg] Object to use as `this` when executing the predicate.
+ * @returns {Observable} Sequence containing the last element in the observable sequence that satisfies the condition in the predicate.
+ */
+ observableProto.last = function (predicate, thisArg) {
+ return predicate ?
+ this.where(predicate, thisArg).last() :
+ lastOrDefaultAsync(this, false);
+ };
+
+ /**
+ * Returns the last element of an observable sequence that satisfies the condition in the predicate, or a default value if no such element exists.
+ * @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence.
+ * @param [defaultValue] The default value if no such element exists. If not specified, defaults to null.
+ * @param {Any} [thisArg] Object to use as `this` when executing the predicate.
+ * @returns {Observable} Sequence containing the last element in the observable sequence that satisfies the condition in the predicate, or a default value if no such element exists.
+ */
+ observableProto.lastOrDefault = function (predicate, defaultValue, thisArg) {
+ return predicate ?
+ this.where(predicate, thisArg).lastOrDefault(null, defaultValue) :
+ lastOrDefaultAsync(this, true, defaultValue);
+ };
+
+ function findValue (source, predicate, thisArg, yieldIndex) {
+ var callback = bindCallback(predicate, thisArg, 3);
+ return new AnonymousObservable(function (o) {
+ var i = 0;
+ return source.subscribe(function (x) {
+ var shouldRun;
+ try {
+ shouldRun = callback(x, i, source);
+ } catch (e) {
+ o.onError(e);
+ return;
+ }
+ if (shouldRun) {
+ o.onNext(yieldIndex ? i : x);
+ o.onCompleted();
+ } else {
+ i++;
+ }
+ }, function (e) { o.onError(e); }, function () {
+ o.onNext(yieldIndex ? -1 : undefined);
+ o.onCompleted();
+ });
+ }, source);
+ }
+
+ /**
+ * Searches for an element that matches the conditions defined by the specified predicate, and returns the first occurrence within the entire Observable sequence.
+ * @param {Function} predicate The predicate that defines the conditions of the element to search for.
+ * @param {Any} [thisArg] Object to use as `this` when executing the predicate.
+ * @returns {Observable} An Observable sequence with the first element that matches the conditions defined by the specified predicate, if found; otherwise, undefined.
+ */
+ observableProto.find = function (predicate, thisArg) {
+ return findValue(this, predicate, thisArg, false);
+ };
+
+ /**
+ * Searches for an element that matches the conditions defined by the specified predicate, and returns
+ * an Observable sequence with the zero-based index of the first occurrence within the entire Observable sequence.
+ * @param {Function} predicate The predicate that defines the conditions of the element to search for.
+ * @param {Any} [thisArg] Object to use as `this` when executing the predicate.
+ * @returns {Observable} An Observable sequence with the zero-based index of the first occurrence of an element that matches the conditions defined by match, if found; otherwise, –1.
+ */
+ observableProto.findIndex = function (predicate, thisArg) {
+ return findValue(this, predicate, thisArg, true);
+ };
+
+ /**
+ * Converts the observable sequence to a Set if it exists.
+ * @returns {Observable} An observable sequence with a single value of a Set containing the values from the observable sequence.
+ */
+ observableProto.toSet = function () {
+ if (typeof root.Set === 'undefined') { throw new TypeError(); }
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var s = new root.Set();
+ return source.subscribe(
+ function (x) { s.add(x); },
+ function (e) { o.onError(e); },
+ function () {
+ o.onNext(s);
+ o.onCompleted();
+ });
+ }, source);
+ };
+
+ /**
+ * Converts the observable sequence to a Map if it exists.
+ * @param {Function} keySelector A function which produces the key for the Map.
+ * @param {Function} [elementSelector] An optional function which produces the element for the Map. If not present, defaults to the value from the observable sequence.
+ * @returns {Observable} An observable sequence with a single value of a Map containing the values from the observable sequence.
+ */
+ observableProto.toMap = function (keySelector, elementSelector) {
+ if (typeof root.Map === 'undefined') { throw new TypeError(); }
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var m = new root.Map();
+ return source.subscribe(
+ function (x) {
+ var key;
+ try {
+ key = keySelector(x);
+ } catch (e) {
+ o.onError(e);
+ return;
+ }
+
+ var element = x;
+ if (elementSelector) {
+ try {
+ element = elementSelector(x);
+ } catch (e) {
+ o.onError(e);
+ return;
+ }
+ }
+
+ m.set(key, element);
+ },
+ function (e) { o.onError(e); },
+ function () {
+ o.onNext(m);
+ o.onCompleted();
+ });
+ }, source);
+ };
+
+ var fnString = 'function',
+ throwString = 'throw',
+ isObject = Rx.internals.isObject;
+
+ function toThunk(obj, ctx) {
+ if (Array.isArray(obj)) { return objectToThunk.call(ctx, obj); }
+ if (isGeneratorFunction(obj)) { return observableSpawn(obj.call(ctx)); }
+ if (isGenerator(obj)) { return observableSpawn(obj); }
+ if (isObservable(obj)) { return observableToThunk(obj); }
+ if (isPromise(obj)) { return promiseToThunk(obj); }
+ if (typeof obj === fnString) { return obj; }
+ if (isObject(obj) || Array.isArray(obj)) { return objectToThunk.call(ctx, obj); }
+
+ return obj;
+ }
+
+ function objectToThunk(obj) {
+ var ctx = this;
+
+ return function (done) {
+ var keys = Object.keys(obj),
+ pending = keys.length,
+ results = new obj.constructor(),
+ finished;
+
+ if (!pending) {
+ timeoutScheduler.schedule(function () { done(null, results); });
+ return;
+ }
+
+ for (var i = 0, len = keys.length; i < len; i++) {
+ run(obj[keys[i]], keys[i]);
+ }
+
+ function run(fn, key) {
+ if (finished) { return; }
+ try {
+ fn = toThunk(fn, ctx);
+
+ if (typeof fn !== fnString) {
+ results[key] = fn;
+ return --pending || done(null, results);
+ }
+
+ fn.call(ctx, function(err, res) {
+ if (finished) { return; }
+
+ if (err) {
+ finished = true;
+ return done(err);
+ }
+
+ results[key] = res;
+ --pending || done(null, results);
+ });
+ } catch (e) {
+ finished = true;
+ done(e);
+ }
+ }
+ }
+ }
+
+ function observableToThunk(observable) {
+ return function (fn) {
+ var value, hasValue = false;
+ observable.subscribe(
+ function (v) {
+ value = v;
+ hasValue = true;
+ },
+ fn,
+ function () {
+ hasValue && fn(null, value);
+ });
+ }
+ }
+
+ function promiseToThunk(promise) {
+ return function(fn) {
+ promise.then(function(res) {
+ fn(null, res);
+ }, fn);
+ }
+ }
+
+ function isObservable(obj) {
+ return obj && typeof obj.subscribe === fnString;
+ }
+
+ function isGeneratorFunction(obj) {
+ return obj && obj.constructor && obj.constructor.name === 'GeneratorFunction';
+ }
+
+ function isGenerator(obj) {
+ return obj && typeof obj.next === fnString && typeof obj[throwString] === fnString;
+ }
+
+ /*
+ * Spawns a generator function which allows for Promises, Observable sequences, Arrays, Objects, Generators and functions.
+ * @param {Function} The spawning function.
+ * @returns {Function} a function which has a done continuation.
+ */
+ var observableSpawn = Rx.spawn = function (fn) {
+ var isGenFun = isGeneratorFunction(fn);
+
+ return function (done) {
+ var ctx = this,
+ gen = fn;
+
+ if (isGenFun) {
+ for(var args = [], i = 0, len = arguments.length; i < len; i++) { args.push(arguments[i]); }
+ var len = args.length,
+ hasCallback = len && typeof args[len - 1] === fnString;
+
+ done = hasCallback ? args.pop() : handleError;
+ gen = fn.apply(this, args);
+ } else {
+ done = done || handleError;
+ }
+
+ next();
+
+ function exit(err, res) {
+ timeoutScheduler.schedule(done.bind(ctx, err, res));
+ }
+
+ function next(err, res) {
+ var ret;
+
+ // multiple args
+ if (arguments.length > 2) {
+ for(var res = [], i = 1, len = arguments.length; i < len; i++) { res.push(arguments[i]); }
+ }
+
+ if (err) {
+ try {
+ ret = gen[throwString](err);
+ } catch (e) {
+ return exit(e);
+ }
+ }
+
+ if (!err) {
+ try {
+ ret = gen.next(res);
+ } catch (e) {
+ return exit(e);
+ }
+ }
+
+ if (ret.done) {
+ return exit(null, ret.value);
+ }
+
+ ret.value = toThunk(ret.value, ctx);
+
+ if (typeof ret.value === fnString) {
+ var called = false;
+ try {
+ ret.value.call(ctx, function() {
+ if (called) {
+ return;
+ }
+
+ called = true;
+ next.apply(ctx, arguments);
+ });
+ } catch (e) {
+ timeoutScheduler.schedule(function () {
+ if (called) {
+ return;
+ }
+
+ called = true;
+ next.call(ctx, e);
+ });
+ }
+ return;
+ }
+
+ // Not supported
+ next(new TypeError('Rx.spawn only supports a function, Promise, Observable, Object or Array.'));
+ }
+ }
+ };
+
+ function handleError(err) {
+ if (!err) { return; }
+ timeoutScheduler.schedule(function() {
+ throw err;
+ });
+ }
+
+ /**
+ * Invokes the specified function asynchronously on the specified scheduler, surfacing the result through an observable sequence.
+ *
+ * @example
+ * var res = Rx.Observable.start(function () { console.log('hello'); });
+ * var res = Rx.Observable.start(function () { console.log('hello'); }, Rx.Scheduler.timeout);
+ * var res = Rx.Observable.start(function () { this.log('hello'); }, Rx.Scheduler.timeout, console);
+ *
+ * @param {Function} func Function to run asynchronously.
+ * @param {Scheduler} [scheduler] Scheduler to run the function on. If not specified, defaults to Scheduler.timeout.
+ * @param [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
+ * @returns {Observable} An observable sequence exposing the function's result value, or an exception.
+ *
+ * Remarks
+ * * The function is called immediately, not during the subscription of the resulting sequence.
+ * * Multiple subscriptions to the resulting sequence can observe the function's result.
+ */
+ Observable.start = function (func, context, scheduler) {
+ return observableToAsync(func, context, scheduler)();
+ };
+
+ /**
+ * Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function on the specified scheduler.
+ * @param {Function} function Function to convert to an asynchronous function.
+ * @param {Scheduler} [scheduler] Scheduler to run the function on. If not specified, defaults to Scheduler.timeout.
+ * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
+ * @returns {Function} Asynchronous function.
+ */
+ var observableToAsync = Observable.toAsync = function (func, context, scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return function () {
+ var args = arguments,
+ subject = new AsyncSubject();
+
+ scheduler.schedule(function () {
+ var result;
+ try {
+ result = func.apply(context, args);
+ } catch (e) {
+ subject.onError(e);
+ return;
+ }
+ subject.onNext(result);
+ subject.onCompleted();
+ });
+ return subject.asObservable();
+ };
+ };
+
+ /**
+ * Converts a callback function to an observable sequence.
+ *
+ * @param {Function} function Function with a callback as the last parameter to convert to an Observable sequence.
+ * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
+ * @param {Function} [selector] A selector which takes the arguments from the callback to produce a single item to yield on next.
+ * @returns {Function} A function, when executed with the required parameters minus the callback, produces an Observable sequence with a single value of the arguments to the callback as an array.
+ */
+ Observable.fromCallback = function (func, context, selector) {
+ return function () {
+ var len = arguments.length, args = new Array(len)
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+
+ return new AnonymousObservable(function (observer) {
+ function handler() {
+ var len = arguments.length, results = new Array(len);
+ for(var i = 0; i < len; i++) { results[i] = arguments[i]; }
+
+ if (selector) {
+ try {
+ results = selector.apply(context, results);
+ } catch (e) {
+ return observer.onError(e);
+ }
+
+ observer.onNext(results);
+ } else {
+ if (results.length <= 1) {
+ observer.onNext.apply(observer, results);
+ } else {
+ observer.onNext(results);
+ }
+ }
+
+ observer.onCompleted();
+ }
+
+ args.push(handler);
+ func.apply(context, args);
+ }).publishLast().refCount();
+ };
+ };
+
+ /**
+ * Converts a Node.js callback style function to an observable sequence. This must be in function (err, ...) format.
+ * @param {Function} func The function to call
+ * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
+ * @param {Function} [selector] A selector which takes the arguments from the callback minus the error to produce a single item to yield on next.
+ * @returns {Function} An async function which when applied, returns an observable sequence with the callback arguments as an array.
+ */
+ Observable.fromNodeCallback = function (func, context, selector) {
+ return function () {
+ var len = arguments.length, args = new Array(len);
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+
+ return new AnonymousObservable(function (observer) {
+ function handler(err) {
+ if (err) {
+ observer.onError(err);
+ return;
+ }
+
+ var len = arguments.length, results = [];
+ for(var i = 1; i < len; i++) { results[i - 1] = arguments[i]; }
+
+ if (selector) {
+ try {
+ results = selector.apply(context, results);
+ } catch (e) {
+ return observer.onError(e);
+ }
+ observer.onNext(results);
+ } else {
+ if (results.length <= 1) {
+ observer.onNext.apply(observer, results);
+ } else {
+ observer.onNext(results);
+ }
+ }
+
+ observer.onCompleted();
+ }
+
+ args.push(handler);
+ func.apply(context, args);
+ }).publishLast().refCount();
+ };
+ };
+
+ function isNodeList(el) {
+ if (window.StaticNodeList) {
+ // IE8 Specific
+ // instanceof is slower than Object#toString, but Object#toString will not work as intended in IE8
+ return (el instanceof window.StaticNodeList || el instanceof window.NodeList);
+ } else {
+ return (Object.prototype.toString.call(el) == '[object NodeList]')
+ }
+ }
+
+ function fixEvent(event) {
+ var stopPropagation = function () {
+ this.cancelBubble = true;
+ };
+
+ var preventDefault = function () {
+ this.bubbledKeyCode = this.keyCode;
+ if (this.ctrlKey) {
+ try {
+ this.keyCode = 0;
+ } catch (e) { }
+ }
+ this.defaultPrevented = true;
+ this.returnValue = false;
+ this.modified = true;
+ };
+
+ event || (event = root.event);
+ if (!event.target) {
+ event.target = event.target || event.srcElement;
+
+ if (event.type == 'mouseover') {
+ event.relatedTarget = event.fromElement;
+ }
+ if (event.type == 'mouseout') {
+ event.relatedTarget = event.toElement;
+ }
+ // Adding stopPropogation and preventDefault to IE
+ if (!event.stopPropagation) {
+ event.stopPropagation = stopPropagation;
+ event.preventDefault = preventDefault;
+ }
+ // Normalize key events
+ switch (event.type) {
+ case 'keypress':
+ var c = ('charCode' in event ? event.charCode : event.keyCode);
+ if (c == 10) {
+ c = 0;
+ event.keyCode = 13;
+ } else if (c == 13 || c == 27) {
+ c = 0;
+ } else if (c == 3) {
+ c = 99;
+ }
+ event.charCode = c;
+ event.keyChar = event.charCode ? String.fromCharCode(event.charCode) : '';
+ break;
+ }
+ }
+
+ return event;
+ }
+
+ function createListener (element, name, handler) {
+ // Standards compliant
+ if (element.addEventListener) {
+ element.addEventListener(name, handler, false);
+ return disposableCreate(function () {
+ element.removeEventListener(name, handler, false);
+ });
+ }
+ if (element.attachEvent) {
+ // IE Specific
+ var innerHandler = function (event) {
+ handler(fixEvent(event));
+ };
+ element.attachEvent('on' + name, innerHandler);
+ return disposableCreate(function () {
+ element.detachEvent('on' + name, innerHandler);
+ });
+ }
+ // Level 1 DOM Events
+ element['on' + name] = handler;
+ return disposableCreate(function () {
+ element['on' + name] = null;
+ });
+ }
+
+ function createEventListener (el, eventName, handler) {
+ var disposables = new CompositeDisposable();
+
+ // Asume NodeList
+ if (isNodeList(el) || Object.prototype.toString.call(el) === '[object HTMLCollection]') {
+ for (var i = 0, len = el.length; i < len; i++) {
+ disposables.add(createEventListener(el.item(i), eventName, handler));
+ }
+ } else if (el) {
+ disposables.add(createListener(el, eventName, handler));
+ }
+
+ return disposables;
+ }
+
+ /**
+ * Configuration option to determine whether to use native events only
+ */
+ Rx.config.useNativeEvents = false;
+
+ /**
+ * Creates an observable sequence by adding an event listener to the matching DOMElement or each item in the NodeList.
+ *
+ * @example
+ * var source = Rx.Observable.fromEvent(element, 'mouseup');
+ *
+ * @param {Object} element The DOMElement or NodeList to attach a listener.
+ * @param {String} eventName The event name to attach the observable sequence.
+ * @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next.
+ * @returns {Observable} An observable sequence of events from the specified element and the specified event.
+ */
+ Observable.fromEvent = function (element, eventName, selector) {
+ // Node.js specific
+ if (element.addListener) {
+ return fromEventPattern(
+ function (h) { element.addListener(eventName, h); },
+ function (h) { element.removeListener(eventName, h); },
+ selector);
+ }
+
+ // Use only if non-native events are allowed
+ if (!Rx.config.useNativeEvents) {
+ // Handles jq, Angular.js, Zepto, Marionette, Ember.js
+ if (typeof element.on === 'function' && typeof element.off === 'function') {
+ return fromEventPattern(
+ function (h) { element.on(eventName, h); },
+ function (h) { element.off(eventName, h); },
+ selector);
+ }
+ }
+ return new AnonymousObservable(function (observer) {
+ return createEventListener(
+ element,
+ eventName,
+ function handler (e) {
+ var results = e;
+
+ if (selector) {
+ try {
+ results = selector(arguments);
+ } catch (err) {
+ return observer.onError(err);
+ }
+ }
+
+ observer.onNext(results);
+ });
+ }).publish().refCount();
+ };
+
+ /**
+ * Creates an observable sequence from an event emitter via an addHandler/removeHandler pair.
+ * @param {Function} addHandler The function to add a handler to the emitter.
+ * @param {Function} [removeHandler] The optional function to remove a handler from an emitter.
+ * @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next.
+ * @returns {Observable} An observable sequence which wraps an event from an event emitter
+ */
+ var fromEventPattern = Observable.fromEventPattern = function (addHandler, removeHandler, selector) {
+ return new AnonymousObservable(function (observer) {
+ function innerHandler (e) {
+ var result = e;
+ if (selector) {
+ try {
+ result = selector(arguments);
+ } catch (err) {
+ return observer.onError(err);
+ }
+ }
+ observer.onNext(result);
+ }
+
+ var returnValue = addHandler(innerHandler);
+ return disposableCreate(function () {
+ if (removeHandler) {
+ removeHandler(innerHandler, returnValue);
+ }
+ });
+ }).publish().refCount();
+ };
+
+ /**
+ * Invokes the asynchronous function, surfacing the result through an observable sequence.
+ * @param {Function} functionAsync Asynchronous function which returns a Promise to run.
+ * @returns {Observable} An observable sequence exposing the function's result value, or an exception.
+ */
+ Observable.startAsync = function (functionAsync) {
+ var promise;
+ try {
+ promise = functionAsync();
+ } catch (e) {
+ return observableThrow(e);
+ }
+ return observableFromPromise(promise);
+ }
+
+ var PausableObservable = (function (__super__) {
+
+ inherits(PausableObservable, __super__);
+
+ function subscribe(observer) {
+ var conn = this.source.publish(),
+ subscription = conn.subscribe(observer),
+ connection = disposableEmpty;
+
+ var pausable = this.pauser.distinctUntilChanged().subscribe(function (b) {
+ if (b) {
+ connection = conn.connect();
+ } else {
+ connection.dispose();
+ connection = disposableEmpty;
+ }
+ });
+
+ return new CompositeDisposable(subscription, connection, pausable);
+ }
+
+ function PausableObservable(source, pauser) {
+ this.source = source;
+ this.controller = new Subject();
+
+ if (pauser && pauser.subscribe) {
+ this.pauser = this.controller.merge(pauser);
+ } else {
+ this.pauser = this.controller;
+ }
+
+ __super__.call(this, subscribe, source);
+ }
+
+ PausableObservable.prototype.pause = function () {
+ this.controller.onNext(false);
+ };
+
+ PausableObservable.prototype.resume = function () {
+ this.controller.onNext(true);
+ };
+
+ return PausableObservable;
+
+ }(Observable));
+
+ /**
+ * Pauses the underlying observable sequence based upon the observable sequence which yields true/false.
+ * @example
+ * var pauser = new Rx.Subject();
+ * var source = Rx.Observable.interval(100).pausable(pauser);
+ * @param {Observable} pauser The observable sequence used to pause the underlying sequence.
+ * @returns {Observable} The observable sequence which is paused based upon the pauser.
+ */
+ observableProto.pausable = function (pauser) {
+ return new PausableObservable(this, pauser);
+ };
+
+ function combineLatestSource(source, subject, resultSelector) {
+ return new AnonymousObservable(function (o) {
+ var hasValue = [false, false],
+ hasValueAll = false,
+ isDone = false,
+ values = new Array(2),
+ err;
+
+ function next(x, i) {
+ values[i] = x
+ hasValue[i] = true;
+ if (hasValueAll || (hasValueAll = hasValue.every(identity))) {
+ if (err) { return o.onError(err); }
+ var res = tryCatch(resultSelector).apply(null, values);
+ if (res === errorObj) { return o.onError(res.e); }
+ o.onNext(res);
+ }
+ isDone && values[1] && o.onCompleted();
+ }
+
+ return new CompositeDisposable(
+ source.subscribe(
+ function (x) {
+ next(x, 0);
+ },
+ function (e) {
+ if (values[1]) {
+ o.onError(e);
+ } else {
+ err = e;
+ }
+ },
+ function () {
+ isDone = true;
+ values[1] && o.onCompleted();
+ }),
+ subject.subscribe(
+ function (x) {
+ next(x, 1);
+ },
+ function (e) { o.onError(e); },
+ function () {
+ isDone = true;
+ next(true, 1);
+ })
+ );
+ }, source);
+ }
+
+ var PausableBufferedObservable = (function (__super__) {
+
+ inherits(PausableBufferedObservable, __super__);
+
+ function subscribe(o) {
+ var q = [], previousShouldFire;
+
+ function drainQueue() { while (q.length > 0) { o.onNext(q.shift()); } }
+
+ var subscription =
+ combineLatestSource(
+ this.source,
+ this.pauser.distinctUntilChanged().startWith(false),
+ function (data, shouldFire) {
+ return { data: data, shouldFire: shouldFire };
+ })
+ .subscribe(
+ function (results) {
+ if (previousShouldFire !== undefined && results.shouldFire != previousShouldFire) {
+ previousShouldFire = results.shouldFire;
+ // change in shouldFire
+ if (results.shouldFire) { drainQueue(); }
+ } else {
+ previousShouldFire = results.shouldFire;
+ // new data
+ if (results.shouldFire) {
+ o.onNext(results.data);
+ } else {
+ q.push(results.data);
+ }
+ }
+ },
+ function (err) {
+ drainQueue();
+ o.onError(err);
+ },
+ function () {
+ drainQueue();
+ o.onCompleted();
+ }
+ );
+ return subscription;
+ }
+
+ function PausableBufferedObservable(source, pauser) {
+ this.source = source;
+ this.controller = new Subject();
+
+ if (pauser && pauser.subscribe) {
+ this.pauser = this.controller.merge(pauser);
+ } else {
+ this.pauser = this.controller;
+ }
+
+ __super__.call(this, subscribe, source);
+ }
+
+ PausableBufferedObservable.prototype.pause = function () {
+ this.controller.onNext(false);
+ };
+
+ PausableBufferedObservable.prototype.resume = function () {
+ this.controller.onNext(true);
+ };
+
+ return PausableBufferedObservable;
+
+ }(Observable));
+
+ /**
+ * Pauses the underlying observable sequence based upon the observable sequence which yields true/false,
+ * and yields the values that were buffered while paused.
+ * @example
+ * var pauser = new Rx.Subject();
+ * var source = Rx.Observable.interval(100).pausableBuffered(pauser);
+ * @param {Observable} pauser The observable sequence used to pause the underlying sequence.
+ * @returns {Observable} The observable sequence which is paused based upon the pauser.
+ */
+ observableProto.pausableBuffered = function (subject) {
+ return new PausableBufferedObservable(this, subject);
+ };
+
+ var ControlledObservable = (function (__super__) {
+
+ inherits(ControlledObservable, __super__);
+
+ function subscribe (observer) {
+ return this.source.subscribe(observer);
+ }
+
+ function ControlledObservable (source, enableQueue, scheduler) {
+ __super__.call(this, subscribe, source);
+ this.subject = new ControlledSubject(enableQueue, scheduler);
+ this.source = source.multicast(this.subject).refCount();
+ }
+
+ ControlledObservable.prototype.request = function (numberOfItems) {
+ return this.subject.request(numberOfItems == null ? -1 : numberOfItems);
+ };
+
+ return ControlledObservable;
+
+ }(Observable));
+
+ var ControlledSubject = (function (__super__) {
+
+ function subscribe (observer) {
+ return this.subject.subscribe(observer);
+ }
+
+ inherits(ControlledSubject, __super__);
+
+ function ControlledSubject(enableQueue, scheduler) {
+ enableQueue == null && (enableQueue = true);
+
+ __super__.call(this, subscribe);
+ this.subject = new Subject();
+ this.enableQueue = enableQueue;
+ this.queue = enableQueue ? [] : null;
+ this.requestedCount = 0;
+ this.requestedDisposable = disposableEmpty;
+ this.error = null;
+ this.hasFailed = false;
+ this.hasCompleted = false;
+ this.scheduler = scheduler || currentThreadScheduler;
+ }
+
+ addProperties(ControlledSubject.prototype, Observer, {
+ onCompleted: function () {
+ this.hasCompleted = true;
+ if (!this.enableQueue || this.queue.length === 0) {
+ this.subject.onCompleted();
+ } else {
+ this.queue.push(Notification.createOnCompleted());
+ }
+ },
+ onError: function (error) {
+ this.hasFailed = true;
+ this.error = error;
+ if (!this.enableQueue || this.queue.length === 0) {
+ this.subject.onError(error);
+ } else {
+ this.queue.push(Notification.createOnError(error));
+ }
+ },
+ onNext: function (value) {
+ var hasRequested = false;
+
+ if (this.requestedCount === 0) {
+ this.enableQueue && this.queue.push(Notification.createOnNext(value));
+ } else {
+ (this.requestedCount !== -1 && this.requestedCount-- === 0) && this.disposeCurrentRequest();
+ hasRequested = true;
+ }
+ hasRequested && this.subject.onNext(value);
+ },
+ _processRequest: function (numberOfItems) {
+ if (this.enableQueue) {
+ while ((this.queue.length >= numberOfItems && numberOfItems > 0) ||
+ (this.queue.length > 0 && this.queue[0].kind !== 'N')) {
+ var first = this.queue.shift();
+ first.accept(this.subject);
+ if (first.kind === 'N') {
+ numberOfItems--;
+ } else {
+ this.disposeCurrentRequest();
+ this.queue = [];
+ }
+ }
+
+ return { numberOfItems : numberOfItems, returnValue: this.queue.length !== 0};
+ }
+
+ return { numberOfItems: numberOfItems, returnValue: false };
+ },
+ request: function (number) {
+ this.disposeCurrentRequest();
+ var self = this;
+
+ this.requestedDisposable = this.scheduler.scheduleWithState(number,
+ function(s, i) {
+ var r = self._processRequest(i), remaining = r.numberOfItems;
+ if (!r.returnValue) {
+ self.requestedCount = remaining;
+ self.requestedDisposable = disposableCreate(function () {
+ self.requestedCount = 0;
+ });
+ }
+ });
+
+ return this.requestedDisposable;
+ },
+ disposeCurrentRequest: function () {
+ this.requestedDisposable.dispose();
+ this.requestedDisposable = disposableEmpty;
+ }
+ });
+
+ return ControlledSubject;
+ }(Observable));
+
+ /**
+ * Attaches a controller to the observable sequence with the ability to queue.
+ * @example
+ * var source = Rx.Observable.interval(100).controlled();
+ * source.request(3); // Reads 3 values
+ * @param {bool} enableQueue truthy value to determine if values should be queued pending the next request
+ * @param {Scheduler} scheduler determines how the requests will be scheduled
+ * @returns {Observable} The observable sequence which only propagates values on request.
+ */
+ observableProto.controlled = function (enableQueue, scheduler) {
+
+ if (enableQueue && isScheduler(enableQueue)) {
+ scheduler = enableQueue;
+ enableQueue = true;
+ }
+
+ if (enableQueue == null) { enableQueue = true; }
+ return new ControlledObservable(this, enableQueue, scheduler);
+ };
+
+ var StopAndWaitObservable = (function (__super__) {
+
+ function subscribe (observer) {
+ this.subscription = this.source.subscribe(new StopAndWaitObserver(observer, this, this.subscription));
+
+ var self = this;
+ timeoutScheduler.schedule(function () { self.source.request(1); });
+
+ return this.subscription;
+ }
+
+ inherits(StopAndWaitObservable, __super__);
+
+ function StopAndWaitObservable (source) {
+ __super__.call(this, subscribe, source);
+ this.source = source;
+ }
+
+ var StopAndWaitObserver = (function (__sub__) {
+
+ inherits(StopAndWaitObserver, __sub__);
+
+ function StopAndWaitObserver (observer, observable, cancel) {
+ __sub__.call(this);
+ this.observer = observer;
+ this.observable = observable;
+ this.cancel = cancel;
+ }
+
+ var stopAndWaitObserverProto = StopAndWaitObserver.prototype;
+
+ stopAndWaitObserverProto.completed = function () {
+ this.observer.onCompleted();
+ this.dispose();
+ };
+
+ stopAndWaitObserverProto.error = function (error) {
+ this.observer.onError(error);
+ this.dispose();
+ }
+
+ stopAndWaitObserverProto.next = function (value) {
+ this.observer.onNext(value);
+
+ var self = this;
+ timeoutScheduler.schedule(function () {
+ self.observable.source.request(1);
+ });
+ };
+
+ stopAndWaitObserverProto.dispose = function () {
+ this.observer = null;
+ if (this.cancel) {
+ this.cancel.dispose();
+ this.cancel = null;
+ }
+ __sub__.prototype.dispose.call(this);
+ };
+
+ return StopAndWaitObserver;
+ }(AbstractObserver));
+
+ return StopAndWaitObservable;
+ }(Observable));
+
+
+ /**
+ * Attaches a stop and wait observable to the current observable.
+ * @returns {Observable} A stop and wait observable.
+ */
+ ControlledObservable.prototype.stopAndWait = function () {
+ return new StopAndWaitObservable(this);
+ };
+
+ var WindowedObservable = (function (__super__) {
+
+ function subscribe (observer) {
+ this.subscription = this.source.subscribe(new WindowedObserver(observer, this, this.subscription));
+
+ var self = this;
+ timeoutScheduler.schedule(function () {
+ self.source.request(self.windowSize);
+ });
+
+ return this.subscription;
+ }
+
+ inherits(WindowedObservable, __super__);
+
+ function WindowedObservable(source, windowSize) {
+ __super__.call(this, subscribe, source);
+ this.source = source;
+ this.windowSize = windowSize;
+ }
+
+ var WindowedObserver = (function (__sub__) {
+
+ inherits(WindowedObserver, __sub__);
+
+ function WindowedObserver(observer, observable, cancel) {
+ this.observer = observer;
+ this.observable = observable;
+ this.cancel = cancel;
+ this.received = 0;
+ }
+
+ var windowedObserverPrototype = WindowedObserver.prototype;
+
+ windowedObserverPrototype.completed = function () {
+ this.observer.onCompleted();
+ this.dispose();
+ };
+
+ windowedObserverPrototype.error = function (error) {
+ this.observer.onError(error);
+ this.dispose();
+ };
+
+ windowedObserverPrototype.next = function (value) {
+ this.observer.onNext(value);
+
+ this.received = ++this.received % this.observable.windowSize;
+ if (this.received === 0) {
+ var self = this;
+ timeoutScheduler.schedule(function () {
+ self.observable.source.request(self.observable.windowSize);
+ });
+ }
+ };
+
+ windowedObserverPrototype.dispose = function () {
+ this.observer = null;
+ if (this.cancel) {
+ this.cancel.dispose();
+ this.cancel = null;
+ }
+ __sub__.prototype.dispose.call(this);
+ };
+
+ return WindowedObserver;
+ }(AbstractObserver));
+
+ return WindowedObservable;
+ }(Observable));
+
+ /**
+ * Creates a sliding windowed observable based upon the window size.
+ * @param {Number} windowSize The number of items in the window
+ * @returns {Observable} A windowed observable based upon the window size.
+ */
+ ControlledObservable.prototype.windowed = function (windowSize) {
+ return new WindowedObservable(this, windowSize);
+ };
+
+ /**
+ * Pipes the existing Observable sequence into a Node.js Stream.
+ * @param {Stream} dest The destination Node.js stream.
+ * @returns {Stream} The destination stream.
+ */
+ observableProto.pipe = function (dest) {
+ var source = this.pausableBuffered();
+
+ function onDrain() {
+ source.resume();
+ }
+
+ dest.addListener('drain', onDrain);
+
+ source.subscribe(
+ function (x) {
+ !dest.write(String(x)) && source.pause();
+ },
+ function (err) {
+ dest.emit('error', err);
+ },
+ function () {
+ // Hack check because STDIO is not closable
+ !dest._isStdio && dest.end();
+ dest.removeListener('drain', onDrain);
+ });
+
+ source.resume();
+
+ return dest;
+ };
+
+ /**
+ * Multicasts the source sequence notifications through an instantiated subject into all uses of the sequence within a selector function. Each
+ * subscription to the resulting sequence causes a separate multicast invocation, exposing the sequence resulting from the selector function's
+ * invocation. For specializations with fixed subject types, see Publish, PublishLast, and Replay.
+ *
+ * @example
+ * 1 - res = source.multicast(observable);
+ * 2 - res = source.multicast(function () { return new Subject(); }, function (x) { return x; });
+ *
+ * @param {Function|Subject} subjectOrSubjectSelector
+ * Factory function to create an intermediate subject through which the source sequence's elements will be multicast to the selector function.
+ * Or:
+ * Subject to push source elements into.
+ *
+ * @param {Function} [selector] Optional selector function which can use the multicasted source sequence subject to the policies enforced by the created subject. Specified only if <paramref name="subjectOrSubjectSelector" is a factory function.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
+ */
+ observableProto.multicast = function (subjectOrSubjectSelector, selector) {
+ var source = this;
+ return typeof subjectOrSubjectSelector === 'function' ?
+ new AnonymousObservable(function (observer) {
+ var connectable = source.multicast(subjectOrSubjectSelector());
+ return new CompositeDisposable(selector(connectable).subscribe(observer), connectable.connect());
+ }, source) :
+ new ConnectableObservable(source, subjectOrSubjectSelector);
+ };
+
+ /**
+ * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence.
+ * This operator is a specialization of Multicast using a regular Subject.
+ *
+ * @example
+ * var resres = source.publish();
+ * var res = source.publish(function (x) { return x; });
+ *
+ * @param {Function} [selector] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all notifications of the source from the time of the subscription on.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
+ */
+ observableProto.publish = function (selector) {
+ return selector && isFunction(selector) ?
+ this.multicast(function () { return new Subject(); }, selector) :
+ this.multicast(new Subject());
+ };
+
+ /**
+ * Returns an observable sequence that shares a single subscription to the underlying sequence.
+ * This operator is a specialization of publish which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence.
+ */
+ observableProto.share = function () {
+ return this.publish().refCount();
+ };
+
+ /**
+ * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence containing only the last notification.
+ * This operator is a specialization of Multicast using a AsyncSubject.
+ *
+ * @example
+ * var res = source.publishLast();
+ * var res = source.publishLast(function (x) { return x; });
+ *
+ * @param selector [Optional] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will only receive the last notification of the source.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
+ */
+ observableProto.publishLast = function (selector) {
+ return selector && isFunction(selector) ?
+ this.multicast(function () { return new AsyncSubject(); }, selector) :
+ this.multicast(new AsyncSubject());
+ };
+
+ /**
+ * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence and starts with initialValue.
+ * This operator is a specialization of Multicast using a BehaviorSubject.
+ *
+ * @example
+ * var res = source.publishValue(42);
+ * var res = source.publishValue(function (x) { return x.select(function (y) { return y * y; }) }, 42);
+ *
+ * @param {Function} [selector] Optional selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive immediately receive the initial value, followed by all notifications of the source from the time of the subscription on.
+ * @param {Mixed} initialValue Initial value received by observers upon subscription.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
+ */
+ observableProto.publishValue = function (initialValueOrSelector, initialValue) {
+ return arguments.length === 2 ?
+ this.multicast(function () {
+ return new BehaviorSubject(initialValue);
+ }, initialValueOrSelector) :
+ this.multicast(new BehaviorSubject(initialValueOrSelector));
+ };
+
+ /**
+ * Returns an observable sequence that shares a single subscription to the underlying sequence and starts with an initialValue.
+ * This operator is a specialization of publishValue which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed.
+ * @param {Mixed} initialValue Initial value received by observers upon subscription.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence.
+ */
+ observableProto.shareValue = function (initialValue) {
+ return this.publishValue(initialValue).refCount();
+ };
+
+ /**
+ * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length for the replay buffer.
+ * This operator is a specialization of Multicast using a ReplaySubject.
+ *
+ * @example
+ * var res = source.replay(null, 3);
+ * var res = source.replay(null, 3, 500);
+ * var res = source.replay(null, 3, 500, scheduler);
+ * var res = source.replay(function (x) { return x.take(6).repeat(); }, 3, 500, scheduler);
+ *
+ * @param selector [Optional] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all the notifications of the source subject to the specified replay buffer trimming policy.
+ * @param bufferSize [Optional] Maximum element count of the replay buffer.
+ * @param windowSize [Optional] Maximum time length of the replay buffer.
+ * @param scheduler [Optional] Scheduler where connected observers within the selector function will be invoked on.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
+ */
+ observableProto.replay = function (selector, bufferSize, windowSize, scheduler) {
+ return selector && isFunction(selector) ?
+ this.multicast(function () { return new ReplaySubject(bufferSize, windowSize, scheduler); }, selector) :
+ this.multicast(new ReplaySubject(bufferSize, windowSize, scheduler));
+ };
+
+ /**
+ * Returns an observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length for the replay buffer.
+ * This operator is a specialization of replay which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed.
+ *
+ * @example
+ * var res = source.shareReplay(3);
+ * var res = source.shareReplay(3, 500);
+ * var res = source.shareReplay(3, 500, scheduler);
+ *
+
+ * @param bufferSize [Optional] Maximum element count of the replay buffer.
+ * @param window [Optional] Maximum time length of the replay buffer.
+ * @param scheduler [Optional] Scheduler where connected observers within the selector function will be invoked on.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence.
+ */
+ observableProto.shareReplay = function (bufferSize, windowSize, scheduler) {
+ return this.replay(null, bufferSize, windowSize, scheduler).refCount();
+ };
+
+ var InnerSubscription = function (subject, observer) {
+ this.subject = subject;
+ this.observer = observer;
+ };
+
+ InnerSubscription.prototype.dispose = function () {
+ if (!this.subject.isDisposed && this.observer !== null) {
+ var idx = this.subject.observers.indexOf(this.observer);
+ this.subject.observers.splice(idx, 1);
+ this.observer = null;
+ }
+ };
+
+ /**
+ * Represents a value that changes over time.
+ * Observers can subscribe to the subject to receive the last (or initial) value and all subsequent notifications.
+ */
+ var BehaviorSubject = Rx.BehaviorSubject = (function (__super__) {
+ function subscribe(observer) {
+ checkDisposed(this);
+ if (!this.isStopped) {
+ this.observers.push(observer);
+ observer.onNext(this.value);
+ return new InnerSubscription(this, observer);
+ }
+ if (this.hasError) {
+ observer.onError(this.error);
+ } else {
+ observer.onCompleted();
+ }
+ return disposableEmpty;
+ }
+
+ inherits(BehaviorSubject, __super__);
+
+ /**
+ * Initializes a new instance of the BehaviorSubject class which creates a subject that caches its last value and starts with the specified value.
+ * @param {Mixed} value Initial value sent to observers when no other value has been received by the subject yet.
+ */
+ function BehaviorSubject(value) {
+ __super__.call(this, subscribe);
+ this.value = value,
+ this.observers = [],
+ this.isDisposed = false,
+ this.isStopped = false,
+ this.hasError = false;
+ }
+
+ addProperties(BehaviorSubject.prototype, Observer, {
+ /**
+ * Gets the current value or throws an exception.
+ * Value is frozen after onCompleted is called.
+ * After onError is called always throws the specified exception.
+ * An exception is always thrown after dispose is called.
+ * @returns {Mixed} The initial value passed to the constructor until onNext is called; after which, the last value passed to onNext.
+ */
+ getValue: function () {
+ checkDisposed(this);
+ if (this.hasError) {
+ throw this.error;
+ }
+ return this.value;
+ },
+ /**
+ * Indicates whether the subject has observers subscribed to it.
+ * @returns {Boolean} Indicates whether the subject has observers subscribed to it.
+ */
+ hasObservers: function () { return this.observers.length > 0; },
+ /**
+ * Notifies all subscribed observers about the end of the sequence.
+ */
+ onCompleted: function () {
+ checkDisposed(this);
+ if (this.isStopped) { return; }
+ this.isStopped = true;
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ os[i].onCompleted();
+ }
+
+ this.observers.length = 0;
+ },
+ /**
+ * Notifies all subscribed observers about the exception.
+ * @param {Mixed} error The exception to send to all observers.
+ */
+ onError: function (error) {
+ checkDisposed(this);
+ if (this.isStopped) { return; }
+ this.isStopped = true;
+ this.hasError = true;
+ this.error = error;
+
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ os[i].onError(error);
+ }
+
+ this.observers.length = 0;
+ },
+ /**
+ * Notifies all subscribed observers about the arrival of the specified element in the sequence.
+ * @param {Mixed} value The value to send to all observers.
+ */
+ onNext: function (value) {
+ checkDisposed(this);
+ if (this.isStopped) { return; }
+ this.value = value;
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ os[i].onNext(value);
+ }
+ },
+ /**
+ * Unsubscribe all observers and release resources.
+ */
+ dispose: function () {
+ this.isDisposed = true;
+ this.observers = null;
+ this.value = null;
+ this.exception = null;
+ }
+ });
+
+ return BehaviorSubject;
+ }(Observable));
+
+ /**
+ * Represents an object that is both an observable sequence as well as an observer.
+ * Each notification is broadcasted to all subscribed and future observers, subject to buffer trimming policies.
+ */
+ var ReplaySubject = Rx.ReplaySubject = (function (__super__) {
+
+ var maxSafeInteger = Math.pow(2, 53) - 1;
+
+ function createRemovableDisposable(subject, observer) {
+ return disposableCreate(function () {
+ observer.dispose();
+ !subject.isDisposed && subject.observers.splice(subject.observers.indexOf(observer), 1);
+ });
+ }
+
+ function subscribe(observer) {
+ var so = new ScheduledObserver(this.scheduler, observer),
+ subscription = createRemovableDisposable(this, so);
+ checkDisposed(this);
+ this._trim(this.scheduler.now());
+ this.observers.push(so);
+
+ for (var i = 0, len = this.q.length; i < len; i++) {
+ so.onNext(this.q[i].value);
+ }
+
+ if (this.hasError) {
+ so.onError(this.error);
+ } else if (this.isStopped) {
+ so.onCompleted();
+ }
+
+ so.ensureActive();
+ return subscription;
+ }
+
+ inherits(ReplaySubject, __super__);
+
+ /**
+ * Initializes a new instance of the ReplaySubject class with the specified buffer size, window size and scheduler.
+ * @param {Number} [bufferSize] Maximum element count of the replay buffer.
+ * @param {Number} [windowSize] Maximum time length of the replay buffer.
+ * @param {Scheduler} [scheduler] Scheduler the observers are invoked on.
+ */
+ function ReplaySubject(bufferSize, windowSize, scheduler) {
+ this.bufferSize = bufferSize == null ? maxSafeInteger : bufferSize;
+ this.windowSize = windowSize == null ? maxSafeInteger : windowSize;
+ this.scheduler = scheduler || currentThreadScheduler;
+ this.q = [];
+ this.observers = [];
+ this.isStopped = false;
+ this.isDisposed = false;
+ this.hasError = false;
+ this.error = null;
+ __super__.call(this, subscribe);
+ }
+
+ addProperties(ReplaySubject.prototype, Observer.prototype, {
+ /**
+ * Indicates whether the subject has observers subscribed to it.
+ * @returns {Boolean} Indicates whether the subject has observers subscribed to it.
+ */
+ hasObservers: function () {
+ return this.observers.length > 0;
+ },
+ _trim: function (now) {
+ while (this.q.length > this.bufferSize) {
+ this.q.shift();
+ }
+ while (this.q.length > 0 && (now - this.q[0].interval) > this.windowSize) {
+ this.q.shift();
+ }
+ },
+ /**
+ * Notifies all subscribed observers about the arrival of the specified element in the sequence.
+ * @param {Mixed} value The value to send to all observers.
+ */
+ onNext: function (value) {
+ checkDisposed(this);
+ if (this.isStopped) { return; }
+ var now = this.scheduler.now();
+ this.q.push({ interval: now, value: value });
+ this._trim(now);
+
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ var observer = os[i];
+ observer.onNext(value);
+ observer.ensureActive();
+ }
+ },
+ /**
+ * Notifies all subscribed observers about the exception.
+ * @param {Mixed} error The exception to send to all observers.
+ */
+ onError: function (error) {
+ checkDisposed(this);
+ if (this.isStopped) { return; }
+ this.isStopped = true;
+ this.error = error;
+ this.hasError = true;
+ var now = this.scheduler.now();
+ this._trim(now);
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ var observer = os[i];
+ observer.onError(error);
+ observer.ensureActive();
+ }
+ this.observers.length = 0;
+ },
+ /**
+ * Notifies all subscribed observers about the end of the sequence.
+ */
+ onCompleted: function () {
+ checkDisposed(this);
+ if (this.isStopped) { return; }
+ this.isStopped = true;
+ var now = this.scheduler.now();
+ this._trim(now);
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ var observer = os[i];
+ observer.onCompleted();
+ observer.ensureActive();
+ }
+ this.observers.length = 0;
+ },
+ /**
+ * Unsubscribe all observers and release resources.
+ */
+ dispose: function () {
+ this.isDisposed = true;
+ this.observers = null;
+ }
+ });
+
+ return ReplaySubject;
+ }(Observable));
+
+ var ConnectableObservable = Rx.ConnectableObservable = (function (__super__) {
+ inherits(ConnectableObservable, __super__);
+
+ function ConnectableObservable(source, subject) {
+ var hasSubscription = false,
+ subscription,
+ sourceObservable = source.asObservable();
+
+ this.connect = function () {
+ if (!hasSubscription) {
+ hasSubscription = true;
+ subscription = new CompositeDisposable(sourceObservable.subscribe(subject), disposableCreate(function () {
+ hasSubscription = false;
+ }));
+ }
+ return subscription;
+ };
+
+ __super__.call(this, function (o) { return subject.subscribe(o); });
+ }
+
+ ConnectableObservable.prototype.refCount = function () {
+ var connectableSubscription, count = 0, source = this;
+ return new AnonymousObservable(function (observer) {
+ var shouldConnect = ++count === 1,
+ subscription = source.subscribe(observer);
+ shouldConnect && (connectableSubscription = source.connect());
+ return function () {
+ subscription.dispose();
+ --count === 0 && connectableSubscription.dispose();
+ };
+ });
+ };
+
+ return ConnectableObservable;
+ }(Observable));
+
+ /**
+ * Returns an observable sequence that shares a single subscription to the underlying sequence. This observable sequence
+ * can be resubscribed to, even if all prior subscriptions have ended. (unlike `.publish().refCount()`)
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source.
+ */
+ observableProto.singleInstance = function() {
+ var source = this, hasObservable = false, observable;
+
+ function getObservable() {
+ if (!hasObservable) {
+ hasObservable = true;
+ observable = source.finally(function() { hasObservable = false; }).publish().refCount();
+ }
+ return observable;
+ };
+
+ return new AnonymousObservable(function(o) {
+ return getObservable().subscribe(o);
+ });
+ };
+
+ var Dictionary = (function () {
+
+ var primes = [1, 3, 7, 13, 31, 61, 127, 251, 509, 1021, 2039, 4093, 8191, 16381, 32749, 65521, 131071, 262139, 524287, 1048573, 2097143, 4194301, 8388593, 16777213, 33554393, 67108859, 134217689, 268435399, 536870909, 1073741789, 2147483647],
+ noSuchkey = "no such key",
+ duplicatekey = "duplicate key";
+
+ function isPrime(candidate) {
+ if ((candidate & 1) === 0) { return candidate === 2; }
+ var num1 = Math.sqrt(candidate),
+ num2 = 3;
+ while (num2 <= num1) {
+ if (candidate % num2 === 0) { return false; }
+ num2 += 2;
+ }
+ return true;
+ }
+
+ function getPrime(min) {
+ var index, num, candidate;
+ for (index = 0; index < primes.length; ++index) {
+ num = primes[index];
+ if (num >= min) { return num; }
+ }
+ candidate = min | 1;
+ while (candidate < primes[primes.length - 1]) {
+ if (isPrime(candidate)) { return candidate; }
+ candidate += 2;
+ }
+ return min;
+ }
+
+ function stringHashFn(str) {
+ var hash = 757602046;
+ if (!str.length) { return hash; }
+ for (var i = 0, len = str.length; i < len; i++) {
+ var character = str.charCodeAt(i);
+ hash = ((hash << 5) - hash) + character;
+ hash = hash & hash;
+ }
+ return hash;
+ }
+
+ function numberHashFn(key) {
+ var c2 = 0x27d4eb2d;
+ key = (key ^ 61) ^ (key >>> 16);
+ key = key + (key << 3);
+ key = key ^ (key >>> 4);
+ key = key * c2;
+ key = key ^ (key >>> 15);
+ return key;
+ }
+
+ var getHashCode = (function () {
+ var uniqueIdCounter = 0;
+
+ return function (obj) {
+ if (obj == null) { throw new Error(noSuchkey); }
+
+ // Check for built-ins before tacking on our own for any object
+ if (typeof obj === 'string') { return stringHashFn(obj); }
+ if (typeof obj === 'number') { return numberHashFn(obj); }
+ if (typeof obj === 'boolean') { return obj === true ? 1 : 0; }
+ if (obj instanceof Date) { return numberHashFn(obj.valueOf()); }
+ if (obj instanceof RegExp) { return stringHashFn(obj.toString()); }
+ if (typeof obj.valueOf === 'function') {
+ // Hack check for valueOf
+ var valueOf = obj.valueOf();
+ if (typeof valueOf === 'number') { return numberHashFn(valueOf); }
+ if (typeof valueOf === 'string') { return stringHashFn(valueOf); }
+ }
+ if (obj.hashCode) { return obj.hashCode(); }
+
+ var id = 17 * uniqueIdCounter++;
+ obj.hashCode = function () { return id; };
+ return id;
+ };
+ }());
+
+ function newEntry() {
+ return { key: null, value: null, next: 0, hashCode: 0 };
+ }
+
+ function Dictionary(capacity, comparer) {
+ if (capacity < 0) { throw new ArgumentOutOfRangeError(); }
+ if (capacity > 0) { this._initialize(capacity); }
+
+ this.comparer = comparer || defaultComparer;
+ this.freeCount = 0;
+ this.size = 0;
+ this.freeList = -1;
+ }
+
+ var dictionaryProto = Dictionary.prototype;
+
+ dictionaryProto._initialize = function (capacity) {
+ var prime = getPrime(capacity), i;
+ this.buckets = new Array(prime);
+ this.entries = new Array(prime);
+ for (i = 0; i < prime; i++) {
+ this.buckets[i] = -1;
+ this.entries[i] = newEntry();
+ }
+ this.freeList = -1;
+ };
+
+ dictionaryProto.add = function (key, value) {
+ this._insert(key, value, true);
+ };
+
+ dictionaryProto._insert = function (key, value, add) {
+ if (!this.buckets) { this._initialize(0); }
+ var index3,
+ num = getHashCode(key) & 2147483647,
+ index1 = num % this.buckets.length;
+ for (var index2 = this.buckets[index1]; index2 >= 0; index2 = this.entries[index2].next) {
+ if (this.entries[index2].hashCode === num && this.comparer(this.entries[index2].key, key)) {
+ if (add) { throw new Error(duplicatekey); }
+ this.entries[index2].value = value;
+ return;
+ }
+ }
+ if (this.freeCount > 0) {
+ index3 = this.freeList;
+ this.freeList = this.entries[index3].next;
+ --this.freeCount;
+ } else {
+ if (this.size === this.entries.length) {
+ this._resize();
+ index1 = num % this.buckets.length;
+ }
+ index3 = this.size;
+ ++this.size;
+ }
+ this.entries[index3].hashCode = num;
+ this.entries[index3].next = this.buckets[index1];
+ this.entries[index3].key = key;
+ this.entries[index3].value = value;
+ this.buckets[index1] = index3;
+ };
+
+ dictionaryProto._resize = function () {
+ var prime = getPrime(this.size * 2),
+ numArray = new Array(prime);
+ for (index = 0; index < numArray.length; ++index) { numArray[index] = -1; }
+ var entryArray = new Array(prime);
+ for (index = 0; index < this.size; ++index) { entryArray[index] = this.entries[index]; }
+ for (var index = this.size; index < prime; ++index) { entryArray[index] = newEntry(); }
+ for (var index1 = 0; index1 < this.size; ++index1) {
+ var index2 = entryArray[index1].hashCode % prime;
+ entryArray[index1].next = numArray[index2];
+ numArray[index2] = index1;
+ }
+ this.buckets = numArray;
+ this.entries = entryArray;
+ };
+
+ dictionaryProto.remove = function (key) {
+ if (this.buckets) {
+ var num = getHashCode(key) & 2147483647,
+ index1 = num % this.buckets.length,
+ index2 = -1;
+ for (var index3 = this.buckets[index1]; index3 >= 0; index3 = this.entries[index3].next) {
+ if (this.entries[index3].hashCode === num && this.comparer(this.entries[index3].key, key)) {
+ if (index2 < 0) {
+ this.buckets[index1] = this.entries[index3].next;
+ } else {
+ this.entries[index2].next = this.entries[index3].next;
+ }
+ this.entries[index3].hashCode = -1;
+ this.entries[index3].next = this.freeList;
+ this.entries[index3].key = null;
+ this.entries[index3].value = null;
+ this.freeList = index3;
+ ++this.freeCount;
+ return true;
+ } else {
+ index2 = index3;
+ }
+ }
+ }
+ return false;
+ };
+
+ dictionaryProto.clear = function () {
+ var index, len;
+ if (this.size <= 0) { return; }
+ for (index = 0, len = this.buckets.length; index < len; ++index) {
+ this.buckets[index] = -1;
+ }
+ for (index = 0; index < this.size; ++index) {
+ this.entries[index] = newEntry();
+ }
+ this.freeList = -1;
+ this.size = 0;
+ };
+
+ dictionaryProto._findEntry = function (key) {
+ if (this.buckets) {
+ var num = getHashCode(key) & 2147483647;
+ for (var index = this.buckets[num % this.buckets.length]; index >= 0; index = this.entries[index].next) {
+ if (this.entries[index].hashCode === num && this.comparer(this.entries[index].key, key)) {
+ return index;
+ }
+ }
+ }
+ return -1;
+ };
+
+ dictionaryProto.count = function () {
+ return this.size - this.freeCount;
+ };
+
+ dictionaryProto.tryGetValue = function (key) {
+ var entry = this._findEntry(key);
+ return entry >= 0 ?
+ this.entries[entry].value :
+ undefined;
+ };
+
+ dictionaryProto.getValues = function () {
+ var index = 0, results = [];
+ if (this.entries) {
+ for (var index1 = 0; index1 < this.size; index1++) {
+ if (this.entries[index1].hashCode >= 0) {
+ results[index++] = this.entries[index1].value;
+ }
+ }
+ }
+ return results;
+ };
+
+ dictionaryProto.get = function (key) {
+ var entry = this._findEntry(key);
+ if (entry >= 0) { return this.entries[entry].value; }
+ throw new Error(noSuchkey);
+ };
+
+ dictionaryProto.set = function (key, value) {
+ this._insert(key, value, false);
+ };
+
+ dictionaryProto.containskey = function (key) {
+ return this._findEntry(key) >= 0;
+ };
+
+ return Dictionary;
+ }());
+
+ /**
+ * Correlates the elements of two sequences based on overlapping durations.
+ *
+ * @param {Observable} right The right observable sequence to join elements for.
+ * @param {Function} leftDurationSelector A function to select the duration (expressed as an observable sequence) of each element of the left observable sequence, used to determine overlap.
+ * @param {Function} rightDurationSelector A function to select the duration (expressed as an observable sequence) of each element of the right observable sequence, used to determine overlap.
+ * @param {Function} resultSelector A function invoked to compute a result element for any two overlapping elements of the left and right observable sequences. The parameters passed to the function correspond with the elements from the left and right source sequences for which overlap occurs.
+ * @returns {Observable} An observable sequence that contains result elements computed from source elements that have an overlapping duration.
+ */
+ observableProto.join = function (right, leftDurationSelector, rightDurationSelector, resultSelector) {
+ var left = this;
+ return new AnonymousObservable(function (observer) {
+ var group = new CompositeDisposable();
+ var leftDone = false, rightDone = false;
+ var leftId = 0, rightId = 0;
+ var leftMap = new Dictionary(), rightMap = new Dictionary();
+
+ group.add(left.subscribe(
+ function (value) {
+ var id = leftId++;
+ var md = new SingleAssignmentDisposable();
+
+ leftMap.add(id, value);
+ group.add(md);
+
+ var expire = function () {
+ leftMap.remove(id) && leftMap.count() === 0 && leftDone && observer.onCompleted();
+ group.remove(md);
+ };
+
+ var duration;
+ try {
+ duration = leftDurationSelector(value);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+
+ md.setDisposable(duration.take(1).subscribe(noop, observer.onError.bind(observer), expire));
+
+ rightMap.getValues().forEach(function (v) {
+ var result;
+ try {
+ result = resultSelector(value, v);
+ } catch (exn) {
+ observer.onError(exn);
+ return;
+ }
+
+ observer.onNext(result);
+ });
+ },
+ observer.onError.bind(observer),
+ function () {
+ leftDone = true;
+ (rightDone || leftMap.count() === 0) && observer.onCompleted();
+ })
+ );
+
+ group.add(right.subscribe(
+ function (value) {
+ var id = rightId++;
+ var md = new SingleAssignmentDisposable();
+
+ rightMap.add(id, value);
+ group.add(md);
+
+ var expire = function () {
+ rightMap.remove(id) && rightMap.count() === 0 && rightDone && observer.onCompleted();
+ group.remove(md);
+ };
+
+ var duration;
+ try {
+ duration = rightDurationSelector(value);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+
+ md.setDisposable(duration.take(1).subscribe(noop, observer.onError.bind(observer), expire));
+
+ leftMap.getValues().forEach(function (v) {
+ var result;
+ try {
+ result = resultSelector(v, value);
+ } catch (exn) {
+ observer.onError(exn);
+ return;
+ }
+
+ observer.onNext(result);
+ });
+ },
+ observer.onError.bind(observer),
+ function () {
+ rightDone = true;
+ (leftDone || rightMap.count() === 0) && observer.onCompleted();
+ })
+ );
+ return group;
+ }, left);
+ };
+
+ /**
+ * Correlates the elements of two sequences based on overlapping durations, and groups the results.
+ *
+ * @param {Observable} right The right observable sequence to join elements for.
+ * @param {Function} leftDurationSelector A function to select the duration (expressed as an observable sequence) of each element of the left observable sequence, used to determine overlap.
+ * @param {Function} rightDurationSelector A function to select the duration (expressed as an observable sequence) of each element of the right observable sequence, used to determine overlap.
+ * @param {Function} resultSelector A function invoked to compute a result element for any element of the left sequence with overlapping elements from the right observable sequence. The first parameter passed to the function is an element of the left sequence. The second parameter passed to the function is an observable sequence with elements from the right sequence that overlap with the left sequence's element.
+ * @returns {Observable} An observable sequence that contains result elements computed from source elements that have an overlapping duration.
+ */
+ observableProto.groupJoin = function (right, leftDurationSelector, rightDurationSelector, resultSelector) {
+ var left = this;
+ return new AnonymousObservable(function (observer) {
+ var group = new CompositeDisposable();
+ var r = new RefCountDisposable(group);
+ var leftMap = new Dictionary(), rightMap = new Dictionary();
+ var leftId = 0, rightId = 0;
+
+ function handleError(e) { return function (v) { v.onError(e); }; };
+
+ group.add(left.subscribe(
+ function (value) {
+ var s = new Subject();
+ var id = leftId++;
+ leftMap.add(id, s);
+
+ var result;
+ try {
+ result = resultSelector(value, addRef(s, r));
+ } catch (e) {
+ leftMap.getValues().forEach(handleError(e));
+ observer.onError(e);
+ return;
+ }
+ observer.onNext(result);
+
+ rightMap.getValues().forEach(function (v) { s.onNext(v); });
+
+ var md = new SingleAssignmentDisposable();
+ group.add(md);
+
+ var expire = function () {
+ leftMap.remove(id) && s.onCompleted();
+ group.remove(md);
+ };
+
+ var duration;
+ try {
+ duration = leftDurationSelector(value);
+ } catch (e) {
+ leftMap.getValues().forEach(handleError(e));
+ observer.onError(e);
+ return;
+ }
+
+ md.setDisposable(duration.take(1).subscribe(
+ noop,
+ function (e) {
+ leftMap.getValues().forEach(handleError(e));
+ observer.onError(e);
+ },
+ expire)
+ );
+ },
+ function (e) {
+ leftMap.getValues().forEach(handleError(e));
+ observer.onError(e);
+ },
+ observer.onCompleted.bind(observer))
+ );
+
+ group.add(right.subscribe(
+ function (value) {
+ var id = rightId++;
+ rightMap.add(id, value);
+
+ var md = new SingleAssignmentDisposable();
+ group.add(md);
+
+ var expire = function () {
+ rightMap.remove(id);
+ group.remove(md);
+ };
+
+ var duration;
+ try {
+ duration = rightDurationSelector(value);
+ } catch (e) {
+ leftMap.getValues().forEach(handleError(e));
+ observer.onError(e);
+ return;
+ }
+ md.setDisposable(duration.take(1).subscribe(
+ noop,
+ function (e) {
+ leftMap.getValues().forEach(handleError(e));
+ observer.onError(e);
+ },
+ expire)
+ );
+
+ leftMap.getValues().forEach(function (v) { v.onNext(value); });
+ },
+ function (e) {
+ leftMap.getValues().forEach(handleError(e));
+ observer.onError(e);
+ })
+ );
+
+ return r;
+ }, left);
+ };
+
+ /**
+ * Projects each element of an observable sequence into zero or more buffers.
+ *
+ * @param {Mixed} bufferOpeningsOrClosingSelector Observable sequence whose elements denote the creation of new windows, or, a function invoked to define the boundaries of the produced windows (a new window is started when the previous one is closed, resulting in non-overlapping windows).
+ * @param {Function} [bufferClosingSelector] A function invoked to define the closing of each produced window. If a closing selector function is specified for the first parameter, this parameter is ignored.
+ * @returns {Observable} An observable sequence of windows.
+ */
+ observableProto.buffer = function (bufferOpeningsOrClosingSelector, bufferClosingSelector) {
+ return this.window.apply(this, arguments).selectMany(function (x) { return x.toArray(); });
+ };
+
+ /**
+ * Projects each element of an observable sequence into zero or more windows.
+ *
+ * @param {Mixed} windowOpeningsOrClosingSelector Observable sequence whose elements denote the creation of new windows, or, a function invoked to define the boundaries of the produced windows (a new window is started when the previous one is closed, resulting in non-overlapping windows).
+ * @param {Function} [windowClosingSelector] A function invoked to define the closing of each produced window. If a closing selector function is specified for the first parameter, this parameter is ignored.
+ * @returns {Observable} An observable sequence of windows.
+ */
+ observableProto.window = function (windowOpeningsOrClosingSelector, windowClosingSelector) {
+ if (arguments.length === 1 && typeof arguments[0] !== 'function') {
+ return observableWindowWithBoundaries.call(this, windowOpeningsOrClosingSelector);
+ }
+ return typeof windowOpeningsOrClosingSelector === 'function' ?
+ observableWindowWithClosingSelector.call(this, windowOpeningsOrClosingSelector) :
+ observableWindowWithOpenings.call(this, windowOpeningsOrClosingSelector, windowClosingSelector);
+ };
+
+ function observableWindowWithOpenings(windowOpenings, windowClosingSelector) {
+ return windowOpenings.groupJoin(this, windowClosingSelector, observableEmpty, function (_, win) {
+ return win;
+ });
+ }
+
+ function observableWindowWithBoundaries(windowBoundaries) {
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ var win = new Subject(),
+ d = new CompositeDisposable(),
+ r = new RefCountDisposable(d);
+
+ observer.onNext(addRef(win, r));
+
+ d.add(source.subscribe(function (x) {
+ win.onNext(x);
+ }, function (err) {
+ win.onError(err);
+ observer.onError(err);
+ }, function () {
+ win.onCompleted();
+ observer.onCompleted();
+ }));
+
+ isPromise(windowBoundaries) && (windowBoundaries = observableFromPromise(windowBoundaries));
+
+ d.add(windowBoundaries.subscribe(function (w) {
+ win.onCompleted();
+ win = new Subject();
+ observer.onNext(addRef(win, r));
+ }, function (err) {
+ win.onError(err);
+ observer.onError(err);
+ }, function () {
+ win.onCompleted();
+ observer.onCompleted();
+ }));
+
+ return r;
+ }, source);
+ }
+
+ function observableWindowWithClosingSelector(windowClosingSelector) {
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ var m = new SerialDisposable(),
+ d = new CompositeDisposable(m),
+ r = new RefCountDisposable(d),
+ win = new Subject();
+ observer.onNext(addRef(win, r));
+ d.add(source.subscribe(function (x) {
+ win.onNext(x);
+ }, function (err) {
+ win.onError(err);
+ observer.onError(err);
+ }, function () {
+ win.onCompleted();
+ observer.onCompleted();
+ }));
+
+ function createWindowClose () {
+ var windowClose;
+ try {
+ windowClose = windowClosingSelector();
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+
+ isPromise(windowClose) && (windowClose = observableFromPromise(windowClose));
+
+ var m1 = new SingleAssignmentDisposable();
+ m.setDisposable(m1);
+ m1.setDisposable(windowClose.take(1).subscribe(noop, function (err) {
+ win.onError(err);
+ observer.onError(err);
+ }, function () {
+ win.onCompleted();
+ win = new Subject();
+ observer.onNext(addRef(win, r));
+ createWindowClose();
+ }));
+ }
+
+ createWindowClose();
+ return r;
+ }, source);
+ }
+
+ /**
+ * Returns a new observable that triggers on the second and subsequent triggerings of the input observable.
+ * The Nth triggering of the input observable passes the arguments from the N-1th and Nth triggering as a pair.
+ * The argument passed to the N-1th triggering is held in hidden internal state until the Nth triggering occurs.
+ * @returns {Observable} An observable that triggers on successive pairs of observations from the input observable as an array.
+ */
+ observableProto.pairwise = function () {
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ var previous, hasPrevious = false;
+ return source.subscribe(
+ function (x) {
+ if (hasPrevious) {
+ observer.onNext([previous, x]);
+ } else {
+ hasPrevious = true;
+ }
+ previous = x;
+ },
+ observer.onError.bind(observer),
+ observer.onCompleted.bind(observer));
+ }, source);
+ };
+
+ /**
+ * Returns two observables which partition the observations of the source by the given function.
+ * The first will trigger observations for those values for which the predicate returns true.
+ * The second will trigger observations for those values where the predicate returns false.
+ * The predicate is executed once for each subscribed observer.
+ * Both also propagate all error observations arising from the source and each completes
+ * when the source completes.
+ * @param {Function} predicate
+ * The function to determine which output Observable will trigger a particular observation.
+ * @returns {Array}
+ * An array of observables. The first triggers when the predicate returns true,
+ * and the second triggers when the predicate returns false.
+ */
+ observableProto.partition = function(predicate, thisArg) {
+ return [
+ this.filter(predicate, thisArg),
+ this.filter(function (x, i, o) { return !predicate.call(thisArg, x, i, o); })
+ ];
+ };
+
+ var WhileEnumerable = (function(__super__) {
+ inherits(WhileEnumerable, __super__);
+ function WhileEnumerable(c, s) {
+ this.c = c;
+ this.s = s;
+ }
+ WhileEnumerable.prototype[$iterator$] = function () {
+ var self = this;
+ return {
+ next: function () {
+ return self.c() ?
+ { done: false, value: self.s } :
+ { done: true, value: void 0 };
+ }
+ };
+ };
+ return WhileEnumerable;
+ }(Enumerable));
+
+ function enumerableWhile(condition, source) {
+ return new WhileEnumerable(condition, source);
+ }
+
+ /**
+ * Returns an observable sequence that is the result of invoking the selector on the source sequence, without sharing subscriptions.
+ * This operator allows for a fluent style of writing queries that use the same sequence multiple times.
+ *
+ * @param {Function} selector Selector function which can use the source sequence as many times as needed, without sharing subscriptions to the source sequence.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
+ */
+ observableProto.letBind = observableProto['let'] = function (func) {
+ return func(this);
+ };
+
+ /**
+ * Determines whether an observable collection contains values. There is an alias for this method called 'ifThen' for browsers <IE9
+ *
+ * @example
+ * 1 - res = Rx.Observable.if(condition, obs1);
+ * 2 - res = Rx.Observable.if(condition, obs1, obs2);
+ * 3 - res = Rx.Observable.if(condition, obs1, scheduler);
+ * @param {Function} condition The condition which determines if the thenSource or elseSource will be run.
+ * @param {Observable} thenSource The observable sequence or Promise that will be run if the condition function returns true.
+ * @param {Observable} [elseSource] The observable sequence or Promise that will be run if the condition function returns false. If this is not provided, it defaults to Rx.Observabe.Empty with the specified scheduler.
+ * @returns {Observable} An observable sequence which is either the thenSource or elseSource.
+ */
+ Observable['if'] = Observable.ifThen = function (condition, thenSource, elseSourceOrScheduler) {
+ return observableDefer(function () {
+ elseSourceOrScheduler || (elseSourceOrScheduler = observableEmpty());
+
+ isPromise(thenSource) && (thenSource = observableFromPromise(thenSource));
+ isPromise(elseSourceOrScheduler) && (elseSourceOrScheduler = observableFromPromise(elseSourceOrScheduler));
+
+ // Assume a scheduler for empty only
+ typeof elseSourceOrScheduler.now === 'function' && (elseSourceOrScheduler = observableEmpty(elseSourceOrScheduler));
+ return condition() ? thenSource : elseSourceOrScheduler;
+ });
+ };
+
+ /**
+ * Concatenates the observable sequences obtained by running the specified result selector for each element in source.
+ * There is an alias for this method called 'forIn' for browsers <IE9
+ * @param {Array} sources An array of values to turn into an observable sequence.
+ * @param {Function} resultSelector A function to apply to each item in the sources array to turn it into an observable sequence.
+ * @returns {Observable} An observable sequence from the concatenated observable sequences.
+ */
+ Observable['for'] = Observable.forIn = function (sources, resultSelector, thisArg) {
+ return enumerableOf(sources, resultSelector, thisArg).concat();
+ };
+
+ /**
+ * Repeats source as long as condition holds emulating a while loop.
+ * There is an alias for this method called 'whileDo' for browsers <IE9
+ *
+ * @param {Function} condition The condition which determines if the source will be repeated.
+ * @param {Observable} source The observable sequence that will be run if the condition function returns true.
+ * @returns {Observable} An observable sequence which is repeated as long as the condition holds.
+ */
+ var observableWhileDo = Observable['while'] = Observable.whileDo = function (condition, source) {
+ isPromise(source) && (source = observableFromPromise(source));
+ return enumerableWhile(condition, source).concat();
+ };
+
+ /**
+ * Repeats source as long as condition holds emulating a do while loop.
+ *
+ * @param {Function} condition The condition which determines if the source will be repeated.
+ * @param {Observable} source The observable sequence that will be run if the condition function returns true.
+ * @returns {Observable} An observable sequence which is repeated as long as the condition holds.
+ */
+ observableProto.doWhile = function (condition) {
+ return observableConcat([this, observableWhileDo(condition, this)]);
+ };
+
+ /**
+ * Uses selector to determine which source in sources to use.
+ * There is an alias 'switchCase' for browsers <IE9.
+ *
+ * @example
+ * 1 - res = Rx.Observable.case(selector, { '1': obs1, '2': obs2 });
+ * 1 - res = Rx.Observable.case(selector, { '1': obs1, '2': obs2 }, obs0);
+ * 1 - res = Rx.Observable.case(selector, { '1': obs1, '2': obs2 }, scheduler);
+ *
+ * @param {Function} selector The function which extracts the value for to test in a case statement.
+ * @param {Array} sources A object which has keys which correspond to the case statement labels.
+ * @param {Observable} [elseSource] The observable sequence or Promise that will be run if the sources are not matched. If this is not provided, it defaults to Rx.Observabe.empty with the specified scheduler.
+ *
+ * @returns {Observable} An observable sequence which is determined by a case statement.
+ */
+ Observable['case'] = Observable.switchCase = function (selector, sources, defaultSourceOrScheduler) {
+ return observableDefer(function () {
+ isPromise(defaultSourceOrScheduler) && (defaultSourceOrScheduler = observableFromPromise(defaultSourceOrScheduler));
+ defaultSourceOrScheduler || (defaultSourceOrScheduler = observableEmpty());
+
+ typeof defaultSourceOrScheduler.now === 'function' && (defaultSourceOrScheduler = observableEmpty(defaultSourceOrScheduler));
+
+ var result = sources[selector()];
+ isPromise(result) && (result = observableFromPromise(result));
+
+ return result || defaultSourceOrScheduler;
+ });
+ };
+
+ /**
+ * Expands an observable sequence by recursively invoking selector.
+ *
+ * @param {Function} selector Selector function to invoke for each produced element, resulting in another sequence to which the selector will be invoked recursively again.
+ * @param {Scheduler} [scheduler] Scheduler on which to perform the expansion. If not provided, this defaults to the current thread scheduler.
+ * @returns {Observable} An observable sequence containing all the elements produced by the recursive expansion.
+ */
+ observableProto.expand = function (selector, scheduler) {
+ isScheduler(scheduler) || (scheduler = immediateScheduler);
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ var q = [],
+ m = new SerialDisposable(),
+ d = new CompositeDisposable(m),
+ activeCount = 0,
+ isAcquired = false;
+
+ var ensureActive = function () {
+ var isOwner = false;
+ if (q.length > 0) {
+ isOwner = !isAcquired;
+ isAcquired = true;
+ }
+ if (isOwner) {
+ m.setDisposable(scheduler.scheduleRecursive(function (self) {
+ var work;
+ if (q.length > 0) {
+ work = q.shift();
+ } else {
+ isAcquired = false;
+ return;
+ }
+ var m1 = new SingleAssignmentDisposable();
+ d.add(m1);
+ m1.setDisposable(work.subscribe(function (x) {
+ observer.onNext(x);
+ var result = null;
+ try {
+ result = selector(x);
+ } catch (e) {
+ observer.onError(e);
+ }
+ q.push(result);
+ activeCount++;
+ ensureActive();
+ }, observer.onError.bind(observer), function () {
+ d.remove(m1);
+ activeCount--;
+ if (activeCount === 0) {
+ observer.onCompleted();
+ }
+ }));
+ self();
+ }));
+ }
+ };
+
+ q.push(source);
+ activeCount++;
+ ensureActive();
+ return d;
+ }, this);
+ };
+
+ /**
+ * Runs all observable sequences in parallel and collect their last elements.
+ *
+ * @example
+ * 1 - res = Rx.Observable.forkJoin([obs1, obs2]);
+ * 1 - res = Rx.Observable.forkJoin(obs1, obs2, ...);
+ * @returns {Observable} An observable sequence with an array collecting the last elements of all the input sequences.
+ */
+ Observable.forkJoin = function () {
+ var allSources = [];
+ if (Array.isArray(arguments[0])) {
+ allSources = arguments[0];
+ } else {
+ for(var i = 0, len = arguments.length; i < len; i++) { allSources.push(arguments[i]); }
+ }
+ return new AnonymousObservable(function (subscriber) {
+ var count = allSources.length;
+ if (count === 0) {
+ subscriber.onCompleted();
+ return disposableEmpty;
+ }
+ var group = new CompositeDisposable(),
+ finished = false,
+ hasResults = new Array(count),
+ hasCompleted = new Array(count),
+ results = new Array(count);
+
+ for (var idx = 0; idx < count; idx++) {
+ (function (i) {
+ var source = allSources[i];
+ isPromise(source) && (source = observableFromPromise(source));
+ group.add(
+ source.subscribe(
+ function (value) {
+ if (!finished) {
+ hasResults[i] = true;
+ results[i] = value;
+ }
+ },
+ function (e) {
+ finished = true;
+ subscriber.onError(e);
+ group.dispose();
+ },
+ function () {
+ if (!finished) {
+ if (!hasResults[i]) {
+ subscriber.onCompleted();
+ return;
+ }
+ hasCompleted[i] = true;
+ for (var ix = 0; ix < count; ix++) {
+ if (!hasCompleted[ix]) { return; }
+ }
+ finished = true;
+ subscriber.onNext(results);
+ subscriber.onCompleted();
+ }
+ }));
+ })(idx);
+ }
+
+ return group;
+ });
+ };
+
+ /**
+ * Runs two observable sequences in parallel and combines their last elemenets.
+ *
+ * @param {Observable} second Second observable sequence.
+ * @param {Function} resultSelector Result selector function to invoke with the last elements of both sequences.
+ * @returns {Observable} An observable sequence with the result of calling the selector function with the last elements of both input sequences.
+ */
+ observableProto.forkJoin = function (second, resultSelector) {
+ var first = this;
+ return new AnonymousObservable(function (observer) {
+ var leftStopped = false, rightStopped = false,
+ hasLeft = false, hasRight = false,
+ lastLeft, lastRight,
+ leftSubscription = new SingleAssignmentDisposable(), rightSubscription = new SingleAssignmentDisposable();
+
+ isPromise(second) && (second = observableFromPromise(second));
+
+ leftSubscription.setDisposable(
+ first.subscribe(function (left) {
+ hasLeft = true;
+ lastLeft = left;
+ }, function (err) {
+ rightSubscription.dispose();
+ observer.onError(err);
+ }, function () {
+ leftStopped = true;
+ if (rightStopped) {
+ if (!hasLeft) {
+ observer.onCompleted();
+ } else if (!hasRight) {
+ observer.onCompleted();
+ } else {
+ var result;
+ try {
+ result = resultSelector(lastLeft, lastRight);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+ observer.onNext(result);
+ observer.onCompleted();
+ }
+ }
+ })
+ );
+
+ rightSubscription.setDisposable(
+ second.subscribe(function (right) {
+ hasRight = true;
+ lastRight = right;
+ }, function (err) {
+ leftSubscription.dispose();
+ observer.onError(err);
+ }, function () {
+ rightStopped = true;
+ if (leftStopped) {
+ if (!hasLeft) {
+ observer.onCompleted();
+ } else if (!hasRight) {
+ observer.onCompleted();
+ } else {
+ var result;
+ try {
+ result = resultSelector(lastLeft, lastRight);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+ observer.onNext(result);
+ observer.onCompleted();
+ }
+ }
+ })
+ );
+
+ return new CompositeDisposable(leftSubscription, rightSubscription);
+ }, first);
+ };
+
+ /**
+ * Comonadic bind operator.
+ * @param {Function} selector A transform function to apply to each element.
+ * @param {Object} scheduler Scheduler used to execute the operation. If not specified, defaults to the ImmediateScheduler.
+ * @returns {Observable} An observable sequence which results from the comonadic bind operation.
+ */
+ observableProto.manySelect = observableProto.extend = function (selector, scheduler) {
+ isScheduler(scheduler) || (scheduler = immediateScheduler);
+ var source = this;
+ return observableDefer(function () {
+ var chain;
+
+ return source
+ .map(function (x) {
+ var curr = new ChainObservable(x);
+
+ chain && chain.onNext(x);
+ chain = curr;
+
+ return curr;
+ })
+ .tap(
+ noop,
+ function (e) { chain && chain.onError(e); },
+ function () { chain && chain.onCompleted(); }
+ )
+ .observeOn(scheduler)
+ .map(selector);
+ }, source);
+ };
+
+ var ChainObservable = (function (__super__) {
+
+ function subscribe (observer) {
+ var self = this, g = new CompositeDisposable();
+ g.add(currentThreadScheduler.schedule(function () {
+ observer.onNext(self.head);
+ g.add(self.tail.mergeAll().subscribe(observer));
+ }));
+
+ return g;
+ }
+
+ inherits(ChainObservable, __super__);
+
+ function ChainObservable(head) {
+ __super__.call(this, subscribe);
+ this.head = head;
+ this.tail = new AsyncSubject();
+ }
+
+ addProperties(ChainObservable.prototype, Observer, {
+ onCompleted: function () {
+ this.onNext(Observable.empty());
+ },
+ onError: function (e) {
+ this.onNext(Observable.throwError(e));
+ },
+ onNext: function (v) {
+ this.tail.onNext(v);
+ this.tail.onCompleted();
+ }
+ });
+
+ return ChainObservable;
+
+ }(Observable));
+
+ /** @private */
+ var Map = root.Map || (function () {
+
+ function Map() {
+ this._keys = [];
+ this._values = [];
+ }
+
+ Map.prototype.get = function (key) {
+ var i = this._keys.indexOf(key);
+ return i !== -1 ? this._values[i] : undefined;
+ };
+
+ Map.prototype.set = function (key, value) {
+ var i = this._keys.indexOf(key);
+ i !== -1 && (this._values[i] = value);
+ this._values[this._keys.push(key) - 1] = value;
+ };
+
+ Map.prototype.forEach = function (callback, thisArg) {
+ for (var i = 0, len = this._keys.length; i < len; i++) {
+ callback.call(thisArg, this._values[i], this._keys[i]);
+ }
+ };
+
+ return Map;
+ }());
+
+ /**
+ * @constructor
+ * Represents a join pattern over observable sequences.
+ */
+ function Pattern(patterns) {
+ this.patterns = patterns;
+ }
+
+ /**
+ * Creates a pattern that matches the current plan matches and when the specified observable sequences has an available value.
+ * @param other Observable sequence to match in addition to the current pattern.
+ * @return {Pattern} Pattern object that matches when all observable sequences in the pattern have an available value.
+ */
+ Pattern.prototype.and = function (other) {
+ return new Pattern(this.patterns.concat(other));
+ };
+
+ /**
+ * Matches when all observable sequences in the pattern (specified using a chain of and operators) have an available value and projects the values.
+ * @param {Function} selector Selector that will be invoked with available values from the source sequences, in the same order of the sequences in the pattern.
+ * @return {Plan} Plan that produces the projected values, to be fed (with other plans) to the when operator.
+ */
+ Pattern.prototype.thenDo = function (selector) {
+ return new Plan(this, selector);
+ };
+
+ function Plan(expression, selector) {
+ this.expression = expression;
+ this.selector = selector;
+ }
+
+ Plan.prototype.activate = function (externalSubscriptions, observer, deactivate) {
+ var self = this;
+ var joinObservers = [];
+ for (var i = 0, len = this.expression.patterns.length; i < len; i++) {
+ joinObservers.push(planCreateObserver(externalSubscriptions, this.expression.patterns[i], observer.onError.bind(observer)));
+ }
+ var activePlan = new ActivePlan(joinObservers, function () {
+ var result;
+ try {
+ result = self.selector.apply(self, arguments);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+ observer.onNext(result);
+ }, function () {
+ for (var j = 0, jlen = joinObservers.length; j < jlen; j++) {
+ joinObservers[j].removeActivePlan(activePlan);
+ }
+ deactivate(activePlan);
+ });
+ for (i = 0, len = joinObservers.length; i < len; i++) {
+ joinObservers[i].addActivePlan(activePlan);
+ }
+ return activePlan;
+ };
+
+ function planCreateObserver(externalSubscriptions, observable, onError) {
+ var entry = externalSubscriptions.get(observable);
+ if (!entry) {
+ var observer = new JoinObserver(observable, onError);
+ externalSubscriptions.set(observable, observer);
+ return observer;
+ }
+ return entry;
+ }
+
+ function ActivePlan(joinObserverArray, onNext, onCompleted) {
+ this.joinObserverArray = joinObserverArray;
+ this.onNext = onNext;
+ this.onCompleted = onCompleted;
+ this.joinObservers = new Map();
+ for (var i = 0, len = this.joinObserverArray.length; i < len; i++) {
+ var joinObserver = this.joinObserverArray[i];
+ this.joinObservers.set(joinObserver, joinObserver);
+ }
+ }
+
+ ActivePlan.prototype.dequeue = function () {
+ this.joinObservers.forEach(function (v) { v.queue.shift(); });
+ };
+
+ ActivePlan.prototype.match = function () {
+ var i, len, hasValues = true;
+ for (i = 0, len = this.joinObserverArray.length; i < len; i++) {
+ if (this.joinObserverArray[i].queue.length === 0) {
+ hasValues = false;
+ break;
+ }
+ }
+ if (hasValues) {
+ var firstValues = [],
+ isCompleted = false;
+ for (i = 0, len = this.joinObserverArray.length; i < len; i++) {
+ firstValues.push(this.joinObserverArray[i].queue[0]);
+ this.joinObserverArray[i].queue[0].kind === 'C' && (isCompleted = true);
+ }
+ if (isCompleted) {
+ this.onCompleted();
+ } else {
+ this.dequeue();
+ var values = [];
+ for (i = 0, len = firstValues.length; i < firstValues.length; i++) {
+ values.push(firstValues[i].value);
+ }
+ this.onNext.apply(this, values);
+ }
+ }
+ };
+
+ var JoinObserver = (function (__super__) {
+ inherits(JoinObserver, __super__);
+
+ function JoinObserver(source, onError) {
+ __super__.call(this);
+ this.source = source;
+ this.onError = onError;
+ this.queue = [];
+ this.activePlans = [];
+ this.subscription = new SingleAssignmentDisposable();
+ this.isDisposed = false;
+ }
+
+ var JoinObserverPrototype = JoinObserver.prototype;
+
+ JoinObserverPrototype.next = function (notification) {
+ if (!this.isDisposed) {
+ if (notification.kind === 'E') {
+ return this.onError(notification.exception);
+ }
+ this.queue.push(notification);
+ var activePlans = this.activePlans.slice(0);
+ for (var i = 0, len = activePlans.length; i < len; i++) {
+ activePlans[i].match();
+ }
+ }
+ };
+
+ JoinObserverPrototype.error = noop;
+ JoinObserverPrototype.completed = noop;
+
+ JoinObserverPrototype.addActivePlan = function (activePlan) {
+ this.activePlans.push(activePlan);
+ };
+
+ JoinObserverPrototype.subscribe = function () {
+ this.subscription.setDisposable(this.source.materialize().subscribe(this));
+ };
+
+ JoinObserverPrototype.removeActivePlan = function (activePlan) {
+ this.activePlans.splice(this.activePlans.indexOf(activePlan), 1);
+ this.activePlans.length === 0 && this.dispose();
+ };
+
+ JoinObserverPrototype.dispose = function () {
+ __super__.prototype.dispose.call(this);
+ if (!this.isDisposed) {
+ this.isDisposed = true;
+ this.subscription.dispose();
+ }
+ };
+
+ return JoinObserver;
+ } (AbstractObserver));
+
+ /**
+ * Creates a pattern that matches when both observable sequences have an available value.
+ *
+ * @param right Observable sequence to match with the current sequence.
+ * @return {Pattern} Pattern object that matches when both observable sequences have an available value.
+ */
+ observableProto.and = function (right) {
+ return new Pattern([this, right]);
+ };
+
+ /**
+ * Matches when the observable sequence has an available value and projects the value.
+ *
+ * @param {Function} selector Selector that will be invoked for values in the source sequence.
+ * @returns {Plan} Plan that produces the projected values, to be fed (with other plans) to the when operator.
+ */
+ observableProto.thenDo = function (selector) {
+ return new Pattern([this]).thenDo(selector);
+ };
+
+ /**
+ * Joins together the results from several patterns.
+ *
+ * @param plans A series of plans (specified as an Array of as a series of arguments) created by use of the Then operator on patterns.
+ * @returns {Observable} Observable sequence with the results form matching several patterns.
+ */
+ Observable.when = function () {
+ var len = arguments.length, plans;
+ if (Array.isArray(arguments[0])) {
+ plans = arguments[0];
+ } else {
+ plans = new Array(len);
+ for(var i = 0; i < len; i++) { plans[i] = arguments[i]; }
+ }
+ return new AnonymousObservable(function (o) {
+ var activePlans = [],
+ externalSubscriptions = new Map();
+ var outObserver = observerCreate(
+ function (x) { o.onNext(x); },
+ function (err) {
+ externalSubscriptions.forEach(function (v) { v.onError(err); });
+ o.onError(err);
+ },
+ function (x) { o.onCompleted(); }
+ );
+ try {
+ for (var i = 0, len = plans.length; i < len; i++) {
+ activePlans.push(plans[i].activate(externalSubscriptions, outObserver, function (activePlan) {
+ var idx = activePlans.indexOf(activePlan);
+ activePlans.splice(idx, 1);
+ activePlans.length === 0 && o.onCompleted();
+ }));
+ }
+ } catch (e) {
+ observableThrow(e).subscribe(o);
+ }
+ var group = new CompositeDisposable();
+ externalSubscriptions.forEach(function (joinObserver) {
+ joinObserver.subscribe();
+ group.add(joinObserver);
+ });
+
+ return group;
+ });
+ };
+
+ function observableTimerDate(dueTime, scheduler) {
+ return new AnonymousObservable(function (observer) {
+ return scheduler.scheduleWithAbsolute(dueTime, function () {
+ observer.onNext(0);
+ observer.onCompleted();
+ });
+ });
+ }
+
+ function observableTimerDateAndPeriod(dueTime, period, scheduler) {
+ return new AnonymousObservable(function (observer) {
+ var d = dueTime, p = normalizeTime(period);
+ return scheduler.scheduleRecursiveWithAbsoluteAndState(0, d, function (count, self) {
+ if (p > 0) {
+ var now = scheduler.now();
+ d = d + p;
+ d <= now && (d = now + p);
+ }
+ observer.onNext(count);
+ self(count + 1, d);
+ });
+ });
+ }
+
+ function observableTimerTimeSpan(dueTime, scheduler) {
+ return new AnonymousObservable(function (observer) {
+ return scheduler.scheduleWithRelative(normalizeTime(dueTime), function () {
+ observer.onNext(0);
+ observer.onCompleted();
+ });
+ });
+ }
+
+ function observableTimerTimeSpanAndPeriod(dueTime, period, scheduler) {
+ return dueTime === period ?
+ new AnonymousObservable(function (observer) {
+ return scheduler.schedulePeriodicWithState(0, period, function (count) {
+ observer.onNext(count);
+ return count + 1;
+ });
+ }) :
+ observableDefer(function () {
+ return observableTimerDateAndPeriod(scheduler.now() + dueTime, period, scheduler);
+ });
+ }
+
+ /**
+ * Returns an observable sequence that produces a value after each period.
+ *
+ * @example
+ * 1 - res = Rx.Observable.interval(1000);
+ * 2 - res = Rx.Observable.interval(1000, Rx.Scheduler.timeout);
+ *
+ * @param {Number} period Period for producing the values in the resulting sequence (specified as an integer denoting milliseconds).
+ * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, Rx.Scheduler.timeout is used.
+ * @returns {Observable} An observable sequence that produces a value after each period.
+ */
+ var observableinterval = Observable.interval = function (period, scheduler) {
+ return observableTimerTimeSpanAndPeriod(period, period, isScheduler(scheduler) ? scheduler : timeoutScheduler);
+ };
+
+ /**
+ * Returns an observable sequence that produces a value after dueTime has elapsed and then after each period.
+ * @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) at which to produce the first value.
+ * @param {Mixed} [periodOrScheduler] Period to produce subsequent values (specified as an integer denoting milliseconds), or the scheduler to run the timer on. If not specified, the resulting timer is not recurring.
+ * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, the timeout scheduler is used.
+ * @returns {Observable} An observable sequence that produces a value after due time has elapsed and then each period.
+ */
+ var observableTimer = Observable.timer = function (dueTime, periodOrScheduler, scheduler) {
+ var period;
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ if (periodOrScheduler !== undefined && typeof periodOrScheduler === 'number') {
+ period = periodOrScheduler;
+ } else if (isScheduler(periodOrScheduler)) {
+ scheduler = periodOrScheduler;
+ }
+ if (dueTime instanceof Date && period === undefined) {
+ return observableTimerDate(dueTime.getTime(), scheduler);
+ }
+ if (dueTime instanceof Date && period !== undefined) {
+ period = periodOrScheduler;
+ return observableTimerDateAndPeriod(dueTime.getTime(), period, scheduler);
+ }
+ return period === undefined ?
+ observableTimerTimeSpan(dueTime, scheduler) :
+ observableTimerTimeSpanAndPeriod(dueTime, period, scheduler);
+ };
+
+ function observableDelayTimeSpan(source, dueTime, scheduler) {
+ return new AnonymousObservable(function (observer) {
+ var active = false,
+ cancelable = new SerialDisposable(),
+ exception = null,
+ q = [],
+ running = false,
+ subscription;
+ subscription = source.materialize().timestamp(scheduler).subscribe(function (notification) {
+ var d, shouldRun;
+ if (notification.value.kind === 'E') {
+ q = [];
+ q.push(notification);
+ exception = notification.value.exception;
+ shouldRun = !running;
+ } else {
+ q.push({ value: notification.value, timestamp: notification.timestamp + dueTime });
+ shouldRun = !active;
+ active = true;
+ }
+ if (shouldRun) {
+ if (exception !== null) {
+ observer.onError(exception);
+ } else {
+ d = new SingleAssignmentDisposable();
+ cancelable.setDisposable(d);
+ d.setDisposable(scheduler.scheduleRecursiveWithRelative(dueTime, function (self) {
+ var e, recurseDueTime, result, shouldRecurse;
+ if (exception !== null) {
+ return;
+ }
+ running = true;
+ do {
+ result = null;
+ if (q.length > 0 && q[0].timestamp - scheduler.now() <= 0) {
+ result = q.shift().value;
+ }
+ if (result !== null) {
+ result.accept(observer);
+ }
+ } while (result !== null);
+ shouldRecurse = false;
+ recurseDueTime = 0;
+ if (q.length > 0) {
+ shouldRecurse = true;
+ recurseDueTime = Math.max(0, q[0].timestamp - scheduler.now());
+ } else {
+ active = false;
+ }
+ e = exception;
+ running = false;
+ if (e !== null) {
+ observer.onError(e);
+ } else if (shouldRecurse) {
+ self(recurseDueTime);
+ }
+ }));
+ }
+ }
+ });
+ return new CompositeDisposable(subscription, cancelable);
+ }, source);
+ }
+
+ function observableDelayDate(source, dueTime, scheduler) {
+ return observableDefer(function () {
+ return observableDelayTimeSpan(source, dueTime - scheduler.now(), scheduler);
+ });
+ }
+
+ /**
+ * Time shifts the observable sequence by dueTime. The relative time intervals between the values are preserved.
+ *
+ * @example
+ * 1 - res = Rx.Observable.delay(new Date());
+ * 2 - res = Rx.Observable.delay(new Date(), Rx.Scheduler.timeout);
+ *
+ * 3 - res = Rx.Observable.delay(5000);
+ * 4 - res = Rx.Observable.delay(5000, 1000, Rx.Scheduler.timeout);
+ * @memberOf Observable#
+ * @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) by which to shift the observable sequence.
+ * @param {Scheduler} [scheduler] Scheduler to run the delay timers on. If not specified, the timeout scheduler is used.
+ * @returns {Observable} Time-shifted sequence.
+ */
+ observableProto.delay = function (dueTime, scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return dueTime instanceof Date ?
+ observableDelayDate(this, dueTime.getTime(), scheduler) :
+ observableDelayTimeSpan(this, dueTime, scheduler);
+ };
+
+ /**
+ * Ignores values from an observable sequence which are followed by another value before dueTime.
+ * @param {Number} dueTime Duration of the debounce period for each value (specified as an integer denoting milliseconds).
+ * @param {Scheduler} [scheduler] Scheduler to run the debounce timers on. If not specified, the timeout scheduler is used.
+ * @returns {Observable} The debounced sequence.
+ */
+ observableProto.debounce = observableProto.throttleWithTimeout = function (dueTime, scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ var cancelable = new SerialDisposable(), hasvalue = false, value, id = 0;
+ var subscription = source.subscribe(
+ function (x) {
+ hasvalue = true;
+ value = x;
+ id++;
+ var currentId = id,
+ d = new SingleAssignmentDisposable();
+ cancelable.setDisposable(d);
+ d.setDisposable(scheduler.scheduleWithRelative(dueTime, function () {
+ hasvalue && id === currentId && observer.onNext(value);
+ hasvalue = false;
+ }));
+ },
+ function (e) {
+ cancelable.dispose();
+ observer.onError(e);
+ hasvalue = false;
+ id++;
+ },
+ function () {
+ cancelable.dispose();
+ hasvalue && observer.onNext(value);
+ observer.onCompleted();
+ hasvalue = false;
+ id++;
+ });
+ return new CompositeDisposable(subscription, cancelable);
+ }, this);
+ };
+
+ /**
+ * @deprecated use #debounce or #throttleWithTimeout instead.
+ */
+ observableProto.throttle = function(dueTime, scheduler) {
+ //deprecate('throttle', 'debounce or throttleWithTimeout');
+ return this.debounce(dueTime, scheduler);
+ };
+
+ /**
+ * Projects each element of an observable sequence into zero or more windows which are produced based on timing information.
+ * @param {Number} timeSpan Length of each window (specified as an integer denoting milliseconds).
+ * @param {Mixed} [timeShiftOrScheduler] Interval between creation of consecutive windows (specified as an integer denoting milliseconds), or an optional scheduler parameter. If not specified, the time shift corresponds to the timeSpan parameter, resulting in non-overlapping adjacent windows.
+ * @param {Scheduler} [scheduler] Scheduler to run windowing timers on. If not specified, the timeout scheduler is used.
+ * @returns {Observable} An observable sequence of windows.
+ */
+ observableProto.windowWithTime = function (timeSpan, timeShiftOrScheduler, scheduler) {
+ var source = this, timeShift;
+ timeShiftOrScheduler == null && (timeShift = timeSpan);
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ if (typeof timeShiftOrScheduler === 'number') {
+ timeShift = timeShiftOrScheduler;
+ } else if (isScheduler(timeShiftOrScheduler)) {
+ timeShift = timeSpan;
+ scheduler = timeShiftOrScheduler;
+ }
+ return new AnonymousObservable(function (observer) {
+ var groupDisposable,
+ nextShift = timeShift,
+ nextSpan = timeSpan,
+ q = [],
+ refCountDisposable,
+ timerD = new SerialDisposable(),
+ totalTime = 0;
+ groupDisposable = new CompositeDisposable(timerD),
+ refCountDisposable = new RefCountDisposable(groupDisposable);
+
+ function createTimer () {
+ var m = new SingleAssignmentDisposable(),
+ isSpan = false,
+ isShift = false;
+ timerD.setDisposable(m);
+ if (nextSpan === nextShift) {
+ isSpan = true;
+ isShift = true;
+ } else if (nextSpan < nextShift) {
+ isSpan = true;
+ } else {
+ isShift = true;
+ }
+ var newTotalTime = isSpan ? nextSpan : nextShift,
+ ts = newTotalTime - totalTime;
+ totalTime = newTotalTime;
+ if (isSpan) {
+ nextSpan += timeShift;
+ }
+ if (isShift) {
+ nextShift += timeShift;
+ }
+ m.setDisposable(scheduler.scheduleWithRelative(ts, function () {
+ if (isShift) {
+ var s = new Subject();
+ q.push(s);
+ observer.onNext(addRef(s, refCountDisposable));
+ }
+ isSpan && q.shift().onCompleted();
+ createTimer();
+ }));
+ };
+ q.push(new Subject());
+ observer.onNext(addRef(q[0], refCountDisposable));
+ createTimer();
+ groupDisposable.add(source.subscribe(
+ function (x) {
+ for (var i = 0, len = q.length; i < len; i++) { q[i].onNext(x); }
+ },
+ function (e) {
+ for (var i = 0, len = q.length; i < len; i++) { q[i].onError(e); }
+ observer.onError(e);
+ },
+ function () {
+ for (var i = 0, len = q.length; i < len; i++) { q[i].onCompleted(); }
+ observer.onCompleted();
+ }
+ ));
+ return refCountDisposable;
+ }, source);
+ };
+
+ /**
+ * Projects each element of an observable sequence into a window that is completed when either it's full or a given amount of time has elapsed.
+ * @param {Number} timeSpan Maximum time length of a window.
+ * @param {Number} count Maximum element count of a window.
+ * @param {Scheduler} [scheduler] Scheduler to run windowing timers on. If not specified, the timeout scheduler is used.
+ * @returns {Observable} An observable sequence of windows.
+ */
+ observableProto.windowWithTimeOrCount = function (timeSpan, count, scheduler) {
+ var source = this;
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return new AnonymousObservable(function (observer) {
+ var timerD = new SerialDisposable(),
+ groupDisposable = new CompositeDisposable(timerD),
+ refCountDisposable = new RefCountDisposable(groupDisposable),
+ n = 0,
+ windowId = 0,
+ s = new Subject();
+
+ function createTimer(id) {
+ var m = new SingleAssignmentDisposable();
+ timerD.setDisposable(m);
+ m.setDisposable(scheduler.scheduleWithRelative(timeSpan, function () {
+ if (id !== windowId) { return; }
+ n = 0;
+ var newId = ++windowId;
+ s.onCompleted();
+ s = new Subject();
+ observer.onNext(addRef(s, refCountDisposable));
+ createTimer(newId);
+ }));
+ }
+
+ observer.onNext(addRef(s, refCountDisposable));
+ createTimer(0);
+
+ groupDisposable.add(source.subscribe(
+ function (x) {
+ var newId = 0, newWindow = false;
+ s.onNext(x);
+ if (++n === count) {
+ newWindow = true;
+ n = 0;
+ newId = ++windowId;
+ s.onCompleted();
+ s = new Subject();
+ observer.onNext(addRef(s, refCountDisposable));
+ }
+ newWindow && createTimer(newId);
+ },
+ function (e) {
+ s.onError(e);
+ observer.onError(e);
+ }, function () {
+ s.onCompleted();
+ observer.onCompleted();
+ }
+ ));
+ return refCountDisposable;
+ }, source);
+ };
+
+ /**
+ * Projects each element of an observable sequence into zero or more buffers which are produced based on timing information.
+ *
+ * @example
+ * 1 - res = xs.bufferWithTime(1000, scheduler); // non-overlapping segments of 1 second
+ * 2 - res = xs.bufferWithTime(1000, 500, scheduler; // segments of 1 second with time shift 0.5 seconds
+ *
+ * @param {Number} timeSpan Length of each buffer (specified as an integer denoting milliseconds).
+ * @param {Mixed} [timeShiftOrScheduler] Interval between creation of consecutive buffers (specified as an integer denoting milliseconds), or an optional scheduler parameter. If not specified, the time shift corresponds to the timeSpan parameter, resulting in non-overlapping adjacent buffers.
+ * @param {Scheduler} [scheduler] Scheduler to run buffer timers on. If not specified, the timeout scheduler is used.
+ * @returns {Observable} An observable sequence of buffers.
+ */
+ observableProto.bufferWithTime = function (timeSpan, timeShiftOrScheduler, scheduler) {
+ return this.windowWithTime.apply(this, arguments).selectMany(function (x) { return x.toArray(); });
+ };
+
+ /**
+ * Projects each element of an observable sequence into a buffer that is completed when either it's full or a given amount of time has elapsed.
+ *
+ * @example
+ * 1 - res = source.bufferWithTimeOrCount(5000, 50); // 5s or 50 items in an array
+ * 2 - res = source.bufferWithTimeOrCount(5000, 50, scheduler); // 5s or 50 items in an array
+ *
+ * @param {Number} timeSpan Maximum time length of a buffer.
+ * @param {Number} count Maximum element count of a buffer.
+ * @param {Scheduler} [scheduler] Scheduler to run bufferin timers on. If not specified, the timeout scheduler is used.
+ * @returns {Observable} An observable sequence of buffers.
+ */
+ observableProto.bufferWithTimeOrCount = function (timeSpan, count, scheduler) {
+ return this.windowWithTimeOrCount(timeSpan, count, scheduler).selectMany(function (x) {
+ return x.toArray();
+ });
+ };
+
+ /**
+ * Records the time interval between consecutive values in an observable sequence.
+ *
+ * @example
+ * 1 - res = source.timeInterval();
+ * 2 - res = source.timeInterval(Rx.Scheduler.timeout);
+ *
+ * @param [scheduler] Scheduler used to compute time intervals. If not specified, the timeout scheduler is used.
+ * @returns {Observable} An observable sequence with time interval information on values.
+ */
+ observableProto.timeInterval = function (scheduler) {
+ var source = this;
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return observableDefer(function () {
+ var last = scheduler.now();
+ return source.map(function (x) {
+ var now = scheduler.now(), span = now - last;
+ last = now;
+ return { value: x, interval: span };
+ });
+ });
+ };
+
+ /**
+ * Records the timestamp for each value in an observable sequence.
+ *
+ * @example
+ * 1 - res = source.timestamp(); // produces { value: x, timestamp: ts }
+ * 2 - res = source.timestamp(Rx.Scheduler.default);
+ *
+ * @param {Scheduler} [scheduler] Scheduler used to compute timestamps. If not specified, the default scheduler is used.
+ * @returns {Observable} An observable sequence with timestamp information on values.
+ */
+ observableProto.timestamp = function (scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return this.map(function (x) {
+ return { value: x, timestamp: scheduler.now() };
+ });
+ };
+
+ function sampleObservable(source, sampler) {
+ return new AnonymousObservable(function (o) {
+ var atEnd = false, value, hasValue = false;
+
+ function sampleSubscribe() {
+ if (hasValue) {
+ hasValue = false;
+ o.onNext(value);
+ }
+ atEnd && o.onCompleted();
+ }
+
+ var sourceSubscription = new SingleAssignmentDisposable();
+ sourceSubscription.setDisposable(source.subscribe(
+ function (newValue) {
+ hasValue = true;
+ value = newValue;
+ },
+ function (e) { o.onError(e); },
+ function () {
+ atEnd = true;
+ sourceSubscription.dispose();
+ }
+ ));
+
+ return new CompositeDisposable(
+ sourceSubscription,
+ sampler.subscribe(sampleSubscribe, function (e) { o.onError(e); }, sampleSubscribe)
+ );
+ }, source);
+ }
+
+ /**
+ * Samples the observable sequence at each interval.
+ *
+ * @example
+ * 1 - res = source.sample(sampleObservable); // Sampler tick sequence
+ * 2 - res = source.sample(5000); // 5 seconds
+ * 2 - res = source.sample(5000, Rx.Scheduler.timeout); // 5 seconds
+ *
+ * @param {Mixed} intervalOrSampler Interval at which to sample (specified as an integer denoting milliseconds) or Sampler Observable.
+ * @param {Scheduler} [scheduler] Scheduler to run the sampling timer on. If not specified, the timeout scheduler is used.
+ * @returns {Observable} Sampled observable sequence.
+ */
+ observableProto.sample = observableProto.throttleLatest = function (intervalOrSampler, scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return typeof intervalOrSampler === 'number' ?
+ sampleObservable(this, observableinterval(intervalOrSampler, scheduler)) :
+ sampleObservable(this, intervalOrSampler);
+ };
+
+ /**
+ * Returns the source observable sequence or the other observable sequence if dueTime elapses.
+ * @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) when a timeout occurs.
+ * @param {Observable} [other] Sequence to return in case of a timeout. If not specified, a timeout error throwing sequence will be used.
+ * @param {Scheduler} [scheduler] Scheduler to run the timeout timers on. If not specified, the timeout scheduler is used.
+ * @returns {Observable} The source sequence switching to the other sequence in case of a timeout.
+ */
+ observableProto.timeout = function (dueTime, other, scheduler) {
+ (other == null || typeof other === 'string') && (other = observableThrow(new Error(other || 'Timeout')));
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+
+ var source = this, schedulerMethod = dueTime instanceof Date ?
+ 'scheduleWithAbsolute' :
+ 'scheduleWithRelative';
+
+ return new AnonymousObservable(function (observer) {
+ var id = 0,
+ original = new SingleAssignmentDisposable(),
+ subscription = new SerialDisposable(),
+ switched = false,
+ timer = new SerialDisposable();
+
+ subscription.setDisposable(original);
+
+ function createTimer() {
+ var myId = id;
+ timer.setDisposable(scheduler[schedulerMethod](dueTime, function () {
+ if (id === myId) {
+ isPromise(other) && (other = observableFromPromise(other));
+ subscription.setDisposable(other.subscribe(observer));
+ }
+ }));
+ }
+
+ createTimer();
+
+ original.setDisposable(source.subscribe(function (x) {
+ if (!switched) {
+ id++;
+ observer.onNext(x);
+ createTimer();
+ }
+ }, function (e) {
+ if (!switched) {
+ id++;
+ observer.onError(e);
+ }
+ }, function () {
+ if (!switched) {
+ id++;
+ observer.onCompleted();
+ }
+ }));
+ return new CompositeDisposable(subscription, timer);
+ }, source);
+ };
+
+ /**
+ * Generates an observable sequence by iterating a state from an initial state until the condition fails.
+ *
+ * @example
+ * res = source.generateWithAbsoluteTime(0,
+ * function (x) { return return true; },
+ * function (x) { return x + 1; },
+ * function (x) { return x; },
+ * function (x) { return new Date(); }
+ * });
+ *
+ * @param {Mixed} initialState Initial state.
+ * @param {Function} condition Condition to terminate generation (upon returning false).
+ * @param {Function} iterate Iteration step function.
+ * @param {Function} resultSelector Selector function for results produced in the sequence.
+ * @param {Function} timeSelector Time selector function to control the speed of values being produced each iteration, returning Date values.
+ * @param {Scheduler} [scheduler] Scheduler on which to run the generator loop. If not specified, the timeout scheduler is used.
+ * @returns {Observable} The generated sequence.
+ */
+ Observable.generateWithAbsoluteTime = function (initialState, condition, iterate, resultSelector, timeSelector, scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return new AnonymousObservable(function (observer) {
+ var first = true,
+ hasResult = false;
+ return scheduler.scheduleRecursiveWithAbsoluteAndState(initialState, scheduler.now(), function (state, self) {
+ hasResult && observer.onNext(state);
+
+ try {
+ if (first) {
+ first = false;
+ } else {
+ state = iterate(state);
+ }
+ hasResult = condition(state);
+ if (hasResult) {
+ var result = resultSelector(state);
+ var time = timeSelector(state);
+ }
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+ if (hasResult) {
+ self(result, time);
+ } else {
+ observer.onCompleted();
+ }
+ });
+ });
+ };
+
+ /**
+ * Generates an observable sequence by iterating a state from an initial state until the condition fails.
+ *
+ * @example
+ * res = source.generateWithRelativeTime(0,
+ * function (x) { return return true; },
+ * function (x) { return x + 1; },
+ * function (x) { return x; },
+ * function (x) { return 500; }
+ * );
+ *
+ * @param {Mixed} initialState Initial state.
+ * @param {Function} condition Condition to terminate generation (upon returning false).
+ * @param {Function} iterate Iteration step function.
+ * @param {Function} resultSelector Selector function for results produced in the sequence.
+ * @param {Function} timeSelector Time selector function to control the speed of values being produced each iteration, returning integer values denoting milliseconds.
+ * @param {Scheduler} [scheduler] Scheduler on which to run the generator loop. If not specified, the timeout scheduler is used.
+ * @returns {Observable} The generated sequence.
+ */
+ Observable.generateWithRelativeTime = function (initialState, condition, iterate, resultSelector, timeSelector, scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return new AnonymousObservable(function (observer) {
+ var first = true,
+ hasResult = false;
+ return scheduler.scheduleRecursiveWithRelativeAndState(initialState, 0, function (state, self) {
+ hasResult && observer.onNext(state);
+
+ try {
+ if (first) {
+ first = false;
+ } else {
+ state = iterate(state);
+ }
+ hasResult = condition(state);
+ if (hasResult) {
+ var result = resultSelector(state);
+ var time = timeSelector(state);
+ }
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+ if (hasResult) {
+ self(result, time);
+ } else {
+ observer.onCompleted();
+ }
+ });
+ });
+ };
+
+ /**
+ * Time shifts the observable sequence by delaying the subscription with the specified relative time duration, using the specified scheduler to run timers.
+ *
+ * @example
+ * 1 - res = source.delaySubscription(5000); // 5s
+ * 2 - res = source.delaySubscription(5000, Rx.Scheduler.default); // 5 seconds
+ *
+ * @param {Number} dueTime Relative or absolute time shift of the subscription.
+ * @param {Scheduler} [scheduler] Scheduler to run the subscription delay timer on. If not specified, the timeout scheduler is used.
+ * @returns {Observable} Time-shifted sequence.
+ */
+ observableProto.delaySubscription = function (dueTime, scheduler) {
+ var scheduleMethod = dueTime instanceof Date ? 'scheduleWithAbsolute' : 'scheduleWithRelative';
+ var source = this;
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return new AnonymousObservable(function (o) {
+ var d = new SerialDisposable();
+
+ d.setDisposable(scheduler[scheduleMethod](dueTime, function() {
+ d.setDisposable(source.subscribe(o));
+ }));
+
+ return d;
+ }, this);
+ };
+
+ /**
+ * Time shifts the observable sequence based on a subscription delay and a delay selector function for each element.
+ *
+ * @example
+ * 1 - res = source.delayWithSelector(function (x) { return Rx.Scheduler.timer(5000); }); // with selector only
+ * 1 - res = source.delayWithSelector(Rx.Observable.timer(2000), function (x) { return Rx.Observable.timer(x); }); // with delay and selector
+ *
+ * @param {Observable} [subscriptionDelay] Sequence indicating the delay for the subscription to the source.
+ * @param {Function} delayDurationSelector Selector function to retrieve a sequence indicating the delay for each given element.
+ * @returns {Observable} Time-shifted sequence.
+ */
+ observableProto.delayWithSelector = function (subscriptionDelay, delayDurationSelector) {
+ var source = this, subDelay, selector;
+ if (isFunction(subscriptionDelay)) {
+ selector = subscriptionDelay;
+ } else {
+ subDelay = subscriptionDelay;
+ selector = delayDurationSelector;
+ }
+ return new AnonymousObservable(function (observer) {
+ var delays = new CompositeDisposable(), atEnd = false, subscription = new SerialDisposable();
+
+ function start() {
+ subscription.setDisposable(source.subscribe(
+ function (x) {
+ var delay = tryCatch(selector)(x);
+ if (delay === errorObj) { return observer.onError(delay.e); }
+ var d = new SingleAssignmentDisposable();
+ delays.add(d);
+ d.setDisposable(delay.subscribe(
+ function () {
+ observer.onNext(x);
+ delays.remove(d);
+ done();
+ },
+ function (e) { observer.onError(e); },
+ function () {
+ observer.onNext(x);
+ delays.remove(d);
+ done();
+ }
+ ))
+ },
+ function (e) { observer.onError(e); },
+ function () {
+ atEnd = true;
+ subscription.dispose();
+ done();
+ }
+ ))
+ }
+
+ function done () {
+ atEnd && delays.length === 0 && observer.onCompleted();
+ }
+
+ if (!subDelay) {
+ start();
+ } else {
+ subscription.setDisposable(subDelay.subscribe(start, function (e) { observer.onError(e); }, start));
+ }
+
+ return new CompositeDisposable(subscription, delays);
+ }, this);
+ };
+
+ /**
+ * Returns the source observable sequence, switching to the other observable sequence if a timeout is signaled.
+ * @param {Observable} [firstTimeout] Observable sequence that represents the timeout for the first element. If not provided, this defaults to Observable.never().
+ * @param {Function} timeoutDurationSelector Selector to retrieve an observable sequence that represents the timeout between the current element and the next element.
+ * @param {Observable} [other] Sequence to return in case of a timeout. If not provided, this is set to Observable.throwException().
+ * @returns {Observable} The source sequence switching to the other sequence in case of a timeout.
+ */
+ observableProto.timeoutWithSelector = function (firstTimeout, timeoutdurationSelector, other) {
+ if (arguments.length === 1) {
+ timeoutdurationSelector = firstTimeout;
+ firstTimeout = observableNever();
+ }
+ other || (other = observableThrow(new Error('Timeout')));
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ var subscription = new SerialDisposable(), timer = new SerialDisposable(), original = new SingleAssignmentDisposable();
+
+ subscription.setDisposable(original);
+
+ var id = 0, switched = false;
+
+ function setTimer(timeout) {
+ var myId = id;
+
+ function timerWins () {
+ return id === myId;
+ }
+
+ var d = new SingleAssignmentDisposable();
+ timer.setDisposable(d);
+ d.setDisposable(timeout.subscribe(function () {
+ timerWins() && subscription.setDisposable(other.subscribe(observer));
+ d.dispose();
+ }, function (e) {
+ timerWins() && observer.onError(e);
+ }, function () {
+ timerWins() && subscription.setDisposable(other.subscribe(observer));
+ }));
+ };
+
+ setTimer(firstTimeout);
+
+ function observerWins() {
+ var res = !switched;
+ if (res) { id++; }
+ return res;
+ }
+
+ original.setDisposable(source.subscribe(function (x) {
+ if (observerWins()) {
+ observer.onNext(x);
+ var timeout;
+ try {
+ timeout = timeoutdurationSelector(x);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+ setTimer(isPromise(timeout) ? observableFromPromise(timeout) : timeout);
+ }
+ }, function (e) {
+ observerWins() && observer.onError(e);
+ }, function () {
+ observerWins() && observer.onCompleted();
+ }));
+ return new CompositeDisposable(subscription, timer);
+ }, source);
+ };
+
+ /**
+ * Ignores values from an observable sequence which are followed by another value within a computed throttle duration.
+ * @param {Function} durationSelector Selector function to retrieve a sequence indicating the throttle duration for each given element.
+ * @returns {Observable} The debounced sequence.
+ */
+ observableProto.debounceWithSelector = function (durationSelector) {
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ var value, hasValue = false, cancelable = new SerialDisposable(), id = 0;
+ var subscription = source.subscribe(function (x) {
+ var throttle;
+ try {
+ throttle = durationSelector(x);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+
+ isPromise(throttle) && (throttle = observableFromPromise(throttle));
+
+ hasValue = true;
+ value = x;
+ id++;
+ var currentid = id, d = new SingleAssignmentDisposable();
+ cancelable.setDisposable(d);
+ d.setDisposable(throttle.subscribe(function () {
+ hasValue && id === currentid && observer.onNext(value);
+ hasValue = false;
+ d.dispose();
+ }, observer.onError.bind(observer), function () {
+ hasValue && id === currentid && observer.onNext(value);
+ hasValue = false;
+ d.dispose();
+ }));
+ }, function (e) {
+ cancelable.dispose();
+ observer.onError(e);
+ hasValue = false;
+ id++;
+ }, function () {
+ cancelable.dispose();
+ hasValue && observer.onNext(value);
+ observer.onCompleted();
+ hasValue = false;
+ id++;
+ });
+ return new CompositeDisposable(subscription, cancelable);
+ }, source);
+ };
+
+ /**
+ * @deprecated use #debounceWithSelector instead.
+ */
+ observableProto.throttleWithSelector = function (durationSelector) {
+ //deprecate('throttleWithSelector', 'debounceWithSelector');
+ return this.debounceWithSelector(durationSelector);
+ };
+
+ /**
+ * Skips elements for the specified duration from the end of the observable source sequence, using the specified scheduler to run timers.
+ *
+ * 1 - res = source.skipLastWithTime(5000);
+ * 2 - res = source.skipLastWithTime(5000, scheduler);
+ *
+ * @description
+ * This operator accumulates a queue with a length enough to store elements received during the initial duration window.
+ * As more elements are received, elements older than the specified duration are taken from the queue and produced on the
+ * result sequence. This causes elements to be delayed with duration.
+ * @param {Number} duration Duration for skipping elements from the end of the sequence.
+ * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout
+ * @returns {Observable} An observable sequence with the elements skipped during the specified duration from the end of the source sequence.
+ */
+ observableProto.skipLastWithTime = function (duration, scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var q = [];
+ return source.subscribe(function (x) {
+ var now = scheduler.now();
+ q.push({ interval: now, value: x });
+ while (q.length > 0 && now - q[0].interval >= duration) {
+ o.onNext(q.shift().value);
+ }
+ }, function (e) { o.onError(e); }, function () {
+ var now = scheduler.now();
+ while (q.length > 0 && now - q[0].interval >= duration) {
+ o.onNext(q.shift().value);
+ }
+ o.onCompleted();
+ });
+ }, source);
+ };
+
+ /**
+ * Returns elements within the specified duration from the end of the observable source sequence, using the specified schedulers to run timers and to drain the collected elements.
+ * @description
+ * This operator accumulates a queue with a length enough to store elements received during the initial duration window.
+ * As more elements are received, elements older than the specified duration are taken from the queue and produced on the
+ * result sequence. This causes elements to be delayed with duration.
+ * @param {Number} duration Duration for taking elements from the end of the sequence.
+ * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout.
+ * @returns {Observable} An observable sequence with the elements taken during the specified duration from the end of the source sequence.
+ */
+ observableProto.takeLastWithTime = function (duration, scheduler) {
+ var source = this;
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return new AnonymousObservable(function (o) {
+ var q = [];
+ return source.subscribe(function (x) {
+ var now = scheduler.now();
+ q.push({ interval: now, value: x });
+ while (q.length > 0 && now - q[0].interval >= duration) {
+ q.shift();
+ }
+ }, function (e) { o.onError(e); }, function () {
+ var now = scheduler.now();
+ while (q.length > 0) {
+ var next = q.shift();
+ if (now - next.interval <= duration) { o.onNext(next.value); }
+ }
+ o.onCompleted();
+ });
+ }, source);
+ };
+
+ /**
+ * Returns an array with the elements within the specified duration from the end of the observable source sequence, using the specified scheduler to run timers.
+ * @description
+ * This operator accumulates a queue with a length enough to store elements received during the initial duration window.
+ * As more elements are received, elements older than the specified duration are taken from the queue and produced on the
+ * result sequence. This causes elements to be delayed with duration.
+ * @param {Number} duration Duration for taking elements from the end of the sequence.
+ * @param {Scheduler} scheduler Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout.
+ * @returns {Observable} An observable sequence containing a single array with the elements taken during the specified duration from the end of the source sequence.
+ */
+ observableProto.takeLastBufferWithTime = function (duration, scheduler) {
+ var source = this;
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return new AnonymousObservable(function (o) {
+ var q = [];
+ return source.subscribe(function (x) {
+ var now = scheduler.now();
+ q.push({ interval: now, value: x });
+ while (q.length > 0 && now - q[0].interval >= duration) {
+ q.shift();
+ }
+ }, function (e) { o.onError(e); }, function () {
+ var now = scheduler.now(), res = [];
+ while (q.length > 0) {
+ var next = q.shift();
+ now - next.interval <= duration && res.push(next.value);
+ }
+ o.onNext(res);
+ o.onCompleted();
+ });
+ }, source);
+ };
+
+ /**
+ * Takes elements for the specified duration from the start of the observable source sequence, using the specified scheduler to run timers.
+ *
+ * @example
+ * 1 - res = source.takeWithTime(5000, [optional scheduler]);
+ * @description
+ * This operator accumulates a queue with a length enough to store elements received during the initial duration window.
+ * As more elements are received, elements older than the specified duration are taken from the queue and produced on the
+ * result sequence. This causes elements to be delayed with duration.
+ * @param {Number} duration Duration for taking elements from the start of the sequence.
+ * @param {Scheduler} scheduler Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout.
+ * @returns {Observable} An observable sequence with the elements taken during the specified duration from the start of the source sequence.
+ */
+ observableProto.takeWithTime = function (duration, scheduler) {
+ var source = this;
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return new AnonymousObservable(function (o) {
+ return new CompositeDisposable(scheduler.scheduleWithRelative(duration, function () { o.onCompleted(); }), source.subscribe(o));
+ }, source);
+ };
+
+ /**
+ * Skips elements for the specified duration from the start of the observable source sequence, using the specified scheduler to run timers.
+ *
+ * @example
+ * 1 - res = source.skipWithTime(5000, [optional scheduler]);
+ *
+ * @description
+ * Specifying a zero value for duration doesn't guarantee no elements will be dropped from the start of the source sequence.
+ * This is a side-effect of the asynchrony introduced by the scheduler, where the action that causes callbacks from the source sequence to be forwarded
+ * may not execute immediately, despite the zero due time.
+ *
+ * Errors produced by the source sequence are always forwarded to the result sequence, even if the error occurs before the duration.
+ * @param {Number} duration Duration for skipping elements from the start of the sequence.
+ * @param {Scheduler} scheduler Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout.
+ * @returns {Observable} An observable sequence with the elements skipped during the specified duration from the start of the source sequence.
+ */
+ observableProto.skipWithTime = function (duration, scheduler) {
+ var source = this;
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return new AnonymousObservable(function (observer) {
+ var open = false;
+ return new CompositeDisposable(
+ scheduler.scheduleWithRelative(duration, function () { open = true; }),
+ source.subscribe(function (x) { open && observer.onNext(x); }, observer.onError.bind(observer), observer.onCompleted.bind(observer)));
+ }, source);
+ };
+
+ /**
+ * Skips elements from the observable source sequence until the specified start time, using the specified scheduler to run timers.
+ * Errors produced by the source sequence are always forwarded to the result sequence, even if the error occurs before the start time.
+ *
+ * @examples
+ * 1 - res = source.skipUntilWithTime(new Date(), [scheduler]);
+ * 2 - res = source.skipUntilWithTime(5000, [scheduler]);
+ * @param {Date|Number} startTime Time to start taking elements from the source sequence. If this value is less than or equal to Date(), no elements will be skipped.
+ * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout.
+ * @returns {Observable} An observable sequence with the elements skipped until the specified start time.
+ */
+ observableProto.skipUntilWithTime = function (startTime, scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ var source = this, schedulerMethod = startTime instanceof Date ?
+ 'scheduleWithAbsolute' :
+ 'scheduleWithRelative';
+ return new AnonymousObservable(function (o) {
+ var open = false;
+
+ return new CompositeDisposable(
+ scheduler[schedulerMethod](startTime, function () { open = true; }),
+ source.subscribe(
+ function (x) { open && o.onNext(x); },
+ function (e) { o.onError(e); }, function () { o.onCompleted(); }));
+ }, source);
+ };
+
+ /**
+ * Takes elements for the specified duration until the specified end time, using the specified scheduler to run timers.
+ * @param {Number | Date} endTime Time to stop taking elements from the source sequence. If this value is less than or equal to new Date(), the result stream will complete immediately.
+ * @param {Scheduler} [scheduler] Scheduler to run the timer on.
+ * @returns {Observable} An observable sequence with the elements taken until the specified end time.
+ */
+ observableProto.takeUntilWithTime = function (endTime, scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ var source = this, schedulerMethod = endTime instanceof Date ?
+ 'scheduleWithAbsolute' :
+ 'scheduleWithRelative';
+ return new AnonymousObservable(function (o) {
+ return new CompositeDisposable(
+ scheduler[schedulerMethod](endTime, function () { o.onCompleted(); }),
+ source.subscribe(o));
+ }, source);
+ };
+
+ /**
+ * Returns an Observable that emits only the first item emitted by the source Observable during sequential time windows of a specified duration.
+ * @param {Number} windowDuration time to wait before emitting another item after emitting the last item
+ * @param {Scheduler} [scheduler] the Scheduler to use internally to manage the timers that handle timeout for each item. If not provided, defaults to Scheduler.timeout.
+ * @returns {Observable} An Observable that performs the throttle operation.
+ */
+ observableProto.throttleFirst = function (windowDuration, scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ var duration = +windowDuration || 0;
+ if (duration <= 0) { throw new RangeError('windowDuration cannot be less or equal zero.'); }
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var lastOnNext = 0;
+ return source.subscribe(
+ function (x) {
+ var now = scheduler.now();
+ if (lastOnNext === 0 || now - lastOnNext >= duration) {
+ lastOnNext = now;
+ o.onNext(x);
+ }
+ },function (e) { o.onError(e); }, function () { o.onCompleted(); }
+ );
+ }, source);
+ };
+
+ /*
+ * Performs a exclusive waiting for the first to finish before subscribing to another observable.
+ * Observables that come in between subscriptions will be dropped on the floor.
+ * @returns {Observable} A exclusive observable with only the results that happen when subscribed.
+ */
+ observableProto.exclusive = function () {
+ var sources = this;
+ return new AnonymousObservable(function (observer) {
+ var hasCurrent = false,
+ isStopped = false,
+ m = new SingleAssignmentDisposable(),
+ g = new CompositeDisposable();
+
+ g.add(m);
+
+ m.setDisposable(sources.subscribe(
+ function (innerSource) {
+ if (!hasCurrent) {
+ hasCurrent = true;
+
+ isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
+
+ var innerSubscription = new SingleAssignmentDisposable();
+ g.add(innerSubscription);
+
+ innerSubscription.setDisposable(innerSource.subscribe(
+ observer.onNext.bind(observer),
+ observer.onError.bind(observer),
+ function () {
+ g.remove(innerSubscription);
+ hasCurrent = false;
+ if (isStopped && g.length === 1) {
+ observer.onCompleted();
+ }
+ }));
+ }
+ },
+ observer.onError.bind(observer),
+ function () {
+ isStopped = true;
+ if (!hasCurrent && g.length === 1) {
+ observer.onCompleted();
+ }
+ }));
+
+ return g;
+ }, this);
+ };
+
+ /*
+ * Performs a exclusive map waiting for the first to finish before subscribing to another observable.
+ * Observables that come in between subscriptions will be dropped on the floor.
+ * @param {Function} selector Selector to invoke for every item in the current subscription.
+ * @param {Any} [thisArg] An optional context to invoke with the selector parameter.
+ * @returns {Observable} An exclusive observable with only the results that happen when subscribed.
+ */
+ observableProto.exclusiveMap = function (selector, thisArg) {
+ var sources = this,
+ selectorFunc = bindCallback(selector, thisArg, 3);
+ return new AnonymousObservable(function (observer) {
+ var index = 0,
+ hasCurrent = false,
+ isStopped = true,
+ m = new SingleAssignmentDisposable(),
+ g = new CompositeDisposable();
+
+ g.add(m);
+
+ m.setDisposable(sources.subscribe(
+ function (innerSource) {
+
+ if (!hasCurrent) {
+ hasCurrent = true;
+
+ innerSubscription = new SingleAssignmentDisposable();
+ g.add(innerSubscription);
+
+ isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
+
+ innerSubscription.setDisposable(innerSource.subscribe(
+ function (x) {
+ var result;
+ try {
+ result = selectorFunc(x, index++, innerSource);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+
+ observer.onNext(result);
+ },
+ function (e) { observer.onError(e); },
+ function () {
+ g.remove(innerSubscription);
+ hasCurrent = false;
+
+ if (isStopped && g.length === 1) {
+ observer.onCompleted();
+ }
+ }));
+ }
+ },
+ function (e) { observer.onError(e); },
+ function () {
+ isStopped = true;
+ if (g.length === 1 && !hasCurrent) {
+ observer.onCompleted();
+ }
+ }));
+ return g;
+ }, this);
+ };
+
+ /**
+ * Executes a transducer to transform the observable sequence
+ * @param {Transducer} transducer A transducer to execute
+ * @returns {Observable} An Observable sequence containing the results from the transducer.
+ */
+ observableProto.transduce = function(transducer) {
+ var source = this;
+
+ function transformForObserver(o) {
+ return {
+ '@@transducer/init': function() {
+ return o;
+ },
+ '@@transducer/step': function(obs, input) {
+ return obs.onNext(input);
+ },
+ '@@transducer/result': function(obs) {
+ return obs.onCompleted();
+ }
+ };
+ }
+
+ return new AnonymousObservable(function(o) {
+ var xform = transducer(transformForObserver(o));
+ return source.subscribe(
+ function(v) {
+ try {
+ xform['@@transducer/step'](o, v);
+ } catch (e) {
+ o.onError(e);
+ }
+ },
+ function (e) { o.onError(e); },
+ function() { xform['@@transducer/result'](o); }
+ );
+ }, source);
+ };
+
+ /** Provides a set of extension methods for virtual time scheduling. */
+ Rx.VirtualTimeScheduler = (function (__super__) {
+
+ function localNow() {
+ return this.toDateTimeOffset(this.clock);
+ }
+
+ function scheduleNow(state, action) {
+ return this.scheduleAbsoluteWithState(state, this.clock, action);
+ }
+
+ function scheduleRelative(state, dueTime, action) {
+ return this.scheduleRelativeWithState(state, this.toRelative(dueTime), action);
+ }
+
+ function scheduleAbsolute(state, dueTime, action) {
+ return this.scheduleRelativeWithState(state, this.toRelative(dueTime - this.now()), action);
+ }
+
+ function invokeAction(scheduler, action) {
+ action();
+ return disposableEmpty;
+ }
+
+ inherits(VirtualTimeScheduler, __super__);
+
+ /**
+ * Creates a new virtual time scheduler with the specified initial clock value and absolute time comparer.
+ *
+ * @constructor
+ * @param {Number} initialClock Initial value for the clock.
+ * @param {Function} comparer Comparer to determine causality of events based on absolute time.
+ */
+ function VirtualTimeScheduler(initialClock, comparer) {
+ this.clock = initialClock;
+ this.comparer = comparer;
+ this.isEnabled = false;
+ this.queue = new PriorityQueue(1024);
+ __super__.call(this, localNow, scheduleNow, scheduleRelative, scheduleAbsolute);
+ }
+
+ var VirtualTimeSchedulerPrototype = VirtualTimeScheduler.prototype;
+
+ /**
+ * Adds a relative time value to an absolute time value.
+ * @param {Number} absolute Absolute virtual time value.
+ * @param {Number} relative Relative virtual time value to add.
+ * @return {Number} Resulting absolute virtual time sum value.
+ */
+ VirtualTimeSchedulerPrototype.add = notImplemented;
+
+ /**
+ * Converts an absolute time to a number
+ * @param {Any} The absolute time.
+ * @returns {Number} The absolute time in ms
+ */
+ VirtualTimeSchedulerPrototype.toDateTimeOffset = notImplemented;
+
+ /**
+ * Converts the TimeSpan value to a relative virtual time value.
+ * @param {Number} timeSpan TimeSpan value to convert.
+ * @return {Number} Corresponding relative virtual time value.
+ */
+ VirtualTimeSchedulerPrototype.toRelative = notImplemented;
+
+ /**
+ * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be emulated using recursive scheduling.
+ * @param {Mixed} state Initial state passed to the action upon the first iteration.
+ * @param {Number} period Period for running the work periodically.
+ * @param {Function} action Action to be executed, potentially updating the state.
+ * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort).
+ */
+ VirtualTimeSchedulerPrototype.schedulePeriodicWithState = function (state, period, action) {
+ var s = new SchedulePeriodicRecursive(this, state, period, action);
+ return s.start();
+ };
+
+ /**
+ * Schedules an action to be executed after dueTime.
+ * @param {Mixed} state State passed to the action to be executed.
+ * @param {Number} dueTime Relative time after which to execute the action.
+ * @param {Function} action Action to be executed.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ VirtualTimeSchedulerPrototype.scheduleRelativeWithState = function (state, dueTime, action) {
+ var runAt = this.add(this.clock, dueTime);
+ return this.scheduleAbsoluteWithState(state, runAt, action);
+ };
+
+ /**
+ * Schedules an action to be executed at dueTime.
+ * @param {Number} dueTime Relative time after which to execute the action.
+ * @param {Function} action Action to be executed.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ VirtualTimeSchedulerPrototype.scheduleRelative = function (dueTime, action) {
+ return this.scheduleRelativeWithState(action, dueTime, invokeAction);
+ };
+
+ /**
+ * Starts the virtual time scheduler.
+ */
+ VirtualTimeSchedulerPrototype.start = function () {
+ if (!this.isEnabled) {
+ this.isEnabled = true;
+ do {
+ var next = this.getNext();
+ if (next !== null) {
+ this.comparer(next.dueTime, this.clock) > 0 && (this.clock = next.dueTime);
+ next.invoke();
+ } else {
+ this.isEnabled = false;
+ }
+ } while (this.isEnabled);
+ }
+ };
+
+ /**
+ * Stops the virtual time scheduler.
+ */
+ VirtualTimeSchedulerPrototype.stop = function () {
+ this.isEnabled = false;
+ };
+
+ /**
+ * Advances the scheduler's clock to the specified time, running all work till that point.
+ * @param {Number} time Absolute time to advance the scheduler's clock to.
+ */
+ VirtualTimeSchedulerPrototype.advanceTo = function (time) {
+ var dueToClock = this.comparer(this.clock, time);
+ if (this.comparer(this.clock, time) > 0) { throw new ArgumentOutOfRangeError(); }
+ if (dueToClock === 0) { return; }
+ if (!this.isEnabled) {
+ this.isEnabled = true;
+ do {
+ var next = this.getNext();
+ if (next !== null && this.comparer(next.dueTime, time) <= 0) {
+ this.comparer(next.dueTime, this.clock) > 0 && (this.clock = next.dueTime);
+ next.invoke();
+ } else {
+ this.isEnabled = false;
+ }
+ } while (this.isEnabled);
+ this.clock = time;
+ }
+ };
+
+ /**
+ * Advances the scheduler's clock by the specified relative time, running all work scheduled for that timespan.
+ * @param {Number} time Relative time to advance the scheduler's clock by.
+ */
+ VirtualTimeSchedulerPrototype.advanceBy = function (time) {
+ var dt = this.add(this.clock, time),
+ dueToClock = this.comparer(this.clock, dt);
+ if (dueToClock > 0) { throw new ArgumentOutOfRangeError(); }
+ if (dueToClock === 0) { return; }
+
+ this.advanceTo(dt);
+ };
+
+ /**
+ * Advances the scheduler's clock by the specified relative time.
+ * @param {Number} time Relative time to advance the scheduler's clock by.
+ */
+ VirtualTimeSchedulerPrototype.sleep = function (time) {
+ var dt = this.add(this.clock, time);
+ if (this.comparer(this.clock, dt) >= 0) { throw new ArgumentOutOfRangeError(); }
+
+ this.clock = dt;
+ };
+
+ /**
+ * Gets the next scheduled item to be executed.
+ * @returns {ScheduledItem} The next scheduled item.
+ */
+ VirtualTimeSchedulerPrototype.getNext = function () {
+ while (this.queue.length > 0) {
+ var next = this.queue.peek();
+ if (next.isCancelled()) {
+ this.queue.dequeue();
+ } else {
+ return next;
+ }
+ }
+ return null;
+ };
+
+ /**
+ * Schedules an action to be executed at dueTime.
+ * @param {Scheduler} scheduler Scheduler to execute the action on.
+ * @param {Number} dueTime Absolute time at which to execute the action.
+ * @param {Function} action Action to be executed.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ VirtualTimeSchedulerPrototype.scheduleAbsolute = function (dueTime, action) {
+ return this.scheduleAbsoluteWithState(action, dueTime, invokeAction);
+ };
+
+ /**
+ * Schedules an action to be executed at dueTime.
+ * @param {Mixed} state State passed to the action to be executed.
+ * @param {Number} dueTime Absolute time at which to execute the action.
+ * @param {Function} action Action to be executed.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ VirtualTimeSchedulerPrototype.scheduleAbsoluteWithState = function (state, dueTime, action) {
+ var self = this;
+
+ function run(scheduler, state1) {
+ self.queue.remove(si);
+ return action(scheduler, state1);
+ }
+
+ var si = new ScheduledItem(this, state, run, dueTime, this.comparer);
+ this.queue.enqueue(si);
+
+ return si.disposable;
+ };
+
+ return VirtualTimeScheduler;
+ }(Scheduler));
+
+ /** Provides a virtual time scheduler that uses Date for absolute time and number for relative time. */
+ Rx.HistoricalScheduler = (function (__super__) {
+ inherits(HistoricalScheduler, __super__);
+
+ /**
+ * Creates a new historical scheduler with the specified initial clock value.
+ * @constructor
+ * @param {Number} initialClock Initial value for the clock.
+ * @param {Function} comparer Comparer to determine causality of events based on absolute time.
+ */
+ function HistoricalScheduler(initialClock, comparer) {
+ var clock = initialClock == null ? 0 : initialClock;
+ var cmp = comparer || defaultSubComparer;
+ __super__.call(this, clock, cmp);
+ }
+
+ var HistoricalSchedulerProto = HistoricalScheduler.prototype;
+
+ /**
+ * Adds a relative time value to an absolute time value.
+ * @param {Number} absolute Absolute virtual time value.
+ * @param {Number} relative Relative virtual time value to add.
+ * @return {Number} Resulting absolute virtual time sum value.
+ */
+ HistoricalSchedulerProto.add = function (absolute, relative) {
+ return absolute + relative;
+ };
+
+ HistoricalSchedulerProto.toDateTimeOffset = function (absolute) {
+ return new Date(absolute).getTime();
+ };
+
+ /**
+ * Converts the TimeSpan value to a relative virtual time value.
+ * @memberOf HistoricalScheduler
+ * @param {Number} timeSpan TimeSpan value to convert.
+ * @return {Number} Corresponding relative virtual time value.
+ */
+ HistoricalSchedulerProto.toRelative = function (timeSpan) {
+ return timeSpan;
+ };
+
+ return HistoricalScheduler;
+ }(Rx.VirtualTimeScheduler));
+
+ var AnonymousObservable = Rx.AnonymousObservable = (function (__super__) {
+ inherits(AnonymousObservable, __super__);
+
+ // Fix subscriber to check for undefined or function returned to decorate as Disposable
+ function fixSubscriber(subscriber) {
+ return subscriber && isFunction(subscriber.dispose) ? subscriber :
+ isFunction(subscriber) ? disposableCreate(subscriber) : disposableEmpty;
+ }
+
+ function setDisposable(s, state) {
+ var ado = state[0], subscribe = state[1];
+ var sub = tryCatch(subscribe)(ado);
+
+ if (sub === errorObj) {
+ if(!ado.fail(errorObj.e)) { return thrower(errorObj.e); }
+ }
+ ado.setDisposable(fixSubscriber(sub));
+ }
+
+ function AnonymousObservable(subscribe, parent) {
+ this.source = parent;
+
+ function s(observer) {
+ var ado = new AutoDetachObserver(observer), state = [ado, subscribe];
+
+ if (currentThreadScheduler.scheduleRequired()) {
+ currentThreadScheduler.scheduleWithState(state, setDisposable);
+ } else {
+ setDisposable(null, state);
+ }
+ return ado;
+ }
+
+ __super__.call(this, s);
+ }
+
+ return AnonymousObservable;
+
+ }(Observable));
+
+ var AutoDetachObserver = (function (__super__) {
+ inherits(AutoDetachObserver, __super__);
+
+ function AutoDetachObserver(observer) {
+ __super__.call(this);
+ this.observer = observer;
+ this.m = new SingleAssignmentDisposable();
+ }
+
+ var AutoDetachObserverPrototype = AutoDetachObserver.prototype;
+
+ AutoDetachObserverPrototype.next = function (value) {
+ var result = tryCatch(this.observer.onNext).call(this.observer, value);
+ if (result === errorObj) {
+ this.dispose();
+ thrower(result.e);
+ }
+ };
+
+ AutoDetachObserverPrototype.error = function (err) {
+ var result = tryCatch(this.observer.onError).call(this.observer, err);
+ this.dispose();
+ result === errorObj && thrower(result.e);
+ };
+
+ AutoDetachObserverPrototype.completed = function () {
+ var result = tryCatch(this.observer.onCompleted).call(this.observer);
+ this.dispose();
+ result === errorObj && thrower(result.e);
+ };
+
+ AutoDetachObserverPrototype.setDisposable = function (value) { this.m.setDisposable(value); };
+ AutoDetachObserverPrototype.getDisposable = function () { return this.m.getDisposable(); };
+
+ AutoDetachObserverPrototype.dispose = function () {
+ __super__.prototype.dispose.call(this);
+ this.m.dispose();
+ };
+
+ return AutoDetachObserver;
+ }(AbstractObserver));
+
+ var GroupedObservable = (function (__super__) {
+ inherits(GroupedObservable, __super__);
+
+ function subscribe(observer) {
+ return this.underlyingObservable.subscribe(observer);
+ }
+
+ function GroupedObservable(key, underlyingObservable, mergedDisposable) {
+ __super__.call(this, subscribe);
+ this.key = key;
+ this.underlyingObservable = !mergedDisposable ?
+ underlyingObservable :
+ new AnonymousObservable(function (observer) {
+ return new CompositeDisposable(mergedDisposable.getDisposable(), underlyingObservable.subscribe(observer));
+ });
+ }
+
+ return GroupedObservable;
+ }(Observable));
+
+ /**
+ * Represents an object that is both an observable sequence as well as an observer.
+ * Each notification is broadcasted to all subscribed observers.
+ */
+ var Subject = Rx.Subject = (function (__super__) {
+ function subscribe(observer) {
+ checkDisposed(this);
+ if (!this.isStopped) {
+ this.observers.push(observer);
+ return new InnerSubscription(this, observer);
+ }
+ if (this.hasError) {
+ observer.onError(this.error);
+ return disposableEmpty;
+ }
+ observer.onCompleted();
+ return disposableEmpty;
+ }
+
+ inherits(Subject, __super__);
+
+ /**
+ * Creates a subject.
+ */
+ function Subject() {
+ __super__.call(this, subscribe);
+ this.isDisposed = false,
+ this.isStopped = false,
+ this.observers = [];
+ this.hasError = false;
+ }
+
+ addProperties(Subject.prototype, Observer.prototype, {
+ /**
+ * Indicates whether the subject has observers subscribed to it.
+ * @returns {Boolean} Indicates whether the subject has observers subscribed to it.
+ */
+ hasObservers: function () { return this.observers.length > 0; },
+ /**
+ * Notifies all subscribed observers about the end of the sequence.
+ */
+ onCompleted: function () {
+ checkDisposed(this);
+ if (!this.isStopped) {
+ this.isStopped = true;
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ os[i].onCompleted();
+ }
+
+ this.observers.length = 0;
+ }
+ },
+ /**
+ * Notifies all subscribed observers about the exception.
+ * @param {Mixed} error The exception to send to all observers.
+ */
+ onError: function (error) {
+ checkDisposed(this);
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.error = error;
+ this.hasError = true;
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ os[i].onError(error);
+ }
+
+ this.observers.length = 0;
+ }
+ },
+ /**
+ * Notifies all subscribed observers about the arrival of the specified element in the sequence.
+ * @param {Mixed} value The value to send to all observers.
+ */
+ onNext: function (value) {
+ checkDisposed(this);
+ if (!this.isStopped) {
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ os[i].onNext(value);
+ }
+ }
+ },
+ /**
+ * Unsubscribe all observers and release resources.
+ */
+ dispose: function () {
+ this.isDisposed = true;
+ this.observers = null;
+ }
+ });
+
+ /**
+ * Creates a subject from the specified observer and observable.
+ * @param {Observer} observer The observer used to send messages to the subject.
+ * @param {Observable} observable The observable used to subscribe to messages sent from the subject.
+ * @returns {Subject} Subject implemented using the given observer and observable.
+ */
+ Subject.create = function (observer, observable) {
+ return new AnonymousSubject(observer, observable);
+ };
+
+ return Subject;
+ }(Observable));
+
+ /**
+ * Represents the result of an asynchronous operation.
+ * The last value before the OnCompleted notification, or the error received through OnError, is sent to all subscribed observers.
+ */
+ var AsyncSubject = Rx.AsyncSubject = (function (__super__) {
+
+ function subscribe(observer) {
+ checkDisposed(this);
+
+ if (!this.isStopped) {
+ this.observers.push(observer);
+ return new InnerSubscription(this, observer);
+ }
+
+ if (this.hasError) {
+ observer.onError(this.error);
+ } else if (this.hasValue) {
+ observer.onNext(this.value);
+ observer.onCompleted();
+ } else {
+ observer.onCompleted();
+ }
+
+ return disposableEmpty;
+ }
+
+ inherits(AsyncSubject, __super__);
+
+ /**
+ * Creates a subject that can only receive one value and that value is cached for all future observations.
+ * @constructor
+ */
+ function AsyncSubject() {
+ __super__.call(this, subscribe);
+
+ this.isDisposed = false;
+ this.isStopped = false;
+ this.hasValue = false;
+ this.observers = [];
+ this.hasError = false;
+ }
+
+ addProperties(AsyncSubject.prototype, Observer, {
+ /**
+ * Indicates whether the subject has observers subscribed to it.
+ * @returns {Boolean} Indicates whether the subject has observers subscribed to it.
+ */
+ hasObservers: function () {
+ checkDisposed(this);
+ return this.observers.length > 0;
+ },
+ /**
+ * Notifies all subscribed observers about the end of the sequence, also causing the last received value to be sent out (if any).
+ */
+ onCompleted: function () {
+ var i, len;
+ checkDisposed(this);
+ if (!this.isStopped) {
+ this.isStopped = true;
+ var os = cloneArray(this.observers), len = os.length;
+
+ if (this.hasValue) {
+ for (i = 0; i < len; i++) {
+ var o = os[i];
+ o.onNext(this.value);
+ o.onCompleted();
+ }
+ } else {
+ for (i = 0; i < len; i++) {
+ os[i].onCompleted();
+ }
+ }
+
+ this.observers.length = 0;
+ }
+ },
+ /**
+ * Notifies all subscribed observers about the error.
+ * @param {Mixed} error The Error to send to all observers.
+ */
+ onError: function (error) {
+ checkDisposed(this);
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.hasError = true;
+ this.error = error;
+
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ os[i].onError(error);
+ }
+
+ this.observers.length = 0;
+ }
+ },
+ /**
+ * Sends a value to the subject. The last value received before successful termination will be sent to all subscribed and future observers.
+ * @param {Mixed} value The value to store in the subject.
+ */
+ onNext: function (value) {
+ checkDisposed(this);
+ if (this.isStopped) { return; }
+ this.value = value;
+ this.hasValue = true;
+ },
+ /**
+ * Unsubscribe all observers and release resources.
+ */
+ dispose: function () {
+ this.isDisposed = true;
+ this.observers = null;
+ this.exception = null;
+ this.value = null;
+ }
+ });
+
+ return AsyncSubject;
+ }(Observable));
+
+ var AnonymousSubject = Rx.AnonymousSubject = (function (__super__) {
+ inherits(AnonymousSubject, __super__);
+
+ function subscribe(observer) {
+ return this.observable.subscribe(observer);
+ }
+
+ function AnonymousSubject(observer, observable) {
+ this.observer = observer;
+ this.observable = observable;
+ __super__.call(this, subscribe);
+ }
+
+ addProperties(AnonymousSubject.prototype, Observer.prototype, {
+ onCompleted: function () {
+ this.observer.onCompleted();
+ },
+ onError: function (error) {
+ this.observer.onError(error);
+ },
+ onNext: function (value) {
+ this.observer.onNext(value);
+ }
+ });
+
+ return AnonymousSubject;
+ }(Observable));
+
+ /**
+ * Used to pause and resume streams.
+ */
+ Rx.Pauser = (function (__super__) {
+ inherits(Pauser, __super__);
+
+ function Pauser() {
+ __super__.call(this);
+ }
+
+ /**
+ * Pauses the underlying sequence.
+ */
+ Pauser.prototype.pause = function () { this.onNext(false); };
+
+ /**
+ * Resumes the underlying sequence.
+ */
+ Pauser.prototype.resume = function () { this.onNext(true); };
+
+ return Pauser;
+ }(Subject));
+
+ if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
+ root.Rx = Rx;
+
+ define(function() {
+ return Rx;
+ });
+ } else if (freeExports && freeModule) {
+ // in Node.js or RingoJS
+ if (moduleExports) {
+ (freeModule.exports = Rx).Rx = Rx;
+ } else {
+ freeExports.Rx = Rx;
+ }
+ } else {
+ // in a browser or Rhino
+ root.Rx = Rx;
+ }
+
+ // All code before this point will be filtered from stack traces.
+ var rEndingLine = captureLine();
+
+}.call(this));
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.all.compat.map b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.all.compat.map
new file mode 100644
index 00000000000..59ccf931dae
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.all.compat.map
@@ -0,0 +1 @@
+{"version":3,"file":"rx.all.compat.min.js","sources":["rx.all.compat.js"],"names":["undefined","cloneArray","arr","len","length","a","Array","i","makeStackTraceLong","error","observable","hasStacks","stack","indexOf","STACK_JUMP_SEPARATOR","stacks","o","source","unshift","concatedStacks","join","filterStackString","stackString","lines","split","desiredLines","line","isInternalFrame","isNodeFrame","push","stackLine","fileNameAndLineNumber","getFileNameAndLineNumber","fileName","lineNumber","rFileName","rStartingLine","rEndingLine","captureLine","Error","e","firstLine","attempt1","exec","Number","attempt2","attempt3","keysIn","object","result","isObject","support","nonEnumArgs","isArguments","slice","call","skipProto","enumPrototypes","skipErrorProps","enumErrorProps","errorProto","key","nonEnumShadows","objectProto","ctor","constructor","index","dontEnumsLength","prototype","className","stringProto","stringClass","errorClass","toString","nonEnum","nonEnumProps","dontEnums","hasOwnProperty","internalFor","callback","keysFunc","props","internalForIn","isNode","value","deepEquals","b","stackA","stackB","type","otherType","otherClass","argsClass","objectClass","boolClass","dateClass","numberClass","regexpClass","String","isArr","arrayClass","nodeClass","ctorA","argsObject","Object","ctorB","isFunction","size","pop","arrayInitialize","count","factory","tryCatcher","tryCatchTarget","apply","this","arguments","errorObj","tryCatch","fn","TypeError","thrower","IndexedItem","id","ScheduledDisposable","scheduler","disposable","isDisposed","scheduleItem","s","self","dispose","StringIterable","str","_s","StringIterator","_l","_i","ArrayIterable","_a","ArrayIterator","toLength","numberIsFinite","root","isFinite","getIterable","it","$iterator$","sign","number","isNaN","Math","floor","abs","maxSafeInteger","FromArraySink","observer","parent","observableOf","array","isScheduler","currentThreadScheduler","FromArrayObservable","PairsSink","RepeatSink","observableCatchHandler","handler","AnonymousObservable","d1","SingleAssignmentDisposable","subscription","SerialDisposable","setDisposable","subscribe","x","onNext","ex","onError","isPromise","observableFromPromise","d","onCompleted","falseFactory","zipArray","second","resultSelector","first","left","right","res","emptyArrayFactory","arrayFactory","ScanObserver","accumulator","hasSeed","seed","hasAccumulation","accumulation","hasValue","isStopped","concatMap","selector","thisArg","selectorFunc","bindCallback","map","isArrayLike","isIterable","observableFrom","concatAll","arrayIndexOfComparer","item","comparer","HashSet","set","flatMap","mergeAll","extremaBy","keySelector","lastKey","list","comparison","ex1","firstOnly","EmptyError","elementAtOrDefault","hasDefault","defaultValue","ArgumentOutOfRangeError","singleOrDefaultAsync","seenValue","firstOrDefaultAsync","lastOrDefaultAsync","findValue","predicate","yieldIndex","shouldRun","toThunk","obj","ctx","isArray","objectToThunk","isGeneratorFunction","observableSpawn","isGenerator","isObservable","observableToThunk","promiseToThunk","fnString","done","run","finished","results","pending","err","keys","timeoutScheduler","schedule","v","promise","then","name","next","throwString","handleError","isNodeList","el","window","StaticNodeList","NodeList","fixEvent","event","stopPropagation","cancelBubble","preventDefault","bubbledKeyCode","keyCode","ctrlKey","defaultPrevented","returnValue","modified","target","srcElement","relatedTarget","fromElement","toElement","c","charCode","keyChar","fromCharCode","createListener","element","addEventListener","disposableCreate","removeEventListener","attachEvent","innerHandler","detachEvent","createEventListener","eventName","disposables","CompositeDisposable","add","combineLatestSource","subject","values","hasValueAll","every","identity","isDone","observableWindowWithOpenings","windowOpenings","windowClosingSelector","groupJoin","observableEmpty","_","win","observableWindowWithBoundaries","windowBoundaries","Subject","r","RefCountDisposable","addRef","w","observableWindowWithClosingSelector","createWindowClose","windowClose","m1","m","take","noop","enumerableWhile","condition","WhileEnumerable","Pattern","patterns","Plan","expression","planCreateObserver","externalSubscriptions","entry","get","JoinObserver","ActivePlan","joinObserverArray","joinObservers","Map","joinObserver","observableTimerDate","dueTime","scheduleWithAbsolute","observableTimerDateAndPeriod","period","p","normalizeTime","scheduleRecursiveWithAbsoluteAndState","now","observableTimerTimeSpan","scheduleWithRelative","observableTimerTimeSpanAndPeriod","schedulePeriodicWithState","observableDefer","observableDelayTimeSpan","active","cancelable","exception","q","running","materialize","timestamp","notification","kind","scheduleRecursiveWithRelative","recurseDueTime","shouldRecurse","shift","accept","max","observableDelayDate","sampleObservable","sampler","sampleSubscribe","atEnd","sourceSubscription","newValue","objectTypes","boolean","function","string","freeExports","exports","nodeType","freeModule","module","moduleExports","freeGlobal","global","Rx","internals","config","Promise","helpers","notDefined","defaultNow","pluck","property","just","Date","defaultComparer","y","isEqual","defaultSubComparer","defaultError","defaultKeySerializer","not","asArray","isFn","longStackSupport","message","ObjectDisposedError","NotSupportedError","NotImplementedError","notImplemented","notSupported","Symbol","iterator","Set","doneEnumerator","supportNodeClass","func","argCount","arg","collection","funcClass","supportsArgsClass","propertyIsEnumerable","document","toLocaleString","valueOf","test","inherits","child","__","addProperties","sources","idx","ln","prop","xs","getDisposable","Function","bind","that","args","bound","F","concat","forEach","T","k","O","kValue","boxedString","splitString","fun","thisp","filter","t","searchElement","n","Infinity","hasDontEnumBug","compareTo","other","PriorityQueue","capacity","items","priorityProto","isHigherPriority","percolate","temp","heapify","peek","removeAt","dequeue","enqueue","remove","isDisposable","CompositeDisposablePrototype","shouldDispose","splice","currentDisposables","Disposable","action","create","disposableEmpty","empty","checkDisposed","current","old","InnerDisposable","isInnerDisposed","underlyingDisposable","isPrimaryDisposed","scheduleWithState","ScheduledItem","state","invoke","invokeCore","isCancelled","Scheduler","scheduleRelative","scheduleAbsolute","_schedule","_scheduleRelative","_scheduleAbsolute","invokeAction","schedulerProto","scheduleWithRelativeAndState","scheduleWithAbsoluteAndState","normalize","timeSpan","invokeRecImmediate","pair","recursiveAction","state1","state2","isAdded","scheduler1","state3","group","invokeRecDate","method","dueTime1","scheduleInnerRecursive","dt","scheduleRecursive","scheduleRecursiveWithState","scheduleRecursiveWithRelativeAndState","scheduleRecursiveWithAbsolute","schedulePeriodic","setInterval","clearInterval","catchError","CatchScheduler","scheduleMethod","clearMethod","SchedulePeriodicRecursive","tick","command","recurse","_period","_state","_action","_cancel","_scheduler","start","immediateScheduler","immediate","scheduleNow","currentThread","runTrampoline","queue","si","currentScheduler","scheduleRequired","localTimer","localSetTimeout","localClearTimeout","setTimeout","clearTimeout","WScript","time","Sleep","runTask","handle","currentlyRunning","task","tasksByHandle","postMessageSupported","postMessage","importScripts","isAsync","oldHandler","onmessage","onGlobalPostMessage","data","substring","MSG_PREFIX","nextHandle","reNative","RegExp","replace","setImmediate","process","nextTick","random","currentId","MessageChannel","channel","port1","port2","createElement","scriptElement","onreadystatechange","parentNode","removeChild","documentElement","appendChild","timeout","__super__","_wrap","_handler","_recursiveOriginal","_recursiveWrapper","_clone","_getRecursiveWrapper","wrapper","failed","Notification","acceptObservable","_accept","_acceptObservable","observerOrOnNext","toObservable","notificationCreateOnNext","createOnNext","notificationCreateOnError","createOnError","notificationCreateOnCompleted","createOnCompleted","Observer","toNotifier","asObserver","AnonymousObserver","checked","CheckedObserver","observerCreate","fromNotifier","notifyOn","ObserveOnObserver","makeSafe","AnonymousSafeObserver","_onNext","_onError","_onCompleted","observableProto","AbstractObserver","completed","fail","_observer","CheckedObserverPrototype","checkAccess","ScheduledObserver","isAcquired","hasFaulted","ensureActive","isOwner","work","cancel","Observable","_subscribe","oldOnError","subscribeOnNext","subscribeOnError","subscribeOnCompleted","ObservableBase","fixSubscriber","subscriber","ado","sub","subscribeCore","AutoDetachObserver","Enumerable","ConcatEnumerableObservable","InnerObserver","currentItem","currentValue","CatchErrorObservable","lastException","catchErrorWhen","notificationHandler","exceptions","notifier","handled","notificationDisposable","outer","inner","exn","RepeatEnumerable","RepeatEnumerator","l","enumerableRepeat","repeat","repeatCount","OfEnumerable","OfEnumerator","enumerableOf","of","observeOn","subscribeOn","FromPromiseObservable","fromPromise","toPromise","promiseCtor","resolve","reject","ToArrayObservable","toArray","createWithDisposable","defer","observableFactory","observableThrow","EmptyObservable","EmptySink","sink","FromObservable","iterable","mapper","FromSink","loopRecursive","pow","charAt","from","mapFn","observableFromArray","fromArray","generate","initialState","iterate","hasResult","ofWithScheduler","NeverObservable","observableNever","never","PairsObservable","pairs","RangeObservable","rangeCount","RangeSink","range","RepeatObservable","JustObservable","JustSink","ThrowObservable","ThrowSink","throwError","throwException","using","resourceFactory","resource","amb","rightSource","leftSource","choiceL","choice","leftChoice","rightSubscription","choiceR","rightChoice","leftSubscription","previous","acc","catchException","handlerOrSecond","observableCatch","combineLatest","j","subscriptions","sad","observableConcat","ConcatObservable","ConcatSink","concatObservable","merge","MergeObservable","maxConcurrent","g","MergeObserver","activeCount","handleSubscribe","innerSource","maxConcurrentOrOther","observableMerge","MergeAllObservable","MergeAllObserver","mergeObservable","CompositeError","errors","innerErrors","mergeDelayError","setCompletion","innerSubscription","onErrorResumeNext","pos","skipUntil","isOpen","SwitchObservable","SwitchObserver","stopped","latest","hasLatest","switchLatest","TakeUntilObservable","takeUntil","withLatestFrom","allValues","zip","queues","queuedValues","asObservable","bufferWithCount","skip","windowWithCount","selectMany","where","dematerialize","distinctUntilChanged","currentKey","hasCurrentKey","comparerEquals","TapObservable","tap","doAction","doOnNext","tapOnNext","doOnError","tapOnError","doOnCompleted","tapOnCompleted","ensure","finallyAction","IgnoreElementsObservable","ignoreElements","retry","retryCount","retryWhen","ScanObservable","scan","skipLast","startWith","takeLast","takeLastBuffer","createWindow","refCountDisposable","selectConcat","selectorResult","i2","concatMapObserver","selectConcatObserver","onNextFunc","onErrorFunc","onCompletedFunc","defaultIfEmpty","found","retValue","distinct","hashSet","groupBy","elementSelector","groupByUntil","durationSelector","Dictionary","groupDisposable","getValues","fireNewMapEntry","writer","tryGetValue","GroupedObservable","durationGroup","duration","md","expire","MapObservable","innerMap","internalMap","select","selectorFn","currentProp","flatMapObserver","selectManyObserver","selectSwitch","flatMapLatest","switchMap","SkipObservable","skipCount","skipWhile","remaining","takeWhile","FilterObservable","innerPredicate","internalFilter","shouldYield","aggregate","ReduceObservable","reduce","some","any","isEmpty","all","includes","fromIndex","contains","sum","prev","curr","minBy","min","maxBy","average","cur","sequenceEqual","donel","doner","ql","qr","subscription1","equal","subscription2","elementAt","single","singleOrDefault","firstOrDefault","last","lastOrDefault","find","findIndex","toSet","toMap","spawn","isGenFun","exit","ret","gen","called","hasCallback","context","observableToAsync","toAsync","AsyncSubject","fromCallback","publishLast","refCount","fromNodeCallback","useNativeEvents","fromEvent","addListener","fromEventPattern","h","removeListener","on","off","publish","addHandler","removeHandler","startAsync","functionAsync","PausableObservable","conn","connection","pausable","pauser","connect","controller","pause","resume","PausableBufferedObservable","drainQueue","previousShouldFire","shouldFire","pausableBuffered","ControlledObservable","enableQueue","ControlledSubject","multicast","request","numberOfItems","requestedCount","requestedDisposable","hasFailed","hasCompleted","hasRequested","disposeCurrentRequest","_processRequest","controlled","StopAndWaitObservable","StopAndWaitObserver","__sub__","stopAndWaitObserverProto","stopAndWait","WindowedObservable","WindowedObserver","windowSize","received","windowedObserverPrototype","windowed","pipe","dest","onDrain","write","emit","_isStdio","end","subjectOrSubjectSelector","connectable","ConnectableObservable","share","publishValue","initialValueOrSelector","initialValue","BehaviorSubject","shareValue","replay","bufferSize","ReplaySubject","shareReplay","InnerSubscription","observers","hasError","getValue","hasObservers","os","createRemovableDisposable","so","_trim","interval","hasSubscription","sourceObservable","connectableSubscription","shouldConnect","singleInstance","getObservable","hasObservable","isPrime","candidate","num1","sqrt","num2","getPrime","num","primes","stringHashFn","hash","character","charCodeAt","numberHashFn","c2","newEntry","hashCode","_initialize","freeCount","freeList","noSuchkey","duplicatekey","getHashCode","uniqueIdCounter","dictionaryProto","prime","buckets","entries","_insert","index3","index1","index2","_resize","numArray","entryArray","clear","_findEntry","containskey","leftDurationSelector","rightDurationSelector","leftDone","rightDone","leftId","rightId","leftMap","rightMap","buffer","bufferOpeningsOrClosingSelector","bufferClosingSelector","windowOpeningsOrClosingSelector","pairwise","hasPrevious","partition","letBind","ifThen","thenSource","elseSourceOrScheduler","forIn","observableWhileDo","whileDo","doWhile","switchCase","defaultSourceOrScheduler","expand","forkJoin","allSources","hasResults","ix","lastLeft","lastRight","leftStopped","rightStopped","hasLeft","hasRight","manySelect","extend","chain","ChainObservable","head","tail","_keys","_values","and","thenDo","activate","deactivate","activePlan","jlen","removeActivePlan","addActivePlan","match","hasValues","firstValues","isCompleted","activePlans","JoinObserverPrototype","when","plans","outObserver","observableinterval","timer","periodOrScheduler","getTime","delay","debounce","throttleWithTimeout","hasvalue","throttle","windowWithTime","timeShiftOrScheduler","timeShift","createTimer","isSpan","isShift","timerD","nextSpan","nextShift","newTotalTime","ts","totalTime","windowWithTimeOrCount","windowId","newId","newWindow","bufferWithTime","bufferWithTimeOrCount","timeInterval","span","sample","throttleLatest","intervalOrSampler","schedulerMethod","myId","original","switched","generateWithAbsoluteTime","timeSelector","generateWithRelativeTime","delaySubscription","delayWithSelector","subscriptionDelay","delayDurationSelector","subDelay","delays","timeoutWithSelector","firstTimeout","timeoutdurationSelector","setTimer","timerWins","observerWins","debounceWithSelector","currentid","throttleWithSelector","skipLastWithTime","takeLastWithTime","takeLastBufferWithTime","takeWithTime","skipWithTime","open","skipUntilWithTime","startTime","takeUntilWithTime","endTime","throttleFirst","windowDuration","RangeError","lastOnNext","exclusive","hasCurrent","exclusiveMap","transduce","transducer","transformForObserver","@@transducer/init","@@transducer/step","obs","input","@@transducer/result","xform","VirtualTimeScheduler","localNow","toDateTimeOffset","clock","scheduleAbsoluteWithState","scheduleRelativeWithState","toRelative","initialClock","isEnabled","VirtualTimeSchedulerPrototype","runAt","getNext","stop","advanceTo","dueToClock","advanceBy","sleep","HistoricalScheduler","cmp","HistoricalSchedulerProto","absolute","relative","AutoDetachObserverPrototype","underlyingObservable","mergedDisposable","AnonymousSubject","Pauser","define","amd"],"mappings":";CAEE,SAAUA,GAyDR,QAASC,GAAWC,GAElB,IAAI,GADAC,GAAMD,EAAIE,OAAQC,EAAI,GAAIC,OAAMH,GAC5BI,EAAI,EAAOJ,EAAJI,EAASA,IAAOF,EAAEE,GAAKL,EAAIK,EAC1C,OAAOF,GAgBX,QAASG,GAAmBC,EAAOC,GAG/B,GAAIC,IACAD,EAAWE,OACM,gBAAVH,IACG,OAAVA,GACAA,EAAMG,OACwC,KAA9CH,EAAMG,MAAMC,QAAQC,IACtB,CAEA,IAAK,GADDC,MACKC,EAAIN,EAAcM,EAAGA,EAAIA,EAAEC,OAC9BD,EAAEJ,OACJG,EAAOG,QAAQF,EAAEJ,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AASmB,OAAO3F,MAIlBgoC,GACPhkB,GAKFvQ,IAAGw0B,OAAU,SAAUnnB,GAGrB,QAASmnB,KACPnnB,EAAU3iB,KAAK4D,MAajB,MAhBAqU,IAAS6xB,EAAQnnB,GASjBmnB,EAAOjpC,UAAUg4B,MAAQ,WAAcj1B,KAAK4D,QAAO,IAKnDsiC,EAAOjpC,UAAUi4B,OAAS,WAAcl1B,KAAK4D,QAAO,IAE7CsiC,GACPt5B,IAEmB,kBAAVu5B,SAA6C,gBAAdA,QAAOC,KAAmBD,OAAOC,KACzExkC,GAAK8P,GAAKA,GAEVy0B,OAAO,WACL,MAAOz0B,OAEAR,IAAeG,GAEpBE,IACDF,GAAWF,QAAUO,IAAIA,GAAKA,GAE/BR,GAAYQ,GAAKA,GAInB9P,GAAK8P,GAAKA,EAIZ,IAAIxW,IAAcC,MAElBiB,KAAK4D"} \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.all.compat.min.js b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.all.compat.min.js
new file mode 100644
index 00000000000..e29462180b4
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.all.compat.min.js
@@ -0,0 +1,7 @@
+/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
+(function(a){function b(a){for(var b=a.length,c=new Array(b),d=0;b>d;d++)c[d]=a[d];return c}function c(a,b){if(Oa&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(Sa)){for(var c=[],e=b;e;e=e.source)e.stack&&c.unshift(e.stack);c.unshift(a.stack);var f=c.join("\n"+Sa+"\n");a.stack=d(f)}}function d(a){for(var b=a.split("\n"),c=[],d=0,g=b.length;g>d;d++){var h=b[d];e(h)||f(h)||!h||c.push(h)}return c.join("\n")}function e(a){var b=h(a);if(!b)return!1;var c=b[0],d=b[1];return c===Qa&&d>=Ra&&Rd>=d}function f(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function g(){if(Oa)try{throw new Error}catch(a){var b=a.stack.split("\n"),c=b[0].indexOf("@")>0?b[1]:b[2],d=h(c);if(!d)return;return Qa=d[0],d[1]}}function h(a){var b=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(a);if(b)return[b[1],Number(b[2])];var c=/at ([^ ]+):(\d+):(?:\d+)$/.exec(a);if(c)return[c[1],Number(c[2])];var d=/.*@(.+):(\d+)$/.exec(a);return d?[d[1],Number(d[2])]:void 0}function i(a){var b=[];if(!zb(a))return b;yb.nonEnumArgs&&a.length&&Ab(a)&&(a=Db.call(a));var c=yb.enumPrototypes&&"function"==typeof a,d=yb.enumErrorProps&&(a===tb||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(yb.nonEnumShadows&&a!==ub){var f=a.constructor,g=-1,h=fb;if(a===(f&&f.prototype))var i=a===vb?pb:a===tb?kb:qb.call(a),j=xb[i];for(;++g<h;)e=eb[g],j&&j[e]||!rb.call(a,e)||b.push(e)}return b}function j(a,b,c){for(var d=-1,e=c(a),f=e.length;++d<f;){var g=e[d];if(b(a[g],g,a)===!1)break}return a}function k(a,b){return j(a,b,i)}function l(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function m(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,f=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=f&&"object"!=f))return!1;var g=qb.call(a),h=qb.call(b);if(g==gb&&(g=nb),h==gb&&(h=nb),g!=h)return!1;switch(g){case ib:case jb:return+a==+b;case mb:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case ob:case pb:return a==String(b)}var i=g==hb;if(!i){if(g!=nb||!yb.nodeClass&&(l(a)||l(b)))return!1;var j=!yb.argsObject&&Ab(a)?Object:a.constructor,n=!yb.argsObject&&Ab(b)?Object:b.constructor;if(!(j==n||rb.call(a,"constructor")&&rb.call(b,"constructor")||Na(j)&&j instanceof j&&Na(n)&&n instanceof n||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var o=c.length;o--;)if(c[o]==a)return d[o]==b;var p=0,q=!0;if(c.push(a),d.push(b),i){if(o=a.length,p=b.length,q=p==o)for(;p--;){var r=b[p];if(!(q=m(a[p],r,c,d)))break}}else k(b,function(b,e,f){return rb.call(f,e)?(p++,q=rb.call(a,e)&&m(a[e],b,c,d)):void 0}),q&&k(a,function(a,b,c){return rb.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function n(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function o(){try{return Bb.apply(this,arguments)}catch(a){return Hb.e=a,Hb}}function p(a){if(!Na(a))throw new TypeError("fn must be a function");return Bb=a,o}function q(a){throw a}function r(a,b){this.id=a,this.value=b}function t(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function u(a,b){b.isDisposed||(b.isDisposed=!0,b.disposable.dispose())}function v(a){this._s=s}function w(a){this._s=s,this._l=s.length,this._i=0}function x(a){this._a=a}function y(a){this._a=a,this._l=C(a),this._i=0}function z(a){return"number"==typeof a&&za.isFinite(a)}function A(b){var c,d=b[$a];if(!d&&"string"==typeof b)return c=new v(b),c[$a]();if(!d&&b.length!==a)return c=new x(b),c[$a]();if(!d)throw new TypeError("Object is not iterable");return b[$a]()}function B(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function C(a){var b=+a.length;return isNaN(b)?0:0!==b&&z(b)?(b=B(b)*Math.floor(Math.abs(b)),0>=b?0:b>Lc?Lc:b):b}function D(a,b){this.observer=a,this.parent=b}function E(a,b){return Zb(a)||(a=cc),new Nc(b,a)}function F(a,b){this.observer=a,this.parent=b}function G(a,b){this.observer=a,this.parent=b}function H(a,b){return new Ld(function(c){var d=new Tb,e=new Ub;return e.setDisposable(d),d.setDisposable(a.subscribe(function(a){c.onNext(a)},function(a){try{var d=b(a)}catch(f){return c.onError(f)}La(d)&&(d=Ec(d));var g=new Tb;e.setDisposable(g),g.setDisposable(d.subscribe(c))},function(a){c.onCompleted(a)})),e},a)}function I(){return!1}function J(a,b){var c=this;return new Ld(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g=a[e++],h=p(b)(c,g);if(h===Hb)return d.onError(h.e);d.onNext(h)}else d.onCompleted()},function(a){d.onError(a)},function(){d.onCompleted()})},c)}function I(){return!1}function K(){return[]}function I(){return!1}function L(){return[]}function M(a,b){this.observer=a,this.accumulator=b.accumulator,this.hasSeed=b.hasSeed,this.seed=b.seed,this.hasAccumulation=!1,this.accumulation=null,this.hasValue=!1,this.isStopped=!1}function N(a,b,c){var d=db(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return La(e)&&(e=Ec(e)),(bb(e)||ab(e))&&(e=Mc(e)),e}).concatAll()}function O(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function P(a){this.comparer=a,this.set=[]}function Q(a,b,c){var d=db(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return La(e)&&(e=Ec(e)),(bb(e)||ab(e))&&(e=Mc(e)),e}).mergeAll()}function R(a,b,c){return new Ld(function(d){var e=!1,f=null,g=[];return a.subscribe(function(a){var h,i;try{i=b(a)}catch(j){return void d.onError(j)}if(h=0,e)try{h=c(i,f)}catch(k){return void d.onError(k)}else e=!0,f=i;h>0&&(f=i,g=[]),h>=0&&g.push(a)},function(a){d.onError(a)},function(){d.onNext(g),d.onCompleted()})},a)}function S(a){if(0===a.length)throw new Ta;return a[0]}function T(a,b,c,d){if(0>b)throw new Va;return new Ld(function(e){var f=b;return a.subscribe(function(a){0===f--&&(e.onNext(a),e.onCompleted())},function(a){e.onError(a)},function(){c?(e.onNext(d),e.onCompleted()):e.onError(new Va)})},a)}function U(a,b,c){return new Ld(function(d){var e=c,f=!1;return a.subscribe(function(a){f?d.onError(new Error("Sequence contains more than one element")):(e=a,f=!0)},function(a){d.onError(a)},function(){f||b?(d.onNext(e),d.onCompleted()):d.onError(new Ta)})},a)}function V(a,b,c){return new Ld(function(d){return a.subscribe(function(a){d.onNext(a),d.onCompleted()},function(a){d.onError(a)},function(){b?(d.onNext(c),d.onCompleted()):d.onError(new Ta)})},a)}function W(a,b,c){return new Ld(function(d){var e=c,f=!1;return a.subscribe(function(a){e=a,f=!0},function(a){d.onError(a)},function(){f||b?(d.onNext(e),d.onCompleted()):d.onError(new Ta)})},a)}function X(b,c,d,e){var f=db(c,d,3);return new Ld(function(c){var d=0;return b.subscribe(function(a){var g;try{g=f(a,d,b)}catch(h){return void c.onError(h)}g?(c.onNext(e?d:a),c.onCompleted()):d++},function(a){c.onError(a)},function(){c.onNext(e?-1:a),c.onCompleted()})},b)}function Y(a,b){return Array.isArray(a)?Z.call(b,a):ba(a)?rd(a.call(b)):ca(a)?rd(a):aa(a)?$(a):La(a)?_(a):typeof a===pd?a:zb(a)||Array.isArray(a)?Z.call(b,a):a}function Z(a){var b=this;return function(c){function d(a,d){if(!e)try{if(a=Y(a,b),typeof a!==pd)return h[d]=a,--g||c(null,h);a.call(b,function(a,b){if(!e){if(a)return e=!0,c(a);h[d]=b,--g||c(null,h)}})}catch(f){e=!0,c(f)}}var e,f=Object.keys(a),g=f.length,h=new a.constructor;if(!g)return void gc.schedule(function(){c(null,h)});for(var i=0,j=f.length;j>i;i++)d(a[f[i]],f[i])}}function $(a){return function(b){var c,d=!1;a.subscribe(function(a){c=a,d=!0},b,function(){d&&b(null,c)})}}function _(a){return function(b){a.then(function(a){b(null,a)},b)}}function aa(a){return a&&typeof a.subscribe===pd}function ba(a){return a&&a.constructor&&"GeneratorFunction"===a.constructor.name}function ca(a){return a&&typeof a.next===pd&&typeof a[qd]===pd}function da(a){a&&gc.schedule(function(){throw a})}function ea(a){return window.StaticNodeList?a instanceof window.StaticNodeList||a instanceof window.NodeList:"[object NodeList]"==Object.prototype.toString.call(a)}function fa(a){var b=function(){this.cancelBubble=!0},c=function(){if(this.bubbledKeyCode=this.keyCode,this.ctrlKey)try{this.keyCode=0}catch(a){}this.defaultPrevented=!0,this.returnValue=!1,this.modified=!0};if(a||(a=za.event),!a.target)switch(a.target=a.target||a.srcElement,"mouseover"==a.type&&(a.relatedTarget=a.fromElement),"mouseout"==a.type&&(a.relatedTarget=a.toElement),a.stopPropagation||(a.stopPropagation=b,a.preventDefault=c),a.type){case"keypress":var d="charCode"in a?a.charCode:a.keyCode;10==d?(d=0,a.keyCode=13):13==d||27==d?d=0:3==d&&(d=99),a.charCode=d,a.keyChar=a.charCode?String.fromCharCode(a.charCode):""}return a}function ga(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1),Pb(function(){a.removeEventListener(b,c,!1)});if(a.attachEvent){var d=function(a){c(fa(a))};return a.attachEvent("on"+b,d),Pb(function(){a.detachEvent("on"+b,d)})}return a["on"+b]=c,Pb(function(){a["on"+b]=null})}function ha(a,b,c){var d=new Mb;if(ea(a)||"[object HTMLCollection]"===Object.prototype.toString.call(a))for(var e=0,f=a.length;f>e;e++)d.add(ha(a.item(e),b,c));else a&&d.add(ga(a,b,c));return d}function ia(a,b,c){return new Ld(function(d){function e(a,b){if(j[b]=a,g[b]=!0,h||(h=g.every(Ga))){if(f)return d.onError(f);var e=p(c).apply(null,j);if(e===Hb)return d.onError(e.e);d.onNext(e)}i&&j[1]&&d.onCompleted()}var f,g=[!1,!1],h=!1,i=!1,j=new Array(2);return new Mb(a.subscribe(function(a){e(a,0)},function(a){j[1]?d.onError(a):f=a},function(){i=!0,j[1]&&d.onCompleted()}),b.subscribe(function(a){e(a,1)},function(a){d.onError(a)},function(){i=!0,e(!0,1)}))},a)}function ja(a,b){return a.groupJoin(this,b,Ic,function(a,b){return b})}function ka(a){var b=this;return new Ld(function(c){var d=new Od,e=new Mb,f=new Vb(e);return c.onNext(Gb(d,f)),e.add(b.subscribe(function(a){d.onNext(a)},function(a){d.onError(a),c.onError(a)},function(){d.onCompleted(),c.onCompleted()})),La(a)&&(a=Ec(a)),e.add(a.subscribe(function(a){d.onCompleted(),d=new Od,c.onNext(Gb(d,f))},function(a){d.onError(a),c.onError(a)},function(){d.onCompleted(),c.onCompleted()})),f},b)}function la(a){var b=this;return new Ld(function(c){function d(){var b;try{b=a()}catch(f){return void c.onError(f)}La(b)&&(b=Ec(b));var i=new Tb;e.setDisposable(i),i.setDisposable(b.take(1).subscribe(Fa,function(a){h.onError(a),c.onError(a)},function(){h.onCompleted(),h=new Od,c.onNext(Gb(h,g)),d()}))}var e=new Ub,f=new Mb(e),g=new Vb(f),h=new Od;return c.onNext(Gb(h,g)),f.add(b.subscribe(function(a){h.onNext(a)},function(a){h.onError(a),c.onError(a)},function(){h.onCompleted(),c.onCompleted()})),d(),g},b)}function ma(a,b){return new Fd(a,b)}function na(a){this.patterns=a}function oa(a,b){this.expression=a,this.selector=b}function pa(a,b,c){var d=a.get(b);if(!d){var e=new Jd(b,c);return a.set(b,e),e}return d}function qa(a,b,c){this.joinObserverArray=a,this.onNext=b,this.onCompleted=c,this.joinObservers=new Id;for(var d=0,e=this.joinObserverArray.length;e>d;d++){var f=this.joinObserverArray[d];this.joinObservers.set(f,f)}}function ra(a,b){return new Ld(function(c){return b.scheduleWithAbsolute(a,function(){c.onNext(0),c.onCompleted()})})}function sa(a,b,c){return new Ld(function(d){var e=a,f=Yb(b);return c.scheduleRecursiveWithAbsoluteAndState(0,e,function(a,b){if(f>0){var g=c.now();e+=f,g>=e&&(e=g+f)}d.onNext(a),b(a+1,e)})})}function ta(a,b){return new Ld(function(c){return b.scheduleWithRelative(Yb(a),function(){c.onNext(0),c.onCompleted()})})}function ua(a,b,c){return a===b?new Ld(function(a){return c.schedulePeriodicWithState(0,b,function(b){return a.onNext(b),b+1})}):Gc(function(){return sa(c.now()+a,b,c)})}function va(a,b,c){return new Ld(function(d){var e,f=!1,g=new Ub,h=null,i=[],j=!1;return e=a.materialize().timestamp(c).subscribe(function(a){var e,k;"E"===a.value.kind?(i=[],i.push(a),h=a.value.exception,k=!j):(i.push({value:a.value,timestamp:a.timestamp+b}),k=!f,f=!0),k&&(null!==h?d.onError(h):(e=new Tb,g.setDisposable(e),e.setDisposable(c.scheduleRecursiveWithRelative(b,function(a){var b,e,g,k;if(null===h){j=!0;do g=null,i.length>0&&i[0].timestamp-c.now()<=0&&(g=i.shift().value),null!==g&&g.accept(d);while(null!==g);k=!1,e=0,i.length>0?(k=!0,e=Math.max(0,i[0].timestamp-c.now())):f=!1,b=h,j=!1,null!==b?d.onError(b):k&&a(e)}}))))}),new Mb(e,g)},a)}function wa(a,b,c){return Gc(function(){return va(a,b-c.now(),c)})}function xa(a,b){return new Ld(function(c){function d(){g&&(g=!1,c.onNext(e)),f&&c.onCompleted()}var e,f=!1,g=!1,h=new Tb;return h.setDisposable(a.subscribe(function(a){g=!0,e=a},function(a){c.onError(a)},function(){f=!0,h.dispose()})),new Mb(h,b.subscribe(d,function(a){c.onError(a)},d))},a)}var ya={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},za=ya[typeof window]&&window||this,Aa=ya[typeof exports]&&exports&&!exports.nodeType&&exports,Ba=ya[typeof module]&&module&&!module.nodeType&&module,Ca=Ba&&Ba.exports===Aa&&Aa,Da=ya[typeof global]&&global;!Da||Da.global!==Da&&Da.window!==Da||(za=Da);var Ea={internals:{},config:{Promise:za.Promise},helpers:{}},Fa=Ea.helpers.noop=function(){},Ga=(Ea.helpers.notDefined=function(a){return"undefined"==typeof a},Ea.helpers.identity=function(a){return a}),Ha=(Ea.helpers.pluck=function(a){return function(b){return b[a]}},Ea.helpers.just=function(a){return function(){return a}},Ea.helpers.defaultNow=function(){return Date.now?Date.now:function(){return+new Date}}()),Ia=Ea.helpers.defaultComparer=function(a,b){return Cb(a,b)},Ja=Ea.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},Ka=(Ea.helpers.defaultKeySerializer=function(a){return a.toString()},Ea.helpers.defaultError=function(a){throw a}),La=Ea.helpers.isPromise=function(a){return!!a&&"function"!=typeof a.subscribe&&"function"==typeof a.then},Ma=(Ea.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},Ea.helpers.not=function(a){return!a}),Na=Ea.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==qb.call(a)}),a}();Ea.config.longStackSupport=!1;var Oa=!1;try{throw new Error}catch(Pa){Oa=!!Pa.stack}var Qa,Ra=g(),Sa="From previous event:",Ta=Ea.EmptyError=function(){this.message="Sequence contains no elements.",Error.call(this)};Ta.prototype=Error.prototype;var Ua=Ea.ObjectDisposedError=function(){this.message="Object has been disposed",Error.call(this)};Ua.prototype=Error.prototype;var Va=Ea.ArgumentOutOfRangeError=function(){this.message="Argument out of range",Error.call(this)};Va.prototype=Error.prototype;var Wa=Ea.NotSupportedError=function(a){this.message=a||"This operation is not supported",Error.call(this)};Wa.prototype=Error.prototype;var Xa=Ea.NotImplementedError=function(a){this.message=a||"This operation is not implemented",Error.call(this)};Xa.prototype=Error.prototype;var Ya=Ea.helpers.notImplemented=function(){throw new Xa},Za=Ea.helpers.notSupported=function(){throw new Wa},$a="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";za.Set&&"function"==typeof(new za.Set)["@@iterator"]&&($a="@@iterator");var _a=Ea.doneEnumerator={done:!0,value:a},ab=Ea.helpers.isIterable=function(b){return b[$a]!==a},bb=Ea.helpers.isArrayLike=function(b){return b&&b.length!==a};Ea.helpers.iterator=$a;var cb,db=Ea.internals.bindCallback=function(a,b,c){if("undefined"==typeof b)return a;switch(c){case 0:return function(){return a.call(b)};case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)}}return function(){return a.apply(b,arguments)}},eb=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],fb=eb.length,gb="[object Arguments]",hb="[object Array]",ib="[object Boolean]",jb="[object Date]",kb="[object Error]",lb="[object Function]",mb="[object Number]",nb="[object Object]",ob="[object RegExp]",pb="[object String]",qb=Object.prototype.toString,rb=Object.prototype.hasOwnProperty,sb=qb.call(arguments)==gb,tb=Error.prototype,ub=Object.prototype,vb=String.prototype,wb=ub.propertyIsEnumerable;try{cb=!(qb.call(document)==nb&&!({toString:0}+""))}catch(Pa){cb=!0}var xb={};xb[hb]=xb[jb]=xb[mb]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},xb[ib]=xb[pb]={constructor:!0,toString:!0,valueOf:!0},xb[kb]=xb[lb]=xb[ob]={constructor:!0,toString:!0},xb[nb]={constructor:!0};var yb={};!function(){var a=function(){this.x=1},b=[];a.prototype={valueOf:1,y:1};for(var c in new a)b.push(c);for(c in arguments);yb.enumErrorProps=wb.call(tb,"message")||wb.call(tb,"name"),yb.enumPrototypes=wb.call(a,"prototype"),yb.nonEnumArgs=0!=c,yb.nonEnumShadows=!/valueOf/.test(b)}(1);var zb=Ea.internals.isObject=function(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1},Ab=function(a){return a&&"object"==typeof a?qb.call(a)==gb:!1};sb||(Ab=function(a){return a&&"object"==typeof a?rb.call(a,"callee"):!1});var Bb,Cb=Ea.internals.isEqual=function(a,b){return m(a,b,[],[])},Db=({}.hasOwnProperty,Array.prototype.slice),Eb=this.inherits=Ea.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c},Fb=Ea.internals.addProperties=function(a){for(var b=[],c=1,d=arguments.length;d>c;c++)b.push(arguments[c]);for(var e=0,f=b.length;f>e;e++){var g=b[e];for(var h in g)a[h]=g[h]}},Gb=Ea.internals.addRef=function(a,b){return new Ld(function(c){return new Mb(b.getDisposable(),a.subscribe(c))})},Hb={e:{}};Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=Db.call(arguments,1),d=function(){function e(){}if(this instanceof d){e.prototype=b.prototype;var f=new e,g=b.apply(f,c.concat(Db.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(Db.call(arguments)))};return d}),Array.prototype.forEach||(Array.prototype.forEach=function(a,b){var c,d;if(null==this)throw new TypeError(" this is null or not defined");var e=Object(this),f=e.length>>>0;if("function"!=typeof a)throw new TypeError(a+" is not a function");for(arguments.length>1&&(c=b),d=0;f>d;){var g;d in e&&(g=e[d],a.call(c,g,d,e)),d++}});var Ib=Object("a"),Jb="a"!=Ib[0]||!(0 in Ib);Array.prototype.every||(Array.prototype.every=function(a){var b=Object(this),c=Jb&&{}.toString.call(this)==pb?this.split(""):b,d=c.length>>>0,e=arguments[1];if({}.toString.call(a)!=lb)throw new TypeError(a+" is not a function");for(var f=0;d>f;f++)if(f in c&&!a.call(e,c[f],f,b))return!1;return!0}),Array.prototype.map||(Array.prototype.map=function(a){var b=Object(this),c=Jb&&{}.toString.call(this)==pb?this.split(""):b,d=c.length>>>0,e=Array(d),f=arguments[1];if({}.toString.call(a)!=lb)throw new TypeError(a+" is not a function");for(var g=0;d>g;g++)g in c&&(e[g]=a.call(f,c[g],g,b));return e}),Array.prototype.filter||(Array.prototype.filter=function(a){for(var b,c=[],d=new Object(this),e=0,f=d.length>>>0;f>e;e++)b=d[e],e in d&&a.call(arguments[1],b,e,d)&&c.push(b);return c}),Array.isArray||(Array.isArray=function(a){return{}.toString.call(a)==hb}),Array.prototype.indexOf||(Array.prototype.indexOf=function(a){var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=0;if(arguments.length>1&&(d=Number(arguments[1]),d!==d?d=0:0!==d&&d!=1/0&&d!==-(1/0)&&(d=(d>0||-1)*Math.floor(Math.abs(d)))),d>=c)return-1;for(var e=d>=0?d:Math.max(c-Math.abs(d),0);c>e;e++)if(e in b&&b[e]===a)return e;return-1}),Object.prototype.propertyIsEnumerable||(Object.prototype.propertyIsEnumerable=function(a){for(var b in this)if(b===a)return!0;return!1}),Object.keys||(Object.keys=function(){"use strict";var a=Object.prototype.hasOwnProperty,b=!{toString:null}.propertyIsEnumerable("toString");return function(c){if("object"!=typeof c&&("function"!=typeof c||null===c))throw new TypeError("Object.keys called on non-object");var d,e,f=[];for(d in c)a.call(c,d)&&f.push(d);if(b)for(e=0;fb>e;e++)a.call(c,eb[e])&&f.push(eb[e]);return f}}()),r.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var Kb=Ea.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Lb=Kb.prototype;Lb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Lb.percolate=function(a){if(!(a>=this.length||0>a)){var b=a-1>>1;if(!(0>b||b===a)&&this.isHigherPriority(a,b)){var c=this.items[a];this.items[a]=this.items[b],this.items[b]=c,this.percolate(b)}}},Lb.heapify=function(a){if(+a||(a=0),!(a>=this.length||0>a)){var b=2*a+1,c=2*a+2,d=a;if(b<this.length&&this.isHigherPriority(b,d)&&(d=b),c<this.length&&this.isHigherPriority(c,d)&&(d=c),d!==a){var e=this.items[a];this.items[a]=this.items[d],this.items[d]=e,this.heapify(d)}}},Lb.peek=function(){return this.items[0].value},Lb.removeAt=function(b){this.items[b]=this.items[--this.length],this.items[this.length]=a,this.heapify()},Lb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Lb.enqueue=function(a){var b=this.length++;this.items[b]=new r(Kb.count++,a),this.percolate(b)},Lb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},Kb.count=0;var Mb=Ea.CompositeDisposable=function(){var a,b,c=[];if(Array.isArray(arguments[0]))c=arguments[0],b=c.length;else for(b=arguments.length,c=new Array(b),a=0;b>a;a++)c[a]=arguments[a];for(a=0;b>a;a++)if(!Rb(c[a]))throw new TypeError("Not a disposable");this.disposables=c,this.isDisposed=!1,this.length=c.length},Nb=Mb.prototype;Nb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Nb.remove=function(a){var b=!1;if(!this.isDisposed){var c=this.disposables.indexOf(a);-1!==c&&(b=!0,this.disposables.splice(c,1),this.length--,a.dispose())}return b},Nb.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;for(var a=this.disposables.length,b=new Array(a),c=0;a>c;c++)b[c]=this.disposables[c];for(this.disposables=[],this.length=0,c=0;a>c;c++)b[c].dispose()}};var Ob=Ea.Disposable=function(a){this.isDisposed=!1,this.action=a||Fa};Ob.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var Pb=Ob.create=function(a){return new Ob(a)},Qb=Ob.empty={dispose:Fa},Rb=Ob.isDisposable=function(a){return a&&Na(a.dispose)},Sb=Ob.checkDisposed=function(a){if(a.isDisposed)throw new Ua},Tb=Ea.SingleAssignmentDisposable=function(){this.isDisposed=!1,this.current=null};Tb.prototype.getDisposable=function(){return this.current},Tb.prototype.setDisposable=function(a){if(this.current)throw new Error("Disposable has already been assigned");var b=this.isDisposed;!b&&(this.current=a),b&&a&&a.dispose()},Tb.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var Ub=Ea.SerialDisposable=function(){this.isDisposed=!1,this.current=null};Ub.prototype.getDisposable=function(){return this.current},Ub.prototype.setDisposable=function(a){var b=this.isDisposed;if(!b){var c=this.current;this.current=a}c&&c.dispose(),b&&a&&a.dispose()},Ub.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var Vb=Ea.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?Qb:new a(this)},b}();t.prototype.dispose=function(){this.scheduler.scheduleWithState(this,u)};var Wb=Ea.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||Ja,this.disposable=new Tb};Wb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},Wb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},Wb.prototype.isCancelled=function(){return this.disposable.isDisposed},Wb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var Xb=Ea.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),Qb}a.isScheduler=function(b){return b instanceof a};var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=Ha,a.normalize=function(a){return 0>a&&(a=0),a},a}(),Yb=Xb.normalize,Zb=Xb.isScheduler;!function(a){function b(a,b){function c(b){e(b,function(b){var d=!1,e=!1,g=a.scheduleWithState(b,function(a,b){return d?f.remove(g):e=!0,c(b),Qb});e||(f.add(g),d=!0)})}var d=b[0],e=b[1],f=new Mb;return c(d),f}function c(a,b,c){function d(b){f(b,function(b,e){var f=!1,h=!1,i=a[c](b,e,function(a,b){return f?g.remove(i):h=!0,d(b),Qb});h||(g.add(i),f=!0)})}var e=b[0],f=b[1],g=new Mb;return d(e),g}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,d)},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState([a,c],b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative([a,d],b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,d)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute([a,d],b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(Xb.prototype),function(a){Xb.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},Xb.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof za.setInterval)throw new Wa;b=Yb(b);var d=a,e=za.setInterval(function(){d=c(d)},b);return Pb(function(){za.clearInterval(e)})}}(Xb.prototype),function(a){a.catchError=a["catch"]=function(a){return new hc(this,a)}}(Xb.prototype);var $b,_b,ac=Ea.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new Tb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),bc=Xb.immediate=function(){function a(a,b){return b(this,a)}return new Xb(Ha,a,Za,Za)}(),cc=Xb.currentThread=function(){function a(){for(;c.length>0;){var a=c.dequeue();!a.isCancelled()&&a.invoke()}}function b(b,d){var e=new Wb(this,b,d,this.now());if(c)c.enqueue(e);else{c=new Kb(4),c.enqueue(e);var f=p(a)();if(c=null,f===Hb)return q(f.e)}return e.disposable}var c,d=new Xb(Ha,b,Za,Za);return d.scheduleRequired=function(){return!c},d}(),dc=function(){var a,b=Fa;if(za.setTimeout)a=za.setTimeout,b=za.clearTimeout;else{if(!za.WScript)throw new Wa;a=function(a,b){za.WScript.Sleep(b),a()}}return{setTimeout:a,clearTimeout:b}}(),ec=dc.setTimeout,fc=dc.clearTimeout;!function(){function a(b){if(f)ec(function(){a(b)},0);else{var c=e[b];if(c){f=!0;var d=p(c)();if(_b(b),f=!1,d===Hb)return q(d.e)}}}function b(){if(!za.postMessage||za.importScripts)return!1;var a=!1,b=za.onmessage;return za.onmessage=function(){a=!0},za.postMessage("","*"),za.onmessage=b,a}function c(b){"string"==typeof b.data&&b.data.substring(0,i.length)===i&&a(b.data.substring(i.length))}var d=1,e={},f=!1;_b=function(a){delete e[a]};var g=RegExp("^"+String(qb).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),h="function"==typeof(h=Da&&Ca&&Da.setImmediate)&&!g.test(h)&&h;if(Na(h))$b=function(b){var c=d++;return e[c]=b,h(function(){a(c)}),c};else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))$b=function(b){var c=d++;return e[c]=b,process.nextTick(function(){a(c)}),c};else if(b()){var i="ms.rx.schedule"+Math.random();za.addEventListener?za.addEventListener("message",c,!1):za.attachEvent?za.attachEvent("onmessage",c):za.onmessage=c,$b=function(a){var b=d++;return e[b]=a,za.postMessage(i+currentId,"*"),b}}else if(za.MessageChannel){var j=new za.MessageChannel;j.port1.onmessage=function(b){a(b.data)},$b=function(a){var b=d++;return e[b]=a,j.port2.postMessage(b),b}}else $b="document"in za&&"onreadystatechange"in za.document.createElement("script")?function(b){var c=za.document.createElement("script"),f=d++;return e[f]=b,c.onreadystatechange=function(){a(f),c.onreadystatechange=null,c.parentNode.removeChild(c),c=null},za.document.documentElement.appendChild(c),f}:function(b){var c=d++;return e[c]=b,ec(function(){a(c)},0),c}}();var gc=Xb.timeout=Xb["default"]=function(){function a(a,b){var c=this,d=new Tb,e=$b(function(){!d.isDisposed&&d.setDisposable(b(c,a))});return new Mb(d,Pb(function(){_b(e)}))}function b(a,b,c){var d=this,e=Xb.normalize(b),f=new Tb;if(0===e)return d.scheduleWithState(a,c);var g=ec(function(){!f.isDisposed&&f.setDisposable(c(d,a))},e);return new Mb(f,Pb(function(){fc(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Xb(Ha,a,b,c)}(),hc=function(a){function b(a,b){return this._scheduler.scheduleWithState(a,this._wrap(b))}function c(a,b,c){return this._scheduler.scheduleWithRelativeAndState(a,b,this._wrap(c))}function d(a,b,c){return this._scheduler.scheduleWithAbsoluteAndState(a,b,this._wrap(c))}function e(e,f){this._scheduler=e,this._handler=f,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this,this._scheduler.now.bind(this._scheduler),b,c,d)}return Eb(e,a),e.prototype._clone=function(a){return new e(a,this._handler)},e.prototype._wrap=function(a){var b=this;return function(c,d){try{return a(b._getRecursiveWrapper(c),d)}catch(e){if(!b._handler(e))throw e;return Qb}}},e.prototype._getRecursiveWrapper=function(a){if(this._recursiveOriginal!==a){this._recursiveOriginal=a;var b=this._clone(a);b._recursiveOriginal=a,b._recursiveWrapper=b,this._recursiveWrapper=b}return this._recursiveWrapper},e.prototype.schedulePeriodicWithState=function(a,b,c){var d=this,e=!1,f=new Tb;return f.setDisposable(this._scheduler.schedulePeriodicWithState(a,b,function(a){if(e)return null;try{return c(a)}catch(b){if(e=!0,!d._handler(b))throw b;return f.dispose(),null}})),f},e}(Xb),ic=Ea.Notification=function(){function a(a,b,c,d,e,f){this.kind=a,this.value=b,this.exception=c,this._accept=d,this._acceptObservable=e,this.toString=f}return a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return Zb(a)||(a=bc),new Ld(function(c){return a.scheduleWithState(b,function(a,b){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),jc=ic.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){return new ic("N",d,null,a,b,c)}}(),kc=ic.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){return new ic("E",null,d,a,b,c)}}(),lc=ic.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){return new ic("C",null,null,a,b,c)}}(),mc=Ea.Observer=function(){};mc.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a);
+
+}},mc.prototype.asObserver=function(){return new qc(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},mc.prototype.checked=function(){return new rc(this)};var nc=mc.create=function(a,b,c){return a||(a=Fa),b||(b=Ka),c||(c=Fa),new qc(a,b,c)};mc.fromNotifier=function(a,b){return new qc(function(c){return a.call(b,jc(c))},function(c){return a.call(b,kc(c))},function(){return a.call(b,lc())})},mc.prototype.notifyOn=function(a){return new tc(a,this)},mc.prototype.makeSafe=function(a){return new AnonymousSafeObserver(this._onNext,this._onError,this._onCompleted,a)};var oc,pc=Ea.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return Eb(b,a),b.prototype.next=Ya,b.prototype.error=Ya,b.prototype.completed=Ya,b.prototype.onNext=function(a){this.isStopped||this.next(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.error(a))},b.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(mc),qc=Ea.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return Eb(b,a),b.prototype.next=function(a){this._onNext(a)},b.prototype.error=function(a){this._onError(a)},b.prototype.completed=function(){this._onCompleted()},b}(pc),rc=function(a){function b(b){a.call(this),this._observer=b,this._state=0}Eb(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();var b=p(this._observer.onNext).call(this._observer,a);this._state=0,b===Hb&&q(b.e)},c.onError=function(a){this.checkAccess();var b=p(this._observer.onError).call(this._observer,a);this._state=2,b===Hb&&q(b.e)},c.onCompleted=function(){this.checkAccess();var a=p(this._observer.onCompleted).call(this._observer);this._state=2,a===Hb&&q(a.e)},c.checkAccess=function(){if(1===this._state)throw new Error("Re-entrancy detected");if(2===this._state)throw new Error("Observer completed");0===this._state&&(this._state=1)},b}(mc),sc=Ea.internals.ScheduledObserver=function(a){function b(b,c){a.call(this),this.scheduler=b,this.observer=c,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new Ub}return Eb(b,a),b.prototype.next=function(a){var b=this;this.queue.push(function(){b.observer.onNext(a)})},b.prototype.error=function(a){var b=this;this.queue.push(function(){b.observer.onError(a)})},b.prototype.completed=function(){var a=this;this.queue.push(function(){a.observer.onCompleted()})},b.prototype.ensureActive=function(){var a=!1,b=this;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(a){var c;if(!(b.queue.length>0))return void(b.isAcquired=!1);c=b.queue.shift();try{c()}catch(d){throw b.queue=[],b.hasFaulted=!0,d}a()}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(pc),tc=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return Eb(b,a),b.prototype.next=function(b){a.prototype.next.call(this,b),this.ensureActive()},b.prototype.error=function(b){a.prototype.error.call(this,b),this.ensureActive()},b.prototype.completed=function(){a.prototype.completed.call(this),this.ensureActive()},b.prototype.dispose=function(){a.prototype.dispose.call(this),this._cancel&&this._cancel.dispose(),this._cancel=null},b}(sc),uc=Ea.Observable=function(){function a(a){if(Ea.config.longStackSupport&&Oa){try{throw new Error}catch(b){this.stack=b.stack.substring(b.stack.indexOf("\n")+1)}var d=this;this._subscribe=function(b){var e=b.onError.bind(b);return b.onError=function(a){c(a,d),e(a)},a.call(d,b)}}else this._subscribe=a}return oc=a.prototype,oc.subscribe=oc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:nc(a,b,c))},oc.subscribeOnNext=function(a,b){return this._subscribe(nc("undefined"!=typeof b?function(c){a.call(b,c)}:a))},oc.subscribeOnError=function(a,b){return this._subscribe(nc(null,"undefined"!=typeof b?function(c){a.call(b,c)}:a))},oc.subscribeOnCompleted=function(a,b){return this._subscribe(nc(null,null,"undefined"!=typeof b?function(){a.call(b)}:a))},a}(),vc=Ea.ObservableBase=function(a){function b(a){return a&&Na(a.dispose)?a:Na(a)?Pb(a):Qb}function c(a,c){var d=c[0],e=c[1],f=p(e.subscribeCore).call(e,d);return f!==Hb||d.fail(Hb.e)?void d.setDisposable(b(f)):q(Hb.e)}function d(a){var b=new Md(a),d=[b,this];return cc.scheduleRequired()?cc.scheduleWithState(d,c):c(null,d),b}function e(){a.call(this,d)}return Eb(e,a),e.prototype.subscribeCore=Ya,e}(uc),wc=Ea.internals.Enumerable=function(){},xc=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b,c){this.o=a,this.s=b,this.e=c,this.isStopped=!1}return Eb(b,a),b.prototype.subscribeCore=function(a){var b,d=new Ub,e=bc.scheduleRecursiveWithState(this.sources[$a](),function(e,f){if(!b){var g=p(e.next).call(e);if(g===Hb)return a.onError(g.e);if(g.done)return a.onCompleted();var h=g.value;La(h)&&(h=Ec(h));var i=new Tb;d.setDisposable(i),i.setDisposable(h.subscribe(new c(a,f,e)))}});return new Mb(d,e,Pb(function(){b=!0}))},c.prototype.onNext=function(a){this.isStopped||this.o.onNext(a)},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.s(this.e))},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(vc);wc.prototype.concat=function(){return new xc(this)};var yc=function(a){function b(b){this.sources=b,a.call(this)}return Eb(b,a),b.prototype.subscribeCore=function(a){var b,c=this.sources[$a](),d=new Ub,e=bc.scheduleRecursiveWithState(null,function(e,f){if(!b){var g=p(c.next).call(c);if(g===Hb)return a.onError(g.e);if(g.done)return null!==e?a.onError(e):a.onCompleted();var h=g.value;La(h)&&(h=Ec(h));var i=new Tb;d.setDisposable(i),i.setDisposable(h.subscribe(function(b){a.onNext(b)},f,function(){a.onCompleted()}))}});return new Mb(d,e,Pb(function(){b=!0}))},b}(vc);wc.prototype.catchError=function(){return new yc(this)},wc.prototype.catchErrorWhen=function(a){var b=this;return new Ld(function(c){var d,e,f=new Od,g=new Od,h=a(f),i=h.subscribe(g),j=b[$a](),k=new Ub,l=bc.scheduleRecursive(function(a){if(!d){var b=p(j.next).call(j);if(b===Hb)return c.onError(b.e);if(b.done)return void(e?c.onError(e):c.onCompleted());var h=b.value;La(h)&&(h=Ec(h));var i=new Tb,l=new Tb;k.setDisposable(new Mb(l,i)),i.setDisposable(h.subscribe(function(a){c.onNext(a)},function(b){l.setDisposable(g.subscribe(a,function(a){c.onError(a)},function(){c.onCompleted()})),f.onNext(b)},function(){c.onCompleted()}))}});return new Mb(i,k,l,Pb(function(){d=!0}))})};var zc=function(a){function b(a,b){this.v=a,this.c=null==b?-1:b}function c(a){this.v=a.v,this.l=a.c}return Eb(b,a),b.prototype[$a]=function(){return new c(this)},c.prototype.next=function(){return 0===this.l?_a:(this.l>0&&this.l--,{done:!1,value:this.v})},b}(wc),Ac=wc.repeat=function(a,b){return new zc(a,b)},Bc=function(a){function b(a,b,c){this.s=a,this.fn=b?db(b,c,3):null}function c(a){this.i=-1,this.s=a.s,this.l=this.s.length,this.fn=a.fn}return Eb(b,a),b.prototype[$a]=function(){return new c(this)},c.prototype.next=function(){return++this.i<this.l?{done:!1,value:this.fn?this.fn(this.s[this.i],this.i,this.s):this.s[this.i]}:_a},b}(wc),Cc=wc.of=function(a,b,c){return new Bc(a,b,c)};oc.observeOn=function(a){var b=this;return new Ld(function(c){return b.subscribe(new tc(a,c))},b)},oc.subscribeOn=function(a){var b=this;return new Ld(function(c){var d=new Tb,e=new Ub;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new t(a,b.subscribe(c)))})),e},b)};var Dc=function(a){function b(b){this.p=b,a.call(this)}return Eb(b,a),b.prototype.subscribeCore=function(a){return this.p.then(function(b){a.onNext(b),a.onCompleted()},function(b){a.onError(b)}),Qb},b}(vc),Ec=uc.fromPromise=function(a){return new Dc(a)};oc.toPromise=function(a){if(a||(a=Ea.config.Promise),!a)throw new Wa("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})};var Fc=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.a=[],this.isStopped=!1}return Eb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a))},c.prototype.onNext=function(a){this.isStopped||this.a.push(a)},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onNext(this.a),this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(vc);oc.toArray=function(){return new Fc(this)},uc.create=uc.createWithDisposable=function(a,b){return new Ld(a,b)};var Gc=uc.defer=function(a){return new Ld(function(b){var c;try{c=a()}catch(d){return Xc(d).subscribe(b)}return La(c)&&(c=Ec(c)),c.subscribe(b)})},Hc=function(a){function b(b){this.scheduler=b,a.call(this)}function c(a,b){this.observer=a,this.parent=b}function d(a,b){b.onCompleted()}return Eb(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this);return b.run()},c.prototype.run=function(){return this.parent.scheduler.scheduleWithState(this.observer,d)},b}(vc),Ic=uc.empty=function(a){return Zb(a)||(a=bc),new Hc(a)},Jc=function(a){function b(b,c,d){this.iterable=b,this.mapper=c,this.scheduler=d,a.call(this)}return Eb(b,a),b.prototype.subscribeCore=function(a){var b=new Kc(a,this);return b.run()},b}(vc),Kc=function(){function a(a,b){this.observer=a,this.parent=b}return a.prototype.run=function(){function a(a,b){try{var f=c.next()}catch(g){return d.onError(g)}if(f.done)return d.onCompleted();var h=f.value;if(e)try{h=e(h,a)}catch(g){return d.onError(g)}d.onNext(h),b(a+1)}var b=Object(this.parent.iterable),c=A(b),d=this.observer,e=this.parent.mapper;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}(),Lc=Math.pow(2,53)-1;v.prototype[$a]=function(){return new w(this._s)},w.prototype[$a]=function(){return this},w.prototype.next=function(){return this._i<this._l?{done:!1,value:this._s.charAt(this._i++)}:_a},x.prototype[$a]=function(){return new y(this._a)},y.prototype[$a]=function(){return this},y.prototype.next=function(){return this._i<this._l?{done:!1,value:this._a[this._i++]}:_a};var Mc=uc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!Na(b))throw new Error("mapFn when provided must be a function");if(b)var e=db(b,c,2);return Zb(d)||(d=cc),new Jc(a,e,d)},Nc=function(a){function b(b,c){this.args=b,this.scheduler=c,a.call(this)}return Eb(b,a),b.prototype.subscribeCore=function(a){var b=new D(a,this);return b.run()},b}(vc);D.prototype.run=function(){function a(a,e){d>a?(b.onNext(c[a]),e(a+1)):b.onCompleted()}var b=this.observer,c=this.parent.args,d=c.length;return this.parent.scheduler.scheduleRecursiveWithState(0,a)};var Oc=uc.fromArray=function(a,b){return Zb(b)||(b=cc),new Nc(a,b)};uc.generate=function(a,b,c,d,e){return Zb(e)||(e=cc),new Ld(function(f){var g=!0;return e.scheduleRecursiveWithState(a,function(a,e){var h,i;try{g?g=!1:a=c(a),h=b(a),h&&(i=d(a))}catch(j){return f.onError(j)}h?(f.onNext(i),e(a)):f.onCompleted()})})},uc.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return new Nc(b,cc)},uc.ofWithScheduler=function(a){for(var b=arguments.length,c=new Array(b-1),d=1;b>d;d++)c[d-1]=arguments[d];return new Nc(c,a)};var Pc=function(a){function b(){a.call(this)}return Eb(b,a),b.prototype.subscribeCore=function(a){return Qb},b}(vc),Qc=uc.never=function(){return new Pc},Rc=function(a){function b(b,c){this.obj=b,this.keys=Object.keys(b),this.scheduler=c,a.call(this)}return Eb(b,a),b.prototype.subscribeCore=function(a){var b=new F(a,this);return b.run()},b}(vc);F.prototype.run=function(){function a(a,f){if(e>a){var g=d[a];b.onNext([g,c[g]]),f(a+1)}else b.onCompleted()}var b=this.observer,c=this.parent.obj,d=this.parent.keys,e=d.length;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},uc.pairs=function(a,b){return b||(b=cc),new Rc(a,b)};var Sc=function(a){function b(b,c,d){this.start=b,this.rangeCount=c,this.scheduler=d,a.call(this)}return Eb(b,a),b.prototype.subscribeCore=function(a){var b=new Tc(a,this);return b.run()},b}(vc),Tc=function(){function a(a,b){this.observer=a,this.parent=b}return a.prototype.run=function(){function a(a,e){c>a?(d.onNext(b+a),e(a+1)):d.onCompleted()}var b=this.parent.start,c=this.parent.rangeCount,d=this.observer;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}();uc.range=function(a,b,c){return Zb(c)||(c=cc),new Sc(a,b,c)};var Uc=function(a){function b(b,c,d){this.value=b,this.repeatCount=null==c?-1:c,this.scheduler=d,a.call(this)}return Eb(b,a),b.prototype.subscribeCore=function(a){var b=new G(a,this);return b.run()},b}(vc);G.prototype.run=function(){function a(a,d){return(-1===a||a>0)&&(b.onNext(c),a>0&&a--),0===a?b.onCompleted():void d(a)}var b=this.observer,c=this.parent.value;return this.parent.scheduler.scheduleRecursiveWithState(this.parent.repeatCount,a)},uc.repeat=function(a,b,c){return Zb(c)||(c=cc),new Uc(a,b,c)};var Vc=function(a){function b(b,c){this.value=b,this.scheduler=c,a.call(this)}function c(a,b){this.observer=a,this.parent=b}function d(a,b){var c=b[0],d=b[1];d.onNext(c),d.onCompleted()}return Eb(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this);return b.run()},c.prototype.run=function(){return this.parent.scheduler.scheduleWithState([this.parent.value,this.observer],d)},b}(vc),Wc=(uc["return"]=uc.just=uc.returnValue=function(a,b){return Zb(b)||(b=bc),new Vc(a,b)},function(a){function b(b,c){this.error=b,this.scheduler=c,a.call(this)}function c(a,b){this.o=a,this.p=b}function d(a,b){var c=b[0],d=b[1];d.onError(c)}return Eb(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this);return b.run()},c.prototype.run=function(){return this.p.scheduler.scheduleWithState([this.p.error,this.o],d)},b}(vc)),Xc=uc["throw"]=uc.throwError=uc.throwException=function(a,b){return Zb(b)||(b=bc),new Wc(a,b)};uc.using=function(a,b){return new Ld(function(c){var d,e,f=Qb;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new Mb(Xc(g).subscribe(c),f)}return new Mb(e.subscribe(c),f)})},oc.amb=function(a){var b=this;return new Ld(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new Tb,j=new Tb;return La(a)&&(a=Ec(a)),i.setDisposable(b.subscribe(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()})),j.setDisposable(a.subscribe(function(a){e(),f===h&&c.onNext(a)},function(a){e(),f===h&&c.onError(a)},function(){e(),f===h&&c.onCompleted()})),new Mb(i,j)})},uc.amb=function(){function a(a,b){return a.amb(b)}var b=Qc(),c=[];if(Array.isArray(arguments[0]))c=arguments[0];else for(var d=0,e=arguments.length;e>d;d++)c.push(arguments[d]);for(var d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},oc["catch"]=oc.catchError=oc.catchException=function(a){return"function"==typeof a?H(this,a):Yc([this,a])};var Yc=uc.catchError=uc["catch"]=uc.catchException=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return Cc(a).catchError()};oc.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return Array.isArray(b[0])?b[0].unshift(this):b.unshift(this),Zc.apply(this,b)};var Zc=uc.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.pop();return Array.isArray(b[0])&&(b=b[0]),new Ld(function(a){function c(b){if(h[b]=!0,i||(i=h.every(Ga))){try{var c=d.apply(null,k)}catch(e){return a.onError(e)}a.onNext(c)}else j.filter(function(a,c){return c!==b}).every(Ga)&&a.onCompleted()}function e(b){j[b]=!0,j.every(Ga)&&a.onCompleted()}for(var f=b.length,g=function(){return!1},h=n(f,g),i=!1,j=n(f,g),k=new Array(f),l=new Array(f),m=0;f>m;m++)!function(d){var f=b[d],g=new Tb;La(f)&&(f=Ec(f)),g.setDisposable(f.subscribe(function(a){k[d]=a,c(d)},function(b){a.onError(b)},function(){e(d)})),l[d]=g}(m);return new Mb(l)},this)};oc.concat=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return a.unshift(this),_c.apply(null,a)};var $c=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b){this.sources=a,this.o=b}return Eb(b,a),b.prototype.subscribeCore=function(a){var b=new c(this.sources,a);return b.run()},c.prototype.run=function(){var a,b=new Ub,c=this.sources,d=c.length,e=this.o,f=bc.scheduleRecursiveWithState(0,function(f,g){if(!a){if(f===d)return e.onCompleted();var h=c[f];La(h)&&(h=Ec(h));var i=new Tb;b.setDisposable(i),i.setDisposable(h.subscribe(function(a){e.onNext(a)},function(a){e.onError(a)},function(){g(f+1)}))}});return new Mb(b,f,Pb(function(){a=!0}))},b}(vc),_c=uc.concat=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(arguments.length);for(var b=0,c=arguments.length;c>b;b++)a[b]=arguments[b]}return new $c(a)};oc.concatAll=oc.concatObservable=function(){return this.merge(1)};var ad=function(a){function b(b,c){this.source=b,this.maxConcurrent=c,a.call(this)}return Eb(b,a),b.prototype.subscribeCore=function(a){var b=new Mb;return b.add(this.source.subscribe(new bd(a,this.maxConcurrent,b))),b},b}(vc),bd=function(){function a(a,b,c){this.o=a,this.max=b,this.g=c,this.done=!1,this.q=[],this.activeCount=0,this.isStopped=!1}function b(a,b){this.parent=a,this.sad=b,this.isStopped=!1}return a.prototype.handleSubscribe=function(a){var c=new Tb;this.g.add(c),La(a)&&(a=Ec(a)),c.setDisposable(a.subscribe(new b(this,c)))},a.prototype.onNext=function(a){this.isStopped||(this.activeCount<this.max?(this.activeCount++,this.handleSubscribe(a)):this.q.push(a))},a.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},a.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,0===this.activeCount&&this.o.onCompleted())},a.prototype.dispose=function(){this.isStopped=!0},a.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b.prototype.onNext=function(a){this.isStopped||this.parent.o.onNext(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.o.onError(a))},b.prototype.onCompleted=function(){if(!this.isStopped){this.isStopped=!0;var a=this.parent;a.g.remove(this.sad),a.q.length>0?a.handleSubscribe(a.q.shift()):(a.activeCount--,a.done&&0===a.activeCount&&a.o.onCompleted())}},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},a}();oc.merge=function(a){return"number"!=typeof a?cd(this,a):new ad(this,a)};var cd=uc.merge=function(){var a,b,c=[],d=arguments.length;if(arguments[0])if(Zb(arguments[0]))for(a=arguments[0],b=1;d>b;b++)c.push(arguments[b]);else for(a=bc,b=0;d>b;b++)c.push(arguments[b]);else for(a=bc,b=1;d>b;b++)c.push(arguments[b]);return Array.isArray(c[0])&&(c=c[0]),E(a,c).mergeAll()},dd=function(a){function b(b){this.source=b,a.call(this)}function c(a,b){this.o=a,this.g=b,this.isStopped=!1,this.done=!1}function d(a,b,c){this.parent=a,this.g=b,this.sad=c,this.isStopped=!1}return Eb(b,a),b.prototype.subscribeCore=function(a){var b=new Mb,d=new Tb;return b.add(d),d.setDisposable(this.source.subscribe(new c(a,b))),b},c.prototype.onNext=function(a){if(!this.isStopped){var b=new Tb;this.g.add(b),La(a)&&(a=Ec(a)),b.setDisposable(a.subscribe(new d(this,this.g,b)))}},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,1===this.g.length&&this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},d.prototype.onNext=function(a){this.isStopped||this.parent.o.onNext(a)},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.o.onError(a))},d.prototype.onCompleted=function(){if(!this.isStopped){var a=this.parent;this.isStopped=!0,a.g.remove(this.sad),a.done&&1===a.g.length&&a.o.onCompleted()}},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},b}(vc);oc.mergeAll=oc.mergeObservable=function(){return new dd(this)};var ed=Ea.CompositeError=function(a){this.name="NotImplementedError",this.innerErrors=a,this.message="This contains multiple errors. Check the innerErrors",Error.call(this)};ed.prototype=Error.prototype,uc.mergeDelayError=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}var d=E(null,a);return new Ld(function(a){function b(){0===g.length?a.onCompleted():a.onError(1===g.length?g[0]:new ed(g))}var c=new Mb,e=new Tb,f=!1,g=[];return c.add(e),e.setDisposable(d.subscribe(function(d){var e=new Tb;c.add(e),La(d)&&(d=Ec(d)),e.setDisposable(d.subscribe(function(b){a.onNext(b)},function(a){g.push(a),c.remove(e),f&&1===c.length&&b()},function(){c.remove(e),f&&1===c.length&&b()}))},function(a){g.push(a),f=!0,1===c.length&&b()},function(){f=!0,1===c.length&&b()})),c})},oc.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return fd([this,a])};var fd=uc.onErrorResumeNext=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return new Ld(function(b){var c=0,d=new Ub,e=bc.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],La(f)&&(f=Ec(f)),g=new Tb,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new Mb(d,e)})};oc.skipUntil=function(a){var b=this;return new Ld(function(c){var d=!1,e=new Mb(b.subscribe(function(a){d&&c.onNext(a)},function(a){c.onError(a)},function(){d&&c.onCompleted()}));La(a)&&(a=Ec(a));var f=new Tb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},function(a){c.onError(a)},function(){f.dispose()})),e},b)};var gd=function(a){function b(b){this.source=b,a.call(this)}function c(a,b){this.o=a,this.inner=b,this.stopped=!1,this.latest=0,this.hasLatest=!1,this.isStopped=!1}function d(a,b){this.parent=a,this.id=b,this.isStopped=!1}return Eb(b,a),b.prototype.subscribeCore=function(a){var b=new Ub,d=this.source.subscribe(new c(a,b));return new Mb(d,b)},c.prototype.onNext=function(a){if(!this.isStopped){var b=new Tb,c=++this.latest;this.hasLatest=!0,this.inner.setDisposable(b),La(a)&&(a=Ec(a)),b.setDisposable(a.subscribe(new d(this,c)))}},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.stopped=!0,!this.hasLatest&&this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},d.prototype.onNext=function(a){this.isStopped||this.parent.latest===this.id&&this.parent.o.onNext(a)},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.latest===this.id&&this.parent.o.onError(a))},d.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.parent.latest===this.id&&(this.parent.hasLatest=!1,this.parent.isStopped&&this.parent.o.onCompleted()))},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},b}(vc);oc["switch"]=oc.switchLatest=function(){return new gd(this)};var hd=function(a){function b(b,c){this.source=b,this.other=La(c)?Ec(c):c,a.call(this)}function c(a){this.o=a,this.isStopped=!1}return Eb(b,a),b.prototype.subscribeCore=function(a){return new Mb(this.source.subscribe(a),this.other.subscribe(new c(a)))},c.prototype.onNext=function(a){this.isStopped||this.o.onCompleted()},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){!this.isStopped&&(this.isStopped=!0)},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(vc);oc.takeUntil=function(a){return new hd(this,a)},oc.withLatestFrom=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.pop(),e=this;return Array.isArray(b[0])&&(b=b[0]),new Ld(function(a){for(var c=b.length,f=n(c,I),g=!1,h=new Array(c),i=new Array(c+1),j=0;c>j;j++)!function(c){var d=b[c],e=new Tb;La(d)&&(d=Ec(d)),e.setDisposable(d.subscribe(function(a){h[c]=a,f[c]=!0,g=f.every(Ga)},function(b){a.onError(b)},Fa)),i[c]=e}(j);var k=new Tb;return k.setDisposable(e.subscribe(function(b){var c=[b].concat(h);if(g){var e=p(d).apply(null,c);return e===Hb?a.onError(e.e):void a.onNext(e)}},function(b){a.onError(b)},function(){a.onCompleted()})),i[c]=k,new Mb(i)},this)},oc.zip=function(){if(Array.isArray(arguments[0]))return J.apply(this,arguments);for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=this,e=b.pop();return b.unshift(d),new Ld(function(a){for(var c=b.length,f=n(c,K),g=n(c,I),h=new Array(c),i=0;c>i;i++)!function(c){var i=b[c],j=new Tb;La(i)&&(i=Ec(i)),j.setDisposable(i.subscribe(function(b){if(f[c].push(b),f.every(function(a){return a.length>0})){var h=f.map(function(a){return a.shift()}),i=p(e).apply(d,h);if(i===Hb)return a.onError(i.e);a.onNext(i)}else g.filter(function(a,b){return b!==c}).every(Ga)&&a.onCompleted()},function(b){a.onError(b)},function(){g[c]=!0,g.every(Ga)&&a.onCompleted()})),h[c]=j}(i);return new Mb(h)},d)},uc.zip=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.shift();return d.zip.apply(d,b)},uc.zipArray=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new Ld(function(b){for(var c=a.length,d=n(c,L),e=n(c,I),f=new Array(c),g=0;c>g;g++)!function(c){f[c]=new Tb,f[c].setDisposable(a[c].subscribe(function(a){if(d[c].push(a),d.every(function(a){return a.length>0})){var f=d.map(function(a){return a.shift()});b.onNext(f)}else if(e.filter(function(a,b){return b!==c}).every(Ga))return b.onCompleted()},function(a){b.onError(a)},function(){e[c]=!0,e.every(Ga)&&b.onCompleted()}))}(g);return new Mb(f)})},oc.asObservable=function(){var a=this;return new Ld(function(b){return a.subscribe(b)},a)},oc.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).selectMany(function(a){return a.toArray()}).where(function(a){return a.length>0})},oc.dematerialize=function(){var a=this;return new Ld(function(b){return a.subscribe(function(a){return a.accept(b)},function(a){b.onError(a)},function(){b.onCompleted()})},this)},oc.distinctUntilChanged=function(a,b){var c=this;return b||(b=Ia),new Ld(function(d){var e,f=!1;return c.subscribe(function(c){var g=c;if(a&&(g=p(a)(c),g===Hb))return d.onError(g.e);if(f){var h=p(b)(e,g);if(h===Hb)return d.onError(h.e)}f&&h||(f=!0,e=g,d.onNext(c))},function(a){d.onError(a)},function(){d.onCompleted()})},this)};var id=function(a){function b(b,c,d,e){this.source=b,this.t=!c||Na(c)?nc(c||Fa,d||Fa,e||Fa):c,a.call(this)}function c(a,b){this.o=a,this.t=b,this.isStopped=!1}return Eb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this.t))},c.prototype.onNext=function(a){if(!this.isStopped){var b=p(this.t.onNext).call(this.t,a);b===Hb&&this.o.onError(b.e),this.o.onNext(a)}},c.prototype.onError=function(a){if(!this.isStopped){this.isStopped=!0;var b=p(this.t.onError).call(this.t,a);if(b===Hb)return this.o.onError(b.e);this.o.onError(a)}},c.prototype.onCompleted=function(){if(!this.isStopped){this.isStopped=!0;var a=p(this.t.onCompleted).call(this.t);if(a===Hb)return this.o.onError(a.e);this.o.onCompleted()}},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(vc);oc["do"]=oc.tap=oc.doAction=function(a,b,c){return new id(this,a,b,c)},oc.doOnNext=oc.tapOnNext=function(a,b){return this.tap("undefined"!=typeof b?function(c){a.call(b,c)}:a)},oc.doOnError=oc.tapOnError=function(a,b){return this.tap(Fa,"undefined"!=typeof b?function(c){a.call(b,c)}:a)},oc.doOnCompleted=oc.tapOnCompleted=function(a,b){return this.tap(Fa,null,"undefined"!=typeof b?function(){a.call(b)}:a)},oc["finally"]=oc.ensure=function(a){var b=this;return new Ld(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return Pb(function(){try{d.dispose()}catch(b){throw b}finally{a()}})},this)},oc.finallyAction=function(a){return this.ensure(a)};var jd=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.isStopped=!1}return Eb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a))},c.prototype.onNext=Fa,c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},b}(vc);oc.ignoreElements=function(){return new jd(this)},oc.materialize=function(){var a=this;return new Ld(function(b){return a.subscribe(function(a){b.onNext(jc(a))},function(a){b.onNext(kc(a)),b.onCompleted()},function(){b.onNext(lc()),b.onCompleted()})},a)},oc.repeat=function(a){return Ac(this,a).concat()},oc.retry=function(a){return Ac(this,a).catchError()},oc.retryWhen=function(a){return Ac(this).catchErrorWhen(a)};var kd=function(a){function b(b,c,d,e){this.source=b,this.accumulator=c,this.hasSeed=d,this.seed=e,a.call(this)}return Eb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new M(a,this))},b}(vc);M.prototype.onNext=function(a){if(!this.isStopped){!this.hasValue&&(this.hasValue=!0);try{this.hasAccumulation?this.accumulation=this.accumulator(this.accumulation,a):(this.accumulation=this.hasSeed?this.accumulator(this.seed,a):a,this.hasAccumulation=!0)}catch(b){return this.observer.onError(b)}this.observer.onNext(this.accumulation)}},M.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.observer.onError(a))},M.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,!this.hasValue&&this.hasSeed&&this.observer.onNext(this.seed),this.observer.onCompleted())},M.prototype.dispose=function(){this.isStopped=!0},M.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},oc.scan=function(){var a,b,c=!1;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new kd(this,b,c,a)},oc.skipLast=function(a){if(0>a)throw new Va;var b=this;return new Ld(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},function(a){c.onError(a)},function(){c.onCompleted()})},b)},oc.startWith=function(){var a,b=0;arguments.length&&Zb(arguments[0])?(a=arguments[0],b=1):a=bc;for(var c=[],d=b,e=arguments.length;e>d;d++)c.push(arguments[d]);return Cc([Oc(c,a),this]).concat()},oc.takeLast=function(a){if(0>a)throw new Va;var b=this;return new Ld(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},function(a){c.onError(a)},function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})},b)},oc.takeLastBuffer=function(a){var b=this;return new Ld(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},function(a){c.onError(a)},function(){c.onNext(d),c.onCompleted()})},b)},oc.windowWithCount=function(a,b){
+var c=this;if(+a||(a=0),Math.abs(a)===1/0&&(a=0),0>=a)throw new Va;if(null==b&&(b=a),+b||(b=0),Math.abs(b)===1/0&&(b=0),0>=b)throw new Va;return new Ld(function(d){function e(){var a=new Od;i.push(a),d.onNext(Gb(a,g))}var f=new Tb,g=new Vb(f),h=0,i=[];return e(),f.setDisposable(c.subscribe(function(c){for(var d=0,f=i.length;f>d;d++)i[d].onNext(c);var g=h-a+1;g>=0&&g%b===0&&i.shift().onCompleted(),++h%b===0&&e()},function(a){for(;i.length>0;)i.shift().onError(a);d.onError(a)},function(){for(;i.length>0;)i.shift().onCompleted();d.onCompleted()})),g},c)},oc.selectConcat=oc.concatMap=function(a,b,c){return Na(a)&&Na(b)?this.concatMap(function(c,d){var e=a(c,d);return La(e)&&(e=Ec(e)),(bb(e)||ab(e))&&(e=Mc(e)),e.map(function(a,e){return b(c,a,d,e)})}):Na(a)?N(this,a,c):N(this,function(){return a})},oc.concatMapObserver=oc.selectConcatObserver=function(a,b,c,d){var e=this,f=db(a,d,2),g=db(b,d,1),h=db(c,d,0);return new Ld(function(a){var b=0;return e.subscribe(function(c){var d;try{d=f(c,b++)}catch(e){return void a.onError(e)}La(d)&&(d=Ec(d)),a.onNext(d)},function(b){var c;try{c=g(b)}catch(d){return void a.onError(d)}La(c)&&(c=Ec(c)),a.onNext(c),a.onCompleted()},function(){var b;try{b=h()}catch(c){return void a.onError(c)}La(b)&&(b=Ec(b)),a.onNext(b),a.onCompleted()})},this).concatAll()},oc.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new Ld(function(a){var d=!1;return c.subscribe(function(b){d=!0,a.onNext(b)},function(b){a.onError(b)},function(){!d&&a.onNext(b),a.onCompleted()})},c)},P.prototype.push=function(a){var b=-1===O(this.set,a,this.comparer);return b&&this.set.push(a),b},oc.distinct=function(a,b){var c=this;return b||(b=Ia),new Ld(function(d){var e=new P(b);return c.subscribe(function(b){var c=b;if(a)try{c=a(b)}catch(f){return void d.onError(f)}e.push(c)&&d.onNext(b)},function(a){d.onError(a)},function(){d.onCompleted()})},this)},oc.groupBy=function(a,b,c){return this.groupByUntil(a,b,Qc,c)},oc.groupByUntil=function(a,b,c,d){var e=this;return b||(b=Ga),d||(d=Ia),new Ld(function(f){function g(a){return function(b){b.onError(a)}}var h=new Ed(0,d),i=new Mb,j=new Vb(i);return i.add(e.subscribe(function(d){var e;try{e=a(d)}catch(k){return h.getValues().forEach(g(k)),void f.onError(k)}var l=!1,m=h.tryGetValue(e);if(m||(m=new Od,h.set(e,m),l=!0),l){var n=new Nd(e,m,j),o=new Nd(e,m);try{duration=c(o)}catch(k){return h.getValues().forEach(g(k)),void f.onError(k)}f.onNext(n);var p=new Tb;i.add(p);var q=function(){h.remove(e)&&m.onCompleted(),i.remove(p)};p.setDisposable(duration.take(1).subscribe(Fa,function(a){h.getValues().forEach(g(a)),f.onError(a)},q))}var r;try{r=b(d)}catch(k){return h.getValues().forEach(g(k)),void f.onError(k)}m.onNext(r)},function(a){h.getValues().forEach(g(a)),f.onError(a)},function(){h.getValues().forEach(function(a){a.onCompleted()}),f.onCompleted()})),j},e)};var ld=function(a){function b(b,c,d){this.source=b,this.selector=db(c,d,3),a.call(this)}function c(a,b){return function(c,d,e){return a.call(this,b.selector(c,d,e),d,e)}}function d(a,b,c){this.o=a,this.selector=b,this.source=c,this.i=0,this.isStopped=!1}return Eb(b,a),b.prototype.internalMap=function(a,d){return new b(this.source,c(a,this),d)},b.prototype.subscribeCore=function(a){return this.source.subscribe(new d(a,this.selector,this))},d.prototype.onNext=function(a){if(!this.isStopped){var b=p(this.selector)(a,this.i++,this.source);return b===Hb?this.o.onError(b.e):void this.o.onNext(b)}},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},d.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(vc);oc.map=oc.select=function(a,b){var c="function"==typeof a?a:function(){return a};return this instanceof ld?this.internalMap(c,b):new ld(this,c,b)},oc.pluck=function(){var b=arguments,c=arguments.length;if(0===c)throw new Error("List of properties cannot be empty.");return this.map(function(d){for(var e=d,f=0;c>f;f++){var g=e[b[f]];if("undefined"==typeof g)return a;e=g}return e})},oc.selectMany=oc.flatMap=function(a,b,c){return Na(a)&&Na(b)?this.flatMap(function(c,d){var e=a(c,d);return La(e)&&(e=Ec(e)),(bb(e)||ab(e))&&(e=Mc(e)),e.map(function(a,e){return b(c,a,d,e)})},c):Na(a)?Q(this,a,c):Q(this,function(){return a})},oc.flatMapObserver=oc.selectManyObserver=function(a,b,c,d){var e=this;return new Ld(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}La(c)&&(c=Ec(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}La(c)&&(c=Ec(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}La(a)&&(a=Ec(a)),f.onNext(a),f.onCompleted()})},e).mergeAll()},oc.selectSwitch=oc.flatMapLatest=oc.switchMap=function(a,b){return this.select(a,b).switchLatest()};var md=function(a){function b(b,c){this.source=b,this.skipCount=c,a.call(this)}function c(a,b){this.c=b,this.r=b,this.o=a,this.isStopped=!1}return Eb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this.skipCount))},c.prototype.onNext=function(a){this.isStopped||(this.r<=0?this.o.onNext(a):this.r--)},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(vc);oc.skip=function(a){if(0>a)throw new Va;return new md(this,a)},oc.skipWhile=function(a,b){var c=this,d=db(a,b,3);return new Ld(function(a){var b=0,e=!1;return c.subscribe(function(f){if(!e)try{e=!d(f,b++,c)}catch(g){return void a.onError(g)}e&&a.onNext(f)},function(b){a.onError(b)},function(){a.onCompleted()})},c)},oc.take=function(a,b){if(0>a)throw new Va;if(0===a)return Ic(b);var c=this;return new Ld(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0>=d&&b.onCompleted())},function(a){b.onError(a)},function(){b.onCompleted()})},c)},oc.takeWhile=function(a,b){var c=this,d=db(a,b,3);return new Ld(function(a){var b=0,e=!0;return c.subscribe(function(f){if(e){try{e=d(f,b++,c)}catch(g){return void a.onError(g)}e?a.onNext(f):a.onCompleted()}},function(b){a.onError(b)},function(){a.onCompleted()})},c)};var nd=function(a){function b(b,c,d){this.source=b,this.predicate=db(c,d,3),a.call(this)}function c(a,b){return function(c,d,e){return b.predicate(c,d,e)&&a.call(this,c,d,e)}}function d(a,b,c){this.o=a,this.predicate=b,this.source=c,this.i=0,this.isStopped=!1}return Eb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new d(a,this.predicate,this))},b.prototype.internalFilter=function(a,d){return new b(this.source,c(a,this),d)},d.prototype.onNext=function(a){if(!this.isStopped){var b=p(this.predicate)(a,this.i++,this.source);return b===Hb?this.o.onError(b.e):void(b&&this.o.onNext(a))}},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},d.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(vc);oc.filter=oc.where=function(a,b){return this instanceof nd?this.internalFilter(a,b):new nd(this,a,b)},oc.aggregate=function(){var a,b,c=!1,d=this;return 2===arguments.length?(c=!0,b=arguments[0],a=arguments[1]):a=arguments[0],new Ld(function(e){var f,g,h;return d.subscribe(function(d){!h&&(h=!0);try{f?g=a(g,d):(g=c?a(b,d):d,f=!0)}catch(i){return e.onError(i)}},function(a){e.onError(a)},function(){h&&e.onNext(g),!h&&c&&e.onNext(b),!h&&!c&&e.onError(new Ta),e.onCompleted()})},d)};var od=function(a){function b(b,c,d,e){this.source=b,this.acc=c,this.hasSeed=d,this.seed=e,a.call(this)}function c(a,b){this.o=a,this.acc=b.acc,this.hasSeed=b.hasSeed,this.seed=b.seed,this.hasAccumulation=!1,this.result=null,this.hasValue=!1,this.isStopped=!1}return Eb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this))},c.prototype.onNext=function(a){this.isStopped||(!this.hasValue&&(this.hasValue=!0),this.hasAccumulation?this.result=p(this.acc)(this.result,a):(this.result=this.hasSeed?p(this.acc)(this.seed,a):a,this.hasAccumulation=!0),this.result===Hb&&this.o.onError(this.result.e))},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.hasValue&&this.o.onNext(this.result),!this.hasValue&&this.hasSeed&&this.o.onNext(this.seed),!this.hasValue&&!this.hasSeed&&this.o.onError(new Ta),this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(vc);oc.reduce=function(a){var b=!1;if(2===arguments.length){b=!0;var c=arguments[1]}return new od(this,a,b,c)},oc.some=function(a,b){var c=this;return a?c.filter(a,b).some():new Ld(function(a){return c.subscribe(function(){a.onNext(!0),a.onCompleted()},function(b){a.onError(b)},function(){a.onNext(!1),a.onCompleted()})},c)},oc.any=function(){return this.some.apply(this,arguments)},oc.isEmpty=function(){return this.any().map(Ma)},oc.every=function(a,b){return this.filter(function(b){return!a(b)},b).some().map(Ma)},oc.all=function(){return this.every.apply(this,arguments)},oc.includes=function(a,b){function c(a,b){return 0===a&&0===b||a===b||isNaN(a)&&isNaN(b)}var d=this;return new Ld(function(e){var f=0,g=+b||0;return Math.abs(g)===1/0&&(g=0),0>g?(e.onNext(!1),e.onCompleted(),Qb):d.subscribe(function(b){f++>=g&&c(b,a)&&(e.onNext(!0),e.onCompleted())},function(a){e.onError(a)},function(){e.onNext(!1),e.onCompleted()})},this)},oc.contains=function(a,b){oc.includes(a,b)},oc.count=function(a,b){return a?this.filter(a,b).count():this.reduce(function(a){return a+1},0)},oc.indexOf=function(a,b){var c=this;return new Ld(function(d){var e=0,f=+b||0;return Math.abs(f)===1/0&&(f=0),0>f?(d.onNext(-1),d.onCompleted(),Qb):c.subscribe(function(b){e>=f&&b===a&&(d.onNext(e),d.onCompleted()),e++},function(a){d.onError(a)},function(){d.onNext(-1),d.onCompleted()})},c)},oc.sum=function(a,b){return a&&Na(a)?this.map(a,b).sum():this.reduce(function(a,b){return a+b},0)},oc.minBy=function(a,b){return b||(b=Ja),R(this,a,function(a,c){return-1*b(a,c)})},oc.min=function(a){return this.minBy(Ga,a).map(function(a){return S(a)})},oc.maxBy=function(a,b){return b||(b=Ja),R(this,a,b)},oc.max=function(a){return this.maxBy(Ga,a).map(function(a){return S(a)})},oc.average=function(a,b){return a&&Na(a)?this.map(a,b).average():this.reduce(function(a,b){return{sum:a.sum+b,count:a.count+1}},{sum:0,count:0}).map(function(a){if(0===a.count)throw new Ta;return a.sum/a.count})},oc.sequenceEqual=function(a,b){var c=this;return b||(b=Ia),new Ld(function(d){var e=!1,f=!1,g=[],h=[],i=c.subscribe(function(a){var c,e;if(h.length>0){e=h.shift();try{c=b(e,a)}catch(i){return void d.onError(i)}c||(d.onNext(!1),d.onCompleted())}else f?(d.onNext(!1),d.onCompleted()):g.push(a)},function(a){d.onError(a)},function(){e=!0,0===g.length&&(h.length>0?(d.onNext(!1),d.onCompleted()):f&&(d.onNext(!0),d.onCompleted()))});(bb(a)||ab(a))&&(a=Mc(a)),La(a)&&(a=Ec(a));var j=a.subscribe(function(a){var c;if(g.length>0){var f=g.shift();try{c=b(f,a)}catch(i){return void d.onError(i)}c||(d.onNext(!1),d.onCompleted())}else e?(d.onNext(!1),d.onCompleted()):h.push(a)},function(a){d.onError(a)},function(){f=!0,0===h.length&&(g.length>0?(d.onNext(!1),d.onCompleted()):e&&(d.onNext(!0),d.onCompleted()))});return new Mb(i,j)},c)},oc.elementAt=function(a){return T(this,a,!1)},oc.elementAtOrDefault=function(a,b){return T(this,a,!0,b)},oc.single=function(a,b){return a&&Na(a)?this.where(a,b).single():U(this,!1)},oc.singleOrDefault=function(a,b,c){return a&&Na(a)?this.filter(a,c).singleOrDefault(null,b):U(this,!0,b)},oc.first=function(a,b){return a?this.where(a,b).first():V(this,!1)},oc.firstOrDefault=function(a,b,c){return a?this.where(a).firstOrDefault(null,b):V(this,!0,b)},oc.last=function(a,b){return a?this.where(a,b).last():W(this,!1)},oc.lastOrDefault=function(a,b,c){return a?this.where(a,c).lastOrDefault(null,b):W(this,!0,b)},oc.find=function(a,b){return X(this,a,b,!1)},oc.findIndex=function(a,b){return X(this,a,b,!0)},oc.toSet=function(){if("undefined"==typeof za.Set)throw new TypeError;var a=this;return new Ld(function(b){var c=new za.Set;return a.subscribe(function(a){c.add(a)},function(a){b.onError(a)},function(){b.onNext(c),b.onCompleted()})},a)},oc.toMap=function(a,b){if("undefined"==typeof za.Map)throw new TypeError;var c=this;return new Ld(function(d){var e=new za.Map;return c.subscribe(function(c){var f;try{f=a(c)}catch(g){return void d.onError(g)}var h=c;if(b)try{h=b(c)}catch(g){return void d.onError(g)}e.set(f,h)},function(a){d.onError(a)},function(){d.onNext(e),d.onCompleted()})},c)};var pd="function",qd="throw",zb=Ea.internals.isObject,rd=Ea.spawn=function(a){var b=ba(a);return function(c){function d(a,b){gc.schedule(c.bind(f,a,b))}function e(a,b){var c;if(arguments.length>2)for(var b=[],h=1,i=arguments.length;i>h;h++)b.push(arguments[h]);if(a)try{c=g[qd](a)}catch(j){return d(j)}if(!a)try{c=g.next(b)}catch(j){return d(j)}if(c.done)return d(null,c.value);if(c.value=Y(c.value,f),typeof c.value!==pd)e(new TypeError("Rx.spawn only supports a function, Promise, Observable, Object or Array."));else{var k=!1;try{c.value.call(f,function(){k||(k=!0,e.apply(f,arguments))})}catch(j){gc.schedule(function(){k||(k=!0,e.call(f,j))})}}}var f=this,g=a;if(b){for(var h=[],i=0,j=arguments.length;j>i;i++)h.push(arguments[i]);var j=h.length,k=j&&typeof h[j-1]===pd;c=k?h.pop():da,g=a.apply(this,h)}else c=c||da;e()}};uc.start=function(a,b,c){return sd(a,b,c)()};var sd=uc.toAsync=function(a,b,c){return Zb(c)||(c=gc),function(){var d=arguments,e=new Pd;return c.schedule(function(){var c;try{c=a.apply(b,d)}catch(f){return void e.onError(f)}e.onNext(c),e.onCompleted()}),e.asObservable()}};uc.fromCallback=function(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return new Ld(function(d){function f(){for(var a=arguments.length,e=new Array(a),f=0;a>f;f++)e[f]=arguments[f];if(c){try{e=c.apply(b,e)}catch(g){return d.onError(g)}d.onNext(e)}else e.length<=1?d.onNext.apply(d,e):d.onNext(e);d.onCompleted()}e.push(f),a.apply(b,e)}).publishLast().refCount()}},uc.fromNodeCallback=function(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return new Ld(function(d){function f(a){if(a)return void d.onError(a);for(var e=arguments.length,f=[],g=1;e>g;g++)f[g-1]=arguments[g];if(c){try{f=c.apply(b,f)}catch(h){return d.onError(h)}d.onNext(f)}else f.length<=1?d.onNext.apply(d,f):d.onNext(f);d.onCompleted()}e.push(f),a.apply(b,e)}).publishLast().refCount()}},Ea.config.useNativeEvents=!1,uc.fromEvent=function(a,b,c){return a.addListener?td(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},c):Ea.config.useNativeEvents||"function"!=typeof a.on||"function"!=typeof a.off?new Ld(function(d){return ha(a,b,function(a){var b=a;if(c)try{b=c(arguments)}catch(e){return d.onError(e)}d.onNext(b)})}).publish().refCount():td(function(c){a.on(b,c)},function(c){a.off(b,c)},c)};var td=uc.fromEventPattern=function(a,b,c){return new Ld(function(d){function e(a){var b=a;if(c)try{b=c(arguments)}catch(e){return d.onError(e)}d.onNext(b)}var f=a(e);return Pb(function(){b&&b(e,f)})}).publish().refCount()};uc.startAsync=function(a){var b;try{b=a()}catch(c){return Xc(c)}return Ec(b)};var ud=function(a){function b(a){var b=this.source.publish(),c=b.subscribe(a),d=Qb,e=this.pauser.distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=Qb)});return new Mb(c,d,e)}function c(c,d){this.source=c,this.controller=new Od,d&&d.subscribe?this.pauser=this.controller.merge(d):this.pauser=this.controller,a.call(this,b,c)}return Eb(c,a),c.prototype.pause=function(){this.controller.onNext(!1)},c.prototype.resume=function(){this.controller.onNext(!0)},c}(uc);oc.pausable=function(a){return new ud(this,a)};var vd=function(b){function c(b){function c(){for(;e.length>0;)b.onNext(e.shift())}var d,e=[],f=ia(this.source,this.pauser.distinctUntilChanged().startWith(!1),function(a,b){return{data:a,shouldFire:b}}).subscribe(function(f){d!==a&&f.shouldFire!=d?(d=f.shouldFire,f.shouldFire&&c()):(d=f.shouldFire,f.shouldFire?b.onNext(f.data):e.push(f.data))},function(a){c(),b.onError(a)},function(){c(),b.onCompleted()});return f}function d(a,d){this.source=a,this.controller=new Od,d&&d.subscribe?this.pauser=this.controller.merge(d):this.pauser=this.controller,b.call(this,c,a)}return Eb(d,b),d.prototype.pause=function(){this.controller.onNext(!1)},d.prototype.resume=function(){this.controller.onNext(!0)},d}(uc);oc.pausableBuffered=function(a){return new vd(this,a)};var wd=function(a){function b(a){return this.source.subscribe(a)}function c(c,d,e){a.call(this,b,c),this.subject=new xd(d,e),this.source=c.multicast(this.subject).refCount()}return Eb(c,a),c.prototype.request=function(a){return this.subject.request(null==a?-1:a)},c}(uc),xd=function(a){function b(a){return this.subject.subscribe(a)}function c(c,d){null==c&&(c=!0),a.call(this,b),this.subject=new Od,this.enableQueue=c,this.queue=c?[]:null,this.requestedCount=0,this.requestedDisposable=Qb,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.scheduler=d||cc}return Eb(c,a),Fb(c.prototype,mc,{onCompleted:function(){this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length?this.queue.push(ic.createOnCompleted()):this.subject.onCompleted()},onError:function(a){this.hasFailed=!0,this.error=a,this.enableQueue&&0!==this.queue.length?this.queue.push(ic.createOnError(a)):this.subject.onError(a)},onNext:function(a){var b=!1;0===this.requestedCount?this.enableQueue&&this.queue.push(ic.createOnNext(a)):(-1!==this.requestedCount&&0===this.requestedCount--&&this.disposeCurrentRequest(),b=!0),b&&this.subject.onNext(a)},_processRequest:function(a){if(this.enableQueue){for(;this.queue.length>=a&&a>0||this.queue.length>0&&"N"!==this.queue[0].kind;){var b=this.queue.shift();b.accept(this.subject),"N"===b.kind?a--:(this.disposeCurrentRequest(),this.queue=[])}return{numberOfItems:a,returnValue:0!==this.queue.length}}return{numberOfItems:a,returnValue:!1}},request:function(a){this.disposeCurrentRequest();var b=this;return this.requestedDisposable=this.scheduler.scheduleWithState(a,function(a,c){var d=b._processRequest(c),e=d.numberOfItems;d.returnValue||(b.requestedCount=e,b.requestedDisposable=Pb(function(){b.requestedCount=0}))}),this.requestedDisposable},disposeCurrentRequest:function(){this.requestedDisposable.dispose(),this.requestedDisposable=Qb}}),c}(uc);oc.controlled=function(a,b){return a&&Zb(a)&&(b=a,a=!0),null==a&&(a=!0),new wd(this,a,b)};var yd=function(a){function b(a){this.subscription=this.source.subscribe(new d(a,this,this.subscription));var b=this;return gc.schedule(function(){b.source.request(1)}),this.subscription}function c(c){a.call(this,b,c),this.source=c}Eb(c,a);var d=function(a){function b(b,c,d){a.call(this),this.observer=b,this.observable=c,this.cancel=d}Eb(b,a);var c=b.prototype;return c.completed=function(){this.observer.onCompleted(),this.dispose()},c.error=function(a){this.observer.onError(a),this.dispose()},c.next=function(a){this.observer.onNext(a);var b=this;gc.schedule(function(){b.observable.source.request(1)})},c.dispose=function(){this.observer=null,this.cancel&&(this.cancel.dispose(),this.cancel=null),a.prototype.dispose.call(this)},b}(pc);return c}(uc);wd.prototype.stopAndWait=function(){return new yd(this)};var zd=function(a){function b(a){this.subscription=this.source.subscribe(new d(a,this,this.subscription));var b=this;return gc.schedule(function(){b.source.request(b.windowSize)}),this.subscription}function c(c,d){a.call(this,b,c),this.source=c,this.windowSize=d}Eb(c,a);var d=function(a){function b(a,b,c){this.observer=a,this.observable=b,this.cancel=c,this.received=0}Eb(b,a);var c=b.prototype;return c.completed=function(){this.observer.onCompleted(),this.dispose()},c.error=function(a){this.observer.onError(a),this.dispose()},c.next=function(a){if(this.observer.onNext(a),this.received=++this.received%this.observable.windowSize,0===this.received){var b=this;gc.schedule(function(){b.observable.source.request(b.observable.windowSize)})}},c.dispose=function(){this.observer=null,this.cancel&&(this.cancel.dispose(),this.cancel=null),a.prototype.dispose.call(this)},b}(pc);return c}(uc);wd.prototype.windowed=function(a){return new zd(this,a)},oc.pipe=function(a){function b(){c.resume()}var c=this.pausableBuffered();return a.addListener("drain",b),c.subscribe(function(b){!a.write(String(b))&&c.pause()},function(b){a.emit("error",b)},function(){!a._isStdio&&a.end(),a.removeListener("drain",b)}),c.resume(),a},oc.multicast=function(a,b){var c=this;return"function"==typeof a?new Ld(function(d){var e=c.multicast(a());return new Mb(b(e).subscribe(d),e.connect())},c):new Dd(c,a)},oc.publish=function(a){return a&&Na(a)?this.multicast(function(){return new Od},a):this.multicast(new Od)},oc.share=function(){return this.publish().refCount()},oc.publishLast=function(a){return a&&Na(a)?this.multicast(function(){return new Pd},a):this.multicast(new Pd)},oc.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new Bd(b)},a):this.multicast(new Bd(a))},oc.shareValue=function(a){return this.publishValue(a).refCount()},oc.replay=function(a,b,c,d){return a&&Na(a)?this.multicast(function(){return new Cd(b,c,d)},a):this.multicast(new Cd(b,c,d))},oc.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};var Ad=function(a,b){this.subject=a,this.observer=b};Ad.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var Bd=Ea.BehaviorSubject=function(a){function c(a){return Sb(this),this.isStopped?(this.hasError?a.onError(this.error):a.onCompleted(),Qb):(this.observers.push(a),a.onNext(this.value),new Ad(this,a))}function d(b){a.call(this,c),this.value=b,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.hasError=!1}return Eb(d,a),Fb(d.prototype,mc,{getValue:function(){if(Sb(this),this.hasError)throw this.error;return this.value},hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(Sb(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=b(this.observers),d=c.length;d>a;a++)c[a].onCompleted();this.observers.length=0}},onError:function(a){if(Sb(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){if(Sb(this),!this.isStopped){this.value=a;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.exception=null}}),d}(uc),Cd=Ea.ReplaySubject=function(a){function c(a,b){return Pb(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function d(a){var b=new sc(this.scheduler,a),d=c(this,b);Sb(this),this._trim(this.scheduler.now()),this.observers.push(b);for(var e=0,f=this.q.length;f>e;e++)b.onNext(this.q[e].value);return this.hasError?b.onError(this.error):this.isStopped&&b.onCompleted(),b.ensureActive(),d}function e(b,c,e){this.bufferSize=null==b?f:b,this.windowSize=null==c?f:c,this.scheduler=e||cc,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this,d)}var f=Math.pow(2,53)-1;return Eb(e,a),Fb(e.prototype,mc.prototype,{hasObservers:function(){return this.observers.length>0},_trim:function(a){for(;this.q.length>this.bufferSize;)this.q.shift();for(;this.q.length>0&&a-this.q[0].interval>this.windowSize;)this.q.shift()},onNext:function(a){if(Sb(this),!this.isStopped){var c=this.scheduler.now();this.q.push({interval:c,value:a}),this._trim(c);for(var d=0,e=b(this.observers),f=e.length;f>d;d++){var g=e[d];g.onNext(a),g.ensureActive()}}},onError:function(a){if(Sb(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var c=this.scheduler.now();this._trim(c);for(var d=0,e=b(this.observers),f=e.length;f>d;d++){var g=e[d];g.onError(a),g.ensureActive()}this.observers.length=0}},onCompleted:function(){if(Sb(this),!this.isStopped){this.isStopped=!0;var a=this.scheduler.now();this._trim(a);for(var c=0,d=b(this.observers),e=d.length;e>c;c++){var f=d[c];f.onCompleted(),f.ensureActive()}this.observers.length=0}},dispose:function(){this.isDisposed=!0,this.observers=null}}),e}(uc),Dd=Ea.ConnectableObservable=function(a){function b(b,c){var d,e=!1,f=b.asObservable();this.connect=function(){return e||(e=!0,d=new Mb(f.subscribe(c),Pb(function(){e=!1}))),d},a.call(this,function(a){return c.subscribe(a)})}return Eb(b,a),b.prototype.refCount=function(){var a,b=0,c=this;return new Ld(function(d){var e=1===++b,f=c.subscribe(d);return e&&(a=c.connect()),function(){f.dispose(),0===--b&&a.dispose()}})},b}(uc);oc.singleInstance=function(){function a(){return d||(d=!0,b=c["finally"](function(){d=!1}).publish().refCount()),b}var b,c=this,d=!1;return new Ld(function(b){return a().subscribe(b)})};var Ed=function(){function b(a){if(0===(1&a))return 2===a;for(var b=Math.sqrt(a),c=3;b>=c;){if(a%c===0)return!1;c+=2}return!0}function c(a){var c,d,e;for(c=0;c<h.length;++c)if(d=h[c],d>=a)return d;for(e=1|a;e<h[h.length-1];){if(b(e))return e;e+=2}return a}function d(a){var b=757602046;if(!a.length)return b;for(var c=0,d=a.length;d>c;c++){var e=a.charCodeAt(c);b=(b<<5)-b+e,b&=b}return b}function e(a){var b=668265261;return a=61^a^a>>>16,a+=a<<3,a^=a>>>4,a*=b,a^=a>>>15}function f(){return{key:null,value:null,next:0,hashCode:0}}function g(a,b){if(0>a)throw new Va;a>0&&this._initialize(a),this.comparer=b||Ia,this.freeCount=0,this.size=0,this.freeList=-1}var h=[1,3,7,13,31,61,127,251,509,1021,2039,4093,8191,16381,32749,65521,131071,262139,524287,1048573,2097143,4194301,8388593,16777213,33554393,67108859,134217689,268435399,536870909,1073741789,2147483647],i="no such key",j="duplicate key",k=function(){var a=0;return function(b){if(null==b)throw new Error(i);if("string"==typeof b)return d(b);if("number"==typeof b)return e(b);if("boolean"==typeof b)return b===!0?1:0;if(b instanceof Date)return e(b.valueOf());if(b instanceof RegExp)return d(b.toString());if("function"==typeof b.valueOf){var c=b.valueOf();if("number"==typeof c)return e(c);if("string"==typeof c)return d(c)}if(b.hashCode)return b.hashCode();var f=17*a++;return b.hashCode=function(){return f},f}}(),l=g.prototype;return l._initialize=function(a){var b,d=c(a);for(this.buckets=new Array(d),this.entries=new Array(d),b=0;d>b;b++)this.buckets[b]=-1,this.entries[b]=f();this.freeList=-1},l.add=function(a,b){this._insert(a,b,!0)},l._insert=function(a,b,c){this.buckets||this._initialize(0);for(var d,e=2147483647&k(a),f=e%this.buckets.length,g=this.buckets[f];g>=0;g=this.entries[g].next)if(this.entries[g].hashCode===e&&this.comparer(this.entries[g].key,a)){if(c)throw new Error(j);return void(this.entries[g].value=b)}this.freeCount>0?(d=this.freeList,this.freeList=this.entries[d].next,--this.freeCount):(this.size===this.entries.length&&(this._resize(),f=e%this.buckets.length),d=this.size,++this.size),this.entries[d].hashCode=e,this.entries[d].next=this.buckets[f],this.entries[d].key=a,this.entries[d].value=b,this.buckets[f]=d},l._resize=function(){var a=c(2*this.size),b=new Array(a);for(e=0;e<b.length;++e)b[e]=-1;var d=new Array(a);for(e=0;e<this.size;++e)d[e]=this.entries[e];for(var e=this.size;a>e;++e)d[e]=f();for(var g=0;g<this.size;++g){var h=d[g].hashCode%a;d[g].next=b[h],b[h]=g}this.buckets=b,this.entries=d},l.remove=function(a){if(this.buckets)for(var b=2147483647&k(a),c=b%this.buckets.length,d=-1,e=this.buckets[c];e>=0;e=this.entries[e].next){if(this.entries[e].hashCode===b&&this.comparer(this.entries[e].key,a))return 0>d?this.buckets[c]=this.entries[e].next:this.entries[d].next=this.entries[e].next,this.entries[e].hashCode=-1,this.entries[e].next=this.freeList,this.entries[e].key=null,this.entries[e].value=null,this.freeList=e,++this.freeCount,!0;d=e}return!1},l.clear=function(){var a,b;if(!(this.size<=0)){for(a=0,b=this.buckets.length;b>a;++a)this.buckets[a]=-1;for(a=0;a<this.size;++a)this.entries[a]=f();this.freeList=-1,this.size=0}},l._findEntry=function(a){if(this.buckets)for(var b=2147483647&k(a),c=this.buckets[b%this.buckets.length];c>=0;c=this.entries[c].next)if(this.entries[c].hashCode===b&&this.comparer(this.entries[c].key,a))return c;return-1},l.count=function(){return this.size-this.freeCount},l.tryGetValue=function(b){var c=this._findEntry(b);return c>=0?this.entries[c].value:a},l.getValues=function(){var a=0,b=[];if(this.entries)for(var c=0;c<this.size;c++)this.entries[c].hashCode>=0&&(b[a++]=this.entries[c].value);return b},l.get=function(a){var b=this._findEntry(a);if(b>=0)return this.entries[b].value;throw new Error(i)},l.set=function(a,b){this._insert(a,b,!1)},l.containskey=function(a){return this._findEntry(a)>=0},g}();oc.join=function(a,b,c,d){var e=this;return new Ld(function(f){var g=new Mb,h=!1,i=!1,j=0,k=0,l=new Ed,m=new Ed;return g.add(e.subscribe(function(a){var c=j++,e=new Tb;l.add(c,a),g.add(e);var i,k=function(){l.remove(c)&&0===l.count()&&h&&f.onCompleted(),g.remove(e)};try{i=b(a)}catch(n){return void f.onError(n)}e.setDisposable(i.take(1).subscribe(Fa,f.onError.bind(f),k)),m.getValues().forEach(function(b){var c;try{c=d(a,b)}catch(e){return void f.onError(e)}f.onNext(c)})},f.onError.bind(f),function(){h=!0,(i||0===l.count())&&f.onCompleted()})),g.add(a.subscribe(function(a){var b=k++,e=new Tb;m.add(b,a),g.add(e);var h,j=function(){m.remove(b)&&0===m.count()&&i&&f.onCompleted(),g.remove(e)};try{h=c(a)}catch(n){return void f.onError(n)}e.setDisposable(h.take(1).subscribe(Fa,f.onError.bind(f),j)),l.getValues().forEach(function(b){var c;try{c=d(b,a)}catch(e){return void f.onError(e)}f.onNext(c)})},f.onError.bind(f),function(){i=!0,(h||0===m.count())&&f.onCompleted()})),g},e)},oc.groupJoin=function(a,b,c,d){var e=this;return new Ld(function(f){function g(a){return function(b){b.onError(a)}}var h=new Mb,i=new Vb(h),j=new Ed,k=new Ed,l=0,m=0;return h.add(e.subscribe(function(a){var c=new Od,e=l++;j.add(e,c);var m;try{m=d(a,Gb(c,i))}catch(n){return j.getValues().forEach(g(n)),void f.onError(n)}f.onNext(m),k.getValues().forEach(function(a){c.onNext(a)});var o=new Tb;h.add(o);var p,q=function(){j.remove(e)&&c.onCompleted(),h.remove(o)};try{p=b(a)}catch(n){return j.getValues().forEach(g(n)),void f.onError(n)}o.setDisposable(p.take(1).subscribe(Fa,function(a){j.getValues().forEach(g(a)),f.onError(a)},q))},function(a){j.getValues().forEach(g(a)),f.onError(a)},f.onCompleted.bind(f))),h.add(a.subscribe(function(a){var b=m++;k.add(b,a);var d=new Tb;h.add(d);var e,i=function(){k.remove(b),h.remove(d)};try{e=c(a)}catch(l){return j.getValues().forEach(g(l)),void f.onError(l)}d.setDisposable(e.take(1).subscribe(Fa,function(a){j.getValues().forEach(g(a)),f.onError(a)},i)),j.getValues().forEach(function(b){b.onNext(a)})},function(a){j.getValues().forEach(g(a)),f.onError(a)})),i},e)},oc.buffer=function(a,b){return this.window.apply(this,arguments).selectMany(function(a){return a.toArray()})},oc.window=function(a,b){return 1===arguments.length&&"function"!=typeof arguments[0]?ka.call(this,a):"function"==typeof a?la.call(this,a):ja.call(this,a,b)},oc.pairwise=function(){var a=this;return new Ld(function(b){var c,d=!1;return a.subscribe(function(a){d?b.onNext([c,a]):d=!0,c=a},b.onError.bind(b),b.onCompleted.bind(b))},a)},oc.partition=function(a,b){return[this.filter(a,b),this.filter(function(c,d,e){
+return!a.call(b,c,d,e)})]};var Fd=function(a){function b(a,b){this.c=a,this.s=b}return Eb(b,a),b.prototype[$a]=function(){var a=this;return{next:function(){return a.c()?{done:!1,value:a.s}:{done:!0,value:void 0}}}},b}(wc);oc.letBind=oc.let=function(a){return a(this)},uc["if"]=uc.ifThen=function(a,b,c){return Gc(function(){return c||(c=Ic()),La(b)&&(b=Ec(b)),La(c)&&(c=Ec(c)),"function"==typeof c.now&&(c=Ic(c)),a()?b:c})},uc["for"]=uc.forIn=function(a,b,c){return Cc(a,b,c).concat()};var Gd=uc["while"]=uc.whileDo=function(a,b){return La(b)&&(b=Ec(b)),ma(a,b).concat()};oc.doWhile=function(a){return _c([this,Gd(a,this)])},uc["case"]=uc.switchCase=function(a,b,c){return Gc(function(){La(c)&&(c=Ec(c)),c||(c=Ic()),"function"==typeof c.now&&(c=Ic(c));var d=b[a()];return La(d)&&(d=Ec(d)),d||c})},oc.expand=function(a,b){Zb(b)||(b=bc);var c=this;return new Ld(function(d){var e=[],f=new Ub,g=new Mb(f),h=0,i=!1,j=function(){var c=!1;e.length>0&&(c=!i,i=!0),c&&f.setDisposable(b.scheduleRecursive(function(b){var c;if(!(e.length>0))return void(i=!1);c=e.shift();var f=new Tb;g.add(f),f.setDisposable(c.subscribe(function(b){d.onNext(b);var c=null;try{c=a(b)}catch(f){d.onError(f)}e.push(c),h++,j()},d.onError.bind(d),function(){g.remove(f),h--,0===h&&d.onCompleted()})),b()}))};return e.push(c),h++,j(),g},this)},uc.forkJoin=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return new Ld(function(b){var c=a.length;if(0===c)return b.onCompleted(),Qb;for(var d=new Mb,e=!1,f=new Array(c),g=new Array(c),h=new Array(c),i=0;c>i;i++)!function(i){var j=a[i];La(j)&&(j=Ec(j)),d.add(j.subscribe(function(a){e||(f[i]=!0,h[i]=a)},function(a){e=!0,b.onError(a),d.dispose()},function(){if(!e){if(!f[i])return void b.onCompleted();g[i]=!0;for(var a=0;c>a;a++)if(!g[a])return;e=!0,b.onNext(h),b.onCompleted()}}))}(i);return d})},oc.forkJoin=function(a,b){var c=this;return new Ld(function(d){var e,f,g=!1,h=!1,i=!1,j=!1,k=new Tb,l=new Tb;return La(a)&&(a=Ec(a)),k.setDisposable(c.subscribe(function(a){i=!0,e=a},function(a){l.dispose(),d.onError(a)},function(){if(g=!0,h)if(i)if(j){var a;try{a=b(e,f)}catch(c){return void d.onError(c)}d.onNext(a),d.onCompleted()}else d.onCompleted();else d.onCompleted()})),l.setDisposable(a.subscribe(function(a){j=!0,f=a},function(a){k.dispose(),d.onError(a)},function(){if(h=!0,g)if(i)if(j){var a;try{a=b(e,f)}catch(c){return void d.onError(c)}d.onNext(a),d.onCompleted()}else d.onCompleted();else d.onCompleted()})),new Mb(k,l)},c)},oc.manySelect=oc.extend=function(a,b){Zb(b)||(b=bc);var c=this;return Gc(function(){var d;return c.map(function(a){var b=new Hd(a);return d&&d.onNext(a),d=b,b}).tap(Fa,function(a){d&&d.onError(a)},function(){d&&d.onCompleted()}).observeOn(b).map(a)},c)};var Hd=function(a){function b(a){var b=this,c=new Mb;return c.add(cc.schedule(function(){a.onNext(b.head),c.add(b.tail.mergeAll().subscribe(a))})),c}function c(c){a.call(this,b),this.head=c,this.tail=new Pd}return Eb(c,a),Fb(c.prototype,mc,{onCompleted:function(){this.onNext(uc.empty())},onError:function(a){this.onNext(uc.throwError(a))},onNext:function(a){this.tail.onNext(a),this.tail.onCompleted()}}),c}(uc),Id=za.Map||function(){function b(){this._keys=[],this._values=[]}return b.prototype.get=function(b){var c=this._keys.indexOf(b);return-1!==c?this._values[c]:a},b.prototype.set=function(a,b){var c=this._keys.indexOf(a);-1!==c&&(this._values[c]=b),this._values[this._keys.push(a)-1]=b},b.prototype.forEach=function(a,b){for(var c=0,d=this._keys.length;d>c;c++)a.call(b,this._values[c],this._keys[c])},b}();na.prototype.and=function(a){return new na(this.patterns.concat(a))},na.prototype.thenDo=function(a){return new oa(this,a)},oa.prototype.activate=function(a,b,c){for(var d=this,e=[],f=0,g=this.expression.patterns.length;g>f;f++)e.push(pa(a,this.expression.patterns[f],b.onError.bind(b)));var h=new qa(e,function(){var a;try{a=d.selector.apply(d,arguments)}catch(c){return void b.onError(c)}b.onNext(a)},function(){for(var a=0,b=e.length;b>a;a++)e[a].removeActivePlan(h);c(h)});for(f=0,g=e.length;g>f;f++)e[f].addActivePlan(h);return h},qa.prototype.dequeue=function(){this.joinObservers.forEach(function(a){a.queue.shift()})},qa.prototype.match=function(){var a,b,c=!0;for(a=0,b=this.joinObserverArray.length;b>a;a++)if(0===this.joinObserverArray[a].queue.length){c=!1;break}if(c){var d=[],e=!1;for(a=0,b=this.joinObserverArray.length;b>a;a++)d.push(this.joinObserverArray[a].queue[0]),"C"===this.joinObserverArray[a].queue[0].kind&&(e=!0);if(e)this.onCompleted();else{this.dequeue();var f=[];for(a=0,b=d.length;a<d.length;a++)f.push(d[a].value);this.onNext.apply(this,f)}}};var Jd=function(a){function b(b,c){a.call(this),this.source=b,this.onError=c,this.queue=[],this.activePlans=[],this.subscription=new Tb,this.isDisposed=!1}Eb(b,a);var c=b.prototype;return c.next=function(a){if(!this.isDisposed){if("E"===a.kind)return this.onError(a.exception);this.queue.push(a);for(var b=this.activePlans.slice(0),c=0,d=b.length;d>c;c++)b[c].match()}},c.error=Fa,c.completed=Fa,c.addActivePlan=function(a){this.activePlans.push(a)},c.subscribe=function(){this.subscription.setDisposable(this.source.materialize().subscribe(this))},c.removeActivePlan=function(a){this.activePlans.splice(this.activePlans.indexOf(a),1),0===this.activePlans.length&&this.dispose()},c.dispose=function(){a.prototype.dispose.call(this),this.isDisposed||(this.isDisposed=!0,this.subscription.dispose())},b}(pc);oc.and=function(a){return new na([this,a])},oc.thenDo=function(a){return new na([this]).thenDo(a)},uc.when=function(){var a,b=arguments.length;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new Ld(function(b){var c=[],d=new Id,e=nc(function(a){b.onNext(a)},function(a){d.forEach(function(b){b.onError(a)}),b.onError(a)},function(a){b.onCompleted()});try{for(var f=0,g=a.length;g>f;f++)c.push(a[f].activate(d,e,function(a){var d=c.indexOf(a);c.splice(d,1),0===c.length&&b.onCompleted()}))}catch(h){Xc(h).subscribe(b)}var i=new Mb;return d.forEach(function(a){a.subscribe(),i.add(a)}),i})};{var Kd=uc.interval=function(a,b){return ua(a,a,Zb(b)?b:gc)};uc.timer=function(b,c,d){var e;return Zb(d)||(d=gc),c!==a&&"number"==typeof c?e=c:Zb(c)&&(d=c),b instanceof Date&&e===a?ra(b.getTime(),d):b instanceof Date&&e!==a?(e=c,sa(b.getTime(),e,d)):e===a?ta(b,d):ua(b,e,d)}}oc.delay=function(a,b){return Zb(b)||(b=gc),a instanceof Date?wa(this,a.getTime(),b):va(this,a,b)},oc.debounce=oc.throttleWithTimeout=function(a,b){Zb(b)||(b=gc);var c=this;return new Ld(function(d){var e,f=new Ub,g=!1,h=0,i=c.subscribe(function(c){g=!0,e=c,h++;var i=h,j=new Tb;f.setDisposable(j),j.setDisposable(b.scheduleWithRelative(a,function(){g&&h===i&&d.onNext(e),g=!1}))},function(a){f.dispose(),d.onError(a),g=!1,h++},function(){f.dispose(),g&&d.onNext(e),d.onCompleted(),g=!1,h++});return new Mb(i,f)},this)},oc.throttle=function(a,b){return this.debounce(a,b)},oc.windowWithTime=function(a,b,c){var d,e=this;return null==b&&(d=a),Zb(c)||(c=gc),"number"==typeof b?d=b:Zb(b)&&(d=a,c=b),new Ld(function(b){function f(){var a=new Tb,e=!1,g=!1;l.setDisposable(a),j===i?(e=!0,g=!0):i>j?e=!0:g=!0;var n=e?j:i,o=n-m;m=n,e&&(j+=d),g&&(i+=d),a.setDisposable(c.scheduleWithRelative(o,function(){if(g){var a=new Od;k.push(a),b.onNext(Gb(a,h))}e&&k.shift().onCompleted(),f()}))}var g,h,i=d,j=a,k=[],l=new Ub,m=0;return g=new Mb(l),h=new Vb(g),k.push(new Od),b.onNext(Gb(k[0],h)),f(),g.add(e.subscribe(function(a){for(var b=0,c=k.length;c>b;b++)k[b].onNext(a)},function(a){for(var c=0,d=k.length;d>c;c++)k[c].onError(a);b.onError(a)},function(){for(var a=0,c=k.length;c>a;a++)k[a].onCompleted();b.onCompleted()})),h},e)},oc.windowWithTimeOrCount=function(a,b,c){var d=this;return Zb(c)||(c=gc),new Ld(function(e){function f(b){var d=new Tb;g.setDisposable(d),d.setDisposable(c.scheduleWithRelative(a,function(){if(b===k){j=0;var a=++k;l.onCompleted(),l=new Od,e.onNext(Gb(l,i)),f(a)}}))}var g=new Ub,h=new Mb(g),i=new Vb(h),j=0,k=0,l=new Od;return e.onNext(Gb(l,i)),f(0),h.add(d.subscribe(function(a){var c=0,d=!1;l.onNext(a),++j===b&&(d=!0,j=0,c=++k,l.onCompleted(),l=new Od,e.onNext(Gb(l,i))),d&&f(c)},function(a){l.onError(a),e.onError(a)},function(){l.onCompleted(),e.onCompleted()})),i},d)},oc.bufferWithTime=function(a,b,c){return this.windowWithTime.apply(this,arguments).selectMany(function(a){return a.toArray()})},oc.bufferWithTimeOrCount=function(a,b,c){return this.windowWithTimeOrCount(a,b,c).selectMany(function(a){return a.toArray()})},oc.timeInterval=function(a){var b=this;return Zb(a)||(a=gc),Gc(function(){var c=a.now();return b.map(function(b){var d=a.now(),e=d-c;return c=d,{value:b,interval:e}})})},oc.timestamp=function(a){return Zb(a)||(a=gc),this.map(function(b){return{value:b,timestamp:a.now()}})},oc.sample=oc.throttleLatest=function(a,b){return Zb(b)||(b=gc),"number"==typeof a?xa(this,Kd(a,b)):xa(this,a)},oc.timeout=function(a,b,c){(null==b||"string"==typeof b)&&(b=Xc(new Error(b||"Timeout"))),Zb(c)||(c=gc);var d=this,e=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new Ld(function(f){function g(){var d=h;l.setDisposable(c[e](a,function(){h===d&&(La(b)&&(b=Ec(b)),j.setDisposable(b.subscribe(f)))}))}var h=0,i=new Tb,j=new Ub,k=!1,l=new Ub;return j.setDisposable(i),g(),i.setDisposable(d.subscribe(function(a){k||(h++,f.onNext(a),g())},function(a){k||(h++,f.onError(a))},function(){k||(h++,f.onCompleted())})),new Mb(j,l)},d)},uc.generateWithAbsoluteTime=function(a,b,c,d,e,f){return Zb(f)||(f=gc),new Ld(function(g){var h=!0,i=!1;return f.scheduleRecursiveWithAbsoluteAndState(a,f.now(),function(a,f){i&&g.onNext(a);try{if(h?h=!1:a=c(a),i=b(a))var j=d(a),k=e(a)}catch(l){return void g.onError(l)}i?f(j,k):g.onCompleted()})})},uc.generateWithRelativeTime=function(a,b,c,d,e,f){return Zb(f)||(f=gc),new Ld(function(g){var h=!0,i=!1;return f.scheduleRecursiveWithRelativeAndState(a,0,function(a,f){i&&g.onNext(a);try{if(h?h=!1:a=c(a),i=b(a))var j=d(a),k=e(a)}catch(l){return void g.onError(l)}i?f(j,k):g.onCompleted()})})},oc.delaySubscription=function(a,b){var c=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative",d=this;return Zb(b)||(b=gc),new Ld(function(e){var f=new Ub;return f.setDisposable(b[c](a,function(){f.setDisposable(d.subscribe(e))})),f},this)},oc.delayWithSelector=function(a,b){var c,d,e=this;return Na(a)?d=a:(c=a,d=b),new Ld(function(a){function b(){i.setDisposable(e.subscribe(function(b){var c=p(d)(b);if(c===Hb)return a.onError(c.e);var e=new Tb;g.add(e),e.setDisposable(c.subscribe(function(){a.onNext(b),g.remove(e),f()},function(b){a.onError(b)},function(){a.onNext(b),g.remove(e),f()}))},function(b){a.onError(b)},function(){h=!0,i.dispose(),f()}))}function f(){h&&0===g.length&&a.onCompleted()}var g=new Mb,h=!1,i=new Ub;return c?i.setDisposable(c.subscribe(b,function(b){a.onError(b)},b)):b(),new Mb(i,g)},this)},oc.timeoutWithSelector=function(a,b,c){1===arguments.length&&(b=a,a=Qc()),c||(c=Xc(new Error("Timeout")));var d=this;return new Ld(function(e){function f(a){function b(){return k===d}var d=k,f=new Tb;i.setDisposable(f),f.setDisposable(a.subscribe(function(){b()&&h.setDisposable(c.subscribe(e)),f.dispose()},function(a){b()&&e.onError(a)},function(){b()&&h.setDisposable(c.subscribe(e))}))}function g(){var a=!l;return a&&k++,a}var h=new Ub,i=new Ub,j=new Tb;h.setDisposable(j);var k=0,l=!1;return f(a),j.setDisposable(d.subscribe(function(a){if(g()){e.onNext(a);var c;try{c=b(a)}catch(d){return void e.onError(d)}f(La(c)?Ec(c):c)}},function(a){g()&&e.onError(a)},function(){g()&&e.onCompleted()})),new Mb(h,i)},d)},oc.debounceWithSelector=function(a){var b=this;return new Ld(function(c){var d,e=!1,f=new Ub,g=0,h=b.subscribe(function(b){var h;try{h=a(b)}catch(i){return void c.onError(i)}La(h)&&(h=Ec(h)),e=!0,d=b,g++;var j=g,k=new Tb;f.setDisposable(k),k.setDisposable(h.subscribe(function(){e&&g===j&&c.onNext(d),e=!1,k.dispose()},c.onError.bind(c),function(){e&&g===j&&c.onNext(d),e=!1,k.dispose()}))},function(a){f.dispose(),c.onError(a),e=!1,g++},function(){f.dispose(),e&&c.onNext(d),c.onCompleted(),e=!1,g++});return new Mb(h,f)},b)},oc.throttleWithSelector=function(a){return this.debounceWithSelector(a)},oc.skipLastWithTime=function(a,b){Zb(b)||(b=gc);var c=this;return new Ld(function(d){var e=[];return c.subscribe(function(c){var f=b.now();for(e.push({interval:f,value:c});e.length>0&&f-e[0].interval>=a;)d.onNext(e.shift().value)},function(a){d.onError(a)},function(){for(var c=b.now();e.length>0&&c-e[0].interval>=a;)d.onNext(e.shift().value);d.onCompleted()})},c)},oc.takeLastWithTime=function(a,b){var c=this;return Zb(b)||(b=gc),new Ld(function(d){var e=[];return c.subscribe(function(c){var d=b.now();for(e.push({interval:d,value:c});e.length>0&&d-e[0].interval>=a;)e.shift()},function(a){d.onError(a)},function(){for(var c=b.now();e.length>0;){var f=e.shift();c-f.interval<=a&&d.onNext(f.value)}d.onCompleted()})},c)},oc.takeLastBufferWithTime=function(a,b){var c=this;return Zb(b)||(b=gc),new Ld(function(d){var e=[];return c.subscribe(function(c){var d=b.now();for(e.push({interval:d,value:c});e.length>0&&d-e[0].interval>=a;)e.shift()},function(a){d.onError(a)},function(){for(var c=b.now(),f=[];e.length>0;){var g=e.shift();c-g.interval<=a&&f.push(g.value)}d.onNext(f),d.onCompleted()})},c)},oc.takeWithTime=function(a,b){var c=this;return Zb(b)||(b=gc),new Ld(function(d){return new Mb(b.scheduleWithRelative(a,function(){d.onCompleted()}),c.subscribe(d))},c)},oc.skipWithTime=function(a,b){var c=this;return Zb(b)||(b=gc),new Ld(function(d){var e=!1;return new Mb(b.scheduleWithRelative(a,function(){e=!0}),c.subscribe(function(a){e&&d.onNext(a)},d.onError.bind(d),d.onCompleted.bind(d)))},c)},oc.skipUntilWithTime=function(a,b){Zb(b)||(b=gc);var c=this,d=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new Ld(function(e){var f=!1;return new Mb(b[d](a,function(){f=!0}),c.subscribe(function(a){f&&e.onNext(a)},function(a){e.onError(a)},function(){e.onCompleted()}))},c)},oc.takeUntilWithTime=function(a,b){Zb(b)||(b=gc);var c=this,d=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new Ld(function(e){return new Mb(b[d](a,function(){e.onCompleted()}),c.subscribe(e))},c)},oc.throttleFirst=function(a,b){Zb(b)||(b=gc);var c=+a||0;if(0>=c)throw new RangeError("windowDuration cannot be less or equal zero.");var d=this;return new Ld(function(a){var e=0;return d.subscribe(function(d){var f=b.now();(0===e||f-e>=c)&&(e=f,a.onNext(d))},function(b){a.onError(b)},function(){a.onCompleted()})},d)},oc.exclusive=function(){var a=this;return new Ld(function(b){var c=!1,d=!1,e=new Tb,f=new Mb;return f.add(e),e.setDisposable(a.subscribe(function(a){if(!c){c=!0,La(a)&&(a=Ec(a));var e=new Tb;f.add(e),e.setDisposable(a.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){f.remove(e),c=!1,d&&1===f.length&&b.onCompleted()}))}},b.onError.bind(b),function(){d=!0,c||1!==f.length||b.onCompleted()})),f},this)},oc.exclusiveMap=function(a,b){var c=this,d=db(a,b,3);return new Ld(function(a){var b=0,e=!1,f=!0,g=new Tb,h=new Mb;return h.add(g),g.setDisposable(c.subscribe(function(c){e||(e=!0,innerSubscription=new Tb,h.add(innerSubscription),La(c)&&(c=Ec(c)),innerSubscription.setDisposable(c.subscribe(function(e){var f;try{f=d(e,b++,c)}catch(g){return void a.onError(g)}a.onNext(f)},function(b){a.onError(b)},function(){h.remove(innerSubscription),e=!1,f&&1===h.length&&a.onCompleted()})))},function(b){a.onError(b)},function(){f=!0,1!==h.length||e||a.onCompleted()})),h},this)},oc.transduce=function(a){function b(a){return{"@@transducer/init":function(){return a},"@@transducer/step":function(a,b){return a.onNext(b)},"@@transducer/result":function(a){return a.onCompleted()}}}var c=this;return new Ld(function(d){var e=a(b(d));return c.subscribe(function(a){try{e["@@transducer/step"](d,a)}catch(b){d.onError(b)}},function(a){d.onError(a)},function(){e["@@transducer/result"](d)})},c)},Ea.VirtualTimeScheduler=function(a){function b(){return this.toDateTimeOffset(this.clock)}function c(a,b){return this.scheduleAbsoluteWithState(a,this.clock,b)}function d(a,b,c){return this.scheduleRelativeWithState(a,this.toRelative(b),c)}function e(a,b,c){return this.scheduleRelativeWithState(a,this.toRelative(b-this.now()),c)}function f(a,b){return b(),Qb}function g(f,g){this.clock=f,this.comparer=g,this.isEnabled=!1,this.queue=new Kb(1024),a.call(this,b,c,d,e)}Eb(g,a);var h=g.prototype;return h.add=Ya,h.toDateTimeOffset=Ya,h.toRelative=Ya,h.schedulePeriodicWithState=function(a,b,c){var d=new ac(this,a,b,c);return d.start()},h.scheduleRelativeWithState=function(a,b,c){var d=this.add(this.clock,b);return this.scheduleAbsoluteWithState(a,d,c)},h.scheduleRelative=function(a,b){return this.scheduleRelativeWithState(b,a,f)},h.start=function(){if(!this.isEnabled){this.isEnabled=!0;do{var a=this.getNext();null!==a?(this.comparer(a.dueTime,this.clock)>0&&(this.clock=a.dueTime),a.invoke()):this.isEnabled=!1}while(this.isEnabled)}},h.stop=function(){this.isEnabled=!1},h.advanceTo=function(a){var b=this.comparer(this.clock,a);if(this.comparer(this.clock,a)>0)throw new Va;if(0!==b&&!this.isEnabled){this.isEnabled=!0;do{var c=this.getNext();null!==c&&this.comparer(c.dueTime,a)<=0?(this.comparer(c.dueTime,this.clock)>0&&(this.clock=c.dueTime),c.invoke()):this.isEnabled=!1}while(this.isEnabled);this.clock=a}},h.advanceBy=function(a){var b=this.add(this.clock,a),c=this.comparer(this.clock,b);if(c>0)throw new Va;0!==c&&this.advanceTo(b)},h.sleep=function(a){var b=this.add(this.clock,a);if(this.comparer(this.clock,b)>=0)throw new Va;this.clock=b},h.getNext=function(){for(;this.queue.length>0;){var a=this.queue.peek();if(!a.isCancelled())return a;this.queue.dequeue()}return null},h.scheduleAbsolute=function(a,b){return this.scheduleAbsoluteWithState(b,a,f)},h.scheduleAbsoluteWithState=function(a,b,c){function d(a,b){return e.queue.remove(f),c(a,b)}var e=this,f=new Wb(this,a,d,b,this.comparer);return this.queue.enqueue(f),f.disposable},g}(Xb),Ea.HistoricalScheduler=function(a){function b(b,c){var d=null==b?0:b,e=c||Ja;a.call(this,d,e)}Eb(b,a);var c=b.prototype;return c.add=function(a,b){return a+b},c.toDateTimeOffset=function(a){return new Date(a).getTime()},c.toRelative=function(a){return a},b}(Ea.VirtualTimeScheduler);var Ld=Ea.AnonymousObservable=function(a){function b(a){return a&&Na(a.dispose)?a:Na(a)?Pb(a):Qb}function c(a,c){var d=c[0],e=c[1],f=p(e)(d);return f!==Hb||d.fail(Hb.e)?void d.setDisposable(b(f)):q(Hb.e)}function d(b,d){function e(a){var d=new Md(a),e=[d,b];return cc.scheduleRequired()?cc.scheduleWithState(e,c):c(null,e),d}this.source=d,a.call(this,e)}return Eb(d,a),d}(uc),Md=function(a){function b(b){a.call(this),this.observer=b,this.m=new Tb}Eb(b,a);var c=b.prototype;return c.next=function(a){var b=p(this.observer.onNext).call(this.observer,a);b===Hb&&(this.dispose(),q(b.e))},c.error=function(a){var b=p(this.observer.onError).call(this.observer,a);this.dispose(),b===Hb&&q(b.e)},c.completed=function(){var a=p(this.observer.onCompleted).call(this.observer);this.dispose(),a===Hb&&q(a.e)},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(pc),Nd=function(a){function b(a){return this.underlyingObservable.subscribe(a)}function c(c,d,e){a.call(this,b),this.key=c,this.underlyingObservable=e?new Ld(function(a){return new Mb(e.getDisposable(),d.subscribe(a))}):d}return Eb(c,a),c}(uc),Od=Ea.Subject=function(a){function c(a){return Sb(this),this.isStopped?this.hasError?(a.onError(this.error),Qb):(a.onCompleted(),Qb):(this.observers.push(a),new Ad(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return Eb(d,a),Fb(d.prototype,mc.prototype,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(Sb(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=b(this.observers),d=c.length;d>a;a++)c[a].onCompleted();this.observers.length=0}},onError:function(a){if(Sb(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){if(Sb(this),!this.isStopped)for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new Qd(a,b)},d}(uc),Pd=Ea.AsyncSubject=function(a){function c(a){return Sb(this),this.isStopped?(this.hasError?a.onError(this.error):this.hasValue?(a.onNext(this.value),a.onCompleted()):a.onCompleted(),Qb):(this.observers.push(a),new Ad(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.hasValue=!1,this.observers=[],this.hasError=!1}return Eb(d,a),Fb(d.prototype,mc,{hasObservers:function(){return Sb(this),this.observers.length>0},onCompleted:function(){var a,c;if(Sb(this),!this.isStopped){this.isStopped=!0;var d=b(this.observers),c=d.length;if(this.hasValue)for(a=0;c>a;a++){var e=d[a];e.onNext(this.value),e.onCompleted()}else for(a=0;c>a;a++)d[a].onCompleted();this.observers.length=0}},onError:function(a){if(Sb(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){Sb(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(uc),Qd=Ea.AnonymousSubject=function(a){function b(a){return this.observable.subscribe(a)}function c(c,d){this.observer=c,this.observable=d,a.call(this,b)}return Eb(c,a),Fb(c.prototype,mc.prototype,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(uc);Ea.Pauser=function(a){function b(){a.call(this)}return Eb(b,a),b.prototype.pause=function(){this.onNext(!1)},b.prototype.resume=function(){this.onNext(!0)},b}(Od),"function"==typeof define&&"object"==typeof define.amd&&define.amd?(za.Rx=Ea,define(function(){return Ea})):Aa&&Ba?Ca?(Ba.exports=Ea).Rx=Ea:Aa.Rx=Ea:za.Rx=Ea;var Rd=g()}).call(this);
+//# sourceMappingURL=rx.all.compat.map \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.all.js b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.all.js
new file mode 100644
index 00000000000..676bcbd9b8b
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.all.js
@@ -0,0 +1,10723 @@
+// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
+
+;(function (undefined) {
+
+ var objectTypes = {
+ 'boolean': false,
+ 'function': true,
+ 'object': true,
+ 'number': false,
+ 'string': false,
+ 'undefined': false
+ };
+
+ var root = (objectTypes[typeof window] && window) || this,
+ freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
+ freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
+ moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
+ freeGlobal = objectTypes[typeof global] && global;
+
+ if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) {
+ root = freeGlobal;
+ }
+
+ var Rx = {
+ internals: {},
+ config: {
+ Promise: root.Promise
+ },
+ helpers: { }
+ };
+
+ // Defaults
+ var noop = Rx.helpers.noop = function () { },
+ notDefined = Rx.helpers.notDefined = function (x) { return typeof x === 'undefined'; },
+ identity = Rx.helpers.identity = function (x) { return x; },
+ pluck = Rx.helpers.pluck = function (property) { return function (x) { return x[property]; }; },
+ just = Rx.helpers.just = function (value) { return function () { return value; }; },
+ defaultNow = Rx.helpers.defaultNow = Date.now,
+ defaultComparer = Rx.helpers.defaultComparer = function (x, y) { return isEqual(x, y); },
+ defaultSubComparer = Rx.helpers.defaultSubComparer = function (x, y) { return x > y ? 1 : (x < y ? -1 : 0); },
+ defaultKeySerializer = Rx.helpers.defaultKeySerializer = function (x) { return x.toString(); },
+ defaultError = Rx.helpers.defaultError = function (err) { throw err; },
+ isPromise = Rx.helpers.isPromise = function (p) { return !!p && typeof p.subscribe !== 'function' && typeof p.then === 'function'; },
+ asArray = Rx.helpers.asArray = function () { return Array.prototype.slice.call(arguments); },
+ not = Rx.helpers.not = function (a) { return !a; },
+ isFunction = Rx.helpers.isFunction = (function () {
+
+ var isFn = function (value) {
+ return typeof value == 'function' || false;
+ }
+
+ // fallback for older versions of Chrome and Safari
+ if (isFn(/x/)) {
+ isFn = function(value) {
+ return typeof value == 'function' && toString.call(value) == '[object Function]';
+ };
+ }
+
+ return isFn;
+ }());
+
+ function cloneArray(arr) { for(var a = [], i = 0, len = arr.length; i < len; i++) { a.push(arr[i]); } return a;}
+
+ Rx.config.longStackSupport = false;
+ var hasStacks = false;
+ try {
+ throw new Error();
+ } catch (e) {
+ hasStacks = !!e.stack;
+ }
+
+ // All code after this point will be filtered from stack traces reported by RxJS
+ var rStartingLine = captureLine(), rFileName;
+
+ var STACK_JUMP_SEPARATOR = "From previous event:";
+
+ function makeStackTraceLong(error, observable) {
+ // If possible, transform the error stack trace by removing Node and RxJS
+ // cruft, then concatenating with the stack trace of `observable`.
+ if (hasStacks &&
+ observable.stack &&
+ typeof error === "object" &&
+ error !== null &&
+ error.stack &&
+ error.stack.indexOf(STACK_JUMP_SEPARATOR) === -1
+ ) {
+ var stacks = [];
+ for (var o = observable; !!o; o = o.source) {
+ if (o.stack) {
+ stacks.unshift(o.stack);
+ }
+ }
+ stacks.unshift(error.stack);
+
+ var concatedStacks = stacks.join("\n" + STACK_JUMP_SEPARATOR + "\n");
+ error.stack = filterStackString(concatedStacks);
+ }
+ }
+
+ function filterStackString(stackString) {
+ var lines = stackString.split("\n"),
+ desiredLines = [];
+ for (var i = 0, len = lines.length; i < len; i++) {
+ var line = lines[i];
+
+ if (!isInternalFrame(line) && !isNodeFrame(line) && line) {
+ desiredLines.push(line);
+ }
+ }
+ return desiredLines.join("\n");
+ }
+
+ function isInternalFrame(stackLine) {
+ var fileNameAndLineNumber = getFileNameAndLineNumber(stackLine);
+ if (!fileNameAndLineNumber) {
+ return false;
+ }
+ var fileName = fileNameAndLineNumber[0], lineNumber = fileNameAndLineNumber[1];
+
+ return fileName === rFileName &&
+ lineNumber >= rStartingLine &&
+ lineNumber <= rEndingLine;
+ }
+
+ function isNodeFrame(stackLine) {
+ return stackLine.indexOf("(module.js:") !== -1 ||
+ stackLine.indexOf("(node.js:") !== -1;
+ }
+
+ function captureLine() {
+ if (!hasStacks) { return; }
+
+ try {
+ throw new Error();
+ } catch (e) {
+ var lines = e.stack.split("\n");
+ var firstLine = lines[0].indexOf("@") > 0 ? lines[1] : lines[2];
+ var fileNameAndLineNumber = getFileNameAndLineNumber(firstLine);
+ if (!fileNameAndLineNumber) { return; }
+
+ rFileName = fileNameAndLineNumber[0];
+ return fileNameAndLineNumber[1];
+ }
+ }
+
+ function getFileNameAndLineNumber(stackLine) {
+ // Named functions: "at functionName (filename:lineNumber:columnNumber)"
+ var attempt1 = /at .+ \((.+):(\d+):(?:\d+)\)$/.exec(stackLine);
+ if (attempt1) { return [attempt1[1], Number(attempt1[2])]; }
+
+ // Anonymous functions: "at filename:lineNumber:columnNumber"
+ var attempt2 = /at ([^ ]+):(\d+):(?:\d+)$/.exec(stackLine);
+ if (attempt2) { return [attempt2[1], Number(attempt2[2])]; }
+
+ // Firefox style: "function@filename:lineNumber or @filename:lineNumber"
+ var attempt3 = /.*@(.+):(\d+)$/.exec(stackLine);
+ if (attempt3) { return [attempt3[1], Number(attempt3[2])]; }
+ }
+
+ var EmptyError = Rx.EmptyError = function() {
+ this.message = 'Sequence contains no elements.';
+ Error.call(this);
+ };
+ EmptyError.prototype = Error.prototype;
+
+ var ObjectDisposedError = Rx.ObjectDisposedError = function() {
+ this.message = 'Object has been disposed';
+ Error.call(this);
+ };
+ ObjectDisposedError.prototype = Error.prototype;
+
+ var ArgumentOutOfRangeError = Rx.ArgumentOutOfRangeError = function () {
+ this.message = 'Argument out of range';
+ Error.call(this);
+ };
+ ArgumentOutOfRangeError.prototype = Error.prototype;
+
+ var NotSupportedError = Rx.NotSupportedError = function (message) {
+ this.message = message || 'This operation is not supported';
+ Error.call(this);
+ };
+ NotSupportedError.prototype = Error.prototype;
+
+ var NotImplementedError = Rx.NotImplementedError = function (message) {
+ this.message = message || 'This operation is not implemented';
+ Error.call(this);
+ };
+ NotImplementedError.prototype = Error.prototype;
+
+ var notImplemented = Rx.helpers.notImplemented = function () {
+ throw new NotImplementedError();
+ };
+
+ var notSupported = Rx.helpers.notSupported = function () {
+ throw new NotSupportedError();
+ };
+
+ // Shim in iterator support
+ var $iterator$ = (typeof Symbol === 'function' && Symbol.iterator) ||
+ '_es6shim_iterator_';
+ // Bug for mozilla version
+ if (root.Set && typeof new root.Set()['@@iterator'] === 'function') {
+ $iterator$ = '@@iterator';
+ }
+
+ var doneEnumerator = Rx.doneEnumerator = { done: true, value: undefined };
+
+ var isIterable = Rx.helpers.isIterable = function (o) {
+ return o[$iterator$] !== undefined;
+ }
+
+ var isArrayLike = Rx.helpers.isArrayLike = function (o) {
+ return o && o.length !== undefined;
+ }
+
+ Rx.helpers.iterator = $iterator$;
+
+ var bindCallback = Rx.internals.bindCallback = function (func, thisArg, argCount) {
+ if (typeof thisArg === 'undefined') { return func; }
+ switch(argCount) {
+ case 0:
+ return function() {
+ return func.call(thisArg)
+ };
+ case 1:
+ return function(arg) {
+ return func.call(thisArg, arg);
+ }
+ case 2:
+ return function(value, index) {
+ return func.call(thisArg, value, index);
+ };
+ case 3:
+ return function(value, index, collection) {
+ return func.call(thisArg, value, index, collection);
+ };
+ }
+
+ return function() {
+ return func.apply(thisArg, arguments);
+ };
+ };
+
+ /** Used to determine if values are of the language type Object */
+ var dontEnums = ['toString',
+ 'toLocaleString',
+ 'valueOf',
+ 'hasOwnProperty',
+ 'isPrototypeOf',
+ 'propertyIsEnumerable',
+ 'constructor'],
+ dontEnumsLength = dontEnums.length;
+
+ /** `Object#toString` result shortcuts */
+ var argsClass = '[object Arguments]',
+ arrayClass = '[object Array]',
+ boolClass = '[object Boolean]',
+ dateClass = '[object Date]',
+ errorClass = '[object Error]',
+ funcClass = '[object Function]',
+ numberClass = '[object Number]',
+ objectClass = '[object Object]',
+ regexpClass = '[object RegExp]',
+ stringClass = '[object String]';
+
+ var toString = Object.prototype.toString,
+ hasOwnProperty = Object.prototype.hasOwnProperty,
+ supportsArgsClass = toString.call(arguments) == argsClass, // For less <IE9 && FF<4
+ supportNodeClass,
+ errorProto = Error.prototype,
+ objectProto = Object.prototype,
+ stringProto = String.prototype,
+ propertyIsEnumerable = objectProto.propertyIsEnumerable;
+
+ try {
+ supportNodeClass = !(toString.call(document) == objectClass && !({ 'toString': 0 } + ''));
+ } catch (e) {
+ supportNodeClass = true;
+ }
+
+ var nonEnumProps = {};
+ nonEnumProps[arrayClass] = nonEnumProps[dateClass] = nonEnumProps[numberClass] = { 'constructor': true, 'toLocaleString': true, 'toString': true, 'valueOf': true };
+ nonEnumProps[boolClass] = nonEnumProps[stringClass] = { 'constructor': true, 'toString': true, 'valueOf': true };
+ nonEnumProps[errorClass] = nonEnumProps[funcClass] = nonEnumProps[regexpClass] = { 'constructor': true, 'toString': true };
+ nonEnumProps[objectClass] = { 'constructor': true };
+
+ var support = {};
+ (function () {
+ var ctor = function() { this.x = 1; },
+ props = [];
+
+ ctor.prototype = { 'valueOf': 1, 'y': 1 };
+ for (var key in new ctor) { props.push(key); }
+ for (key in arguments) { }
+
+ // Detect if `name` or `message` properties of `Error.prototype` are enumerable by default.
+ support.enumErrorProps = propertyIsEnumerable.call(errorProto, 'message') || propertyIsEnumerable.call(errorProto, 'name');
+
+ // Detect if `prototype` properties are enumerable by default.
+ support.enumPrototypes = propertyIsEnumerable.call(ctor, 'prototype');
+
+ // Detect if `arguments` object indexes are non-enumerable
+ support.nonEnumArgs = key != 0;
+
+ // Detect if properties shadowing those on `Object.prototype` are non-enumerable.
+ support.nonEnumShadows = !/valueOf/.test(props);
+ }(1));
+
+ var isObject = Rx.internals.isObject = function(value) {
+ var type = typeof value;
+ return value && (type == 'function' || type == 'object') || false;
+ };
+
+ function keysIn(object) {
+ var result = [];
+ if (!isObject(object)) {
+ return result;
+ }
+ if (support.nonEnumArgs && object.length && isArguments(object)) {
+ object = slice.call(object);
+ }
+ var skipProto = support.enumPrototypes && typeof object == 'function',
+ skipErrorProps = support.enumErrorProps && (object === errorProto || object instanceof Error);
+
+ for (var key in object) {
+ if (!(skipProto && key == 'prototype') &&
+ !(skipErrorProps && (key == 'message' || key == 'name'))) {
+ result.push(key);
+ }
+ }
+
+ if (support.nonEnumShadows && object !== objectProto) {
+ var ctor = object.constructor,
+ index = -1,
+ length = dontEnumsLength;
+
+ if (object === (ctor && ctor.prototype)) {
+ var className = object === stringProto ? stringClass : object === errorProto ? errorClass : toString.call(object),
+ nonEnum = nonEnumProps[className];
+ }
+ while (++index < length) {
+ key = dontEnums[index];
+ if (!(nonEnum && nonEnum[key]) && hasOwnProperty.call(object, key)) {
+ result.push(key);
+ }
+ }
+ }
+ return result;
+ }
+
+ function internalFor(object, callback, keysFunc) {
+ var index = -1,
+ props = keysFunc(object),
+ length = props.length;
+
+ while (++index < length) {
+ var key = props[index];
+ if (callback(object[key], key, object) === false) {
+ break;
+ }
+ }
+ return object;
+ }
+
+ function internalForIn(object, callback) {
+ return internalFor(object, callback, keysIn);
+ }
+
+ function isNode(value) {
+ // IE < 9 presents DOM nodes as `Object` objects except they have `toString`
+ // methods that are `typeof` "string" and still can coerce nodes to strings
+ return typeof value.toString != 'function' && typeof (value + '') == 'string';
+ }
+
+ var isArguments = function(value) {
+ return (value && typeof value == 'object') ? toString.call(value) == argsClass : false;
+ }
+
+ // fallback for browsers that can't detect `arguments` objects by [[Class]]
+ if (!supportsArgsClass) {
+ isArguments = function(value) {
+ return (value && typeof value == 'object') ? hasOwnProperty.call(value, 'callee') : false;
+ };
+ }
+
+ var isEqual = Rx.internals.isEqual = function (x, y) {
+ return deepEquals(x, y, [], []);
+ };
+
+ /** @private
+ * Used for deep comparison
+ **/
+ function deepEquals(a, b, stackA, stackB) {
+ // exit early for identical values
+ if (a === b) {
+ // treat `+0` vs. `-0` as not equal
+ return a !== 0 || (1 / a == 1 / b);
+ }
+
+ var type = typeof a,
+ otherType = typeof b;
+
+ // exit early for unlike primitive values
+ if (a === a && (a == null || b == null ||
+ (type != 'function' && type != 'object' && otherType != 'function' && otherType != 'object'))) {
+ return false;
+ }
+
+ // compare [[Class]] names
+ var className = toString.call(a),
+ otherClass = toString.call(b);
+
+ if (className == argsClass) {
+ className = objectClass;
+ }
+ if (otherClass == argsClass) {
+ otherClass = objectClass;
+ }
+ if (className != otherClass) {
+ return false;
+ }
+ switch (className) {
+ case boolClass:
+ case dateClass:
+ // coerce dates and booleans to numbers, dates to milliseconds and booleans
+ // to `1` or `0` treating invalid dates coerced to `NaN` as not equal
+ return +a == +b;
+
+ case numberClass:
+ // treat `NaN` vs. `NaN` as equal
+ return (a != +a) ?
+ b != +b :
+ // but treat `-0` vs. `+0` as not equal
+ (a == 0 ? (1 / a == 1 / b) : a == +b);
+
+ case regexpClass:
+ case stringClass:
+ // coerce regexes to strings (http://es5.github.io/#x15.10.6.4)
+ // treat string primitives and their corresponding object instances as equal
+ return a == String(b);
+ }
+ var isArr = className == arrayClass;
+ if (!isArr) {
+
+ // exit for functions and DOM nodes
+ if (className != objectClass || (!support.nodeClass && (isNode(a) || isNode(b)))) {
+ return false;
+ }
+ // in older versions of Opera, `arguments` objects have `Array` constructors
+ var ctorA = !support.argsObject && isArguments(a) ? Object : a.constructor,
+ ctorB = !support.argsObject && isArguments(b) ? Object : b.constructor;
+
+ // non `Object` object instances with different constructors are not equal
+ if (ctorA != ctorB &&
+ !(hasOwnProperty.call(a, 'constructor') && hasOwnProperty.call(b, 'constructor')) &&
+ !(isFunction(ctorA) && ctorA instanceof ctorA && isFunction(ctorB) && ctorB instanceof ctorB) &&
+ ('constructor' in a && 'constructor' in b)
+ ) {
+ return false;
+ }
+ }
+ // assume cyclic structures are equal
+ // the algorithm for detecting cyclic structures is adapted from ES 5.1
+ // section 15.12.3, abstract operation `JO` (http://es5.github.io/#x15.12.3)
+ var initedStack = !stackA;
+ stackA || (stackA = []);
+ stackB || (stackB = []);
+
+ var length = stackA.length;
+ while (length--) {
+ if (stackA[length] == a) {
+ return stackB[length] == b;
+ }
+ }
+ var size = 0;
+ var result = true;
+
+ // add `a` and `b` to the stack of traversed objects
+ stackA.push(a);
+ stackB.push(b);
+
+ // recursively compare objects and arrays (susceptible to call stack limits)
+ if (isArr) {
+ // compare lengths to determine if a deep comparison is necessary
+ length = a.length;
+ size = b.length;
+ result = size == length;
+
+ if (result) {
+ // deep compare the contents, ignoring non-numeric properties
+ while (size--) {
+ var index = length,
+ value = b[size];
+
+ if (!(result = deepEquals(a[size], value, stackA, stackB))) {
+ break;
+ }
+ }
+ }
+ }
+ else {
+ // deep compare objects using `forIn`, instead of `forOwn`, to avoid `Object.keys`
+ // which, in this case, is more costly
+ internalForIn(b, function(value, key, b) {
+ if (hasOwnProperty.call(b, key)) {
+ // count the number of properties.
+ size++;
+ // deep compare each property value.
+ return (result = hasOwnProperty.call(a, key) && deepEquals(a[key], value, stackA, stackB));
+ }
+ });
+
+ if (result) {
+ // ensure both objects have the same number of properties
+ internalForIn(a, function(value, key, a) {
+ if (hasOwnProperty.call(a, key)) {
+ // `size` will be `-1` if `a` has more properties than `b`
+ return (result = --size > -1);
+ }
+ });
+ }
+ }
+ stackA.pop();
+ stackB.pop();
+
+ return result;
+ }
+
+ var hasProp = {}.hasOwnProperty,
+ slice = Array.prototype.slice;
+
+ var inherits = this.inherits = Rx.internals.inherits = function (child, parent) {
+ function __() { this.constructor = child; }
+ __.prototype = parent.prototype;
+ child.prototype = new __();
+ };
+
+ var addProperties = Rx.internals.addProperties = function (obj) {
+ for(var sources = [], i = 1, len = arguments.length; i < len; i++) { sources.push(arguments[i]); }
+ for (var idx = 0, ln = sources.length; idx < ln; idx++) {
+ var source = sources[idx];
+ for (var prop in source) {
+ obj[prop] = source[prop];
+ }
+ }
+ };
+
+ // Rx Utils
+ var addRef = Rx.internals.addRef = function (xs, r) {
+ return new AnonymousObservable(function (observer) {
+ return new CompositeDisposable(r.getDisposable(), xs.subscribe(observer));
+ });
+ };
+
+ function arrayInitialize(count, factory) {
+ var a = new Array(count);
+ for (var i = 0; i < count; i++) {
+ a[i] = factory();
+ }
+ return a;
+ }
+
+ var errorObj = {e: {}};
+ var tryCatchTarget;
+ function tryCatcher() {
+ try {
+ return tryCatchTarget.apply(this, arguments);
+ } catch (e) {
+ errorObj.e = e;
+ return errorObj;
+ }
+ }
+ function tryCatch(fn) {
+ if (!isFunction(fn)) { throw new TypeError('fn must be a function'); }
+ tryCatchTarget = fn;
+ return tryCatcher;
+ }
+ function thrower(e) {
+ throw e;
+ }
+
+ // Collections
+ function IndexedItem(id, value) {
+ this.id = id;
+ this.value = value;
+ }
+
+ IndexedItem.prototype.compareTo = function (other) {
+ var c = this.value.compareTo(other.value);
+ c === 0 && (c = this.id - other.id);
+ return c;
+ };
+
+ // Priority Queue for Scheduling
+ var PriorityQueue = Rx.internals.PriorityQueue = function (capacity) {
+ this.items = new Array(capacity);
+ this.length = 0;
+ };
+
+ var priorityProto = PriorityQueue.prototype;
+ priorityProto.isHigherPriority = function (left, right) {
+ return this.items[left].compareTo(this.items[right]) < 0;
+ };
+
+ priorityProto.percolate = function (index) {
+ if (index >= this.length || index < 0) { return; }
+ var parent = index - 1 >> 1;
+ if (parent < 0 || parent === index) { return; }
+ if (this.isHigherPriority(index, parent)) {
+ var temp = this.items[index];
+ this.items[index] = this.items[parent];
+ this.items[parent] = temp;
+ this.percolate(parent);
+ }
+ };
+
+ priorityProto.heapify = function (index) {
+ +index || (index = 0);
+ if (index >= this.length || index < 0) { return; }
+ var left = 2 * index + 1,
+ right = 2 * index + 2,
+ first = index;
+ if (left < this.length && this.isHigherPriority(left, first)) {
+ first = left;
+ }
+ if (right < this.length && this.isHigherPriority(right, first)) {
+ first = right;
+ }
+ if (first !== index) {
+ var temp = this.items[index];
+ this.items[index] = this.items[first];
+ this.items[first] = temp;
+ this.heapify(first);
+ }
+ };
+
+ priorityProto.peek = function () { return this.items[0].value; };
+
+ priorityProto.removeAt = function (index) {
+ this.items[index] = this.items[--this.length];
+ this.items[this.length] = undefined;
+ this.heapify();
+ };
+
+ priorityProto.dequeue = function () {
+ var result = this.peek();
+ this.removeAt(0);
+ return result;
+ };
+
+ priorityProto.enqueue = function (item) {
+ var index = this.length++;
+ this.items[index] = new IndexedItem(PriorityQueue.count++, item);
+ this.percolate(index);
+ };
+
+ priorityProto.remove = function (item) {
+ for (var i = 0; i < this.length; i++) {
+ if (this.items[i].value === item) {
+ this.removeAt(i);
+ return true;
+ }
+ }
+ return false;
+ };
+ PriorityQueue.count = 0;
+
+ /**
+ * Represents a group of disposable resources that are disposed together.
+ * @constructor
+ */
+ var CompositeDisposable = Rx.CompositeDisposable = function () {
+ var args = [], i, len;
+ if (Array.isArray(arguments[0])) {
+ args = arguments[0];
+ len = args.length;
+ } else {
+ len = arguments.length;
+ args = new Array(len);
+ for(i = 0; i < len; i++) { args[i] = arguments[i]; }
+ }
+ for(i = 0; i < len; i++) {
+ if (!isDisposable(args[i])) { throw new TypeError('Not a disposable'); }
+ }
+ this.disposables = args;
+ this.isDisposed = false;
+ this.length = args.length;
+ };
+
+ var CompositeDisposablePrototype = CompositeDisposable.prototype;
+
+ /**
+ * Adds a disposable to the CompositeDisposable or disposes the disposable if the CompositeDisposable is disposed.
+ * @param {Mixed} item Disposable to add.
+ */
+ CompositeDisposablePrototype.add = function (item) {
+ if (this.isDisposed) {
+ item.dispose();
+ } else {
+ this.disposables.push(item);
+ this.length++;
+ }
+ };
+
+ /**
+ * Removes and disposes the first occurrence of a disposable from the CompositeDisposable.
+ * @param {Mixed} item Disposable to remove.
+ * @returns {Boolean} true if found; false otherwise.
+ */
+ CompositeDisposablePrototype.remove = function (item) {
+ var shouldDispose = false;
+ if (!this.isDisposed) {
+ var idx = this.disposables.indexOf(item);
+ if (idx !== -1) {
+ shouldDispose = true;
+ this.disposables.splice(idx, 1);
+ this.length--;
+ item.dispose();
+ }
+ }
+ return shouldDispose;
+ };
+
+ /**
+ * Disposes all disposables in the group and removes them from the group.
+ */
+ CompositeDisposablePrototype.dispose = function () {
+ if (!this.isDisposed) {
+ this.isDisposed = true;
+ var len = this.disposables.length, currentDisposables = new Array(len);
+ for(var i = 0; i < len; i++) { currentDisposables[i] = this.disposables[i]; }
+ this.disposables = [];
+ this.length = 0;
+
+ for (i = 0; i < len; i++) {
+ currentDisposables[i].dispose();
+ }
+ }
+ };
+
+ /**
+ * Provides a set of static methods for creating Disposables.
+ * @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once.
+ */
+ var Disposable = Rx.Disposable = function (action) {
+ this.isDisposed = false;
+ this.action = action || noop;
+ };
+
+ /** Performs the task of cleaning up resources. */
+ Disposable.prototype.dispose = function () {
+ if (!this.isDisposed) {
+ this.action();
+ this.isDisposed = true;
+ }
+ };
+
+ /**
+ * Creates a disposable object that invokes the specified action when disposed.
+ * @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once.
+ * @return {Disposable} The disposable object that runs the given action upon disposal.
+ */
+ var disposableCreate = Disposable.create = function (action) { return new Disposable(action); };
+
+ /**
+ * Gets the disposable that does nothing when disposed.
+ */
+ var disposableEmpty = Disposable.empty = { dispose: noop };
+
+ /**
+ * Validates whether the given object is a disposable
+ * @param {Object} Object to test whether it has a dispose method
+ * @returns {Boolean} true if a disposable object, else false.
+ */
+ var isDisposable = Disposable.isDisposable = function (d) {
+ return d && isFunction(d.dispose);
+ };
+
+ var checkDisposed = Disposable.checkDisposed = function (disposable) {
+ if (disposable.isDisposed) { throw new ObjectDisposedError(); }
+ };
+
+ // Single assignment
+ var SingleAssignmentDisposable = Rx.SingleAssignmentDisposable = function () {
+ this.isDisposed = false;
+ this.current = null;
+ };
+ SingleAssignmentDisposable.prototype.getDisposable = function () {
+ return this.current;
+ };
+ SingleAssignmentDisposable.prototype.setDisposable = function (value) {
+ if (this.current) { throw new Error('Disposable has already been assigned'); }
+ var shouldDispose = this.isDisposed;
+ !shouldDispose && (this.current = value);
+ shouldDispose && value && value.dispose();
+ };
+ SingleAssignmentDisposable.prototype.dispose = function () {
+ if (!this.isDisposed) {
+ this.isDisposed = true;
+ var old = this.current;
+ this.current = null;
+ }
+ old && old.dispose();
+ };
+
+ // Multiple assignment disposable
+ var SerialDisposable = Rx.SerialDisposable = function () {
+ this.isDisposed = false;
+ this.current = null;
+ };
+ SerialDisposable.prototype.getDisposable = function () {
+ return this.current;
+ };
+ SerialDisposable.prototype.setDisposable = function (value) {
+ var shouldDispose = this.isDisposed;
+ if (!shouldDispose) {
+ var old = this.current;
+ this.current = value;
+ }
+ old && old.dispose();
+ shouldDispose && value && value.dispose();
+ };
+ SerialDisposable.prototype.dispose = function () {
+ if (!this.isDisposed) {
+ this.isDisposed = true;
+ var old = this.current;
+ this.current = null;
+ }
+ old && old.dispose();
+ };
+
+ /**
+ * Represents a disposable resource that only disposes its underlying disposable resource when all dependent disposable objects have been disposed.
+ */
+ var RefCountDisposable = Rx.RefCountDisposable = (function () {
+
+ function InnerDisposable(disposable) {
+ this.disposable = disposable;
+ this.disposable.count++;
+ this.isInnerDisposed = false;
+ }
+
+ InnerDisposable.prototype.dispose = function () {
+ if (!this.disposable.isDisposed && !this.isInnerDisposed) {
+ this.isInnerDisposed = true;
+ this.disposable.count--;
+ if (this.disposable.count === 0 && this.disposable.isPrimaryDisposed) {
+ this.disposable.isDisposed = true;
+ this.disposable.underlyingDisposable.dispose();
+ }
+ }
+ };
+
+ /**
+ * Initializes a new instance of the RefCountDisposable with the specified disposable.
+ * @constructor
+ * @param {Disposable} disposable Underlying disposable.
+ */
+ function RefCountDisposable(disposable) {
+ this.underlyingDisposable = disposable;
+ this.isDisposed = false;
+ this.isPrimaryDisposed = false;
+ this.count = 0;
+ }
+
+ /**
+ * Disposes the underlying disposable only when all dependent disposables have been disposed
+ */
+ RefCountDisposable.prototype.dispose = function () {
+ if (!this.isDisposed && !this.isPrimaryDisposed) {
+ this.isPrimaryDisposed = true;
+ if (this.count === 0) {
+ this.isDisposed = true;
+ this.underlyingDisposable.dispose();
+ }
+ }
+ };
+
+ /**
+ * Returns a dependent disposable that when disposed decreases the refcount on the underlying disposable.
+ * @returns {Disposable} A dependent disposable contributing to the reference count that manages the underlying disposable's lifetime.
+ */
+ RefCountDisposable.prototype.getDisposable = function () {
+ return this.isDisposed ? disposableEmpty : new InnerDisposable(this);
+ };
+
+ return RefCountDisposable;
+ })();
+
+ function ScheduledDisposable(scheduler, disposable) {
+ this.scheduler = scheduler;
+ this.disposable = disposable;
+ this.isDisposed = false;
+ }
+
+ function scheduleItem(s, self) {
+ if (!self.isDisposed) {
+ self.isDisposed = true;
+ self.disposable.dispose();
+ }
+ }
+
+ ScheduledDisposable.prototype.dispose = function () {
+ this.scheduler.scheduleWithState(this, scheduleItem);
+ };
+
+ var ScheduledItem = Rx.internals.ScheduledItem = function (scheduler, state, action, dueTime, comparer) {
+ this.scheduler = scheduler;
+ this.state = state;
+ this.action = action;
+ this.dueTime = dueTime;
+ this.comparer = comparer || defaultSubComparer;
+ this.disposable = new SingleAssignmentDisposable();
+ }
+
+ ScheduledItem.prototype.invoke = function () {
+ this.disposable.setDisposable(this.invokeCore());
+ };
+
+ ScheduledItem.prototype.compareTo = function (other) {
+ return this.comparer(this.dueTime, other.dueTime);
+ };
+
+ ScheduledItem.prototype.isCancelled = function () {
+ return this.disposable.isDisposed;
+ };
+
+ ScheduledItem.prototype.invokeCore = function () {
+ return this.action(this.scheduler, this.state);
+ };
+
+ /** Provides a set of static properties to access commonly used schedulers. */
+ var Scheduler = Rx.Scheduler = (function () {
+
+ function Scheduler(now, schedule, scheduleRelative, scheduleAbsolute) {
+ this.now = now;
+ this._schedule = schedule;
+ this._scheduleRelative = scheduleRelative;
+ this._scheduleAbsolute = scheduleAbsolute;
+ }
+
+ /** Determines whether the given object is a scheduler */
+ Scheduler.isScheduler = function (s) {
+ return s instanceof Scheduler;
+ }
+
+ function invokeAction(scheduler, action) {
+ action();
+ return disposableEmpty;
+ }
+
+ var schedulerProto = Scheduler.prototype;
+
+ /**
+ * Schedules an action to be executed.
+ * @param {Function} action Action to execute.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.schedule = function (action) {
+ return this._schedule(action, invokeAction);
+ };
+
+ /**
+ * Schedules an action to be executed.
+ * @param state State passed to the action to be executed.
+ * @param {Function} action Action to be executed.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleWithState = function (state, action) {
+ return this._schedule(state, action);
+ };
+
+ /**
+ * Schedules an action to be executed after the specified relative due time.
+ * @param {Function} action Action to execute.
+ * @param {Number} dueTime Relative time after which to execute the action.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleWithRelative = function (dueTime, action) {
+ return this._scheduleRelative(action, dueTime, invokeAction);
+ };
+
+ /**
+ * Schedules an action to be executed after dueTime.
+ * @param state State passed to the action to be executed.
+ * @param {Function} action Action to be executed.
+ * @param {Number} dueTime Relative time after which to execute the action.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleWithRelativeAndState = function (state, dueTime, action) {
+ return this._scheduleRelative(state, dueTime, action);
+ };
+
+ /**
+ * Schedules an action to be executed at the specified absolute due time.
+ * @param {Function} action Action to execute.
+ * @param {Number} dueTime Absolute time at which to execute the action.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleWithAbsolute = function (dueTime, action) {
+ return this._scheduleAbsolute(action, dueTime, invokeAction);
+ };
+
+ /**
+ * Schedules an action to be executed at dueTime.
+ * @param {Mixed} state State passed to the action to be executed.
+ * @param {Function} action Action to be executed.
+ * @param {Number}dueTime Absolute time at which to execute the action.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleWithAbsoluteAndState = function (state, dueTime, action) {
+ return this._scheduleAbsolute(state, dueTime, action);
+ };
+
+ /** Gets the current time according to the local machine's system clock. */
+ Scheduler.now = defaultNow;
+
+ /**
+ * Normalizes the specified TimeSpan value to a positive value.
+ * @param {Number} timeSpan The time span value to normalize.
+ * @returns {Number} The specified TimeSpan value if it is zero or positive; otherwise, 0
+ */
+ Scheduler.normalize = function (timeSpan) {
+ timeSpan < 0 && (timeSpan = 0);
+ return timeSpan;
+ };
+
+ return Scheduler;
+ }());
+
+ var normalizeTime = Scheduler.normalize, isScheduler = Scheduler.isScheduler;
+
+ (function (schedulerProto) {
+
+ function invokeRecImmediate(scheduler, pair) {
+ var state = pair[0], action = pair[1], group = new CompositeDisposable();
+
+ function recursiveAction(state1) {
+ action(state1, function (state2) {
+ var isAdded = false, isDone = false,
+ d = scheduler.scheduleWithState(state2, function (scheduler1, state3) {
+ if (isAdded) {
+ group.remove(d);
+ } else {
+ isDone = true;
+ }
+ recursiveAction(state3);
+ return disposableEmpty;
+ });
+ if (!isDone) {
+ group.add(d);
+ isAdded = true;
+ }
+ });
+ }
+ recursiveAction(state);
+ return group;
+ }
+
+ function invokeRecDate(scheduler, pair, method) {
+ var state = pair[0], action = pair[1], group = new CompositeDisposable();
+ function recursiveAction(state1) {
+ action(state1, function (state2, dueTime1) {
+ var isAdded = false, isDone = false,
+ d = scheduler[method](state2, dueTime1, function (scheduler1, state3) {
+ if (isAdded) {
+ group.remove(d);
+ } else {
+ isDone = true;
+ }
+ recursiveAction(state3);
+ return disposableEmpty;
+ });
+ if (!isDone) {
+ group.add(d);
+ isAdded = true;
+ }
+ });
+ };
+ recursiveAction(state);
+ return group;
+ }
+
+ function scheduleInnerRecursive(action, self) {
+ action(function(dt) { self(action, dt); });
+ }
+
+ /**
+ * Schedules an action to be executed recursively.
+ * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleRecursive = function (action) {
+ return this.scheduleRecursiveWithState(action, scheduleInnerRecursive);
+ };
+
+ /**
+ * Schedules an action to be executed recursively.
+ * @param {Mixed} state State passed to the action to be executed.
+ * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in recursive invocation state.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleRecursiveWithState = function (state, action) {
+ return this.scheduleWithState([state, action], invokeRecImmediate);
+ };
+
+ /**
+ * Schedules an action to be executed recursively after a specified relative due time.
+ * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified relative time.
+ * @param {Number}dueTime Relative time after which to execute the action for the first time.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleRecursiveWithRelative = function (dueTime, action) {
+ return this.scheduleRecursiveWithRelativeAndState(action, dueTime, scheduleInnerRecursive);
+ };
+
+ /**
+ * Schedules an action to be executed recursively after a specified relative due time.
+ * @param {Mixed} state State passed to the action to be executed.
+ * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state.
+ * @param {Number}dueTime Relative time after which to execute the action for the first time.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleRecursiveWithRelativeAndState = function (state, dueTime, action) {
+ return this._scheduleRelative([state, action], dueTime, function (s, p) {
+ return invokeRecDate(s, p, 'scheduleWithRelativeAndState');
+ });
+ };
+
+ /**
+ * Schedules an action to be executed recursively at a specified absolute due time.
+ * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified absolute time.
+ * @param {Number}dueTime Absolute time at which to execute the action for the first time.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleRecursiveWithAbsolute = function (dueTime, action) {
+ return this.scheduleRecursiveWithAbsoluteAndState(action, dueTime, scheduleInnerRecursive);
+ };
+
+ /**
+ * Schedules an action to be executed recursively at a specified absolute due time.
+ * @param {Mixed} state State passed to the action to be executed.
+ * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state.
+ * @param {Number}dueTime Absolute time at which to execute the action for the first time.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleRecursiveWithAbsoluteAndState = function (state, dueTime, action) {
+ return this._scheduleAbsolute([state, action], dueTime, function (s, p) {
+ return invokeRecDate(s, p, 'scheduleWithAbsoluteAndState');
+ });
+ };
+ }(Scheduler.prototype));
+
+ (function (schedulerProto) {
+
+ /**
+ * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation.
+ * @param {Number} period Period for running the work periodically.
+ * @param {Function} action Action to be executed.
+ * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort).
+ */
+ Scheduler.prototype.schedulePeriodic = function (period, action) {
+ return this.schedulePeriodicWithState(null, period, action);
+ };
+
+ /**
+ * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation.
+ * @param {Mixed} state Initial state passed to the action upon the first iteration.
+ * @param {Number} period Period for running the work periodically.
+ * @param {Function} action Action to be executed, potentially updating the state.
+ * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort).
+ */
+ Scheduler.prototype.schedulePeriodicWithState = function(state, period, action) {
+ if (typeof root.setInterval === 'undefined') { throw new NotSupportedError(); }
+ period = normalizeTime(period);
+ var s = state, id = root.setInterval(function () { s = action(s); }, period);
+ return disposableCreate(function () { root.clearInterval(id); });
+ };
+
+ }(Scheduler.prototype));
+
+ (function (schedulerProto) {
+ /**
+ * Returns a scheduler that wraps the original scheduler, adding exception handling for scheduled actions.
+ * @param {Function} handler Handler that's run if an exception is caught. The exception will be rethrown if the handler returns false.
+ * @returns {Scheduler} Wrapper around the original scheduler, enforcing exception handling.
+ */
+ schedulerProto.catchError = schedulerProto['catch'] = function (handler) {
+ return new CatchScheduler(this, handler);
+ };
+ }(Scheduler.prototype));
+
+ var SchedulePeriodicRecursive = Rx.internals.SchedulePeriodicRecursive = (function () {
+ function tick(command, recurse) {
+ recurse(0, this._period);
+ try {
+ this._state = this._action(this._state);
+ } catch (e) {
+ this._cancel.dispose();
+ throw e;
+ }
+ }
+
+ function SchedulePeriodicRecursive(scheduler, state, period, action) {
+ this._scheduler = scheduler;
+ this._state = state;
+ this._period = period;
+ this._action = action;
+ }
+
+ SchedulePeriodicRecursive.prototype.start = function () {
+ var d = new SingleAssignmentDisposable();
+ this._cancel = d;
+ d.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0, this._period, tick.bind(this)));
+
+ return d;
+ };
+
+ return SchedulePeriodicRecursive;
+ }());
+
+ /** Gets a scheduler that schedules work immediately on the current thread. */
+ var immediateScheduler = Scheduler.immediate = (function () {
+ function scheduleNow(state, action) { return action(this, state); }
+ return new Scheduler(defaultNow, scheduleNow, notSupported, notSupported);
+ }());
+
+ /**
+ * Gets a scheduler that schedules work as soon as possible on the current thread.
+ */
+ var currentThreadScheduler = Scheduler.currentThread = (function () {
+ var queue;
+
+ function runTrampoline () {
+ while (queue.length > 0) {
+ var item = queue.dequeue();
+ !item.isCancelled() && item.invoke();
+ }
+ }
+
+ function scheduleNow(state, action) {
+ var si = new ScheduledItem(this, state, action, this.now());
+
+ if (!queue) {
+ queue = new PriorityQueue(4);
+ queue.enqueue(si);
+
+ var result = tryCatch(runTrampoline)();
+ queue = null;
+ if (result === errorObj) { return thrower(result.e); }
+ } else {
+ queue.enqueue(si);
+ }
+ return si.disposable;
+ }
+
+ var currentScheduler = new Scheduler(defaultNow, scheduleNow, notSupported, notSupported);
+ currentScheduler.scheduleRequired = function () { return !queue; };
+
+ return currentScheduler;
+ }());
+
+ var scheduleMethod, clearMethod;
+
+ var localTimer = (function () {
+ var localSetTimeout, localClearTimeout = noop;
+ if (!!root.setTimeout) {
+ localSetTimeout = root.setTimeout;
+ localClearTimeout = root.clearTimeout;
+ } else if (!!root.WScript) {
+ localSetTimeout = function (fn, time) {
+ root.WScript.Sleep(time);
+ fn();
+ };
+ } else {
+ throw new NotSupportedError();
+ }
+
+ return {
+ setTimeout: localSetTimeout,
+ clearTimeout: localClearTimeout
+ };
+ }());
+ var localSetTimeout = localTimer.setTimeout,
+ localClearTimeout = localTimer.clearTimeout;
+
+ (function () {
+
+ var nextHandle = 1, tasksByHandle = {}, currentlyRunning = false;
+
+ clearMethod = function (handle) {
+ delete tasksByHandle[handle];
+ };
+
+ function runTask(handle) {
+ if (currentlyRunning) {
+ localSetTimeout(function () { runTask(handle) }, 0);
+ } else {
+ var task = tasksByHandle[handle];
+ if (task) {
+ currentlyRunning = true;
+ var result = tryCatch(task)();
+ clearMethod(handle);
+ currentlyRunning = false;
+ if (result === errorObj) { return thrower(result.e); }
+ }
+ }
+ }
+
+ var reNative = RegExp('^' +
+ String(toString)
+ .replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
+ .replace(/toString| for [^\]]+/g, '.*?') + '$'
+ );
+
+ var setImmediate = typeof (setImmediate = freeGlobal && moduleExports && freeGlobal.setImmediate) == 'function' &&
+ !reNative.test(setImmediate) && setImmediate;
+
+ function postMessageSupported () {
+ // Ensure not in a worker
+ if (!root.postMessage || root.importScripts) { return false; }
+ var isAsync = false, oldHandler = root.onmessage;
+ // Test for async
+ root.onmessage = function () { isAsync = true; };
+ root.postMessage('', '*');
+ root.onmessage = oldHandler;
+
+ return isAsync;
+ }
+
+ // Use in order, setImmediate, nextTick, postMessage, MessageChannel, script readystatechanged, setTimeout
+ if (isFunction(setImmediate)) {
+ scheduleMethod = function (action) {
+ var id = nextHandle++;
+ tasksByHandle[id] = action;
+ setImmediate(function () { runTask(id); });
+
+ return id;
+ };
+ } else if (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]') {
+ scheduleMethod = function (action) {
+ var id = nextHandle++;
+ tasksByHandle[id] = action;
+ process.nextTick(function () { runTask(id); });
+
+ return id;
+ };
+ } else if (postMessageSupported()) {
+ var MSG_PREFIX = 'ms.rx.schedule' + Math.random();
+
+ function onGlobalPostMessage(event) {
+ // Only if we're a match to avoid any other global events
+ if (typeof event.data === 'string' && event.data.substring(0, MSG_PREFIX.length) === MSG_PREFIX) {
+ runTask(event.data.substring(MSG_PREFIX.length));
+ }
+ }
+
+ if (root.addEventListener) {
+ root.addEventListener('message', onGlobalPostMessage, false);
+ } else if (root.attachEvent) {
+ root.attachEvent('onmessage', onGlobalPostMessage);
+ } else {
+ root.onmessage = onGlobalPostMessage;
+ }
+
+ scheduleMethod = function (action) {
+ var id = nextHandle++;
+ tasksByHandle[id] = action;
+ root.postMessage(MSG_PREFIX + currentId, '*');
+ return id;
+ };
+ } else if (!!root.MessageChannel) {
+ var channel = new root.MessageChannel();
+
+ channel.port1.onmessage = function (e) { runTask(e.data); };
+
+ scheduleMethod = function (action) {
+ var id = nextHandle++;
+ tasksByHandle[id] = action;
+ channel.port2.postMessage(id);
+ return id;
+ };
+ } else if ('document' in root && 'onreadystatechange' in root.document.createElement('script')) {
+
+ scheduleMethod = function (action) {
+ var scriptElement = root.document.createElement('script');
+ var id = nextHandle++;
+ tasksByHandle[id] = action;
+
+ scriptElement.onreadystatechange = function () {
+ runTask(id);
+ scriptElement.onreadystatechange = null;
+ scriptElement.parentNode.removeChild(scriptElement);
+ scriptElement = null;
+ };
+ root.document.documentElement.appendChild(scriptElement);
+ return id;
+ };
+
+ } else {
+ scheduleMethod = function (action) {
+ var id = nextHandle++;
+ tasksByHandle[id] = action;
+ localSetTimeout(function () {
+ runTask(id);
+ }, 0);
+
+ return id;
+ };
+ }
+ }());
+
+ /**
+ * Gets a scheduler that schedules work via a timed callback based upon platform.
+ */
+ var timeoutScheduler = Scheduler.timeout = Scheduler['default'] = (function () {
+
+ function scheduleNow(state, action) {
+ var scheduler = this, disposable = new SingleAssignmentDisposable();
+ var id = scheduleMethod(function () {
+ !disposable.isDisposed && disposable.setDisposable(action(scheduler, state));
+ });
+ return new CompositeDisposable(disposable, disposableCreate(function () {
+ clearMethod(id);
+ }));
+ }
+
+ function scheduleRelative(state, dueTime, action) {
+ var scheduler = this, dt = Scheduler.normalize(dueTime), disposable = new SingleAssignmentDisposable();
+ if (dt === 0) { return scheduler.scheduleWithState(state, action); }
+ var id = localSetTimeout(function () {
+ !disposable.isDisposed && disposable.setDisposable(action(scheduler, state));
+ }, dt);
+ return new CompositeDisposable(disposable, disposableCreate(function () {
+ localClearTimeout(id);
+ }));
+ }
+
+ function scheduleAbsolute(state, dueTime, action) {
+ return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action);
+ }
+
+ return new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute);
+ })();
+
+ var CatchScheduler = (function (__super__) {
+
+ function scheduleNow(state, action) {
+ return this._scheduler.scheduleWithState(state, this._wrap(action));
+ }
+
+ function scheduleRelative(state, dueTime, action) {
+ return this._scheduler.scheduleWithRelativeAndState(state, dueTime, this._wrap(action));
+ }
+
+ function scheduleAbsolute(state, dueTime, action) {
+ return this._scheduler.scheduleWithAbsoluteAndState(state, dueTime, this._wrap(action));
+ }
+
+ inherits(CatchScheduler, __super__);
+
+ function CatchScheduler(scheduler, handler) {
+ this._scheduler = scheduler;
+ this._handler = handler;
+ this._recursiveOriginal = null;
+ this._recursiveWrapper = null;
+ __super__.call(this, this._scheduler.now.bind(this._scheduler), scheduleNow, scheduleRelative, scheduleAbsolute);
+ }
+
+ CatchScheduler.prototype._clone = function (scheduler) {
+ return new CatchScheduler(scheduler, this._handler);
+ };
+
+ CatchScheduler.prototype._wrap = function (action) {
+ var parent = this;
+ return function (self, state) {
+ try {
+ return action(parent._getRecursiveWrapper(self), state);
+ } catch (e) {
+ if (!parent._handler(e)) { throw e; }
+ return disposableEmpty;
+ }
+ };
+ };
+
+ CatchScheduler.prototype._getRecursiveWrapper = function (scheduler) {
+ if (this._recursiveOriginal !== scheduler) {
+ this._recursiveOriginal = scheduler;
+ var wrapper = this._clone(scheduler);
+ wrapper._recursiveOriginal = scheduler;
+ wrapper._recursiveWrapper = wrapper;
+ this._recursiveWrapper = wrapper;
+ }
+ return this._recursiveWrapper;
+ };
+
+ CatchScheduler.prototype.schedulePeriodicWithState = function (state, period, action) {
+ var self = this, failed = false, d = new SingleAssignmentDisposable();
+
+ d.setDisposable(this._scheduler.schedulePeriodicWithState(state, period, function (state1) {
+ if (failed) { return null; }
+ try {
+ return action(state1);
+ } catch (e) {
+ failed = true;
+ if (!self._handler(e)) { throw e; }
+ d.dispose();
+ return null;
+ }
+ }));
+
+ return d;
+ };
+
+ return CatchScheduler;
+ }(Scheduler));
+
+ /**
+ * Represents a notification to an observer.
+ */
+ var Notification = Rx.Notification = (function () {
+ function Notification(kind, value, exception, accept, acceptObservable, toString) {
+ this.kind = kind;
+ this.value = value;
+ this.exception = exception;
+ this._accept = accept;
+ this._acceptObservable = acceptObservable;
+ this.toString = toString;
+ }
+
+ /**
+ * Invokes the delegate corresponding to the notification or the observer's method corresponding to the notification and returns the produced result.
+ *
+ * @memberOf Notification
+ * @param {Any} observerOrOnNext Delegate to invoke for an OnNext notification or Observer to invoke the notification on..
+ * @param {Function} onError Delegate to invoke for an OnError notification.
+ * @param {Function} onCompleted Delegate to invoke for an OnCompleted notification.
+ * @returns {Any} Result produced by the observation.
+ */
+ Notification.prototype.accept = function (observerOrOnNext, onError, onCompleted) {
+ return observerOrOnNext && typeof observerOrOnNext === 'object' ?
+ this._acceptObservable(observerOrOnNext) :
+ this._accept(observerOrOnNext, onError, onCompleted);
+ };
+
+ /**
+ * Returns an observable sequence with a single notification.
+ *
+ * @memberOf Notifications
+ * @param {Scheduler} [scheduler] Scheduler to send out the notification calls on.
+ * @returns {Observable} The observable sequence that surfaces the behavior of the notification upon subscription.
+ */
+ Notification.prototype.toObservable = function (scheduler) {
+ var self = this;
+ isScheduler(scheduler) || (scheduler = immediateScheduler);
+ return new AnonymousObservable(function (observer) {
+ return scheduler.scheduleWithState(self, function (_, notification) {
+ notification._acceptObservable(observer);
+ notification.kind === 'N' && observer.onCompleted();
+ });
+ });
+ };
+
+ return Notification;
+ })();
+
+ /**
+ * Creates an object that represents an OnNext notification to an observer.
+ * @param {Any} value The value contained in the notification.
+ * @returns {Notification} The OnNext notification containing the value.
+ */
+ var notificationCreateOnNext = Notification.createOnNext = (function () {
+ function _accept(onNext) { return onNext(this.value); }
+ function _acceptObservable(observer) { return observer.onNext(this.value); }
+ function toString() { return 'OnNext(' + this.value + ')'; }
+
+ return function (value) {
+ return new Notification('N', value, null, _accept, _acceptObservable, toString);
+ };
+ }());
+
+ /**
+ * Creates an object that represents an OnError notification to an observer.
+ * @param {Any} error The exception contained in the notification.
+ * @returns {Notification} The OnError notification containing the exception.
+ */
+ var notificationCreateOnError = Notification.createOnError = (function () {
+ function _accept (onNext, onError) { return onError(this.exception); }
+ function _acceptObservable(observer) { return observer.onError(this.exception); }
+ function toString () { return 'OnError(' + this.exception + ')'; }
+
+ return function (e) {
+ return new Notification('E', null, e, _accept, _acceptObservable, toString);
+ };
+ }());
+
+ /**
+ * Creates an object that represents an OnCompleted notification to an observer.
+ * @returns {Notification} The OnCompleted notification.
+ */
+ var notificationCreateOnCompleted = Notification.createOnCompleted = (function () {
+ function _accept (onNext, onError, onCompleted) { return onCompleted(); }
+ function _acceptObservable(observer) { return observer.onCompleted(); }
+ function toString () { return 'OnCompleted()'; }
+
+ return function () {
+ return new Notification('C', null, null, _accept, _acceptObservable, toString);
+ };
+ }());
+
+ /**
+ * Supports push-style iteration over an observable sequence.
+ */
+ var Observer = Rx.Observer = function () { };
+
+ /**
+ * Creates a notification callback from an observer.
+ * @returns The action that forwards its input notification to the underlying observer.
+ */
+ Observer.prototype.toNotifier = function () {
+ var observer = this;
+ return function (n) { return n.accept(observer); };
+ };
+
+ /**
+ * Hides the identity of an observer.
+ * @returns An observer that hides the identity of the specified observer.
+ */
+ Observer.prototype.asObserver = function () {
+ return new AnonymousObserver(this.onNext.bind(this), this.onError.bind(this), this.onCompleted.bind(this));
+ };
+
+ /**
+ * Checks access to the observer for grammar violations. This includes checking for multiple OnError or OnCompleted calls, as well as reentrancy in any of the observer methods.
+ * If a violation is detected, an Error is thrown from the offending observer method call.
+ * @returns An observer that checks callbacks invocations against the observer grammar and, if the checks pass, forwards those to the specified observer.
+ */
+ Observer.prototype.checked = function () { return new CheckedObserver(this); };
+
+ /**
+ * Creates an observer from the specified OnNext, along with optional OnError, and OnCompleted actions.
+ * @param {Function} [onNext] Observer's OnNext action implementation.
+ * @param {Function} [onError] Observer's OnError action implementation.
+ * @param {Function} [onCompleted] Observer's OnCompleted action implementation.
+ * @returns {Observer} The observer object implemented using the given actions.
+ */
+ var observerCreate = Observer.create = function (onNext, onError, onCompleted) {
+ onNext || (onNext = noop);
+ onError || (onError = defaultError);
+ onCompleted || (onCompleted = noop);
+ return new AnonymousObserver(onNext, onError, onCompleted);
+ };
+
+ /**
+ * Creates an observer from a notification callback.
+ *
+ * @static
+ * @memberOf Observer
+ * @param {Function} handler Action that handles a notification.
+ * @returns The observer object that invokes the specified handler using a notification corresponding to each message it receives.
+ */
+ Observer.fromNotifier = function (handler, thisArg) {
+ return new AnonymousObserver(function (x) {
+ return handler.call(thisArg, notificationCreateOnNext(x));
+ }, function (e) {
+ return handler.call(thisArg, notificationCreateOnError(e));
+ }, function () {
+ return handler.call(thisArg, notificationCreateOnCompleted());
+ });
+ };
+
+ /**
+ * Schedules the invocation of observer methods on the given scheduler.
+ * @param {Scheduler} scheduler Scheduler to schedule observer messages on.
+ * @returns {Observer} Observer whose messages are scheduled on the given scheduler.
+ */
+ Observer.prototype.notifyOn = function (scheduler) {
+ return new ObserveOnObserver(scheduler, this);
+ };
+
+ Observer.prototype.makeSafe = function(disposable) {
+ return new AnonymousSafeObserver(this._onNext, this._onError, this._onCompleted, disposable);
+ };
+
+ /**
+ * Abstract base class for implementations of the Observer class.
+ * This base class enforces the grammar of observers where OnError and OnCompleted are terminal messages.
+ */
+ var AbstractObserver = Rx.internals.AbstractObserver = (function (__super__) {
+ inherits(AbstractObserver, __super__);
+
+ /**
+ * Creates a new observer in a non-stopped state.
+ */
+ function AbstractObserver() {
+ this.isStopped = false;
+ __super__.call(this);
+ }
+
+ // Must be implemented by other observers
+ AbstractObserver.prototype.next = notImplemented;
+ AbstractObserver.prototype.error = notImplemented;
+ AbstractObserver.prototype.completed = notImplemented;
+
+ /**
+ * Notifies the observer of a new element in the sequence.
+ * @param {Any} value Next element in the sequence.
+ */
+ AbstractObserver.prototype.onNext = function (value) {
+ if (!this.isStopped) { this.next(value); }
+ };
+
+ /**
+ * Notifies the observer that an exception has occurred.
+ * @param {Any} error The error that has occurred.
+ */
+ AbstractObserver.prototype.onError = function (error) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.error(error);
+ }
+ };
+
+ /**
+ * Notifies the observer of the end of the sequence.
+ */
+ AbstractObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.completed();
+ }
+ };
+
+ /**
+ * Disposes the observer, causing it to transition to the stopped state.
+ */
+ AbstractObserver.prototype.dispose = function () {
+ this.isStopped = true;
+ };
+
+ AbstractObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.error(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ return AbstractObserver;
+ }(Observer));
+
+ /**
+ * Class to create an Observer instance from delegate-based implementations of the on* methods.
+ */
+ var AnonymousObserver = Rx.AnonymousObserver = (function (__super__) {
+ inherits(AnonymousObserver, __super__);
+
+ /**
+ * Creates an observer from the specified OnNext, OnError, and OnCompleted actions.
+ * @param {Any} onNext Observer's OnNext action implementation.
+ * @param {Any} onError Observer's OnError action implementation.
+ * @param {Any} onCompleted Observer's OnCompleted action implementation.
+ */
+ function AnonymousObserver(onNext, onError, onCompleted) {
+ __super__.call(this);
+ this._onNext = onNext;
+ this._onError = onError;
+ this._onCompleted = onCompleted;
+ }
+
+ /**
+ * Calls the onNext action.
+ * @param {Any} value Next element in the sequence.
+ */
+ AnonymousObserver.prototype.next = function (value) {
+ this._onNext(value);
+ };
+
+ /**
+ * Calls the onError action.
+ * @param {Any} error The error that has occurred.
+ */
+ AnonymousObserver.prototype.error = function (error) {
+ this._onError(error);
+ };
+
+ /**
+ * Calls the onCompleted action.
+ */
+ AnonymousObserver.prototype.completed = function () {
+ this._onCompleted();
+ };
+
+ return AnonymousObserver;
+ }(AbstractObserver));
+
+ var CheckedObserver = (function (__super__) {
+ inherits(CheckedObserver, __super__);
+
+ function CheckedObserver(observer) {
+ __super__.call(this);
+ this._observer = observer;
+ this._state = 0; // 0 - idle, 1 - busy, 2 - done
+ }
+
+ var CheckedObserverPrototype = CheckedObserver.prototype;
+
+ CheckedObserverPrototype.onNext = function (value) {
+ this.checkAccess();
+ var res = tryCatch(this._observer.onNext).call(this._observer, value);
+ this._state = 0;
+ res === errorObj && thrower(res.e);
+ };
+
+ CheckedObserverPrototype.onError = function (err) {
+ this.checkAccess();
+ var res = tryCatch(this._observer.onError).call(this._observer, err);
+ this._state = 2;
+ res === errorObj && thrower(res.e);
+ };
+
+ CheckedObserverPrototype.onCompleted = function () {
+ this.checkAccess();
+ var res = tryCatch(this._observer.onCompleted).call(this._observer);
+ this._state = 2;
+ res === errorObj && thrower(res.e);
+ };
+
+ CheckedObserverPrototype.checkAccess = function () {
+ if (this._state === 1) { throw new Error('Re-entrancy detected'); }
+ if (this._state === 2) { throw new Error('Observer completed'); }
+ if (this._state === 0) { this._state = 1; }
+ };
+
+ return CheckedObserver;
+ }(Observer));
+
+ var ScheduledObserver = Rx.internals.ScheduledObserver = (function (__super__) {
+ inherits(ScheduledObserver, __super__);
+
+ function ScheduledObserver(scheduler, observer) {
+ __super__.call(this);
+ this.scheduler = scheduler;
+ this.observer = observer;
+ this.isAcquired = false;
+ this.hasFaulted = false;
+ this.queue = [];
+ this.disposable = new SerialDisposable();
+ }
+
+ ScheduledObserver.prototype.next = function (value) {
+ var self = this;
+ this.queue.push(function () { self.observer.onNext(value); });
+ };
+
+ ScheduledObserver.prototype.error = function (e) {
+ var self = this;
+ this.queue.push(function () { self.observer.onError(e); });
+ };
+
+ ScheduledObserver.prototype.completed = function () {
+ var self = this;
+ this.queue.push(function () { self.observer.onCompleted(); });
+ };
+
+ ScheduledObserver.prototype.ensureActive = function () {
+ var isOwner = false, parent = this;
+ if (!this.hasFaulted && this.queue.length > 0) {
+ isOwner = !this.isAcquired;
+ this.isAcquired = true;
+ }
+ if (isOwner) {
+ this.disposable.setDisposable(this.scheduler.scheduleRecursive(function (self) {
+ var work;
+ if (parent.queue.length > 0) {
+ work = parent.queue.shift();
+ } else {
+ parent.isAcquired = false;
+ return;
+ }
+ try {
+ work();
+ } catch (ex) {
+ parent.queue = [];
+ parent.hasFaulted = true;
+ throw ex;
+ }
+ self();
+ }));
+ }
+ };
+
+ ScheduledObserver.prototype.dispose = function () {
+ __super__.prototype.dispose.call(this);
+ this.disposable.dispose();
+ };
+
+ return ScheduledObserver;
+ }(AbstractObserver));
+
+ var ObserveOnObserver = (function (__super__) {
+ inherits(ObserveOnObserver, __super__);
+
+ function ObserveOnObserver(scheduler, observer, cancel) {
+ __super__.call(this, scheduler, observer);
+ this._cancel = cancel;
+ }
+
+ ObserveOnObserver.prototype.next = function (value) {
+ __super__.prototype.next.call(this, value);
+ this.ensureActive();
+ };
+
+ ObserveOnObserver.prototype.error = function (e) {
+ __super__.prototype.error.call(this, e);
+ this.ensureActive();
+ };
+
+ ObserveOnObserver.prototype.completed = function () {
+ __super__.prototype.completed.call(this);
+ this.ensureActive();
+ };
+
+ ObserveOnObserver.prototype.dispose = function () {
+ __super__.prototype.dispose.call(this);
+ this._cancel && this._cancel.dispose();
+ this._cancel = null;
+ };
+
+ return ObserveOnObserver;
+ })(ScheduledObserver);
+
+ var observableProto;
+
+ /**
+ * Represents a push-style collection.
+ */
+ var Observable = Rx.Observable = (function () {
+
+ function Observable(subscribe) {
+ if (Rx.config.longStackSupport && hasStacks) {
+ try {
+ throw new Error();
+ } catch (e) {
+ this.stack = e.stack.substring(e.stack.indexOf("\n") + 1);
+ }
+
+ var self = this;
+ this._subscribe = function (observer) {
+ var oldOnError = observer.onError.bind(observer);
+
+ observer.onError = function (err) {
+ makeStackTraceLong(err, self);
+ oldOnError(err);
+ };
+
+ return subscribe.call(self, observer);
+ };
+ } else {
+ this._subscribe = subscribe;
+ }
+ }
+
+ observableProto = Observable.prototype;
+
+ /**
+ * Subscribes an observer to the observable sequence.
+ * @param {Mixed} [observerOrOnNext] The object that is to receive notifications or an action to invoke for each element in the observable sequence.
+ * @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence.
+ * @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence.
+ * @returns {Diposable} A disposable handling the subscriptions and unsubscriptions.
+ */
+ observableProto.subscribe = observableProto.forEach = function (observerOrOnNext, onError, onCompleted) {
+ return this._subscribe(typeof observerOrOnNext === 'object' ?
+ observerOrOnNext :
+ observerCreate(observerOrOnNext, onError, onCompleted));
+ };
+
+ /**
+ * Subscribes to the next value in the sequence with an optional "this" argument.
+ * @param {Function} onNext The function to invoke on each element in the observable sequence.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions.
+ */
+ observableProto.subscribeOnNext = function (onNext, thisArg) {
+ return this._subscribe(observerCreate(typeof thisArg !== 'undefined' ? function(x) { onNext.call(thisArg, x); } : onNext));
+ };
+
+ /**
+ * Subscribes to an exceptional condition in the sequence with an optional "this" argument.
+ * @param {Function} onError The function to invoke upon exceptional termination of the observable sequence.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions.
+ */
+ observableProto.subscribeOnError = function (onError, thisArg) {
+ return this._subscribe(observerCreate(null, typeof thisArg !== 'undefined' ? function(e) { onError.call(thisArg, e); } : onError));
+ };
+
+ /**
+ * Subscribes to the next value in the sequence with an optional "this" argument.
+ * @param {Function} onCompleted The function to invoke upon graceful termination of the observable sequence.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions.
+ */
+ observableProto.subscribeOnCompleted = function (onCompleted, thisArg) {
+ return this._subscribe(observerCreate(null, null, typeof thisArg !== 'undefined' ? function() { onCompleted.call(thisArg); } : onCompleted));
+ };
+
+ return Observable;
+ })();
+
+ var ObservableBase = Rx.ObservableBase = (function (__super__) {
+ inherits(ObservableBase, __super__);
+
+ function fixSubscriber(subscriber) {
+ return subscriber && isFunction(subscriber.dispose) ? subscriber :
+ isFunction(subscriber) ? disposableCreate(subscriber) : disposableEmpty;
+ }
+
+ function setDisposable(s, state) {
+ var ado = state[0], self = state[1];
+ var sub = tryCatch(self.subscribeCore).call(self, ado);
+
+ if (sub === errorObj) {
+ if(!ado.fail(errorObj.e)) { return thrower(errorObj.e); }
+ }
+ ado.setDisposable(fixSubscriber(sub));
+ }
+
+ function subscribe(observer) {
+ var ado = new AutoDetachObserver(observer), state = [ado, this];
+
+ if (currentThreadScheduler.scheduleRequired()) {
+ currentThreadScheduler.scheduleWithState(state, setDisposable);
+ } else {
+ setDisposable(null, state);
+ }
+ return ado;
+ }
+
+ function ObservableBase() {
+ __super__.call(this, subscribe);
+ }
+
+ ObservableBase.prototype.subscribeCore = notImplemented;
+
+ return ObservableBase;
+ }(Observable));
+
+ var Enumerable = Rx.internals.Enumerable = function () { };
+
+ var ConcatEnumerableObservable = (function(__super__) {
+ inherits(ConcatEnumerableObservable, __super__);
+ function ConcatEnumerableObservable(sources) {
+ this.sources = sources;
+ __super__.call(this);
+ }
+
+ ConcatEnumerableObservable.prototype.subscribeCore = function (o) {
+ var isDisposed, subscription = new SerialDisposable();
+ var cancelable = immediateScheduler.scheduleRecursiveWithState(this.sources[$iterator$](), function (e, self) {
+ if (isDisposed) { return; }
+ var currentItem = tryCatch(e.next).call(e);
+ if (currentItem === errorObj) { return o.onError(currentItem.e); }
+
+ if (currentItem.done) {
+ return o.onCompleted();
+ }
+
+ // Check if promise
+ var currentValue = currentItem.value;
+ isPromise(currentValue) && (currentValue = observableFromPromise(currentValue));
+
+ var d = new SingleAssignmentDisposable();
+ subscription.setDisposable(d);
+ d.setDisposable(currentValue.subscribe(new InnerObserver(o, self, e)));
+ });
+
+ return new CompositeDisposable(subscription, cancelable, disposableCreate(function () {
+ isDisposed = true;
+ }));
+ };
+
+ function InnerObserver(o, s, e) {
+ this.o = o;
+ this.s = s;
+ this.e = e;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) { if(!this.isStopped) { this.o.onNext(x); } };
+ InnerObserver.prototype.onError = function (err) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(err);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.s(this.e);
+ }
+ };
+ InnerObserver.prototype.dispose = function () { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (err) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(err);
+ return true;
+ }
+ return false;
+ };
+
+ return ConcatEnumerableObservable;
+ }(ObservableBase));
+
+ Enumerable.prototype.concat = function () {
+ return new ConcatEnumerableObservable(this);
+ };
+
+ var CatchErrorObservable = (function(__super__) {
+ inherits(CatchErrorObservable, __super__);
+ function CatchErrorObservable(sources) {
+ this.sources = sources;
+ __super__.call(this);
+ }
+
+ CatchErrorObservable.prototype.subscribeCore = function (o) {
+ var e = this.sources[$iterator$]();
+
+ var isDisposed, subscription = new SerialDisposable();
+ var cancelable = immediateScheduler.scheduleRecursiveWithState(null, function (lastException, self) {
+ if (isDisposed) { return; }
+ var currentItem = tryCatch(e.next).call(e);
+ if (currentItem === errorObj) { return o.onError(currentItem.e); }
+
+ if (currentItem.done) {
+ return lastException !== null ? o.onError(lastException) : o.onCompleted();
+ }
+
+ // Check if promise
+ var currentValue = currentItem.value;
+ isPromise(currentValue) && (currentValue = observableFromPromise(currentValue));
+
+ var d = new SingleAssignmentDisposable();
+ subscription.setDisposable(d);
+ d.setDisposable(currentValue.subscribe(
+ function(x) { o.onNext(x); },
+ self,
+ function() { o.onCompleted(); }));
+ });
+ return new CompositeDisposable(subscription, cancelable, disposableCreate(function () {
+ isDisposed = true;
+ }));
+ };
+
+ return CatchErrorObservable;
+ }(ObservableBase));
+
+ Enumerable.prototype.catchError = function () {
+ return new CatchErrorObservable(this);
+ };
+
+ Enumerable.prototype.catchErrorWhen = function (notificationHandler) {
+ var sources = this;
+ return new AnonymousObservable(function (o) {
+ var exceptions = new Subject(),
+ notifier = new Subject(),
+ handled = notificationHandler(exceptions),
+ notificationDisposable = handled.subscribe(notifier);
+
+ var e = sources[$iterator$]();
+
+ var isDisposed,
+ lastException,
+ subscription = new SerialDisposable();
+ var cancelable = immediateScheduler.scheduleRecursive(function (self) {
+ if (isDisposed) { return; }
+ var currentItem = tryCatch(e.next).call(e);
+ if (currentItem === errorObj) { return o.onError(currentItem.e); }
+
+ if (currentItem.done) {
+ if (lastException) {
+ o.onError(lastException);
+ } else {
+ o.onCompleted();
+ }
+ return;
+ }
+
+ // Check if promise
+ var currentValue = currentItem.value;
+ isPromise(currentValue) && (currentValue = observableFromPromise(currentValue));
+
+ var outer = new SingleAssignmentDisposable();
+ var inner = new SingleAssignmentDisposable();
+ subscription.setDisposable(new CompositeDisposable(inner, outer));
+ outer.setDisposable(currentValue.subscribe(
+ function(x) { o.onNext(x); },
+ function (exn) {
+ inner.setDisposable(notifier.subscribe(self, function(ex) {
+ o.onError(ex);
+ }, function() {
+ o.onCompleted();
+ }));
+
+ exceptions.onNext(exn);
+ },
+ function() { o.onCompleted(); }));
+ });
+
+ return new CompositeDisposable(notificationDisposable, subscription, cancelable, disposableCreate(function () {
+ isDisposed = true;
+ }));
+ });
+ };
+
+ var RepeatEnumerable = (function (__super__) {
+ inherits(RepeatEnumerable, __super__);
+
+ function RepeatEnumerable(v, c) {
+ this.v = v;
+ this.c = c == null ? -1 : c;
+ }
+ RepeatEnumerable.prototype[$iterator$] = function () {
+ return new RepeatEnumerator(this);
+ };
+
+ function RepeatEnumerator(p) {
+ this.v = p.v;
+ this.l = p.c;
+ }
+ RepeatEnumerator.prototype.next = function () {
+ if (this.l === 0) { return doneEnumerator; }
+ if (this.l > 0) { this.l--; }
+ return { done: false, value: this.v };
+ };
+
+ return RepeatEnumerable;
+ }(Enumerable));
+
+ var enumerableRepeat = Enumerable.repeat = function (value, repeatCount) {
+ return new RepeatEnumerable(value, repeatCount);
+ };
+
+ var OfEnumerable = (function(__super__) {
+ inherits(OfEnumerable, __super__);
+ function OfEnumerable(s, fn, thisArg) {
+ this.s = s;
+ this.fn = fn ? bindCallback(fn, thisArg, 3) : null;
+ }
+ OfEnumerable.prototype[$iterator$] = function () {
+ return new OfEnumerator(this);
+ };
+
+ function OfEnumerator(p) {
+ this.i = -1;
+ this.s = p.s;
+ this.l = this.s.length;
+ this.fn = p.fn;
+ }
+ OfEnumerator.prototype.next = function () {
+ return ++this.i < this.l ?
+ { done: false, value: !this.fn ? this.s[this.i] : this.fn(this.s[this.i], this.i, this.s) } :
+ doneEnumerator;
+ };
+
+ return OfEnumerable;
+ }(Enumerable));
+
+ var enumerableOf = Enumerable.of = function (source, selector, thisArg) {
+ return new OfEnumerable(source, selector, thisArg);
+ };
+
+ /**
+ * Wraps the source sequence in order to run its observer callbacks on the specified scheduler.
+ *
+ * This only invokes observer callbacks on a scheduler. In case the subscription and/or unsubscription actions have side-effects
+ * that require to be run on a scheduler, use subscribeOn.
+ *
+ * @param {Scheduler} scheduler Scheduler to notify observers on.
+ * @returns {Observable} The source sequence whose observations happen on the specified scheduler.
+ */
+ observableProto.observeOn = function (scheduler) {
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ return source.subscribe(new ObserveOnObserver(scheduler, observer));
+ }, source);
+ };
+
+ /**
+ * Wraps the source sequence in order to run its subscription and unsubscription logic on the specified scheduler. This operation is not commonly used;
+ * see the remarks section for more information on the distinction between subscribeOn and observeOn.
+
+ * This only performs the side-effects of subscription and unsubscription on the specified scheduler. In order to invoke observer
+ * callbacks on a scheduler, use observeOn.
+
+ * @param {Scheduler} scheduler Scheduler to perform subscription and unsubscription actions on.
+ * @returns {Observable} The source sequence whose subscriptions and unsubscriptions happen on the specified scheduler.
+ */
+ observableProto.subscribeOn = function (scheduler) {
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ var m = new SingleAssignmentDisposable(), d = new SerialDisposable();
+ d.setDisposable(m);
+ m.setDisposable(scheduler.schedule(function () {
+ d.setDisposable(new ScheduledDisposable(scheduler, source.subscribe(observer)));
+ }));
+ return d;
+ }, source);
+ };
+
+ var FromPromiseObservable = (function(__super__) {
+ inherits(FromPromiseObservable, __super__);
+ function FromPromiseObservable(p) {
+ this.p = p;
+ __super__.call(this);
+ }
+
+ FromPromiseObservable.prototype.subscribeCore = function(o) {
+ this.p.then(function (data) {
+ o.onNext(data);
+ o.onCompleted();
+ }, function (err) { o.onError(err); });
+ return disposableEmpty;
+ };
+
+ return FromPromiseObservable;
+ }(ObservableBase));
+
+ /**
+ * Converts a Promise to an Observable sequence
+ * @param {Promise} An ES6 Compliant promise.
+ * @returns {Observable} An Observable sequence which wraps the existing promise success and failure.
+ */
+ var observableFromPromise = Observable.fromPromise = function (promise) {
+ return new FromPromiseObservable(promise);
+ };
+ /*
+ * Converts an existing observable sequence to an ES6 Compatible Promise
+ * @example
+ * var promise = Rx.Observable.return(42).toPromise(RSVP.Promise);
+ *
+ * // With config
+ * Rx.config.Promise = RSVP.Promise;
+ * var promise = Rx.Observable.return(42).toPromise();
+ * @param {Function} [promiseCtor] The constructor of the promise. If not provided, it looks for it in Rx.config.Promise.
+ * @returns {Promise} An ES6 compatible promise with the last value from the observable sequence.
+ */
+ observableProto.toPromise = function (promiseCtor) {
+ promiseCtor || (promiseCtor = Rx.config.Promise);
+ if (!promiseCtor) { throw new NotSupportedError('Promise type not provided nor in Rx.config.Promise'); }
+ var source = this;
+ return new promiseCtor(function (resolve, reject) {
+ // No cancellation can be done
+ var value, hasValue = false;
+ source.subscribe(function (v) {
+ value = v;
+ hasValue = true;
+ }, reject, function () {
+ hasValue && resolve(value);
+ });
+ });
+ };
+
+ var ToArrayObservable = (function(__super__) {
+ inherits(ToArrayObservable, __super__);
+ function ToArrayObservable(source) {
+ this.source = source;
+ __super__.call(this);
+ }
+
+ ToArrayObservable.prototype.subscribeCore = function(o) {
+ return this.source.subscribe(new InnerObserver(o));
+ };
+
+ function InnerObserver(o) {
+ this.o = o;
+ this.a = [];
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) { if(!this.isStopped) { this.a.push(x); } };
+ InnerObserver.prototype.onError = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onNext(this.a);
+ this.o.onCompleted();
+ }
+ };
+ InnerObserver.prototype.dispose = function () { this.isStopped = true; }
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ return ToArrayObservable;
+ }(ObservableBase));
+
+ /**
+ * Creates an array from an observable sequence.
+ * @returns {Observable} An observable sequence containing a single element with a list containing all the elements of the source sequence.
+ */
+ observableProto.toArray = function () {
+ return new ToArrayObservable(this);
+ };
+
+ /**
+ * Creates an observable sequence from a specified subscribe method implementation.
+ * @example
+ * var res = Rx.Observable.create(function (observer) { return function () { } );
+ * var res = Rx.Observable.create(function (observer) { return Rx.Disposable.empty; } );
+ * var res = Rx.Observable.create(function (observer) { } );
+ * @param {Function} subscribe Implementation of the resulting observable sequence's subscribe method, returning a function that will be wrapped in a Disposable.
+ * @returns {Observable} The observable sequence with the specified implementation for the Subscribe method.
+ */
+ Observable.create = Observable.createWithDisposable = function (subscribe, parent) {
+ return new AnonymousObservable(subscribe, parent);
+ };
+
+ /**
+ * Returns an observable sequence that invokes the specified factory function whenever a new observer subscribes.
+ *
+ * @example
+ * var res = Rx.Observable.defer(function () { return Rx.Observable.fromArray([1,2,3]); });
+ * @param {Function} observableFactory Observable factory function to invoke for each observer that subscribes to the resulting sequence or Promise.
+ * @returns {Observable} An observable sequence whose observers trigger an invocation of the given observable factory function.
+ */
+ var observableDefer = Observable.defer = function (observableFactory) {
+ return new AnonymousObservable(function (observer) {
+ var result;
+ try {
+ result = observableFactory();
+ } catch (e) {
+ return observableThrow(e).subscribe(observer);
+ }
+ isPromise(result) && (result = observableFromPromise(result));
+ return result.subscribe(observer);
+ });
+ };
+
+ var EmptyObservable = (function(__super__) {
+ inherits(EmptyObservable, __super__);
+ function EmptyObservable(scheduler) {
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ EmptyObservable.prototype.subscribeCore = function (observer) {
+ var sink = new EmptySink(observer, this);
+ return sink.run();
+ };
+
+ function EmptySink(observer, parent) {
+ this.observer = observer;
+ this.parent = parent;
+ }
+
+ function scheduleItem(s, state) {
+ state.onCompleted();
+ }
+
+ EmptySink.prototype.run = function () {
+ return this.parent.scheduler.scheduleWithState(this.observer, scheduleItem);
+ };
+
+ return EmptyObservable;
+ }(ObservableBase));
+
+ /**
+ * Returns an empty observable sequence, using the specified scheduler to send out the single OnCompleted message.
+ *
+ * @example
+ * var res = Rx.Observable.empty();
+ * var res = Rx.Observable.empty(Rx.Scheduler.timeout);
+ * @param {Scheduler} [scheduler] Scheduler to send the termination call on.
+ * @returns {Observable} An observable sequence with no elements.
+ */
+ var observableEmpty = Observable.empty = function (scheduler) {
+ isScheduler(scheduler) || (scheduler = immediateScheduler);
+ return new EmptyObservable(scheduler);
+ };
+
+ var FromObservable = (function(__super__) {
+ inherits(FromObservable, __super__);
+ function FromObservable(iterable, mapper, scheduler) {
+ this.iterable = iterable;
+ this.mapper = mapper;
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ FromObservable.prototype.subscribeCore = function (observer) {
+ var sink = new FromSink(observer, this);
+ return sink.run();
+ };
+
+ return FromObservable;
+ }(ObservableBase));
+
+ var FromSink = (function () {
+ function FromSink(observer, parent) {
+ this.observer = observer;
+ this.parent = parent;
+ }
+
+ FromSink.prototype.run = function () {
+ var list = Object(this.parent.iterable),
+ it = getIterable(list),
+ observer = this.observer,
+ mapper = this.parent.mapper;
+
+ function loopRecursive(i, recurse) {
+ try {
+ var next = it.next();
+ } catch (e) {
+ return observer.onError(e);
+ }
+ if (next.done) {
+ return observer.onCompleted();
+ }
+
+ var result = next.value;
+
+ if (mapper) {
+ try {
+ result = mapper(result, i);
+ } catch (e) {
+ return observer.onError(e);
+ }
+ }
+
+ observer.onNext(result);
+ recurse(i + 1);
+ }
+
+ return this.parent.scheduler.scheduleRecursiveWithState(0, loopRecursive);
+ };
+
+ return FromSink;
+ }());
+
+ var maxSafeInteger = Math.pow(2, 53) - 1;
+
+ function StringIterable(str) {
+ this._s = s;
+ }
+
+ StringIterable.prototype[$iterator$] = function () {
+ return new StringIterator(this._s);
+ };
+
+ function StringIterator(str) {
+ this._s = s;
+ this._l = s.length;
+ this._i = 0;
+ }
+
+ StringIterator.prototype[$iterator$] = function () {
+ return this;
+ };
+
+ StringIterator.prototype.next = function () {
+ return this._i < this._l ? { done: false, value: this._s.charAt(this._i++) } : doneEnumerator;
+ };
+
+ function ArrayIterable(a) {
+ this._a = a;
+ }
+
+ ArrayIterable.prototype[$iterator$] = function () {
+ return new ArrayIterator(this._a);
+ };
+
+ function ArrayIterator(a) {
+ this._a = a;
+ this._l = toLength(a);
+ this._i = 0;
+ }
+
+ ArrayIterator.prototype[$iterator$] = function () {
+ return this;
+ };
+
+ ArrayIterator.prototype.next = function () {
+ return this._i < this._l ? { done: false, value: this._a[this._i++] } : doneEnumerator;
+ };
+
+ function numberIsFinite(value) {
+ return typeof value === 'number' && root.isFinite(value);
+ }
+
+ function isNan(n) {
+ return n !== n;
+ }
+
+ function getIterable(o) {
+ var i = o[$iterator$], it;
+ if (!i && typeof o === 'string') {
+ it = new StringIterable(o);
+ return it[$iterator$]();
+ }
+ if (!i && o.length !== undefined) {
+ it = new ArrayIterable(o);
+ return it[$iterator$]();
+ }
+ if (!i) { throw new TypeError('Object is not iterable'); }
+ return o[$iterator$]();
+ }
+
+ function sign(value) {
+ var number = +value;
+ if (number === 0) { return number; }
+ if (isNaN(number)) { return number; }
+ return number < 0 ? -1 : 1;
+ }
+
+ function toLength(o) {
+ var len = +o.length;
+ if (isNaN(len)) { return 0; }
+ if (len === 0 || !numberIsFinite(len)) { return len; }
+ len = sign(len) * Math.floor(Math.abs(len));
+ if (len <= 0) { return 0; }
+ if (len > maxSafeInteger) { return maxSafeInteger; }
+ return len;
+ }
+
+ /**
+ * This method creates a new Observable sequence from an array-like or iterable object.
+ * @param {Any} arrayLike An array-like or iterable object to convert to an Observable sequence.
+ * @param {Function} [mapFn] Map function to call on every element of the array.
+ * @param {Any} [thisArg] The context to use calling the mapFn if provided.
+ * @param {Scheduler} [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread.
+ */
+ var observableFrom = Observable.from = function (iterable, mapFn, thisArg, scheduler) {
+ if (iterable == null) {
+ throw new Error('iterable cannot be null.')
+ }
+ if (mapFn && !isFunction(mapFn)) {
+ throw new Error('mapFn when provided must be a function');
+ }
+ if (mapFn) {
+ var mapper = bindCallback(mapFn, thisArg, 2);
+ }
+ isScheduler(scheduler) || (scheduler = currentThreadScheduler);
+ return new FromObservable(iterable, mapper, scheduler);
+ }
+
+ var FromArrayObservable = (function(__super__) {
+ inherits(FromArrayObservable, __super__);
+ function FromArrayObservable(args, scheduler) {
+ this.args = args;
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ FromArrayObservable.prototype.subscribeCore = function (observer) {
+ var sink = new FromArraySink(observer, this);
+ return sink.run();
+ };
+
+ return FromArrayObservable;
+ }(ObservableBase));
+
+ function FromArraySink(observer, parent) {
+ this.observer = observer;
+ this.parent = parent;
+ }
+
+ FromArraySink.prototype.run = function () {
+ var observer = this.observer, args = this.parent.args, len = args.length;
+ function loopRecursive(i, recurse) {
+ if (i < len) {
+ observer.onNext(args[i]);
+ recurse(i + 1);
+ } else {
+ observer.onCompleted();
+ }
+ }
+
+ return this.parent.scheduler.scheduleRecursiveWithState(0, loopRecursive);
+ };
+
+ /**
+ * Converts an array to an observable sequence, using an optional scheduler to enumerate the array.
+ * @deprecated use Observable.from or Observable.of
+ * @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on.
+ * @returns {Observable} The observable sequence whose elements are pulled from the given enumerable sequence.
+ */
+ var observableFromArray = Observable.fromArray = function (array, scheduler) {
+ isScheduler(scheduler) || (scheduler = currentThreadScheduler);
+ return new FromArrayObservable(array, scheduler)
+ };
+
+ /**
+ * Generates an observable sequence by running a state-driven loop producing the sequence's elements, using the specified scheduler to send out observer messages.
+ *
+ * @example
+ * var res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; });
+ * var res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; }, Rx.Scheduler.timeout);
+ * @param {Mixed} initialState Initial state.
+ * @param {Function} condition Condition to terminate generation (upon returning false).
+ * @param {Function} iterate Iteration step function.
+ * @param {Function} resultSelector Selector function for results produced in the sequence.
+ * @param {Scheduler} [scheduler] Scheduler on which to run the generator loop. If not provided, defaults to Scheduler.currentThread.
+ * @returns {Observable} The generated sequence.
+ */
+ Observable.generate = function (initialState, condition, iterate, resultSelector, scheduler) {
+ isScheduler(scheduler) || (scheduler = currentThreadScheduler);
+ return new AnonymousObservable(function (o) {
+ var first = true;
+ return scheduler.scheduleRecursiveWithState(initialState, function (state, self) {
+ var hasResult, result;
+ try {
+ if (first) {
+ first = false;
+ } else {
+ state = iterate(state);
+ }
+ hasResult = condition(state);
+ hasResult && (result = resultSelector(state));
+ } catch (e) {
+ return o.onError(e);
+ }
+ if (hasResult) {
+ o.onNext(result);
+ self(state);
+ } else {
+ o.onCompleted();
+ }
+ });
+ });
+ };
+
+ function observableOf (scheduler, array) {
+ isScheduler(scheduler) || (scheduler = currentThreadScheduler);
+ return new FromArrayObservable(array, scheduler);
+ }
+
+ /**
+ * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments.
+ * @returns {Observable} The observable sequence whose elements are pulled from the given arguments.
+ */
+ Observable.of = function () {
+ var len = arguments.length, args = new Array(len);
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+ return new FromArrayObservable(args, currentThreadScheduler);
+ };
+
+ /**
+ * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments.
+ * @param {Scheduler} scheduler A scheduler to use for scheduling the arguments.
+ * @returns {Observable} The observable sequence whose elements are pulled from the given arguments.
+ */
+ Observable.ofWithScheduler = function (scheduler) {
+ var len = arguments.length, args = new Array(len - 1);
+ for(var i = 1; i < len; i++) { args[i - 1] = arguments[i]; }
+ return new FromArrayObservable(args, scheduler);
+ };
+
+ /**
+ * Creates an Observable sequence from changes to an array using Array.observe.
+ * @param {Array} array An array to observe changes.
+ * @returns {Observable} An observable sequence containing changes to an array from Array.observe.
+ */
+ Observable.ofArrayChanges = function(array) {
+ if (!Array.isArray(array)) { throw new TypeError('Array.observe only accepts arrays.'); }
+ if (typeof Array.observe !== 'function' && typeof Array.unobserve !== 'function') { throw new TypeError('Array.observe is not supported on your platform') }
+ return new AnonymousObservable(function(observer) {
+ function observerFn(changes) {
+ for(var i = 0, len = changes.length; i < len; i++) {
+ observer.onNext(changes[i]);
+ }
+ }
+
+ Array.observe(array, observerFn);
+
+ return function () {
+ Array.unobserve(array, observerFn);
+ };
+ });
+ };
+
+ /**
+ * Creates an Observable sequence from changes to an object using Object.observe.
+ * @param {Object} obj An object to observe changes.
+ * @returns {Observable} An observable sequence containing changes to an object from Object.observe.
+ */
+ Observable.ofObjectChanges = function(obj) {
+ if (obj == null) { throw new TypeError('object must not be null or undefined.'); }
+ if (typeof Object.observe !== 'function' && typeof Object.unobserve !== 'function') { throw new TypeError('Object.observe is not supported on your platform') }
+ return new AnonymousObservable(function(observer) {
+ function observerFn(changes) {
+ for(var i = 0, len = changes.length; i < len; i++) {
+ observer.onNext(changes[i]);
+ }
+ }
+
+ Object.observe(obj, observerFn);
+
+ return function () {
+ Object.unobserve(obj, observerFn);
+ };
+ });
+ };
+
+ var NeverObservable = (function(__super__) {
+ inherits(NeverObservable, __super__);
+ function NeverObservable() {
+ __super__.call(this);
+ }
+
+ NeverObservable.prototype.subscribeCore = function (observer) {
+ return disposableEmpty;
+ };
+
+ return NeverObservable;
+ }(ObservableBase));
+
+ /**
+ * Returns a non-terminating observable sequence, which can be used to denote an infinite duration (e.g. when using reactive joins).
+ * @returns {Observable} An observable sequence whose observers will never get called.
+ */
+ var observableNever = Observable.never = function () {
+ return new NeverObservable();
+ };
+
+ var PairsObservable = (function(__super__) {
+ inherits(PairsObservable, __super__);
+ function PairsObservable(obj, scheduler) {
+ this.obj = obj;
+ this.keys = Object.keys(obj);
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ PairsObservable.prototype.subscribeCore = function (observer) {
+ var sink = new PairsSink(observer, this);
+ return sink.run();
+ };
+
+ return PairsObservable;
+ }(ObservableBase));
+
+ function PairsSink(observer, parent) {
+ this.observer = observer;
+ this.parent = parent;
+ }
+
+ PairsSink.prototype.run = function () {
+ var observer = this.observer, obj = this.parent.obj, keys = this.parent.keys, len = keys.length;
+ function loopRecursive(i, recurse) {
+ if (i < len) {
+ var key = keys[i];
+ observer.onNext([key, obj[key]]);
+ recurse(i + 1);
+ } else {
+ observer.onCompleted();
+ }
+ }
+
+ return this.parent.scheduler.scheduleRecursiveWithState(0, loopRecursive);
+ };
+
+ /**
+ * Convert an object into an observable sequence of [key, value] pairs.
+ * @param {Object} obj The object to inspect.
+ * @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on.
+ * @returns {Observable} An observable sequence of [key, value] pairs from the object.
+ */
+ Observable.pairs = function (obj, scheduler) {
+ scheduler || (scheduler = currentThreadScheduler);
+ return new PairsObservable(obj, scheduler);
+ };
+
+ var RangeObservable = (function(__super__) {
+ inherits(RangeObservable, __super__);
+ function RangeObservable(start, count, scheduler) {
+ this.start = start;
+ this.rangeCount = count;
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ RangeObservable.prototype.subscribeCore = function (observer) {
+ var sink = new RangeSink(observer, this);
+ return sink.run();
+ };
+
+ return RangeObservable;
+ }(ObservableBase));
+
+ var RangeSink = (function () {
+ function RangeSink(observer, parent) {
+ this.observer = observer;
+ this.parent = parent;
+ }
+
+ RangeSink.prototype.run = function () {
+ var start = this.parent.start, count = this.parent.rangeCount, observer = this.observer;
+ function loopRecursive(i, recurse) {
+ if (i < count) {
+ observer.onNext(start + i);
+ recurse(i + 1);
+ } else {
+ observer.onCompleted();
+ }
+ }
+
+ return this.parent.scheduler.scheduleRecursiveWithState(0, loopRecursive);
+ };
+
+ return RangeSink;
+ }());
+
+ /**
+ * Generates an observable sequence of integral numbers within a specified range, using the specified scheduler to send out observer messages.
+ * @param {Number} start The value of the first integer in the sequence.
+ * @param {Number} count The number of sequential integers to generate.
+ * @param {Scheduler} [scheduler] Scheduler to run the generator loop on. If not specified, defaults to Scheduler.currentThread.
+ * @returns {Observable} An observable sequence that contains a range of sequential integral numbers.
+ */
+ Observable.range = function (start, count, scheduler) {
+ isScheduler(scheduler) || (scheduler = currentThreadScheduler);
+ return new RangeObservable(start, count, scheduler);
+ };
+
+ var RepeatObservable = (function(__super__) {
+ inherits(RepeatObservable, __super__);
+ function RepeatObservable(value, repeatCount, scheduler) {
+ this.value = value;
+ this.repeatCount = repeatCount == null ? -1 : repeatCount;
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ RepeatObservable.prototype.subscribeCore = function (observer) {
+ var sink = new RepeatSink(observer, this);
+ return sink.run();
+ };
+
+ return RepeatObservable;
+ }(ObservableBase));
+
+ function RepeatSink(observer, parent) {
+ this.observer = observer;
+ this.parent = parent;
+ }
+
+ RepeatSink.prototype.run = function () {
+ var observer = this.observer, value = this.parent.value;
+ function loopRecursive(i, recurse) {
+ if (i === -1 || i > 0) {
+ observer.onNext(value);
+ i > 0 && i--;
+ }
+ if (i === 0) { return observer.onCompleted(); }
+ recurse(i);
+ }
+
+ return this.parent.scheduler.scheduleRecursiveWithState(this.parent.repeatCount, loopRecursive);
+ };
+
+ /**
+ * Generates an observable sequence that repeats the given element the specified number of times, using the specified scheduler to send out observer messages.
+ * @param {Mixed} value Element to repeat.
+ * @param {Number} repeatCount [Optiona] Number of times to repeat the element. If not specified, repeats indefinitely.
+ * @param {Scheduler} scheduler Scheduler to run the producer loop on. If not specified, defaults to Scheduler.immediate.
+ * @returns {Observable} An observable sequence that repeats the given element the specified number of times.
+ */
+ Observable.repeat = function (value, repeatCount, scheduler) {
+ isScheduler(scheduler) || (scheduler = currentThreadScheduler);
+ return new RepeatObservable(value, repeatCount, scheduler);
+ };
+
+ var JustObservable = (function(__super__) {
+ inherits(JustObservable, __super__);
+ function JustObservable(value, scheduler) {
+ this.value = value;
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ JustObservable.prototype.subscribeCore = function (observer) {
+ var sink = new JustSink(observer, this);
+ return sink.run();
+ };
+
+ function JustSink(observer, parent) {
+ this.observer = observer;
+ this.parent = parent;
+ }
+
+ function scheduleItem(s, state) {
+ var value = state[0], observer = state[1];
+ observer.onNext(value);
+ observer.onCompleted();
+ }
+
+ JustSink.prototype.run = function () {
+ return this.parent.scheduler.scheduleWithState([this.parent.value, this.observer], scheduleItem);
+ };
+
+ return JustObservable;
+ }(ObservableBase));
+
+ /**
+ * Returns an observable sequence that contains a single element, using the specified scheduler to send out observer messages.
+ * There is an alias called 'just' or browsers <IE9.
+ * @param {Mixed} value Single element in the resulting observable sequence.
+ * @param {Scheduler} scheduler Scheduler to send the single element on. If not specified, defaults to Scheduler.immediate.
+ * @returns {Observable} An observable sequence containing the single specified element.
+ */
+ var observableReturn = Observable['return'] = Observable.just = Observable.returnValue = function (value, scheduler) {
+ isScheduler(scheduler) || (scheduler = immediateScheduler);
+ return new JustObservable(value, scheduler);
+ };
+
+ var ThrowObservable = (function(__super__) {
+ inherits(ThrowObservable, __super__);
+ function ThrowObservable(error, scheduler) {
+ this.error = error;
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ ThrowObservable.prototype.subscribeCore = function (o) {
+ var sink = new ThrowSink(o, this);
+ return sink.run();
+ };
+
+ function ThrowSink(o, p) {
+ this.o = o;
+ this.p = p;
+ }
+
+ function scheduleItem(s, state) {
+ var e = state[0], o = state[1];
+ o.onError(e);
+ }
+
+ ThrowSink.prototype.run = function () {
+ return this.p.scheduler.scheduleWithState([this.p.error, this.o], scheduleItem);
+ };
+
+ return ThrowObservable;
+ }(ObservableBase));
+
+ /**
+ * Returns an observable sequence that terminates with an exception, using the specified scheduler to send out the single onError message.
+ * There is an alias to this method called 'throwError' for browsers <IE9.
+ * @param {Mixed} error An object used for the sequence's termination.
+ * @param {Scheduler} scheduler Scheduler to send the exceptional termination call on. If not specified, defaults to Scheduler.immediate.
+ * @returns {Observable} The observable sequence that terminates exceptionally with the specified exception object.
+ */
+ var observableThrow = Observable['throw'] = Observable.throwError = Observable.throwException = function (error, scheduler) {
+ isScheduler(scheduler) || (scheduler = immediateScheduler);
+ return new ThrowObservable(error, scheduler);
+ };
+
+ /**
+ * Constructs an observable sequence that depends on a resource object, whose lifetime is tied to the resulting observable sequence's lifetime.
+ * @param {Function} resourceFactory Factory function to obtain a resource object.
+ * @param {Function} observableFactory Factory function to obtain an observable sequence that depends on the obtained resource.
+ * @returns {Observable} An observable sequence whose lifetime controls the lifetime of the dependent resource object.
+ */
+ Observable.using = function (resourceFactory, observableFactory) {
+ return new AnonymousObservable(function (observer) {
+ var disposable = disposableEmpty, resource, source;
+ try {
+ resource = resourceFactory();
+ resource && (disposable = resource);
+ source = observableFactory(resource);
+ } catch (exception) {
+ return new CompositeDisposable(observableThrow(exception).subscribe(observer), disposable);
+ }
+ return new CompositeDisposable(source.subscribe(observer), disposable);
+ });
+ };
+
+ /**
+ * Propagates the observable sequence or Promise that reacts first.
+ * @param {Observable} rightSource Second observable sequence or Promise.
+ * @returns {Observable} {Observable} An observable sequence that surfaces either of the given sequences, whichever reacted first.
+ */
+ observableProto.amb = function (rightSource) {
+ var leftSource = this;
+ return new AnonymousObservable(function (observer) {
+ var choice,
+ leftChoice = 'L', rightChoice = 'R',
+ leftSubscription = new SingleAssignmentDisposable(),
+ rightSubscription = new SingleAssignmentDisposable();
+
+ isPromise(rightSource) && (rightSource = observableFromPromise(rightSource));
+
+ function choiceL() {
+ if (!choice) {
+ choice = leftChoice;
+ rightSubscription.dispose();
+ }
+ }
+
+ function choiceR() {
+ if (!choice) {
+ choice = rightChoice;
+ leftSubscription.dispose();
+ }
+ }
+
+ leftSubscription.setDisposable(leftSource.subscribe(function (left) {
+ choiceL();
+ choice === leftChoice && observer.onNext(left);
+ }, function (err) {
+ choiceL();
+ choice === leftChoice && observer.onError(err);
+ }, function () {
+ choiceL();
+ choice === leftChoice && observer.onCompleted();
+ }));
+
+ rightSubscription.setDisposable(rightSource.subscribe(function (right) {
+ choiceR();
+ choice === rightChoice && observer.onNext(right);
+ }, function (err) {
+ choiceR();
+ choice === rightChoice && observer.onError(err);
+ }, function () {
+ choiceR();
+ choice === rightChoice && observer.onCompleted();
+ }));
+
+ return new CompositeDisposable(leftSubscription, rightSubscription);
+ });
+ };
+
+ /**
+ * Propagates the observable sequence or Promise that reacts first.
+ *
+ * @example
+ * var = Rx.Observable.amb(xs, ys, zs);
+ * @returns {Observable} An observable sequence that surfaces any of the given sequences, whichever reacted first.
+ */
+ Observable.amb = function () {
+ var acc = observableNever(), items = [];
+ if (Array.isArray(arguments[0])) {
+ items = arguments[0];
+ } else {
+ for(var i = 0, len = arguments.length; i < len; i++) { items.push(arguments[i]); }
+ }
+
+ function func(previous, current) {
+ return previous.amb(current);
+ }
+ for (var i = 0, len = items.length; i < len; i++) {
+ acc = func(acc, items[i]);
+ }
+ return acc;
+ };
+
+ function observableCatchHandler(source, handler) {
+ return new AnonymousObservable(function (o) {
+ var d1 = new SingleAssignmentDisposable(), subscription = new SerialDisposable();
+ subscription.setDisposable(d1);
+ d1.setDisposable(source.subscribe(function (x) { o.onNext(x); }, function (e) {
+ try {
+ var result = handler(e);
+ } catch (ex) {
+ return o.onError(ex);
+ }
+ isPromise(result) && (result = observableFromPromise(result));
+
+ var d = new SingleAssignmentDisposable();
+ subscription.setDisposable(d);
+ d.setDisposable(result.subscribe(o));
+ }, function (x) { o.onCompleted(x); }));
+
+ return subscription;
+ }, source);
+ }
+
+ /**
+ * Continues an observable sequence that is terminated by an exception with the next observable sequence.
+ * @example
+ * 1 - xs.catchException(ys)
+ * 2 - xs.catchException(function (ex) { return ys(ex); })
+ * @param {Mixed} handlerOrSecond Exception handler function that returns an observable sequence given the error that occurred in the first sequence, or a second observable sequence used to produce results when an error occurred in the first sequence.
+ * @returns {Observable} An observable sequence containing the first sequence's elements, followed by the elements of the handler sequence in case an exception occurred.
+ */
+ observableProto['catch'] = observableProto.catchError = observableProto.catchException = function (handlerOrSecond) {
+ return typeof handlerOrSecond === 'function' ?
+ observableCatchHandler(this, handlerOrSecond) :
+ observableCatch([this, handlerOrSecond]);
+ };
+
+ /**
+ * Continues an observable sequence that is terminated by an exception with the next observable sequence.
+ * @param {Array | Arguments} args Arguments or an array to use as the next sequence if an error occurs.
+ * @returns {Observable} An observable sequence containing elements from consecutive source sequences until a source sequence terminates successfully.
+ */
+ var observableCatch = Observable.catchError = Observable['catch'] = Observable.catchException = function () {
+ var items = [];
+ if (Array.isArray(arguments[0])) {
+ items = arguments[0];
+ } else {
+ for(var i = 0, len = arguments.length; i < len; i++) { items.push(arguments[i]); }
+ }
+ return enumerableOf(items).catchError();
+ };
+
+ /**
+ * Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element.
+ * This can be in the form of an argument list of observables or an array.
+ *
+ * @example
+ * 1 - obs = observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
+ * 2 - obs = observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
+ * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
+ */
+ observableProto.combineLatest = function () {
+ var len = arguments.length, args = new Array(len);
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+ if (Array.isArray(args[0])) {
+ args[0].unshift(this);
+ } else {
+ args.unshift(this);
+ }
+ return combineLatest.apply(this, args);
+ };
+
+ /**
+ * Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element.
+ *
+ * @example
+ * 1 - obs = Rx.Observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
+ * 2 - obs = Rx.Observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
+ * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
+ */
+ var combineLatest = Observable.combineLatest = function () {
+ var len = arguments.length, args = new Array(len);
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+ var resultSelector = args.pop();
+ Array.isArray(args[0]) && (args = args[0]);
+
+ return new AnonymousObservable(function (o) {
+ var n = args.length,
+ falseFactory = function () { return false; },
+ hasValue = arrayInitialize(n, falseFactory),
+ hasValueAll = false,
+ isDone = arrayInitialize(n, falseFactory),
+ values = new Array(n);
+
+ function next(i) {
+ hasValue[i] = true;
+ if (hasValueAll || (hasValueAll = hasValue.every(identity))) {
+ try {
+ var res = resultSelector.apply(null, values);
+ } catch (e) {
+ return o.onError(e);
+ }
+ o.onNext(res);
+ } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) {
+ o.onCompleted();
+ }
+ }
+
+ function done (i) {
+ isDone[i] = true;
+ isDone.every(identity) && o.onCompleted();
+ }
+
+ var subscriptions = new Array(n);
+ for (var idx = 0; idx < n; idx++) {
+ (function (i) {
+ var source = args[i], sad = new SingleAssignmentDisposable();
+ isPromise(source) && (source = observableFromPromise(source));
+ sad.setDisposable(source.subscribe(function (x) {
+ values[i] = x;
+ next(i);
+ },
+ function(e) { o.onError(e); },
+ function () { done(i); }
+ ));
+ subscriptions[i] = sad;
+ }(idx));
+ }
+
+ return new CompositeDisposable(subscriptions);
+ }, this);
+ };
+
+ /**
+ * Concatenates all the observable sequences. This takes in either an array or variable arguments to concatenate.
+ * @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order.
+ */
+ observableProto.concat = function () {
+ for(var args = [], i = 0, len = arguments.length; i < len; i++) { args.push(arguments[i]); }
+ args.unshift(this);
+ return observableConcat.apply(null, args);
+ };
+
+ var ConcatObservable = (function(__super__) {
+ inherits(ConcatObservable, __super__);
+ function ConcatObservable(sources) {
+ this.sources = sources;
+ __super__.call(this);
+ }
+
+ ConcatObservable.prototype.subscribeCore = function(o) {
+ var sink = new ConcatSink(this.sources, o);
+ return sink.run();
+ };
+
+ function ConcatSink(sources, o) {
+ this.sources = sources;
+ this.o = o;
+ }
+ ConcatSink.prototype.run = function () {
+ var isDisposed, subscription = new SerialDisposable(), sources = this.sources, length = sources.length, o = this.o;
+ var cancelable = immediateScheduler.scheduleRecursiveWithState(0, function (i, self) {
+ if (isDisposed) { return; }
+ if (i === length) {
+ return o.onCompleted();
+ }
+
+ // Check if promise
+ var currentValue = sources[i];
+ isPromise(currentValue) && (currentValue = observableFromPromise(currentValue));
+
+ var d = new SingleAssignmentDisposable();
+ subscription.setDisposable(d);
+ d.setDisposable(currentValue.subscribe(
+ function (x) { o.onNext(x); },
+ function (e) { o.onError(e); },
+ function () { self(i + 1); }
+ ));
+ });
+
+ return new CompositeDisposable(subscription, cancelable, disposableCreate(function () {
+ isDisposed = true;
+ }));
+ };
+
+
+ return ConcatObservable;
+ }(ObservableBase));
+
+ /**
+ * Concatenates all the observable sequences.
+ * @param {Array | Arguments} args Arguments or an array to concat to the observable sequence.
+ * @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order.
+ */
+ var observableConcat = Observable.concat = function () {
+ var args;
+ if (Array.isArray(arguments[0])) {
+ args = arguments[0];
+ } else {
+ args = new Array(arguments.length);
+ for(var i = 0, len = arguments.length; i < len; i++) { args[i] = arguments[i]; }
+ }
+ return new ConcatObservable(args);
+ };
+
+ /**
+ * Concatenates an observable sequence of observable sequences.
+ * @returns {Observable} An observable sequence that contains the elements of each observed inner sequence, in sequential order.
+ */
+ observableProto.concatAll = observableProto.concatObservable = function () {
+ return this.merge(1);
+ };
+
+ var MergeObservable = (function (__super__) {
+ inherits(MergeObservable, __super__);
+
+ function MergeObservable(source, maxConcurrent) {
+ this.source = source;
+ this.maxConcurrent = maxConcurrent;
+ __super__.call(this);
+ }
+
+ MergeObservable.prototype.subscribeCore = function(observer) {
+ var g = new CompositeDisposable();
+ g.add(this.source.subscribe(new MergeObserver(observer, this.maxConcurrent, g)));
+ return g;
+ };
+
+ return MergeObservable;
+
+ }(ObservableBase));
+
+ var MergeObserver = (function () {
+ function MergeObserver(o, max, g) {
+ this.o = o;
+ this.max = max;
+ this.g = g;
+ this.done = false;
+ this.q = [];
+ this.activeCount = 0;
+ this.isStopped = false;
+ }
+ MergeObserver.prototype.handleSubscribe = function (xs) {
+ var sad = new SingleAssignmentDisposable();
+ this.g.add(sad);
+ isPromise(xs) && (xs = observableFromPromise(xs));
+ sad.setDisposable(xs.subscribe(new InnerObserver(this, sad)));
+ };
+ MergeObserver.prototype.onNext = function (innerSource) {
+ if (this.isStopped) { return; }
+ if(this.activeCount < this.max) {
+ this.activeCount++;
+ this.handleSubscribe(innerSource);
+ } else {
+ this.q.push(innerSource);
+ }
+ };
+ MergeObserver.prototype.onError = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ }
+ };
+ MergeObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.done = true;
+ this.activeCount === 0 && this.o.onCompleted();
+ }
+ };
+ MergeObserver.prototype.dispose = function() { this.isStopped = true; };
+ MergeObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ function InnerObserver(parent, sad) {
+ this.parent = parent;
+ this.sad = sad;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) { if(!this.isStopped) { this.parent.o.onNext(x); } };
+ InnerObserver.prototype.onError = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.parent.o.onError(e);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ var parent = this.parent;
+ parent.g.remove(this.sad);
+ if (parent.q.length > 0) {
+ parent.handleSubscribe(parent.q.shift());
+ } else {
+ parent.activeCount--;
+ parent.done && parent.activeCount === 0 && parent.o.onCompleted();
+ }
+ }
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.parent.o.onError(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ return MergeObserver;
+ }());
+
+
+
+
+
+ /**
+ * Merges an observable sequence of observable sequences into an observable sequence, limiting the number of concurrent subscriptions to inner sequences.
+ * Or merges two observable sequences into a single observable sequence.
+ *
+ * @example
+ * 1 - merged = sources.merge(1);
+ * 2 - merged = source.merge(otherSource);
+ * @param {Mixed} [maxConcurrentOrOther] Maximum number of inner observable sequences being subscribed to concurrently or the second observable sequence.
+ * @returns {Observable} The observable sequence that merges the elements of the inner sequences.
+ */
+ observableProto.merge = function (maxConcurrentOrOther) {
+ return typeof maxConcurrentOrOther !== 'number' ?
+ observableMerge(this, maxConcurrentOrOther) :
+ new MergeObservable(this, maxConcurrentOrOther);
+ };
+
+ /**
+ * Merges all the observable sequences into a single observable sequence.
+ * The scheduler is optional and if not specified, the immediate scheduler is used.
+ * @returns {Observable} The observable sequence that merges the elements of the observable sequences.
+ */
+ var observableMerge = Observable.merge = function () {
+ var scheduler, sources = [], i, len = arguments.length;
+ if (!arguments[0]) {
+ scheduler = immediateScheduler;
+ for(i = 1; i < len; i++) { sources.push(arguments[i]); }
+ } else if (isScheduler(arguments[0])) {
+ scheduler = arguments[0];
+ for(i = 1; i < len; i++) { sources.push(arguments[i]); }
+ } else {
+ scheduler = immediateScheduler;
+ for(i = 0; i < len; i++) { sources.push(arguments[i]); }
+ }
+ if (Array.isArray(sources[0])) {
+ sources = sources[0];
+ }
+ return observableOf(scheduler, sources).mergeAll();
+ };
+
+ var MergeAllObservable = (function (__super__) {
+ inherits(MergeAllObservable, __super__);
+
+ function MergeAllObservable(source) {
+ this.source = source;
+ __super__.call(this);
+ }
+
+ MergeAllObservable.prototype.subscribeCore = function (observer) {
+ var g = new CompositeDisposable(), m = new SingleAssignmentDisposable();
+ g.add(m);
+ m.setDisposable(this.source.subscribe(new MergeAllObserver(observer, g)));
+ return g;
+ };
+
+ function MergeAllObserver(o, g) {
+ this.o = o;
+ this.g = g;
+ this.isStopped = false;
+ this.done = false;
+ }
+ MergeAllObserver.prototype.onNext = function(innerSource) {
+ if(this.isStopped) { return; }
+ var sad = new SingleAssignmentDisposable();
+ this.g.add(sad);
+
+ isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
+
+ sad.setDisposable(innerSource.subscribe(new InnerObserver(this, this.g, sad)));
+ };
+ MergeAllObserver.prototype.onError = function (e) {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ }
+ };
+ MergeAllObserver.prototype.onCompleted = function () {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ this.done = true;
+ this.g.length === 1 && this.o.onCompleted();
+ }
+ };
+ MergeAllObserver.prototype.dispose = function() { this.isStopped = true; };
+ MergeAllObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ function InnerObserver(parent, g, sad) {
+ this.parent = parent;
+ this.g = g;
+ this.sad = sad;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) { if (!this.isStopped) { this.parent.o.onNext(x); } };
+ InnerObserver.prototype.onError = function (e) {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ this.parent.o.onError(e);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if(!this.isStopped) {
+ var parent = this.parent;
+ this.isStopped = true;
+ parent.g.remove(this.sad);
+ parent.done && parent.g.length === 1 && parent.o.onCompleted();
+ }
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.parent.o.onError(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ return MergeAllObservable;
+ }(ObservableBase));
+
+ /**
+ * Merges an observable sequence of observable sequences into an observable sequence.
+ * @returns {Observable} The observable sequence that merges the elements of the inner sequences.
+ */
+ observableProto.mergeAll = observableProto.mergeObservable = function () {
+ return new MergeAllObservable(this);
+ };
+
+ var CompositeError = Rx.CompositeError = function(errors) {
+ this.name = "NotImplementedError";
+ this.innerErrors = errors;
+ this.message = 'This contains multiple errors. Check the innerErrors';
+ Error.call(this);
+ }
+ CompositeError.prototype = Error.prototype;
+
+ /**
+ * Flattens an Observable that emits Observables into one Observable, in a way that allows an Observer to
+ * receive all successfully emitted items from all of the source Observables without being interrupted by
+ * an error notification from one of them.
+ *
+ * This behaves like Observable.prototype.mergeAll except that if any of the merged Observables notify of an
+ * error via the Observer's onError, mergeDelayError will refrain from propagating that
+ * error notification until all of the merged Observables have finished emitting items.
+ * @param {Array | Arguments} args Arguments or an array to merge.
+ * @returns {Observable} an Observable that emits all of the items emitted by the Observables emitted by the Observable
+ */
+ Observable.mergeDelayError = function() {
+ var args;
+ if (Array.isArray(arguments[0])) {
+ args = arguments[0];
+ } else {
+ var len = arguments.length;
+ args = new Array(len);
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+ }
+ var source = observableOf(null, args);
+
+ return new AnonymousObservable(function (o) {
+ var group = new CompositeDisposable(),
+ m = new SingleAssignmentDisposable(),
+ isStopped = false,
+ errors = [];
+
+ function setCompletion() {
+ if (errors.length === 0) {
+ o.onCompleted();
+ } else if (errors.length === 1) {
+ o.onError(errors[0]);
+ } else {
+ o.onError(new CompositeError(errors));
+ }
+ }
+
+ group.add(m);
+
+ m.setDisposable(source.subscribe(
+ function (innerSource) {
+ var innerSubscription = new SingleAssignmentDisposable();
+ group.add(innerSubscription);
+
+ // Check for promises support
+ isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
+
+ innerSubscription.setDisposable(innerSource.subscribe(
+ function (x) { o.onNext(x); },
+ function (e) {
+ errors.push(e);
+ group.remove(innerSubscription);
+ isStopped && group.length === 1 && setCompletion();
+ },
+ function () {
+ group.remove(innerSubscription);
+ isStopped && group.length === 1 && setCompletion();
+ }));
+ },
+ function (e) {
+ errors.push(e);
+ isStopped = true;
+ group.length === 1 && setCompletion();
+ },
+ function () {
+ isStopped = true;
+ group.length === 1 && setCompletion();
+ }));
+ return group;
+ });
+ };
+
+ /**
+ * Continues an observable sequence that is terminated normally or by an exception with the next observable sequence.
+ * @param {Observable} second Second observable sequence used to produce results after the first sequence terminates.
+ * @returns {Observable} An observable sequence that concatenates the first and second sequence, even if the first sequence terminates exceptionally.
+ */
+ observableProto.onErrorResumeNext = function (second) {
+ if (!second) { throw new Error('Second observable is required'); }
+ return onErrorResumeNext([this, second]);
+ };
+
+ /**
+ * Continues an observable sequence that is terminated normally or by an exception with the next observable sequence.
+ *
+ * @example
+ * 1 - res = Rx.Observable.onErrorResumeNext(xs, ys, zs);
+ * 1 - res = Rx.Observable.onErrorResumeNext([xs, ys, zs]);
+ * @returns {Observable} An observable sequence that concatenates the source sequences, even if a sequence terminates exceptionally.
+ */
+ var onErrorResumeNext = Observable.onErrorResumeNext = function () {
+ var sources = [];
+ if (Array.isArray(arguments[0])) {
+ sources = arguments[0];
+ } else {
+ for(var i = 0, len = arguments.length; i < len; i++) { sources.push(arguments[i]); }
+ }
+ return new AnonymousObservable(function (observer) {
+ var pos = 0, subscription = new SerialDisposable(),
+ cancelable = immediateScheduler.scheduleRecursive(function (self) {
+ var current, d;
+ if (pos < sources.length) {
+ current = sources[pos++];
+ isPromise(current) && (current = observableFromPromise(current));
+ d = new SingleAssignmentDisposable();
+ subscription.setDisposable(d);
+ d.setDisposable(current.subscribe(observer.onNext.bind(observer), self, self));
+ } else {
+ observer.onCompleted();
+ }
+ });
+ return new CompositeDisposable(subscription, cancelable);
+ });
+ };
+
+ /**
+ * Returns the values from the source observable sequence only after the other observable sequence produces a value.
+ * @param {Observable | Promise} other The observable sequence or Promise that triggers propagation of elements of the source sequence.
+ * @returns {Observable} An observable sequence containing the elements of the source sequence starting from the point the other sequence triggered propagation.
+ */
+ observableProto.skipUntil = function (other) {
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var isOpen = false;
+ var disposables = new CompositeDisposable(source.subscribe(function (left) {
+ isOpen && o.onNext(left);
+ }, function (e) { o.onError(e); }, function () {
+ isOpen && o.onCompleted();
+ }));
+
+ isPromise(other) && (other = observableFromPromise(other));
+
+ var rightSubscription = new SingleAssignmentDisposable();
+ disposables.add(rightSubscription);
+ rightSubscription.setDisposable(other.subscribe(function () {
+ isOpen = true;
+ rightSubscription.dispose();
+ }, function (e) { o.onError(e); }, function () {
+ rightSubscription.dispose();
+ }));
+
+ return disposables;
+ }, source);
+ };
+
+ var SwitchObservable = (function(__super__) {
+ inherits(SwitchObservable, __super__);
+ function SwitchObservable(source) {
+ this.source = source;
+ __super__.call(this);
+ }
+
+ SwitchObservable.prototype.subscribeCore = function (o) {
+ var inner = new SerialDisposable(), s = this.source.subscribe(new SwitchObserver(o, inner));
+ return new CompositeDisposable(s, inner);
+ };
+
+ function SwitchObserver(o, inner) {
+ this.o = o;
+ this.inner = inner;
+ this.stopped = false;
+ this.latest = 0;
+ this.hasLatest = false;
+ this.isStopped = false;
+ }
+ SwitchObserver.prototype.onNext = function (innerSource) {
+ if (this.isStopped) { return; }
+ var d = new SingleAssignmentDisposable(), id = ++this.latest;
+ this.hasLatest = true;
+ this.inner.setDisposable(d);
+ isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
+ d.setDisposable(innerSource.subscribe(new InnerObserver(this, id)));
+ };
+ SwitchObserver.prototype.onError = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ }
+ };
+ SwitchObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.stopped = true;
+ !this.hasLatest && this.o.onCompleted();
+ }
+ };
+ SwitchObserver.prototype.dispose = function () { this.isStopped = true; };
+ SwitchObserver.prototype.fail = function (e) {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ function InnerObserver(parent, id) {
+ this.parent = parent;
+ this.id = id;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) {
+ if (this.isStopped) { return; }
+ this.parent.latest === this.id && this.parent.o.onNext(x);
+ };
+ InnerObserver.prototype.onError = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.parent.latest === this.id && this.parent.o.onError(e);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ if (this.parent.latest === this.id) {
+ this.parent.hasLatest = false;
+ this.parent.isStopped && this.parent.o.onCompleted();
+ }
+ }
+ };
+ InnerObserver.prototype.dispose = function () { this.isStopped = true; }
+ InnerObserver.prototype.fail = function (e) {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ this.parent.o.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ return SwitchObservable;
+ }(ObservableBase));
+
+ /**
+ * Transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
+ * @returns {Observable} The observable sequence that at any point in time produces the elements of the most recent inner observable sequence that has been received.
+ */
+ observableProto['switch'] = observableProto.switchLatest = function () {
+ return new SwitchObservable(this);
+ };
+
+ var TakeUntilObservable = (function(__super__) {
+ inherits(TakeUntilObservable, __super__);
+
+ function TakeUntilObservable(source, other) {
+ this.source = source;
+ this.other = isPromise(other) ? observableFromPromise(other) : other;
+ __super__.call(this);
+ }
+
+ TakeUntilObservable.prototype.subscribeCore = function(o) {
+ return new CompositeDisposable(
+ this.source.subscribe(o),
+ this.other.subscribe(new InnerObserver(o))
+ );
+ };
+
+ function InnerObserver(o) {
+ this.o = o;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) {
+ if (this.isStopped) { return; }
+ this.o.onCompleted();
+ };
+ InnerObserver.prototype.onError = function (err) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(err);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ !this.isStopped && (this.isStopped = true);
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ return TakeUntilObservable;
+ }(ObservableBase));
+
+ /**
+ * Returns the values from the source observable sequence until the other observable sequence produces a value.
+ * @param {Observable | Promise} other Observable sequence or Promise that terminates propagation of elements of the source sequence.
+ * @returns {Observable} An observable sequence containing the elements of the source sequence up to the point the other sequence interrupted further propagation.
+ */
+ observableProto.takeUntil = function (other) {
+ return new TakeUntilObservable(this, other);
+ };
+
+ function falseFactory() { return false; }
+
+ /**
+ * Merges the specified observable sequences into one observable sequence by using the selector function only when the (first) source observable sequence produces an element.
+ * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
+ */
+ observableProto.withLatestFrom = function () {
+ var len = arguments.length, args = new Array(len)
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+ var resultSelector = args.pop(), source = this;
+ Array.isArray(args[0]) && (args = args[0]);
+
+ return new AnonymousObservable(function (observer) {
+ var n = args.length,
+ hasValue = arrayInitialize(n, falseFactory),
+ hasValueAll = false,
+ values = new Array(n);
+
+ var subscriptions = new Array(n + 1);
+ for (var idx = 0; idx < n; idx++) {
+ (function (i) {
+ var other = args[i], sad = new SingleAssignmentDisposable();
+ isPromise(other) && (other = observableFromPromise(other));
+ sad.setDisposable(other.subscribe(function (x) {
+ values[i] = x;
+ hasValue[i] = true;
+ hasValueAll = hasValue.every(identity);
+ }, function (e) { observer.onError(e); }, noop));
+ subscriptions[i] = sad;
+ }(idx));
+ }
+
+ var sad = new SingleAssignmentDisposable();
+ sad.setDisposable(source.subscribe(function (x) {
+ var allValues = [x].concat(values);
+ if (!hasValueAll) { return; }
+ var res = tryCatch(resultSelector).apply(null, allValues);
+ if (res === errorObj) { return observer.onError(res.e); }
+ observer.onNext(res);
+ }, function (e) { observer.onError(e); }, function () {
+ observer.onCompleted();
+ }));
+ subscriptions[n] = sad;
+
+ return new CompositeDisposable(subscriptions);
+ }, this);
+ };
+
+ function zipArray(second, resultSelector) {
+ var first = this;
+ return new AnonymousObservable(function (o) {
+ var index = 0, len = second.length;
+ return first.subscribe(function (left) {
+ if (index < len) {
+ var right = second[index++], res = tryCatch(resultSelector)(left, right);
+ if (res === errorObj) { return o.onError(res.e); }
+ o.onNext(res);
+ } else {
+ o.onCompleted();
+ }
+ }, function (e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, first);
+ }
+
+ function falseFactory() { return false; }
+ function emptyArrayFactory() { return []; }
+
+ /**
+ * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences or an array have produced an element at a corresponding index.
+ * The last element in the arguments must be a function to invoke for each series of elements at corresponding indexes in the args.
+ * @returns {Observable} An observable sequence containing the result of combining elements of the args using the specified result selector function.
+ */
+ observableProto.zip = function () {
+ if (Array.isArray(arguments[0])) { return zipArray.apply(this, arguments); }
+ var len = arguments.length, args = new Array(len);
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+
+ var parent = this, resultSelector = args.pop();
+ args.unshift(parent);
+ return new AnonymousObservable(function (o) {
+ var n = args.length,
+ queues = arrayInitialize(n, emptyArrayFactory),
+ isDone = arrayInitialize(n, falseFactory);
+
+ var subscriptions = new Array(n);
+ for (var idx = 0; idx < n; idx++) {
+ (function (i) {
+ var source = args[i], sad = new SingleAssignmentDisposable();
+ isPromise(source) && (source = observableFromPromise(source));
+ sad.setDisposable(source.subscribe(function (x) {
+ queues[i].push(x);
+ if (queues.every(function (x) { return x.length > 0; })) {
+ var queuedValues = queues.map(function (x) { return x.shift(); }),
+ res = tryCatch(resultSelector).apply(parent, queuedValues);
+ if (res === errorObj) { return o.onError(res.e); }
+ o.onNext(res);
+ } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) {
+ o.onCompleted();
+ }
+ }, function (e) { o.onError(e); }, function () {
+ isDone[i] = true;
+ isDone.every(identity) && o.onCompleted();
+ }));
+ subscriptions[i] = sad;
+ })(idx);
+ }
+
+ return new CompositeDisposable(subscriptions);
+ }, parent);
+ };
+
+ /**
+ * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index.
+ * @param arguments Observable sources.
+ * @param {Function} resultSelector Function to invoke for each series of elements at corresponding indexes in the sources.
+ * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
+ */
+ Observable.zip = function () {
+ var len = arguments.length, args = new Array(len);
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+ var first = args.shift();
+ return first.zip.apply(first, args);
+ };
+
+ function falseFactory() { return false; }
+ function arrayFactory() { return []; }
+
+ /**
+ * Merges the specified observable sequences into one observable sequence by emitting a list with the elements of the observable sequences at corresponding indexes.
+ * @param arguments Observable sources.
+ * @returns {Observable} An observable sequence containing lists of elements at corresponding indexes.
+ */
+ Observable.zipArray = function () {
+ var sources;
+ if (Array.isArray(arguments[0])) {
+ sources = arguments[0];
+ } else {
+ var len = arguments.length;
+ sources = new Array(len);
+ for(var i = 0; i < len; i++) { sources[i] = arguments[i]; }
+ }
+ return new AnonymousObservable(function (o) {
+ var n = sources.length,
+ queues = arrayInitialize(n, arrayFactory),
+ isDone = arrayInitialize(n, falseFactory);
+
+ var subscriptions = new Array(n);
+ for (var idx = 0; idx < n; idx++) {
+ (function (i) {
+ subscriptions[i] = new SingleAssignmentDisposable();
+ subscriptions[i].setDisposable(sources[i].subscribe(function (x) {
+ queues[i].push(x);
+ if (queues.every(function (x) { return x.length > 0; })) {
+ var res = queues.map(function (x) { return x.shift(); });
+ o.onNext(res);
+ } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) {
+ return o.onCompleted();
+ }
+ }, function (e) { o.onError(e); }, function () {
+ isDone[i] = true;
+ isDone.every(identity) && o.onCompleted();
+ }));
+ })(idx);
+ }
+
+ return new CompositeDisposable(subscriptions);
+ });
+ };
+
+ /**
+ * Hides the identity of an observable sequence.
+ * @returns {Observable} An observable sequence that hides the identity of the source sequence.
+ */
+ observableProto.asObservable = function () {
+ var source = this;
+ return new AnonymousObservable(function (o) { return source.subscribe(o); }, source);
+ };
+
+ /**
+ * Projects each element of an observable sequence into zero or more buffers which are produced based on element count information.
+ *
+ * @example
+ * var res = xs.bufferWithCount(10);
+ * var res = xs.bufferWithCount(10, 1);
+ * @param {Number} count Length of each buffer.
+ * @param {Number} [skip] Number of elements to skip between creation of consecutive buffers. If not provided, defaults to the count.
+ * @returns {Observable} An observable sequence of buffers.
+ */
+ observableProto.bufferWithCount = function (count, skip) {
+ if (typeof skip !== 'number') {
+ skip = count;
+ }
+ return this.windowWithCount(count, skip).selectMany(function (x) {
+ return x.toArray();
+ }).where(function (x) {
+ return x.length > 0;
+ });
+ };
+
+ /**
+ * Dematerializes the explicit notification values of an observable sequence as implicit notifications.
+ * @returns {Observable} An observable sequence exhibiting the behavior corresponding to the source sequence's notification values.
+ */
+ observableProto.dematerialize = function () {
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ return source.subscribe(function (x) { return x.accept(o); }, function(e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, this);
+ };
+
+ /**
+ * Returns an observable sequence that contains only distinct contiguous elements according to the keySelector and the comparer.
+ *
+ * var obs = observable.distinctUntilChanged();
+ * var obs = observable.distinctUntilChanged(function (x) { return x.id; });
+ * var obs = observable.distinctUntilChanged(function (x) { return x.id; }, function (x, y) { return x === y; });
+ *
+ * @param {Function} [keySelector] A function to compute the comparison key for each element. If not provided, it projects the value.
+ * @param {Function} [comparer] Equality comparer for computed key values. If not provided, defaults to an equality comparer function.
+ * @returns {Observable} An observable sequence only containing the distinct contiguous elements, based on a computed key value, from the source sequence.
+ */
+ observableProto.distinctUntilChanged = function (keySelector, comparer) {
+ var source = this;
+ comparer || (comparer = defaultComparer);
+ return new AnonymousObservable(function (o) {
+ var hasCurrentKey = false, currentKey;
+ return source.subscribe(function (value) {
+ var key = value;
+ if (keySelector) {
+ key = tryCatch(keySelector)(value);
+ if (key === errorObj) { return o.onError(key.e); }
+ }
+ if (hasCurrentKey) {
+ var comparerEquals = tryCatch(comparer)(currentKey, key);
+ if (comparerEquals === errorObj) { return o.onError(comparerEquals.e); }
+ }
+ if (!hasCurrentKey || !comparerEquals) {
+ hasCurrentKey = true;
+ currentKey = key;
+ o.onNext(value);
+ }
+ }, function (e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, this);
+ };
+
+ var TapObservable = (function(__super__) {
+ inherits(TapObservable,__super__);
+ function TapObservable(source, observerOrOnNext, onError, onCompleted) {
+ this.source = source;
+ this.t = !observerOrOnNext || isFunction(observerOrOnNext) ?
+ observerCreate(observerOrOnNext || noop, onError || noop, onCompleted || noop) :
+ observerOrOnNext;
+ __super__.call(this);
+ }
+
+ TapObservable.prototype.subscribeCore = function(o) {
+ return this.source.subscribe(new InnerObserver(o, this.t));
+ };
+
+ function InnerObserver(o, t) {
+ this.o = o;
+ this.t = t;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function(x) {
+ if (this.isStopped) { return; }
+ var res = tryCatch(this.t.onNext).call(this.t, x);
+ if (res === errorObj) { this.o.onError(res.e); }
+ this.o.onNext(x);
+ };
+ InnerObserver.prototype.onError = function(err) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ var res = tryCatch(this.t.onError).call(this.t, err);
+ if (res === errorObj) { return this.o.onError(res.e); }
+ this.o.onError(err);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function() {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ var res = tryCatch(this.t.onCompleted).call(this.t);
+ if (res === errorObj) { return this.o.onError(res.e); }
+ this.o.onCompleted();
+ }
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ return TapObservable;
+ }(ObservableBase));
+
+ /**
+ * Invokes an action for each element in the observable sequence and invokes an action upon graceful or exceptional termination of the observable sequence.
+ * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
+ * @param {Function | Observer} observerOrOnNext Action to invoke for each element in the observable sequence or an o.
+ * @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function.
+ * @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function.
+ * @returns {Observable} The source sequence with the side-effecting behavior applied.
+ */
+ observableProto['do'] = observableProto.tap = observableProto.doAction = function (observerOrOnNext, onError, onCompleted) {
+ return new TapObservable(this, observerOrOnNext, onError, onCompleted);
+ };
+
+ /**
+ * Invokes an action for each element in the observable sequence.
+ * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
+ * @param {Function} onNext Action to invoke for each element in the observable sequence.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} The source sequence with the side-effecting behavior applied.
+ */
+ observableProto.doOnNext = observableProto.tapOnNext = function (onNext, thisArg) {
+ return this.tap(typeof thisArg !== 'undefined' ? function (x) { onNext.call(thisArg, x); } : onNext);
+ };
+
+ /**
+ * Invokes an action upon exceptional termination of the observable sequence.
+ * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
+ * @param {Function} onError Action to invoke upon exceptional termination of the observable sequence.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} The source sequence with the side-effecting behavior applied.
+ */
+ observableProto.doOnError = observableProto.tapOnError = function (onError, thisArg) {
+ return this.tap(noop, typeof thisArg !== 'undefined' ? function (e) { onError.call(thisArg, e); } : onError);
+ };
+
+ /**
+ * Invokes an action upon graceful termination of the observable sequence.
+ * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
+ * @param {Function} onCompleted Action to invoke upon graceful termination of the observable sequence.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} The source sequence with the side-effecting behavior applied.
+ */
+ observableProto.doOnCompleted = observableProto.tapOnCompleted = function (onCompleted, thisArg) {
+ return this.tap(noop, null, typeof thisArg !== 'undefined' ? function () { onCompleted.call(thisArg); } : onCompleted);
+ };
+
+ /**
+ * Invokes a specified action after the source observable sequence terminates gracefully or exceptionally.
+ * @param {Function} finallyAction Action to invoke after the source observable sequence terminates.
+ * @returns {Observable} Source sequence with the action-invoking termination behavior applied.
+ */
+ observableProto['finally'] = observableProto.ensure = function (action) {
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ var subscription;
+ try {
+ subscription = source.subscribe(observer);
+ } catch (e) {
+ action();
+ throw e;
+ }
+ return disposableCreate(function () {
+ try {
+ subscription.dispose();
+ } catch (e) {
+ throw e;
+ } finally {
+ action();
+ }
+ });
+ }, this);
+ };
+
+ /**
+ * @deprecated use #finally or #ensure instead.
+ */
+ observableProto.finallyAction = function (action) {
+ //deprecate('finallyAction', 'finally or ensure');
+ return this.ensure(action);
+ };
+
+ var IgnoreElementsObservable = (function(__super__) {
+ inherits(IgnoreElementsObservable, __super__);
+
+ function IgnoreElementsObservable(source) {
+ this.source = source;
+ __super__.call(this);
+ }
+
+ IgnoreElementsObservable.prototype.subscribeCore = function (o) {
+ return this.source.subscribe(new InnerObserver(o));
+ };
+
+ function InnerObserver(o) {
+ this.o = o;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = noop;
+ InnerObserver.prototype.onError = function (err) {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(err);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ this.o.onCompleted();
+ }
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.observer.onError(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ return IgnoreElementsObservable;
+ }(ObservableBase));
+
+ /**
+ * Ignores all elements in an observable sequence leaving only the termination messages.
+ * @returns {Observable} An empty observable sequence that signals termination, successful or exceptional, of the source sequence.
+ */
+ observableProto.ignoreElements = function () {
+ return new IgnoreElementsObservable(this);
+ };
+
+ /**
+ * Materializes the implicit notifications of an observable sequence as explicit notification values.
+ * @returns {Observable} An observable sequence containing the materialized notification values from the source sequence.
+ */
+ observableProto.materialize = function () {
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ return source.subscribe(function (value) {
+ observer.onNext(notificationCreateOnNext(value));
+ }, function (e) {
+ observer.onNext(notificationCreateOnError(e));
+ observer.onCompleted();
+ }, function () {
+ observer.onNext(notificationCreateOnCompleted());
+ observer.onCompleted();
+ });
+ }, source);
+ };
+
+ /**
+ * Repeats the observable sequence a specified number of times. If the repeat count is not specified, the sequence repeats indefinitely.
+ * @param {Number} [repeatCount] Number of times to repeat the sequence. If not provided, repeats the sequence indefinitely.
+ * @returns {Observable} The observable sequence producing the elements of the given sequence repeatedly.
+ */
+ observableProto.repeat = function (repeatCount) {
+ return enumerableRepeat(this, repeatCount).concat();
+ };
+
+ /**
+ * Repeats the source observable sequence the specified number of times or until it successfully terminates. If the retry count is not specified, it retries indefinitely.
+ * Note if you encounter an error and want it to retry once, then you must use .retry(2);
+ *
+ * @example
+ * var res = retried = retry.repeat();
+ * var res = retried = retry.repeat(2);
+ * @param {Number} [retryCount] Number of times to retry the sequence. If not provided, retry the sequence indefinitely.
+ * @returns {Observable} An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully.
+ */
+ observableProto.retry = function (retryCount) {
+ return enumerableRepeat(this, retryCount).catchError();
+ };
+
+ /**
+ * Repeats the source observable sequence upon error each time the notifier emits or until it successfully terminates.
+ * if the notifier completes, the observable sequence completes.
+ *
+ * @example
+ * var timer = Observable.timer(500);
+ * var source = observable.retryWhen(timer);
+ * @param {Observable} [notifier] An observable that triggers the retries or completes the observable with onNext or onCompleted respectively.
+ * @returns {Observable} An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully.
+ */
+ observableProto.retryWhen = function (notifier) {
+ return enumerableRepeat(this).catchErrorWhen(notifier);
+ };
+ var ScanObservable = (function(__super__) {
+ inherits(ScanObservable, __super__);
+ function ScanObservable(source, accumulator, hasSeed, seed) {
+ this.source = source;
+ this.accumulator = accumulator;
+ this.hasSeed = hasSeed;
+ this.seed = seed;
+ __super__.call(this);
+ }
+
+ ScanObservable.prototype.subscribeCore = function(observer) {
+ return this.source.subscribe(new ScanObserver(observer,this));
+ };
+
+ return ScanObservable;
+ }(ObservableBase));
+
+ function ScanObserver(observer, parent) {
+ this.observer = observer;
+ this.accumulator = parent.accumulator;
+ this.hasSeed = parent.hasSeed;
+ this.seed = parent.seed;
+ this.hasAccumulation = false;
+ this.accumulation = null;
+ this.hasValue = false;
+ this.isStopped = false;
+ }
+ ScanObserver.prototype.onNext = function (x) {
+ if (this.isStopped) { return; }
+ !this.hasValue && (this.hasValue = true);
+ try {
+ if (this.hasAccumulation) {
+ this.accumulation = this.accumulator(this.accumulation, x);
+ } else {
+ this.accumulation = this.hasSeed ? this.accumulator(this.seed, x) : x;
+ this.hasAccumulation = true;
+ }
+ } catch (e) {
+ return this.observer.onError(e);
+ }
+ this.observer.onNext(this.accumulation);
+ };
+ ScanObserver.prototype.onError = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.observer.onError(e);
+ }
+ };
+ ScanObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ !this.hasValue && this.hasSeed && this.observer.onNext(this.seed);
+ this.observer.onCompleted();
+ }
+ };
+ ScanObserver.prototype.dispose = function() { this.isStopped = true; };
+ ScanObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.observer.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ /**
+ * Applies an accumulator function over an observable sequence and returns each intermediate result. The optional seed value is used as the initial accumulator value.
+ * For aggregation behavior with no intermediate results, see Observable.aggregate.
+ * @param {Mixed} [seed] The initial accumulator value.
+ * @param {Function} accumulator An accumulator function to be invoked on each element.
+ * @returns {Observable} An observable sequence containing the accumulated values.
+ */
+ observableProto.scan = function () {
+ var hasSeed = false, seed, accumulator, source = this;
+ if (arguments.length === 2) {
+ hasSeed = true;
+ seed = arguments[0];
+ accumulator = arguments[1];
+ } else {
+ accumulator = arguments[0];
+ }
+ return new ScanObservable(this, accumulator, hasSeed, seed);
+ };
+
+ /**
+ * Bypasses a specified number of elements at the end of an observable sequence.
+ * @description
+ * This operator accumulates a queue with a length enough to store the first `count` elements. As more elements are
+ * received, elements are taken from the front of the queue and produced on the result sequence. This causes elements to be delayed.
+ * @param count Number of elements to bypass at the end of the source sequence.
+ * @returns {Observable} An observable sequence containing the source sequence elements except for the bypassed ones at the end.
+ */
+ observableProto.skipLast = function (count) {
+ if (count < 0) { throw new ArgumentOutOfRangeError(); }
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var q = [];
+ return source.subscribe(function (x) {
+ q.push(x);
+ q.length > count && o.onNext(q.shift());
+ }, function (e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, source);
+ };
+
+ /**
+ * Prepends a sequence of values to an observable sequence with an optional scheduler and an argument list of values to prepend.
+ * @example
+ * var res = source.startWith(1, 2, 3);
+ * var res = source.startWith(Rx.Scheduler.timeout, 1, 2, 3);
+ * @param {Arguments} args The specified values to prepend to the observable sequence
+ * @returns {Observable} The source sequence prepended with the specified values.
+ */
+ observableProto.startWith = function () {
+ var values, scheduler, start = 0;
+ if (!!arguments.length && isScheduler(arguments[0])) {
+ scheduler = arguments[0];
+ start = 1;
+ } else {
+ scheduler = immediateScheduler;
+ }
+ for(var args = [], i = start, len = arguments.length; i < len; i++) { args.push(arguments[i]); }
+ return enumerableOf([observableFromArray(args, scheduler), this]).concat();
+ };
+
+ /**
+ * Returns a specified number of contiguous elements from the end of an observable sequence.
+ * @description
+ * This operator accumulates a buffer with a length enough to store elements count elements. Upon completion of
+ * the source sequence, this buffer is drained on the result sequence. This causes the elements to be delayed.
+ * @param {Number} count Number of elements to take from the end of the source sequence.
+ * @returns {Observable} An observable sequence containing the specified number of elements from the end of the source sequence.
+ */
+ observableProto.takeLast = function (count) {
+ if (count < 0) { throw new ArgumentOutOfRangeError(); }
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var q = [];
+ return source.subscribe(function (x) {
+ q.push(x);
+ q.length > count && q.shift();
+ }, function (e) { o.onError(e); }, function () {
+ while (q.length > 0) { o.onNext(q.shift()); }
+ o.onCompleted();
+ });
+ }, source);
+ };
+
+ /**
+ * Returns an array with the specified number of contiguous elements from the end of an observable sequence.
+ *
+ * @description
+ * This operator accumulates a buffer with a length enough to store count elements. Upon completion of the
+ * source sequence, this buffer is produced on the result sequence.
+ * @param {Number} count Number of elements to take from the end of the source sequence.
+ * @returns {Observable} An observable sequence containing a single array with the specified number of elements from the end of the source sequence.
+ */
+ observableProto.takeLastBuffer = function (count) {
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var q = [];
+ return source.subscribe(function (x) {
+ q.push(x);
+ q.length > count && q.shift();
+ }, function (e) { o.onError(e); }, function () {
+ o.onNext(q);
+ o.onCompleted();
+ });
+ }, source);
+ };
+
+ /**
+ * Projects each element of an observable sequence into zero or more windows which are produced based on element count information.
+ *
+ * var res = xs.windowWithCount(10);
+ * var res = xs.windowWithCount(10, 1);
+ * @param {Number} count Length of each window.
+ * @param {Number} [skip] Number of elements to skip between creation of consecutive windows. If not specified, defaults to the count.
+ * @returns {Observable} An observable sequence of windows.
+ */
+ observableProto.windowWithCount = function (count, skip) {
+ var source = this;
+ +count || (count = 0);
+ Math.abs(count) === Infinity && (count = 0);
+ if (count <= 0) { throw new ArgumentOutOfRangeError(); }
+ skip == null && (skip = count);
+ +skip || (skip = 0);
+ Math.abs(skip) === Infinity && (skip = 0);
+
+ if (skip <= 0) { throw new ArgumentOutOfRangeError(); }
+ return new AnonymousObservable(function (observer) {
+ var m = new SingleAssignmentDisposable(),
+ refCountDisposable = new RefCountDisposable(m),
+ n = 0,
+ q = [];
+
+ function createWindow () {
+ var s = new Subject();
+ q.push(s);
+ observer.onNext(addRef(s, refCountDisposable));
+ }
+
+ createWindow();
+
+ m.setDisposable(source.subscribe(
+ function (x) {
+ for (var i = 0, len = q.length; i < len; i++) { q[i].onNext(x); }
+ var c = n - count + 1;
+ c >= 0 && c % skip === 0 && q.shift().onCompleted();
+ ++n % skip === 0 && createWindow();
+ },
+ function (e) {
+ while (q.length > 0) { q.shift().onError(e); }
+ observer.onError(e);
+ },
+ function () {
+ while (q.length > 0) { q.shift().onCompleted(); }
+ observer.onCompleted();
+ }
+ ));
+ return refCountDisposable;
+ }, source);
+ };
+
+ function concatMap(source, selector, thisArg) {
+ var selectorFunc = bindCallback(selector, thisArg, 3);
+ return source.map(function (x, i) {
+ var result = selectorFunc(x, i, source);
+ isPromise(result) && (result = observableFromPromise(result));
+ (isArrayLike(result) || isIterable(result)) && (result = observableFrom(result));
+ return result;
+ }).concatAll();
+ }
+
+ /**
+ * One of the Following:
+ * Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
+ *
+ * @example
+ * var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); });
+ * Or:
+ * Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
+ *
+ * var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
+ * Or:
+ * Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
+ *
+ * var res = source.concatMap(Rx.Observable.fromArray([1,2,3]));
+ * @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the
+ * source sequence onto which could be either an observable or Promise.
+ * @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
+ * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
+ */
+ observableProto.selectConcat = observableProto.concatMap = function (selector, resultSelector, thisArg) {
+ if (isFunction(selector) && isFunction(resultSelector)) {
+ return this.concatMap(function (x, i) {
+ var selectorResult = selector(x, i);
+ isPromise(selectorResult) && (selectorResult = observableFromPromise(selectorResult));
+ (isArrayLike(selectorResult) || isIterable(selectorResult)) && (selectorResult = observableFrom(selectorResult));
+
+ return selectorResult.map(function (y, i2) {
+ return resultSelector(x, y, i, i2);
+ });
+ });
+ }
+ return isFunction(selector) ?
+ concatMap(this, selector, thisArg) :
+ concatMap(this, function () { return selector; });
+ };
+
+ /**
+ * Projects each notification of an observable sequence to an observable sequence and concats the resulting observable sequences into one observable sequence.
+ * @param {Function} onNext A transform function to apply to each element; the second parameter of the function represents the index of the source element.
+ * @param {Function} onError A transform function to apply when an error occurs in the source sequence.
+ * @param {Function} onCompleted A transform function to apply when the end of the source sequence is reached.
+ * @param {Any} [thisArg] An optional "this" to use to invoke each transform.
+ * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function corresponding to each notification in the input sequence.
+ */
+ observableProto.concatMapObserver = observableProto.selectConcatObserver = function(onNext, onError, onCompleted, thisArg) {
+ var source = this,
+ onNextFunc = bindCallback(onNext, thisArg, 2),
+ onErrorFunc = bindCallback(onError, thisArg, 1),
+ onCompletedFunc = bindCallback(onCompleted, thisArg, 0);
+ return new AnonymousObservable(function (observer) {
+ var index = 0;
+ return source.subscribe(
+ function (x) {
+ var result;
+ try {
+ result = onNextFunc(x, index++);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+ isPromise(result) && (result = observableFromPromise(result));
+ observer.onNext(result);
+ },
+ function (err) {
+ var result;
+ try {
+ result = onErrorFunc(err);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+ isPromise(result) && (result = observableFromPromise(result));
+ observer.onNext(result);
+ observer.onCompleted();
+ },
+ function () {
+ var result;
+ try {
+ result = onCompletedFunc();
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+ isPromise(result) && (result = observableFromPromise(result));
+ observer.onNext(result);
+ observer.onCompleted();
+ });
+ }, this).concatAll();
+ };
+
+ /**
+ * Returns the elements of the specified sequence or the specified value in a singleton sequence if the sequence is empty.
+ *
+ * var res = obs = xs.defaultIfEmpty();
+ * 2 - obs = xs.defaultIfEmpty(false);
+ *
+ * @memberOf Observable#
+ * @param defaultValue The value to return if the sequence is empty. If not provided, this defaults to null.
+ * @returns {Observable} An observable sequence that contains the specified default value if the source is empty; otherwise, the elements of the source itself.
+ */
+ observableProto.defaultIfEmpty = function (defaultValue) {
+ var source = this;
+ defaultValue === undefined && (defaultValue = null);
+ return new AnonymousObservable(function (observer) {
+ var found = false;
+ return source.subscribe(function (x) {
+ found = true;
+ observer.onNext(x);
+ },
+ function (e) { observer.onError(e); },
+ function () {
+ !found && observer.onNext(defaultValue);
+ observer.onCompleted();
+ });
+ }, source);
+ };
+
+ // Swap out for Array.findIndex
+ function arrayIndexOfComparer(array, item, comparer) {
+ for (var i = 0, len = array.length; i < len; i++) {
+ if (comparer(array[i], item)) { return i; }
+ }
+ return -1;
+ }
+
+ function HashSet(comparer) {
+ this.comparer = comparer;
+ this.set = [];
+ }
+ HashSet.prototype.push = function(value) {
+ var retValue = arrayIndexOfComparer(this.set, value, this.comparer) === -1;
+ retValue && this.set.push(value);
+ return retValue;
+ };
+
+ /**
+ * Returns an observable sequence that contains only distinct elements according to the keySelector and the comparer.
+ * Usage of this operator should be considered carefully due to the maintenance of an internal lookup structure which can grow large.
+ *
+ * @example
+ * var res = obs = xs.distinct();
+ * 2 - obs = xs.distinct(function (x) { return x.id; });
+ * 2 - obs = xs.distinct(function (x) { return x.id; }, function (a,b) { return a === b; });
+ * @param {Function} [keySelector] A function to compute the comparison key for each element.
+ * @param {Function} [comparer] Used to compare items in the collection.
+ * @returns {Observable} An observable sequence only containing the distinct elements, based on a computed key value, from the source sequence.
+ */
+ observableProto.distinct = function (keySelector, comparer) {
+ var source = this;
+ comparer || (comparer = defaultComparer);
+ return new AnonymousObservable(function (o) {
+ var hashSet = new HashSet(comparer);
+ return source.subscribe(function (x) {
+ var key = x;
+
+ if (keySelector) {
+ try {
+ key = keySelector(x);
+ } catch (e) {
+ o.onError(e);
+ return;
+ }
+ }
+ hashSet.push(key) && o.onNext(x);
+ },
+ function (e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, this);
+ };
+
+ /**
+ * Groups the elements of an observable sequence according to a specified key selector function and comparer and selects the resulting elements by using a specified function.
+ *
+ * @example
+ * var res = observable.groupBy(function (x) { return x.id; });
+ * 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; });
+ * 3 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function (x) { return x.toString(); });
+ * @param {Function} keySelector A function to extract the key for each element.
+ * @param {Function} [elementSelector] A function to map each source element to an element in an observable group.
+ * @param {Function} [comparer] Used to determine whether the objects are equal.
+ * @returns {Observable} A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value.
+ */
+ observableProto.groupBy = function (keySelector, elementSelector, comparer) {
+ return this.groupByUntil(keySelector, elementSelector, observableNever, comparer);
+ };
+
+ /**
+ * Groups the elements of an observable sequence according to a specified key selector function.
+ * A duration selector function is used to control the lifetime of groups. When a group expires, it receives an OnCompleted notification. When a new element with the same
+ * key value as a reclaimed group occurs, the group will be reborn with a new lifetime request.
+ *
+ * @example
+ * var res = observable.groupByUntil(function (x) { return x.id; }, null, function () { return Rx.Observable.never(); });
+ * 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function () { return Rx.Observable.never(); });
+ * 3 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function () { return Rx.Observable.never(); }, function (x) { return x.toString(); });
+ * @param {Function} keySelector A function to extract the key for each element.
+ * @param {Function} durationSelector A function to signal the expiration of a group.
+ * @param {Function} [comparer] Used to compare objects. When not specified, the default comparer is used.
+ * @returns {Observable}
+ * A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value.
+ * If a group's lifetime expires, a new group with the same key value can be created once an element with such a key value is encoutered.
+ *
+ */
+ observableProto.groupByUntil = function (keySelector, elementSelector, durationSelector, comparer) {
+ var source = this;
+ elementSelector || (elementSelector = identity);
+ comparer || (comparer = defaultComparer);
+ return new AnonymousObservable(function (observer) {
+ function handleError(e) { return function (item) { item.onError(e); }; }
+ var map = new Dictionary(0, comparer),
+ groupDisposable = new CompositeDisposable(),
+ refCountDisposable = new RefCountDisposable(groupDisposable);
+
+ groupDisposable.add(source.subscribe(function (x) {
+ var key;
+ try {
+ key = keySelector(x);
+ } catch (e) {
+ map.getValues().forEach(handleError(e));
+ observer.onError(e);
+ return;
+ }
+
+ var fireNewMapEntry = false,
+ writer = map.tryGetValue(key);
+ if (!writer) {
+ writer = new Subject();
+ map.set(key, writer);
+ fireNewMapEntry = true;
+ }
+
+ if (fireNewMapEntry) {
+ var group = new GroupedObservable(key, writer, refCountDisposable),
+ durationGroup = new GroupedObservable(key, writer);
+ try {
+ duration = durationSelector(durationGroup);
+ } catch (e) {
+ map.getValues().forEach(handleError(e));
+ observer.onError(e);
+ return;
+ }
+
+ observer.onNext(group);
+
+ var md = new SingleAssignmentDisposable();
+ groupDisposable.add(md);
+
+ var expire = function () {
+ map.remove(key) && writer.onCompleted();
+ groupDisposable.remove(md);
+ };
+
+ md.setDisposable(duration.take(1).subscribe(
+ noop,
+ function (exn) {
+ map.getValues().forEach(handleError(exn));
+ observer.onError(exn);
+ },
+ expire)
+ );
+ }
+
+ var element;
+ try {
+ element = elementSelector(x);
+ } catch (e) {
+ map.getValues().forEach(handleError(e));
+ observer.onError(e);
+ return;
+ }
+
+ writer.onNext(element);
+ }, function (ex) {
+ map.getValues().forEach(handleError(ex));
+ observer.onError(ex);
+ }, function () {
+ map.getValues().forEach(function (item) { item.onCompleted(); });
+ observer.onCompleted();
+ }));
+
+ return refCountDisposable;
+ }, source);
+ };
+
+ var MapObservable = (function (__super__) {
+ inherits(MapObservable, __super__);
+
+ function MapObservable(source, selector, thisArg) {
+ this.source = source;
+ this.selector = bindCallback(selector, thisArg, 3);
+ __super__.call(this);
+ }
+
+ function innerMap(selector, self) {
+ return function (x, i, o) { return selector.call(this, self.selector(x, i, o), i, o); }
+ }
+
+ MapObservable.prototype.internalMap = function (selector, thisArg) {
+ return new MapObservable(this.source, innerMap(selector, this), thisArg);
+ };
+
+ MapObservable.prototype.subscribeCore = function (o) {
+ return this.source.subscribe(new InnerObserver(o, this.selector, this));
+ };
+
+ function InnerObserver(o, selector, source) {
+ this.o = o;
+ this.selector = selector;
+ this.source = source;
+ this.i = 0;
+ this.isStopped = false;
+ }
+
+ InnerObserver.prototype.onNext = function(x) {
+ if (this.isStopped) { return; }
+ var result = tryCatch(this.selector)(x, this.i++, this.source);
+ if (result === errorObj) {
+ return this.o.onError(result.e);
+ }
+ this.o.onNext(result);
+ };
+ InnerObserver.prototype.onError = function (e) {
+ if(!this.isStopped) { this.isStopped = true; this.o.onError(e); }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if(!this.isStopped) { this.isStopped = true; this.o.onCompleted(); }
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ return MapObservable;
+
+ }(ObservableBase));
+
+ /**
+ * Projects each element of an observable sequence into a new form by incorporating the element's index.
+ * @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source.
+ */
+ observableProto.map = observableProto.select = function (selector, thisArg) {
+ var selectorFn = typeof selector === 'function' ? selector : function () { return selector; };
+ return this instanceof MapObservable ?
+ this.internalMap(selectorFn, thisArg) :
+ new MapObservable(this, selectorFn, thisArg);
+ };
+
+ /**
+ * Retrieves the value of a specified nested property from all elements in
+ * the Observable sequence.
+ * @param {Arguments} arguments The nested properties to pluck.
+ * @returns {Observable} Returns a new Observable sequence of property values.
+ */
+ observableProto.pluck = function () {
+ var args = arguments, len = arguments.length;
+ if (len === 0) { throw new Error('List of properties cannot be empty.'); }
+ return this.map(function (x) {
+ var currentProp = x;
+ for (var i = 0; i < len; i++) {
+ var p = currentProp[args[i]];
+ if (typeof p !== 'undefined') {
+ currentProp = p;
+ } else {
+ return undefined;
+ }
+ }
+ return currentProp;
+ });
+ };
+
+ function flatMap(source, selector, thisArg) {
+ var selectorFunc = bindCallback(selector, thisArg, 3);
+ return source.map(function (x, i) {
+ var result = selectorFunc(x, i, source);
+ isPromise(result) && (result = observableFromPromise(result));
+ (isArrayLike(result) || isIterable(result)) && (result = observableFrom(result));
+ return result;
+ }).mergeAll();
+ }
+
+ /**
+ * One of the Following:
+ * Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
+ *
+ * @example
+ * var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); });
+ * Or:
+ * Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
+ *
+ * var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
+ * Or:
+ * Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
+ *
+ * var res = source.selectMany(Rx.Observable.fromArray([1,2,3]));
+ * @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the source sequence onto which could be either an observable or Promise.
+ * @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
+ */
+ observableProto.selectMany = observableProto.flatMap = function (selector, resultSelector, thisArg) {
+ if (isFunction(selector) && isFunction(resultSelector)) {
+ return this.flatMap(function (x, i) {
+ var selectorResult = selector(x, i);
+ isPromise(selectorResult) && (selectorResult = observableFromPromise(selectorResult));
+ (isArrayLike(selectorResult) || isIterable(selectorResult)) && (selectorResult = observableFrom(selectorResult));
+
+ return selectorResult.map(function (y, i2) {
+ return resultSelector(x, y, i, i2);
+ });
+ }, thisArg);
+ }
+ return isFunction(selector) ?
+ flatMap(this, selector, thisArg) :
+ flatMap(this, function () { return selector; });
+ };
+
+ /**
+ * Projects each notification of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
+ * @param {Function} onNext A transform function to apply to each element; the second parameter of the function represents the index of the source element.
+ * @param {Function} onError A transform function to apply when an error occurs in the source sequence.
+ * @param {Function} onCompleted A transform function to apply when the end of the source sequence is reached.
+ * @param {Any} [thisArg] An optional "this" to use to invoke each transform.
+ * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function corresponding to each notification in the input sequence.
+ */
+ observableProto.flatMapObserver = observableProto.selectManyObserver = function (onNext, onError, onCompleted, thisArg) {
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ var index = 0;
+
+ return source.subscribe(
+ function (x) {
+ var result;
+ try {
+ result = onNext.call(thisArg, x, index++);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+ isPromise(result) && (result = observableFromPromise(result));
+ observer.onNext(result);
+ },
+ function (err) {
+ var result;
+ try {
+ result = onError.call(thisArg, err);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+ isPromise(result) && (result = observableFromPromise(result));
+ observer.onNext(result);
+ observer.onCompleted();
+ },
+ function () {
+ var result;
+ try {
+ result = onCompleted.call(thisArg);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+ isPromise(result) && (result = observableFromPromise(result));
+ observer.onNext(result);
+ observer.onCompleted();
+ });
+ }, source).mergeAll();
+ };
+
+ /**
+ * Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then
+ * transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
+ * @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences
+ * and that at any point in time produces the elements of the most recent inner observable sequence that has been received.
+ */
+ observableProto.selectSwitch = observableProto.flatMapLatest = observableProto.switchMap = function (selector, thisArg) {
+ return this.select(selector, thisArg).switchLatest();
+ };
+
+ var SkipObservable = (function(__super__) {
+ inherits(SkipObservable, __super__);
+ function SkipObservable(source, count) {
+ this.source = source;
+ this.skipCount = count;
+ __super__.call(this);
+ }
+
+ SkipObservable.prototype.subscribeCore = function (o) {
+ return this.source.subscribe(new InnerObserver(o, this.skipCount));
+ };
+
+ function InnerObserver(o, c) {
+ this.c = c;
+ this.r = c;
+ this.o = o;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) {
+ if (this.isStopped) { return; }
+ if (this.r <= 0) {
+ this.o.onNext(x);
+ } else {
+ this.r--;
+ }
+ };
+ InnerObserver.prototype.onError = function(e) {
+ if (!this.isStopped) { this.isStopped = true; this.o.onError(e); }
+ };
+ InnerObserver.prototype.onCompleted = function() {
+ if (!this.isStopped) { this.isStopped = true; this.o.onCompleted(); }
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function(e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ return SkipObservable;
+ }(ObservableBase));
+
+ /**
+ * Bypasses a specified number of elements in an observable sequence and then returns the remaining elements.
+ * @param {Number} count The number of elements to skip before returning the remaining elements.
+ * @returns {Observable} An observable sequence that contains the elements that occur after the specified index in the input sequence.
+ */
+ observableProto.skip = function (count) {
+ if (count < 0) { throw new ArgumentOutOfRangeError(); }
+ return new SkipObservable(this, count);
+ };
+ /**
+ * Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements.
+ * The element's index is used in the logic of the predicate function.
+ *
+ * var res = source.skipWhile(function (value) { return value < 10; });
+ * var res = source.skipWhile(function (value, index) { return value < 10 || index < 10; });
+ * @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate.
+ */
+ observableProto.skipWhile = function (predicate, thisArg) {
+ var source = this,
+ callback = bindCallback(predicate, thisArg, 3);
+ return new AnonymousObservable(function (o) {
+ var i = 0, running = false;
+ return source.subscribe(function (x) {
+ if (!running) {
+ try {
+ running = !callback(x, i++, source);
+ } catch (e) {
+ o.onError(e);
+ return;
+ }
+ }
+ running && o.onNext(x);
+ }, function (e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, source);
+ };
+
+ /**
+ * Returns a specified number of contiguous elements from the start of an observable sequence, using the specified scheduler for the edge case of take(0).
+ *
+ * var res = source.take(5);
+ * var res = source.take(0, Rx.Scheduler.timeout);
+ * @param {Number} count The number of elements to return.
+ * @param {Scheduler} [scheduler] Scheduler used to produce an OnCompleted message in case <paramref name="count count</paramref> is set to 0.
+ * @returns {Observable} An observable sequence that contains the specified number of elements from the start of the input sequence.
+ */
+ observableProto.take = function (count, scheduler) {
+ if (count < 0) { throw new ArgumentOutOfRangeError(); }
+ if (count === 0) { return observableEmpty(scheduler); }
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var remaining = count;
+ return source.subscribe(function (x) {
+ if (remaining-- > 0) {
+ o.onNext(x);
+ remaining <= 0 && o.onCompleted();
+ }
+ }, function (e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, source);
+ };
+
+ /**
+ * Returns elements from an observable sequence as long as a specified condition is true.
+ * The element's index is used in the logic of the predicate function.
+ * @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence that contains the elements from the input sequence that occur before the element at which the test no longer passes.
+ */
+ observableProto.takeWhile = function (predicate, thisArg) {
+ var source = this,
+ callback = bindCallback(predicate, thisArg, 3);
+ return new AnonymousObservable(function (o) {
+ var i = 0, running = true;
+ return source.subscribe(function (x) {
+ if (running) {
+ try {
+ running = callback(x, i++, source);
+ } catch (e) {
+ o.onError(e);
+ return;
+ }
+ if (running) {
+ o.onNext(x);
+ } else {
+ o.onCompleted();
+ }
+ }
+ }, function (e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, source);
+ };
+
+ var FilterObservable = (function (__super__) {
+ inherits(FilterObservable, __super__);
+
+ function FilterObservable(source, predicate, thisArg) {
+ this.source = source;
+ this.predicate = bindCallback(predicate, thisArg, 3);
+ __super__.call(this);
+ }
+
+ FilterObservable.prototype.subscribeCore = function (o) {
+ return this.source.subscribe(new InnerObserver(o, this.predicate, this));
+ };
+
+ function innerPredicate(predicate, self) {
+ return function(x, i, o) { return self.predicate(x, i, o) && predicate.call(this, x, i, o); }
+ }
+
+ FilterObservable.prototype.internalFilter = function(predicate, thisArg) {
+ return new FilterObservable(this.source, innerPredicate(predicate, this), thisArg);
+ };
+
+ function InnerObserver(o, predicate, source) {
+ this.o = o;
+ this.predicate = predicate;
+ this.source = source;
+ this.i = 0;
+ this.isStopped = false;
+ }
+
+ InnerObserver.prototype.onNext = function(x) {
+ if (this.isStopped) { return; }
+ var shouldYield = tryCatch(this.predicate)(x, this.i++, this.source);
+ if (shouldYield === errorObj) {
+ return this.o.onError(shouldYield.e);
+ }
+ shouldYield && this.o.onNext(x);
+ };
+ InnerObserver.prototype.onError = function (e) {
+ if(!this.isStopped) { this.isStopped = true; this.o.onError(e); }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if(!this.isStopped) { this.isStopped = true; this.o.onCompleted(); }
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ return FilterObservable;
+
+ }(ObservableBase));
+
+ /**
+ * Filters the elements of an observable sequence based on a predicate by incorporating the element's index.
+ * @param {Function} predicate A function to test each source element for a condition; the second parameter of the function represents the index of the source element.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence that contains elements from the input sequence that satisfy the condition.
+ */
+ observableProto.filter = observableProto.where = function (predicate, thisArg) {
+ return this instanceof FilterObservable ? this.internalFilter(predicate, thisArg) :
+ new FilterObservable(this, predicate, thisArg);
+ };
+
+ function extremaBy(source, keySelector, comparer) {
+ return new AnonymousObservable(function (o) {
+ var hasValue = false, lastKey = null, list = [];
+ return source.subscribe(function (x) {
+ var comparison, key;
+ try {
+ key = keySelector(x);
+ } catch (ex) {
+ o.onError(ex);
+ return;
+ }
+ comparison = 0;
+ if (!hasValue) {
+ hasValue = true;
+ lastKey = key;
+ } else {
+ try {
+ comparison = comparer(key, lastKey);
+ } catch (ex1) {
+ o.onError(ex1);
+ return;
+ }
+ }
+ if (comparison > 0) {
+ lastKey = key;
+ list = [];
+ }
+ if (comparison >= 0) { list.push(x); }
+ }, function (e) { o.onError(e); }, function () {
+ o.onNext(list);
+ o.onCompleted();
+ });
+ }, source);
+ }
+
+ function firstOnly(x) {
+ if (x.length === 0) { throw new EmptyError(); }
+ return x[0];
+ }
+
+ /**
+ * Applies an accumulator function over an observable sequence, returning the result of the aggregation as a single element in the result sequence. The specified seed value is used as the initial accumulator value.
+ * For aggregation behavior with incremental intermediate results, see Observable.scan.
+ * @deprecated Use #reduce instead
+ * @param {Mixed} [seed] The initial accumulator value.
+ * @param {Function} accumulator An accumulator function to be invoked on each element.
+ * @returns {Observable} An observable sequence containing a single element with the final accumulator value.
+ */
+ observableProto.aggregate = function () {
+ var hasSeed = false, accumulator, seed, source = this;
+ if (arguments.length === 2) {
+ hasSeed = true;
+ seed = arguments[0];
+ accumulator = arguments[1];
+ } else {
+ accumulator = arguments[0];
+ }
+ return new AnonymousObservable(function (o) {
+ var hasAccumulation, accumulation, hasValue;
+ return source.subscribe (
+ function (x) {
+ !hasValue && (hasValue = true);
+ try {
+ if (hasAccumulation) {
+ accumulation = accumulator(accumulation, x);
+ } else {
+ accumulation = hasSeed ? accumulator(seed, x) : x;
+ hasAccumulation = true;
+ }
+ } catch (e) {
+ return o.onError(e);
+ }
+ },
+ function (e) { o.onError(e); },
+ function () {
+ hasValue && o.onNext(accumulation);
+ !hasValue && hasSeed && o.onNext(seed);
+ !hasValue && !hasSeed && o.onError(new EmptyError());
+ o.onCompleted();
+ }
+ );
+ }, source);
+ };
+
+ var ReduceObservable = (function(__super__) {
+ inherits(ReduceObservable, __super__);
+ function ReduceObservable(source, acc, hasSeed, seed) {
+ this.source = source;
+ this.acc = acc;
+ this.hasSeed = hasSeed;
+ this.seed = seed;
+ __super__.call(this);
+ }
+
+ ReduceObservable.prototype.subscribeCore = function(observer) {
+ return this.source.subscribe(new InnerObserver(observer,this));
+ };
+
+ function InnerObserver(o, parent) {
+ this.o = o;
+ this.acc = parent.acc;
+ this.hasSeed = parent.hasSeed;
+ this.seed = parent.seed;
+ this.hasAccumulation = false;
+ this.result = null;
+ this.hasValue = false;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) {
+ if (this.isStopped) { return; }
+ !this.hasValue && (this.hasValue = true);
+ if (this.hasAccumulation) {
+ this.result = tryCatch(this.acc)(this.result, x);
+ } else {
+ this.result = this.hasSeed ? tryCatch(this.acc)(this.seed, x) : x;
+ this.hasAccumulation = true;
+ }
+ if (this.result === errorObj) { this.o.onError(this.result.e); }
+ };
+ InnerObserver.prototype.onError = function (e) {
+ if (!this.isStopped) { this.isStopped = true; this.o.onError(e); }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.hasValue && this.o.onNext(this.result);
+ !this.hasValue && this.hasSeed && this.o.onNext(this.seed);
+ !this.hasValue && !this.hasSeed && this.o.onError(new EmptyError());
+ this.o.onCompleted();
+ }
+ };
+ InnerObserver.prototype.dispose = function () { this.isStopped = true; };
+ InnerObserver.prototype.fail = function(e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ return ReduceObservable;
+ }(ObservableBase));
+
+ /**
+ * Applies an accumulator function over an observable sequence, returning the result of the aggregation as a single element in the result sequence. The specified seed value is used as the initial accumulator value.
+ * For aggregation behavior with incremental intermediate results, see Observable.scan.
+ * @param {Function} accumulator An accumulator function to be invoked on each element.
+ * @param {Any} [seed] The initial accumulator value.
+ * @returns {Observable} An observable sequence containing a single element with the final accumulator value.
+ */
+ observableProto.reduce = function (accumulator) {
+ var hasSeed = false;
+ if (arguments.length === 2) {
+ hasSeed = true;
+ var seed = arguments[1];
+ }
+ return new ReduceObservable(this, accumulator, hasSeed, seed);
+ };
+
+ /**
+ * Determines whether any element of an observable sequence satisfies a condition if present, else if any items are in the sequence.
+ * @param {Function} [predicate] A function to test each element for a condition.
+ * @returns {Observable} An observable sequence containing a single element determining whether any elements in the source sequence pass the test in the specified predicate if given, else if any items are in the sequence.
+ */
+ observableProto.some = function (predicate, thisArg) {
+ var source = this;
+ return predicate ?
+ source.filter(predicate, thisArg).some() :
+ new AnonymousObservable(function (observer) {
+ return source.subscribe(function () {
+ observer.onNext(true);
+ observer.onCompleted();
+ }, function (e) { observer.onError(e); }, function () {
+ observer.onNext(false);
+ observer.onCompleted();
+ });
+ }, source);
+ };
+
+ /** @deprecated use #some instead */
+ observableProto.any = function () {
+ //deprecate('any', 'some');
+ return this.some.apply(this, arguments);
+ };
+
+ /**
+ * Determines whether an observable sequence is empty.
+ * @returns {Observable} An observable sequence containing a single element determining whether the source sequence is empty.
+ */
+ observableProto.isEmpty = function () {
+ return this.any().map(not);
+ };
+
+ /**
+ * Determines whether all elements of an observable sequence satisfy a condition.
+ * @param {Function} [predicate] A function to test each element for a condition.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence containing a single element determining whether all elements in the source sequence pass the test in the specified predicate.
+ */
+ observableProto.every = function (predicate, thisArg) {
+ return this.filter(function (v) { return !predicate(v); }, thisArg).some().map(not);
+ };
+
+ /** @deprecated use #every instead */
+ observableProto.all = function () {
+ //deprecate('all', 'every');
+ return this.every.apply(this, arguments);
+ };
+
+ /**
+ * Determines whether an observable sequence includes a specified element with an optional equality comparer.
+ * @param searchElement The value to locate in the source sequence.
+ * @param {Number} [fromIndex] An equality comparer to compare elements.
+ * @returns {Observable} An observable sequence containing a single element determining whether the source sequence includes an element that has the specified value from the given index.
+ */
+ observableProto.includes = function (searchElement, fromIndex) {
+ var source = this;
+ function comparer(a, b) {
+ return (a === 0 && b === 0) || (a === b || (isNaN(a) && isNaN(b)));
+ }
+ return new AnonymousObservable(function (o) {
+ var i = 0, n = +fromIndex || 0;
+ Math.abs(n) === Infinity && (n = 0);
+ if (n < 0) {
+ o.onNext(false);
+ o.onCompleted();
+ return disposableEmpty;
+ }
+ return source.subscribe(
+ function (x) {
+ if (i++ >= n && comparer(x, searchElement)) {
+ o.onNext(true);
+ o.onCompleted();
+ }
+ },
+ function (e) { o.onError(e); },
+ function () {
+ o.onNext(false);
+ o.onCompleted();
+ });
+ }, this);
+ };
+
+ /**
+ * @deprecated use #includes instead.
+ */
+ observableProto.contains = function (searchElement, fromIndex) {
+ //deprecate('contains', 'includes');
+ observableProto.includes(searchElement, fromIndex);
+ };
+
+ /**
+ * Returns an observable sequence containing a value that represents how many elements in the specified observable sequence satisfy a condition if provided, else the count of items.
+ * @example
+ * res = source.count();
+ * res = source.count(function (x) { return x > 3; });
+ * @param {Function} [predicate]A function to test each element for a condition.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence containing a single element with a number that represents how many elements in the input sequence satisfy the condition in the predicate function if provided, else the count of items in the sequence.
+ */
+ observableProto.count = function (predicate, thisArg) {
+ return predicate ?
+ this.filter(predicate, thisArg).count() :
+ this.reduce(function (count) { return count + 1; }, 0);
+ };
+
+ /**
+ * Returns the first index at which a given element can be found in the observable sequence, or -1 if it is not present.
+ * @param {Any} searchElement Element to locate in the array.
+ * @param {Number} [fromIndex] The index to start the search. If not specified, defaults to 0.
+ * @returns {Observable} And observable sequence containing the first index at which a given element can be found in the observable sequence, or -1 if it is not present.
+ */
+ observableProto.indexOf = function(searchElement, fromIndex) {
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var i = 0, n = +fromIndex || 0;
+ Math.abs(n) === Infinity && (n = 0);
+ if (n < 0) {
+ o.onNext(-1);
+ o.onCompleted();
+ return disposableEmpty;
+ }
+ return source.subscribe(
+ function (x) {
+ if (i >= n && x === searchElement) {
+ o.onNext(i);
+ o.onCompleted();
+ }
+ i++;
+ },
+ function (e) { o.onError(e); },
+ function () {
+ o.onNext(-1);
+ o.onCompleted();
+ });
+ }, source);
+ };
+
+ /**
+ * Computes the sum of a sequence of values that are obtained by invoking an optional transform function on each element of the input sequence, else if not specified computes the sum on each item in the sequence.
+ * @param {Function} [selector] A transform function to apply to each element.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence containing a single element with the sum of the values in the source sequence.
+ */
+ observableProto.sum = function (keySelector, thisArg) {
+ return keySelector && isFunction(keySelector) ?
+ this.map(keySelector, thisArg).sum() :
+ this.reduce(function (prev, curr) { return prev + curr; }, 0);
+ };
+
+ /**
+ * Returns the elements in an observable sequence with the minimum key value according to the specified comparer.
+ * @example
+ * var res = source.minBy(function (x) { return x.value; });
+ * var res = source.minBy(function (x) { return x.value; }, function (x, y) { return x - y; });
+ * @param {Function} keySelector Key selector function.
+ * @param {Function} [comparer] Comparer used to compare key values.
+ * @returns {Observable} An observable sequence containing a list of zero or more elements that have a minimum key value.
+ */
+ observableProto.minBy = function (keySelector, comparer) {
+ comparer || (comparer = defaultSubComparer);
+ return extremaBy(this, keySelector, function (x, y) { return comparer(x, y) * -1; });
+ };
+
+ /**
+ * Returns the minimum element in an observable sequence according to the optional comparer else a default greater than less than check.
+ * @example
+ * var res = source.min();
+ * var res = source.min(function (x, y) { return x.value - y.value; });
+ * @param {Function} [comparer] Comparer used to compare elements.
+ * @returns {Observable} An observable sequence containing a single element with the minimum element in the source sequence.
+ */
+ observableProto.min = function (comparer) {
+ return this.minBy(identity, comparer).map(function (x) { return firstOnly(x); });
+ };
+
+ /**
+ * Returns the elements in an observable sequence with the maximum key value according to the specified comparer.
+ * @example
+ * var res = source.maxBy(function (x) { return x.value; });
+ * var res = source.maxBy(function (x) { return x.value; }, function (x, y) { return x - y;; });
+ * @param {Function} keySelector Key selector function.
+ * @param {Function} [comparer] Comparer used to compare key values.
+ * @returns {Observable} An observable sequence containing a list of zero or more elements that have a maximum key value.
+ */
+ observableProto.maxBy = function (keySelector, comparer) {
+ comparer || (comparer = defaultSubComparer);
+ return extremaBy(this, keySelector, comparer);
+ };
+
+ /**
+ * Returns the maximum value in an observable sequence according to the specified comparer.
+ * @example
+ * var res = source.max();
+ * var res = source.max(function (x, y) { return x.value - y.value; });
+ * @param {Function} [comparer] Comparer used to compare elements.
+ * @returns {Observable} An observable sequence containing a single element with the maximum element in the source sequence.
+ */
+ observableProto.max = function (comparer) {
+ return this.maxBy(identity, comparer).map(function (x) { return firstOnly(x); });
+ };
+
+ /**
+ * Computes the average of an observable sequence of values that are in the sequence or obtained by invoking a transform function on each element of the input sequence if present.
+ * @param {Function} [selector] A transform function to apply to each element.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence containing a single element with the average of the sequence of values.
+ */
+ observableProto.average = function (keySelector, thisArg) {
+ return keySelector && isFunction(keySelector) ?
+ this.map(keySelector, thisArg).average() :
+ this.reduce(function (prev, cur) {
+ return {
+ sum: prev.sum + cur,
+ count: prev.count + 1
+ };
+ }, {sum: 0, count: 0 }).map(function (s) {
+ if (s.count === 0) { throw new EmptyError(); }
+ return s.sum / s.count;
+ });
+ };
+
+ /**
+ * Determines whether two sequences are equal by comparing the elements pairwise using a specified equality comparer.
+ *
+ * @example
+ * var res = res = source.sequenceEqual([1,2,3]);
+ * var res = res = source.sequenceEqual([{ value: 42 }], function (x, y) { return x.value === y.value; });
+ * 3 - res = source.sequenceEqual(Rx.Observable.returnValue(42));
+ * 4 - res = source.sequenceEqual(Rx.Observable.returnValue({ value: 42 }), function (x, y) { return x.value === y.value; });
+ * @param {Observable} second Second observable sequence or array to compare.
+ * @param {Function} [comparer] Comparer used to compare elements of both sequences.
+ * @returns {Observable} An observable sequence that contains a single element which indicates whether both sequences are of equal length and their corresponding elements are equal according to the specified equality comparer.
+ */
+ observableProto.sequenceEqual = function (second, comparer) {
+ var first = this;
+ comparer || (comparer = defaultComparer);
+ return new AnonymousObservable(function (o) {
+ var donel = false, doner = false, ql = [], qr = [];
+ var subscription1 = first.subscribe(function (x) {
+ var equal, v;
+ if (qr.length > 0) {
+ v = qr.shift();
+ try {
+ equal = comparer(v, x);
+ } catch (e) {
+ o.onError(e);
+ return;
+ }
+ if (!equal) {
+ o.onNext(false);
+ o.onCompleted();
+ }
+ } else if (doner) {
+ o.onNext(false);
+ o.onCompleted();
+ } else {
+ ql.push(x);
+ }
+ }, function(e) { o.onError(e); }, function () {
+ donel = true;
+ if (ql.length === 0) {
+ if (qr.length > 0) {
+ o.onNext(false);
+ o.onCompleted();
+ } else if (doner) {
+ o.onNext(true);
+ o.onCompleted();
+ }
+ }
+ });
+
+ (isArrayLike(second) || isIterable(second)) && (second = observableFrom(second));
+ isPromise(second) && (second = observableFromPromise(second));
+ var subscription2 = second.subscribe(function (x) {
+ var equal;
+ if (ql.length > 0) {
+ var v = ql.shift();
+ try {
+ equal = comparer(v, x);
+ } catch (exception) {
+ o.onError(exception);
+ return;
+ }
+ if (!equal) {
+ o.onNext(false);
+ o.onCompleted();
+ }
+ } else if (donel) {
+ o.onNext(false);
+ o.onCompleted();
+ } else {
+ qr.push(x);
+ }
+ }, function(e) { o.onError(e); }, function () {
+ doner = true;
+ if (qr.length === 0) {
+ if (ql.length > 0) {
+ o.onNext(false);
+ o.onCompleted();
+ } else if (donel) {
+ o.onNext(true);
+ o.onCompleted();
+ }
+ }
+ });
+ return new CompositeDisposable(subscription1, subscription2);
+ }, first);
+ };
+
+ function elementAtOrDefault(source, index, hasDefault, defaultValue) {
+ if (index < 0) { throw new ArgumentOutOfRangeError(); }
+ return new AnonymousObservable(function (o) {
+ var i = index;
+ return source.subscribe(function (x) {
+ if (i-- === 0) {
+ o.onNext(x);
+ o.onCompleted();
+ }
+ }, function (e) { o.onError(e); }, function () {
+ if (!hasDefault) {
+ o.onError(new ArgumentOutOfRangeError());
+ } else {
+ o.onNext(defaultValue);
+ o.onCompleted();
+ }
+ });
+ }, source);
+ }
+
+ /**
+ * Returns the element at a specified index in a sequence.
+ * @example
+ * var res = source.elementAt(5);
+ * @param {Number} index The zero-based index of the element to retrieve.
+ * @returns {Observable} An observable sequence that produces the element at the specified position in the source sequence.
+ */
+ observableProto.elementAt = function (index) {
+ return elementAtOrDefault(this, index, false);
+ };
+
+ /**
+ * Returns the element at a specified index in a sequence or a default value if the index is out of range.
+ * @example
+ * var res = source.elementAtOrDefault(5);
+ * var res = source.elementAtOrDefault(5, 0);
+ * @param {Number} index The zero-based index of the element to retrieve.
+ * @param [defaultValue] The default value if the index is outside the bounds of the source sequence.
+ * @returns {Observable} An observable sequence that produces the element at the specified position in the source sequence, or a default value if the index is outside the bounds of the source sequence.
+ */
+ observableProto.elementAtOrDefault = function (index, defaultValue) {
+ return elementAtOrDefault(this, index, true, defaultValue);
+ };
+
+ function singleOrDefaultAsync(source, hasDefault, defaultValue) {
+ return new AnonymousObservable(function (o) {
+ var value = defaultValue, seenValue = false;
+ return source.subscribe(function (x) {
+ if (seenValue) {
+ o.onError(new Error('Sequence contains more than one element'));
+ } else {
+ value = x;
+ seenValue = true;
+ }
+ }, function (e) { o.onError(e); }, function () {
+ if (!seenValue && !hasDefault) {
+ o.onError(new EmptyError());
+ } else {
+ o.onNext(value);
+ o.onCompleted();
+ }
+ });
+ }, source);
+ }
+
+ /**
+ * Returns the only element of an observable sequence that satisfies the condition in the optional predicate, and reports an exception if there is not exactly one element in the observable sequence.
+ * @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence.
+ * @param {Any} [thisArg] Object to use as `this` when executing the predicate.
+ * @returns {Observable} Sequence containing the single element in the observable sequence that satisfies the condition in the predicate.
+ */
+ observableProto.single = function (predicate, thisArg) {
+ return predicate && isFunction(predicate) ?
+ this.where(predicate, thisArg).single() :
+ singleOrDefaultAsync(this, false);
+ };
+
+ /**
+ * Returns the only element of an observable sequence that matches the predicate, or a default value if no such element exists; this method reports an exception if there is more than one element in the observable sequence.
+ * @example
+ * var res = res = source.singleOrDefault();
+ * var res = res = source.singleOrDefault(function (x) { return x === 42; });
+ * res = source.singleOrDefault(function (x) { return x === 42; }, 0);
+ * res = source.singleOrDefault(null, 0);
+ * @memberOf Observable#
+ * @param {Function} predicate A predicate function to evaluate for elements in the source sequence.
+ * @param [defaultValue] The default value if the index is outside the bounds of the source sequence.
+ * @param {Any} [thisArg] Object to use as `this` when executing the predicate.
+ * @returns {Observable} Sequence containing the single element in the observable sequence that satisfies the condition in the predicate, or a default value if no such element exists.
+ */
+ observableProto.singleOrDefault = function (predicate, defaultValue, thisArg) {
+ return predicate && isFunction(predicate) ?
+ this.filter(predicate, thisArg).singleOrDefault(null, defaultValue) :
+ singleOrDefaultAsync(this, true, defaultValue);
+ };
+
+ function firstOrDefaultAsync(source, hasDefault, defaultValue) {
+ return new AnonymousObservable(function (o) {
+ return source.subscribe(function (x) {
+ o.onNext(x);
+ o.onCompleted();
+ }, function (e) { o.onError(e); }, function () {
+ if (!hasDefault) {
+ o.onError(new EmptyError());
+ } else {
+ o.onNext(defaultValue);
+ o.onCompleted();
+ }
+ });
+ }, source);
+ }
+
+ /**
+ * Returns the first element of an observable sequence that satisfies the condition in the predicate if present else the first item in the sequence.
+ * @example
+ * var res = res = source.first();
+ * var res = res = source.first(function (x) { return x > 3; });
+ * @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence.
+ * @param {Any} [thisArg] Object to use as `this` when executing the predicate.
+ * @returns {Observable} Sequence containing the first element in the observable sequence that satisfies the condition in the predicate if provided, else the first item in the sequence.
+ */
+ observableProto.first = function (predicate, thisArg) {
+ return predicate ?
+ this.where(predicate, thisArg).first() :
+ firstOrDefaultAsync(this, false);
+ };
+
+ /**
+ * Returns the first element of an observable sequence that satisfies the condition in the predicate, or a default value if no such element exists.
+ * @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence.
+ * @param {Any} [defaultValue] The default value if no such element exists. If not specified, defaults to null.
+ * @param {Any} [thisArg] Object to use as `this` when executing the predicate.
+ * @returns {Observable} Sequence containing the first element in the observable sequence that satisfies the condition in the predicate, or a default value if no such element exists.
+ */
+ observableProto.firstOrDefault = function (predicate, defaultValue, thisArg) {
+ return predicate ?
+ this.where(predicate).firstOrDefault(null, defaultValue) :
+ firstOrDefaultAsync(this, true, defaultValue);
+ };
+
+ function lastOrDefaultAsync(source, hasDefault, defaultValue) {
+ return new AnonymousObservable(function (o) {
+ var value = defaultValue, seenValue = false;
+ return source.subscribe(function (x) {
+ value = x;
+ seenValue = true;
+ }, function (e) { o.onError(e); }, function () {
+ if (!seenValue && !hasDefault) {
+ o.onError(new EmptyError());
+ } else {
+ o.onNext(value);
+ o.onCompleted();
+ }
+ });
+ }, source);
+ }
+
+ /**
+ * Returns the last element of an observable sequence that satisfies the condition in the predicate if specified, else the last element.
+ * @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence.
+ * @param {Any} [thisArg] Object to use as `this` when executing the predicate.
+ * @returns {Observable} Sequence containing the last element in the observable sequence that satisfies the condition in the predicate.
+ */
+ observableProto.last = function (predicate, thisArg) {
+ return predicate ?
+ this.where(predicate, thisArg).last() :
+ lastOrDefaultAsync(this, false);
+ };
+
+ /**
+ * Returns the last element of an observable sequence that satisfies the condition in the predicate, or a default value if no such element exists.
+ * @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence.
+ * @param [defaultValue] The default value if no such element exists. If not specified, defaults to null.
+ * @param {Any} [thisArg] Object to use as `this` when executing the predicate.
+ * @returns {Observable} Sequence containing the last element in the observable sequence that satisfies the condition in the predicate, or a default value if no such element exists.
+ */
+ observableProto.lastOrDefault = function (predicate, defaultValue, thisArg) {
+ return predicate ?
+ this.where(predicate, thisArg).lastOrDefault(null, defaultValue) :
+ lastOrDefaultAsync(this, true, defaultValue);
+ };
+
+ function findValue (source, predicate, thisArg, yieldIndex) {
+ var callback = bindCallback(predicate, thisArg, 3);
+ return new AnonymousObservable(function (o) {
+ var i = 0;
+ return source.subscribe(function (x) {
+ var shouldRun;
+ try {
+ shouldRun = callback(x, i, source);
+ } catch (e) {
+ o.onError(e);
+ return;
+ }
+ if (shouldRun) {
+ o.onNext(yieldIndex ? i : x);
+ o.onCompleted();
+ } else {
+ i++;
+ }
+ }, function (e) { o.onError(e); }, function () {
+ o.onNext(yieldIndex ? -1 : undefined);
+ o.onCompleted();
+ });
+ }, source);
+ }
+
+ /**
+ * Searches for an element that matches the conditions defined by the specified predicate, and returns the first occurrence within the entire Observable sequence.
+ * @param {Function} predicate The predicate that defines the conditions of the element to search for.
+ * @param {Any} [thisArg] Object to use as `this` when executing the predicate.
+ * @returns {Observable} An Observable sequence with the first element that matches the conditions defined by the specified predicate, if found; otherwise, undefined.
+ */
+ observableProto.find = function (predicate, thisArg) {
+ return findValue(this, predicate, thisArg, false);
+ };
+
+ /**
+ * Searches for an element that matches the conditions defined by the specified predicate, and returns
+ * an Observable sequence with the zero-based index of the first occurrence within the entire Observable sequence.
+ * @param {Function} predicate The predicate that defines the conditions of the element to search for.
+ * @param {Any} [thisArg] Object to use as `this` when executing the predicate.
+ * @returns {Observable} An Observable sequence with the zero-based index of the first occurrence of an element that matches the conditions defined by match, if found; otherwise, –1.
+ */
+ observableProto.findIndex = function (predicate, thisArg) {
+ return findValue(this, predicate, thisArg, true);
+ };
+
+ /**
+ * Converts the observable sequence to a Set if it exists.
+ * @returns {Observable} An observable sequence with a single value of a Set containing the values from the observable sequence.
+ */
+ observableProto.toSet = function () {
+ if (typeof root.Set === 'undefined') { throw new TypeError(); }
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var s = new root.Set();
+ return source.subscribe(
+ function (x) { s.add(x); },
+ function (e) { o.onError(e); },
+ function () {
+ o.onNext(s);
+ o.onCompleted();
+ });
+ }, source);
+ };
+
+ /**
+ * Converts the observable sequence to a Map if it exists.
+ * @param {Function} keySelector A function which produces the key for the Map.
+ * @param {Function} [elementSelector] An optional function which produces the element for the Map. If not present, defaults to the value from the observable sequence.
+ * @returns {Observable} An observable sequence with a single value of a Map containing the values from the observable sequence.
+ */
+ observableProto.toMap = function (keySelector, elementSelector) {
+ if (typeof root.Map === 'undefined') { throw new TypeError(); }
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var m = new root.Map();
+ return source.subscribe(
+ function (x) {
+ var key;
+ try {
+ key = keySelector(x);
+ } catch (e) {
+ o.onError(e);
+ return;
+ }
+
+ var element = x;
+ if (elementSelector) {
+ try {
+ element = elementSelector(x);
+ } catch (e) {
+ o.onError(e);
+ return;
+ }
+ }
+
+ m.set(key, element);
+ },
+ function (e) { o.onError(e); },
+ function () {
+ o.onNext(m);
+ o.onCompleted();
+ });
+ }, source);
+ };
+
+ var fnString = 'function',
+ throwString = 'throw',
+ isObject = Rx.internals.isObject;
+
+ function toThunk(obj, ctx) {
+ if (Array.isArray(obj)) { return objectToThunk.call(ctx, obj); }
+ if (isGeneratorFunction(obj)) { return observableSpawn(obj.call(ctx)); }
+ if (isGenerator(obj)) { return observableSpawn(obj); }
+ if (isObservable(obj)) { return observableToThunk(obj); }
+ if (isPromise(obj)) { return promiseToThunk(obj); }
+ if (typeof obj === fnString) { return obj; }
+ if (isObject(obj) || Array.isArray(obj)) { return objectToThunk.call(ctx, obj); }
+
+ return obj;
+ }
+
+ function objectToThunk(obj) {
+ var ctx = this;
+
+ return function (done) {
+ var keys = Object.keys(obj),
+ pending = keys.length,
+ results = new obj.constructor(),
+ finished;
+
+ if (!pending) {
+ timeoutScheduler.schedule(function () { done(null, results); });
+ return;
+ }
+
+ for (var i = 0, len = keys.length; i < len; i++) {
+ run(obj[keys[i]], keys[i]);
+ }
+
+ function run(fn, key) {
+ if (finished) { return; }
+ try {
+ fn = toThunk(fn, ctx);
+
+ if (typeof fn !== fnString) {
+ results[key] = fn;
+ return --pending || done(null, results);
+ }
+
+ fn.call(ctx, function(err, res) {
+ if (finished) { return; }
+
+ if (err) {
+ finished = true;
+ return done(err);
+ }
+
+ results[key] = res;
+ --pending || done(null, results);
+ });
+ } catch (e) {
+ finished = true;
+ done(e);
+ }
+ }
+ }
+ }
+
+ function observableToThunk(observable) {
+ return function (fn) {
+ var value, hasValue = false;
+ observable.subscribe(
+ function (v) {
+ value = v;
+ hasValue = true;
+ },
+ fn,
+ function () {
+ hasValue && fn(null, value);
+ });
+ }
+ }
+
+ function promiseToThunk(promise) {
+ return function(fn) {
+ promise.then(function(res) {
+ fn(null, res);
+ }, fn);
+ }
+ }
+
+ function isObservable(obj) {
+ return obj && typeof obj.subscribe === fnString;
+ }
+
+ function isGeneratorFunction(obj) {
+ return obj && obj.constructor && obj.constructor.name === 'GeneratorFunction';
+ }
+
+ function isGenerator(obj) {
+ return obj && typeof obj.next === fnString && typeof obj[throwString] === fnString;
+ }
+
+ /*
+ * Spawns a generator function which allows for Promises, Observable sequences, Arrays, Objects, Generators and functions.
+ * @param {Function} The spawning function.
+ * @returns {Function} a function which has a done continuation.
+ */
+ var observableSpawn = Rx.spawn = function (fn) {
+ var isGenFun = isGeneratorFunction(fn);
+
+ return function (done) {
+ var ctx = this,
+ gen = fn;
+
+ if (isGenFun) {
+ for(var args = [], i = 0, len = arguments.length; i < len; i++) { args.push(arguments[i]); }
+ var len = args.length,
+ hasCallback = len && typeof args[len - 1] === fnString;
+
+ done = hasCallback ? args.pop() : handleError;
+ gen = fn.apply(this, args);
+ } else {
+ done = done || handleError;
+ }
+
+ next();
+
+ function exit(err, res) {
+ timeoutScheduler.schedule(done.bind(ctx, err, res));
+ }
+
+ function next(err, res) {
+ var ret;
+
+ // multiple args
+ if (arguments.length > 2) {
+ for(var res = [], i = 1, len = arguments.length; i < len; i++) { res.push(arguments[i]); }
+ }
+
+ if (err) {
+ try {
+ ret = gen[throwString](err);
+ } catch (e) {
+ return exit(e);
+ }
+ }
+
+ if (!err) {
+ try {
+ ret = gen.next(res);
+ } catch (e) {
+ return exit(e);
+ }
+ }
+
+ if (ret.done) {
+ return exit(null, ret.value);
+ }
+
+ ret.value = toThunk(ret.value, ctx);
+
+ if (typeof ret.value === fnString) {
+ var called = false;
+ try {
+ ret.value.call(ctx, function() {
+ if (called) {
+ return;
+ }
+
+ called = true;
+ next.apply(ctx, arguments);
+ });
+ } catch (e) {
+ timeoutScheduler.schedule(function () {
+ if (called) {
+ return;
+ }
+
+ called = true;
+ next.call(ctx, e);
+ });
+ }
+ return;
+ }
+
+ // Not supported
+ next(new TypeError('Rx.spawn only supports a function, Promise, Observable, Object or Array.'));
+ }
+ }
+ };
+
+ function handleError(err) {
+ if (!err) { return; }
+ timeoutScheduler.schedule(function() {
+ throw err;
+ });
+ }
+
+ /**
+ * Invokes the specified function asynchronously on the specified scheduler, surfacing the result through an observable sequence.
+ *
+ * @example
+ * var res = Rx.Observable.start(function () { console.log('hello'); });
+ * var res = Rx.Observable.start(function () { console.log('hello'); }, Rx.Scheduler.timeout);
+ * var res = Rx.Observable.start(function () { this.log('hello'); }, Rx.Scheduler.timeout, console);
+ *
+ * @param {Function} func Function to run asynchronously.
+ * @param {Scheduler} [scheduler] Scheduler to run the function on. If not specified, defaults to Scheduler.timeout.
+ * @param [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
+ * @returns {Observable} An observable sequence exposing the function's result value, or an exception.
+ *
+ * Remarks
+ * * The function is called immediately, not during the subscription of the resulting sequence.
+ * * Multiple subscriptions to the resulting sequence can observe the function's result.
+ */
+ Observable.start = function (func, context, scheduler) {
+ return observableToAsync(func, context, scheduler)();
+ };
+
+ /**
+ * Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function on the specified scheduler.
+ * @param {Function} function Function to convert to an asynchronous function.
+ * @param {Scheduler} [scheduler] Scheduler to run the function on. If not specified, defaults to Scheduler.timeout.
+ * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
+ * @returns {Function} Asynchronous function.
+ */
+ var observableToAsync = Observable.toAsync = function (func, context, scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return function () {
+ var args = arguments,
+ subject = new AsyncSubject();
+
+ scheduler.schedule(function () {
+ var result;
+ try {
+ result = func.apply(context, args);
+ } catch (e) {
+ subject.onError(e);
+ return;
+ }
+ subject.onNext(result);
+ subject.onCompleted();
+ });
+ return subject.asObservable();
+ };
+ };
+
+ /**
+ * Converts a callback function to an observable sequence.
+ *
+ * @param {Function} function Function with a callback as the last parameter to convert to an Observable sequence.
+ * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
+ * @param {Function} [selector] A selector which takes the arguments from the callback to produce a single item to yield on next.
+ * @returns {Function} A function, when executed with the required parameters minus the callback, produces an Observable sequence with a single value of the arguments to the callback as an array.
+ */
+ Observable.fromCallback = function (func, context, selector) {
+ return function () {
+ var len = arguments.length, args = new Array(len)
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+
+ return new AnonymousObservable(function (observer) {
+ function handler() {
+ var len = arguments.length, results = new Array(len);
+ for(var i = 0; i < len; i++) { results[i] = arguments[i]; }
+
+ if (selector) {
+ try {
+ results = selector.apply(context, results);
+ } catch (e) {
+ return observer.onError(e);
+ }
+
+ observer.onNext(results);
+ } else {
+ if (results.length <= 1) {
+ observer.onNext.apply(observer, results);
+ } else {
+ observer.onNext(results);
+ }
+ }
+
+ observer.onCompleted();
+ }
+
+ args.push(handler);
+ func.apply(context, args);
+ }).publishLast().refCount();
+ };
+ };
+
+ /**
+ * Converts a Node.js callback style function to an observable sequence. This must be in function (err, ...) format.
+ * @param {Function} func The function to call
+ * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
+ * @param {Function} [selector] A selector which takes the arguments from the callback minus the error to produce a single item to yield on next.
+ * @returns {Function} An async function which when applied, returns an observable sequence with the callback arguments as an array.
+ */
+ Observable.fromNodeCallback = function (func, context, selector) {
+ return function () {
+ var len = arguments.length, args = new Array(len);
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+
+ return new AnonymousObservable(function (observer) {
+ function handler(err) {
+ if (err) {
+ observer.onError(err);
+ return;
+ }
+
+ var len = arguments.length, results = [];
+ for(var i = 1; i < len; i++) { results[i - 1] = arguments[i]; }
+
+ if (selector) {
+ try {
+ results = selector.apply(context, results);
+ } catch (e) {
+ return observer.onError(e);
+ }
+ observer.onNext(results);
+ } else {
+ if (results.length <= 1) {
+ observer.onNext.apply(observer, results);
+ } else {
+ observer.onNext(results);
+ }
+ }
+
+ observer.onCompleted();
+ }
+
+ args.push(handler);
+ func.apply(context, args);
+ }).publishLast().refCount();
+ };
+ };
+
+ function createListener (element, name, handler) {
+ if (element.addEventListener) {
+ element.addEventListener(name, handler, false);
+ return disposableCreate(function () {
+ element.removeEventListener(name, handler, false);
+ });
+ }
+ throw new Error('No listener found');
+ }
+
+ function createEventListener (el, eventName, handler) {
+ var disposables = new CompositeDisposable();
+
+ // Asume NodeList or HTMLCollection
+ var toStr = Object.prototype.toString;
+ if (toStr.call(el) === '[object NodeList]' || toStr.call(el) === '[object HTMLCollection]') {
+ for (var i = 0, len = el.length; i < len; i++) {
+ disposables.add(createEventListener(el.item(i), eventName, handler));
+ }
+ } else if (el) {
+ disposables.add(createListener(el, eventName, handler));
+ }
+
+ return disposables;
+ }
+
+ /**
+ * Configuration option to determine whether to use native events only
+ */
+ Rx.config.useNativeEvents = false;
+
+ /**
+ * Creates an observable sequence by adding an event listener to the matching DOMElement or each item in the NodeList.
+ *
+ * @example
+ * var source = Rx.Observable.fromEvent(element, 'mouseup');
+ *
+ * @param {Object} element The DOMElement or NodeList to attach a listener.
+ * @param {String} eventName The event name to attach the observable sequence.
+ * @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next.
+ * @returns {Observable} An observable sequence of events from the specified element and the specified event.
+ */
+ Observable.fromEvent = function (element, eventName, selector) {
+ // Node.js specific
+ if (element.addListener) {
+ return fromEventPattern(
+ function (h) { element.addListener(eventName, h); },
+ function (h) { element.removeListener(eventName, h); },
+ selector);
+ }
+
+ // Use only if non-native events are allowed
+ if (!Rx.config.useNativeEvents) {
+ // Handles jq, Angular.js, Zepto, Marionette, Ember.js
+ if (typeof element.on === 'function' && typeof element.off === 'function') {
+ return fromEventPattern(
+ function (h) { element.on(eventName, h); },
+ function (h) { element.off(eventName, h); },
+ selector);
+ }
+ }
+ return new AnonymousObservable(function (observer) {
+ return createEventListener(
+ element,
+ eventName,
+ function handler (e) {
+ var results = e;
+
+ if (selector) {
+ try {
+ results = selector(arguments);
+ } catch (err) {
+ return observer.onError(err);
+ }
+ }
+
+ observer.onNext(results);
+ });
+ }).publish().refCount();
+ };
+
+ /**
+ * Creates an observable sequence from an event emitter via an addHandler/removeHandler pair.
+ * @param {Function} addHandler The function to add a handler to the emitter.
+ * @param {Function} [removeHandler] The optional function to remove a handler from an emitter.
+ * @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next.
+ * @returns {Observable} An observable sequence which wraps an event from an event emitter
+ */
+ var fromEventPattern = Observable.fromEventPattern = function (addHandler, removeHandler, selector) {
+ return new AnonymousObservable(function (observer) {
+ function innerHandler (e) {
+ var result = e;
+ if (selector) {
+ try {
+ result = selector(arguments);
+ } catch (err) {
+ return observer.onError(err);
+ }
+ }
+ observer.onNext(result);
+ }
+
+ var returnValue = addHandler(innerHandler);
+ return disposableCreate(function () {
+ if (removeHandler) {
+ removeHandler(innerHandler, returnValue);
+ }
+ });
+ }).publish().refCount();
+ };
+
+ /**
+ * Invokes the asynchronous function, surfacing the result through an observable sequence.
+ * @param {Function} functionAsync Asynchronous function which returns a Promise to run.
+ * @returns {Observable} An observable sequence exposing the function's result value, or an exception.
+ */
+ Observable.startAsync = function (functionAsync) {
+ var promise;
+ try {
+ promise = functionAsync();
+ } catch (e) {
+ return observableThrow(e);
+ }
+ return observableFromPromise(promise);
+ }
+
+ var PausableObservable = (function (__super__) {
+
+ inherits(PausableObservable, __super__);
+
+ function subscribe(observer) {
+ var conn = this.source.publish(),
+ subscription = conn.subscribe(observer),
+ connection = disposableEmpty;
+
+ var pausable = this.pauser.distinctUntilChanged().subscribe(function (b) {
+ if (b) {
+ connection = conn.connect();
+ } else {
+ connection.dispose();
+ connection = disposableEmpty;
+ }
+ });
+
+ return new CompositeDisposable(subscription, connection, pausable);
+ }
+
+ function PausableObservable(source, pauser) {
+ this.source = source;
+ this.controller = new Subject();
+
+ if (pauser && pauser.subscribe) {
+ this.pauser = this.controller.merge(pauser);
+ } else {
+ this.pauser = this.controller;
+ }
+
+ __super__.call(this, subscribe, source);
+ }
+
+ PausableObservable.prototype.pause = function () {
+ this.controller.onNext(false);
+ };
+
+ PausableObservable.prototype.resume = function () {
+ this.controller.onNext(true);
+ };
+
+ return PausableObservable;
+
+ }(Observable));
+
+ /**
+ * Pauses the underlying observable sequence based upon the observable sequence which yields true/false.
+ * @example
+ * var pauser = new Rx.Subject();
+ * var source = Rx.Observable.interval(100).pausable(pauser);
+ * @param {Observable} pauser The observable sequence used to pause the underlying sequence.
+ * @returns {Observable} The observable sequence which is paused based upon the pauser.
+ */
+ observableProto.pausable = function (pauser) {
+ return new PausableObservable(this, pauser);
+ };
+
+ function combineLatestSource(source, subject, resultSelector) {
+ return new AnonymousObservable(function (o) {
+ var hasValue = [false, false],
+ hasValueAll = false,
+ isDone = false,
+ values = new Array(2),
+ err;
+
+ function next(x, i) {
+ values[i] = x
+ hasValue[i] = true;
+ if (hasValueAll || (hasValueAll = hasValue.every(identity))) {
+ if (err) { return o.onError(err); }
+ var res = tryCatch(resultSelector).apply(null, values);
+ if (res === errorObj) { return o.onError(res.e); }
+ o.onNext(res);
+ }
+ isDone && values[1] && o.onCompleted();
+ }
+
+ return new CompositeDisposable(
+ source.subscribe(
+ function (x) {
+ next(x, 0);
+ },
+ function (e) {
+ if (values[1]) {
+ o.onError(e);
+ } else {
+ err = e;
+ }
+ },
+ function () {
+ isDone = true;
+ values[1] && o.onCompleted();
+ }),
+ subject.subscribe(
+ function (x) {
+ next(x, 1);
+ },
+ function (e) { o.onError(e); },
+ function () {
+ isDone = true;
+ next(true, 1);
+ })
+ );
+ }, source);
+ }
+
+ var PausableBufferedObservable = (function (__super__) {
+
+ inherits(PausableBufferedObservable, __super__);
+
+ function subscribe(o) {
+ var q = [], previousShouldFire;
+
+ function drainQueue() { while (q.length > 0) { o.onNext(q.shift()); } }
+
+ var subscription =
+ combineLatestSource(
+ this.source,
+ this.pauser.distinctUntilChanged().startWith(false),
+ function (data, shouldFire) {
+ return { data: data, shouldFire: shouldFire };
+ })
+ .subscribe(
+ function (results) {
+ if (previousShouldFire !== undefined && results.shouldFire != previousShouldFire) {
+ previousShouldFire = results.shouldFire;
+ // change in shouldFire
+ if (results.shouldFire) { drainQueue(); }
+ } else {
+ previousShouldFire = results.shouldFire;
+ // new data
+ if (results.shouldFire) {
+ o.onNext(results.data);
+ } else {
+ q.push(results.data);
+ }
+ }
+ },
+ function (err) {
+ drainQueue();
+ o.onError(err);
+ },
+ function () {
+ drainQueue();
+ o.onCompleted();
+ }
+ );
+ return subscription;
+ }
+
+ function PausableBufferedObservable(source, pauser) {
+ this.source = source;
+ this.controller = new Subject();
+
+ if (pauser && pauser.subscribe) {
+ this.pauser = this.controller.merge(pauser);
+ } else {
+ this.pauser = this.controller;
+ }
+
+ __super__.call(this, subscribe, source);
+ }
+
+ PausableBufferedObservable.prototype.pause = function () {
+ this.controller.onNext(false);
+ };
+
+ PausableBufferedObservable.prototype.resume = function () {
+ this.controller.onNext(true);
+ };
+
+ return PausableBufferedObservable;
+
+ }(Observable));
+
+ /**
+ * Pauses the underlying observable sequence based upon the observable sequence which yields true/false,
+ * and yields the values that were buffered while paused.
+ * @example
+ * var pauser = new Rx.Subject();
+ * var source = Rx.Observable.interval(100).pausableBuffered(pauser);
+ * @param {Observable} pauser The observable sequence used to pause the underlying sequence.
+ * @returns {Observable} The observable sequence which is paused based upon the pauser.
+ */
+ observableProto.pausableBuffered = function (subject) {
+ return new PausableBufferedObservable(this, subject);
+ };
+
+ var ControlledObservable = (function (__super__) {
+
+ inherits(ControlledObservable, __super__);
+
+ function subscribe (observer) {
+ return this.source.subscribe(observer);
+ }
+
+ function ControlledObservable (source, enableQueue, scheduler) {
+ __super__.call(this, subscribe, source);
+ this.subject = new ControlledSubject(enableQueue, scheduler);
+ this.source = source.multicast(this.subject).refCount();
+ }
+
+ ControlledObservable.prototype.request = function (numberOfItems) {
+ return this.subject.request(numberOfItems == null ? -1 : numberOfItems);
+ };
+
+ return ControlledObservable;
+
+ }(Observable));
+
+ var ControlledSubject = (function (__super__) {
+
+ function subscribe (observer) {
+ return this.subject.subscribe(observer);
+ }
+
+ inherits(ControlledSubject, __super__);
+
+ function ControlledSubject(enableQueue, scheduler) {
+ enableQueue == null && (enableQueue = true);
+
+ __super__.call(this, subscribe);
+ this.subject = new Subject();
+ this.enableQueue = enableQueue;
+ this.queue = enableQueue ? [] : null;
+ this.requestedCount = 0;
+ this.requestedDisposable = disposableEmpty;
+ this.error = null;
+ this.hasFailed = false;
+ this.hasCompleted = false;
+ this.scheduler = scheduler || currentThreadScheduler;
+ }
+
+ addProperties(ControlledSubject.prototype, Observer, {
+ onCompleted: function () {
+ this.hasCompleted = true;
+ if (!this.enableQueue || this.queue.length === 0) {
+ this.subject.onCompleted();
+ } else {
+ this.queue.push(Notification.createOnCompleted());
+ }
+ },
+ onError: function (error) {
+ this.hasFailed = true;
+ this.error = error;
+ if (!this.enableQueue || this.queue.length === 0) {
+ this.subject.onError(error);
+ } else {
+ this.queue.push(Notification.createOnError(error));
+ }
+ },
+ onNext: function (value) {
+ var hasRequested = false;
+
+ if (this.requestedCount === 0) {
+ this.enableQueue && this.queue.push(Notification.createOnNext(value));
+ } else {
+ (this.requestedCount !== -1 && this.requestedCount-- === 0) && this.disposeCurrentRequest();
+ hasRequested = true;
+ }
+ hasRequested && this.subject.onNext(value);
+ },
+ _processRequest: function (numberOfItems) {
+ if (this.enableQueue) {
+ while ((this.queue.length >= numberOfItems && numberOfItems > 0) ||
+ (this.queue.length > 0 && this.queue[0].kind !== 'N')) {
+ var first = this.queue.shift();
+ first.accept(this.subject);
+ if (first.kind === 'N') {
+ numberOfItems--;
+ } else {
+ this.disposeCurrentRequest();
+ this.queue = [];
+ }
+ }
+
+ return { numberOfItems : numberOfItems, returnValue: this.queue.length !== 0};
+ }
+
+ return { numberOfItems: numberOfItems, returnValue: false };
+ },
+ request: function (number) {
+ this.disposeCurrentRequest();
+ var self = this;
+
+ this.requestedDisposable = this.scheduler.scheduleWithState(number,
+ function(s, i) {
+ var r = self._processRequest(i), remaining = r.numberOfItems;
+ if (!r.returnValue) {
+ self.requestedCount = remaining;
+ self.requestedDisposable = disposableCreate(function () {
+ self.requestedCount = 0;
+ });
+ }
+ });
+
+ return this.requestedDisposable;
+ },
+ disposeCurrentRequest: function () {
+ this.requestedDisposable.dispose();
+ this.requestedDisposable = disposableEmpty;
+ }
+ });
+
+ return ControlledSubject;
+ }(Observable));
+
+ /**
+ * Attaches a controller to the observable sequence with the ability to queue.
+ * @example
+ * var source = Rx.Observable.interval(100).controlled();
+ * source.request(3); // Reads 3 values
+ * @param {bool} enableQueue truthy value to determine if values should be queued pending the next request
+ * @param {Scheduler} scheduler determines how the requests will be scheduled
+ * @returns {Observable} The observable sequence which only propagates values on request.
+ */
+ observableProto.controlled = function (enableQueue, scheduler) {
+
+ if (enableQueue && isScheduler(enableQueue)) {
+ scheduler = enableQueue;
+ enableQueue = true;
+ }
+
+ if (enableQueue == null) { enableQueue = true; }
+ return new ControlledObservable(this, enableQueue, scheduler);
+ };
+
+ var StopAndWaitObservable = (function (__super__) {
+
+ function subscribe (observer) {
+ this.subscription = this.source.subscribe(new StopAndWaitObserver(observer, this, this.subscription));
+
+ var self = this;
+ timeoutScheduler.schedule(function () { self.source.request(1); });
+
+ return this.subscription;
+ }
+
+ inherits(StopAndWaitObservable, __super__);
+
+ function StopAndWaitObservable (source) {
+ __super__.call(this, subscribe, source);
+ this.source = source;
+ }
+
+ var StopAndWaitObserver = (function (__sub__) {
+
+ inherits(StopAndWaitObserver, __sub__);
+
+ function StopAndWaitObserver (observer, observable, cancel) {
+ __sub__.call(this);
+ this.observer = observer;
+ this.observable = observable;
+ this.cancel = cancel;
+ }
+
+ var stopAndWaitObserverProto = StopAndWaitObserver.prototype;
+
+ stopAndWaitObserverProto.completed = function () {
+ this.observer.onCompleted();
+ this.dispose();
+ };
+
+ stopAndWaitObserverProto.error = function (error) {
+ this.observer.onError(error);
+ this.dispose();
+ }
+
+ stopAndWaitObserverProto.next = function (value) {
+ this.observer.onNext(value);
+
+ var self = this;
+ timeoutScheduler.schedule(function () {
+ self.observable.source.request(1);
+ });
+ };
+
+ stopAndWaitObserverProto.dispose = function () {
+ this.observer = null;
+ if (this.cancel) {
+ this.cancel.dispose();
+ this.cancel = null;
+ }
+ __sub__.prototype.dispose.call(this);
+ };
+
+ return StopAndWaitObserver;
+ }(AbstractObserver));
+
+ return StopAndWaitObservable;
+ }(Observable));
+
+
+ /**
+ * Attaches a stop and wait observable to the current observable.
+ * @returns {Observable} A stop and wait observable.
+ */
+ ControlledObservable.prototype.stopAndWait = function () {
+ return new StopAndWaitObservable(this);
+ };
+
+ var WindowedObservable = (function (__super__) {
+
+ function subscribe (observer) {
+ this.subscription = this.source.subscribe(new WindowedObserver(observer, this, this.subscription));
+
+ var self = this;
+ timeoutScheduler.schedule(function () {
+ self.source.request(self.windowSize);
+ });
+
+ return this.subscription;
+ }
+
+ inherits(WindowedObservable, __super__);
+
+ function WindowedObservable(source, windowSize) {
+ __super__.call(this, subscribe, source);
+ this.source = source;
+ this.windowSize = windowSize;
+ }
+
+ var WindowedObserver = (function (__sub__) {
+
+ inherits(WindowedObserver, __sub__);
+
+ function WindowedObserver(observer, observable, cancel) {
+ this.observer = observer;
+ this.observable = observable;
+ this.cancel = cancel;
+ this.received = 0;
+ }
+
+ var windowedObserverPrototype = WindowedObserver.prototype;
+
+ windowedObserverPrototype.completed = function () {
+ this.observer.onCompleted();
+ this.dispose();
+ };
+
+ windowedObserverPrototype.error = function (error) {
+ this.observer.onError(error);
+ this.dispose();
+ };
+
+ windowedObserverPrototype.next = function (value) {
+ this.observer.onNext(value);
+
+ this.received = ++this.received % this.observable.windowSize;
+ if (this.received === 0) {
+ var self = this;
+ timeoutScheduler.schedule(function () {
+ self.observable.source.request(self.observable.windowSize);
+ });
+ }
+ };
+
+ windowedObserverPrototype.dispose = function () {
+ this.observer = null;
+ if (this.cancel) {
+ this.cancel.dispose();
+ this.cancel = null;
+ }
+ __sub__.prototype.dispose.call(this);
+ };
+
+ return WindowedObserver;
+ }(AbstractObserver));
+
+ return WindowedObservable;
+ }(Observable));
+
+ /**
+ * Creates a sliding windowed observable based upon the window size.
+ * @param {Number} windowSize The number of items in the window
+ * @returns {Observable} A windowed observable based upon the window size.
+ */
+ ControlledObservable.prototype.windowed = function (windowSize) {
+ return new WindowedObservable(this, windowSize);
+ };
+
+ /**
+ * Pipes the existing Observable sequence into a Node.js Stream.
+ * @param {Stream} dest The destination Node.js stream.
+ * @returns {Stream} The destination stream.
+ */
+ observableProto.pipe = function (dest) {
+ var source = this.pausableBuffered();
+
+ function onDrain() {
+ source.resume();
+ }
+
+ dest.addListener('drain', onDrain);
+
+ source.subscribe(
+ function (x) {
+ !dest.write(String(x)) && source.pause();
+ },
+ function (err) {
+ dest.emit('error', err);
+ },
+ function () {
+ // Hack check because STDIO is not closable
+ !dest._isStdio && dest.end();
+ dest.removeListener('drain', onDrain);
+ });
+
+ source.resume();
+
+ return dest;
+ };
+
+ /**
+ * Multicasts the source sequence notifications through an instantiated subject into all uses of the sequence within a selector function. Each
+ * subscription to the resulting sequence causes a separate multicast invocation, exposing the sequence resulting from the selector function's
+ * invocation. For specializations with fixed subject types, see Publish, PublishLast, and Replay.
+ *
+ * @example
+ * 1 - res = source.multicast(observable);
+ * 2 - res = source.multicast(function () { return new Subject(); }, function (x) { return x; });
+ *
+ * @param {Function|Subject} subjectOrSubjectSelector
+ * Factory function to create an intermediate subject through which the source sequence's elements will be multicast to the selector function.
+ * Or:
+ * Subject to push source elements into.
+ *
+ * @param {Function} [selector] Optional selector function which can use the multicasted source sequence subject to the policies enforced by the created subject. Specified only if <paramref name="subjectOrSubjectSelector" is a factory function.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
+ */
+ observableProto.multicast = function (subjectOrSubjectSelector, selector) {
+ var source = this;
+ return typeof subjectOrSubjectSelector === 'function' ?
+ new AnonymousObservable(function (observer) {
+ var connectable = source.multicast(subjectOrSubjectSelector());
+ return new CompositeDisposable(selector(connectable).subscribe(observer), connectable.connect());
+ }, source) :
+ new ConnectableObservable(source, subjectOrSubjectSelector);
+ };
+
+ /**
+ * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence.
+ * This operator is a specialization of Multicast using a regular Subject.
+ *
+ * @example
+ * var resres = source.publish();
+ * var res = source.publish(function (x) { return x; });
+ *
+ * @param {Function} [selector] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all notifications of the source from the time of the subscription on.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
+ */
+ observableProto.publish = function (selector) {
+ return selector && isFunction(selector) ?
+ this.multicast(function () { return new Subject(); }, selector) :
+ this.multicast(new Subject());
+ };
+
+ /**
+ * Returns an observable sequence that shares a single subscription to the underlying sequence.
+ * This operator is a specialization of publish which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence.
+ */
+ observableProto.share = function () {
+ return this.publish().refCount();
+ };
+
+ /**
+ * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence containing only the last notification.
+ * This operator is a specialization of Multicast using a AsyncSubject.
+ *
+ * @example
+ * var res = source.publishLast();
+ * var res = source.publishLast(function (x) { return x; });
+ *
+ * @param selector [Optional] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will only receive the last notification of the source.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
+ */
+ observableProto.publishLast = function (selector) {
+ return selector && isFunction(selector) ?
+ this.multicast(function () { return new AsyncSubject(); }, selector) :
+ this.multicast(new AsyncSubject());
+ };
+
+ /**
+ * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence and starts with initialValue.
+ * This operator is a specialization of Multicast using a BehaviorSubject.
+ *
+ * @example
+ * var res = source.publishValue(42);
+ * var res = source.publishValue(function (x) { return x.select(function (y) { return y * y; }) }, 42);
+ *
+ * @param {Function} [selector] Optional selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive immediately receive the initial value, followed by all notifications of the source from the time of the subscription on.
+ * @param {Mixed} initialValue Initial value received by observers upon subscription.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
+ */
+ observableProto.publishValue = function (initialValueOrSelector, initialValue) {
+ return arguments.length === 2 ?
+ this.multicast(function () {
+ return new BehaviorSubject(initialValue);
+ }, initialValueOrSelector) :
+ this.multicast(new BehaviorSubject(initialValueOrSelector));
+ };
+
+ /**
+ * Returns an observable sequence that shares a single subscription to the underlying sequence and starts with an initialValue.
+ * This operator is a specialization of publishValue which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed.
+ * @param {Mixed} initialValue Initial value received by observers upon subscription.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence.
+ */
+ observableProto.shareValue = function (initialValue) {
+ return this.publishValue(initialValue).refCount();
+ };
+
+ /**
+ * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length for the replay buffer.
+ * This operator is a specialization of Multicast using a ReplaySubject.
+ *
+ * @example
+ * var res = source.replay(null, 3);
+ * var res = source.replay(null, 3, 500);
+ * var res = source.replay(null, 3, 500, scheduler);
+ * var res = source.replay(function (x) { return x.take(6).repeat(); }, 3, 500, scheduler);
+ *
+ * @param selector [Optional] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all the notifications of the source subject to the specified replay buffer trimming policy.
+ * @param bufferSize [Optional] Maximum element count of the replay buffer.
+ * @param windowSize [Optional] Maximum time length of the replay buffer.
+ * @param scheduler [Optional] Scheduler where connected observers within the selector function will be invoked on.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
+ */
+ observableProto.replay = function (selector, bufferSize, windowSize, scheduler) {
+ return selector && isFunction(selector) ?
+ this.multicast(function () { return new ReplaySubject(bufferSize, windowSize, scheduler); }, selector) :
+ this.multicast(new ReplaySubject(bufferSize, windowSize, scheduler));
+ };
+
+ /**
+ * Returns an observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length for the replay buffer.
+ * This operator is a specialization of replay which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed.
+ *
+ * @example
+ * var res = source.shareReplay(3);
+ * var res = source.shareReplay(3, 500);
+ * var res = source.shareReplay(3, 500, scheduler);
+ *
+
+ * @param bufferSize [Optional] Maximum element count of the replay buffer.
+ * @param window [Optional] Maximum time length of the replay buffer.
+ * @param scheduler [Optional] Scheduler where connected observers within the selector function will be invoked on.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence.
+ */
+ observableProto.shareReplay = function (bufferSize, windowSize, scheduler) {
+ return this.replay(null, bufferSize, windowSize, scheduler).refCount();
+ };
+
+ var InnerSubscription = function (subject, observer) {
+ this.subject = subject;
+ this.observer = observer;
+ };
+
+ InnerSubscription.prototype.dispose = function () {
+ if (!this.subject.isDisposed && this.observer !== null) {
+ var idx = this.subject.observers.indexOf(this.observer);
+ this.subject.observers.splice(idx, 1);
+ this.observer = null;
+ }
+ };
+
+ /**
+ * Represents a value that changes over time.
+ * Observers can subscribe to the subject to receive the last (or initial) value and all subsequent notifications.
+ */
+ var BehaviorSubject = Rx.BehaviorSubject = (function (__super__) {
+ function subscribe(observer) {
+ checkDisposed(this);
+ if (!this.isStopped) {
+ this.observers.push(observer);
+ observer.onNext(this.value);
+ return new InnerSubscription(this, observer);
+ }
+ if (this.hasError) {
+ observer.onError(this.error);
+ } else {
+ observer.onCompleted();
+ }
+ return disposableEmpty;
+ }
+
+ inherits(BehaviorSubject, __super__);
+
+ /**
+ * Initializes a new instance of the BehaviorSubject class which creates a subject that caches its last value and starts with the specified value.
+ * @param {Mixed} value Initial value sent to observers when no other value has been received by the subject yet.
+ */
+ function BehaviorSubject(value) {
+ __super__.call(this, subscribe);
+ this.value = value,
+ this.observers = [],
+ this.isDisposed = false,
+ this.isStopped = false,
+ this.hasError = false;
+ }
+
+ addProperties(BehaviorSubject.prototype, Observer, {
+ /**
+ * Gets the current value or throws an exception.
+ * Value is frozen after onCompleted is called.
+ * After onError is called always throws the specified exception.
+ * An exception is always thrown after dispose is called.
+ * @returns {Mixed} The initial value passed to the constructor until onNext is called; after which, the last value passed to onNext.
+ */
+ getValue: function () {
+ checkDisposed(this);
+ if (this.hasError) {
+ throw this.error;
+ }
+ return this.value;
+ },
+ /**
+ * Indicates whether the subject has observers subscribed to it.
+ * @returns {Boolean} Indicates whether the subject has observers subscribed to it.
+ */
+ hasObservers: function () { return this.observers.length > 0; },
+ /**
+ * Notifies all subscribed observers about the end of the sequence.
+ */
+ onCompleted: function () {
+ checkDisposed(this);
+ if (this.isStopped) { return; }
+ this.isStopped = true;
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ os[i].onCompleted();
+ }
+
+ this.observers.length = 0;
+ },
+ /**
+ * Notifies all subscribed observers about the exception.
+ * @param {Mixed} error The exception to send to all observers.
+ */
+ onError: function (error) {
+ checkDisposed(this);
+ if (this.isStopped) { return; }
+ this.isStopped = true;
+ this.hasError = true;
+ this.error = error;
+
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ os[i].onError(error);
+ }
+
+ this.observers.length = 0;
+ },
+ /**
+ * Notifies all subscribed observers about the arrival of the specified element in the sequence.
+ * @param {Mixed} value The value to send to all observers.
+ */
+ onNext: function (value) {
+ checkDisposed(this);
+ if (this.isStopped) { return; }
+ this.value = value;
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ os[i].onNext(value);
+ }
+ },
+ /**
+ * Unsubscribe all observers and release resources.
+ */
+ dispose: function () {
+ this.isDisposed = true;
+ this.observers = null;
+ this.value = null;
+ this.exception = null;
+ }
+ });
+
+ return BehaviorSubject;
+ }(Observable));
+
+ /**
+ * Represents an object that is both an observable sequence as well as an observer.
+ * Each notification is broadcasted to all subscribed and future observers, subject to buffer trimming policies.
+ */
+ var ReplaySubject = Rx.ReplaySubject = (function (__super__) {
+
+ var maxSafeInteger = Math.pow(2, 53) - 1;
+
+ function createRemovableDisposable(subject, observer) {
+ return disposableCreate(function () {
+ observer.dispose();
+ !subject.isDisposed && subject.observers.splice(subject.observers.indexOf(observer), 1);
+ });
+ }
+
+ function subscribe(observer) {
+ var so = new ScheduledObserver(this.scheduler, observer),
+ subscription = createRemovableDisposable(this, so);
+ checkDisposed(this);
+ this._trim(this.scheduler.now());
+ this.observers.push(so);
+
+ for (var i = 0, len = this.q.length; i < len; i++) {
+ so.onNext(this.q[i].value);
+ }
+
+ if (this.hasError) {
+ so.onError(this.error);
+ } else if (this.isStopped) {
+ so.onCompleted();
+ }
+
+ so.ensureActive();
+ return subscription;
+ }
+
+ inherits(ReplaySubject, __super__);
+
+ /**
+ * Initializes a new instance of the ReplaySubject class with the specified buffer size, window size and scheduler.
+ * @param {Number} [bufferSize] Maximum element count of the replay buffer.
+ * @param {Number} [windowSize] Maximum time length of the replay buffer.
+ * @param {Scheduler} [scheduler] Scheduler the observers are invoked on.
+ */
+ function ReplaySubject(bufferSize, windowSize, scheduler) {
+ this.bufferSize = bufferSize == null ? maxSafeInteger : bufferSize;
+ this.windowSize = windowSize == null ? maxSafeInteger : windowSize;
+ this.scheduler = scheduler || currentThreadScheduler;
+ this.q = [];
+ this.observers = [];
+ this.isStopped = false;
+ this.isDisposed = false;
+ this.hasError = false;
+ this.error = null;
+ __super__.call(this, subscribe);
+ }
+
+ addProperties(ReplaySubject.prototype, Observer.prototype, {
+ /**
+ * Indicates whether the subject has observers subscribed to it.
+ * @returns {Boolean} Indicates whether the subject has observers subscribed to it.
+ */
+ hasObservers: function () {
+ return this.observers.length > 0;
+ },
+ _trim: function (now) {
+ while (this.q.length > this.bufferSize) {
+ this.q.shift();
+ }
+ while (this.q.length > 0 && (now - this.q[0].interval) > this.windowSize) {
+ this.q.shift();
+ }
+ },
+ /**
+ * Notifies all subscribed observers about the arrival of the specified element in the sequence.
+ * @param {Mixed} value The value to send to all observers.
+ */
+ onNext: function (value) {
+ checkDisposed(this);
+ if (this.isStopped) { return; }
+ var now = this.scheduler.now();
+ this.q.push({ interval: now, value: value });
+ this._trim(now);
+
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ var observer = os[i];
+ observer.onNext(value);
+ observer.ensureActive();
+ }
+ },
+ /**
+ * Notifies all subscribed observers about the exception.
+ * @param {Mixed} error The exception to send to all observers.
+ */
+ onError: function (error) {
+ checkDisposed(this);
+ if (this.isStopped) { return; }
+ this.isStopped = true;
+ this.error = error;
+ this.hasError = true;
+ var now = this.scheduler.now();
+ this._trim(now);
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ var observer = os[i];
+ observer.onError(error);
+ observer.ensureActive();
+ }
+ this.observers.length = 0;
+ },
+ /**
+ * Notifies all subscribed observers about the end of the sequence.
+ */
+ onCompleted: function () {
+ checkDisposed(this);
+ if (this.isStopped) { return; }
+ this.isStopped = true;
+ var now = this.scheduler.now();
+ this._trim(now);
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ var observer = os[i];
+ observer.onCompleted();
+ observer.ensureActive();
+ }
+ this.observers.length = 0;
+ },
+ /**
+ * Unsubscribe all observers and release resources.
+ */
+ dispose: function () {
+ this.isDisposed = true;
+ this.observers = null;
+ }
+ });
+
+ return ReplaySubject;
+ }(Observable));
+
+ var ConnectableObservable = Rx.ConnectableObservable = (function (__super__) {
+ inherits(ConnectableObservable, __super__);
+
+ function ConnectableObservable(source, subject) {
+ var hasSubscription = false,
+ subscription,
+ sourceObservable = source.asObservable();
+
+ this.connect = function () {
+ if (!hasSubscription) {
+ hasSubscription = true;
+ subscription = new CompositeDisposable(sourceObservable.subscribe(subject), disposableCreate(function () {
+ hasSubscription = false;
+ }));
+ }
+ return subscription;
+ };
+
+ __super__.call(this, function (o) { return subject.subscribe(o); });
+ }
+
+ ConnectableObservable.prototype.refCount = function () {
+ var connectableSubscription, count = 0, source = this;
+ return new AnonymousObservable(function (observer) {
+ var shouldConnect = ++count === 1,
+ subscription = source.subscribe(observer);
+ shouldConnect && (connectableSubscription = source.connect());
+ return function () {
+ subscription.dispose();
+ --count === 0 && connectableSubscription.dispose();
+ };
+ });
+ };
+
+ return ConnectableObservable;
+ }(Observable));
+
+ /**
+ * Returns an observable sequence that shares a single subscription to the underlying sequence. This observable sequence
+ * can be resubscribed to, even if all prior subscriptions have ended. (unlike `.publish().refCount()`)
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source.
+ */
+ observableProto.singleInstance = function() {
+ var source = this, hasObservable = false, observable;
+
+ function getObservable() {
+ if (!hasObservable) {
+ hasObservable = true;
+ observable = source.finally(function() { hasObservable = false; }).publish().refCount();
+ }
+ return observable;
+ };
+
+ return new AnonymousObservable(function(o) {
+ return getObservable().subscribe(o);
+ });
+ };
+
+ var Dictionary = (function () {
+
+ var primes = [1, 3, 7, 13, 31, 61, 127, 251, 509, 1021, 2039, 4093, 8191, 16381, 32749, 65521, 131071, 262139, 524287, 1048573, 2097143, 4194301, 8388593, 16777213, 33554393, 67108859, 134217689, 268435399, 536870909, 1073741789, 2147483647],
+ noSuchkey = "no such key",
+ duplicatekey = "duplicate key";
+
+ function isPrime(candidate) {
+ if ((candidate & 1) === 0) { return candidate === 2; }
+ var num1 = Math.sqrt(candidate),
+ num2 = 3;
+ while (num2 <= num1) {
+ if (candidate % num2 === 0) { return false; }
+ num2 += 2;
+ }
+ return true;
+ }
+
+ function getPrime(min) {
+ var index, num, candidate;
+ for (index = 0; index < primes.length; ++index) {
+ num = primes[index];
+ if (num >= min) { return num; }
+ }
+ candidate = min | 1;
+ while (candidate < primes[primes.length - 1]) {
+ if (isPrime(candidate)) { return candidate; }
+ candidate += 2;
+ }
+ return min;
+ }
+
+ function stringHashFn(str) {
+ var hash = 757602046;
+ if (!str.length) { return hash; }
+ for (var i = 0, len = str.length; i < len; i++) {
+ var character = str.charCodeAt(i);
+ hash = ((hash << 5) - hash) + character;
+ hash = hash & hash;
+ }
+ return hash;
+ }
+
+ function numberHashFn(key) {
+ var c2 = 0x27d4eb2d;
+ key = (key ^ 61) ^ (key >>> 16);
+ key = key + (key << 3);
+ key = key ^ (key >>> 4);
+ key = key * c2;
+ key = key ^ (key >>> 15);
+ return key;
+ }
+
+ var getHashCode = (function () {
+ var uniqueIdCounter = 0;
+
+ return function (obj) {
+ if (obj == null) { throw new Error(noSuchkey); }
+
+ // Check for built-ins before tacking on our own for any object
+ if (typeof obj === 'string') { return stringHashFn(obj); }
+ if (typeof obj === 'number') { return numberHashFn(obj); }
+ if (typeof obj === 'boolean') { return obj === true ? 1 : 0; }
+ if (obj instanceof Date) { return numberHashFn(obj.valueOf()); }
+ if (obj instanceof RegExp) { return stringHashFn(obj.toString()); }
+ if (typeof obj.valueOf === 'function') {
+ // Hack check for valueOf
+ var valueOf = obj.valueOf();
+ if (typeof valueOf === 'number') { return numberHashFn(valueOf); }
+ if (typeof valueOf === 'string') { return stringHashFn(valueOf); }
+ }
+ if (obj.hashCode) { return obj.hashCode(); }
+
+ var id = 17 * uniqueIdCounter++;
+ obj.hashCode = function () { return id; };
+ return id;
+ };
+ }());
+
+ function newEntry() {
+ return { key: null, value: null, next: 0, hashCode: 0 };
+ }
+
+ function Dictionary(capacity, comparer) {
+ if (capacity < 0) { throw new ArgumentOutOfRangeError(); }
+ if (capacity > 0) { this._initialize(capacity); }
+
+ this.comparer = comparer || defaultComparer;
+ this.freeCount = 0;
+ this.size = 0;
+ this.freeList = -1;
+ }
+
+ var dictionaryProto = Dictionary.prototype;
+
+ dictionaryProto._initialize = function (capacity) {
+ var prime = getPrime(capacity), i;
+ this.buckets = new Array(prime);
+ this.entries = new Array(prime);
+ for (i = 0; i < prime; i++) {
+ this.buckets[i] = -1;
+ this.entries[i] = newEntry();
+ }
+ this.freeList = -1;
+ };
+
+ dictionaryProto.add = function (key, value) {
+ this._insert(key, value, true);
+ };
+
+ dictionaryProto._insert = function (key, value, add) {
+ if (!this.buckets) { this._initialize(0); }
+ var index3,
+ num = getHashCode(key) & 2147483647,
+ index1 = num % this.buckets.length;
+ for (var index2 = this.buckets[index1]; index2 >= 0; index2 = this.entries[index2].next) {
+ if (this.entries[index2].hashCode === num && this.comparer(this.entries[index2].key, key)) {
+ if (add) { throw new Error(duplicatekey); }
+ this.entries[index2].value = value;
+ return;
+ }
+ }
+ if (this.freeCount > 0) {
+ index3 = this.freeList;
+ this.freeList = this.entries[index3].next;
+ --this.freeCount;
+ } else {
+ if (this.size === this.entries.length) {
+ this._resize();
+ index1 = num % this.buckets.length;
+ }
+ index3 = this.size;
+ ++this.size;
+ }
+ this.entries[index3].hashCode = num;
+ this.entries[index3].next = this.buckets[index1];
+ this.entries[index3].key = key;
+ this.entries[index3].value = value;
+ this.buckets[index1] = index3;
+ };
+
+ dictionaryProto._resize = function () {
+ var prime = getPrime(this.size * 2),
+ numArray = new Array(prime);
+ for (index = 0; index < numArray.length; ++index) { numArray[index] = -1; }
+ var entryArray = new Array(prime);
+ for (index = 0; index < this.size; ++index) { entryArray[index] = this.entries[index]; }
+ for (var index = this.size; index < prime; ++index) { entryArray[index] = newEntry(); }
+ for (var index1 = 0; index1 < this.size; ++index1) {
+ var index2 = entryArray[index1].hashCode % prime;
+ entryArray[index1].next = numArray[index2];
+ numArray[index2] = index1;
+ }
+ this.buckets = numArray;
+ this.entries = entryArray;
+ };
+
+ dictionaryProto.remove = function (key) {
+ if (this.buckets) {
+ var num = getHashCode(key) & 2147483647,
+ index1 = num % this.buckets.length,
+ index2 = -1;
+ for (var index3 = this.buckets[index1]; index3 >= 0; index3 = this.entries[index3].next) {
+ if (this.entries[index3].hashCode === num && this.comparer(this.entries[index3].key, key)) {
+ if (index2 < 0) {
+ this.buckets[index1] = this.entries[index3].next;
+ } else {
+ this.entries[index2].next = this.entries[index3].next;
+ }
+ this.entries[index3].hashCode = -1;
+ this.entries[index3].next = this.freeList;
+ this.entries[index3].key = null;
+ this.entries[index3].value = null;
+ this.freeList = index3;
+ ++this.freeCount;
+ return true;
+ } else {
+ index2 = index3;
+ }
+ }
+ }
+ return false;
+ };
+
+ dictionaryProto.clear = function () {
+ var index, len;
+ if (this.size <= 0) { return; }
+ for (index = 0, len = this.buckets.length; index < len; ++index) {
+ this.buckets[index] = -1;
+ }
+ for (index = 0; index < this.size; ++index) {
+ this.entries[index] = newEntry();
+ }
+ this.freeList = -1;
+ this.size = 0;
+ };
+
+ dictionaryProto._findEntry = function (key) {
+ if (this.buckets) {
+ var num = getHashCode(key) & 2147483647;
+ for (var index = this.buckets[num % this.buckets.length]; index >= 0; index = this.entries[index].next) {
+ if (this.entries[index].hashCode === num && this.comparer(this.entries[index].key, key)) {
+ return index;
+ }
+ }
+ }
+ return -1;
+ };
+
+ dictionaryProto.count = function () {
+ return this.size - this.freeCount;
+ };
+
+ dictionaryProto.tryGetValue = function (key) {
+ var entry = this._findEntry(key);
+ return entry >= 0 ?
+ this.entries[entry].value :
+ undefined;
+ };
+
+ dictionaryProto.getValues = function () {
+ var index = 0, results = [];
+ if (this.entries) {
+ for (var index1 = 0; index1 < this.size; index1++) {
+ if (this.entries[index1].hashCode >= 0) {
+ results[index++] = this.entries[index1].value;
+ }
+ }
+ }
+ return results;
+ };
+
+ dictionaryProto.get = function (key) {
+ var entry = this._findEntry(key);
+ if (entry >= 0) { return this.entries[entry].value; }
+ throw new Error(noSuchkey);
+ };
+
+ dictionaryProto.set = function (key, value) {
+ this._insert(key, value, false);
+ };
+
+ dictionaryProto.containskey = function (key) {
+ return this._findEntry(key) >= 0;
+ };
+
+ return Dictionary;
+ }());
+
+ /**
+ * Correlates the elements of two sequences based on overlapping durations.
+ *
+ * @param {Observable} right The right observable sequence to join elements for.
+ * @param {Function} leftDurationSelector A function to select the duration (expressed as an observable sequence) of each element of the left observable sequence, used to determine overlap.
+ * @param {Function} rightDurationSelector A function to select the duration (expressed as an observable sequence) of each element of the right observable sequence, used to determine overlap.
+ * @param {Function} resultSelector A function invoked to compute a result element for any two overlapping elements of the left and right observable sequences. The parameters passed to the function correspond with the elements from the left and right source sequences for which overlap occurs.
+ * @returns {Observable} An observable sequence that contains result elements computed from source elements that have an overlapping duration.
+ */
+ observableProto.join = function (right, leftDurationSelector, rightDurationSelector, resultSelector) {
+ var left = this;
+ return new AnonymousObservable(function (observer) {
+ var group = new CompositeDisposable();
+ var leftDone = false, rightDone = false;
+ var leftId = 0, rightId = 0;
+ var leftMap = new Dictionary(), rightMap = new Dictionary();
+
+ group.add(left.subscribe(
+ function (value) {
+ var id = leftId++;
+ var md = new SingleAssignmentDisposable();
+
+ leftMap.add(id, value);
+ group.add(md);
+
+ var expire = function () {
+ leftMap.remove(id) && leftMap.count() === 0 && leftDone && observer.onCompleted();
+ group.remove(md);
+ };
+
+ var duration;
+ try {
+ duration = leftDurationSelector(value);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+
+ md.setDisposable(duration.take(1).subscribe(noop, observer.onError.bind(observer), expire));
+
+ rightMap.getValues().forEach(function (v) {
+ var result;
+ try {
+ result = resultSelector(value, v);
+ } catch (exn) {
+ observer.onError(exn);
+ return;
+ }
+
+ observer.onNext(result);
+ });
+ },
+ observer.onError.bind(observer),
+ function () {
+ leftDone = true;
+ (rightDone || leftMap.count() === 0) && observer.onCompleted();
+ })
+ );
+
+ group.add(right.subscribe(
+ function (value) {
+ var id = rightId++;
+ var md = new SingleAssignmentDisposable();
+
+ rightMap.add(id, value);
+ group.add(md);
+
+ var expire = function () {
+ rightMap.remove(id) && rightMap.count() === 0 && rightDone && observer.onCompleted();
+ group.remove(md);
+ };
+
+ var duration;
+ try {
+ duration = rightDurationSelector(value);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+
+ md.setDisposable(duration.take(1).subscribe(noop, observer.onError.bind(observer), expire));
+
+ leftMap.getValues().forEach(function (v) {
+ var result;
+ try {
+ result = resultSelector(v, value);
+ } catch (exn) {
+ observer.onError(exn);
+ return;
+ }
+
+ observer.onNext(result);
+ });
+ },
+ observer.onError.bind(observer),
+ function () {
+ rightDone = true;
+ (leftDone || rightMap.count() === 0) && observer.onCompleted();
+ })
+ );
+ return group;
+ }, left);
+ };
+
+ /**
+ * Correlates the elements of two sequences based on overlapping durations, and groups the results.
+ *
+ * @param {Observable} right The right observable sequence to join elements for.
+ * @param {Function} leftDurationSelector A function to select the duration (expressed as an observable sequence) of each element of the left observable sequence, used to determine overlap.
+ * @param {Function} rightDurationSelector A function to select the duration (expressed as an observable sequence) of each element of the right observable sequence, used to determine overlap.
+ * @param {Function} resultSelector A function invoked to compute a result element for any element of the left sequence with overlapping elements from the right observable sequence. The first parameter passed to the function is an element of the left sequence. The second parameter passed to the function is an observable sequence with elements from the right sequence that overlap with the left sequence's element.
+ * @returns {Observable} An observable sequence that contains result elements computed from source elements that have an overlapping duration.
+ */
+ observableProto.groupJoin = function (right, leftDurationSelector, rightDurationSelector, resultSelector) {
+ var left = this;
+ return new AnonymousObservable(function (observer) {
+ var group = new CompositeDisposable();
+ var r = new RefCountDisposable(group);
+ var leftMap = new Dictionary(), rightMap = new Dictionary();
+ var leftId = 0, rightId = 0;
+
+ function handleError(e) { return function (v) { v.onError(e); }; };
+
+ group.add(left.subscribe(
+ function (value) {
+ var s = new Subject();
+ var id = leftId++;
+ leftMap.add(id, s);
+
+ var result;
+ try {
+ result = resultSelector(value, addRef(s, r));
+ } catch (e) {
+ leftMap.getValues().forEach(handleError(e));
+ observer.onError(e);
+ return;
+ }
+ observer.onNext(result);
+
+ rightMap.getValues().forEach(function (v) { s.onNext(v); });
+
+ var md = new SingleAssignmentDisposable();
+ group.add(md);
+
+ var expire = function () {
+ leftMap.remove(id) && s.onCompleted();
+ group.remove(md);
+ };
+
+ var duration;
+ try {
+ duration = leftDurationSelector(value);
+ } catch (e) {
+ leftMap.getValues().forEach(handleError(e));
+ observer.onError(e);
+ return;
+ }
+
+ md.setDisposable(duration.take(1).subscribe(
+ noop,
+ function (e) {
+ leftMap.getValues().forEach(handleError(e));
+ observer.onError(e);
+ },
+ expire)
+ );
+ },
+ function (e) {
+ leftMap.getValues().forEach(handleError(e));
+ observer.onError(e);
+ },
+ observer.onCompleted.bind(observer))
+ );
+
+ group.add(right.subscribe(
+ function (value) {
+ var id = rightId++;
+ rightMap.add(id, value);
+
+ var md = new SingleAssignmentDisposable();
+ group.add(md);
+
+ var expire = function () {
+ rightMap.remove(id);
+ group.remove(md);
+ };
+
+ var duration;
+ try {
+ duration = rightDurationSelector(value);
+ } catch (e) {
+ leftMap.getValues().forEach(handleError(e));
+ observer.onError(e);
+ return;
+ }
+ md.setDisposable(duration.take(1).subscribe(
+ noop,
+ function (e) {
+ leftMap.getValues().forEach(handleError(e));
+ observer.onError(e);
+ },
+ expire)
+ );
+
+ leftMap.getValues().forEach(function (v) { v.onNext(value); });
+ },
+ function (e) {
+ leftMap.getValues().forEach(handleError(e));
+ observer.onError(e);
+ })
+ );
+
+ return r;
+ }, left);
+ };
+
+ /**
+ * Projects each element of an observable sequence into zero or more buffers.
+ *
+ * @param {Mixed} bufferOpeningsOrClosingSelector Observable sequence whose elements denote the creation of new windows, or, a function invoked to define the boundaries of the produced windows (a new window is started when the previous one is closed, resulting in non-overlapping windows).
+ * @param {Function} [bufferClosingSelector] A function invoked to define the closing of each produced window. If a closing selector function is specified for the first parameter, this parameter is ignored.
+ * @returns {Observable} An observable sequence of windows.
+ */
+ observableProto.buffer = function (bufferOpeningsOrClosingSelector, bufferClosingSelector) {
+ return this.window.apply(this, arguments).selectMany(function (x) { return x.toArray(); });
+ };
+
+ /**
+ * Projects each element of an observable sequence into zero or more windows.
+ *
+ * @param {Mixed} windowOpeningsOrClosingSelector Observable sequence whose elements denote the creation of new windows, or, a function invoked to define the boundaries of the produced windows (a new window is started when the previous one is closed, resulting in non-overlapping windows).
+ * @param {Function} [windowClosingSelector] A function invoked to define the closing of each produced window. If a closing selector function is specified for the first parameter, this parameter is ignored.
+ * @returns {Observable} An observable sequence of windows.
+ */
+ observableProto.window = function (windowOpeningsOrClosingSelector, windowClosingSelector) {
+ if (arguments.length === 1 && typeof arguments[0] !== 'function') {
+ return observableWindowWithBoundaries.call(this, windowOpeningsOrClosingSelector);
+ }
+ return typeof windowOpeningsOrClosingSelector === 'function' ?
+ observableWindowWithClosingSelector.call(this, windowOpeningsOrClosingSelector) :
+ observableWindowWithOpenings.call(this, windowOpeningsOrClosingSelector, windowClosingSelector);
+ };
+
+ function observableWindowWithOpenings(windowOpenings, windowClosingSelector) {
+ return windowOpenings.groupJoin(this, windowClosingSelector, observableEmpty, function (_, win) {
+ return win;
+ });
+ }
+
+ function observableWindowWithBoundaries(windowBoundaries) {
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ var win = new Subject(),
+ d = new CompositeDisposable(),
+ r = new RefCountDisposable(d);
+
+ observer.onNext(addRef(win, r));
+
+ d.add(source.subscribe(function (x) {
+ win.onNext(x);
+ }, function (err) {
+ win.onError(err);
+ observer.onError(err);
+ }, function () {
+ win.onCompleted();
+ observer.onCompleted();
+ }));
+
+ isPromise(windowBoundaries) && (windowBoundaries = observableFromPromise(windowBoundaries));
+
+ d.add(windowBoundaries.subscribe(function (w) {
+ win.onCompleted();
+ win = new Subject();
+ observer.onNext(addRef(win, r));
+ }, function (err) {
+ win.onError(err);
+ observer.onError(err);
+ }, function () {
+ win.onCompleted();
+ observer.onCompleted();
+ }));
+
+ return r;
+ }, source);
+ }
+
+ function observableWindowWithClosingSelector(windowClosingSelector) {
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ var m = new SerialDisposable(),
+ d = new CompositeDisposable(m),
+ r = new RefCountDisposable(d),
+ win = new Subject();
+ observer.onNext(addRef(win, r));
+ d.add(source.subscribe(function (x) {
+ win.onNext(x);
+ }, function (err) {
+ win.onError(err);
+ observer.onError(err);
+ }, function () {
+ win.onCompleted();
+ observer.onCompleted();
+ }));
+
+ function createWindowClose () {
+ var windowClose;
+ try {
+ windowClose = windowClosingSelector();
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+
+ isPromise(windowClose) && (windowClose = observableFromPromise(windowClose));
+
+ var m1 = new SingleAssignmentDisposable();
+ m.setDisposable(m1);
+ m1.setDisposable(windowClose.take(1).subscribe(noop, function (err) {
+ win.onError(err);
+ observer.onError(err);
+ }, function () {
+ win.onCompleted();
+ win = new Subject();
+ observer.onNext(addRef(win, r));
+ createWindowClose();
+ }));
+ }
+
+ createWindowClose();
+ return r;
+ }, source);
+ }
+
+ /**
+ * Returns a new observable that triggers on the second and subsequent triggerings of the input observable.
+ * The Nth triggering of the input observable passes the arguments from the N-1th and Nth triggering as a pair.
+ * The argument passed to the N-1th triggering is held in hidden internal state until the Nth triggering occurs.
+ * @returns {Observable} An observable that triggers on successive pairs of observations from the input observable as an array.
+ */
+ observableProto.pairwise = function () {
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ var previous, hasPrevious = false;
+ return source.subscribe(
+ function (x) {
+ if (hasPrevious) {
+ observer.onNext([previous, x]);
+ } else {
+ hasPrevious = true;
+ }
+ previous = x;
+ },
+ observer.onError.bind(observer),
+ observer.onCompleted.bind(observer));
+ }, source);
+ };
+
+ /**
+ * Returns two observables which partition the observations of the source by the given function.
+ * The first will trigger observations for those values for which the predicate returns true.
+ * The second will trigger observations for those values where the predicate returns false.
+ * The predicate is executed once for each subscribed observer.
+ * Both also propagate all error observations arising from the source and each completes
+ * when the source completes.
+ * @param {Function} predicate
+ * The function to determine which output Observable will trigger a particular observation.
+ * @returns {Array}
+ * An array of observables. The first triggers when the predicate returns true,
+ * and the second triggers when the predicate returns false.
+ */
+ observableProto.partition = function(predicate, thisArg) {
+ return [
+ this.filter(predicate, thisArg),
+ this.filter(function (x, i, o) { return !predicate.call(thisArg, x, i, o); })
+ ];
+ };
+
+ var WhileEnumerable = (function(__super__) {
+ inherits(WhileEnumerable, __super__);
+ function WhileEnumerable(c, s) {
+ this.c = c;
+ this.s = s;
+ }
+ WhileEnumerable.prototype[$iterator$] = function () {
+ var self = this;
+ return {
+ next: function () {
+ return self.c() ?
+ { done: false, value: self.s } :
+ { done: true, value: void 0 };
+ }
+ };
+ };
+ return WhileEnumerable;
+ }(Enumerable));
+
+ function enumerableWhile(condition, source) {
+ return new WhileEnumerable(condition, source);
+ }
+
+ /**
+ * Returns an observable sequence that is the result of invoking the selector on the source sequence, without sharing subscriptions.
+ * This operator allows for a fluent style of writing queries that use the same sequence multiple times.
+ *
+ * @param {Function} selector Selector function which can use the source sequence as many times as needed, without sharing subscriptions to the source sequence.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
+ */
+ observableProto.letBind = observableProto['let'] = function (func) {
+ return func(this);
+ };
+
+ /**
+ * Determines whether an observable collection contains values. There is an alias for this method called 'ifThen' for browsers <IE9
+ *
+ * @example
+ * 1 - res = Rx.Observable.if(condition, obs1);
+ * 2 - res = Rx.Observable.if(condition, obs1, obs2);
+ * 3 - res = Rx.Observable.if(condition, obs1, scheduler);
+ * @param {Function} condition The condition which determines if the thenSource or elseSource will be run.
+ * @param {Observable} thenSource The observable sequence or Promise that will be run if the condition function returns true.
+ * @param {Observable} [elseSource] The observable sequence or Promise that will be run if the condition function returns false. If this is not provided, it defaults to Rx.Observabe.Empty with the specified scheduler.
+ * @returns {Observable} An observable sequence which is either the thenSource or elseSource.
+ */
+ Observable['if'] = Observable.ifThen = function (condition, thenSource, elseSourceOrScheduler) {
+ return observableDefer(function () {
+ elseSourceOrScheduler || (elseSourceOrScheduler = observableEmpty());
+
+ isPromise(thenSource) && (thenSource = observableFromPromise(thenSource));
+ isPromise(elseSourceOrScheduler) && (elseSourceOrScheduler = observableFromPromise(elseSourceOrScheduler));
+
+ // Assume a scheduler for empty only
+ typeof elseSourceOrScheduler.now === 'function' && (elseSourceOrScheduler = observableEmpty(elseSourceOrScheduler));
+ return condition() ? thenSource : elseSourceOrScheduler;
+ });
+ };
+
+ /**
+ * Concatenates the observable sequences obtained by running the specified result selector for each element in source.
+ * There is an alias for this method called 'forIn' for browsers <IE9
+ * @param {Array} sources An array of values to turn into an observable sequence.
+ * @param {Function} resultSelector A function to apply to each item in the sources array to turn it into an observable sequence.
+ * @returns {Observable} An observable sequence from the concatenated observable sequences.
+ */
+ Observable['for'] = Observable.forIn = function (sources, resultSelector, thisArg) {
+ return enumerableOf(sources, resultSelector, thisArg).concat();
+ };
+
+ /**
+ * Repeats source as long as condition holds emulating a while loop.
+ * There is an alias for this method called 'whileDo' for browsers <IE9
+ *
+ * @param {Function} condition The condition which determines if the source will be repeated.
+ * @param {Observable} source The observable sequence that will be run if the condition function returns true.
+ * @returns {Observable} An observable sequence which is repeated as long as the condition holds.
+ */
+ var observableWhileDo = Observable['while'] = Observable.whileDo = function (condition, source) {
+ isPromise(source) && (source = observableFromPromise(source));
+ return enumerableWhile(condition, source).concat();
+ };
+
+ /**
+ * Repeats source as long as condition holds emulating a do while loop.
+ *
+ * @param {Function} condition The condition which determines if the source will be repeated.
+ * @param {Observable} source The observable sequence that will be run if the condition function returns true.
+ * @returns {Observable} An observable sequence which is repeated as long as the condition holds.
+ */
+ observableProto.doWhile = function (condition) {
+ return observableConcat([this, observableWhileDo(condition, this)]);
+ };
+
+ /**
+ * Uses selector to determine which source in sources to use.
+ * There is an alias 'switchCase' for browsers <IE9.
+ *
+ * @example
+ * 1 - res = Rx.Observable.case(selector, { '1': obs1, '2': obs2 });
+ * 1 - res = Rx.Observable.case(selector, { '1': obs1, '2': obs2 }, obs0);
+ * 1 - res = Rx.Observable.case(selector, { '1': obs1, '2': obs2 }, scheduler);
+ *
+ * @param {Function} selector The function which extracts the value for to test in a case statement.
+ * @param {Array} sources A object which has keys which correspond to the case statement labels.
+ * @param {Observable} [elseSource] The observable sequence or Promise that will be run if the sources are not matched. If this is not provided, it defaults to Rx.Observabe.empty with the specified scheduler.
+ *
+ * @returns {Observable} An observable sequence which is determined by a case statement.
+ */
+ Observable['case'] = Observable.switchCase = function (selector, sources, defaultSourceOrScheduler) {
+ return observableDefer(function () {
+ isPromise(defaultSourceOrScheduler) && (defaultSourceOrScheduler = observableFromPromise(defaultSourceOrScheduler));
+ defaultSourceOrScheduler || (defaultSourceOrScheduler = observableEmpty());
+
+ typeof defaultSourceOrScheduler.now === 'function' && (defaultSourceOrScheduler = observableEmpty(defaultSourceOrScheduler));
+
+ var result = sources[selector()];
+ isPromise(result) && (result = observableFromPromise(result));
+
+ return result || defaultSourceOrScheduler;
+ });
+ };
+
+ /**
+ * Expands an observable sequence by recursively invoking selector.
+ *
+ * @param {Function} selector Selector function to invoke for each produced element, resulting in another sequence to which the selector will be invoked recursively again.
+ * @param {Scheduler} [scheduler] Scheduler on which to perform the expansion. If not provided, this defaults to the current thread scheduler.
+ * @returns {Observable} An observable sequence containing all the elements produced by the recursive expansion.
+ */
+ observableProto.expand = function (selector, scheduler) {
+ isScheduler(scheduler) || (scheduler = immediateScheduler);
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ var q = [],
+ m = new SerialDisposable(),
+ d = new CompositeDisposable(m),
+ activeCount = 0,
+ isAcquired = false;
+
+ var ensureActive = function () {
+ var isOwner = false;
+ if (q.length > 0) {
+ isOwner = !isAcquired;
+ isAcquired = true;
+ }
+ if (isOwner) {
+ m.setDisposable(scheduler.scheduleRecursive(function (self) {
+ var work;
+ if (q.length > 0) {
+ work = q.shift();
+ } else {
+ isAcquired = false;
+ return;
+ }
+ var m1 = new SingleAssignmentDisposable();
+ d.add(m1);
+ m1.setDisposable(work.subscribe(function (x) {
+ observer.onNext(x);
+ var result = null;
+ try {
+ result = selector(x);
+ } catch (e) {
+ observer.onError(e);
+ }
+ q.push(result);
+ activeCount++;
+ ensureActive();
+ }, observer.onError.bind(observer), function () {
+ d.remove(m1);
+ activeCount--;
+ if (activeCount === 0) {
+ observer.onCompleted();
+ }
+ }));
+ self();
+ }));
+ }
+ };
+
+ q.push(source);
+ activeCount++;
+ ensureActive();
+ return d;
+ }, this);
+ };
+
+ /**
+ * Runs all observable sequences in parallel and collect their last elements.
+ *
+ * @example
+ * 1 - res = Rx.Observable.forkJoin([obs1, obs2]);
+ * 1 - res = Rx.Observable.forkJoin(obs1, obs2, ...);
+ * @returns {Observable} An observable sequence with an array collecting the last elements of all the input sequences.
+ */
+ Observable.forkJoin = function () {
+ var allSources = [];
+ if (Array.isArray(arguments[0])) {
+ allSources = arguments[0];
+ } else {
+ for(var i = 0, len = arguments.length; i < len; i++) { allSources.push(arguments[i]); }
+ }
+ return new AnonymousObservable(function (subscriber) {
+ var count = allSources.length;
+ if (count === 0) {
+ subscriber.onCompleted();
+ return disposableEmpty;
+ }
+ var group = new CompositeDisposable(),
+ finished = false,
+ hasResults = new Array(count),
+ hasCompleted = new Array(count),
+ results = new Array(count);
+
+ for (var idx = 0; idx < count; idx++) {
+ (function (i) {
+ var source = allSources[i];
+ isPromise(source) && (source = observableFromPromise(source));
+ group.add(
+ source.subscribe(
+ function (value) {
+ if (!finished) {
+ hasResults[i] = true;
+ results[i] = value;
+ }
+ },
+ function (e) {
+ finished = true;
+ subscriber.onError(e);
+ group.dispose();
+ },
+ function () {
+ if (!finished) {
+ if (!hasResults[i]) {
+ subscriber.onCompleted();
+ return;
+ }
+ hasCompleted[i] = true;
+ for (var ix = 0; ix < count; ix++) {
+ if (!hasCompleted[ix]) { return; }
+ }
+ finished = true;
+ subscriber.onNext(results);
+ subscriber.onCompleted();
+ }
+ }));
+ })(idx);
+ }
+
+ return group;
+ });
+ };
+
+ /**
+ * Runs two observable sequences in parallel and combines their last elemenets.
+ *
+ * @param {Observable} second Second observable sequence.
+ * @param {Function} resultSelector Result selector function to invoke with the last elements of both sequences.
+ * @returns {Observable} An observable sequence with the result of calling the selector function with the last elements of both input sequences.
+ */
+ observableProto.forkJoin = function (second, resultSelector) {
+ var first = this;
+ return new AnonymousObservable(function (observer) {
+ var leftStopped = false, rightStopped = false,
+ hasLeft = false, hasRight = false,
+ lastLeft, lastRight,
+ leftSubscription = new SingleAssignmentDisposable(), rightSubscription = new SingleAssignmentDisposable();
+
+ isPromise(second) && (second = observableFromPromise(second));
+
+ leftSubscription.setDisposable(
+ first.subscribe(function (left) {
+ hasLeft = true;
+ lastLeft = left;
+ }, function (err) {
+ rightSubscription.dispose();
+ observer.onError(err);
+ }, function () {
+ leftStopped = true;
+ if (rightStopped) {
+ if (!hasLeft) {
+ observer.onCompleted();
+ } else if (!hasRight) {
+ observer.onCompleted();
+ } else {
+ var result;
+ try {
+ result = resultSelector(lastLeft, lastRight);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+ observer.onNext(result);
+ observer.onCompleted();
+ }
+ }
+ })
+ );
+
+ rightSubscription.setDisposable(
+ second.subscribe(function (right) {
+ hasRight = true;
+ lastRight = right;
+ }, function (err) {
+ leftSubscription.dispose();
+ observer.onError(err);
+ }, function () {
+ rightStopped = true;
+ if (leftStopped) {
+ if (!hasLeft) {
+ observer.onCompleted();
+ } else if (!hasRight) {
+ observer.onCompleted();
+ } else {
+ var result;
+ try {
+ result = resultSelector(lastLeft, lastRight);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+ observer.onNext(result);
+ observer.onCompleted();
+ }
+ }
+ })
+ );
+
+ return new CompositeDisposable(leftSubscription, rightSubscription);
+ }, first);
+ };
+
+ /**
+ * Comonadic bind operator.
+ * @param {Function} selector A transform function to apply to each element.
+ * @param {Object} scheduler Scheduler used to execute the operation. If not specified, defaults to the ImmediateScheduler.
+ * @returns {Observable} An observable sequence which results from the comonadic bind operation.
+ */
+ observableProto.manySelect = observableProto.extend = function (selector, scheduler) {
+ isScheduler(scheduler) || (scheduler = immediateScheduler);
+ var source = this;
+ return observableDefer(function () {
+ var chain;
+
+ return source
+ .map(function (x) {
+ var curr = new ChainObservable(x);
+
+ chain && chain.onNext(x);
+ chain = curr;
+
+ return curr;
+ })
+ .tap(
+ noop,
+ function (e) { chain && chain.onError(e); },
+ function () { chain && chain.onCompleted(); }
+ )
+ .observeOn(scheduler)
+ .map(selector);
+ }, source);
+ };
+
+ var ChainObservable = (function (__super__) {
+
+ function subscribe (observer) {
+ var self = this, g = new CompositeDisposable();
+ g.add(currentThreadScheduler.schedule(function () {
+ observer.onNext(self.head);
+ g.add(self.tail.mergeAll().subscribe(observer));
+ }));
+
+ return g;
+ }
+
+ inherits(ChainObservable, __super__);
+
+ function ChainObservable(head) {
+ __super__.call(this, subscribe);
+ this.head = head;
+ this.tail = new AsyncSubject();
+ }
+
+ addProperties(ChainObservable.prototype, Observer, {
+ onCompleted: function () {
+ this.onNext(Observable.empty());
+ },
+ onError: function (e) {
+ this.onNext(Observable.throwError(e));
+ },
+ onNext: function (v) {
+ this.tail.onNext(v);
+ this.tail.onCompleted();
+ }
+ });
+
+ return ChainObservable;
+
+ }(Observable));
+
+ /** @private */
+ var Map = root.Map || (function () {
+
+ function Map() {
+ this._keys = [];
+ this._values = [];
+ }
+
+ Map.prototype.get = function (key) {
+ var i = this._keys.indexOf(key);
+ return i !== -1 ? this._values[i] : undefined;
+ };
+
+ Map.prototype.set = function (key, value) {
+ var i = this._keys.indexOf(key);
+ i !== -1 && (this._values[i] = value);
+ this._values[this._keys.push(key) - 1] = value;
+ };
+
+ Map.prototype.forEach = function (callback, thisArg) {
+ for (var i = 0, len = this._keys.length; i < len; i++) {
+ callback.call(thisArg, this._values[i], this._keys[i]);
+ }
+ };
+
+ return Map;
+ }());
+
+ /**
+ * @constructor
+ * Represents a join pattern over observable sequences.
+ */
+ function Pattern(patterns) {
+ this.patterns = patterns;
+ }
+
+ /**
+ * Creates a pattern that matches the current plan matches and when the specified observable sequences has an available value.
+ * @param other Observable sequence to match in addition to the current pattern.
+ * @return {Pattern} Pattern object that matches when all observable sequences in the pattern have an available value.
+ */
+ Pattern.prototype.and = function (other) {
+ return new Pattern(this.patterns.concat(other));
+ };
+
+ /**
+ * Matches when all observable sequences in the pattern (specified using a chain of and operators) have an available value and projects the values.
+ * @param {Function} selector Selector that will be invoked with available values from the source sequences, in the same order of the sequences in the pattern.
+ * @return {Plan} Plan that produces the projected values, to be fed (with other plans) to the when operator.
+ */
+ Pattern.prototype.thenDo = function (selector) {
+ return new Plan(this, selector);
+ };
+
+ function Plan(expression, selector) {
+ this.expression = expression;
+ this.selector = selector;
+ }
+
+ Plan.prototype.activate = function (externalSubscriptions, observer, deactivate) {
+ var self = this;
+ var joinObservers = [];
+ for (var i = 0, len = this.expression.patterns.length; i < len; i++) {
+ joinObservers.push(planCreateObserver(externalSubscriptions, this.expression.patterns[i], observer.onError.bind(observer)));
+ }
+ var activePlan = new ActivePlan(joinObservers, function () {
+ var result;
+ try {
+ result = self.selector.apply(self, arguments);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+ observer.onNext(result);
+ }, function () {
+ for (var j = 0, jlen = joinObservers.length; j < jlen; j++) {
+ joinObservers[j].removeActivePlan(activePlan);
+ }
+ deactivate(activePlan);
+ });
+ for (i = 0, len = joinObservers.length; i < len; i++) {
+ joinObservers[i].addActivePlan(activePlan);
+ }
+ return activePlan;
+ };
+
+ function planCreateObserver(externalSubscriptions, observable, onError) {
+ var entry = externalSubscriptions.get(observable);
+ if (!entry) {
+ var observer = new JoinObserver(observable, onError);
+ externalSubscriptions.set(observable, observer);
+ return observer;
+ }
+ return entry;
+ }
+
+ function ActivePlan(joinObserverArray, onNext, onCompleted) {
+ this.joinObserverArray = joinObserverArray;
+ this.onNext = onNext;
+ this.onCompleted = onCompleted;
+ this.joinObservers = new Map();
+ for (var i = 0, len = this.joinObserverArray.length; i < len; i++) {
+ var joinObserver = this.joinObserverArray[i];
+ this.joinObservers.set(joinObserver, joinObserver);
+ }
+ }
+
+ ActivePlan.prototype.dequeue = function () {
+ this.joinObservers.forEach(function (v) { v.queue.shift(); });
+ };
+
+ ActivePlan.prototype.match = function () {
+ var i, len, hasValues = true;
+ for (i = 0, len = this.joinObserverArray.length; i < len; i++) {
+ if (this.joinObserverArray[i].queue.length === 0) {
+ hasValues = false;
+ break;
+ }
+ }
+ if (hasValues) {
+ var firstValues = [],
+ isCompleted = false;
+ for (i = 0, len = this.joinObserverArray.length; i < len; i++) {
+ firstValues.push(this.joinObserverArray[i].queue[0]);
+ this.joinObserverArray[i].queue[0].kind === 'C' && (isCompleted = true);
+ }
+ if (isCompleted) {
+ this.onCompleted();
+ } else {
+ this.dequeue();
+ var values = [];
+ for (i = 0, len = firstValues.length; i < firstValues.length; i++) {
+ values.push(firstValues[i].value);
+ }
+ this.onNext.apply(this, values);
+ }
+ }
+ };
+
+ var JoinObserver = (function (__super__) {
+ inherits(JoinObserver, __super__);
+
+ function JoinObserver(source, onError) {
+ __super__.call(this);
+ this.source = source;
+ this.onError = onError;
+ this.queue = [];
+ this.activePlans = [];
+ this.subscription = new SingleAssignmentDisposable();
+ this.isDisposed = false;
+ }
+
+ var JoinObserverPrototype = JoinObserver.prototype;
+
+ JoinObserverPrototype.next = function (notification) {
+ if (!this.isDisposed) {
+ if (notification.kind === 'E') {
+ return this.onError(notification.exception);
+ }
+ this.queue.push(notification);
+ var activePlans = this.activePlans.slice(0);
+ for (var i = 0, len = activePlans.length; i < len; i++) {
+ activePlans[i].match();
+ }
+ }
+ };
+
+ JoinObserverPrototype.error = noop;
+ JoinObserverPrototype.completed = noop;
+
+ JoinObserverPrototype.addActivePlan = function (activePlan) {
+ this.activePlans.push(activePlan);
+ };
+
+ JoinObserverPrototype.subscribe = function () {
+ this.subscription.setDisposable(this.source.materialize().subscribe(this));
+ };
+
+ JoinObserverPrototype.removeActivePlan = function (activePlan) {
+ this.activePlans.splice(this.activePlans.indexOf(activePlan), 1);
+ this.activePlans.length === 0 && this.dispose();
+ };
+
+ JoinObserverPrototype.dispose = function () {
+ __super__.prototype.dispose.call(this);
+ if (!this.isDisposed) {
+ this.isDisposed = true;
+ this.subscription.dispose();
+ }
+ };
+
+ return JoinObserver;
+ } (AbstractObserver));
+
+ /**
+ * Creates a pattern that matches when both observable sequences have an available value.
+ *
+ * @param right Observable sequence to match with the current sequence.
+ * @return {Pattern} Pattern object that matches when both observable sequences have an available value.
+ */
+ observableProto.and = function (right) {
+ return new Pattern([this, right]);
+ };
+
+ /**
+ * Matches when the observable sequence has an available value and projects the value.
+ *
+ * @param {Function} selector Selector that will be invoked for values in the source sequence.
+ * @returns {Plan} Plan that produces the projected values, to be fed (with other plans) to the when operator.
+ */
+ observableProto.thenDo = function (selector) {
+ return new Pattern([this]).thenDo(selector);
+ };
+
+ /**
+ * Joins together the results from several patterns.
+ *
+ * @param plans A series of plans (specified as an Array of as a series of arguments) created by use of the Then operator on patterns.
+ * @returns {Observable} Observable sequence with the results form matching several patterns.
+ */
+ Observable.when = function () {
+ var len = arguments.length, plans;
+ if (Array.isArray(arguments[0])) {
+ plans = arguments[0];
+ } else {
+ plans = new Array(len);
+ for(var i = 0; i < len; i++) { plans[i] = arguments[i]; }
+ }
+ return new AnonymousObservable(function (o) {
+ var activePlans = [],
+ externalSubscriptions = new Map();
+ var outObserver = observerCreate(
+ function (x) { o.onNext(x); },
+ function (err) {
+ externalSubscriptions.forEach(function (v) { v.onError(err); });
+ o.onError(err);
+ },
+ function (x) { o.onCompleted(); }
+ );
+ try {
+ for (var i = 0, len = plans.length; i < len; i++) {
+ activePlans.push(plans[i].activate(externalSubscriptions, outObserver, function (activePlan) {
+ var idx = activePlans.indexOf(activePlan);
+ activePlans.splice(idx, 1);
+ activePlans.length === 0 && o.onCompleted();
+ }));
+ }
+ } catch (e) {
+ observableThrow(e).subscribe(o);
+ }
+ var group = new CompositeDisposable();
+ externalSubscriptions.forEach(function (joinObserver) {
+ joinObserver.subscribe();
+ group.add(joinObserver);
+ });
+
+ return group;
+ });
+ };
+
+ function observableTimerDate(dueTime, scheduler) {
+ return new AnonymousObservable(function (observer) {
+ return scheduler.scheduleWithAbsolute(dueTime, function () {
+ observer.onNext(0);
+ observer.onCompleted();
+ });
+ });
+ }
+
+ function observableTimerDateAndPeriod(dueTime, period, scheduler) {
+ return new AnonymousObservable(function (observer) {
+ var d = dueTime, p = normalizeTime(period);
+ return scheduler.scheduleRecursiveWithAbsoluteAndState(0, d, function (count, self) {
+ if (p > 0) {
+ var now = scheduler.now();
+ d = d + p;
+ d <= now && (d = now + p);
+ }
+ observer.onNext(count);
+ self(count + 1, d);
+ });
+ });
+ }
+
+ function observableTimerTimeSpan(dueTime, scheduler) {
+ return new AnonymousObservable(function (observer) {
+ return scheduler.scheduleWithRelative(normalizeTime(dueTime), function () {
+ observer.onNext(0);
+ observer.onCompleted();
+ });
+ });
+ }
+
+ function observableTimerTimeSpanAndPeriod(dueTime, period, scheduler) {
+ return dueTime === period ?
+ new AnonymousObservable(function (observer) {
+ return scheduler.schedulePeriodicWithState(0, period, function (count) {
+ observer.onNext(count);
+ return count + 1;
+ });
+ }) :
+ observableDefer(function () {
+ return observableTimerDateAndPeriod(scheduler.now() + dueTime, period, scheduler);
+ });
+ }
+
+ /**
+ * Returns an observable sequence that produces a value after each period.
+ *
+ * @example
+ * 1 - res = Rx.Observable.interval(1000);
+ * 2 - res = Rx.Observable.interval(1000, Rx.Scheduler.timeout);
+ *
+ * @param {Number} period Period for producing the values in the resulting sequence (specified as an integer denoting milliseconds).
+ * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, Rx.Scheduler.timeout is used.
+ * @returns {Observable} An observable sequence that produces a value after each period.
+ */
+ var observableinterval = Observable.interval = function (period, scheduler) {
+ return observableTimerTimeSpanAndPeriod(period, period, isScheduler(scheduler) ? scheduler : timeoutScheduler);
+ };
+
+ /**
+ * Returns an observable sequence that produces a value after dueTime has elapsed and then after each period.
+ * @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) at which to produce the first value.
+ * @param {Mixed} [periodOrScheduler] Period to produce subsequent values (specified as an integer denoting milliseconds), or the scheduler to run the timer on. If not specified, the resulting timer is not recurring.
+ * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, the timeout scheduler is used.
+ * @returns {Observable} An observable sequence that produces a value after due time has elapsed and then each period.
+ */
+ var observableTimer = Observable.timer = function (dueTime, periodOrScheduler, scheduler) {
+ var period;
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ if (periodOrScheduler !== undefined && typeof periodOrScheduler === 'number') {
+ period = periodOrScheduler;
+ } else if (isScheduler(periodOrScheduler)) {
+ scheduler = periodOrScheduler;
+ }
+ if (dueTime instanceof Date && period === undefined) {
+ return observableTimerDate(dueTime.getTime(), scheduler);
+ }
+ if (dueTime instanceof Date && period !== undefined) {
+ period = periodOrScheduler;
+ return observableTimerDateAndPeriod(dueTime.getTime(), period, scheduler);
+ }
+ return period === undefined ?
+ observableTimerTimeSpan(dueTime, scheduler) :
+ observableTimerTimeSpanAndPeriod(dueTime, period, scheduler);
+ };
+
+ function observableDelayTimeSpan(source, dueTime, scheduler) {
+ return new AnonymousObservable(function (observer) {
+ var active = false,
+ cancelable = new SerialDisposable(),
+ exception = null,
+ q = [],
+ running = false,
+ subscription;
+ subscription = source.materialize().timestamp(scheduler).subscribe(function (notification) {
+ var d, shouldRun;
+ if (notification.value.kind === 'E') {
+ q = [];
+ q.push(notification);
+ exception = notification.value.exception;
+ shouldRun = !running;
+ } else {
+ q.push({ value: notification.value, timestamp: notification.timestamp + dueTime });
+ shouldRun = !active;
+ active = true;
+ }
+ if (shouldRun) {
+ if (exception !== null) {
+ observer.onError(exception);
+ } else {
+ d = new SingleAssignmentDisposable();
+ cancelable.setDisposable(d);
+ d.setDisposable(scheduler.scheduleRecursiveWithRelative(dueTime, function (self) {
+ var e, recurseDueTime, result, shouldRecurse;
+ if (exception !== null) {
+ return;
+ }
+ running = true;
+ do {
+ result = null;
+ if (q.length > 0 && q[0].timestamp - scheduler.now() <= 0) {
+ result = q.shift().value;
+ }
+ if (result !== null) {
+ result.accept(observer);
+ }
+ } while (result !== null);
+ shouldRecurse = false;
+ recurseDueTime = 0;
+ if (q.length > 0) {
+ shouldRecurse = true;
+ recurseDueTime = Math.max(0, q[0].timestamp - scheduler.now());
+ } else {
+ active = false;
+ }
+ e = exception;
+ running = false;
+ if (e !== null) {
+ observer.onError(e);
+ } else if (shouldRecurse) {
+ self(recurseDueTime);
+ }
+ }));
+ }
+ }
+ });
+ return new CompositeDisposable(subscription, cancelable);
+ }, source);
+ }
+
+ function observableDelayDate(source, dueTime, scheduler) {
+ return observableDefer(function () {
+ return observableDelayTimeSpan(source, dueTime - scheduler.now(), scheduler);
+ });
+ }
+
+ /**
+ * Time shifts the observable sequence by dueTime. The relative time intervals between the values are preserved.
+ *
+ * @example
+ * 1 - res = Rx.Observable.delay(new Date());
+ * 2 - res = Rx.Observable.delay(new Date(), Rx.Scheduler.timeout);
+ *
+ * 3 - res = Rx.Observable.delay(5000);
+ * 4 - res = Rx.Observable.delay(5000, 1000, Rx.Scheduler.timeout);
+ * @memberOf Observable#
+ * @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) by which to shift the observable sequence.
+ * @param {Scheduler} [scheduler] Scheduler to run the delay timers on. If not specified, the timeout scheduler is used.
+ * @returns {Observable} Time-shifted sequence.
+ */
+ observableProto.delay = function (dueTime, scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return dueTime instanceof Date ?
+ observableDelayDate(this, dueTime.getTime(), scheduler) :
+ observableDelayTimeSpan(this, dueTime, scheduler);
+ };
+
+ /**
+ * Ignores values from an observable sequence which are followed by another value before dueTime.
+ * @param {Number} dueTime Duration of the debounce period for each value (specified as an integer denoting milliseconds).
+ * @param {Scheduler} [scheduler] Scheduler to run the debounce timers on. If not specified, the timeout scheduler is used.
+ * @returns {Observable} The debounced sequence.
+ */
+ observableProto.debounce = observableProto.throttleWithTimeout = function (dueTime, scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ var cancelable = new SerialDisposable(), hasvalue = false, value, id = 0;
+ var subscription = source.subscribe(
+ function (x) {
+ hasvalue = true;
+ value = x;
+ id++;
+ var currentId = id,
+ d = new SingleAssignmentDisposable();
+ cancelable.setDisposable(d);
+ d.setDisposable(scheduler.scheduleWithRelative(dueTime, function () {
+ hasvalue && id === currentId && observer.onNext(value);
+ hasvalue = false;
+ }));
+ },
+ function (e) {
+ cancelable.dispose();
+ observer.onError(e);
+ hasvalue = false;
+ id++;
+ },
+ function () {
+ cancelable.dispose();
+ hasvalue && observer.onNext(value);
+ observer.onCompleted();
+ hasvalue = false;
+ id++;
+ });
+ return new CompositeDisposable(subscription, cancelable);
+ }, this);
+ };
+
+ /**
+ * @deprecated use #debounce or #throttleWithTimeout instead.
+ */
+ observableProto.throttle = function(dueTime, scheduler) {
+ //deprecate('throttle', 'debounce or throttleWithTimeout');
+ return this.debounce(dueTime, scheduler);
+ };
+
+ /**
+ * Projects each element of an observable sequence into zero or more windows which are produced based on timing information.
+ * @param {Number} timeSpan Length of each window (specified as an integer denoting milliseconds).
+ * @param {Mixed} [timeShiftOrScheduler] Interval between creation of consecutive windows (specified as an integer denoting milliseconds), or an optional scheduler parameter. If not specified, the time shift corresponds to the timeSpan parameter, resulting in non-overlapping adjacent windows.
+ * @param {Scheduler} [scheduler] Scheduler to run windowing timers on. If not specified, the timeout scheduler is used.
+ * @returns {Observable} An observable sequence of windows.
+ */
+ observableProto.windowWithTime = function (timeSpan, timeShiftOrScheduler, scheduler) {
+ var source = this, timeShift;
+ timeShiftOrScheduler == null && (timeShift = timeSpan);
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ if (typeof timeShiftOrScheduler === 'number') {
+ timeShift = timeShiftOrScheduler;
+ } else if (isScheduler(timeShiftOrScheduler)) {
+ timeShift = timeSpan;
+ scheduler = timeShiftOrScheduler;
+ }
+ return new AnonymousObservable(function (observer) {
+ var groupDisposable,
+ nextShift = timeShift,
+ nextSpan = timeSpan,
+ q = [],
+ refCountDisposable,
+ timerD = new SerialDisposable(),
+ totalTime = 0;
+ groupDisposable = new CompositeDisposable(timerD),
+ refCountDisposable = new RefCountDisposable(groupDisposable);
+
+ function createTimer () {
+ var m = new SingleAssignmentDisposable(),
+ isSpan = false,
+ isShift = false;
+ timerD.setDisposable(m);
+ if (nextSpan === nextShift) {
+ isSpan = true;
+ isShift = true;
+ } else if (nextSpan < nextShift) {
+ isSpan = true;
+ } else {
+ isShift = true;
+ }
+ var newTotalTime = isSpan ? nextSpan : nextShift,
+ ts = newTotalTime - totalTime;
+ totalTime = newTotalTime;
+ if (isSpan) {
+ nextSpan += timeShift;
+ }
+ if (isShift) {
+ nextShift += timeShift;
+ }
+ m.setDisposable(scheduler.scheduleWithRelative(ts, function () {
+ if (isShift) {
+ var s = new Subject();
+ q.push(s);
+ observer.onNext(addRef(s, refCountDisposable));
+ }
+ isSpan && q.shift().onCompleted();
+ createTimer();
+ }));
+ };
+ q.push(new Subject());
+ observer.onNext(addRef(q[0], refCountDisposable));
+ createTimer();
+ groupDisposable.add(source.subscribe(
+ function (x) {
+ for (var i = 0, len = q.length; i < len; i++) { q[i].onNext(x); }
+ },
+ function (e) {
+ for (var i = 0, len = q.length; i < len; i++) { q[i].onError(e); }
+ observer.onError(e);
+ },
+ function () {
+ for (var i = 0, len = q.length; i < len; i++) { q[i].onCompleted(); }
+ observer.onCompleted();
+ }
+ ));
+ return refCountDisposable;
+ }, source);
+ };
+
+ /**
+ * Projects each element of an observable sequence into a window that is completed when either it's full or a given amount of time has elapsed.
+ * @param {Number} timeSpan Maximum time length of a window.
+ * @param {Number} count Maximum element count of a window.
+ * @param {Scheduler} [scheduler] Scheduler to run windowing timers on. If not specified, the timeout scheduler is used.
+ * @returns {Observable} An observable sequence of windows.
+ */
+ observableProto.windowWithTimeOrCount = function (timeSpan, count, scheduler) {
+ var source = this;
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return new AnonymousObservable(function (observer) {
+ var timerD = new SerialDisposable(),
+ groupDisposable = new CompositeDisposable(timerD),
+ refCountDisposable = new RefCountDisposable(groupDisposable),
+ n = 0,
+ windowId = 0,
+ s = new Subject();
+
+ function createTimer(id) {
+ var m = new SingleAssignmentDisposable();
+ timerD.setDisposable(m);
+ m.setDisposable(scheduler.scheduleWithRelative(timeSpan, function () {
+ if (id !== windowId) { return; }
+ n = 0;
+ var newId = ++windowId;
+ s.onCompleted();
+ s = new Subject();
+ observer.onNext(addRef(s, refCountDisposable));
+ createTimer(newId);
+ }));
+ }
+
+ observer.onNext(addRef(s, refCountDisposable));
+ createTimer(0);
+
+ groupDisposable.add(source.subscribe(
+ function (x) {
+ var newId = 0, newWindow = false;
+ s.onNext(x);
+ if (++n === count) {
+ newWindow = true;
+ n = 0;
+ newId = ++windowId;
+ s.onCompleted();
+ s = new Subject();
+ observer.onNext(addRef(s, refCountDisposable));
+ }
+ newWindow && createTimer(newId);
+ },
+ function (e) {
+ s.onError(e);
+ observer.onError(e);
+ }, function () {
+ s.onCompleted();
+ observer.onCompleted();
+ }
+ ));
+ return refCountDisposable;
+ }, source);
+ };
+
+ /**
+ * Projects each element of an observable sequence into zero or more buffers which are produced based on timing information.
+ *
+ * @example
+ * 1 - res = xs.bufferWithTime(1000, scheduler); // non-overlapping segments of 1 second
+ * 2 - res = xs.bufferWithTime(1000, 500, scheduler; // segments of 1 second with time shift 0.5 seconds
+ *
+ * @param {Number} timeSpan Length of each buffer (specified as an integer denoting milliseconds).
+ * @param {Mixed} [timeShiftOrScheduler] Interval between creation of consecutive buffers (specified as an integer denoting milliseconds), or an optional scheduler parameter. If not specified, the time shift corresponds to the timeSpan parameter, resulting in non-overlapping adjacent buffers.
+ * @param {Scheduler} [scheduler] Scheduler to run buffer timers on. If not specified, the timeout scheduler is used.
+ * @returns {Observable} An observable sequence of buffers.
+ */
+ observableProto.bufferWithTime = function (timeSpan, timeShiftOrScheduler, scheduler) {
+ return this.windowWithTime.apply(this, arguments).selectMany(function (x) { return x.toArray(); });
+ };
+
+ /**
+ * Projects each element of an observable sequence into a buffer that is completed when either it's full or a given amount of time has elapsed.
+ *
+ * @example
+ * 1 - res = source.bufferWithTimeOrCount(5000, 50); // 5s or 50 items in an array
+ * 2 - res = source.bufferWithTimeOrCount(5000, 50, scheduler); // 5s or 50 items in an array
+ *
+ * @param {Number} timeSpan Maximum time length of a buffer.
+ * @param {Number} count Maximum element count of a buffer.
+ * @param {Scheduler} [scheduler] Scheduler to run bufferin timers on. If not specified, the timeout scheduler is used.
+ * @returns {Observable} An observable sequence of buffers.
+ */
+ observableProto.bufferWithTimeOrCount = function (timeSpan, count, scheduler) {
+ return this.windowWithTimeOrCount(timeSpan, count, scheduler).selectMany(function (x) {
+ return x.toArray();
+ });
+ };
+
+ /**
+ * Records the time interval between consecutive values in an observable sequence.
+ *
+ * @example
+ * 1 - res = source.timeInterval();
+ * 2 - res = source.timeInterval(Rx.Scheduler.timeout);
+ *
+ * @param [scheduler] Scheduler used to compute time intervals. If not specified, the timeout scheduler is used.
+ * @returns {Observable} An observable sequence with time interval information on values.
+ */
+ observableProto.timeInterval = function (scheduler) {
+ var source = this;
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return observableDefer(function () {
+ var last = scheduler.now();
+ return source.map(function (x) {
+ var now = scheduler.now(), span = now - last;
+ last = now;
+ return { value: x, interval: span };
+ });
+ });
+ };
+
+ /**
+ * Records the timestamp for each value in an observable sequence.
+ *
+ * @example
+ * 1 - res = source.timestamp(); // produces { value: x, timestamp: ts }
+ * 2 - res = source.timestamp(Rx.Scheduler.default);
+ *
+ * @param {Scheduler} [scheduler] Scheduler used to compute timestamps. If not specified, the default scheduler is used.
+ * @returns {Observable} An observable sequence with timestamp information on values.
+ */
+ observableProto.timestamp = function (scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return this.map(function (x) {
+ return { value: x, timestamp: scheduler.now() };
+ });
+ };
+
+ function sampleObservable(source, sampler) {
+ return new AnonymousObservable(function (o) {
+ var atEnd = false, value, hasValue = false;
+
+ function sampleSubscribe() {
+ if (hasValue) {
+ hasValue = false;
+ o.onNext(value);
+ }
+ atEnd && o.onCompleted();
+ }
+
+ var sourceSubscription = new SingleAssignmentDisposable();
+ sourceSubscription.setDisposable(source.subscribe(
+ function (newValue) {
+ hasValue = true;
+ value = newValue;
+ },
+ function (e) { o.onError(e); },
+ function () {
+ atEnd = true;
+ sourceSubscription.dispose();
+ }
+ ));
+
+ return new CompositeDisposable(
+ sourceSubscription,
+ sampler.subscribe(sampleSubscribe, function (e) { o.onError(e); }, sampleSubscribe)
+ );
+ }, source);
+ }
+
+ /**
+ * Samples the observable sequence at each interval.
+ *
+ * @example
+ * 1 - res = source.sample(sampleObservable); // Sampler tick sequence
+ * 2 - res = source.sample(5000); // 5 seconds
+ * 2 - res = source.sample(5000, Rx.Scheduler.timeout); // 5 seconds
+ *
+ * @param {Mixed} intervalOrSampler Interval at which to sample (specified as an integer denoting milliseconds) or Sampler Observable.
+ * @param {Scheduler} [scheduler] Scheduler to run the sampling timer on. If not specified, the timeout scheduler is used.
+ * @returns {Observable} Sampled observable sequence.
+ */
+ observableProto.sample = observableProto.throttleLatest = function (intervalOrSampler, scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return typeof intervalOrSampler === 'number' ?
+ sampleObservable(this, observableinterval(intervalOrSampler, scheduler)) :
+ sampleObservable(this, intervalOrSampler);
+ };
+
+ /**
+ * Returns the source observable sequence or the other observable sequence if dueTime elapses.
+ * @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) when a timeout occurs.
+ * @param {Observable} [other] Sequence to return in case of a timeout. If not specified, a timeout error throwing sequence will be used.
+ * @param {Scheduler} [scheduler] Scheduler to run the timeout timers on. If not specified, the timeout scheduler is used.
+ * @returns {Observable} The source sequence switching to the other sequence in case of a timeout.
+ */
+ observableProto.timeout = function (dueTime, other, scheduler) {
+ (other == null || typeof other === 'string') && (other = observableThrow(new Error(other || 'Timeout')));
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+
+ var source = this, schedulerMethod = dueTime instanceof Date ?
+ 'scheduleWithAbsolute' :
+ 'scheduleWithRelative';
+
+ return new AnonymousObservable(function (observer) {
+ var id = 0,
+ original = new SingleAssignmentDisposable(),
+ subscription = new SerialDisposable(),
+ switched = false,
+ timer = new SerialDisposable();
+
+ subscription.setDisposable(original);
+
+ function createTimer() {
+ var myId = id;
+ timer.setDisposable(scheduler[schedulerMethod](dueTime, function () {
+ if (id === myId) {
+ isPromise(other) && (other = observableFromPromise(other));
+ subscription.setDisposable(other.subscribe(observer));
+ }
+ }));
+ }
+
+ createTimer();
+
+ original.setDisposable(source.subscribe(function (x) {
+ if (!switched) {
+ id++;
+ observer.onNext(x);
+ createTimer();
+ }
+ }, function (e) {
+ if (!switched) {
+ id++;
+ observer.onError(e);
+ }
+ }, function () {
+ if (!switched) {
+ id++;
+ observer.onCompleted();
+ }
+ }));
+ return new CompositeDisposable(subscription, timer);
+ }, source);
+ };
+
+ /**
+ * Generates an observable sequence by iterating a state from an initial state until the condition fails.
+ *
+ * @example
+ * res = source.generateWithAbsoluteTime(0,
+ * function (x) { return return true; },
+ * function (x) { return x + 1; },
+ * function (x) { return x; },
+ * function (x) { return new Date(); }
+ * });
+ *
+ * @param {Mixed} initialState Initial state.
+ * @param {Function} condition Condition to terminate generation (upon returning false).
+ * @param {Function} iterate Iteration step function.
+ * @param {Function} resultSelector Selector function for results produced in the sequence.
+ * @param {Function} timeSelector Time selector function to control the speed of values being produced each iteration, returning Date values.
+ * @param {Scheduler} [scheduler] Scheduler on which to run the generator loop. If not specified, the timeout scheduler is used.
+ * @returns {Observable} The generated sequence.
+ */
+ Observable.generateWithAbsoluteTime = function (initialState, condition, iterate, resultSelector, timeSelector, scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return new AnonymousObservable(function (observer) {
+ var first = true,
+ hasResult = false;
+ return scheduler.scheduleRecursiveWithAbsoluteAndState(initialState, scheduler.now(), function (state, self) {
+ hasResult && observer.onNext(state);
+
+ try {
+ if (first) {
+ first = false;
+ } else {
+ state = iterate(state);
+ }
+ hasResult = condition(state);
+ if (hasResult) {
+ var result = resultSelector(state);
+ var time = timeSelector(state);
+ }
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+ if (hasResult) {
+ self(result, time);
+ } else {
+ observer.onCompleted();
+ }
+ });
+ });
+ };
+
+ /**
+ * Generates an observable sequence by iterating a state from an initial state until the condition fails.
+ *
+ * @example
+ * res = source.generateWithRelativeTime(0,
+ * function (x) { return return true; },
+ * function (x) { return x + 1; },
+ * function (x) { return x; },
+ * function (x) { return 500; }
+ * );
+ *
+ * @param {Mixed} initialState Initial state.
+ * @param {Function} condition Condition to terminate generation (upon returning false).
+ * @param {Function} iterate Iteration step function.
+ * @param {Function} resultSelector Selector function for results produced in the sequence.
+ * @param {Function} timeSelector Time selector function to control the speed of values being produced each iteration, returning integer values denoting milliseconds.
+ * @param {Scheduler} [scheduler] Scheduler on which to run the generator loop. If not specified, the timeout scheduler is used.
+ * @returns {Observable} The generated sequence.
+ */
+ Observable.generateWithRelativeTime = function (initialState, condition, iterate, resultSelector, timeSelector, scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return new AnonymousObservable(function (observer) {
+ var first = true,
+ hasResult = false;
+ return scheduler.scheduleRecursiveWithRelativeAndState(initialState, 0, function (state, self) {
+ hasResult && observer.onNext(state);
+
+ try {
+ if (first) {
+ first = false;
+ } else {
+ state = iterate(state);
+ }
+ hasResult = condition(state);
+ if (hasResult) {
+ var result = resultSelector(state);
+ var time = timeSelector(state);
+ }
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+ if (hasResult) {
+ self(result, time);
+ } else {
+ observer.onCompleted();
+ }
+ });
+ });
+ };
+
+ /**
+ * Time shifts the observable sequence by delaying the subscription with the specified relative time duration, using the specified scheduler to run timers.
+ *
+ * @example
+ * 1 - res = source.delaySubscription(5000); // 5s
+ * 2 - res = source.delaySubscription(5000, Rx.Scheduler.default); // 5 seconds
+ *
+ * @param {Number} dueTime Relative or absolute time shift of the subscription.
+ * @param {Scheduler} [scheduler] Scheduler to run the subscription delay timer on. If not specified, the timeout scheduler is used.
+ * @returns {Observable} Time-shifted sequence.
+ */
+ observableProto.delaySubscription = function (dueTime, scheduler) {
+ var scheduleMethod = dueTime instanceof Date ? 'scheduleWithAbsolute' : 'scheduleWithRelative';
+ var source = this;
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return new AnonymousObservable(function (o) {
+ var d = new SerialDisposable();
+
+ d.setDisposable(scheduler[scheduleMethod](dueTime, function() {
+ d.setDisposable(source.subscribe(o));
+ }));
+
+ return d;
+ }, this);
+ };
+
+ /**
+ * Time shifts the observable sequence based on a subscription delay and a delay selector function for each element.
+ *
+ * @example
+ * 1 - res = source.delayWithSelector(function (x) { return Rx.Scheduler.timer(5000); }); // with selector only
+ * 1 - res = source.delayWithSelector(Rx.Observable.timer(2000), function (x) { return Rx.Observable.timer(x); }); // with delay and selector
+ *
+ * @param {Observable} [subscriptionDelay] Sequence indicating the delay for the subscription to the source.
+ * @param {Function} delayDurationSelector Selector function to retrieve a sequence indicating the delay for each given element.
+ * @returns {Observable} Time-shifted sequence.
+ */
+ observableProto.delayWithSelector = function (subscriptionDelay, delayDurationSelector) {
+ var source = this, subDelay, selector;
+ if (isFunction(subscriptionDelay)) {
+ selector = subscriptionDelay;
+ } else {
+ subDelay = subscriptionDelay;
+ selector = delayDurationSelector;
+ }
+ return new AnonymousObservable(function (observer) {
+ var delays = new CompositeDisposable(), atEnd = false, subscription = new SerialDisposable();
+
+ function start() {
+ subscription.setDisposable(source.subscribe(
+ function (x) {
+ var delay = tryCatch(selector)(x);
+ if (delay === errorObj) { return observer.onError(delay.e); }
+ var d = new SingleAssignmentDisposable();
+ delays.add(d);
+ d.setDisposable(delay.subscribe(
+ function () {
+ observer.onNext(x);
+ delays.remove(d);
+ done();
+ },
+ function (e) { observer.onError(e); },
+ function () {
+ observer.onNext(x);
+ delays.remove(d);
+ done();
+ }
+ ))
+ },
+ function (e) { observer.onError(e); },
+ function () {
+ atEnd = true;
+ subscription.dispose();
+ done();
+ }
+ ))
+ }
+
+ function done () {
+ atEnd && delays.length === 0 && observer.onCompleted();
+ }
+
+ if (!subDelay) {
+ start();
+ } else {
+ subscription.setDisposable(subDelay.subscribe(start, function (e) { observer.onError(e); }, start));
+ }
+
+ return new CompositeDisposable(subscription, delays);
+ }, this);
+ };
+
+ /**
+ * Returns the source observable sequence, switching to the other observable sequence if a timeout is signaled.
+ * @param {Observable} [firstTimeout] Observable sequence that represents the timeout for the first element. If not provided, this defaults to Observable.never().
+ * @param {Function} timeoutDurationSelector Selector to retrieve an observable sequence that represents the timeout between the current element and the next element.
+ * @param {Observable} [other] Sequence to return in case of a timeout. If not provided, this is set to Observable.throwException().
+ * @returns {Observable} The source sequence switching to the other sequence in case of a timeout.
+ */
+ observableProto.timeoutWithSelector = function (firstTimeout, timeoutdurationSelector, other) {
+ if (arguments.length === 1) {
+ timeoutdurationSelector = firstTimeout;
+ firstTimeout = observableNever();
+ }
+ other || (other = observableThrow(new Error('Timeout')));
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ var subscription = new SerialDisposable(), timer = new SerialDisposable(), original = new SingleAssignmentDisposable();
+
+ subscription.setDisposable(original);
+
+ var id = 0, switched = false;
+
+ function setTimer(timeout) {
+ var myId = id;
+
+ function timerWins () {
+ return id === myId;
+ }
+
+ var d = new SingleAssignmentDisposable();
+ timer.setDisposable(d);
+ d.setDisposable(timeout.subscribe(function () {
+ timerWins() && subscription.setDisposable(other.subscribe(observer));
+ d.dispose();
+ }, function (e) {
+ timerWins() && observer.onError(e);
+ }, function () {
+ timerWins() && subscription.setDisposable(other.subscribe(observer));
+ }));
+ };
+
+ setTimer(firstTimeout);
+
+ function observerWins() {
+ var res = !switched;
+ if (res) { id++; }
+ return res;
+ }
+
+ original.setDisposable(source.subscribe(function (x) {
+ if (observerWins()) {
+ observer.onNext(x);
+ var timeout;
+ try {
+ timeout = timeoutdurationSelector(x);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+ setTimer(isPromise(timeout) ? observableFromPromise(timeout) : timeout);
+ }
+ }, function (e) {
+ observerWins() && observer.onError(e);
+ }, function () {
+ observerWins() && observer.onCompleted();
+ }));
+ return new CompositeDisposable(subscription, timer);
+ }, source);
+ };
+
+ /**
+ * Ignores values from an observable sequence which are followed by another value within a computed throttle duration.
+ * @param {Function} durationSelector Selector function to retrieve a sequence indicating the throttle duration for each given element.
+ * @returns {Observable} The debounced sequence.
+ */
+ observableProto.debounceWithSelector = function (durationSelector) {
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ var value, hasValue = false, cancelable = new SerialDisposable(), id = 0;
+ var subscription = source.subscribe(function (x) {
+ var throttle;
+ try {
+ throttle = durationSelector(x);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+
+ isPromise(throttle) && (throttle = observableFromPromise(throttle));
+
+ hasValue = true;
+ value = x;
+ id++;
+ var currentid = id, d = new SingleAssignmentDisposable();
+ cancelable.setDisposable(d);
+ d.setDisposable(throttle.subscribe(function () {
+ hasValue && id === currentid && observer.onNext(value);
+ hasValue = false;
+ d.dispose();
+ }, observer.onError.bind(observer), function () {
+ hasValue && id === currentid && observer.onNext(value);
+ hasValue = false;
+ d.dispose();
+ }));
+ }, function (e) {
+ cancelable.dispose();
+ observer.onError(e);
+ hasValue = false;
+ id++;
+ }, function () {
+ cancelable.dispose();
+ hasValue && observer.onNext(value);
+ observer.onCompleted();
+ hasValue = false;
+ id++;
+ });
+ return new CompositeDisposable(subscription, cancelable);
+ }, source);
+ };
+
+ /**
+ * @deprecated use #debounceWithSelector instead.
+ */
+ observableProto.throttleWithSelector = function (durationSelector) {
+ //deprecate('throttleWithSelector', 'debounceWithSelector');
+ return this.debounceWithSelector(durationSelector);
+ };
+
+ /**
+ * Skips elements for the specified duration from the end of the observable source sequence, using the specified scheduler to run timers.
+ *
+ * 1 - res = source.skipLastWithTime(5000);
+ * 2 - res = source.skipLastWithTime(5000, scheduler);
+ *
+ * @description
+ * This operator accumulates a queue with a length enough to store elements received during the initial duration window.
+ * As more elements are received, elements older than the specified duration are taken from the queue and produced on the
+ * result sequence. This causes elements to be delayed with duration.
+ * @param {Number} duration Duration for skipping elements from the end of the sequence.
+ * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout
+ * @returns {Observable} An observable sequence with the elements skipped during the specified duration from the end of the source sequence.
+ */
+ observableProto.skipLastWithTime = function (duration, scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var q = [];
+ return source.subscribe(function (x) {
+ var now = scheduler.now();
+ q.push({ interval: now, value: x });
+ while (q.length > 0 && now - q[0].interval >= duration) {
+ o.onNext(q.shift().value);
+ }
+ }, function (e) { o.onError(e); }, function () {
+ var now = scheduler.now();
+ while (q.length > 0 && now - q[0].interval >= duration) {
+ o.onNext(q.shift().value);
+ }
+ o.onCompleted();
+ });
+ }, source);
+ };
+
+ /**
+ * Returns elements within the specified duration from the end of the observable source sequence, using the specified schedulers to run timers and to drain the collected elements.
+ * @description
+ * This operator accumulates a queue with a length enough to store elements received during the initial duration window.
+ * As more elements are received, elements older than the specified duration are taken from the queue and produced on the
+ * result sequence. This causes elements to be delayed with duration.
+ * @param {Number} duration Duration for taking elements from the end of the sequence.
+ * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout.
+ * @returns {Observable} An observable sequence with the elements taken during the specified duration from the end of the source sequence.
+ */
+ observableProto.takeLastWithTime = function (duration, scheduler) {
+ var source = this;
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return new AnonymousObservable(function (o) {
+ var q = [];
+ return source.subscribe(function (x) {
+ var now = scheduler.now();
+ q.push({ interval: now, value: x });
+ while (q.length > 0 && now - q[0].interval >= duration) {
+ q.shift();
+ }
+ }, function (e) { o.onError(e); }, function () {
+ var now = scheduler.now();
+ while (q.length > 0) {
+ var next = q.shift();
+ if (now - next.interval <= duration) { o.onNext(next.value); }
+ }
+ o.onCompleted();
+ });
+ }, source);
+ };
+
+ /**
+ * Returns an array with the elements within the specified duration from the end of the observable source sequence, using the specified scheduler to run timers.
+ * @description
+ * This operator accumulates a queue with a length enough to store elements received during the initial duration window.
+ * As more elements are received, elements older than the specified duration are taken from the queue and produced on the
+ * result sequence. This causes elements to be delayed with duration.
+ * @param {Number} duration Duration for taking elements from the end of the sequence.
+ * @param {Scheduler} scheduler Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout.
+ * @returns {Observable} An observable sequence containing a single array with the elements taken during the specified duration from the end of the source sequence.
+ */
+ observableProto.takeLastBufferWithTime = function (duration, scheduler) {
+ var source = this;
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return new AnonymousObservable(function (o) {
+ var q = [];
+ return source.subscribe(function (x) {
+ var now = scheduler.now();
+ q.push({ interval: now, value: x });
+ while (q.length > 0 && now - q[0].interval >= duration) {
+ q.shift();
+ }
+ }, function (e) { o.onError(e); }, function () {
+ var now = scheduler.now(), res = [];
+ while (q.length > 0) {
+ var next = q.shift();
+ now - next.interval <= duration && res.push(next.value);
+ }
+ o.onNext(res);
+ o.onCompleted();
+ });
+ }, source);
+ };
+
+ /**
+ * Takes elements for the specified duration from the start of the observable source sequence, using the specified scheduler to run timers.
+ *
+ * @example
+ * 1 - res = source.takeWithTime(5000, [optional scheduler]);
+ * @description
+ * This operator accumulates a queue with a length enough to store elements received during the initial duration window.
+ * As more elements are received, elements older than the specified duration are taken from the queue and produced on the
+ * result sequence. This causes elements to be delayed with duration.
+ * @param {Number} duration Duration for taking elements from the start of the sequence.
+ * @param {Scheduler} scheduler Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout.
+ * @returns {Observable} An observable sequence with the elements taken during the specified duration from the start of the source sequence.
+ */
+ observableProto.takeWithTime = function (duration, scheduler) {
+ var source = this;
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return new AnonymousObservable(function (o) {
+ return new CompositeDisposable(scheduler.scheduleWithRelative(duration, function () { o.onCompleted(); }), source.subscribe(o));
+ }, source);
+ };
+
+ /**
+ * Skips elements for the specified duration from the start of the observable source sequence, using the specified scheduler to run timers.
+ *
+ * @example
+ * 1 - res = source.skipWithTime(5000, [optional scheduler]);
+ *
+ * @description
+ * Specifying a zero value for duration doesn't guarantee no elements will be dropped from the start of the source sequence.
+ * This is a side-effect of the asynchrony introduced by the scheduler, where the action that causes callbacks from the source sequence to be forwarded
+ * may not execute immediately, despite the zero due time.
+ *
+ * Errors produced by the source sequence are always forwarded to the result sequence, even if the error occurs before the duration.
+ * @param {Number} duration Duration for skipping elements from the start of the sequence.
+ * @param {Scheduler} scheduler Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout.
+ * @returns {Observable} An observable sequence with the elements skipped during the specified duration from the start of the source sequence.
+ */
+ observableProto.skipWithTime = function (duration, scheduler) {
+ var source = this;
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return new AnonymousObservable(function (observer) {
+ var open = false;
+ return new CompositeDisposable(
+ scheduler.scheduleWithRelative(duration, function () { open = true; }),
+ source.subscribe(function (x) { open && observer.onNext(x); }, observer.onError.bind(observer), observer.onCompleted.bind(observer)));
+ }, source);
+ };
+
+ /**
+ * Skips elements from the observable source sequence until the specified start time, using the specified scheduler to run timers.
+ * Errors produced by the source sequence are always forwarded to the result sequence, even if the error occurs before the start time.
+ *
+ * @examples
+ * 1 - res = source.skipUntilWithTime(new Date(), [scheduler]);
+ * 2 - res = source.skipUntilWithTime(5000, [scheduler]);
+ * @param {Date|Number} startTime Time to start taking elements from the source sequence. If this value is less than or equal to Date(), no elements will be skipped.
+ * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout.
+ * @returns {Observable} An observable sequence with the elements skipped until the specified start time.
+ */
+ observableProto.skipUntilWithTime = function (startTime, scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ var source = this, schedulerMethod = startTime instanceof Date ?
+ 'scheduleWithAbsolute' :
+ 'scheduleWithRelative';
+ return new AnonymousObservable(function (o) {
+ var open = false;
+
+ return new CompositeDisposable(
+ scheduler[schedulerMethod](startTime, function () { open = true; }),
+ source.subscribe(
+ function (x) { open && o.onNext(x); },
+ function (e) { o.onError(e); }, function () { o.onCompleted(); }));
+ }, source);
+ };
+
+ /**
+ * Takes elements for the specified duration until the specified end time, using the specified scheduler to run timers.
+ * @param {Number | Date} endTime Time to stop taking elements from the source sequence. If this value is less than or equal to new Date(), the result stream will complete immediately.
+ * @param {Scheduler} [scheduler] Scheduler to run the timer on.
+ * @returns {Observable} An observable sequence with the elements taken until the specified end time.
+ */
+ observableProto.takeUntilWithTime = function (endTime, scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ var source = this, schedulerMethod = endTime instanceof Date ?
+ 'scheduleWithAbsolute' :
+ 'scheduleWithRelative';
+ return new AnonymousObservable(function (o) {
+ return new CompositeDisposable(
+ scheduler[schedulerMethod](endTime, function () { o.onCompleted(); }),
+ source.subscribe(o));
+ }, source);
+ };
+
+ /**
+ * Returns an Observable that emits only the first item emitted by the source Observable during sequential time windows of a specified duration.
+ * @param {Number} windowDuration time to wait before emitting another item after emitting the last item
+ * @param {Scheduler} [scheduler] the Scheduler to use internally to manage the timers that handle timeout for each item. If not provided, defaults to Scheduler.timeout.
+ * @returns {Observable} An Observable that performs the throttle operation.
+ */
+ observableProto.throttleFirst = function (windowDuration, scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ var duration = +windowDuration || 0;
+ if (duration <= 0) { throw new RangeError('windowDuration cannot be less or equal zero.'); }
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var lastOnNext = 0;
+ return source.subscribe(
+ function (x) {
+ var now = scheduler.now();
+ if (lastOnNext === 0 || now - lastOnNext >= duration) {
+ lastOnNext = now;
+ o.onNext(x);
+ }
+ },function (e) { o.onError(e); }, function () { o.onCompleted(); }
+ );
+ }, source);
+ };
+
+ /**
+ * Executes a transducer to transform the observable sequence
+ * @param {Transducer} transducer A transducer to execute
+ * @returns {Observable} An Observable sequence containing the results from the transducer.
+ */
+ observableProto.transduce = function(transducer) {
+ var source = this;
+
+ function transformForObserver(o) {
+ return {
+ '@@transducer/init': function() {
+ return o;
+ },
+ '@@transducer/step': function(obs, input) {
+ return obs.onNext(input);
+ },
+ '@@transducer/result': function(obs) {
+ return obs.onCompleted();
+ }
+ };
+ }
+
+ return new AnonymousObservable(function(o) {
+ var xform = transducer(transformForObserver(o));
+ return source.subscribe(
+ function(v) {
+ try {
+ xform['@@transducer/step'](o, v);
+ } catch (e) {
+ o.onError(e);
+ }
+ },
+ function (e) { o.onError(e); },
+ function() { xform['@@transducer/result'](o); }
+ );
+ }, source);
+ };
+
+ /*
+ * Performs a exclusive waiting for the first to finish before subscribing to another observable.
+ * Observables that come in between subscriptions will be dropped on the floor.
+ * @returns {Observable} A exclusive observable with only the results that happen when subscribed.
+ */
+ observableProto.exclusive = function () {
+ var sources = this;
+ return new AnonymousObservable(function (observer) {
+ var hasCurrent = false,
+ isStopped = false,
+ m = new SingleAssignmentDisposable(),
+ g = new CompositeDisposable();
+
+ g.add(m);
+
+ m.setDisposable(sources.subscribe(
+ function (innerSource) {
+ if (!hasCurrent) {
+ hasCurrent = true;
+
+ isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
+
+ var innerSubscription = new SingleAssignmentDisposable();
+ g.add(innerSubscription);
+
+ innerSubscription.setDisposable(innerSource.subscribe(
+ observer.onNext.bind(observer),
+ observer.onError.bind(observer),
+ function () {
+ g.remove(innerSubscription);
+ hasCurrent = false;
+ if (isStopped && g.length === 1) {
+ observer.onCompleted();
+ }
+ }));
+ }
+ },
+ observer.onError.bind(observer),
+ function () {
+ isStopped = true;
+ if (!hasCurrent && g.length === 1) {
+ observer.onCompleted();
+ }
+ }));
+
+ return g;
+ }, this);
+ };
+
+ /*
+ * Performs a exclusive map waiting for the first to finish before subscribing to another observable.
+ * Observables that come in between subscriptions will be dropped on the floor.
+ * @param {Function} selector Selector to invoke for every item in the current subscription.
+ * @param {Any} [thisArg] An optional context to invoke with the selector parameter.
+ * @returns {Observable} An exclusive observable with only the results that happen when subscribed.
+ */
+ observableProto.exclusiveMap = function (selector, thisArg) {
+ var sources = this,
+ selectorFunc = bindCallback(selector, thisArg, 3);
+ return new AnonymousObservable(function (observer) {
+ var index = 0,
+ hasCurrent = false,
+ isStopped = true,
+ m = new SingleAssignmentDisposable(),
+ g = new CompositeDisposable();
+
+ g.add(m);
+
+ m.setDisposable(sources.subscribe(
+ function (innerSource) {
+
+ if (!hasCurrent) {
+ hasCurrent = true;
+
+ innerSubscription = new SingleAssignmentDisposable();
+ g.add(innerSubscription);
+
+ isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
+
+ innerSubscription.setDisposable(innerSource.subscribe(
+ function (x) {
+ var result;
+ try {
+ result = selectorFunc(x, index++, innerSource);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+
+ observer.onNext(result);
+ },
+ function (e) { observer.onError(e); },
+ function () {
+ g.remove(innerSubscription);
+ hasCurrent = false;
+
+ if (isStopped && g.length === 1) {
+ observer.onCompleted();
+ }
+ }));
+ }
+ },
+ function (e) { observer.onError(e); },
+ function () {
+ isStopped = true;
+ if (g.length === 1 && !hasCurrent) {
+ observer.onCompleted();
+ }
+ }));
+ return g;
+ }, this);
+ };
+
+ /** Provides a set of extension methods for virtual time scheduling. */
+ Rx.VirtualTimeScheduler = (function (__super__) {
+
+ function localNow() {
+ return this.toDateTimeOffset(this.clock);
+ }
+
+ function scheduleNow(state, action) {
+ return this.scheduleAbsoluteWithState(state, this.clock, action);
+ }
+
+ function scheduleRelative(state, dueTime, action) {
+ return this.scheduleRelativeWithState(state, this.toRelative(dueTime), action);
+ }
+
+ function scheduleAbsolute(state, dueTime, action) {
+ return this.scheduleRelativeWithState(state, this.toRelative(dueTime - this.now()), action);
+ }
+
+ function invokeAction(scheduler, action) {
+ action();
+ return disposableEmpty;
+ }
+
+ inherits(VirtualTimeScheduler, __super__);
+
+ /**
+ * Creates a new virtual time scheduler with the specified initial clock value and absolute time comparer.
+ *
+ * @constructor
+ * @param {Number} initialClock Initial value for the clock.
+ * @param {Function} comparer Comparer to determine causality of events based on absolute time.
+ */
+ function VirtualTimeScheduler(initialClock, comparer) {
+ this.clock = initialClock;
+ this.comparer = comparer;
+ this.isEnabled = false;
+ this.queue = new PriorityQueue(1024);
+ __super__.call(this, localNow, scheduleNow, scheduleRelative, scheduleAbsolute);
+ }
+
+ var VirtualTimeSchedulerPrototype = VirtualTimeScheduler.prototype;
+
+ /**
+ * Adds a relative time value to an absolute time value.
+ * @param {Number} absolute Absolute virtual time value.
+ * @param {Number} relative Relative virtual time value to add.
+ * @return {Number} Resulting absolute virtual time sum value.
+ */
+ VirtualTimeSchedulerPrototype.add = notImplemented;
+
+ /**
+ * Converts an absolute time to a number
+ * @param {Any} The absolute time.
+ * @returns {Number} The absolute time in ms
+ */
+ VirtualTimeSchedulerPrototype.toDateTimeOffset = notImplemented;
+
+ /**
+ * Converts the TimeSpan value to a relative virtual time value.
+ * @param {Number} timeSpan TimeSpan value to convert.
+ * @return {Number} Corresponding relative virtual time value.
+ */
+ VirtualTimeSchedulerPrototype.toRelative = notImplemented;
+
+ /**
+ * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be emulated using recursive scheduling.
+ * @param {Mixed} state Initial state passed to the action upon the first iteration.
+ * @param {Number} period Period for running the work periodically.
+ * @param {Function} action Action to be executed, potentially updating the state.
+ * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort).
+ */
+ VirtualTimeSchedulerPrototype.schedulePeriodicWithState = function (state, period, action) {
+ var s = new SchedulePeriodicRecursive(this, state, period, action);
+ return s.start();
+ };
+
+ /**
+ * Schedules an action to be executed after dueTime.
+ * @param {Mixed} state State passed to the action to be executed.
+ * @param {Number} dueTime Relative time after which to execute the action.
+ * @param {Function} action Action to be executed.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ VirtualTimeSchedulerPrototype.scheduleRelativeWithState = function (state, dueTime, action) {
+ var runAt = this.add(this.clock, dueTime);
+ return this.scheduleAbsoluteWithState(state, runAt, action);
+ };
+
+ /**
+ * Schedules an action to be executed at dueTime.
+ * @param {Number} dueTime Relative time after which to execute the action.
+ * @param {Function} action Action to be executed.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ VirtualTimeSchedulerPrototype.scheduleRelative = function (dueTime, action) {
+ return this.scheduleRelativeWithState(action, dueTime, invokeAction);
+ };
+
+ /**
+ * Starts the virtual time scheduler.
+ */
+ VirtualTimeSchedulerPrototype.start = function () {
+ if (!this.isEnabled) {
+ this.isEnabled = true;
+ do {
+ var next = this.getNext();
+ if (next !== null) {
+ this.comparer(next.dueTime, this.clock) > 0 && (this.clock = next.dueTime);
+ next.invoke();
+ } else {
+ this.isEnabled = false;
+ }
+ } while (this.isEnabled);
+ }
+ };
+
+ /**
+ * Stops the virtual time scheduler.
+ */
+ VirtualTimeSchedulerPrototype.stop = function () {
+ this.isEnabled = false;
+ };
+
+ /**
+ * Advances the scheduler's clock to the specified time, running all work till that point.
+ * @param {Number} time Absolute time to advance the scheduler's clock to.
+ */
+ VirtualTimeSchedulerPrototype.advanceTo = function (time) {
+ var dueToClock = this.comparer(this.clock, time);
+ if (this.comparer(this.clock, time) > 0) { throw new ArgumentOutOfRangeError(); }
+ if (dueToClock === 0) { return; }
+ if (!this.isEnabled) {
+ this.isEnabled = true;
+ do {
+ var next = this.getNext();
+ if (next !== null && this.comparer(next.dueTime, time) <= 0) {
+ this.comparer(next.dueTime, this.clock) > 0 && (this.clock = next.dueTime);
+ next.invoke();
+ } else {
+ this.isEnabled = false;
+ }
+ } while (this.isEnabled);
+ this.clock = time;
+ }
+ };
+
+ /**
+ * Advances the scheduler's clock by the specified relative time, running all work scheduled for that timespan.
+ * @param {Number} time Relative time to advance the scheduler's clock by.
+ */
+ VirtualTimeSchedulerPrototype.advanceBy = function (time) {
+ var dt = this.add(this.clock, time),
+ dueToClock = this.comparer(this.clock, dt);
+ if (dueToClock > 0) { throw new ArgumentOutOfRangeError(); }
+ if (dueToClock === 0) { return; }
+
+ this.advanceTo(dt);
+ };
+
+ /**
+ * Advances the scheduler's clock by the specified relative time.
+ * @param {Number} time Relative time to advance the scheduler's clock by.
+ */
+ VirtualTimeSchedulerPrototype.sleep = function (time) {
+ var dt = this.add(this.clock, time);
+ if (this.comparer(this.clock, dt) >= 0) { throw new ArgumentOutOfRangeError(); }
+
+ this.clock = dt;
+ };
+
+ /**
+ * Gets the next scheduled item to be executed.
+ * @returns {ScheduledItem} The next scheduled item.
+ */
+ VirtualTimeSchedulerPrototype.getNext = function () {
+ while (this.queue.length > 0) {
+ var next = this.queue.peek();
+ if (next.isCancelled()) {
+ this.queue.dequeue();
+ } else {
+ return next;
+ }
+ }
+ return null;
+ };
+
+ /**
+ * Schedules an action to be executed at dueTime.
+ * @param {Scheduler} scheduler Scheduler to execute the action on.
+ * @param {Number} dueTime Absolute time at which to execute the action.
+ * @param {Function} action Action to be executed.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ VirtualTimeSchedulerPrototype.scheduleAbsolute = function (dueTime, action) {
+ return this.scheduleAbsoluteWithState(action, dueTime, invokeAction);
+ };
+
+ /**
+ * Schedules an action to be executed at dueTime.
+ * @param {Mixed} state State passed to the action to be executed.
+ * @param {Number} dueTime Absolute time at which to execute the action.
+ * @param {Function} action Action to be executed.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ VirtualTimeSchedulerPrototype.scheduleAbsoluteWithState = function (state, dueTime, action) {
+ var self = this;
+
+ function run(scheduler, state1) {
+ self.queue.remove(si);
+ return action(scheduler, state1);
+ }
+
+ var si = new ScheduledItem(this, state, run, dueTime, this.comparer);
+ this.queue.enqueue(si);
+
+ return si.disposable;
+ };
+
+ return VirtualTimeScheduler;
+ }(Scheduler));
+
+ /** Provides a virtual time scheduler that uses Date for absolute time and number for relative time. */
+ Rx.HistoricalScheduler = (function (__super__) {
+ inherits(HistoricalScheduler, __super__);
+
+ /**
+ * Creates a new historical scheduler with the specified initial clock value.
+ * @constructor
+ * @param {Number} initialClock Initial value for the clock.
+ * @param {Function} comparer Comparer to determine causality of events based on absolute time.
+ */
+ function HistoricalScheduler(initialClock, comparer) {
+ var clock = initialClock == null ? 0 : initialClock;
+ var cmp = comparer || defaultSubComparer;
+ __super__.call(this, clock, cmp);
+ }
+
+ var HistoricalSchedulerProto = HistoricalScheduler.prototype;
+
+ /**
+ * Adds a relative time value to an absolute time value.
+ * @param {Number} absolute Absolute virtual time value.
+ * @param {Number} relative Relative virtual time value to add.
+ * @return {Number} Resulting absolute virtual time sum value.
+ */
+ HistoricalSchedulerProto.add = function (absolute, relative) {
+ return absolute + relative;
+ };
+
+ HistoricalSchedulerProto.toDateTimeOffset = function (absolute) {
+ return new Date(absolute).getTime();
+ };
+
+ /**
+ * Converts the TimeSpan value to a relative virtual time value.
+ * @memberOf HistoricalScheduler
+ * @param {Number} timeSpan TimeSpan value to convert.
+ * @return {Number} Corresponding relative virtual time value.
+ */
+ HistoricalSchedulerProto.toRelative = function (timeSpan) {
+ return timeSpan;
+ };
+
+ return HistoricalScheduler;
+ }(Rx.VirtualTimeScheduler));
+
+ var AnonymousObservable = Rx.AnonymousObservable = (function (__super__) {
+ inherits(AnonymousObservable, __super__);
+
+ // Fix subscriber to check for undefined or function returned to decorate as Disposable
+ function fixSubscriber(subscriber) {
+ return subscriber && isFunction(subscriber.dispose) ? subscriber :
+ isFunction(subscriber) ? disposableCreate(subscriber) : disposableEmpty;
+ }
+
+ function setDisposable(s, state) {
+ var ado = state[0], subscribe = state[1];
+ var sub = tryCatch(subscribe)(ado);
+
+ if (sub === errorObj) {
+ if(!ado.fail(errorObj.e)) { return thrower(errorObj.e); }
+ }
+ ado.setDisposable(fixSubscriber(sub));
+ }
+
+ function AnonymousObservable(subscribe, parent) {
+ this.source = parent;
+
+ function s(observer) {
+ var ado = new AutoDetachObserver(observer), state = [ado, subscribe];
+
+ if (currentThreadScheduler.scheduleRequired()) {
+ currentThreadScheduler.scheduleWithState(state, setDisposable);
+ } else {
+ setDisposable(null, state);
+ }
+ return ado;
+ }
+
+ __super__.call(this, s);
+ }
+
+ return AnonymousObservable;
+
+ }(Observable));
+
+ var AutoDetachObserver = (function (__super__) {
+ inherits(AutoDetachObserver, __super__);
+
+ function AutoDetachObserver(observer) {
+ __super__.call(this);
+ this.observer = observer;
+ this.m = new SingleAssignmentDisposable();
+ }
+
+ var AutoDetachObserverPrototype = AutoDetachObserver.prototype;
+
+ AutoDetachObserverPrototype.next = function (value) {
+ var result = tryCatch(this.observer.onNext).call(this.observer, value);
+ if (result === errorObj) {
+ this.dispose();
+ thrower(result.e);
+ }
+ };
+
+ AutoDetachObserverPrototype.error = function (err) {
+ var result = tryCatch(this.observer.onError).call(this.observer, err);
+ this.dispose();
+ result === errorObj && thrower(result.e);
+ };
+
+ AutoDetachObserverPrototype.completed = function () {
+ var result = tryCatch(this.observer.onCompleted).call(this.observer);
+ this.dispose();
+ result === errorObj && thrower(result.e);
+ };
+
+ AutoDetachObserverPrototype.setDisposable = function (value) { this.m.setDisposable(value); };
+ AutoDetachObserverPrototype.getDisposable = function () { return this.m.getDisposable(); };
+
+ AutoDetachObserverPrototype.dispose = function () {
+ __super__.prototype.dispose.call(this);
+ this.m.dispose();
+ };
+
+ return AutoDetachObserver;
+ }(AbstractObserver));
+
+ var GroupedObservable = (function (__super__) {
+ inherits(GroupedObservable, __super__);
+
+ function subscribe(observer) {
+ return this.underlyingObservable.subscribe(observer);
+ }
+
+ function GroupedObservable(key, underlyingObservable, mergedDisposable) {
+ __super__.call(this, subscribe);
+ this.key = key;
+ this.underlyingObservable = !mergedDisposable ?
+ underlyingObservable :
+ new AnonymousObservable(function (observer) {
+ return new CompositeDisposable(mergedDisposable.getDisposable(), underlyingObservable.subscribe(observer));
+ });
+ }
+
+ return GroupedObservable;
+ }(Observable));
+
+ /**
+ * Represents an object that is both an observable sequence as well as an observer.
+ * Each notification is broadcasted to all subscribed observers.
+ */
+ var Subject = Rx.Subject = (function (__super__) {
+ function subscribe(observer) {
+ checkDisposed(this);
+ if (!this.isStopped) {
+ this.observers.push(observer);
+ return new InnerSubscription(this, observer);
+ }
+ if (this.hasError) {
+ observer.onError(this.error);
+ return disposableEmpty;
+ }
+ observer.onCompleted();
+ return disposableEmpty;
+ }
+
+ inherits(Subject, __super__);
+
+ /**
+ * Creates a subject.
+ */
+ function Subject() {
+ __super__.call(this, subscribe);
+ this.isDisposed = false,
+ this.isStopped = false,
+ this.observers = [];
+ this.hasError = false;
+ }
+
+ addProperties(Subject.prototype, Observer.prototype, {
+ /**
+ * Indicates whether the subject has observers subscribed to it.
+ * @returns {Boolean} Indicates whether the subject has observers subscribed to it.
+ */
+ hasObservers: function () { return this.observers.length > 0; },
+ /**
+ * Notifies all subscribed observers about the end of the sequence.
+ */
+ onCompleted: function () {
+ checkDisposed(this);
+ if (!this.isStopped) {
+ this.isStopped = true;
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ os[i].onCompleted();
+ }
+
+ this.observers.length = 0;
+ }
+ },
+ /**
+ * Notifies all subscribed observers about the exception.
+ * @param {Mixed} error The exception to send to all observers.
+ */
+ onError: function (error) {
+ checkDisposed(this);
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.error = error;
+ this.hasError = true;
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ os[i].onError(error);
+ }
+
+ this.observers.length = 0;
+ }
+ },
+ /**
+ * Notifies all subscribed observers about the arrival of the specified element in the sequence.
+ * @param {Mixed} value The value to send to all observers.
+ */
+ onNext: function (value) {
+ checkDisposed(this);
+ if (!this.isStopped) {
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ os[i].onNext(value);
+ }
+ }
+ },
+ /**
+ * Unsubscribe all observers and release resources.
+ */
+ dispose: function () {
+ this.isDisposed = true;
+ this.observers = null;
+ }
+ });
+
+ /**
+ * Creates a subject from the specified observer and observable.
+ * @param {Observer} observer The observer used to send messages to the subject.
+ * @param {Observable} observable The observable used to subscribe to messages sent from the subject.
+ * @returns {Subject} Subject implemented using the given observer and observable.
+ */
+ Subject.create = function (observer, observable) {
+ return new AnonymousSubject(observer, observable);
+ };
+
+ return Subject;
+ }(Observable));
+
+ /**
+ * Represents the result of an asynchronous operation.
+ * The last value before the OnCompleted notification, or the error received through OnError, is sent to all subscribed observers.
+ */
+ var AsyncSubject = Rx.AsyncSubject = (function (__super__) {
+
+ function subscribe(observer) {
+ checkDisposed(this);
+
+ if (!this.isStopped) {
+ this.observers.push(observer);
+ return new InnerSubscription(this, observer);
+ }
+
+ if (this.hasError) {
+ observer.onError(this.error);
+ } else if (this.hasValue) {
+ observer.onNext(this.value);
+ observer.onCompleted();
+ } else {
+ observer.onCompleted();
+ }
+
+ return disposableEmpty;
+ }
+
+ inherits(AsyncSubject, __super__);
+
+ /**
+ * Creates a subject that can only receive one value and that value is cached for all future observations.
+ * @constructor
+ */
+ function AsyncSubject() {
+ __super__.call(this, subscribe);
+
+ this.isDisposed = false;
+ this.isStopped = false;
+ this.hasValue = false;
+ this.observers = [];
+ this.hasError = false;
+ }
+
+ addProperties(AsyncSubject.prototype, Observer, {
+ /**
+ * Indicates whether the subject has observers subscribed to it.
+ * @returns {Boolean} Indicates whether the subject has observers subscribed to it.
+ */
+ hasObservers: function () {
+ checkDisposed(this);
+ return this.observers.length > 0;
+ },
+ /**
+ * Notifies all subscribed observers about the end of the sequence, also causing the last received value to be sent out (if any).
+ */
+ onCompleted: function () {
+ var i, len;
+ checkDisposed(this);
+ if (!this.isStopped) {
+ this.isStopped = true;
+ var os = cloneArray(this.observers), len = os.length;
+
+ if (this.hasValue) {
+ for (i = 0; i < len; i++) {
+ var o = os[i];
+ o.onNext(this.value);
+ o.onCompleted();
+ }
+ } else {
+ for (i = 0; i < len; i++) {
+ os[i].onCompleted();
+ }
+ }
+
+ this.observers.length = 0;
+ }
+ },
+ /**
+ * Notifies all subscribed observers about the error.
+ * @param {Mixed} error The Error to send to all observers.
+ */
+ onError: function (error) {
+ checkDisposed(this);
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.hasError = true;
+ this.error = error;
+
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ os[i].onError(error);
+ }
+
+ this.observers.length = 0;
+ }
+ },
+ /**
+ * Sends a value to the subject. The last value received before successful termination will be sent to all subscribed and future observers.
+ * @param {Mixed} value The value to store in the subject.
+ */
+ onNext: function (value) {
+ checkDisposed(this);
+ if (this.isStopped) { return; }
+ this.value = value;
+ this.hasValue = true;
+ },
+ /**
+ * Unsubscribe all observers and release resources.
+ */
+ dispose: function () {
+ this.isDisposed = true;
+ this.observers = null;
+ this.exception = null;
+ this.value = null;
+ }
+ });
+
+ return AsyncSubject;
+ }(Observable));
+
+ var AnonymousSubject = Rx.AnonymousSubject = (function (__super__) {
+ inherits(AnonymousSubject, __super__);
+
+ function subscribe(observer) {
+ return this.observable.subscribe(observer);
+ }
+
+ function AnonymousSubject(observer, observable) {
+ this.observer = observer;
+ this.observable = observable;
+ __super__.call(this, subscribe);
+ }
+
+ addProperties(AnonymousSubject.prototype, Observer.prototype, {
+ onCompleted: function () {
+ this.observer.onCompleted();
+ },
+ onError: function (error) {
+ this.observer.onError(error);
+ },
+ onNext: function (value) {
+ this.observer.onNext(value);
+ }
+ });
+
+ return AnonymousSubject;
+ }(Observable));
+
+ /**
+ * Used to pause and resume streams.
+ */
+ Rx.Pauser = (function (__super__) {
+ inherits(Pauser, __super__);
+
+ function Pauser() {
+ __super__.call(this);
+ }
+
+ /**
+ * Pauses the underlying sequence.
+ */
+ Pauser.prototype.pause = function () { this.onNext(false); };
+
+ /**
+ * Resumes the underlying sequence.
+ */
+ Pauser.prototype.resume = function () { this.onNext(true); };
+
+ return Pauser;
+ }(Subject));
+
+ if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
+ root.Rx = Rx;
+
+ define(function() {
+ return Rx;
+ });
+ } else if (freeExports && freeModule) {
+ // in Node.js or RingoJS
+ if (moduleExports) {
+ (freeModule.exports = Rx).Rx = Rx;
+ } else {
+ freeExports.Rx = Rx;
+ }
+ } else {
+ // in a browser or Rhino
+ root.Rx = Rx;
+ }
+
+ // All code before this point will be filtered from stack traces.
+ var rEndingLine = captureLine();
+
+}.call(this));
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.all.map b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.all.map
new file mode 100644
index 00000000000..54ad12d5635
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.all.map
@@ -0,0 +1 @@
+{"version":3,"file":"rx.all.min.js","sources":["rx.all.js"],"names":["undefined","cloneArray","arr","a","i","len","length","push","makeStackTraceLong","error","observable","hasStacks","stack","indexOf","STACK_JUMP_SEPARATOR","stacks","o","source","unshift","concatedStacks","join","filterStackString","stackString","lines","split","desiredLines","line","isInternalFrame","isNodeFrame","stackLine","fileNameAndLineNumber","getFileNameAndLineNumber","fileName","lineNumber","rFileName","rStartingLine","rEndingLine","captureLine","Error","e","firstLine","attempt1","exec","Number","attempt2","attempt3","keysIn","object","result","isObject","support","nonEnumArgs","isArguments","slice","call","skipProto","enumPrototypes","skipErrorProps","enumErrorProps","errorProto","key","nonEnumShadows","objectProto","ctor","constructor","index","dontEnumsLength","prototype","className","stringProto","stringClass","errorClass","toString","nonEnum","nonEnumProps","dontEnums","hasOwnProperty","internalFor","callback","keysFunc","props","internalForIn","isNode","value","deepEquals","b","stackA","stackB","type","otherType","otherClass","argsClass","objectClass","boolClass","dateClass","numberClass","regexpClass","String","isArr","arrayClass","nodeClass","ctorA","argsObject","Object","ctorB","isFunction","size","pop","arrayInitialize","count","factory","Array","tryCatcher","tryCatchTarget","apply","this","arguments","errorObj","tryCatch","fn","TypeError","thrower","IndexedItem","id","ScheduledDisposable","scheduler","disposable","isDisposed","scheduleItem","s","self","dispose","StringIterable","str","_s","StringIterator","_l","_i","ArrayIterable","_a","ArrayIterator","toLength","numberIsFinite","root","isFinite","getIterable","it","$iterator$","sign","number","isNaN","Math","floor","abs","maxSafeInteger","FromArraySink","observer","parent","observableOf","array","isScheduler","currentThreadScheduler","FromArrayObservable","PairsSink","RepeatSink","observableCatchHandler","handler","AnonymousObservable","d1","SingleAssignmentDisposable","subscription","SerialDisposable","setDisposable","subscribe","x","onNext","ex","onError","isPromise","observableFromPromise","d","onCompleted","falseFactory","zipArray","second","resultSelector","first","left","right","res","emptyArrayFactory","arrayFactory","ScanObserver","accumulator","hasSeed","seed","hasAccumulation","accumulation","hasValue","isStopped","concatMap","selector","thisArg","selectorFunc","bindCallback","map","isArrayLike","isIterable","observableFrom","concatAll","arrayIndexOfComparer","item","comparer","HashSet","set","flatMap","mergeAll","extremaBy","keySelector","lastKey","list","comparison","ex1","firstOnly","EmptyError","elementAtOrDefault","hasDefault","defaultValue","ArgumentOutOfRangeError","singleOrDefaultAsync","seenValue","firstOrDefaultAsync","lastOrDefaultAsync","findValue","predicate","yieldIndex","shouldRun","toThunk","obj","ctx","isArray","objectToThunk","isGeneratorFunction","observableSpawn","isGenerator","isObservable","observableToThunk","promiseToThunk","fnString","done","run","finished","results","pending","err","keys","timeoutScheduler","schedule","v","promise","then","name","next","throwString","handleError","createListener","element","addEventListener","disposableCreate","removeEventListener","createEventListener","el","eventName","disposables","CompositeDisposable","toStr","add","combineLatestSource","subject","values","hasValueAll","every","identity","isDone","observableWindowWithOpenings","windowOpenings","windowClosingSelector","groupJoin","observableEmpty","_","win","observableWindowWithBoundaries","windowBoundaries","Subject","r","RefCountDisposable","addRef","w","observableWindowWithClosingSelector","createWindowClose","windowClose","m1","m","take","noop","enumerableWhile","condition","WhileEnumerable","Pattern","patterns","Plan","expression","planCreateObserver","externalSubscriptions","entry","get","JoinObserver","ActivePlan","joinObserverArray","joinObservers","Map","joinObserver","observableTimerDate","dueTime","scheduleWithAbsolute","observableTimerDateAndPeriod","period","p","normalizeTime","scheduleRecursiveWithAbsoluteAndState","now","observableTimerTimeSpan","scheduleWithRelative","observableTimerTimeSpanAndPeriod","schedulePeriodicWithState","observableDefer","observableDelayTimeSpan","active","cancelable","exception","q","running","materialize","timestamp","notification","kind","scheduleRecursiveWithRelative","recurseDueTime","shouldRecurse","shift","accept","max","observableDelayDate","sampleObservable","sampler","sampleSubscribe","atEnd","sourceSubscription","newValue","objectTypes","boolean","function","string","window","freeExports","exports","nodeType","freeModule","module","moduleExports","freeGlobal","global","Rx","internals","config","Promise","helpers","notDefined","defaultNow","pluck","property","just","Date","defaultComparer","y","isEqual","defaultSubComparer","defaultError","defaultKeySerializer","not","asArray","isFn","longStackSupport","message","ObjectDisposedError","NotSupportedError","NotImplementedError","notImplemented","notSupported","Symbol","iterator","Set","doneEnumerator","supportNodeClass","func","argCount","arg","collection","funcClass","supportsArgsClass","propertyIsEnumerable","document","toLocaleString","valueOf","test","inherits","child","__","addProperties","sources","idx","ln","prop","xs","getDisposable","compareTo","other","c","PriorityQueue","capacity","items","priorityProto","isHigherPriority","percolate","temp","heapify","peek","removeAt","dequeue","enqueue","remove","args","isDisposable","CompositeDisposablePrototype","shouldDispose","splice","currentDisposables","Disposable","action","create","disposableEmpty","empty","checkDisposed","current","old","InnerDisposable","isInnerDisposed","underlyingDisposable","isPrimaryDisposed","scheduleWithState","ScheduledItem","state","invoke","invokeCore","isCancelled","Scheduler","scheduleRelative","scheduleAbsolute","_schedule","_scheduleRelative","_scheduleAbsolute","invokeAction","schedulerProto","scheduleWithRelativeAndState","scheduleWithAbsoluteAndState","normalize","timeSpan","invokeRecImmediate","pair","recursiveAction","state1","state2","isAdded","scheduler1","state3","group","invokeRecDate","method","dueTime1","scheduleInnerRecursive","dt","scheduleRecursive","scheduleRecursiveWithState","scheduleRecursiveWithRelativeAndState","scheduleRecursiveWithAbsolute","schedulePeriodic","setInterval","clearInterval","catchError","CatchScheduler","scheduleMethod","clearMethod","SchedulePeriodicRecursive","tick","command","recurse","_period","_state","_action","_cancel","_scheduler","start","bind","immediateScheduler","immediate","scheduleNow","currentThread","runTrampoline","queue","si","currentScheduler","scheduleRequired","localTimer","localSetTimeout","localClearTimeout","setTimeout","clearTimeout","WScript","time","Sleep","runTask","handle","currentlyRunning","task","tasksByHandle","postMessageSupported","postMessage","importScripts","isAsync","oldHandler","onmessage","onGlobalPostMessage","event","data","substring","MSG_PREFIX","nextHandle","reNative","RegExp","replace","setImmediate","process","nextTick","random","attachEvent","currentId","MessageChannel","channel","port1","port2","createElement","scriptElement","onreadystatechange","parentNode","removeChild","documentElement","appendChild","timeout","__super__","_wrap","_handler","_recursiveOriginal","_recursiveWrapper","_clone","_getRecursiveWrapper","wrapper","failed","Notification","acceptObservable","_accept","_acceptObservable","observerOrOnNext","toObservable","notificationCreateOnNext","createOnNext","notificationCreateOnError","createOnError","notificationCreateOnCompleted","createOnCompleted","Observer","toNotifier","n","asObserver","AnonymousObserver","checked","CheckedObserver","observerCreate","fromNotifier","notifyOn","ObserveOnObserver","makeSafe","AnonymousSafeObserver","_onNext","_onError","_onCompleted","observableProto","AbstractObserver","completed","fail","_observer","CheckedObserverPrototype","checkAccess","ScheduledObserver","isAcquired","hasFaulted","ensureActive","isOwner","work","cancel","Observable","_subscribe","oldOnError","forEach","subscribeOnNext","subscribeOnError","subscribeOnCompleted","ObservableBase","fixSubscriber","subscriber","ado","sub","subscribeCore","AutoDetachObserver","Enumerable","ConcatEnumerableObservable","InnerObserver","currentItem","currentValue","concat","CatchErrorObservable","lastException","catchErrorWhen","notificationHandler","exceptions","notifier","handled","notificationDisposable","outer","inner","exn","RepeatEnumerable","RepeatEnumerator","l","enumerableRepeat","repeat","repeatCount","OfEnumerable","OfEnumerator","enumerableOf","of","observeOn","subscribeOn","FromPromiseObservable","fromPromise","toPromise","promiseCtor","resolve","reject","ToArrayObservable","toArray","createWithDisposable","defer","observableFactory","observableThrow","EmptyObservable","EmptySink","sink","FromObservable","iterable","mapper","FromSink","loopRecursive","pow","charAt","from","mapFn","observableFromArray","fromArray","generate","initialState","iterate","hasResult","ofWithScheduler","ofArrayChanges","observe","unobserve","observerFn","changes","ofObjectChanges","NeverObservable","observableNever","never","PairsObservable","pairs","RangeObservable","rangeCount","RangeSink","range","RepeatObservable","JustObservable","JustSink","ThrowObservable","returnValue","ThrowSink","throwError","throwException","using","resourceFactory","resource","amb","rightSource","leftSource","choiceL","choice","leftChoice","rightSubscription","choiceR","rightChoice","leftSubscription","previous","acc","catchException","handlerOrSecond","observableCatch","combineLatest","filter","j","subscriptions","sad","observableConcat","ConcatObservable","ConcatSink","concatObservable","merge","MergeObservable","maxConcurrent","g","MergeObserver","activeCount","handleSubscribe","innerSource","maxConcurrentOrOther","observableMerge","MergeAllObservable","MergeAllObserver","mergeObservable","CompositeError","errors","innerErrors","mergeDelayError","setCompletion","innerSubscription","onErrorResumeNext","pos","skipUntil","isOpen","SwitchObservable","SwitchObserver","stopped","latest","hasLatest","switchLatest","TakeUntilObservable","takeUntil","withLatestFrom","allValues","zip","queues","queuedValues","asObservable","bufferWithCount","skip","windowWithCount","selectMany","where","dematerialize","distinctUntilChanged","currentKey","hasCurrentKey","comparerEquals","TapObservable","t","tap","doAction","doOnNext","tapOnNext","doOnError","tapOnError","doOnCompleted","tapOnCompleted","ensure","finallyAction","IgnoreElementsObservable","ignoreElements","retry","retryCount","retryWhen","ScanObservable","scan","skipLast","startWith","takeLast","takeLastBuffer","Infinity","createWindow","refCountDisposable","selectConcat","selectorResult","i2","concatMapObserver","selectConcatObserver","onNextFunc","onErrorFunc","onCompletedFunc","defaultIfEmpty","found","retValue","distinct","hashSet","groupBy","elementSelector","groupByUntil","durationSelector","Dictionary","groupDisposable","getValues","fireNewMapEntry","writer","tryGetValue","GroupedObservable","durationGroup","duration","md","expire","MapObservable","innerMap","internalMap","select","selectorFn","currentProp","flatMapObserver","selectManyObserver","selectSwitch","flatMapLatest","switchMap","SkipObservable","skipCount","skipWhile","remaining","takeWhile","FilterObservable","innerPredicate","internalFilter","shouldYield","aggregate","ReduceObservable","reduce","some","any","isEmpty","all","includes","searchElement","fromIndex","contains","sum","prev","curr","minBy","min","maxBy","average","cur","sequenceEqual","donel","doner","ql","qr","subscription1","equal","subscription2","elementAt","single","singleOrDefault","firstOrDefault","last","lastOrDefault","find","findIndex","toSet","toMap","spawn","isGenFun","exit","ret","gen","called","hasCallback","context","observableToAsync","toAsync","AsyncSubject","fromCallback","publishLast","refCount","fromNodeCallback","useNativeEvents","fromEvent","addListener","fromEventPattern","h","removeListener","on","off","publish","addHandler","removeHandler","innerHandler","startAsync","functionAsync","PausableObservable","conn","connection","pausable","pauser","connect","controller","pause","resume","PausableBufferedObservable","drainQueue","previousShouldFire","shouldFire","pausableBuffered","ControlledObservable","enableQueue","ControlledSubject","multicast","request","numberOfItems","requestedCount","requestedDisposable","hasFailed","hasCompleted","hasRequested","disposeCurrentRequest","_processRequest","controlled","StopAndWaitObservable","StopAndWaitObserver","__sub__","stopAndWaitObserverProto","stopAndWait","WindowedObservable","WindowedObserver","windowSize","received","windowedObserverPrototype","windowed","pipe","dest","onDrain","write","emit","_isStdio","end","subjectOrSubjectSelector","connectable","ConnectableObservable","share","publishValue","initialValueOrSelector","initialValue","BehaviorSubject","shareValue","replay","bufferSize","ReplaySubject","shareReplay","InnerSubscription","observers","hasError","getValue","hasObservers","os","createRemovableDisposable","so","_trim","interval","hasSubscription","sourceObservable","connectableSubscription","shouldConnect","singleInstance","getObservable","hasObservable","isPrime","candidate","num1","sqrt","num2","getPrime","num","primes","stringHashFn","hash","character","charCodeAt","numberHashFn","c2","newEntry","hashCode","_initialize","freeCount","freeList","noSuchkey","duplicatekey","getHashCode","uniqueIdCounter","dictionaryProto","prime","buckets","entries","_insert","index3","index1","index2","_resize","numArray","entryArray","clear","_findEntry","containskey","leftDurationSelector","rightDurationSelector","leftDone","rightDone","leftId","rightId","leftMap","rightMap","buffer","bufferOpeningsOrClosingSelector","bufferClosingSelector","windowOpeningsOrClosingSelector","pairwise","hasPrevious","partition","letBind","ifThen","thenSource","elseSourceOrScheduler","forIn","observableWhileDo","whileDo","doWhile","switchCase","defaultSourceOrScheduler","expand","forkJoin","allSources","hasResults","ix","lastLeft","lastRight","leftStopped","rightStopped","hasLeft","hasRight","manySelect","extend","chain","ChainObservable","head","tail","_keys","_values","and","thenDo","activate","deactivate","activePlan","jlen","removeActivePlan","addActivePlan","match","hasValues","firstValues","isCompleted","activePlans","JoinObserverPrototype","when","plans","outObserver","observableinterval","timer","periodOrScheduler","getTime","delay","debounce","throttleWithTimeout","hasvalue","throttle","windowWithTime","timeShiftOrScheduler","timeShift","createTimer","isSpan","isShift","timerD","nextSpan","nextShift","newTotalTime","ts","totalTime","windowWithTimeOrCount","windowId","newId","newWindow","bufferWithTime","bufferWithTimeOrCount","timeInterval","span","sample","throttleLatest","intervalOrSampler","schedulerMethod","myId","original","switched","generateWithAbsoluteTime","timeSelector","generateWithRelativeTime","delaySubscription","delayWithSelector","subscriptionDelay","delayDurationSelector","subDelay","delays","timeoutWithSelector","firstTimeout","timeoutdurationSelector","setTimer","timerWins","observerWins","debounceWithSelector","currentid","throttleWithSelector","skipLastWithTime","takeLastWithTime","takeLastBufferWithTime","takeWithTime","skipWithTime","open","skipUntilWithTime","startTime","takeUntilWithTime","endTime","throttleFirst","windowDuration","RangeError","lastOnNext","transduce","transducer","transformForObserver","@@transducer/init","@@transducer/step","obs","input","@@transducer/result","xform","exclusive","hasCurrent","exclusiveMap","VirtualTimeScheduler","localNow","toDateTimeOffset","clock","scheduleAbsoluteWithState","scheduleRelativeWithState","toRelative","initialClock","isEnabled","VirtualTimeSchedulerPrototype","runAt","getNext","stop","advanceTo","dueToClock","advanceBy","sleep","HistoricalScheduler","cmp","HistoricalSchedulerProto","absolute","relative","AutoDetachObserverPrototype","underlyingObservable","mergedDisposable","AnonymousSubject","Pauser","define","amd"],"mappings":";CAEE,SAAUA,GA2DV,Q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vP,IAAGs0B,OAAU,SAAUloB,GAGrB,QAASkoB,KACPloB,EAAUlgB,KAAK6D,MAajB,MAhBA4S,IAAS2xB,EAAQloB,GASjBkoB,EAAOvnC,UAAUs2B,MAAQ,WAActzB,KAAK4D,QAAO,IAKnD2gC,EAAOvnC,UAAUu2B,OAAS,WAAcvzB,KAAK4D,QAAO,IAE7C2gC,GACPr5B,IAEmB,kBAAVs5B,SAA6C,gBAAdA,QAAOC,KAAmBD,OAAOC,KACzE7iC,GAAKqO,GAAKA,GAEVu0B,OAAO,WACL,MAAOv0B,OAEAR,IAAeG,GAEpBE,IACDF,GAAWF,QAAUO,IAAIA,GAAKA,GAE/BR,GAAYQ,GAAKA,GAInBrO,GAAKqO,GAAKA,EAIZ,IAAIhV,IAAcC,MAElBiB,KAAK6D"} \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.all.min.js b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.all.min.js
new file mode 100644
index 00000000000..7e36eb93dab
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.all.min.js
@@ -0,0 +1,6 @@
+/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
+(function(a){function b(a){for(var b=[],c=0,d=a.length;d>c;c++)b.push(a[c]);return b}function c(a,b){if(Ma&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(Qa)){for(var c=[],e=b;e;e=e.source)e.stack&&c.unshift(e.stack);c.unshift(a.stack);var f=c.join("\n"+Qa+"\n");a.stack=d(f)}}function d(a){for(var b=a.split("\n"),c=[],d=0,g=b.length;g>d;d++){var h=b[d];e(h)||f(h)||!h||c.push(h)}return c.join("\n")}function e(a){var b=h(a);if(!b)return!1;var c=b[0],d=b[1];return c===Oa&&d>=Pa&&Nd>=d}function f(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function g(){if(Ma)try{throw new Error}catch(a){var b=a.stack.split("\n"),c=b[0].indexOf("@")>0?b[1]:b[2],d=h(c);if(!d)return;return Oa=d[0],d[1]}}function h(a){var b=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(a);if(b)return[b[1],Number(b[2])];var c=/at ([^ ]+):(\d+):(?:\d+)$/.exec(a);if(c)return[c[1],Number(c[2])];var d=/.*@(.+):(\d+)$/.exec(a);return d?[d[1],Number(d[2])]:void 0}function i(a){var b=[];if(!xb(a))return b;wb.nonEnumArgs&&a.length&&yb(a)&&(a=Bb.call(a));var c=wb.enumPrototypes&&"function"==typeof a,d=wb.enumErrorProps&&(a===rb||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(wb.nonEnumShadows&&a!==sb){var f=a.constructor,g=-1,h=db;if(a===(f&&f.prototype))var i=a===tb?nb:a===rb?ib:ob.call(a),j=vb[i];for(;++g<h;)e=cb[g],j&&j[e]||!pb.call(a,e)||b.push(e)}return b}function j(a,b,c){for(var d=-1,e=c(a),f=e.length;++d<f;){var g=e[d];if(b(a[g],g,a)===!1)break}return a}function k(a,b){return j(a,b,i)}function l(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function m(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,f=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=f&&"object"!=f))return!1;var g=ob.call(a),h=ob.call(b);if(g==eb&&(g=lb),h==eb&&(h=lb),g!=h)return!1;switch(g){case gb:case hb:return+a==+b;case kb:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case mb:case nb:return a==String(b)}var i=g==fb;if(!i){if(g!=lb||!wb.nodeClass&&(l(a)||l(b)))return!1;var j=!wb.argsObject&&yb(a)?Object:a.constructor,n=!wb.argsObject&&yb(b)?Object:b.constructor;if(!(j==n||pb.call(a,"constructor")&&pb.call(b,"constructor")||La(j)&&j instanceof j&&La(n)&&n instanceof n||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var o=c.length;o--;)if(c[o]==a)return d[o]==b;var p=0,q=!0;if(c.push(a),d.push(b),i){if(o=a.length,p=b.length,q=p==o)for(;p--;){var r=b[p];if(!(q=m(a[p],r,c,d)))break}}else k(b,function(b,e,f){return pb.call(f,e)?(p++,q=pb.call(a,e)&&m(a[e],b,c,d)):void 0}),q&&k(a,function(a,b,c){return pb.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function n(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function o(){try{return zb.apply(this,arguments)}catch(a){return Fb.e=a,Fb}}function p(a){if(!La(a))throw new TypeError("fn must be a function");return zb=a,o}function q(a){throw a}function r(a,b){this.id=a,this.value=b}function t(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function u(a,b){b.isDisposed||(b.isDisposed=!0,b.disposable.dispose())}function v(a){this._s=s}function w(a){this._s=s,this._l=s.length,this._i=0}function x(a){this._a=a}function y(a){this._a=a,this._l=C(a),this._i=0}function z(a){return"number"==typeof a&&xa.isFinite(a)}function A(b){var c,d=b[Ya];if(!d&&"string"==typeof b)return c=new v(b),c[Ya]();if(!d&&b.length!==a)return c=new x(b),c[Ya]();if(!d)throw new TypeError("Object is not iterable");return b[Ya]()}function B(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function C(a){var b=+a.length;return isNaN(b)?0:0!==b&&z(b)?(b=B(b)*Math.floor(Math.abs(b)),0>=b?0:b>Hc?Hc:b):b}function D(a,b){this.observer=a,this.parent=b}function E(a,b){return Vb(a)||(a=$b),new Jc(b,a)}function F(a,b){this.observer=a,this.parent=b}function G(a,b){this.observer=a,this.parent=b}function H(a,b){return new Hd(function(c){var d=new Pb,e=new Qb;return e.setDisposable(d),d.setDisposable(a.subscribe(function(a){c.onNext(a)},function(a){try{var d=b(a)}catch(f){return c.onError(f)}Ja(d)&&(d=Ac(d));var g=new Pb;e.setDisposable(g),g.setDisposable(d.subscribe(c))},function(a){c.onCompleted(a)})),e},a)}function I(){return!1}function J(a,b){var c=this;return new Hd(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g=a[e++],h=p(b)(c,g);if(h===Fb)return d.onError(h.e);d.onNext(h)}else d.onCompleted()},function(a){d.onError(a)},function(){d.onCompleted()})},c)}function I(){return!1}function K(){return[]}function I(){return!1}function L(){return[]}function M(a,b){this.observer=a,this.accumulator=b.accumulator,this.hasSeed=b.hasSeed,this.seed=b.seed,this.hasAccumulation=!1,this.accumulation=null,this.hasValue=!1,this.isStopped=!1}function N(a,b,c){var d=bb(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return Ja(e)&&(e=Ac(e)),(_a(e)||$a(e))&&(e=Ic(e)),e}).concatAll()}function O(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function P(a){this.comparer=a,this.set=[]}function Q(a,b,c){var d=bb(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return Ja(e)&&(e=Ac(e)),(_a(e)||$a(e))&&(e=Ic(e)),e}).mergeAll()}function R(a,b,c){return new Hd(function(d){var e=!1,f=null,g=[];return a.subscribe(function(a){var h,i;try{i=b(a)}catch(j){return void d.onError(j)}if(h=0,e)try{h=c(i,f)}catch(k){return void d.onError(k)}else e=!0,f=i;h>0&&(f=i,g=[]),h>=0&&g.push(a)},function(a){d.onError(a)},function(){d.onNext(g),d.onCompleted()})},a)}function S(a){if(0===a.length)throw new Ra;return a[0]}function T(a,b,c,d){if(0>b)throw new Ta;return new Hd(function(e){var f=b;return a.subscribe(function(a){0===f--&&(e.onNext(a),e.onCompleted())},function(a){e.onError(a)},function(){c?(e.onNext(d),e.onCompleted()):e.onError(new Ta)})},a)}function U(a,b,c){return new Hd(function(d){var e=c,f=!1;return a.subscribe(function(a){f?d.onError(new Error("Sequence contains more than one element")):(e=a,f=!0)},function(a){d.onError(a)},function(){f||b?(d.onNext(e),d.onCompleted()):d.onError(new Ra)})},a)}function V(a,b,c){return new Hd(function(d){return a.subscribe(function(a){d.onNext(a),d.onCompleted()},function(a){d.onError(a)},function(){b?(d.onNext(c),d.onCompleted()):d.onError(new Ra)})},a)}function W(a,b,c){return new Hd(function(d){var e=c,f=!1;return a.subscribe(function(a){e=a,f=!0},function(a){d.onError(a)},function(){f||b?(d.onNext(e),d.onCompleted()):d.onError(new Ra)})},a)}function X(b,c,d,e){var f=bb(c,d,3);return new Hd(function(c){var d=0;return b.subscribe(function(a){var g;try{g=f(a,d,b)}catch(h){return void c.onError(h)}g?(c.onNext(e?d:a),c.onCompleted()):d++},function(a){c.onError(a)},function(){c.onNext(e?-1:a),c.onCompleted()})},b)}function Y(a,b){return Array.isArray(a)?Z.call(b,a):ba(a)?nd(a.call(b)):ca(a)?nd(a):aa(a)?$(a):Ja(a)?_(a):typeof a===ld?a:xb(a)||Array.isArray(a)?Z.call(b,a):a}function Z(a){var b=this;return function(c){function d(a,d){if(!e)try{if(a=Y(a,b),typeof a!==ld)return h[d]=a,--g||c(null,h);a.call(b,function(a,b){if(!e){if(a)return e=!0,c(a);h[d]=b,--g||c(null,h)}})}catch(f){e=!0,c(f)}}var e,f=Object.keys(a),g=f.length,h=new a.constructor;if(!g)return void cc.schedule(function(){c(null,h)});for(var i=0,j=f.length;j>i;i++)d(a[f[i]],f[i])}}function $(a){return function(b){var c,d=!1;a.subscribe(function(a){c=a,d=!0},b,function(){d&&b(null,c)})}}function _(a){return function(b){a.then(function(a){b(null,a)},b)}}function aa(a){return a&&typeof a.subscribe===ld}function ba(a){return a&&a.constructor&&"GeneratorFunction"===a.constructor.name}function ca(a){return a&&typeof a.next===ld&&typeof a[md]===ld}function da(a){a&&cc.schedule(function(){throw a})}function ea(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1),Lb(function(){a.removeEventListener(b,c,!1)});throw new Error("No listener found")}function fa(a,b,c){var d=new Ib,e=Object.prototype.toString;if("[object NodeList]"===e.call(a)||"[object HTMLCollection]"===e.call(a))for(var f=0,g=a.length;g>f;f++)d.add(fa(a.item(f),b,c));else a&&d.add(ea(a,b,c));return d}function ga(a,b,c){return new Hd(function(d){function e(a,b){if(j[b]=a,g[b]=!0,h||(h=g.every(Ea))){if(f)return d.onError(f);var e=p(c).apply(null,j);if(e===Fb)return d.onError(e.e);d.onNext(e)}i&&j[1]&&d.onCompleted()}var f,g=[!1,!1],h=!1,i=!1,j=new Array(2);return new Ib(a.subscribe(function(a){e(a,0)},function(a){j[1]?d.onError(a):f=a},function(){i=!0,j[1]&&d.onCompleted()}),b.subscribe(function(a){e(a,1)},function(a){d.onError(a)},function(){i=!0,e(!0,1)}))},a)}function ha(a,b){return a.groupJoin(this,b,Ec,function(a,b){return b})}function ia(a){var b=this;return new Hd(function(c){var d=new Kd,e=new Ib,f=new Rb(e);return c.onNext(Eb(d,f)),e.add(b.subscribe(function(a){d.onNext(a)},function(a){d.onError(a),c.onError(a)},function(){d.onCompleted(),c.onCompleted()})),Ja(a)&&(a=Ac(a)),e.add(a.subscribe(function(a){d.onCompleted(),d=new Kd,c.onNext(Eb(d,f))},function(a){d.onError(a),c.onError(a)},function(){d.onCompleted(),c.onCompleted()})),f},b)}function ja(a){var b=this;return new Hd(function(c){function d(){var b;try{b=a()}catch(f){return void c.onError(f)}Ja(b)&&(b=Ac(b));var i=new Pb;e.setDisposable(i),i.setDisposable(b.take(1).subscribe(Da,function(a){h.onError(a),c.onError(a)},function(){h.onCompleted(),h=new Kd,c.onNext(Eb(h,g)),d()}))}var e=new Qb,f=new Ib(e),g=new Rb(f),h=new Kd;return c.onNext(Eb(h,g)),f.add(b.subscribe(function(a){h.onNext(a)},function(a){h.onError(a),c.onError(a)},function(){h.onCompleted(),c.onCompleted()})),d(),g},b)}function ka(a,b){return new Bd(a,b)}function la(a){this.patterns=a}function ma(a,b){this.expression=a,this.selector=b}function na(a,b,c){var d=a.get(b);if(!d){var e=new Fd(b,c);return a.set(b,e),e}return d}function oa(a,b,c){this.joinObserverArray=a,this.onNext=b,this.onCompleted=c,this.joinObservers=new Ed;for(var d=0,e=this.joinObserverArray.length;e>d;d++){var f=this.joinObserverArray[d];this.joinObservers.set(f,f)}}function pa(a,b){return new Hd(function(c){return b.scheduleWithAbsolute(a,function(){c.onNext(0),c.onCompleted()})})}function qa(a,b,c){return new Hd(function(d){var e=a,f=Ub(b);return c.scheduleRecursiveWithAbsoluteAndState(0,e,function(a,b){if(f>0){var g=c.now();e+=f,g>=e&&(e=g+f)}d.onNext(a),b(a+1,e)})})}function ra(a,b){return new Hd(function(c){return b.scheduleWithRelative(Ub(a),function(){c.onNext(0),c.onCompleted()})})}function sa(a,b,c){return a===b?new Hd(function(a){return c.schedulePeriodicWithState(0,b,function(b){return a.onNext(b),b+1})}):Cc(function(){return qa(c.now()+a,b,c)})}function ta(a,b,c){return new Hd(function(d){var e,f=!1,g=new Qb,h=null,i=[],j=!1;return e=a.materialize().timestamp(c).subscribe(function(a){var e,k;"E"===a.value.kind?(i=[],i.push(a),h=a.value.exception,k=!j):(i.push({value:a.value,timestamp:a.timestamp+b}),k=!f,f=!0),k&&(null!==h?d.onError(h):(e=new Pb,g.setDisposable(e),e.setDisposable(c.scheduleRecursiveWithRelative(b,function(a){var b,e,g,k;if(null===h){j=!0;do g=null,i.length>0&&i[0].timestamp-c.now()<=0&&(g=i.shift().value),null!==g&&g.accept(d);while(null!==g);k=!1,e=0,i.length>0?(k=!0,e=Math.max(0,i[0].timestamp-c.now())):f=!1,b=h,j=!1,null!==b?d.onError(b):k&&a(e)}}))))}),new Ib(e,g)},a)}function ua(a,b,c){return Cc(function(){return ta(a,b-c.now(),c)})}function va(a,b){return new Hd(function(c){function d(){g&&(g=!1,c.onNext(e)),f&&c.onCompleted()}var e,f=!1,g=!1,h=new Pb;return h.setDisposable(a.subscribe(function(a){g=!0,e=a},function(a){c.onError(a)},function(){f=!0,h.dispose()})),new Ib(h,b.subscribe(d,function(a){c.onError(a)},d))},a)}var wa={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},xa=wa[typeof window]&&window||this,ya=wa[typeof exports]&&exports&&!exports.nodeType&&exports,za=wa[typeof module]&&module&&!module.nodeType&&module,Aa=za&&za.exports===ya&&ya,Ba=wa[typeof global]&&global;!Ba||Ba.global!==Ba&&Ba.window!==Ba||(xa=Ba);var Ca={internals:{},config:{Promise:xa.Promise},helpers:{}},Da=Ca.helpers.noop=function(){},Ea=(Ca.helpers.notDefined=function(a){return"undefined"==typeof a},Ca.helpers.identity=function(a){return a}),Fa=(Ca.helpers.pluck=function(a){return function(b){return b[a]}},Ca.helpers.just=function(a){return function(){return a}},Ca.helpers.defaultNow=Date.now),Ga=Ca.helpers.defaultComparer=function(a,b){return Ab(a,b)},Ha=Ca.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},Ia=(Ca.helpers.defaultKeySerializer=function(a){return a.toString()},Ca.helpers.defaultError=function(a){throw a}),Ja=Ca.helpers.isPromise=function(a){return!!a&&"function"!=typeof a.subscribe&&"function"==typeof a.then},Ka=(Ca.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},Ca.helpers.not=function(a){return!a}),La=Ca.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==ob.call(a)}),a}();Ca.config.longStackSupport=!1;var Ma=!1;try{throw new Error}catch(Na){Ma=!!Na.stack}var Oa,Pa=g(),Qa="From previous event:",Ra=Ca.EmptyError=function(){this.message="Sequence contains no elements.",Error.call(this)};Ra.prototype=Error.prototype;var Sa=Ca.ObjectDisposedError=function(){this.message="Object has been disposed",Error.call(this)};Sa.prototype=Error.prototype;var Ta=Ca.ArgumentOutOfRangeError=function(){this.message="Argument out of range",Error.call(this)};Ta.prototype=Error.prototype;var Ua=Ca.NotSupportedError=function(a){this.message=a||"This operation is not supported",Error.call(this)};Ua.prototype=Error.prototype;var Va=Ca.NotImplementedError=function(a){this.message=a||"This operation is not implemented",Error.call(this)};Va.prototype=Error.prototype;var Wa=Ca.helpers.notImplemented=function(){throw new Va},Xa=Ca.helpers.notSupported=function(){throw new Ua},Ya="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";xa.Set&&"function"==typeof(new xa.Set)["@@iterator"]&&(Ya="@@iterator");var Za=Ca.doneEnumerator={done:!0,value:a},$a=Ca.helpers.isIterable=function(b){return b[Ya]!==a},_a=Ca.helpers.isArrayLike=function(b){return b&&b.length!==a};Ca.helpers.iterator=Ya;var ab,bb=Ca.internals.bindCallback=function(a,b,c){if("undefined"==typeof b)return a;switch(c){case 0:return function(){return a.call(b)};case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)}}return function(){return a.apply(b,arguments)}},cb=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],db=cb.length,eb="[object Arguments]",fb="[object Array]",gb="[object Boolean]",hb="[object Date]",ib="[object Error]",jb="[object Function]",kb="[object Number]",lb="[object Object]",mb="[object RegExp]",nb="[object String]",ob=Object.prototype.toString,pb=Object.prototype.hasOwnProperty,qb=ob.call(arguments)==eb,rb=Error.prototype,sb=Object.prototype,tb=String.prototype,ub=sb.propertyIsEnumerable;try{ab=!(ob.call(document)==lb&&!({toString:0}+""))}catch(Na){ab=!0}var vb={};vb[fb]=vb[hb]=vb[kb]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},vb[gb]=vb[nb]={constructor:!0,toString:!0,valueOf:!0},vb[ib]=vb[jb]=vb[mb]={constructor:!0,toString:!0},vb[lb]={constructor:!0};var wb={};!function(){var a=function(){this.x=1},b=[];a.prototype={valueOf:1,y:1};for(var c in new a)b.push(c);for(c in arguments);wb.enumErrorProps=ub.call(rb,"message")||ub.call(rb,"name"),wb.enumPrototypes=ub.call(a,"prototype"),wb.nonEnumArgs=0!=c,wb.nonEnumShadows=!/valueOf/.test(b)}(1);var xb=Ca.internals.isObject=function(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1},yb=function(a){return a&&"object"==typeof a?ob.call(a)==eb:!1};qb||(yb=function(a){return a&&"object"==typeof a?pb.call(a,"callee"):!1});var zb,Ab=Ca.internals.isEqual=function(a,b){return m(a,b,[],[])},Bb=({}.hasOwnProperty,Array.prototype.slice),Cb=this.inherits=Ca.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c},Db=Ca.internals.addProperties=function(a){for(var b=[],c=1,d=arguments.length;d>c;c++)b.push(arguments[c]);for(var e=0,f=b.length;f>e;e++){var g=b[e];for(var h in g)a[h]=g[h]}},Eb=Ca.internals.addRef=function(a,b){return new Hd(function(c){return new Ib(b.getDisposable(),a.subscribe(c))})},Fb={e:{}};r.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var Gb=Ca.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},Hb=Gb.prototype;Hb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},Hb.percolate=function(a){if(!(a>=this.length||0>a)){var b=a-1>>1;if(!(0>b||b===a)&&this.isHigherPriority(a,b)){var c=this.items[a];this.items[a]=this.items[b],this.items[b]=c,this.percolate(b)}}},Hb.heapify=function(a){if(+a||(a=0),!(a>=this.length||0>a)){var b=2*a+1,c=2*a+2,d=a;if(b<this.length&&this.isHigherPriority(b,d)&&(d=b),c<this.length&&this.isHigherPriority(c,d)&&(d=c),d!==a){var e=this.items[a];this.items[a]=this.items[d],this.items[d]=e,this.heapify(d)}}},Hb.peek=function(){return this.items[0].value},Hb.removeAt=function(b){this.items[b]=this.items[--this.length],this.items[this.length]=a,this.heapify()},Hb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},Hb.enqueue=function(a){var b=this.length++;this.items[b]=new r(Gb.count++,a),this.percolate(b)},Hb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},Gb.count=0;var Ib=Ca.CompositeDisposable=function(){var a,b,c=[];if(Array.isArray(arguments[0]))c=arguments[0],b=c.length;else for(b=arguments.length,c=new Array(b),a=0;b>a;a++)c[a]=arguments[a];for(a=0;b>a;a++)if(!Nb(c[a]))throw new TypeError("Not a disposable");this.disposables=c,this.isDisposed=!1,this.length=c.length},Jb=Ib.prototype;Jb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},Jb.remove=function(a){var b=!1;if(!this.isDisposed){var c=this.disposables.indexOf(a);-1!==c&&(b=!0,this.disposables.splice(c,1),this.length--,a.dispose())}return b},Jb.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;for(var a=this.disposables.length,b=new Array(a),c=0;a>c;c++)b[c]=this.disposables[c];for(this.disposables=[],this.length=0,c=0;a>c;c++)b[c].dispose()}};var Kb=Ca.Disposable=function(a){this.isDisposed=!1,this.action=a||Da};Kb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var Lb=Kb.create=function(a){return new Kb(a)},Mb=Kb.empty={dispose:Da},Nb=Kb.isDisposable=function(a){return a&&La(a.dispose)},Ob=Kb.checkDisposed=function(a){if(a.isDisposed)throw new Sa},Pb=Ca.SingleAssignmentDisposable=function(){this.isDisposed=!1,this.current=null};Pb.prototype.getDisposable=function(){return this.current},Pb.prototype.setDisposable=function(a){if(this.current)throw new Error("Disposable has already been assigned");var b=this.isDisposed;!b&&(this.current=a),b&&a&&a.dispose()},Pb.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var Qb=Ca.SerialDisposable=function(){this.isDisposed=!1,this.current=null};Qb.prototype.getDisposable=function(){return this.current},Qb.prototype.setDisposable=function(a){var b=this.isDisposed;if(!b){var c=this.current;this.current=a}c&&c.dispose(),b&&a&&a.dispose()},Qb.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var Rb=Ca.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?Mb:new a(this)},b}();t.prototype.dispose=function(){this.scheduler.scheduleWithState(this,u)};var Sb=Ca.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||Ha,this.disposable=new Pb};Sb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},Sb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},Sb.prototype.isCancelled=function(){return this.disposable.isDisposed},Sb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var Tb=Ca.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),Mb}a.isScheduler=function(b){return b instanceof a};var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=Fa,a.normalize=function(a){return 0>a&&(a=0),a},a}(),Ub=Tb.normalize,Vb=Tb.isScheduler;!function(a){function b(a,b){function c(b){e(b,function(b){var d=!1,e=!1,g=a.scheduleWithState(b,function(a,b){return d?f.remove(g):e=!0,c(b),Mb});e||(f.add(g),d=!0)})}var d=b[0],e=b[1],f=new Ib;return c(d),f}function c(a,b,c){function d(b){f(b,function(b,e){var f=!1,h=!1,i=a[c](b,e,function(a,b){return f?g.remove(i):h=!0,d(b),Mb});h||(g.add(i),f=!0)})}var e=b[0],f=b[1],g=new Ib;return d(e),g}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,d)},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState([a,c],b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative([a,d],b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,d)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute([a,d],b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(Tb.prototype),function(a){Tb.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},Tb.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof xa.setInterval)throw new Ua;b=Ub(b);var d=a,e=xa.setInterval(function(){d=c(d)},b);return Lb(function(){xa.clearInterval(e)})}}(Tb.prototype),function(a){a.catchError=a["catch"]=function(a){return new dc(this,a)}}(Tb.prototype);var Wb,Xb,Yb=Ca.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new Pb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),Zb=Tb.immediate=function(){function a(a,b){return b(this,a)}return new Tb(Fa,a,Xa,Xa)}(),$b=Tb.currentThread=function(){function a(){for(;c.length>0;){var a=c.dequeue();!a.isCancelled()&&a.invoke()}}function b(b,d){var e=new Sb(this,b,d,this.now());if(c)c.enqueue(e);else{c=new Gb(4),c.enqueue(e);var f=p(a)();if(c=null,f===Fb)return q(f.e)}return e.disposable}var c,d=new Tb(Fa,b,Xa,Xa);return d.scheduleRequired=function(){return!c},d}(),_b=function(){var a,b=Da;if(xa.setTimeout)a=xa.setTimeout,b=xa.clearTimeout;else{if(!xa.WScript)throw new Ua;a=function(a,b){xa.WScript.Sleep(b),a()}}return{setTimeout:a,clearTimeout:b}}(),ac=_b.setTimeout,bc=_b.clearTimeout;!function(){function a(b){if(f)ac(function(){a(b)},0);else{var c=e[b];if(c){f=!0;var d=p(c)();if(Xb(b),f=!1,d===Fb)return q(d.e)}}}function b(){if(!xa.postMessage||xa.importScripts)return!1;var a=!1,b=xa.onmessage;return xa.onmessage=function(){a=!0},xa.postMessage("","*"),xa.onmessage=b,a}function c(b){"string"==typeof b.data&&b.data.substring(0,i.length)===i&&a(b.data.substring(i.length))}var d=1,e={},f=!1;Xb=function(a){delete e[a]};var g=RegExp("^"+String(ob).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),h="function"==typeof(h=Ba&&Aa&&Ba.setImmediate)&&!g.test(h)&&h;if(La(h))Wb=function(b){var c=d++;return e[c]=b,h(function(){a(c)}),c};else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))Wb=function(b){var c=d++;return e[c]=b,process.nextTick(function(){a(c)}),c};else if(b()){var i="ms.rx.schedule"+Math.random();xa.addEventListener?xa.addEventListener("message",c,!1):xa.attachEvent?xa.attachEvent("onmessage",c):xa.onmessage=c,Wb=function(a){var b=d++;return e[b]=a,xa.postMessage(i+currentId,"*"),b}}else if(xa.MessageChannel){var j=new xa.MessageChannel;j.port1.onmessage=function(b){a(b.data)},Wb=function(a){var b=d++;return e[b]=a,j.port2.postMessage(b),b}}else Wb="document"in xa&&"onreadystatechange"in xa.document.createElement("script")?function(b){var c=xa.document.createElement("script"),f=d++;return e[f]=b,c.onreadystatechange=function(){a(f),c.onreadystatechange=null,c.parentNode.removeChild(c),c=null},xa.document.documentElement.appendChild(c),f}:function(b){var c=d++;return e[c]=b,ac(function(){a(c)},0),c}}();var cc=Tb.timeout=Tb["default"]=function(){function a(a,b){var c=this,d=new Pb,e=Wb(function(){!d.isDisposed&&d.setDisposable(b(c,a))});return new Ib(d,Lb(function(){Xb(e)}))}function b(a,b,c){var d=this,e=Tb.normalize(b),f=new Pb;if(0===e)return d.scheduleWithState(a,c);var g=ac(function(){!f.isDisposed&&f.setDisposable(c(d,a))},e);return new Ib(f,Lb(function(){bc(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new Tb(Fa,a,b,c)}(),dc=function(a){function b(a,b){return this._scheduler.scheduleWithState(a,this._wrap(b))}function c(a,b,c){return this._scheduler.scheduleWithRelativeAndState(a,b,this._wrap(c))}function d(a,b,c){return this._scheduler.scheduleWithAbsoluteAndState(a,b,this._wrap(c))}function e(e,f){this._scheduler=e,this._handler=f,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this,this._scheduler.now.bind(this._scheduler),b,c,d)}return Cb(e,a),e.prototype._clone=function(a){return new e(a,this._handler)},e.prototype._wrap=function(a){var b=this;return function(c,d){try{return a(b._getRecursiveWrapper(c),d)}catch(e){if(!b._handler(e))throw e;return Mb}}},e.prototype._getRecursiveWrapper=function(a){if(this._recursiveOriginal!==a){this._recursiveOriginal=a;var b=this._clone(a);b._recursiveOriginal=a,b._recursiveWrapper=b,this._recursiveWrapper=b}return this._recursiveWrapper},e.prototype.schedulePeriodicWithState=function(a,b,c){var d=this,e=!1,f=new Pb;return f.setDisposable(this._scheduler.schedulePeriodicWithState(a,b,function(a){if(e)return null;try{return c(a)}catch(b){if(e=!0,!d._handler(b))throw b;return f.dispose(),null}})),f},e}(Tb),ec=Ca.Notification=function(){function a(a,b,c,d,e,f){this.kind=a,this.value=b,this.exception=c,this._accept=d,this._acceptObservable=e,this.toString=f}return a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return Vb(a)||(a=Zb),new Hd(function(c){return a.scheduleWithState(b,function(a,b){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),fc=ec.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){return new ec("N",d,null,a,b,c)}}(),gc=ec.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){return new ec("E",null,d,a,b,c)}}(),hc=ec.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){return new ec("C",null,null,a,b,c)}}(),ic=Ca.Observer=function(){};ic.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},ic.prototype.asObserver=function(){return new mc(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},ic.prototype.checked=function(){return new nc(this)};var jc=ic.create=function(a,b,c){return a||(a=Da),b||(b=Ia),c||(c=Da),new mc(a,b,c)};ic.fromNotifier=function(a,b){return new mc(function(c){return a.call(b,fc(c))},function(c){return a.call(b,gc(c))},function(){return a.call(b,hc())})},ic.prototype.notifyOn=function(a){return new pc(a,this)},ic.prototype.makeSafe=function(a){return new AnonymousSafeObserver(this._onNext,this._onError,this._onCompleted,a)};var kc,lc=Ca.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return Cb(b,a),b.prototype.next=Wa,b.prototype.error=Wa,b.prototype.completed=Wa,b.prototype.onNext=function(a){this.isStopped||this.next(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.error(a))},b.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(ic),mc=Ca.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return Cb(b,a),b.prototype.next=function(a){this._onNext(a)},b.prototype.error=function(a){this._onError(a)},b.prototype.completed=function(){this._onCompleted()},b}(lc),nc=function(a){function b(b){a.call(this),this._observer=b,this._state=0}Cb(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();var b=p(this._observer.onNext).call(this._observer,a);this._state=0,b===Fb&&q(b.e)},c.onError=function(a){this.checkAccess();var b=p(this._observer.onError).call(this._observer,a);this._state=2,b===Fb&&q(b.e)},c.onCompleted=function(){this.checkAccess();var a=p(this._observer.onCompleted).call(this._observer);this._state=2,a===Fb&&q(a.e)},c.checkAccess=function(){if(1===this._state)throw new Error("Re-entrancy detected");if(2===this._state)throw new Error("Observer completed");0===this._state&&(this._state=1)},b}(ic),oc=Ca.internals.ScheduledObserver=function(a){function b(b,c){a.call(this),this.scheduler=b,this.observer=c,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new Qb}return Cb(b,a),b.prototype.next=function(a){var b=this;this.queue.push(function(){b.observer.onNext(a)})},b.prototype.error=function(a){var b=this;this.queue.push(function(){b.observer.onError(a)})},b.prototype.completed=function(){var a=this;this.queue.push(function(){a.observer.onCompleted()})},b.prototype.ensureActive=function(){var a=!1,b=this;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(a){var c;if(!(b.queue.length>0))return void(b.isAcquired=!1);c=b.queue.shift();try{c()}catch(d){throw b.queue=[],b.hasFaulted=!0,d}a()}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(lc),pc=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return Cb(b,a),b.prototype.next=function(b){a.prototype.next.call(this,b),this.ensureActive()},b.prototype.error=function(b){a.prototype.error.call(this,b),this.ensureActive()},b.prototype.completed=function(){a.prototype.completed.call(this),this.ensureActive()},b.prototype.dispose=function(){
+a.prototype.dispose.call(this),this._cancel&&this._cancel.dispose(),this._cancel=null},b}(oc),qc=Ca.Observable=function(){function a(a){if(Ca.config.longStackSupport&&Ma){try{throw new Error}catch(b){this.stack=b.stack.substring(b.stack.indexOf("\n")+1)}var d=this;this._subscribe=function(b){var e=b.onError.bind(b);return b.onError=function(a){c(a,d),e(a)},a.call(d,b)}}else this._subscribe=a}return kc=a.prototype,kc.subscribe=kc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:jc(a,b,c))},kc.subscribeOnNext=function(a,b){return this._subscribe(jc("undefined"!=typeof b?function(c){a.call(b,c)}:a))},kc.subscribeOnError=function(a,b){return this._subscribe(jc(null,"undefined"!=typeof b?function(c){a.call(b,c)}:a))},kc.subscribeOnCompleted=function(a,b){return this._subscribe(jc(null,null,"undefined"!=typeof b?function(){a.call(b)}:a))},a}(),rc=Ca.ObservableBase=function(a){function b(a){return a&&La(a.dispose)?a:La(a)?Lb(a):Mb}function c(a,c){var d=c[0],e=c[1],f=p(e.subscribeCore).call(e,d);return f!==Fb||d.fail(Fb.e)?void d.setDisposable(b(f)):q(Fb.e)}function d(a){var b=new Id(a),d=[b,this];return $b.scheduleRequired()?$b.scheduleWithState(d,c):c(null,d),b}function e(){a.call(this,d)}return Cb(e,a),e.prototype.subscribeCore=Wa,e}(qc),sc=Ca.internals.Enumerable=function(){},tc=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b,c){this.o=a,this.s=b,this.e=c,this.isStopped=!1}return Cb(b,a),b.prototype.subscribeCore=function(a){var b,d=new Qb,e=Zb.scheduleRecursiveWithState(this.sources[Ya](),function(e,f){if(!b){var g=p(e.next).call(e);if(g===Fb)return a.onError(g.e);if(g.done)return a.onCompleted();var h=g.value;Ja(h)&&(h=Ac(h));var i=new Pb;d.setDisposable(i),i.setDisposable(h.subscribe(new c(a,f,e)))}});return new Ib(d,e,Lb(function(){b=!0}))},c.prototype.onNext=function(a){this.isStopped||this.o.onNext(a)},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.s(this.e))},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(rc);sc.prototype.concat=function(){return new tc(this)};var uc=function(a){function b(b){this.sources=b,a.call(this)}return Cb(b,a),b.prototype.subscribeCore=function(a){var b,c=this.sources[Ya](),d=new Qb,e=Zb.scheduleRecursiveWithState(null,function(e,f){if(!b){var g=p(c.next).call(c);if(g===Fb)return a.onError(g.e);if(g.done)return null!==e?a.onError(e):a.onCompleted();var h=g.value;Ja(h)&&(h=Ac(h));var i=new Pb;d.setDisposable(i),i.setDisposable(h.subscribe(function(b){a.onNext(b)},f,function(){a.onCompleted()}))}});return new Ib(d,e,Lb(function(){b=!0}))},b}(rc);sc.prototype.catchError=function(){return new uc(this)},sc.prototype.catchErrorWhen=function(a){var b=this;return new Hd(function(c){var d,e,f=new Kd,g=new Kd,h=a(f),i=h.subscribe(g),j=b[Ya](),k=new Qb,l=Zb.scheduleRecursive(function(a){if(!d){var b=p(j.next).call(j);if(b===Fb)return c.onError(b.e);if(b.done)return void(e?c.onError(e):c.onCompleted());var h=b.value;Ja(h)&&(h=Ac(h));var i=new Pb,l=new Pb;k.setDisposable(new Ib(l,i)),i.setDisposable(h.subscribe(function(a){c.onNext(a)},function(b){l.setDisposable(g.subscribe(a,function(a){c.onError(a)},function(){c.onCompleted()})),f.onNext(b)},function(){c.onCompleted()}))}});return new Ib(i,k,l,Lb(function(){d=!0}))})};var vc=function(a){function b(a,b){this.v=a,this.c=null==b?-1:b}function c(a){this.v=a.v,this.l=a.c}return Cb(b,a),b.prototype[Ya]=function(){return new c(this)},c.prototype.next=function(){return 0===this.l?Za:(this.l>0&&this.l--,{done:!1,value:this.v})},b}(sc),wc=sc.repeat=function(a,b){return new vc(a,b)},xc=function(a){function b(a,b,c){this.s=a,this.fn=b?bb(b,c,3):null}function c(a){this.i=-1,this.s=a.s,this.l=this.s.length,this.fn=a.fn}return Cb(b,a),b.prototype[Ya]=function(){return new c(this)},c.prototype.next=function(){return++this.i<this.l?{done:!1,value:this.fn?this.fn(this.s[this.i],this.i,this.s):this.s[this.i]}:Za},b}(sc),yc=sc.of=function(a,b,c){return new xc(a,b,c)};kc.observeOn=function(a){var b=this;return new Hd(function(c){return b.subscribe(new pc(a,c))},b)},kc.subscribeOn=function(a){var b=this;return new Hd(function(c){var d=new Pb,e=new Qb;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new t(a,b.subscribe(c)))})),e},b)};var zc=function(a){function b(b){this.p=b,a.call(this)}return Cb(b,a),b.prototype.subscribeCore=function(a){return this.p.then(function(b){a.onNext(b),a.onCompleted()},function(b){a.onError(b)}),Mb},b}(rc),Ac=qc.fromPromise=function(a){return new zc(a)};kc.toPromise=function(a){if(a||(a=Ca.config.Promise),!a)throw new Ua("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})};var Bc=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.a=[],this.isStopped=!1}return Cb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a))},c.prototype.onNext=function(a){this.isStopped||this.a.push(a)},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onNext(this.a),this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(rc);kc.toArray=function(){return new Bc(this)},qc.create=qc.createWithDisposable=function(a,b){return new Hd(a,b)};var Cc=qc.defer=function(a){return new Hd(function(b){var c;try{c=a()}catch(d){return Tc(d).subscribe(b)}return Ja(c)&&(c=Ac(c)),c.subscribe(b)})},Dc=function(a){function b(b){this.scheduler=b,a.call(this)}function c(a,b){this.observer=a,this.parent=b}function d(a,b){b.onCompleted()}return Cb(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this);return b.run()},c.prototype.run=function(){return this.parent.scheduler.scheduleWithState(this.observer,d)},b}(rc),Ec=qc.empty=function(a){return Vb(a)||(a=Zb),new Dc(a)},Fc=function(a){function b(b,c,d){this.iterable=b,this.mapper=c,this.scheduler=d,a.call(this)}return Cb(b,a),b.prototype.subscribeCore=function(a){var b=new Gc(a,this);return b.run()},b}(rc),Gc=function(){function a(a,b){this.observer=a,this.parent=b}return a.prototype.run=function(){function a(a,b){try{var f=c.next()}catch(g){return d.onError(g)}if(f.done)return d.onCompleted();var h=f.value;if(e)try{h=e(h,a)}catch(g){return d.onError(g)}d.onNext(h),b(a+1)}var b=Object(this.parent.iterable),c=A(b),d=this.observer,e=this.parent.mapper;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}(),Hc=Math.pow(2,53)-1;v.prototype[Ya]=function(){return new w(this._s)},w.prototype[Ya]=function(){return this},w.prototype.next=function(){return this._i<this._l?{done:!1,value:this._s.charAt(this._i++)}:Za},x.prototype[Ya]=function(){return new y(this._a)},y.prototype[Ya]=function(){return this},y.prototype.next=function(){return this._i<this._l?{done:!1,value:this._a[this._i++]}:Za};var Ic=qc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!La(b))throw new Error("mapFn when provided must be a function");if(b)var e=bb(b,c,2);return Vb(d)||(d=$b),new Fc(a,e,d)},Jc=function(a){function b(b,c){this.args=b,this.scheduler=c,a.call(this)}return Cb(b,a),b.prototype.subscribeCore=function(a){var b=new D(a,this);return b.run()},b}(rc);D.prototype.run=function(){function a(a,e){d>a?(b.onNext(c[a]),e(a+1)):b.onCompleted()}var b=this.observer,c=this.parent.args,d=c.length;return this.parent.scheduler.scheduleRecursiveWithState(0,a)};var Kc=qc.fromArray=function(a,b){return Vb(b)||(b=$b),new Jc(a,b)};qc.generate=function(a,b,c,d,e){return Vb(e)||(e=$b),new Hd(function(f){var g=!0;return e.scheduleRecursiveWithState(a,function(a,e){var h,i;try{g?g=!1:a=c(a),h=b(a),h&&(i=d(a))}catch(j){return f.onError(j)}h?(f.onNext(i),e(a)):f.onCompleted()})})},qc.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return new Jc(b,$b)},qc.ofWithScheduler=function(a){for(var b=arguments.length,c=new Array(b-1),d=1;b>d;d++)c[d-1]=arguments[d];return new Jc(c,a)},qc.ofArrayChanges=function(a){if(!Array.isArray(a))throw new TypeError("Array.observe only accepts arrays.");if("function"!=typeof Array.observe&&"function"!=typeof Array.unobserve)throw new TypeError("Array.observe is not supported on your platform");return new Hd(function(b){function c(a){for(var c=0,d=a.length;d>c;c++)b.onNext(a[c])}return Array.observe(a,c),function(){Array.unobserve(a,c)}})},qc.ofObjectChanges=function(a){if(null==a)throw new TypeError("object must not be null or undefined.");if("function"!=typeof Object.observe&&"function"!=typeof Object.unobserve)throw new TypeError("Object.observe is not supported on your platform");return new Hd(function(b){function c(a){for(var c=0,d=a.length;d>c;c++)b.onNext(a[c])}return Object.observe(a,c),function(){Object.unobserve(a,c)}})};var Lc=function(a){function b(){a.call(this)}return Cb(b,a),b.prototype.subscribeCore=function(a){return Mb},b}(rc),Mc=qc.never=function(){return new Lc},Nc=function(a){function b(b,c){this.obj=b,this.keys=Object.keys(b),this.scheduler=c,a.call(this)}return Cb(b,a),b.prototype.subscribeCore=function(a){var b=new F(a,this);return b.run()},b}(rc);F.prototype.run=function(){function a(a,f){if(e>a){var g=d[a];b.onNext([g,c[g]]),f(a+1)}else b.onCompleted()}var b=this.observer,c=this.parent.obj,d=this.parent.keys,e=d.length;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},qc.pairs=function(a,b){return b||(b=$b),new Nc(a,b)};var Oc=function(a){function b(b,c,d){this.start=b,this.rangeCount=c,this.scheduler=d,a.call(this)}return Cb(b,a),b.prototype.subscribeCore=function(a){var b=new Pc(a,this);return b.run()},b}(rc),Pc=function(){function a(a,b){this.observer=a,this.parent=b}return a.prototype.run=function(){function a(a,e){c>a?(d.onNext(b+a),e(a+1)):d.onCompleted()}var b=this.parent.start,c=this.parent.rangeCount,d=this.observer;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}();qc.range=function(a,b,c){return Vb(c)||(c=$b),new Oc(a,b,c)};var Qc=function(a){function b(b,c,d){this.value=b,this.repeatCount=null==c?-1:c,this.scheduler=d,a.call(this)}return Cb(b,a),b.prototype.subscribeCore=function(a){var b=new G(a,this);return b.run()},b}(rc);G.prototype.run=function(){function a(a,d){return(-1===a||a>0)&&(b.onNext(c),a>0&&a--),0===a?b.onCompleted():void d(a)}var b=this.observer,c=this.parent.value;return this.parent.scheduler.scheduleRecursiveWithState(this.parent.repeatCount,a)},qc.repeat=function(a,b,c){return Vb(c)||(c=$b),new Qc(a,b,c)};var Rc=function(a){function b(b,c){this.value=b,this.scheduler=c,a.call(this)}function c(a,b){this.observer=a,this.parent=b}function d(a,b){var c=b[0],d=b[1];d.onNext(c),d.onCompleted()}return Cb(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this);return b.run()},c.prototype.run=function(){return this.parent.scheduler.scheduleWithState([this.parent.value,this.observer],d)},b}(rc),Sc=(qc["return"]=qc.just=qc.returnValue=function(a,b){return Vb(b)||(b=Zb),new Rc(a,b)},function(a){function b(b,c){this.error=b,this.scheduler=c,a.call(this)}function c(a,b){this.o=a,this.p=b}function d(a,b){var c=b[0],d=b[1];d.onError(c)}return Cb(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this);return b.run()},c.prototype.run=function(){return this.p.scheduler.scheduleWithState([this.p.error,this.o],d)},b}(rc)),Tc=qc["throw"]=qc.throwError=qc.throwException=function(a,b){return Vb(b)||(b=Zb),new Sc(a,b)};qc.using=function(a,b){return new Hd(function(c){var d,e,f=Mb;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new Ib(Tc(g).subscribe(c),f)}return new Ib(e.subscribe(c),f)})},kc.amb=function(a){var b=this;return new Hd(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new Pb,j=new Pb;return Ja(a)&&(a=Ac(a)),i.setDisposable(b.subscribe(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()})),j.setDisposable(a.subscribe(function(a){e(),f===h&&c.onNext(a)},function(a){e(),f===h&&c.onError(a)},function(){e(),f===h&&c.onCompleted()})),new Ib(i,j)})},qc.amb=function(){function a(a,b){return a.amb(b)}var b=Mc(),c=[];if(Array.isArray(arguments[0]))c=arguments[0];else for(var d=0,e=arguments.length;e>d;d++)c.push(arguments[d]);for(var d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},kc["catch"]=kc.catchError=kc.catchException=function(a){return"function"==typeof a?H(this,a):Uc([this,a])};var Uc=qc.catchError=qc["catch"]=qc.catchException=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return yc(a).catchError()};kc.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return Array.isArray(b[0])?b[0].unshift(this):b.unshift(this),Vc.apply(this,b)};var Vc=qc.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.pop();return Array.isArray(b[0])&&(b=b[0]),new Hd(function(a){function c(b){if(h[b]=!0,i||(i=h.every(Ea))){try{var c=d.apply(null,k)}catch(e){return a.onError(e)}a.onNext(c)}else j.filter(function(a,c){return c!==b}).every(Ea)&&a.onCompleted()}function e(b){j[b]=!0,j.every(Ea)&&a.onCompleted()}for(var f=b.length,g=function(){return!1},h=n(f,g),i=!1,j=n(f,g),k=new Array(f),l=new Array(f),m=0;f>m;m++)!function(d){var f=b[d],g=new Pb;Ja(f)&&(f=Ac(f)),g.setDisposable(f.subscribe(function(a){k[d]=a,c(d)},function(b){a.onError(b)},function(){e(d)})),l[d]=g}(m);return new Ib(l)},this)};kc.concat=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return a.unshift(this),Xc.apply(null,a)};var Wc=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b){this.sources=a,this.o=b}return Cb(b,a),b.prototype.subscribeCore=function(a){var b=new c(this.sources,a);return b.run()},c.prototype.run=function(){var a,b=new Qb,c=this.sources,d=c.length,e=this.o,f=Zb.scheduleRecursiveWithState(0,function(f,g){if(!a){if(f===d)return e.onCompleted();var h=c[f];Ja(h)&&(h=Ac(h));var i=new Pb;b.setDisposable(i),i.setDisposable(h.subscribe(function(a){e.onNext(a)},function(a){e.onError(a)},function(){g(f+1)}))}});return new Ib(b,f,Lb(function(){a=!0}))},b}(rc),Xc=qc.concat=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(arguments.length);for(var b=0,c=arguments.length;c>b;b++)a[b]=arguments[b]}return new Wc(a)};kc.concatAll=kc.concatObservable=function(){return this.merge(1)};var Yc=function(a){function b(b,c){this.source=b,this.maxConcurrent=c,a.call(this)}return Cb(b,a),b.prototype.subscribeCore=function(a){var b=new Ib;return b.add(this.source.subscribe(new Zc(a,this.maxConcurrent,b))),b},b}(rc),Zc=function(){function a(a,b,c){this.o=a,this.max=b,this.g=c,this.done=!1,this.q=[],this.activeCount=0,this.isStopped=!1}function b(a,b){this.parent=a,this.sad=b,this.isStopped=!1}return a.prototype.handleSubscribe=function(a){var c=new Pb;this.g.add(c),Ja(a)&&(a=Ac(a)),c.setDisposable(a.subscribe(new b(this,c)))},a.prototype.onNext=function(a){this.isStopped||(this.activeCount<this.max?(this.activeCount++,this.handleSubscribe(a)):this.q.push(a))},a.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},a.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,0===this.activeCount&&this.o.onCompleted())},a.prototype.dispose=function(){this.isStopped=!0},a.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b.prototype.onNext=function(a){this.isStopped||this.parent.o.onNext(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.o.onError(a))},b.prototype.onCompleted=function(){if(!this.isStopped){this.isStopped=!0;var a=this.parent;a.g.remove(this.sad),a.q.length>0?a.handleSubscribe(a.q.shift()):(a.activeCount--,a.done&&0===a.activeCount&&a.o.onCompleted())}},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},a}();kc.merge=function(a){return"number"!=typeof a?$c(this,a):new Yc(this,a)};var $c=qc.merge=function(){var a,b,c=[],d=arguments.length;if(arguments[0])if(Vb(arguments[0]))for(a=arguments[0],b=1;d>b;b++)c.push(arguments[b]);else for(a=Zb,b=0;d>b;b++)c.push(arguments[b]);else for(a=Zb,b=1;d>b;b++)c.push(arguments[b]);return Array.isArray(c[0])&&(c=c[0]),E(a,c).mergeAll()},_c=function(a){function b(b){this.source=b,a.call(this)}function c(a,b){this.o=a,this.g=b,this.isStopped=!1,this.done=!1}function d(a,b,c){this.parent=a,this.g=b,this.sad=c,this.isStopped=!1}return Cb(b,a),b.prototype.subscribeCore=function(a){var b=new Ib,d=new Pb;return b.add(d),d.setDisposable(this.source.subscribe(new c(a,b))),b},c.prototype.onNext=function(a){if(!this.isStopped){var b=new Pb;this.g.add(b),Ja(a)&&(a=Ac(a)),b.setDisposable(a.subscribe(new d(this,this.g,b)))}},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,1===this.g.length&&this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},d.prototype.onNext=function(a){this.isStopped||this.parent.o.onNext(a)},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.o.onError(a))},d.prototype.onCompleted=function(){if(!this.isStopped){var a=this.parent;this.isStopped=!0,a.g.remove(this.sad),a.done&&1===a.g.length&&a.o.onCompleted()}},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},b}(rc);kc.mergeAll=kc.mergeObservable=function(){return new _c(this)};var ad=Ca.CompositeError=function(a){this.name="NotImplementedError",this.innerErrors=a,this.message="This contains multiple errors. Check the innerErrors",Error.call(this)};ad.prototype=Error.prototype,qc.mergeDelayError=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}var d=E(null,a);return new Hd(function(a){function b(){0===g.length?a.onCompleted():a.onError(1===g.length?g[0]:new ad(g))}var c=new Ib,e=new Pb,f=!1,g=[];return c.add(e),e.setDisposable(d.subscribe(function(d){var e=new Pb;c.add(e),Ja(d)&&(d=Ac(d)),e.setDisposable(d.subscribe(function(b){a.onNext(b)},function(a){g.push(a),c.remove(e),f&&1===c.length&&b()},function(){c.remove(e),f&&1===c.length&&b()}))},function(a){g.push(a),f=!0,1===c.length&&b()},function(){f=!0,1===c.length&&b()})),c})},kc.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return bd([this,a])};var bd=qc.onErrorResumeNext=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return new Hd(function(b){var c=0,d=new Qb,e=Zb.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],Ja(f)&&(f=Ac(f)),g=new Pb,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new Ib(d,e)})};kc.skipUntil=function(a){var b=this;return new Hd(function(c){var d=!1,e=new Ib(b.subscribe(function(a){d&&c.onNext(a)},function(a){c.onError(a)},function(){d&&c.onCompleted()}));Ja(a)&&(a=Ac(a));var f=new Pb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},function(a){c.onError(a)},function(){f.dispose()})),e},b)};var cd=function(a){function b(b){this.source=b,a.call(this)}function c(a,b){this.o=a,this.inner=b,this.stopped=!1,this.latest=0,this.hasLatest=!1,this.isStopped=!1}function d(a,b){this.parent=a,this.id=b,this.isStopped=!1}return Cb(b,a),b.prototype.subscribeCore=function(a){var b=new Qb,d=this.source.subscribe(new c(a,b));return new Ib(d,b)},c.prototype.onNext=function(a){if(!this.isStopped){var b=new Pb,c=++this.latest;this.hasLatest=!0,this.inner.setDisposable(b),Ja(a)&&(a=Ac(a)),b.setDisposable(a.subscribe(new d(this,c)))}},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.stopped=!0,!this.hasLatest&&this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},d.prototype.onNext=function(a){this.isStopped||this.parent.latest===this.id&&this.parent.o.onNext(a)},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.latest===this.id&&this.parent.o.onError(a))},d.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.parent.latest===this.id&&(this.parent.hasLatest=!1,this.parent.isStopped&&this.parent.o.onCompleted()))},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},b}(rc);kc["switch"]=kc.switchLatest=function(){return new cd(this)};var dd=function(a){function b(b,c){this.source=b,this.other=Ja(c)?Ac(c):c,a.call(this)}function c(a){this.o=a,this.isStopped=!1}return Cb(b,a),b.prototype.subscribeCore=function(a){return new Ib(this.source.subscribe(a),this.other.subscribe(new c(a)))},c.prototype.onNext=function(a){this.isStopped||this.o.onCompleted()},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){!this.isStopped&&(this.isStopped=!0)},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(rc);kc.takeUntil=function(a){return new dd(this,a)},kc.withLatestFrom=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.pop(),e=this;return Array.isArray(b[0])&&(b=b[0]),new Hd(function(a){for(var c=b.length,f=n(c,I),g=!1,h=new Array(c),i=new Array(c+1),j=0;c>j;j++)!function(c){var d=b[c],e=new Pb;Ja(d)&&(d=Ac(d)),e.setDisposable(d.subscribe(function(a){h[c]=a,f[c]=!0,g=f.every(Ea)},function(b){a.onError(b)},Da)),i[c]=e}(j);var k=new Pb;return k.setDisposable(e.subscribe(function(b){var c=[b].concat(h);if(g){var e=p(d).apply(null,c);return e===Fb?a.onError(e.e):void a.onNext(e)}},function(b){a.onError(b)},function(){a.onCompleted()})),i[c]=k,new Ib(i)},this)},kc.zip=function(){if(Array.isArray(arguments[0]))return J.apply(this,arguments);for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=this,e=b.pop();return b.unshift(d),new Hd(function(a){for(var c=b.length,f=n(c,K),g=n(c,I),h=new Array(c),i=0;c>i;i++)!function(c){var i=b[c],j=new Pb;Ja(i)&&(i=Ac(i)),j.setDisposable(i.subscribe(function(b){if(f[c].push(b),f.every(function(a){return a.length>0})){var h=f.map(function(a){return a.shift()}),i=p(e).apply(d,h);if(i===Fb)return a.onError(i.e);a.onNext(i)}else g.filter(function(a,b){return b!==c}).every(Ea)&&a.onCompleted()},function(b){a.onError(b)},function(){g[c]=!0,g.every(Ea)&&a.onCompleted()})),h[c]=j}(i);return new Ib(h)},d)},qc.zip=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.shift();return d.zip.apply(d,b)},qc.zipArray=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new Hd(function(b){for(var c=a.length,d=n(c,L),e=n(c,I),f=new Array(c),g=0;c>g;g++)!function(c){f[c]=new Pb,f[c].setDisposable(a[c].subscribe(function(a){if(d[c].push(a),d.every(function(a){return a.length>0})){var f=d.map(function(a){return a.shift()});b.onNext(f)}else if(e.filter(function(a,b){return b!==c}).every(Ea))return b.onCompleted()},function(a){b.onError(a)},function(){e[c]=!0,e.every(Ea)&&b.onCompleted()}))}(g);return new Ib(f)})},kc.asObservable=function(){var a=this;return new Hd(function(b){return a.subscribe(b)},a)},kc.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).selectMany(function(a){return a.toArray()}).where(function(a){return a.length>0})},kc.dematerialize=function(){var a=this;return new Hd(function(b){return a.subscribe(function(a){return a.accept(b)},function(a){b.onError(a)},function(){b.onCompleted()})},this)},kc.distinctUntilChanged=function(a,b){var c=this;return b||(b=Ga),new Hd(function(d){var e,f=!1;return c.subscribe(function(c){var g=c;if(a&&(g=p(a)(c),g===Fb))return d.onError(g.e);if(f){var h=p(b)(e,g);if(h===Fb)return d.onError(h.e)}f&&h||(f=!0,e=g,d.onNext(c))},function(a){d.onError(a)},function(){d.onCompleted()})},this)};var ed=function(a){function b(b,c,d,e){this.source=b,this.t=!c||La(c)?jc(c||Da,d||Da,e||Da):c,a.call(this)}function c(a,b){this.o=a,this.t=b,this.isStopped=!1}return Cb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this.t))},c.prototype.onNext=function(a){if(!this.isStopped){var b=p(this.t.onNext).call(this.t,a);b===Fb&&this.o.onError(b.e),this.o.onNext(a)}},c.prototype.onError=function(a){if(!this.isStopped){this.isStopped=!0;var b=p(this.t.onError).call(this.t,a);if(b===Fb)return this.o.onError(b.e);this.o.onError(a)}},c.prototype.onCompleted=function(){if(!this.isStopped){this.isStopped=!0;var a=p(this.t.onCompleted).call(this.t);if(a===Fb)return this.o.onError(a.e);this.o.onCompleted()}},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(rc);kc["do"]=kc.tap=kc.doAction=function(a,b,c){return new ed(this,a,b,c)},kc.doOnNext=kc.tapOnNext=function(a,b){return this.tap("undefined"!=typeof b?function(c){a.call(b,c)}:a)},kc.doOnError=kc.tapOnError=function(a,b){return this.tap(Da,"undefined"!=typeof b?function(c){a.call(b,c)}:a)},kc.doOnCompleted=kc.tapOnCompleted=function(a,b){return this.tap(Da,null,"undefined"!=typeof b?function(){a.call(b)}:a)},kc["finally"]=kc.ensure=function(a){var b=this;return new Hd(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return Lb(function(){try{d.dispose()}catch(b){throw b}finally{a()}})},this)},kc.finallyAction=function(a){return this.ensure(a)};var fd=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.isStopped=!1}return Cb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a))},c.prototype.onNext=Da,c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},b}(rc);kc.ignoreElements=function(){return new fd(this)},kc.materialize=function(){var a=this;return new Hd(function(b){return a.subscribe(function(a){b.onNext(fc(a))},function(a){b.onNext(gc(a)),b.onCompleted()},function(){b.onNext(hc()),b.onCompleted()})},a)},kc.repeat=function(a){return wc(this,a).concat()},kc.retry=function(a){return wc(this,a).catchError()},kc.retryWhen=function(a){return wc(this).catchErrorWhen(a)};var gd=function(a){function b(b,c,d,e){this.source=b,this.accumulator=c,this.hasSeed=d,this.seed=e,a.call(this)}return Cb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new M(a,this))},b}(rc);M.prototype.onNext=function(a){if(!this.isStopped){!this.hasValue&&(this.hasValue=!0);try{this.hasAccumulation?this.accumulation=this.accumulator(this.accumulation,a):(this.accumulation=this.hasSeed?this.accumulator(this.seed,a):a,this.hasAccumulation=!0)}catch(b){return this.observer.onError(b)}this.observer.onNext(this.accumulation)}},M.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.observer.onError(a))},M.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,!this.hasValue&&this.hasSeed&&this.observer.onNext(this.seed),this.observer.onCompleted())},M.prototype.dispose=function(){this.isStopped=!0},M.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},kc.scan=function(){var a,b,c=!1;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new gd(this,b,c,a)},kc.skipLast=function(a){if(0>a)throw new Ta;var b=this;return new Hd(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},function(a){c.onError(a)},function(){c.onCompleted()})},b)},kc.startWith=function(){var a,b=0;arguments.length&&Vb(arguments[0])?(a=arguments[0],b=1):a=Zb;for(var c=[],d=b,e=arguments.length;e>d;d++)c.push(arguments[d]);return yc([Kc(c,a),this]).concat()},kc.takeLast=function(a){if(0>a)throw new Ta;var b=this;return new Hd(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},function(a){c.onError(a)},function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})},b)},kc.takeLastBuffer=function(a){var b=this;return new Hd(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},function(a){c.onError(a)},function(){c.onNext(d),c.onCompleted()})},b)},kc.windowWithCount=function(a,b){var c=this;if(+a||(a=0),Math.abs(a)===1/0&&(a=0),0>=a)throw new Ta;if(null==b&&(b=a),+b||(b=0),Math.abs(b)===1/0&&(b=0),0>=b)throw new Ta;return new Hd(function(d){function e(){var a=new Kd;i.push(a),d.onNext(Eb(a,g))}var f=new Pb,g=new Rb(f),h=0,i=[];return e(),f.setDisposable(c.subscribe(function(c){for(var d=0,f=i.length;f>d;d++)i[d].onNext(c);var g=h-a+1;g>=0&&g%b===0&&i.shift().onCompleted(),++h%b===0&&e()},function(a){for(;i.length>0;)i.shift().onError(a);d.onError(a)},function(){for(;i.length>0;)i.shift().onCompleted();d.onCompleted()})),g},c)},kc.selectConcat=kc.concatMap=function(a,b,c){return La(a)&&La(b)?this.concatMap(function(c,d){var e=a(c,d);return Ja(e)&&(e=Ac(e)),(_a(e)||$a(e))&&(e=Ic(e)),e.map(function(a,e){return b(c,a,d,e)})}):La(a)?N(this,a,c):N(this,function(){return a})},kc.concatMapObserver=kc.selectConcatObserver=function(a,b,c,d){var e=this,f=bb(a,d,2),g=bb(b,d,1),h=bb(c,d,0);return new Hd(function(a){var b=0;return e.subscribe(function(c){var d;try{d=f(c,b++)}catch(e){return void a.onError(e)}Ja(d)&&(d=Ac(d)),a.onNext(d)},function(b){var c;try{c=g(b)}catch(d){return void a.onError(d)}Ja(c)&&(c=Ac(c)),a.onNext(c),a.onCompleted()},function(){var b;try{b=h()}catch(c){return void a.onError(c)}Ja(b)&&(b=Ac(b)),a.onNext(b),a.onCompleted()})},this).concatAll()},kc.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new Hd(function(a){var d=!1;return c.subscribe(function(b){d=!0,a.onNext(b)},function(b){a.onError(b)},function(){!d&&a.onNext(b),a.onCompleted()})},c)},P.prototype.push=function(a){var b=-1===O(this.set,a,this.comparer);return b&&this.set.push(a),b},kc.distinct=function(a,b){var c=this;return b||(b=Ga),new Hd(function(d){var e=new P(b);return c.subscribe(function(b){var c=b;if(a)try{c=a(b)}catch(f){return void d.onError(f)}e.push(c)&&d.onNext(b)},function(a){d.onError(a)},function(){d.onCompleted()})},this)},kc.groupBy=function(a,b,c){return this.groupByUntil(a,b,Mc,c)},kc.groupByUntil=function(a,b,c,d){var e=this;return b||(b=Ea),d||(d=Ga),new Hd(function(f){function g(a){return function(b){b.onError(a)}}var h=new Ad(0,d),i=new Ib,j=new Rb(i);return i.add(e.subscribe(function(d){var e;try{e=a(d)}catch(k){return h.getValues().forEach(g(k)),void f.onError(k)}var l=!1,m=h.tryGetValue(e);if(m||(m=new Kd,h.set(e,m),l=!0),l){var n=new Jd(e,m,j),o=new Jd(e,m);try{duration=c(o)}catch(k){return h.getValues().forEach(g(k)),void f.onError(k)}f.onNext(n);var p=new Pb;i.add(p);var q=function(){h.remove(e)&&m.onCompleted(),i.remove(p)};p.setDisposable(duration.take(1).subscribe(Da,function(a){
+h.getValues().forEach(g(a)),f.onError(a)},q))}var r;try{r=b(d)}catch(k){return h.getValues().forEach(g(k)),void f.onError(k)}m.onNext(r)},function(a){h.getValues().forEach(g(a)),f.onError(a)},function(){h.getValues().forEach(function(a){a.onCompleted()}),f.onCompleted()})),j},e)};var hd=function(a){function b(b,c,d){this.source=b,this.selector=bb(c,d,3),a.call(this)}function c(a,b){return function(c,d,e){return a.call(this,b.selector(c,d,e),d,e)}}function d(a,b,c){this.o=a,this.selector=b,this.source=c,this.i=0,this.isStopped=!1}return Cb(b,a),b.prototype.internalMap=function(a,d){return new b(this.source,c(a,this),d)},b.prototype.subscribeCore=function(a){return this.source.subscribe(new d(a,this.selector,this))},d.prototype.onNext=function(a){if(!this.isStopped){var b=p(this.selector)(a,this.i++,this.source);return b===Fb?this.o.onError(b.e):void this.o.onNext(b)}},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},d.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(rc);kc.map=kc.select=function(a,b){var c="function"==typeof a?a:function(){return a};return this instanceof hd?this.internalMap(c,b):new hd(this,c,b)},kc.pluck=function(){var b=arguments,c=arguments.length;if(0===c)throw new Error("List of properties cannot be empty.");return this.map(function(d){for(var e=d,f=0;c>f;f++){var g=e[b[f]];if("undefined"==typeof g)return a;e=g}return e})},kc.selectMany=kc.flatMap=function(a,b,c){return La(a)&&La(b)?this.flatMap(function(c,d){var e=a(c,d);return Ja(e)&&(e=Ac(e)),(_a(e)||$a(e))&&(e=Ic(e)),e.map(function(a,e){return b(c,a,d,e)})},c):La(a)?Q(this,a,c):Q(this,function(){return a})},kc.flatMapObserver=kc.selectManyObserver=function(a,b,c,d){var e=this;return new Hd(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}Ja(c)&&(c=Ac(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}Ja(c)&&(c=Ac(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}Ja(a)&&(a=Ac(a)),f.onNext(a),f.onCompleted()})},e).mergeAll()},kc.selectSwitch=kc.flatMapLatest=kc.switchMap=function(a,b){return this.select(a,b).switchLatest()};var id=function(a){function b(b,c){this.source=b,this.skipCount=c,a.call(this)}function c(a,b){this.c=b,this.r=b,this.o=a,this.isStopped=!1}return Cb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this.skipCount))},c.prototype.onNext=function(a){this.isStopped||(this.r<=0?this.o.onNext(a):this.r--)},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(rc);kc.skip=function(a){if(0>a)throw new Ta;return new id(this,a)},kc.skipWhile=function(a,b){var c=this,d=bb(a,b,3);return new Hd(function(a){var b=0,e=!1;return c.subscribe(function(f){if(!e)try{e=!d(f,b++,c)}catch(g){return void a.onError(g)}e&&a.onNext(f)},function(b){a.onError(b)},function(){a.onCompleted()})},c)},kc.take=function(a,b){if(0>a)throw new Ta;if(0===a)return Ec(b);var c=this;return new Hd(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0>=d&&b.onCompleted())},function(a){b.onError(a)},function(){b.onCompleted()})},c)},kc.takeWhile=function(a,b){var c=this,d=bb(a,b,3);return new Hd(function(a){var b=0,e=!0;return c.subscribe(function(f){if(e){try{e=d(f,b++,c)}catch(g){return void a.onError(g)}e?a.onNext(f):a.onCompleted()}},function(b){a.onError(b)},function(){a.onCompleted()})},c)};var jd=function(a){function b(b,c,d){this.source=b,this.predicate=bb(c,d,3),a.call(this)}function c(a,b){return function(c,d,e){return b.predicate(c,d,e)&&a.call(this,c,d,e)}}function d(a,b,c){this.o=a,this.predicate=b,this.source=c,this.i=0,this.isStopped=!1}return Cb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new d(a,this.predicate,this))},b.prototype.internalFilter=function(a,d){return new b(this.source,c(a,this),d)},d.prototype.onNext=function(a){if(!this.isStopped){var b=p(this.predicate)(a,this.i++,this.source);return b===Fb?this.o.onError(b.e):void(b&&this.o.onNext(a))}},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},d.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(rc);kc.filter=kc.where=function(a,b){return this instanceof jd?this.internalFilter(a,b):new jd(this,a,b)},kc.aggregate=function(){var a,b,c=!1,d=this;return 2===arguments.length?(c=!0,b=arguments[0],a=arguments[1]):a=arguments[0],new Hd(function(e){var f,g,h;return d.subscribe(function(d){!h&&(h=!0);try{f?g=a(g,d):(g=c?a(b,d):d,f=!0)}catch(i){return e.onError(i)}},function(a){e.onError(a)},function(){h&&e.onNext(g),!h&&c&&e.onNext(b),!h&&!c&&e.onError(new Ra),e.onCompleted()})},d)};var kd=function(a){function b(b,c,d,e){this.source=b,this.acc=c,this.hasSeed=d,this.seed=e,a.call(this)}function c(a,b){this.o=a,this.acc=b.acc,this.hasSeed=b.hasSeed,this.seed=b.seed,this.hasAccumulation=!1,this.result=null,this.hasValue=!1,this.isStopped=!1}return Cb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this))},c.prototype.onNext=function(a){this.isStopped||(!this.hasValue&&(this.hasValue=!0),this.hasAccumulation?this.result=p(this.acc)(this.result,a):(this.result=this.hasSeed?p(this.acc)(this.seed,a):a,this.hasAccumulation=!0),this.result===Fb&&this.o.onError(this.result.e))},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.hasValue&&this.o.onNext(this.result),!this.hasValue&&this.hasSeed&&this.o.onNext(this.seed),!this.hasValue&&!this.hasSeed&&this.o.onError(new Ra),this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(rc);kc.reduce=function(a){var b=!1;if(2===arguments.length){b=!0;var c=arguments[1]}return new kd(this,a,b,c)},kc.some=function(a,b){var c=this;return a?c.filter(a,b).some():new Hd(function(a){return c.subscribe(function(){a.onNext(!0),a.onCompleted()},function(b){a.onError(b)},function(){a.onNext(!1),a.onCompleted()})},c)},kc.any=function(){return this.some.apply(this,arguments)},kc.isEmpty=function(){return this.any().map(Ka)},kc.every=function(a,b){return this.filter(function(b){return!a(b)},b).some().map(Ka)},kc.all=function(){return this.every.apply(this,arguments)},kc.includes=function(a,b){function c(a,b){return 0===a&&0===b||a===b||isNaN(a)&&isNaN(b)}var d=this;return new Hd(function(e){var f=0,g=+b||0;return Math.abs(g)===1/0&&(g=0),0>g?(e.onNext(!1),e.onCompleted(),Mb):d.subscribe(function(b){f++>=g&&c(b,a)&&(e.onNext(!0),e.onCompleted())},function(a){e.onError(a)},function(){e.onNext(!1),e.onCompleted()})},this)},kc.contains=function(a,b){kc.includes(a,b)},kc.count=function(a,b){return a?this.filter(a,b).count():this.reduce(function(a){return a+1},0)},kc.indexOf=function(a,b){var c=this;return new Hd(function(d){var e=0,f=+b||0;return Math.abs(f)===1/0&&(f=0),0>f?(d.onNext(-1),d.onCompleted(),Mb):c.subscribe(function(b){e>=f&&b===a&&(d.onNext(e),d.onCompleted()),e++},function(a){d.onError(a)},function(){d.onNext(-1),d.onCompleted()})},c)},kc.sum=function(a,b){return a&&La(a)?this.map(a,b).sum():this.reduce(function(a,b){return a+b},0)},kc.minBy=function(a,b){return b||(b=Ha),R(this,a,function(a,c){return-1*b(a,c)})},kc.min=function(a){return this.minBy(Ea,a).map(function(a){return S(a)})},kc.maxBy=function(a,b){return b||(b=Ha),R(this,a,b)},kc.max=function(a){return this.maxBy(Ea,a).map(function(a){return S(a)})},kc.average=function(a,b){return a&&La(a)?this.map(a,b).average():this.reduce(function(a,b){return{sum:a.sum+b,count:a.count+1}},{sum:0,count:0}).map(function(a){if(0===a.count)throw new Ra;return a.sum/a.count})},kc.sequenceEqual=function(a,b){var c=this;return b||(b=Ga),new Hd(function(d){var e=!1,f=!1,g=[],h=[],i=c.subscribe(function(a){var c,e;if(h.length>0){e=h.shift();try{c=b(e,a)}catch(i){return void d.onError(i)}c||(d.onNext(!1),d.onCompleted())}else f?(d.onNext(!1),d.onCompleted()):g.push(a)},function(a){d.onError(a)},function(){e=!0,0===g.length&&(h.length>0?(d.onNext(!1),d.onCompleted()):f&&(d.onNext(!0),d.onCompleted()))});(_a(a)||$a(a))&&(a=Ic(a)),Ja(a)&&(a=Ac(a));var j=a.subscribe(function(a){var c;if(g.length>0){var f=g.shift();try{c=b(f,a)}catch(i){return void d.onError(i)}c||(d.onNext(!1),d.onCompleted())}else e?(d.onNext(!1),d.onCompleted()):h.push(a)},function(a){d.onError(a)},function(){f=!0,0===h.length&&(g.length>0?(d.onNext(!1),d.onCompleted()):e&&(d.onNext(!0),d.onCompleted()))});return new Ib(i,j)},c)},kc.elementAt=function(a){return T(this,a,!1)},kc.elementAtOrDefault=function(a,b){return T(this,a,!0,b)},kc.single=function(a,b){return a&&La(a)?this.where(a,b).single():U(this,!1)},kc.singleOrDefault=function(a,b,c){return a&&La(a)?this.filter(a,c).singleOrDefault(null,b):U(this,!0,b)},kc.first=function(a,b){return a?this.where(a,b).first():V(this,!1)},kc.firstOrDefault=function(a,b,c){return a?this.where(a).firstOrDefault(null,b):V(this,!0,b)},kc.last=function(a,b){return a?this.where(a,b).last():W(this,!1)},kc.lastOrDefault=function(a,b,c){return a?this.where(a,c).lastOrDefault(null,b):W(this,!0,b)},kc.find=function(a,b){return X(this,a,b,!1)},kc.findIndex=function(a,b){return X(this,a,b,!0)},kc.toSet=function(){if("undefined"==typeof xa.Set)throw new TypeError;var a=this;return new Hd(function(b){var c=new xa.Set;return a.subscribe(function(a){c.add(a)},function(a){b.onError(a)},function(){b.onNext(c),b.onCompleted()})},a)},kc.toMap=function(a,b){if("undefined"==typeof xa.Map)throw new TypeError;var c=this;return new Hd(function(d){var e=new xa.Map;return c.subscribe(function(c){var f;try{f=a(c)}catch(g){return void d.onError(g)}var h=c;if(b)try{h=b(c)}catch(g){return void d.onError(g)}e.set(f,h)},function(a){d.onError(a)},function(){d.onNext(e),d.onCompleted()})},c)};var ld="function",md="throw",xb=Ca.internals.isObject,nd=Ca.spawn=function(a){var b=ba(a);return function(c){function d(a,b){cc.schedule(c.bind(f,a,b))}function e(a,b){var c;if(arguments.length>2)for(var b=[],h=1,i=arguments.length;i>h;h++)b.push(arguments[h]);if(a)try{c=g[md](a)}catch(j){return d(j)}if(!a)try{c=g.next(b)}catch(j){return d(j)}if(c.done)return d(null,c.value);if(c.value=Y(c.value,f),typeof c.value!==ld)e(new TypeError("Rx.spawn only supports a function, Promise, Observable, Object or Array."));else{var k=!1;try{c.value.call(f,function(){k||(k=!0,e.apply(f,arguments))})}catch(j){cc.schedule(function(){k||(k=!0,e.call(f,j))})}}}var f=this,g=a;if(b){for(var h=[],i=0,j=arguments.length;j>i;i++)h.push(arguments[i]);var j=h.length,k=j&&typeof h[j-1]===ld;c=k?h.pop():da,g=a.apply(this,h)}else c=c||da;e()}};qc.start=function(a,b,c){return od(a,b,c)()};var od=qc.toAsync=function(a,b,c){return Vb(c)||(c=cc),function(){var d=arguments,e=new Ld;return c.schedule(function(){var c;try{c=a.apply(b,d)}catch(f){return void e.onError(f)}e.onNext(c),e.onCompleted()}),e.asObservable()}};qc.fromCallback=function(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return new Hd(function(d){function f(){for(var a=arguments.length,e=new Array(a),f=0;a>f;f++)e[f]=arguments[f];if(c){try{e=c.apply(b,e)}catch(g){return d.onError(g)}d.onNext(e)}else e.length<=1?d.onNext.apply(d,e):d.onNext(e);d.onCompleted()}e.push(f),a.apply(b,e)}).publishLast().refCount()}},qc.fromNodeCallback=function(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return new Hd(function(d){function f(a){if(a)return void d.onError(a);for(var e=arguments.length,f=[],g=1;e>g;g++)f[g-1]=arguments[g];if(c){try{f=c.apply(b,f)}catch(h){return d.onError(h)}d.onNext(f)}else f.length<=1?d.onNext.apply(d,f):d.onNext(f);d.onCompleted()}e.push(f),a.apply(b,e)}).publishLast().refCount()}},Ca.config.useNativeEvents=!1,qc.fromEvent=function(a,b,c){return a.addListener?pd(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},c):Ca.config.useNativeEvents||"function"!=typeof a.on||"function"!=typeof a.off?new Hd(function(d){return fa(a,b,function(a){var b=a;if(c)try{b=c(arguments)}catch(e){return d.onError(e)}d.onNext(b)})}).publish().refCount():pd(function(c){a.on(b,c)},function(c){a.off(b,c)},c)};var pd=qc.fromEventPattern=function(a,b,c){return new Hd(function(d){function e(a){var b=a;if(c)try{b=c(arguments)}catch(e){return d.onError(e)}d.onNext(b)}var f=a(e);return Lb(function(){b&&b(e,f)})}).publish().refCount()};qc.startAsync=function(a){var b;try{b=a()}catch(c){return Tc(c)}return Ac(b)};var qd=function(a){function b(a){var b=this.source.publish(),c=b.subscribe(a),d=Mb,e=this.pauser.distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=Mb)});return new Ib(c,d,e)}function c(c,d){this.source=c,this.controller=new Kd,d&&d.subscribe?this.pauser=this.controller.merge(d):this.pauser=this.controller,a.call(this,b,c)}return Cb(c,a),c.prototype.pause=function(){this.controller.onNext(!1)},c.prototype.resume=function(){this.controller.onNext(!0)},c}(qc);kc.pausable=function(a){return new qd(this,a)};var rd=function(b){function c(b){function c(){for(;e.length>0;)b.onNext(e.shift())}var d,e=[],f=ga(this.source,this.pauser.distinctUntilChanged().startWith(!1),function(a,b){return{data:a,shouldFire:b}}).subscribe(function(f){d!==a&&f.shouldFire!=d?(d=f.shouldFire,f.shouldFire&&c()):(d=f.shouldFire,f.shouldFire?b.onNext(f.data):e.push(f.data))},function(a){c(),b.onError(a)},function(){c(),b.onCompleted()});return f}function d(a,d){this.source=a,this.controller=new Kd,d&&d.subscribe?this.pauser=this.controller.merge(d):this.pauser=this.controller,b.call(this,c,a)}return Cb(d,b),d.prototype.pause=function(){this.controller.onNext(!1)},d.prototype.resume=function(){this.controller.onNext(!0)},d}(qc);kc.pausableBuffered=function(a){return new rd(this,a)};var sd=function(a){function b(a){return this.source.subscribe(a)}function c(c,d,e){a.call(this,b,c),this.subject=new td(d,e),this.source=c.multicast(this.subject).refCount()}return Cb(c,a),c.prototype.request=function(a){return this.subject.request(null==a?-1:a)},c}(qc),td=function(a){function b(a){return this.subject.subscribe(a)}function c(c,d){null==c&&(c=!0),a.call(this,b),this.subject=new Kd,this.enableQueue=c,this.queue=c?[]:null,this.requestedCount=0,this.requestedDisposable=Mb,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.scheduler=d||$b}return Cb(c,a),Db(c.prototype,ic,{onCompleted:function(){this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length?this.queue.push(ec.createOnCompleted()):this.subject.onCompleted()},onError:function(a){this.hasFailed=!0,this.error=a,this.enableQueue&&0!==this.queue.length?this.queue.push(ec.createOnError(a)):this.subject.onError(a)},onNext:function(a){var b=!1;0===this.requestedCount?this.enableQueue&&this.queue.push(ec.createOnNext(a)):(-1!==this.requestedCount&&0===this.requestedCount--&&this.disposeCurrentRequest(),b=!0),b&&this.subject.onNext(a)},_processRequest:function(a){if(this.enableQueue){for(;this.queue.length>=a&&a>0||this.queue.length>0&&"N"!==this.queue[0].kind;){var b=this.queue.shift();b.accept(this.subject),"N"===b.kind?a--:(this.disposeCurrentRequest(),this.queue=[])}return{numberOfItems:a,returnValue:0!==this.queue.length}}return{numberOfItems:a,returnValue:!1}},request:function(a){this.disposeCurrentRequest();var b=this;return this.requestedDisposable=this.scheduler.scheduleWithState(a,function(a,c){var d=b._processRequest(c),e=d.numberOfItems;d.returnValue||(b.requestedCount=e,b.requestedDisposable=Lb(function(){b.requestedCount=0}))}),this.requestedDisposable},disposeCurrentRequest:function(){this.requestedDisposable.dispose(),this.requestedDisposable=Mb}}),c}(qc);kc.controlled=function(a,b){return a&&Vb(a)&&(b=a,a=!0),null==a&&(a=!0),new sd(this,a,b)};var ud=function(a){function b(a){this.subscription=this.source.subscribe(new d(a,this,this.subscription));var b=this;return cc.schedule(function(){b.source.request(1)}),this.subscription}function c(c){a.call(this,b,c),this.source=c}Cb(c,a);var d=function(a){function b(b,c,d){a.call(this),this.observer=b,this.observable=c,this.cancel=d}Cb(b,a);var c=b.prototype;return c.completed=function(){this.observer.onCompleted(),this.dispose()},c.error=function(a){this.observer.onError(a),this.dispose()},c.next=function(a){this.observer.onNext(a);var b=this;cc.schedule(function(){b.observable.source.request(1)})},c.dispose=function(){this.observer=null,this.cancel&&(this.cancel.dispose(),this.cancel=null),a.prototype.dispose.call(this)},b}(lc);return c}(qc);sd.prototype.stopAndWait=function(){return new ud(this)};var vd=function(a){function b(a){this.subscription=this.source.subscribe(new d(a,this,this.subscription));var b=this;return cc.schedule(function(){b.source.request(b.windowSize)}),this.subscription}function c(c,d){a.call(this,b,c),this.source=c,this.windowSize=d}Cb(c,a);var d=function(a){function b(a,b,c){this.observer=a,this.observable=b,this.cancel=c,this.received=0}Cb(b,a);var c=b.prototype;return c.completed=function(){this.observer.onCompleted(),this.dispose()},c.error=function(a){this.observer.onError(a),this.dispose()},c.next=function(a){if(this.observer.onNext(a),this.received=++this.received%this.observable.windowSize,0===this.received){var b=this;cc.schedule(function(){b.observable.source.request(b.observable.windowSize)})}},c.dispose=function(){this.observer=null,this.cancel&&(this.cancel.dispose(),this.cancel=null),a.prototype.dispose.call(this)},b}(lc);return c}(qc);sd.prototype.windowed=function(a){return new vd(this,a)},kc.pipe=function(a){function b(){c.resume()}var c=this.pausableBuffered();return a.addListener("drain",b),c.subscribe(function(b){!a.write(String(b))&&c.pause()},function(b){a.emit("error",b)},function(){!a._isStdio&&a.end(),a.removeListener("drain",b)}),c.resume(),a},kc.multicast=function(a,b){var c=this;return"function"==typeof a?new Hd(function(d){var e=c.multicast(a());return new Ib(b(e).subscribe(d),e.connect())},c):new zd(c,a)},kc.publish=function(a){return a&&La(a)?this.multicast(function(){return new Kd},a):this.multicast(new Kd)},kc.share=function(){return this.publish().refCount()},kc.publishLast=function(a){return a&&La(a)?this.multicast(function(){return new Ld},a):this.multicast(new Ld)},kc.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new xd(b)},a):this.multicast(new xd(a))},kc.shareValue=function(a){return this.publishValue(a).refCount()},kc.replay=function(a,b,c,d){return a&&La(a)?this.multicast(function(){return new yd(b,c,d)},a):this.multicast(new yd(b,c,d))},kc.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};var wd=function(a,b){this.subject=a,this.observer=b};wd.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var xd=Ca.BehaviorSubject=function(a){function c(a){return Ob(this),this.isStopped?(this.hasError?a.onError(this.error):a.onCompleted(),Mb):(this.observers.push(a),a.onNext(this.value),new wd(this,a))}function d(b){a.call(this,c),this.value=b,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.hasError=!1}return Cb(d,a),Db(d.prototype,ic,{getValue:function(){if(Ob(this),this.hasError)throw this.error;return this.value},hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(Ob(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=b(this.observers),d=c.length;d>a;a++)c[a].onCompleted();this.observers.length=0}},onError:function(a){if(Ob(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){if(Ob(this),!this.isStopped){this.value=a;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.exception=null}}),d}(qc),yd=Ca.ReplaySubject=function(a){function c(a,b){return Lb(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function d(a){var b=new oc(this.scheduler,a),d=c(this,b);Ob(this),this._trim(this.scheduler.now()),this.observers.push(b);for(var e=0,f=this.q.length;f>e;e++)b.onNext(this.q[e].value);return this.hasError?b.onError(this.error):this.isStopped&&b.onCompleted(),b.ensureActive(),d}function e(b,c,e){this.bufferSize=null==b?f:b,this.windowSize=null==c?f:c,this.scheduler=e||$b,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this,d)}var f=Math.pow(2,53)-1;return Cb(e,a),Db(e.prototype,ic.prototype,{hasObservers:function(){return this.observers.length>0},_trim:function(a){for(;this.q.length>this.bufferSize;)this.q.shift();for(;this.q.length>0&&a-this.q[0].interval>this.windowSize;)this.q.shift()},onNext:function(a){if(Ob(this),!this.isStopped){var c=this.scheduler.now();this.q.push({interval:c,value:a}),this._trim(c);for(var d=0,e=b(this.observers),f=e.length;f>d;d++){var g=e[d];g.onNext(a),g.ensureActive()}}},onError:function(a){if(Ob(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var c=this.scheduler.now();this._trim(c);for(var d=0,e=b(this.observers),f=e.length;f>d;d++){var g=e[d];g.onError(a),g.ensureActive()}this.observers.length=0}},onCompleted:function(){if(Ob(this),!this.isStopped){this.isStopped=!0;var a=this.scheduler.now();this._trim(a);for(var c=0,d=b(this.observers),e=d.length;e>c;c++){var f=d[c];f.onCompleted(),f.ensureActive()}this.observers.length=0}},dispose:function(){this.isDisposed=!0,this.observers=null}}),e}(qc),zd=Ca.ConnectableObservable=function(a){function b(b,c){var d,e=!1,f=b.asObservable();this.connect=function(){return e||(e=!0,d=new Ib(f.subscribe(c),Lb(function(){e=!1}))),d},a.call(this,function(a){return c.subscribe(a)})}return Cb(b,a),b.prototype.refCount=function(){var a,b=0,c=this;return new Hd(function(d){var e=1===++b,f=c.subscribe(d);return e&&(a=c.connect()),function(){f.dispose(),0===--b&&a.dispose()}})},b}(qc);kc.singleInstance=function(){function a(){return d||(d=!0,b=c["finally"](function(){d=!1}).publish().refCount()),b}var b,c=this,d=!1;return new Hd(function(b){return a().subscribe(b)})};var Ad=function(){function b(a){if(0===(1&a))return 2===a;for(var b=Math.sqrt(a),c=3;b>=c;){if(a%c===0)return!1;c+=2}return!0}function c(a){var c,d,e;for(c=0;c<h.length;++c)if(d=h[c],d>=a)return d;for(e=1|a;e<h[h.length-1];){if(b(e))return e;e+=2}return a}function d(a){var b=757602046;if(!a.length)return b;for(var c=0,d=a.length;d>c;c++){var e=a.charCodeAt(c);b=(b<<5)-b+e,b&=b}return b}function e(a){var b=668265261;return a=61^a^a>>>16,a+=a<<3,a^=a>>>4,a*=b,a^=a>>>15}function f(){return{key:null,value:null,next:0,hashCode:0}}function g(a,b){if(0>a)throw new Ta;a>0&&this._initialize(a),this.comparer=b||Ga,this.freeCount=0,this.size=0,this.freeList=-1}var h=[1,3,7,13,31,61,127,251,509,1021,2039,4093,8191,16381,32749,65521,131071,262139,524287,1048573,2097143,4194301,8388593,16777213,33554393,67108859,134217689,268435399,536870909,1073741789,2147483647],i="no such key",j="duplicate key",k=function(){var a=0;return function(b){if(null==b)throw new Error(i);if("string"==typeof b)return d(b);if("number"==typeof b)return e(b);if("boolean"==typeof b)return b===!0?1:0;if(b instanceof Date)return e(b.valueOf());if(b instanceof RegExp)return d(b.toString());if("function"==typeof b.valueOf){var c=b.valueOf();if("number"==typeof c)return e(c);if("string"==typeof c)return d(c)}if(b.hashCode)return b.hashCode();var f=17*a++;return b.hashCode=function(){return f},f}}(),l=g.prototype;return l._initialize=function(a){var b,d=c(a);for(this.buckets=new Array(d),this.entries=new Array(d),b=0;d>b;b++)this.buckets[b]=-1,this.entries[b]=f();this.freeList=-1},l.add=function(a,b){this._insert(a,b,!0)},l._insert=function(a,b,c){this.buckets||this._initialize(0);for(var d,e=2147483647&k(a),f=e%this.buckets.length,g=this.buckets[f];g>=0;g=this.entries[g].next)if(this.entries[g].hashCode===e&&this.comparer(this.entries[g].key,a)){if(c)throw new Error(j);return void(this.entries[g].value=b)}this.freeCount>0?(d=this.freeList,this.freeList=this.entries[d].next,--this.freeCount):(this.size===this.entries.length&&(this._resize(),f=e%this.buckets.length),d=this.size,++this.size),this.entries[d].hashCode=e,this.entries[d].next=this.buckets[f],this.entries[d].key=a,this.entries[d].value=b,this.buckets[f]=d},l._resize=function(){var a=c(2*this.size),b=new Array(a);for(e=0;e<b.length;++e)b[e]=-1;var d=new Array(a);for(e=0;e<this.size;++e)d[e]=this.entries[e];for(var e=this.size;a>e;++e)d[e]=f();for(var g=0;g<this.size;++g){var h=d[g].hashCode%a;d[g].next=b[h],b[h]=g}this.buckets=b,this.entries=d},l.remove=function(a){if(this.buckets)for(var b=2147483647&k(a),c=b%this.buckets.length,d=-1,e=this.buckets[c];e>=0;e=this.entries[e].next){if(this.entries[e].hashCode===b&&this.comparer(this.entries[e].key,a))return 0>d?this.buckets[c]=this.entries[e].next:this.entries[d].next=this.entries[e].next,this.entries[e].hashCode=-1,this.entries[e].next=this.freeList,this.entries[e].key=null,this.entries[e].value=null,this.freeList=e,++this.freeCount,!0;d=e}return!1},l.clear=function(){var a,b;if(!(this.size<=0)){for(a=0,b=this.buckets.length;b>a;++a)this.buckets[a]=-1;for(a=0;a<this.size;++a)this.entries[a]=f();this.freeList=-1,this.size=0}},l._findEntry=function(a){if(this.buckets)for(var b=2147483647&k(a),c=this.buckets[b%this.buckets.length];c>=0;c=this.entries[c].next)if(this.entries[c].hashCode===b&&this.comparer(this.entries[c].key,a))return c;return-1},l.count=function(){return this.size-this.freeCount},l.tryGetValue=function(b){var c=this._findEntry(b);return c>=0?this.entries[c].value:a},l.getValues=function(){var a=0,b=[];if(this.entries)for(var c=0;c<this.size;c++)this.entries[c].hashCode>=0&&(b[a++]=this.entries[c].value);return b},l.get=function(a){var b=this._findEntry(a);if(b>=0)return this.entries[b].value;throw new Error(i)},l.set=function(a,b){this._insert(a,b,!1)},l.containskey=function(a){return this._findEntry(a)>=0},g}();kc.join=function(a,b,c,d){var e=this;return new Hd(function(f){var g=new Ib,h=!1,i=!1,j=0,k=0,l=new Ad,m=new Ad;return g.add(e.subscribe(function(a){var c=j++,e=new Pb;l.add(c,a),g.add(e);var i,k=function(){l.remove(c)&&0===l.count()&&h&&f.onCompleted(),g.remove(e)};try{i=b(a)}catch(n){return void f.onError(n)}e.setDisposable(i.take(1).subscribe(Da,f.onError.bind(f),k)),m.getValues().forEach(function(b){var c;try{c=d(a,b)}catch(e){return void f.onError(e)}f.onNext(c)})},f.onError.bind(f),function(){h=!0,(i||0===l.count())&&f.onCompleted()})),g.add(a.subscribe(function(a){var b=k++,e=new Pb;m.add(b,a),g.add(e);var h,j=function(){m.remove(b)&&0===m.count()&&i&&f.onCompleted(),g.remove(e)};try{h=c(a)}catch(n){return void f.onError(n)}e.setDisposable(h.take(1).subscribe(Da,f.onError.bind(f),j)),l.getValues().forEach(function(b){var c;try{c=d(b,a)}catch(e){return void f.onError(e)}f.onNext(c)})},f.onError.bind(f),function(){i=!0,(h||0===m.count())&&f.onCompleted()})),g},e)},kc.groupJoin=function(a,b,c,d){var e=this;return new Hd(function(f){function g(a){return function(b){b.onError(a)}}var h=new Ib,i=new Rb(h),j=new Ad,k=new Ad,l=0,m=0;return h.add(e.subscribe(function(a){var c=new Kd,e=l++;j.add(e,c);var m;try{m=d(a,Eb(c,i))}catch(n){return j.getValues().forEach(g(n)),void f.onError(n)}f.onNext(m),k.getValues().forEach(function(a){c.onNext(a)});var o=new Pb;h.add(o);var p,q=function(){j.remove(e)&&c.onCompleted(),h.remove(o)};try{p=b(a)}catch(n){return j.getValues().forEach(g(n)),void f.onError(n)}o.setDisposable(p.take(1).subscribe(Da,function(a){j.getValues().forEach(g(a)),f.onError(a)},q))},function(a){j.getValues().forEach(g(a)),f.onError(a)},f.onCompleted.bind(f))),h.add(a.subscribe(function(a){var b=m++;k.add(b,a);var d=new Pb;h.add(d);var e,i=function(){k.remove(b),h.remove(d)};try{e=c(a)}catch(l){return j.getValues().forEach(g(l)),void f.onError(l)}d.setDisposable(e.take(1).subscribe(Da,function(a){j.getValues().forEach(g(a)),f.onError(a)},i)),j.getValues().forEach(function(b){b.onNext(a)})},function(a){j.getValues().forEach(g(a)),f.onError(a)})),i},e)},kc.buffer=function(a,b){return this.window.apply(this,arguments).selectMany(function(a){return a.toArray()})},kc.window=function(a,b){return 1===arguments.length&&"function"!=typeof arguments[0]?ia.call(this,a):"function"==typeof a?ja.call(this,a):ha.call(this,a,b)},kc.pairwise=function(){var a=this;return new Hd(function(b){var c,d=!1;return a.subscribe(function(a){d?b.onNext([c,a]):d=!0,c=a},b.onError.bind(b),b.onCompleted.bind(b))},a)},kc.partition=function(a,b){return[this.filter(a,b),this.filter(function(c,d,e){return!a.call(b,c,d,e)})]};var Bd=function(a){function b(a,b){this.c=a,this.s=b}return Cb(b,a),b.prototype[Ya]=function(){var a=this;return{next:function(){return a.c()?{done:!1,value:a.s}:{done:!0,value:void 0}}}},b}(sc);kc.letBind=kc.let=function(a){return a(this)},qc["if"]=qc.ifThen=function(a,b,c){return Cc(function(){return c||(c=Ec()),Ja(b)&&(b=Ac(b)),Ja(c)&&(c=Ac(c)),"function"==typeof c.now&&(c=Ec(c)),a()?b:c})},qc["for"]=qc.forIn=function(a,b,c){return yc(a,b,c).concat()};var Cd=qc["while"]=qc.whileDo=function(a,b){return Ja(b)&&(b=Ac(b)),ka(a,b).concat()};kc.doWhile=function(a){return Xc([this,Cd(a,this)])},qc["case"]=qc.switchCase=function(a,b,c){return Cc(function(){Ja(c)&&(c=Ac(c)),c||(c=Ec()),"function"==typeof c.now&&(c=Ec(c));var d=b[a()];return Ja(d)&&(d=Ac(d)),d||c})},kc.expand=function(a,b){Vb(b)||(b=Zb);var c=this;return new Hd(function(d){var e=[],f=new Qb,g=new Ib(f),h=0,i=!1,j=function(){var c=!1;e.length>0&&(c=!i,i=!0),c&&f.setDisposable(b.scheduleRecursive(function(b){var c;if(!(e.length>0))return void(i=!1);c=e.shift();var f=new Pb;g.add(f),f.setDisposable(c.subscribe(function(b){d.onNext(b);var c=null;try{c=a(b)}catch(f){d.onError(f)}e.push(c),h++,j()},d.onError.bind(d),function(){g.remove(f),h--,0===h&&d.onCompleted()})),b()}))};return e.push(c),h++,j(),g},this)},qc.forkJoin=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return new Hd(function(b){var c=a.length;if(0===c)return b.onCompleted(),Mb;for(var d=new Ib,e=!1,f=new Array(c),g=new Array(c),h=new Array(c),i=0;c>i;i++)!function(i){var j=a[i];Ja(j)&&(j=Ac(j)),d.add(j.subscribe(function(a){e||(f[i]=!0,h[i]=a)},function(a){e=!0,b.onError(a),d.dispose()},function(){if(!e){if(!f[i])return void b.onCompleted();g[i]=!0;for(var a=0;c>a;a++)if(!g[a])return;e=!0,b.onNext(h),b.onCompleted()}}))}(i);return d})},kc.forkJoin=function(a,b){var c=this;return new Hd(function(d){var e,f,g=!1,h=!1,i=!1,j=!1,k=new Pb,l=new Pb;return Ja(a)&&(a=Ac(a)),k.setDisposable(c.subscribe(function(a){i=!0,e=a},function(a){l.dispose(),d.onError(a)},function(){if(g=!0,h)if(i)if(j){var a;try{a=b(e,f)}catch(c){return void d.onError(c)}d.onNext(a),d.onCompleted()}else d.onCompleted();else d.onCompleted()})),l.setDisposable(a.subscribe(function(a){j=!0,f=a},function(a){k.dispose(),d.onError(a)},function(){if(h=!0,g)if(i)if(j){var a;try{a=b(e,f)}catch(c){return void d.onError(c)}d.onNext(a),d.onCompleted()}else d.onCompleted();else d.onCompleted()})),new Ib(k,l)},c)},kc.manySelect=kc.extend=function(a,b){
+Vb(b)||(b=Zb);var c=this;return Cc(function(){var d;return c.map(function(a){var b=new Dd(a);return d&&d.onNext(a),d=b,b}).tap(Da,function(a){d&&d.onError(a)},function(){d&&d.onCompleted()}).observeOn(b).map(a)},c)};var Dd=function(a){function b(a){var b=this,c=new Ib;return c.add($b.schedule(function(){a.onNext(b.head),c.add(b.tail.mergeAll().subscribe(a))})),c}function c(c){a.call(this,b),this.head=c,this.tail=new Ld}return Cb(c,a),Db(c.prototype,ic,{onCompleted:function(){this.onNext(qc.empty())},onError:function(a){this.onNext(qc.throwError(a))},onNext:function(a){this.tail.onNext(a),this.tail.onCompleted()}}),c}(qc),Ed=xa.Map||function(){function b(){this._keys=[],this._values=[]}return b.prototype.get=function(b){var c=this._keys.indexOf(b);return-1!==c?this._values[c]:a},b.prototype.set=function(a,b){var c=this._keys.indexOf(a);-1!==c&&(this._values[c]=b),this._values[this._keys.push(a)-1]=b},b.prototype.forEach=function(a,b){for(var c=0,d=this._keys.length;d>c;c++)a.call(b,this._values[c],this._keys[c])},b}();la.prototype.and=function(a){return new la(this.patterns.concat(a))},la.prototype.thenDo=function(a){return new ma(this,a)},ma.prototype.activate=function(a,b,c){for(var d=this,e=[],f=0,g=this.expression.patterns.length;g>f;f++)e.push(na(a,this.expression.patterns[f],b.onError.bind(b)));var h=new oa(e,function(){var a;try{a=d.selector.apply(d,arguments)}catch(c){return void b.onError(c)}b.onNext(a)},function(){for(var a=0,b=e.length;b>a;a++)e[a].removeActivePlan(h);c(h)});for(f=0,g=e.length;g>f;f++)e[f].addActivePlan(h);return h},oa.prototype.dequeue=function(){this.joinObservers.forEach(function(a){a.queue.shift()})},oa.prototype.match=function(){var a,b,c=!0;for(a=0,b=this.joinObserverArray.length;b>a;a++)if(0===this.joinObserverArray[a].queue.length){c=!1;break}if(c){var d=[],e=!1;for(a=0,b=this.joinObserverArray.length;b>a;a++)d.push(this.joinObserverArray[a].queue[0]),"C"===this.joinObserverArray[a].queue[0].kind&&(e=!0);if(e)this.onCompleted();else{this.dequeue();var f=[];for(a=0,b=d.length;a<d.length;a++)f.push(d[a].value);this.onNext.apply(this,f)}}};var Fd=function(a){function b(b,c){a.call(this),this.source=b,this.onError=c,this.queue=[],this.activePlans=[],this.subscription=new Pb,this.isDisposed=!1}Cb(b,a);var c=b.prototype;return c.next=function(a){if(!this.isDisposed){if("E"===a.kind)return this.onError(a.exception);this.queue.push(a);for(var b=this.activePlans.slice(0),c=0,d=b.length;d>c;c++)b[c].match()}},c.error=Da,c.completed=Da,c.addActivePlan=function(a){this.activePlans.push(a)},c.subscribe=function(){this.subscription.setDisposable(this.source.materialize().subscribe(this))},c.removeActivePlan=function(a){this.activePlans.splice(this.activePlans.indexOf(a),1),0===this.activePlans.length&&this.dispose()},c.dispose=function(){a.prototype.dispose.call(this),this.isDisposed||(this.isDisposed=!0,this.subscription.dispose())},b}(lc);kc.and=function(a){return new la([this,a])},kc.thenDo=function(a){return new la([this]).thenDo(a)},qc.when=function(){var a,b=arguments.length;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new Hd(function(b){var c=[],d=new Ed,e=jc(function(a){b.onNext(a)},function(a){d.forEach(function(b){b.onError(a)}),b.onError(a)},function(a){b.onCompleted()});try{for(var f=0,g=a.length;g>f;f++)c.push(a[f].activate(d,e,function(a){var d=c.indexOf(a);c.splice(d,1),0===c.length&&b.onCompleted()}))}catch(h){Tc(h).subscribe(b)}var i=new Ib;return d.forEach(function(a){a.subscribe(),i.add(a)}),i})};{var Gd=qc.interval=function(a,b){return sa(a,a,Vb(b)?b:cc)};qc.timer=function(b,c,d){var e;return Vb(d)||(d=cc),c!==a&&"number"==typeof c?e=c:Vb(c)&&(d=c),b instanceof Date&&e===a?pa(b.getTime(),d):b instanceof Date&&e!==a?(e=c,qa(b.getTime(),e,d)):e===a?ra(b,d):sa(b,e,d)}}kc.delay=function(a,b){return Vb(b)||(b=cc),a instanceof Date?ua(this,a.getTime(),b):ta(this,a,b)},kc.debounce=kc.throttleWithTimeout=function(a,b){Vb(b)||(b=cc);var c=this;return new Hd(function(d){var e,f=new Qb,g=!1,h=0,i=c.subscribe(function(c){g=!0,e=c,h++;var i=h,j=new Pb;f.setDisposable(j),j.setDisposable(b.scheduleWithRelative(a,function(){g&&h===i&&d.onNext(e),g=!1}))},function(a){f.dispose(),d.onError(a),g=!1,h++},function(){f.dispose(),g&&d.onNext(e),d.onCompleted(),g=!1,h++});return new Ib(i,f)},this)},kc.throttle=function(a,b){return this.debounce(a,b)},kc.windowWithTime=function(a,b,c){var d,e=this;return null==b&&(d=a),Vb(c)||(c=cc),"number"==typeof b?d=b:Vb(b)&&(d=a,c=b),new Hd(function(b){function f(){var a=new Pb,e=!1,g=!1;l.setDisposable(a),j===i?(e=!0,g=!0):i>j?e=!0:g=!0;var n=e?j:i,o=n-m;m=n,e&&(j+=d),g&&(i+=d),a.setDisposable(c.scheduleWithRelative(o,function(){if(g){var a=new Kd;k.push(a),b.onNext(Eb(a,h))}e&&k.shift().onCompleted(),f()}))}var g,h,i=d,j=a,k=[],l=new Qb,m=0;return g=new Ib(l),h=new Rb(g),k.push(new Kd),b.onNext(Eb(k[0],h)),f(),g.add(e.subscribe(function(a){for(var b=0,c=k.length;c>b;b++)k[b].onNext(a)},function(a){for(var c=0,d=k.length;d>c;c++)k[c].onError(a);b.onError(a)},function(){for(var a=0,c=k.length;c>a;a++)k[a].onCompleted();b.onCompleted()})),h},e)},kc.windowWithTimeOrCount=function(a,b,c){var d=this;return Vb(c)||(c=cc),new Hd(function(e){function f(b){var d=new Pb;g.setDisposable(d),d.setDisposable(c.scheduleWithRelative(a,function(){if(b===k){j=0;var a=++k;l.onCompleted(),l=new Kd,e.onNext(Eb(l,i)),f(a)}}))}var g=new Qb,h=new Ib(g),i=new Rb(h),j=0,k=0,l=new Kd;return e.onNext(Eb(l,i)),f(0),h.add(d.subscribe(function(a){var c=0,d=!1;l.onNext(a),++j===b&&(d=!0,j=0,c=++k,l.onCompleted(),l=new Kd,e.onNext(Eb(l,i))),d&&f(c)},function(a){l.onError(a),e.onError(a)},function(){l.onCompleted(),e.onCompleted()})),i},d)},kc.bufferWithTime=function(a,b,c){return this.windowWithTime.apply(this,arguments).selectMany(function(a){return a.toArray()})},kc.bufferWithTimeOrCount=function(a,b,c){return this.windowWithTimeOrCount(a,b,c).selectMany(function(a){return a.toArray()})},kc.timeInterval=function(a){var b=this;return Vb(a)||(a=cc),Cc(function(){var c=a.now();return b.map(function(b){var d=a.now(),e=d-c;return c=d,{value:b,interval:e}})})},kc.timestamp=function(a){return Vb(a)||(a=cc),this.map(function(b){return{value:b,timestamp:a.now()}})},kc.sample=kc.throttleLatest=function(a,b){return Vb(b)||(b=cc),"number"==typeof a?va(this,Gd(a,b)):va(this,a)},kc.timeout=function(a,b,c){(null==b||"string"==typeof b)&&(b=Tc(new Error(b||"Timeout"))),Vb(c)||(c=cc);var d=this,e=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new Hd(function(f){function g(){var d=h;l.setDisposable(c[e](a,function(){h===d&&(Ja(b)&&(b=Ac(b)),j.setDisposable(b.subscribe(f)))}))}var h=0,i=new Pb,j=new Qb,k=!1,l=new Qb;return j.setDisposable(i),g(),i.setDisposable(d.subscribe(function(a){k||(h++,f.onNext(a),g())},function(a){k||(h++,f.onError(a))},function(){k||(h++,f.onCompleted())})),new Ib(j,l)},d)},qc.generateWithAbsoluteTime=function(a,b,c,d,e,f){return Vb(f)||(f=cc),new Hd(function(g){var h=!0,i=!1;return f.scheduleRecursiveWithAbsoluteAndState(a,f.now(),function(a,f){i&&g.onNext(a);try{if(h?h=!1:a=c(a),i=b(a))var j=d(a),k=e(a)}catch(l){return void g.onError(l)}i?f(j,k):g.onCompleted()})})},qc.generateWithRelativeTime=function(a,b,c,d,e,f){return Vb(f)||(f=cc),new Hd(function(g){var h=!0,i=!1;return f.scheduleRecursiveWithRelativeAndState(a,0,function(a,f){i&&g.onNext(a);try{if(h?h=!1:a=c(a),i=b(a))var j=d(a),k=e(a)}catch(l){return void g.onError(l)}i?f(j,k):g.onCompleted()})})},kc.delaySubscription=function(a,b){var c=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative",d=this;return Vb(b)||(b=cc),new Hd(function(e){var f=new Qb;return f.setDisposable(b[c](a,function(){f.setDisposable(d.subscribe(e))})),f},this)},kc.delayWithSelector=function(a,b){var c,d,e=this;return La(a)?d=a:(c=a,d=b),new Hd(function(a){function b(){i.setDisposable(e.subscribe(function(b){var c=p(d)(b);if(c===Fb)return a.onError(c.e);var e=new Pb;g.add(e),e.setDisposable(c.subscribe(function(){a.onNext(b),g.remove(e),f()},function(b){a.onError(b)},function(){a.onNext(b),g.remove(e),f()}))},function(b){a.onError(b)},function(){h=!0,i.dispose(),f()}))}function f(){h&&0===g.length&&a.onCompleted()}var g=new Ib,h=!1,i=new Qb;return c?i.setDisposable(c.subscribe(b,function(b){a.onError(b)},b)):b(),new Ib(i,g)},this)},kc.timeoutWithSelector=function(a,b,c){1===arguments.length&&(b=a,a=Mc()),c||(c=Tc(new Error("Timeout")));var d=this;return new Hd(function(e){function f(a){function b(){return k===d}var d=k,f=new Pb;i.setDisposable(f),f.setDisposable(a.subscribe(function(){b()&&h.setDisposable(c.subscribe(e)),f.dispose()},function(a){b()&&e.onError(a)},function(){b()&&h.setDisposable(c.subscribe(e))}))}function g(){var a=!l;return a&&k++,a}var h=new Qb,i=new Qb,j=new Pb;h.setDisposable(j);var k=0,l=!1;return f(a),j.setDisposable(d.subscribe(function(a){if(g()){e.onNext(a);var c;try{c=b(a)}catch(d){return void e.onError(d)}f(Ja(c)?Ac(c):c)}},function(a){g()&&e.onError(a)},function(){g()&&e.onCompleted()})),new Ib(h,i)},d)},kc.debounceWithSelector=function(a){var b=this;return new Hd(function(c){var d,e=!1,f=new Qb,g=0,h=b.subscribe(function(b){var h;try{h=a(b)}catch(i){return void c.onError(i)}Ja(h)&&(h=Ac(h)),e=!0,d=b,g++;var j=g,k=new Pb;f.setDisposable(k),k.setDisposable(h.subscribe(function(){e&&g===j&&c.onNext(d),e=!1,k.dispose()},c.onError.bind(c),function(){e&&g===j&&c.onNext(d),e=!1,k.dispose()}))},function(a){f.dispose(),c.onError(a),e=!1,g++},function(){f.dispose(),e&&c.onNext(d),c.onCompleted(),e=!1,g++});return new Ib(h,f)},b)},kc.throttleWithSelector=function(a){return this.debounceWithSelector(a)},kc.skipLastWithTime=function(a,b){Vb(b)||(b=cc);var c=this;return new Hd(function(d){var e=[];return c.subscribe(function(c){var f=b.now();for(e.push({interval:f,value:c});e.length>0&&f-e[0].interval>=a;)d.onNext(e.shift().value)},function(a){d.onError(a)},function(){for(var c=b.now();e.length>0&&c-e[0].interval>=a;)d.onNext(e.shift().value);d.onCompleted()})},c)},kc.takeLastWithTime=function(a,b){var c=this;return Vb(b)||(b=cc),new Hd(function(d){var e=[];return c.subscribe(function(c){var d=b.now();for(e.push({interval:d,value:c});e.length>0&&d-e[0].interval>=a;)e.shift()},function(a){d.onError(a)},function(){for(var c=b.now();e.length>0;){var f=e.shift();c-f.interval<=a&&d.onNext(f.value)}d.onCompleted()})},c)},kc.takeLastBufferWithTime=function(a,b){var c=this;return Vb(b)||(b=cc),new Hd(function(d){var e=[];return c.subscribe(function(c){var d=b.now();for(e.push({interval:d,value:c});e.length>0&&d-e[0].interval>=a;)e.shift()},function(a){d.onError(a)},function(){for(var c=b.now(),f=[];e.length>0;){var g=e.shift();c-g.interval<=a&&f.push(g.value)}d.onNext(f),d.onCompleted()})},c)},kc.takeWithTime=function(a,b){var c=this;return Vb(b)||(b=cc),new Hd(function(d){return new Ib(b.scheduleWithRelative(a,function(){d.onCompleted()}),c.subscribe(d))},c)},kc.skipWithTime=function(a,b){var c=this;return Vb(b)||(b=cc),new Hd(function(d){var e=!1;return new Ib(b.scheduleWithRelative(a,function(){e=!0}),c.subscribe(function(a){e&&d.onNext(a)},d.onError.bind(d),d.onCompleted.bind(d)))},c)},kc.skipUntilWithTime=function(a,b){Vb(b)||(b=cc);var c=this,d=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new Hd(function(e){var f=!1;return new Ib(b[d](a,function(){f=!0}),c.subscribe(function(a){f&&e.onNext(a)},function(a){e.onError(a)},function(){e.onCompleted()}))},c)},kc.takeUntilWithTime=function(a,b){Vb(b)||(b=cc);var c=this,d=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new Hd(function(e){return new Ib(b[d](a,function(){e.onCompleted()}),c.subscribe(e))},c)},kc.throttleFirst=function(a,b){Vb(b)||(b=cc);var c=+a||0;if(0>=c)throw new RangeError("windowDuration cannot be less or equal zero.");var d=this;return new Hd(function(a){var e=0;return d.subscribe(function(d){var f=b.now();(0===e||f-e>=c)&&(e=f,a.onNext(d))},function(b){a.onError(b)},function(){a.onCompleted()})},d)},kc.transduce=function(a){function b(a){return{"@@transducer/init":function(){return a},"@@transducer/step":function(a,b){return a.onNext(b)},"@@transducer/result":function(a){return a.onCompleted()}}}var c=this;return new Hd(function(d){var e=a(b(d));return c.subscribe(function(a){try{e["@@transducer/step"](d,a)}catch(b){d.onError(b)}},function(a){d.onError(a)},function(){e["@@transducer/result"](d)})},c)},kc.exclusive=function(){var a=this;return new Hd(function(b){var c=!1,d=!1,e=new Pb,f=new Ib;return f.add(e),e.setDisposable(a.subscribe(function(a){if(!c){c=!0,Ja(a)&&(a=Ac(a));var e=new Pb;f.add(e),e.setDisposable(a.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){f.remove(e),c=!1,d&&1===f.length&&b.onCompleted()}))}},b.onError.bind(b),function(){d=!0,c||1!==f.length||b.onCompleted()})),f},this)},kc.exclusiveMap=function(a,b){var c=this,d=bb(a,b,3);return new Hd(function(a){var b=0,e=!1,f=!0,g=new Pb,h=new Ib;return h.add(g),g.setDisposable(c.subscribe(function(c){e||(e=!0,innerSubscription=new Pb,h.add(innerSubscription),Ja(c)&&(c=Ac(c)),innerSubscription.setDisposable(c.subscribe(function(e){var f;try{f=d(e,b++,c)}catch(g){return void a.onError(g)}a.onNext(f)},function(b){a.onError(b)},function(){h.remove(innerSubscription),e=!1,f&&1===h.length&&a.onCompleted()})))},function(b){a.onError(b)},function(){f=!0,1!==h.length||e||a.onCompleted()})),h},this)},Ca.VirtualTimeScheduler=function(a){function b(){return this.toDateTimeOffset(this.clock)}function c(a,b){return this.scheduleAbsoluteWithState(a,this.clock,b)}function d(a,b,c){return this.scheduleRelativeWithState(a,this.toRelative(b),c)}function e(a,b,c){return this.scheduleRelativeWithState(a,this.toRelative(b-this.now()),c)}function f(a,b){return b(),Mb}function g(f,g){this.clock=f,this.comparer=g,this.isEnabled=!1,this.queue=new Gb(1024),a.call(this,b,c,d,e)}Cb(g,a);var h=g.prototype;return h.add=Wa,h.toDateTimeOffset=Wa,h.toRelative=Wa,h.schedulePeriodicWithState=function(a,b,c){var d=new Yb(this,a,b,c);return d.start()},h.scheduleRelativeWithState=function(a,b,c){var d=this.add(this.clock,b);return this.scheduleAbsoluteWithState(a,d,c)},h.scheduleRelative=function(a,b){return this.scheduleRelativeWithState(b,a,f)},h.start=function(){if(!this.isEnabled){this.isEnabled=!0;do{var a=this.getNext();null!==a?(this.comparer(a.dueTime,this.clock)>0&&(this.clock=a.dueTime),a.invoke()):this.isEnabled=!1}while(this.isEnabled)}},h.stop=function(){this.isEnabled=!1},h.advanceTo=function(a){var b=this.comparer(this.clock,a);if(this.comparer(this.clock,a)>0)throw new Ta;if(0!==b&&!this.isEnabled){this.isEnabled=!0;do{var c=this.getNext();null!==c&&this.comparer(c.dueTime,a)<=0?(this.comparer(c.dueTime,this.clock)>0&&(this.clock=c.dueTime),c.invoke()):this.isEnabled=!1}while(this.isEnabled);this.clock=a}},h.advanceBy=function(a){var b=this.add(this.clock,a),c=this.comparer(this.clock,b);if(c>0)throw new Ta;0!==c&&this.advanceTo(b)},h.sleep=function(a){var b=this.add(this.clock,a);if(this.comparer(this.clock,b)>=0)throw new Ta;this.clock=b},h.getNext=function(){for(;this.queue.length>0;){var a=this.queue.peek();if(!a.isCancelled())return a;this.queue.dequeue()}return null},h.scheduleAbsolute=function(a,b){return this.scheduleAbsoluteWithState(b,a,f)},h.scheduleAbsoluteWithState=function(a,b,c){function d(a,b){return e.queue.remove(f),c(a,b)}var e=this,f=new Sb(this,a,d,b,this.comparer);return this.queue.enqueue(f),f.disposable},g}(Tb),Ca.HistoricalScheduler=function(a){function b(b,c){var d=null==b?0:b,e=c||Ha;a.call(this,d,e)}Cb(b,a);var c=b.prototype;return c.add=function(a,b){return a+b},c.toDateTimeOffset=function(a){return new Date(a).getTime()},c.toRelative=function(a){return a},b}(Ca.VirtualTimeScheduler);var Hd=Ca.AnonymousObservable=function(a){function b(a){return a&&La(a.dispose)?a:La(a)?Lb(a):Mb}function c(a,c){var d=c[0],e=c[1],f=p(e)(d);return f!==Fb||d.fail(Fb.e)?void d.setDisposable(b(f)):q(Fb.e)}function d(b,d){function e(a){var d=new Id(a),e=[d,b];return $b.scheduleRequired()?$b.scheduleWithState(e,c):c(null,e),d}this.source=d,a.call(this,e)}return Cb(d,a),d}(qc),Id=function(a){function b(b){a.call(this),this.observer=b,this.m=new Pb}Cb(b,a);var c=b.prototype;return c.next=function(a){var b=p(this.observer.onNext).call(this.observer,a);b===Fb&&(this.dispose(),q(b.e))},c.error=function(a){var b=p(this.observer.onError).call(this.observer,a);this.dispose(),b===Fb&&q(b.e)},c.completed=function(){var a=p(this.observer.onCompleted).call(this.observer);this.dispose(),a===Fb&&q(a.e)},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(lc),Jd=function(a){function b(a){return this.underlyingObservable.subscribe(a)}function c(c,d,e){a.call(this,b),this.key=c,this.underlyingObservable=e?new Hd(function(a){return new Ib(e.getDisposable(),d.subscribe(a))}):d}return Cb(c,a),c}(qc),Kd=Ca.Subject=function(a){function c(a){return Ob(this),this.isStopped?this.hasError?(a.onError(this.error),Mb):(a.onCompleted(),Mb):(this.observers.push(a),new wd(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return Cb(d,a),Db(d.prototype,ic.prototype,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(Ob(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=b(this.observers),d=c.length;d>a;a++)c[a].onCompleted();this.observers.length=0}},onError:function(a){if(Ob(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){if(Ob(this),!this.isStopped)for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new Md(a,b)},d}(qc),Ld=Ca.AsyncSubject=function(a){function c(a){return Ob(this),this.isStopped?(this.hasError?a.onError(this.error):this.hasValue?(a.onNext(this.value),a.onCompleted()):a.onCompleted(),Mb):(this.observers.push(a),new wd(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.hasValue=!1,this.observers=[],this.hasError=!1}return Cb(d,a),Db(d.prototype,ic,{hasObservers:function(){return Ob(this),this.observers.length>0},onCompleted:function(){var a,c;if(Ob(this),!this.isStopped){this.isStopped=!0;var d=b(this.observers),c=d.length;if(this.hasValue)for(a=0;c>a;a++){var e=d[a];e.onNext(this.value),e.onCompleted()}else for(a=0;c>a;a++)d[a].onCompleted();this.observers.length=0}},onError:function(a){if(Ob(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){Ob(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(qc),Md=Ca.AnonymousSubject=function(a){function b(a){return this.observable.subscribe(a)}function c(c,d){this.observer=c,this.observable=d,a.call(this,b)}return Cb(c,a),Db(c.prototype,ic.prototype,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(qc);Ca.Pauser=function(a){function b(){a.call(this)}return Cb(b,a),b.prototype.pause=function(){this.onNext(!1)},b.prototype.resume=function(){this.onNext(!0)},b}(Kd),"function"==typeof define&&"object"==typeof define.amd&&define.amd?(xa.Rx=Ca,define(function(){return Ca})):ya&&za?Aa?(za.exports=Ca).Rx=Ca:ya.Rx=Ca:xa.Rx=Ca;var Nd=g()}).call(this);
+//# sourceMappingURL=rx.all.map \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.async.compat.js b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.async.compat.js
new file mode 100644
index 00000000000..0e487e988cf
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.async.compat.js
@@ -0,0 +1,586 @@
+// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
+
+;(function (factory) {
+ var objectTypes = {
+ 'boolean': false,
+ 'function': true,
+ 'object': true,
+ 'number': false,
+ 'string': false,
+ 'undefined': false
+ };
+
+ var root = (objectTypes[typeof window] && window) || this,
+ freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
+ freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
+ moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
+ freeGlobal = objectTypes[typeof global] && global;
+
+ if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) {
+ root = freeGlobal;
+ }
+
+ // Because of build optimizers
+ if (typeof define === 'function' && define.amd) {
+ define(['rx.binding', 'exports'], function (Rx, exports) {
+ root.Rx = factory(root, exports, Rx);
+ return root.Rx;
+ });
+ } else if (typeof module === 'object' && module && module.exports === freeExports) {
+ module.exports = factory(root, module.exports, require('./rx'));
+ } else {
+ root.Rx = factory(root, {}, root.Rx);
+ }
+}.call(this, function (root, exp, Rx, undefined) {
+
+ // Aliases
+ var Observable = Rx.Observable,
+ observableProto = Observable.prototype,
+ observableFromPromise = Observable.fromPromise,
+ observableThrow = Observable.throwError,
+ AnonymousObservable = Rx.AnonymousObservable,
+ AsyncSubject = Rx.AsyncSubject,
+ disposableCreate = Rx.Disposable.create,
+ CompositeDisposable = Rx.CompositeDisposable,
+ immediateScheduler = Rx.Scheduler.immediate,
+ timeoutScheduler = Rx.Scheduler['default'],
+ isScheduler = Rx.Scheduler.isScheduler,
+ slice = Array.prototype.slice;
+
+ var fnString = 'function',
+ throwString = 'throw',
+ isObject = Rx.internals.isObject;
+
+ function toThunk(obj, ctx) {
+ if (Array.isArray(obj)) { return objectToThunk.call(ctx, obj); }
+ if (isGeneratorFunction(obj)) { return observableSpawn(obj.call(ctx)); }
+ if (isGenerator(obj)) { return observableSpawn(obj); }
+ if (isObservable(obj)) { return observableToThunk(obj); }
+ if (isPromise(obj)) { return promiseToThunk(obj); }
+ if (typeof obj === fnString) { return obj; }
+ if (isObject(obj) || Array.isArray(obj)) { return objectToThunk.call(ctx, obj); }
+
+ return obj;
+ }
+
+ function objectToThunk(obj) {
+ var ctx = this;
+
+ return function (done) {
+ var keys = Object.keys(obj),
+ pending = keys.length,
+ results = new obj.constructor(),
+ finished;
+
+ if (!pending) {
+ timeoutScheduler.schedule(function () { done(null, results); });
+ return;
+ }
+
+ for (var i = 0, len = keys.length; i < len; i++) {
+ run(obj[keys[i]], keys[i]);
+ }
+
+ function run(fn, key) {
+ if (finished) { return; }
+ try {
+ fn = toThunk(fn, ctx);
+
+ if (typeof fn !== fnString) {
+ results[key] = fn;
+ return --pending || done(null, results);
+ }
+
+ fn.call(ctx, function(err, res) {
+ if (finished) { return; }
+
+ if (err) {
+ finished = true;
+ return done(err);
+ }
+
+ results[key] = res;
+ --pending || done(null, results);
+ });
+ } catch (e) {
+ finished = true;
+ done(e);
+ }
+ }
+ }
+ }
+
+ function observableToThunk(observable) {
+ return function (fn) {
+ var value, hasValue = false;
+ observable.subscribe(
+ function (v) {
+ value = v;
+ hasValue = true;
+ },
+ fn,
+ function () {
+ hasValue && fn(null, value);
+ });
+ }
+ }
+
+ function promiseToThunk(promise) {
+ return function(fn) {
+ promise.then(function(res) {
+ fn(null, res);
+ }, fn);
+ }
+ }
+
+ function isObservable(obj) {
+ return obj && typeof obj.subscribe === fnString;
+ }
+
+ function isGeneratorFunction(obj) {
+ return obj && obj.constructor && obj.constructor.name === 'GeneratorFunction';
+ }
+
+ function isGenerator(obj) {
+ return obj && typeof obj.next === fnString && typeof obj[throwString] === fnString;
+ }
+
+ /*
+ * Spawns a generator function which allows for Promises, Observable sequences, Arrays, Objects, Generators and functions.
+ * @param {Function} The spawning function.
+ * @returns {Function} a function which has a done continuation.
+ */
+ var observableSpawn = Rx.spawn = function (fn) {
+ var isGenFun = isGeneratorFunction(fn);
+
+ return function (done) {
+ var ctx = this,
+ gen = fn;
+
+ if (isGenFun) {
+ for(var args = [], i = 0, len = arguments.length; i < len; i++) { args.push(arguments[i]); }
+ var len = args.length,
+ hasCallback = len && typeof args[len - 1] === fnString;
+
+ done = hasCallback ? args.pop() : handleError;
+ gen = fn.apply(this, args);
+ } else {
+ done = done || handleError;
+ }
+
+ next();
+
+ function exit(err, res) {
+ timeoutScheduler.schedule(done.bind(ctx, err, res));
+ }
+
+ function next(err, res) {
+ var ret;
+
+ // multiple args
+ if (arguments.length > 2) {
+ for(var res = [], i = 1, len = arguments.length; i < len; i++) { res.push(arguments[i]); }
+ }
+
+ if (err) {
+ try {
+ ret = gen[throwString](err);
+ } catch (e) {
+ return exit(e);
+ }
+ }
+
+ if (!err) {
+ try {
+ ret = gen.next(res);
+ } catch (e) {
+ return exit(e);
+ }
+ }
+
+ if (ret.done) {
+ return exit(null, ret.value);
+ }
+
+ ret.value = toThunk(ret.value, ctx);
+
+ if (typeof ret.value === fnString) {
+ var called = false;
+ try {
+ ret.value.call(ctx, function() {
+ if (called) {
+ return;
+ }
+
+ called = true;
+ next.apply(ctx, arguments);
+ });
+ } catch (e) {
+ timeoutScheduler.schedule(function () {
+ if (called) {
+ return;
+ }
+
+ called = true;
+ next.call(ctx, e);
+ });
+ }
+ return;
+ }
+
+ // Not supported
+ next(new TypeError('Rx.spawn only supports a function, Promise, Observable, Object or Array.'));
+ }
+ }
+ };
+
+ function handleError(err) {
+ if (!err) { return; }
+ timeoutScheduler.schedule(function() {
+ throw err;
+ });
+ }
+
+ /**
+ * Invokes the specified function asynchronously on the specified scheduler, surfacing the result through an observable sequence.
+ *
+ * @example
+ * var res = Rx.Observable.start(function () { console.log('hello'); });
+ * var res = Rx.Observable.start(function () { console.log('hello'); }, Rx.Scheduler.timeout);
+ * var res = Rx.Observable.start(function () { this.log('hello'); }, Rx.Scheduler.timeout, console);
+ *
+ * @param {Function} func Function to run asynchronously.
+ * @param {Scheduler} [scheduler] Scheduler to run the function on. If not specified, defaults to Scheduler.timeout.
+ * @param [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
+ * @returns {Observable} An observable sequence exposing the function's result value, or an exception.
+ *
+ * Remarks
+ * * The function is called immediately, not during the subscription of the resulting sequence.
+ * * Multiple subscriptions to the resulting sequence can observe the function's result.
+ */
+ Observable.start = function (func, context, scheduler) {
+ return observableToAsync(func, context, scheduler)();
+ };
+
+ /**
+ * Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function on the specified scheduler.
+ * @param {Function} function Function to convert to an asynchronous function.
+ * @param {Scheduler} [scheduler] Scheduler to run the function on. If not specified, defaults to Scheduler.timeout.
+ * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
+ * @returns {Function} Asynchronous function.
+ */
+ var observableToAsync = Observable.toAsync = function (func, context, scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return function () {
+ var args = arguments,
+ subject = new AsyncSubject();
+
+ scheduler.schedule(function () {
+ var result;
+ try {
+ result = func.apply(context, args);
+ } catch (e) {
+ subject.onError(e);
+ return;
+ }
+ subject.onNext(result);
+ subject.onCompleted();
+ });
+ return subject.asObservable();
+ };
+ };
+
+ /**
+ * Converts a callback function to an observable sequence.
+ *
+ * @param {Function} function Function with a callback as the last parameter to convert to an Observable sequence.
+ * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
+ * @param {Function} [selector] A selector which takes the arguments from the callback to produce a single item to yield on next.
+ * @returns {Function} A function, when executed with the required parameters minus the callback, produces an Observable sequence with a single value of the arguments to the callback as an array.
+ */
+ Observable.fromCallback = function (func, context, selector) {
+ return function () {
+ var len = arguments.length, args = new Array(len)
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+
+ return new AnonymousObservable(function (observer) {
+ function handler() {
+ var len = arguments.length, results = new Array(len);
+ for(var i = 0; i < len; i++) { results[i] = arguments[i]; }
+
+ if (selector) {
+ try {
+ results = selector.apply(context, results);
+ } catch (e) {
+ return observer.onError(e);
+ }
+
+ observer.onNext(results);
+ } else {
+ if (results.length <= 1) {
+ observer.onNext.apply(observer, results);
+ } else {
+ observer.onNext(results);
+ }
+ }
+
+ observer.onCompleted();
+ }
+
+ args.push(handler);
+ func.apply(context, args);
+ }).publishLast().refCount();
+ };
+ };
+
+ /**
+ * Converts a Node.js callback style function to an observable sequence. This must be in function (err, ...) format.
+ * @param {Function} func The function to call
+ * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
+ * @param {Function} [selector] A selector which takes the arguments from the callback minus the error to produce a single item to yield on next.
+ * @returns {Function} An async function which when applied, returns an observable sequence with the callback arguments as an array.
+ */
+ Observable.fromNodeCallback = function (func, context, selector) {
+ return function () {
+ var len = arguments.length, args = new Array(len);
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+
+ return new AnonymousObservable(function (observer) {
+ function handler(err) {
+ if (err) {
+ observer.onError(err);
+ return;
+ }
+
+ var len = arguments.length, results = [];
+ for(var i = 1; i < len; i++) { results[i - 1] = arguments[i]; }
+
+ if (selector) {
+ try {
+ results = selector.apply(context, results);
+ } catch (e) {
+ return observer.onError(e);
+ }
+ observer.onNext(results);
+ } else {
+ if (results.length <= 1) {
+ observer.onNext.apply(observer, results);
+ } else {
+ observer.onNext(results);
+ }
+ }
+
+ observer.onCompleted();
+ }
+
+ args.push(handler);
+ func.apply(context, args);
+ }).publishLast().refCount();
+ };
+ };
+
+ function isNodeList(el) {
+ if (window.StaticNodeList) {
+ // IE8 Specific
+ // instanceof is slower than Object#toString, but Object#toString will not work as intended in IE8
+ return (el instanceof window.StaticNodeList || el instanceof window.NodeList);
+ } else {
+ return (Object.prototype.toString.call(el) == '[object NodeList]')
+ }
+ }
+
+ function fixEvent(event) {
+ var stopPropagation = function () {
+ this.cancelBubble = true;
+ };
+
+ var preventDefault = function () {
+ this.bubbledKeyCode = this.keyCode;
+ if (this.ctrlKey) {
+ try {
+ this.keyCode = 0;
+ } catch (e) { }
+ }
+ this.defaultPrevented = true;
+ this.returnValue = false;
+ this.modified = true;
+ };
+
+ event || (event = root.event);
+ if (!event.target) {
+ event.target = event.target || event.srcElement;
+
+ if (event.type == 'mouseover') {
+ event.relatedTarget = event.fromElement;
+ }
+ if (event.type == 'mouseout') {
+ event.relatedTarget = event.toElement;
+ }
+ // Adding stopPropogation and preventDefault to IE
+ if (!event.stopPropagation) {
+ event.stopPropagation = stopPropagation;
+ event.preventDefault = preventDefault;
+ }
+ // Normalize key events
+ switch (event.type) {
+ case 'keypress':
+ var c = ('charCode' in event ? event.charCode : event.keyCode);
+ if (c == 10) {
+ c = 0;
+ event.keyCode = 13;
+ } else if (c == 13 || c == 27) {
+ c = 0;
+ } else if (c == 3) {
+ c = 99;
+ }
+ event.charCode = c;
+ event.keyChar = event.charCode ? String.fromCharCode(event.charCode) : '';
+ break;
+ }
+ }
+
+ return event;
+ }
+
+ function createListener (element, name, handler) {
+ // Standards compliant
+ if (element.addEventListener) {
+ element.addEventListener(name, handler, false);
+ return disposableCreate(function () {
+ element.removeEventListener(name, handler, false);
+ });
+ }
+ if (element.attachEvent) {
+ // IE Specific
+ var innerHandler = function (event) {
+ handler(fixEvent(event));
+ };
+ element.attachEvent('on' + name, innerHandler);
+ return disposableCreate(function () {
+ element.detachEvent('on' + name, innerHandler);
+ });
+ }
+ // Level 1 DOM Events
+ element['on' + name] = handler;
+ return disposableCreate(function () {
+ element['on' + name] = null;
+ });
+ }
+
+ function createEventListener (el, eventName, handler) {
+ var disposables = new CompositeDisposable();
+
+ // Asume NodeList
+ if (isNodeList(el) || Object.prototype.toString.call(el) === '[object HTMLCollection]') {
+ for (var i = 0, len = el.length; i < len; i++) {
+ disposables.add(createEventListener(el.item(i), eventName, handler));
+ }
+ } else if (el) {
+ disposables.add(createListener(el, eventName, handler));
+ }
+
+ return disposables;
+ }
+
+ /**
+ * Configuration option to determine whether to use native events only
+ */
+ Rx.config.useNativeEvents = false;
+
+ /**
+ * Creates an observable sequence by adding an event listener to the matching DOMElement or each item in the NodeList.
+ *
+ * @example
+ * var source = Rx.Observable.fromEvent(element, 'mouseup');
+ *
+ * @param {Object} element The DOMElement or NodeList to attach a listener.
+ * @param {String} eventName The event name to attach the observable sequence.
+ * @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next.
+ * @returns {Observable} An observable sequence of events from the specified element and the specified event.
+ */
+ Observable.fromEvent = function (element, eventName, selector) {
+ // Node.js specific
+ if (element.addListener) {
+ return fromEventPattern(
+ function (h) { element.addListener(eventName, h); },
+ function (h) { element.removeListener(eventName, h); },
+ selector);
+ }
+
+ // Use only if non-native events are allowed
+ if (!Rx.config.useNativeEvents) {
+ // Handles jq, Angular.js, Zepto, Marionette, Ember.js
+ if (typeof element.on === 'function' && typeof element.off === 'function') {
+ return fromEventPattern(
+ function (h) { element.on(eventName, h); },
+ function (h) { element.off(eventName, h); },
+ selector);
+ }
+ }
+ return new AnonymousObservable(function (observer) {
+ return createEventListener(
+ element,
+ eventName,
+ function handler (e) {
+ var results = e;
+
+ if (selector) {
+ try {
+ results = selector(arguments);
+ } catch (err) {
+ return observer.onError(err);
+ }
+ }
+
+ observer.onNext(results);
+ });
+ }).publish().refCount();
+ };
+
+ /**
+ * Creates an observable sequence from an event emitter via an addHandler/removeHandler pair.
+ * @param {Function} addHandler The function to add a handler to the emitter.
+ * @param {Function} [removeHandler] The optional function to remove a handler from an emitter.
+ * @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next.
+ * @returns {Observable} An observable sequence which wraps an event from an event emitter
+ */
+ var fromEventPattern = Observable.fromEventPattern = function (addHandler, removeHandler, selector) {
+ return new AnonymousObservable(function (observer) {
+ function innerHandler (e) {
+ var result = e;
+ if (selector) {
+ try {
+ result = selector(arguments);
+ } catch (err) {
+ return observer.onError(err);
+ }
+ }
+ observer.onNext(result);
+ }
+
+ var returnValue = addHandler(innerHandler);
+ return disposableCreate(function () {
+ if (removeHandler) {
+ removeHandler(innerHandler, returnValue);
+ }
+ });
+ }).publish().refCount();
+ };
+
+ /**
+ * Invokes the asynchronous function, surfacing the result through an observable sequence.
+ * @param {Function} functionAsync Asynchronous function which returns a Promise to run.
+ * @returns {Observable} An observable sequence exposing the function's result value, or an exception.
+ */
+ Observable.startAsync = function (functionAsync) {
+ var promise;
+ try {
+ promise = functionAsync();
+ } catch (e) {
+ return observableThrow(e);
+ }
+ return observableFromPromise(promise);
+ }
+
+ return Rx;
+}));
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.async.compat.map b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.async.compat.map
new file mode 100644
index 00000000000..effbad5d4a0
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.async.compat.map
@@ -0,0 +1 @@
+{"version":3,"file":"rx.async.compat.min.js","sources":["rx.async.compat.js"],"names":["factory","objectTypes","boolean","function","object","number","string","undefined","root","window","this","freeExports","exports","nodeType","freeModule","module","freeGlobal","global","define","amd","Rx","require","call","exp","toThunk","obj","ctx","Array","isArray","objectToThunk","isGeneratorFunction","observableSpawn","isGenerator","isObservable","observableToThunk","isPromise","promiseToThunk","fnString","isObject","done","run","fn","key","finished","results","pending","err","res","e","keys","Object","length","constructor","timeoutScheduler","schedule","i","len","observable","value","hasValue","subscribe","v","promise","then","name","next","throwString","handleError","isNodeList","el","StaticNodeList","NodeList","prototype","toString","fixEvent","event","stopPropagation","cancelBubble","preventDefault","bubbledKeyCode","keyCode","ctrlKey","defaultPrevented","returnValue","modified","target","srcElement","type","relatedTarget","fromElement","toElement","c","charCode","keyChar","String","fromCharCode","createListener","element","handler","addEventListener","disposableCreate","removeEventListener","attachEvent","innerHandler","detachEvent","createEventListener","eventName","disposables","CompositeDisposable","add","item","Observable","observableFromPromise","fromPromise","observableThrow","throwError","AnonymousObservable","AsyncSubject","Disposable","create","Scheduler","immediate","isScheduler","slice","internals","spawn","isGenFun","exit","bind","ret","arguments","push","gen","TypeError","called","apply","args","hasCallback","pop","start","func","context","scheduler","observableToAsync","toAsync","subject","result","onError","onNext","onCompleted","asObservable","fromCallback","selector","observer","publishLast","refCount","fromNodeCallback","config","useNativeEvents","fromEvent","addList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_modules/rx/dist/rx.async.compat.min.js b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.async.compat.min.js
new file mode 100644
index 00000000000..34f0e751222
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.async.compat.min.js
@@ -0,0 +1,3 @@
+/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
+(function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx.binding","exports"],function(b,d){return c.Rx=a(c,d,b),c.Rx}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){function e(a,b){return Array.isArray(a)?f.call(b,a):j(a)?C(a.call(b)):k(a)?C(a):i(a)?g(a):isPromise(a)?h(a):typeof a===z?a:B(a)||Array.isArray(a)?f.call(b,a):a}function f(a){var b=this;return function(c){function d(a,d){if(!f)try{if(a=e(a,b),typeof a!==z)return i[d]=a,--h||c(null,i);a.call(b,function(a,b){if(!f){if(a)return f=!0,c(a);i[d]=b,--h||c(null,i)}})}catch(g){f=!0,c(g)}}var f,g=Object.keys(a),h=g.length,i=new a.constructor;if(!h)return void x.schedule(function(){c(null,i)});for(var j=0,k=g.length;k>j;j++)d(a[g[j]],g[j])}}function g(a){return function(b){var c,d=!1;a.subscribe(function(a){c=a,d=!0},b,function(){d&&b(null,c)})}}function h(a){return function(b){a.then(function(a){b(null,a)},b)}}function i(a){return a&&typeof a.subscribe===z}function j(a){return a&&a.constructor&&"GeneratorFunction"===a.constructor.name}function k(a){return a&&typeof a.next===z&&typeof a[A]===z}function l(a){a&&x.schedule(function(){throw a})}function m(a){return window.StaticNodeList?a instanceof window.StaticNodeList||a instanceof window.NodeList:"[object NodeList]"==Object.prototype.toString.call(a)}function n(b){var c=function(){this.cancelBubble=!0},d=function(){if(this.bubbledKeyCode=this.keyCode,this.ctrlKey)try{this.keyCode=0}catch(a){}this.defaultPrevented=!0,this.returnValue=!1,this.modified=!0};if(b||(b=a.event),!b.target)switch(b.target=b.target||b.srcElement,"mouseover"==b.type&&(b.relatedTarget=b.fromElement),"mouseout"==b.type&&(b.relatedTarget=b.toElement),b.stopPropagation||(b.stopPropagation=c,b.preventDefault=d),b.type){case"keypress":var e="charCode"in b?b.charCode:b.keyCode;10==e?(e=0,b.keyCode=13):13==e||27==e?e=0:3==e&&(e=99),b.charCode=e,b.keyChar=b.charCode?String.fromCharCode(b.charCode):""}return b}function o(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1),v(function(){a.removeEventListener(b,c,!1)});if(a.attachEvent){var d=function(a){c(n(a))};return a.attachEvent("on"+b,d),v(function(){a.detachEvent("on"+b,d)})}return a["on"+b]=c,v(function(){a["on"+b]=null})}function p(a,b,c){var d=new w;if(m(a)||"[object HTMLCollection]"===Object.prototype.toString.call(a))for(var e=0,f=a.length;f>e;e++)d.add(p(a.item(e),b,c));else a&&d.add(o(a,b,c));return d}var q=c.Observable,r=(q.prototype,q.fromPromise),s=q.throwError,t=c.AnonymousObservable,u=c.AsyncSubject,v=c.Disposable.create,w=c.CompositeDisposable,x=(c.Scheduler.immediate,c.Scheduler["default"]),y=c.Scheduler.isScheduler,z=(Array.prototype.slice,"function"),A="throw",B=c.internals.isObject,C=c.spawn=function(a){var b=j(a);return function(c){function d(a,b){x.schedule(c.bind(g,a,b))}function f(a,b){var c;if(arguments.length>2)for(var b=[],i=1,j=arguments.length;j>i;i++)b.push(arguments[i]);if(a)try{c=h[A](a)}catch(k){return d(k)}if(!a)try{c=h.next(b)}catch(k){return d(k)}if(c.done)return d(null,c.value);if(c.value=e(c.value,g),typeof c.value!==z)f(new TypeError("Rx.spawn only supports a function, Promise, Observable, Object or Array."));else{var l=!1;try{c.value.call(g,function(){l||(l=!0,f.apply(g,arguments))})}catch(k){x.schedule(function(){l||(l=!0,f.call(g,k))})}}}var g=this,h=a;if(b){for(var i=[],j=0,k=arguments.length;k>j;j++)i.push(arguments[j]);var k=i.length,m=k&&typeof i[k-1]===z;c=m?i.pop():l,h=a.apply(this,i)}else c=c||l;f()}};q.start=function(a,b,c){return D(a,b,c)()};var D=q.toAsync=function(a,b,c){return y(c)||(c=x),function(){var d=arguments,e=new u;return c.schedule(function(){var c;try{c=a.apply(b,d)}catch(f){return void e.onError(f)}e.onNext(c),e.onCompleted()}),e.asObservable()}};q.fromCallback=function(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return new t(function(d){function f(){for(var a=arguments.length,e=new Array(a),f=0;a>f;f++)e[f]=arguments[f];if(c){try{e=c.apply(b,e)}catch(g){return d.onError(g)}d.onNext(e)}else e.length<=1?d.onNext.apply(d,e):d.onNext(e);d.onCompleted()}e.push(f),a.apply(b,e)}).publishLast().refCount()}},q.fromNodeCallback=function(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return new t(function(d){function f(a){if(a)return void d.onError(a);for(var e=arguments.length,f=[],g=1;e>g;g++)f[g-1]=arguments[g];if(c){try{f=c.apply(b,f)}catch(h){return d.onError(h)}d.onNext(f)}else f.length<=1?d.onNext.apply(d,f):d.onNext(f);d.onCompleted()}e.push(f),a.apply(b,e)}).publishLast().refCount()}},c.config.useNativeEvents=!1,q.fromEvent=function(a,b,d){return a.addListener?E(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},d):c.config.useNativeEvents||"function"!=typeof a.on||"function"!=typeof a.off?new t(function(c){return p(a,b,function(a){var b=a;if(d)try{b=d(arguments)}catch(e){return c.onError(e)}c.onNext(b)})}).publish().refCount():E(function(c){a.on(b,c)},function(c){a.off(b,c)},d)};var E=q.fromEventPattern=function(a,b,c){return new t(function(d){function e(a){var b=a;if(c)try{b=c(arguments)}catch(e){return d.onError(e)}d.onNext(b)}var f=a(e);return v(function(){b&&b(e,f)})}).publish().refCount()};return q.startAsync=function(a){var b;try{b=a()}catch(c){return s(c)}return r(b)},c});
+//# sourceMappingURL=rx.async.compat.map \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.async.js b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.async.js
new file mode 100644
index 00000000000..93b212bebef
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.async.js
@@ -0,0 +1,509 @@
+// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
+
+;(function (factory) {
+ var objectTypes = {
+ 'boolean': false,
+ 'function': true,
+ 'object': true,
+ 'number': false,
+ 'string': false,
+ 'undefined': false
+ };
+
+ var root = (objectTypes[typeof window] && window) || this,
+ freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
+ freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
+ moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
+ freeGlobal = objectTypes[typeof global] && global;
+
+ if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) {
+ root = freeGlobal;
+ }
+
+ // Because of build optimizers
+ if (typeof define === 'function' && define.amd) {
+ define(['rx.binding', 'exports'], function (Rx, exports) {
+ root.Rx = factory(root, exports, Rx);
+ return root.Rx;
+ });
+ } else if (typeof module === 'object' && module && module.exports === freeExports) {
+ module.exports = factory(root, module.exports, require('./rx'));
+ } else {
+ root.Rx = factory(root, {}, root.Rx);
+ }
+}.call(this, function (root, exp, Rx, undefined) {
+
+ // Aliases
+ var Observable = Rx.Observable,
+ observableProto = Observable.prototype,
+ observableFromPromise = Observable.fromPromise,
+ observableThrow = Observable.throwError,
+ AnonymousObservable = Rx.AnonymousObservable,
+ AsyncSubject = Rx.AsyncSubject,
+ disposableCreate = Rx.Disposable.create,
+ CompositeDisposable = Rx.CompositeDisposable,
+ immediateScheduler = Rx.Scheduler.immediate,
+ timeoutScheduler = Rx.Scheduler['default'],
+ isScheduler = Rx.Scheduler.isScheduler,
+ slice = Array.prototype.slice;
+
+ var fnString = 'function',
+ throwString = 'throw',
+ isObject = Rx.internals.isObject;
+
+ function toThunk(obj, ctx) {
+ if (Array.isArray(obj)) { return objectToThunk.call(ctx, obj); }
+ if (isGeneratorFunction(obj)) { return observableSpawn(obj.call(ctx)); }
+ if (isGenerator(obj)) { return observableSpawn(obj); }
+ if (isObservable(obj)) { return observableToThunk(obj); }
+ if (isPromise(obj)) { return promiseToThunk(obj); }
+ if (typeof obj === fnString) { return obj; }
+ if (isObject(obj) || Array.isArray(obj)) { return objectToThunk.call(ctx, obj); }
+
+ return obj;
+ }
+
+ function objectToThunk(obj) {
+ var ctx = this;
+
+ return function (done) {
+ var keys = Object.keys(obj),
+ pending = keys.length,
+ results = new obj.constructor(),
+ finished;
+
+ if (!pending) {
+ timeoutScheduler.schedule(function () { done(null, results); });
+ return;
+ }
+
+ for (var i = 0, len = keys.length; i < len; i++) {
+ run(obj[keys[i]], keys[i]);
+ }
+
+ function run(fn, key) {
+ if (finished) { return; }
+ try {
+ fn = toThunk(fn, ctx);
+
+ if (typeof fn !== fnString) {
+ results[key] = fn;
+ return --pending || done(null, results);
+ }
+
+ fn.call(ctx, function(err, res) {
+ if (finished) { return; }
+
+ if (err) {
+ finished = true;
+ return done(err);
+ }
+
+ results[key] = res;
+ --pending || done(null, results);
+ });
+ } catch (e) {
+ finished = true;
+ done(e);
+ }
+ }
+ }
+ }
+
+ function observableToThunk(observable) {
+ return function (fn) {
+ var value, hasValue = false;
+ observable.subscribe(
+ function (v) {
+ value = v;
+ hasValue = true;
+ },
+ fn,
+ function () {
+ hasValue && fn(null, value);
+ });
+ }
+ }
+
+ function promiseToThunk(promise) {
+ return function(fn) {
+ promise.then(function(res) {
+ fn(null, res);
+ }, fn);
+ }
+ }
+
+ function isObservable(obj) {
+ return obj && typeof obj.subscribe === fnString;
+ }
+
+ function isGeneratorFunction(obj) {
+ return obj && obj.constructor && obj.constructor.name === 'GeneratorFunction';
+ }
+
+ function isGenerator(obj) {
+ return obj && typeof obj.next === fnString && typeof obj[throwString] === fnString;
+ }
+
+ /*
+ * Spawns a generator function which allows for Promises, Observable sequences, Arrays, Objects, Generators and functions.
+ * @param {Function} The spawning function.
+ * @returns {Function} a function which has a done continuation.
+ */
+ var observableSpawn = Rx.spawn = function (fn) {
+ var isGenFun = isGeneratorFunction(fn);
+
+ return function (done) {
+ var ctx = this,
+ gen = fn;
+
+ if (isGenFun) {
+ for(var args = [], i = 0, len = arguments.length; i < len; i++) { args.push(arguments[i]); }
+ var len = args.length,
+ hasCallback = len && typeof args[len - 1] === fnString;
+
+ done = hasCallback ? args.pop() : handleError;
+ gen = fn.apply(this, args);
+ } else {
+ done = done || handleError;
+ }
+
+ next();
+
+ function exit(err, res) {
+ timeoutScheduler.schedule(done.bind(ctx, err, res));
+ }
+
+ function next(err, res) {
+ var ret;
+
+ // multiple args
+ if (arguments.length > 2) {
+ for(var res = [], i = 1, len = arguments.length; i < len; i++) { res.push(arguments[i]); }
+ }
+
+ if (err) {
+ try {
+ ret = gen[throwString](err);
+ } catch (e) {
+ return exit(e);
+ }
+ }
+
+ if (!err) {
+ try {
+ ret = gen.next(res);
+ } catch (e) {
+ return exit(e);
+ }
+ }
+
+ if (ret.done) {
+ return exit(null, ret.value);
+ }
+
+ ret.value = toThunk(ret.value, ctx);
+
+ if (typeof ret.value === fnString) {
+ var called = false;
+ try {
+ ret.value.call(ctx, function() {
+ if (called) {
+ return;
+ }
+
+ called = true;
+ next.apply(ctx, arguments);
+ });
+ } catch (e) {
+ timeoutScheduler.schedule(function () {
+ if (called) {
+ return;
+ }
+
+ called = true;
+ next.call(ctx, e);
+ });
+ }
+ return;
+ }
+
+ // Not supported
+ next(new TypeError('Rx.spawn only supports a function, Promise, Observable, Object or Array.'));
+ }
+ }
+ };
+
+ function handleError(err) {
+ if (!err) { return; }
+ timeoutScheduler.schedule(function() {
+ throw err;
+ });
+ }
+
+ /**
+ * Invokes the specified function asynchronously on the specified scheduler, surfacing the result through an observable sequence.
+ *
+ * @example
+ * var res = Rx.Observable.start(function () { console.log('hello'); });
+ * var res = Rx.Observable.start(function () { console.log('hello'); }, Rx.Scheduler.timeout);
+ * var res = Rx.Observable.start(function () { this.log('hello'); }, Rx.Scheduler.timeout, console);
+ *
+ * @param {Function} func Function to run asynchronously.
+ * @param {Scheduler} [scheduler] Scheduler to run the function on. If not specified, defaults to Scheduler.timeout.
+ * @param [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
+ * @returns {Observable} An observable sequence exposing the function's result value, or an exception.
+ *
+ * Remarks
+ * * The function is called immediately, not during the subscription of the resulting sequence.
+ * * Multiple subscriptions to the resulting sequence can observe the function's result.
+ */
+ Observable.start = function (func, context, scheduler) {
+ return observableToAsync(func, context, scheduler)();
+ };
+
+ /**
+ * Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function on the specified scheduler.
+ * @param {Function} function Function to convert to an asynchronous function.
+ * @param {Scheduler} [scheduler] Scheduler to run the function on. If not specified, defaults to Scheduler.timeout.
+ * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
+ * @returns {Function} Asynchronous function.
+ */
+ var observableToAsync = Observable.toAsync = function (func, context, scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return function () {
+ var args = arguments,
+ subject = new AsyncSubject();
+
+ scheduler.schedule(function () {
+ var result;
+ try {
+ result = func.apply(context, args);
+ } catch (e) {
+ subject.onError(e);
+ return;
+ }
+ subject.onNext(result);
+ subject.onCompleted();
+ });
+ return subject.asObservable();
+ };
+ };
+
+ /**
+ * Converts a callback function to an observable sequence.
+ *
+ * @param {Function} function Function with a callback as the last parameter to convert to an Observable sequence.
+ * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
+ * @param {Function} [selector] A selector which takes the arguments from the callback to produce a single item to yield on next.
+ * @returns {Function} A function, when executed with the required parameters minus the callback, produces an Observable sequence with a single value of the arguments to the callback as an array.
+ */
+ Observable.fromCallback = function (func, context, selector) {
+ return function () {
+ var len = arguments.length, args = new Array(len)
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+
+ return new AnonymousObservable(function (observer) {
+ function handler() {
+ var len = arguments.length, results = new Array(len);
+ for(var i = 0; i < len; i++) { results[i] = arguments[i]; }
+
+ if (selector) {
+ try {
+ results = selector.apply(context, results);
+ } catch (e) {
+ return observer.onError(e);
+ }
+
+ observer.onNext(results);
+ } else {
+ if (results.length <= 1) {
+ observer.onNext.apply(observer, results);
+ } else {
+ observer.onNext(results);
+ }
+ }
+
+ observer.onCompleted();
+ }
+
+ args.push(handler);
+ func.apply(context, args);
+ }).publishLast().refCount();
+ };
+ };
+
+ /**
+ * Converts a Node.js callback style function to an observable sequence. This must be in function (err, ...) format.
+ * @param {Function} func The function to call
+ * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
+ * @param {Function} [selector] A selector which takes the arguments from the callback minus the error to produce a single item to yield on next.
+ * @returns {Function} An async function which when applied, returns an observable sequence with the callback arguments as an array.
+ */
+ Observable.fromNodeCallback = function (func, context, selector) {
+ return function () {
+ var len = arguments.length, args = new Array(len);
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+
+ return new AnonymousObservable(function (observer) {
+ function handler(err) {
+ if (err) {
+ observer.onError(err);
+ return;
+ }
+
+ var len = arguments.length, results = [];
+ for(var i = 1; i < len; i++) { results[i - 1] = arguments[i]; }
+
+ if (selector) {
+ try {
+ results = selector.apply(context, results);
+ } catch (e) {
+ return observer.onError(e);
+ }
+ observer.onNext(results);
+ } else {
+ if (results.length <= 1) {
+ observer.onNext.apply(observer, results);
+ } else {
+ observer.onNext(results);
+ }
+ }
+
+ observer.onCompleted();
+ }
+
+ args.push(handler);
+ func.apply(context, args);
+ }).publishLast().refCount();
+ };
+ };
+
+ function createListener (element, name, handler) {
+ if (element.addEventListener) {
+ element.addEventListener(name, handler, false);
+ return disposableCreate(function () {
+ element.removeEventListener(name, handler, false);
+ });
+ }
+ throw new Error('No listener found');
+ }
+
+ function createEventListener (el, eventName, handler) {
+ var disposables = new CompositeDisposable();
+
+ // Asume NodeList or HTMLCollection
+ var toStr = Object.prototype.toString;
+ if (toStr.call(el) === '[object NodeList]' || toStr.call(el) === '[object HTMLCollection]') {
+ for (var i = 0, len = el.length; i < len; i++) {
+ disposables.add(createEventListener(el.item(i), eventName, handler));
+ }
+ } else if (el) {
+ disposables.add(createListener(el, eventName, handler));
+ }
+
+ return disposables;
+ }
+
+ /**
+ * Configuration option to determine whether to use native events only
+ */
+ Rx.config.useNativeEvents = false;
+
+ /**
+ * Creates an observable sequence by adding an event listener to the matching DOMElement or each item in the NodeList.
+ *
+ * @example
+ * var source = Rx.Observable.fromEvent(element, 'mouseup');
+ *
+ * @param {Object} element The DOMElement or NodeList to attach a listener.
+ * @param {String} eventName The event name to attach the observable sequence.
+ * @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next.
+ * @returns {Observable} An observable sequence of events from the specified element and the specified event.
+ */
+ Observable.fromEvent = function (element, eventName, selector) {
+ // Node.js specific
+ if (element.addListener) {
+ return fromEventPattern(
+ function (h) { element.addListener(eventName, h); },
+ function (h) { element.removeListener(eventName, h); },
+ selector);
+ }
+
+ // Use only if non-native events are allowed
+ if (!Rx.config.useNativeEvents) {
+ // Handles jq, Angular.js, Zepto, Marionette, Ember.js
+ if (typeof element.on === 'function' && typeof element.off === 'function') {
+ return fromEventPattern(
+ function (h) { element.on(eventName, h); },
+ function (h) { element.off(eventName, h); },
+ selector);
+ }
+ }
+ return new AnonymousObservable(function (observer) {
+ return createEventListener(
+ element,
+ eventName,
+ function handler (e) {
+ var results = e;
+
+ if (selector) {
+ try {
+ results = selector(arguments);
+ } catch (err) {
+ return observer.onError(err);
+ }
+ }
+
+ observer.onNext(results);
+ });
+ }).publish().refCount();
+ };
+
+ /**
+ * Creates an observable sequence from an event emitter via an addHandler/removeHandler pair.
+ * @param {Function} addHandler The function to add a handler to the emitter.
+ * @param {Function} [removeHandler] The optional function to remove a handler from an emitter.
+ * @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next.
+ * @returns {Observable} An observable sequence which wraps an event from an event emitter
+ */
+ var fromEventPattern = Observable.fromEventPattern = function (addHandler, removeHandler, selector) {
+ return new AnonymousObservable(function (observer) {
+ function innerHandler (e) {
+ var result = e;
+ if (selector) {
+ try {
+ result = selector(arguments);
+ } catch (err) {
+ return observer.onError(err);
+ }
+ }
+ observer.onNext(result);
+ }
+
+ var returnValue = addHandler(innerHandler);
+ return disposableCreate(function () {
+ if (removeHandler) {
+ removeHandler(innerHandler, returnValue);
+ }
+ });
+ }).publish().refCount();
+ };
+
+ /**
+ * Invokes the asynchronous function, surfacing the result through an observable sequence.
+ * @param {Function} functionAsync Asynchronous function which returns a Promise to run.
+ * @returns {Observable} An observable sequence exposing the function's result value, or an exception.
+ */
+ Observable.startAsync = function (functionAsync) {
+ var promise;
+ try {
+ promise = functionAsync();
+ } catch (e) {
+ return observableThrow(e);
+ }
+ return observableFromPromise(promise);
+ }
+
+ return Rx;
+}));
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.async.map b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.async.map
new file mode 100644
index 00000000000..afbe1976c7d
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.async.map
@@ -0,0 +1 @@
+{"version":3,"file":"rx.async.min.js","sources":["rx.async.js"],"names":["factory","objectTypes","boolean","function","object","number","string","undefined","root","window","this","freeExports","exports","nodeType","freeModule","module","freeGlobal","global","define","amd","Rx","require","call","exp","toThunk","obj","ctx","Array","isArray","objectToThunk","isGeneratorFunction","observableSpawn","isGenerator","isObservable","observableToThunk","isPromise","promiseToThunk","fnString","isObject","done","run","fn","key","finished","results","pending","err","res","e","keys","Object","length","constructor","timeoutScheduler","schedule","i","len","observable","value","hasValue","subscribe","v","promise","then","name","next","throwString","handleError","createListener","element","handler","addEventListener","disposableCreate","removeEventListener","Error","createEventListener","el","eventName","disposables","CompositeDisposable","toStr","prototype","toString","add","item","Observable","observableFromPromise","fromPromise","observableThrow","throwError","AnonymousObservable","AsyncSubject","Disposable","create","Scheduler","immediate","isScheduler","slice","internals","spawn","isGenFun","exit","bind","ret","arguments","push","gen","TypeError","called","apply","args","hasCallback","pop","start","func","context","scheduler","observableToAsync","toAsync","subject","result","onError","onNext","onCompleted","asObservable","fromCallback","selector","observer","publishLast","refCount","fromNodeCallback","config","useNativeEvents","fromEvent","addListener","fromEventPattern","h","removeListener","on","off","publish","addHandler","removeHandler","innerHandler","returnValue","startAsync","functionAsync"],"mappings":";CAEE,SAAUA,GACR,GAAIC,IACAC,WAAW,EACXC,YAAY,EACZC,QAAU,EACVC,QAAU,EACVC,QAAU,EACVC,WAAa,GAGbC,EAAQP,QAAmBQ,UAAWA,QAAWC,KACjDC,EAAcV,QAAmBW,WAAYA,UAAYA,QAAQC,UAAYD,QAC7EE,EAAab,QAAmBc,UAAWA,SAAWA,OAAOF,UAAYE,OAEzEC,GADgBF,GAAcA,EAAWF,UAAYD,GAAeA,EACvDV,QAAmBgB,UAAWA,SAE3CD,GAAeA,EAAWC,SAAWD,GAAcA,EAAWP,SAAWO,IACzER,EAAOQ,GAIW,kBAAXE,SAAyBA,OAAOC,IACvCD,QAAQ,aAAc,WAAY,SAAUE,EAAIR,GAE5C,MADAJ,GAAKY,GAAKpB,EAAQQ,EAAMI,EAASQ,GAC1BZ,EAAKY,KAES,gBAAXL,SAAuBA,QAAUA,OAAOH,UAAYD,EAClEI,OAAOH,QAAUZ,EAAQQ,EAAMO,OAAOH,QAASS,QAAQ,SAEvDb,EAAKY,GAAKpB,EAAQQ,KAAUA,EAAKY,MAEvCE,KAAKZ,KAAM,SAAUF,EAAMe,EAAKH,EAAIb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A8BR,IAAIS,GAAmBlD,EAAWkD,iBAAmB,SAAUM,EAAYC,EAAehB,GACxF,MAAO,IAAIpC,GAAoB,SAAUqC,GACvC,QAASgB,GAAc/F,GACrB,GAAIwE,GAASxE,CACb,IAAI8E,EACF,IACEN,EAASM,EAAStB,WAClB,MAAO1D,GACP,MAAOiF,GAASN,QAAQ3E,GAG5BiF,EAASL,OAAOF,GAGlB,GAAIwB,GAAcH,EAAWE,EAC7B,OAAOvE,GAAiB,WAClBsE,GACFA,EAAcC,EAAcC,OAG/BJ,UAAUX,WAkBb,OAVF5C,GAAW4D,WAAa,SAAUC,GAChC,GAAIpF,EACJ,KACEA,EAAUoF,IACV,MAAOlG,GACP,MAAOwC,GAAgBxC,GAEzB,MAAOsC,GAAsBxB,IAGtB1C"} \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.async.min.js b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.async.min.js
new file mode 100644
index 00000000000..484f2850c99
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.async.min.js
@@ -0,0 +1,3 @@
+/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
+(function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx.binding","exports"],function(b,d){return c.Rx=a(c,d,b),c.Rx}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){function e(a,b){return Array.isArray(a)?f.call(b,a):j(a)?A(a.call(b)):k(a)?A(a):i(a)?g(a):isPromise(a)?h(a):typeof a===x?a:z(a)||Array.isArray(a)?f.call(b,a):a}function f(a){var b=this;return function(c){function d(a,d){if(!f)try{if(a=e(a,b),typeof a!==x)return i[d]=a,--h||c(null,i);a.call(b,function(a,b){if(!f){if(a)return f=!0,c(a);i[d]=b,--h||c(null,i)}})}catch(g){f=!0,c(g)}}var f,g=Object.keys(a),h=g.length,i=new a.constructor;if(!h)return void v.schedule(function(){c(null,i)});for(var j=0,k=g.length;k>j;j++)d(a[g[j]],g[j])}}function g(a){return function(b){var c,d=!1;a.subscribe(function(a){c=a,d=!0},b,function(){d&&b(null,c)})}}function h(a){return function(b){a.then(function(a){b(null,a)},b)}}function i(a){return a&&typeof a.subscribe===x}function j(a){return a&&a.constructor&&"GeneratorFunction"===a.constructor.name}function k(a){return a&&typeof a.next===x&&typeof a[y]===x}function l(a){a&&v.schedule(function(){throw a})}function m(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1),t(function(){a.removeEventListener(b,c,!1)});throw new Error("No listener found")}function n(a,b,c){var d=new u,e=Object.prototype.toString;if("[object NodeList]"===e.call(a)||"[object HTMLCollection]"===e.call(a))for(var f=0,g=a.length;g>f;f++)d.add(n(a.item(f),b,c));else a&&d.add(m(a,b,c));return d}var o=c.Observable,p=(o.prototype,o.fromPromise),q=o.throwError,r=c.AnonymousObservable,s=c.AsyncSubject,t=c.Disposable.create,u=c.CompositeDisposable,v=(c.Scheduler.immediate,c.Scheduler["default"]),w=c.Scheduler.isScheduler,x=(Array.prototype.slice,"function"),y="throw",z=c.internals.isObject,A=c.spawn=function(a){var b=j(a);return function(c){function d(a,b){v.schedule(c.bind(g,a,b))}function f(a,b){var c;if(arguments.length>2)for(var b=[],i=1,j=arguments.length;j>i;i++)b.push(arguments[i]);if(a)try{c=h[y](a)}catch(k){return d(k)}if(!a)try{c=h.next(b)}catch(k){return d(k)}if(c.done)return d(null,c.value);if(c.value=e(c.value,g),typeof c.value!==x)f(new TypeError("Rx.spawn only supports a function, Promise, Observable, Object or Array."));else{var l=!1;try{c.value.call(g,function(){l||(l=!0,f.apply(g,arguments))})}catch(k){v.schedule(function(){l||(l=!0,f.call(g,k))})}}}var g=this,h=a;if(b){for(var i=[],j=0,k=arguments.length;k>j;j++)i.push(arguments[j]);var k=i.length,m=k&&typeof i[k-1]===x;c=m?i.pop():l,h=a.apply(this,i)}else c=c||l;f()}};o.start=function(a,b,c){return B(a,b,c)()};var B=o.toAsync=function(a,b,c){return w(c)||(c=v),function(){var d=arguments,e=new s;return c.schedule(function(){var c;try{c=a.apply(b,d)}catch(f){return void e.onError(f)}e.onNext(c),e.onCompleted()}),e.asObservable()}};o.fromCallback=function(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return new r(function(d){function f(){for(var a=arguments.length,e=new Array(a),f=0;a>f;f++)e[f]=arguments[f];if(c){try{e=c.apply(b,e)}catch(g){return d.onError(g)}d.onNext(e)}else e.length<=1?d.onNext.apply(d,e):d.onNext(e);d.onCompleted()}e.push(f),a.apply(b,e)}).publishLast().refCount()}},o.fromNodeCallback=function(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return new r(function(d){function f(a){if(a)return void d.onError(a);for(var e=arguments.length,f=[],g=1;e>g;g++)f[g-1]=arguments[g];if(c){try{f=c.apply(b,f)}catch(h){return d.onError(h)}d.onNext(f)}else f.length<=1?d.onNext.apply(d,f):d.onNext(f);d.onCompleted()}e.push(f),a.apply(b,e)}).publishLast().refCount()}},c.config.useNativeEvents=!1,o.fromEvent=function(a,b,d){return a.addListener?C(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},d):c.config.useNativeEvents||"function"!=typeof a.on||"function"!=typeof a.off?new r(function(c){return n(a,b,function(a){var b=a;if(d)try{b=d(arguments)}catch(e){return c.onError(e)}c.onNext(b)})}).publish().refCount():C(function(c){a.on(b,c)},function(c){a.off(b,c)},d)};var C=o.fromEventPattern=function(a,b,c){return new r(function(d){function e(a){var b=a;if(c)try{b=c(arguments)}catch(e){return d.onError(e)}d.onNext(b)}var f=a(e);return t(function(){b&&b(e,f)})}).publish().refCount()};return o.startAsync=function(a){var b;try{b=a()}catch(c){return q(c)}return p(b)},c});
+//# sourceMappingURL=rx.async.map \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.backpressure.js b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.backpressure.js
new file mode 100644
index 00000000000..fb96332da54
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.backpressure.js
@@ -0,0 +1,580 @@
+// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
+
+;(function (factory) {
+ var objectTypes = {
+ 'boolean': false,
+ 'function': true,
+ 'object': true,
+ 'number': false,
+ 'string': false,
+ 'undefined': false
+ };
+
+ var root = (objectTypes[typeof window] && window) || this,
+ freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
+ freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
+ moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
+ freeGlobal = objectTypes[typeof global] && global;
+
+ if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) {
+ root = freeGlobal;
+ }
+
+ // Because of build optimizers
+ if (typeof define === 'function' && define.amd) {
+ define(['rx'], function (Rx, exports) {
+ return factory(root, exports, Rx);
+ });
+ } else if (typeof module === 'object' && module && module.exports === freeExports) {
+ module.exports = factory(root, module.exports, require('./rx'));
+ } else {
+ root.Rx = factory(root, {}, root.Rx);
+ }
+}.call(this, function (root, exp, Rx, undefined) {
+
+ // References
+ var Observable = Rx.Observable,
+ observableProto = Observable.prototype,
+ AnonymousObservable = Rx.AnonymousObservable,
+ AbstractObserver = Rx.internals.AbstractObserver,
+ CompositeDisposable = Rx.CompositeDisposable,
+ Notification = Rx.Notification,
+ Subject = Rx.Subject,
+ Observer = Rx.Observer,
+ disposableEmpty = Rx.Disposable.empty,
+ disposableCreate = Rx.Disposable.create,
+ inherits = Rx.internals.inherits,
+ addProperties = Rx.internals.addProperties,
+ timeoutScheduler = Rx.Scheduler.timeout,
+ currentThreadScheduler = Rx.Scheduler.currentThread,
+ identity = Rx.helpers.identity,
+ isScheduler = Rx.Scheduler.isScheduler,
+ isFunction = Rx.helpers.isFunction,
+ checkDisposed = Rx.Disposable.checkDisposed;
+
+ var errorObj = {e: {}};
+ var tryCatchTarget;
+ function tryCatcher() {
+ try {
+ return tryCatchTarget.apply(this, arguments);
+ } catch (e) {
+ errorObj.e = e;
+ return errorObj;
+ }
+ }
+ function tryCatch(fn) {
+ if (!isFunction(fn)) { throw new TypeError('fn must be a function'); }
+ tryCatchTarget = fn;
+ return tryCatcher;
+ }
+ function thrower(e) {
+ throw e;
+ }
+
+ /**
+ * Used to pause and resume streams.
+ */
+ Rx.Pauser = (function (__super__) {
+ inherits(Pauser, __super__);
+
+ function Pauser() {
+ __super__.call(this);
+ }
+
+ /**
+ * Pauses the underlying sequence.
+ */
+ Pauser.prototype.pause = function () { this.onNext(false); };
+
+ /**
+ * Resumes the underlying sequence.
+ */
+ Pauser.prototype.resume = function () { this.onNext(true); };
+
+ return Pauser;
+ }(Subject));
+
+ var PausableObservable = (function (__super__) {
+
+ inherits(PausableObservable, __super__);
+
+ function subscribe(observer) {
+ var conn = this.source.publish(),
+ subscription = conn.subscribe(observer),
+ connection = disposableEmpty;
+
+ var pausable = this.pauser.distinctUntilChanged().subscribe(function (b) {
+ if (b) {
+ connection = conn.connect();
+ } else {
+ connection.dispose();
+ connection = disposableEmpty;
+ }
+ });
+
+ return new CompositeDisposable(subscription, connection, pausable);
+ }
+
+ function PausableObservable(source, pauser) {
+ this.source = source;
+ this.controller = new Subject();
+
+ if (pauser && pauser.subscribe) {
+ this.pauser = this.controller.merge(pauser);
+ } else {
+ this.pauser = this.controller;
+ }
+
+ __super__.call(this, subscribe, source);
+ }
+
+ PausableObservable.prototype.pause = function () {
+ this.controller.onNext(false);
+ };
+
+ PausableObservable.prototype.resume = function () {
+ this.controller.onNext(true);
+ };
+
+ return PausableObservable;
+
+ }(Observable));
+
+ /**
+ * Pauses the underlying observable sequence based upon the observable sequence which yields true/false.
+ * @example
+ * var pauser = new Rx.Subject();
+ * var source = Rx.Observable.interval(100).pausable(pauser);
+ * @param {Observable} pauser The observable sequence used to pause the underlying sequence.
+ * @returns {Observable} The observable sequence which is paused based upon the pauser.
+ */
+ observableProto.pausable = function (pauser) {
+ return new PausableObservable(this, pauser);
+ };
+
+ function combineLatestSource(source, subject, resultSelector) {
+ return new AnonymousObservable(function (o) {
+ var hasValue = [false, false],
+ hasValueAll = false,
+ isDone = false,
+ values = new Array(2),
+ err;
+
+ function next(x, i) {
+ values[i] = x
+ hasValue[i] = true;
+ if (hasValueAll || (hasValueAll = hasValue.every(identity))) {
+ if (err) { return o.onError(err); }
+ var res = tryCatch(resultSelector).apply(null, values);
+ if (res === errorObj) { return o.onError(res.e); }
+ o.onNext(res);
+ }
+ isDone && values[1] && o.onCompleted();
+ }
+
+ return new CompositeDisposable(
+ source.subscribe(
+ function (x) {
+ next(x, 0);
+ },
+ function (e) {
+ if (values[1]) {
+ o.onError(e);
+ } else {
+ err = e;
+ }
+ },
+ function () {
+ isDone = true;
+ values[1] && o.onCompleted();
+ }),
+ subject.subscribe(
+ function (x) {
+ next(x, 1);
+ },
+ function (e) { o.onError(e); },
+ function () {
+ isDone = true;
+ next(true, 1);
+ })
+ );
+ }, source);
+ }
+
+ var PausableBufferedObservable = (function (__super__) {
+
+ inherits(PausableBufferedObservable, __super__);
+
+ function subscribe(o) {
+ var q = [], previousShouldFire;
+
+ function drainQueue() { while (q.length > 0) { o.onNext(q.shift()); } }
+
+ var subscription =
+ combineLatestSource(
+ this.source,
+ this.pauser.distinctUntilChanged().startWith(false),
+ function (data, shouldFire) {
+ return { data: data, shouldFire: shouldFire };
+ })
+ .subscribe(
+ function (results) {
+ if (previousShouldFire !== undefined && results.shouldFire != previousShouldFire) {
+ previousShouldFire = results.shouldFire;
+ // change in shouldFire
+ if (results.shouldFire) { drainQueue(); }
+ } else {
+ previousShouldFire = results.shouldFire;
+ // new data
+ if (results.shouldFire) {
+ o.onNext(results.data);
+ } else {
+ q.push(results.data);
+ }
+ }
+ },
+ function (err) {
+ drainQueue();
+ o.onError(err);
+ },
+ function () {
+ drainQueue();
+ o.onCompleted();
+ }
+ );
+ return subscription;
+ }
+
+ function PausableBufferedObservable(source, pauser) {
+ this.source = source;
+ this.controller = new Subject();
+
+ if (pauser && pauser.subscribe) {
+ this.pauser = this.controller.merge(pauser);
+ } else {
+ this.pauser = this.controller;
+ }
+
+ __super__.call(this, subscribe, source);
+ }
+
+ PausableBufferedObservable.prototype.pause = function () {
+ this.controller.onNext(false);
+ };
+
+ PausableBufferedObservable.prototype.resume = function () {
+ this.controller.onNext(true);
+ };
+
+ return PausableBufferedObservable;
+
+ }(Observable));
+
+ /**
+ * Pauses the underlying observable sequence based upon the observable sequence which yields true/false,
+ * and yields the values that were buffered while paused.
+ * @example
+ * var pauser = new Rx.Subject();
+ * var source = Rx.Observable.interval(100).pausableBuffered(pauser);
+ * @param {Observable} pauser The observable sequence used to pause the underlying sequence.
+ * @returns {Observable} The observable sequence which is paused based upon the pauser.
+ */
+ observableProto.pausableBuffered = function (subject) {
+ return new PausableBufferedObservable(this, subject);
+ };
+
+ var ControlledObservable = (function (__super__) {
+
+ inherits(ControlledObservable, __super__);
+
+ function subscribe (observer) {
+ return this.source.subscribe(observer);
+ }
+
+ function ControlledObservable (source, enableQueue, scheduler) {
+ __super__.call(this, subscribe, source);
+ this.subject = new ControlledSubject(enableQueue, scheduler);
+ this.source = source.multicast(this.subject).refCount();
+ }
+
+ ControlledObservable.prototype.request = function (numberOfItems) {
+ return this.subject.request(numberOfItems == null ? -1 : numberOfItems);
+ };
+
+ return ControlledObservable;
+
+ }(Observable));
+
+ var ControlledSubject = (function (__super__) {
+
+ function subscribe (observer) {
+ return this.subject.subscribe(observer);
+ }
+
+ inherits(ControlledSubject, __super__);
+
+ function ControlledSubject(enableQueue, scheduler) {
+ enableQueue == null && (enableQueue = true);
+
+ __super__.call(this, subscribe);
+ this.subject = new Subject();
+ this.enableQueue = enableQueue;
+ this.queue = enableQueue ? [] : null;
+ this.requestedCount = 0;
+ this.requestedDisposable = disposableEmpty;
+ this.error = null;
+ this.hasFailed = false;
+ this.hasCompleted = false;
+ this.scheduler = scheduler || currentThreadScheduler;
+ }
+
+ addProperties(ControlledSubject.prototype, Observer, {
+ onCompleted: function () {
+ this.hasCompleted = true;
+ if (!this.enableQueue || this.queue.length === 0) {
+ this.subject.onCompleted();
+ } else {
+ this.queue.push(Notification.createOnCompleted());
+ }
+ },
+ onError: function (error) {
+ this.hasFailed = true;
+ this.error = error;
+ if (!this.enableQueue || this.queue.length === 0) {
+ this.subject.onError(error);
+ } else {
+ this.queue.push(Notification.createOnError(error));
+ }
+ },
+ onNext: function (value) {
+ var hasRequested = false;
+
+ if (this.requestedCount === 0) {
+ this.enableQueue && this.queue.push(Notification.createOnNext(value));
+ } else {
+ (this.requestedCount !== -1 && this.requestedCount-- === 0) && this.disposeCurrentRequest();
+ hasRequested = true;
+ }
+ hasRequested && this.subject.onNext(value);
+ },
+ _processRequest: function (numberOfItems) {
+ if (this.enableQueue) {
+ while ((this.queue.length >= numberOfItems && numberOfItems > 0) ||
+ (this.queue.length > 0 && this.queue[0].kind !== 'N')) {
+ var first = this.queue.shift();
+ first.accept(this.subject);
+ if (first.kind === 'N') {
+ numberOfItems--;
+ } else {
+ this.disposeCurrentRequest();
+ this.queue = [];
+ }
+ }
+
+ return { numberOfItems : numberOfItems, returnValue: this.queue.length !== 0};
+ }
+
+ return { numberOfItems: numberOfItems, returnValue: false };
+ },
+ request: function (number) {
+ this.disposeCurrentRequest();
+ var self = this;
+
+ this.requestedDisposable = this.scheduler.scheduleWithState(number,
+ function(s, i) {
+ var r = self._processRequest(i), remaining = r.numberOfItems;
+ if (!r.returnValue) {
+ self.requestedCount = remaining;
+ self.requestedDisposable = disposableCreate(function () {
+ self.requestedCount = 0;
+ });
+ }
+ });
+
+ return this.requestedDisposable;
+ },
+ disposeCurrentRequest: function () {
+ this.requestedDisposable.dispose();
+ this.requestedDisposable = disposableEmpty;
+ }
+ });
+
+ return ControlledSubject;
+ }(Observable));
+
+ /**
+ * Attaches a controller to the observable sequence with the ability to queue.
+ * @example
+ * var source = Rx.Observable.interval(100).controlled();
+ * source.request(3); // Reads 3 values
+ * @param {bool} enableQueue truthy value to determine if values should be queued pending the next request
+ * @param {Scheduler} scheduler determines how the requests will be scheduled
+ * @returns {Observable} The observable sequence which only propagates values on request.
+ */
+ observableProto.controlled = function (enableQueue, scheduler) {
+
+ if (enableQueue && isScheduler(enableQueue)) {
+ scheduler = enableQueue;
+ enableQueue = true;
+ }
+
+ if (enableQueue == null) { enableQueue = true; }
+ return new ControlledObservable(this, enableQueue, scheduler);
+ };
+
+ var StopAndWaitObservable = (function (__super__) {
+
+ function subscribe (observer) {
+ this.subscription = this.source.subscribe(new StopAndWaitObserver(observer, this, this.subscription));
+
+ var self = this;
+ timeoutScheduler.schedule(function () { self.source.request(1); });
+
+ return this.subscription;
+ }
+
+ inherits(StopAndWaitObservable, __super__);
+
+ function StopAndWaitObservable (source) {
+ __super__.call(this, subscribe, source);
+ this.source = source;
+ }
+
+ var StopAndWaitObserver = (function (__sub__) {
+
+ inherits(StopAndWaitObserver, __sub__);
+
+ function StopAndWaitObserver (observer, observable, cancel) {
+ __sub__.call(this);
+ this.observer = observer;
+ this.observable = observable;
+ this.cancel = cancel;
+ }
+
+ var stopAndWaitObserverProto = StopAndWaitObserver.prototype;
+
+ stopAndWaitObserverProto.completed = function () {
+ this.observer.onCompleted();
+ this.dispose();
+ };
+
+ stopAndWaitObserverProto.error = function (error) {
+ this.observer.onError(error);
+ this.dispose();
+ }
+
+ stopAndWaitObserverProto.next = function (value) {
+ this.observer.onNext(value);
+
+ var self = this;
+ timeoutScheduler.schedule(function () {
+ self.observable.source.request(1);
+ });
+ };
+
+ stopAndWaitObserverProto.dispose = function () {
+ this.observer = null;
+ if (this.cancel) {
+ this.cancel.dispose();
+ this.cancel = null;
+ }
+ __sub__.prototype.dispose.call(this);
+ };
+
+ return StopAndWaitObserver;
+ }(AbstractObserver));
+
+ return StopAndWaitObservable;
+ }(Observable));
+
+
+ /**
+ * Attaches a stop and wait observable to the current observable.
+ * @returns {Observable} A stop and wait observable.
+ */
+ ControlledObservable.prototype.stopAndWait = function () {
+ return new StopAndWaitObservable(this);
+ };
+
+ var WindowedObservable = (function (__super__) {
+
+ function subscribe (observer) {
+ this.subscription = this.source.subscribe(new WindowedObserver(observer, this, this.subscription));
+
+ var self = this;
+ timeoutScheduler.schedule(function () {
+ self.source.request(self.windowSize);
+ });
+
+ return this.subscription;
+ }
+
+ inherits(WindowedObservable, __super__);
+
+ function WindowedObservable(source, windowSize) {
+ __super__.call(this, subscribe, source);
+ this.source = source;
+ this.windowSize = windowSize;
+ }
+
+ var WindowedObserver = (function (__sub__) {
+
+ inherits(WindowedObserver, __sub__);
+
+ function WindowedObserver(observer, observable, cancel) {
+ this.observer = observer;
+ this.observable = observable;
+ this.cancel = cancel;
+ this.received = 0;
+ }
+
+ var windowedObserverPrototype = WindowedObserver.prototype;
+
+ windowedObserverPrototype.completed = function () {
+ this.observer.onCompleted();
+ this.dispose();
+ };
+
+ windowedObserverPrototype.error = function (error) {
+ this.observer.onError(error);
+ this.dispose();
+ };
+
+ windowedObserverPrototype.next = function (value) {
+ this.observer.onNext(value);
+
+ this.received = ++this.received % this.observable.windowSize;
+ if (this.received === 0) {
+ var self = this;
+ timeoutScheduler.schedule(function () {
+ self.observable.source.request(self.observable.windowSize);
+ });
+ }
+ };
+
+ windowedObserverPrototype.dispose = function () {
+ this.observer = null;
+ if (this.cancel) {
+ this.cancel.dispose();
+ this.cancel = null;
+ }
+ __sub__.prototype.dispose.call(this);
+ };
+
+ return WindowedObserver;
+ }(AbstractObserver));
+
+ return WindowedObservable;
+ }(Observable));
+
+ /**
+ * Creates a sliding windowed observable based upon the window size.
+ * @param {Number} windowSize The number of items in the window
+ * @returns {Observable} A windowed observable based upon the window size.
+ */
+ ControlledObservable.prototype.windowed = function (windowSize) {
+ return new WindowedObservable(this, windowSize);
+ };
+
+ return Rx;
+}));
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.backpressure.map b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.backpressure.map
new file mode 100644
index 00000000000..3d9269c3221
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.backpressure.map
@@ -0,0 +1 @@
+{"version":3,"file":"rx.backpressure.min.js","sources":["rx.backpressure.js"],"names":["factory","objectTypes","boolean","function","object","number","string","undefined","root","window","this","freeExports","exports","nodeType","freeModule","module","freeGlobal","global","define","amd","Rx","require","call","exp","tryCatcher","tryCatchTarget","apply","arguments","e","errorObj","tryCatch","fn","isFunction","TypeError","combineLatestSource","source","subject","resultSelector","AnonymousObservable","o","next","x","i","values","hasValue","hasValueAll","every","identity","err","onError","res","onNext","isDone","onCompleted","Array","CompositeDisposable","subscribe","Observable","observableProto","prototype","AbstractObserver","internals","Notification","Subject","Observer","disposableEmpty","Disposable","empty","disposableCreate","create","inherits","addProperties","timeoutScheduler","Scheduler","timeout","currentThreadScheduler","currentThread","helpers","isScheduler","checkDisposed","Pauser","__super__","pause","resume","PausableObservable","observer","conn","publish","subscription","connection","pausable","pauser","distinctUntilChanged","b","connect","dispose","controller","merge","PausableBufferedObservable","drainQueue","q","length","shift","previousShouldFire","startWith","data","shouldFire","results","push","pausableBuffered","ControlledObservable","enableQueue","scheduler","ControlledSubject","multicast","refCount","request","numberOfItems","queue","requestedCount","requestedDisposable","error","hasFailed","hasCompleted","createOnCompleted","createOnError","value","hasRequested","createOnNext","disposeCurrentRequest","_processRequest","kind","first","accept","returnValue","self","scheduleWithState","s","r","remaining","controlled","StopAndWaitObservable","StopAndWaitObserver","schedule","__sub__","observable","cancel","stopAndWaitObserverProto","completed","stopAndWait","WindowedObservable","W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GAA0BN,UAAY,WACpC1I,KAAK2E,SAAShC,cACd3C,KAAKqF,WAGP2D,EAA0BjC,MAAQ,SAAUA,GAC1C/G,KAAK2E,SAASpC,QAAQwE,GACtB/G,KAAKqF,WAGP2D,EAA0BlH,KAAO,SAAUsF,GAIzC,GAHApH,KAAK2E,SAASlC,OAAO2E,GAErBpH,KAAK+I,WAAa/I,KAAK+I,SAAW/I,KAAKuI,WAAWO,WAC5B,IAAlB9I,KAAK+I,SAAgB,CACvB,GAAIlB,GAAO7H,IACX8D,GAAiBuE,SAAS,WACxBR,EAAKU,WAAW9G,OAAOiF,QAAQmB,EAAKU,WAAWO,gBAKrDE,EAA0B3D,QAAU,WAClCrF,KAAK2E,SAAW,KACZ3E,KAAKwI,SACPxI,KAAKwI,OAAOnD,UACZrF,KAAKwI,OAAS,MAEhBF,EAAQrF,UAAUoC,QAAQzE,KAAKZ,OAG1B6I,GACP3F,EAEF,OAAO0F,IACP7F,EAWA,OAJFqD,GAAqBnD,UAAUgG,SAAW,SAAUH,GAClD,MAAO,IAAIF,GAAmB5I,KAAM8I,IAG7BpI"} \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.backpressure.min.js b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.backpressure.min.js
new file mode 100644
index 00000000000..8efd4c872e2
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.backpressure.min.js
@@ -0,0 +1,3 @@
+/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
+(function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx"],function(b,d){return a(c,d,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){function e(){try{return h.apply(this,arguments)}catch(a){return z.e=a,z}}function f(a){if(!y(a))throw new TypeError("fn must be a function");return h=a,e}function g(a,b,c){return new k(function(d){function e(a,b){if(k[b]=a,h[b]=!0,i||(i=h.every(w))){if(g)return d.onError(g);var e=f(c).apply(null,k);if(e===z)return d.onError(e.e);d.onNext(e)}j&&k[1]&&d.onCompleted()}var g,h=[!1,!1],i=!1,j=!1,k=new Array(2);return new m(a.subscribe(function(a){e(a,0)},function(a){k[1]?d.onError(a):g=a},function(){j=!0,k[1]&&d.onCompleted()}),b.subscribe(function(a){e(a,1)},function(a){d.onError(a)},function(){j=!0,e(!0,1)}))},a)}var h,i=c.Observable,j=i.prototype,k=c.AnonymousObservable,l=c.internals.AbstractObserver,m=c.CompositeDisposable,n=c.Notification,o=c.Subject,p=c.Observer,q=c.Disposable.empty,r=c.Disposable.create,s=c.internals.inherits,t=c.internals.addProperties,u=c.Scheduler.timeout,v=c.Scheduler.currentThread,w=c.helpers.identity,x=c.Scheduler.isScheduler,y=c.helpers.isFunction,z=(c.Disposable.checkDisposed,{e:{}});c.Pauser=function(a){function b(){a.call(this)}return s(b,a),b.prototype.pause=function(){this.onNext(!1)},b.prototype.resume=function(){this.onNext(!0)},b}(o);var A=function(a){function b(a){var b=this.source.publish(),c=b.subscribe(a),d=q,e=this.pauser.distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=q)});return new m(c,d,e)}function c(c,d){this.source=c,this.controller=new o,d&&d.subscribe?this.pauser=this.controller.merge(d):this.pauser=this.controller,a.call(this,b,c)}return s(c,a),c.prototype.pause=function(){this.controller.onNext(!1)},c.prototype.resume=function(){this.controller.onNext(!0)},c}(i);j.pausable=function(a){return new A(this,a)};var B=function(a){function b(a){function b(){for(;e.length>0;)a.onNext(e.shift())}var c,e=[],f=g(this.source,this.pauser.distinctUntilChanged().startWith(!1),function(a,b){return{data:a,shouldFire:b}}).subscribe(function(f){c!==d&&f.shouldFire!=c?(c=f.shouldFire,f.shouldFire&&b()):(c=f.shouldFire,f.shouldFire?a.onNext(f.data):e.push(f.data))},function(c){b(),a.onError(c)},function(){b(),a.onCompleted()});return f}function c(c,d){this.source=c,this.controller=new o,d&&d.subscribe?this.pauser=this.controller.merge(d):this.pauser=this.controller,a.call(this,b,c)}return s(c,a),c.prototype.pause=function(){this.controller.onNext(!1)},c.prototype.resume=function(){this.controller.onNext(!0)},c}(i);j.pausableBuffered=function(a){return new B(this,a)};var C=function(a){function b(a){return this.source.subscribe(a)}function c(c,d,e){a.call(this,b,c),this.subject=new D(d,e),this.source=c.multicast(this.subject).refCount()}return s(c,a),c.prototype.request=function(a){return this.subject.request(null==a?-1:a)},c}(i),D=function(a){function b(a){return this.subject.subscribe(a)}function c(c,d){null==c&&(c=!0),a.call(this,b),this.subject=new o,this.enableQueue=c,this.queue=c?[]:null,this.requestedCount=0,this.requestedDisposable=q,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.scheduler=d||v}return s(c,a),t(c.prototype,p,{onCompleted:function(){this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length?this.queue.push(n.createOnCompleted()):this.subject.onCompleted()},onError:function(a){this.hasFailed=!0,this.error=a,this.enableQueue&&0!==this.queue.length?this.queue.push(n.createOnError(a)):this.subject.onError(a)},onNext:function(a){var b=!1;0===this.requestedCount?this.enableQueue&&this.queue.push(n.createOnNext(a)):(-1!==this.requestedCount&&0===this.requestedCount--&&this.disposeCurrentRequest(),b=!0),b&&this.subject.onNext(a)},_processRequest:function(a){if(this.enableQueue){for(;this.queue.length>=a&&a>0||this.queue.length>0&&"N"!==this.queue[0].kind;){var b=this.queue.shift();b.accept(this.subject),"N"===b.kind?a--:(this.disposeCurrentRequest(),this.queue=[])}return{numberOfItems:a,returnValue:0!==this.queue.length}}return{numberOfItems:a,returnValue:!1}},request:function(a){this.disposeCurrentRequest();var b=this;return this.requestedDisposable=this.scheduler.scheduleWithState(a,function(a,c){var d=b._processRequest(c),e=d.numberOfItems;d.returnValue||(b.requestedCount=e,b.requestedDisposable=r(function(){b.requestedCount=0}))}),this.requestedDisposable},disposeCurrentRequest:function(){this.requestedDisposable.dispose(),this.requestedDisposable=q}}),c}(i);j.controlled=function(a,b){return a&&x(a)&&(b=a,a=!0),null==a&&(a=!0),new C(this,a,b)};var E=function(a){function b(a){this.subscription=this.source.subscribe(new d(a,this,this.subscription));var b=this;return u.schedule(function(){b.source.request(1)}),this.subscription}function c(c){a.call(this,b,c),this.source=c}s(c,a);var d=function(a){function b(b,c,d){a.call(this),this.observer=b,this.observable=c,this.cancel=d}s(b,a);var c=b.prototype;return c.completed=function(){this.observer.onCompleted(),this.dispose()},c.error=function(a){this.observer.onError(a),this.dispose()},c.next=function(a){this.observer.onNext(a);var b=this;u.schedule(function(){b.observable.source.request(1)})},c.dispose=function(){this.observer=null,this.cancel&&(this.cancel.dispose(),this.cancel=null),a.prototype.dispose.call(this)},b}(l);return c}(i);C.prototype.stopAndWait=function(){return new E(this)};var F=function(a){function b(a){this.subscription=this.source.subscribe(new d(a,this,this.subscription));var b=this;return u.schedule(function(){b.source.request(b.windowSize)}),this.subscription}function c(c,d){a.call(this,b,c),this.source=c,this.windowSize=d}s(c,a);var d=function(a){function b(a,b,c){this.observer=a,this.observable=b,this.cancel=c,this.received=0}s(b,a);var c=b.prototype;return c.completed=function(){this.observer.onCompleted(),this.dispose()},c.error=function(a){this.observer.onError(a),this.dispose()},c.next=function(a){if(this.observer.onNext(a),this.received=++this.received%this.observable.windowSize,0===this.received){var b=this;u.schedule(function(){b.observable.source.request(b.observable.windowSize)})}},c.dispose=function(){this.observer=null,this.cancel&&(this.cancel.dispose(),this.cancel=null),a.prototype.dispose.call(this)},b}(l);return c}(i);return C.prototype.windowed=function(a){return new F(this,a)},c});
+//# sourceMappingURL=rx.backpressure.map \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.binding.js b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.binding.js
new file mode 100644
index 00000000000..c0165590847
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.binding.js
@@ -0,0 +1,519 @@
+// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
+
+;(function (factory) {
+ var objectTypes = {
+ 'boolean': false,
+ 'function': true,
+ 'object': true,
+ 'number': false,
+ 'string': false,
+ 'undefined': false
+ };
+
+ var root = (objectTypes[typeof window] && window) || this,
+ freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
+ freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
+ moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
+ freeGlobal = objectTypes[typeof global] && global;
+
+ if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) {
+ root = freeGlobal;
+ }
+
+ // Because of build optimizers
+ if (typeof define === 'function' && define.amd) {
+ define(['rx'], function (Rx, exports) {
+ return factory(root, exports, Rx);
+ });
+ } else if (typeof module === 'object' && module && module.exports === freeExports) {
+ module.exports = factory(root, module.exports, require('./rx'));
+ } else {
+ root.Rx = factory(root, {}, root.Rx);
+ }
+}.call(this, function (root, exp, Rx, undefined) {
+
+ var Observable = Rx.Observable,
+ observableProto = Observable.prototype,
+ AnonymousObservable = Rx.AnonymousObservable,
+ Subject = Rx.Subject,
+ AsyncSubject = Rx.AsyncSubject,
+ Observer = Rx.Observer,
+ ScheduledObserver = Rx.internals.ScheduledObserver,
+ disposableCreate = Rx.Disposable.create,
+ disposableEmpty = Rx.Disposable.empty,
+ CompositeDisposable = Rx.CompositeDisposable,
+ currentThreadScheduler = Rx.Scheduler.currentThread,
+ isFunction = Rx.helpers.isFunction,
+ inherits = Rx.internals.inherits,
+ addProperties = Rx.internals.addProperties,
+ checkDisposed = Rx.Disposable.checkDisposed;
+
+ // Utilities
+ function cloneArray(arr) {
+ var len = arr.length, a = new Array(len);
+ for(var i = 0; i < len; i++) { a[i] = arr[i]; }
+ return a;
+ }
+
+ /**
+ * Multicasts the source sequence notifications through an instantiated subject into all uses of the sequence within a selector function. Each
+ * subscription to the resulting sequence causes a separate multicast invocation, exposing the sequence resulting from the selector function's
+ * invocation. For specializations with fixed subject types, see Publish, PublishLast, and Replay.
+ *
+ * @example
+ * 1 - res = source.multicast(observable);
+ * 2 - res = source.multicast(function () { return new Subject(); }, function (x) { return x; });
+ *
+ * @param {Function|Subject} subjectOrSubjectSelector
+ * Factory function to create an intermediate subject through which the source sequence's elements will be multicast to the selector function.
+ * Or:
+ * Subject to push source elements into.
+ *
+ * @param {Function} [selector] Optional selector function which can use the multicasted source sequence subject to the policies enforced by the created subject. Specified only if <paramref name="subjectOrSubjectSelector" is a factory function.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
+ */
+ observableProto.multicast = function (subjectOrSubjectSelector, selector) {
+ var source = this;
+ return typeof subjectOrSubjectSelector === 'function' ?
+ new AnonymousObservable(function (observer) {
+ var connectable = source.multicast(subjectOrSubjectSelector());
+ return new CompositeDisposable(selector(connectable).subscribe(observer), connectable.connect());
+ }, source) :
+ new ConnectableObservable(source, subjectOrSubjectSelector);
+ };
+
+ /**
+ * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence.
+ * This operator is a specialization of Multicast using a regular Subject.
+ *
+ * @example
+ * var resres = source.publish();
+ * var res = source.publish(function (x) { return x; });
+ *
+ * @param {Function} [selector] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all notifications of the source from the time of the subscription on.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
+ */
+ observableProto.publish = function (selector) {
+ return selector && isFunction(selector) ?
+ this.multicast(function () { return new Subject(); }, selector) :
+ this.multicast(new Subject());
+ };
+
+ /**
+ * Returns an observable sequence that shares a single subscription to the underlying sequence.
+ * This operator is a specialization of publish which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence.
+ */
+ observableProto.share = function () {
+ return this.publish().refCount();
+ };
+
+ /**
+ * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence containing only the last notification.
+ * This operator is a specialization of Multicast using a AsyncSubject.
+ *
+ * @example
+ * var res = source.publishLast();
+ * var res = source.publishLast(function (x) { return x; });
+ *
+ * @param selector [Optional] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will only receive the last notification of the source.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
+ */
+ observableProto.publishLast = function (selector) {
+ return selector && isFunction(selector) ?
+ this.multicast(function () { return new AsyncSubject(); }, selector) :
+ this.multicast(new AsyncSubject());
+ };
+
+ /**
+ * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence and starts with initialValue.
+ * This operator is a specialization of Multicast using a BehaviorSubject.
+ *
+ * @example
+ * var res = source.publishValue(42);
+ * var res = source.publishValue(function (x) { return x.select(function (y) { return y * y; }) }, 42);
+ *
+ * @param {Function} [selector] Optional selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive immediately receive the initial value, followed by all notifications of the source from the time of the subscription on.
+ * @param {Mixed} initialValue Initial value received by observers upon subscription.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
+ */
+ observableProto.publishValue = function (initialValueOrSelector, initialValue) {
+ return arguments.length === 2 ?
+ this.multicast(function () {
+ return new BehaviorSubject(initialValue);
+ }, initialValueOrSelector) :
+ this.multicast(new BehaviorSubject(initialValueOrSelector));
+ };
+
+ /**
+ * Returns an observable sequence that shares a single subscription to the underlying sequence and starts with an initialValue.
+ * This operator is a specialization of publishValue which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed.
+ * @param {Mixed} initialValue Initial value received by observers upon subscription.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence.
+ */
+ observableProto.shareValue = function (initialValue) {
+ return this.publishValue(initialValue).refCount();
+ };
+
+ /**
+ * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length for the replay buffer.
+ * This operator is a specialization of Multicast using a ReplaySubject.
+ *
+ * @example
+ * var res = source.replay(null, 3);
+ * var res = source.replay(null, 3, 500);
+ * var res = source.replay(null, 3, 500, scheduler);
+ * var res = source.replay(function (x) { return x.take(6).repeat(); }, 3, 500, scheduler);
+ *
+ * @param selector [Optional] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all the notifications of the source subject to the specified replay buffer trimming policy.
+ * @param bufferSize [Optional] Maximum element count of the replay buffer.
+ * @param windowSize [Optional] Maximum time length of the replay buffer.
+ * @param scheduler [Optional] Scheduler where connected observers within the selector function will be invoked on.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
+ */
+ observableProto.replay = function (selector, bufferSize, windowSize, scheduler) {
+ return selector && isFunction(selector) ?
+ this.multicast(function () { return new ReplaySubject(bufferSize, windowSize, scheduler); }, selector) :
+ this.multicast(new ReplaySubject(bufferSize, windowSize, scheduler));
+ };
+
+ /**
+ * Returns an observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length for the replay buffer.
+ * This operator is a specialization of replay which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed.
+ *
+ * @example
+ * var res = source.shareReplay(3);
+ * var res = source.shareReplay(3, 500);
+ * var res = source.shareReplay(3, 500, scheduler);
+ *
+
+ * @param bufferSize [Optional] Maximum element count of the replay buffer.
+ * @param window [Optional] Maximum time length of the replay buffer.
+ * @param scheduler [Optional] Scheduler where connected observers within the selector function will be invoked on.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence.
+ */
+ observableProto.shareReplay = function (bufferSize, windowSize, scheduler) {
+ return this.replay(null, bufferSize, windowSize, scheduler).refCount();
+ };
+
+ var InnerSubscription = function (subject, observer) {
+ this.subject = subject;
+ this.observer = observer;
+ };
+
+ InnerSubscription.prototype.dispose = function () {
+ if (!this.subject.isDisposed && this.observer !== null) {
+ var idx = this.subject.observers.indexOf(this.observer);
+ this.subject.observers.splice(idx, 1);
+ this.observer = null;
+ }
+ };
+
+ /**
+ * Represents a value that changes over time.
+ * Observers can subscribe to the subject to receive the last (or initial) value and all subsequent notifications.
+ */
+ var BehaviorSubject = Rx.BehaviorSubject = (function (__super__) {
+ function subscribe(observer) {
+ checkDisposed(this);
+ if (!this.isStopped) {
+ this.observers.push(observer);
+ observer.onNext(this.value);
+ return new InnerSubscription(this, observer);
+ }
+ if (this.hasError) {
+ observer.onError(this.error);
+ } else {
+ observer.onCompleted();
+ }
+ return disposableEmpty;
+ }
+
+ inherits(BehaviorSubject, __super__);
+
+ /**
+ * Initializes a new instance of the BehaviorSubject class which creates a subject that caches its last value and starts with the specified value.
+ * @param {Mixed} value Initial value sent to observers when no other value has been received by the subject yet.
+ */
+ function BehaviorSubject(value) {
+ __super__.call(this, subscribe);
+ this.value = value,
+ this.observers = [],
+ this.isDisposed = false,
+ this.isStopped = false,
+ this.hasError = false;
+ }
+
+ addProperties(BehaviorSubject.prototype, Observer, {
+ /**
+ * Gets the current value or throws an exception.
+ * Value is frozen after onCompleted is called.
+ * After onError is called always throws the specified exception.
+ * An exception is always thrown after dispose is called.
+ * @returns {Mixed} The initial value passed to the constructor until onNext is called; after which, the last value passed to onNext.
+ */
+ getValue: function () {
+ checkDisposed(this);
+ if (this.hasError) {
+ throw this.error;
+ }
+ return this.value;
+ },
+ /**
+ * Indicates whether the subject has observers subscribed to it.
+ * @returns {Boolean} Indicates whether the subject has observers subscribed to it.
+ */
+ hasObservers: function () { return this.observers.length > 0; },
+ /**
+ * Notifies all subscribed observers about the end of the sequence.
+ */
+ onCompleted: function () {
+ checkDisposed(this);
+ if (this.isStopped) { return; }
+ this.isStopped = true;
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ os[i].onCompleted();
+ }
+
+ this.observers.length = 0;
+ },
+ /**
+ * Notifies all subscribed observers about the exception.
+ * @param {Mixed} error The exception to send to all observers.
+ */
+ onError: function (error) {
+ checkDisposed(this);
+ if (this.isStopped) { return; }
+ this.isStopped = true;
+ this.hasError = true;
+ this.error = error;
+
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ os[i].onError(error);
+ }
+
+ this.observers.length = 0;
+ },
+ /**
+ * Notifies all subscribed observers about the arrival of the specified element in the sequence.
+ * @param {Mixed} value The value to send to all observers.
+ */
+ onNext: function (value) {
+ checkDisposed(this);
+ if (this.isStopped) { return; }
+ this.value = value;
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ os[i].onNext(value);
+ }
+ },
+ /**
+ * Unsubscribe all observers and release resources.
+ */
+ dispose: function () {
+ this.isDisposed = true;
+ this.observers = null;
+ this.value = null;
+ this.exception = null;
+ }
+ });
+
+ return BehaviorSubject;
+ }(Observable));
+
+ /**
+ * Represents an object that is both an observable sequence as well as an observer.
+ * Each notification is broadcasted to all subscribed and future observers, subject to buffer trimming policies.
+ */
+ var ReplaySubject = Rx.ReplaySubject = (function (__super__) {
+
+ var maxSafeInteger = Math.pow(2, 53) - 1;
+
+ function createRemovableDisposable(subject, observer) {
+ return disposableCreate(function () {
+ observer.dispose();
+ !subject.isDisposed && subject.observers.splice(subject.observers.indexOf(observer), 1);
+ });
+ }
+
+ function subscribe(observer) {
+ var so = new ScheduledObserver(this.scheduler, observer),
+ subscription = createRemovableDisposable(this, so);
+ checkDisposed(this);
+ this._trim(this.scheduler.now());
+ this.observers.push(so);
+
+ for (var i = 0, len = this.q.length; i < len; i++) {
+ so.onNext(this.q[i].value);
+ }
+
+ if (this.hasError) {
+ so.onError(this.error);
+ } else if (this.isStopped) {
+ so.onCompleted();
+ }
+
+ so.ensureActive();
+ return subscription;
+ }
+
+ inherits(ReplaySubject, __super__);
+
+ /**
+ * Initializes a new instance of the ReplaySubject class with the specified buffer size, window size and scheduler.
+ * @param {Number} [bufferSize] Maximum element count of the replay buffer.
+ * @param {Number} [windowSize] Maximum time length of the replay buffer.
+ * @param {Scheduler} [scheduler] Scheduler the observers are invoked on.
+ */
+ function ReplaySubject(bufferSize, windowSize, scheduler) {
+ this.bufferSize = bufferSize == null ? maxSafeInteger : bufferSize;
+ this.windowSize = windowSize == null ? maxSafeInteger : windowSize;
+ this.scheduler = scheduler || currentThreadScheduler;
+ this.q = [];
+ this.observers = [];
+ this.isStopped = false;
+ this.isDisposed = false;
+ this.hasError = false;
+ this.error = null;
+ __super__.call(this, subscribe);
+ }
+
+ addProperties(ReplaySubject.prototype, Observer.prototype, {
+ /**
+ * Indicates whether the subject has observers subscribed to it.
+ * @returns {Boolean} Indicates whether the subject has observers subscribed to it.
+ */
+ hasObservers: function () {
+ return this.observers.length > 0;
+ },
+ _trim: function (now) {
+ while (this.q.length > this.bufferSize) {
+ this.q.shift();
+ }
+ while (this.q.length > 0 && (now - this.q[0].interval) > this.windowSize) {
+ this.q.shift();
+ }
+ },
+ /**
+ * Notifies all subscribed observers about the arrival of the specified element in the sequence.
+ * @param {Mixed} value The value to send to all observers.
+ */
+ onNext: function (value) {
+ checkDisposed(this);
+ if (this.isStopped) { return; }
+ var now = this.scheduler.now();
+ this.q.push({ interval: now, value: value });
+ this._trim(now);
+
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ var observer = os[i];
+ observer.onNext(value);
+ observer.ensureActive();
+ }
+ },
+ /**
+ * Notifies all subscribed observers about the exception.
+ * @param {Mixed} error The exception to send to all observers.
+ */
+ onError: function (error) {
+ checkDisposed(this);
+ if (this.isStopped) { return; }
+ this.isStopped = true;
+ this.error = error;
+ this.hasError = true;
+ var now = this.scheduler.now();
+ this._trim(now);
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ var observer = os[i];
+ observer.onError(error);
+ observer.ensureActive();
+ }
+ this.observers.length = 0;
+ },
+ /**
+ * Notifies all subscribed observers about the end of the sequence.
+ */
+ onCompleted: function () {
+ checkDisposed(this);
+ if (this.isStopped) { return; }
+ this.isStopped = true;
+ var now = this.scheduler.now();
+ this._trim(now);
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ var observer = os[i];
+ observer.onCompleted();
+ observer.ensureActive();
+ }
+ this.observers.length = 0;
+ },
+ /**
+ * Unsubscribe all observers and release resources.
+ */
+ dispose: function () {
+ this.isDisposed = true;
+ this.observers = null;
+ }
+ });
+
+ return ReplaySubject;
+ }(Observable));
+
+ var ConnectableObservable = Rx.ConnectableObservable = (function (__super__) {
+ inherits(ConnectableObservable, __super__);
+
+ function ConnectableObservable(source, subject) {
+ var hasSubscription = false,
+ subscription,
+ sourceObservable = source.asObservable();
+
+ this.connect = function () {
+ if (!hasSubscription) {
+ hasSubscription = true;
+ subscription = new CompositeDisposable(sourceObservable.subscribe(subject), disposableCreate(function () {
+ hasSubscription = false;
+ }));
+ }
+ return subscription;
+ };
+
+ __super__.call(this, function (o) { return subject.subscribe(o); });
+ }
+
+ ConnectableObservable.prototype.refCount = function () {
+ var connectableSubscription, count = 0, source = this;
+ return new AnonymousObservable(function (observer) {
+ var shouldConnect = ++count === 1,
+ subscription = source.subscribe(observer);
+ shouldConnect && (connectableSubscription = source.connect());
+ return function () {
+ subscription.dispose();
+ --count === 0 && connectableSubscription.dispose();
+ };
+ });
+ };
+
+ return ConnectableObservable;
+ }(Observable));
+
+ /**
+ * Returns an observable sequence that shares a single subscription to the underlying sequence. This observable sequence
+ * can be resubscribed to, even if all prior subscriptions have ended. (unlike `.publish().refCount()`)
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source.
+ */
+ observableProto.singleInstance = function() {
+ var source = this, hasObservable = false, observable;
+
+ function getObservable() {
+ if (!hasObservable) {
+ hasObservable = true;
+ observable = source.finally(function() { hasObservable = false; }).publish().refCount();
+ }
+ return observable;
+ };
+
+ return new AnonymousObservable(function(o) {
+ return getObservable().subscribe(o);
+ });
+ };
+
+ return Rx;
+}));
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.binding.map b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.binding.map
new file mode 100644
index 00000000000..8d9d193e567
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.binding.map
@@ -0,0 +1 @@
+{"version":3,"file":"rx.binding.min.js","sources":["rx.binding.js"],"names":["factory","objectTypes","boolean","function","object","number","string","undefined","root","window","this","freeExports","exports","nodeType","freeModule","module","freeGlobal","global","define","amd","Rx","require","call","exp","cloneArray","arr","len","length","a","Array","i","Observable","observableProto","prototype","AnonymousObservable","Subject","AsyncSubject","Observer","ScheduledObserver","internals","disposableCreate","Disposable","create","disposableEmpty","empty","CompositeDisposable","currentThreadScheduler","Scheduler","currentThread","isFunction","helpers","inherits","addProperties","checkDisposed","multicast","subjectOrSubjectSelector","selector","source","observer","connectable","subscribe","connect","ConnectableObservable","publish","share","refCount","publishLast","publishValue","initialValueOrSelector","initialValue","arguments","BehaviorSubject","shareValue","replay","bufferSize","windowSize","scheduler","ReplaySubject","shareReplay","InnerSubscription","subject","dispose","isDisposed","idx","observers","indexOf","splice","__super__","isStopped","hasError","onError","error","onCompleted","push","onNext","value","getValue","hasObservers","os","exception","createRemovableDisposable","so","subscription","_trim","now","q","ensureActive","maxSafeInteger","Math","pow","shift","interval","hasSubscription","sourceObservable","asObservable","o","connectableSubscription","count","shouldConnect","singleInstance","getObservable","hasObservable","observable"],"mappings":";CAEE,SAAUA,GACR,GAAIC,IACAC,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D,EAAwBnC,cAK1CnB,GACP/B,EAuBA,OAhBFC,GAAgBuF,eAAiB,WAG/B,QAASC,KAKP,MAJKC,KACHA,GAAgB,EAChBC,EAAajE,EAAAA,WAAe,WAAagE,GAAgB,IAAU1D,UAAUE,YAExEyD,EAPT,GAA0CA,GAAtCjE,EAAS/C,KAAM+G,GAAgB,CAUnC,OAAO,IAAIvF,GAAoB,SAASiF,GACtC,MAAOK,KAAgB5D,UAAUuD,MAI5B/F"} \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.binding.min.js b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.binding.min.js
new file mode 100644
index 00000000000..20f4f087244
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.binding.min.js
@@ -0,0 +1,3 @@
+/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
+(function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx"],function(b,d){return a(c,d,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){function e(a){for(var b=a.length,c=new Array(b),d=0;b>d;d++)c[d]=a[d];return c}var f=c.Observable,g=f.prototype,h=c.AnonymousObservable,i=c.Subject,j=c.AsyncSubject,k=c.Observer,l=c.internals.ScheduledObserver,m=c.Disposable.create,n=c.Disposable.empty,o=c.CompositeDisposable,p=c.Scheduler.currentThread,q=c.helpers.isFunction,r=c.internals.inherits,s=c.internals.addProperties,t=c.Disposable.checkDisposed;g.multicast=function(a,b){var c=this;return"function"==typeof a?new h(function(d){var e=c.multicast(a());return new o(b(e).subscribe(d),e.connect())},c):new x(c,a)},g.publish=function(a){return a&&q(a)?this.multicast(function(){return new i},a):this.multicast(new i)},g.share=function(){return this.publish().refCount()},g.publishLast=function(a){return a&&q(a)?this.multicast(function(){return new j},a):this.multicast(new j)},g.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new v(b)},a):this.multicast(new v(a))},g.shareValue=function(a){return this.publishValue(a).refCount()},g.replay=function(a,b,c,d){return a&&q(a)?this.multicast(function(){return new w(b,c,d)},a):this.multicast(new w(b,c,d))},g.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};var u=function(a,b){this.subject=a,this.observer=b};u.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var v=c.BehaviorSubject=function(a){function b(a){return t(this),this.isStopped?(this.hasError?a.onError(this.error):a.onCompleted(),n):(this.observers.push(a),a.onNext(this.value),new u(this,a))}function c(c){a.call(this,b),this.value=c,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.hasError=!1}return r(c,a),s(c.prototype,k,{getValue:function(){if(t(this),this.hasError)throw this.error;return this.value},hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(t(this),!this.isStopped){this.isStopped=!0;for(var a=0,b=e(this.observers),c=b.length;c>a;a++)b[a].onCompleted();this.observers.length=0}},onError:function(a){if(t(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var b=0,c=e(this.observers),d=c.length;d>b;b++)c[b].onError(a);this.observers.length=0}},onNext:function(a){if(t(this),!this.isStopped){this.value=a;for(var b=0,c=e(this.observers),d=c.length;d>b;b++)c[b].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.exception=null}}),c}(f),w=c.ReplaySubject=function(a){function b(a,b){return m(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function c(a){var c=new l(this.scheduler,a),d=b(this,c);t(this),this._trim(this.scheduler.now()),this.observers.push(c);for(var e=0,f=this.q.length;f>e;e++)c.onNext(this.q[e].value);return this.hasError?c.onError(this.error):this.isStopped&&c.onCompleted(),c.ensureActive(),d}function d(b,d,e){this.bufferSize=null==b?f:b,this.windowSize=null==d?f:d,this.scheduler=e||p,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this,c)}var f=Math.pow(2,53)-1;return r(d,a),s(d.prototype,k.prototype,{hasObservers:function(){return this.observers.length>0},_trim:function(a){for(;this.q.length>this.bufferSize;)this.q.shift();for(;this.q.length>0&&a-this.q[0].interval>this.windowSize;)this.q.shift()},onNext:function(a){if(t(this),!this.isStopped){var b=this.scheduler.now();this.q.push({interval:b,value:a}),this._trim(b);for(var c=0,d=e(this.observers),f=d.length;f>c;c++){var g=d[c];g.onNext(a),g.ensureActive()}}},onError:function(a){if(t(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var b=this.scheduler.now();this._trim(b);for(var c=0,d=e(this.observers),f=d.length;f>c;c++){var g=d[c];g.onError(a),g.ensureActive()}this.observers.length=0}},onCompleted:function(){if(t(this),!this.isStopped){this.isStopped=!0;var a=this.scheduler.now();this._trim(a);for(var b=0,c=e(this.observers),d=c.length;d>b;b++){var f=c[b];f.onCompleted(),f.ensureActive()}this.observers.length=0}},dispose:function(){this.isDisposed=!0,this.observers=null}}),d}(f),x=c.ConnectableObservable=function(a){function b(b,c){var d,e=!1,f=b.asObservable();this.connect=function(){return e||(e=!0,d=new o(f.subscribe(c),m(function(){e=!1}))),d},a.call(this,function(a){return c.subscribe(a)})}return r(b,a),b.prototype.refCount=function(){var a,b=0,c=this;return new h(function(d){var e=1===++b,f=c.subscribe(d);return e&&(a=c.connect()),function(){f.dispose(),0===--b&&a.dispose()}})},b}(f);return g.singleInstance=function(){function a(){return d||(d=!0,b=c["finally"](function(){d=!1}).publish().refCount()),b}var b,c=this,d=!1;return new h(function(b){return a().subscribe(b)})},c});
+//# sourceMappingURL=rx.binding.map \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.coincidence.js b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.coincidence.js
new file mode 100644
index 00000000000..fa9c10dbb76
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.coincidence.js
@@ -0,0 +1,815 @@
+// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
+
+;(function (factory) {
+ var objectTypes = {
+ 'boolean': false,
+ 'function': true,
+ 'object': true,
+ 'number': false,
+ 'string': false,
+ 'undefined': false
+ };
+
+ var root = (objectTypes[typeof window] && window) || this,
+ freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
+ freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
+ moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
+ freeGlobal = objectTypes[typeof global] && global;
+
+ if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) {
+ root = freeGlobal;
+ }
+
+ // Because of build optimizers
+ if (typeof define === 'function' && define.amd) {
+ define(['rx'], function (Rx, exports) {
+ return factory(root, exports, Rx);
+ });
+ } else if (typeof module === 'object' && module && module.exports === freeExports) {
+ module.exports = factory(root, module.exports, require('./rx'));
+ } else {
+ root.Rx = factory(root, {}, root.Rx);
+ }
+}.call(this, function (root, exp, Rx, undefined) {
+
+ var Observable = Rx.Observable,
+ CompositeDisposable = Rx.CompositeDisposable,
+ RefCountDisposable = Rx.RefCountDisposable,
+ SingleAssignmentDisposable = Rx.SingleAssignmentDisposable,
+ SerialDisposable = Rx.SerialDisposable,
+ Subject = Rx.Subject,
+ observableProto = Observable.prototype,
+ observableEmpty = Observable.empty,
+ observableNever = Observable.never,
+ AnonymousObservable = Rx.AnonymousObservable,
+ observerCreate = Rx.Observer.create,
+ addRef = Rx.internals.addRef,
+ defaultComparer = Rx.internals.isEqual,
+ inherits = Rx.internals.inherits,
+ noop = Rx.helpers.noop,
+ identity = Rx.helpers.identity,
+ isPromise = Rx.helpers.isPromise,
+ observableFromPromise = Observable.fromPromise,
+ ArgumentOutOfRangeError = Rx.ArgumentOutOfRangeError;
+
+ var Dictionary = (function () {
+
+ var primes = [1, 3, 7, 13, 31, 61, 127, 251, 509, 1021, 2039, 4093, 8191, 16381, 32749, 65521, 131071, 262139, 524287, 1048573, 2097143, 4194301, 8388593, 16777213, 33554393, 67108859, 134217689, 268435399, 536870909, 1073741789, 2147483647],
+ noSuchkey = "no such key",
+ duplicatekey = "duplicate key";
+
+ function isPrime(candidate) {
+ if ((candidate & 1) === 0) { return candidate === 2; }
+ var num1 = Math.sqrt(candidate),
+ num2 = 3;
+ while (num2 <= num1) {
+ if (candidate % num2 === 0) { return false; }
+ num2 += 2;
+ }
+ return true;
+ }
+
+ function getPrime(min) {
+ var index, num, candidate;
+ for (index = 0; index < primes.length; ++index) {
+ num = primes[index];
+ if (num >= min) { return num; }
+ }
+ candidate = min | 1;
+ while (candidate < primes[primes.length - 1]) {
+ if (isPrime(candidate)) { return candidate; }
+ candidate += 2;
+ }
+ return min;
+ }
+
+ function stringHashFn(str) {
+ var hash = 757602046;
+ if (!str.length) { return hash; }
+ for (var i = 0, len = str.length; i < len; i++) {
+ var character = str.charCodeAt(i);
+ hash = ((hash << 5) - hash) + character;
+ hash = hash & hash;
+ }
+ return hash;
+ }
+
+ function numberHashFn(key) {
+ var c2 = 0x27d4eb2d;
+ key = (key ^ 61) ^ (key >>> 16);
+ key = key + (key << 3);
+ key = key ^ (key >>> 4);
+ key = key * c2;
+ key = key ^ (key >>> 15);
+ return key;
+ }
+
+ var getHashCode = (function () {
+ var uniqueIdCounter = 0;
+
+ return function (obj) {
+ if (obj == null) { throw new Error(noSuchkey); }
+
+ // Check for built-ins before tacking on our own for any object
+ if (typeof obj === 'string') { return stringHashFn(obj); }
+ if (typeof obj === 'number') { return numberHashFn(obj); }
+ if (typeof obj === 'boolean') { return obj === true ? 1 : 0; }
+ if (obj instanceof Date) { return numberHashFn(obj.valueOf()); }
+ if (obj instanceof RegExp) { return stringHashFn(obj.toString()); }
+ if (typeof obj.valueOf === 'function') {
+ // Hack check for valueOf
+ var valueOf = obj.valueOf();
+ if (typeof valueOf === 'number') { return numberHashFn(valueOf); }
+ if (typeof valueOf === 'string') { return stringHashFn(valueOf); }
+ }
+ if (obj.hashCode) { return obj.hashCode(); }
+
+ var id = 17 * uniqueIdCounter++;
+ obj.hashCode = function () { return id; };
+ return id;
+ };
+ }());
+
+ function newEntry() {
+ return { key: null, value: null, next: 0, hashCode: 0 };
+ }
+
+ function Dictionary(capacity, comparer) {
+ if (capacity < 0) { throw new ArgumentOutOfRangeError(); }
+ if (capacity > 0) { this._initialize(capacity); }
+
+ this.comparer = comparer || defaultComparer;
+ this.freeCount = 0;
+ this.size = 0;
+ this.freeList = -1;
+ }
+
+ var dictionaryProto = Dictionary.prototype;
+
+ dictionaryProto._initialize = function (capacity) {
+ var prime = getPrime(capacity), i;
+ this.buckets = new Array(prime);
+ this.entries = new Array(prime);
+ for (i = 0; i < prime; i++) {
+ this.buckets[i] = -1;
+ this.entries[i] = newEntry();
+ }
+ this.freeList = -1;
+ };
+
+ dictionaryProto.add = function (key, value) {
+ this._insert(key, value, true);
+ };
+
+ dictionaryProto._insert = function (key, value, add) {
+ if (!this.buckets) { this._initialize(0); }
+ var index3,
+ num = getHashCode(key) & 2147483647,
+ index1 = num % this.buckets.length;
+ for (var index2 = this.buckets[index1]; index2 >= 0; index2 = this.entries[index2].next) {
+ if (this.entries[index2].hashCode === num && this.comparer(this.entries[index2].key, key)) {
+ if (add) { throw new Error(duplicatekey); }
+ this.entries[index2].value = value;
+ return;
+ }
+ }
+ if (this.freeCount > 0) {
+ index3 = this.freeList;
+ this.freeList = this.entries[index3].next;
+ --this.freeCount;
+ } else {
+ if (this.size === this.entries.length) {
+ this._resize();
+ index1 = num % this.buckets.length;
+ }
+ index3 = this.size;
+ ++this.size;
+ }
+ this.entries[index3].hashCode = num;
+ this.entries[index3].next = this.buckets[index1];
+ this.entries[index3].key = key;
+ this.entries[index3].value = value;
+ this.buckets[index1] = index3;
+ };
+
+ dictionaryProto._resize = function () {
+ var prime = getPrime(this.size * 2),
+ numArray = new Array(prime);
+ for (index = 0; index < numArray.length; ++index) { numArray[index] = -1; }
+ var entryArray = new Array(prime);
+ for (index = 0; index < this.size; ++index) { entryArray[index] = this.entries[index]; }
+ for (var index = this.size; index < prime; ++index) { entryArray[index] = newEntry(); }
+ for (var index1 = 0; index1 < this.size; ++index1) {
+ var index2 = entryArray[index1].hashCode % prime;
+ entryArray[index1].next = numArray[index2];
+ numArray[index2] = index1;
+ }
+ this.buckets = numArray;
+ this.entries = entryArray;
+ };
+
+ dictionaryProto.remove = function (key) {
+ if (this.buckets) {
+ var num = getHashCode(key) & 2147483647,
+ index1 = num % this.buckets.length,
+ index2 = -1;
+ for (var index3 = this.buckets[index1]; index3 >= 0; index3 = this.entries[index3].next) {
+ if (this.entries[index3].hashCode === num && this.comparer(this.entries[index3].key, key)) {
+ if (index2 < 0) {
+ this.buckets[index1] = this.entries[index3].next;
+ } else {
+ this.entries[index2].next = this.entries[index3].next;
+ }
+ this.entries[index3].hashCode = -1;
+ this.entries[index3].next = this.freeList;
+ this.entries[index3].key = null;
+ this.entries[index3].value = null;
+ this.freeList = index3;
+ ++this.freeCount;
+ return true;
+ } else {
+ index2 = index3;
+ }
+ }
+ }
+ return false;
+ };
+
+ dictionaryProto.clear = function () {
+ var index, len;
+ if (this.size <= 0) { return; }
+ for (index = 0, len = this.buckets.length; index < len; ++index) {
+ this.buckets[index] = -1;
+ }
+ for (index = 0; index < this.size; ++index) {
+ this.entries[index] = newEntry();
+ }
+ this.freeList = -1;
+ this.size = 0;
+ };
+
+ dictionaryProto._findEntry = function (key) {
+ if (this.buckets) {
+ var num = getHashCode(key) & 2147483647;
+ for (var index = this.buckets[num % this.buckets.length]; index >= 0; index = this.entries[index].next) {
+ if (this.entries[index].hashCode === num && this.comparer(this.entries[index].key, key)) {
+ return index;
+ }
+ }
+ }
+ return -1;
+ };
+
+ dictionaryProto.count = function () {
+ return this.size - this.freeCount;
+ };
+
+ dictionaryProto.tryGetValue = function (key) {
+ var entry = this._findEntry(key);
+ return entry >= 0 ?
+ this.entries[entry].value :
+ undefined;
+ };
+
+ dictionaryProto.getValues = function () {
+ var index = 0, results = [];
+ if (this.entries) {
+ for (var index1 = 0; index1 < this.size; index1++) {
+ if (this.entries[index1].hashCode >= 0) {
+ results[index++] = this.entries[index1].value;
+ }
+ }
+ }
+ return results;
+ };
+
+ dictionaryProto.get = function (key) {
+ var entry = this._findEntry(key);
+ if (entry >= 0) { return this.entries[entry].value; }
+ throw new Error(noSuchkey);
+ };
+
+ dictionaryProto.set = function (key, value) {
+ this._insert(key, value, false);
+ };
+
+ dictionaryProto.containskey = function (key) {
+ return this._findEntry(key) >= 0;
+ };
+
+ return Dictionary;
+ }());
+
+ /**
+ * Correlates the elements of two sequences based on overlapping durations.
+ *
+ * @param {Observable} right The right observable sequence to join elements for.
+ * @param {Function} leftDurationSelector A function to select the duration (expressed as an observable sequence) of each element of the left observable sequence, used to determine overlap.
+ * @param {Function} rightDurationSelector A function to select the duration (expressed as an observable sequence) of each element of the right observable sequence, used to determine overlap.
+ * @param {Function} resultSelector A function invoked to compute a result element for any two overlapping elements of the left and right observable sequences. The parameters passed to the function correspond with the elements from the left and right source sequences for which overlap occurs.
+ * @returns {Observable} An observable sequence that contains result elements computed from source elements that have an overlapping duration.
+ */
+ observableProto.join = function (right, leftDurationSelector, rightDurationSelector, resultSelector) {
+ var left = this;
+ return new AnonymousObservable(function (observer) {
+ var group = new CompositeDisposable();
+ var leftDone = false, rightDone = false;
+ var leftId = 0, rightId = 0;
+ var leftMap = new Dictionary(), rightMap = new Dictionary();
+
+ group.add(left.subscribe(
+ function (value) {
+ var id = leftId++;
+ var md = new SingleAssignmentDisposable();
+
+ leftMap.add(id, value);
+ group.add(md);
+
+ var expire = function () {
+ leftMap.remove(id) && leftMap.count() === 0 && leftDone && observer.onCompleted();
+ group.remove(md);
+ };
+
+ var duration;
+ try {
+ duration = leftDurationSelector(value);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+
+ md.setDisposable(duration.take(1).subscribe(noop, observer.onError.bind(observer), expire));
+
+ rightMap.getValues().forEach(function (v) {
+ var result;
+ try {
+ result = resultSelector(value, v);
+ } catch (exn) {
+ observer.onError(exn);
+ return;
+ }
+
+ observer.onNext(result);
+ });
+ },
+ observer.onError.bind(observer),
+ function () {
+ leftDone = true;
+ (rightDone || leftMap.count() === 0) && observer.onCompleted();
+ })
+ );
+
+ group.add(right.subscribe(
+ function (value) {
+ var id = rightId++;
+ var md = new SingleAssignmentDisposable();
+
+ rightMap.add(id, value);
+ group.add(md);
+
+ var expire = function () {
+ rightMap.remove(id) && rightMap.count() === 0 && rightDone && observer.onCompleted();
+ group.remove(md);
+ };
+
+ var duration;
+ try {
+ duration = rightDurationSelector(value);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+
+ md.setDisposable(duration.take(1).subscribe(noop, observer.onError.bind(observer), expire));
+
+ leftMap.getValues().forEach(function (v) {
+ var result;
+ try {
+ result = resultSelector(v, value);
+ } catch (exn) {
+ observer.onError(exn);
+ return;
+ }
+
+ observer.onNext(result);
+ });
+ },
+ observer.onError.bind(observer),
+ function () {
+ rightDone = true;
+ (leftDone || rightMap.count() === 0) && observer.onCompleted();
+ })
+ );
+ return group;
+ }, left);
+ };
+
+ /**
+ * Correlates the elements of two sequences based on overlapping durations, and groups the results.
+ *
+ * @param {Observable} right The right observable sequence to join elements for.
+ * @param {Function} leftDurationSelector A function to select the duration (expressed as an observable sequence) of each element of the left observable sequence, used to determine overlap.
+ * @param {Function} rightDurationSelector A function to select the duration (expressed as an observable sequence) of each element of the right observable sequence, used to determine overlap.
+ * @param {Function} resultSelector A function invoked to compute a result element for any element of the left sequence with overlapping elements from the right observable sequence. The first parameter passed to the function is an element of the left sequence. The second parameter passed to the function is an observable sequence with elements from the right sequence that overlap with the left sequence's element.
+ * @returns {Observable} An observable sequence that contains result elements computed from source elements that have an overlapping duration.
+ */
+ observableProto.groupJoin = function (right, leftDurationSelector, rightDurationSelector, resultSelector) {
+ var left = this;
+ return new AnonymousObservable(function (observer) {
+ var group = new CompositeDisposable();
+ var r = new RefCountDisposable(group);
+ var leftMap = new Dictionary(), rightMap = new Dictionary();
+ var leftId = 0, rightId = 0;
+
+ function handleError(e) { return function (v) { v.onError(e); }; };
+
+ group.add(left.subscribe(
+ function (value) {
+ var s = new Subject();
+ var id = leftId++;
+ leftMap.add(id, s);
+
+ var result;
+ try {
+ result = resultSelector(value, addRef(s, r));
+ } catch (e) {
+ leftMap.getValues().forEach(handleError(e));
+ observer.onError(e);
+ return;
+ }
+ observer.onNext(result);
+
+ rightMap.getValues().forEach(function (v) { s.onNext(v); });
+
+ var md = new SingleAssignmentDisposable();
+ group.add(md);
+
+ var expire = function () {
+ leftMap.remove(id) && s.onCompleted();
+ group.remove(md);
+ };
+
+ var duration;
+ try {
+ duration = leftDurationSelector(value);
+ } catch (e) {
+ leftMap.getValues().forEach(handleError(e));
+ observer.onError(e);
+ return;
+ }
+
+ md.setDisposable(duration.take(1).subscribe(
+ noop,
+ function (e) {
+ leftMap.getValues().forEach(handleError(e));
+ observer.onError(e);
+ },
+ expire)
+ );
+ },
+ function (e) {
+ leftMap.getValues().forEach(handleError(e));
+ observer.onError(e);
+ },
+ observer.onCompleted.bind(observer))
+ );
+
+ group.add(right.subscribe(
+ function (value) {
+ var id = rightId++;
+ rightMap.add(id, value);
+
+ var md = new SingleAssignmentDisposable();
+ group.add(md);
+
+ var expire = function () {
+ rightMap.remove(id);
+ group.remove(md);
+ };
+
+ var duration;
+ try {
+ duration = rightDurationSelector(value);
+ } catch (e) {
+ leftMap.getValues().forEach(handleError(e));
+ observer.onError(e);
+ return;
+ }
+ md.setDisposable(duration.take(1).subscribe(
+ noop,
+ function (e) {
+ leftMap.getValues().forEach(handleError(e));
+ observer.onError(e);
+ },
+ expire)
+ );
+
+ leftMap.getValues().forEach(function (v) { v.onNext(value); });
+ },
+ function (e) {
+ leftMap.getValues().forEach(handleError(e));
+ observer.onError(e);
+ })
+ );
+
+ return r;
+ }, left);
+ };
+
+ /**
+ * Projects each element of an observable sequence into zero or more buffers.
+ *
+ * @param {Mixed} bufferOpeningsOrClosingSelector Observable sequence whose elements denote the creation of new windows, or, a function invoked to define the boundaries of the produced windows (a new window is started when the previous one is closed, resulting in non-overlapping windows).
+ * @param {Function} [bufferClosingSelector] A function invoked to define the closing of each produced window. If a closing selector function is specified for the first parameter, this parameter is ignored.
+ * @returns {Observable} An observable sequence of windows.
+ */
+ observableProto.buffer = function (bufferOpeningsOrClosingSelector, bufferClosingSelector) {
+ return this.window.apply(this, arguments).selectMany(function (x) { return x.toArray(); });
+ };
+
+ /**
+ * Projects each element of an observable sequence into zero or more windows.
+ *
+ * @param {Mixed} windowOpeningsOrClosingSelector Observable sequence whose elements denote the creation of new windows, or, a function invoked to define the boundaries of the produced windows (a new window is started when the previous one is closed, resulting in non-overlapping windows).
+ * @param {Function} [windowClosingSelector] A function invoked to define the closing of each produced window. If a closing selector function is specified for the first parameter, this parameter is ignored.
+ * @returns {Observable} An observable sequence of windows.
+ */
+ observableProto.window = function (windowOpeningsOrClosingSelector, windowClosingSelector) {
+ if (arguments.length === 1 && typeof arguments[0] !== 'function') {
+ return observableWindowWithBoundaries.call(this, windowOpeningsOrClosingSelector);
+ }
+ return typeof windowOpeningsOrClosingSelector === 'function' ?
+ observableWindowWithClosingSelector.call(this, windowOpeningsOrClosingSelector) :
+ observableWindowWithOpenings.call(this, windowOpeningsOrClosingSelector, windowClosingSelector);
+ };
+
+ function observableWindowWithOpenings(windowOpenings, windowClosingSelector) {
+ return windowOpenings.groupJoin(this, windowClosingSelector, observableEmpty, function (_, win) {
+ return win;
+ });
+ }
+
+ function observableWindowWithBoundaries(windowBoundaries) {
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ var win = new Subject(),
+ d = new CompositeDisposable(),
+ r = new RefCountDisposable(d);
+
+ observer.onNext(addRef(win, r));
+
+ d.add(source.subscribe(function (x) {
+ win.onNext(x);
+ }, function (err) {
+ win.onError(err);
+ observer.onError(err);
+ }, function () {
+ win.onCompleted();
+ observer.onCompleted();
+ }));
+
+ isPromise(windowBoundaries) && (windowBoundaries = observableFromPromise(windowBoundaries));
+
+ d.add(windowBoundaries.subscribe(function (w) {
+ win.onCompleted();
+ win = new Subject();
+ observer.onNext(addRef(win, r));
+ }, function (err) {
+ win.onError(err);
+ observer.onError(err);
+ }, function () {
+ win.onCompleted();
+ observer.onCompleted();
+ }));
+
+ return r;
+ }, source);
+ }
+
+ function observableWindowWithClosingSelector(windowClosingSelector) {
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ var m = new SerialDisposable(),
+ d = new CompositeDisposable(m),
+ r = new RefCountDisposable(d),
+ win = new Subject();
+ observer.onNext(addRef(win, r));
+ d.add(source.subscribe(function (x) {
+ win.onNext(x);
+ }, function (err) {
+ win.onError(err);
+ observer.onError(err);
+ }, function () {
+ win.onCompleted();
+ observer.onCompleted();
+ }));
+
+ function createWindowClose () {
+ var windowClose;
+ try {
+ windowClose = windowClosingSelector();
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+
+ isPromise(windowClose) && (windowClose = observableFromPromise(windowClose));
+
+ var m1 = new SingleAssignmentDisposable();
+ m.setDisposable(m1);
+ m1.setDisposable(windowClose.take(1).subscribe(noop, function (err) {
+ win.onError(err);
+ observer.onError(err);
+ }, function () {
+ win.onCompleted();
+ win = new Subject();
+ observer.onNext(addRef(win, r));
+ createWindowClose();
+ }));
+ }
+
+ createWindowClose();
+ return r;
+ }, source);
+ }
+
+ /**
+ * Returns a new observable that triggers on the second and subsequent triggerings of the input observable.
+ * The Nth triggering of the input observable passes the arguments from the N-1th and Nth triggering as a pair.
+ * The argument passed to the N-1th triggering is held in hidden internal state until the Nth triggering occurs.
+ * @returns {Observable} An observable that triggers on successive pairs of observations from the input observable as an array.
+ */
+ observableProto.pairwise = function () {
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ var previous, hasPrevious = false;
+ return source.subscribe(
+ function (x) {
+ if (hasPrevious) {
+ observer.onNext([previous, x]);
+ } else {
+ hasPrevious = true;
+ }
+ previous = x;
+ },
+ observer.onError.bind(observer),
+ observer.onCompleted.bind(observer));
+ }, source);
+ };
+
+ /**
+ * Returns two observables which partition the observations of the source by the given function.
+ * The first will trigger observations for those values for which the predicate returns true.
+ * The second will trigger observations for those values where the predicate returns false.
+ * The predicate is executed once for each subscribed observer.
+ * Both also propagate all error observations arising from the source and each completes
+ * when the source completes.
+ * @param {Function} predicate
+ * The function to determine which output Observable will trigger a particular observation.
+ * @returns {Array}
+ * An array of observables. The first triggers when the predicate returns true,
+ * and the second triggers when the predicate returns false.
+ */
+ observableProto.partition = function(predicate, thisArg) {
+ return [
+ this.filter(predicate, thisArg),
+ this.filter(function (x, i, o) { return !predicate.call(thisArg, x, i, o); })
+ ];
+ };
+
+ /**
+ * Groups the elements of an observable sequence according to a specified key selector function and comparer and selects the resulting elements by using a specified function.
+ *
+ * @example
+ * var res = observable.groupBy(function (x) { return x.id; });
+ * 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; });
+ * 3 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function (x) { return x.toString(); });
+ * @param {Function} keySelector A function to extract the key for each element.
+ * @param {Function} [elementSelector] A function to map each source element to an element in an observable group.
+ * @param {Function} [comparer] Used to determine whether the objects are equal.
+ * @returns {Observable} A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value.
+ */
+ observableProto.groupBy = function (keySelector, elementSelector, comparer) {
+ return this.groupByUntil(keySelector, elementSelector, observableNever, comparer);
+ };
+
+ /**
+ * Groups the elements of an observable sequence according to a specified key selector function.
+ * A duration selector function is used to control the lifetime of groups. When a group expires, it receives an OnCompleted notification. When a new element with the same
+ * key value as a reclaimed group occurs, the group will be reborn with a new lifetime request.
+ *
+ * @example
+ * var res = observable.groupByUntil(function (x) { return x.id; }, null, function () { return Rx.Observable.never(); });
+ * 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function () { return Rx.Observable.never(); });
+ * 3 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function () { return Rx.Observable.never(); }, function (x) { return x.toString(); });
+ * @param {Function} keySelector A function to extract the key for each element.
+ * @param {Function} durationSelector A function to signal the expiration of a group.
+ * @param {Function} [comparer] Used to compare objects. When not specified, the default comparer is used.
+ * @returns {Observable}
+ * A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value.
+ * If a group's lifetime expires, a new group with the same key value can be created once an element with such a key value is encoutered.
+ *
+ */
+ observableProto.groupByUntil = function (keySelector, elementSelector, durationSelector, comparer) {
+ var source = this;
+ elementSelector || (elementSelector = identity);
+ comparer || (comparer = defaultComparer);
+ return new AnonymousObservable(function (observer) {
+ function handleError(e) { return function (item) { item.onError(e); }; }
+ var map = new Dictionary(0, comparer),
+ groupDisposable = new CompositeDisposable(),
+ refCountDisposable = new RefCountDisposable(groupDisposable);
+
+ groupDisposable.add(source.subscribe(function (x) {
+ var key;
+ try {
+ key = keySelector(x);
+ } catch (e) {
+ map.getValues().forEach(handleError(e));
+ observer.onError(e);
+ return;
+ }
+
+ var fireNewMapEntry = false,
+ writer = map.tryGetValue(key);
+ if (!writer) {
+ writer = new Subject();
+ map.set(key, writer);
+ fireNewMapEntry = true;
+ }
+
+ if (fireNewMapEntry) {
+ var group = new GroupedObservable(key, writer, refCountDisposable),
+ durationGroup = new GroupedObservable(key, writer);
+ try {
+ duration = durationSelector(durationGroup);
+ } catch (e) {
+ map.getValues().forEach(handleError(e));
+ observer.onError(e);
+ return;
+ }
+
+ observer.onNext(group);
+
+ var md = new SingleAssignmentDisposable();
+ groupDisposable.add(md);
+
+ var expire = function () {
+ map.remove(key) && writer.onCompleted();
+ groupDisposable.remove(md);
+ };
+
+ md.setDisposable(duration.take(1).subscribe(
+ noop,
+ function (exn) {
+ map.getValues().forEach(handleError(exn));
+ observer.onError(exn);
+ },
+ expire)
+ );
+ }
+
+ var element;
+ try {
+ element = elementSelector(x);
+ } catch (e) {
+ map.getValues().forEach(handleError(e));
+ observer.onError(e);
+ return;
+ }
+
+ writer.onNext(element);
+ }, function (ex) {
+ map.getValues().forEach(handleError(ex));
+ observer.onError(ex);
+ }, function () {
+ map.getValues().forEach(function (item) { item.onCompleted(); });
+ observer.onCompleted();
+ }));
+
+ return refCountDisposable;
+ }, source);
+ };
+
+ var GroupedObservable = (function (__super__) {
+ inherits(GroupedObservable, __super__);
+
+ function subscribe(observer) {
+ return this.underlyingObservable.subscribe(observer);
+ }
+
+ function GroupedObservable(key, underlyingObservable, mergedDisposable) {
+ __super__.call(this, subscribe);
+ this.key = key;
+ this.underlyingObservable = !mergedDisposable ?
+ underlyingObservable :
+ new AnonymousObservable(function (observer) {
+ return new CompositeDisposable(mergedDisposable.getDisposable(), underlyingObservable.subscribe(observer));
+ });
+ }
+
+ return GroupedObservable;
+ }(Observable));
+
+ return Rx;
+}));
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.coincidence.map b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.coincidence.map
new file mode 100644
index 00000000000..12e9b9ca1a4
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.coincidence.map
@@ -0,0 +1 @@
+{"version":3,"file":"rx.coincidence.min.js","sources":["rx.coincidence.js"],"names":["factory","objectTypes","boolean","function","object","number","string","undefined","root","window","this","freeExports","exports","nodeType","freeModule","module","freeGlobal","global","define","amd","Rx","require","call","exp","observableWindowWithOpenings","windowOpenings","windowClosingSelector","groupJoin","observableEmpty","_","win","observableWindowWithBoundaries","windowBoundaries","source","AnonymousObservable","observer","Subject","d","CompositeDisposable","r","RefCountDisposable","onNext","addRef","add","subscribe","x","err","onError","onCompleted","isPromise","observableFromPromise","w","observableWindowWithClosingSelector","createWindowClose","windowClose","e","m1","SingleAssignmentDisposable","m","setDisposable","take","noop","SerialDisposable","Observable","observableProto","prototype","empty","observableNever","never","Observer","create","internals","defaultComparer","isEqual","inherits","helpers","identity","fromPromise","ArgumentOutOfRangeError","Dictionary","isPrime","candidate","num1","Math","sqrt","num2","getPrime","min","index","num","primes","length","stringHashFn","str","hash","i","len","character","charCodeAt","numberHashFn","key","c2","newEntry","value","next","hashCode","capacity","comparer","_initialize","freeCount","size","freeList","noSuchkey","duplicatekey","getHashCode","uniqueIdCounter","obj","Error","Date","valueOf","RegExp","toString","id","dictionaryProto","prime","buckets","Array","entries","_insert","index3","index1","index2","_resize","numArray","entryArray","remove","clear","_findEntry","count","tryGetValue","entry","getValues","results","get","set","containskey","join","right","leftDurationSelector","rightDurationSelector","resultSelector","left","group","leftDone","rightDone","leftId","rightId","leftMap","rightMap","md","duration","expire","bind","forEach","v","result","exn","handleError","s","buffer","bufferOpeningsOrClosingSelector","bufferClosingSelector","apply","arguments","selectMany","toArray","windowOpeningsOrClosingSelector","pairwise","previous","hasPrevious","partition","predicate","thisArg","filter","o","groupBy","keySelector","elementSelector","groupByUntil","durationSelector","item","map","groupDisposable","refCountDisposable","fireNewMapEntry","writer","GroupedObservable","durationGroup","element","ex","__super__","underlyingObservable","mergedDisposable","getDisposable"],"mappings":";CAEE,SAAUA,GACR,GAAIC,IACAC,WAAW,EACXC,YAAY,EACZC,QAAU,EACVC,QAAU,EACVC,QAAU,EACVC,WAAa,GAGbC,EAAQP,QAAmBQ,UAAWA,QAAWC,KACjDC,EAAcV,QAAmBW,WAAYA,UAAYA,QAAQC,UAAYD,QAC7EE,EAAab,QAAmBc,UAAWA,SAAWA,OAAOF,UAAYE,OAEzEC,GADgBF,GAAcA,EAAWF,UAAYD,GAAeA,EACvDV,QAAmBgB,UAAWA,SAE3CD,GAAeA,EAAWC,SAAWD,GAAcA,EAAWP,SAAWO,IACzER,EAAOQ,GAIW,kBAAXE,SAAyBA,OAAOC,IACvCD,QAAQ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7C,KACEnC,SAAW6B,EAAiBQ,GAC5B,MAAO9I,GAGP,MAFAwI,GAAIlD,YAAYsB,QAAQI,EAAYhH,QACpCpB,GAASY,QAAQQ,GAInBpB,EAASM,OAAO+G,EAEhB,IAAIO,GAAK,GAAItG,EACbuI,GAAgBrJ,IAAIoH,EAEpB,IAAIE,GAAS,WACX8B,EAAIxD,OAAOnC,IAAQ+F,EAAOnJ,cAC1BgJ,EAAgBzD,OAAOwB,GAGzBA,GAAGpG,cAAcqG,SAASpG,KAAK,GAAGhB,UAChCiB,EACA,SAAUyG,GACRyB,EAAIlD,YAAYsB,QAAQI,EAAYD,IACpCnI,EAASY,QAAQuH,IAEnBL,IAIJ,GAAIqC,EACJ,KACEA,EAAUX,EAAgB9I,GAC1B,MAAOU,GAGP,MAFAwI,GAAIlD,YAAYsB,QAAQI,EAAYhH,QACpCpB,GAASY,QAAQQ,GAInB4I,EAAO1J,OAAO6J,IACf,SAAUC,GACXR,EAAIlD,YAAYsB,QAAQI,EAAYgC,IACpCpK,EAASY,QAAQwJ,IAChB,WACDR,EAAIlD,YAAYsB,QAAQ,SAAU2B,GAAQA,EAAK9I,gBAC/Cb,EAASa,iBAGJiJ,GACNhK,GAGL,IAAImK,GAAqB,SAAUI,GAGjC,QAAS5J,GAAUT,GACjB,MAAOzB,MAAK+L,qBAAqB7J,UAAUT,GAG7C,QAASiK,GAAkBhG,EAAKqG,EAAsBC,GACpDF,EAAUlL,KAAKZ,KAAMkC,GACrBlC,KAAK0F,IAAMA,EACX1F,KAAK+L,qBAAwBC,EAE3B,GAAIxK,GAAoB,SAAUC,GAChC,MAAO,IAAIG,GAAoBoK,EAAiBC,gBAAiBF,EAAqB7J,UAAUT,MAFlGsK,EAMJ,MAhBA/H,GAAS0H,EAAmBI,GAgBrBJ,GACPrI,EAEA,OAAO3C"} \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.coincidence.min.js b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.coincidence.min.js
new file mode 100644
index 00000000000..c235fd2a678
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.coincidence.min.js
@@ -0,0 +1,3 @@
+/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
+(function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx"],function(b,d){return a(c,d,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){function e(a,b){return a.groupJoin(this,b,o,function(a,b){return b})}function f(a){var b=this;return new q(function(c){var d=new m,e=new i,f=new j(e);return c.onNext(r(d,f)),e.add(b.subscribe(function(a){d.onNext(a)},function(a){d.onError(a),c.onError(a)},function(){d.onCompleted(),c.onCompleted()})),w(a)&&(a=x(a)),e.add(a.subscribe(function(a){d.onCompleted(),d=new m,c.onNext(r(d,f))},function(a){d.onError(a),c.onError(a)},function(){d.onCompleted(),c.onCompleted()})),f},b)}function g(a){var b=this;return new q(function(c){function d(){var b;try{b=a()}catch(f){return void c.onError(f)}w(b)&&(b=x(b));var i=new k;e.setDisposable(i),i.setDisposable(b.take(1).subscribe(u,function(a){h.onError(a),c.onError(a)},function(){h.onCompleted(),h=new m,c.onNext(r(h,g)),d()}))}var e=new l,f=new i(e),g=new j(f),h=new m;return c.onNext(r(h,g)),f.add(b.subscribe(function(a){h.onNext(a)},function(a){h.onError(a),c.onError(a)},function(){h.onCompleted(),c.onCompleted()})),d(),g},b)}var h=c.Observable,i=c.CompositeDisposable,j=c.RefCountDisposable,k=c.SingleAssignmentDisposable,l=c.SerialDisposable,m=c.Subject,n=h.prototype,o=h.empty,p=h.never,q=c.AnonymousObservable,r=(c.Observer.create,c.internals.addRef),s=c.internals.isEqual,t=c.internals.inherits,u=c.helpers.noop,v=c.helpers.identity,w=c.helpers.isPromise,x=h.fromPromise,y=c.ArgumentOutOfRangeError,z=function(){function a(a){if(0===(1&a))return 2===a;for(var b=Math.sqrt(a),c=3;b>=c;){if(a%c===0)return!1;c+=2}return!0}function b(b){var c,d,e;for(c=0;c<h.length;++c)if(d=h[c],d>=b)return d;for(e=1|b;e<h[h.length-1];){if(a(e))return e;e+=2}return b}function c(a){var b=757602046;if(!a.length)return b;for(var c=0,d=a.length;d>c;c++){var e=a.charCodeAt(c);b=(b<<5)-b+e,b&=b}return b}function e(a){var b=668265261;return a=61^a^a>>>16,a+=a<<3,a^=a>>>4,a*=b,a^=a>>>15}function f(){return{key:null,value:null,next:0,hashCode:0}}function g(a,b){if(0>a)throw new y;a>0&&this._initialize(a),this.comparer=b||s,this.freeCount=0,this.size=0,this.freeList=-1}var h=[1,3,7,13,31,61,127,251,509,1021,2039,4093,8191,16381,32749,65521,131071,262139,524287,1048573,2097143,4194301,8388593,16777213,33554393,67108859,134217689,268435399,536870909,1073741789,2147483647],i="no such key",j="duplicate key",k=function(){var a=0;return function(b){if(null==b)throw new Error(i);if("string"==typeof b)return c(b);if("number"==typeof b)return e(b);if("boolean"==typeof b)return b===!0?1:0;if(b instanceof Date)return e(b.valueOf());if(b instanceof RegExp)return c(b.toString());if("function"==typeof b.valueOf){var d=b.valueOf();if("number"==typeof d)return e(d);if("string"==typeof d)return c(d)}if(b.hashCode)return b.hashCode();var f=17*a++;return b.hashCode=function(){return f},f}}(),l=g.prototype;return l._initialize=function(a){var c,d=b(a);for(this.buckets=new Array(d),this.entries=new Array(d),c=0;d>c;c++)this.buckets[c]=-1,this.entries[c]=f();this.freeList=-1},l.add=function(a,b){this._insert(a,b,!0)},l._insert=function(a,b,c){this.buckets||this._initialize(0);for(var d,e=2147483647&k(a),f=e%this.buckets.length,g=this.buckets[f];g>=0;g=this.entries[g].next)if(this.entries[g].hashCode===e&&this.comparer(this.entries[g].key,a)){if(c)throw new Error(j);return void(this.entries[g].value=b)}this.freeCount>0?(d=this.freeList,this.freeList=this.entries[d].next,--this.freeCount):(this.size===this.entries.length&&(this._resize(),f=e%this.buckets.length),d=this.size,++this.size),this.entries[d].hashCode=e,this.entries[d].next=this.buckets[f],this.entries[d].key=a,this.entries[d].value=b,this.buckets[f]=d},l._resize=function(){var a=b(2*this.size),c=new Array(a);for(e=0;e<c.length;++e)c[e]=-1;var d=new Array(a);for(e=0;e<this.size;++e)d[e]=this.entries[e];for(var e=this.size;a>e;++e)d[e]=f();for(var g=0;g<this.size;++g){var h=d[g].hashCode%a;d[g].next=c[h],c[h]=g}this.buckets=c,this.entries=d},l.remove=function(a){if(this.buckets)for(var b=2147483647&k(a),c=b%this.buckets.length,d=-1,e=this.buckets[c];e>=0;e=this.entries[e].next){if(this.entries[e].hashCode===b&&this.comparer(this.entries[e].key,a))return 0>d?this.buckets[c]=this.entries[e].next:this.entries[d].next=this.entries[e].next,this.entries[e].hashCode=-1,this.entries[e].next=this.freeList,this.entries[e].key=null,this.entries[e].value=null,this.freeList=e,++this.freeCount,!0;d=e}return!1},l.clear=function(){var a,b;if(!(this.size<=0)){for(a=0,b=this.buckets.length;b>a;++a)this.buckets[a]=-1;for(a=0;a<this.size;++a)this.entries[a]=f();this.freeList=-1,this.size=0}},l._findEntry=function(a){if(this.buckets)for(var b=2147483647&k(a),c=this.buckets[b%this.buckets.length];c>=0;c=this.entries[c].next)if(this.entries[c].hashCode===b&&this.comparer(this.entries[c].key,a))return c;return-1},l.count=function(){return this.size-this.freeCount},l.tryGetValue=function(a){var b=this._findEntry(a);return b>=0?this.entries[b].value:d},l.getValues=function(){var a=0,b=[];if(this.entries)for(var c=0;c<this.size;c++)this.entries[c].hashCode>=0&&(b[a++]=this.entries[c].value);return b},l.get=function(a){var b=this._findEntry(a);if(b>=0)return this.entries[b].value;throw new Error(i)},l.set=function(a,b){this._insert(a,b,!1)},l.containskey=function(a){return this._findEntry(a)>=0},g}();n.join=function(a,b,c,d){var e=this;return new q(function(f){var g=new i,h=!1,j=!1,l=0,m=0,n=new z,o=new z;return g.add(e.subscribe(function(a){var c=l++,e=new k;n.add(c,a),g.add(e);var i,j=function(){n.remove(c)&&0===n.count()&&h&&f.onCompleted(),g.remove(e)};try{i=b(a)}catch(m){return void f.onError(m)}e.setDisposable(i.take(1).subscribe(u,f.onError.bind(f),j)),o.getValues().forEach(function(b){var c;try{c=d(a,b)}catch(e){return void f.onError(e)}f.onNext(c)})},f.onError.bind(f),function(){h=!0,(j||0===n.count())&&f.onCompleted()})),g.add(a.subscribe(function(a){var b=m++,e=new k;o.add(b,a),g.add(e);var h,i=function(){o.remove(b)&&0===o.count()&&j&&f.onCompleted(),g.remove(e)};try{h=c(a)}catch(l){return void f.onError(l)}e.setDisposable(h.take(1).subscribe(u,f.onError.bind(f),i)),n.getValues().forEach(function(b){var c;try{c=d(b,a)}catch(e){return void f.onError(e)}f.onNext(c)})},f.onError.bind(f),function(){j=!0,(h||0===o.count())&&f.onCompleted()})),g},e)},n.groupJoin=function(a,b,c,d){var e=this;return new q(function(f){function g(a){return function(b){b.onError(a)}}var h=new i,l=new j(h),n=new z,o=new z,p=0,q=0;return h.add(e.subscribe(function(a){var c=new m,e=p++;n.add(e,c);var i;try{i=d(a,r(c,l))}catch(j){return n.getValues().forEach(g(j)),void f.onError(j)}f.onNext(i),o.getValues().forEach(function(a){c.onNext(a)});var q=new k;h.add(q);var s,t=function(){n.remove(e)&&c.onCompleted(),h.remove(q)};try{s=b(a)}catch(j){return n.getValues().forEach(g(j)),void f.onError(j)}q.setDisposable(s.take(1).subscribe(u,function(a){n.getValues().forEach(g(a)),f.onError(a)},t))},function(a){n.getValues().forEach(g(a)),f.onError(a)},f.onCompleted.bind(f))),h.add(a.subscribe(function(a){var b=q++;o.add(b,a);var d=new k;h.add(d);var e,i=function(){o.remove(b),h.remove(d)};try{e=c(a)}catch(j){return n.getValues().forEach(g(j)),void f.onError(j)}d.setDisposable(e.take(1).subscribe(u,function(a){n.getValues().forEach(g(a)),f.onError(a)},i)),n.getValues().forEach(function(b){b.onNext(a)})},function(a){n.getValues().forEach(g(a)),f.onError(a)})),l},e)},n.buffer=function(a,b){return this.window.apply(this,arguments).selectMany(function(a){return a.toArray()})},n.window=function(a,b){return 1===arguments.length&&"function"!=typeof arguments[0]?f.call(this,a):"function"==typeof a?g.call(this,a):e.call(this,a,b)},n.pairwise=function(){var a=this;return new q(function(b){var c,d=!1;return a.subscribe(function(a){d?b.onNext([c,a]):d=!0,c=a},b.onError.bind(b),b.onCompleted.bind(b))},a)},n.partition=function(a,b){return[this.filter(a,b),this.filter(function(c,d,e){return!a.call(b,c,d,e)})]},n.groupBy=function(a,b,c){return this.groupByUntil(a,b,p,c)},n.groupByUntil=function(a,b,c,d){var e=this;return b||(b=v),d||(d=s),new q(function(f){function g(a){return function(b){b.onError(a)}}var h=new z(0,d),l=new i,n=new j(l);return l.add(e.subscribe(function(d){var e;try{e=a(d)}catch(i){return h.getValues().forEach(g(i)),void f.onError(i)}var j=!1,o=h.tryGetValue(e);if(o||(o=new m,h.set(e,o),j=!0),j){var p=new A(e,o,n),q=new A(e,o);try{duration=c(q)}catch(i){return h.getValues().forEach(g(i)),void f.onError(i)}f.onNext(p);var r=new k;l.add(r);var s=function(){h.remove(e)&&o.onCompleted(),l.remove(r)};r.setDisposable(duration.take(1).subscribe(u,function(a){h.getValues().forEach(g(a)),f.onError(a)},s))}var t;try{t=b(d)}catch(i){return h.getValues().forEach(g(i)),void f.onError(i)}o.onNext(t)},function(a){h.getValues().forEach(g(a)),f.onError(a)},function(){h.getValues().forEach(function(a){a.onCompleted()}),f.onCompleted()})),n},e)};var A=function(a){function b(a){return this.underlyingObservable.subscribe(a)}function c(c,d,e){a.call(this,b),this.key=c,this.underlyingObservable=e?new q(function(a){return new i(e.getDisposable(),d.subscribe(a))}):d}return t(c,a),c}(h);return c});
+//# sourceMappingURL=rx.coincidence.map \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.compat.js b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.compat.js
new file mode 100644
index 00000000000..f6eca625907
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.compat.js
@@ -0,0 +1,5778 @@
+// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
+
+;(function (undefined) {
+
+ var objectTypes = {
+ 'boolean': false,
+ 'function': true,
+ 'object': true,
+ 'number': false,
+ 'string': false,
+ 'undefined': false
+ };
+
+ var root = (objectTypes[typeof window] && window) || this,
+ freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
+ freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
+ moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
+ freeGlobal = objectTypes[typeof global] && global;
+
+ if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) {
+ root = freeGlobal;
+ }
+
+ var Rx = {
+ internals: {},
+ config: {
+ Promise: root.Promise
+ },
+ helpers: { }
+ };
+
+ // Defaults
+ var noop = Rx.helpers.noop = function () { },
+ notDefined = Rx.helpers.notDefined = function (x) { return typeof x === 'undefined'; },
+ identity = Rx.helpers.identity = function (x) { return x; },
+ pluck = Rx.helpers.pluck = function (property) { return function (x) { return x[property]; }; },
+ just = Rx.helpers.just = function (value) { return function () { return value; }; },
+ defaultNow = Rx.helpers.defaultNow = (function () { return !!Date.now ? Date.now : function () { return +new Date; }; }()),
+ defaultComparer = Rx.helpers.defaultComparer = function (x, y) { return isEqual(x, y); },
+ defaultSubComparer = Rx.helpers.defaultSubComparer = function (x, y) { return x > y ? 1 : (x < y ? -1 : 0); },
+ defaultKeySerializer = Rx.helpers.defaultKeySerializer = function (x) { return x.toString(); },
+ defaultError = Rx.helpers.defaultError = function (err) { throw err; },
+ isPromise = Rx.helpers.isPromise = function (p) { return !!p && typeof p.subscribe !== 'function' && typeof p.then === 'function'; },
+ asArray = Rx.helpers.asArray = function () { return Array.prototype.slice.call(arguments); },
+ not = Rx.helpers.not = function (a) { return !a; },
+ isFunction = Rx.helpers.isFunction = (function () {
+ var isFn = function (value) {
+ return typeof value == 'function' || false;
+ }
+
+ // fallback for older versions of Chrome and Safari
+ if (isFn(/x/)) {
+ isFn = function(value) {
+ return typeof value == 'function' && toString.call(value) == '[object Function]';
+ };
+ }
+ return isFn;
+ }());
+
+ function cloneArray(arr) {
+ var len = arr.length, a = new Array(len);
+ for(var i = 0; i < len; i++) { a[i] = arr[i]; }
+ return a;
+ }
+
+ Rx.config.longStackSupport = false;
+ var hasStacks = false;
+ try {
+ throw new Error();
+ } catch (e) {
+ hasStacks = !!e.stack;
+ }
+
+ // All code after this point will be filtered from stack traces reported by RxJS
+ var rStartingLine = captureLine(), rFileName;
+
+ var STACK_JUMP_SEPARATOR = "From previous event:";
+
+ function makeStackTraceLong(error, observable) {
+ // If possible, transform the error stack trace by removing Node and RxJS
+ // cruft, then concatenating with the stack trace of `observable`.
+ if (hasStacks &&
+ observable.stack &&
+ typeof error === "object" &&
+ error !== null &&
+ error.stack &&
+ error.stack.indexOf(STACK_JUMP_SEPARATOR) === -1
+ ) {
+ var stacks = [];
+ for (var o = observable; !!o; o = o.source) {
+ if (o.stack) {
+ stacks.unshift(o.stack);
+ }
+ }
+ stacks.unshift(error.stack);
+
+ var concatedStacks = stacks.join("\n" + STACK_JUMP_SEPARATOR + "\n");
+ error.stack = filterStackString(concatedStacks);
+ }
+ }
+
+ function filterStackString(stackString) {
+ var lines = stackString.split("\n"),
+ desiredLines = [];
+ for (var i = 0, len = lines.length; i < len; i++) {
+ var line = lines[i];
+
+ if (!isInternalFrame(line) && !isNodeFrame(line) && line) {
+ desiredLines.push(line);
+ }
+ }
+ return desiredLines.join("\n");
+ }
+
+ function isInternalFrame(stackLine) {
+ var fileNameAndLineNumber = getFileNameAndLineNumber(stackLine);
+ if (!fileNameAndLineNumber) {
+ return false;
+ }
+ var fileName = fileNameAndLineNumber[0], lineNumber = fileNameAndLineNumber[1];
+
+ return fileName === rFileName &&
+ lineNumber >= rStartingLine &&
+ lineNumber <= rEndingLine;
+ }
+
+ function isNodeFrame(stackLine) {
+ return stackLine.indexOf("(module.js:") !== -1 ||
+ stackLine.indexOf("(node.js:") !== -1;
+ }
+
+ function captureLine() {
+ if (!hasStacks) { return; }
+
+ try {
+ throw new Error();
+ } catch (e) {
+ var lines = e.stack.split("\n");
+ var firstLine = lines[0].indexOf("@") > 0 ? lines[1] : lines[2];
+ var fileNameAndLineNumber = getFileNameAndLineNumber(firstLine);
+ if (!fileNameAndLineNumber) { return; }
+
+ rFileName = fileNameAndLineNumber[0];
+ return fileNameAndLineNumber[1];
+ }
+ }
+
+ function getFileNameAndLineNumber(stackLine) {
+ // Named functions: "at functionName (filename:lineNumber:columnNumber)"
+ var attempt1 = /at .+ \((.+):(\d+):(?:\d+)\)$/.exec(stackLine);
+ if (attempt1) { return [attempt1[1], Number(attempt1[2])]; }
+
+ // Anonymous functions: "at filename:lineNumber:columnNumber"
+ var attempt2 = /at ([^ ]+):(\d+):(?:\d+)$/.exec(stackLine);
+ if (attempt2) { return [attempt2[1], Number(attempt2[2])]; }
+
+ // Firefox style: "function@filename:lineNumber or @filename:lineNumber"
+ var attempt3 = /.*@(.+):(\d+)$/.exec(stackLine);
+ if (attempt3) { return [attempt3[1], Number(attempt3[2])]; }
+ }
+
+ var EmptyError = Rx.EmptyError = function() {
+ this.message = 'Sequence contains no elements.';
+ Error.call(this);
+ };
+ EmptyError.prototype = Error.prototype;
+
+ var ObjectDisposedError = Rx.ObjectDisposedError = function() {
+ this.message = 'Object has been disposed';
+ Error.call(this);
+ };
+ ObjectDisposedError.prototype = Error.prototype;
+
+ var ArgumentOutOfRangeError = Rx.ArgumentOutOfRangeError = function () {
+ this.message = 'Argument out of range';
+ Error.call(this);
+ };
+ ArgumentOutOfRangeError.prototype = Error.prototype;
+
+ var NotSupportedError = Rx.NotSupportedError = function (message) {
+ this.message = message || 'This operation is not supported';
+ Error.call(this);
+ };
+ NotSupportedError.prototype = Error.prototype;
+
+ var NotImplementedError = Rx.NotImplementedError = function (message) {
+ this.message = message || 'This operation is not implemented';
+ Error.call(this);
+ };
+ NotImplementedError.prototype = Error.prototype;
+
+ var notImplemented = Rx.helpers.notImplemented = function () {
+ throw new NotImplementedError();
+ };
+
+ var notSupported = Rx.helpers.notSupported = function () {
+ throw new NotSupportedError();
+ };
+
+ // Shim in iterator support
+ var $iterator$ = (typeof Symbol === 'function' && Symbol.iterator) ||
+ '_es6shim_iterator_';
+ // Bug for mozilla version
+ if (root.Set && typeof new root.Set()['@@iterator'] === 'function') {
+ $iterator$ = '@@iterator';
+ }
+
+ var doneEnumerator = Rx.doneEnumerator = { done: true, value: undefined };
+
+ var isIterable = Rx.helpers.isIterable = function (o) {
+ return o[$iterator$] !== undefined;
+ }
+
+ var isArrayLike = Rx.helpers.isArrayLike = function (o) {
+ return o && o.length !== undefined;
+ }
+
+ Rx.helpers.iterator = $iterator$;
+
+ var bindCallback = Rx.internals.bindCallback = function (func, thisArg, argCount) {
+ if (typeof thisArg === 'undefined') { return func; }
+ switch(argCount) {
+ case 0:
+ return function() {
+ return func.call(thisArg)
+ };
+ case 1:
+ return function(arg) {
+ return func.call(thisArg, arg);
+ }
+ case 2:
+ return function(value, index) {
+ return func.call(thisArg, value, index);
+ };
+ case 3:
+ return function(value, index, collection) {
+ return func.call(thisArg, value, index, collection);
+ };
+ }
+
+ return function() {
+ return func.apply(thisArg, arguments);
+ };
+ };
+
+ /** Used to determine if values are of the language type Object */
+ var dontEnums = ['toString',
+ 'toLocaleString',
+ 'valueOf',
+ 'hasOwnProperty',
+ 'isPrototypeOf',
+ 'propertyIsEnumerable',
+ 'constructor'],
+ dontEnumsLength = dontEnums.length;
+
+ /** `Object#toString` result shortcuts */
+ var argsClass = '[object Arguments]',
+ arrayClass = '[object Array]',
+ boolClass = '[object Boolean]',
+ dateClass = '[object Date]',
+ errorClass = '[object Error]',
+ funcClass = '[object Function]',
+ numberClass = '[object Number]',
+ objectClass = '[object Object]',
+ regexpClass = '[object RegExp]',
+ stringClass = '[object String]';
+
+ var toString = Object.prototype.toString,
+ hasOwnProperty = Object.prototype.hasOwnProperty,
+ supportsArgsClass = toString.call(arguments) == argsClass, // For less <IE9 && FF<4
+ supportNodeClass,
+ errorProto = Error.prototype,
+ objectProto = Object.prototype,
+ stringProto = String.prototype,
+ propertyIsEnumerable = objectProto.propertyIsEnumerable;
+
+ try {
+ supportNodeClass = !(toString.call(document) == objectClass && !({ 'toString': 0 } + ''));
+ } catch (e) {
+ supportNodeClass = true;
+ }
+
+ var nonEnumProps = {};
+ nonEnumProps[arrayClass] = nonEnumProps[dateClass] = nonEnumProps[numberClass] = { 'constructor': true, 'toLocaleString': true, 'toString': true, 'valueOf': true };
+ nonEnumProps[boolClass] = nonEnumProps[stringClass] = { 'constructor': true, 'toString': true, 'valueOf': true };
+ nonEnumProps[errorClass] = nonEnumProps[funcClass] = nonEnumProps[regexpClass] = { 'constructor': true, 'toString': true };
+ nonEnumProps[objectClass] = { 'constructor': true };
+
+ var support = {};
+ (function () {
+ var ctor = function() { this.x = 1; },
+ props = [];
+
+ ctor.prototype = { 'valueOf': 1, 'y': 1 };
+ for (var key in new ctor) { props.push(key); }
+ for (key in arguments) { }
+
+ // Detect if `name` or `message` properties of `Error.prototype` are enumerable by default.
+ support.enumErrorProps = propertyIsEnumerable.call(errorProto, 'message') || propertyIsEnumerable.call(errorProto, 'name');
+
+ // Detect if `prototype` properties are enumerable by default.
+ support.enumPrototypes = propertyIsEnumerable.call(ctor, 'prototype');
+
+ // Detect if `arguments` object indexes are non-enumerable
+ support.nonEnumArgs = key != 0;
+
+ // Detect if properties shadowing those on `Object.prototype` are non-enumerable.
+ support.nonEnumShadows = !/valueOf/.test(props);
+ }(1));
+
+ var isObject = Rx.internals.isObject = function(value) {
+ var type = typeof value;
+ return value && (type == 'function' || type == 'object') || false;
+ };
+
+ function keysIn(object) {
+ var result = [];
+ if (!isObject(object)) {
+ return result;
+ }
+ if (support.nonEnumArgs && object.length && isArguments(object)) {
+ object = slice.call(object);
+ }
+ var skipProto = support.enumPrototypes && typeof object == 'function',
+ skipErrorProps = support.enumErrorProps && (object === errorProto || object instanceof Error);
+
+ for (var key in object) {
+ if (!(skipProto && key == 'prototype') &&
+ !(skipErrorProps && (key == 'message' || key == 'name'))) {
+ result.push(key);
+ }
+ }
+
+ if (support.nonEnumShadows && object !== objectProto) {
+ var ctor = object.constructor,
+ index = -1,
+ length = dontEnumsLength;
+
+ if (object === (ctor && ctor.prototype)) {
+ var className = object === stringProto ? stringClass : object === errorProto ? errorClass : toString.call(object),
+ nonEnum = nonEnumProps[className];
+ }
+ while (++index < length) {
+ key = dontEnums[index];
+ if (!(nonEnum && nonEnum[key]) && hasOwnProperty.call(object, key)) {
+ result.push(key);
+ }
+ }
+ }
+ return result;
+ }
+
+ function internalFor(object, callback, keysFunc) {
+ var index = -1,
+ props = keysFunc(object),
+ length = props.length;
+
+ while (++index < length) {
+ var key = props[index];
+ if (callback(object[key], key, object) === false) {
+ break;
+ }
+ }
+ return object;
+ }
+
+ function internalForIn(object, callback) {
+ return internalFor(object, callback, keysIn);
+ }
+
+ function isNode(value) {
+ // IE < 9 presents DOM nodes as `Object` objects except they have `toString`
+ // methods that are `typeof` "string" and still can coerce nodes to strings
+ return typeof value.toString != 'function' && typeof (value + '') == 'string';
+ }
+
+ var isArguments = function(value) {
+ return (value && typeof value == 'object') ? toString.call(value) == argsClass : false;
+ }
+
+ // fallback for browsers that can't detect `arguments` objects by [[Class]]
+ if (!supportsArgsClass) {
+ isArguments = function(value) {
+ return (value && typeof value == 'object') ? hasOwnProperty.call(value, 'callee') : false;
+ };
+ }
+
+ var isEqual = Rx.internals.isEqual = function (x, y) {
+ return deepEquals(x, y, [], []);
+ };
+
+ /** @private
+ * Used for deep comparison
+ **/
+ function deepEquals(a, b, stackA, stackB) {
+ // exit early for identical values
+ if (a === b) {
+ // treat `+0` vs. `-0` as not equal
+ return a !== 0 || (1 / a == 1 / b);
+ }
+
+ var type = typeof a,
+ otherType = typeof b;
+
+ // exit early for unlike primitive values
+ if (a === a && (a == null || b == null ||
+ (type != 'function' && type != 'object' && otherType != 'function' && otherType != 'object'))) {
+ return false;
+ }
+
+ // compare [[Class]] names
+ var className = toString.call(a),
+ otherClass = toString.call(b);
+
+ if (className == argsClass) {
+ className = objectClass;
+ }
+ if (otherClass == argsClass) {
+ otherClass = objectClass;
+ }
+ if (className != otherClass) {
+ return false;
+ }
+ switch (className) {
+ case boolClass:
+ case dateClass:
+ // coerce dates and booleans to numbers, dates to milliseconds and booleans
+ // to `1` or `0` treating invalid dates coerced to `NaN` as not equal
+ return +a == +b;
+
+ case numberClass:
+ // treat `NaN` vs. `NaN` as equal
+ return (a != +a) ?
+ b != +b :
+ // but treat `-0` vs. `+0` as not equal
+ (a == 0 ? (1 / a == 1 / b) : a == +b);
+
+ case regexpClass:
+ case stringClass:
+ // coerce regexes to strings (http://es5.github.io/#x15.10.6.4)
+ // treat string primitives and their corresponding object instances as equal
+ return a == String(b);
+ }
+ var isArr = className == arrayClass;
+ if (!isArr) {
+
+ // exit for functions and DOM nodes
+ if (className != objectClass || (!support.nodeClass && (isNode(a) || isNode(b)))) {
+ return false;
+ }
+ // in older versions of Opera, `arguments` objects have `Array` constructors
+ var ctorA = !support.argsObject && isArguments(a) ? Object : a.constructor,
+ ctorB = !support.argsObject && isArguments(b) ? Object : b.constructor;
+
+ // non `Object` object instances with different constructors are not equal
+ if (ctorA != ctorB &&
+ !(hasOwnProperty.call(a, 'constructor') && hasOwnProperty.call(b, 'constructor')) &&
+ !(isFunction(ctorA) && ctorA instanceof ctorA && isFunction(ctorB) && ctorB instanceof ctorB) &&
+ ('constructor' in a && 'constructor' in b)
+ ) {
+ return false;
+ }
+ }
+ // assume cyclic structures are equal
+ // the algorithm for detecting cyclic structures is adapted from ES 5.1
+ // section 15.12.3, abstract operation `JO` (http://es5.github.io/#x15.12.3)
+ var initedStack = !stackA;
+ stackA || (stackA = []);
+ stackB || (stackB = []);
+
+ var length = stackA.length;
+ while (length--) {
+ if (stackA[length] == a) {
+ return stackB[length] == b;
+ }
+ }
+ var size = 0;
+ var result = true;
+
+ // add `a` and `b` to the stack of traversed objects
+ stackA.push(a);
+ stackB.push(b);
+
+ // recursively compare objects and arrays (susceptible to call stack limits)
+ if (isArr) {
+ // compare lengths to determine if a deep comparison is necessary
+ length = a.length;
+ size = b.length;
+ result = size == length;
+
+ if (result) {
+ // deep compare the contents, ignoring non-numeric properties
+ while (size--) {
+ var index = length,
+ value = b[size];
+
+ if (!(result = deepEquals(a[size], value, stackA, stackB))) {
+ break;
+ }
+ }
+ }
+ }
+ else {
+ // deep compare objects using `forIn`, instead of `forOwn`, to avoid `Object.keys`
+ // which, in this case, is more costly
+ internalForIn(b, function(value, key, b) {
+ if (hasOwnProperty.call(b, key)) {
+ // count the number of properties.
+ size++;
+ // deep compare each property value.
+ return (result = hasOwnProperty.call(a, key) && deepEquals(a[key], value, stackA, stackB));
+ }
+ });
+
+ if (result) {
+ // ensure both objects have the same number of properties
+ internalForIn(a, function(value, key, a) {
+ if (hasOwnProperty.call(a, key)) {
+ // `size` will be `-1` if `a` has more properties than `b`
+ return (result = --size > -1);
+ }
+ });
+ }
+ }
+ stackA.pop();
+ stackB.pop();
+
+ return result;
+ }
+
+ var hasProp = {}.hasOwnProperty,
+ slice = Array.prototype.slice;
+
+ var inherits = this.inherits = Rx.internals.inherits = function (child, parent) {
+ function __() { this.constructor = child; }
+ __.prototype = parent.prototype;
+ child.prototype = new __();
+ };
+
+ var addProperties = Rx.internals.addProperties = function (obj) {
+ for(var sources = [], i = 1, len = arguments.length; i < len; i++) { sources.push(arguments[i]); }
+ for (var idx = 0, ln = sources.length; idx < ln; idx++) {
+ var source = sources[idx];
+ for (var prop in source) {
+ obj[prop] = source[prop];
+ }
+ }
+ };
+
+ // Rx Utils
+ var addRef = Rx.internals.addRef = function (xs, r) {
+ return new AnonymousObservable(function (observer) {
+ return new CompositeDisposable(r.getDisposable(), xs.subscribe(observer));
+ });
+ };
+
+ function arrayInitialize(count, factory) {
+ var a = new Array(count);
+ for (var i = 0; i < count; i++) {
+ a[i] = factory();
+ }
+ return a;
+ }
+
+ var errorObj = {e: {}};
+ var tryCatchTarget;
+ function tryCatcher() {
+ try {
+ return tryCatchTarget.apply(this, arguments);
+ } catch (e) {
+ errorObj.e = e;
+ return errorObj;
+ }
+ }
+ function tryCatch(fn) {
+ if (!isFunction(fn)) { throw new TypeError('fn must be a function'); }
+ tryCatchTarget = fn;
+ return tryCatcher;
+ }
+ function thrower(e) {
+ throw e;
+ }
+
+ // Utilities
+ if (!Function.prototype.bind) {
+ Function.prototype.bind = function (that) {
+ var target = this,
+ args = slice.call(arguments, 1);
+ var bound = function () {
+ if (this instanceof bound) {
+ function F() { }
+ F.prototype = target.prototype;
+ var self = new F();
+ var result = target.apply(self, args.concat(slice.call(arguments)));
+ if (Object(result) === result) {
+ return result;
+ }
+ return self;
+ } else {
+ return target.apply(that, args.concat(slice.call(arguments)));
+ }
+ };
+
+ return bound;
+ };
+ }
+
+ if (!Array.prototype.forEach) {
+ Array.prototype.forEach = function (callback, thisArg) {
+ var T, k;
+
+ if (this == null) {
+ throw new TypeError(" this is null or not defined");
+ }
+
+ var O = Object(this);
+ var len = O.length >>> 0;
+
+ if (typeof callback !== "function") {
+ throw new TypeError(callback + " is not a function");
+ }
+
+ if (arguments.length > 1) {
+ T = thisArg;
+ }
+
+ k = 0;
+ while (k < len) {
+ var kValue;
+ if (k in O) {
+ kValue = O[k];
+ callback.call(T, kValue, k, O);
+ }
+ k++;
+ }
+ };
+ }
+
+ var boxedString = Object("a"),
+ splitString = boxedString[0] != "a" || !(0 in boxedString);
+ if (!Array.prototype.every) {
+ Array.prototype.every = function every(fun /*, thisp */) {
+ var object = Object(this),
+ self = splitString && {}.toString.call(this) == stringClass ?
+ this.split("") :
+ object,
+ length = self.length >>> 0,
+ thisp = arguments[1];
+
+ if ({}.toString.call(fun) != funcClass) {
+ throw new TypeError(fun + " is not a function");
+ }
+
+ for (var i = 0; i < length; i++) {
+ if (i in self && !fun.call(thisp, self[i], i, object)) {
+ return false;
+ }
+ }
+ return true;
+ };
+ }
+
+ if (!Array.prototype.map) {
+ Array.prototype.map = function map(fun /*, thisp*/) {
+ var object = Object(this),
+ self = splitString && {}.toString.call(this) == stringClass ?
+ this.split("") :
+ object,
+ length = self.length >>> 0,
+ result = Array(length),
+ thisp = arguments[1];
+
+ if ({}.toString.call(fun) != funcClass) {
+ throw new TypeError(fun + " is not a function");
+ }
+
+ for (var i = 0; i < length; i++) {
+ if (i in self) {
+ result[i] = fun.call(thisp, self[i], i, object);
+ }
+ }
+ return result;
+ };
+ }
+
+ if (!Array.prototype.filter) {
+ Array.prototype.filter = function (predicate) {
+ var results = [], item, t = new Object(this);
+ for (var i = 0, len = t.length >>> 0; i < len; i++) {
+ item = t[i];
+ if (i in t && predicate.call(arguments[1], item, i, t)) {
+ results.push(item);
+ }
+ }
+ return results;
+ };
+ }
+
+ if (!Array.isArray) {
+ Array.isArray = function (arg) {
+ return {}.toString.call(arg) == arrayClass;
+ };
+ }
+
+ if (!Array.prototype.indexOf) {
+ Array.prototype.indexOf = function indexOf(searchElement) {
+ var t = Object(this);
+ var len = t.length >>> 0;
+ if (len === 0) {
+ return -1;
+ }
+ var n = 0;
+ if (arguments.length > 1) {
+ n = Number(arguments[1]);
+ if (n !== n) {
+ n = 0;
+ } else if (n !== 0 && n != Infinity && n !== -Infinity) {
+ n = (n > 0 || -1) * Math.floor(Math.abs(n));
+ }
+ }
+ if (n >= len) {
+ return -1;
+ }
+ var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0);
+ for (; k < len; k++) {
+ if (k in t && t[k] === searchElement) {
+ return k;
+ }
+ }
+ return -1;
+ };
+ }
+
+ // Fix for Tessel
+ if (!Object.prototype.propertyIsEnumerable) {
+ Object.prototype.propertyIsEnumerable = function (key) {
+ for (var k in this) { if (k === key) { return true; } }
+ return false;
+ };
+ }
+
+ if (!Object.keys) {
+ Object.keys = (function() {
+ 'use strict';
+ var hasOwnProperty = Object.prototype.hasOwnProperty,
+ hasDontEnumBug = !({ toString: null }).propertyIsEnumerable('toString');
+
+ return function(obj) {
+ if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) {
+ throw new TypeError('Object.keys called on non-object');
+ }
+
+ var result = [], prop, i;
+
+ for (prop in obj) {
+ if (hasOwnProperty.call(obj, prop)) {
+ result.push(prop);
+ }
+ }
+
+ if (hasDontEnumBug) {
+ for (i = 0; i < dontEnumsLength; i++) {
+ if (hasOwnProperty.call(obj, dontEnums[i])) {
+ result.push(dontEnums[i]);
+ }
+ }
+ }
+ return result;
+ };
+ }());
+ }
+
+ // Collections
+ function IndexedItem(id, value) {
+ this.id = id;
+ this.value = value;
+ }
+
+ IndexedItem.prototype.compareTo = function (other) {
+ var c = this.value.compareTo(other.value);
+ c === 0 && (c = this.id - other.id);
+ return c;
+ };
+
+ // Priority Queue for Scheduling
+ var PriorityQueue = Rx.internals.PriorityQueue = function (capacity) {
+ this.items = new Array(capacity);
+ this.length = 0;
+ };
+
+ var priorityProto = PriorityQueue.prototype;
+ priorityProto.isHigherPriority = function (left, right) {
+ return this.items[left].compareTo(this.items[right]) < 0;
+ };
+
+ priorityProto.percolate = function (index) {
+ if (index >= this.length || index < 0) { return; }
+ var parent = index - 1 >> 1;
+ if (parent < 0 || parent === index) { return; }
+ if (this.isHigherPriority(index, parent)) {
+ var temp = this.items[index];
+ this.items[index] = this.items[parent];
+ this.items[parent] = temp;
+ this.percolate(parent);
+ }
+ };
+
+ priorityProto.heapify = function (index) {
+ +index || (index = 0);
+ if (index >= this.length || index < 0) { return; }
+ var left = 2 * index + 1,
+ right = 2 * index + 2,
+ first = index;
+ if (left < this.length && this.isHigherPriority(left, first)) {
+ first = left;
+ }
+ if (right < this.length && this.isHigherPriority(right, first)) {
+ first = right;
+ }
+ if (first !== index) {
+ var temp = this.items[index];
+ this.items[index] = this.items[first];
+ this.items[first] = temp;
+ this.heapify(first);
+ }
+ };
+
+ priorityProto.peek = function () { return this.items[0].value; };
+
+ priorityProto.removeAt = function (index) {
+ this.items[index] = this.items[--this.length];
+ this.items[this.length] = undefined;
+ this.heapify();
+ };
+
+ priorityProto.dequeue = function () {
+ var result = this.peek();
+ this.removeAt(0);
+ return result;
+ };
+
+ priorityProto.enqueue = function (item) {
+ var index = this.length++;
+ this.items[index] = new IndexedItem(PriorityQueue.count++, item);
+ this.percolate(index);
+ };
+
+ priorityProto.remove = function (item) {
+ for (var i = 0; i < this.length; i++) {
+ if (this.items[i].value === item) {
+ this.removeAt(i);
+ return true;
+ }
+ }
+ return false;
+ };
+ PriorityQueue.count = 0;
+
+ /**
+ * Represents a group of disposable resources that are disposed together.
+ * @constructor
+ */
+ var CompositeDisposable = Rx.CompositeDisposable = function () {
+ var args = [], i, len;
+ if (Array.isArray(arguments[0])) {
+ args = arguments[0];
+ len = args.length;
+ } else {
+ len = arguments.length;
+ args = new Array(len);
+ for(i = 0; i < len; i++) { args[i] = arguments[i]; }
+ }
+ for(i = 0; i < len; i++) {
+ if (!isDisposable(args[i])) { throw new TypeError('Not a disposable'); }
+ }
+ this.disposables = args;
+ this.isDisposed = false;
+ this.length = args.length;
+ };
+
+ var CompositeDisposablePrototype = CompositeDisposable.prototype;
+
+ /**
+ * Adds a disposable to the CompositeDisposable or disposes the disposable if the CompositeDisposable is disposed.
+ * @param {Mixed} item Disposable to add.
+ */
+ CompositeDisposablePrototype.add = function (item) {
+ if (this.isDisposed) {
+ item.dispose();
+ } else {
+ this.disposables.push(item);
+ this.length++;
+ }
+ };
+
+ /**
+ * Removes and disposes the first occurrence of a disposable from the CompositeDisposable.
+ * @param {Mixed} item Disposable to remove.
+ * @returns {Boolean} true if found; false otherwise.
+ */
+ CompositeDisposablePrototype.remove = function (item) {
+ var shouldDispose = false;
+ if (!this.isDisposed) {
+ var idx = this.disposables.indexOf(item);
+ if (idx !== -1) {
+ shouldDispose = true;
+ this.disposables.splice(idx, 1);
+ this.length--;
+ item.dispose();
+ }
+ }
+ return shouldDispose;
+ };
+
+ /**
+ * Disposes all disposables in the group and removes them from the group.
+ */
+ CompositeDisposablePrototype.dispose = function () {
+ if (!this.isDisposed) {
+ this.isDisposed = true;
+ var len = this.disposables.length, currentDisposables = new Array(len);
+ for(var i = 0; i < len; i++) { currentDisposables[i] = this.disposables[i]; }
+ this.disposables = [];
+ this.length = 0;
+
+ for (i = 0; i < len; i++) {
+ currentDisposables[i].dispose();
+ }
+ }
+ };
+
+ /**
+ * Provides a set of static methods for creating Disposables.
+ * @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once.
+ */
+ var Disposable = Rx.Disposable = function (action) {
+ this.isDisposed = false;
+ this.action = action || noop;
+ };
+
+ /** Performs the task of cleaning up resources. */
+ Disposable.prototype.dispose = function () {
+ if (!this.isDisposed) {
+ this.action();
+ this.isDisposed = true;
+ }
+ };
+
+ /**
+ * Creates a disposable object that invokes the specified action when disposed.
+ * @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once.
+ * @return {Disposable} The disposable object that runs the given action upon disposal.
+ */
+ var disposableCreate = Disposable.create = function (action) { return new Disposable(action); };
+
+ /**
+ * Gets the disposable that does nothing when disposed.
+ */
+ var disposableEmpty = Disposable.empty = { dispose: noop };
+
+ /**
+ * Validates whether the given object is a disposable
+ * @param {Object} Object to test whether it has a dispose method
+ * @returns {Boolean} true if a disposable object, else false.
+ */
+ var isDisposable = Disposable.isDisposable = function (d) {
+ return d && isFunction(d.dispose);
+ };
+
+ var checkDisposed = Disposable.checkDisposed = function (disposable) {
+ if (disposable.isDisposed) { throw new ObjectDisposedError(); }
+ };
+
+ // Single assignment
+ var SingleAssignmentDisposable = Rx.SingleAssignmentDisposable = function () {
+ this.isDisposed = false;
+ this.current = null;
+ };
+ SingleAssignmentDisposable.prototype.getDisposable = function () {
+ return this.current;
+ };
+ SingleAssignmentDisposable.prototype.setDisposable = function (value) {
+ if (this.current) { throw new Error('Disposable has already been assigned'); }
+ var shouldDispose = this.isDisposed;
+ !shouldDispose && (this.current = value);
+ shouldDispose && value && value.dispose();
+ };
+ SingleAssignmentDisposable.prototype.dispose = function () {
+ if (!this.isDisposed) {
+ this.isDisposed = true;
+ var old = this.current;
+ this.current = null;
+ }
+ old && old.dispose();
+ };
+
+ // Multiple assignment disposable
+ var SerialDisposable = Rx.SerialDisposable = function () {
+ this.isDisposed = false;
+ this.current = null;
+ };
+ SerialDisposable.prototype.getDisposable = function () {
+ return this.current;
+ };
+ SerialDisposable.prototype.setDisposable = function (value) {
+ var shouldDispose = this.isDisposed;
+ if (!shouldDispose) {
+ var old = this.current;
+ this.current = value;
+ }
+ old && old.dispose();
+ shouldDispose && value && value.dispose();
+ };
+ SerialDisposable.prototype.dispose = function () {
+ if (!this.isDisposed) {
+ this.isDisposed = true;
+ var old = this.current;
+ this.current = null;
+ }
+ old && old.dispose();
+ };
+
+ /**
+ * Represents a disposable resource that only disposes its underlying disposable resource when all dependent disposable objects have been disposed.
+ */
+ var RefCountDisposable = Rx.RefCountDisposable = (function () {
+
+ function InnerDisposable(disposable) {
+ this.disposable = disposable;
+ this.disposable.count++;
+ this.isInnerDisposed = false;
+ }
+
+ InnerDisposable.prototype.dispose = function () {
+ if (!this.disposable.isDisposed && !this.isInnerDisposed) {
+ this.isInnerDisposed = true;
+ this.disposable.count--;
+ if (this.disposable.count === 0 && this.disposable.isPrimaryDisposed) {
+ this.disposable.isDisposed = true;
+ this.disposable.underlyingDisposable.dispose();
+ }
+ }
+ };
+
+ /**
+ * Initializes a new instance of the RefCountDisposable with the specified disposable.
+ * @constructor
+ * @param {Disposable} disposable Underlying disposable.
+ */
+ function RefCountDisposable(disposable) {
+ this.underlyingDisposable = disposable;
+ this.isDisposed = false;
+ this.isPrimaryDisposed = false;
+ this.count = 0;
+ }
+
+ /**
+ * Disposes the underlying disposable only when all dependent disposables have been disposed
+ */
+ RefCountDisposable.prototype.dispose = function () {
+ if (!this.isDisposed && !this.isPrimaryDisposed) {
+ this.isPrimaryDisposed = true;
+ if (this.count === 0) {
+ this.isDisposed = true;
+ this.underlyingDisposable.dispose();
+ }
+ }
+ };
+
+ /**
+ * Returns a dependent disposable that when disposed decreases the refcount on the underlying disposable.
+ * @returns {Disposable} A dependent disposable contributing to the reference count that manages the underlying disposable's lifetime.
+ */
+ RefCountDisposable.prototype.getDisposable = function () {
+ return this.isDisposed ? disposableEmpty : new InnerDisposable(this);
+ };
+
+ return RefCountDisposable;
+ })();
+
+ function ScheduledDisposable(scheduler, disposable) {
+ this.scheduler = scheduler;
+ this.disposable = disposable;
+ this.isDisposed = false;
+ }
+
+ function scheduleItem(s, self) {
+ if (!self.isDisposed) {
+ self.isDisposed = true;
+ self.disposable.dispose();
+ }
+ }
+
+ ScheduledDisposable.prototype.dispose = function () {
+ this.scheduler.scheduleWithState(this, scheduleItem);
+ };
+
+ var ScheduledItem = Rx.internals.ScheduledItem = function (scheduler, state, action, dueTime, comparer) {
+ this.scheduler = scheduler;
+ this.state = state;
+ this.action = action;
+ this.dueTime = dueTime;
+ this.comparer = comparer || defaultSubComparer;
+ this.disposable = new SingleAssignmentDisposable();
+ }
+
+ ScheduledItem.prototype.invoke = function () {
+ this.disposable.setDisposable(this.invokeCore());
+ };
+
+ ScheduledItem.prototype.compareTo = function (other) {
+ return this.comparer(this.dueTime, other.dueTime);
+ };
+
+ ScheduledItem.prototype.isCancelled = function () {
+ return this.disposable.isDisposed;
+ };
+
+ ScheduledItem.prototype.invokeCore = function () {
+ return this.action(this.scheduler, this.state);
+ };
+
+ /** Provides a set of static properties to access commonly used schedulers. */
+ var Scheduler = Rx.Scheduler = (function () {
+
+ function Scheduler(now, schedule, scheduleRelative, scheduleAbsolute) {
+ this.now = now;
+ this._schedule = schedule;
+ this._scheduleRelative = scheduleRelative;
+ this._scheduleAbsolute = scheduleAbsolute;
+ }
+
+ /** Determines whether the given object is a scheduler */
+ Scheduler.isScheduler = function (s) {
+ return s instanceof Scheduler;
+ }
+
+ function invokeAction(scheduler, action) {
+ action();
+ return disposableEmpty;
+ }
+
+ var schedulerProto = Scheduler.prototype;
+
+ /**
+ * Schedules an action to be executed.
+ * @param {Function} action Action to execute.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.schedule = function (action) {
+ return this._schedule(action, invokeAction);
+ };
+
+ /**
+ * Schedules an action to be executed.
+ * @param state State passed to the action to be executed.
+ * @param {Function} action Action to be executed.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleWithState = function (state, action) {
+ return this._schedule(state, action);
+ };
+
+ /**
+ * Schedules an action to be executed after the specified relative due time.
+ * @param {Function} action Action to execute.
+ * @param {Number} dueTime Relative time after which to execute the action.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleWithRelative = function (dueTime, action) {
+ return this._scheduleRelative(action, dueTime, invokeAction);
+ };
+
+ /**
+ * Schedules an action to be executed after dueTime.
+ * @param state State passed to the action to be executed.
+ * @param {Function} action Action to be executed.
+ * @param {Number} dueTime Relative time after which to execute the action.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleWithRelativeAndState = function (state, dueTime, action) {
+ return this._scheduleRelative(state, dueTime, action);
+ };
+
+ /**
+ * Schedules an action to be executed at the specified absolute due time.
+ * @param {Function} action Action to execute.
+ * @param {Number} dueTime Absolute time at which to execute the action.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleWithAbsolute = function (dueTime, action) {
+ return this._scheduleAbsolute(action, dueTime, invokeAction);
+ };
+
+ /**
+ * Schedules an action to be executed at dueTime.
+ * @param {Mixed} state State passed to the action to be executed.
+ * @param {Function} action Action to be executed.
+ * @param {Number}dueTime Absolute time at which to execute the action.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleWithAbsoluteAndState = function (state, dueTime, action) {
+ return this._scheduleAbsolute(state, dueTime, action);
+ };
+
+ /** Gets the current time according to the local machine's system clock. */
+ Scheduler.now = defaultNow;
+
+ /**
+ * Normalizes the specified TimeSpan value to a positive value.
+ * @param {Number} timeSpan The time span value to normalize.
+ * @returns {Number} The specified TimeSpan value if it is zero or positive; otherwise, 0
+ */
+ Scheduler.normalize = function (timeSpan) {
+ timeSpan < 0 && (timeSpan = 0);
+ return timeSpan;
+ };
+
+ return Scheduler;
+ }());
+
+ var normalizeTime = Scheduler.normalize, isScheduler = Scheduler.isScheduler;
+
+ (function (schedulerProto) {
+
+ function invokeRecImmediate(scheduler, pair) {
+ var state = pair[0], action = pair[1], group = new CompositeDisposable();
+
+ function recursiveAction(state1) {
+ action(state1, function (state2) {
+ var isAdded = false, isDone = false,
+ d = scheduler.scheduleWithState(state2, function (scheduler1, state3) {
+ if (isAdded) {
+ group.remove(d);
+ } else {
+ isDone = true;
+ }
+ recursiveAction(state3);
+ return disposableEmpty;
+ });
+ if (!isDone) {
+ group.add(d);
+ isAdded = true;
+ }
+ });
+ }
+ recursiveAction(state);
+ return group;
+ }
+
+ function invokeRecDate(scheduler, pair, method) {
+ var state = pair[0], action = pair[1], group = new CompositeDisposable();
+ function recursiveAction(state1) {
+ action(state1, function (state2, dueTime1) {
+ var isAdded = false, isDone = false,
+ d = scheduler[method](state2, dueTime1, function (scheduler1, state3) {
+ if (isAdded) {
+ group.remove(d);
+ } else {
+ isDone = true;
+ }
+ recursiveAction(state3);
+ return disposableEmpty;
+ });
+ if (!isDone) {
+ group.add(d);
+ isAdded = true;
+ }
+ });
+ };
+ recursiveAction(state);
+ return group;
+ }
+
+ function scheduleInnerRecursive(action, self) {
+ action(function(dt) { self(action, dt); });
+ }
+
+ /**
+ * Schedules an action to be executed recursively.
+ * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleRecursive = function (action) {
+ return this.scheduleRecursiveWithState(action, scheduleInnerRecursive);
+ };
+
+ /**
+ * Schedules an action to be executed recursively.
+ * @param {Mixed} state State passed to the action to be executed.
+ * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in recursive invocation state.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleRecursiveWithState = function (state, action) {
+ return this.scheduleWithState([state, action], invokeRecImmediate);
+ };
+
+ /**
+ * Schedules an action to be executed recursively after a specified relative due time.
+ * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified relative time.
+ * @param {Number}dueTime Relative time after which to execute the action for the first time.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleRecursiveWithRelative = function (dueTime, action) {
+ return this.scheduleRecursiveWithRelativeAndState(action, dueTime, scheduleInnerRecursive);
+ };
+
+ /**
+ * Schedules an action to be executed recursively after a specified relative due time.
+ * @param {Mixed} state State passed to the action to be executed.
+ * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state.
+ * @param {Number}dueTime Relative time after which to execute the action for the first time.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleRecursiveWithRelativeAndState = function (state, dueTime, action) {
+ return this._scheduleRelative([state, action], dueTime, function (s, p) {
+ return invokeRecDate(s, p, 'scheduleWithRelativeAndState');
+ });
+ };
+
+ /**
+ * Schedules an action to be executed recursively at a specified absolute due time.
+ * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified absolute time.
+ * @param {Number}dueTime Absolute time at which to execute the action for the first time.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleRecursiveWithAbsolute = function (dueTime, action) {
+ return this.scheduleRecursiveWithAbsoluteAndState(action, dueTime, scheduleInnerRecursive);
+ };
+
+ /**
+ * Schedules an action to be executed recursively at a specified absolute due time.
+ * @param {Mixed} state State passed to the action to be executed.
+ * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state.
+ * @param {Number}dueTime Absolute time at which to execute the action for the first time.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleRecursiveWithAbsoluteAndState = function (state, dueTime, action) {
+ return this._scheduleAbsolute([state, action], dueTime, function (s, p) {
+ return invokeRecDate(s, p, 'scheduleWithAbsoluteAndState');
+ });
+ };
+ }(Scheduler.prototype));
+
+ (function (schedulerProto) {
+
+ /**
+ * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation.
+ * @param {Number} period Period for running the work periodically.
+ * @param {Function} action Action to be executed.
+ * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort).
+ */
+ Scheduler.prototype.schedulePeriodic = function (period, action) {
+ return this.schedulePeriodicWithState(null, period, action);
+ };
+
+ /**
+ * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation.
+ * @param {Mixed} state Initial state passed to the action upon the first iteration.
+ * @param {Number} period Period for running the work periodically.
+ * @param {Function} action Action to be executed, potentially updating the state.
+ * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort).
+ */
+ Scheduler.prototype.schedulePeriodicWithState = function(state, period, action) {
+ if (typeof root.setInterval === 'undefined') { throw new NotSupportedError(); }
+ period = normalizeTime(period);
+ var s = state, id = root.setInterval(function () { s = action(s); }, period);
+ return disposableCreate(function () { root.clearInterval(id); });
+ };
+
+ }(Scheduler.prototype));
+
+ (function (schedulerProto) {
+ /**
+ * Returns a scheduler that wraps the original scheduler, adding exception handling for scheduled actions.
+ * @param {Function} handler Handler that's run if an exception is caught. The exception will be rethrown if the handler returns false.
+ * @returns {Scheduler} Wrapper around the original scheduler, enforcing exception handling.
+ */
+ schedulerProto.catchError = schedulerProto['catch'] = function (handler) {
+ return new CatchScheduler(this, handler);
+ };
+ }(Scheduler.prototype));
+
+ var SchedulePeriodicRecursive = Rx.internals.SchedulePeriodicRecursive = (function () {
+ function tick(command, recurse) {
+ recurse(0, this._period);
+ try {
+ this._state = this._action(this._state);
+ } catch (e) {
+ this._cancel.dispose();
+ throw e;
+ }
+ }
+
+ function SchedulePeriodicRecursive(scheduler, state, period, action) {
+ this._scheduler = scheduler;
+ this._state = state;
+ this._period = period;
+ this._action = action;
+ }
+
+ SchedulePeriodicRecursive.prototype.start = function () {
+ var d = new SingleAssignmentDisposable();
+ this._cancel = d;
+ d.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0, this._period, tick.bind(this)));
+
+ return d;
+ };
+
+ return SchedulePeriodicRecursive;
+ }());
+
+ /** Gets a scheduler that schedules work immediately on the current thread. */
+ var immediateScheduler = Scheduler.immediate = (function () {
+ function scheduleNow(state, action) { return action(this, state); }
+ return new Scheduler(defaultNow, scheduleNow, notSupported, notSupported);
+ }());
+
+ /**
+ * Gets a scheduler that schedules work as soon as possible on the current thread.
+ */
+ var currentThreadScheduler = Scheduler.currentThread = (function () {
+ var queue;
+
+ function runTrampoline () {
+ while (queue.length > 0) {
+ var item = queue.dequeue();
+ !item.isCancelled() && item.invoke();
+ }
+ }
+
+ function scheduleNow(state, action) {
+ var si = new ScheduledItem(this, state, action, this.now());
+
+ if (!queue) {
+ queue = new PriorityQueue(4);
+ queue.enqueue(si);
+
+ var result = tryCatch(runTrampoline)();
+ queue = null;
+ if (result === errorObj) { return thrower(result.e); }
+ } else {
+ queue.enqueue(si);
+ }
+ return si.disposable;
+ }
+
+ var currentScheduler = new Scheduler(defaultNow, scheduleNow, notSupported, notSupported);
+ currentScheduler.scheduleRequired = function () { return !queue; };
+
+ return currentScheduler;
+ }());
+
+ var scheduleMethod, clearMethod;
+
+ var localTimer = (function () {
+ var localSetTimeout, localClearTimeout = noop;
+ if (!!root.setTimeout) {
+ localSetTimeout = root.setTimeout;
+ localClearTimeout = root.clearTimeout;
+ } else if (!!root.WScript) {
+ localSetTimeout = function (fn, time) {
+ root.WScript.Sleep(time);
+ fn();
+ };
+ } else {
+ throw new NotSupportedError();
+ }
+
+ return {
+ setTimeout: localSetTimeout,
+ clearTimeout: localClearTimeout
+ };
+ }());
+ var localSetTimeout = localTimer.setTimeout,
+ localClearTimeout = localTimer.clearTimeout;
+
+ (function () {
+
+ var nextHandle = 1, tasksByHandle = {}, currentlyRunning = false;
+
+ clearMethod = function (handle) {
+ delete tasksByHandle[handle];
+ };
+
+ function runTask(handle) {
+ if (currentlyRunning) {
+ localSetTimeout(function () { runTask(handle) }, 0);
+ } else {
+ var task = tasksByHandle[handle];
+ if (task) {
+ currentlyRunning = true;
+ var result = tryCatch(task)();
+ clearMethod(handle);
+ currentlyRunning = false;
+ if (result === errorObj) { return thrower(result.e); }
+ }
+ }
+ }
+
+ var reNative = RegExp('^' +
+ String(toString)
+ .replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
+ .replace(/toString| for [^\]]+/g, '.*?') + '$'
+ );
+
+ var setImmediate = typeof (setImmediate = freeGlobal && moduleExports && freeGlobal.setImmediate) == 'function' &&
+ !reNative.test(setImmediate) && setImmediate;
+
+ function postMessageSupported () {
+ // Ensure not in a worker
+ if (!root.postMessage || root.importScripts) { return false; }
+ var isAsync = false, oldHandler = root.onmessage;
+ // Test for async
+ root.onmessage = function () { isAsync = true; };
+ root.postMessage('', '*');
+ root.onmessage = oldHandler;
+
+ return isAsync;
+ }
+
+ // Use in order, setImmediate, nextTick, postMessage, MessageChannel, script readystatechanged, setTimeout
+ if (isFunction(setImmediate)) {
+ scheduleMethod = function (action) {
+ var id = nextHandle++;
+ tasksByHandle[id] = action;
+ setImmediate(function () { runTask(id); });
+
+ return id;
+ };
+ } else if (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]') {
+ scheduleMethod = function (action) {
+ var id = nextHandle++;
+ tasksByHandle[id] = action;
+ process.nextTick(function () { runTask(id); });
+
+ return id;
+ };
+ } else if (postMessageSupported()) {
+ var MSG_PREFIX = 'ms.rx.schedule' + Math.random();
+
+ function onGlobalPostMessage(event) {
+ // Only if we're a match to avoid any other global events
+ if (typeof event.data === 'string' && event.data.substring(0, MSG_PREFIX.length) === MSG_PREFIX) {
+ runTask(event.data.substring(MSG_PREFIX.length));
+ }
+ }
+
+ if (root.addEventListener) {
+ root.addEventListener('message', onGlobalPostMessage, false);
+ } else if (root.attachEvent) {
+ root.attachEvent('onmessage', onGlobalPostMessage);
+ } else {
+ root.onmessage = onGlobalPostMessage;
+ }
+
+ scheduleMethod = function (action) {
+ var id = nextHandle++;
+ tasksByHandle[id] = action;
+ root.postMessage(MSG_PREFIX + currentId, '*');
+ return id;
+ };
+ } else if (!!root.MessageChannel) {
+ var channel = new root.MessageChannel();
+
+ channel.port1.onmessage = function (e) { runTask(e.data); };
+
+ scheduleMethod = function (action) {
+ var id = nextHandle++;
+ tasksByHandle[id] = action;
+ channel.port2.postMessage(id);
+ return id;
+ };
+ } else if ('document' in root && 'onreadystatechange' in root.document.createElement('script')) {
+
+ scheduleMethod = function (action) {
+ var scriptElement = root.document.createElement('script');
+ var id = nextHandle++;
+ tasksByHandle[id] = action;
+
+ scriptElement.onreadystatechange = function () {
+ runTask(id);
+ scriptElement.onreadystatechange = null;
+ scriptElement.parentNode.removeChild(scriptElement);
+ scriptElement = null;
+ };
+ root.document.documentElement.appendChild(scriptElement);
+ return id;
+ };
+
+ } else {
+ scheduleMethod = function (action) {
+ var id = nextHandle++;
+ tasksByHandle[id] = action;
+ localSetTimeout(function () {
+ runTask(id);
+ }, 0);
+
+ return id;
+ };
+ }
+ }());
+
+ /**
+ * Gets a scheduler that schedules work via a timed callback based upon platform.
+ */
+ var timeoutScheduler = Scheduler.timeout = Scheduler['default'] = (function () {
+
+ function scheduleNow(state, action) {
+ var scheduler = this, disposable = new SingleAssignmentDisposable();
+ var id = scheduleMethod(function () {
+ !disposable.isDisposed && disposable.setDisposable(action(scheduler, state));
+ });
+ return new CompositeDisposable(disposable, disposableCreate(function () {
+ clearMethod(id);
+ }));
+ }
+
+ function scheduleRelative(state, dueTime, action) {
+ var scheduler = this, dt = Scheduler.normalize(dueTime), disposable = new SingleAssignmentDisposable();
+ if (dt === 0) { return scheduler.scheduleWithState(state, action); }
+ var id = localSetTimeout(function () {
+ !disposable.isDisposed && disposable.setDisposable(action(scheduler, state));
+ }, dt);
+ return new CompositeDisposable(disposable, disposableCreate(function () {
+ localClearTimeout(id);
+ }));
+ }
+
+ function scheduleAbsolute(state, dueTime, action) {
+ return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action);
+ }
+
+ return new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute);
+ })();
+
+ var CatchScheduler = (function (__super__) {
+
+ function scheduleNow(state, action) {
+ return this._scheduler.scheduleWithState(state, this._wrap(action));
+ }
+
+ function scheduleRelative(state, dueTime, action) {
+ return this._scheduler.scheduleWithRelativeAndState(state, dueTime, this._wrap(action));
+ }
+
+ function scheduleAbsolute(state, dueTime, action) {
+ return this._scheduler.scheduleWithAbsoluteAndState(state, dueTime, this._wrap(action));
+ }
+
+ inherits(CatchScheduler, __super__);
+
+ function CatchScheduler(scheduler, handler) {
+ this._scheduler = scheduler;
+ this._handler = handler;
+ this._recursiveOriginal = null;
+ this._recursiveWrapper = null;
+ __super__.call(this, this._scheduler.now.bind(this._scheduler), scheduleNow, scheduleRelative, scheduleAbsolute);
+ }
+
+ CatchScheduler.prototype._clone = function (scheduler) {
+ return new CatchScheduler(scheduler, this._handler);
+ };
+
+ CatchScheduler.prototype._wrap = function (action) {
+ var parent = this;
+ return function (self, state) {
+ try {
+ return action(parent._getRecursiveWrapper(self), state);
+ } catch (e) {
+ if (!parent._handler(e)) { throw e; }
+ return disposableEmpty;
+ }
+ };
+ };
+
+ CatchScheduler.prototype._getRecursiveWrapper = function (scheduler) {
+ if (this._recursiveOriginal !== scheduler) {
+ this._recursiveOriginal = scheduler;
+ var wrapper = this._clone(scheduler);
+ wrapper._recursiveOriginal = scheduler;
+ wrapper._recursiveWrapper = wrapper;
+ this._recursiveWrapper = wrapper;
+ }
+ return this._recursiveWrapper;
+ };
+
+ CatchScheduler.prototype.schedulePeriodicWithState = function (state, period, action) {
+ var self = this, failed = false, d = new SingleAssignmentDisposable();
+
+ d.setDisposable(this._scheduler.schedulePeriodicWithState(state, period, function (state1) {
+ if (failed) { return null; }
+ try {
+ return action(state1);
+ } catch (e) {
+ failed = true;
+ if (!self._handler(e)) { throw e; }
+ d.dispose();
+ return null;
+ }
+ }));
+
+ return d;
+ };
+
+ return CatchScheduler;
+ }(Scheduler));
+
+ /**
+ * Represents a notification to an observer.
+ */
+ var Notification = Rx.Notification = (function () {
+ function Notification(kind, value, exception, accept, acceptObservable, toString) {
+ this.kind = kind;
+ this.value = value;
+ this.exception = exception;
+ this._accept = accept;
+ this._acceptObservable = acceptObservable;
+ this.toString = toString;
+ }
+
+ /**
+ * Invokes the delegate corresponding to the notification or the observer's method corresponding to the notification and returns the produced result.
+ *
+ * @memberOf Notification
+ * @param {Any} observerOrOnNext Delegate to invoke for an OnNext notification or Observer to invoke the notification on..
+ * @param {Function} onError Delegate to invoke for an OnError notification.
+ * @param {Function} onCompleted Delegate to invoke for an OnCompleted notification.
+ * @returns {Any} Result produced by the observation.
+ */
+ Notification.prototype.accept = function (observerOrOnNext, onError, onCompleted) {
+ return observerOrOnNext && typeof observerOrOnNext === 'object' ?
+ this._acceptObservable(observerOrOnNext) :
+ this._accept(observerOrOnNext, onError, onCompleted);
+ };
+
+ /**
+ * Returns an observable sequence with a single notification.
+ *
+ * @memberOf Notifications
+ * @param {Scheduler} [scheduler] Scheduler to send out the notification calls on.
+ * @returns {Observable} The observable sequence that surfaces the behavior of the notification upon subscription.
+ */
+ Notification.prototype.toObservable = function (scheduler) {
+ var self = this;
+ isScheduler(scheduler) || (scheduler = immediateScheduler);
+ return new AnonymousObservable(function (observer) {
+ return scheduler.scheduleWithState(self, function (_, notification) {
+ notification._acceptObservable(observer);
+ notification.kind === 'N' && observer.onCompleted();
+ });
+ });
+ };
+
+ return Notification;
+ })();
+
+ /**
+ * Creates an object that represents an OnNext notification to an observer.
+ * @param {Any} value The value contained in the notification.
+ * @returns {Notification} The OnNext notification containing the value.
+ */
+ var notificationCreateOnNext = Notification.createOnNext = (function () {
+ function _accept(onNext) { return onNext(this.value); }
+ function _acceptObservable(observer) { return observer.onNext(this.value); }
+ function toString() { return 'OnNext(' + this.value + ')'; }
+
+ return function (value) {
+ return new Notification('N', value, null, _accept, _acceptObservable, toString);
+ };
+ }());
+
+ /**
+ * Creates an object that represents an OnError notification to an observer.
+ * @param {Any} error The exception contained in the notification.
+ * @returns {Notification} The OnError notification containing the exception.
+ */
+ var notificationCreateOnError = Notification.createOnError = (function () {
+ function _accept (onNext, onError) { return onError(this.exception); }
+ function _acceptObservable(observer) { return observer.onError(this.exception); }
+ function toString () { return 'OnError(' + this.exception + ')'; }
+
+ return function (e) {
+ return new Notification('E', null, e, _accept, _acceptObservable, toString);
+ };
+ }());
+
+ /**
+ * Creates an object that represents an OnCompleted notification to an observer.
+ * @returns {Notification} The OnCompleted notification.
+ */
+ var notificationCreateOnCompleted = Notification.createOnCompleted = (function () {
+ function _accept (onNext, onError, onCompleted) { return onCompleted(); }
+ function _acceptObservable(observer) { return observer.onCompleted(); }
+ function toString () { return 'OnCompleted()'; }
+
+ return function () {
+ return new Notification('C', null, null, _accept, _acceptObservable, toString);
+ };
+ }());
+
+ /**
+ * Supports push-style iteration over an observable sequence.
+ */
+ var Observer = Rx.Observer = function () { };
+
+ /**
+ * Creates a notification callback from an observer.
+ * @returns The action that forwards its input notification to the underlying observer.
+ */
+ Observer.prototype.toNotifier = function () {
+ var observer = this;
+ return function (n) { return n.accept(observer); };
+ };
+
+ /**
+ * Hides the identity of an observer.
+ * @returns An observer that hides the identity of the specified observer.
+ */
+ Observer.prototype.asObserver = function () {
+ return new AnonymousObserver(this.onNext.bind(this), this.onError.bind(this), this.onCompleted.bind(this));
+ };
+
+ /**
+ * Checks access to the observer for grammar violations. This includes checking for multiple OnError or OnCompleted calls, as well as reentrancy in any of the observer methods.
+ * If a violation is detected, an Error is thrown from the offending observer method call.
+ * @returns An observer that checks callbacks invocations against the observer grammar and, if the checks pass, forwards those to the specified observer.
+ */
+ Observer.prototype.checked = function () { return new CheckedObserver(this); };
+
+ /**
+ * Creates an observer from the specified OnNext, along with optional OnError, and OnCompleted actions.
+ * @param {Function} [onNext] Observer's OnNext action implementation.
+ * @param {Function} [onError] Observer's OnError action implementation.
+ * @param {Function} [onCompleted] Observer's OnCompleted action implementation.
+ * @returns {Observer} The observer object implemented using the given actions.
+ */
+ var observerCreate = Observer.create = function (onNext, onError, onCompleted) {
+ onNext || (onNext = noop);
+ onError || (onError = defaultError);
+ onCompleted || (onCompleted = noop);
+ return new AnonymousObserver(onNext, onError, onCompleted);
+ };
+
+ /**
+ * Creates an observer from a notification callback.
+ *
+ * @static
+ * @memberOf Observer
+ * @param {Function} handler Action that handles a notification.
+ * @returns The observer object that invokes the specified handler using a notification corresponding to each message it receives.
+ */
+ Observer.fromNotifier = function (handler, thisArg) {
+ return new AnonymousObserver(function (x) {
+ return handler.call(thisArg, notificationCreateOnNext(x));
+ }, function (e) {
+ return handler.call(thisArg, notificationCreateOnError(e));
+ }, function () {
+ return handler.call(thisArg, notificationCreateOnCompleted());
+ });
+ };
+
+ /**
+ * Schedules the invocation of observer methods on the given scheduler.
+ * @param {Scheduler} scheduler Scheduler to schedule observer messages on.
+ * @returns {Observer} Observer whose messages are scheduled on the given scheduler.
+ */
+ Observer.prototype.notifyOn = function (scheduler) {
+ return new ObserveOnObserver(scheduler, this);
+ };
+
+ Observer.prototype.makeSafe = function(disposable) {
+ return new AnonymousSafeObserver(this._onNext, this._onError, this._onCompleted, disposable);
+ };
+
+ /**
+ * Abstract base class for implementations of the Observer class.
+ * This base class enforces the grammar of observers where OnError and OnCompleted are terminal messages.
+ */
+ var AbstractObserver = Rx.internals.AbstractObserver = (function (__super__) {
+ inherits(AbstractObserver, __super__);
+
+ /**
+ * Creates a new observer in a non-stopped state.
+ */
+ function AbstractObserver() {
+ this.isStopped = false;
+ __super__.call(this);
+ }
+
+ // Must be implemented by other observers
+ AbstractObserver.prototype.next = notImplemented;
+ AbstractObserver.prototype.error = notImplemented;
+ AbstractObserver.prototype.completed = notImplemented;
+
+ /**
+ * Notifies the observer of a new element in the sequence.
+ * @param {Any} value Next element in the sequence.
+ */
+ AbstractObserver.prototype.onNext = function (value) {
+ if (!this.isStopped) { this.next(value); }
+ };
+
+ /**
+ * Notifies the observer that an exception has occurred.
+ * @param {Any} error The error that has occurred.
+ */
+ AbstractObserver.prototype.onError = function (error) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.error(error);
+ }
+ };
+
+ /**
+ * Notifies the observer of the end of the sequence.
+ */
+ AbstractObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.completed();
+ }
+ };
+
+ /**
+ * Disposes the observer, causing it to transition to the stopped state.
+ */
+ AbstractObserver.prototype.dispose = function () {
+ this.isStopped = true;
+ };
+
+ AbstractObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.error(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ return AbstractObserver;
+ }(Observer));
+
+ /**
+ * Class to create an Observer instance from delegate-based implementations of the on* methods.
+ */
+ var AnonymousObserver = Rx.AnonymousObserver = (function (__super__) {
+ inherits(AnonymousObserver, __super__);
+
+ /**
+ * Creates an observer from the specified OnNext, OnError, and OnCompleted actions.
+ * @param {Any} onNext Observer's OnNext action implementation.
+ * @param {Any} onError Observer's OnError action implementation.
+ * @param {Any} onCompleted Observer's OnCompleted action implementation.
+ */
+ function AnonymousObserver(onNext, onError, onCompleted) {
+ __super__.call(this);
+ this._onNext = onNext;
+ this._onError = onError;
+ this._onCompleted = onCompleted;
+ }
+
+ /**
+ * Calls the onNext action.
+ * @param {Any} value Next element in the sequence.
+ */
+ AnonymousObserver.prototype.next = function (value) {
+ this._onNext(value);
+ };
+
+ /**
+ * Calls the onError action.
+ * @param {Any} error The error that has occurred.
+ */
+ AnonymousObserver.prototype.error = function (error) {
+ this._onError(error);
+ };
+
+ /**
+ * Calls the onCompleted action.
+ */
+ AnonymousObserver.prototype.completed = function () {
+ this._onCompleted();
+ };
+
+ return AnonymousObserver;
+ }(AbstractObserver));
+
+ var CheckedObserver = (function (__super__) {
+ inherits(CheckedObserver, __super__);
+
+ function CheckedObserver(observer) {
+ __super__.call(this);
+ this._observer = observer;
+ this._state = 0; // 0 - idle, 1 - busy, 2 - done
+ }
+
+ var CheckedObserverPrototype = CheckedObserver.prototype;
+
+ CheckedObserverPrototype.onNext = function (value) {
+ this.checkAccess();
+ var res = tryCatch(this._observer.onNext).call(this._observer, value);
+ this._state = 0;
+ res === errorObj && thrower(res.e);
+ };
+
+ CheckedObserverPrototype.onError = function (err) {
+ this.checkAccess();
+ var res = tryCatch(this._observer.onError).call(this._observer, err);
+ this._state = 2;
+ res === errorObj && thrower(res.e);
+ };
+
+ CheckedObserverPrototype.onCompleted = function () {
+ this.checkAccess();
+ var res = tryCatch(this._observer.onCompleted).call(this._observer);
+ this._state = 2;
+ res === errorObj && thrower(res.e);
+ };
+
+ CheckedObserverPrototype.checkAccess = function () {
+ if (this._state === 1) { throw new Error('Re-entrancy detected'); }
+ if (this._state === 2) { throw new Error('Observer completed'); }
+ if (this._state === 0) { this._state = 1; }
+ };
+
+ return CheckedObserver;
+ }(Observer));
+
+ var ScheduledObserver = Rx.internals.ScheduledObserver = (function (__super__) {
+ inherits(ScheduledObserver, __super__);
+
+ function ScheduledObserver(scheduler, observer) {
+ __super__.call(this);
+ this.scheduler = scheduler;
+ this.observer = observer;
+ this.isAcquired = false;
+ this.hasFaulted = false;
+ this.queue = [];
+ this.disposable = new SerialDisposable();
+ }
+
+ ScheduledObserver.prototype.next = function (value) {
+ var self = this;
+ this.queue.push(function () { self.observer.onNext(value); });
+ };
+
+ ScheduledObserver.prototype.error = function (e) {
+ var self = this;
+ this.queue.push(function () { self.observer.onError(e); });
+ };
+
+ ScheduledObserver.prototype.completed = function () {
+ var self = this;
+ this.queue.push(function () { self.observer.onCompleted(); });
+ };
+
+ ScheduledObserver.prototype.ensureActive = function () {
+ var isOwner = false, parent = this;
+ if (!this.hasFaulted && this.queue.length > 0) {
+ isOwner = !this.isAcquired;
+ this.isAcquired = true;
+ }
+ if (isOwner) {
+ this.disposable.setDisposable(this.scheduler.scheduleRecursive(function (self) {
+ var work;
+ if (parent.queue.length > 0) {
+ work = parent.queue.shift();
+ } else {
+ parent.isAcquired = false;
+ return;
+ }
+ try {
+ work();
+ } catch (ex) {
+ parent.queue = [];
+ parent.hasFaulted = true;
+ throw ex;
+ }
+ self();
+ }));
+ }
+ };
+
+ ScheduledObserver.prototype.dispose = function () {
+ __super__.prototype.dispose.call(this);
+ this.disposable.dispose();
+ };
+
+ return ScheduledObserver;
+ }(AbstractObserver));
+
+ var ObserveOnObserver = (function (__super__) {
+ inherits(ObserveOnObserver, __super__);
+
+ function ObserveOnObserver(scheduler, observer, cancel) {
+ __super__.call(this, scheduler, observer);
+ this._cancel = cancel;
+ }
+
+ ObserveOnObserver.prototype.next = function (value) {
+ __super__.prototype.next.call(this, value);
+ this.ensureActive();
+ };
+
+ ObserveOnObserver.prototype.error = function (e) {
+ __super__.prototype.error.call(this, e);
+ this.ensureActive();
+ };
+
+ ObserveOnObserver.prototype.completed = function () {
+ __super__.prototype.completed.call(this);
+ this.ensureActive();
+ };
+
+ ObserveOnObserver.prototype.dispose = function () {
+ __super__.prototype.dispose.call(this);
+ this._cancel && this._cancel.dispose();
+ this._cancel = null;
+ };
+
+ return ObserveOnObserver;
+ })(ScheduledObserver);
+
+ var observableProto;
+
+ /**
+ * Represents a push-style collection.
+ */
+ var Observable = Rx.Observable = (function () {
+
+ function Observable(subscribe) {
+ if (Rx.config.longStackSupport && hasStacks) {
+ try {
+ throw new Error();
+ } catch (e) {
+ this.stack = e.stack.substring(e.stack.indexOf("\n") + 1);
+ }
+
+ var self = this;
+ this._subscribe = function (observer) {
+ var oldOnError = observer.onError.bind(observer);
+
+ observer.onError = function (err) {
+ makeStackTraceLong(err, self);
+ oldOnError(err);
+ };
+
+ return subscribe.call(self, observer);
+ };
+ } else {
+ this._subscribe = subscribe;
+ }
+ }
+
+ observableProto = Observable.prototype;
+
+ /**
+ * Subscribes an observer to the observable sequence.
+ * @param {Mixed} [observerOrOnNext] The object that is to receive notifications or an action to invoke for each element in the observable sequence.
+ * @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence.
+ * @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence.
+ * @returns {Diposable} A disposable handling the subscriptions and unsubscriptions.
+ */
+ observableProto.subscribe = observableProto.forEach = function (observerOrOnNext, onError, onCompleted) {
+ return this._subscribe(typeof observerOrOnNext === 'object' ?
+ observerOrOnNext :
+ observerCreate(observerOrOnNext, onError, onCompleted));
+ };
+
+ /**
+ * Subscribes to the next value in the sequence with an optional "this" argument.
+ * @param {Function} onNext The function to invoke on each element in the observable sequence.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions.
+ */
+ observableProto.subscribeOnNext = function (onNext, thisArg) {
+ return this._subscribe(observerCreate(typeof thisArg !== 'undefined' ? function(x) { onNext.call(thisArg, x); } : onNext));
+ };
+
+ /**
+ * Subscribes to an exceptional condition in the sequence with an optional "this" argument.
+ * @param {Function} onError The function to invoke upon exceptional termination of the observable sequence.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions.
+ */
+ observableProto.subscribeOnError = function (onError, thisArg) {
+ return this._subscribe(observerCreate(null, typeof thisArg !== 'undefined' ? function(e) { onError.call(thisArg, e); } : onError));
+ };
+
+ /**
+ * Subscribes to the next value in the sequence with an optional "this" argument.
+ * @param {Function} onCompleted The function to invoke upon graceful termination of the observable sequence.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions.
+ */
+ observableProto.subscribeOnCompleted = function (onCompleted, thisArg) {
+ return this._subscribe(observerCreate(null, null, typeof thisArg !== 'undefined' ? function() { onCompleted.call(thisArg); } : onCompleted));
+ };
+
+ return Observable;
+ })();
+
+ var ObservableBase = Rx.ObservableBase = (function (__super__) {
+ inherits(ObservableBase, __super__);
+
+ function fixSubscriber(subscriber) {
+ return subscriber && isFunction(subscriber.dispose) ? subscriber :
+ isFunction(subscriber) ? disposableCreate(subscriber) : disposableEmpty;
+ }
+
+ function setDisposable(s, state) {
+ var ado = state[0], self = state[1];
+ var sub = tryCatch(self.subscribeCore).call(self, ado);
+
+ if (sub === errorObj) {
+ if(!ado.fail(errorObj.e)) { return thrower(errorObj.e); }
+ }
+ ado.setDisposable(fixSubscriber(sub));
+ }
+
+ function subscribe(observer) {
+ var ado = new AutoDetachObserver(observer), state = [ado, this];
+
+ if (currentThreadScheduler.scheduleRequired()) {
+ currentThreadScheduler.scheduleWithState(state, setDisposable);
+ } else {
+ setDisposable(null, state);
+ }
+ return ado;
+ }
+
+ function ObservableBase() {
+ __super__.call(this, subscribe);
+ }
+
+ ObservableBase.prototype.subscribeCore = notImplemented;
+
+ return ObservableBase;
+ }(Observable));
+
+ var Enumerable = Rx.internals.Enumerable = function () { };
+
+ var ConcatEnumerableObservable = (function(__super__) {
+ inherits(ConcatEnumerableObservable, __super__);
+ function ConcatEnumerableObservable(sources) {
+ this.sources = sources;
+ __super__.call(this);
+ }
+
+ ConcatEnumerableObservable.prototype.subscribeCore = function (o) {
+ var isDisposed, subscription = new SerialDisposable();
+ var cancelable = immediateScheduler.scheduleRecursiveWithState(this.sources[$iterator$](), function (e, self) {
+ if (isDisposed) { return; }
+ var currentItem = tryCatch(e.next).call(e);
+ if (currentItem === errorObj) { return o.onError(currentItem.e); }
+
+ if (currentItem.done) {
+ return o.onCompleted();
+ }
+
+ // Check if promise
+ var currentValue = currentItem.value;
+ isPromise(currentValue) && (currentValue = observableFromPromise(currentValue));
+
+ var d = new SingleAssignmentDisposable();
+ subscription.setDisposable(d);
+ d.setDisposable(currentValue.subscribe(new InnerObserver(o, self, e)));
+ });
+
+ return new CompositeDisposable(subscription, cancelable, disposableCreate(function () {
+ isDisposed = true;
+ }));
+ };
+
+ function InnerObserver(o, s, e) {
+ this.o = o;
+ this.s = s;
+ this.e = e;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) { if(!this.isStopped) { this.o.onNext(x); } };
+ InnerObserver.prototype.onError = function (err) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(err);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.s(this.e);
+ }
+ };
+ InnerObserver.prototype.dispose = function () { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (err) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(err);
+ return true;
+ }
+ return false;
+ };
+
+ return ConcatEnumerableObservable;
+ }(ObservableBase));
+
+ Enumerable.prototype.concat = function () {
+ return new ConcatEnumerableObservable(this);
+ };
+
+ var CatchErrorObservable = (function(__super__) {
+ inherits(CatchErrorObservable, __super__);
+ function CatchErrorObservable(sources) {
+ this.sources = sources;
+ __super__.call(this);
+ }
+
+ CatchErrorObservable.prototype.subscribeCore = function (o) {
+ var e = this.sources[$iterator$]();
+
+ var isDisposed, subscription = new SerialDisposable();
+ var cancelable = immediateScheduler.scheduleRecursiveWithState(null, function (lastException, self) {
+ if (isDisposed) { return; }
+ var currentItem = tryCatch(e.next).call(e);
+ if (currentItem === errorObj) { return o.onError(currentItem.e); }
+
+ if (currentItem.done) {
+ return lastException !== null ? o.onError(lastException) : o.onCompleted();
+ }
+
+ // Check if promise
+ var currentValue = currentItem.value;
+ isPromise(currentValue) && (currentValue = observableFromPromise(currentValue));
+
+ var d = new SingleAssignmentDisposable();
+ subscription.setDisposable(d);
+ d.setDisposable(currentValue.subscribe(
+ function(x) { o.onNext(x); },
+ self,
+ function() { o.onCompleted(); }));
+ });
+ return new CompositeDisposable(subscription, cancelable, disposableCreate(function () {
+ isDisposed = true;
+ }));
+ };
+
+ return CatchErrorObservable;
+ }(ObservableBase));
+
+ Enumerable.prototype.catchError = function () {
+ return new CatchErrorObservable(this);
+ };
+
+ Enumerable.prototype.catchErrorWhen = function (notificationHandler) {
+ var sources = this;
+ return new AnonymousObservable(function (o) {
+ var exceptions = new Subject(),
+ notifier = new Subject(),
+ handled = notificationHandler(exceptions),
+ notificationDisposable = handled.subscribe(notifier);
+
+ var e = sources[$iterator$]();
+
+ var isDisposed,
+ lastException,
+ subscription = new SerialDisposable();
+ var cancelable = immediateScheduler.scheduleRecursive(function (self) {
+ if (isDisposed) { return; }
+ var currentItem = tryCatch(e.next).call(e);
+ if (currentItem === errorObj) { return o.onError(currentItem.e); }
+
+ if (currentItem.done) {
+ if (lastException) {
+ o.onError(lastException);
+ } else {
+ o.onCompleted();
+ }
+ return;
+ }
+
+ // Check if promise
+ var currentValue = currentItem.value;
+ isPromise(currentValue) && (currentValue = observableFromPromise(currentValue));
+
+ var outer = new SingleAssignmentDisposable();
+ var inner = new SingleAssignmentDisposable();
+ subscription.setDisposable(new CompositeDisposable(inner, outer));
+ outer.setDisposable(currentValue.subscribe(
+ function(x) { o.onNext(x); },
+ function (exn) {
+ inner.setDisposable(notifier.subscribe(self, function(ex) {
+ o.onError(ex);
+ }, function() {
+ o.onCompleted();
+ }));
+
+ exceptions.onNext(exn);
+ },
+ function() { o.onCompleted(); }));
+ });
+
+ return new CompositeDisposable(notificationDisposable, subscription, cancelable, disposableCreate(function () {
+ isDisposed = true;
+ }));
+ });
+ };
+
+ var RepeatEnumerable = (function (__super__) {
+ inherits(RepeatEnumerable, __super__);
+
+ function RepeatEnumerable(v, c) {
+ this.v = v;
+ this.c = c == null ? -1 : c;
+ }
+ RepeatEnumerable.prototype[$iterator$] = function () {
+ return new RepeatEnumerator(this);
+ };
+
+ function RepeatEnumerator(p) {
+ this.v = p.v;
+ this.l = p.c;
+ }
+ RepeatEnumerator.prototype.next = function () {
+ if (this.l === 0) { return doneEnumerator; }
+ if (this.l > 0) { this.l--; }
+ return { done: false, value: this.v };
+ };
+
+ return RepeatEnumerable;
+ }(Enumerable));
+
+ var enumerableRepeat = Enumerable.repeat = function (value, repeatCount) {
+ return new RepeatEnumerable(value, repeatCount);
+ };
+
+ var OfEnumerable = (function(__super__) {
+ inherits(OfEnumerable, __super__);
+ function OfEnumerable(s, fn, thisArg) {
+ this.s = s;
+ this.fn = fn ? bindCallback(fn, thisArg, 3) : null;
+ }
+ OfEnumerable.prototype[$iterator$] = function () {
+ return new OfEnumerator(this);
+ };
+
+ function OfEnumerator(p) {
+ this.i = -1;
+ this.s = p.s;
+ this.l = this.s.length;
+ this.fn = p.fn;
+ }
+ OfEnumerator.prototype.next = function () {
+ return ++this.i < this.l ?
+ { done: false, value: !this.fn ? this.s[this.i] : this.fn(this.s[this.i], this.i, this.s) } :
+ doneEnumerator;
+ };
+
+ return OfEnumerable;
+ }(Enumerable));
+
+ var enumerableOf = Enumerable.of = function (source, selector, thisArg) {
+ return new OfEnumerable(source, selector, thisArg);
+ };
+
+ /**
+ * Wraps the source sequence in order to run its observer callbacks on the specified scheduler.
+ *
+ * This only invokes observer callbacks on a scheduler. In case the subscription and/or unsubscription actions have side-effects
+ * that require to be run on a scheduler, use subscribeOn.
+ *
+ * @param {Scheduler} scheduler Scheduler to notify observers on.
+ * @returns {Observable} The source sequence whose observations happen on the specified scheduler.
+ */
+ observableProto.observeOn = function (scheduler) {
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ return source.subscribe(new ObserveOnObserver(scheduler, observer));
+ }, source);
+ };
+
+ /**
+ * Wraps the source sequence in order to run its subscription and unsubscription logic on the specified scheduler. This operation is not commonly used;
+ * see the remarks section for more information on the distinction between subscribeOn and observeOn.
+
+ * This only performs the side-effects of subscription and unsubscription on the specified scheduler. In order to invoke observer
+ * callbacks on a scheduler, use observeOn.
+
+ * @param {Scheduler} scheduler Scheduler to perform subscription and unsubscription actions on.
+ * @returns {Observable} The source sequence whose subscriptions and unsubscriptions happen on the specified scheduler.
+ */
+ observableProto.subscribeOn = function (scheduler) {
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ var m = new SingleAssignmentDisposable(), d = new SerialDisposable();
+ d.setDisposable(m);
+ m.setDisposable(scheduler.schedule(function () {
+ d.setDisposable(new ScheduledDisposable(scheduler, source.subscribe(observer)));
+ }));
+ return d;
+ }, source);
+ };
+
+ var FromPromiseObservable = (function(__super__) {
+ inherits(FromPromiseObservable, __super__);
+ function FromPromiseObservable(p) {
+ this.p = p;
+ __super__.call(this);
+ }
+
+ FromPromiseObservable.prototype.subscribeCore = function(o) {
+ this.p.then(function (data) {
+ o.onNext(data);
+ o.onCompleted();
+ }, function (err) { o.onError(err); });
+ return disposableEmpty;
+ };
+
+ return FromPromiseObservable;
+ }(ObservableBase));
+
+ /**
+ * Converts a Promise to an Observable sequence
+ * @param {Promise} An ES6 Compliant promise.
+ * @returns {Observable} An Observable sequence which wraps the existing promise success and failure.
+ */
+ var observableFromPromise = Observable.fromPromise = function (promise) {
+ return new FromPromiseObservable(promise);
+ };
+ /*
+ * Converts an existing observable sequence to an ES6 Compatible Promise
+ * @example
+ * var promise = Rx.Observable.return(42).toPromise(RSVP.Promise);
+ *
+ * // With config
+ * Rx.config.Promise = RSVP.Promise;
+ * var promise = Rx.Observable.return(42).toPromise();
+ * @param {Function} [promiseCtor] The constructor of the promise. If not provided, it looks for it in Rx.config.Promise.
+ * @returns {Promise} An ES6 compatible promise with the last value from the observable sequence.
+ */
+ observableProto.toPromise = function (promiseCtor) {
+ promiseCtor || (promiseCtor = Rx.config.Promise);
+ if (!promiseCtor) { throw new NotSupportedError('Promise type not provided nor in Rx.config.Promise'); }
+ var source = this;
+ return new promiseCtor(function (resolve, reject) {
+ // No cancellation can be done
+ var value, hasValue = false;
+ source.subscribe(function (v) {
+ value = v;
+ hasValue = true;
+ }, reject, function () {
+ hasValue && resolve(value);
+ });
+ });
+ };
+
+ var ToArrayObservable = (function(__super__) {
+ inherits(ToArrayObservable, __super__);
+ function ToArrayObservable(source) {
+ this.source = source;
+ __super__.call(this);
+ }
+
+ ToArrayObservable.prototype.subscribeCore = function(o) {
+ return this.source.subscribe(new InnerObserver(o));
+ };
+
+ function InnerObserver(o) {
+ this.o = o;
+ this.a = [];
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) { if(!this.isStopped) { this.a.push(x); } };
+ InnerObserver.prototype.onError = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onNext(this.a);
+ this.o.onCompleted();
+ }
+ };
+ InnerObserver.prototype.dispose = function () { this.isStopped = true; }
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ return ToArrayObservable;
+ }(ObservableBase));
+
+ /**
+ * Creates an array from an observable sequence.
+ * @returns {Observable} An observable sequence containing a single element with a list containing all the elements of the source sequence.
+ */
+ observableProto.toArray = function () {
+ return new ToArrayObservable(this);
+ };
+
+ /**
+ * Creates an observable sequence from a specified subscribe method implementation.
+ * @example
+ * var res = Rx.Observable.create(function (observer) { return function () { } );
+ * var res = Rx.Observable.create(function (observer) { return Rx.Disposable.empty; } );
+ * var res = Rx.Observable.create(function (observer) { } );
+ * @param {Function} subscribe Implementation of the resulting observable sequence's subscribe method, returning a function that will be wrapped in a Disposable.
+ * @returns {Observable} The observable sequence with the specified implementation for the Subscribe method.
+ */
+ Observable.create = Observable.createWithDisposable = function (subscribe, parent) {
+ return new AnonymousObservable(subscribe, parent);
+ };
+
+ /**
+ * Returns an observable sequence that invokes the specified factory function whenever a new observer subscribes.
+ *
+ * @example
+ * var res = Rx.Observable.defer(function () { return Rx.Observable.fromArray([1,2,3]); });
+ * @param {Function} observableFactory Observable factory function to invoke for each observer that subscribes to the resulting sequence or Promise.
+ * @returns {Observable} An observable sequence whose observers trigger an invocation of the given observable factory function.
+ */
+ var observableDefer = Observable.defer = function (observableFactory) {
+ return new AnonymousObservable(function (observer) {
+ var result;
+ try {
+ result = observableFactory();
+ } catch (e) {
+ return observableThrow(e).subscribe(observer);
+ }
+ isPromise(result) && (result = observableFromPromise(result));
+ return result.subscribe(observer);
+ });
+ };
+
+ var EmptyObservable = (function(__super__) {
+ inherits(EmptyObservable, __super__);
+ function EmptyObservable(scheduler) {
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ EmptyObservable.prototype.subscribeCore = function (observer) {
+ var sink = new EmptySink(observer, this);
+ return sink.run();
+ };
+
+ function EmptySink(observer, parent) {
+ this.observer = observer;
+ this.parent = parent;
+ }
+
+ function scheduleItem(s, state) {
+ state.onCompleted();
+ }
+
+ EmptySink.prototype.run = function () {
+ return this.parent.scheduler.scheduleWithState(this.observer, scheduleItem);
+ };
+
+ return EmptyObservable;
+ }(ObservableBase));
+
+ /**
+ * Returns an empty observable sequence, using the specified scheduler to send out the single OnCompleted message.
+ *
+ * @example
+ * var res = Rx.Observable.empty();
+ * var res = Rx.Observable.empty(Rx.Scheduler.timeout);
+ * @param {Scheduler} [scheduler] Scheduler to send the termination call on.
+ * @returns {Observable} An observable sequence with no elements.
+ */
+ var observableEmpty = Observable.empty = function (scheduler) {
+ isScheduler(scheduler) || (scheduler = immediateScheduler);
+ return new EmptyObservable(scheduler);
+ };
+
+ var FromObservable = (function(__super__) {
+ inherits(FromObservable, __super__);
+ function FromObservable(iterable, mapper, scheduler) {
+ this.iterable = iterable;
+ this.mapper = mapper;
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ FromObservable.prototype.subscribeCore = function (observer) {
+ var sink = new FromSink(observer, this);
+ return sink.run();
+ };
+
+ return FromObservable;
+ }(ObservableBase));
+
+ var FromSink = (function () {
+ function FromSink(observer, parent) {
+ this.observer = observer;
+ this.parent = parent;
+ }
+
+ FromSink.prototype.run = function () {
+ var list = Object(this.parent.iterable),
+ it = getIterable(list),
+ observer = this.observer,
+ mapper = this.parent.mapper;
+
+ function loopRecursive(i, recurse) {
+ try {
+ var next = it.next();
+ } catch (e) {
+ return observer.onError(e);
+ }
+ if (next.done) {
+ return observer.onCompleted();
+ }
+
+ var result = next.value;
+
+ if (mapper) {
+ try {
+ result = mapper(result, i);
+ } catch (e) {
+ return observer.onError(e);
+ }
+ }
+
+ observer.onNext(result);
+ recurse(i + 1);
+ }
+
+ return this.parent.scheduler.scheduleRecursiveWithState(0, loopRecursive);
+ };
+
+ return FromSink;
+ }());
+
+ var maxSafeInteger = Math.pow(2, 53) - 1;
+
+ function StringIterable(str) {
+ this._s = s;
+ }
+
+ StringIterable.prototype[$iterator$] = function () {
+ return new StringIterator(this._s);
+ };
+
+ function StringIterator(str) {
+ this._s = s;
+ this._l = s.length;
+ this._i = 0;
+ }
+
+ StringIterator.prototype[$iterator$] = function () {
+ return this;
+ };
+
+ StringIterator.prototype.next = function () {
+ return this._i < this._l ? { done: false, value: this._s.charAt(this._i++) } : doneEnumerator;
+ };
+
+ function ArrayIterable(a) {
+ this._a = a;
+ }
+
+ ArrayIterable.prototype[$iterator$] = function () {
+ return new ArrayIterator(this._a);
+ };
+
+ function ArrayIterator(a) {
+ this._a = a;
+ this._l = toLength(a);
+ this._i = 0;
+ }
+
+ ArrayIterator.prototype[$iterator$] = function () {
+ return this;
+ };
+
+ ArrayIterator.prototype.next = function () {
+ return this._i < this._l ? { done: false, value: this._a[this._i++] } : doneEnumerator;
+ };
+
+ function numberIsFinite(value) {
+ return typeof value === 'number' && root.isFinite(value);
+ }
+
+ function isNan(n) {
+ return n !== n;
+ }
+
+ function getIterable(o) {
+ var i = o[$iterator$], it;
+ if (!i && typeof o === 'string') {
+ it = new StringIterable(o);
+ return it[$iterator$]();
+ }
+ if (!i && o.length !== undefined) {
+ it = new ArrayIterable(o);
+ return it[$iterator$]();
+ }
+ if (!i) { throw new TypeError('Object is not iterable'); }
+ return o[$iterator$]();
+ }
+
+ function sign(value) {
+ var number = +value;
+ if (number === 0) { return number; }
+ if (isNaN(number)) { return number; }
+ return number < 0 ? -1 : 1;
+ }
+
+ function toLength(o) {
+ var len = +o.length;
+ if (isNaN(len)) { return 0; }
+ if (len === 0 || !numberIsFinite(len)) { return len; }
+ len = sign(len) * Math.floor(Math.abs(len));
+ if (len <= 0) { return 0; }
+ if (len > maxSafeInteger) { return maxSafeInteger; }
+ return len;
+ }
+
+ /**
+ * This method creates a new Observable sequence from an array-like or iterable object.
+ * @param {Any} arrayLike An array-like or iterable object to convert to an Observable sequence.
+ * @param {Function} [mapFn] Map function to call on every element of the array.
+ * @param {Any} [thisArg] The context to use calling the mapFn if provided.
+ * @param {Scheduler} [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread.
+ */
+ var observableFrom = Observable.from = function (iterable, mapFn, thisArg, scheduler) {
+ if (iterable == null) {
+ throw new Error('iterable cannot be null.')
+ }
+ if (mapFn && !isFunction(mapFn)) {
+ throw new Error('mapFn when provided must be a function');
+ }
+ if (mapFn) {
+ var mapper = bindCallback(mapFn, thisArg, 2);
+ }
+ isScheduler(scheduler) || (scheduler = currentThreadScheduler);
+ return new FromObservable(iterable, mapper, scheduler);
+ }
+
+ var FromArrayObservable = (function(__super__) {
+ inherits(FromArrayObservable, __super__);
+ function FromArrayObservable(args, scheduler) {
+ this.args = args;
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ FromArrayObservable.prototype.subscribeCore = function (observer) {
+ var sink = new FromArraySink(observer, this);
+ return sink.run();
+ };
+
+ return FromArrayObservable;
+ }(ObservableBase));
+
+ function FromArraySink(observer, parent) {
+ this.observer = observer;
+ this.parent = parent;
+ }
+
+ FromArraySink.prototype.run = function () {
+ var observer = this.observer, args = this.parent.args, len = args.length;
+ function loopRecursive(i, recurse) {
+ if (i < len) {
+ observer.onNext(args[i]);
+ recurse(i + 1);
+ } else {
+ observer.onCompleted();
+ }
+ }
+
+ return this.parent.scheduler.scheduleRecursiveWithState(0, loopRecursive);
+ };
+
+ /**
+ * Converts an array to an observable sequence, using an optional scheduler to enumerate the array.
+ * @deprecated use Observable.from or Observable.of
+ * @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on.
+ * @returns {Observable} The observable sequence whose elements are pulled from the given enumerable sequence.
+ */
+ var observableFromArray = Observable.fromArray = function (array, scheduler) {
+ isScheduler(scheduler) || (scheduler = currentThreadScheduler);
+ return new FromArrayObservable(array, scheduler)
+ };
+
+ /**
+ * Generates an observable sequence by running a state-driven loop producing the sequence's elements, using the specified scheduler to send out observer messages.
+ *
+ * @example
+ * var res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; });
+ * var res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; }, Rx.Scheduler.timeout);
+ * @param {Mixed} initialState Initial state.
+ * @param {Function} condition Condition to terminate generation (upon returning false).
+ * @param {Function} iterate Iteration step function.
+ * @param {Function} resultSelector Selector function for results produced in the sequence.
+ * @param {Scheduler} [scheduler] Scheduler on which to run the generator loop. If not provided, defaults to Scheduler.currentThread.
+ * @returns {Observable} The generated sequence.
+ */
+ Observable.generate = function (initialState, condition, iterate, resultSelector, scheduler) {
+ isScheduler(scheduler) || (scheduler = currentThreadScheduler);
+ return new AnonymousObservable(function (o) {
+ var first = true;
+ return scheduler.scheduleRecursiveWithState(initialState, function (state, self) {
+ var hasResult, result;
+ try {
+ if (first) {
+ first = false;
+ } else {
+ state = iterate(state);
+ }
+ hasResult = condition(state);
+ hasResult && (result = resultSelector(state));
+ } catch (e) {
+ return o.onError(e);
+ }
+ if (hasResult) {
+ o.onNext(result);
+ self(state);
+ } else {
+ o.onCompleted();
+ }
+ });
+ });
+ };
+
+ var NeverObservable = (function(__super__) {
+ inherits(NeverObservable, __super__);
+ function NeverObservable() {
+ __super__.call(this);
+ }
+
+ NeverObservable.prototype.subscribeCore = function (observer) {
+ return disposableEmpty;
+ };
+
+ return NeverObservable;
+ }(ObservableBase));
+
+ /**
+ * Returns a non-terminating observable sequence, which can be used to denote an infinite duration (e.g. when using reactive joins).
+ * @returns {Observable} An observable sequence whose observers will never get called.
+ */
+ var observableNever = Observable.never = function () {
+ return new NeverObservable();
+ };
+
+ function observableOf (scheduler, array) {
+ isScheduler(scheduler) || (scheduler = currentThreadScheduler);
+ return new FromArrayObservable(array, scheduler);
+ }
+
+ /**
+ * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments.
+ * @returns {Observable} The observable sequence whose elements are pulled from the given arguments.
+ */
+ Observable.of = function () {
+ var len = arguments.length, args = new Array(len);
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+ return new FromArrayObservable(args, currentThreadScheduler);
+ };
+
+ /**
+ * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments.
+ * @param {Scheduler} scheduler A scheduler to use for scheduling the arguments.
+ * @returns {Observable} The observable sequence whose elements are pulled from the given arguments.
+ */
+ Observable.ofWithScheduler = function (scheduler) {
+ var len = arguments.length, args = new Array(len - 1);
+ for(var i = 1; i < len; i++) { args[i - 1] = arguments[i]; }
+ return new FromArrayObservable(args, scheduler);
+ };
+
+ var PairsObservable = (function(__super__) {
+ inherits(PairsObservable, __super__);
+ function PairsObservable(obj, scheduler) {
+ this.obj = obj;
+ this.keys = Object.keys(obj);
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ PairsObservable.prototype.subscribeCore = function (observer) {
+ var sink = new PairsSink(observer, this);
+ return sink.run();
+ };
+
+ return PairsObservable;
+ }(ObservableBase));
+
+ function PairsSink(observer, parent) {
+ this.observer = observer;
+ this.parent = parent;
+ }
+
+ PairsSink.prototype.run = function () {
+ var observer = this.observer, obj = this.parent.obj, keys = this.parent.keys, len = keys.length;
+ function loopRecursive(i, recurse) {
+ if (i < len) {
+ var key = keys[i];
+ observer.onNext([key, obj[key]]);
+ recurse(i + 1);
+ } else {
+ observer.onCompleted();
+ }
+ }
+
+ return this.parent.scheduler.scheduleRecursiveWithState(0, loopRecursive);
+ };
+
+ /**
+ * Convert an object into an observable sequence of [key, value] pairs.
+ * @param {Object} obj The object to inspect.
+ * @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on.
+ * @returns {Observable} An observable sequence of [key, value] pairs from the object.
+ */
+ Observable.pairs = function (obj, scheduler) {
+ scheduler || (scheduler = currentThreadScheduler);
+ return new PairsObservable(obj, scheduler);
+ };
+
+ var RangeObservable = (function(__super__) {
+ inherits(RangeObservable, __super__);
+ function RangeObservable(start, count, scheduler) {
+ this.start = start;
+ this.rangeCount = count;
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ RangeObservable.prototype.subscribeCore = function (observer) {
+ var sink = new RangeSink(observer, this);
+ return sink.run();
+ };
+
+ return RangeObservable;
+ }(ObservableBase));
+
+ var RangeSink = (function () {
+ function RangeSink(observer, parent) {
+ this.observer = observer;
+ this.parent = parent;
+ }
+
+ RangeSink.prototype.run = function () {
+ var start = this.parent.start, count = this.parent.rangeCount, observer = this.observer;
+ function loopRecursive(i, recurse) {
+ if (i < count) {
+ observer.onNext(start + i);
+ recurse(i + 1);
+ } else {
+ observer.onCompleted();
+ }
+ }
+
+ return this.parent.scheduler.scheduleRecursiveWithState(0, loopRecursive);
+ };
+
+ return RangeSink;
+ }());
+
+ /**
+ * Generates an observable sequence of integral numbers within a specified range, using the specified scheduler to send out observer messages.
+ * @param {Number} start The value of the first integer in the sequence.
+ * @param {Number} count The number of sequential integers to generate.
+ * @param {Scheduler} [scheduler] Scheduler to run the generator loop on. If not specified, defaults to Scheduler.currentThread.
+ * @returns {Observable} An observable sequence that contains a range of sequential integral numbers.
+ */
+ Observable.range = function (start, count, scheduler) {
+ isScheduler(scheduler) || (scheduler = currentThreadScheduler);
+ return new RangeObservable(start, count, scheduler);
+ };
+
+ var RepeatObservable = (function(__super__) {
+ inherits(RepeatObservable, __super__);
+ function RepeatObservable(value, repeatCount, scheduler) {
+ this.value = value;
+ this.repeatCount = repeatCount == null ? -1 : repeatCount;
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ RepeatObservable.prototype.subscribeCore = function (observer) {
+ var sink = new RepeatSink(observer, this);
+ return sink.run();
+ };
+
+ return RepeatObservable;
+ }(ObservableBase));
+
+ function RepeatSink(observer, parent) {
+ this.observer = observer;
+ this.parent = parent;
+ }
+
+ RepeatSink.prototype.run = function () {
+ var observer = this.observer, value = this.parent.value;
+ function loopRecursive(i, recurse) {
+ if (i === -1 || i > 0) {
+ observer.onNext(value);
+ i > 0 && i--;
+ }
+ if (i === 0) { return observer.onCompleted(); }
+ recurse(i);
+ }
+
+ return this.parent.scheduler.scheduleRecursiveWithState(this.parent.repeatCount, loopRecursive);
+ };
+
+ /**
+ * Generates an observable sequence that repeats the given element the specified number of times, using the specified scheduler to send out observer messages.
+ * @param {Mixed} value Element to repeat.
+ * @param {Number} repeatCount [Optiona] Number of times to repeat the element. If not specified, repeats indefinitely.
+ * @param {Scheduler} scheduler Scheduler to run the producer loop on. If not specified, defaults to Scheduler.immediate.
+ * @returns {Observable} An observable sequence that repeats the given element the specified number of times.
+ */
+ Observable.repeat = function (value, repeatCount, scheduler) {
+ isScheduler(scheduler) || (scheduler = currentThreadScheduler);
+ return new RepeatObservable(value, repeatCount, scheduler);
+ };
+
+ var JustObservable = (function(__super__) {
+ inherits(JustObservable, __super__);
+ function JustObservable(value, scheduler) {
+ this.value = value;
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ JustObservable.prototype.subscribeCore = function (observer) {
+ var sink = new JustSink(observer, this);
+ return sink.run();
+ };
+
+ function JustSink(observer, parent) {
+ this.observer = observer;
+ this.parent = parent;
+ }
+
+ function scheduleItem(s, state) {
+ var value = state[0], observer = state[1];
+ observer.onNext(value);
+ observer.onCompleted();
+ }
+
+ JustSink.prototype.run = function () {
+ return this.parent.scheduler.scheduleWithState([this.parent.value, this.observer], scheduleItem);
+ };
+
+ return JustObservable;
+ }(ObservableBase));
+
+ /**
+ * Returns an observable sequence that contains a single element, using the specified scheduler to send out observer messages.
+ * There is an alias called 'just' or browsers <IE9.
+ * @param {Mixed} value Single element in the resulting observable sequence.
+ * @param {Scheduler} scheduler Scheduler to send the single element on. If not specified, defaults to Scheduler.immediate.
+ * @returns {Observable} An observable sequence containing the single specified element.
+ */
+ var observableReturn = Observable['return'] = Observable.just = Observable.returnValue = function (value, scheduler) {
+ isScheduler(scheduler) || (scheduler = immediateScheduler);
+ return new JustObservable(value, scheduler);
+ };
+
+ var ThrowObservable = (function(__super__) {
+ inherits(ThrowObservable, __super__);
+ function ThrowObservable(error, scheduler) {
+ this.error = error;
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ ThrowObservable.prototype.subscribeCore = function (o) {
+ var sink = new ThrowSink(o, this);
+ return sink.run();
+ };
+
+ function ThrowSink(o, p) {
+ this.o = o;
+ this.p = p;
+ }
+
+ function scheduleItem(s, state) {
+ var e = state[0], o = state[1];
+ o.onError(e);
+ }
+
+ ThrowSink.prototype.run = function () {
+ return this.p.scheduler.scheduleWithState([this.p.error, this.o], scheduleItem);
+ };
+
+ return ThrowObservable;
+ }(ObservableBase));
+
+ /**
+ * Returns an observable sequence that terminates with an exception, using the specified scheduler to send out the single onError message.
+ * There is an alias to this method called 'throwError' for browsers <IE9.
+ * @param {Mixed} error An object used for the sequence's termination.
+ * @param {Scheduler} scheduler Scheduler to send the exceptional termination call on. If not specified, defaults to Scheduler.immediate.
+ * @returns {Observable} The observable sequence that terminates exceptionally with the specified exception object.
+ */
+ var observableThrow = Observable['throw'] = Observable.throwError = Observable.throwException = function (error, scheduler) {
+ isScheduler(scheduler) || (scheduler = immediateScheduler);
+ return new ThrowObservable(error, scheduler);
+ };
+
+ /**
+ * Constructs an observable sequence that depends on a resource object, whose lifetime is tied to the resulting observable sequence's lifetime.
+ * @param {Function} resourceFactory Factory function to obtain a resource object.
+ * @param {Function} observableFactory Factory function to obtain an observable sequence that depends on the obtained resource.
+ * @returns {Observable} An observable sequence whose lifetime controls the lifetime of the dependent resource object.
+ */
+ Observable.using = function (resourceFactory, observableFactory) {
+ return new AnonymousObservable(function (observer) {
+ var disposable = disposableEmpty, resource, source;
+ try {
+ resource = resourceFactory();
+ resource && (disposable = resource);
+ source = observableFactory(resource);
+ } catch (exception) {
+ return new CompositeDisposable(observableThrow(exception).subscribe(observer), disposable);
+ }
+ return new CompositeDisposable(source.subscribe(observer), disposable);
+ });
+ };
+
+ /**
+ * Propagates the observable sequence or Promise that reacts first.
+ * @param {Observable} rightSource Second observable sequence or Promise.
+ * @returns {Observable} {Observable} An observable sequence that surfaces either of the given sequences, whichever reacted first.
+ */
+ observableProto.amb = function (rightSource) {
+ var leftSource = this;
+ return new AnonymousObservable(function (observer) {
+ var choice,
+ leftChoice = 'L', rightChoice = 'R',
+ leftSubscription = new SingleAssignmentDisposable(),
+ rightSubscription = new SingleAssignmentDisposable();
+
+ isPromise(rightSource) && (rightSource = observableFromPromise(rightSource));
+
+ function choiceL() {
+ if (!choice) {
+ choice = leftChoice;
+ rightSubscription.dispose();
+ }
+ }
+
+ function choiceR() {
+ if (!choice) {
+ choice = rightChoice;
+ leftSubscription.dispose();
+ }
+ }
+
+ leftSubscription.setDisposable(leftSource.subscribe(function (left) {
+ choiceL();
+ choice === leftChoice && observer.onNext(left);
+ }, function (err) {
+ choiceL();
+ choice === leftChoice && observer.onError(err);
+ }, function () {
+ choiceL();
+ choice === leftChoice && observer.onCompleted();
+ }));
+
+ rightSubscription.setDisposable(rightSource.subscribe(function (right) {
+ choiceR();
+ choice === rightChoice && observer.onNext(right);
+ }, function (err) {
+ choiceR();
+ choice === rightChoice && observer.onError(err);
+ }, function () {
+ choiceR();
+ choice === rightChoice && observer.onCompleted();
+ }));
+
+ return new CompositeDisposable(leftSubscription, rightSubscription);
+ });
+ };
+
+ /**
+ * Propagates the observable sequence or Promise that reacts first.
+ *
+ * @example
+ * var = Rx.Observable.amb(xs, ys, zs);
+ * @returns {Observable} An observable sequence that surfaces any of the given sequences, whichever reacted first.
+ */
+ Observable.amb = function () {
+ var acc = observableNever(), items = [];
+ if (Array.isArray(arguments[0])) {
+ items = arguments[0];
+ } else {
+ for(var i = 0, len = arguments.length; i < len; i++) { items.push(arguments[i]); }
+ }
+
+ function func(previous, current) {
+ return previous.amb(current);
+ }
+ for (var i = 0, len = items.length; i < len; i++) {
+ acc = func(acc, items[i]);
+ }
+ return acc;
+ };
+
+ function observableCatchHandler(source, handler) {
+ return new AnonymousObservable(function (o) {
+ var d1 = new SingleAssignmentDisposable(), subscription = new SerialDisposable();
+ subscription.setDisposable(d1);
+ d1.setDisposable(source.subscribe(function (x) { o.onNext(x); }, function (e) {
+ try {
+ var result = handler(e);
+ } catch (ex) {
+ return o.onError(ex);
+ }
+ isPromise(result) && (result = observableFromPromise(result));
+
+ var d = new SingleAssignmentDisposable();
+ subscription.setDisposable(d);
+ d.setDisposable(result.subscribe(o));
+ }, function (x) { o.onCompleted(x); }));
+
+ return subscription;
+ }, source);
+ }
+
+ /**
+ * Continues an observable sequence that is terminated by an exception with the next observable sequence.
+ * @example
+ * 1 - xs.catchException(ys)
+ * 2 - xs.catchException(function (ex) { return ys(ex); })
+ * @param {Mixed} handlerOrSecond Exception handler function that returns an observable sequence given the error that occurred in the first sequence, or a second observable sequence used to produce results when an error occurred in the first sequence.
+ * @returns {Observable} An observable sequence containing the first sequence's elements, followed by the elements of the handler sequence in case an exception occurred.
+ */
+ observableProto['catch'] = observableProto.catchError = observableProto.catchException = function (handlerOrSecond) {
+ return typeof handlerOrSecond === 'function' ?
+ observableCatchHandler(this, handlerOrSecond) :
+ observableCatch([this, handlerOrSecond]);
+ };
+
+ /**
+ * Continues an observable sequence that is terminated by an exception with the next observable sequence.
+ * @param {Array | Arguments} args Arguments or an array to use as the next sequence if an error occurs.
+ * @returns {Observable} An observable sequence containing elements from consecutive source sequences until a source sequence terminates successfully.
+ */
+ var observableCatch = Observable.catchError = Observable['catch'] = Observable.catchException = function () {
+ var items = [];
+ if (Array.isArray(arguments[0])) {
+ items = arguments[0];
+ } else {
+ for(var i = 0, len = arguments.length; i < len; i++) { items.push(arguments[i]); }
+ }
+ return enumerableOf(items).catchError();
+ };
+
+ /**
+ * Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element.
+ * This can be in the form of an argument list of observables or an array.
+ *
+ * @example
+ * 1 - obs = observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
+ * 2 - obs = observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
+ * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
+ */
+ observableProto.combineLatest = function () {
+ var len = arguments.length, args = new Array(len);
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+ if (Array.isArray(args[0])) {
+ args[0].unshift(this);
+ } else {
+ args.unshift(this);
+ }
+ return combineLatest.apply(this, args);
+ };
+
+ /**
+ * Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element.
+ *
+ * @example
+ * 1 - obs = Rx.Observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
+ * 2 - obs = Rx.Observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
+ * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
+ */
+ var combineLatest = Observable.combineLatest = function () {
+ var len = arguments.length, args = new Array(len);
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+ var resultSelector = args.pop();
+ Array.isArray(args[0]) && (args = args[0]);
+
+ return new AnonymousObservable(function (o) {
+ var n = args.length,
+ falseFactory = function () { return false; },
+ hasValue = arrayInitialize(n, falseFactory),
+ hasValueAll = false,
+ isDone = arrayInitialize(n, falseFactory),
+ values = new Array(n);
+
+ function next(i) {
+ hasValue[i] = true;
+ if (hasValueAll || (hasValueAll = hasValue.every(identity))) {
+ try {
+ var res = resultSelector.apply(null, values);
+ } catch (e) {
+ return o.onError(e);
+ }
+ o.onNext(res);
+ } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) {
+ o.onCompleted();
+ }
+ }
+
+ function done (i) {
+ isDone[i] = true;
+ isDone.every(identity) && o.onCompleted();
+ }
+
+ var subscriptions = new Array(n);
+ for (var idx = 0; idx < n; idx++) {
+ (function (i) {
+ var source = args[i], sad = new SingleAssignmentDisposable();
+ isPromise(source) && (source = observableFromPromise(source));
+ sad.setDisposable(source.subscribe(function (x) {
+ values[i] = x;
+ next(i);
+ },
+ function(e) { o.onError(e); },
+ function () { done(i); }
+ ));
+ subscriptions[i] = sad;
+ }(idx));
+ }
+
+ return new CompositeDisposable(subscriptions);
+ }, this);
+ };
+
+ /**
+ * Concatenates all the observable sequences. This takes in either an array or variable arguments to concatenate.
+ * @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order.
+ */
+ observableProto.concat = function () {
+ for(var args = [], i = 0, len = arguments.length; i < len; i++) { args.push(arguments[i]); }
+ args.unshift(this);
+ return observableConcat.apply(null, args);
+ };
+
+ var ConcatObservable = (function(__super__) {
+ inherits(ConcatObservable, __super__);
+ function ConcatObservable(sources) {
+ this.sources = sources;
+ __super__.call(this);
+ }
+
+ ConcatObservable.prototype.subscribeCore = function(o) {
+ var sink = new ConcatSink(this.sources, o);
+ return sink.run();
+ };
+
+ function ConcatSink(sources, o) {
+ this.sources = sources;
+ this.o = o;
+ }
+ ConcatSink.prototype.run = function () {
+ var isDisposed, subscription = new SerialDisposable(), sources = this.sources, length = sources.length, o = this.o;
+ var cancelable = immediateScheduler.scheduleRecursiveWithState(0, function (i, self) {
+ if (isDisposed) { return; }
+ if (i === length) {
+ return o.onCompleted();
+ }
+
+ // Check if promise
+ var currentValue = sources[i];
+ isPromise(currentValue) && (currentValue = observableFromPromise(currentValue));
+
+ var d = new SingleAssignmentDisposable();
+ subscription.setDisposable(d);
+ d.setDisposable(currentValue.subscribe(
+ function (x) { o.onNext(x); },
+ function (e) { o.onError(e); },
+ function () { self(i + 1); }
+ ));
+ });
+
+ return new CompositeDisposable(subscription, cancelable, disposableCreate(function () {
+ isDisposed = true;
+ }));
+ };
+
+
+ return ConcatObservable;
+ }(ObservableBase));
+
+ /**
+ * Concatenates all the observable sequences.
+ * @param {Array | Arguments} args Arguments or an array to concat to the observable sequence.
+ * @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order.
+ */
+ var observableConcat = Observable.concat = function () {
+ var args;
+ if (Array.isArray(arguments[0])) {
+ args = arguments[0];
+ } else {
+ args = new Array(arguments.length);
+ for(var i = 0, len = arguments.length; i < len; i++) { args[i] = arguments[i]; }
+ }
+ return new ConcatObservable(args);
+ };
+
+ /**
+ * Concatenates an observable sequence of observable sequences.
+ * @returns {Observable} An observable sequence that contains the elements of each observed inner sequence, in sequential order.
+ */
+ observableProto.concatAll = observableProto.concatObservable = function () {
+ return this.merge(1);
+ };
+
+ var MergeObservable = (function (__super__) {
+ inherits(MergeObservable, __super__);
+
+ function MergeObservable(source, maxConcurrent) {
+ this.source = source;
+ this.maxConcurrent = maxConcurrent;
+ __super__.call(this);
+ }
+
+ MergeObservable.prototype.subscribeCore = function(observer) {
+ var g = new CompositeDisposable();
+ g.add(this.source.subscribe(new MergeObserver(observer, this.maxConcurrent, g)));
+ return g;
+ };
+
+ return MergeObservable;
+
+ }(ObservableBase));
+
+ var MergeObserver = (function () {
+ function MergeObserver(o, max, g) {
+ this.o = o;
+ this.max = max;
+ this.g = g;
+ this.done = false;
+ this.q = [];
+ this.activeCount = 0;
+ this.isStopped = false;
+ }
+ MergeObserver.prototype.handleSubscribe = function (xs) {
+ var sad = new SingleAssignmentDisposable();
+ this.g.add(sad);
+ isPromise(xs) && (xs = observableFromPromise(xs));
+ sad.setDisposable(xs.subscribe(new InnerObserver(this, sad)));
+ };
+ MergeObserver.prototype.onNext = function (innerSource) {
+ if (this.isStopped) { return; }
+ if(this.activeCount < this.max) {
+ this.activeCount++;
+ this.handleSubscribe(innerSource);
+ } else {
+ this.q.push(innerSource);
+ }
+ };
+ MergeObserver.prototype.onError = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ }
+ };
+ MergeObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.done = true;
+ this.activeCount === 0 && this.o.onCompleted();
+ }
+ };
+ MergeObserver.prototype.dispose = function() { this.isStopped = true; };
+ MergeObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ function InnerObserver(parent, sad) {
+ this.parent = parent;
+ this.sad = sad;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) { if(!this.isStopped) { this.parent.o.onNext(x); } };
+ InnerObserver.prototype.onError = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.parent.o.onError(e);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ var parent = this.parent;
+ parent.g.remove(this.sad);
+ if (parent.q.length > 0) {
+ parent.handleSubscribe(parent.q.shift());
+ } else {
+ parent.activeCount--;
+ parent.done && parent.activeCount === 0 && parent.o.onCompleted();
+ }
+ }
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.parent.o.onError(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ return MergeObserver;
+ }());
+
+
+
+
+
+ /**
+ * Merges an observable sequence of observable sequences into an observable sequence, limiting the number of concurrent subscriptions to inner sequences.
+ * Or merges two observable sequences into a single observable sequence.
+ *
+ * @example
+ * 1 - merged = sources.merge(1);
+ * 2 - merged = source.merge(otherSource);
+ * @param {Mixed} [maxConcurrentOrOther] Maximum number of inner observable sequences being subscribed to concurrently or the second observable sequence.
+ * @returns {Observable} The observable sequence that merges the elements of the inner sequences.
+ */
+ observableProto.merge = function (maxConcurrentOrOther) {
+ return typeof maxConcurrentOrOther !== 'number' ?
+ observableMerge(this, maxConcurrentOrOther) :
+ new MergeObservable(this, maxConcurrentOrOther);
+ };
+
+ /**
+ * Merges all the observable sequences into a single observable sequence.
+ * The scheduler is optional and if not specified, the immediate scheduler is used.
+ * @returns {Observable} The observable sequence that merges the elements of the observable sequences.
+ */
+ var observableMerge = Observable.merge = function () {
+ var scheduler, sources = [], i, len = arguments.length;
+ if (!arguments[0]) {
+ scheduler = immediateScheduler;
+ for(i = 1; i < len; i++) { sources.push(arguments[i]); }
+ } else if (isScheduler(arguments[0])) {
+ scheduler = arguments[0];
+ for(i = 1; i < len; i++) { sources.push(arguments[i]); }
+ } else {
+ scheduler = immediateScheduler;
+ for(i = 0; i < len; i++) { sources.push(arguments[i]); }
+ }
+ if (Array.isArray(sources[0])) {
+ sources = sources[0];
+ }
+ return observableOf(scheduler, sources).mergeAll();
+ };
+
+ var MergeAllObservable = (function (__super__) {
+ inherits(MergeAllObservable, __super__);
+
+ function MergeAllObservable(source) {
+ this.source = source;
+ __super__.call(this);
+ }
+
+ MergeAllObservable.prototype.subscribeCore = function (observer) {
+ var g = new CompositeDisposable(), m = new SingleAssignmentDisposable();
+ g.add(m);
+ m.setDisposable(this.source.subscribe(new MergeAllObserver(observer, g)));
+ return g;
+ };
+
+ function MergeAllObserver(o, g) {
+ this.o = o;
+ this.g = g;
+ this.isStopped = false;
+ this.done = false;
+ }
+ MergeAllObserver.prototype.onNext = function(innerSource) {
+ if(this.isStopped) { return; }
+ var sad = new SingleAssignmentDisposable();
+ this.g.add(sad);
+
+ isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
+
+ sad.setDisposable(innerSource.subscribe(new InnerObserver(this, this.g, sad)));
+ };
+ MergeAllObserver.prototype.onError = function (e) {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ }
+ };
+ MergeAllObserver.prototype.onCompleted = function () {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ this.done = true;
+ this.g.length === 1 && this.o.onCompleted();
+ }
+ };
+ MergeAllObserver.prototype.dispose = function() { this.isStopped = true; };
+ MergeAllObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ function InnerObserver(parent, g, sad) {
+ this.parent = parent;
+ this.g = g;
+ this.sad = sad;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) { if (!this.isStopped) { this.parent.o.onNext(x); } };
+ InnerObserver.prototype.onError = function (e) {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ this.parent.o.onError(e);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if(!this.isStopped) {
+ var parent = this.parent;
+ this.isStopped = true;
+ parent.g.remove(this.sad);
+ parent.done && parent.g.length === 1 && parent.o.onCompleted();
+ }
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.parent.o.onError(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ return MergeAllObservable;
+ }(ObservableBase));
+
+ /**
+ * Merges an observable sequence of observable sequences into an observable sequence.
+ * @returns {Observable} The observable sequence that merges the elements of the inner sequences.
+ */
+ observableProto.mergeAll = observableProto.mergeObservable = function () {
+ return new MergeAllObservable(this);
+ };
+
+ var CompositeError = Rx.CompositeError = function(errors) {
+ this.name = "NotImplementedError";
+ this.innerErrors = errors;
+ this.message = 'This contains multiple errors. Check the innerErrors';
+ Error.call(this);
+ }
+ CompositeError.prototype = Error.prototype;
+
+ /**
+ * Flattens an Observable that emits Observables into one Observable, in a way that allows an Observer to
+ * receive all successfully emitted items from all of the source Observables without being interrupted by
+ * an error notification from one of them.
+ *
+ * This behaves like Observable.prototype.mergeAll except that if any of the merged Observables notify of an
+ * error via the Observer's onError, mergeDelayError will refrain from propagating that
+ * error notification until all of the merged Observables have finished emitting items.
+ * @param {Array | Arguments} args Arguments or an array to merge.
+ * @returns {Observable} an Observable that emits all of the items emitted by the Observables emitted by the Observable
+ */
+ Observable.mergeDelayError = function() {
+ var args;
+ if (Array.isArray(arguments[0])) {
+ args = arguments[0];
+ } else {
+ var len = arguments.length;
+ args = new Array(len);
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+ }
+ var source = observableOf(null, args);
+
+ return new AnonymousObservable(function (o) {
+ var group = new CompositeDisposable(),
+ m = new SingleAssignmentDisposable(),
+ isStopped = false,
+ errors = [];
+
+ function setCompletion() {
+ if (errors.length === 0) {
+ o.onCompleted();
+ } else if (errors.length === 1) {
+ o.onError(errors[0]);
+ } else {
+ o.onError(new CompositeError(errors));
+ }
+ }
+
+ group.add(m);
+
+ m.setDisposable(source.subscribe(
+ function (innerSource) {
+ var innerSubscription = new SingleAssignmentDisposable();
+ group.add(innerSubscription);
+
+ // Check for promises support
+ isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
+
+ innerSubscription.setDisposable(innerSource.subscribe(
+ function (x) { o.onNext(x); },
+ function (e) {
+ errors.push(e);
+ group.remove(innerSubscription);
+ isStopped && group.length === 1 && setCompletion();
+ },
+ function () {
+ group.remove(innerSubscription);
+ isStopped && group.length === 1 && setCompletion();
+ }));
+ },
+ function (e) {
+ errors.push(e);
+ isStopped = true;
+ group.length === 1 && setCompletion();
+ },
+ function () {
+ isStopped = true;
+ group.length === 1 && setCompletion();
+ }));
+ return group;
+ });
+ };
+
+ /**
+ * Continues an observable sequence that is terminated normally or by an exception with the next observable sequence.
+ * @param {Observable} second Second observable sequence used to produce results after the first sequence terminates.
+ * @returns {Observable} An observable sequence that concatenates the first and second sequence, even if the first sequence terminates exceptionally.
+ */
+ observableProto.onErrorResumeNext = function (second) {
+ if (!second) { throw new Error('Second observable is required'); }
+ return onErrorResumeNext([this, second]);
+ };
+
+ /**
+ * Continues an observable sequence that is terminated normally or by an exception with the next observable sequence.
+ *
+ * @example
+ * 1 - res = Rx.Observable.onErrorResumeNext(xs, ys, zs);
+ * 1 - res = Rx.Observable.onErrorResumeNext([xs, ys, zs]);
+ * @returns {Observable} An observable sequence that concatenates the source sequences, even if a sequence terminates exceptionally.
+ */
+ var onErrorResumeNext = Observable.onErrorResumeNext = function () {
+ var sources = [];
+ if (Array.isArray(arguments[0])) {
+ sources = arguments[0];
+ } else {
+ for(var i = 0, len = arguments.length; i < len; i++) { sources.push(arguments[i]); }
+ }
+ return new AnonymousObservable(function (observer) {
+ var pos = 0, subscription = new SerialDisposable(),
+ cancelable = immediateScheduler.scheduleRecursive(function (self) {
+ var current, d;
+ if (pos < sources.length) {
+ current = sources[pos++];
+ isPromise(current) && (current = observableFromPromise(current));
+ d = new SingleAssignmentDisposable();
+ subscription.setDisposable(d);
+ d.setDisposable(current.subscribe(observer.onNext.bind(observer), self, self));
+ } else {
+ observer.onCompleted();
+ }
+ });
+ return new CompositeDisposable(subscription, cancelable);
+ });
+ };
+
+ /**
+ * Returns the values from the source observable sequence only after the other observable sequence produces a value.
+ * @param {Observable | Promise} other The observable sequence or Promise that triggers propagation of elements of the source sequence.
+ * @returns {Observable} An observable sequence containing the elements of the source sequence starting from the point the other sequence triggered propagation.
+ */
+ observableProto.skipUntil = function (other) {
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var isOpen = false;
+ var disposables = new CompositeDisposable(source.subscribe(function (left) {
+ isOpen && o.onNext(left);
+ }, function (e) { o.onError(e); }, function () {
+ isOpen && o.onCompleted();
+ }));
+
+ isPromise(other) && (other = observableFromPromise(other));
+
+ var rightSubscription = new SingleAssignmentDisposable();
+ disposables.add(rightSubscription);
+ rightSubscription.setDisposable(other.subscribe(function () {
+ isOpen = true;
+ rightSubscription.dispose();
+ }, function (e) { o.onError(e); }, function () {
+ rightSubscription.dispose();
+ }));
+
+ return disposables;
+ }, source);
+ };
+
+ var SwitchObservable = (function(__super__) {
+ inherits(SwitchObservable, __super__);
+ function SwitchObservable(source) {
+ this.source = source;
+ __super__.call(this);
+ }
+
+ SwitchObservable.prototype.subscribeCore = function (o) {
+ var inner = new SerialDisposable(), s = this.source.subscribe(new SwitchObserver(o, inner));
+ return new CompositeDisposable(s, inner);
+ };
+
+ function SwitchObserver(o, inner) {
+ this.o = o;
+ this.inner = inner;
+ this.stopped = false;
+ this.latest = 0;
+ this.hasLatest = false;
+ this.isStopped = false;
+ }
+ SwitchObserver.prototype.onNext = function (innerSource) {
+ if (this.isStopped) { return; }
+ var d = new SingleAssignmentDisposable(), id = ++this.latest;
+ this.hasLatest = true;
+ this.inner.setDisposable(d);
+ isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
+ d.setDisposable(innerSource.subscribe(new InnerObserver(this, id)));
+ };
+ SwitchObserver.prototype.onError = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ }
+ };
+ SwitchObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.stopped = true;
+ !this.hasLatest && this.o.onCompleted();
+ }
+ };
+ SwitchObserver.prototype.dispose = function () { this.isStopped = true; };
+ SwitchObserver.prototype.fail = function (e) {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ function InnerObserver(parent, id) {
+ this.parent = parent;
+ this.id = id;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) {
+ if (this.isStopped) { return; }
+ this.parent.latest === this.id && this.parent.o.onNext(x);
+ };
+ InnerObserver.prototype.onError = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.parent.latest === this.id && this.parent.o.onError(e);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ if (this.parent.latest === this.id) {
+ this.parent.hasLatest = false;
+ this.parent.isStopped && this.parent.o.onCompleted();
+ }
+ }
+ };
+ InnerObserver.prototype.dispose = function () { this.isStopped = true; }
+ InnerObserver.prototype.fail = function (e) {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ this.parent.o.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ return SwitchObservable;
+ }(ObservableBase));
+
+ /**
+ * Transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
+ * @returns {Observable} The observable sequence that at any point in time produces the elements of the most recent inner observable sequence that has been received.
+ */
+ observableProto['switch'] = observableProto.switchLatest = function () {
+ return new SwitchObservable(this);
+ };
+
+ var TakeUntilObservable = (function(__super__) {
+ inherits(TakeUntilObservable, __super__);
+
+ function TakeUntilObservable(source, other) {
+ this.source = source;
+ this.other = isPromise(other) ? observableFromPromise(other) : other;
+ __super__.call(this);
+ }
+
+ TakeUntilObservable.prototype.subscribeCore = function(o) {
+ return new CompositeDisposable(
+ this.source.subscribe(o),
+ this.other.subscribe(new InnerObserver(o))
+ );
+ };
+
+ function InnerObserver(o) {
+ this.o = o;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) {
+ if (this.isStopped) { return; }
+ this.o.onCompleted();
+ };
+ InnerObserver.prototype.onError = function (err) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(err);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ !this.isStopped && (this.isStopped = true);
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ return TakeUntilObservable;
+ }(ObservableBase));
+
+ /**
+ * Returns the values from the source observable sequence until the other observable sequence produces a value.
+ * @param {Observable | Promise} other Observable sequence or Promise that terminates propagation of elements of the source sequence.
+ * @returns {Observable} An observable sequence containing the elements of the source sequence up to the point the other sequence interrupted further propagation.
+ */
+ observableProto.takeUntil = function (other) {
+ return new TakeUntilObservable(this, other);
+ };
+
+ function falseFactory() { return false; }
+
+ /**
+ * Merges the specified observable sequences into one observable sequence by using the selector function only when the (first) source observable sequence produces an element.
+ * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
+ */
+ observableProto.withLatestFrom = function () {
+ var len = arguments.length, args = new Array(len)
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+ var resultSelector = args.pop(), source = this;
+ Array.isArray(args[0]) && (args = args[0]);
+
+ return new AnonymousObservable(function (observer) {
+ var n = args.length,
+ hasValue = arrayInitialize(n, falseFactory),
+ hasValueAll = false,
+ values = new Array(n);
+
+ var subscriptions = new Array(n + 1);
+ for (var idx = 0; idx < n; idx++) {
+ (function (i) {
+ var other = args[i], sad = new SingleAssignmentDisposable();
+ isPromise(other) && (other = observableFromPromise(other));
+ sad.setDisposable(other.subscribe(function (x) {
+ values[i] = x;
+ hasValue[i] = true;
+ hasValueAll = hasValue.every(identity);
+ }, function (e) { observer.onError(e); }, noop));
+ subscriptions[i] = sad;
+ }(idx));
+ }
+
+ var sad = new SingleAssignmentDisposable();
+ sad.setDisposable(source.subscribe(function (x) {
+ var allValues = [x].concat(values);
+ if (!hasValueAll) { return; }
+ var res = tryCatch(resultSelector).apply(null, allValues);
+ if (res === errorObj) { return observer.onError(res.e); }
+ observer.onNext(res);
+ }, function (e) { observer.onError(e); }, function () {
+ observer.onCompleted();
+ }));
+ subscriptions[n] = sad;
+
+ return new CompositeDisposable(subscriptions);
+ }, this);
+ };
+
+ function zipArray(second, resultSelector) {
+ var first = this;
+ return new AnonymousObservable(function (o) {
+ var index = 0, len = second.length;
+ return first.subscribe(function (left) {
+ if (index < len) {
+ var right = second[index++], res = tryCatch(resultSelector)(left, right);
+ if (res === errorObj) { return o.onError(res.e); }
+ o.onNext(res);
+ } else {
+ o.onCompleted();
+ }
+ }, function (e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, first);
+ }
+
+ function falseFactory() { return false; }
+ function emptyArrayFactory() { return []; }
+
+ /**
+ * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences or an array have produced an element at a corresponding index.
+ * The last element in the arguments must be a function to invoke for each series of elements at corresponding indexes in the args.
+ * @returns {Observable} An observable sequence containing the result of combining elements of the args using the specified result selector function.
+ */
+ observableProto.zip = function () {
+ if (Array.isArray(arguments[0])) { return zipArray.apply(this, arguments); }
+ var len = arguments.length, args = new Array(len);
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+
+ var parent = this, resultSelector = args.pop();
+ args.unshift(parent);
+ return new AnonymousObservable(function (o) {
+ var n = args.length,
+ queues = arrayInitialize(n, emptyArrayFactory),
+ isDone = arrayInitialize(n, falseFactory);
+
+ var subscriptions = new Array(n);
+ for (var idx = 0; idx < n; idx++) {
+ (function (i) {
+ var source = args[i], sad = new SingleAssignmentDisposable();
+ isPromise(source) && (source = observableFromPromise(source));
+ sad.setDisposable(source.subscribe(function (x) {
+ queues[i].push(x);
+ if (queues.every(function (x) { return x.length > 0; })) {
+ var queuedValues = queues.map(function (x) { return x.shift(); }),
+ res = tryCatch(resultSelector).apply(parent, queuedValues);
+ if (res === errorObj) { return o.onError(res.e); }
+ o.onNext(res);
+ } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) {
+ o.onCompleted();
+ }
+ }, function (e) { o.onError(e); }, function () {
+ isDone[i] = true;
+ isDone.every(identity) && o.onCompleted();
+ }));
+ subscriptions[i] = sad;
+ })(idx);
+ }
+
+ return new CompositeDisposable(subscriptions);
+ }, parent);
+ };
+
+ /**
+ * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index.
+ * @param arguments Observable sources.
+ * @param {Function} resultSelector Function to invoke for each series of elements at corresponding indexes in the sources.
+ * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
+ */
+ Observable.zip = function () {
+ var len = arguments.length, args = new Array(len);
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+ var first = args.shift();
+ return first.zip.apply(first, args);
+ };
+
+ function falseFactory() { return false; }
+ function arrayFactory() { return []; }
+
+ /**
+ * Merges the specified observable sequences into one observable sequence by emitting a list with the elements of the observable sequences at corresponding indexes.
+ * @param arguments Observable sources.
+ * @returns {Observable} An observable sequence containing lists of elements at corresponding indexes.
+ */
+ Observable.zipArray = function () {
+ var sources;
+ if (Array.isArray(arguments[0])) {
+ sources = arguments[0];
+ } else {
+ var len = arguments.length;
+ sources = new Array(len);
+ for(var i = 0; i < len; i++) { sources[i] = arguments[i]; }
+ }
+ return new AnonymousObservable(function (o) {
+ var n = sources.length,
+ queues = arrayInitialize(n, arrayFactory),
+ isDone = arrayInitialize(n, falseFactory);
+
+ var subscriptions = new Array(n);
+ for (var idx = 0; idx < n; idx++) {
+ (function (i) {
+ subscriptions[i] = new SingleAssignmentDisposable();
+ subscriptions[i].setDisposable(sources[i].subscribe(function (x) {
+ queues[i].push(x);
+ if (queues.every(function (x) { return x.length > 0; })) {
+ var res = queues.map(function (x) { return x.shift(); });
+ o.onNext(res);
+ } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) {
+ return o.onCompleted();
+ }
+ }, function (e) { o.onError(e); }, function () {
+ isDone[i] = true;
+ isDone.every(identity) && o.onCompleted();
+ }));
+ })(idx);
+ }
+
+ return new CompositeDisposable(subscriptions);
+ });
+ };
+
+ /**
+ * Hides the identity of an observable sequence.
+ * @returns {Observable} An observable sequence that hides the identity of the source sequence.
+ */
+ observableProto.asObservable = function () {
+ var source = this;
+ return new AnonymousObservable(function (o) { return source.subscribe(o); }, source);
+ };
+
+ /**
+ * Projects each element of an observable sequence into zero or more buffers which are produced based on element count information.
+ *
+ * @example
+ * var res = xs.bufferWithCount(10);
+ * var res = xs.bufferWithCount(10, 1);
+ * @param {Number} count Length of each buffer.
+ * @param {Number} [skip] Number of elements to skip between creation of consecutive buffers. If not provided, defaults to the count.
+ * @returns {Observable} An observable sequence of buffers.
+ */
+ observableProto.bufferWithCount = function (count, skip) {
+ if (typeof skip !== 'number') {
+ skip = count;
+ }
+ return this.windowWithCount(count, skip).selectMany(function (x) {
+ return x.toArray();
+ }).where(function (x) {
+ return x.length > 0;
+ });
+ };
+
+ /**
+ * Dematerializes the explicit notification values of an observable sequence as implicit notifications.
+ * @returns {Observable} An observable sequence exhibiting the behavior corresponding to the source sequence's notification values.
+ */
+ observableProto.dematerialize = function () {
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ return source.subscribe(function (x) { return x.accept(o); }, function(e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, this);
+ };
+
+ /**
+ * Returns an observable sequence that contains only distinct contiguous elements according to the keySelector and the comparer.
+ *
+ * var obs = observable.distinctUntilChanged();
+ * var obs = observable.distinctUntilChanged(function (x) { return x.id; });
+ * var obs = observable.distinctUntilChanged(function (x) { return x.id; }, function (x, y) { return x === y; });
+ *
+ * @param {Function} [keySelector] A function to compute the comparison key for each element. If not provided, it projects the value.
+ * @param {Function} [comparer] Equality comparer for computed key values. If not provided, defaults to an equality comparer function.
+ * @returns {Observable} An observable sequence only containing the distinct contiguous elements, based on a computed key value, from the source sequence.
+ */
+ observableProto.distinctUntilChanged = function (keySelector, comparer) {
+ var source = this;
+ comparer || (comparer = defaultComparer);
+ return new AnonymousObservable(function (o) {
+ var hasCurrentKey = false, currentKey;
+ return source.subscribe(function (value) {
+ var key = value;
+ if (keySelector) {
+ key = tryCatch(keySelector)(value);
+ if (key === errorObj) { return o.onError(key.e); }
+ }
+ if (hasCurrentKey) {
+ var comparerEquals = tryCatch(comparer)(currentKey, key);
+ if (comparerEquals === errorObj) { return o.onError(comparerEquals.e); }
+ }
+ if (!hasCurrentKey || !comparerEquals) {
+ hasCurrentKey = true;
+ currentKey = key;
+ o.onNext(value);
+ }
+ }, function (e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, this);
+ };
+
+ var TapObservable = (function(__super__) {
+ inherits(TapObservable,__super__);
+ function TapObservable(source, observerOrOnNext, onError, onCompleted) {
+ this.source = source;
+ this.t = !observerOrOnNext || isFunction(observerOrOnNext) ?
+ observerCreate(observerOrOnNext || noop, onError || noop, onCompleted || noop) :
+ observerOrOnNext;
+ __super__.call(this);
+ }
+
+ TapObservable.prototype.subscribeCore = function(o) {
+ return this.source.subscribe(new InnerObserver(o, this.t));
+ };
+
+ function InnerObserver(o, t) {
+ this.o = o;
+ this.t = t;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function(x) {
+ if (this.isStopped) { return; }
+ var res = tryCatch(this.t.onNext).call(this.t, x);
+ if (res === errorObj) { this.o.onError(res.e); }
+ this.o.onNext(x);
+ };
+ InnerObserver.prototype.onError = function(err) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ var res = tryCatch(this.t.onError).call(this.t, err);
+ if (res === errorObj) { return this.o.onError(res.e); }
+ this.o.onError(err);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function() {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ var res = tryCatch(this.t.onCompleted).call(this.t);
+ if (res === errorObj) { return this.o.onError(res.e); }
+ this.o.onCompleted();
+ }
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ return TapObservable;
+ }(ObservableBase));
+
+ /**
+ * Invokes an action for each element in the observable sequence and invokes an action upon graceful or exceptional termination of the observable sequence.
+ * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
+ * @param {Function | Observer} observerOrOnNext Action to invoke for each element in the observable sequence or an o.
+ * @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function.
+ * @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function.
+ * @returns {Observable} The source sequence with the side-effecting behavior applied.
+ */
+ observableProto['do'] = observableProto.tap = observableProto.doAction = function (observerOrOnNext, onError, onCompleted) {
+ return new TapObservable(this, observerOrOnNext, onError, onCompleted);
+ };
+
+ /**
+ * Invokes an action for each element in the observable sequence.
+ * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
+ * @param {Function} onNext Action to invoke for each element in the observable sequence.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} The source sequence with the side-effecting behavior applied.
+ */
+ observableProto.doOnNext = observableProto.tapOnNext = function (onNext, thisArg) {
+ return this.tap(typeof thisArg !== 'undefined' ? function (x) { onNext.call(thisArg, x); } : onNext);
+ };
+
+ /**
+ * Invokes an action upon exceptional termination of the observable sequence.
+ * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
+ * @param {Function} onError Action to invoke upon exceptional termination of the observable sequence.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} The source sequence with the side-effecting behavior applied.
+ */
+ observableProto.doOnError = observableProto.tapOnError = function (onError, thisArg) {
+ return this.tap(noop, typeof thisArg !== 'undefined' ? function (e) { onError.call(thisArg, e); } : onError);
+ };
+
+ /**
+ * Invokes an action upon graceful termination of the observable sequence.
+ * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
+ * @param {Function} onCompleted Action to invoke upon graceful termination of the observable sequence.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} The source sequence with the side-effecting behavior applied.
+ */
+ observableProto.doOnCompleted = observableProto.tapOnCompleted = function (onCompleted, thisArg) {
+ return this.tap(noop, null, typeof thisArg !== 'undefined' ? function () { onCompleted.call(thisArg); } : onCompleted);
+ };
+
+ /**
+ * Invokes a specified action after the source observable sequence terminates gracefully or exceptionally.
+ * @param {Function} finallyAction Action to invoke after the source observable sequence terminates.
+ * @returns {Observable} Source sequence with the action-invoking termination behavior applied.
+ */
+ observableProto['finally'] = observableProto.ensure = function (action) {
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ var subscription;
+ try {
+ subscription = source.subscribe(observer);
+ } catch (e) {
+ action();
+ throw e;
+ }
+ return disposableCreate(function () {
+ try {
+ subscription.dispose();
+ } catch (e) {
+ throw e;
+ } finally {
+ action();
+ }
+ });
+ }, this);
+ };
+
+ /**
+ * @deprecated use #finally or #ensure instead.
+ */
+ observableProto.finallyAction = function (action) {
+ //deprecate('finallyAction', 'finally or ensure');
+ return this.ensure(action);
+ };
+
+ var IgnoreElementsObservable = (function(__super__) {
+ inherits(IgnoreElementsObservable, __super__);
+
+ function IgnoreElementsObservable(source) {
+ this.source = source;
+ __super__.call(this);
+ }
+
+ IgnoreElementsObservable.prototype.subscribeCore = function (o) {
+ return this.source.subscribe(new InnerObserver(o));
+ };
+
+ function InnerObserver(o) {
+ this.o = o;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = noop;
+ InnerObserver.prototype.onError = function (err) {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(err);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ this.o.onCompleted();
+ }
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.observer.onError(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ return IgnoreElementsObservable;
+ }(ObservableBase));
+
+ /**
+ * Ignores all elements in an observable sequence leaving only the termination messages.
+ * @returns {Observable} An empty observable sequence that signals termination, successful or exceptional, of the source sequence.
+ */
+ observableProto.ignoreElements = function () {
+ return new IgnoreElementsObservable(this);
+ };
+
+ /**
+ * Materializes the implicit notifications of an observable sequence as explicit notification values.
+ * @returns {Observable} An observable sequence containing the materialized notification values from the source sequence.
+ */
+ observableProto.materialize = function () {
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ return source.subscribe(function (value) {
+ observer.onNext(notificationCreateOnNext(value));
+ }, function (e) {
+ observer.onNext(notificationCreateOnError(e));
+ observer.onCompleted();
+ }, function () {
+ observer.onNext(notificationCreateOnCompleted());
+ observer.onCompleted();
+ });
+ }, source);
+ };
+
+ /**
+ * Repeats the observable sequence a specified number of times. If the repeat count is not specified, the sequence repeats indefinitely.
+ * @param {Number} [repeatCount] Number of times to repeat the sequence. If not provided, repeats the sequence indefinitely.
+ * @returns {Observable} The observable sequence producing the elements of the given sequence repeatedly.
+ */
+ observableProto.repeat = function (repeatCount) {
+ return enumerableRepeat(this, repeatCount).concat();
+ };
+
+ /**
+ * Repeats the source observable sequence the specified number of times or until it successfully terminates. If the retry count is not specified, it retries indefinitely.
+ * Note if you encounter an error and want it to retry once, then you must use .retry(2);
+ *
+ * @example
+ * var res = retried = retry.repeat();
+ * var res = retried = retry.repeat(2);
+ * @param {Number} [retryCount] Number of times to retry the sequence. If not provided, retry the sequence indefinitely.
+ * @returns {Observable} An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully.
+ */
+ observableProto.retry = function (retryCount) {
+ return enumerableRepeat(this, retryCount).catchError();
+ };
+
+ /**
+ * Repeats the source observable sequence upon error each time the notifier emits or until it successfully terminates.
+ * if the notifier completes, the observable sequence completes.
+ *
+ * @example
+ * var timer = Observable.timer(500);
+ * var source = observable.retryWhen(timer);
+ * @param {Observable} [notifier] An observable that triggers the retries or completes the observable with onNext or onCompleted respectively.
+ * @returns {Observable} An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully.
+ */
+ observableProto.retryWhen = function (notifier) {
+ return enumerableRepeat(this).catchErrorWhen(notifier);
+ };
+ var ScanObservable = (function(__super__) {
+ inherits(ScanObservable, __super__);
+ function ScanObservable(source, accumulator, hasSeed, seed) {
+ this.source = source;
+ this.accumulator = accumulator;
+ this.hasSeed = hasSeed;
+ this.seed = seed;
+ __super__.call(this);
+ }
+
+ ScanObservable.prototype.subscribeCore = function(observer) {
+ return this.source.subscribe(new ScanObserver(observer,this));
+ };
+
+ return ScanObservable;
+ }(ObservableBase));
+
+ function ScanObserver(observer, parent) {
+ this.observer = observer;
+ this.accumulator = parent.accumulator;
+ this.hasSeed = parent.hasSeed;
+ this.seed = parent.seed;
+ this.hasAccumulation = false;
+ this.accumulation = null;
+ this.hasValue = false;
+ this.isStopped = false;
+ }
+ ScanObserver.prototype.onNext = function (x) {
+ if (this.isStopped) { return; }
+ !this.hasValue && (this.hasValue = true);
+ try {
+ if (this.hasAccumulation) {
+ this.accumulation = this.accumulator(this.accumulation, x);
+ } else {
+ this.accumulation = this.hasSeed ? this.accumulator(this.seed, x) : x;
+ this.hasAccumulation = true;
+ }
+ } catch (e) {
+ return this.observer.onError(e);
+ }
+ this.observer.onNext(this.accumulation);
+ };
+ ScanObserver.prototype.onError = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.observer.onError(e);
+ }
+ };
+ ScanObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ !this.hasValue && this.hasSeed && this.observer.onNext(this.seed);
+ this.observer.onCompleted();
+ }
+ };
+ ScanObserver.prototype.dispose = function() { this.isStopped = true; };
+ ScanObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.observer.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ /**
+ * Applies an accumulator function over an observable sequence and returns each intermediate result. The optional seed value is used as the initial accumulator value.
+ * For aggregation behavior with no intermediate results, see Observable.aggregate.
+ * @param {Mixed} [seed] The initial accumulator value.
+ * @param {Function} accumulator An accumulator function to be invoked on each element.
+ * @returns {Observable} An observable sequence containing the accumulated values.
+ */
+ observableProto.scan = function () {
+ var hasSeed = false, seed, accumulator, source = this;
+ if (arguments.length === 2) {
+ hasSeed = true;
+ seed = arguments[0];
+ accumulator = arguments[1];
+ } else {
+ accumulator = arguments[0];
+ }
+ return new ScanObservable(this, accumulator, hasSeed, seed);
+ };
+
+ /**
+ * Bypasses a specified number of elements at the end of an observable sequence.
+ * @description
+ * This operator accumulates a queue with a length enough to store the first `count` elements. As more elements are
+ * received, elements are taken from the front of the queue and produced on the result sequence. This causes elements to be delayed.
+ * @param count Number of elements to bypass at the end of the source sequence.
+ * @returns {Observable} An observable sequence containing the source sequence elements except for the bypassed ones at the end.
+ */
+ observableProto.skipLast = function (count) {
+ if (count < 0) { throw new ArgumentOutOfRangeError(); }
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var q = [];
+ return source.subscribe(function (x) {
+ q.push(x);
+ q.length > count && o.onNext(q.shift());
+ }, function (e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, source);
+ };
+
+ /**
+ * Prepends a sequence of values to an observable sequence with an optional scheduler and an argument list of values to prepend.
+ * @example
+ * var res = source.startWith(1, 2, 3);
+ * var res = source.startWith(Rx.Scheduler.timeout, 1, 2, 3);
+ * @param {Arguments} args The specified values to prepend to the observable sequence
+ * @returns {Observable} The source sequence prepended with the specified values.
+ */
+ observableProto.startWith = function () {
+ var values, scheduler, start = 0;
+ if (!!arguments.length && isScheduler(arguments[0])) {
+ scheduler = arguments[0];
+ start = 1;
+ } else {
+ scheduler = immediateScheduler;
+ }
+ for(var args = [], i = start, len = arguments.length; i < len; i++) { args.push(arguments[i]); }
+ return enumerableOf([observableFromArray(args, scheduler), this]).concat();
+ };
+
+ /**
+ * Returns a specified number of contiguous elements from the end of an observable sequence.
+ * @description
+ * This operator accumulates a buffer with a length enough to store elements count elements. Upon completion of
+ * the source sequence, this buffer is drained on the result sequence. This causes the elements to be delayed.
+ * @param {Number} count Number of elements to take from the end of the source sequence.
+ * @returns {Observable} An observable sequence containing the specified number of elements from the end of the source sequence.
+ */
+ observableProto.takeLast = function (count) {
+ if (count < 0) { throw new ArgumentOutOfRangeError(); }
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var q = [];
+ return source.subscribe(function (x) {
+ q.push(x);
+ q.length > count && q.shift();
+ }, function (e) { o.onError(e); }, function () {
+ while (q.length > 0) { o.onNext(q.shift()); }
+ o.onCompleted();
+ });
+ }, source);
+ };
+
+ /**
+ * Returns an array with the specified number of contiguous elements from the end of an observable sequence.
+ *
+ * @description
+ * This operator accumulates a buffer with a length enough to store count elements. Upon completion of the
+ * source sequence, this buffer is produced on the result sequence.
+ * @param {Number} count Number of elements to take from the end of the source sequence.
+ * @returns {Observable} An observable sequence containing a single array with the specified number of elements from the end of the source sequence.
+ */
+ observableProto.takeLastBuffer = function (count) {
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var q = [];
+ return source.subscribe(function (x) {
+ q.push(x);
+ q.length > count && q.shift();
+ }, function (e) { o.onError(e); }, function () {
+ o.onNext(q);
+ o.onCompleted();
+ });
+ }, source);
+ };
+
+ /**
+ * Projects each element of an observable sequence into zero or more windows which are produced based on element count information.
+ *
+ * var res = xs.windowWithCount(10);
+ * var res = xs.windowWithCount(10, 1);
+ * @param {Number} count Length of each window.
+ * @param {Number} [skip] Number of elements to skip between creation of consecutive windows. If not specified, defaults to the count.
+ * @returns {Observable} An observable sequence of windows.
+ */
+ observableProto.windowWithCount = function (count, skip) {
+ var source = this;
+ +count || (count = 0);
+ Math.abs(count) === Infinity && (count = 0);
+ if (count <= 0) { throw new ArgumentOutOfRangeError(); }
+ skip == null && (skip = count);
+ +skip || (skip = 0);
+ Math.abs(skip) === Infinity && (skip = 0);
+
+ if (skip <= 0) { throw new ArgumentOutOfRangeError(); }
+ return new AnonymousObservable(function (observer) {
+ var m = new SingleAssignmentDisposable(),
+ refCountDisposable = new RefCountDisposable(m),
+ n = 0,
+ q = [];
+
+ function createWindow () {
+ var s = new Subject();
+ q.push(s);
+ observer.onNext(addRef(s, refCountDisposable));
+ }
+
+ createWindow();
+
+ m.setDisposable(source.subscribe(
+ function (x) {
+ for (var i = 0, len = q.length; i < len; i++) { q[i].onNext(x); }
+ var c = n - count + 1;
+ c >= 0 && c % skip === 0 && q.shift().onCompleted();
+ ++n % skip === 0 && createWindow();
+ },
+ function (e) {
+ while (q.length > 0) { q.shift().onError(e); }
+ observer.onError(e);
+ },
+ function () {
+ while (q.length > 0) { q.shift().onCompleted(); }
+ observer.onCompleted();
+ }
+ ));
+ return refCountDisposable;
+ }, source);
+ };
+
+ function concatMap(source, selector, thisArg) {
+ var selectorFunc = bindCallback(selector, thisArg, 3);
+ return source.map(function (x, i) {
+ var result = selectorFunc(x, i, source);
+ isPromise(result) && (result = observableFromPromise(result));
+ (isArrayLike(result) || isIterable(result)) && (result = observableFrom(result));
+ return result;
+ }).concatAll();
+ }
+
+ /**
+ * One of the Following:
+ * Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
+ *
+ * @example
+ * var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); });
+ * Or:
+ * Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
+ *
+ * var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
+ * Or:
+ * Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
+ *
+ * var res = source.concatMap(Rx.Observable.fromArray([1,2,3]));
+ * @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the
+ * source sequence onto which could be either an observable or Promise.
+ * @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
+ * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
+ */
+ observableProto.selectConcat = observableProto.concatMap = function (selector, resultSelector, thisArg) {
+ if (isFunction(selector) && isFunction(resultSelector)) {
+ return this.concatMap(function (x, i) {
+ var selectorResult = selector(x, i);
+ isPromise(selectorResult) && (selectorResult = observableFromPromise(selectorResult));
+ (isArrayLike(selectorResult) || isIterable(selectorResult)) && (selectorResult = observableFrom(selectorResult));
+
+ return selectorResult.map(function (y, i2) {
+ return resultSelector(x, y, i, i2);
+ });
+ });
+ }
+ return isFunction(selector) ?
+ concatMap(this, selector, thisArg) :
+ concatMap(this, function () { return selector; });
+ };
+
+ /**
+ * Projects each notification of an observable sequence to an observable sequence and concats the resulting observable sequences into one observable sequence.
+ * @param {Function} onNext A transform function to apply to each element; the second parameter of the function represents the index of the source element.
+ * @param {Function} onError A transform function to apply when an error occurs in the source sequence.
+ * @param {Function} onCompleted A transform function to apply when the end of the source sequence is reached.
+ * @param {Any} [thisArg] An optional "this" to use to invoke each transform.
+ * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function corresponding to each notification in the input sequence.
+ */
+ observableProto.concatMapObserver = observableProto.selectConcatObserver = function(onNext, onError, onCompleted, thisArg) {
+ var source = this,
+ onNextFunc = bindCallback(onNext, thisArg, 2),
+ onErrorFunc = bindCallback(onError, thisArg, 1),
+ onCompletedFunc = bindCallback(onCompleted, thisArg, 0);
+ return new AnonymousObservable(function (observer) {
+ var index = 0;
+ return source.subscribe(
+ function (x) {
+ var result;
+ try {
+ result = onNextFunc(x, index++);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+ isPromise(result) && (result = observableFromPromise(result));
+ observer.onNext(result);
+ },
+ function (err) {
+ var result;
+ try {
+ result = onErrorFunc(err);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+ isPromise(result) && (result = observableFromPromise(result));
+ observer.onNext(result);
+ observer.onCompleted();
+ },
+ function () {
+ var result;
+ try {
+ result = onCompletedFunc();
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+ isPromise(result) && (result = observableFromPromise(result));
+ observer.onNext(result);
+ observer.onCompleted();
+ });
+ }, this).concatAll();
+ };
+
+ /**
+ * Returns the elements of the specified sequence or the specified value in a singleton sequence if the sequence is empty.
+ *
+ * var res = obs = xs.defaultIfEmpty();
+ * 2 - obs = xs.defaultIfEmpty(false);
+ *
+ * @memberOf Observable#
+ * @param defaultValue The value to return if the sequence is empty. If not provided, this defaults to null.
+ * @returns {Observable} An observable sequence that contains the specified default value if the source is empty; otherwise, the elements of the source itself.
+ */
+ observableProto.defaultIfEmpty = function (defaultValue) {
+ var source = this;
+ defaultValue === undefined && (defaultValue = null);
+ return new AnonymousObservable(function (observer) {
+ var found = false;
+ return source.subscribe(function (x) {
+ found = true;
+ observer.onNext(x);
+ },
+ function (e) { observer.onError(e); },
+ function () {
+ !found && observer.onNext(defaultValue);
+ observer.onCompleted();
+ });
+ }, source);
+ };
+
+ // Swap out for Array.findIndex
+ function arrayIndexOfComparer(array, item, comparer) {
+ for (var i = 0, len = array.length; i < len; i++) {
+ if (comparer(array[i], item)) { return i; }
+ }
+ return -1;
+ }
+
+ function HashSet(comparer) {
+ this.comparer = comparer;
+ this.set = [];
+ }
+ HashSet.prototype.push = function(value) {
+ var retValue = arrayIndexOfComparer(this.set, value, this.comparer) === -1;
+ retValue && this.set.push(value);
+ return retValue;
+ };
+
+ /**
+ * Returns an observable sequence that contains only distinct elements according to the keySelector and the comparer.
+ * Usage of this operator should be considered carefully due to the maintenance of an internal lookup structure which can grow large.
+ *
+ * @example
+ * var res = obs = xs.distinct();
+ * 2 - obs = xs.distinct(function (x) { return x.id; });
+ * 2 - obs = xs.distinct(function (x) { return x.id; }, function (a,b) { return a === b; });
+ * @param {Function} [keySelector] A function to compute the comparison key for each element.
+ * @param {Function} [comparer] Used to compare items in the collection.
+ * @returns {Observable} An observable sequence only containing the distinct elements, based on a computed key value, from the source sequence.
+ */
+ observableProto.distinct = function (keySelector, comparer) {
+ var source = this;
+ comparer || (comparer = defaultComparer);
+ return new AnonymousObservable(function (o) {
+ var hashSet = new HashSet(comparer);
+ return source.subscribe(function (x) {
+ var key = x;
+
+ if (keySelector) {
+ try {
+ key = keySelector(x);
+ } catch (e) {
+ o.onError(e);
+ return;
+ }
+ }
+ hashSet.push(key) && o.onNext(x);
+ },
+ function (e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, this);
+ };
+
+ var MapObservable = (function (__super__) {
+ inherits(MapObservable, __super__);
+
+ function MapObservable(source, selector, thisArg) {
+ this.source = source;
+ this.selector = bindCallback(selector, thisArg, 3);
+ __super__.call(this);
+ }
+
+ function innerMap(selector, self) {
+ return function (x, i, o) { return selector.call(this, self.selector(x, i, o), i, o); }
+ }
+
+ MapObservable.prototype.internalMap = function (selector, thisArg) {
+ return new MapObservable(this.source, innerMap(selector, this), thisArg);
+ };
+
+ MapObservable.prototype.subscribeCore = function (o) {
+ return this.source.subscribe(new InnerObserver(o, this.selector, this));
+ };
+
+ function InnerObserver(o, selector, source) {
+ this.o = o;
+ this.selector = selector;
+ this.source = source;
+ this.i = 0;
+ this.isStopped = false;
+ }
+
+ InnerObserver.prototype.onNext = function(x) {
+ if (this.isStopped) { return; }
+ var result = tryCatch(this.selector)(x, this.i++, this.source);
+ if (result === errorObj) {
+ return this.o.onError(result.e);
+ }
+ this.o.onNext(result);
+ };
+ InnerObserver.prototype.onError = function (e) {
+ if(!this.isStopped) { this.isStopped = true; this.o.onError(e); }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if(!this.isStopped) { this.isStopped = true; this.o.onCompleted(); }
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ return MapObservable;
+
+ }(ObservableBase));
+
+ /**
+ * Projects each element of an observable sequence into a new form by incorporating the element's index.
+ * @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source.
+ */
+ observableProto.map = observableProto.select = function (selector, thisArg) {
+ var selectorFn = typeof selector === 'function' ? selector : function () { return selector; };
+ return this instanceof MapObservable ?
+ this.internalMap(selectorFn, thisArg) :
+ new MapObservable(this, selectorFn, thisArg);
+ };
+
+ /**
+ * Retrieves the value of a specified nested property from all elements in
+ * the Observable sequence.
+ * @param {Arguments} arguments The nested properties to pluck.
+ * @returns {Observable} Returns a new Observable sequence of property values.
+ */
+ observableProto.pluck = function () {
+ var args = arguments, len = arguments.length;
+ if (len === 0) { throw new Error('List of properties cannot be empty.'); }
+ return this.map(function (x) {
+ var currentProp = x;
+ for (var i = 0; i < len; i++) {
+ var p = currentProp[args[i]];
+ if (typeof p !== 'undefined') {
+ currentProp = p;
+ } else {
+ return undefined;
+ }
+ }
+ return currentProp;
+ });
+ };
+
+ function flatMap(source, selector, thisArg) {
+ var selectorFunc = bindCallback(selector, thisArg, 3);
+ return source.map(function (x, i) {
+ var result = selectorFunc(x, i, source);
+ isPromise(result) && (result = observableFromPromise(result));
+ (isArrayLike(result) || isIterable(result)) && (result = observableFrom(result));
+ return result;
+ }).mergeAll();
+ }
+
+ /**
+ * One of the Following:
+ * Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
+ *
+ * @example
+ * var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); });
+ * Or:
+ * Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
+ *
+ * var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
+ * Or:
+ * Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
+ *
+ * var res = source.selectMany(Rx.Observable.fromArray([1,2,3]));
+ * @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the source sequence onto which could be either an observable or Promise.
+ * @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
+ */
+ observableProto.selectMany = observableProto.flatMap = function (selector, resultSelector, thisArg) {
+ if (isFunction(selector) && isFunction(resultSelector)) {
+ return this.flatMap(function (x, i) {
+ var selectorResult = selector(x, i);
+ isPromise(selectorResult) && (selectorResult = observableFromPromise(selectorResult));
+ (isArrayLike(selectorResult) || isIterable(selectorResult)) && (selectorResult = observableFrom(selectorResult));
+
+ return selectorResult.map(function (y, i2) {
+ return resultSelector(x, y, i, i2);
+ });
+ }, thisArg);
+ }
+ return isFunction(selector) ?
+ flatMap(this, selector, thisArg) :
+ flatMap(this, function () { return selector; });
+ };
+
+ /**
+ * Projects each notification of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
+ * @param {Function} onNext A transform function to apply to each element; the second parameter of the function represents the index of the source element.
+ * @param {Function} onError A transform function to apply when an error occurs in the source sequence.
+ * @param {Function} onCompleted A transform function to apply when the end of the source sequence is reached.
+ * @param {Any} [thisArg] An optional "this" to use to invoke each transform.
+ * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function corresponding to each notification in the input sequence.
+ */
+ observableProto.flatMapObserver = observableProto.selectManyObserver = function (onNext, onError, onCompleted, thisArg) {
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ var index = 0;
+
+ return source.subscribe(
+ function (x) {
+ var result;
+ try {
+ result = onNext.call(thisArg, x, index++);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+ isPromise(result) && (result = observableFromPromise(result));
+ observer.onNext(result);
+ },
+ function (err) {
+ var result;
+ try {
+ result = onError.call(thisArg, err);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+ isPromise(result) && (result = observableFromPromise(result));
+ observer.onNext(result);
+ observer.onCompleted();
+ },
+ function () {
+ var result;
+ try {
+ result = onCompleted.call(thisArg);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+ isPromise(result) && (result = observableFromPromise(result));
+ observer.onNext(result);
+ observer.onCompleted();
+ });
+ }, source).mergeAll();
+ };
+
+ /**
+ * Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then
+ * transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
+ * @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences
+ * and that at any point in time produces the elements of the most recent inner observable sequence that has been received.
+ */
+ observableProto.selectSwitch = observableProto.flatMapLatest = observableProto.switchMap = function (selector, thisArg) {
+ return this.select(selector, thisArg).switchLatest();
+ };
+
+ var SkipObservable = (function(__super__) {
+ inherits(SkipObservable, __super__);
+ function SkipObservable(source, count) {
+ this.source = source;
+ this.skipCount = count;
+ __super__.call(this);
+ }
+
+ SkipObservable.prototype.subscribeCore = function (o) {
+ return this.source.subscribe(new InnerObserver(o, this.skipCount));
+ };
+
+ function InnerObserver(o, c) {
+ this.c = c;
+ this.r = c;
+ this.o = o;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) {
+ if (this.isStopped) { return; }
+ if (this.r <= 0) {
+ this.o.onNext(x);
+ } else {
+ this.r--;
+ }
+ };
+ InnerObserver.prototype.onError = function(e) {
+ if (!this.isStopped) { this.isStopped = true; this.o.onError(e); }
+ };
+ InnerObserver.prototype.onCompleted = function() {
+ if (!this.isStopped) { this.isStopped = true; this.o.onCompleted(); }
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function(e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ return SkipObservable;
+ }(ObservableBase));
+
+ /**
+ * Bypasses a specified number of elements in an observable sequence and then returns the remaining elements.
+ * @param {Number} count The number of elements to skip before returning the remaining elements.
+ * @returns {Observable} An observable sequence that contains the elements that occur after the specified index in the input sequence.
+ */
+ observableProto.skip = function (count) {
+ if (count < 0) { throw new ArgumentOutOfRangeError(); }
+ return new SkipObservable(this, count);
+ };
+ /**
+ * Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements.
+ * The element's index is used in the logic of the predicate function.
+ *
+ * var res = source.skipWhile(function (value) { return value < 10; });
+ * var res = source.skipWhile(function (value, index) { return value < 10 || index < 10; });
+ * @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate.
+ */
+ observableProto.skipWhile = function (predicate, thisArg) {
+ var source = this,
+ callback = bindCallback(predicate, thisArg, 3);
+ return new AnonymousObservable(function (o) {
+ var i = 0, running = false;
+ return source.subscribe(function (x) {
+ if (!running) {
+ try {
+ running = !callback(x, i++, source);
+ } catch (e) {
+ o.onError(e);
+ return;
+ }
+ }
+ running && o.onNext(x);
+ }, function (e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, source);
+ };
+
+ /**
+ * Returns a specified number of contiguous elements from the start of an observable sequence, using the specified scheduler for the edge case of take(0).
+ *
+ * var res = source.take(5);
+ * var res = source.take(0, Rx.Scheduler.timeout);
+ * @param {Number} count The number of elements to return.
+ * @param {Scheduler} [scheduler] Scheduler used to produce an OnCompleted message in case <paramref name="count count</paramref> is set to 0.
+ * @returns {Observable} An observable sequence that contains the specified number of elements from the start of the input sequence.
+ */
+ observableProto.take = function (count, scheduler) {
+ if (count < 0) { throw new ArgumentOutOfRangeError(); }
+ if (count === 0) { return observableEmpty(scheduler); }
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var remaining = count;
+ return source.subscribe(function (x) {
+ if (remaining-- > 0) {
+ o.onNext(x);
+ remaining <= 0 && o.onCompleted();
+ }
+ }, function (e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, source);
+ };
+
+ /**
+ * Returns elements from an observable sequence as long as a specified condition is true.
+ * The element's index is used in the logic of the predicate function.
+ * @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence that contains the elements from the input sequence that occur before the element at which the test no longer passes.
+ */
+ observableProto.takeWhile = function (predicate, thisArg) {
+ var source = this,
+ callback = bindCallback(predicate, thisArg, 3);
+ return new AnonymousObservable(function (o) {
+ var i = 0, running = true;
+ return source.subscribe(function (x) {
+ if (running) {
+ try {
+ running = callback(x, i++, source);
+ } catch (e) {
+ o.onError(e);
+ return;
+ }
+ if (running) {
+ o.onNext(x);
+ } else {
+ o.onCompleted();
+ }
+ }
+ }, function (e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, source);
+ };
+
+ var FilterObservable = (function (__super__) {
+ inherits(FilterObservable, __super__);
+
+ function FilterObservable(source, predicate, thisArg) {
+ this.source = source;
+ this.predicate = bindCallback(predicate, thisArg, 3);
+ __super__.call(this);
+ }
+
+ FilterObservable.prototype.subscribeCore = function (o) {
+ return this.source.subscribe(new InnerObserver(o, this.predicate, this));
+ };
+
+ function innerPredicate(predicate, self) {
+ return function(x, i, o) { return self.predicate(x, i, o) && predicate.call(this, x, i, o); }
+ }
+
+ FilterObservable.prototype.internalFilter = function(predicate, thisArg) {
+ return new FilterObservable(this.source, innerPredicate(predicate, this), thisArg);
+ };
+
+ function InnerObserver(o, predicate, source) {
+ this.o = o;
+ this.predicate = predicate;
+ this.source = source;
+ this.i = 0;
+ this.isStopped = false;
+ }
+
+ InnerObserver.prototype.onNext = function(x) {
+ if (this.isStopped) { return; }
+ var shouldYield = tryCatch(this.predicate)(x, this.i++, this.source);
+ if (shouldYield === errorObj) {
+ return this.o.onError(shouldYield.e);
+ }
+ shouldYield && this.o.onNext(x);
+ };
+ InnerObserver.prototype.onError = function (e) {
+ if(!this.isStopped) { this.isStopped = true; this.o.onError(e); }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if(!this.isStopped) { this.isStopped = true; this.o.onCompleted(); }
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ return FilterObservable;
+
+ }(ObservableBase));
+
+ /**
+ * Filters the elements of an observable sequence based on a predicate by incorporating the element's index.
+ * @param {Function} predicate A function to test each source element for a condition; the second parameter of the function represents the index of the source element.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence that contains elements from the input sequence that satisfy the condition.
+ */
+ observableProto.filter = observableProto.where = function (predicate, thisArg) {
+ return this instanceof FilterObservable ? this.internalFilter(predicate, thisArg) :
+ new FilterObservable(this, predicate, thisArg);
+ };
+
+ /**
+ * Executes a transducer to transform the observable sequence
+ * @param {Transducer} transducer A transducer to execute
+ * @returns {Observable} An Observable sequence containing the results from the transducer.
+ */
+ observableProto.transduce = function(transducer) {
+ var source = this;
+
+ function transformForObserver(o) {
+ return {
+ '@@transducer/init': function() {
+ return o;
+ },
+ '@@transducer/step': function(obs, input) {
+ return obs.onNext(input);
+ },
+ '@@transducer/result': function(obs) {
+ return obs.onCompleted();
+ }
+ };
+ }
+
+ return new AnonymousObservable(function(o) {
+ var xform = transducer(transformForObserver(o));
+ return source.subscribe(
+ function(v) {
+ try {
+ xform['@@transducer/step'](o, v);
+ } catch (e) {
+ o.onError(e);
+ }
+ },
+ function (e) { o.onError(e); },
+ function() { xform['@@transducer/result'](o); }
+ );
+ }, source);
+ };
+
+ var AnonymousObservable = Rx.AnonymousObservable = (function (__super__) {
+ inherits(AnonymousObservable, __super__);
+
+ // Fix subscriber to check for undefined or function returned to decorate as Disposable
+ function fixSubscriber(subscriber) {
+ return subscriber && isFunction(subscriber.dispose) ? subscriber :
+ isFunction(subscriber) ? disposableCreate(subscriber) : disposableEmpty;
+ }
+
+ function setDisposable(s, state) {
+ var ado = state[0], subscribe = state[1];
+ var sub = tryCatch(subscribe)(ado);
+
+ if (sub === errorObj) {
+ if(!ado.fail(errorObj.e)) { return thrower(errorObj.e); }
+ }
+ ado.setDisposable(fixSubscriber(sub));
+ }
+
+ function AnonymousObservable(subscribe, parent) {
+ this.source = parent;
+
+ function s(observer) {
+ var ado = new AutoDetachObserver(observer), state = [ado, subscribe];
+
+ if (currentThreadScheduler.scheduleRequired()) {
+ currentThreadScheduler.scheduleWithState(state, setDisposable);
+ } else {
+ setDisposable(null, state);
+ }
+ return ado;
+ }
+
+ __super__.call(this, s);
+ }
+
+ return AnonymousObservable;
+
+ }(Observable));
+
+ var AutoDetachObserver = (function (__super__) {
+ inherits(AutoDetachObserver, __super__);
+
+ function AutoDetachObserver(observer) {
+ __super__.call(this);
+ this.observer = observer;
+ this.m = new SingleAssignmentDisposable();
+ }
+
+ var AutoDetachObserverPrototype = AutoDetachObserver.prototype;
+
+ AutoDetachObserverPrototype.next = function (value) {
+ var result = tryCatch(this.observer.onNext).call(this.observer, value);
+ if (result === errorObj) {
+ this.dispose();
+ thrower(result.e);
+ }
+ };
+
+ AutoDetachObserverPrototype.error = function (err) {
+ var result = tryCatch(this.observer.onError).call(this.observer, err);
+ this.dispose();
+ result === errorObj && thrower(result.e);
+ };
+
+ AutoDetachObserverPrototype.completed = function () {
+ var result = tryCatch(this.observer.onCompleted).call(this.observer);
+ this.dispose();
+ result === errorObj && thrower(result.e);
+ };
+
+ AutoDetachObserverPrototype.setDisposable = function (value) { this.m.setDisposable(value); };
+ AutoDetachObserverPrototype.getDisposable = function () { return this.m.getDisposable(); };
+
+ AutoDetachObserverPrototype.dispose = function () {
+ __super__.prototype.dispose.call(this);
+ this.m.dispose();
+ };
+
+ return AutoDetachObserver;
+ }(AbstractObserver));
+
+ var InnerSubscription = function (subject, observer) {
+ this.subject = subject;
+ this.observer = observer;
+ };
+
+ InnerSubscription.prototype.dispose = function () {
+ if (!this.subject.isDisposed && this.observer !== null) {
+ var idx = this.subject.observers.indexOf(this.observer);
+ this.subject.observers.splice(idx, 1);
+ this.observer = null;
+ }
+ };
+
+ /**
+ * Represents an object that is both an observable sequence as well as an observer.
+ * Each notification is broadcasted to all subscribed observers.
+ */
+ var Subject = Rx.Subject = (function (__super__) {
+ function subscribe(observer) {
+ checkDisposed(this);
+ if (!this.isStopped) {
+ this.observers.push(observer);
+ return new InnerSubscription(this, observer);
+ }
+ if (this.hasError) {
+ observer.onError(this.error);
+ return disposableEmpty;
+ }
+ observer.onCompleted();
+ return disposableEmpty;
+ }
+
+ inherits(Subject, __super__);
+
+ /**
+ * Creates a subject.
+ */
+ function Subject() {
+ __super__.call(this, subscribe);
+ this.isDisposed = false,
+ this.isStopped = false,
+ this.observers = [];
+ this.hasError = false;
+ }
+
+ addProperties(Subject.prototype, Observer.prototype, {
+ /**
+ * Indicates whether the subject has observers subscribed to it.
+ * @returns {Boolean} Indicates whether the subject has observers subscribed to it.
+ */
+ hasObservers: function () { return this.observers.length > 0; },
+ /**
+ * Notifies all subscribed observers about the end of the sequence.
+ */
+ onCompleted: function () {
+ checkDisposed(this);
+ if (!this.isStopped) {
+ this.isStopped = true;
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ os[i].onCompleted();
+ }
+
+ this.observers.length = 0;
+ }
+ },
+ /**
+ * Notifies all subscribed observers about the exception.
+ * @param {Mixed} error The exception to send to all observers.
+ */
+ onError: function (error) {
+ checkDisposed(this);
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.error = error;
+ this.hasError = true;
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ os[i].onError(error);
+ }
+
+ this.observers.length = 0;
+ }
+ },
+ /**
+ * Notifies all subscribed observers about the arrival of the specified element in the sequence.
+ * @param {Mixed} value The value to send to all observers.
+ */
+ onNext: function (value) {
+ checkDisposed(this);
+ if (!this.isStopped) {
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ os[i].onNext(value);
+ }
+ }
+ },
+ /**
+ * Unsubscribe all observers and release resources.
+ */
+ dispose: function () {
+ this.isDisposed = true;
+ this.observers = null;
+ }
+ });
+
+ /**
+ * Creates a subject from the specified observer and observable.
+ * @param {Observer} observer The observer used to send messages to the subject.
+ * @param {Observable} observable The observable used to subscribe to messages sent from the subject.
+ * @returns {Subject} Subject implemented using the given observer and observable.
+ */
+ Subject.create = function (observer, observable) {
+ return new AnonymousSubject(observer, observable);
+ };
+
+ return Subject;
+ }(Observable));
+
+ /**
+ * Represents the result of an asynchronous operation.
+ * The last value before the OnCompleted notification, or the error received through OnError, is sent to all subscribed observers.
+ */
+ var AsyncSubject = Rx.AsyncSubject = (function (__super__) {
+
+ function subscribe(observer) {
+ checkDisposed(this);
+
+ if (!this.isStopped) {
+ this.observers.push(observer);
+ return new InnerSubscription(this, observer);
+ }
+
+ if (this.hasError) {
+ observer.onError(this.error);
+ } else if (this.hasValue) {
+ observer.onNext(this.value);
+ observer.onCompleted();
+ } else {
+ observer.onCompleted();
+ }
+
+ return disposableEmpty;
+ }
+
+ inherits(AsyncSubject, __super__);
+
+ /**
+ * Creates a subject that can only receive one value and that value is cached for all future observations.
+ * @constructor
+ */
+ function AsyncSubject() {
+ __super__.call(this, subscribe);
+
+ this.isDisposed = false;
+ this.isStopped = false;
+ this.hasValue = false;
+ this.observers = [];
+ this.hasError = false;
+ }
+
+ addProperties(AsyncSubject.prototype, Observer, {
+ /**
+ * Indicates whether the subject has observers subscribed to it.
+ * @returns {Boolean} Indicates whether the subject has observers subscribed to it.
+ */
+ hasObservers: function () {
+ checkDisposed(this);
+ return this.observers.length > 0;
+ },
+ /**
+ * Notifies all subscribed observers about the end of the sequence, also causing the last received value to be sent out (if any).
+ */
+ onCompleted: function () {
+ var i, len;
+ checkDisposed(this);
+ if (!this.isStopped) {
+ this.isStopped = true;
+ var os = cloneArray(this.observers), len = os.length;
+
+ if (this.hasValue) {
+ for (i = 0; i < len; i++) {
+ var o = os[i];
+ o.onNext(this.value);
+ o.onCompleted();
+ }
+ } else {
+ for (i = 0; i < len; i++) {
+ os[i].onCompleted();
+ }
+ }
+
+ this.observers.length = 0;
+ }
+ },
+ /**
+ * Notifies all subscribed observers about the error.
+ * @param {Mixed} error The Error to send to all observers.
+ */
+ onError: function (error) {
+ checkDisposed(this);
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.hasError = true;
+ this.error = error;
+
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ os[i].onError(error);
+ }
+
+ this.observers.length = 0;
+ }
+ },
+ /**
+ * Sends a value to the subject. The last value received before successful termination will be sent to all subscribed and future observers.
+ * @param {Mixed} value The value to store in the subject.
+ */
+ onNext: function (value) {
+ checkDisposed(this);
+ if (this.isStopped) { return; }
+ this.value = value;
+ this.hasValue = true;
+ },
+ /**
+ * Unsubscribe all observers and release resources.
+ */
+ dispose: function () {
+ this.isDisposed = true;
+ this.observers = null;
+ this.exception = null;
+ this.value = null;
+ }
+ });
+
+ return AsyncSubject;
+ }(Observable));
+
+ var AnonymousSubject = Rx.AnonymousSubject = (function (__super__) {
+ inherits(AnonymousSubject, __super__);
+
+ function subscribe(observer) {
+ return this.observable.subscribe(observer);
+ }
+
+ function AnonymousSubject(observer, observable) {
+ this.observer = observer;
+ this.observable = observable;
+ __super__.call(this, subscribe);
+ }
+
+ addProperties(AnonymousSubject.prototype, Observer.prototype, {
+ onCompleted: function () {
+ this.observer.onCompleted();
+ },
+ onError: function (error) {
+ this.observer.onError(error);
+ },
+ onNext: function (value) {
+ this.observer.onNext(value);
+ }
+ });
+
+ return AnonymousSubject;
+ }(Observable));
+
+ if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
+ root.Rx = Rx;
+
+ define(function() {
+ return Rx;
+ });
+ } else if (freeExports && freeModule) {
+ // in Node.js or RingoJS
+ if (moduleExports) {
+ (freeModule.exports = Rx).Rx = Rx;
+ } else {
+ freeExports.Rx = Rx;
+ }
+ } else {
+ // in a browser or Rhino
+ root.Rx = Rx;
+ }
+
+ // All code before this point will be filtered from stack traces.
+ var rEndingLine = captureLine();
+
+}.call(this));
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.compat.map b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.compat.map
new file mode 100644
index 00000000000..e0122a58a24
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.compat.map
@@ -0,0 +1 @@
+{"version":3,"file":"rx.compat.min.js","sources":["rx.compat.js"],"names":["undefined","cloneArray","arr","len","length","a","Array","i","makeStackTraceLong","error","observable","hasStacks","stack","indexOf","STACK_JUMP_SEPARATOR","stacks","o","source","unshift","concatedStacks","join","filterStackString","stackString","lines","split","desiredLines","line","isInternalFrame","isNodeFrame","push","stackLine","fileNameAndLineNumber","getFileNameAndLineNumber","fileName","lineNumber","rFileName","rStartingLine","rEndingLine","captureLine","Error","e","firstLine","attempt1","exec","Number","attempt2","attempt3","keysIn","object","result","isObject","support","nonEnumArgs","isArguments","slice","call","skipProto","enumPrototypes","skipErrorProps","enumErrorProps","errorProto","key","nonEnumShadows","objectProto","ctor","constructor","index","dontEnumsLength","prototype","className","stringProto","stringClass","errorClass","toString","nonEnum","nonEnumProps","dontEnums","hasOwnProperty","internalFor","callback","keysFunc","props","internalForIn","isNode","value","deepEquals","b","stackA","stackB","type","otherType","otherClass","argsClass","objectClass","boolClass","dateClass","numberClass","regexpClass","String","isArr","arrayClass","nodeClass","ctorA","argsObject","Object","ctorB","isFunction","size","pop","arrayInitialize","count","factory","tryCatcher","tryCatchTarget","apply","this","arguments","errorObj","tryCatch","fn","TypeError","thrower","IndexedItem","id","ScheduledDisposable","scheduler","disposable","isDisposed","scheduleItem","s","self","dispose","StringIterable","str","_s","StringIterator","_l","_i","ArrayIterable","_a","ArrayIterator","toLength","numberIsFinite","root","isFinite","getIterable","it","$iterator$","sign","number","isNaN","Math","floor","abs","maxSafeInteger","FromArraySink","observer","parent","observableOf","array","isScheduler","currentThreadScheduler","FromArrayObservable","PairsSink","RepeatSink","observableCatchHandler","handler","AnonymousObservable","d1","SingleAssignmentDisposable","subscription","SerialDisposable","setDisposable","subscribe","x","onNext","ex","onError","isPromise","observableFromPromise","d","onCompleted","falseFactory","zipArray","second","resultSelector","first","left","right","res","emptyArrayFactory","arrayFactory","ScanObserver","accumulator","hasSeed","seed","hasAccumulation","accumulation","hasValue","isStopped","concatMap","selector","thisArg","selectorFunc","bindCallback","map","isArrayLike","isIterable","observableFrom","concatAll","arrayIndexOfComparer","item","comparer","HashSet","set","flatMap","mergeAll","objectTypes","boolean","function","string","window","freeExports","exports","nodeType","freeModule","module","moduleExports","freeGlobal","global","Rx","internals","config","Promise","helpers","noop","identity","notDefined","defaultNow","pluck","property","just","Date","now","defaultComparer","y","isEqual","defaultSubComparer","defaultError","defaultKeySerializer","err","p","then","asArray","not","isFn","longStackSupport","EmptyError","message","ObjectDisposedError","ArgumentOutOfRangeError","NotSupportedError","NotImplementedError","notImplemented","notSupported","Symbol","iterator","Set","doneEnumerator","done","supportNodeClass","func","argCount","arg","collection","funcClass","supportsArgsClass","propertyIsEnumerable","document","toLocaleString","valueOf","test","inherits","child","__","addProperties","obj","sources","idx","ln","prop","addRef","xs","r","CompositeDisposable","getDisposable","Function","bind","that","target","args","bound","F","concat","forEach","T","k","O","kValue","boxedString","splitString","every","fun","thisp","filter","predicate","results","t","isArray","searchElement","n","Infinity","max","keys","hasDontEnumBug","compareTo","other","c","PriorityQueue","capacity","items","priorityProto","isHigherPriority","percolate","temp","heapify","peek","removeAt","dequeue","enqueue","remove","isDisposable","disposables","CompositeDisposablePrototype","add","shouldDispose","splice","currentDisposables","Disposable","action","disposableCreate","create","disposableEmpty","empty","checkDisposed","current","old","RefCountDisposable","InnerDisposable","isInnerDisposed","underlyingDisposable","isPrimaryDisposed","scheduleWithState","ScheduledItem","state","dueTime","invoke","invokeCore","isCancelled","Scheduler","schedule","scheduleRelative","scheduleAbsolute","_schedule","_scheduleRelative","_scheduleAbsolute","invokeAction","schedulerProto","scheduleWithRelative","scheduleWithRelativeAndState","scheduleWithAbsolute","scheduleWithAbsoluteAndState","normalize","timeSpan","normalizeTime","invokeRecImmediate","pair","recursiveAction","state1","state2","isAdded","isDone","scheduler1","state3","group","invokeRecDate","method","dueTime1","scheduleInnerRecursive","dt","scheduleRecursive","scheduleRecursiveWithState","scheduleRecursiveWithRelative","scheduleRecursiveWithRelativeAndState","scheduleRecursiveWithAbsolute","scheduleRecursiveWithAbsoluteAndState","schedulePeriodic","period","schedulePeriodicWithState","setInterval","clearInterval","catchError","CatchScheduler","scheduleMethod","clearMethod","immediateScheduler","SchedulePeriodicRecursive","tick","command","recurse","_period","_state","_action","_cancel","_scheduler","start","immediate","scheduleNow","currentThread","runTrampoline","queue","si","currentScheduler","scheduleRequired","localTimer","localSetTimeout","localClearTimeout","setTimeout","clearTimeout","WScript","time","Sleep","runTask","handle","currentlyRunning","task","tasksByHandle","postMessageSupported","postMessage","importScripts","isAsync","oldHandler","onmessage","onGlobalPostMessage","event","data","substring","MSG_PREFIX","nextHandle","reNative","RegExp","replace","setImmediate","process","nextTick","random","addEventListener","attachEvent","currentId","MessageChannel","channel","port1","port2","createElement","scriptElement","onreadystatechange","parentNode","removeChild","documentElement","appendChild","timeout","__super__","_wrap","_handler","_recursiveOriginal","_recursiveWrapper","_clone","_getRecursiveWrapper","wrapper","failed","Notification","kind","exception","accept","acceptObservable","_accept","_acceptObservable","observerOrOnNext","toObservable","_","notification","notificationCreateOnNext","createOnNext","notificationCreateOnError","createOnError","notificationCreateOnCompleted","createOnCompleted","Observer","toNotifier","asObserver","AnonymousObserver","checked","CheckedObserver","observerCreate","fromNotifier","notifyOn","ObserveOnObserver","makeSafe","AnonymousSafeObserver","_onNext","_onError","_onCompleted","observableProto","AbstractObserver","next","completed","fail","_observer","CheckedObserverPrototype","checkAccess","ScheduledObserver","isAcquired","hasFaulted","ensureActive","isOwner","work","shift","cancel","Observable","_subscribe","oldOnError","subscribeOnNext","subscribeOnError","subscribeOnCompleted","ObservableBase","fixSubscriber","subscriber","ado","sub","subscribeCore","AutoDetachObserver","Enumerable","ConcatEnumerableObservable","InnerObserver","cancelable","currentItem","currentValue","CatchErrorObservable","lastException","catchErrorWhen","notificationHandler","exceptions","Subject","notifier","handled","notificationDisposable","outer","inner","exn","RepeatEnumerable","v","RepeatEnumerator","l","enumerableRepeat","repeat","repeatCount","OfEnumerable","OfEnumerator","enumerableOf","of","observeOn","subscribeOn","m","FromPromiseObservable","fromPromise","promise","toPromise","promiseCtor","resolve","reject","ToArrayObservable","toArray","createWithDisposable","EmptyObservable","defer","observableFactory","observableThrow","EmptySink","sink","run","observableEmpty","FromObservable","iterable","mapper","FromSink","loopRecursive","list","pow","charAt","from","mapFn","observableFromArray","fromArray","generate","initialState","condition","iterate","hasResult","NeverObservable","observableNever","never","ofWithScheduler","PairsObservable","pairs","RangeObservable","rangeCount","RangeSink","range","RepeatObservable","JustObservable","JustSink","ThrowObservable","returnValue","ThrowSink","throwError","throwException","using","resourceFactory","resource","amb","rightSource","leftSource","choiceL","choice","leftChoice","rightSubscription","choiceR","rightChoice","leftSubscription","previous","acc","catchException","handlerOrSecond","observableCatch","combineLatest","hasValueAll","values","j","subscriptions","sad","observableConcat","ConcatObservable","ConcatSink","concatObservable","merge","MergeObservable","maxConcurrent","g","MergeObserver","q","activeCount","handleSubscribe","innerSource","maxConcurrentOrOther","observableMerge","MergeAllObservable","MergeAllObserver","mergeObservable","CompositeError","errors","name","innerErrors","mergeDelayError","setCompletion","innerSubscription","onErrorResumeNext","pos","skipUntil","isOpen","SwitchObservable","SwitchObserver","stopped","latest","hasLatest","switchLatest","TakeUntilObservable","takeUntil","withLatestFrom","allValues","zip","queues","queuedValues","asObservable","bufferWithCount","skip","windowWithCount","selectMany","where","dematerialize","distinctUntilChanged","keySelector","currentKey","hasCurrentKey","comparerEquals","TapObservable","tap","doAction","doOnNext","tapOnNext","doOnError","tapOnError","doOnCompleted","tapOnCompleted","ensure","finallyAction","IgnoreElementsObservable","ignoreElements","materialize","retry","retryCount","retryWhen","ScanObservable","scan","skipLast","startWith","takeLast","takeLastBuffer","createWindow","refCountDisposable","selectConcat","selectorResult","i2","concatMapObserver","selectConcatObserver","onNextFunc","onErrorFunc","onCompletedFunc","defaultIfEmpty","defaultValue","found","retValue","distinct","hashSet","MapObservable","innerMap","internalMap","select","selectorFn","currentProp","flatMapObserver","selectManyObserver","selectSwitch","flatMapLatest","switchMap","SkipObservable","skipCount","skipWhile","running","take","remaining","takeWhile","FilterObservable","innerPredicate","internalFilter","shouldYield","transduce","transducer","transformForObserver","@@transducer/init","@@transducer/step","obs","input","@@transducer/result","xform","AutoDetachObserverPrototype","InnerSubscription","subject","observers","hasError","hasObservers","os","AnonymousSubject","AsyncSubject","define","amd"],"mappings":";CAEE,SAAUA,GAyDR,QAASC,GAAWC,GAElB,IAAI,GADAC,GAAMD,EAAIE,OAAQC,EAAI,GAAIC,OAAMH,GAC5BI,EAAI,EAAOJ,EAAJI,EAASA,IAAOF,EAAEE,GAAKL,EAAIK,EAC1C,OAAOF,GAgBX,QAASG,GAAmBC,EAAOC,GAG/B,GAAIC,IACAD,EAAWE,OACM,gBAAVH,IACG,OAAVA,GACAA,EAAMG,OACwC,KAA9CH,EAAMG,MAAMC,QAAQC,IACtB,CAEA,IAAK,GADDC,MACKC,EAAIN,EAAcM,EAAGA,EAAIA,EAAEC,OAC9BD,EAAEJ,OACJG,EAAOG,QAAQF,EAAEJ,MAGrBG,GAAOG,QAAQT,EAAMG,MAErB,IAAIO,GAAiBJ,EAAOK,KAAK,KAAON,GAAuB,KAC/DL,GAAMG,MAAQS,EAAkBF,IAItC,QAASE,GAAkBC,GAGzB,IAAK,GAFDC,GAAQD,EAAYE,MAAM,MAC1BC,KACKlB,EAAI,EAAGJ,EAAMoB,EAAMnB,OAAYD,EAAJI,EAASA,IAAK,CAChD,GAAImB,GAAOH,EAAMhB,EAEZoB,GAAgBD,IAAUE,EAAYF,KAASA,GAClDD,EAAaI,KAAKH,GAGtB,MAAOD,GAAaL,KAAK,MAG3B,QAASO,GAAgBG,GACvB,GAAIC,GAAwBC,EAAyBF,EACrD,KAAKC,EACH,OAAO,CAET,IAAIE,GAAWF,EAAsB,GAAI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,EAAKuF,GAAKA,CAIZ,IAAIjM,IAAcC,MAElBiB,KAAK4D"} \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.compat.min.js b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.compat.min.js
new file mode 100644
index 00000000000..25dcdd9d57c
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.compat.min.js
@@ -0,0 +1,5 @@
+/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
+(function(a){function b(a){for(var b=a.length,c=new Array(b),d=0;b>d;d++)c[d]=a[d];return c}function c(a,b){if(ea&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(ia)){for(var c=[],e=b;e;e=e.source)e.stack&&c.unshift(e.stack);c.unshift(a.stack);var f=c.join("\n"+ia+"\n");a.stack=d(f)}}function d(a){for(var b=a.split("\n"),c=[],d=0,g=b.length;g>d;d++){var h=b[d];e(h)||f(h)||!h||c.push(h)}return c.join("\n")}function e(a){var b=h(a);if(!b)return!1;var c=b[0],d=b[1];return c===ga&&d>=ha&&Ic>=d}function f(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function g(){if(ea)try{throw new Error}catch(a){var b=a.stack.split("\n"),c=b[0].indexOf("@")>0?b[1]:b[2],d=h(c);if(!d)return;return ga=d[0],d[1]}}function h(a){var b=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(a);if(b)return[b[1],Number(b[2])];var c=/at ([^ ]+):(\d+):(?:\d+)$/.exec(a);if(c)return[c[1],Number(c[2])];var d=/.*@(.+):(\d+)$/.exec(a);return d?[d[1],Number(d[2])]:void 0}function i(a){var b=[];if(!Ra(a))return b;Qa.nonEnumArgs&&a.length&&Sa(a)&&(a=Va.call(a));var c=Qa.enumPrototypes&&"function"==typeof a,d=Qa.enumErrorProps&&(a===La||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(Qa.nonEnumShadows&&a!==Ma){var f=a.constructor,g=-1,h=xa;if(a===(f&&f.prototype))var i=a===Na?Ha:a===La?Ca:Ia.call(a),j=Pa[i];for(;++g<h;)e=wa[g],j&&j[e]||!Ja.call(a,e)||b.push(e)}return b}function j(a,b,c){for(var d=-1,e=c(a),f=e.length;++d<f;){var g=e[d];if(b(a[g],g,a)===!1)break}return a}function k(a,b){return j(a,b,i)}function l(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function m(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,f=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=f&&"object"!=f))return!1;var g=Ia.call(a),h=Ia.call(b);if(g==ya&&(g=Fa),h==ya&&(h=Fa),g!=h)return!1;switch(g){case Aa:case Ba:return+a==+b;case Ea:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case Ga:case Ha:return a==String(b)}var i=g==za;if(!i){if(g!=Fa||!Qa.nodeClass&&(l(a)||l(b)))return!1;var j=!Qa.argsObject&&Sa(a)?Object:a.constructor,n=!Qa.argsObject&&Sa(b)?Object:b.constructor;if(!(j==n||Ja.call(a,"constructor")&&Ja.call(b,"constructor")||da(j)&&j instanceof j&&da(n)&&n instanceof n||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var o=c.length;o--;)if(c[o]==a)return d[o]==b;var p=0,q=!0;if(c.push(a),d.push(b),i){if(o=a.length,p=b.length,q=p==o)for(;p--;){var r=b[p];if(!(q=m(a[p],r,c,d)))break}}else k(b,function(b,e,f){return Ja.call(f,e)?(p++,q=Ja.call(a,e)&&m(a[e],b,c,d)):void 0}),q&&k(a,function(a,b,c){return Ja.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function n(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function o(){try{return Ta.apply(this,arguments)}catch(a){return Za.e=a,Za}}function p(a){if(!da(a))throw new TypeError("fn must be a function");return Ta=a,o}function q(a){throw a}function r(a,b){this.id=a,this.value=b}function t(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function u(a,b){b.isDisposed||(b.isDisposed=!0,b.disposable.dispose())}function v(a){this._s=s}function w(a){this._s=s,this._l=s.length,this._i=0}function x(a){this._a=a}function y(a){this._a=a,this._l=C(a),this._i=0}function z(a){return"number"==typeof a&&S.isFinite(a)}function A(b){var c,d=b[qa];if(!d&&"string"==typeof b)return c=new v(b),c[qa]();if(!d&&b.length!==a)return c=new x(b),c[qa]();if(!d)throw new TypeError("Object is not iterable");return b[qa]()}function B(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function C(a){var b=+a.length;return isNaN(b)?0:0!==b&&z(b)?(b=B(b)*Math.floor(Math.abs(b)),0>=b?0:b>$b?$b:b):b}function D(a,b){this.observer=a,this.parent=b}function E(a,b){return pb(a)||(a=tb),new ac(b,a)}function F(a,b){this.observer=a,this.parent=b}function G(a,b){this.observer=a,this.parent=b}function H(a,b){return new Dc(function(c){var d=new jb,e=new kb;return e.setDisposable(d),d.setDisposable(a.subscribe(function(a){c.onNext(a)},function(a){try{var d=b(a)}catch(f){return c.onError(f)}ca(d)&&(d=Ub(d));var g=new jb;e.setDisposable(g),g.setDisposable(d.subscribe(c))},function(a){c.onCompleted(a)})),e},a)}function I(){return!1}function J(a,b){var c=this;return new Dc(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g=a[e++],h=p(b)(c,g);if(h===Za)return d.onError(h.e);d.onNext(h)}else d.onCompleted()},function(a){d.onError(a)},function(){d.onCompleted()})},c)}function I(){return!1}function K(){return[]}function I(){return!1}function L(){return[]}function M(a,b){this.observer=a,this.accumulator=b.accumulator,this.hasSeed=b.hasSeed,this.seed=b.seed,this.hasAccumulation=!1,this.accumulation=null,this.hasValue=!1,this.isStopped=!1}function N(a,b,c){var d=va(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return ca(e)&&(e=Ub(e)),(ta(e)||sa(e))&&(e=_b(e)),e}).concatAll()}function O(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function P(a){this.comparer=a,this.set=[]}function Q(a,b,c){var d=va(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return ca(e)&&(e=Ub(e)),(ta(e)||sa(e))&&(e=_b(e)),e}).mergeAll()}var R={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},S=R[typeof window]&&window||this,T=R[typeof exports]&&exports&&!exports.nodeType&&exports,U=R[typeof module]&&module&&!module.nodeType&&module,V=U&&U.exports===T&&T,W=R[typeof global]&&global;!W||W.global!==W&&W.window!==W||(S=W);var X={internals:{},config:{Promise:S.Promise},helpers:{}},Y=X.helpers.noop=function(){},Z=(X.helpers.notDefined=function(a){return"undefined"==typeof a},X.helpers.identity=function(a){return a}),$=(X.helpers.pluck=function(a){return function(b){return b[a]}},X.helpers.just=function(a){return function(){return a}},X.helpers.defaultNow=function(){return Date.now?Date.now:function(){return+new Date}}()),_=X.helpers.defaultComparer=function(a,b){return Ua(a,b)},aa=X.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},ba=(X.helpers.defaultKeySerializer=function(a){return a.toString()},X.helpers.defaultError=function(a){throw a}),ca=X.helpers.isPromise=function(a){return!!a&&"function"!=typeof a.subscribe&&"function"==typeof a.then},da=(X.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},X.helpers.not=function(a){return!a},X.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==Ia.call(a)}),a}());X.config.longStackSupport=!1;var ea=!1;try{throw new Error}catch(fa){ea=!!fa.stack}var ga,ha=g(),ia="From previous event:",ja=X.EmptyError=function(){this.message="Sequence contains no elements.",Error.call(this)};ja.prototype=Error.prototype;var ka=X.ObjectDisposedError=function(){this.message="Object has been disposed",Error.call(this)};ka.prototype=Error.prototype;var la=X.ArgumentOutOfRangeError=function(){this.message="Argument out of range",Error.call(this)};la.prototype=Error.prototype;var ma=X.NotSupportedError=function(a){this.message=a||"This operation is not supported",Error.call(this)};ma.prototype=Error.prototype;var na=X.NotImplementedError=function(a){this.message=a||"This operation is not implemented",Error.call(this)};na.prototype=Error.prototype;var oa=X.helpers.notImplemented=function(){throw new na},pa=X.helpers.notSupported=function(){throw new ma},qa="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";S.Set&&"function"==typeof(new S.Set)["@@iterator"]&&(qa="@@iterator");var ra=X.doneEnumerator={done:!0,value:a},sa=X.helpers.isIterable=function(b){return b[qa]!==a},ta=X.helpers.isArrayLike=function(b){return b&&b.length!==a};X.helpers.iterator=qa;var ua,va=X.internals.bindCallback=function(a,b,c){if("undefined"==typeof b)return a;switch(c){case 0:return function(){return a.call(b)};case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)}}return function(){return a.apply(b,arguments)}},wa=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],xa=wa.length,ya="[object Arguments]",za="[object Array]",Aa="[object Boolean]",Ba="[object Date]",Ca="[object Error]",Da="[object Function]",Ea="[object Number]",Fa="[object Object]",Ga="[object RegExp]",Ha="[object String]",Ia=Object.prototype.toString,Ja=Object.prototype.hasOwnProperty,Ka=Ia.call(arguments)==ya,La=Error.prototype,Ma=Object.prototype,Na=String.prototype,Oa=Ma.propertyIsEnumerable;try{ua=!(Ia.call(document)==Fa&&!({toString:0}+""))}catch(fa){ua=!0}var Pa={};Pa[za]=Pa[Ba]=Pa[Ea]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},Pa[Aa]=Pa[Ha]={constructor:!0,toString:!0,valueOf:!0},Pa[Ca]=Pa[Da]=Pa[Ga]={constructor:!0,toString:!0},Pa[Fa]={constructor:!0};var Qa={};!function(){var a=function(){this.x=1},b=[];a.prototype={valueOf:1,y:1};for(var c in new a)b.push(c);for(c in arguments);Qa.enumErrorProps=Oa.call(La,"message")||Oa.call(La,"name"),Qa.enumPrototypes=Oa.call(a,"prototype"),Qa.nonEnumArgs=0!=c,Qa.nonEnumShadows=!/valueOf/.test(b)}(1);var Ra=X.internals.isObject=function(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1},Sa=function(a){return a&&"object"==typeof a?Ia.call(a)==ya:!1};Ka||(Sa=function(a){return a&&"object"==typeof a?Ja.call(a,"callee"):!1});var Ta,Ua=X.internals.isEqual=function(a,b){return m(a,b,[],[])},Va=({}.hasOwnProperty,Array.prototype.slice),Wa=this.inherits=X.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c},Xa=X.internals.addProperties=function(a){for(var b=[],c=1,d=arguments.length;d>c;c++)b.push(arguments[c]);for(var e=0,f=b.length;f>e;e++){var g=b[e];for(var h in g)a[h]=g[h]}},Ya=X.internals.addRef=function(a,b){return new Dc(function(c){return new cb(b.getDisposable(),a.subscribe(c))})},Za={e:{}};Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=Va.call(arguments,1),d=function(){function e(){}if(this instanceof d){e.prototype=b.prototype;var f=new e,g=b.apply(f,c.concat(Va.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(Va.call(arguments)))};return d}),Array.prototype.forEach||(Array.prototype.forEach=function(a,b){var c,d;if(null==this)throw new TypeError(" this is null or not defined");var e=Object(this),f=e.length>>>0;if("function"!=typeof a)throw new TypeError(a+" is not a function");for(arguments.length>1&&(c=b),d=0;f>d;){var g;d in e&&(g=e[d],a.call(c,g,d,e)),d++}});var $a=Object("a"),_a="a"!=$a[0]||!(0 in $a);Array.prototype.every||(Array.prototype.every=function(a){var b=Object(this),c=_a&&{}.toString.call(this)==Ha?this.split(""):b,d=c.length>>>0,e=arguments[1];if({}.toString.call(a)!=Da)throw new TypeError(a+" is not a function");for(var f=0;d>f;f++)if(f in c&&!a.call(e,c[f],f,b))return!1;return!0}),Array.prototype.map||(Array.prototype.map=function(a){var b=Object(this),c=_a&&{}.toString.call(this)==Ha?this.split(""):b,d=c.length>>>0,e=Array(d),f=arguments[1];if({}.toString.call(a)!=Da)throw new TypeError(a+" is not a function");for(var g=0;d>g;g++)g in c&&(e[g]=a.call(f,c[g],g,b));return e}),Array.prototype.filter||(Array.prototype.filter=function(a){for(var b,c=[],d=new Object(this),e=0,f=d.length>>>0;f>e;e++)b=d[e],e in d&&a.call(arguments[1],b,e,d)&&c.push(b);return c}),Array.isArray||(Array.isArray=function(a){return{}.toString.call(a)==za}),Array.prototype.indexOf||(Array.prototype.indexOf=function(a){var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=0;if(arguments.length>1&&(d=Number(arguments[1]),d!==d?d=0:0!==d&&d!=1/0&&d!==-(1/0)&&(d=(d>0||-1)*Math.floor(Math.abs(d)))),d>=c)return-1;for(var e=d>=0?d:Math.max(c-Math.abs(d),0);c>e;e++)if(e in b&&b[e]===a)return e;return-1}),Object.prototype.propertyIsEnumerable||(Object.prototype.propertyIsEnumerable=function(a){for(var b in this)if(b===a)return!0;return!1}),Object.keys||(Object.keys=function(){"use strict";var a=Object.prototype.hasOwnProperty,b=!{toString:null}.propertyIsEnumerable("toString");return function(c){if("object"!=typeof c&&("function"!=typeof c||null===c))throw new TypeError("Object.keys called on non-object");var d,e,f=[];for(d in c)a.call(c,d)&&f.push(d);if(b)for(e=0;xa>e;e++)a.call(c,wa[e])&&f.push(wa[e]);return f}}()),r.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var ab=X.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},bb=ab.prototype;bb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},bb.percolate=function(a){if(!(a>=this.length||0>a)){var b=a-1>>1;if(!(0>b||b===a)&&this.isHigherPriority(a,b)){var c=this.items[a];this.items[a]=this.items[b],this.items[b]=c,this.percolate(b)}}},bb.heapify=function(a){if(+a||(a=0),!(a>=this.length||0>a)){var b=2*a+1,c=2*a+2,d=a;if(b<this.length&&this.isHigherPriority(b,d)&&(d=b),c<this.length&&this.isHigherPriority(c,d)&&(d=c),d!==a){var e=this.items[a];this.items[a]=this.items[d],this.items[d]=e,this.heapify(d)}}},bb.peek=function(){return this.items[0].value},bb.removeAt=function(b){this.items[b]=this.items[--this.length],this.items[this.length]=a,this.heapify()},bb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},bb.enqueue=function(a){var b=this.length++;this.items[b]=new r(ab.count++,a),this.percolate(b)},bb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},ab.count=0;var cb=X.CompositeDisposable=function(){var a,b,c=[];if(Array.isArray(arguments[0]))c=arguments[0],b=c.length;else for(b=arguments.length,c=new Array(b),a=0;b>a;a++)c[a]=arguments[a];for(a=0;b>a;a++)if(!hb(c[a]))throw new TypeError("Not a disposable");this.disposables=c,this.isDisposed=!1,this.length=c.length},db=cb.prototype;db.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},db.remove=function(a){var b=!1;if(!this.isDisposed){var c=this.disposables.indexOf(a);-1!==c&&(b=!0,this.disposables.splice(c,1),this.length--,a.dispose())}return b},db.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;for(var a=this.disposables.length,b=new Array(a),c=0;a>c;c++)b[c]=this.disposables[c];for(this.disposables=[],this.length=0,c=0;a>c;c++)b[c].dispose()}};var eb=X.Disposable=function(a){this.isDisposed=!1,this.action=a||Y};eb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var fb=eb.create=function(a){return new eb(a)},gb=eb.empty={dispose:Y},hb=eb.isDisposable=function(a){return a&&da(a.dispose)},ib=eb.checkDisposed=function(a){if(a.isDisposed)throw new ka},jb=X.SingleAssignmentDisposable=function(){this.isDisposed=!1,this.current=null};jb.prototype.getDisposable=function(){return this.current},jb.prototype.setDisposable=function(a){if(this.current)throw new Error("Disposable has already been assigned");var b=this.isDisposed;!b&&(this.current=a),b&&a&&a.dispose()},jb.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var kb=X.SerialDisposable=function(){this.isDisposed=!1,this.current=null};kb.prototype.getDisposable=function(){return this.current},kb.prototype.setDisposable=function(a){var b=this.isDisposed;if(!b){var c=this.current;this.current=a}c&&c.dispose(),b&&a&&a.dispose()},kb.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var lb=X.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?gb:new a(this)},b}();t.prototype.dispose=function(){this.scheduler.scheduleWithState(this,u)};var mb=X.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||aa,this.disposable=new jb};mb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},mb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},mb.prototype.isCancelled=function(){return this.disposable.isDisposed},mb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var nb=X.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),gb}a.isScheduler=function(b){return b instanceof a};var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=$,a.normalize=function(a){return 0>a&&(a=0),a},a}(),ob=nb.normalize,pb=nb.isScheduler;!function(a){function b(a,b){function c(b){e(b,function(b){var d=!1,e=!1,g=a.scheduleWithState(b,function(a,b){return d?f.remove(g):e=!0,c(b),gb});e||(f.add(g),d=!0)})}var d=b[0],e=b[1],f=new cb;return c(d),f}function c(a,b,c){function d(b){f(b,function(b,e){var f=!1,h=!1,i=a[c](b,e,function(a,b){return f?g.remove(i):h=!0,d(b),gb});h||(g.add(i),f=!0)})}var e=b[0],f=b[1],g=new cb;return d(e),g}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,d)},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState([a,c],b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative([a,d],b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,d)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute([a,d],b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(nb.prototype),function(a){nb.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},nb.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof S.setInterval)throw new ma;b=ob(b);var d=a,e=S.setInterval(function(){d=c(d)},b);return fb(function(){S.clearInterval(e)})}}(nb.prototype),function(a){a.catchError=a["catch"]=function(a){return new xb(this,a)}}(nb.prototype);var qb,rb,sb=(X.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new jb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),nb.immediate=function(){function a(a,b){return b(this,a)}return new nb($,a,pa,pa)}()),tb=nb.currentThread=function(){function a(){for(;c.length>0;){var a=c.dequeue();!a.isCancelled()&&a.invoke()}}function b(b,d){var e=new mb(this,b,d,this.now());if(c)c.enqueue(e);else{c=new ab(4),c.enqueue(e);var f=p(a)();if(c=null,f===Za)return q(f.e)}return e.disposable}var c,d=new nb($,b,pa,pa);return d.scheduleRequired=function(){return!c},d}(),ub=function(){var a,b=Y;if(S.setTimeout)a=S.setTimeout,b=S.clearTimeout;else{if(!S.WScript)throw new ma;a=function(a,b){S.WScript.Sleep(b),a()}}return{setTimeout:a,clearTimeout:b}}(),vb=ub.setTimeout,wb=ub.clearTimeout;!function(){function a(b){if(f)vb(function(){a(b)},0);else{var c=e[b];if(c){f=!0;var d=p(c)();if(rb(b),f=!1,d===Za)return q(d.e)}}}function b(){if(!S.postMessage||S.importScripts)return!1;var a=!1,b=S.onmessage;return S.onmessage=function(){a=!0},S.postMessage("","*"),S.onmessage=b,a}function c(b){"string"==typeof b.data&&b.data.substring(0,i.length)===i&&a(b.data.substring(i.length))}var d=1,e={},f=!1;rb=function(a){delete e[a]};var g=RegExp("^"+String(Ia).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),h="function"==typeof(h=W&&V&&W.setImmediate)&&!g.test(h)&&h;if(da(h))qb=function(b){var c=d++;return e[c]=b,h(function(){a(c)}),c};else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))qb=function(b){var c=d++;return e[c]=b,process.nextTick(function(){a(c)}),c};else if(b()){var i="ms.rx.schedule"+Math.random();S.addEventListener?S.addEventListener("message",c,!1):S.attachEvent?S.attachEvent("onmessage",c):S.onmessage=c,qb=function(a){var b=d++;return e[b]=a,S.postMessage(i+currentId,"*"),b}}else if(S.MessageChannel){var j=new S.MessageChannel;j.port1.onmessage=function(b){a(b.data)},qb=function(a){var b=d++;return e[b]=a,j.port2.postMessage(b),b}}else qb="document"in S&&"onreadystatechange"in S.document.createElement("script")?function(b){var c=S.document.createElement("script"),f=d++;return e[f]=b,c.onreadystatechange=function(){a(f),c.onreadystatechange=null,c.parentNode.removeChild(c),c=null},S.document.documentElement.appendChild(c),f}:function(b){var c=d++;return e[c]=b,vb(function(){a(c)},0),c}}();var xb=(nb.timeout=nb["default"]=function(){function a(a,b){var c=this,d=new jb,e=qb(function(){!d.isDisposed&&d.setDisposable(b(c,a))});return new cb(d,fb(function(){rb(e)}))}function b(a,b,c){var d=this,e=nb.normalize(b),f=new jb;if(0===e)return d.scheduleWithState(a,c);var g=vb(function(){!f.isDisposed&&f.setDisposable(c(d,a))},e);return new cb(f,fb(function(){wb(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new nb($,a,b,c)}(),function(a){function b(a,b){return this._scheduler.scheduleWithState(a,this._wrap(b))}function c(a,b,c){return this._scheduler.scheduleWithRelativeAndState(a,b,this._wrap(c))}function d(a,b,c){return this._scheduler.scheduleWithAbsoluteAndState(a,b,this._wrap(c))}function e(e,f){this._scheduler=e,this._handler=f,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this,this._scheduler.now.bind(this._scheduler),b,c,d)}return Wa(e,a),e.prototype._clone=function(a){return new e(a,this._handler)},e.prototype._wrap=function(a){var b=this;return function(c,d){try{return a(b._getRecursiveWrapper(c),d)}catch(e){if(!b._handler(e))throw e;return gb}}},e.prototype._getRecursiveWrapper=function(a){if(this._recursiveOriginal!==a){this._recursiveOriginal=a;var b=this._clone(a);b._recursiveOriginal=a,b._recursiveWrapper=b,this._recursiveWrapper=b}return this._recursiveWrapper},e.prototype.schedulePeriodicWithState=function(a,b,c){var d=this,e=!1,f=new jb;return f.setDisposable(this._scheduler.schedulePeriodicWithState(a,b,function(a){if(e)return null;try{return c(a)}catch(b){if(e=!0,!d._handler(b))throw b;return f.dispose(),null}})),f},e}(nb)),yb=X.Notification=function(){function a(a,b,c,d,e,f){this.kind=a,this.value=b,this.exception=c,this._accept=d,this._acceptObservable=e,this.toString=f}return a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return pb(a)||(a=sb),new Dc(function(c){return a.scheduleWithState(b,function(a,b){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),zb=yb.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){return new yb("N",d,null,a,b,c)}}(),Ab=yb.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){return new yb("E",null,d,a,b,c)}}(),Bb=yb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){return new yb("C",null,null,a,b,c)}}(),Cb=X.Observer=function(){};Cb.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},Cb.prototype.asObserver=function(){return new Gb(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},Cb.prototype.checked=function(){return new Hb(this)};var Db=Cb.create=function(a,b,c){return a||(a=Y),b||(b=ba),c||(c=Y),new Gb(a,b,c)};Cb.fromNotifier=function(a,b){return new Gb(function(c){return a.call(b,zb(c))},function(c){return a.call(b,Ab(c))},function(){return a.call(b,Bb())})},Cb.prototype.notifyOn=function(a){return new Jb(a,this)},Cb.prototype.makeSafe=function(a){return new AnonymousSafeObserver(this._onNext,this._onError,this._onCompleted,a)};var Eb,Fb=X.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return Wa(b,a),b.prototype.next=oa,b.prototype.error=oa,b.prototype.completed=oa,b.prototype.onNext=function(a){this.isStopped||this.next(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.error(a))},b.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(Cb),Gb=X.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return Wa(b,a),b.prototype.next=function(a){this._onNext(a)},b.prototype.error=function(a){this._onError(a)},b.prototype.completed=function(){this._onCompleted()},b}(Fb),Hb=function(a){function b(b){a.call(this),this._observer=b,this._state=0}Wa(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();var b=p(this._observer.onNext).call(this._observer,a);this._state=0,b===Za&&q(b.e)},c.onError=function(a){this.checkAccess();var b=p(this._observer.onError).call(this._observer,a);this._state=2,b===Za&&q(b.e)},c.onCompleted=function(){this.checkAccess();var a=p(this._observer.onCompleted).call(this._observer);this._state=2,a===Za&&q(a.e)},c.checkAccess=function(){if(1===this._state)throw new Error("Re-entrancy detected");if(2===this._state)throw new Error("Observer completed");0===this._state&&(this._state=1)},b}(Cb),Ib=X.internals.ScheduledObserver=function(a){function b(b,c){a.call(this),this.scheduler=b,this.observer=c,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new kb}return Wa(b,a),b.prototype.next=function(a){var b=this;this.queue.push(function(){b.observer.onNext(a)})},b.prototype.error=function(a){var b=this;this.queue.push(function(){b.observer.onError(a)})},b.prototype.completed=function(){var a=this;this.queue.push(function(){a.observer.onCompleted()})},b.prototype.ensureActive=function(){var a=!1,b=this;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(a){var c;if(!(b.queue.length>0))return void(b.isAcquired=!1);c=b.queue.shift();try{c()}catch(d){throw b.queue=[],b.hasFaulted=!0,d}a()}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(Fb),Jb=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return Wa(b,a),b.prototype.next=function(b){a.prototype.next.call(this,b),this.ensureActive()},b.prototype.error=function(b){a.prototype.error.call(this,b),this.ensureActive()},b.prototype.completed=function(){a.prototype.completed.call(this),this.ensureActive()},b.prototype.dispose=function(){a.prototype.dispose.call(this),this._cancel&&this._cancel.dispose(),this._cancel=null},b}(Ib),Kb=X.Observable=function(){function a(a){if(X.config.longStackSupport&&ea){try{throw new Error}catch(b){this.stack=b.stack.substring(b.stack.indexOf("\n")+1)}var d=this;this._subscribe=function(b){var e=b.onError.bind(b);return b.onError=function(a){c(a,d),e(a)},a.call(d,b)}}else this._subscribe=a}return Eb=a.prototype,Eb.subscribe=Eb.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:Db(a,b,c))},Eb.subscribeOnNext=function(a,b){return this._subscribe(Db("undefined"!=typeof b?function(c){a.call(b,c)}:a))},Eb.subscribeOnError=function(a,b){return this._subscribe(Db(null,"undefined"!=typeof b?function(c){a.call(b,c)}:a))},Eb.subscribeOnCompleted=function(a,b){return this._subscribe(Db(null,null,"undefined"!=typeof b?function(){a.call(b)}:a))},a}(),Lb=X.ObservableBase=function(a){function b(a){return a&&da(a.dispose)?a:da(a)?fb(a):gb}function c(a,c){var d=c[0],e=c[1],f=p(e.subscribeCore).call(e,d);return f!==Za||d.fail(Za.e)?void d.setDisposable(b(f)):q(Za.e)}function d(a){var b=new Ec(a),d=[b,this];return tb.scheduleRequired()?tb.scheduleWithState(d,c):c(null,d),b}function e(){a.call(this,d)}return Wa(e,a),e.prototype.subscribeCore=oa,e}(Kb),Mb=X.internals.Enumerable=function(){},Nb=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b,c){this.o=a,this.s=b,this.e=c,this.isStopped=!1}return Wa(b,a),b.prototype.subscribeCore=function(a){var b,d=new kb,e=sb.scheduleRecursiveWithState(this.sources[qa](),function(e,f){if(!b){var g=p(e.next).call(e);if(g===Za)return a.onError(g.e);if(g.done)return a.onCompleted();var h=g.value;ca(h)&&(h=Ub(h));var i=new jb;d.setDisposable(i),i.setDisposable(h.subscribe(new c(a,f,e)))}});return new cb(d,e,fb(function(){b=!0}))},c.prototype.onNext=function(a){this.isStopped||this.o.onNext(a)},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.s(this.e))},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Lb);Mb.prototype.concat=function(){return new Nb(this)};var Ob=function(a){function b(b){this.sources=b,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){var b,c=this.sources[qa](),d=new kb,e=sb.scheduleRecursiveWithState(null,function(e,f){if(!b){var g=p(c.next).call(c);if(g===Za)return a.onError(g.e);if(g.done)return null!==e?a.onError(e):a.onCompleted();var h=g.value;ca(h)&&(h=Ub(h));var i=new jb;d.setDisposable(i),i.setDisposable(h.subscribe(function(b){a.onNext(b)},f,function(){a.onCompleted()}))}});return new cb(d,e,fb(function(){b=!0}))},b}(Lb);Mb.prototype.catchError=function(){return new Ob(this)},Mb.prototype.catchErrorWhen=function(a){var b=this;return new Dc(function(c){var d,e,f=new Gc,g=new Gc,h=a(f),i=h.subscribe(g),j=b[qa](),k=new kb,l=sb.scheduleRecursive(function(a){if(!d){var b=p(j.next).call(j);if(b===Za)return c.onError(b.e);if(b.done)return void(e?c.onError(e):c.onCompleted());var h=b.value;ca(h)&&(h=Ub(h));var i=new jb,l=new jb;k.setDisposable(new cb(l,i)),i.setDisposable(h.subscribe(function(a){c.onNext(a)},function(b){l.setDisposable(g.subscribe(a,function(a){c.onError(a)},function(){c.onCompleted()})),f.onNext(b)},function(){c.onCompleted()}))}});return new cb(i,k,l,fb(function(){d=!0}))})};var Pb=function(a){function b(a,b){this.v=a,this.c=null==b?-1:b}function c(a){this.v=a.v,this.l=a.c}return Wa(b,a),b.prototype[qa]=function(){return new c(this)},c.prototype.next=function(){return 0===this.l?ra:(this.l>0&&this.l--,{done:!1,value:this.v})},b}(Mb),Qb=Mb.repeat=function(a,b){return new Pb(a,b)},Rb=function(a){function b(a,b,c){this.s=a,this.fn=b?va(b,c,3):null}function c(a){this.i=-1,this.s=a.s,this.l=this.s.length,this.fn=a.fn}return Wa(b,a),b.prototype[qa]=function(){return new c(this)},c.prototype.next=function(){return++this.i<this.l?{done:!1,value:this.fn?this.fn(this.s[this.i],this.i,this.s):this.s[this.i]
+}:ra},b}(Mb),Sb=Mb.of=function(a,b,c){return new Rb(a,b,c)};Eb.observeOn=function(a){var b=this;return new Dc(function(c){return b.subscribe(new Jb(a,c))},b)},Eb.subscribeOn=function(a){var b=this;return new Dc(function(c){var d=new jb,e=new kb;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new t(a,b.subscribe(c)))})),e},b)};var Tb=function(a){function b(b){this.p=b,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){return this.p.then(function(b){a.onNext(b),a.onCompleted()},function(b){a.onError(b)}),gb},b}(Lb),Ub=Kb.fromPromise=function(a){return new Tb(a)};Eb.toPromise=function(a){if(a||(a=X.config.Promise),!a)throw new ma("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})};var Vb=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.a=[],this.isStopped=!1}return Wa(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a))},c.prototype.onNext=function(a){this.isStopped||this.a.push(a)},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onNext(this.a),this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Lb);Eb.toArray=function(){return new Vb(this)},Kb.create=Kb.createWithDisposable=function(a,b){return new Dc(a,b)};var Wb=(Kb.defer=function(a){return new Dc(function(b){var c;try{c=a()}catch(d){return kc(d).subscribe(b)}return ca(c)&&(c=Ub(c)),c.subscribe(b)})},function(a){function b(b){this.scheduler=b,a.call(this)}function c(a,b){this.observer=a,this.parent=b}function d(a,b){b.onCompleted()}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this);return b.run()},c.prototype.run=function(){return this.parent.scheduler.scheduleWithState(this.observer,d)},b}(Lb)),Xb=Kb.empty=function(a){return pb(a)||(a=sb),new Wb(a)},Yb=function(a){function b(b,c,d){this.iterable=b,this.mapper=c,this.scheduler=d,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new Zb(a,this);return b.run()},b}(Lb),Zb=function(){function a(a,b){this.observer=a,this.parent=b}return a.prototype.run=function(){function a(a,b){try{var f=c.next()}catch(g){return d.onError(g)}if(f.done)return d.onCompleted();var h=f.value;if(e)try{h=e(h,a)}catch(g){return d.onError(g)}d.onNext(h),b(a+1)}var b=Object(this.parent.iterable),c=A(b),d=this.observer,e=this.parent.mapper;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}(),$b=Math.pow(2,53)-1;v.prototype[qa]=function(){return new w(this._s)},w.prototype[qa]=function(){return this},w.prototype.next=function(){return this._i<this._l?{done:!1,value:this._s.charAt(this._i++)}:ra},x.prototype[qa]=function(){return new y(this._a)},y.prototype[qa]=function(){return this},y.prototype.next=function(){return this._i<this._l?{done:!1,value:this._a[this._i++]}:ra};var _b=Kb.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!da(b))throw new Error("mapFn when provided must be a function");if(b)var e=va(b,c,2);return pb(d)||(d=tb),new Yb(a,e,d)},ac=function(a){function b(b,c){this.args=b,this.scheduler=c,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new D(a,this);return b.run()},b}(Lb);D.prototype.run=function(){function a(a,e){d>a?(b.onNext(c[a]),e(a+1)):b.onCompleted()}var b=this.observer,c=this.parent.args,d=c.length;return this.parent.scheduler.scheduleRecursiveWithState(0,a)};var bc=Kb.fromArray=function(a,b){return pb(b)||(b=tb),new ac(a,b)};Kb.generate=function(a,b,c,d,e){return pb(e)||(e=tb),new Dc(function(f){var g=!0;return e.scheduleRecursiveWithState(a,function(a,e){var h,i;try{g?g=!1:a=c(a),h=b(a),h&&(i=d(a))}catch(j){return f.onError(j)}h?(f.onNext(i),e(a)):f.onCompleted()})})};var cc=function(a){function b(){a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){return gb},b}(Lb),dc=Kb.never=function(){return new cc};Kb.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return new ac(b,tb)},Kb.ofWithScheduler=function(a){for(var b=arguments.length,c=new Array(b-1),d=1;b>d;d++)c[d-1]=arguments[d];return new ac(c,a)};var ec=function(a){function b(b,c){this.obj=b,this.keys=Object.keys(b),this.scheduler=c,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new F(a,this);return b.run()},b}(Lb);F.prototype.run=function(){function a(a,f){if(e>a){var g=d[a];b.onNext([g,c[g]]),f(a+1)}else b.onCompleted()}var b=this.observer,c=this.parent.obj,d=this.parent.keys,e=d.length;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},Kb.pairs=function(a,b){return b||(b=tb),new ec(a,b)};var fc=function(a){function b(b,c,d){this.start=b,this.rangeCount=c,this.scheduler=d,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new gc(a,this);return b.run()},b}(Lb),gc=function(){function a(a,b){this.observer=a,this.parent=b}return a.prototype.run=function(){function a(a,e){c>a?(d.onNext(b+a),e(a+1)):d.onCompleted()}var b=this.parent.start,c=this.parent.rangeCount,d=this.observer;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}();Kb.range=function(a,b,c){return pb(c)||(c=tb),new fc(a,b,c)};var hc=function(a){function b(b,c,d){this.value=b,this.repeatCount=null==c?-1:c,this.scheduler=d,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new G(a,this);return b.run()},b}(Lb);G.prototype.run=function(){function a(a,d){return(-1===a||a>0)&&(b.onNext(c),a>0&&a--),0===a?b.onCompleted():void d(a)}var b=this.observer,c=this.parent.value;return this.parent.scheduler.scheduleRecursiveWithState(this.parent.repeatCount,a)},Kb.repeat=function(a,b,c){return pb(c)||(c=tb),new hc(a,b,c)};var ic=function(a){function b(b,c){this.value=b,this.scheduler=c,a.call(this)}function c(a,b){this.observer=a,this.parent=b}function d(a,b){var c=b[0],d=b[1];d.onNext(c),d.onCompleted()}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this);return b.run()},c.prototype.run=function(){return this.parent.scheduler.scheduleWithState([this.parent.value,this.observer],d)},b}(Lb),jc=(Kb["return"]=Kb.just=Kb.returnValue=function(a,b){return pb(b)||(b=sb),new ic(a,b)},function(a){function b(b,c){this.error=b,this.scheduler=c,a.call(this)}function c(a,b){this.o=a,this.p=b}function d(a,b){var c=b[0],d=b[1];d.onError(c)}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this);return b.run()},c.prototype.run=function(){return this.p.scheduler.scheduleWithState([this.p.error,this.o],d)},b}(Lb)),kc=Kb["throw"]=Kb.throwError=Kb.throwException=function(a,b){return pb(b)||(b=sb),new jc(a,b)};Kb.using=function(a,b){return new Dc(function(c){var d,e,f=gb;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new cb(kc(g).subscribe(c),f)}return new cb(e.subscribe(c),f)})},Eb.amb=function(a){var b=this;return new Dc(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new jb,j=new jb;return ca(a)&&(a=Ub(a)),i.setDisposable(b.subscribe(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()})),j.setDisposable(a.subscribe(function(a){e(),f===h&&c.onNext(a)},function(a){e(),f===h&&c.onError(a)},function(){e(),f===h&&c.onCompleted()})),new cb(i,j)})},Kb.amb=function(){function a(a,b){return a.amb(b)}var b=dc(),c=[];if(Array.isArray(arguments[0]))c=arguments[0];else for(var d=0,e=arguments.length;e>d;d++)c.push(arguments[d]);for(var d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},Eb["catch"]=Eb.catchError=Eb.catchException=function(a){return"function"==typeof a?H(this,a):lc([this,a])};var lc=Kb.catchError=Kb["catch"]=Kb.catchException=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return Sb(a).catchError()};Eb.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return Array.isArray(b[0])?b[0].unshift(this):b.unshift(this),mc.apply(this,b)};var mc=Kb.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.pop();return Array.isArray(b[0])&&(b=b[0]),new Dc(function(a){function c(b){if(h[b]=!0,i||(i=h.every(Z))){try{var c=d.apply(null,k)}catch(e){return a.onError(e)}a.onNext(c)}else j.filter(function(a,c){return c!==b}).every(Z)&&a.onCompleted()}function e(b){j[b]=!0,j.every(Z)&&a.onCompleted()}for(var f=b.length,g=function(){return!1},h=n(f,g),i=!1,j=n(f,g),k=new Array(f),l=new Array(f),m=0;f>m;m++)!function(d){var f=b[d],g=new jb;ca(f)&&(f=Ub(f)),g.setDisposable(f.subscribe(function(a){k[d]=a,c(d)},function(b){a.onError(b)},function(){e(d)})),l[d]=g}(m);return new cb(l)},this)};Eb.concat=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return a.unshift(this),oc.apply(null,a)};var nc=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b){this.sources=a,this.o=b}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new c(this.sources,a);return b.run()},c.prototype.run=function(){var a,b=new kb,c=this.sources,d=c.length,e=this.o,f=sb.scheduleRecursiveWithState(0,function(f,g){if(!a){if(f===d)return e.onCompleted();var h=c[f];ca(h)&&(h=Ub(h));var i=new jb;b.setDisposable(i),i.setDisposable(h.subscribe(function(a){e.onNext(a)},function(a){e.onError(a)},function(){g(f+1)}))}});return new cb(b,f,fb(function(){a=!0}))},b}(Lb),oc=Kb.concat=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(arguments.length);for(var b=0,c=arguments.length;c>b;b++)a[b]=arguments[b]}return new nc(a)};Eb.concatAll=Eb.concatObservable=function(){return this.merge(1)};var pc=function(a){function b(b,c){this.source=b,this.maxConcurrent=c,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new cb;return b.add(this.source.subscribe(new qc(a,this.maxConcurrent,b))),b},b}(Lb),qc=function(){function a(a,b,c){this.o=a,this.max=b,this.g=c,this.done=!1,this.q=[],this.activeCount=0,this.isStopped=!1}function b(a,b){this.parent=a,this.sad=b,this.isStopped=!1}return a.prototype.handleSubscribe=function(a){var c=new jb;this.g.add(c),ca(a)&&(a=Ub(a)),c.setDisposable(a.subscribe(new b(this,c)))},a.prototype.onNext=function(a){this.isStopped||(this.activeCount<this.max?(this.activeCount++,this.handleSubscribe(a)):this.q.push(a))},a.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},a.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,0===this.activeCount&&this.o.onCompleted())},a.prototype.dispose=function(){this.isStopped=!0},a.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b.prototype.onNext=function(a){this.isStopped||this.parent.o.onNext(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.o.onError(a))},b.prototype.onCompleted=function(){if(!this.isStopped){this.isStopped=!0;var a=this.parent;a.g.remove(this.sad),a.q.length>0?a.handleSubscribe(a.q.shift()):(a.activeCount--,a.done&&0===a.activeCount&&a.o.onCompleted())}},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},a}();Eb.merge=function(a){return"number"!=typeof a?rc(this,a):new pc(this,a)};var rc=Kb.merge=function(){var a,b,c=[],d=arguments.length;if(arguments[0])if(pb(arguments[0]))for(a=arguments[0],b=1;d>b;b++)c.push(arguments[b]);else for(a=sb,b=0;d>b;b++)c.push(arguments[b]);else for(a=sb,b=1;d>b;b++)c.push(arguments[b]);return Array.isArray(c[0])&&(c=c[0]),E(a,c).mergeAll()},sc=function(a){function b(b){this.source=b,a.call(this)}function c(a,b){this.o=a,this.g=b,this.isStopped=!1,this.done=!1}function d(a,b,c){this.parent=a,this.g=b,this.sad=c,this.isStopped=!1}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new cb,d=new jb;return b.add(d),d.setDisposable(this.source.subscribe(new c(a,b))),b},c.prototype.onNext=function(a){if(!this.isStopped){var b=new jb;this.g.add(b),ca(a)&&(a=Ub(a)),b.setDisposable(a.subscribe(new d(this,this.g,b)))}},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,1===this.g.length&&this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},d.prototype.onNext=function(a){this.isStopped||this.parent.o.onNext(a)},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.o.onError(a))},d.prototype.onCompleted=function(){if(!this.isStopped){var a=this.parent;this.isStopped=!0,a.g.remove(this.sad),a.done&&1===a.g.length&&a.o.onCompleted()}},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},b}(Lb);Eb.mergeAll=Eb.mergeObservable=function(){return new sc(this)};var tc=X.CompositeError=function(a){this.name="NotImplementedError",this.innerErrors=a,this.message="This contains multiple errors. Check the innerErrors",Error.call(this)};tc.prototype=Error.prototype,Kb.mergeDelayError=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}var d=E(null,a);return new Dc(function(a){function b(){0===g.length?a.onCompleted():a.onError(1===g.length?g[0]:new tc(g))}var c=new cb,e=new jb,f=!1,g=[];return c.add(e),e.setDisposable(d.subscribe(function(d){var e=new jb;c.add(e),ca(d)&&(d=Ub(d)),e.setDisposable(d.subscribe(function(b){a.onNext(b)},function(a){g.push(a),c.remove(e),f&&1===c.length&&b()},function(){c.remove(e),f&&1===c.length&&b()}))},function(a){g.push(a),f=!0,1===c.length&&b()},function(){f=!0,1===c.length&&b()})),c})},Eb.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return uc([this,a])};var uc=Kb.onErrorResumeNext=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return new Dc(function(b){var c=0,d=new kb,e=sb.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],ca(f)&&(f=Ub(f)),g=new jb,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new cb(d,e)})};Eb.skipUntil=function(a){var b=this;return new Dc(function(c){var d=!1,e=new cb(b.subscribe(function(a){d&&c.onNext(a)},function(a){c.onError(a)},function(){d&&c.onCompleted()}));ca(a)&&(a=Ub(a));var f=new jb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},function(a){c.onError(a)},function(){f.dispose()})),e},b)};var vc=function(a){function b(b){this.source=b,a.call(this)}function c(a,b){this.o=a,this.inner=b,this.stopped=!1,this.latest=0,this.hasLatest=!1,this.isStopped=!1}function d(a,b){this.parent=a,this.id=b,this.isStopped=!1}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new kb,d=this.source.subscribe(new c(a,b));return new cb(d,b)},c.prototype.onNext=function(a){if(!this.isStopped){var b=new jb,c=++this.latest;this.hasLatest=!0,this.inner.setDisposable(b),ca(a)&&(a=Ub(a)),b.setDisposable(a.subscribe(new d(this,c)))}},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.stopped=!0,!this.hasLatest&&this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},d.prototype.onNext=function(a){this.isStopped||this.parent.latest===this.id&&this.parent.o.onNext(a)},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.latest===this.id&&this.parent.o.onError(a))},d.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.parent.latest===this.id&&(this.parent.hasLatest=!1,this.parent.isStopped&&this.parent.o.onCompleted()))},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},b}(Lb);Eb["switch"]=Eb.switchLatest=function(){return new vc(this)};var wc=function(a){function b(b,c){this.source=b,this.other=ca(c)?Ub(c):c,a.call(this)}function c(a){this.o=a,this.isStopped=!1}return Wa(b,a),b.prototype.subscribeCore=function(a){return new cb(this.source.subscribe(a),this.other.subscribe(new c(a)))},c.prototype.onNext=function(a){this.isStopped||this.o.onCompleted()},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){!this.isStopped&&(this.isStopped=!0)},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Lb);Eb.takeUntil=function(a){return new wc(this,a)},Eb.withLatestFrom=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.pop(),e=this;return Array.isArray(b[0])&&(b=b[0]),new Dc(function(a){for(var c=b.length,f=n(c,I),g=!1,h=new Array(c),i=new Array(c+1),j=0;c>j;j++)!function(c){var d=b[c],e=new jb;ca(d)&&(d=Ub(d)),e.setDisposable(d.subscribe(function(a){h[c]=a,f[c]=!0,g=f.every(Z)},function(b){a.onError(b)},Y)),i[c]=e}(j);var k=new jb;return k.setDisposable(e.subscribe(function(b){var c=[b].concat(h);if(g){var e=p(d).apply(null,c);return e===Za?a.onError(e.e):void a.onNext(e)}},function(b){a.onError(b)},function(){a.onCompleted()})),i[c]=k,new cb(i)},this)},Eb.zip=function(){if(Array.isArray(arguments[0]))return J.apply(this,arguments);for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=this,e=b.pop();return b.unshift(d),new Dc(function(a){for(var c=b.length,f=n(c,K),g=n(c,I),h=new Array(c),i=0;c>i;i++)!function(c){var i=b[c],j=new jb;ca(i)&&(i=Ub(i)),j.setDisposable(i.subscribe(function(b){if(f[c].push(b),f.every(function(a){return a.length>0})){var h=f.map(function(a){return a.shift()}),i=p(e).apply(d,h);if(i===Za)return a.onError(i.e);a.onNext(i)}else g.filter(function(a,b){return b!==c}).every(Z)&&a.onCompleted()},function(b){a.onError(b)},function(){g[c]=!0,g.every(Z)&&a.onCompleted()})),h[c]=j}(i);return new cb(h)},d)},Kb.zip=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.shift();return d.zip.apply(d,b)},Kb.zipArray=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new Dc(function(b){for(var c=a.length,d=n(c,L),e=n(c,I),f=new Array(c),g=0;c>g;g++)!function(c){f[c]=new jb,f[c].setDisposable(a[c].subscribe(function(a){if(d[c].push(a),d.every(function(a){return a.length>0})){var f=d.map(function(a){return a.shift()});b.onNext(f)}else if(e.filter(function(a,b){return b!==c}).every(Z))return b.onCompleted()},function(a){b.onError(a)},function(){e[c]=!0,e.every(Z)&&b.onCompleted()}))}(g);return new cb(f)})},Eb.asObservable=function(){var a=this;return new Dc(function(b){return a.subscribe(b)},a)},Eb.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).selectMany(function(a){return a.toArray()}).where(function(a){return a.length>0})},Eb.dematerialize=function(){var a=this;return new Dc(function(b){return a.subscribe(function(a){return a.accept(b)},function(a){b.onError(a)},function(){b.onCompleted()})},this)},Eb.distinctUntilChanged=function(a,b){var c=this;return b||(b=_),new Dc(function(d){var e,f=!1;return c.subscribe(function(c){var g=c;if(a&&(g=p(a)(c),g===Za))return d.onError(g.e);if(f){var h=p(b)(e,g);if(h===Za)return d.onError(h.e)}f&&h||(f=!0,e=g,d.onNext(c))},function(a){d.onError(a)},function(){d.onCompleted()})},this)};var xc=function(a){function b(b,c,d,e){this.source=b,this.t=!c||da(c)?Db(c||Y,d||Y,e||Y):c,a.call(this)}function c(a,b){this.o=a,this.t=b,this.isStopped=!1}return Wa(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this.t))},c.prototype.onNext=function(a){if(!this.isStopped){var b=p(this.t.onNext).call(this.t,a);b===Za&&this.o.onError(b.e),this.o.onNext(a)}},c.prototype.onError=function(a){if(!this.isStopped){this.isStopped=!0;var b=p(this.t.onError).call(this.t,a);if(b===Za)return this.o.onError(b.e);this.o.onError(a)}},c.prototype.onCompleted=function(){if(!this.isStopped){this.isStopped=!0;var a=p(this.t.onCompleted).call(this.t);if(a===Za)return this.o.onError(a.e);this.o.onCompleted()}},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Lb);Eb["do"]=Eb.tap=Eb.doAction=function(a,b,c){return new xc(this,a,b,c)},Eb.doOnNext=Eb.tapOnNext=function(a,b){return this.tap("undefined"!=typeof b?function(c){a.call(b,c)}:a)},Eb.doOnError=Eb.tapOnError=function(a,b){return this.tap(Y,"undefined"!=typeof b?function(c){a.call(b,c)}:a)},Eb.doOnCompleted=Eb.tapOnCompleted=function(a,b){return this.tap(Y,null,"undefined"!=typeof b?function(){a.call(b)}:a)},Eb["finally"]=Eb.ensure=function(a){var b=this;return new Dc(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return fb(function(){try{d.dispose()}catch(b){throw b}finally{a()}})},this)},Eb.finallyAction=function(a){return this.ensure(a)};var yc=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.isStopped=!1}return Wa(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a))},c.prototype.onNext=Y,c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},b}(Lb);Eb.ignoreElements=function(){return new yc(this)},Eb.materialize=function(){var a=this;return new Dc(function(b){return a.subscribe(function(a){b.onNext(zb(a))},function(a){b.onNext(Ab(a)),b.onCompleted()},function(){b.onNext(Bb()),b.onCompleted()})},a)},Eb.repeat=function(a){return Qb(this,a).concat()},Eb.retry=function(a){return Qb(this,a).catchError()},Eb.retryWhen=function(a){return Qb(this).catchErrorWhen(a)};var zc=function(a){function b(b,c,d,e){this.source=b,this.accumulator=c,this.hasSeed=d,this.seed=e,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new M(a,this))},b}(Lb);M.prototype.onNext=function(a){if(!this.isStopped){!this.hasValue&&(this.hasValue=!0);try{this.hasAccumulation?this.accumulation=this.accumulator(this.accumulation,a):(this.accumulation=this.hasSeed?this.accumulator(this.seed,a):a,this.hasAccumulation=!0)}catch(b){return this.observer.onError(b)}this.observer.onNext(this.accumulation)}},M.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.observer.onError(a))},M.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,!this.hasValue&&this.hasSeed&&this.observer.onNext(this.seed),this.observer.onCompleted())},M.prototype.dispose=function(){this.isStopped=!0},M.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},Eb.scan=function(){var a,b,c=!1;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new zc(this,b,c,a)},Eb.skipLast=function(a){if(0>a)throw new la;var b=this;return new Dc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},function(a){c.onError(a)},function(){c.onCompleted()})},b)},Eb.startWith=function(){var a,b=0;arguments.length&&pb(arguments[0])?(a=arguments[0],b=1):a=sb;for(var c=[],d=b,e=arguments.length;e>d;d++)c.push(arguments[d]);return Sb([bc(c,a),this]).concat()},Eb.takeLast=function(a){if(0>a)throw new la;var b=this;return new Dc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},function(a){c.onError(a)},function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})},b)},Eb.takeLastBuffer=function(a){var b=this;return new Dc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},function(a){c.onError(a)},function(){c.onNext(d),c.onCompleted()})},b)},Eb.windowWithCount=function(a,b){var c=this;if(+a||(a=0),Math.abs(a)===1/0&&(a=0),0>=a)throw new la;if(null==b&&(b=a),+b||(b=0),Math.abs(b)===1/0&&(b=0),0>=b)throw new la;return new Dc(function(d){function e(){var a=new Gc;i.push(a),d.onNext(Ya(a,g))}var f=new jb,g=new lb(f),h=0,i=[];return e(),f.setDisposable(c.subscribe(function(c){for(var d=0,f=i.length;f>d;d++)i[d].onNext(c);var g=h-a+1;g>=0&&g%b===0&&i.shift().onCompleted(),++h%b===0&&e()},function(a){for(;i.length>0;)i.shift().onError(a);d.onError(a)},function(){for(;i.length>0;)i.shift().onCompleted();d.onCompleted()})),g},c)},Eb.selectConcat=Eb.concatMap=function(a,b,c){return da(a)&&da(b)?this.concatMap(function(c,d){var e=a(c,d);return ca(e)&&(e=Ub(e)),(ta(e)||sa(e))&&(e=_b(e)),e.map(function(a,e){return b(c,a,d,e)})}):da(a)?N(this,a,c):N(this,function(){return a})},Eb.concatMapObserver=Eb.selectConcatObserver=function(a,b,c,d){var e=this,f=va(a,d,2),g=va(b,d,1),h=va(c,d,0);return new Dc(function(a){var b=0;return e.subscribe(function(c){var d;try{d=f(c,b++)}catch(e){return void a.onError(e)}ca(d)&&(d=Ub(d)),a.onNext(d)},function(b){var c;try{c=g(b)}catch(d){return void a.onError(d)}ca(c)&&(c=Ub(c)),a.onNext(c),a.onCompleted()},function(){var b;try{b=h()}catch(c){return void a.onError(c)}ca(b)&&(b=Ub(b)),a.onNext(b),a.onCompleted()})},this).concatAll()},Eb.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new Dc(function(a){var d=!1;return c.subscribe(function(b){d=!0,a.onNext(b)},function(b){a.onError(b)},function(){!d&&a.onNext(b),a.onCompleted()})},c)},P.prototype.push=function(a){var b=-1===O(this.set,a,this.comparer);return b&&this.set.push(a),b},Eb.distinct=function(a,b){var c=this;return b||(b=_),new Dc(function(d){var e=new P(b);return c.subscribe(function(b){var c=b;if(a)try{c=a(b)}catch(f){return void d.onError(f)}e.push(c)&&d.onNext(b)},function(a){d.onError(a)},function(){d.onCompleted()})},this)};var Ac=function(a){function b(b,c,d){this.source=b,this.selector=va(c,d,3),a.call(this)}function c(a,b){return function(c,d,e){return a.call(this,b.selector(c,d,e),d,e)}}function d(a,b,c){this.o=a,this.selector=b,this.source=c,this.i=0,this.isStopped=!1}return Wa(b,a),b.prototype.internalMap=function(a,d){return new b(this.source,c(a,this),d)},b.prototype.subscribeCore=function(a){return this.source.subscribe(new d(a,this.selector,this))},d.prototype.onNext=function(a){if(!this.isStopped){var b=p(this.selector)(a,this.i++,this.source);return b===Za?this.o.onError(b.e):void this.o.onNext(b)}},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},d.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Lb);Eb.map=Eb.select=function(a,b){var c="function"==typeof a?a:function(){return a};return this instanceof Ac?this.internalMap(c,b):new Ac(this,c,b)},Eb.pluck=function(){var b=arguments,c=arguments.length;if(0===c)throw new Error("List of properties cannot be empty.");return this.map(function(d){for(var e=d,f=0;c>f;f++){var g=e[b[f]];if("undefined"==typeof g)return a;e=g}return e})},Eb.selectMany=Eb.flatMap=function(a,b,c){return da(a)&&da(b)?this.flatMap(function(c,d){var e=a(c,d);return ca(e)&&(e=Ub(e)),(ta(e)||sa(e))&&(e=_b(e)),e.map(function(a,e){return b(c,a,d,e)})},c):da(a)?Q(this,a,c):Q(this,function(){return a})},Eb.flatMapObserver=Eb.selectManyObserver=function(a,b,c,d){var e=this;return new Dc(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}ca(c)&&(c=Ub(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}ca(c)&&(c=Ub(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}ca(a)&&(a=Ub(a)),f.onNext(a),f.onCompleted()})},e).mergeAll()},Eb.selectSwitch=Eb.flatMapLatest=Eb.switchMap=function(a,b){return this.select(a,b).switchLatest()};var Bc=function(a){function b(b,c){this.source=b,this.skipCount=c,a.call(this)}function c(a,b){this.c=b,this.r=b,this.o=a,this.isStopped=!1}return Wa(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this.skipCount))},c.prototype.onNext=function(a){this.isStopped||(this.r<=0?this.o.onNext(a):this.r--)},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Lb);Eb.skip=function(a){if(0>a)throw new la;return new Bc(this,a)},Eb.skipWhile=function(a,b){var c=this,d=va(a,b,3);return new Dc(function(a){var b=0,e=!1;return c.subscribe(function(f){if(!e)try{e=!d(f,b++,c)}catch(g){return void a.onError(g)}e&&a.onNext(f)},function(b){a.onError(b)},function(){a.onCompleted()})},c)},Eb.take=function(a,b){if(0>a)throw new la;if(0===a)return Xb(b);var c=this;return new Dc(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0>=d&&b.onCompleted())},function(a){b.onError(a)},function(){b.onCompleted()})},c)},Eb.takeWhile=function(a,b){var c=this,d=va(a,b,3);return new Dc(function(a){var b=0,e=!0;return c.subscribe(function(f){if(e){try{e=d(f,b++,c)}catch(g){return void a.onError(g)}e?a.onNext(f):a.onCompleted()}},function(b){a.onError(b)},function(){a.onCompleted()})},c)};var Cc=function(a){function b(b,c,d){this.source=b,this.predicate=va(c,d,3),a.call(this)}function c(a,b){return function(c,d,e){return b.predicate(c,d,e)&&a.call(this,c,d,e)}}function d(a,b,c){this.o=a,this.predicate=b,this.source=c,this.i=0,this.isStopped=!1}return Wa(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new d(a,this.predicate,this))},b.prototype.internalFilter=function(a,d){return new b(this.source,c(a,this),d)},d.prototype.onNext=function(a){if(!this.isStopped){var b=p(this.predicate)(a,this.i++,this.source);return b===Za?this.o.onError(b.e):void(b&&this.o.onNext(a))}},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},d.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Lb);Eb.filter=Eb.where=function(a,b){return this instanceof Cc?this.internalFilter(a,b):new Cc(this,a,b)},Eb.transduce=function(a){function b(a){return{"@@transducer/init":function(){return a},"@@transducer/step":function(a,b){return a.onNext(b)},"@@transducer/result":function(a){return a.onCompleted()}}}var c=this;return new Dc(function(d){var e=a(b(d));return c.subscribe(function(a){try{e["@@transducer/step"](d,a)}catch(b){d.onError(b)}},function(a){d.onError(a)},function(){e["@@transducer/result"](d)})},c)};var Dc=X.AnonymousObservable=function(a){function b(a){return a&&da(a.dispose)?a:da(a)?fb(a):gb}function c(a,c){var d=c[0],e=c[1],f=p(e)(d);return f!==Za||d.fail(Za.e)?void d.setDisposable(b(f)):q(Za.e)}function d(b,d){function e(a){var d=new Ec(a),e=[d,b];return tb.scheduleRequired()?tb.scheduleWithState(e,c):c(null,e),d}this.source=d,a.call(this,e)}return Wa(d,a),d}(Kb),Ec=function(a){function b(b){a.call(this),this.observer=b,this.m=new jb}Wa(b,a);var c=b.prototype;return c.next=function(a){
+var b=p(this.observer.onNext).call(this.observer,a);b===Za&&(this.dispose(),q(b.e))},c.error=function(a){var b=p(this.observer.onError).call(this.observer,a);this.dispose(),b===Za&&q(b.e)},c.completed=function(){var a=p(this.observer.onCompleted).call(this.observer);this.dispose(),a===Za&&q(a.e)},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(Fb),Fc=function(a,b){this.subject=a,this.observer=b};Fc.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var Gc=X.Subject=function(a){function c(a){return ib(this),this.isStopped?this.hasError?(a.onError(this.error),gb):(a.onCompleted(),gb):(this.observers.push(a),new Fc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return Wa(d,a),Xa(d.prototype,Cb.prototype,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(ib(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=b(this.observers),d=c.length;d>a;a++)c[a].onCompleted();this.observers.length=0}},onError:function(a){if(ib(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){if(ib(this),!this.isStopped)for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new Hc(a,b)},d}(Kb),Hc=(X.AsyncSubject=function(a){function c(a){return ib(this),this.isStopped?(this.hasError?a.onError(this.error):this.hasValue?(a.onNext(this.value),a.onCompleted()):a.onCompleted(),gb):(this.observers.push(a),new Fc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.hasValue=!1,this.observers=[],this.hasError=!1}return Wa(d,a),Xa(d.prototype,Cb,{hasObservers:function(){return ib(this),this.observers.length>0},onCompleted:function(){var a,c;if(ib(this),!this.isStopped){this.isStopped=!0;var d=b(this.observers),c=d.length;if(this.hasValue)for(a=0;c>a;a++){var e=d[a];e.onNext(this.value),e.onCompleted()}else for(a=0;c>a;a++)d[a].onCompleted();this.observers.length=0}},onError:function(a){if(ib(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){ib(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(Kb),X.AnonymousSubject=function(a){function b(a){return this.observable.subscribe(a)}function c(c,d){this.observer=c,this.observable=d,a.call(this,b)}return Wa(c,a),Xa(c.prototype,Cb.prototype,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(Kb));"function"==typeof define&&"object"==typeof define.amd&&define.amd?(S.Rx=X,define(function(){return X})):T&&U?V?(U.exports=X).Rx=X:T.Rx=X:S.Rx=X;var Ic=g()}).call(this);
+//# sourceMappingURL=rx.compat.map \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.experimental.js b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.experimental.js
new file mode 100644
index 00000000000..df8a6834b22
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.experimental.js
@@ -0,0 +1,597 @@
+// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
+
+;(function (factory) {
+ var objectTypes = {
+ 'boolean': false,
+ 'function': true,
+ 'object': true,
+ 'number': false,
+ 'string': false,
+ 'undefined': false
+ };
+
+ var root = (objectTypes[typeof window] && window) || this,
+ freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
+ freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
+ moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
+ freeGlobal = objectTypes[typeof global] && global;
+
+ if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) {
+ root = freeGlobal;
+ }
+
+ // Because of build optimizers
+ if (typeof define === 'function' && define.amd) {
+ define(['rx'], function (Rx, exports) {
+ return factory(root, exports, Rx);
+ });
+ } else if (typeof module === 'object' && module && module.exports === freeExports) {
+ module.exports = factory(root, module.exports, require('./rx'));
+ } else {
+ root.Rx = factory(root, {}, root.Rx);
+ }
+}.call(this, function (root, exp, Rx, undefined) {
+
+ // Aliases
+ var Observable = Rx.Observable,
+ observableProto = Observable.prototype,
+ AnonymousObservable = Rx.AnonymousObservable,
+ observableConcat = Observable.concat,
+ observableDefer = Observable.defer,
+ observableEmpty = Observable.empty,
+ disposableEmpty = Rx.Disposable.empty,
+ CompositeDisposable = Rx.CompositeDisposable,
+ SerialDisposable = Rx.SerialDisposable,
+ SingleAssignmentDisposable = Rx.SingleAssignmentDisposable,
+ Enumerator = Rx.internals.Enumerator,
+ Enumerable = Rx.internals.Enumerable,
+ enumerableOf = Enumerable.of,
+ immediateScheduler = Rx.Scheduler.immediate,
+ currentThreadScheduler = Rx.Scheduler.currentThread,
+ slice = Array.prototype.slice,
+ AsyncSubject = Rx.AsyncSubject,
+ Observer = Rx.Observer,
+ inherits = Rx.internals.inherits,
+ bindCallback = Rx.internals.bindCallback,
+ addProperties = Rx.internals.addProperties,
+ helpers = Rx.helpers,
+ noop = helpers.noop,
+ isPromise = helpers.isPromise,
+ isScheduler = Rx.Scheduler.isScheduler,
+ observableFromPromise = Observable.fromPromise;
+
+ // Shim in iterator support
+ var $iterator$ = (typeof Symbol === 'function' && Symbol.iterator) ||
+ '_es6shim_iterator_';
+ // Bug for mozilla version
+ if (root.Set && typeof new root.Set()['@@iterator'] === 'function') {
+ $iterator$ = '@@iterator';
+ }
+
+ var doneEnumerator = Rx.doneEnumerator = { done: true, value: undefined };
+
+ var isIterable = Rx.helpers.isIterable = function (o) {
+ return o[$iterator$] !== undefined;
+ }
+
+ var isArrayLike = Rx.helpers.isArrayLike = function (o) {
+ return o && o.length !== undefined;
+ }
+
+ Rx.helpers.iterator = $iterator$;
+
+ var WhileEnumerable = (function(__super__) {
+ inherits(WhileEnumerable, __super__);
+ function WhileEnumerable(c, s) {
+ this.c = c;
+ this.s = s;
+ }
+ WhileEnumerable.prototype[$iterator$] = function () {
+ var self = this;
+ return {
+ next: function () {
+ return self.c() ?
+ { done: false, value: self.s } :
+ { done: true, value: void 0 };
+ }
+ };
+ };
+ return WhileEnumerable;
+ }(Enumerable));
+
+ function enumerableWhile(condition, source) {
+ return new WhileEnumerable(condition, source);
+ }
+
+ /**
+ * Returns an observable sequence that is the result of invoking the selector on the source sequence, without sharing subscriptions.
+ * This operator allows for a fluent style of writing queries that use the same sequence multiple times.
+ *
+ * @param {Function} selector Selector function which can use the source sequence as many times as needed, without sharing subscriptions to the source sequence.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
+ */
+ observableProto.letBind = observableProto['let'] = function (func) {
+ return func(this);
+ };
+
+ /**
+ * Determines whether an observable collection contains values. There is an alias for this method called 'ifThen' for browsers <IE9
+ *
+ * @example
+ * 1 - res = Rx.Observable.if(condition, obs1);
+ * 2 - res = Rx.Observable.if(condition, obs1, obs2);
+ * 3 - res = Rx.Observable.if(condition, obs1, scheduler);
+ * @param {Function} condition The condition which determines if the thenSource or elseSource will be run.
+ * @param {Observable} thenSource The observable sequence or Promise that will be run if the condition function returns true.
+ * @param {Observable} [elseSource] The observable sequence or Promise that will be run if the condition function returns false. If this is not provided, it defaults to Rx.Observabe.Empty with the specified scheduler.
+ * @returns {Observable} An observable sequence which is either the thenSource or elseSource.
+ */
+ Observable['if'] = Observable.ifThen = function (condition, thenSource, elseSourceOrScheduler) {
+ return observableDefer(function () {
+ elseSourceOrScheduler || (elseSourceOrScheduler = observableEmpty());
+
+ isPromise(thenSource) && (thenSource = observableFromPromise(thenSource));
+ isPromise(elseSourceOrScheduler) && (elseSourceOrScheduler = observableFromPromise(elseSourceOrScheduler));
+
+ // Assume a scheduler for empty only
+ typeof elseSourceOrScheduler.now === 'function' && (elseSourceOrScheduler = observableEmpty(elseSourceOrScheduler));
+ return condition() ? thenSource : elseSourceOrScheduler;
+ });
+ };
+
+ /**
+ * Concatenates the observable sequences obtained by running the specified result selector for each element in source.
+ * There is an alias for this method called 'forIn' for browsers <IE9
+ * @param {Array} sources An array of values to turn into an observable sequence.
+ * @param {Function} resultSelector A function to apply to each item in the sources array to turn it into an observable sequence.
+ * @returns {Observable} An observable sequence from the concatenated observable sequences.
+ */
+ Observable['for'] = Observable.forIn = function (sources, resultSelector, thisArg) {
+ return enumerableOf(sources, resultSelector, thisArg).concat();
+ };
+
+ /**
+ * Repeats source as long as condition holds emulating a while loop.
+ * There is an alias for this method called 'whileDo' for browsers <IE9
+ *
+ * @param {Function} condition The condition which determines if the source will be repeated.
+ * @param {Observable} source The observable sequence that will be run if the condition function returns true.
+ * @returns {Observable} An observable sequence which is repeated as long as the condition holds.
+ */
+ var observableWhileDo = Observable['while'] = Observable.whileDo = function (condition, source) {
+ isPromise(source) && (source = observableFromPromise(source));
+ return enumerableWhile(condition, source).concat();
+ };
+
+ /**
+ * Repeats source as long as condition holds emulating a do while loop.
+ *
+ * @param {Function} condition The condition which determines if the source will be repeated.
+ * @param {Observable} source The observable sequence that will be run if the condition function returns true.
+ * @returns {Observable} An observable sequence which is repeated as long as the condition holds.
+ */
+ observableProto.doWhile = function (condition) {
+ return observableConcat([this, observableWhileDo(condition, this)]);
+ };
+
+ /**
+ * Uses selector to determine which source in sources to use.
+ * There is an alias 'switchCase' for browsers <IE9.
+ *
+ * @example
+ * 1 - res = Rx.Observable.case(selector, { '1': obs1, '2': obs2 });
+ * 1 - res = Rx.Observable.case(selector, { '1': obs1, '2': obs2 }, obs0);
+ * 1 - res = Rx.Observable.case(selector, { '1': obs1, '2': obs2 }, scheduler);
+ *
+ * @param {Function} selector The function which extracts the value for to test in a case statement.
+ * @param {Array} sources A object which has keys which correspond to the case statement labels.
+ * @param {Observable} [elseSource] The observable sequence or Promise that will be run if the sources are not matched. If this is not provided, it defaults to Rx.Observabe.empty with the specified scheduler.
+ *
+ * @returns {Observable} An observable sequence which is determined by a case statement.
+ */
+ Observable['case'] = Observable.switchCase = function (selector, sources, defaultSourceOrScheduler) {
+ return observableDefer(function () {
+ isPromise(defaultSourceOrScheduler) && (defaultSourceOrScheduler = observableFromPromise(defaultSourceOrScheduler));
+ defaultSourceOrScheduler || (defaultSourceOrScheduler = observableEmpty());
+
+ typeof defaultSourceOrScheduler.now === 'function' && (defaultSourceOrScheduler = observableEmpty(defaultSourceOrScheduler));
+
+ var result = sources[selector()];
+ isPromise(result) && (result = observableFromPromise(result));
+
+ return result || defaultSourceOrScheduler;
+ });
+ };
+
+ /**
+ * Expands an observable sequence by recursively invoking selector.
+ *
+ * @param {Function} selector Selector function to invoke for each produced element, resulting in another sequence to which the selector will be invoked recursively again.
+ * @param {Scheduler} [scheduler] Scheduler on which to perform the expansion. If not provided, this defaults to the current thread scheduler.
+ * @returns {Observable} An observable sequence containing all the elements produced by the recursive expansion.
+ */
+ observableProto.expand = function (selector, scheduler) {
+ isScheduler(scheduler) || (scheduler = immediateScheduler);
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ var q = [],
+ m = new SerialDisposable(),
+ d = new CompositeDisposable(m),
+ activeCount = 0,
+ isAcquired = false;
+
+ var ensureActive = function () {
+ var isOwner = false;
+ if (q.length > 0) {
+ isOwner = !isAcquired;
+ isAcquired = true;
+ }
+ if (isOwner) {
+ m.setDisposable(scheduler.scheduleRecursive(function (self) {
+ var work;
+ if (q.length > 0) {
+ work = q.shift();
+ } else {
+ isAcquired = false;
+ return;
+ }
+ var m1 = new SingleAssignmentDisposable();
+ d.add(m1);
+ m1.setDisposable(work.subscribe(function (x) {
+ observer.onNext(x);
+ var result = null;
+ try {
+ result = selector(x);
+ } catch (e) {
+ observer.onError(e);
+ }
+ q.push(result);
+ activeCount++;
+ ensureActive();
+ }, observer.onError.bind(observer), function () {
+ d.remove(m1);
+ activeCount--;
+ if (activeCount === 0) {
+ observer.onCompleted();
+ }
+ }));
+ self();
+ }));
+ }
+ };
+
+ q.push(source);
+ activeCount++;
+ ensureActive();
+ return d;
+ }, this);
+ };
+
+ /**
+ * Runs all observable sequences in parallel and collect their last elements.
+ *
+ * @example
+ * 1 - res = Rx.Observable.forkJoin([obs1, obs2]);
+ * 1 - res = Rx.Observable.forkJoin(obs1, obs2, ...);
+ * @returns {Observable} An observable sequence with an array collecting the last elements of all the input sequences.
+ */
+ Observable.forkJoin = function () {
+ var allSources = [];
+ if (Array.isArray(arguments[0])) {
+ allSources = arguments[0];
+ } else {
+ for(var i = 0, len = arguments.length; i < len; i++) { allSources.push(arguments[i]); }
+ }
+ return new AnonymousObservable(function (subscriber) {
+ var count = allSources.length;
+ if (count === 0) {
+ subscriber.onCompleted();
+ return disposableEmpty;
+ }
+ var group = new CompositeDisposable(),
+ finished = false,
+ hasResults = new Array(count),
+ hasCompleted = new Array(count),
+ results = new Array(count);
+
+ for (var idx = 0; idx < count; idx++) {
+ (function (i) {
+ var source = allSources[i];
+ isPromise(source) && (source = observableFromPromise(source));
+ group.add(
+ source.subscribe(
+ function (value) {
+ if (!finished) {
+ hasResults[i] = true;
+ results[i] = value;
+ }
+ },
+ function (e) {
+ finished = true;
+ subscriber.onError(e);
+ group.dispose();
+ },
+ function () {
+ if (!finished) {
+ if (!hasResults[i]) {
+ subscriber.onCompleted();
+ return;
+ }
+ hasCompleted[i] = true;
+ for (var ix = 0; ix < count; ix++) {
+ if (!hasCompleted[ix]) { return; }
+ }
+ finished = true;
+ subscriber.onNext(results);
+ subscriber.onCompleted();
+ }
+ }));
+ })(idx);
+ }
+
+ return group;
+ });
+ };
+
+ /**
+ * Runs two observable sequences in parallel and combines their last elemenets.
+ *
+ * @param {Observable} second Second observable sequence.
+ * @param {Function} resultSelector Result selector function to invoke with the last elements of both sequences.
+ * @returns {Observable} An observable sequence with the result of calling the selector function with the last elements of both input sequences.
+ */
+ observableProto.forkJoin = function (second, resultSelector) {
+ var first = this;
+ return new AnonymousObservable(function (observer) {
+ var leftStopped = false, rightStopped = false,
+ hasLeft = false, hasRight = false,
+ lastLeft, lastRight,
+ leftSubscription = new SingleAssignmentDisposable(), rightSubscription = new SingleAssignmentDisposable();
+
+ isPromise(second) && (second = observableFromPromise(second));
+
+ leftSubscription.setDisposable(
+ first.subscribe(function (left) {
+ hasLeft = true;
+ lastLeft = left;
+ }, function (err) {
+ rightSubscription.dispose();
+ observer.onError(err);
+ }, function () {
+ leftStopped = true;
+ if (rightStopped) {
+ if (!hasLeft) {
+ observer.onCompleted();
+ } else if (!hasRight) {
+ observer.onCompleted();
+ } else {
+ var result;
+ try {
+ result = resultSelector(lastLeft, lastRight);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+ observer.onNext(result);
+ observer.onCompleted();
+ }
+ }
+ })
+ );
+
+ rightSubscription.setDisposable(
+ second.subscribe(function (right) {
+ hasRight = true;
+ lastRight = right;
+ }, function (err) {
+ leftSubscription.dispose();
+ observer.onError(err);
+ }, function () {
+ rightStopped = true;
+ if (leftStopped) {
+ if (!hasLeft) {
+ observer.onCompleted();
+ } else if (!hasRight) {
+ observer.onCompleted();
+ } else {
+ var result;
+ try {
+ result = resultSelector(lastLeft, lastRight);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+ observer.onNext(result);
+ observer.onCompleted();
+ }
+ }
+ })
+ );
+
+ return new CompositeDisposable(leftSubscription, rightSubscription);
+ }, first);
+ };
+
+ /**
+ * Comonadic bind operator.
+ * @param {Function} selector A transform function to apply to each element.
+ * @param {Object} scheduler Scheduler used to execute the operation. If not specified, defaults to the ImmediateScheduler.
+ * @returns {Observable} An observable sequence which results from the comonadic bind operation.
+ */
+ observableProto.manySelect = observableProto.extend = function (selector, scheduler) {
+ isScheduler(scheduler) || (scheduler = immediateScheduler);
+ var source = this;
+ return observableDefer(function () {
+ var chain;
+
+ return source
+ .map(function (x) {
+ var curr = new ChainObservable(x);
+
+ chain && chain.onNext(x);
+ chain = curr;
+
+ return curr;
+ })
+ .tap(
+ noop,
+ function (e) { chain && chain.onError(e); },
+ function () { chain && chain.onCompleted(); }
+ )
+ .observeOn(scheduler)
+ .map(selector);
+ }, source);
+ };
+
+ var ChainObservable = (function (__super__) {
+
+ function subscribe (observer) {
+ var self = this, g = new CompositeDisposable();
+ g.add(currentThreadScheduler.schedule(function () {
+ observer.onNext(self.head);
+ g.add(self.tail.mergeAll().subscribe(observer));
+ }));
+
+ return g;
+ }
+
+ inherits(ChainObservable, __super__);
+
+ function ChainObservable(head) {
+ __super__.call(this, subscribe);
+ this.head = head;
+ this.tail = new AsyncSubject();
+ }
+
+ addProperties(ChainObservable.prototype, Observer, {
+ onCompleted: function () {
+ this.onNext(Observable.empty());
+ },
+ onError: function (e) {
+ this.onNext(Observable.throwError(e));
+ },
+ onNext: function (v) {
+ this.tail.onNext(v);
+ this.tail.onCompleted();
+ }
+ });
+
+ return ChainObservable;
+
+ }(Observable));
+
+ /*
+ * Performs a exclusive waiting for the first to finish before subscribing to another observable.
+ * Observables that come in between subscriptions will be dropped on the floor.
+ * @returns {Observable} A exclusive observable with only the results that happen when subscribed.
+ */
+ observableProto.exclusive = function () {
+ var sources = this;
+ return new AnonymousObservable(function (observer) {
+ var hasCurrent = false,
+ isStopped = false,
+ m = new SingleAssignmentDisposable(),
+ g = new CompositeDisposable();
+
+ g.add(m);
+
+ m.setDisposable(sources.subscribe(
+ function (innerSource) {
+ if (!hasCurrent) {
+ hasCurrent = true;
+
+ isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
+
+ var innerSubscription = new SingleAssignmentDisposable();
+ g.add(innerSubscription);
+
+ innerSubscription.setDisposable(innerSource.subscribe(
+ observer.onNext.bind(observer),
+ observer.onError.bind(observer),
+ function () {
+ g.remove(innerSubscription);
+ hasCurrent = false;
+ if (isStopped && g.length === 1) {
+ observer.onCompleted();
+ }
+ }));
+ }
+ },
+ observer.onError.bind(observer),
+ function () {
+ isStopped = true;
+ if (!hasCurrent && g.length === 1) {
+ observer.onCompleted();
+ }
+ }));
+
+ return g;
+ }, this);
+ };
+
+ /*
+ * Performs a exclusive map waiting for the first to finish before subscribing to another observable.
+ * Observables that come in between subscriptions will be dropped on the floor.
+ * @param {Function} selector Selector to invoke for every item in the current subscription.
+ * @param {Any} [thisArg] An optional context to invoke with the selector parameter.
+ * @returns {Observable} An exclusive observable with only the results that happen when subscribed.
+ */
+ observableProto.exclusiveMap = function (selector, thisArg) {
+ var sources = this,
+ selectorFunc = bindCallback(selector, thisArg, 3);
+ return new AnonymousObservable(function (observer) {
+ var index = 0,
+ hasCurrent = false,
+ isStopped = true,
+ m = new SingleAssignmentDisposable(),
+ g = new CompositeDisposable();
+
+ g.add(m);
+
+ m.setDisposable(sources.subscribe(
+ function (innerSource) {
+
+ if (!hasCurrent) {
+ hasCurrent = true;
+
+ innerSubscription = new SingleAssignmentDisposable();
+ g.add(innerSubscription);
+
+ isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
+
+ innerSubscription.setDisposable(innerSource.subscribe(
+ function (x) {
+ var result;
+ try {
+ result = selectorFunc(x, index++, innerSource);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+
+ observer.onNext(result);
+ },
+ function (e) { observer.onError(e); },
+ function () {
+ g.remove(innerSubscription);
+ hasCurrent = false;
+
+ if (isStopped && g.length === 1) {
+ observer.onCompleted();
+ }
+ }));
+ }
+ },
+ function (e) { observer.onError(e); },
+ function () {
+ isStopped = true;
+ if (g.length === 1 && !hasCurrent) {
+ observer.onCompleted();
+ }
+ }));
+ return g;
+ }, this);
+ };
+
+ return Rx;
+}));
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.experimental.map b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.experimental.map
new file mode 100644
index 00000000000..81132942038
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.experimental.map
@@ -0,0 +1 @@
+{"version":3,"file":"rx.experimental.min.js","sources":["rx.experimental.js"],"names":["factory","objectTypes","boolean","function","object","number","string","undefined","root","window","this","freeExports","exports","nodeType","freeModule","module","freeGlobal","global","define","amd","Rx","require","call","exp","enumerableWhile","condition","source","WhileEnumerable","Observable","observableProto","prototype","AnonymousObservable","observableConcat","concat","observableDefer","defer","observableEmpty","empty","disposableEmpty","Disposable","CompositeDisposable","SerialDisposable","SingleAssignmentDisposable","Enumerable","internals","Enumerator","enumerableOf","of","immediateScheduler","Scheduler","immediate","currentThreadScheduler","currentThread","AsyncSubject","Array","slice","Observer","inherits","bindCallback","addProperties","helpers","noop","isPromise","isScheduler","observableFromPromise","fromPromise","$iterator$","Symbol","iterator","Set","doneEnumerator","done","value","isIterable","o","isArrayLike","length","__super__","c","s","self","next","letBind","func","ifThen","thenSource","elseSourceOrScheduler","now","forIn","sources","resultSelector","thisArg","observableWhileDo","whileDo","doWhile","switchCase","selector","defaultSourceOrScheduler","result","expand","scheduler","observer","q","m","d","activeCount","isAcquired","ensureActive","isOwner","setDisposable","scheduleRecursive","work","shift","m1","add","subscribe","x","onNext","e","onError","push","bind","remove","onCompleted","forkJoin","allSources","isArray","arguments","i","len","subscriber","count","group","finished","hasResults","hasCompleted","results","idx","dispose","ix","second","first","lastLeft","lastRight","leftStopped","rightStopped","hasLeft","hasRight","leftSubscription","rightSubscription","left","err","right","manySelect","extend","chain","map","curr","ChainObservable","tap","observeOn","g","schedule","head","tail","mergeAll","throwError","v","exclusive","hasCurrent","isStopped","innerSource","innerSubscription","exclusiveMap","selectorFunc","index"],"mappings":";CAEE,SAAUA,GACR,GAAIC,IACAC,WAAW,EACXC,YAAY,EACZC,QAAU,EACVC,QAAU,EACVC,QAAU,EACVC,WAAa,GAGbC,EAAQP,QAAmBQ,UAAWA,QAAWC,KACjDC,EAAcV,QAAmBW,WAAYA,UAAYA,QAAQC,UAAYD,QAC7EE,EAAab,QAAmBc,UAAWA,SAAWA,OAAOF,UAAYE,OAEzEC,GADgBF,GAAcA,EAAWF,UAAYD,GAAeA,EACvDV,QAAmBgB,UAAWA,SAE3CD,GAAeA,EAAWC,SAAWD,GAAcA,EAAWP,SAAWO,IACzER,EAAOQ,GAIW,kBAAXE,SAAyBA,OAAOC,IACvCD,QAAQ,MAAO,SAAUE,EAAIR,GACzB,MAAOZ,GAAQQ,EAAMI,EAASQ,KAET,gBAAXL,SAAuBA,QAAUA,OAAOH,UAAYD,EAClEI,OAAOH,QAAUZ,EAAQQ,EAAMO,OAAOH,QAASS,QAAQ,SAEvDb,EAAKY,GAAKpB,EAAQQ,KAAUA,EAAKY,MAEvCE,KAAKZ,KAAM,SAAUF,E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KACEA,EAAS4E,EAAa1D,EAAG2D,IAASJ,GAClC,MAAOrD,GAEP,WADAjB,GAASkB,QAAQD,GAInBjB,EAASgB,OAAOnB,IAElB,SAAUoB,GAAKjB,EAASkB,QAAQD,IAChC,WACE2C,EAAEvC,OAAOkD,mBACTH,GAAa,EAETC,GAA0B,IAAbT,EAAErF,QACjByB,EAASsB,mBAKnB,SAAUL,GAAKjB,EAASkB,QAAQD,IAChC,WACEoD,GAAY,EACK,IAAbT,EAAErF,QAAiB6F,GACrBpE,EAASsB,iBAGRsC,GACNvJ,OAGIU"} \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.experimental.min.js b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.experimental.min.js
new file mode 100644
index 00000000000..09f17382890
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.experimental.min.js
@@ -0,0 +1,3 @@
+/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
+(function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx"],function(b,d){return a(c,d,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){function e(a,b){return new E(a,b)}var f=c.Observable,g=f.prototype,h=c.AnonymousObservable,i=f.concat,j=f.defer,k=f.empty,l=c.Disposable.empty,m=c.CompositeDisposable,n=c.SerialDisposable,o=c.SingleAssignmentDisposable,p=(c.internals.Enumerator,c.internals.Enumerable),q=p.of,r=c.Scheduler.immediate,s=c.Scheduler.currentThread,t=(Array.prototype.slice,c.AsyncSubject),u=c.Observer,v=c.internals.inherits,w=c.internals.bindCallback,x=c.internals.addProperties,y=c.helpers,z=y.noop,A=y.isPromise,B=c.Scheduler.isScheduler,C=f.fromPromise,D="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";a.Set&&"function"==typeof(new a.Set)["@@iterator"]&&(D="@@iterator");c.doneEnumerator={done:!0,value:d},c.helpers.isIterable=function(a){return a[D]!==d},c.helpers.isArrayLike=function(a){return a&&a.length!==d};c.helpers.iterator=D;var E=function(a){function b(a,b){this.c=a,this.s=b}return v(b,a),b.prototype[D]=function(){var a=this;return{next:function(){return a.c()?{done:!1,value:a.s}:{done:!0,value:void 0}}}},b}(p);g.letBind=g.let=function(a){return a(this)},f["if"]=f.ifThen=function(a,b,c){return j(function(){return c||(c=k()),A(b)&&(b=C(b)),A(c)&&(c=C(c)),"function"==typeof c.now&&(c=k(c)),a()?b:c})},f["for"]=f.forIn=function(a,b,c){return q(a,b,c).concat()};var F=f["while"]=f.whileDo=function(a,b){return A(b)&&(b=C(b)),e(a,b).concat()};g.doWhile=function(a){return i([this,F(a,this)])},f["case"]=f.switchCase=function(a,b,c){return j(function(){A(c)&&(c=C(c)),c||(c=k()),"function"==typeof c.now&&(c=k(c));var d=b[a()];return A(d)&&(d=C(d)),d||c})},g.expand=function(a,b){B(b)||(b=r);var c=this;return new h(function(d){var e=[],f=new n,g=new m(f),h=0,i=!1,j=function(){var c=!1;e.length>0&&(c=!i,i=!0),c&&f.setDisposable(b.scheduleRecursive(function(b){var c;if(!(e.length>0))return void(i=!1);c=e.shift();var f=new o;g.add(f),f.setDisposable(c.subscribe(function(b){d.onNext(b);var c=null;try{c=a(b)}catch(f){d.onError(f)}e.push(c),h++,j()},d.onError.bind(d),function(){g.remove(f),h--,0===h&&d.onCompleted()})),b()}))};return e.push(c),h++,j(),g},this)},f.forkJoin=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return new h(function(b){var c=a.length;if(0===c)return b.onCompleted(),l;for(var d=new m,e=!1,f=new Array(c),g=new Array(c),h=new Array(c),i=0;c>i;i++)!function(i){var j=a[i];A(j)&&(j=C(j)),d.add(j.subscribe(function(a){e||(f[i]=!0,h[i]=a)},function(a){e=!0,b.onError(a),d.dispose()},function(){if(!e){if(!f[i])return void b.onCompleted();g[i]=!0;for(var a=0;c>a;a++)if(!g[a])return;e=!0,b.onNext(h),b.onCompleted()}}))}(i);return d})},g.forkJoin=function(a,b){var c=this;return new h(function(d){var e,f,g=!1,h=!1,i=!1,j=!1,k=new o,l=new o;return A(a)&&(a=C(a)),k.setDisposable(c.subscribe(function(a){i=!0,e=a},function(a){l.dispose(),d.onError(a)},function(){if(g=!0,h)if(i)if(j){var a;try{a=b(e,f)}catch(c){return void d.onError(c)}d.onNext(a),d.onCompleted()}else d.onCompleted();else d.onCompleted()})),l.setDisposable(a.subscribe(function(a){j=!0,f=a},function(a){k.dispose(),d.onError(a)},function(){if(h=!0,g)if(i)if(j){var a;try{a=b(e,f)}catch(c){return void d.onError(c)}d.onNext(a),d.onCompleted()}else d.onCompleted();else d.onCompleted()})),new m(k,l)},c)},g.manySelect=g.extend=function(a,b){B(b)||(b=r);var c=this;return j(function(){var d;return c.map(function(a){var b=new G(a);return d&&d.onNext(a),d=b,b}).tap(z,function(a){d&&d.onError(a)},function(){d&&d.onCompleted()}).observeOn(b).map(a)},c)};var G=function(a){function b(a){var b=this,c=new m;return c.add(s.schedule(function(){a.onNext(b.head),c.add(b.tail.mergeAll().subscribe(a))})),c}function c(c){a.call(this,b),this.head=c,this.tail=new t}return v(c,a),x(c.prototype,u,{onCompleted:function(){this.onNext(f.empty())},onError:function(a){this.onNext(f.throwError(a))},onNext:function(a){this.tail.onNext(a),this.tail.onCompleted()}}),c}(f);return g.exclusive=function(){var a=this;return new h(function(b){var c=!1,d=!1,e=new o,f=new m;return f.add(e),e.setDisposable(a.subscribe(function(a){if(!c){c=!0,A(a)&&(a=C(a));var e=new o;f.add(e),e.setDisposable(a.subscribe(b.onNext.bind(b),b.onError.bind(b),function(){f.remove(e),c=!1,d&&1===f.length&&b.onCompleted()}))}},b.onError.bind(b),function(){d=!0,c||1!==f.length||b.onCompleted()})),f},this)},g.exclusiveMap=function(a,b){var c=this,d=w(a,b,3);return new h(function(a){var b=0,e=!1,f=!0,g=new o,h=new m;return h.add(g),g.setDisposable(c.subscribe(function(c){e||(e=!0,innerSubscription=new o,h.add(innerSubscription),A(c)&&(c=C(c)),innerSubscription.setDisposable(c.subscribe(function(e){var f;try{f=d(e,b++,c)}catch(g){return void a.onError(g)}a.onNext(f)},function(b){a.onError(b)},function(){h.remove(innerSubscription),e=!1,f&&1===h.length&&a.onCompleted()})))},function(b){a.onError(b)},function(){f=!0,1!==h.length||e||a.onCompleted()})),h},this)},c});
+//# sourceMappingURL=rx.experimental.map \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.joinpatterns.js b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.joinpatterns.js
new file mode 100644
index 00000000000..9f2574c57e6
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.joinpatterns.js
@@ -0,0 +1,313 @@
+// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
+
+;(function (factory) {
+ var objectTypes = {
+ 'boolean': false,
+ 'function': true,
+ 'object': true,
+ 'number': false,
+ 'string': false,
+ 'undefined': false
+ };
+
+ var root = (objectTypes[typeof window] && window) || this,
+ freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
+ freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
+ moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
+ freeGlobal = objectTypes[typeof global] && global;
+
+ if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) {
+ root = freeGlobal;
+ }
+
+ // Because of build optimizers
+ if (typeof define === 'function' && define.amd) {
+ define(['rx'], function (Rx, exports) {
+ return factory(root, exports, Rx);
+ });
+ } else if (typeof module === 'object' && module && module.exports === freeExports) {
+ module.exports = factory(root, module.exports, require('./rx'));
+ } else {
+ root.Rx = factory(root, {}, root.Rx);
+ }
+}.call(this, function (root, exp, Rx, undefined) {
+
+ // Aliases
+ var Observable = Rx.Observable,
+ observableProto = Observable.prototype,
+ AnonymousObservable = Rx.AnonymousObservable,
+ observableThrow = Observable.throwError,
+ observerCreate = Rx.Observer.create,
+ SingleAssignmentDisposable = Rx.SingleAssignmentDisposable,
+ CompositeDisposable = Rx.CompositeDisposable,
+ AbstractObserver = Rx.internals.AbstractObserver,
+ noop = Rx.helpers.noop,
+ defaultComparer = Rx.internals.isEqual,
+ inherits = Rx.internals.inherits,
+ Enumerable = Rx.internals.Enumerable,
+ Enumerator = Rx.internals.Enumerator,
+ $iterator$ = Rx.iterator,
+ doneEnumerator = Rx.doneEnumerator;
+
+ /** @private */
+ var Map = root.Map || (function () {
+
+ function Map() {
+ this._keys = [];
+ this._values = [];
+ }
+
+ Map.prototype.get = function (key) {
+ var i = this._keys.indexOf(key);
+ return i !== -1 ? this._values[i] : undefined;
+ };
+
+ Map.prototype.set = function (key, value) {
+ var i = this._keys.indexOf(key);
+ i !== -1 && (this._values[i] = value);
+ this._values[this._keys.push(key) - 1] = value;
+ };
+
+ Map.prototype.forEach = function (callback, thisArg) {
+ for (var i = 0, len = this._keys.length; i < len; i++) {
+ callback.call(thisArg, this._values[i], this._keys[i]);
+ }
+ };
+
+ return Map;
+ }());
+
+ /**
+ * @constructor
+ * Represents a join pattern over observable sequences.
+ */
+ function Pattern(patterns) {
+ this.patterns = patterns;
+ }
+
+ /**
+ * Creates a pattern that matches the current plan matches and when the specified observable sequences has an available value.
+ * @param other Observable sequence to match in addition to the current pattern.
+ * @return {Pattern} Pattern object that matches when all observable sequences in the pattern have an available value.
+ */
+ Pattern.prototype.and = function (other) {
+ return new Pattern(this.patterns.concat(other));
+ };
+
+ /**
+ * Matches when all observable sequences in the pattern (specified using a chain of and operators) have an available value and projects the values.
+ * @param {Function} selector Selector that will be invoked with available values from the source sequences, in the same order of the sequences in the pattern.
+ * @return {Plan} Plan that produces the projected values, to be fed (with other plans) to the when operator.
+ */
+ Pattern.prototype.thenDo = function (selector) {
+ return new Plan(this, selector);
+ };
+
+ function Plan(expression, selector) {
+ this.expression = expression;
+ this.selector = selector;
+ }
+
+ Plan.prototype.activate = function (externalSubscriptions, observer, deactivate) {
+ var self = this;
+ var joinObservers = [];
+ for (var i = 0, len = this.expression.patterns.length; i < len; i++) {
+ joinObservers.push(planCreateObserver(externalSubscriptions, this.expression.patterns[i], observer.onError.bind(observer)));
+ }
+ var activePlan = new ActivePlan(joinObservers, function () {
+ var result;
+ try {
+ result = self.selector.apply(self, arguments);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+ observer.onNext(result);
+ }, function () {
+ for (var j = 0, jlen = joinObservers.length; j < jlen; j++) {
+ joinObservers[j].removeActivePlan(activePlan);
+ }
+ deactivate(activePlan);
+ });
+ for (i = 0, len = joinObservers.length; i < len; i++) {
+ joinObservers[i].addActivePlan(activePlan);
+ }
+ return activePlan;
+ };
+
+ function planCreateObserver(externalSubscriptions, observable, onError) {
+ var entry = externalSubscriptions.get(observable);
+ if (!entry) {
+ var observer = new JoinObserver(observable, onError);
+ externalSubscriptions.set(observable, observer);
+ return observer;
+ }
+ return entry;
+ }
+
+ function ActivePlan(joinObserverArray, onNext, onCompleted) {
+ this.joinObserverArray = joinObserverArray;
+ this.onNext = onNext;
+ this.onCompleted = onCompleted;
+ this.joinObservers = new Map();
+ for (var i = 0, len = this.joinObserverArray.length; i < len; i++) {
+ var joinObserver = this.joinObserverArray[i];
+ this.joinObservers.set(joinObserver, joinObserver);
+ }
+ }
+
+ ActivePlan.prototype.dequeue = function () {
+ this.joinObservers.forEach(function (v) { v.queue.shift(); });
+ };
+
+ ActivePlan.prototype.match = function () {
+ var i, len, hasValues = true;
+ for (i = 0, len = this.joinObserverArray.length; i < len; i++) {
+ if (this.joinObserverArray[i].queue.length === 0) {
+ hasValues = false;
+ break;
+ }
+ }
+ if (hasValues) {
+ var firstValues = [],
+ isCompleted = false;
+ for (i = 0, len = this.joinObserverArray.length; i < len; i++) {
+ firstValues.push(this.joinObserverArray[i].queue[0]);
+ this.joinObserverArray[i].queue[0].kind === 'C' && (isCompleted = true);
+ }
+ if (isCompleted) {
+ this.onCompleted();
+ } else {
+ this.dequeue();
+ var values = [];
+ for (i = 0, len = firstValues.length; i < firstValues.length; i++) {
+ values.push(firstValues[i].value);
+ }
+ this.onNext.apply(this, values);
+ }
+ }
+ };
+
+ var JoinObserver = (function (__super__) {
+ inherits(JoinObserver, __super__);
+
+ function JoinObserver(source, onError) {
+ __super__.call(this);
+ this.source = source;
+ this.onError = onError;
+ this.queue = [];
+ this.activePlans = [];
+ this.subscription = new SingleAssignmentDisposable();
+ this.isDisposed = false;
+ }
+
+ var JoinObserverPrototype = JoinObserver.prototype;
+
+ JoinObserverPrototype.next = function (notification) {
+ if (!this.isDisposed) {
+ if (notification.kind === 'E') {
+ return this.onError(notification.exception);
+ }
+ this.queue.push(notification);
+ var activePlans = this.activePlans.slice(0);
+ for (var i = 0, len = activePlans.length; i < len; i++) {
+ activePlans[i].match();
+ }
+ }
+ };
+
+ JoinObserverPrototype.error = noop;
+ JoinObserverPrototype.completed = noop;
+
+ JoinObserverPrototype.addActivePlan = function (activePlan) {
+ this.activePlans.push(activePlan);
+ };
+
+ JoinObserverPrototype.subscribe = function () {
+ this.subscription.setDisposable(this.source.materialize().subscribe(this));
+ };
+
+ JoinObserverPrototype.removeActivePlan = function (activePlan) {
+ this.activePlans.splice(this.activePlans.indexOf(activePlan), 1);
+ this.activePlans.length === 0 && this.dispose();
+ };
+
+ JoinObserverPrototype.dispose = function () {
+ __super__.prototype.dispose.call(this);
+ if (!this.isDisposed) {
+ this.isDisposed = true;
+ this.subscription.dispose();
+ }
+ };
+
+ return JoinObserver;
+ } (AbstractObserver));
+
+ /**
+ * Creates a pattern that matches when both observable sequences have an available value.
+ *
+ * @param right Observable sequence to match with the current sequence.
+ * @return {Pattern} Pattern object that matches when both observable sequences have an available value.
+ */
+ observableProto.and = function (right) {
+ return new Pattern([this, right]);
+ };
+
+ /**
+ * Matches when the observable sequence has an available value and projects the value.
+ *
+ * @param {Function} selector Selector that will be invoked for values in the source sequence.
+ * @returns {Plan} Plan that produces the projected values, to be fed (with other plans) to the when operator.
+ */
+ observableProto.thenDo = function (selector) {
+ return new Pattern([this]).thenDo(selector);
+ };
+
+ /**
+ * Joins together the results from several patterns.
+ *
+ * @param plans A series of plans (specified as an Array of as a series of arguments) created by use of the Then operator on patterns.
+ * @returns {Observable} Observable sequence with the results form matching several patterns.
+ */
+ Observable.when = function () {
+ var len = arguments.length, plans;
+ if (Array.isArray(arguments[0])) {
+ plans = arguments[0];
+ } else {
+ plans = new Array(len);
+ for(var i = 0; i < len; i++) { plans[i] = arguments[i]; }
+ }
+ return new AnonymousObservable(function (o) {
+ var activePlans = [],
+ externalSubscriptions = new Map();
+ var outObserver = observerCreate(
+ function (x) { o.onNext(x); },
+ function (err) {
+ externalSubscriptions.forEach(function (v) { v.onError(err); });
+ o.onError(err);
+ },
+ function (x) { o.onCompleted(); }
+ );
+ try {
+ for (var i = 0, len = plans.length; i < len; i++) {
+ activePlans.push(plans[i].activate(externalSubscriptions, outObserver, function (activePlan) {
+ var idx = activePlans.indexOf(activePlan);
+ activePlans.splice(idx, 1);
+ activePlans.length === 0 && o.onCompleted();
+ }));
+ }
+ } catch (e) {
+ observableThrow(e).subscribe(o);
+ }
+ var group = new CompositeDisposable();
+ externalSubscriptions.forEach(function (joinObserver) {
+ joinObserver.subscribe();
+ group.add(joinObserver);
+ });
+
+ return group;
+ });
+ };
+
+ return Rx;
+}));
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.joinpatterns.map b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.joinpatterns.map
new file mode 100644
index 00000000000..3ca0517401f
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.joinpatterns.map
@@ -0,0 +1 @@
+{"version":3,"file":"rx.joinpatterns.min.js","sources":["rx.joinpatterns.js"],"names":["factory","objectTypes","boolean","function","object","number","string","undefined","root","window","this","freeExports","exports","nodeType","freeModule","module","freeGlobal","global","define","amd","Rx","require","call","exp","Pattern","patterns","Plan","expression","selector","planCreateObserver","externalSubscriptions","observable","onError","entry","get","observer","JoinObserver","set","ActivePlan","joinObserverArray","onNext","onCompleted","joinObservers","Map","i","len","length","joinObserver","Observable","observableProto","prototype","AnonymousObservable","observableThrow","throwError","observerCreate","Observer","create","SingleAssignmentDisposable","CompositeDisposable","AbstractObserver","internals","noop","helpers","inherits","isEqual","Enumerable","Enumerator","iterator","doneEnumerator","_keys","_values","key","indexOf","value","push","forEach","callback","thisArg","and","other","concat","thenDo","activate","deactivate","self","bind","activePlan","result","apply","arguments","e","j","jlen","removeActivePlan","addActivePlan","dequeue","v","queue","shift","match","hasValues","firstValues","isCompleted","kind","values","__super__","source","activePlans","subscription","isDisposed","JoinObserverPrototype","next","notification","exception","slice","error","completed","subscribe","setDisposable","materialize","splice","dispose","right","when","plans","Array","isArray","o","outObserver","x","err","idx","group","add"],"mappings":";CAEE,SAAUA,GACR,GAAIC,IACAC,WAAW,EACXC,YAAY,EACZC,QAAU,EACVC,QAAU,EACVC,QAAU,EACVC,WAAa,GAGbC,EAAQP,QAAmBQ,UAAWA,QAAWC,KACjDC,EAAcV,QAAmBW,WAAYA,UAAYA,QAAQC,UAAYD,QAC7EE,EAAab,QAAmBc,UAAWA,SAAWA,OAAOF,UAAYE,OAEzEC,GADgBF,GAAcA,EAAWF,UAAYD,GAAeA,EACvDV,QAAmBgB,UAAWA,SAE3CD,GAAeA,EAAWC,SAAWD,GAAcA,EAAWP,SAAWO,IACzER,EAAOQ,GAIW,kBAAXE,SAAyBA,OAAOC,IACvCD,QAAQ,MAAO,SAAUE,EAAIR,GACzB,MAAOZ,GAAQQ,EAAMI,E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UAAU7C,GAEtD,MAAO,IAAIO,GAAoB,SAAU4E,GACvC,GAAIpB,MACA7E,EAAwB,GAAIa,GAC5BqF,EAAc1E,EAChB,SAAU2E,GAAKF,EAAEvF,OAAOyF,IACxB,SAAUC,GACRpG,EAAsB6C,QAAQ,SAAUqB,GAAKA,EAAEhE,QAAQkG,KACvDH,EAAE/F,QAAQkG,IAEZ,SAAUD,GAAKF,EAAEtF,eAEnB,KACE,IAAK,GAAIG,GAAI,EAAGC,EAAM+E,EAAM9E,OAAYD,EAAJD,EAASA,IAC3C+D,EAAYjC,KAAKkD,EAAMhF,GAAGsC,SAASpD,EAAuBkG,EAAa,SAAU1C,GAC/E,GAAI6C,GAAMxB,EAAYnC,QAAQc,EAC9BqB,GAAYa,OAAOW,EAAK,GACD,IAAvBxB,EAAY7D,QAAgBiF,EAAEtF,iBAGlC,MAAOiD,GACPtC,EAAgBsC,GAAG2B,UAAUU,GAE/B,GAAIK,GAAQ,GAAI1E,EAMhB,OALA5B,GAAsB6C,QAAQ,SAAU5B,GACtCA,EAAasE,YACbe,EAAMC,IAAItF,KAGLqF,KAIFhH"} \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.joinpatterns.min.js b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.joinpatterns.min.js
new file mode 100644
index 00000000000..d8cf75f211a
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.joinpatterns.min.js
@@ -0,0 +1,3 @@
+/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
+(function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx"],function(b,d){return a(c,d,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){function e(a){this.patterns=a}function f(a,b){this.expression=a,this.selector=b}function g(a,b,c){var d=a.get(b);if(!d){var e=new t(b,c);return a.set(b,e),e}return d}function h(a,b,c){this.joinObserverArray=a,this.onNext=b,this.onCompleted=c,this.joinObservers=new s;for(var d=0,e=this.joinObserverArray.length;e>d;d++){var f=this.joinObserverArray[d];this.joinObservers.set(f,f)}}var i=c.Observable,j=i.prototype,k=c.AnonymousObservable,l=i.throwError,m=c.Observer.create,n=c.SingleAssignmentDisposable,o=c.CompositeDisposable,p=c.internals.AbstractObserver,q=c.helpers.noop,r=(c.internals.isEqual,c.internals.inherits),s=(c.internals.Enumerable,c.internals.Enumerator,c.iterator,c.doneEnumerator,a.Map||function(){function a(){this._keys=[],this._values=[]}return a.prototype.get=function(a){var b=this._keys.indexOf(a);return-1!==b?this._values[b]:d},a.prototype.set=function(a,b){var c=this._keys.indexOf(a);-1!==c&&(this._values[c]=b),this._values[this._keys.push(a)-1]=b},a.prototype.forEach=function(a,b){for(var c=0,d=this._keys.length;d>c;c++)a.call(b,this._values[c],this._keys[c])},a}());e.prototype.and=function(a){return new e(this.patterns.concat(a))},e.prototype.thenDo=function(a){return new f(this,a)},f.prototype.activate=function(a,b,c){for(var d=this,e=[],f=0,i=this.expression.patterns.length;i>f;f++)e.push(g(a,this.expression.patterns[f],b.onError.bind(b)));var j=new h(e,function(){var a;try{a=d.selector.apply(d,arguments)}catch(c){return void b.onError(c)}b.onNext(a)},function(){for(var a=0,b=e.length;b>a;a++)e[a].removeActivePlan(j);c(j)});for(f=0,i=e.length;i>f;f++)e[f].addActivePlan(j);return j},h.prototype.dequeue=function(){this.joinObservers.forEach(function(a){a.queue.shift()})},h.prototype.match=function(){var a,b,c=!0;for(a=0,b=this.joinObserverArray.length;b>a;a++)if(0===this.joinObserverArray[a].queue.length){c=!1;break}if(c){var d=[],e=!1;for(a=0,b=this.joinObserverArray.length;b>a;a++)d.push(this.joinObserverArray[a].queue[0]),"C"===this.joinObserverArray[a].queue[0].kind&&(e=!0);if(e)this.onCompleted();else{this.dequeue();var f=[];for(a=0,b=d.length;a<d.length;a++)f.push(d[a].value);this.onNext.apply(this,f)}}};var t=function(a){function b(b,c){a.call(this),this.source=b,this.onError=c,this.queue=[],this.activePlans=[],this.subscription=new n,this.isDisposed=!1}r(b,a);var c=b.prototype;return c.next=function(a){if(!this.isDisposed){if("E"===a.kind)return this.onError(a.exception);this.queue.push(a);for(var b=this.activePlans.slice(0),c=0,d=b.length;d>c;c++)b[c].match()}},c.error=q,c.completed=q,c.addActivePlan=function(a){this.activePlans.push(a)},c.subscribe=function(){this.subscription.setDisposable(this.source.materialize().subscribe(this))},c.removeActivePlan=function(a){this.activePlans.splice(this.activePlans.indexOf(a),1),0===this.activePlans.length&&this.dispose()},c.dispose=function(){a.prototype.dispose.call(this),this.isDisposed||(this.isDisposed=!0,this.subscription.dispose())},b}(p);return j.and=function(a){return new e([this,a])},j.thenDo=function(a){return new e([this]).thenDo(a)},i.when=function(){var a,b=arguments.length;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new k(function(b){var c=[],d=new s,e=m(function(a){b.onNext(a)},function(a){d.forEach(function(b){b.onError(a)}),b.onError(a)},function(a){b.onCompleted()});try{for(var f=0,g=a.length;g>f;f++)c.push(a[f].activate(d,e,function(a){var d=c.indexOf(a);c.splice(d,1),0===c.length&&b.onCompleted()}))}catch(h){l(h).subscribe(b)}var i=new o;return d.forEach(function(a){a.subscribe(),i.add(a)}),i})},c});
+//# sourceMappingURL=rx.joinpatterns.map \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.js b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.js
new file mode 100644
index 00000000000..c8746ae4365
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.js
@@ -0,0 +1,5587 @@
+// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
+
+;(function (undefined) {
+
+ var objectTypes = {
+ 'boolean': false,
+ 'function': true,
+ 'object': true,
+ 'number': false,
+ 'string': false,
+ 'undefined': false
+ };
+
+ var root = (objectTypes[typeof window] && window) || this,
+ freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
+ freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
+ moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
+ freeGlobal = objectTypes[typeof global] && global;
+
+ if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) {
+ root = freeGlobal;
+ }
+
+ var Rx = {
+ internals: {},
+ config: {
+ Promise: root.Promise
+ },
+ helpers: { }
+ };
+
+ // Defaults
+ var noop = Rx.helpers.noop = function () { },
+ notDefined = Rx.helpers.notDefined = function (x) { return typeof x === 'undefined'; },
+ identity = Rx.helpers.identity = function (x) { return x; },
+ pluck = Rx.helpers.pluck = function (property) { return function (x) { return x[property]; }; },
+ just = Rx.helpers.just = function (value) { return function () { return value; }; },
+ defaultNow = Rx.helpers.defaultNow = Date.now,
+ defaultComparer = Rx.helpers.defaultComparer = function (x, y) { return isEqual(x, y); },
+ defaultSubComparer = Rx.helpers.defaultSubComparer = function (x, y) { return x > y ? 1 : (x < y ? -1 : 0); },
+ defaultKeySerializer = Rx.helpers.defaultKeySerializer = function (x) { return x.toString(); },
+ defaultError = Rx.helpers.defaultError = function (err) { throw err; },
+ isPromise = Rx.helpers.isPromise = function (p) { return !!p && typeof p.subscribe !== 'function' && typeof p.then === 'function'; },
+ asArray = Rx.helpers.asArray = function () { return Array.prototype.slice.call(arguments); },
+ not = Rx.helpers.not = function (a) { return !a; },
+ isFunction = Rx.helpers.isFunction = (function () {
+
+ var isFn = function (value) {
+ return typeof value == 'function' || false;
+ }
+
+ // fallback for older versions of Chrome and Safari
+ if (isFn(/x/)) {
+ isFn = function(value) {
+ return typeof value == 'function' && toString.call(value) == '[object Function]';
+ };
+ }
+
+ return isFn;
+ }());
+
+ function cloneArray(arr) { for(var a = [], i = 0, len = arr.length; i < len; i++) { a.push(arr[i]); } return a;}
+
+ Rx.config.longStackSupport = false;
+ var hasStacks = false;
+ try {
+ throw new Error();
+ } catch (e) {
+ hasStacks = !!e.stack;
+ }
+
+ // All code after this point will be filtered from stack traces reported by RxJS
+ var rStartingLine = captureLine(), rFileName;
+
+ var STACK_JUMP_SEPARATOR = "From previous event:";
+
+ function makeStackTraceLong(error, observable) {
+ // If possible, transform the error stack trace by removing Node and RxJS
+ // cruft, then concatenating with the stack trace of `observable`.
+ if (hasStacks &&
+ observable.stack &&
+ typeof error === "object" &&
+ error !== null &&
+ error.stack &&
+ error.stack.indexOf(STACK_JUMP_SEPARATOR) === -1
+ ) {
+ var stacks = [];
+ for (var o = observable; !!o; o = o.source) {
+ if (o.stack) {
+ stacks.unshift(o.stack);
+ }
+ }
+ stacks.unshift(error.stack);
+
+ var concatedStacks = stacks.join("\n" + STACK_JUMP_SEPARATOR + "\n");
+ error.stack = filterStackString(concatedStacks);
+ }
+ }
+
+ function filterStackString(stackString) {
+ var lines = stackString.split("\n"),
+ desiredLines = [];
+ for (var i = 0, len = lines.length; i < len; i++) {
+ var line = lines[i];
+
+ if (!isInternalFrame(line) && !isNodeFrame(line) && line) {
+ desiredLines.push(line);
+ }
+ }
+ return desiredLines.join("\n");
+ }
+
+ function isInternalFrame(stackLine) {
+ var fileNameAndLineNumber = getFileNameAndLineNumber(stackLine);
+ if (!fileNameAndLineNumber) {
+ return false;
+ }
+ var fileName = fileNameAndLineNumber[0], lineNumber = fileNameAndLineNumber[1];
+
+ return fileName === rFileName &&
+ lineNumber >= rStartingLine &&
+ lineNumber <= rEndingLine;
+ }
+
+ function isNodeFrame(stackLine) {
+ return stackLine.indexOf("(module.js:") !== -1 ||
+ stackLine.indexOf("(node.js:") !== -1;
+ }
+
+ function captureLine() {
+ if (!hasStacks) { return; }
+
+ try {
+ throw new Error();
+ } catch (e) {
+ var lines = e.stack.split("\n");
+ var firstLine = lines[0].indexOf("@") > 0 ? lines[1] : lines[2];
+ var fileNameAndLineNumber = getFileNameAndLineNumber(firstLine);
+ if (!fileNameAndLineNumber) { return; }
+
+ rFileName = fileNameAndLineNumber[0];
+ return fileNameAndLineNumber[1];
+ }
+ }
+
+ function getFileNameAndLineNumber(stackLine) {
+ // Named functions: "at functionName (filename:lineNumber:columnNumber)"
+ var attempt1 = /at .+ \((.+):(\d+):(?:\d+)\)$/.exec(stackLine);
+ if (attempt1) { return [attempt1[1], Number(attempt1[2])]; }
+
+ // Anonymous functions: "at filename:lineNumber:columnNumber"
+ var attempt2 = /at ([^ ]+):(\d+):(?:\d+)$/.exec(stackLine);
+ if (attempt2) { return [attempt2[1], Number(attempt2[2])]; }
+
+ // Firefox style: "function@filename:lineNumber or @filename:lineNumber"
+ var attempt3 = /.*@(.+):(\d+)$/.exec(stackLine);
+ if (attempt3) { return [attempt3[1], Number(attempt3[2])]; }
+ }
+
+ var EmptyError = Rx.EmptyError = function() {
+ this.message = 'Sequence contains no elements.';
+ Error.call(this);
+ };
+ EmptyError.prototype = Error.prototype;
+
+ var ObjectDisposedError = Rx.ObjectDisposedError = function() {
+ this.message = 'Object has been disposed';
+ Error.call(this);
+ };
+ ObjectDisposedError.prototype = Error.prototype;
+
+ var ArgumentOutOfRangeError = Rx.ArgumentOutOfRangeError = function () {
+ this.message = 'Argument out of range';
+ Error.call(this);
+ };
+ ArgumentOutOfRangeError.prototype = Error.prototype;
+
+ var NotSupportedError = Rx.NotSupportedError = function (message) {
+ this.message = message || 'This operation is not supported';
+ Error.call(this);
+ };
+ NotSupportedError.prototype = Error.prototype;
+
+ var NotImplementedError = Rx.NotImplementedError = function (message) {
+ this.message = message || 'This operation is not implemented';
+ Error.call(this);
+ };
+ NotImplementedError.prototype = Error.prototype;
+
+ var notImplemented = Rx.helpers.notImplemented = function () {
+ throw new NotImplementedError();
+ };
+
+ var notSupported = Rx.helpers.notSupported = function () {
+ throw new NotSupportedError();
+ };
+
+ // Shim in iterator support
+ var $iterator$ = (typeof Symbol === 'function' && Symbol.iterator) ||
+ '_es6shim_iterator_';
+ // Bug for mozilla version
+ if (root.Set && typeof new root.Set()['@@iterator'] === 'function') {
+ $iterator$ = '@@iterator';
+ }
+
+ var doneEnumerator = Rx.doneEnumerator = { done: true, value: undefined };
+
+ var isIterable = Rx.helpers.isIterable = function (o) {
+ return o[$iterator$] !== undefined;
+ }
+
+ var isArrayLike = Rx.helpers.isArrayLike = function (o) {
+ return o && o.length !== undefined;
+ }
+
+ Rx.helpers.iterator = $iterator$;
+
+ var bindCallback = Rx.internals.bindCallback = function (func, thisArg, argCount) {
+ if (typeof thisArg === 'undefined') { return func; }
+ switch(argCount) {
+ case 0:
+ return function() {
+ return func.call(thisArg)
+ };
+ case 1:
+ return function(arg) {
+ return func.call(thisArg, arg);
+ }
+ case 2:
+ return function(value, index) {
+ return func.call(thisArg, value, index);
+ };
+ case 3:
+ return function(value, index, collection) {
+ return func.call(thisArg, value, index, collection);
+ };
+ }
+
+ return function() {
+ return func.apply(thisArg, arguments);
+ };
+ };
+
+ /** Used to determine if values are of the language type Object */
+ var dontEnums = ['toString',
+ 'toLocaleString',
+ 'valueOf',
+ 'hasOwnProperty',
+ 'isPrototypeOf',
+ 'propertyIsEnumerable',
+ 'constructor'],
+ dontEnumsLength = dontEnums.length;
+
+ /** `Object#toString` result shortcuts */
+ var argsClass = '[object Arguments]',
+ arrayClass = '[object Array]',
+ boolClass = '[object Boolean]',
+ dateClass = '[object Date]',
+ errorClass = '[object Error]',
+ funcClass = '[object Function]',
+ numberClass = '[object Number]',
+ objectClass = '[object Object]',
+ regexpClass = '[object RegExp]',
+ stringClass = '[object String]';
+
+ var toString = Object.prototype.toString,
+ hasOwnProperty = Object.prototype.hasOwnProperty,
+ supportsArgsClass = toString.call(arguments) == argsClass, // For less <IE9 && FF<4
+ supportNodeClass,
+ errorProto = Error.prototype,
+ objectProto = Object.prototype,
+ stringProto = String.prototype,
+ propertyIsEnumerable = objectProto.propertyIsEnumerable;
+
+ try {
+ supportNodeClass = !(toString.call(document) == objectClass && !({ 'toString': 0 } + ''));
+ } catch (e) {
+ supportNodeClass = true;
+ }
+
+ var nonEnumProps = {};
+ nonEnumProps[arrayClass] = nonEnumProps[dateClass] = nonEnumProps[numberClass] = { 'constructor': true, 'toLocaleString': true, 'toString': true, 'valueOf': true };
+ nonEnumProps[boolClass] = nonEnumProps[stringClass] = { 'constructor': true, 'toString': true, 'valueOf': true };
+ nonEnumProps[errorClass] = nonEnumProps[funcClass] = nonEnumProps[regexpClass] = { 'constructor': true, 'toString': true };
+ nonEnumProps[objectClass] = { 'constructor': true };
+
+ var support = {};
+ (function () {
+ var ctor = function() { this.x = 1; },
+ props = [];
+
+ ctor.prototype = { 'valueOf': 1, 'y': 1 };
+ for (var key in new ctor) { props.push(key); }
+ for (key in arguments) { }
+
+ // Detect if `name` or `message` properties of `Error.prototype` are enumerable by default.
+ support.enumErrorProps = propertyIsEnumerable.call(errorProto, 'message') || propertyIsEnumerable.call(errorProto, 'name');
+
+ // Detect if `prototype` properties are enumerable by default.
+ support.enumPrototypes = propertyIsEnumerable.call(ctor, 'prototype');
+
+ // Detect if `arguments` object indexes are non-enumerable
+ support.nonEnumArgs = key != 0;
+
+ // Detect if properties shadowing those on `Object.prototype` are non-enumerable.
+ support.nonEnumShadows = !/valueOf/.test(props);
+ }(1));
+
+ var isObject = Rx.internals.isObject = function(value) {
+ var type = typeof value;
+ return value && (type == 'function' || type == 'object') || false;
+ };
+
+ function keysIn(object) {
+ var result = [];
+ if (!isObject(object)) {
+ return result;
+ }
+ if (support.nonEnumArgs && object.length && isArguments(object)) {
+ object = slice.call(object);
+ }
+ var skipProto = support.enumPrototypes && typeof object == 'function',
+ skipErrorProps = support.enumErrorProps && (object === errorProto || object instanceof Error);
+
+ for (var key in object) {
+ if (!(skipProto && key == 'prototype') &&
+ !(skipErrorProps && (key == 'message' || key == 'name'))) {
+ result.push(key);
+ }
+ }
+
+ if (support.nonEnumShadows && object !== objectProto) {
+ var ctor = object.constructor,
+ index = -1,
+ length = dontEnumsLength;
+
+ if (object === (ctor && ctor.prototype)) {
+ var className = object === stringProto ? stringClass : object === errorProto ? errorClass : toString.call(object),
+ nonEnum = nonEnumProps[className];
+ }
+ while (++index < length) {
+ key = dontEnums[index];
+ if (!(nonEnum && nonEnum[key]) && hasOwnProperty.call(object, key)) {
+ result.push(key);
+ }
+ }
+ }
+ return result;
+ }
+
+ function internalFor(object, callback, keysFunc) {
+ var index = -1,
+ props = keysFunc(object),
+ length = props.length;
+
+ while (++index < length) {
+ var key = props[index];
+ if (callback(object[key], key, object) === false) {
+ break;
+ }
+ }
+ return object;
+ }
+
+ function internalForIn(object, callback) {
+ return internalFor(object, callback, keysIn);
+ }
+
+ function isNode(value) {
+ // IE < 9 presents DOM nodes as `Object` objects except they have `toString`
+ // methods that are `typeof` "string" and still can coerce nodes to strings
+ return typeof value.toString != 'function' && typeof (value + '') == 'string';
+ }
+
+ var isArguments = function(value) {
+ return (value && typeof value == 'object') ? toString.call(value) == argsClass : false;
+ }
+
+ // fallback for browsers that can't detect `arguments` objects by [[Class]]
+ if (!supportsArgsClass) {
+ isArguments = function(value) {
+ return (value && typeof value == 'object') ? hasOwnProperty.call(value, 'callee') : false;
+ };
+ }
+
+ var isEqual = Rx.internals.isEqual = function (x, y) {
+ return deepEquals(x, y, [], []);
+ };
+
+ /** @private
+ * Used for deep comparison
+ **/
+ function deepEquals(a, b, stackA, stackB) {
+ // exit early for identical values
+ if (a === b) {
+ // treat `+0` vs. `-0` as not equal
+ return a !== 0 || (1 / a == 1 / b);
+ }
+
+ var type = typeof a,
+ otherType = typeof b;
+
+ // exit early for unlike primitive values
+ if (a === a && (a == null || b == null ||
+ (type != 'function' && type != 'object' && otherType != 'function' && otherType != 'object'))) {
+ return false;
+ }
+
+ // compare [[Class]] names
+ var className = toString.call(a),
+ otherClass = toString.call(b);
+
+ if (className == argsClass) {
+ className = objectClass;
+ }
+ if (otherClass == argsClass) {
+ otherClass = objectClass;
+ }
+ if (className != otherClass) {
+ return false;
+ }
+ switch (className) {
+ case boolClass:
+ case dateClass:
+ // coerce dates and booleans to numbers, dates to milliseconds and booleans
+ // to `1` or `0` treating invalid dates coerced to `NaN` as not equal
+ return +a == +b;
+
+ case numberClass:
+ // treat `NaN` vs. `NaN` as equal
+ return (a != +a) ?
+ b != +b :
+ // but treat `-0` vs. `+0` as not equal
+ (a == 0 ? (1 / a == 1 / b) : a == +b);
+
+ case regexpClass:
+ case stringClass:
+ // coerce regexes to strings (http://es5.github.io/#x15.10.6.4)
+ // treat string primitives and their corresponding object instances as equal
+ return a == String(b);
+ }
+ var isArr = className == arrayClass;
+ if (!isArr) {
+
+ // exit for functions and DOM nodes
+ if (className != objectClass || (!support.nodeClass && (isNode(a) || isNode(b)))) {
+ return false;
+ }
+ // in older versions of Opera, `arguments` objects have `Array` constructors
+ var ctorA = !support.argsObject && isArguments(a) ? Object : a.constructor,
+ ctorB = !support.argsObject && isArguments(b) ? Object : b.constructor;
+
+ // non `Object` object instances with different constructors are not equal
+ if (ctorA != ctorB &&
+ !(hasOwnProperty.call(a, 'constructor') && hasOwnProperty.call(b, 'constructor')) &&
+ !(isFunction(ctorA) && ctorA instanceof ctorA && isFunction(ctorB) && ctorB instanceof ctorB) &&
+ ('constructor' in a && 'constructor' in b)
+ ) {
+ return false;
+ }
+ }
+ // assume cyclic structures are equal
+ // the algorithm for detecting cyclic structures is adapted from ES 5.1
+ // section 15.12.3, abstract operation `JO` (http://es5.github.io/#x15.12.3)
+ var initedStack = !stackA;
+ stackA || (stackA = []);
+ stackB || (stackB = []);
+
+ var length = stackA.length;
+ while (length--) {
+ if (stackA[length] == a) {
+ return stackB[length] == b;
+ }
+ }
+ var size = 0;
+ var result = true;
+
+ // add `a` and `b` to the stack of traversed objects
+ stackA.push(a);
+ stackB.push(b);
+
+ // recursively compare objects and arrays (susceptible to call stack limits)
+ if (isArr) {
+ // compare lengths to determine if a deep comparison is necessary
+ length = a.length;
+ size = b.length;
+ result = size == length;
+
+ if (result) {
+ // deep compare the contents, ignoring non-numeric properties
+ while (size--) {
+ var index = length,
+ value = b[size];
+
+ if (!(result = deepEquals(a[size], value, stackA, stackB))) {
+ break;
+ }
+ }
+ }
+ }
+ else {
+ // deep compare objects using `forIn`, instead of `forOwn`, to avoid `Object.keys`
+ // which, in this case, is more costly
+ internalForIn(b, function(value, key, b) {
+ if (hasOwnProperty.call(b, key)) {
+ // count the number of properties.
+ size++;
+ // deep compare each property value.
+ return (result = hasOwnProperty.call(a, key) && deepEquals(a[key], value, stackA, stackB));
+ }
+ });
+
+ if (result) {
+ // ensure both objects have the same number of properties
+ internalForIn(a, function(value, key, a) {
+ if (hasOwnProperty.call(a, key)) {
+ // `size` will be `-1` if `a` has more properties than `b`
+ return (result = --size > -1);
+ }
+ });
+ }
+ }
+ stackA.pop();
+ stackB.pop();
+
+ return result;
+ }
+
+ var hasProp = {}.hasOwnProperty,
+ slice = Array.prototype.slice;
+
+ var inherits = this.inherits = Rx.internals.inherits = function (child, parent) {
+ function __() { this.constructor = child; }
+ __.prototype = parent.prototype;
+ child.prototype = new __();
+ };
+
+ var addProperties = Rx.internals.addProperties = function (obj) {
+ for(var sources = [], i = 1, len = arguments.length; i < len; i++) { sources.push(arguments[i]); }
+ for (var idx = 0, ln = sources.length; idx < ln; idx++) {
+ var source = sources[idx];
+ for (var prop in source) {
+ obj[prop] = source[prop];
+ }
+ }
+ };
+
+ // Rx Utils
+ var addRef = Rx.internals.addRef = function (xs, r) {
+ return new AnonymousObservable(function (observer) {
+ return new CompositeDisposable(r.getDisposable(), xs.subscribe(observer));
+ });
+ };
+
+ function arrayInitialize(count, factory) {
+ var a = new Array(count);
+ for (var i = 0; i < count; i++) {
+ a[i] = factory();
+ }
+ return a;
+ }
+
+ var errorObj = {e: {}};
+ var tryCatchTarget;
+ function tryCatcher() {
+ try {
+ return tryCatchTarget.apply(this, arguments);
+ } catch (e) {
+ errorObj.e = e;
+ return errorObj;
+ }
+ }
+ function tryCatch(fn) {
+ if (!isFunction(fn)) { throw new TypeError('fn must be a function'); }
+ tryCatchTarget = fn;
+ return tryCatcher;
+ }
+ function thrower(e) {
+ throw e;
+ }
+
+ // Collections
+ function IndexedItem(id, value) {
+ this.id = id;
+ this.value = value;
+ }
+
+ IndexedItem.prototype.compareTo = function (other) {
+ var c = this.value.compareTo(other.value);
+ c === 0 && (c = this.id - other.id);
+ return c;
+ };
+
+ // Priority Queue for Scheduling
+ var PriorityQueue = Rx.internals.PriorityQueue = function (capacity) {
+ this.items = new Array(capacity);
+ this.length = 0;
+ };
+
+ var priorityProto = PriorityQueue.prototype;
+ priorityProto.isHigherPriority = function (left, right) {
+ return this.items[left].compareTo(this.items[right]) < 0;
+ };
+
+ priorityProto.percolate = function (index) {
+ if (index >= this.length || index < 0) { return; }
+ var parent = index - 1 >> 1;
+ if (parent < 0 || parent === index) { return; }
+ if (this.isHigherPriority(index, parent)) {
+ var temp = this.items[index];
+ this.items[index] = this.items[parent];
+ this.items[parent] = temp;
+ this.percolate(parent);
+ }
+ };
+
+ priorityProto.heapify = function (index) {
+ +index || (index = 0);
+ if (index >= this.length || index < 0) { return; }
+ var left = 2 * index + 1,
+ right = 2 * index + 2,
+ first = index;
+ if (left < this.length && this.isHigherPriority(left, first)) {
+ first = left;
+ }
+ if (right < this.length && this.isHigherPriority(right, first)) {
+ first = right;
+ }
+ if (first !== index) {
+ var temp = this.items[index];
+ this.items[index] = this.items[first];
+ this.items[first] = temp;
+ this.heapify(first);
+ }
+ };
+
+ priorityProto.peek = function () { return this.items[0].value; };
+
+ priorityProto.removeAt = function (index) {
+ this.items[index] = this.items[--this.length];
+ this.items[this.length] = undefined;
+ this.heapify();
+ };
+
+ priorityProto.dequeue = function () {
+ var result = this.peek();
+ this.removeAt(0);
+ return result;
+ };
+
+ priorityProto.enqueue = function (item) {
+ var index = this.length++;
+ this.items[index] = new IndexedItem(PriorityQueue.count++, item);
+ this.percolate(index);
+ };
+
+ priorityProto.remove = function (item) {
+ for (var i = 0; i < this.length; i++) {
+ if (this.items[i].value === item) {
+ this.removeAt(i);
+ return true;
+ }
+ }
+ return false;
+ };
+ PriorityQueue.count = 0;
+
+ /**
+ * Represents a group of disposable resources that are disposed together.
+ * @constructor
+ */
+ var CompositeDisposable = Rx.CompositeDisposable = function () {
+ var args = [], i, len;
+ if (Array.isArray(arguments[0])) {
+ args = arguments[0];
+ len = args.length;
+ } else {
+ len = arguments.length;
+ args = new Array(len);
+ for(i = 0; i < len; i++) { args[i] = arguments[i]; }
+ }
+ for(i = 0; i < len; i++) {
+ if (!isDisposable(args[i])) { throw new TypeError('Not a disposable'); }
+ }
+ this.disposables = args;
+ this.isDisposed = false;
+ this.length = args.length;
+ };
+
+ var CompositeDisposablePrototype = CompositeDisposable.prototype;
+
+ /**
+ * Adds a disposable to the CompositeDisposable or disposes the disposable if the CompositeDisposable is disposed.
+ * @param {Mixed} item Disposable to add.
+ */
+ CompositeDisposablePrototype.add = function (item) {
+ if (this.isDisposed) {
+ item.dispose();
+ } else {
+ this.disposables.push(item);
+ this.length++;
+ }
+ };
+
+ /**
+ * Removes and disposes the first occurrence of a disposable from the CompositeDisposable.
+ * @param {Mixed} item Disposable to remove.
+ * @returns {Boolean} true if found; false otherwise.
+ */
+ CompositeDisposablePrototype.remove = function (item) {
+ var shouldDispose = false;
+ if (!this.isDisposed) {
+ var idx = this.disposables.indexOf(item);
+ if (idx !== -1) {
+ shouldDispose = true;
+ this.disposables.splice(idx, 1);
+ this.length--;
+ item.dispose();
+ }
+ }
+ return shouldDispose;
+ };
+
+ /**
+ * Disposes all disposables in the group and removes them from the group.
+ */
+ CompositeDisposablePrototype.dispose = function () {
+ if (!this.isDisposed) {
+ this.isDisposed = true;
+ var len = this.disposables.length, currentDisposables = new Array(len);
+ for(var i = 0; i < len; i++) { currentDisposables[i] = this.disposables[i]; }
+ this.disposables = [];
+ this.length = 0;
+
+ for (i = 0; i < len; i++) {
+ currentDisposables[i].dispose();
+ }
+ }
+ };
+
+ /**
+ * Provides a set of static methods for creating Disposables.
+ * @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once.
+ */
+ var Disposable = Rx.Disposable = function (action) {
+ this.isDisposed = false;
+ this.action = action || noop;
+ };
+
+ /** Performs the task of cleaning up resources. */
+ Disposable.prototype.dispose = function () {
+ if (!this.isDisposed) {
+ this.action();
+ this.isDisposed = true;
+ }
+ };
+
+ /**
+ * Creates a disposable object that invokes the specified action when disposed.
+ * @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once.
+ * @return {Disposable} The disposable object that runs the given action upon disposal.
+ */
+ var disposableCreate = Disposable.create = function (action) { return new Disposable(action); };
+
+ /**
+ * Gets the disposable that does nothing when disposed.
+ */
+ var disposableEmpty = Disposable.empty = { dispose: noop };
+
+ /**
+ * Validates whether the given object is a disposable
+ * @param {Object} Object to test whether it has a dispose method
+ * @returns {Boolean} true if a disposable object, else false.
+ */
+ var isDisposable = Disposable.isDisposable = function (d) {
+ return d && isFunction(d.dispose);
+ };
+
+ var checkDisposed = Disposable.checkDisposed = function (disposable) {
+ if (disposable.isDisposed) { throw new ObjectDisposedError(); }
+ };
+
+ // Single assignment
+ var SingleAssignmentDisposable = Rx.SingleAssignmentDisposable = function () {
+ this.isDisposed = false;
+ this.current = null;
+ };
+ SingleAssignmentDisposable.prototype.getDisposable = function () {
+ return this.current;
+ };
+ SingleAssignmentDisposable.prototype.setDisposable = function (value) {
+ if (this.current) { throw new Error('Disposable has already been assigned'); }
+ var shouldDispose = this.isDisposed;
+ !shouldDispose && (this.current = value);
+ shouldDispose && value && value.dispose();
+ };
+ SingleAssignmentDisposable.prototype.dispose = function () {
+ if (!this.isDisposed) {
+ this.isDisposed = true;
+ var old = this.current;
+ this.current = null;
+ }
+ old && old.dispose();
+ };
+
+ // Multiple assignment disposable
+ var SerialDisposable = Rx.SerialDisposable = function () {
+ this.isDisposed = false;
+ this.current = null;
+ };
+ SerialDisposable.prototype.getDisposable = function () {
+ return this.current;
+ };
+ SerialDisposable.prototype.setDisposable = function (value) {
+ var shouldDispose = this.isDisposed;
+ if (!shouldDispose) {
+ var old = this.current;
+ this.current = value;
+ }
+ old && old.dispose();
+ shouldDispose && value && value.dispose();
+ };
+ SerialDisposable.prototype.dispose = function () {
+ if (!this.isDisposed) {
+ this.isDisposed = true;
+ var old = this.current;
+ this.current = null;
+ }
+ old && old.dispose();
+ };
+
+ /**
+ * Represents a disposable resource that only disposes its underlying disposable resource when all dependent disposable objects have been disposed.
+ */
+ var RefCountDisposable = Rx.RefCountDisposable = (function () {
+
+ function InnerDisposable(disposable) {
+ this.disposable = disposable;
+ this.disposable.count++;
+ this.isInnerDisposed = false;
+ }
+
+ InnerDisposable.prototype.dispose = function () {
+ if (!this.disposable.isDisposed && !this.isInnerDisposed) {
+ this.isInnerDisposed = true;
+ this.disposable.count--;
+ if (this.disposable.count === 0 && this.disposable.isPrimaryDisposed) {
+ this.disposable.isDisposed = true;
+ this.disposable.underlyingDisposable.dispose();
+ }
+ }
+ };
+
+ /**
+ * Initializes a new instance of the RefCountDisposable with the specified disposable.
+ * @constructor
+ * @param {Disposable} disposable Underlying disposable.
+ */
+ function RefCountDisposable(disposable) {
+ this.underlyingDisposable = disposable;
+ this.isDisposed = false;
+ this.isPrimaryDisposed = false;
+ this.count = 0;
+ }
+
+ /**
+ * Disposes the underlying disposable only when all dependent disposables have been disposed
+ */
+ RefCountDisposable.prototype.dispose = function () {
+ if (!this.isDisposed && !this.isPrimaryDisposed) {
+ this.isPrimaryDisposed = true;
+ if (this.count === 0) {
+ this.isDisposed = true;
+ this.underlyingDisposable.dispose();
+ }
+ }
+ };
+
+ /**
+ * Returns a dependent disposable that when disposed decreases the refcount on the underlying disposable.
+ * @returns {Disposable} A dependent disposable contributing to the reference count that manages the underlying disposable's lifetime.
+ */
+ RefCountDisposable.prototype.getDisposable = function () {
+ return this.isDisposed ? disposableEmpty : new InnerDisposable(this);
+ };
+
+ return RefCountDisposable;
+ })();
+
+ function ScheduledDisposable(scheduler, disposable) {
+ this.scheduler = scheduler;
+ this.disposable = disposable;
+ this.isDisposed = false;
+ }
+
+ function scheduleItem(s, self) {
+ if (!self.isDisposed) {
+ self.isDisposed = true;
+ self.disposable.dispose();
+ }
+ }
+
+ ScheduledDisposable.prototype.dispose = function () {
+ this.scheduler.scheduleWithState(this, scheduleItem);
+ };
+
+ var ScheduledItem = Rx.internals.ScheduledItem = function (scheduler, state, action, dueTime, comparer) {
+ this.scheduler = scheduler;
+ this.state = state;
+ this.action = action;
+ this.dueTime = dueTime;
+ this.comparer = comparer || defaultSubComparer;
+ this.disposable = new SingleAssignmentDisposable();
+ }
+
+ ScheduledItem.prototype.invoke = function () {
+ this.disposable.setDisposable(this.invokeCore());
+ };
+
+ ScheduledItem.prototype.compareTo = function (other) {
+ return this.comparer(this.dueTime, other.dueTime);
+ };
+
+ ScheduledItem.prototype.isCancelled = function () {
+ return this.disposable.isDisposed;
+ };
+
+ ScheduledItem.prototype.invokeCore = function () {
+ return this.action(this.scheduler, this.state);
+ };
+
+ /** Provides a set of static properties to access commonly used schedulers. */
+ var Scheduler = Rx.Scheduler = (function () {
+
+ function Scheduler(now, schedule, scheduleRelative, scheduleAbsolute) {
+ this.now = now;
+ this._schedule = schedule;
+ this._scheduleRelative = scheduleRelative;
+ this._scheduleAbsolute = scheduleAbsolute;
+ }
+
+ /** Determines whether the given object is a scheduler */
+ Scheduler.isScheduler = function (s) {
+ return s instanceof Scheduler;
+ }
+
+ function invokeAction(scheduler, action) {
+ action();
+ return disposableEmpty;
+ }
+
+ var schedulerProto = Scheduler.prototype;
+
+ /**
+ * Schedules an action to be executed.
+ * @param {Function} action Action to execute.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.schedule = function (action) {
+ return this._schedule(action, invokeAction);
+ };
+
+ /**
+ * Schedules an action to be executed.
+ * @param state State passed to the action to be executed.
+ * @param {Function} action Action to be executed.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleWithState = function (state, action) {
+ return this._schedule(state, action);
+ };
+
+ /**
+ * Schedules an action to be executed after the specified relative due time.
+ * @param {Function} action Action to execute.
+ * @param {Number} dueTime Relative time after which to execute the action.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleWithRelative = function (dueTime, action) {
+ return this._scheduleRelative(action, dueTime, invokeAction);
+ };
+
+ /**
+ * Schedules an action to be executed after dueTime.
+ * @param state State passed to the action to be executed.
+ * @param {Function} action Action to be executed.
+ * @param {Number} dueTime Relative time after which to execute the action.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleWithRelativeAndState = function (state, dueTime, action) {
+ return this._scheduleRelative(state, dueTime, action);
+ };
+
+ /**
+ * Schedules an action to be executed at the specified absolute due time.
+ * @param {Function} action Action to execute.
+ * @param {Number} dueTime Absolute time at which to execute the action.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleWithAbsolute = function (dueTime, action) {
+ return this._scheduleAbsolute(action, dueTime, invokeAction);
+ };
+
+ /**
+ * Schedules an action to be executed at dueTime.
+ * @param {Mixed} state State passed to the action to be executed.
+ * @param {Function} action Action to be executed.
+ * @param {Number}dueTime Absolute time at which to execute the action.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleWithAbsoluteAndState = function (state, dueTime, action) {
+ return this._scheduleAbsolute(state, dueTime, action);
+ };
+
+ /** Gets the current time according to the local machine's system clock. */
+ Scheduler.now = defaultNow;
+
+ /**
+ * Normalizes the specified TimeSpan value to a positive value.
+ * @param {Number} timeSpan The time span value to normalize.
+ * @returns {Number} The specified TimeSpan value if it is zero or positive; otherwise, 0
+ */
+ Scheduler.normalize = function (timeSpan) {
+ timeSpan < 0 && (timeSpan = 0);
+ return timeSpan;
+ };
+
+ return Scheduler;
+ }());
+
+ var normalizeTime = Scheduler.normalize, isScheduler = Scheduler.isScheduler;
+
+ (function (schedulerProto) {
+
+ function invokeRecImmediate(scheduler, pair) {
+ var state = pair[0], action = pair[1], group = new CompositeDisposable();
+
+ function recursiveAction(state1) {
+ action(state1, function (state2) {
+ var isAdded = false, isDone = false,
+ d = scheduler.scheduleWithState(state2, function (scheduler1, state3) {
+ if (isAdded) {
+ group.remove(d);
+ } else {
+ isDone = true;
+ }
+ recursiveAction(state3);
+ return disposableEmpty;
+ });
+ if (!isDone) {
+ group.add(d);
+ isAdded = true;
+ }
+ });
+ }
+ recursiveAction(state);
+ return group;
+ }
+
+ function invokeRecDate(scheduler, pair, method) {
+ var state = pair[0], action = pair[1], group = new CompositeDisposable();
+ function recursiveAction(state1) {
+ action(state1, function (state2, dueTime1) {
+ var isAdded = false, isDone = false,
+ d = scheduler[method](state2, dueTime1, function (scheduler1, state3) {
+ if (isAdded) {
+ group.remove(d);
+ } else {
+ isDone = true;
+ }
+ recursiveAction(state3);
+ return disposableEmpty;
+ });
+ if (!isDone) {
+ group.add(d);
+ isAdded = true;
+ }
+ });
+ };
+ recursiveAction(state);
+ return group;
+ }
+
+ function scheduleInnerRecursive(action, self) {
+ action(function(dt) { self(action, dt); });
+ }
+
+ /**
+ * Schedules an action to be executed recursively.
+ * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleRecursive = function (action) {
+ return this.scheduleRecursiveWithState(action, scheduleInnerRecursive);
+ };
+
+ /**
+ * Schedules an action to be executed recursively.
+ * @param {Mixed} state State passed to the action to be executed.
+ * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in recursive invocation state.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleRecursiveWithState = function (state, action) {
+ return this.scheduleWithState([state, action], invokeRecImmediate);
+ };
+
+ /**
+ * Schedules an action to be executed recursively after a specified relative due time.
+ * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified relative time.
+ * @param {Number}dueTime Relative time after which to execute the action for the first time.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleRecursiveWithRelative = function (dueTime, action) {
+ return this.scheduleRecursiveWithRelativeAndState(action, dueTime, scheduleInnerRecursive);
+ };
+
+ /**
+ * Schedules an action to be executed recursively after a specified relative due time.
+ * @param {Mixed} state State passed to the action to be executed.
+ * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state.
+ * @param {Number}dueTime Relative time after which to execute the action for the first time.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleRecursiveWithRelativeAndState = function (state, dueTime, action) {
+ return this._scheduleRelative([state, action], dueTime, function (s, p) {
+ return invokeRecDate(s, p, 'scheduleWithRelativeAndState');
+ });
+ };
+
+ /**
+ * Schedules an action to be executed recursively at a specified absolute due time.
+ * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified absolute time.
+ * @param {Number}dueTime Absolute time at which to execute the action for the first time.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleRecursiveWithAbsolute = function (dueTime, action) {
+ return this.scheduleRecursiveWithAbsoluteAndState(action, dueTime, scheduleInnerRecursive);
+ };
+
+ /**
+ * Schedules an action to be executed recursively at a specified absolute due time.
+ * @param {Mixed} state State passed to the action to be executed.
+ * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state.
+ * @param {Number}dueTime Absolute time at which to execute the action for the first time.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleRecursiveWithAbsoluteAndState = function (state, dueTime, action) {
+ return this._scheduleAbsolute([state, action], dueTime, function (s, p) {
+ return invokeRecDate(s, p, 'scheduleWithAbsoluteAndState');
+ });
+ };
+ }(Scheduler.prototype));
+
+ (function (schedulerProto) {
+
+ /**
+ * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation.
+ * @param {Number} period Period for running the work periodically.
+ * @param {Function} action Action to be executed.
+ * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort).
+ */
+ Scheduler.prototype.schedulePeriodic = function (period, action) {
+ return this.schedulePeriodicWithState(null, period, action);
+ };
+
+ /**
+ * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation.
+ * @param {Mixed} state Initial state passed to the action upon the first iteration.
+ * @param {Number} period Period for running the work periodically.
+ * @param {Function} action Action to be executed, potentially updating the state.
+ * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort).
+ */
+ Scheduler.prototype.schedulePeriodicWithState = function(state, period, action) {
+ if (typeof root.setInterval === 'undefined') { throw new NotSupportedError(); }
+ period = normalizeTime(period);
+ var s = state, id = root.setInterval(function () { s = action(s); }, period);
+ return disposableCreate(function () { root.clearInterval(id); });
+ };
+
+ }(Scheduler.prototype));
+
+ (function (schedulerProto) {
+ /**
+ * Returns a scheduler that wraps the original scheduler, adding exception handling for scheduled actions.
+ * @param {Function} handler Handler that's run if an exception is caught. The exception will be rethrown if the handler returns false.
+ * @returns {Scheduler} Wrapper around the original scheduler, enforcing exception handling.
+ */
+ schedulerProto.catchError = schedulerProto['catch'] = function (handler) {
+ return new CatchScheduler(this, handler);
+ };
+ }(Scheduler.prototype));
+
+ var SchedulePeriodicRecursive = Rx.internals.SchedulePeriodicRecursive = (function () {
+ function tick(command, recurse) {
+ recurse(0, this._period);
+ try {
+ this._state = this._action(this._state);
+ } catch (e) {
+ this._cancel.dispose();
+ throw e;
+ }
+ }
+
+ function SchedulePeriodicRecursive(scheduler, state, period, action) {
+ this._scheduler = scheduler;
+ this._state = state;
+ this._period = period;
+ this._action = action;
+ }
+
+ SchedulePeriodicRecursive.prototype.start = function () {
+ var d = new SingleAssignmentDisposable();
+ this._cancel = d;
+ d.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0, this._period, tick.bind(this)));
+
+ return d;
+ };
+
+ return SchedulePeriodicRecursive;
+ }());
+
+ /** Gets a scheduler that schedules work immediately on the current thread. */
+ var immediateScheduler = Scheduler.immediate = (function () {
+ function scheduleNow(state, action) { return action(this, state); }
+ return new Scheduler(defaultNow, scheduleNow, notSupported, notSupported);
+ }());
+
+ /**
+ * Gets a scheduler that schedules work as soon as possible on the current thread.
+ */
+ var currentThreadScheduler = Scheduler.currentThread = (function () {
+ var queue;
+
+ function runTrampoline () {
+ while (queue.length > 0) {
+ var item = queue.dequeue();
+ !item.isCancelled() && item.invoke();
+ }
+ }
+
+ function scheduleNow(state, action) {
+ var si = new ScheduledItem(this, state, action, this.now());
+
+ if (!queue) {
+ queue = new PriorityQueue(4);
+ queue.enqueue(si);
+
+ var result = tryCatch(runTrampoline)();
+ queue = null;
+ if (result === errorObj) { return thrower(result.e); }
+ } else {
+ queue.enqueue(si);
+ }
+ return si.disposable;
+ }
+
+ var currentScheduler = new Scheduler(defaultNow, scheduleNow, notSupported, notSupported);
+ currentScheduler.scheduleRequired = function () { return !queue; };
+
+ return currentScheduler;
+ }());
+
+ var scheduleMethod, clearMethod;
+
+ var localTimer = (function () {
+ var localSetTimeout, localClearTimeout = noop;
+ if (!!root.setTimeout) {
+ localSetTimeout = root.setTimeout;
+ localClearTimeout = root.clearTimeout;
+ } else if (!!root.WScript) {
+ localSetTimeout = function (fn, time) {
+ root.WScript.Sleep(time);
+ fn();
+ };
+ } else {
+ throw new NotSupportedError();
+ }
+
+ return {
+ setTimeout: localSetTimeout,
+ clearTimeout: localClearTimeout
+ };
+ }());
+ var localSetTimeout = localTimer.setTimeout,
+ localClearTimeout = localTimer.clearTimeout;
+
+ (function () {
+
+ var nextHandle = 1, tasksByHandle = {}, currentlyRunning = false;
+
+ clearMethod = function (handle) {
+ delete tasksByHandle[handle];
+ };
+
+ function runTask(handle) {
+ if (currentlyRunning) {
+ localSetTimeout(function () { runTask(handle) }, 0);
+ } else {
+ var task = tasksByHandle[handle];
+ if (task) {
+ currentlyRunning = true;
+ var result = tryCatch(task)();
+ clearMethod(handle);
+ currentlyRunning = false;
+ if (result === errorObj) { return thrower(result.e); }
+ }
+ }
+ }
+
+ var reNative = RegExp('^' +
+ String(toString)
+ .replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
+ .replace(/toString| for [^\]]+/g, '.*?') + '$'
+ );
+
+ var setImmediate = typeof (setImmediate = freeGlobal && moduleExports && freeGlobal.setImmediate) == 'function' &&
+ !reNative.test(setImmediate) && setImmediate;
+
+ function postMessageSupported () {
+ // Ensure not in a worker
+ if (!root.postMessage || root.importScripts) { return false; }
+ var isAsync = false, oldHandler = root.onmessage;
+ // Test for async
+ root.onmessage = function () { isAsync = true; };
+ root.postMessage('', '*');
+ root.onmessage = oldHandler;
+
+ return isAsync;
+ }
+
+ // Use in order, setImmediate, nextTick, postMessage, MessageChannel, script readystatechanged, setTimeout
+ if (isFunction(setImmediate)) {
+ scheduleMethod = function (action) {
+ var id = nextHandle++;
+ tasksByHandle[id] = action;
+ setImmediate(function () { runTask(id); });
+
+ return id;
+ };
+ } else if (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]') {
+ scheduleMethod = function (action) {
+ var id = nextHandle++;
+ tasksByHandle[id] = action;
+ process.nextTick(function () { runTask(id); });
+
+ return id;
+ };
+ } else if (postMessageSupported()) {
+ var MSG_PREFIX = 'ms.rx.schedule' + Math.random();
+
+ function onGlobalPostMessage(event) {
+ // Only if we're a match to avoid any other global events
+ if (typeof event.data === 'string' && event.data.substring(0, MSG_PREFIX.length) === MSG_PREFIX) {
+ runTask(event.data.substring(MSG_PREFIX.length));
+ }
+ }
+
+ if (root.addEventListener) {
+ root.addEventListener('message', onGlobalPostMessage, false);
+ } else if (root.attachEvent) {
+ root.attachEvent('onmessage', onGlobalPostMessage);
+ } else {
+ root.onmessage = onGlobalPostMessage;
+ }
+
+ scheduleMethod = function (action) {
+ var id = nextHandle++;
+ tasksByHandle[id] = action;
+ root.postMessage(MSG_PREFIX + currentId, '*');
+ return id;
+ };
+ } else if (!!root.MessageChannel) {
+ var channel = new root.MessageChannel();
+
+ channel.port1.onmessage = function (e) { runTask(e.data); };
+
+ scheduleMethod = function (action) {
+ var id = nextHandle++;
+ tasksByHandle[id] = action;
+ channel.port2.postMessage(id);
+ return id;
+ };
+ } else if ('document' in root && 'onreadystatechange' in root.document.createElement('script')) {
+
+ scheduleMethod = function (action) {
+ var scriptElement = root.document.createElement('script');
+ var id = nextHandle++;
+ tasksByHandle[id] = action;
+
+ scriptElement.onreadystatechange = function () {
+ runTask(id);
+ scriptElement.onreadystatechange = null;
+ scriptElement.parentNode.removeChild(scriptElement);
+ scriptElement = null;
+ };
+ root.document.documentElement.appendChild(scriptElement);
+ return id;
+ };
+
+ } else {
+ scheduleMethod = function (action) {
+ var id = nextHandle++;
+ tasksByHandle[id] = action;
+ localSetTimeout(function () {
+ runTask(id);
+ }, 0);
+
+ return id;
+ };
+ }
+ }());
+
+ /**
+ * Gets a scheduler that schedules work via a timed callback based upon platform.
+ */
+ var timeoutScheduler = Scheduler.timeout = Scheduler['default'] = (function () {
+
+ function scheduleNow(state, action) {
+ var scheduler = this, disposable = new SingleAssignmentDisposable();
+ var id = scheduleMethod(function () {
+ !disposable.isDisposed && disposable.setDisposable(action(scheduler, state));
+ });
+ return new CompositeDisposable(disposable, disposableCreate(function () {
+ clearMethod(id);
+ }));
+ }
+
+ function scheduleRelative(state, dueTime, action) {
+ var scheduler = this, dt = Scheduler.normalize(dueTime), disposable = new SingleAssignmentDisposable();
+ if (dt === 0) { return scheduler.scheduleWithState(state, action); }
+ var id = localSetTimeout(function () {
+ !disposable.isDisposed && disposable.setDisposable(action(scheduler, state));
+ }, dt);
+ return new CompositeDisposable(disposable, disposableCreate(function () {
+ localClearTimeout(id);
+ }));
+ }
+
+ function scheduleAbsolute(state, dueTime, action) {
+ return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action);
+ }
+
+ return new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute);
+ })();
+
+ var CatchScheduler = (function (__super__) {
+
+ function scheduleNow(state, action) {
+ return this._scheduler.scheduleWithState(state, this._wrap(action));
+ }
+
+ function scheduleRelative(state, dueTime, action) {
+ return this._scheduler.scheduleWithRelativeAndState(state, dueTime, this._wrap(action));
+ }
+
+ function scheduleAbsolute(state, dueTime, action) {
+ return this._scheduler.scheduleWithAbsoluteAndState(state, dueTime, this._wrap(action));
+ }
+
+ inherits(CatchScheduler, __super__);
+
+ function CatchScheduler(scheduler, handler) {
+ this._scheduler = scheduler;
+ this._handler = handler;
+ this._recursiveOriginal = null;
+ this._recursiveWrapper = null;
+ __super__.call(this, this._scheduler.now.bind(this._scheduler), scheduleNow, scheduleRelative, scheduleAbsolute);
+ }
+
+ CatchScheduler.prototype._clone = function (scheduler) {
+ return new CatchScheduler(scheduler, this._handler);
+ };
+
+ CatchScheduler.prototype._wrap = function (action) {
+ var parent = this;
+ return function (self, state) {
+ try {
+ return action(parent._getRecursiveWrapper(self), state);
+ } catch (e) {
+ if (!parent._handler(e)) { throw e; }
+ return disposableEmpty;
+ }
+ };
+ };
+
+ CatchScheduler.prototype._getRecursiveWrapper = function (scheduler) {
+ if (this._recursiveOriginal !== scheduler) {
+ this._recursiveOriginal = scheduler;
+ var wrapper = this._clone(scheduler);
+ wrapper._recursiveOriginal = scheduler;
+ wrapper._recursiveWrapper = wrapper;
+ this._recursiveWrapper = wrapper;
+ }
+ return this._recursiveWrapper;
+ };
+
+ CatchScheduler.prototype.schedulePeriodicWithState = function (state, period, action) {
+ var self = this, failed = false, d = new SingleAssignmentDisposable();
+
+ d.setDisposable(this._scheduler.schedulePeriodicWithState(state, period, function (state1) {
+ if (failed) { return null; }
+ try {
+ return action(state1);
+ } catch (e) {
+ failed = true;
+ if (!self._handler(e)) { throw e; }
+ d.dispose();
+ return null;
+ }
+ }));
+
+ return d;
+ };
+
+ return CatchScheduler;
+ }(Scheduler));
+
+ /**
+ * Represents a notification to an observer.
+ */
+ var Notification = Rx.Notification = (function () {
+ function Notification(kind, value, exception, accept, acceptObservable, toString) {
+ this.kind = kind;
+ this.value = value;
+ this.exception = exception;
+ this._accept = accept;
+ this._acceptObservable = acceptObservable;
+ this.toString = toString;
+ }
+
+ /**
+ * Invokes the delegate corresponding to the notification or the observer's method corresponding to the notification and returns the produced result.
+ *
+ * @memberOf Notification
+ * @param {Any} observerOrOnNext Delegate to invoke for an OnNext notification or Observer to invoke the notification on..
+ * @param {Function} onError Delegate to invoke for an OnError notification.
+ * @param {Function} onCompleted Delegate to invoke for an OnCompleted notification.
+ * @returns {Any} Result produced by the observation.
+ */
+ Notification.prototype.accept = function (observerOrOnNext, onError, onCompleted) {
+ return observerOrOnNext && typeof observerOrOnNext === 'object' ?
+ this._acceptObservable(observerOrOnNext) :
+ this._accept(observerOrOnNext, onError, onCompleted);
+ };
+
+ /**
+ * Returns an observable sequence with a single notification.
+ *
+ * @memberOf Notifications
+ * @param {Scheduler} [scheduler] Scheduler to send out the notification calls on.
+ * @returns {Observable} The observable sequence that surfaces the behavior of the notification upon subscription.
+ */
+ Notification.prototype.toObservable = function (scheduler) {
+ var self = this;
+ isScheduler(scheduler) || (scheduler = immediateScheduler);
+ return new AnonymousObservable(function (observer) {
+ return scheduler.scheduleWithState(self, function (_, notification) {
+ notification._acceptObservable(observer);
+ notification.kind === 'N' && observer.onCompleted();
+ });
+ });
+ };
+
+ return Notification;
+ })();
+
+ /**
+ * Creates an object that represents an OnNext notification to an observer.
+ * @param {Any} value The value contained in the notification.
+ * @returns {Notification} The OnNext notification containing the value.
+ */
+ var notificationCreateOnNext = Notification.createOnNext = (function () {
+ function _accept(onNext) { return onNext(this.value); }
+ function _acceptObservable(observer) { return observer.onNext(this.value); }
+ function toString() { return 'OnNext(' + this.value + ')'; }
+
+ return function (value) {
+ return new Notification('N', value, null, _accept, _acceptObservable, toString);
+ };
+ }());
+
+ /**
+ * Creates an object that represents an OnError notification to an observer.
+ * @param {Any} error The exception contained in the notification.
+ * @returns {Notification} The OnError notification containing the exception.
+ */
+ var notificationCreateOnError = Notification.createOnError = (function () {
+ function _accept (onNext, onError) { return onError(this.exception); }
+ function _acceptObservable(observer) { return observer.onError(this.exception); }
+ function toString () { return 'OnError(' + this.exception + ')'; }
+
+ return function (e) {
+ return new Notification('E', null, e, _accept, _acceptObservable, toString);
+ };
+ }());
+
+ /**
+ * Creates an object that represents an OnCompleted notification to an observer.
+ * @returns {Notification} The OnCompleted notification.
+ */
+ var notificationCreateOnCompleted = Notification.createOnCompleted = (function () {
+ function _accept (onNext, onError, onCompleted) { return onCompleted(); }
+ function _acceptObservable(observer) { return observer.onCompleted(); }
+ function toString () { return 'OnCompleted()'; }
+
+ return function () {
+ return new Notification('C', null, null, _accept, _acceptObservable, toString);
+ };
+ }());
+
+ /**
+ * Supports push-style iteration over an observable sequence.
+ */
+ var Observer = Rx.Observer = function () { };
+
+ /**
+ * Creates a notification callback from an observer.
+ * @returns The action that forwards its input notification to the underlying observer.
+ */
+ Observer.prototype.toNotifier = function () {
+ var observer = this;
+ return function (n) { return n.accept(observer); };
+ };
+
+ /**
+ * Hides the identity of an observer.
+ * @returns An observer that hides the identity of the specified observer.
+ */
+ Observer.prototype.asObserver = function () {
+ return new AnonymousObserver(this.onNext.bind(this), this.onError.bind(this), this.onCompleted.bind(this));
+ };
+
+ /**
+ * Checks access to the observer for grammar violations. This includes checking for multiple OnError or OnCompleted calls, as well as reentrancy in any of the observer methods.
+ * If a violation is detected, an Error is thrown from the offending observer method call.
+ * @returns An observer that checks callbacks invocations against the observer grammar and, if the checks pass, forwards those to the specified observer.
+ */
+ Observer.prototype.checked = function () { return new CheckedObserver(this); };
+
+ /**
+ * Creates an observer from the specified OnNext, along with optional OnError, and OnCompleted actions.
+ * @param {Function} [onNext] Observer's OnNext action implementation.
+ * @param {Function} [onError] Observer's OnError action implementation.
+ * @param {Function} [onCompleted] Observer's OnCompleted action implementation.
+ * @returns {Observer} The observer object implemented using the given actions.
+ */
+ var observerCreate = Observer.create = function (onNext, onError, onCompleted) {
+ onNext || (onNext = noop);
+ onError || (onError = defaultError);
+ onCompleted || (onCompleted = noop);
+ return new AnonymousObserver(onNext, onError, onCompleted);
+ };
+
+ /**
+ * Creates an observer from a notification callback.
+ *
+ * @static
+ * @memberOf Observer
+ * @param {Function} handler Action that handles a notification.
+ * @returns The observer object that invokes the specified handler using a notification corresponding to each message it receives.
+ */
+ Observer.fromNotifier = function (handler, thisArg) {
+ return new AnonymousObserver(function (x) {
+ return handler.call(thisArg, notificationCreateOnNext(x));
+ }, function (e) {
+ return handler.call(thisArg, notificationCreateOnError(e));
+ }, function () {
+ return handler.call(thisArg, notificationCreateOnCompleted());
+ });
+ };
+
+ /**
+ * Schedules the invocation of observer methods on the given scheduler.
+ * @param {Scheduler} scheduler Scheduler to schedule observer messages on.
+ * @returns {Observer} Observer whose messages are scheduled on the given scheduler.
+ */
+ Observer.prototype.notifyOn = function (scheduler) {
+ return new ObserveOnObserver(scheduler, this);
+ };
+
+ Observer.prototype.makeSafe = function(disposable) {
+ return new AnonymousSafeObserver(this._onNext, this._onError, this._onCompleted, disposable);
+ };
+
+ /**
+ * Abstract base class for implementations of the Observer class.
+ * This base class enforces the grammar of observers where OnError and OnCompleted are terminal messages.
+ */
+ var AbstractObserver = Rx.internals.AbstractObserver = (function (__super__) {
+ inherits(AbstractObserver, __super__);
+
+ /**
+ * Creates a new observer in a non-stopped state.
+ */
+ function AbstractObserver() {
+ this.isStopped = false;
+ __super__.call(this);
+ }
+
+ // Must be implemented by other observers
+ AbstractObserver.prototype.next = notImplemented;
+ AbstractObserver.prototype.error = notImplemented;
+ AbstractObserver.prototype.completed = notImplemented;
+
+ /**
+ * Notifies the observer of a new element in the sequence.
+ * @param {Any} value Next element in the sequence.
+ */
+ AbstractObserver.prototype.onNext = function (value) {
+ if (!this.isStopped) { this.next(value); }
+ };
+
+ /**
+ * Notifies the observer that an exception has occurred.
+ * @param {Any} error The error that has occurred.
+ */
+ AbstractObserver.prototype.onError = function (error) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.error(error);
+ }
+ };
+
+ /**
+ * Notifies the observer of the end of the sequence.
+ */
+ AbstractObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.completed();
+ }
+ };
+
+ /**
+ * Disposes the observer, causing it to transition to the stopped state.
+ */
+ AbstractObserver.prototype.dispose = function () {
+ this.isStopped = true;
+ };
+
+ AbstractObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.error(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ return AbstractObserver;
+ }(Observer));
+
+ /**
+ * Class to create an Observer instance from delegate-based implementations of the on* methods.
+ */
+ var AnonymousObserver = Rx.AnonymousObserver = (function (__super__) {
+ inherits(AnonymousObserver, __super__);
+
+ /**
+ * Creates an observer from the specified OnNext, OnError, and OnCompleted actions.
+ * @param {Any} onNext Observer's OnNext action implementation.
+ * @param {Any} onError Observer's OnError action implementation.
+ * @param {Any} onCompleted Observer's OnCompleted action implementation.
+ */
+ function AnonymousObserver(onNext, onError, onCompleted) {
+ __super__.call(this);
+ this._onNext = onNext;
+ this._onError = onError;
+ this._onCompleted = onCompleted;
+ }
+
+ /**
+ * Calls the onNext action.
+ * @param {Any} value Next element in the sequence.
+ */
+ AnonymousObserver.prototype.next = function (value) {
+ this._onNext(value);
+ };
+
+ /**
+ * Calls the onError action.
+ * @param {Any} error The error that has occurred.
+ */
+ AnonymousObserver.prototype.error = function (error) {
+ this._onError(error);
+ };
+
+ /**
+ * Calls the onCompleted action.
+ */
+ AnonymousObserver.prototype.completed = function () {
+ this._onCompleted();
+ };
+
+ return AnonymousObserver;
+ }(AbstractObserver));
+
+ var CheckedObserver = (function (__super__) {
+ inherits(CheckedObserver, __super__);
+
+ function CheckedObserver(observer) {
+ __super__.call(this);
+ this._observer = observer;
+ this._state = 0; // 0 - idle, 1 - busy, 2 - done
+ }
+
+ var CheckedObserverPrototype = CheckedObserver.prototype;
+
+ CheckedObserverPrototype.onNext = function (value) {
+ this.checkAccess();
+ var res = tryCatch(this._observer.onNext).call(this._observer, value);
+ this._state = 0;
+ res === errorObj && thrower(res.e);
+ };
+
+ CheckedObserverPrototype.onError = function (err) {
+ this.checkAccess();
+ var res = tryCatch(this._observer.onError).call(this._observer, err);
+ this._state = 2;
+ res === errorObj && thrower(res.e);
+ };
+
+ CheckedObserverPrototype.onCompleted = function () {
+ this.checkAccess();
+ var res = tryCatch(this._observer.onCompleted).call(this._observer);
+ this._state = 2;
+ res === errorObj && thrower(res.e);
+ };
+
+ CheckedObserverPrototype.checkAccess = function () {
+ if (this._state === 1) { throw new Error('Re-entrancy detected'); }
+ if (this._state === 2) { throw new Error('Observer completed'); }
+ if (this._state === 0) { this._state = 1; }
+ };
+
+ return CheckedObserver;
+ }(Observer));
+
+ var ScheduledObserver = Rx.internals.ScheduledObserver = (function (__super__) {
+ inherits(ScheduledObserver, __super__);
+
+ function ScheduledObserver(scheduler, observer) {
+ __super__.call(this);
+ this.scheduler = scheduler;
+ this.observer = observer;
+ this.isAcquired = false;
+ this.hasFaulted = false;
+ this.queue = [];
+ this.disposable = new SerialDisposable();
+ }
+
+ ScheduledObserver.prototype.next = function (value) {
+ var self = this;
+ this.queue.push(function () { self.observer.onNext(value); });
+ };
+
+ ScheduledObserver.prototype.error = function (e) {
+ var self = this;
+ this.queue.push(function () { self.observer.onError(e); });
+ };
+
+ ScheduledObserver.prototype.completed = function () {
+ var self = this;
+ this.queue.push(function () { self.observer.onCompleted(); });
+ };
+
+ ScheduledObserver.prototype.ensureActive = function () {
+ var isOwner = false, parent = this;
+ if (!this.hasFaulted && this.queue.length > 0) {
+ isOwner = !this.isAcquired;
+ this.isAcquired = true;
+ }
+ if (isOwner) {
+ this.disposable.setDisposable(this.scheduler.scheduleRecursive(function (self) {
+ var work;
+ if (parent.queue.length > 0) {
+ work = parent.queue.shift();
+ } else {
+ parent.isAcquired = false;
+ return;
+ }
+ try {
+ work();
+ } catch (ex) {
+ parent.queue = [];
+ parent.hasFaulted = true;
+ throw ex;
+ }
+ self();
+ }));
+ }
+ };
+
+ ScheduledObserver.prototype.dispose = function () {
+ __super__.prototype.dispose.call(this);
+ this.disposable.dispose();
+ };
+
+ return ScheduledObserver;
+ }(AbstractObserver));
+
+ var ObserveOnObserver = (function (__super__) {
+ inherits(ObserveOnObserver, __super__);
+
+ function ObserveOnObserver(scheduler, observer, cancel) {
+ __super__.call(this, scheduler, observer);
+ this._cancel = cancel;
+ }
+
+ ObserveOnObserver.prototype.next = function (value) {
+ __super__.prototype.next.call(this, value);
+ this.ensureActive();
+ };
+
+ ObserveOnObserver.prototype.error = function (e) {
+ __super__.prototype.error.call(this, e);
+ this.ensureActive();
+ };
+
+ ObserveOnObserver.prototype.completed = function () {
+ __super__.prototype.completed.call(this);
+ this.ensureActive();
+ };
+
+ ObserveOnObserver.prototype.dispose = function () {
+ __super__.prototype.dispose.call(this);
+ this._cancel && this._cancel.dispose();
+ this._cancel = null;
+ };
+
+ return ObserveOnObserver;
+ })(ScheduledObserver);
+
+ var observableProto;
+
+ /**
+ * Represents a push-style collection.
+ */
+ var Observable = Rx.Observable = (function () {
+
+ function Observable(subscribe) {
+ if (Rx.config.longStackSupport && hasStacks) {
+ try {
+ throw new Error();
+ } catch (e) {
+ this.stack = e.stack.substring(e.stack.indexOf("\n") + 1);
+ }
+
+ var self = this;
+ this._subscribe = function (observer) {
+ var oldOnError = observer.onError.bind(observer);
+
+ observer.onError = function (err) {
+ makeStackTraceLong(err, self);
+ oldOnError(err);
+ };
+
+ return subscribe.call(self, observer);
+ };
+ } else {
+ this._subscribe = subscribe;
+ }
+ }
+
+ observableProto = Observable.prototype;
+
+ /**
+ * Subscribes an observer to the observable sequence.
+ * @param {Mixed} [observerOrOnNext] The object that is to receive notifications or an action to invoke for each element in the observable sequence.
+ * @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence.
+ * @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence.
+ * @returns {Diposable} A disposable handling the subscriptions and unsubscriptions.
+ */
+ observableProto.subscribe = observableProto.forEach = function (observerOrOnNext, onError, onCompleted) {
+ return this._subscribe(typeof observerOrOnNext === 'object' ?
+ observerOrOnNext :
+ observerCreate(observerOrOnNext, onError, onCompleted));
+ };
+
+ /**
+ * Subscribes to the next value in the sequence with an optional "this" argument.
+ * @param {Function} onNext The function to invoke on each element in the observable sequence.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions.
+ */
+ observableProto.subscribeOnNext = function (onNext, thisArg) {
+ return this._subscribe(observerCreate(typeof thisArg !== 'undefined' ? function(x) { onNext.call(thisArg, x); } : onNext));
+ };
+
+ /**
+ * Subscribes to an exceptional condition in the sequence with an optional "this" argument.
+ * @param {Function} onError The function to invoke upon exceptional termination of the observable sequence.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions.
+ */
+ observableProto.subscribeOnError = function (onError, thisArg) {
+ return this._subscribe(observerCreate(null, typeof thisArg !== 'undefined' ? function(e) { onError.call(thisArg, e); } : onError));
+ };
+
+ /**
+ * Subscribes to the next value in the sequence with an optional "this" argument.
+ * @param {Function} onCompleted The function to invoke upon graceful termination of the observable sequence.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions.
+ */
+ observableProto.subscribeOnCompleted = function (onCompleted, thisArg) {
+ return this._subscribe(observerCreate(null, null, typeof thisArg !== 'undefined' ? function() { onCompleted.call(thisArg); } : onCompleted));
+ };
+
+ return Observable;
+ })();
+
+ var ObservableBase = Rx.ObservableBase = (function (__super__) {
+ inherits(ObservableBase, __super__);
+
+ function fixSubscriber(subscriber) {
+ return subscriber && isFunction(subscriber.dispose) ? subscriber :
+ isFunction(subscriber) ? disposableCreate(subscriber) : disposableEmpty;
+ }
+
+ function setDisposable(s, state) {
+ var ado = state[0], self = state[1];
+ var sub = tryCatch(self.subscribeCore).call(self, ado);
+
+ if (sub === errorObj) {
+ if(!ado.fail(errorObj.e)) { return thrower(errorObj.e); }
+ }
+ ado.setDisposable(fixSubscriber(sub));
+ }
+
+ function subscribe(observer) {
+ var ado = new AutoDetachObserver(observer), state = [ado, this];
+
+ if (currentThreadScheduler.scheduleRequired()) {
+ currentThreadScheduler.scheduleWithState(state, setDisposable);
+ } else {
+ setDisposable(null, state);
+ }
+ return ado;
+ }
+
+ function ObservableBase() {
+ __super__.call(this, subscribe);
+ }
+
+ ObservableBase.prototype.subscribeCore = notImplemented;
+
+ return ObservableBase;
+ }(Observable));
+
+ var Enumerable = Rx.internals.Enumerable = function () { };
+
+ var ConcatEnumerableObservable = (function(__super__) {
+ inherits(ConcatEnumerableObservable, __super__);
+ function ConcatEnumerableObservable(sources) {
+ this.sources = sources;
+ __super__.call(this);
+ }
+
+ ConcatEnumerableObservable.prototype.subscribeCore = function (o) {
+ var isDisposed, subscription = new SerialDisposable();
+ var cancelable = immediateScheduler.scheduleRecursiveWithState(this.sources[$iterator$](), function (e, self) {
+ if (isDisposed) { return; }
+ var currentItem = tryCatch(e.next).call(e);
+ if (currentItem === errorObj) { return o.onError(currentItem.e); }
+
+ if (currentItem.done) {
+ return o.onCompleted();
+ }
+
+ // Check if promise
+ var currentValue = currentItem.value;
+ isPromise(currentValue) && (currentValue = observableFromPromise(currentValue));
+
+ var d = new SingleAssignmentDisposable();
+ subscription.setDisposable(d);
+ d.setDisposable(currentValue.subscribe(new InnerObserver(o, self, e)));
+ });
+
+ return new CompositeDisposable(subscription, cancelable, disposableCreate(function () {
+ isDisposed = true;
+ }));
+ };
+
+ function InnerObserver(o, s, e) {
+ this.o = o;
+ this.s = s;
+ this.e = e;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) { if(!this.isStopped) { this.o.onNext(x); } };
+ InnerObserver.prototype.onError = function (err) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(err);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.s(this.e);
+ }
+ };
+ InnerObserver.prototype.dispose = function () { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (err) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(err);
+ return true;
+ }
+ return false;
+ };
+
+ return ConcatEnumerableObservable;
+ }(ObservableBase));
+
+ Enumerable.prototype.concat = function () {
+ return new ConcatEnumerableObservable(this);
+ };
+
+ var CatchErrorObservable = (function(__super__) {
+ inherits(CatchErrorObservable, __super__);
+ function CatchErrorObservable(sources) {
+ this.sources = sources;
+ __super__.call(this);
+ }
+
+ CatchErrorObservable.prototype.subscribeCore = function (o) {
+ var e = this.sources[$iterator$]();
+
+ var isDisposed, subscription = new SerialDisposable();
+ var cancelable = immediateScheduler.scheduleRecursiveWithState(null, function (lastException, self) {
+ if (isDisposed) { return; }
+ var currentItem = tryCatch(e.next).call(e);
+ if (currentItem === errorObj) { return o.onError(currentItem.e); }
+
+ if (currentItem.done) {
+ return lastException !== null ? o.onError(lastException) : o.onCompleted();
+ }
+
+ // Check if promise
+ var currentValue = currentItem.value;
+ isPromise(currentValue) && (currentValue = observableFromPromise(currentValue));
+
+ var d = new SingleAssignmentDisposable();
+ subscription.setDisposable(d);
+ d.setDisposable(currentValue.subscribe(
+ function(x) { o.onNext(x); },
+ self,
+ function() { o.onCompleted(); }));
+ });
+ return new CompositeDisposable(subscription, cancelable, disposableCreate(function () {
+ isDisposed = true;
+ }));
+ };
+
+ return CatchErrorObservable;
+ }(ObservableBase));
+
+ Enumerable.prototype.catchError = function () {
+ return new CatchErrorObservable(this);
+ };
+
+ Enumerable.prototype.catchErrorWhen = function (notificationHandler) {
+ var sources = this;
+ return new AnonymousObservable(function (o) {
+ var exceptions = new Subject(),
+ notifier = new Subject(),
+ handled = notificationHandler(exceptions),
+ notificationDisposable = handled.subscribe(notifier);
+
+ var e = sources[$iterator$]();
+
+ var isDisposed,
+ lastException,
+ subscription = new SerialDisposable();
+ var cancelable = immediateScheduler.scheduleRecursive(function (self) {
+ if (isDisposed) { return; }
+ var currentItem = tryCatch(e.next).call(e);
+ if (currentItem === errorObj) { return o.onError(currentItem.e); }
+
+ if (currentItem.done) {
+ if (lastException) {
+ o.onError(lastException);
+ } else {
+ o.onCompleted();
+ }
+ return;
+ }
+
+ // Check if promise
+ var currentValue = currentItem.value;
+ isPromise(currentValue) && (currentValue = observableFromPromise(currentValue));
+
+ var outer = new SingleAssignmentDisposable();
+ var inner = new SingleAssignmentDisposable();
+ subscription.setDisposable(new CompositeDisposable(inner, outer));
+ outer.setDisposable(currentValue.subscribe(
+ function(x) { o.onNext(x); },
+ function (exn) {
+ inner.setDisposable(notifier.subscribe(self, function(ex) {
+ o.onError(ex);
+ }, function() {
+ o.onCompleted();
+ }));
+
+ exceptions.onNext(exn);
+ },
+ function() { o.onCompleted(); }));
+ });
+
+ return new CompositeDisposable(notificationDisposable, subscription, cancelable, disposableCreate(function () {
+ isDisposed = true;
+ }));
+ });
+ };
+
+ var RepeatEnumerable = (function (__super__) {
+ inherits(RepeatEnumerable, __super__);
+
+ function RepeatEnumerable(v, c) {
+ this.v = v;
+ this.c = c == null ? -1 : c;
+ }
+ RepeatEnumerable.prototype[$iterator$] = function () {
+ return new RepeatEnumerator(this);
+ };
+
+ function RepeatEnumerator(p) {
+ this.v = p.v;
+ this.l = p.c;
+ }
+ RepeatEnumerator.prototype.next = function () {
+ if (this.l === 0) { return doneEnumerator; }
+ if (this.l > 0) { this.l--; }
+ return { done: false, value: this.v };
+ };
+
+ return RepeatEnumerable;
+ }(Enumerable));
+
+ var enumerableRepeat = Enumerable.repeat = function (value, repeatCount) {
+ return new RepeatEnumerable(value, repeatCount);
+ };
+
+ var OfEnumerable = (function(__super__) {
+ inherits(OfEnumerable, __super__);
+ function OfEnumerable(s, fn, thisArg) {
+ this.s = s;
+ this.fn = fn ? bindCallback(fn, thisArg, 3) : null;
+ }
+ OfEnumerable.prototype[$iterator$] = function () {
+ return new OfEnumerator(this);
+ };
+
+ function OfEnumerator(p) {
+ this.i = -1;
+ this.s = p.s;
+ this.l = this.s.length;
+ this.fn = p.fn;
+ }
+ OfEnumerator.prototype.next = function () {
+ return ++this.i < this.l ?
+ { done: false, value: !this.fn ? this.s[this.i] : this.fn(this.s[this.i], this.i, this.s) } :
+ doneEnumerator;
+ };
+
+ return OfEnumerable;
+ }(Enumerable));
+
+ var enumerableOf = Enumerable.of = function (source, selector, thisArg) {
+ return new OfEnumerable(source, selector, thisArg);
+ };
+
+ /**
+ * Wraps the source sequence in order to run its observer callbacks on the specified scheduler.
+ *
+ * This only invokes observer callbacks on a scheduler. In case the subscription and/or unsubscription actions have side-effects
+ * that require to be run on a scheduler, use subscribeOn.
+ *
+ * @param {Scheduler} scheduler Scheduler to notify observers on.
+ * @returns {Observable} The source sequence whose observations happen on the specified scheduler.
+ */
+ observableProto.observeOn = function (scheduler) {
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ return source.subscribe(new ObserveOnObserver(scheduler, observer));
+ }, source);
+ };
+
+ /**
+ * Wraps the source sequence in order to run its subscription and unsubscription logic on the specified scheduler. This operation is not commonly used;
+ * see the remarks section for more information on the distinction between subscribeOn and observeOn.
+
+ * This only performs the side-effects of subscription and unsubscription on the specified scheduler. In order to invoke observer
+ * callbacks on a scheduler, use observeOn.
+
+ * @param {Scheduler} scheduler Scheduler to perform subscription and unsubscription actions on.
+ * @returns {Observable} The source sequence whose subscriptions and unsubscriptions happen on the specified scheduler.
+ */
+ observableProto.subscribeOn = function (scheduler) {
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ var m = new SingleAssignmentDisposable(), d = new SerialDisposable();
+ d.setDisposable(m);
+ m.setDisposable(scheduler.schedule(function () {
+ d.setDisposable(new ScheduledDisposable(scheduler, source.subscribe(observer)));
+ }));
+ return d;
+ }, source);
+ };
+
+ var FromPromiseObservable = (function(__super__) {
+ inherits(FromPromiseObservable, __super__);
+ function FromPromiseObservable(p) {
+ this.p = p;
+ __super__.call(this);
+ }
+
+ FromPromiseObservable.prototype.subscribeCore = function(o) {
+ this.p.then(function (data) {
+ o.onNext(data);
+ o.onCompleted();
+ }, function (err) { o.onError(err); });
+ return disposableEmpty;
+ };
+
+ return FromPromiseObservable;
+ }(ObservableBase));
+
+ /**
+ * Converts a Promise to an Observable sequence
+ * @param {Promise} An ES6 Compliant promise.
+ * @returns {Observable} An Observable sequence which wraps the existing promise success and failure.
+ */
+ var observableFromPromise = Observable.fromPromise = function (promise) {
+ return new FromPromiseObservable(promise);
+ };
+ /*
+ * Converts an existing observable sequence to an ES6 Compatible Promise
+ * @example
+ * var promise = Rx.Observable.return(42).toPromise(RSVP.Promise);
+ *
+ * // With config
+ * Rx.config.Promise = RSVP.Promise;
+ * var promise = Rx.Observable.return(42).toPromise();
+ * @param {Function} [promiseCtor] The constructor of the promise. If not provided, it looks for it in Rx.config.Promise.
+ * @returns {Promise} An ES6 compatible promise with the last value from the observable sequence.
+ */
+ observableProto.toPromise = function (promiseCtor) {
+ promiseCtor || (promiseCtor = Rx.config.Promise);
+ if (!promiseCtor) { throw new NotSupportedError('Promise type not provided nor in Rx.config.Promise'); }
+ var source = this;
+ return new promiseCtor(function (resolve, reject) {
+ // No cancellation can be done
+ var value, hasValue = false;
+ source.subscribe(function (v) {
+ value = v;
+ hasValue = true;
+ }, reject, function () {
+ hasValue && resolve(value);
+ });
+ });
+ };
+
+ var ToArrayObservable = (function(__super__) {
+ inherits(ToArrayObservable, __super__);
+ function ToArrayObservable(source) {
+ this.source = source;
+ __super__.call(this);
+ }
+
+ ToArrayObservable.prototype.subscribeCore = function(o) {
+ return this.source.subscribe(new InnerObserver(o));
+ };
+
+ function InnerObserver(o) {
+ this.o = o;
+ this.a = [];
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) { if(!this.isStopped) { this.a.push(x); } };
+ InnerObserver.prototype.onError = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onNext(this.a);
+ this.o.onCompleted();
+ }
+ };
+ InnerObserver.prototype.dispose = function () { this.isStopped = true; }
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ return ToArrayObservable;
+ }(ObservableBase));
+
+ /**
+ * Creates an array from an observable sequence.
+ * @returns {Observable} An observable sequence containing a single element with a list containing all the elements of the source sequence.
+ */
+ observableProto.toArray = function () {
+ return new ToArrayObservable(this);
+ };
+
+ /**
+ * Creates an observable sequence from a specified subscribe method implementation.
+ * @example
+ * var res = Rx.Observable.create(function (observer) { return function () { } );
+ * var res = Rx.Observable.create(function (observer) { return Rx.Disposable.empty; } );
+ * var res = Rx.Observable.create(function (observer) { } );
+ * @param {Function} subscribe Implementation of the resulting observable sequence's subscribe method, returning a function that will be wrapped in a Disposable.
+ * @returns {Observable} The observable sequence with the specified implementation for the Subscribe method.
+ */
+ Observable.create = Observable.createWithDisposable = function (subscribe, parent) {
+ return new AnonymousObservable(subscribe, parent);
+ };
+
+ /**
+ * Returns an observable sequence that invokes the specified factory function whenever a new observer subscribes.
+ *
+ * @example
+ * var res = Rx.Observable.defer(function () { return Rx.Observable.fromArray([1,2,3]); });
+ * @param {Function} observableFactory Observable factory function to invoke for each observer that subscribes to the resulting sequence or Promise.
+ * @returns {Observable} An observable sequence whose observers trigger an invocation of the given observable factory function.
+ */
+ var observableDefer = Observable.defer = function (observableFactory) {
+ return new AnonymousObservable(function (observer) {
+ var result;
+ try {
+ result = observableFactory();
+ } catch (e) {
+ return observableThrow(e).subscribe(observer);
+ }
+ isPromise(result) && (result = observableFromPromise(result));
+ return result.subscribe(observer);
+ });
+ };
+
+ var EmptyObservable = (function(__super__) {
+ inherits(EmptyObservable, __super__);
+ function EmptyObservable(scheduler) {
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ EmptyObservable.prototype.subscribeCore = function (observer) {
+ var sink = new EmptySink(observer, this);
+ return sink.run();
+ };
+
+ function EmptySink(observer, parent) {
+ this.observer = observer;
+ this.parent = parent;
+ }
+
+ function scheduleItem(s, state) {
+ state.onCompleted();
+ }
+
+ EmptySink.prototype.run = function () {
+ return this.parent.scheduler.scheduleWithState(this.observer, scheduleItem);
+ };
+
+ return EmptyObservable;
+ }(ObservableBase));
+
+ /**
+ * Returns an empty observable sequence, using the specified scheduler to send out the single OnCompleted message.
+ *
+ * @example
+ * var res = Rx.Observable.empty();
+ * var res = Rx.Observable.empty(Rx.Scheduler.timeout);
+ * @param {Scheduler} [scheduler] Scheduler to send the termination call on.
+ * @returns {Observable} An observable sequence with no elements.
+ */
+ var observableEmpty = Observable.empty = function (scheduler) {
+ isScheduler(scheduler) || (scheduler = immediateScheduler);
+ return new EmptyObservable(scheduler);
+ };
+
+ var FromObservable = (function(__super__) {
+ inherits(FromObservable, __super__);
+ function FromObservable(iterable, mapper, scheduler) {
+ this.iterable = iterable;
+ this.mapper = mapper;
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ FromObservable.prototype.subscribeCore = function (observer) {
+ var sink = new FromSink(observer, this);
+ return sink.run();
+ };
+
+ return FromObservable;
+ }(ObservableBase));
+
+ var FromSink = (function () {
+ function FromSink(observer, parent) {
+ this.observer = observer;
+ this.parent = parent;
+ }
+
+ FromSink.prototype.run = function () {
+ var list = Object(this.parent.iterable),
+ it = getIterable(list),
+ observer = this.observer,
+ mapper = this.parent.mapper;
+
+ function loopRecursive(i, recurse) {
+ try {
+ var next = it.next();
+ } catch (e) {
+ return observer.onError(e);
+ }
+ if (next.done) {
+ return observer.onCompleted();
+ }
+
+ var result = next.value;
+
+ if (mapper) {
+ try {
+ result = mapper(result, i);
+ } catch (e) {
+ return observer.onError(e);
+ }
+ }
+
+ observer.onNext(result);
+ recurse(i + 1);
+ }
+
+ return this.parent.scheduler.scheduleRecursiveWithState(0, loopRecursive);
+ };
+
+ return FromSink;
+ }());
+
+ var maxSafeInteger = Math.pow(2, 53) - 1;
+
+ function StringIterable(str) {
+ this._s = s;
+ }
+
+ StringIterable.prototype[$iterator$] = function () {
+ return new StringIterator(this._s);
+ };
+
+ function StringIterator(str) {
+ this._s = s;
+ this._l = s.length;
+ this._i = 0;
+ }
+
+ StringIterator.prototype[$iterator$] = function () {
+ return this;
+ };
+
+ StringIterator.prototype.next = function () {
+ return this._i < this._l ? { done: false, value: this._s.charAt(this._i++) } : doneEnumerator;
+ };
+
+ function ArrayIterable(a) {
+ this._a = a;
+ }
+
+ ArrayIterable.prototype[$iterator$] = function () {
+ return new ArrayIterator(this._a);
+ };
+
+ function ArrayIterator(a) {
+ this._a = a;
+ this._l = toLength(a);
+ this._i = 0;
+ }
+
+ ArrayIterator.prototype[$iterator$] = function () {
+ return this;
+ };
+
+ ArrayIterator.prototype.next = function () {
+ return this._i < this._l ? { done: false, value: this._a[this._i++] } : doneEnumerator;
+ };
+
+ function numberIsFinite(value) {
+ return typeof value === 'number' && root.isFinite(value);
+ }
+
+ function isNan(n) {
+ return n !== n;
+ }
+
+ function getIterable(o) {
+ var i = o[$iterator$], it;
+ if (!i && typeof o === 'string') {
+ it = new StringIterable(o);
+ return it[$iterator$]();
+ }
+ if (!i && o.length !== undefined) {
+ it = new ArrayIterable(o);
+ return it[$iterator$]();
+ }
+ if (!i) { throw new TypeError('Object is not iterable'); }
+ return o[$iterator$]();
+ }
+
+ function sign(value) {
+ var number = +value;
+ if (number === 0) { return number; }
+ if (isNaN(number)) { return number; }
+ return number < 0 ? -1 : 1;
+ }
+
+ function toLength(o) {
+ var len = +o.length;
+ if (isNaN(len)) { return 0; }
+ if (len === 0 || !numberIsFinite(len)) { return len; }
+ len = sign(len) * Math.floor(Math.abs(len));
+ if (len <= 0) { return 0; }
+ if (len > maxSafeInteger) { return maxSafeInteger; }
+ return len;
+ }
+
+ /**
+ * This method creates a new Observable sequence from an array-like or iterable object.
+ * @param {Any} arrayLike An array-like or iterable object to convert to an Observable sequence.
+ * @param {Function} [mapFn] Map function to call on every element of the array.
+ * @param {Any} [thisArg] The context to use calling the mapFn if provided.
+ * @param {Scheduler} [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread.
+ */
+ var observableFrom = Observable.from = function (iterable, mapFn, thisArg, scheduler) {
+ if (iterable == null) {
+ throw new Error('iterable cannot be null.')
+ }
+ if (mapFn && !isFunction(mapFn)) {
+ throw new Error('mapFn when provided must be a function');
+ }
+ if (mapFn) {
+ var mapper = bindCallback(mapFn, thisArg, 2);
+ }
+ isScheduler(scheduler) || (scheduler = currentThreadScheduler);
+ return new FromObservable(iterable, mapper, scheduler);
+ }
+
+ var FromArrayObservable = (function(__super__) {
+ inherits(FromArrayObservable, __super__);
+ function FromArrayObservable(args, scheduler) {
+ this.args = args;
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ FromArrayObservable.prototype.subscribeCore = function (observer) {
+ var sink = new FromArraySink(observer, this);
+ return sink.run();
+ };
+
+ return FromArrayObservable;
+ }(ObservableBase));
+
+ function FromArraySink(observer, parent) {
+ this.observer = observer;
+ this.parent = parent;
+ }
+
+ FromArraySink.prototype.run = function () {
+ var observer = this.observer, args = this.parent.args, len = args.length;
+ function loopRecursive(i, recurse) {
+ if (i < len) {
+ observer.onNext(args[i]);
+ recurse(i + 1);
+ } else {
+ observer.onCompleted();
+ }
+ }
+
+ return this.parent.scheduler.scheduleRecursiveWithState(0, loopRecursive);
+ };
+
+ /**
+ * Converts an array to an observable sequence, using an optional scheduler to enumerate the array.
+ * @deprecated use Observable.from or Observable.of
+ * @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on.
+ * @returns {Observable} The observable sequence whose elements are pulled from the given enumerable sequence.
+ */
+ var observableFromArray = Observable.fromArray = function (array, scheduler) {
+ isScheduler(scheduler) || (scheduler = currentThreadScheduler);
+ return new FromArrayObservable(array, scheduler)
+ };
+
+ /**
+ * Generates an observable sequence by running a state-driven loop producing the sequence's elements, using the specified scheduler to send out observer messages.
+ *
+ * @example
+ * var res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; });
+ * var res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; }, Rx.Scheduler.timeout);
+ * @param {Mixed} initialState Initial state.
+ * @param {Function} condition Condition to terminate generation (upon returning false).
+ * @param {Function} iterate Iteration step function.
+ * @param {Function} resultSelector Selector function for results produced in the sequence.
+ * @param {Scheduler} [scheduler] Scheduler on which to run the generator loop. If not provided, defaults to Scheduler.currentThread.
+ * @returns {Observable} The generated sequence.
+ */
+ Observable.generate = function (initialState, condition, iterate, resultSelector, scheduler) {
+ isScheduler(scheduler) || (scheduler = currentThreadScheduler);
+ return new AnonymousObservable(function (o) {
+ var first = true;
+ return scheduler.scheduleRecursiveWithState(initialState, function (state, self) {
+ var hasResult, result;
+ try {
+ if (first) {
+ first = false;
+ } else {
+ state = iterate(state);
+ }
+ hasResult = condition(state);
+ hasResult && (result = resultSelector(state));
+ } catch (e) {
+ return o.onError(e);
+ }
+ if (hasResult) {
+ o.onNext(result);
+ self(state);
+ } else {
+ o.onCompleted();
+ }
+ });
+ });
+ };
+
+ var NeverObservable = (function(__super__) {
+ inherits(NeverObservable, __super__);
+ function NeverObservable() {
+ __super__.call(this);
+ }
+
+ NeverObservable.prototype.subscribeCore = function (observer) {
+ return disposableEmpty;
+ };
+
+ return NeverObservable;
+ }(ObservableBase));
+
+ /**
+ * Returns a non-terminating observable sequence, which can be used to denote an infinite duration (e.g. when using reactive joins).
+ * @returns {Observable} An observable sequence whose observers will never get called.
+ */
+ var observableNever = Observable.never = function () {
+ return new NeverObservable();
+ };
+
+ function observableOf (scheduler, array) {
+ isScheduler(scheduler) || (scheduler = currentThreadScheduler);
+ return new FromArrayObservable(array, scheduler);
+ }
+
+ /**
+ * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments.
+ * @returns {Observable} The observable sequence whose elements are pulled from the given arguments.
+ */
+ Observable.of = function () {
+ var len = arguments.length, args = new Array(len);
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+ return new FromArrayObservable(args, currentThreadScheduler);
+ };
+
+ /**
+ * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments.
+ * @param {Scheduler} scheduler A scheduler to use for scheduling the arguments.
+ * @returns {Observable} The observable sequence whose elements are pulled from the given arguments.
+ */
+ Observable.ofWithScheduler = function (scheduler) {
+ var len = arguments.length, args = new Array(len - 1);
+ for(var i = 1; i < len; i++) { args[i - 1] = arguments[i]; }
+ return new FromArrayObservable(args, scheduler);
+ };
+
+ var PairsObservable = (function(__super__) {
+ inherits(PairsObservable, __super__);
+ function PairsObservable(obj, scheduler) {
+ this.obj = obj;
+ this.keys = Object.keys(obj);
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ PairsObservable.prototype.subscribeCore = function (observer) {
+ var sink = new PairsSink(observer, this);
+ return sink.run();
+ };
+
+ return PairsObservable;
+ }(ObservableBase));
+
+ function PairsSink(observer, parent) {
+ this.observer = observer;
+ this.parent = parent;
+ }
+
+ PairsSink.prototype.run = function () {
+ var observer = this.observer, obj = this.parent.obj, keys = this.parent.keys, len = keys.length;
+ function loopRecursive(i, recurse) {
+ if (i < len) {
+ var key = keys[i];
+ observer.onNext([key, obj[key]]);
+ recurse(i + 1);
+ } else {
+ observer.onCompleted();
+ }
+ }
+
+ return this.parent.scheduler.scheduleRecursiveWithState(0, loopRecursive);
+ };
+
+ /**
+ * Convert an object into an observable sequence of [key, value] pairs.
+ * @param {Object} obj The object to inspect.
+ * @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on.
+ * @returns {Observable} An observable sequence of [key, value] pairs from the object.
+ */
+ Observable.pairs = function (obj, scheduler) {
+ scheduler || (scheduler = currentThreadScheduler);
+ return new PairsObservable(obj, scheduler);
+ };
+
+ var RangeObservable = (function(__super__) {
+ inherits(RangeObservable, __super__);
+ function RangeObservable(start, count, scheduler) {
+ this.start = start;
+ this.rangeCount = count;
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ RangeObservable.prototype.subscribeCore = function (observer) {
+ var sink = new RangeSink(observer, this);
+ return sink.run();
+ };
+
+ return RangeObservable;
+ }(ObservableBase));
+
+ var RangeSink = (function () {
+ function RangeSink(observer, parent) {
+ this.observer = observer;
+ this.parent = parent;
+ }
+
+ RangeSink.prototype.run = function () {
+ var start = this.parent.start, count = this.parent.rangeCount, observer = this.observer;
+ function loopRecursive(i, recurse) {
+ if (i < count) {
+ observer.onNext(start + i);
+ recurse(i + 1);
+ } else {
+ observer.onCompleted();
+ }
+ }
+
+ return this.parent.scheduler.scheduleRecursiveWithState(0, loopRecursive);
+ };
+
+ return RangeSink;
+ }());
+
+ /**
+ * Generates an observable sequence of integral numbers within a specified range, using the specified scheduler to send out observer messages.
+ * @param {Number} start The value of the first integer in the sequence.
+ * @param {Number} count The number of sequential integers to generate.
+ * @param {Scheduler} [scheduler] Scheduler to run the generator loop on. If not specified, defaults to Scheduler.currentThread.
+ * @returns {Observable} An observable sequence that contains a range of sequential integral numbers.
+ */
+ Observable.range = function (start, count, scheduler) {
+ isScheduler(scheduler) || (scheduler = currentThreadScheduler);
+ return new RangeObservable(start, count, scheduler);
+ };
+
+ var RepeatObservable = (function(__super__) {
+ inherits(RepeatObservable, __super__);
+ function RepeatObservable(value, repeatCount, scheduler) {
+ this.value = value;
+ this.repeatCount = repeatCount == null ? -1 : repeatCount;
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ RepeatObservable.prototype.subscribeCore = function (observer) {
+ var sink = new RepeatSink(observer, this);
+ return sink.run();
+ };
+
+ return RepeatObservable;
+ }(ObservableBase));
+
+ function RepeatSink(observer, parent) {
+ this.observer = observer;
+ this.parent = parent;
+ }
+
+ RepeatSink.prototype.run = function () {
+ var observer = this.observer, value = this.parent.value;
+ function loopRecursive(i, recurse) {
+ if (i === -1 || i > 0) {
+ observer.onNext(value);
+ i > 0 && i--;
+ }
+ if (i === 0) { return observer.onCompleted(); }
+ recurse(i);
+ }
+
+ return this.parent.scheduler.scheduleRecursiveWithState(this.parent.repeatCount, loopRecursive);
+ };
+
+ /**
+ * Generates an observable sequence that repeats the given element the specified number of times, using the specified scheduler to send out observer messages.
+ * @param {Mixed} value Element to repeat.
+ * @param {Number} repeatCount [Optiona] Number of times to repeat the element. If not specified, repeats indefinitely.
+ * @param {Scheduler} scheduler Scheduler to run the producer loop on. If not specified, defaults to Scheduler.immediate.
+ * @returns {Observable} An observable sequence that repeats the given element the specified number of times.
+ */
+ Observable.repeat = function (value, repeatCount, scheduler) {
+ isScheduler(scheduler) || (scheduler = currentThreadScheduler);
+ return new RepeatObservable(value, repeatCount, scheduler);
+ };
+
+ var JustObservable = (function(__super__) {
+ inherits(JustObservable, __super__);
+ function JustObservable(value, scheduler) {
+ this.value = value;
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ JustObservable.prototype.subscribeCore = function (observer) {
+ var sink = new JustSink(observer, this);
+ return sink.run();
+ };
+
+ function JustSink(observer, parent) {
+ this.observer = observer;
+ this.parent = parent;
+ }
+
+ function scheduleItem(s, state) {
+ var value = state[0], observer = state[1];
+ observer.onNext(value);
+ observer.onCompleted();
+ }
+
+ JustSink.prototype.run = function () {
+ return this.parent.scheduler.scheduleWithState([this.parent.value, this.observer], scheduleItem);
+ };
+
+ return JustObservable;
+ }(ObservableBase));
+
+ /**
+ * Returns an observable sequence that contains a single element, using the specified scheduler to send out observer messages.
+ * There is an alias called 'just' or browsers <IE9.
+ * @param {Mixed} value Single element in the resulting observable sequence.
+ * @param {Scheduler} scheduler Scheduler to send the single element on. If not specified, defaults to Scheduler.immediate.
+ * @returns {Observable} An observable sequence containing the single specified element.
+ */
+ var observableReturn = Observable['return'] = Observable.just = Observable.returnValue = function (value, scheduler) {
+ isScheduler(scheduler) || (scheduler = immediateScheduler);
+ return new JustObservable(value, scheduler);
+ };
+
+ var ThrowObservable = (function(__super__) {
+ inherits(ThrowObservable, __super__);
+ function ThrowObservable(error, scheduler) {
+ this.error = error;
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ ThrowObservable.prototype.subscribeCore = function (o) {
+ var sink = new ThrowSink(o, this);
+ return sink.run();
+ };
+
+ function ThrowSink(o, p) {
+ this.o = o;
+ this.p = p;
+ }
+
+ function scheduleItem(s, state) {
+ var e = state[0], o = state[1];
+ o.onError(e);
+ }
+
+ ThrowSink.prototype.run = function () {
+ return this.p.scheduler.scheduleWithState([this.p.error, this.o], scheduleItem);
+ };
+
+ return ThrowObservable;
+ }(ObservableBase));
+
+ /**
+ * Returns an observable sequence that terminates with an exception, using the specified scheduler to send out the single onError message.
+ * There is an alias to this method called 'throwError' for browsers <IE9.
+ * @param {Mixed} error An object used for the sequence's termination.
+ * @param {Scheduler} scheduler Scheduler to send the exceptional termination call on. If not specified, defaults to Scheduler.immediate.
+ * @returns {Observable} The observable sequence that terminates exceptionally with the specified exception object.
+ */
+ var observableThrow = Observable['throw'] = Observable.throwError = Observable.throwException = function (error, scheduler) {
+ isScheduler(scheduler) || (scheduler = immediateScheduler);
+ return new ThrowObservable(error, scheduler);
+ };
+
+ /**
+ * Constructs an observable sequence that depends on a resource object, whose lifetime is tied to the resulting observable sequence's lifetime.
+ * @param {Function} resourceFactory Factory function to obtain a resource object.
+ * @param {Function} observableFactory Factory function to obtain an observable sequence that depends on the obtained resource.
+ * @returns {Observable} An observable sequence whose lifetime controls the lifetime of the dependent resource object.
+ */
+ Observable.using = function (resourceFactory, observableFactory) {
+ return new AnonymousObservable(function (observer) {
+ var disposable = disposableEmpty, resource, source;
+ try {
+ resource = resourceFactory();
+ resource && (disposable = resource);
+ source = observableFactory(resource);
+ } catch (exception) {
+ return new CompositeDisposable(observableThrow(exception).subscribe(observer), disposable);
+ }
+ return new CompositeDisposable(source.subscribe(observer), disposable);
+ });
+ };
+
+ /**
+ * Propagates the observable sequence or Promise that reacts first.
+ * @param {Observable} rightSource Second observable sequence or Promise.
+ * @returns {Observable} {Observable} An observable sequence that surfaces either of the given sequences, whichever reacted first.
+ */
+ observableProto.amb = function (rightSource) {
+ var leftSource = this;
+ return new AnonymousObservable(function (observer) {
+ var choice,
+ leftChoice = 'L', rightChoice = 'R',
+ leftSubscription = new SingleAssignmentDisposable(),
+ rightSubscription = new SingleAssignmentDisposable();
+
+ isPromise(rightSource) && (rightSource = observableFromPromise(rightSource));
+
+ function choiceL() {
+ if (!choice) {
+ choice = leftChoice;
+ rightSubscription.dispose();
+ }
+ }
+
+ function choiceR() {
+ if (!choice) {
+ choice = rightChoice;
+ leftSubscription.dispose();
+ }
+ }
+
+ leftSubscription.setDisposable(leftSource.subscribe(function (left) {
+ choiceL();
+ choice === leftChoice && observer.onNext(left);
+ }, function (err) {
+ choiceL();
+ choice === leftChoice && observer.onError(err);
+ }, function () {
+ choiceL();
+ choice === leftChoice && observer.onCompleted();
+ }));
+
+ rightSubscription.setDisposable(rightSource.subscribe(function (right) {
+ choiceR();
+ choice === rightChoice && observer.onNext(right);
+ }, function (err) {
+ choiceR();
+ choice === rightChoice && observer.onError(err);
+ }, function () {
+ choiceR();
+ choice === rightChoice && observer.onCompleted();
+ }));
+
+ return new CompositeDisposable(leftSubscription, rightSubscription);
+ });
+ };
+
+ /**
+ * Propagates the observable sequence or Promise that reacts first.
+ *
+ * @example
+ * var = Rx.Observable.amb(xs, ys, zs);
+ * @returns {Observable} An observable sequence that surfaces any of the given sequences, whichever reacted first.
+ */
+ Observable.amb = function () {
+ var acc = observableNever(), items = [];
+ if (Array.isArray(arguments[0])) {
+ items = arguments[0];
+ } else {
+ for(var i = 0, len = arguments.length; i < len; i++) { items.push(arguments[i]); }
+ }
+
+ function func(previous, current) {
+ return previous.amb(current);
+ }
+ for (var i = 0, len = items.length; i < len; i++) {
+ acc = func(acc, items[i]);
+ }
+ return acc;
+ };
+
+ function observableCatchHandler(source, handler) {
+ return new AnonymousObservable(function (o) {
+ var d1 = new SingleAssignmentDisposable(), subscription = new SerialDisposable();
+ subscription.setDisposable(d1);
+ d1.setDisposable(source.subscribe(function (x) { o.onNext(x); }, function (e) {
+ try {
+ var result = handler(e);
+ } catch (ex) {
+ return o.onError(ex);
+ }
+ isPromise(result) && (result = observableFromPromise(result));
+
+ var d = new SingleAssignmentDisposable();
+ subscription.setDisposable(d);
+ d.setDisposable(result.subscribe(o));
+ }, function (x) { o.onCompleted(x); }));
+
+ return subscription;
+ }, source);
+ }
+
+ /**
+ * Continues an observable sequence that is terminated by an exception with the next observable sequence.
+ * @example
+ * 1 - xs.catchException(ys)
+ * 2 - xs.catchException(function (ex) { return ys(ex); })
+ * @param {Mixed} handlerOrSecond Exception handler function that returns an observable sequence given the error that occurred in the first sequence, or a second observable sequence used to produce results when an error occurred in the first sequence.
+ * @returns {Observable} An observable sequence containing the first sequence's elements, followed by the elements of the handler sequence in case an exception occurred.
+ */
+ observableProto['catch'] = observableProto.catchError = observableProto.catchException = function (handlerOrSecond) {
+ return typeof handlerOrSecond === 'function' ?
+ observableCatchHandler(this, handlerOrSecond) :
+ observableCatch([this, handlerOrSecond]);
+ };
+
+ /**
+ * Continues an observable sequence that is terminated by an exception with the next observable sequence.
+ * @param {Array | Arguments} args Arguments or an array to use as the next sequence if an error occurs.
+ * @returns {Observable} An observable sequence containing elements from consecutive source sequences until a source sequence terminates successfully.
+ */
+ var observableCatch = Observable.catchError = Observable['catch'] = Observable.catchException = function () {
+ var items = [];
+ if (Array.isArray(arguments[0])) {
+ items = arguments[0];
+ } else {
+ for(var i = 0, len = arguments.length; i < len; i++) { items.push(arguments[i]); }
+ }
+ return enumerableOf(items).catchError();
+ };
+
+ /**
+ * Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element.
+ * This can be in the form of an argument list of observables or an array.
+ *
+ * @example
+ * 1 - obs = observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
+ * 2 - obs = observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
+ * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
+ */
+ observableProto.combineLatest = function () {
+ var len = arguments.length, args = new Array(len);
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+ if (Array.isArray(args[0])) {
+ args[0].unshift(this);
+ } else {
+ args.unshift(this);
+ }
+ return combineLatest.apply(this, args);
+ };
+
+ /**
+ * Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element.
+ *
+ * @example
+ * 1 - obs = Rx.Observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
+ * 2 - obs = Rx.Observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
+ * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
+ */
+ var combineLatest = Observable.combineLatest = function () {
+ var len = arguments.length, args = new Array(len);
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+ var resultSelector = args.pop();
+ Array.isArray(args[0]) && (args = args[0]);
+
+ return new AnonymousObservable(function (o) {
+ var n = args.length,
+ falseFactory = function () { return false; },
+ hasValue = arrayInitialize(n, falseFactory),
+ hasValueAll = false,
+ isDone = arrayInitialize(n, falseFactory),
+ values = new Array(n);
+
+ function next(i) {
+ hasValue[i] = true;
+ if (hasValueAll || (hasValueAll = hasValue.every(identity))) {
+ try {
+ var res = resultSelector.apply(null, values);
+ } catch (e) {
+ return o.onError(e);
+ }
+ o.onNext(res);
+ } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) {
+ o.onCompleted();
+ }
+ }
+
+ function done (i) {
+ isDone[i] = true;
+ isDone.every(identity) && o.onCompleted();
+ }
+
+ var subscriptions = new Array(n);
+ for (var idx = 0; idx < n; idx++) {
+ (function (i) {
+ var source = args[i], sad = new SingleAssignmentDisposable();
+ isPromise(source) && (source = observableFromPromise(source));
+ sad.setDisposable(source.subscribe(function (x) {
+ values[i] = x;
+ next(i);
+ },
+ function(e) { o.onError(e); },
+ function () { done(i); }
+ ));
+ subscriptions[i] = sad;
+ }(idx));
+ }
+
+ return new CompositeDisposable(subscriptions);
+ }, this);
+ };
+
+ /**
+ * Concatenates all the observable sequences. This takes in either an array or variable arguments to concatenate.
+ * @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order.
+ */
+ observableProto.concat = function () {
+ for(var args = [], i = 0, len = arguments.length; i < len; i++) { args.push(arguments[i]); }
+ args.unshift(this);
+ return observableConcat.apply(null, args);
+ };
+
+ var ConcatObservable = (function(__super__) {
+ inherits(ConcatObservable, __super__);
+ function ConcatObservable(sources) {
+ this.sources = sources;
+ __super__.call(this);
+ }
+
+ ConcatObservable.prototype.subscribeCore = function(o) {
+ var sink = new ConcatSink(this.sources, o);
+ return sink.run();
+ };
+
+ function ConcatSink(sources, o) {
+ this.sources = sources;
+ this.o = o;
+ }
+ ConcatSink.prototype.run = function () {
+ var isDisposed, subscription = new SerialDisposable(), sources = this.sources, length = sources.length, o = this.o;
+ var cancelable = immediateScheduler.scheduleRecursiveWithState(0, function (i, self) {
+ if (isDisposed) { return; }
+ if (i === length) {
+ return o.onCompleted();
+ }
+
+ // Check if promise
+ var currentValue = sources[i];
+ isPromise(currentValue) && (currentValue = observableFromPromise(currentValue));
+
+ var d = new SingleAssignmentDisposable();
+ subscription.setDisposable(d);
+ d.setDisposable(currentValue.subscribe(
+ function (x) { o.onNext(x); },
+ function (e) { o.onError(e); },
+ function () { self(i + 1); }
+ ));
+ });
+
+ return new CompositeDisposable(subscription, cancelable, disposableCreate(function () {
+ isDisposed = true;
+ }));
+ };
+
+
+ return ConcatObservable;
+ }(ObservableBase));
+
+ /**
+ * Concatenates all the observable sequences.
+ * @param {Array | Arguments} args Arguments or an array to concat to the observable sequence.
+ * @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order.
+ */
+ var observableConcat = Observable.concat = function () {
+ var args;
+ if (Array.isArray(arguments[0])) {
+ args = arguments[0];
+ } else {
+ args = new Array(arguments.length);
+ for(var i = 0, len = arguments.length; i < len; i++) { args[i] = arguments[i]; }
+ }
+ return new ConcatObservable(args);
+ };
+
+ /**
+ * Concatenates an observable sequence of observable sequences.
+ * @returns {Observable} An observable sequence that contains the elements of each observed inner sequence, in sequential order.
+ */
+ observableProto.concatAll = observableProto.concatObservable = function () {
+ return this.merge(1);
+ };
+
+ var MergeObservable = (function (__super__) {
+ inherits(MergeObservable, __super__);
+
+ function MergeObservable(source, maxConcurrent) {
+ this.source = source;
+ this.maxConcurrent = maxConcurrent;
+ __super__.call(this);
+ }
+
+ MergeObservable.prototype.subscribeCore = function(observer) {
+ var g = new CompositeDisposable();
+ g.add(this.source.subscribe(new MergeObserver(observer, this.maxConcurrent, g)));
+ return g;
+ };
+
+ return MergeObservable;
+
+ }(ObservableBase));
+
+ var MergeObserver = (function () {
+ function MergeObserver(o, max, g) {
+ this.o = o;
+ this.max = max;
+ this.g = g;
+ this.done = false;
+ this.q = [];
+ this.activeCount = 0;
+ this.isStopped = false;
+ }
+ MergeObserver.prototype.handleSubscribe = function (xs) {
+ var sad = new SingleAssignmentDisposable();
+ this.g.add(sad);
+ isPromise(xs) && (xs = observableFromPromise(xs));
+ sad.setDisposable(xs.subscribe(new InnerObserver(this, sad)));
+ };
+ MergeObserver.prototype.onNext = function (innerSource) {
+ if (this.isStopped) { return; }
+ if(this.activeCount < this.max) {
+ this.activeCount++;
+ this.handleSubscribe(innerSource);
+ } else {
+ this.q.push(innerSource);
+ }
+ };
+ MergeObserver.prototype.onError = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ }
+ };
+ MergeObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.done = true;
+ this.activeCount === 0 && this.o.onCompleted();
+ }
+ };
+ MergeObserver.prototype.dispose = function() { this.isStopped = true; };
+ MergeObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ function InnerObserver(parent, sad) {
+ this.parent = parent;
+ this.sad = sad;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) { if(!this.isStopped) { this.parent.o.onNext(x); } };
+ InnerObserver.prototype.onError = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.parent.o.onError(e);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ var parent = this.parent;
+ parent.g.remove(this.sad);
+ if (parent.q.length > 0) {
+ parent.handleSubscribe(parent.q.shift());
+ } else {
+ parent.activeCount--;
+ parent.done && parent.activeCount === 0 && parent.o.onCompleted();
+ }
+ }
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.parent.o.onError(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ return MergeObserver;
+ }());
+
+
+
+
+
+ /**
+ * Merges an observable sequence of observable sequences into an observable sequence, limiting the number of concurrent subscriptions to inner sequences.
+ * Or merges two observable sequences into a single observable sequence.
+ *
+ * @example
+ * 1 - merged = sources.merge(1);
+ * 2 - merged = source.merge(otherSource);
+ * @param {Mixed} [maxConcurrentOrOther] Maximum number of inner observable sequences being subscribed to concurrently or the second observable sequence.
+ * @returns {Observable} The observable sequence that merges the elements of the inner sequences.
+ */
+ observableProto.merge = function (maxConcurrentOrOther) {
+ return typeof maxConcurrentOrOther !== 'number' ?
+ observableMerge(this, maxConcurrentOrOther) :
+ new MergeObservable(this, maxConcurrentOrOther);
+ };
+
+ /**
+ * Merges all the observable sequences into a single observable sequence.
+ * The scheduler is optional and if not specified, the immediate scheduler is used.
+ * @returns {Observable} The observable sequence that merges the elements of the observable sequences.
+ */
+ var observableMerge = Observable.merge = function () {
+ var scheduler, sources = [], i, len = arguments.length;
+ if (!arguments[0]) {
+ scheduler = immediateScheduler;
+ for(i = 1; i < len; i++) { sources.push(arguments[i]); }
+ } else if (isScheduler(arguments[0])) {
+ scheduler = arguments[0];
+ for(i = 1; i < len; i++) { sources.push(arguments[i]); }
+ } else {
+ scheduler = immediateScheduler;
+ for(i = 0; i < len; i++) { sources.push(arguments[i]); }
+ }
+ if (Array.isArray(sources[0])) {
+ sources = sources[0];
+ }
+ return observableOf(scheduler, sources).mergeAll();
+ };
+
+ var CompositeError = Rx.CompositeError = function(errors) {
+ this.name = "NotImplementedError";
+ this.innerErrors = errors;
+ this.message = 'This contains multiple errors. Check the innerErrors';
+ Error.call(this);
+ }
+ CompositeError.prototype = Error.prototype;
+
+ /**
+ * Flattens an Observable that emits Observables into one Observable, in a way that allows an Observer to
+ * receive all successfully emitted items from all of the source Observables without being interrupted by
+ * an error notification from one of them.
+ *
+ * This behaves like Observable.prototype.mergeAll except that if any of the merged Observables notify of an
+ * error via the Observer's onError, mergeDelayError will refrain from propagating that
+ * error notification until all of the merged Observables have finished emitting items.
+ * @param {Array | Arguments} args Arguments or an array to merge.
+ * @returns {Observable} an Observable that emits all of the items emitted by the Observables emitted by the Observable
+ */
+ Observable.mergeDelayError = function() {
+ var args;
+ if (Array.isArray(arguments[0])) {
+ args = arguments[0];
+ } else {
+ var len = arguments.length;
+ args = new Array(len);
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+ }
+ var source = observableOf(null, args);
+
+ return new AnonymousObservable(function (o) {
+ var group = new CompositeDisposable(),
+ m = new SingleAssignmentDisposable(),
+ isStopped = false,
+ errors = [];
+
+ function setCompletion() {
+ if (errors.length === 0) {
+ o.onCompleted();
+ } else if (errors.length === 1) {
+ o.onError(errors[0]);
+ } else {
+ o.onError(new CompositeError(errors));
+ }
+ }
+
+ group.add(m);
+
+ m.setDisposable(source.subscribe(
+ function (innerSource) {
+ var innerSubscription = new SingleAssignmentDisposable();
+ group.add(innerSubscription);
+
+ // Check for promises support
+ isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
+
+ innerSubscription.setDisposable(innerSource.subscribe(
+ function (x) { o.onNext(x); },
+ function (e) {
+ errors.push(e);
+ group.remove(innerSubscription);
+ isStopped && group.length === 1 && setCompletion();
+ },
+ function () {
+ group.remove(innerSubscription);
+ isStopped && group.length === 1 && setCompletion();
+ }));
+ },
+ function (e) {
+ errors.push(e);
+ isStopped = true;
+ group.length === 1 && setCompletion();
+ },
+ function () {
+ isStopped = true;
+ group.length === 1 && setCompletion();
+ }));
+ return group;
+ });
+ };
+
+ var MergeAllObservable = (function (__super__) {
+ inherits(MergeAllObservable, __super__);
+
+ function MergeAllObservable(source) {
+ this.source = source;
+ __super__.call(this);
+ }
+
+ MergeAllObservable.prototype.subscribeCore = function (observer) {
+ var g = new CompositeDisposable(), m = new SingleAssignmentDisposable();
+ g.add(m);
+ m.setDisposable(this.source.subscribe(new MergeAllObserver(observer, g)));
+ return g;
+ };
+
+ function MergeAllObserver(o, g) {
+ this.o = o;
+ this.g = g;
+ this.isStopped = false;
+ this.done = false;
+ }
+ MergeAllObserver.prototype.onNext = function(innerSource) {
+ if(this.isStopped) { return; }
+ var sad = new SingleAssignmentDisposable();
+ this.g.add(sad);
+
+ isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
+
+ sad.setDisposable(innerSource.subscribe(new InnerObserver(this, this.g, sad)));
+ };
+ MergeAllObserver.prototype.onError = function (e) {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ }
+ };
+ MergeAllObserver.prototype.onCompleted = function () {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ this.done = true;
+ this.g.length === 1 && this.o.onCompleted();
+ }
+ };
+ MergeAllObserver.prototype.dispose = function() { this.isStopped = true; };
+ MergeAllObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ function InnerObserver(parent, g, sad) {
+ this.parent = parent;
+ this.g = g;
+ this.sad = sad;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) { if (!this.isStopped) { this.parent.o.onNext(x); } };
+ InnerObserver.prototype.onError = function (e) {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ this.parent.o.onError(e);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if(!this.isStopped) {
+ var parent = this.parent;
+ this.isStopped = true;
+ parent.g.remove(this.sad);
+ parent.done && parent.g.length === 1 && parent.o.onCompleted();
+ }
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.parent.o.onError(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ return MergeAllObservable;
+ }(ObservableBase));
+
+ /**
+ * Merges an observable sequence of observable sequences into an observable sequence.
+ * @returns {Observable} The observable sequence that merges the elements of the inner sequences.
+ */
+ observableProto.mergeAll = observableProto.mergeObservable = function () {
+ return new MergeAllObservable(this);
+ };
+
+ /**
+ * Continues an observable sequence that is terminated normally or by an exception with the next observable sequence.
+ * @param {Observable} second Second observable sequence used to produce results after the first sequence terminates.
+ * @returns {Observable} An observable sequence that concatenates the first and second sequence, even if the first sequence terminates exceptionally.
+ */
+ observableProto.onErrorResumeNext = function (second) {
+ if (!second) { throw new Error('Second observable is required'); }
+ return onErrorResumeNext([this, second]);
+ };
+
+ /**
+ * Continues an observable sequence that is terminated normally or by an exception with the next observable sequence.
+ *
+ * @example
+ * 1 - res = Rx.Observable.onErrorResumeNext(xs, ys, zs);
+ * 1 - res = Rx.Observable.onErrorResumeNext([xs, ys, zs]);
+ * @returns {Observable} An observable sequence that concatenates the source sequences, even if a sequence terminates exceptionally.
+ */
+ var onErrorResumeNext = Observable.onErrorResumeNext = function () {
+ var sources = [];
+ if (Array.isArray(arguments[0])) {
+ sources = arguments[0];
+ } else {
+ for(var i = 0, len = arguments.length; i < len; i++) { sources.push(arguments[i]); }
+ }
+ return new AnonymousObservable(function (observer) {
+ var pos = 0, subscription = new SerialDisposable(),
+ cancelable = immediateScheduler.scheduleRecursive(function (self) {
+ var current, d;
+ if (pos < sources.length) {
+ current = sources[pos++];
+ isPromise(current) && (current = observableFromPromise(current));
+ d = new SingleAssignmentDisposable();
+ subscription.setDisposable(d);
+ d.setDisposable(current.subscribe(observer.onNext.bind(observer), self, self));
+ } else {
+ observer.onCompleted();
+ }
+ });
+ return new CompositeDisposable(subscription, cancelable);
+ });
+ };
+
+ /**
+ * Returns the values from the source observable sequence only after the other observable sequence produces a value.
+ * @param {Observable | Promise} other The observable sequence or Promise that triggers propagation of elements of the source sequence.
+ * @returns {Observable} An observable sequence containing the elements of the source sequence starting from the point the other sequence triggered propagation.
+ */
+ observableProto.skipUntil = function (other) {
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var isOpen = false;
+ var disposables = new CompositeDisposable(source.subscribe(function (left) {
+ isOpen && o.onNext(left);
+ }, function (e) { o.onError(e); }, function () {
+ isOpen && o.onCompleted();
+ }));
+
+ isPromise(other) && (other = observableFromPromise(other));
+
+ var rightSubscription = new SingleAssignmentDisposable();
+ disposables.add(rightSubscription);
+ rightSubscription.setDisposable(other.subscribe(function () {
+ isOpen = true;
+ rightSubscription.dispose();
+ }, function (e) { o.onError(e); }, function () {
+ rightSubscription.dispose();
+ }));
+
+ return disposables;
+ }, source);
+ };
+
+ var SwitchObservable = (function(__super__) {
+ inherits(SwitchObservable, __super__);
+ function SwitchObservable(source) {
+ this.source = source;
+ __super__.call(this);
+ }
+
+ SwitchObservable.prototype.subscribeCore = function (o) {
+ var inner = new SerialDisposable(), s = this.source.subscribe(new SwitchObserver(o, inner));
+ return new CompositeDisposable(s, inner);
+ };
+
+ function SwitchObserver(o, inner) {
+ this.o = o;
+ this.inner = inner;
+ this.stopped = false;
+ this.latest = 0;
+ this.hasLatest = false;
+ this.isStopped = false;
+ }
+ SwitchObserver.prototype.onNext = function (innerSource) {
+ if (this.isStopped) { return; }
+ var d = new SingleAssignmentDisposable(), id = ++this.latest;
+ this.hasLatest = true;
+ this.inner.setDisposable(d);
+ isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
+ d.setDisposable(innerSource.subscribe(new InnerObserver(this, id)));
+ };
+ SwitchObserver.prototype.onError = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ }
+ };
+ SwitchObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.stopped = true;
+ !this.hasLatest && this.o.onCompleted();
+ }
+ };
+ SwitchObserver.prototype.dispose = function () { this.isStopped = true; };
+ SwitchObserver.prototype.fail = function (e) {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ function InnerObserver(parent, id) {
+ this.parent = parent;
+ this.id = id;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) {
+ if (this.isStopped) { return; }
+ this.parent.latest === this.id && this.parent.o.onNext(x);
+ };
+ InnerObserver.prototype.onError = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.parent.latest === this.id && this.parent.o.onError(e);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ if (this.parent.latest === this.id) {
+ this.parent.hasLatest = false;
+ this.parent.isStopped && this.parent.o.onCompleted();
+ }
+ }
+ };
+ InnerObserver.prototype.dispose = function () { this.isStopped = true; }
+ InnerObserver.prototype.fail = function (e) {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ this.parent.o.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ return SwitchObservable;
+ }(ObservableBase));
+
+ /**
+ * Transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
+ * @returns {Observable} The observable sequence that at any point in time produces the elements of the most recent inner observable sequence that has been received.
+ */
+ observableProto['switch'] = observableProto.switchLatest = function () {
+ return new SwitchObservable(this);
+ };
+
+ var TakeUntilObservable = (function(__super__) {
+ inherits(TakeUntilObservable, __super__);
+
+ function TakeUntilObservable(source, other) {
+ this.source = source;
+ this.other = isPromise(other) ? observableFromPromise(other) : other;
+ __super__.call(this);
+ }
+
+ TakeUntilObservable.prototype.subscribeCore = function(o) {
+ return new CompositeDisposable(
+ this.source.subscribe(o),
+ this.other.subscribe(new InnerObserver(o))
+ );
+ };
+
+ function InnerObserver(o) {
+ this.o = o;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) {
+ if (this.isStopped) { return; }
+ this.o.onCompleted();
+ };
+ InnerObserver.prototype.onError = function (err) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(err);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ !this.isStopped && (this.isStopped = true);
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ return TakeUntilObservable;
+ }(ObservableBase));
+
+ /**
+ * Returns the values from the source observable sequence until the other observable sequence produces a value.
+ * @param {Observable | Promise} other Observable sequence or Promise that terminates propagation of elements of the source sequence.
+ * @returns {Observable} An observable sequence containing the elements of the source sequence up to the point the other sequence interrupted further propagation.
+ */
+ observableProto.takeUntil = function (other) {
+ return new TakeUntilObservable(this, other);
+ };
+
+ function falseFactory() { return false; }
+
+ /**
+ * Merges the specified observable sequences into one observable sequence by using the selector function only when the (first) source observable sequence produces an element.
+ * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
+ */
+ observableProto.withLatestFrom = function () {
+ var len = arguments.length, args = new Array(len)
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+ var resultSelector = args.pop(), source = this;
+ Array.isArray(args[0]) && (args = args[0]);
+
+ return new AnonymousObservable(function (observer) {
+ var n = args.length,
+ hasValue = arrayInitialize(n, falseFactory),
+ hasValueAll = false,
+ values = new Array(n);
+
+ var subscriptions = new Array(n + 1);
+ for (var idx = 0; idx < n; idx++) {
+ (function (i) {
+ var other = args[i], sad = new SingleAssignmentDisposable();
+ isPromise(other) && (other = observableFromPromise(other));
+ sad.setDisposable(other.subscribe(function (x) {
+ values[i] = x;
+ hasValue[i] = true;
+ hasValueAll = hasValue.every(identity);
+ }, function (e) { observer.onError(e); }, noop));
+ subscriptions[i] = sad;
+ }(idx));
+ }
+
+ var sad = new SingleAssignmentDisposable();
+ sad.setDisposable(source.subscribe(function (x) {
+ var allValues = [x].concat(values);
+ if (!hasValueAll) { return; }
+ var res = tryCatch(resultSelector).apply(null, allValues);
+ if (res === errorObj) { return observer.onError(res.e); }
+ observer.onNext(res);
+ }, function (e) { observer.onError(e); }, function () {
+ observer.onCompleted();
+ }));
+ subscriptions[n] = sad;
+
+ return new CompositeDisposable(subscriptions);
+ }, this);
+ };
+
+ function zipArray(second, resultSelector) {
+ var first = this;
+ return new AnonymousObservable(function (o) {
+ var index = 0, len = second.length;
+ return first.subscribe(function (left) {
+ if (index < len) {
+ var right = second[index++], res = tryCatch(resultSelector)(left, right);
+ if (res === errorObj) { return o.onError(res.e); }
+ o.onNext(res);
+ } else {
+ o.onCompleted();
+ }
+ }, function (e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, first);
+ }
+
+ function falseFactory() { return false; }
+ function emptyArrayFactory() { return []; }
+
+ /**
+ * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences or an array have produced an element at a corresponding index.
+ * The last element in the arguments must be a function to invoke for each series of elements at corresponding indexes in the args.
+ * @returns {Observable} An observable sequence containing the result of combining elements of the args using the specified result selector function.
+ */
+ observableProto.zip = function () {
+ if (Array.isArray(arguments[0])) { return zipArray.apply(this, arguments); }
+ var len = arguments.length, args = new Array(len);
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+
+ var parent = this, resultSelector = args.pop();
+ args.unshift(parent);
+ return new AnonymousObservable(function (o) {
+ var n = args.length,
+ queues = arrayInitialize(n, emptyArrayFactory),
+ isDone = arrayInitialize(n, falseFactory);
+
+ var subscriptions = new Array(n);
+ for (var idx = 0; idx < n; idx++) {
+ (function (i) {
+ var source = args[i], sad = new SingleAssignmentDisposable();
+ isPromise(source) && (source = observableFromPromise(source));
+ sad.setDisposable(source.subscribe(function (x) {
+ queues[i].push(x);
+ if (queues.every(function (x) { return x.length > 0; })) {
+ var queuedValues = queues.map(function (x) { return x.shift(); }),
+ res = tryCatch(resultSelector).apply(parent, queuedValues);
+ if (res === errorObj) { return o.onError(res.e); }
+ o.onNext(res);
+ } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) {
+ o.onCompleted();
+ }
+ }, function (e) { o.onError(e); }, function () {
+ isDone[i] = true;
+ isDone.every(identity) && o.onCompleted();
+ }));
+ subscriptions[i] = sad;
+ })(idx);
+ }
+
+ return new CompositeDisposable(subscriptions);
+ }, parent);
+ };
+
+ /**
+ * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index.
+ * @param arguments Observable sources.
+ * @param {Function} resultSelector Function to invoke for each series of elements at corresponding indexes in the sources.
+ * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
+ */
+ Observable.zip = function () {
+ var len = arguments.length, args = new Array(len);
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+ var first = args.shift();
+ return first.zip.apply(first, args);
+ };
+
+ function falseFactory() { return false; }
+ function arrayFactory() { return []; }
+
+ /**
+ * Merges the specified observable sequences into one observable sequence by emitting a list with the elements of the observable sequences at corresponding indexes.
+ * @param arguments Observable sources.
+ * @returns {Observable} An observable sequence containing lists of elements at corresponding indexes.
+ */
+ Observable.zipArray = function () {
+ var sources;
+ if (Array.isArray(arguments[0])) {
+ sources = arguments[0];
+ } else {
+ var len = arguments.length;
+ sources = new Array(len);
+ for(var i = 0; i < len; i++) { sources[i] = arguments[i]; }
+ }
+ return new AnonymousObservable(function (o) {
+ var n = sources.length,
+ queues = arrayInitialize(n, arrayFactory),
+ isDone = arrayInitialize(n, falseFactory);
+
+ var subscriptions = new Array(n);
+ for (var idx = 0; idx < n; idx++) {
+ (function (i) {
+ subscriptions[i] = new SingleAssignmentDisposable();
+ subscriptions[i].setDisposable(sources[i].subscribe(function (x) {
+ queues[i].push(x);
+ if (queues.every(function (x) { return x.length > 0; })) {
+ var res = queues.map(function (x) { return x.shift(); });
+ o.onNext(res);
+ } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) {
+ return o.onCompleted();
+ }
+ }, function (e) { o.onError(e); }, function () {
+ isDone[i] = true;
+ isDone.every(identity) && o.onCompleted();
+ }));
+ })(idx);
+ }
+
+ return new CompositeDisposable(subscriptions);
+ });
+ };
+
+ /**
+ * Hides the identity of an observable sequence.
+ * @returns {Observable} An observable sequence that hides the identity of the source sequence.
+ */
+ observableProto.asObservable = function () {
+ var source = this;
+ return new AnonymousObservable(function (o) { return source.subscribe(o); }, source);
+ };
+
+ /**
+ * Projects each element of an observable sequence into zero or more buffers which are produced based on element count information.
+ *
+ * @example
+ * var res = xs.bufferWithCount(10);
+ * var res = xs.bufferWithCount(10, 1);
+ * @param {Number} count Length of each buffer.
+ * @param {Number} [skip] Number of elements to skip between creation of consecutive buffers. If not provided, defaults to the count.
+ * @returns {Observable} An observable sequence of buffers.
+ */
+ observableProto.bufferWithCount = function (count, skip) {
+ if (typeof skip !== 'number') {
+ skip = count;
+ }
+ return this.windowWithCount(count, skip).selectMany(function (x) {
+ return x.toArray();
+ }).where(function (x) {
+ return x.length > 0;
+ });
+ };
+
+ /**
+ * Dematerializes the explicit notification values of an observable sequence as implicit notifications.
+ * @returns {Observable} An observable sequence exhibiting the behavior corresponding to the source sequence's notification values.
+ */
+ observableProto.dematerialize = function () {
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ return source.subscribe(function (x) { return x.accept(o); }, function(e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, this);
+ };
+
+ /**
+ * Returns an observable sequence that contains only distinct contiguous elements according to the keySelector and the comparer.
+ *
+ * var obs = observable.distinctUntilChanged();
+ * var obs = observable.distinctUntilChanged(function (x) { return x.id; });
+ * var obs = observable.distinctUntilChanged(function (x) { return x.id; }, function (x, y) { return x === y; });
+ *
+ * @param {Function} [keySelector] A function to compute the comparison key for each element. If not provided, it projects the value.
+ * @param {Function} [comparer] Equality comparer for computed key values. If not provided, defaults to an equality comparer function.
+ * @returns {Observable} An observable sequence only containing the distinct contiguous elements, based on a computed key value, from the source sequence.
+ */
+ observableProto.distinctUntilChanged = function (keySelector, comparer) {
+ var source = this;
+ comparer || (comparer = defaultComparer);
+ return new AnonymousObservable(function (o) {
+ var hasCurrentKey = false, currentKey;
+ return source.subscribe(function (value) {
+ var key = value;
+ if (keySelector) {
+ key = tryCatch(keySelector)(value);
+ if (key === errorObj) { return o.onError(key.e); }
+ }
+ if (hasCurrentKey) {
+ var comparerEquals = tryCatch(comparer)(currentKey, key);
+ if (comparerEquals === errorObj) { return o.onError(comparerEquals.e); }
+ }
+ if (!hasCurrentKey || !comparerEquals) {
+ hasCurrentKey = true;
+ currentKey = key;
+ o.onNext(value);
+ }
+ }, function (e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, this);
+ };
+
+ var TapObservable = (function(__super__) {
+ inherits(TapObservable,__super__);
+ function TapObservable(source, observerOrOnNext, onError, onCompleted) {
+ this.source = source;
+ this.t = !observerOrOnNext || isFunction(observerOrOnNext) ?
+ observerCreate(observerOrOnNext || noop, onError || noop, onCompleted || noop) :
+ observerOrOnNext;
+ __super__.call(this);
+ }
+
+ TapObservable.prototype.subscribeCore = function(o) {
+ return this.source.subscribe(new InnerObserver(o, this.t));
+ };
+
+ function InnerObserver(o, t) {
+ this.o = o;
+ this.t = t;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function(x) {
+ if (this.isStopped) { return; }
+ var res = tryCatch(this.t.onNext).call(this.t, x);
+ if (res === errorObj) { this.o.onError(res.e); }
+ this.o.onNext(x);
+ };
+ InnerObserver.prototype.onError = function(err) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ var res = tryCatch(this.t.onError).call(this.t, err);
+ if (res === errorObj) { return this.o.onError(res.e); }
+ this.o.onError(err);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function() {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ var res = tryCatch(this.t.onCompleted).call(this.t);
+ if (res === errorObj) { return this.o.onError(res.e); }
+ this.o.onCompleted();
+ }
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ return TapObservable;
+ }(ObservableBase));
+
+ /**
+ * Invokes an action for each element in the observable sequence and invokes an action upon graceful or exceptional termination of the observable sequence.
+ * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
+ * @param {Function | Observer} observerOrOnNext Action to invoke for each element in the observable sequence or an o.
+ * @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function.
+ * @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function.
+ * @returns {Observable} The source sequence with the side-effecting behavior applied.
+ */
+ observableProto['do'] = observableProto.tap = observableProto.doAction = function (observerOrOnNext, onError, onCompleted) {
+ return new TapObservable(this, observerOrOnNext, onError, onCompleted);
+ };
+
+ /**
+ * Invokes an action for each element in the observable sequence.
+ * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
+ * @param {Function} onNext Action to invoke for each element in the observable sequence.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} The source sequence with the side-effecting behavior applied.
+ */
+ observableProto.doOnNext = observableProto.tapOnNext = function (onNext, thisArg) {
+ return this.tap(typeof thisArg !== 'undefined' ? function (x) { onNext.call(thisArg, x); } : onNext);
+ };
+
+ /**
+ * Invokes an action upon exceptional termination of the observable sequence.
+ * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
+ * @param {Function} onError Action to invoke upon exceptional termination of the observable sequence.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} The source sequence with the side-effecting behavior applied.
+ */
+ observableProto.doOnError = observableProto.tapOnError = function (onError, thisArg) {
+ return this.tap(noop, typeof thisArg !== 'undefined' ? function (e) { onError.call(thisArg, e); } : onError);
+ };
+
+ /**
+ * Invokes an action upon graceful termination of the observable sequence.
+ * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
+ * @param {Function} onCompleted Action to invoke upon graceful termination of the observable sequence.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} The source sequence with the side-effecting behavior applied.
+ */
+ observableProto.doOnCompleted = observableProto.tapOnCompleted = function (onCompleted, thisArg) {
+ return this.tap(noop, null, typeof thisArg !== 'undefined' ? function () { onCompleted.call(thisArg); } : onCompleted);
+ };
+
+ /**
+ * Invokes a specified action after the source observable sequence terminates gracefully or exceptionally.
+ * @param {Function} finallyAction Action to invoke after the source observable sequence terminates.
+ * @returns {Observable} Source sequence with the action-invoking termination behavior applied.
+ */
+ observableProto['finally'] = observableProto.ensure = function (action) {
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ var subscription;
+ try {
+ subscription = source.subscribe(observer);
+ } catch (e) {
+ action();
+ throw e;
+ }
+ return disposableCreate(function () {
+ try {
+ subscription.dispose();
+ } catch (e) {
+ throw e;
+ } finally {
+ action();
+ }
+ });
+ }, this);
+ };
+
+ /**
+ * @deprecated use #finally or #ensure instead.
+ */
+ observableProto.finallyAction = function (action) {
+ //deprecate('finallyAction', 'finally or ensure');
+ return this.ensure(action);
+ };
+
+ var IgnoreElementsObservable = (function(__super__) {
+ inherits(IgnoreElementsObservable, __super__);
+
+ function IgnoreElementsObservable(source) {
+ this.source = source;
+ __super__.call(this);
+ }
+
+ IgnoreElementsObservable.prototype.subscribeCore = function (o) {
+ return this.source.subscribe(new InnerObserver(o));
+ };
+
+ function InnerObserver(o) {
+ this.o = o;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = noop;
+ InnerObserver.prototype.onError = function (err) {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(err);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ this.o.onCompleted();
+ }
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.observer.onError(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ return IgnoreElementsObservable;
+ }(ObservableBase));
+
+ /**
+ * Ignores all elements in an observable sequence leaving only the termination messages.
+ * @returns {Observable} An empty observable sequence that signals termination, successful or exceptional, of the source sequence.
+ */
+ observableProto.ignoreElements = function () {
+ return new IgnoreElementsObservable(this);
+ };
+
+ /**
+ * Materializes the implicit notifications of an observable sequence as explicit notification values.
+ * @returns {Observable} An observable sequence containing the materialized notification values from the source sequence.
+ */
+ observableProto.materialize = function () {
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ return source.subscribe(function (value) {
+ observer.onNext(notificationCreateOnNext(value));
+ }, function (e) {
+ observer.onNext(notificationCreateOnError(e));
+ observer.onCompleted();
+ }, function () {
+ observer.onNext(notificationCreateOnCompleted());
+ observer.onCompleted();
+ });
+ }, source);
+ };
+
+ /**
+ * Repeats the observable sequence a specified number of times. If the repeat count is not specified, the sequence repeats indefinitely.
+ * @param {Number} [repeatCount] Number of times to repeat the sequence. If not provided, repeats the sequence indefinitely.
+ * @returns {Observable} The observable sequence producing the elements of the given sequence repeatedly.
+ */
+ observableProto.repeat = function (repeatCount) {
+ return enumerableRepeat(this, repeatCount).concat();
+ };
+
+ /**
+ * Repeats the source observable sequence the specified number of times or until it successfully terminates. If the retry count is not specified, it retries indefinitely.
+ * Note if you encounter an error and want it to retry once, then you must use .retry(2);
+ *
+ * @example
+ * var res = retried = retry.repeat();
+ * var res = retried = retry.repeat(2);
+ * @param {Number} [retryCount] Number of times to retry the sequence. If not provided, retry the sequence indefinitely.
+ * @returns {Observable} An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully.
+ */
+ observableProto.retry = function (retryCount) {
+ return enumerableRepeat(this, retryCount).catchError();
+ };
+
+ /**
+ * Repeats the source observable sequence upon error each time the notifier emits or until it successfully terminates.
+ * if the notifier completes, the observable sequence completes.
+ *
+ * @example
+ * var timer = Observable.timer(500);
+ * var source = observable.retryWhen(timer);
+ * @param {Observable} [notifier] An observable that triggers the retries or completes the observable with onNext or onCompleted respectively.
+ * @returns {Observable} An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully.
+ */
+ observableProto.retryWhen = function (notifier) {
+ return enumerableRepeat(this).catchErrorWhen(notifier);
+ };
+ var ScanObservable = (function(__super__) {
+ inherits(ScanObservable, __super__);
+ function ScanObservable(source, accumulator, hasSeed, seed) {
+ this.source = source;
+ this.accumulator = accumulator;
+ this.hasSeed = hasSeed;
+ this.seed = seed;
+ __super__.call(this);
+ }
+
+ ScanObservable.prototype.subscribeCore = function(observer) {
+ return this.source.subscribe(new ScanObserver(observer,this));
+ };
+
+ return ScanObservable;
+ }(ObservableBase));
+
+ function ScanObserver(observer, parent) {
+ this.observer = observer;
+ this.accumulator = parent.accumulator;
+ this.hasSeed = parent.hasSeed;
+ this.seed = parent.seed;
+ this.hasAccumulation = false;
+ this.accumulation = null;
+ this.hasValue = false;
+ this.isStopped = false;
+ }
+ ScanObserver.prototype.onNext = function (x) {
+ if (this.isStopped) { return; }
+ !this.hasValue && (this.hasValue = true);
+ try {
+ if (this.hasAccumulation) {
+ this.accumulation = this.accumulator(this.accumulation, x);
+ } else {
+ this.accumulation = this.hasSeed ? this.accumulator(this.seed, x) : x;
+ this.hasAccumulation = true;
+ }
+ } catch (e) {
+ return this.observer.onError(e);
+ }
+ this.observer.onNext(this.accumulation);
+ };
+ ScanObserver.prototype.onError = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.observer.onError(e);
+ }
+ };
+ ScanObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ !this.hasValue && this.hasSeed && this.observer.onNext(this.seed);
+ this.observer.onCompleted();
+ }
+ };
+ ScanObserver.prototype.dispose = function() { this.isStopped = true; };
+ ScanObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.observer.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ /**
+ * Applies an accumulator function over an observable sequence and returns each intermediate result. The optional seed value is used as the initial accumulator value.
+ * For aggregation behavior with no intermediate results, see Observable.aggregate.
+ * @param {Mixed} [seed] The initial accumulator value.
+ * @param {Function} accumulator An accumulator function to be invoked on each element.
+ * @returns {Observable} An observable sequence containing the accumulated values.
+ */
+ observableProto.scan = function () {
+ var hasSeed = false, seed, accumulator, source = this;
+ if (arguments.length === 2) {
+ hasSeed = true;
+ seed = arguments[0];
+ accumulator = arguments[1];
+ } else {
+ accumulator = arguments[0];
+ }
+ return new ScanObservable(this, accumulator, hasSeed, seed);
+ };
+
+ /**
+ * Bypasses a specified number of elements at the end of an observable sequence.
+ * @description
+ * This operator accumulates a queue with a length enough to store the first `count` elements. As more elements are
+ * received, elements are taken from the front of the queue and produced on the result sequence. This causes elements to be delayed.
+ * @param count Number of elements to bypass at the end of the source sequence.
+ * @returns {Observable} An observable sequence containing the source sequence elements except for the bypassed ones at the end.
+ */
+ observableProto.skipLast = function (count) {
+ if (count < 0) { throw new ArgumentOutOfRangeError(); }
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var q = [];
+ return source.subscribe(function (x) {
+ q.push(x);
+ q.length > count && o.onNext(q.shift());
+ }, function (e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, source);
+ };
+
+ /**
+ * Prepends a sequence of values to an observable sequence with an optional scheduler and an argument list of values to prepend.
+ * @example
+ * var res = source.startWith(1, 2, 3);
+ * var res = source.startWith(Rx.Scheduler.timeout, 1, 2, 3);
+ * @param {Arguments} args The specified values to prepend to the observable sequence
+ * @returns {Observable} The source sequence prepended with the specified values.
+ */
+ observableProto.startWith = function () {
+ var values, scheduler, start = 0;
+ if (!!arguments.length && isScheduler(arguments[0])) {
+ scheduler = arguments[0];
+ start = 1;
+ } else {
+ scheduler = immediateScheduler;
+ }
+ for(var args = [], i = start, len = arguments.length; i < len; i++) { args.push(arguments[i]); }
+ return enumerableOf([observableFromArray(args, scheduler), this]).concat();
+ };
+
+ /**
+ * Returns a specified number of contiguous elements from the end of an observable sequence.
+ * @description
+ * This operator accumulates a buffer with a length enough to store elements count elements. Upon completion of
+ * the source sequence, this buffer is drained on the result sequence. This causes the elements to be delayed.
+ * @param {Number} count Number of elements to take from the end of the source sequence.
+ * @returns {Observable} An observable sequence containing the specified number of elements from the end of the source sequence.
+ */
+ observableProto.takeLast = function (count) {
+ if (count < 0) { throw new ArgumentOutOfRangeError(); }
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var q = [];
+ return source.subscribe(function (x) {
+ q.push(x);
+ q.length > count && q.shift();
+ }, function (e) { o.onError(e); }, function () {
+ while (q.length > 0) { o.onNext(q.shift()); }
+ o.onCompleted();
+ });
+ }, source);
+ };
+
+ /**
+ * Returns an array with the specified number of contiguous elements from the end of an observable sequence.
+ *
+ * @description
+ * This operator accumulates a buffer with a length enough to store count elements. Upon completion of the
+ * source sequence, this buffer is produced on the result sequence.
+ * @param {Number} count Number of elements to take from the end of the source sequence.
+ * @returns {Observable} An observable sequence containing a single array with the specified number of elements from the end of the source sequence.
+ */
+ observableProto.takeLastBuffer = function (count) {
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var q = [];
+ return source.subscribe(function (x) {
+ q.push(x);
+ q.length > count && q.shift();
+ }, function (e) { o.onError(e); }, function () {
+ o.onNext(q);
+ o.onCompleted();
+ });
+ }, source);
+ };
+
+ /**
+ * Projects each element of an observable sequence into zero or more windows which are produced based on element count information.
+ *
+ * var res = xs.windowWithCount(10);
+ * var res = xs.windowWithCount(10, 1);
+ * @param {Number} count Length of each window.
+ * @param {Number} [skip] Number of elements to skip between creation of consecutive windows. If not specified, defaults to the count.
+ * @returns {Observable} An observable sequence of windows.
+ */
+ observableProto.windowWithCount = function (count, skip) {
+ var source = this;
+ +count || (count = 0);
+ Math.abs(count) === Infinity && (count = 0);
+ if (count <= 0) { throw new ArgumentOutOfRangeError(); }
+ skip == null && (skip = count);
+ +skip || (skip = 0);
+ Math.abs(skip) === Infinity && (skip = 0);
+
+ if (skip <= 0) { throw new ArgumentOutOfRangeError(); }
+ return new AnonymousObservable(function (observer) {
+ var m = new SingleAssignmentDisposable(),
+ refCountDisposable = new RefCountDisposable(m),
+ n = 0,
+ q = [];
+
+ function createWindow () {
+ var s = new Subject();
+ q.push(s);
+ observer.onNext(addRef(s, refCountDisposable));
+ }
+
+ createWindow();
+
+ m.setDisposable(source.subscribe(
+ function (x) {
+ for (var i = 0, len = q.length; i < len; i++) { q[i].onNext(x); }
+ var c = n - count + 1;
+ c >= 0 && c % skip === 0 && q.shift().onCompleted();
+ ++n % skip === 0 && createWindow();
+ },
+ function (e) {
+ while (q.length > 0) { q.shift().onError(e); }
+ observer.onError(e);
+ },
+ function () {
+ while (q.length > 0) { q.shift().onCompleted(); }
+ observer.onCompleted();
+ }
+ ));
+ return refCountDisposable;
+ }, source);
+ };
+
+ function concatMap(source, selector, thisArg) {
+ var selectorFunc = bindCallback(selector, thisArg, 3);
+ return source.map(function (x, i) {
+ var result = selectorFunc(x, i, source);
+ isPromise(result) && (result = observableFromPromise(result));
+ (isArrayLike(result) || isIterable(result)) && (result = observableFrom(result));
+ return result;
+ }).concatAll();
+ }
+
+ /**
+ * One of the Following:
+ * Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
+ *
+ * @example
+ * var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); });
+ * Or:
+ * Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
+ *
+ * var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
+ * Or:
+ * Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
+ *
+ * var res = source.concatMap(Rx.Observable.fromArray([1,2,3]));
+ * @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the
+ * source sequence onto which could be either an observable or Promise.
+ * @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
+ * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
+ */
+ observableProto.selectConcat = observableProto.concatMap = function (selector, resultSelector, thisArg) {
+ if (isFunction(selector) && isFunction(resultSelector)) {
+ return this.concatMap(function (x, i) {
+ var selectorResult = selector(x, i);
+ isPromise(selectorResult) && (selectorResult = observableFromPromise(selectorResult));
+ (isArrayLike(selectorResult) || isIterable(selectorResult)) && (selectorResult = observableFrom(selectorResult));
+
+ return selectorResult.map(function (y, i2) {
+ return resultSelector(x, y, i, i2);
+ });
+ });
+ }
+ return isFunction(selector) ?
+ concatMap(this, selector, thisArg) :
+ concatMap(this, function () { return selector; });
+ };
+
+ /**
+ * Projects each notification of an observable sequence to an observable sequence and concats the resulting observable sequences into one observable sequence.
+ * @param {Function} onNext A transform function to apply to each element; the second parameter of the function represents the index of the source element.
+ * @param {Function} onError A transform function to apply when an error occurs in the source sequence.
+ * @param {Function} onCompleted A transform function to apply when the end of the source sequence is reached.
+ * @param {Any} [thisArg] An optional "this" to use to invoke each transform.
+ * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function corresponding to each notification in the input sequence.
+ */
+ observableProto.concatMapObserver = observableProto.selectConcatObserver = function(onNext, onError, onCompleted, thisArg) {
+ var source = this,
+ onNextFunc = bindCallback(onNext, thisArg, 2),
+ onErrorFunc = bindCallback(onError, thisArg, 1),
+ onCompletedFunc = bindCallback(onCompleted, thisArg, 0);
+ return new AnonymousObservable(function (observer) {
+ var index = 0;
+ return source.subscribe(
+ function (x) {
+ var result;
+ try {
+ result = onNextFunc(x, index++);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+ isPromise(result) && (result = observableFromPromise(result));
+ observer.onNext(result);
+ },
+ function (err) {
+ var result;
+ try {
+ result = onErrorFunc(err);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+ isPromise(result) && (result = observableFromPromise(result));
+ observer.onNext(result);
+ observer.onCompleted();
+ },
+ function () {
+ var result;
+ try {
+ result = onCompletedFunc();
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+ isPromise(result) && (result = observableFromPromise(result));
+ observer.onNext(result);
+ observer.onCompleted();
+ });
+ }, this).concatAll();
+ };
+
+ /**
+ * Returns the elements of the specified sequence or the specified value in a singleton sequence if the sequence is empty.
+ *
+ * var res = obs = xs.defaultIfEmpty();
+ * 2 - obs = xs.defaultIfEmpty(false);
+ *
+ * @memberOf Observable#
+ * @param defaultValue The value to return if the sequence is empty. If not provided, this defaults to null.
+ * @returns {Observable} An observable sequence that contains the specified default value if the source is empty; otherwise, the elements of the source itself.
+ */
+ observableProto.defaultIfEmpty = function (defaultValue) {
+ var source = this;
+ defaultValue === undefined && (defaultValue = null);
+ return new AnonymousObservable(function (observer) {
+ var found = false;
+ return source.subscribe(function (x) {
+ found = true;
+ observer.onNext(x);
+ },
+ function (e) { observer.onError(e); },
+ function () {
+ !found && observer.onNext(defaultValue);
+ observer.onCompleted();
+ });
+ }, source);
+ };
+
+ // Swap out for Array.findIndex
+ function arrayIndexOfComparer(array, item, comparer) {
+ for (var i = 0, len = array.length; i < len; i++) {
+ if (comparer(array[i], item)) { return i; }
+ }
+ return -1;
+ }
+
+ function HashSet(comparer) {
+ this.comparer = comparer;
+ this.set = [];
+ }
+ HashSet.prototype.push = function(value) {
+ var retValue = arrayIndexOfComparer(this.set, value, this.comparer) === -1;
+ retValue && this.set.push(value);
+ return retValue;
+ };
+
+ /**
+ * Returns an observable sequence that contains only distinct elements according to the keySelector and the comparer.
+ * Usage of this operator should be considered carefully due to the maintenance of an internal lookup structure which can grow large.
+ *
+ * @example
+ * var res = obs = xs.distinct();
+ * 2 - obs = xs.distinct(function (x) { return x.id; });
+ * 2 - obs = xs.distinct(function (x) { return x.id; }, function (a,b) { return a === b; });
+ * @param {Function} [keySelector] A function to compute the comparison key for each element.
+ * @param {Function} [comparer] Used to compare items in the collection.
+ * @returns {Observable} An observable sequence only containing the distinct elements, based on a computed key value, from the source sequence.
+ */
+ observableProto.distinct = function (keySelector, comparer) {
+ var source = this;
+ comparer || (comparer = defaultComparer);
+ return new AnonymousObservable(function (o) {
+ var hashSet = new HashSet(comparer);
+ return source.subscribe(function (x) {
+ var key = x;
+
+ if (keySelector) {
+ try {
+ key = keySelector(x);
+ } catch (e) {
+ o.onError(e);
+ return;
+ }
+ }
+ hashSet.push(key) && o.onNext(x);
+ },
+ function (e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, this);
+ };
+
+ var MapObservable = (function (__super__) {
+ inherits(MapObservable, __super__);
+
+ function MapObservable(source, selector, thisArg) {
+ this.source = source;
+ this.selector = bindCallback(selector, thisArg, 3);
+ __super__.call(this);
+ }
+
+ function innerMap(selector, self) {
+ return function (x, i, o) { return selector.call(this, self.selector(x, i, o), i, o); }
+ }
+
+ MapObservable.prototype.internalMap = function (selector, thisArg) {
+ return new MapObservable(this.source, innerMap(selector, this), thisArg);
+ };
+
+ MapObservable.prototype.subscribeCore = function (o) {
+ return this.source.subscribe(new InnerObserver(o, this.selector, this));
+ };
+
+ function InnerObserver(o, selector, source) {
+ this.o = o;
+ this.selector = selector;
+ this.source = source;
+ this.i = 0;
+ this.isStopped = false;
+ }
+
+ InnerObserver.prototype.onNext = function(x) {
+ if (this.isStopped) { return; }
+ var result = tryCatch(this.selector)(x, this.i++, this.source);
+ if (result === errorObj) {
+ return this.o.onError(result.e);
+ }
+ this.o.onNext(result);
+ };
+ InnerObserver.prototype.onError = function (e) {
+ if(!this.isStopped) { this.isStopped = true; this.o.onError(e); }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if(!this.isStopped) { this.isStopped = true; this.o.onCompleted(); }
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ return MapObservable;
+
+ }(ObservableBase));
+
+ /**
+ * Projects each element of an observable sequence into a new form by incorporating the element's index.
+ * @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source.
+ */
+ observableProto.map = observableProto.select = function (selector, thisArg) {
+ var selectorFn = typeof selector === 'function' ? selector : function () { return selector; };
+ return this instanceof MapObservable ?
+ this.internalMap(selectorFn, thisArg) :
+ new MapObservable(this, selectorFn, thisArg);
+ };
+
+ /**
+ * Retrieves the value of a specified nested property from all elements in
+ * the Observable sequence.
+ * @param {Arguments} arguments The nested properties to pluck.
+ * @returns {Observable} Returns a new Observable sequence of property values.
+ */
+ observableProto.pluck = function () {
+ var args = arguments, len = arguments.length;
+ if (len === 0) { throw new Error('List of properties cannot be empty.'); }
+ return this.map(function (x) {
+ var currentProp = x;
+ for (var i = 0; i < len; i++) {
+ var p = currentProp[args[i]];
+ if (typeof p !== 'undefined') {
+ currentProp = p;
+ } else {
+ return undefined;
+ }
+ }
+ return currentProp;
+ });
+ };
+
+ /**
+ * Projects each notification of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
+ * @param {Function} onNext A transform function to apply to each element; the second parameter of the function represents the index of the source element.
+ * @param {Function} onError A transform function to apply when an error occurs in the source sequence.
+ * @param {Function} onCompleted A transform function to apply when the end of the source sequence is reached.
+ * @param {Any} [thisArg] An optional "this" to use to invoke each transform.
+ * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function corresponding to each notification in the input sequence.
+ */
+ observableProto.flatMapObserver = observableProto.selectManyObserver = function (onNext, onError, onCompleted, thisArg) {
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ var index = 0;
+
+ return source.subscribe(
+ function (x) {
+ var result;
+ try {
+ result = onNext.call(thisArg, x, index++);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+ isPromise(result) && (result = observableFromPromise(result));
+ observer.onNext(result);
+ },
+ function (err) {
+ var result;
+ try {
+ result = onError.call(thisArg, err);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+ isPromise(result) && (result = observableFromPromise(result));
+ observer.onNext(result);
+ observer.onCompleted();
+ },
+ function () {
+ var result;
+ try {
+ result = onCompleted.call(thisArg);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+ isPromise(result) && (result = observableFromPromise(result));
+ observer.onNext(result);
+ observer.onCompleted();
+ });
+ }, source).mergeAll();
+ };
+
+ function flatMap(source, selector, thisArg) {
+ var selectorFunc = bindCallback(selector, thisArg, 3);
+ return source.map(function (x, i) {
+ var result = selectorFunc(x, i, source);
+ isPromise(result) && (result = observableFromPromise(result));
+ (isArrayLike(result) || isIterable(result)) && (result = observableFrom(result));
+ return result;
+ }).mergeAll();
+ }
+
+ /**
+ * One of the Following:
+ * Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
+ *
+ * @example
+ * var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); });
+ * Or:
+ * Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
+ *
+ * var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
+ * Or:
+ * Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
+ *
+ * var res = source.selectMany(Rx.Observable.fromArray([1,2,3]));
+ * @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the source sequence onto which could be either an observable or Promise.
+ * @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
+ */
+ observableProto.selectMany = observableProto.flatMap = function (selector, resultSelector, thisArg) {
+ if (isFunction(selector) && isFunction(resultSelector)) {
+ return this.flatMap(function (x, i) {
+ var selectorResult = selector(x, i);
+ isPromise(selectorResult) && (selectorResult = observableFromPromise(selectorResult));
+ (isArrayLike(selectorResult) || isIterable(selectorResult)) && (selectorResult = observableFrom(selectorResult));
+
+ return selectorResult.map(function (y, i2) {
+ return resultSelector(x, y, i, i2);
+ });
+ }, thisArg);
+ }
+ return isFunction(selector) ?
+ flatMap(this, selector, thisArg) :
+ flatMap(this, function () { return selector; });
+ };
+
+ /**
+ * Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then
+ * transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
+ * @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences
+ * and that at any point in time produces the elements of the most recent inner observable sequence that has been received.
+ */
+ observableProto.selectSwitch = observableProto.flatMapLatest = observableProto.switchMap = function (selector, thisArg) {
+ return this.select(selector, thisArg).switchLatest();
+ };
+
+ var SkipObservable = (function(__super__) {
+ inherits(SkipObservable, __super__);
+ function SkipObservable(source, count) {
+ this.source = source;
+ this.skipCount = count;
+ __super__.call(this);
+ }
+
+ SkipObservable.prototype.subscribeCore = function (o) {
+ return this.source.subscribe(new InnerObserver(o, this.skipCount));
+ };
+
+ function InnerObserver(o, c) {
+ this.c = c;
+ this.r = c;
+ this.o = o;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) {
+ if (this.isStopped) { return; }
+ if (this.r <= 0) {
+ this.o.onNext(x);
+ } else {
+ this.r--;
+ }
+ };
+ InnerObserver.prototype.onError = function(e) {
+ if (!this.isStopped) { this.isStopped = true; this.o.onError(e); }
+ };
+ InnerObserver.prototype.onCompleted = function() {
+ if (!this.isStopped) { this.isStopped = true; this.o.onCompleted(); }
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function(e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ return SkipObservable;
+ }(ObservableBase));
+
+ /**
+ * Bypasses a specified number of elements in an observable sequence and then returns the remaining elements.
+ * @param {Number} count The number of elements to skip before returning the remaining elements.
+ * @returns {Observable} An observable sequence that contains the elements that occur after the specified index in the input sequence.
+ */
+ observableProto.skip = function (count) {
+ if (count < 0) { throw new ArgumentOutOfRangeError(); }
+ return new SkipObservable(this, count);
+ };
+ /**
+ * Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements.
+ * The element's index is used in the logic of the predicate function.
+ *
+ * var res = source.skipWhile(function (value) { return value < 10; });
+ * var res = source.skipWhile(function (value, index) { return value < 10 || index < 10; });
+ * @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate.
+ */
+ observableProto.skipWhile = function (predicate, thisArg) {
+ var source = this,
+ callback = bindCallback(predicate, thisArg, 3);
+ return new AnonymousObservable(function (o) {
+ var i = 0, running = false;
+ return source.subscribe(function (x) {
+ if (!running) {
+ try {
+ running = !callback(x, i++, source);
+ } catch (e) {
+ o.onError(e);
+ return;
+ }
+ }
+ running && o.onNext(x);
+ }, function (e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, source);
+ };
+
+ /**
+ * Returns a specified number of contiguous elements from the start of an observable sequence, using the specified scheduler for the edge case of take(0).
+ *
+ * var res = source.take(5);
+ * var res = source.take(0, Rx.Scheduler.timeout);
+ * @param {Number} count The number of elements to return.
+ * @param {Scheduler} [scheduler] Scheduler used to produce an OnCompleted message in case <paramref name="count count</paramref> is set to 0.
+ * @returns {Observable} An observable sequence that contains the specified number of elements from the start of the input sequence.
+ */
+ observableProto.take = function (count, scheduler) {
+ if (count < 0) { throw new ArgumentOutOfRangeError(); }
+ if (count === 0) { return observableEmpty(scheduler); }
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var remaining = count;
+ return source.subscribe(function (x) {
+ if (remaining-- > 0) {
+ o.onNext(x);
+ remaining <= 0 && o.onCompleted();
+ }
+ }, function (e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, source);
+ };
+
+ /**
+ * Returns elements from an observable sequence as long as a specified condition is true.
+ * The element's index is used in the logic of the predicate function.
+ * @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence that contains the elements from the input sequence that occur before the element at which the test no longer passes.
+ */
+ observableProto.takeWhile = function (predicate, thisArg) {
+ var source = this,
+ callback = bindCallback(predicate, thisArg, 3);
+ return new AnonymousObservable(function (o) {
+ var i = 0, running = true;
+ return source.subscribe(function (x) {
+ if (running) {
+ try {
+ running = callback(x, i++, source);
+ } catch (e) {
+ o.onError(e);
+ return;
+ }
+ if (running) {
+ o.onNext(x);
+ } else {
+ o.onCompleted();
+ }
+ }
+ }, function (e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, source);
+ };
+
+ var FilterObservable = (function (__super__) {
+ inherits(FilterObservable, __super__);
+
+ function FilterObservable(source, predicate, thisArg) {
+ this.source = source;
+ this.predicate = bindCallback(predicate, thisArg, 3);
+ __super__.call(this);
+ }
+
+ FilterObservable.prototype.subscribeCore = function (o) {
+ return this.source.subscribe(new InnerObserver(o, this.predicate, this));
+ };
+
+ function innerPredicate(predicate, self) {
+ return function(x, i, o) { return self.predicate(x, i, o) && predicate.call(this, x, i, o); }
+ }
+
+ FilterObservable.prototype.internalFilter = function(predicate, thisArg) {
+ return new FilterObservable(this.source, innerPredicate(predicate, this), thisArg);
+ };
+
+ function InnerObserver(o, predicate, source) {
+ this.o = o;
+ this.predicate = predicate;
+ this.source = source;
+ this.i = 0;
+ this.isStopped = false;
+ }
+
+ InnerObserver.prototype.onNext = function(x) {
+ if (this.isStopped) { return; }
+ var shouldYield = tryCatch(this.predicate)(x, this.i++, this.source);
+ if (shouldYield === errorObj) {
+ return this.o.onError(shouldYield.e);
+ }
+ shouldYield && this.o.onNext(x);
+ };
+ InnerObserver.prototype.onError = function (e) {
+ if(!this.isStopped) { this.isStopped = true; this.o.onError(e); }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if(!this.isStopped) { this.isStopped = true; this.o.onCompleted(); }
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ return FilterObservable;
+
+ }(ObservableBase));
+
+ /**
+ * Filters the elements of an observable sequence based on a predicate by incorporating the element's index.
+ * @param {Function} predicate A function to test each source element for a condition; the second parameter of the function represents the index of the source element.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence that contains elements from the input sequence that satisfy the condition.
+ */
+ observableProto.filter = observableProto.where = function (predicate, thisArg) {
+ return this instanceof FilterObservable ? this.internalFilter(predicate, thisArg) :
+ new FilterObservable(this, predicate, thisArg);
+ };
+
+ /**
+ * Executes a transducer to transform the observable sequence
+ * @param {Transducer} transducer A transducer to execute
+ * @returns {Observable} An Observable sequence containing the results from the transducer.
+ */
+ observableProto.transduce = function(transducer) {
+ var source = this;
+
+ function transformForObserver(o) {
+ return {
+ '@@transducer/init': function() {
+ return o;
+ },
+ '@@transducer/step': function(obs, input) {
+ return obs.onNext(input);
+ },
+ '@@transducer/result': function(obs) {
+ return obs.onCompleted();
+ }
+ };
+ }
+
+ return new AnonymousObservable(function(o) {
+ var xform = transducer(transformForObserver(o));
+ return source.subscribe(
+ function(v) {
+ try {
+ xform['@@transducer/step'](o, v);
+ } catch (e) {
+ o.onError(e);
+ }
+ },
+ function (e) { o.onError(e); },
+ function() { xform['@@transducer/result'](o); }
+ );
+ }, source);
+ };
+
+ var AnonymousObservable = Rx.AnonymousObservable = (function (__super__) {
+ inherits(AnonymousObservable, __super__);
+
+ // Fix subscriber to check for undefined or function returned to decorate as Disposable
+ function fixSubscriber(subscriber) {
+ return subscriber && isFunction(subscriber.dispose) ? subscriber :
+ isFunction(subscriber) ? disposableCreate(subscriber) : disposableEmpty;
+ }
+
+ function setDisposable(s, state) {
+ var ado = state[0], subscribe = state[1];
+ var sub = tryCatch(subscribe)(ado);
+
+ if (sub === errorObj) {
+ if(!ado.fail(errorObj.e)) { return thrower(errorObj.e); }
+ }
+ ado.setDisposable(fixSubscriber(sub));
+ }
+
+ function AnonymousObservable(subscribe, parent) {
+ this.source = parent;
+
+ function s(observer) {
+ var ado = new AutoDetachObserver(observer), state = [ado, subscribe];
+
+ if (currentThreadScheduler.scheduleRequired()) {
+ currentThreadScheduler.scheduleWithState(state, setDisposable);
+ } else {
+ setDisposable(null, state);
+ }
+ return ado;
+ }
+
+ __super__.call(this, s);
+ }
+
+ return AnonymousObservable;
+
+ }(Observable));
+
+ var AutoDetachObserver = (function (__super__) {
+ inherits(AutoDetachObserver, __super__);
+
+ function AutoDetachObserver(observer) {
+ __super__.call(this);
+ this.observer = observer;
+ this.m = new SingleAssignmentDisposable();
+ }
+
+ var AutoDetachObserverPrototype = AutoDetachObserver.prototype;
+
+ AutoDetachObserverPrototype.next = function (value) {
+ var result = tryCatch(this.observer.onNext).call(this.observer, value);
+ if (result === errorObj) {
+ this.dispose();
+ thrower(result.e);
+ }
+ };
+
+ AutoDetachObserverPrototype.error = function (err) {
+ var result = tryCatch(this.observer.onError).call(this.observer, err);
+ this.dispose();
+ result === errorObj && thrower(result.e);
+ };
+
+ AutoDetachObserverPrototype.completed = function () {
+ var result = tryCatch(this.observer.onCompleted).call(this.observer);
+ this.dispose();
+ result === errorObj && thrower(result.e);
+ };
+
+ AutoDetachObserverPrototype.setDisposable = function (value) { this.m.setDisposable(value); };
+ AutoDetachObserverPrototype.getDisposable = function () { return this.m.getDisposable(); };
+
+ AutoDetachObserverPrototype.dispose = function () {
+ __super__.prototype.dispose.call(this);
+ this.m.dispose();
+ };
+
+ return AutoDetachObserver;
+ }(AbstractObserver));
+
+ var InnerSubscription = function (subject, observer) {
+ this.subject = subject;
+ this.observer = observer;
+ };
+
+ InnerSubscription.prototype.dispose = function () {
+ if (!this.subject.isDisposed && this.observer !== null) {
+ var idx = this.subject.observers.indexOf(this.observer);
+ this.subject.observers.splice(idx, 1);
+ this.observer = null;
+ }
+ };
+
+ /**
+ * Represents an object that is both an observable sequence as well as an observer.
+ * Each notification is broadcasted to all subscribed observers.
+ */
+ var Subject = Rx.Subject = (function (__super__) {
+ function subscribe(observer) {
+ checkDisposed(this);
+ if (!this.isStopped) {
+ this.observers.push(observer);
+ return new InnerSubscription(this, observer);
+ }
+ if (this.hasError) {
+ observer.onError(this.error);
+ return disposableEmpty;
+ }
+ observer.onCompleted();
+ return disposableEmpty;
+ }
+
+ inherits(Subject, __super__);
+
+ /**
+ * Creates a subject.
+ */
+ function Subject() {
+ __super__.call(this, subscribe);
+ this.isDisposed = false,
+ this.isStopped = false,
+ this.observers = [];
+ this.hasError = false;
+ }
+
+ addProperties(Subject.prototype, Observer.prototype, {
+ /**
+ * Indicates whether the subject has observers subscribed to it.
+ * @returns {Boolean} Indicates whether the subject has observers subscribed to it.
+ */
+ hasObservers: function () { return this.observers.length > 0; },
+ /**
+ * Notifies all subscribed observers about the end of the sequence.
+ */
+ onCompleted: function () {
+ checkDisposed(this);
+ if (!this.isStopped) {
+ this.isStopped = true;
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ os[i].onCompleted();
+ }
+
+ this.observers.length = 0;
+ }
+ },
+ /**
+ * Notifies all subscribed observers about the exception.
+ * @param {Mixed} error The exception to send to all observers.
+ */
+ onError: function (error) {
+ checkDisposed(this);
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.error = error;
+ this.hasError = true;
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ os[i].onError(error);
+ }
+
+ this.observers.length = 0;
+ }
+ },
+ /**
+ * Notifies all subscribed observers about the arrival of the specified element in the sequence.
+ * @param {Mixed} value The value to send to all observers.
+ */
+ onNext: function (value) {
+ checkDisposed(this);
+ if (!this.isStopped) {
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ os[i].onNext(value);
+ }
+ }
+ },
+ /**
+ * Unsubscribe all observers and release resources.
+ */
+ dispose: function () {
+ this.isDisposed = true;
+ this.observers = null;
+ }
+ });
+
+ /**
+ * Creates a subject from the specified observer and observable.
+ * @param {Observer} observer The observer used to send messages to the subject.
+ * @param {Observable} observable The observable used to subscribe to messages sent from the subject.
+ * @returns {Subject} Subject implemented using the given observer and observable.
+ */
+ Subject.create = function (observer, observable) {
+ return new AnonymousSubject(observer, observable);
+ };
+
+ return Subject;
+ }(Observable));
+
+ /**
+ * Represents the result of an asynchronous operation.
+ * The last value before the OnCompleted notification, or the error received through OnError, is sent to all subscribed observers.
+ */
+ var AsyncSubject = Rx.AsyncSubject = (function (__super__) {
+
+ function subscribe(observer) {
+ checkDisposed(this);
+
+ if (!this.isStopped) {
+ this.observers.push(observer);
+ return new InnerSubscription(this, observer);
+ }
+
+ if (this.hasError) {
+ observer.onError(this.error);
+ } else if (this.hasValue) {
+ observer.onNext(this.value);
+ observer.onCompleted();
+ } else {
+ observer.onCompleted();
+ }
+
+ return disposableEmpty;
+ }
+
+ inherits(AsyncSubject, __super__);
+
+ /**
+ * Creates a subject that can only receive one value and that value is cached for all future observations.
+ * @constructor
+ */
+ function AsyncSubject() {
+ __super__.call(this, subscribe);
+
+ this.isDisposed = false;
+ this.isStopped = false;
+ this.hasValue = false;
+ this.observers = [];
+ this.hasError = false;
+ }
+
+ addProperties(AsyncSubject.prototype, Observer, {
+ /**
+ * Indicates whether the subject has observers subscribed to it.
+ * @returns {Boolean} Indicates whether the subject has observers subscribed to it.
+ */
+ hasObservers: function () {
+ checkDisposed(this);
+ return this.observers.length > 0;
+ },
+ /**
+ * Notifies all subscribed observers about the end of the sequence, also causing the last received value to be sent out (if any).
+ */
+ onCompleted: function () {
+ var i, len;
+ checkDisposed(this);
+ if (!this.isStopped) {
+ this.isStopped = true;
+ var os = cloneArray(this.observers), len = os.length;
+
+ if (this.hasValue) {
+ for (i = 0; i < len; i++) {
+ var o = os[i];
+ o.onNext(this.value);
+ o.onCompleted();
+ }
+ } else {
+ for (i = 0; i < len; i++) {
+ os[i].onCompleted();
+ }
+ }
+
+ this.observers.length = 0;
+ }
+ },
+ /**
+ * Notifies all subscribed observers about the error.
+ * @param {Mixed} error The Error to send to all observers.
+ */
+ onError: function (error) {
+ checkDisposed(this);
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.hasError = true;
+ this.error = error;
+
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ os[i].onError(error);
+ }
+
+ this.observers.length = 0;
+ }
+ },
+ /**
+ * Sends a value to the subject. The last value received before successful termination will be sent to all subscribed and future observers.
+ * @param {Mixed} value The value to store in the subject.
+ */
+ onNext: function (value) {
+ checkDisposed(this);
+ if (this.isStopped) { return; }
+ this.value = value;
+ this.hasValue = true;
+ },
+ /**
+ * Unsubscribe all observers and release resources.
+ */
+ dispose: function () {
+ this.isDisposed = true;
+ this.observers = null;
+ this.exception = null;
+ this.value = null;
+ }
+ });
+
+ return AsyncSubject;
+ }(Observable));
+
+ var AnonymousSubject = Rx.AnonymousSubject = (function (__super__) {
+ inherits(AnonymousSubject, __super__);
+
+ function subscribe(observer) {
+ return this.observable.subscribe(observer);
+ }
+
+ function AnonymousSubject(observer, observable) {
+ this.observer = observer;
+ this.observable = observable;
+ __super__.call(this, subscribe);
+ }
+
+ addProperties(AnonymousSubject.prototype, Observer.prototype, {
+ onCompleted: function () {
+ this.observer.onCompleted();
+ },
+ onError: function (error) {
+ this.observer.onError(error);
+ },
+ onNext: function (value) {
+ this.observer.onNext(value);
+ }
+ });
+
+ return AnonymousSubject;
+ }(Observable));
+
+ if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
+ root.Rx = Rx;
+
+ define(function() {
+ return Rx;
+ });
+ } else if (freeExports && freeModule) {
+ // in Node.js or RingoJS
+ if (moduleExports) {
+ (freeModule.exports = Rx).Rx = Rx;
+ } else {
+ freeExports.Rx = Rx;
+ }
+ } else {
+ // in a browser or Rhino
+ root.Rx = Rx;
+ }
+
+ // All code before this point will be filtered from stack traces.
+ var rEndingLine = captureLine();
+
+}.call(this));
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.compat.js b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.compat.js
new file mode 100644
index 00000000000..a1e5611d0ee
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.compat.js
@@ -0,0 +1,6529 @@
+// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
+
+;(function (undefined) {
+
+ var objectTypes = {
+ 'boolean': false,
+ 'function': true,
+ 'object': true,
+ 'number': false,
+ 'string': false,
+ 'undefined': false
+ };
+
+ var root = (objectTypes[typeof window] && window) || this,
+ freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
+ freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
+ moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
+ freeGlobal = objectTypes[typeof global] && global;
+
+ if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) {
+ root = freeGlobal;
+ }
+
+ var Rx = {
+ internals: {},
+ config: {
+ Promise: root.Promise
+ },
+ helpers: { }
+ };
+
+ // Defaults
+ var noop = Rx.helpers.noop = function () { },
+ notDefined = Rx.helpers.notDefined = function (x) { return typeof x === 'undefined'; },
+ identity = Rx.helpers.identity = function (x) { return x; },
+ pluck = Rx.helpers.pluck = function (property) { return function (x) { return x[property]; }; },
+ just = Rx.helpers.just = function (value) { return function () { return value; }; },
+ defaultNow = Rx.helpers.defaultNow = (function () { return !!Date.now ? Date.now : function () { return +new Date; }; }()),
+ defaultComparer = Rx.helpers.defaultComparer = function (x, y) { return isEqual(x, y); },
+ defaultSubComparer = Rx.helpers.defaultSubComparer = function (x, y) { return x > y ? 1 : (x < y ? -1 : 0); },
+ defaultKeySerializer = Rx.helpers.defaultKeySerializer = function (x) { return x.toString(); },
+ defaultError = Rx.helpers.defaultError = function (err) { throw err; },
+ isPromise = Rx.helpers.isPromise = function (p) { return !!p && typeof p.subscribe !== 'function' && typeof p.then === 'function'; },
+ asArray = Rx.helpers.asArray = function () { return Array.prototype.slice.call(arguments); },
+ not = Rx.helpers.not = function (a) { return !a; },
+ isFunction = Rx.helpers.isFunction = (function () {
+
+ var isFn = function (value) {
+ return typeof value == 'function' || false;
+ }
+
+ // fallback for older versions of Chrome and Safari
+ if (isFn(/x/)) {
+ isFn = function(value) {
+ return typeof value == 'function' && toString.call(value) == '[object Function]';
+ };
+ }
+
+ return isFn;
+ }());
+
+ function cloneArray(arr) {
+ var len = arr.length, a = new Array(len);
+ for(var i = 0; i < len; i++) { a[i] = arr[i]; }
+ return a;
+ }
+
+ Rx.config.longStackSupport = false;
+ var hasStacks = false;
+ try {
+ throw new Error();
+ } catch (e) {
+ hasStacks = !!e.stack;
+ }
+
+ // All code after this point will be filtered from stack traces reported by RxJS
+ var rStartingLine = captureLine(), rFileName;
+
+ var STACK_JUMP_SEPARATOR = "From previous event:";
+
+ function makeStackTraceLong(error, observable) {
+ // If possible, transform the error stack trace by removing Node and RxJS
+ // cruft, then concatenating with the stack trace of `observable`.
+ if (hasStacks &&
+ observable.stack &&
+ typeof error === "object" &&
+ error !== null &&
+ error.stack &&
+ error.stack.indexOf(STACK_JUMP_SEPARATOR) === -1
+ ) {
+ var stacks = [];
+ for (var o = observable; !!o; o = o.source) {
+ if (o.stack) {
+ stacks.unshift(o.stack);
+ }
+ }
+ stacks.unshift(error.stack);
+
+ var concatedStacks = stacks.join("\n" + STACK_JUMP_SEPARATOR + "\n");
+ error.stack = filterStackString(concatedStacks);
+ }
+ }
+
+ function filterStackString(stackString) {
+ var lines = stackString.split("\n"),
+ desiredLines = [];
+ for (var i = 0, len = lines.length; i < len; i++) {
+ var line = lines[i];
+
+ if (!isInternalFrame(line) && !isNodeFrame(line) && line) {
+ desiredLines.push(line);
+ }
+ }
+ return desiredLines.join("\n");
+ }
+
+ function isInternalFrame(stackLine) {
+ var fileNameAndLineNumber = getFileNameAndLineNumber(stackLine);
+ if (!fileNameAndLineNumber) {
+ return false;
+ }
+ var fileName = fileNameAndLineNumber[0], lineNumber = fileNameAndLineNumber[1];
+
+ return fileName === rFileName &&
+ lineNumber >= rStartingLine &&
+ lineNumber <= rEndingLine;
+ }
+
+ function isNodeFrame(stackLine) {
+ return stackLine.indexOf("(module.js:") !== -1 ||
+ stackLine.indexOf("(node.js:") !== -1;
+ }
+
+ function captureLine() {
+ if (!hasStacks) { return; }
+
+ try {
+ throw new Error();
+ } catch (e) {
+ var lines = e.stack.split("\n");
+ var firstLine = lines[0].indexOf("@") > 0 ? lines[1] : lines[2];
+ var fileNameAndLineNumber = getFileNameAndLineNumber(firstLine);
+ if (!fileNameAndLineNumber) { return; }
+
+ rFileName = fileNameAndLineNumber[0];
+ return fileNameAndLineNumber[1];
+ }
+ }
+
+ function getFileNameAndLineNumber(stackLine) {
+ // Named functions: "at functionName (filename:lineNumber:columnNumber)"
+ var attempt1 = /at .+ \((.+):(\d+):(?:\d+)\)$/.exec(stackLine);
+ if (attempt1) { return [attempt1[1], Number(attempt1[2])]; }
+
+ // Anonymous functions: "at filename:lineNumber:columnNumber"
+ var attempt2 = /at ([^ ]+):(\d+):(?:\d+)$/.exec(stackLine);
+ if (attempt2) { return [attempt2[1], Number(attempt2[2])]; }
+
+ // Firefox style: "function@filename:lineNumber or @filename:lineNumber"
+ var attempt3 = /.*@(.+):(\d+)$/.exec(stackLine);
+ if (attempt3) { return [attempt3[1], Number(attempt3[2])]; }
+ }
+
+ var EmptyError = Rx.EmptyError = function() {
+ this.message = 'Sequence contains no elements.';
+ Error.call(this);
+ };
+ EmptyError.prototype = Error.prototype;
+
+ var ObjectDisposedError = Rx.ObjectDisposedError = function() {
+ this.message = 'Object has been disposed';
+ Error.call(this);
+ };
+ ObjectDisposedError.prototype = Error.prototype;
+
+ var ArgumentOutOfRangeError = Rx.ArgumentOutOfRangeError = function () {
+ this.message = 'Argument out of range';
+ Error.call(this);
+ };
+ ArgumentOutOfRangeError.prototype = Error.prototype;
+
+ var NotSupportedError = Rx.NotSupportedError = function (message) {
+ this.message = message || 'This operation is not supported';
+ Error.call(this);
+ };
+ NotSupportedError.prototype = Error.prototype;
+
+ var NotImplementedError = Rx.NotImplementedError = function (message) {
+ this.message = message || 'This operation is not implemented';
+ Error.call(this);
+ };
+ NotImplementedError.prototype = Error.prototype;
+
+ var notImplemented = Rx.helpers.notImplemented = function () {
+ throw new NotImplementedError();
+ };
+
+ var notSupported = Rx.helpers.notSupported = function () {
+ throw new NotSupportedError();
+ };
+
+ // Shim in iterator support
+ var $iterator$ = (typeof Symbol === 'function' && Symbol.iterator) ||
+ '_es6shim_iterator_';
+ // Bug for mozilla version
+ if (root.Set && typeof new root.Set()['@@iterator'] === 'function') {
+ $iterator$ = '@@iterator';
+ }
+
+ var doneEnumerator = Rx.doneEnumerator = { done: true, value: undefined };
+
+ var isIterable = Rx.helpers.isIterable = function (o) {
+ return o[$iterator$] !== undefined;
+ }
+
+ var isArrayLike = Rx.helpers.isArrayLike = function (o) {
+ return o && o.length !== undefined;
+ }
+
+ Rx.helpers.iterator = $iterator$;
+
+ var bindCallback = Rx.internals.bindCallback = function (func, thisArg, argCount) {
+ if (typeof thisArg === 'undefined') { return func; }
+ switch(argCount) {
+ case 0:
+ return function() {
+ return func.call(thisArg)
+ };
+ case 1:
+ return function(arg) {
+ return func.call(thisArg, arg);
+ }
+ case 2:
+ return function(value, index) {
+ return func.call(thisArg, value, index);
+ };
+ case 3:
+ return function(value, index, collection) {
+ return func.call(thisArg, value, index, collection);
+ };
+ }
+
+ return function() {
+ return func.apply(thisArg, arguments);
+ };
+ };
+
+ /** Used to determine if values are of the language type Object */
+ var dontEnums = ['toString',
+ 'toLocaleString',
+ 'valueOf',
+ 'hasOwnProperty',
+ 'isPrototypeOf',
+ 'propertyIsEnumerable',
+ 'constructor'],
+ dontEnumsLength = dontEnums.length;
+
+ /** `Object#toString` result shortcuts */
+ var argsClass = '[object Arguments]',
+ arrayClass = '[object Array]',
+ boolClass = '[object Boolean]',
+ dateClass = '[object Date]',
+ errorClass = '[object Error]',
+ funcClass = '[object Function]',
+ numberClass = '[object Number]',
+ objectClass = '[object Object]',
+ regexpClass = '[object RegExp]',
+ stringClass = '[object String]';
+
+ var toString = Object.prototype.toString,
+ hasOwnProperty = Object.prototype.hasOwnProperty,
+ supportsArgsClass = toString.call(arguments) == argsClass, // For less <IE9 && FF<4
+ supportNodeClass,
+ errorProto = Error.prototype,
+ objectProto = Object.prototype,
+ stringProto = String.prototype,
+ propertyIsEnumerable = objectProto.propertyIsEnumerable;
+
+ try {
+ supportNodeClass = !(toString.call(document) == objectClass && !({ 'toString': 0 } + ''));
+ } catch (e) {
+ supportNodeClass = true;
+ }
+
+ var nonEnumProps = {};
+ nonEnumProps[arrayClass] = nonEnumProps[dateClass] = nonEnumProps[numberClass] = { 'constructor': true, 'toLocaleString': true, 'toString': true, 'valueOf': true };
+ nonEnumProps[boolClass] = nonEnumProps[stringClass] = { 'constructor': true, 'toString': true, 'valueOf': true };
+ nonEnumProps[errorClass] = nonEnumProps[funcClass] = nonEnumProps[regexpClass] = { 'constructor': true, 'toString': true };
+ nonEnumProps[objectClass] = { 'constructor': true };
+
+ var support = {};
+ (function () {
+ var ctor = function() { this.x = 1; },
+ props = [];
+
+ ctor.prototype = { 'valueOf': 1, 'y': 1 };
+ for (var key in new ctor) { props.push(key); }
+ for (key in arguments) { }
+
+ // Detect if `name` or `message` properties of `Error.prototype` are enumerable by default.
+ support.enumErrorProps = propertyIsEnumerable.call(errorProto, 'message') || propertyIsEnumerable.call(errorProto, 'name');
+
+ // Detect if `prototype` properties are enumerable by default.
+ support.enumPrototypes = propertyIsEnumerable.call(ctor, 'prototype');
+
+ // Detect if `arguments` object indexes are non-enumerable
+ support.nonEnumArgs = key != 0;
+
+ // Detect if properties shadowing those on `Object.prototype` are non-enumerable.
+ support.nonEnumShadows = !/valueOf/.test(props);
+ }(1));
+
+ var isObject = Rx.internals.isObject = function(value) {
+ var type = typeof value;
+ return value && (type == 'function' || type == 'object') || false;
+ };
+
+ function keysIn(object) {
+ var result = [];
+ if (!isObject(object)) {
+ return result;
+ }
+ if (support.nonEnumArgs && object.length && isArguments(object)) {
+ object = slice.call(object);
+ }
+ var skipProto = support.enumPrototypes && typeof object == 'function',
+ skipErrorProps = support.enumErrorProps && (object === errorProto || object instanceof Error);
+
+ for (var key in object) {
+ if (!(skipProto && key == 'prototype') &&
+ !(skipErrorProps && (key == 'message' || key == 'name'))) {
+ result.push(key);
+ }
+ }
+
+ if (support.nonEnumShadows && object !== objectProto) {
+ var ctor = object.constructor,
+ index = -1,
+ length = dontEnumsLength;
+
+ if (object === (ctor && ctor.prototype)) {
+ var className = object === stringProto ? stringClass : object === errorProto ? errorClass : toString.call(object),
+ nonEnum = nonEnumProps[className];
+ }
+ while (++index < length) {
+ key = dontEnums[index];
+ if (!(nonEnum && nonEnum[key]) && hasOwnProperty.call(object, key)) {
+ result.push(key);
+ }
+ }
+ }
+ return result;
+ }
+
+ function internalFor(object, callback, keysFunc) {
+ var index = -1,
+ props = keysFunc(object),
+ length = props.length;
+
+ while (++index < length) {
+ var key = props[index];
+ if (callback(object[key], key, object) === false) {
+ break;
+ }
+ }
+ return object;
+ }
+
+ function internalForIn(object, callback) {
+ return internalFor(object, callback, keysIn);
+ }
+
+ function isNode(value) {
+ // IE < 9 presents DOM nodes as `Object` objects except they have `toString`
+ // methods that are `typeof` "string" and still can coerce nodes to strings
+ return typeof value.toString != 'function' && typeof (value + '') == 'string';
+ }
+
+ var isArguments = function(value) {
+ return (value && typeof value == 'object') ? toString.call(value) == argsClass : false;
+ }
+
+ // fallback for browsers that can't detect `arguments` objects by [[Class]]
+ if (!supportsArgsClass) {
+ isArguments = function(value) {
+ return (value && typeof value == 'object') ? hasOwnProperty.call(value, 'callee') : false;
+ };
+ }
+
+ var isEqual = Rx.internals.isEqual = function (x, y) {
+ return deepEquals(x, y, [], []);
+ };
+
+ /** @private
+ * Used for deep comparison
+ **/
+ function deepEquals(a, b, stackA, stackB) {
+ // exit early for identical values
+ if (a === b) {
+ // treat `+0` vs. `-0` as not equal
+ return a !== 0 || (1 / a == 1 / b);
+ }
+
+ var type = typeof a,
+ otherType = typeof b;
+
+ // exit early for unlike primitive values
+ if (a === a && (a == null || b == null ||
+ (type != 'function' && type != 'object' && otherType != 'function' && otherType != 'object'))) {
+ return false;
+ }
+
+ // compare [[Class]] names
+ var className = toString.call(a),
+ otherClass = toString.call(b);
+
+ if (className == argsClass) {
+ className = objectClass;
+ }
+ if (otherClass == argsClass) {
+ otherClass = objectClass;
+ }
+ if (className != otherClass) {
+ return false;
+ }
+ switch (className) {
+ case boolClass:
+ case dateClass:
+ // coerce dates and booleans to numbers, dates to milliseconds and booleans
+ // to `1` or `0` treating invalid dates coerced to `NaN` as not equal
+ return +a == +b;
+
+ case numberClass:
+ // treat `NaN` vs. `NaN` as equal
+ return (a != +a) ?
+ b != +b :
+ // but treat `-0` vs. `+0` as not equal
+ (a == 0 ? (1 / a == 1 / b) : a == +b);
+
+ case regexpClass:
+ case stringClass:
+ // coerce regexes to strings (http://es5.github.io/#x15.10.6.4)
+ // treat string primitives and their corresponding object instances as equal
+ return a == String(b);
+ }
+ var isArr = className == arrayClass;
+ if (!isArr) {
+
+ // exit for functions and DOM nodes
+ if (className != objectClass || (!support.nodeClass && (isNode(a) || isNode(b)))) {
+ return false;
+ }
+ // in older versions of Opera, `arguments` objects have `Array` constructors
+ var ctorA = !support.argsObject && isArguments(a) ? Object : a.constructor,
+ ctorB = !support.argsObject && isArguments(b) ? Object : b.constructor;
+
+ // non `Object` object instances with different constructors are not equal
+ if (ctorA != ctorB &&
+ !(hasOwnProperty.call(a, 'constructor') && hasOwnProperty.call(b, 'constructor')) &&
+ !(isFunction(ctorA) && ctorA instanceof ctorA && isFunction(ctorB) && ctorB instanceof ctorB) &&
+ ('constructor' in a && 'constructor' in b)
+ ) {
+ return false;
+ }
+ }
+ // assume cyclic structures are equal
+ // the algorithm for detecting cyclic structures is adapted from ES 5.1
+ // section 15.12.3, abstract operation `JO` (http://es5.github.io/#x15.12.3)
+ var initedStack = !stackA;
+ stackA || (stackA = []);
+ stackB || (stackB = []);
+
+ var length = stackA.length;
+ while (length--) {
+ if (stackA[length] == a) {
+ return stackB[length] == b;
+ }
+ }
+ var size = 0;
+ var result = true;
+
+ // add `a` and `b` to the stack of traversed objects
+ stackA.push(a);
+ stackB.push(b);
+
+ // recursively compare objects and arrays (susceptible to call stack limits)
+ if (isArr) {
+ // compare lengths to determine if a deep comparison is necessary
+ length = a.length;
+ size = b.length;
+ result = size == length;
+
+ if (result) {
+ // deep compare the contents, ignoring non-numeric properties
+ while (size--) {
+ var index = length,
+ value = b[size];
+
+ if (!(result = deepEquals(a[size], value, stackA, stackB))) {
+ break;
+ }
+ }
+ }
+ }
+ else {
+ // deep compare objects using `forIn`, instead of `forOwn`, to avoid `Object.keys`
+ // which, in this case, is more costly
+ internalForIn(b, function(value, key, b) {
+ if (hasOwnProperty.call(b, key)) {
+ // count the number of properties.
+ size++;
+ // deep compare each property value.
+ return (result = hasOwnProperty.call(a, key) && deepEquals(a[key], value, stackA, stackB));
+ }
+ });
+
+ if (result) {
+ // ensure both objects have the same number of properties
+ internalForIn(a, function(value, key, a) {
+ if (hasOwnProperty.call(a, key)) {
+ // `size` will be `-1` if `a` has more properties than `b`
+ return (result = --size > -1);
+ }
+ });
+ }
+ }
+ stackA.pop();
+ stackB.pop();
+
+ return result;
+ }
+
+ var errorObj = {e: {}};
+ var tryCatchTarget;
+ function tryCatcher() {
+ try {
+ return tryCatchTarget.apply(this, arguments);
+ } catch (e) {
+ errorObj.e = e;
+ return errorObj;
+ }
+ }
+ function tryCatch(fn) {
+ if (!isFunction(fn)) { throw new TypeError('fn must be a function'); }
+ tryCatchTarget = fn;
+ return tryCatcher;
+ }
+ function thrower(e) {
+ throw e;
+ }
+
+ var hasProp = {}.hasOwnProperty,
+ slice = Array.prototype.slice;
+
+ var inherits = this.inherits = Rx.internals.inherits = function (child, parent) {
+ function __() { this.constructor = child; }
+ __.prototype = parent.prototype;
+ child.prototype = new __();
+ };
+
+ var addProperties = Rx.internals.addProperties = function (obj) {
+ for(var sources = [], i = 1, len = arguments.length; i < len; i++) { sources.push(arguments[i]); }
+ for (var idx = 0, ln = sources.length; idx < ln; idx++) {
+ var source = sources[idx];
+ for (var prop in source) {
+ obj[prop] = source[prop];
+ }
+ }
+ };
+
+ // Rx Utils
+ var addRef = Rx.internals.addRef = function (xs, r) {
+ return new AnonymousObservable(function (observer) {
+ return new CompositeDisposable(r.getDisposable(), xs.subscribe(observer));
+ });
+ };
+
+ function arrayInitialize(count, factory) {
+ var a = new Array(count);
+ for (var i = 0; i < count; i++) {
+ a[i] = factory();
+ }
+ return a;
+ }
+
+ // Utilities
+ if (!Function.prototype.bind) {
+ Function.prototype.bind = function (that) {
+ var target = this,
+ args = slice.call(arguments, 1);
+ var bound = function () {
+ if (this instanceof bound) {
+ function F() { }
+ F.prototype = target.prototype;
+ var self = new F();
+ var result = target.apply(self, args.concat(slice.call(arguments)));
+ if (Object(result) === result) {
+ return result;
+ }
+ return self;
+ } else {
+ return target.apply(that, args.concat(slice.call(arguments)));
+ }
+ };
+
+ return bound;
+ };
+ }
+
+ if (!Array.prototype.forEach) {
+ Array.prototype.forEach = function (callback, thisArg) {
+ var T, k;
+
+ if (this == null) {
+ throw new TypeError(" this is null or not defined");
+ }
+
+ var O = Object(this);
+ var len = O.length >>> 0;
+
+ if (typeof callback !== "function") {
+ throw new TypeError(callback + " is not a function");
+ }
+
+ if (arguments.length > 1) {
+ T = thisArg;
+ }
+
+ k = 0;
+ while (k < len) {
+ var kValue;
+ if (k in O) {
+ kValue = O[k];
+ callback.call(T, kValue, k, O);
+ }
+ k++;
+ }
+ };
+ }
+
+ var boxedString = Object("a"),
+ splitString = boxedString[0] != "a" || !(0 in boxedString);
+ if (!Array.prototype.every) {
+ Array.prototype.every = function every(fun /*, thisp */) {
+ var object = Object(this),
+ self = splitString && {}.toString.call(this) == stringClass ?
+ this.split("") :
+ object,
+ length = self.length >>> 0,
+ thisp = arguments[1];
+
+ if ({}.toString.call(fun) != funcClass) {
+ throw new TypeError(fun + " is not a function");
+ }
+
+ for (var i = 0; i < length; i++) {
+ if (i in self && !fun.call(thisp, self[i], i, object)) {
+ return false;
+ }
+ }
+ return true;
+ };
+ }
+
+ if (!Array.prototype.map) {
+ Array.prototype.map = function map(fun /*, thisp*/) {
+ var object = Object(this),
+ self = splitString && {}.toString.call(this) == stringClass ?
+ this.split("") :
+ object,
+ length = self.length >>> 0,
+ result = Array(length),
+ thisp = arguments[1];
+
+ if ({}.toString.call(fun) != funcClass) {
+ throw new TypeError(fun + " is not a function");
+ }
+
+ for (var i = 0; i < length; i++) {
+ if (i in self) {
+ result[i] = fun.call(thisp, self[i], i, object);
+ }
+ }
+ return result;
+ };
+ }
+
+ if (!Array.prototype.filter) {
+ Array.prototype.filter = function (predicate) {
+ var results = [], item, t = new Object(this);
+ for (var i = 0, len = t.length >>> 0; i < len; i++) {
+ item = t[i];
+ if (i in t && predicate.call(arguments[1], item, i, t)) {
+ results.push(item);
+ }
+ }
+ return results;
+ };
+ }
+
+ if (!Array.isArray) {
+ Array.isArray = function (arg) {
+ return {}.toString.call(arg) == arrayClass;
+ };
+ }
+
+ if (!Array.prototype.indexOf) {
+ Array.prototype.indexOf = function indexOf(searchElement) {
+ var t = Object(this);
+ var len = t.length >>> 0;
+ if (len === 0) {
+ return -1;
+ }
+ var n = 0;
+ if (arguments.length > 1) {
+ n = Number(arguments[1]);
+ if (n !== n) {
+ n = 0;
+ } else if (n !== 0 && n != Infinity && n !== -Infinity) {
+ n = (n > 0 || -1) * Math.floor(Math.abs(n));
+ }
+ }
+ if (n >= len) {
+ return -1;
+ }
+ var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0);
+ for (; k < len; k++) {
+ if (k in t && t[k] === searchElement) {
+ return k;
+ }
+ }
+ return -1;
+ };
+ }
+
+ // Fix for Tessel
+ if (!Object.prototype.propertyIsEnumerable) {
+ Object.prototype.propertyIsEnumerable = function (key) {
+ for (var k in this) { if (k === key) { return true; } }
+ return false;
+ };
+ }
+
+ if (!Object.keys) {
+ Object.keys = (function() {
+ 'use strict';
+ var hasOwnProperty = Object.prototype.hasOwnProperty,
+ hasDontEnumBug = !({ toString: null }).propertyIsEnumerable('toString');
+
+ return function(obj) {
+ if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) {
+ throw new TypeError('Object.keys called on non-object');
+ }
+
+ var result = [], prop, i;
+
+ for (prop in obj) {
+ if (hasOwnProperty.call(obj, prop)) {
+ result.push(prop);
+ }
+ }
+
+ if (hasDontEnumBug) {
+ for (i = 0; i < dontEnumsLength; i++) {
+ if (hasOwnProperty.call(obj, dontEnums[i])) {
+ result.push(dontEnums[i]);
+ }
+ }
+ }
+ return result;
+ };
+ }());
+ }
+
+ // Collections
+ function IndexedItem(id, value) {
+ this.id = id;
+ this.value = value;
+ }
+
+ IndexedItem.prototype.compareTo = function (other) {
+ var c = this.value.compareTo(other.value);
+ c === 0 && (c = this.id - other.id);
+ return c;
+ };
+
+ // Priority Queue for Scheduling
+ var PriorityQueue = Rx.internals.PriorityQueue = function (capacity) {
+ this.items = new Array(capacity);
+ this.length = 0;
+ };
+
+ var priorityProto = PriorityQueue.prototype;
+ priorityProto.isHigherPriority = function (left, right) {
+ return this.items[left].compareTo(this.items[right]) < 0;
+ };
+
+ priorityProto.percolate = function (index) {
+ if (index >= this.length || index < 0) { return; }
+ var parent = index - 1 >> 1;
+ if (parent < 0 || parent === index) { return; }
+ if (this.isHigherPriority(index, parent)) {
+ var temp = this.items[index];
+ this.items[index] = this.items[parent];
+ this.items[parent] = temp;
+ this.percolate(parent);
+ }
+ };
+
+ priorityProto.heapify = function (index) {
+ +index || (index = 0);
+ if (index >= this.length || index < 0) { return; }
+ var left = 2 * index + 1,
+ right = 2 * index + 2,
+ first = index;
+ if (left < this.length && this.isHigherPriority(left, first)) {
+ first = left;
+ }
+ if (right < this.length && this.isHigherPriority(right, first)) {
+ first = right;
+ }
+ if (first !== index) {
+ var temp = this.items[index];
+ this.items[index] = this.items[first];
+ this.items[first] = temp;
+ this.heapify(first);
+ }
+ };
+
+ priorityProto.peek = function () { return this.items[0].value; };
+
+ priorityProto.removeAt = function (index) {
+ this.items[index] = this.items[--this.length];
+ this.items[this.length] = undefined;
+ this.heapify();
+ };
+
+ priorityProto.dequeue = function () {
+ var result = this.peek();
+ this.removeAt(0);
+ return result;
+ };
+
+ priorityProto.enqueue = function (item) {
+ var index = this.length++;
+ this.items[index] = new IndexedItem(PriorityQueue.count++, item);
+ this.percolate(index);
+ };
+
+ priorityProto.remove = function (item) {
+ for (var i = 0; i < this.length; i++) {
+ if (this.items[i].value === item) {
+ this.removeAt(i);
+ return true;
+ }
+ }
+ return false;
+ };
+ PriorityQueue.count = 0;
+
+ /**
+ * Represents a group of disposable resources that are disposed together.
+ * @constructor
+ */
+ var CompositeDisposable = Rx.CompositeDisposable = function () {
+ var args = [], i, len;
+ if (Array.isArray(arguments[0])) {
+ args = arguments[0];
+ len = args.length;
+ } else {
+ len = arguments.length;
+ args = new Array(len);
+ for(i = 0; i < len; i++) { args[i] = arguments[i]; }
+ }
+ for(i = 0; i < len; i++) {
+ if (!isDisposable(args[i])) { throw new TypeError('Not a disposable'); }
+ }
+ this.disposables = args;
+ this.isDisposed = false;
+ this.length = args.length;
+ };
+
+ var CompositeDisposablePrototype = CompositeDisposable.prototype;
+
+ /**
+ * Adds a disposable to the CompositeDisposable or disposes the disposable if the CompositeDisposable is disposed.
+ * @param {Mixed} item Disposable to add.
+ */
+ CompositeDisposablePrototype.add = function (item) {
+ if (this.isDisposed) {
+ item.dispose();
+ } else {
+ this.disposables.push(item);
+ this.length++;
+ }
+ };
+
+ /**
+ * Removes and disposes the first occurrence of a disposable from the CompositeDisposable.
+ * @param {Mixed} item Disposable to remove.
+ * @returns {Boolean} true if found; false otherwise.
+ */
+ CompositeDisposablePrototype.remove = function (item) {
+ var shouldDispose = false;
+ if (!this.isDisposed) {
+ var idx = this.disposables.indexOf(item);
+ if (idx !== -1) {
+ shouldDispose = true;
+ this.disposables.splice(idx, 1);
+ this.length--;
+ item.dispose();
+ }
+ }
+ return shouldDispose;
+ };
+
+ /**
+ * Disposes all disposables in the group and removes them from the group.
+ */
+ CompositeDisposablePrototype.dispose = function () {
+ if (!this.isDisposed) {
+ this.isDisposed = true;
+ var len = this.disposables.length, currentDisposables = new Array(len);
+ for(var i = 0; i < len; i++) { currentDisposables[i] = this.disposables[i]; }
+ this.disposables = [];
+ this.length = 0;
+
+ for (i = 0; i < len; i++) {
+ currentDisposables[i].dispose();
+ }
+ }
+ };
+
+ /**
+ * Provides a set of static methods for creating Disposables.
+ * @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once.
+ */
+ var Disposable = Rx.Disposable = function (action) {
+ this.isDisposed = false;
+ this.action = action || noop;
+ };
+
+ /** Performs the task of cleaning up resources. */
+ Disposable.prototype.dispose = function () {
+ if (!this.isDisposed) {
+ this.action();
+ this.isDisposed = true;
+ }
+ };
+
+ /**
+ * Creates a disposable object that invokes the specified action when disposed.
+ * @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once.
+ * @return {Disposable} The disposable object that runs the given action upon disposal.
+ */
+ var disposableCreate = Disposable.create = function (action) { return new Disposable(action); };
+
+ /**
+ * Gets the disposable that does nothing when disposed.
+ */
+ var disposableEmpty = Disposable.empty = { dispose: noop };
+
+ /**
+ * Validates whether the given object is a disposable
+ * @param {Object} Object to test whether it has a dispose method
+ * @returns {Boolean} true if a disposable object, else false.
+ */
+ var isDisposable = Disposable.isDisposable = function (d) {
+ return d && isFunction(d.dispose);
+ };
+
+ var checkDisposed = Disposable.checkDisposed = function (disposable) {
+ if (disposable.isDisposed) { throw new ObjectDisposedError(); }
+ };
+
+ // Single assignment
+ var SingleAssignmentDisposable = Rx.SingleAssignmentDisposable = function () {
+ this.isDisposed = false;
+ this.current = null;
+ };
+ SingleAssignmentDisposable.prototype.getDisposable = function () {
+ return this.current;
+ };
+ SingleAssignmentDisposable.prototype.setDisposable = function (value) {
+ if (this.current) { throw new Error('Disposable has already been assigned'); }
+ var shouldDispose = this.isDisposed;
+ !shouldDispose && (this.current = value);
+ shouldDispose && value && value.dispose();
+ };
+ SingleAssignmentDisposable.prototype.dispose = function () {
+ if (!this.isDisposed) {
+ this.isDisposed = true;
+ var old = this.current;
+ this.current = null;
+ }
+ old && old.dispose();
+ };
+
+ // Multiple assignment disposable
+ var SerialDisposable = Rx.SerialDisposable = function () {
+ this.isDisposed = false;
+ this.current = null;
+ };
+ SerialDisposable.prototype.getDisposable = function () {
+ return this.current;
+ };
+ SerialDisposable.prototype.setDisposable = function (value) {
+ var shouldDispose = this.isDisposed;
+ if (!shouldDispose) {
+ var old = this.current;
+ this.current = value;
+ }
+ old && old.dispose();
+ shouldDispose && value && value.dispose();
+ };
+ SerialDisposable.prototype.dispose = function () {
+ if (!this.isDisposed) {
+ this.isDisposed = true;
+ var old = this.current;
+ this.current = null;
+ }
+ old && old.dispose();
+ };
+
+ /**
+ * Represents a disposable resource that only disposes its underlying disposable resource when all dependent disposable objects have been disposed.
+ */
+ var RefCountDisposable = Rx.RefCountDisposable = (function () {
+
+ function InnerDisposable(disposable) {
+ this.disposable = disposable;
+ this.disposable.count++;
+ this.isInnerDisposed = false;
+ }
+
+ InnerDisposable.prototype.dispose = function () {
+ if (!this.disposable.isDisposed && !this.isInnerDisposed) {
+ this.isInnerDisposed = true;
+ this.disposable.count--;
+ if (this.disposable.count === 0 && this.disposable.isPrimaryDisposed) {
+ this.disposable.isDisposed = true;
+ this.disposable.underlyingDisposable.dispose();
+ }
+ }
+ };
+
+ /**
+ * Initializes a new instance of the RefCountDisposable with the specified disposable.
+ * @constructor
+ * @param {Disposable} disposable Underlying disposable.
+ */
+ function RefCountDisposable(disposable) {
+ this.underlyingDisposable = disposable;
+ this.isDisposed = false;
+ this.isPrimaryDisposed = false;
+ this.count = 0;
+ }
+
+ /**
+ * Disposes the underlying disposable only when all dependent disposables have been disposed
+ */
+ RefCountDisposable.prototype.dispose = function () {
+ if (!this.isDisposed && !this.isPrimaryDisposed) {
+ this.isPrimaryDisposed = true;
+ if (this.count === 0) {
+ this.isDisposed = true;
+ this.underlyingDisposable.dispose();
+ }
+ }
+ };
+
+ /**
+ * Returns a dependent disposable that when disposed decreases the refcount on the underlying disposable.
+ * @returns {Disposable} A dependent disposable contributing to the reference count that manages the underlying disposable's lifetime.
+ */
+ RefCountDisposable.prototype.getDisposable = function () {
+ return this.isDisposed ? disposableEmpty : new InnerDisposable(this);
+ };
+
+ return RefCountDisposable;
+ })();
+
+ var ScheduledItem = Rx.internals.ScheduledItem = function (scheduler, state, action, dueTime, comparer) {
+ this.scheduler = scheduler;
+ this.state = state;
+ this.action = action;
+ this.dueTime = dueTime;
+ this.comparer = comparer || defaultSubComparer;
+ this.disposable = new SingleAssignmentDisposable();
+ }
+
+ ScheduledItem.prototype.invoke = function () {
+ this.disposable.setDisposable(this.invokeCore());
+ };
+
+ ScheduledItem.prototype.compareTo = function (other) {
+ return this.comparer(this.dueTime, other.dueTime);
+ };
+
+ ScheduledItem.prototype.isCancelled = function () {
+ return this.disposable.isDisposed;
+ };
+
+ ScheduledItem.prototype.invokeCore = function () {
+ return this.action(this.scheduler, this.state);
+ };
+
+ /** Provides a set of static properties to access commonly used schedulers. */
+ var Scheduler = Rx.Scheduler = (function () {
+
+ function Scheduler(now, schedule, scheduleRelative, scheduleAbsolute) {
+ this.now = now;
+ this._schedule = schedule;
+ this._scheduleRelative = scheduleRelative;
+ this._scheduleAbsolute = scheduleAbsolute;
+ }
+
+ /** Determines whether the given object is a scheduler */
+ Scheduler.isScheduler = function (s) {
+ return s instanceof Scheduler;
+ }
+
+ function invokeAction(scheduler, action) {
+ action();
+ return disposableEmpty;
+ }
+
+ var schedulerProto = Scheduler.prototype;
+
+ /**
+ * Schedules an action to be executed.
+ * @param {Function} action Action to execute.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.schedule = function (action) {
+ return this._schedule(action, invokeAction);
+ };
+
+ /**
+ * Schedules an action to be executed.
+ * @param state State passed to the action to be executed.
+ * @param {Function} action Action to be executed.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleWithState = function (state, action) {
+ return this._schedule(state, action);
+ };
+
+ /**
+ * Schedules an action to be executed after the specified relative due time.
+ * @param {Function} action Action to execute.
+ * @param {Number} dueTime Relative time after which to execute the action.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleWithRelative = function (dueTime, action) {
+ return this._scheduleRelative(action, dueTime, invokeAction);
+ };
+
+ /**
+ * Schedules an action to be executed after dueTime.
+ * @param state State passed to the action to be executed.
+ * @param {Function} action Action to be executed.
+ * @param {Number} dueTime Relative time after which to execute the action.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleWithRelativeAndState = function (state, dueTime, action) {
+ return this._scheduleRelative(state, dueTime, action);
+ };
+
+ /**
+ * Schedules an action to be executed at the specified absolute due time.
+ * @param {Function} action Action to execute.
+ * @param {Number} dueTime Absolute time at which to execute the action.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleWithAbsolute = function (dueTime, action) {
+ return this._scheduleAbsolute(action, dueTime, invokeAction);
+ };
+
+ /**
+ * Schedules an action to be executed at dueTime.
+ * @param {Mixed} state State passed to the action to be executed.
+ * @param {Function} action Action to be executed.
+ * @param {Number}dueTime Absolute time at which to execute the action.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleWithAbsoluteAndState = function (state, dueTime, action) {
+ return this._scheduleAbsolute(state, dueTime, action);
+ };
+
+ /** Gets the current time according to the local machine's system clock. */
+ Scheduler.now = defaultNow;
+
+ /**
+ * Normalizes the specified TimeSpan value to a positive value.
+ * @param {Number} timeSpan The time span value to normalize.
+ * @returns {Number} The specified TimeSpan value if it is zero or positive; otherwise, 0
+ */
+ Scheduler.normalize = function (timeSpan) {
+ timeSpan < 0 && (timeSpan = 0);
+ return timeSpan;
+ };
+
+ return Scheduler;
+ }());
+
+ var normalizeTime = Scheduler.normalize, isScheduler = Scheduler.isScheduler;
+
+ (function (schedulerProto) {
+
+ function invokeRecImmediate(scheduler, pair) {
+ var state = pair[0], action = pair[1], group = new CompositeDisposable();
+
+ function recursiveAction(state1) {
+ action(state1, function (state2) {
+ var isAdded = false, isDone = false,
+ d = scheduler.scheduleWithState(state2, function (scheduler1, state3) {
+ if (isAdded) {
+ group.remove(d);
+ } else {
+ isDone = true;
+ }
+ recursiveAction(state3);
+ return disposableEmpty;
+ });
+ if (!isDone) {
+ group.add(d);
+ isAdded = true;
+ }
+ });
+ }
+ recursiveAction(state);
+ return group;
+ }
+
+ function invokeRecDate(scheduler, pair, method) {
+ var state = pair[0], action = pair[1], group = new CompositeDisposable();
+ function recursiveAction(state1) {
+ action(state1, function (state2, dueTime1) {
+ var isAdded = false, isDone = false,
+ d = scheduler[method](state2, dueTime1, function (scheduler1, state3) {
+ if (isAdded) {
+ group.remove(d);
+ } else {
+ isDone = true;
+ }
+ recursiveAction(state3);
+ return disposableEmpty;
+ });
+ if (!isDone) {
+ group.add(d);
+ isAdded = true;
+ }
+ });
+ };
+ recursiveAction(state);
+ return group;
+ }
+
+ function scheduleInnerRecursive(action, self) {
+ action(function(dt) { self(action, dt); });
+ }
+
+ /**
+ * Schedules an action to be executed recursively.
+ * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleRecursive = function (action) {
+ return this.scheduleRecursiveWithState(action, scheduleInnerRecursive);
+ };
+
+ /**
+ * Schedules an action to be executed recursively.
+ * @param {Mixed} state State passed to the action to be executed.
+ * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in recursive invocation state.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleRecursiveWithState = function (state, action) {
+ return this.scheduleWithState([state, action], invokeRecImmediate);
+ };
+
+ /**
+ * Schedules an action to be executed recursively after a specified relative due time.
+ * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified relative time.
+ * @param {Number}dueTime Relative time after which to execute the action for the first time.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleRecursiveWithRelative = function (dueTime, action) {
+ return this.scheduleRecursiveWithRelativeAndState(action, dueTime, scheduleInnerRecursive);
+ };
+
+ /**
+ * Schedules an action to be executed recursively after a specified relative due time.
+ * @param {Mixed} state State passed to the action to be executed.
+ * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state.
+ * @param {Number}dueTime Relative time after which to execute the action for the first time.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleRecursiveWithRelativeAndState = function (state, dueTime, action) {
+ return this._scheduleRelative([state, action], dueTime, function (s, p) {
+ return invokeRecDate(s, p, 'scheduleWithRelativeAndState');
+ });
+ };
+
+ /**
+ * Schedules an action to be executed recursively at a specified absolute due time.
+ * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified absolute time.
+ * @param {Number}dueTime Absolute time at which to execute the action for the first time.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleRecursiveWithAbsolute = function (dueTime, action) {
+ return this.scheduleRecursiveWithAbsoluteAndState(action, dueTime, scheduleInnerRecursive);
+ };
+
+ /**
+ * Schedules an action to be executed recursively at a specified absolute due time.
+ * @param {Mixed} state State passed to the action to be executed.
+ * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state.
+ * @param {Number}dueTime Absolute time at which to execute the action for the first time.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleRecursiveWithAbsoluteAndState = function (state, dueTime, action) {
+ return this._scheduleAbsolute([state, action], dueTime, function (s, p) {
+ return invokeRecDate(s, p, 'scheduleWithAbsoluteAndState');
+ });
+ };
+ }(Scheduler.prototype));
+
+ (function (schedulerProto) {
+
+ /**
+ * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation.
+ * @param {Number} period Period for running the work periodically.
+ * @param {Function} action Action to be executed.
+ * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort).
+ */
+ Scheduler.prototype.schedulePeriodic = function (period, action) {
+ return this.schedulePeriodicWithState(null, period, action);
+ };
+
+ /**
+ * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation.
+ * @param {Mixed} state Initial state passed to the action upon the first iteration.
+ * @param {Number} period Period for running the work periodically.
+ * @param {Function} action Action to be executed, potentially updating the state.
+ * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort).
+ */
+ Scheduler.prototype.schedulePeriodicWithState = function(state, period, action) {
+ if (typeof root.setInterval === 'undefined') { throw new NotSupportedError(); }
+ period = normalizeTime(period);
+ var s = state, id = root.setInterval(function () { s = action(s); }, period);
+ return disposableCreate(function () { root.clearInterval(id); });
+ };
+
+ }(Scheduler.prototype));
+
+ /** Gets a scheduler that schedules work immediately on the current thread. */
+ var immediateScheduler = Scheduler.immediate = (function () {
+ function scheduleNow(state, action) { return action(this, state); }
+ return new Scheduler(defaultNow, scheduleNow, notSupported, notSupported);
+ }());
+
+ /**
+ * Gets a scheduler that schedules work as soon as possible on the current thread.
+ */
+ var currentThreadScheduler = Scheduler.currentThread = (function () {
+ var queue;
+
+ function runTrampoline () {
+ while (queue.length > 0) {
+ var item = queue.dequeue();
+ !item.isCancelled() && item.invoke();
+ }
+ }
+
+ function scheduleNow(state, action) {
+ var si = new ScheduledItem(this, state, action, this.now());
+
+ if (!queue) {
+ queue = new PriorityQueue(4);
+ queue.enqueue(si);
+
+ var result = tryCatch(runTrampoline)();
+ queue = null;
+ if (result === errorObj) { return thrower(result.e); }
+ } else {
+ queue.enqueue(si);
+ }
+ return si.disposable;
+ }
+
+ var currentScheduler = new Scheduler(defaultNow, scheduleNow, notSupported, notSupported);
+ currentScheduler.scheduleRequired = function () { return !queue; };
+
+ return currentScheduler;
+ }());
+
+ var SchedulePeriodicRecursive = Rx.internals.SchedulePeriodicRecursive = (function () {
+ function tick(command, recurse) {
+ recurse(0, this._period);
+ try {
+ this._state = this._action(this._state);
+ } catch (e) {
+ this._cancel.dispose();
+ throw e;
+ }
+ }
+
+ function SchedulePeriodicRecursive(scheduler, state, period, action) {
+ this._scheduler = scheduler;
+ this._state = state;
+ this._period = period;
+ this._action = action;
+ }
+
+ SchedulePeriodicRecursive.prototype.start = function () {
+ var d = new SingleAssignmentDisposable();
+ this._cancel = d;
+ d.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0, this._period, tick.bind(this)));
+
+ return d;
+ };
+
+ return SchedulePeriodicRecursive;
+ }());
+
+ var scheduleMethod, clearMethod;
+
+ var localTimer = (function () {
+ var localSetTimeout, localClearTimeout = noop;
+ if (!!root.setTimeout) {
+ localSetTimeout = root.setTimeout;
+ localClearTimeout = root.clearTimeout;
+ } else if (!!root.WScript) {
+ localSetTimeout = function (fn, time) {
+ root.WScript.Sleep(time);
+ fn();
+ };
+ } else {
+ throw new NotSupportedError();
+ }
+
+ return {
+ setTimeout: localSetTimeout,
+ clearTimeout: localClearTimeout
+ };
+ }());
+ var localSetTimeout = localTimer.setTimeout,
+ localClearTimeout = localTimer.clearTimeout;
+
+ (function () {
+
+ var nextHandle = 1, tasksByHandle = {}, currentlyRunning = false;
+
+ clearMethod = function (handle) {
+ delete tasksByHandle[handle];
+ };
+
+ function runTask(handle) {
+ if (currentlyRunning) {
+ localSetTimeout(function () { runTask(handle) }, 0);
+ } else {
+ var task = tasksByHandle[handle];
+ if (task) {
+ currentlyRunning = true;
+ var result = tryCatch(task)();
+ clearMethod(handle);
+ currentlyRunning = false;
+ if (result === errorObj) { return thrower(result.e); }
+ }
+ }
+ }
+
+ var reNative = RegExp('^' +
+ String(toString)
+ .replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
+ .replace(/toString| for [^\]]+/g, '.*?') + '$'
+ );
+
+ var setImmediate = typeof (setImmediate = freeGlobal && moduleExports && freeGlobal.setImmediate) == 'function' &&
+ !reNative.test(setImmediate) && setImmediate;
+
+ function postMessageSupported () {
+ // Ensure not in a worker
+ if (!root.postMessage || root.importScripts) { return false; }
+ var isAsync = false, oldHandler = root.onmessage;
+ // Test for async
+ root.onmessage = function () { isAsync = true; };
+ root.postMessage('', '*');
+ root.onmessage = oldHandler;
+
+ return isAsync;
+ }
+
+ // Use in order, setImmediate, nextTick, postMessage, MessageChannel, script readystatechanged, setTimeout
+ if (isFunction(setImmediate)) {
+ scheduleMethod = function (action) {
+ var id = nextHandle++;
+ tasksByHandle[id] = action;
+ setImmediate(function () { runTask(id); });
+
+ return id;
+ };
+ } else if (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]') {
+ scheduleMethod = function (action) {
+ var id = nextHandle++;
+ tasksByHandle[id] = action;
+ process.nextTick(function () { runTask(id); });
+
+ return id;
+ };
+ } else if (postMessageSupported()) {
+ var MSG_PREFIX = 'ms.rx.schedule' + Math.random();
+
+ function onGlobalPostMessage(event) {
+ // Only if we're a match to avoid any other global events
+ if (typeof event.data === 'string' && event.data.substring(0, MSG_PREFIX.length) === MSG_PREFIX) {
+ runTask(event.data.substring(MSG_PREFIX.length));
+ }
+ }
+
+ if (root.addEventListener) {
+ root.addEventListener('message', onGlobalPostMessage, false);
+ } else if (root.attachEvent) {
+ root.attachEvent('onmessage', onGlobalPostMessage);
+ } else {
+ root.onmessage = onGlobalPostMessage;
+ }
+
+ scheduleMethod = function (action) {
+ var id = nextHandle++;
+ tasksByHandle[id] = action;
+ root.postMessage(MSG_PREFIX + currentId, '*');
+ return id;
+ };
+ } else if (!!root.MessageChannel) {
+ var channel = new root.MessageChannel();
+
+ channel.port1.onmessage = function (e) { runTask(e.data); };
+
+ scheduleMethod = function (action) {
+ var id = nextHandle++;
+ tasksByHandle[id] = action;
+ channel.port2.postMessage(id);
+ return id;
+ };
+ } else if ('document' in root && 'onreadystatechange' in root.document.createElement('script')) {
+
+ scheduleMethod = function (action) {
+ var scriptElement = root.document.createElement('script');
+ var id = nextHandle++;
+ tasksByHandle[id] = action;
+
+ scriptElement.onreadystatechange = function () {
+ runTask(id);
+ scriptElement.onreadystatechange = null;
+ scriptElement.parentNode.removeChild(scriptElement);
+ scriptElement = null;
+ };
+ root.document.documentElement.appendChild(scriptElement);
+ return id;
+ };
+
+ } else {
+ scheduleMethod = function (action) {
+ var id = nextHandle++;
+ tasksByHandle[id] = action;
+ localSetTimeout(function () {
+ runTask(id);
+ }, 0);
+
+ return id;
+ };
+ }
+ }());
+
+ /**
+ * Gets a scheduler that schedules work via a timed callback based upon platform.
+ */
+ var timeoutScheduler = Scheduler.timeout = Scheduler['default'] = (function () {
+
+ function scheduleNow(state, action) {
+ var scheduler = this, disposable = new SingleAssignmentDisposable();
+ var id = scheduleMethod(function () {
+ !disposable.isDisposed && disposable.setDisposable(action(scheduler, state));
+ });
+ return new CompositeDisposable(disposable, disposableCreate(function () {
+ clearMethod(id);
+ }));
+ }
+
+ function scheduleRelative(state, dueTime, action) {
+ var scheduler = this, dt = Scheduler.normalize(dueTime), disposable = new SingleAssignmentDisposable();
+ if (dt === 0) { return scheduler.scheduleWithState(state, action); }
+ var id = localSetTimeout(function () {
+ !disposable.isDisposed && disposable.setDisposable(action(scheduler, state));
+ }, dt);
+ return new CompositeDisposable(disposable, disposableCreate(function () {
+ localClearTimeout(id);
+ }));
+ }
+
+ function scheduleAbsolute(state, dueTime, action) {
+ return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action);
+ }
+
+ return new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute);
+ })();
+
+ /**
+ * Represents a notification to an observer.
+ */
+ var Notification = Rx.Notification = (function () {
+ function Notification(kind, value, exception, accept, acceptObservable, toString) {
+ this.kind = kind;
+ this.value = value;
+ this.exception = exception;
+ this._accept = accept;
+ this._acceptObservable = acceptObservable;
+ this.toString = toString;
+ }
+
+ /**
+ * Invokes the delegate corresponding to the notification or the observer's method corresponding to the notification and returns the produced result.
+ *
+ * @memberOf Notification
+ * @param {Any} observerOrOnNext Delegate to invoke for an OnNext notification or Observer to invoke the notification on..
+ * @param {Function} onError Delegate to invoke for an OnError notification.
+ * @param {Function} onCompleted Delegate to invoke for an OnCompleted notification.
+ * @returns {Any} Result produced by the observation.
+ */
+ Notification.prototype.accept = function (observerOrOnNext, onError, onCompleted) {
+ return observerOrOnNext && typeof observerOrOnNext === 'object' ?
+ this._acceptObservable(observerOrOnNext) :
+ this._accept(observerOrOnNext, onError, onCompleted);
+ };
+
+ /**
+ * Returns an observable sequence with a single notification.
+ *
+ * @memberOf Notifications
+ * @param {Scheduler} [scheduler] Scheduler to send out the notification calls on.
+ * @returns {Observable} The observable sequence that surfaces the behavior of the notification upon subscription.
+ */
+ Notification.prototype.toObservable = function (scheduler) {
+ var self = this;
+ isScheduler(scheduler) || (scheduler = immediateScheduler);
+ return new AnonymousObservable(function (observer) {
+ return scheduler.scheduleWithState(self, function (_, notification) {
+ notification._acceptObservable(observer);
+ notification.kind === 'N' && observer.onCompleted();
+ });
+ });
+ };
+
+ return Notification;
+ })();
+
+ /**
+ * Creates an object that represents an OnNext notification to an observer.
+ * @param {Any} value The value contained in the notification.
+ * @returns {Notification} The OnNext notification containing the value.
+ */
+ var notificationCreateOnNext = Notification.createOnNext = (function () {
+ function _accept(onNext) { return onNext(this.value); }
+ function _acceptObservable(observer) { return observer.onNext(this.value); }
+ function toString() { return 'OnNext(' + this.value + ')'; }
+
+ return function (value) {
+ return new Notification('N', value, null, _accept, _acceptObservable, toString);
+ };
+ }());
+
+ /**
+ * Creates an object that represents an OnError notification to an observer.
+ * @param {Any} error The exception contained in the notification.
+ * @returns {Notification} The OnError notification containing the exception.
+ */
+ var notificationCreateOnError = Notification.createOnError = (function () {
+ function _accept (onNext, onError) { return onError(this.exception); }
+ function _acceptObservable(observer) { return observer.onError(this.exception); }
+ function toString () { return 'OnError(' + this.exception + ')'; }
+
+ return function (e) {
+ return new Notification('E', null, e, _accept, _acceptObservable, toString);
+ };
+ }());
+
+ /**
+ * Creates an object that represents an OnCompleted notification to an observer.
+ * @returns {Notification} The OnCompleted notification.
+ */
+ var notificationCreateOnCompleted = Notification.createOnCompleted = (function () {
+ function _accept (onNext, onError, onCompleted) { return onCompleted(); }
+ function _acceptObservable(observer) { return observer.onCompleted(); }
+ function toString () { return 'OnCompleted()'; }
+
+ return function () {
+ return new Notification('C', null, null, _accept, _acceptObservable, toString);
+ };
+ }());
+
+ /**
+ * Supports push-style iteration over an observable sequence.
+ */
+ var Observer = Rx.Observer = function () { };
+
+ /**
+ * Creates an observer from the specified OnNext, along with optional OnError, and OnCompleted actions.
+ * @param {Function} [onNext] Observer's OnNext action implementation.
+ * @param {Function} [onError] Observer's OnError action implementation.
+ * @param {Function} [onCompleted] Observer's OnCompleted action implementation.
+ * @returns {Observer} The observer object implemented using the given actions.
+ */
+ var observerCreate = Observer.create = function (onNext, onError, onCompleted) {
+ onNext || (onNext = noop);
+ onError || (onError = defaultError);
+ onCompleted || (onCompleted = noop);
+ return new AnonymousObserver(onNext, onError, onCompleted);
+ };
+
+ /**
+ * Abstract base class for implementations of the Observer class.
+ * This base class enforces the grammar of observers where OnError and OnCompleted are terminal messages.
+ */
+ var AbstractObserver = Rx.internals.AbstractObserver = (function (__super__) {
+ inherits(AbstractObserver, __super__);
+
+ /**
+ * Creates a new observer in a non-stopped state.
+ */
+ function AbstractObserver() {
+ this.isStopped = false;
+ __super__.call(this);
+ }
+
+ // Must be implemented by other observers
+ AbstractObserver.prototype.next = notImplemented;
+ AbstractObserver.prototype.error = notImplemented;
+ AbstractObserver.prototype.completed = notImplemented;
+
+ /**
+ * Notifies the observer of a new element in the sequence.
+ * @param {Any} value Next element in the sequence.
+ */
+ AbstractObserver.prototype.onNext = function (value) {
+ if (!this.isStopped) { this.next(value); }
+ };
+
+ /**
+ * Notifies the observer that an exception has occurred.
+ * @param {Any} error The error that has occurred.
+ */
+ AbstractObserver.prototype.onError = function (error) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.error(error);
+ }
+ };
+
+ /**
+ * Notifies the observer of the end of the sequence.
+ */
+ AbstractObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.completed();
+ }
+ };
+
+ /**
+ * Disposes the observer, causing it to transition to the stopped state.
+ */
+ AbstractObserver.prototype.dispose = function () {
+ this.isStopped = true;
+ };
+
+ AbstractObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.error(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ return AbstractObserver;
+ }(Observer));
+
+ /**
+ * Class to create an Observer instance from delegate-based implementations of the on* methods.
+ */
+ var AnonymousObserver = Rx.AnonymousObserver = (function (__super__) {
+ inherits(AnonymousObserver, __super__);
+
+ /**
+ * Creates an observer from the specified OnNext, OnError, and OnCompleted actions.
+ * @param {Any} onNext Observer's OnNext action implementation.
+ * @param {Any} onError Observer's OnError action implementation.
+ * @param {Any} onCompleted Observer's OnCompleted action implementation.
+ */
+ function AnonymousObserver(onNext, onError, onCompleted) {
+ __super__.call(this);
+ this._onNext = onNext;
+ this._onError = onError;
+ this._onCompleted = onCompleted;
+ }
+
+ /**
+ * Calls the onNext action.
+ * @param {Any} value Next element in the sequence.
+ */
+ AnonymousObserver.prototype.next = function (value) {
+ this._onNext(value);
+ };
+
+ /**
+ * Calls the onError action.
+ * @param {Any} error The error that has occurred.
+ */
+ AnonymousObserver.prototype.error = function (error) {
+ this._onError(error);
+ };
+
+ /**
+ * Calls the onCompleted action.
+ */
+ AnonymousObserver.prototype.completed = function () {
+ this._onCompleted();
+ };
+
+ return AnonymousObserver;
+ }(AbstractObserver));
+
+ var observableProto;
+
+ /**
+ * Represents a push-style collection.
+ */
+ var Observable = Rx.Observable = (function () {
+
+ function Observable(subscribe) {
+ if (Rx.config.longStackSupport && hasStacks) {
+ try {
+ throw new Error();
+ } catch (e) {
+ this.stack = e.stack.substring(e.stack.indexOf("\n") + 1);
+ }
+
+ var self = this;
+ this._subscribe = function (observer) {
+ var oldOnError = observer.onError.bind(observer);
+
+ observer.onError = function (err) {
+ makeStackTraceLong(err, self);
+ oldOnError(err);
+ };
+
+ return subscribe.call(self, observer);
+ };
+ } else {
+ this._subscribe = subscribe;
+ }
+ }
+
+ observableProto = Observable.prototype;
+
+ /**
+ * Subscribes an observer to the observable sequence.
+ * @param {Mixed} [observerOrOnNext] The object that is to receive notifications or an action to invoke for each element in the observable sequence.
+ * @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence.
+ * @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence.
+ * @returns {Diposable} A disposable handling the subscriptions and unsubscriptions.
+ */
+ observableProto.subscribe = observableProto.forEach = function (observerOrOnNext, onError, onCompleted) {
+ return this._subscribe(typeof observerOrOnNext === 'object' ?
+ observerOrOnNext :
+ observerCreate(observerOrOnNext, onError, onCompleted));
+ };
+
+ /**
+ * Subscribes to the next value in the sequence with an optional "this" argument.
+ * @param {Function} onNext The function to invoke on each element in the observable sequence.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions.
+ */
+ observableProto.subscribeOnNext = function (onNext, thisArg) {
+ return this._subscribe(observerCreate(typeof thisArg !== 'undefined' ? function(x) { onNext.call(thisArg, x); } : onNext));
+ };
+
+ /**
+ * Subscribes to an exceptional condition in the sequence with an optional "this" argument.
+ * @param {Function} onError The function to invoke upon exceptional termination of the observable sequence.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions.
+ */
+ observableProto.subscribeOnError = function (onError, thisArg) {
+ return this._subscribe(observerCreate(null, typeof thisArg !== 'undefined' ? function(e) { onError.call(thisArg, e); } : onError));
+ };
+
+ /**
+ * Subscribes to the next value in the sequence with an optional "this" argument.
+ * @param {Function} onCompleted The function to invoke upon graceful termination of the observable sequence.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions.
+ */
+ observableProto.subscribeOnCompleted = function (onCompleted, thisArg) {
+ return this._subscribe(observerCreate(null, null, typeof thisArg !== 'undefined' ? function() { onCompleted.call(thisArg); } : onCompleted));
+ };
+
+ return Observable;
+ })();
+
+ var ObservableBase = Rx.ObservableBase = (function (__super__) {
+ inherits(ObservableBase, __super__);
+
+ function fixSubscriber(subscriber) {
+ return subscriber && isFunction(subscriber.dispose) ? subscriber :
+ isFunction(subscriber) ? disposableCreate(subscriber) : disposableEmpty;
+ }
+
+ function setDisposable(s, state) {
+ var ado = state[0], self = state[1];
+ var sub = tryCatch(self.subscribeCore).call(self, ado);
+
+ if (sub === errorObj) {
+ if(!ado.fail(errorObj.e)) { return thrower(errorObj.e); }
+ }
+ ado.setDisposable(fixSubscriber(sub));
+ }
+
+ function subscribe(observer) {
+ var ado = new AutoDetachObserver(observer), state = [ado, this];
+
+ if (currentThreadScheduler.scheduleRequired()) {
+ currentThreadScheduler.scheduleWithState(state, setDisposable);
+ } else {
+ setDisposable(null, state);
+ }
+ return ado;
+ }
+
+ function ObservableBase() {
+ __super__.call(this, subscribe);
+ }
+
+ ObservableBase.prototype.subscribeCore = notImplemented;
+
+ return ObservableBase;
+ }(Observable));
+
+ var Enumerable = Rx.internals.Enumerable = function () { };
+
+ var ConcatEnumerableObservable = (function(__super__) {
+ inherits(ConcatEnumerableObservable, __super__);
+ function ConcatEnumerableObservable(sources) {
+ this.sources = sources;
+ __super__.call(this);
+ }
+
+ ConcatEnumerableObservable.prototype.subscribeCore = function (o) {
+ var isDisposed, subscription = new SerialDisposable();
+ var cancelable = immediateScheduler.scheduleRecursiveWithState(this.sources[$iterator$](), function (e, self) {
+ if (isDisposed) { return; }
+ var currentItem = tryCatch(e.next).call(e);
+ if (currentItem === errorObj) { return o.onError(currentItem.e); }
+
+ if (currentItem.done) {
+ return o.onCompleted();
+ }
+
+ // Check if promise
+ var currentValue = currentItem.value;
+ isPromise(currentValue) && (currentValue = observableFromPromise(currentValue));
+
+ var d = new SingleAssignmentDisposable();
+ subscription.setDisposable(d);
+ d.setDisposable(currentValue.subscribe(new InnerObserver(o, self, e)));
+ });
+
+ return new CompositeDisposable(subscription, cancelable, disposableCreate(function () {
+ isDisposed = true;
+ }));
+ };
+
+ function InnerObserver(o, s, e) {
+ this.o = o;
+ this.s = s;
+ this.e = e;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) { if(!this.isStopped) { this.o.onNext(x); } };
+ InnerObserver.prototype.onError = function (err) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(err);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.s(this.e);
+ }
+ };
+ InnerObserver.prototype.dispose = function () { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (err) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(err);
+ return true;
+ }
+ return false;
+ };
+
+ return ConcatEnumerableObservable;
+ }(ObservableBase));
+
+ Enumerable.prototype.concat = function () {
+ return new ConcatEnumerableObservable(this);
+ };
+
+ var CatchErrorObservable = (function(__super__) {
+ inherits(CatchErrorObservable, __super__);
+ function CatchErrorObservable(sources) {
+ this.sources = sources;
+ __super__.call(this);
+ }
+
+ CatchErrorObservable.prototype.subscribeCore = function (o) {
+ var e = this.sources[$iterator$]();
+
+ var isDisposed, subscription = new SerialDisposable();
+ var cancelable = immediateScheduler.scheduleRecursiveWithState(null, function (lastException, self) {
+ if (isDisposed) { return; }
+ var currentItem = tryCatch(e.next).call(e);
+ if (currentItem === errorObj) { return o.onError(currentItem.e); }
+
+ if (currentItem.done) {
+ return lastException !== null ? o.onError(lastException) : o.onCompleted();
+ }
+
+ // Check if promise
+ var currentValue = currentItem.value;
+ isPromise(currentValue) && (currentValue = observableFromPromise(currentValue));
+
+ var d = new SingleAssignmentDisposable();
+ subscription.setDisposable(d);
+ d.setDisposable(currentValue.subscribe(
+ function(x) { o.onNext(x); },
+ self,
+ function() { o.onCompleted(); }));
+ });
+ return new CompositeDisposable(subscription, cancelable, disposableCreate(function () {
+ isDisposed = true;
+ }));
+ };
+
+ return CatchErrorObservable;
+ }(ObservableBase));
+
+ Enumerable.prototype.catchError = function () {
+ return new CatchErrorObservable(this);
+ };
+
+ Enumerable.prototype.catchErrorWhen = function (notificationHandler) {
+ var sources = this;
+ return new AnonymousObservable(function (o) {
+ var exceptions = new Subject(),
+ notifier = new Subject(),
+ handled = notificationHandler(exceptions),
+ notificationDisposable = handled.subscribe(notifier);
+
+ var e = sources[$iterator$]();
+
+ var isDisposed,
+ lastException,
+ subscription = new SerialDisposable();
+ var cancelable = immediateScheduler.scheduleRecursive(function (self) {
+ if (isDisposed) { return; }
+ var currentItem = tryCatch(e.next).call(e);
+ if (currentItem === errorObj) { return o.onError(currentItem.e); }
+
+ if (currentItem.done) {
+ if (lastException) {
+ o.onError(lastException);
+ } else {
+ o.onCompleted();
+ }
+ return;
+ }
+
+ // Check if promise
+ var currentValue = currentItem.value;
+ isPromise(currentValue) && (currentValue = observableFromPromise(currentValue));
+
+ var outer = new SingleAssignmentDisposable();
+ var inner = new SingleAssignmentDisposable();
+ subscription.setDisposable(new CompositeDisposable(inner, outer));
+ outer.setDisposable(currentValue.subscribe(
+ function(x) { o.onNext(x); },
+ function (exn) {
+ inner.setDisposable(notifier.subscribe(self, function(ex) {
+ o.onError(ex);
+ }, function() {
+ o.onCompleted();
+ }));
+
+ exceptions.onNext(exn);
+ },
+ function() { o.onCompleted(); }));
+ });
+
+ return new CompositeDisposable(notificationDisposable, subscription, cancelable, disposableCreate(function () {
+ isDisposed = true;
+ }));
+ });
+ };
+
+ var RepeatEnumerable = (function (__super__) {
+ inherits(RepeatEnumerable, __super__);
+
+ function RepeatEnumerable(v, c) {
+ this.v = v;
+ this.c = c == null ? -1 : c;
+ }
+ RepeatEnumerable.prototype[$iterator$] = function () {
+ return new RepeatEnumerator(this);
+ };
+
+ function RepeatEnumerator(p) {
+ this.v = p.v;
+ this.l = p.c;
+ }
+ RepeatEnumerator.prototype.next = function () {
+ if (this.l === 0) { return doneEnumerator; }
+ if (this.l > 0) { this.l--; }
+ return { done: false, value: this.v };
+ };
+
+ return RepeatEnumerable;
+ }(Enumerable));
+
+ var enumerableRepeat = Enumerable.repeat = function (value, repeatCount) {
+ return new RepeatEnumerable(value, repeatCount);
+ };
+
+ var OfEnumerable = (function(__super__) {
+ inherits(OfEnumerable, __super__);
+ function OfEnumerable(s, fn, thisArg) {
+ this.s = s;
+ this.fn = fn ? bindCallback(fn, thisArg, 3) : null;
+ }
+ OfEnumerable.prototype[$iterator$] = function () {
+ return new OfEnumerator(this);
+ };
+
+ function OfEnumerator(p) {
+ this.i = -1;
+ this.s = p.s;
+ this.l = this.s.length;
+ this.fn = p.fn;
+ }
+ OfEnumerator.prototype.next = function () {
+ return ++this.i < this.l ?
+ { done: false, value: !this.fn ? this.s[this.i] : this.fn(this.s[this.i], this.i, this.s) } :
+ doneEnumerator;
+ };
+
+ return OfEnumerable;
+ }(Enumerable));
+
+ var enumerableOf = Enumerable.of = function (source, selector, thisArg) {
+ return new OfEnumerable(source, selector, thisArg);
+ };
+
+ var ScheduledObserver = Rx.internals.ScheduledObserver = (function (__super__) {
+ inherits(ScheduledObserver, __super__);
+
+ function ScheduledObserver(scheduler, observer) {
+ __super__.call(this);
+ this.scheduler = scheduler;
+ this.observer = observer;
+ this.isAcquired = false;
+ this.hasFaulted = false;
+ this.queue = [];
+ this.disposable = new SerialDisposable();
+ }
+
+ ScheduledObserver.prototype.next = function (value) {
+ var self = this;
+ this.queue.push(function () { self.observer.onNext(value); });
+ };
+
+ ScheduledObserver.prototype.error = function (e) {
+ var self = this;
+ this.queue.push(function () { self.observer.onError(e); });
+ };
+
+ ScheduledObserver.prototype.completed = function () {
+ var self = this;
+ this.queue.push(function () { self.observer.onCompleted(); });
+ };
+
+ ScheduledObserver.prototype.ensureActive = function () {
+ var isOwner = false, parent = this;
+ if (!this.hasFaulted && this.queue.length > 0) {
+ isOwner = !this.isAcquired;
+ this.isAcquired = true;
+ }
+ if (isOwner) {
+ this.disposable.setDisposable(this.scheduler.scheduleRecursive(function (self) {
+ var work;
+ if (parent.queue.length > 0) {
+ work = parent.queue.shift();
+ } else {
+ parent.isAcquired = false;
+ return;
+ }
+ try {
+ work();
+ } catch (ex) {
+ parent.queue = [];
+ parent.hasFaulted = true;
+ throw ex;
+ }
+ self();
+ }));
+ }
+ };
+
+ ScheduledObserver.prototype.dispose = function () {
+ __super__.prototype.dispose.call(this);
+ this.disposable.dispose();
+ };
+
+ return ScheduledObserver;
+ }(AbstractObserver));
+
+ var ToArrayObservable = (function(__super__) {
+ inherits(ToArrayObservable, __super__);
+ function ToArrayObservable(source) {
+ this.source = source;
+ __super__.call(this);
+ }
+
+ ToArrayObservable.prototype.subscribeCore = function(o) {
+ return this.source.subscribe(new InnerObserver(o));
+ };
+
+ function InnerObserver(o) {
+ this.o = o;
+ this.a = [];
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) { if(!this.isStopped) { this.a.push(x); } };
+ InnerObserver.prototype.onError = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onNext(this.a);
+ this.o.onCompleted();
+ }
+ };
+ InnerObserver.prototype.dispose = function () { this.isStopped = true; }
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ return ToArrayObservable;
+ }(ObservableBase));
+
+ /**
+ * Creates an array from an observable sequence.
+ * @returns {Observable} An observable sequence containing a single element with a list containing all the elements of the source sequence.
+ */
+ observableProto.toArray = function () {
+ return new ToArrayObservable(this);
+ };
+
+ /**
+ * Creates an observable sequence from a specified subscribe method implementation.
+ * @example
+ * var res = Rx.Observable.create(function (observer) { return function () { } );
+ * var res = Rx.Observable.create(function (observer) { return Rx.Disposable.empty; } );
+ * var res = Rx.Observable.create(function (observer) { } );
+ * @param {Function} subscribe Implementation of the resulting observable sequence's subscribe method, returning a function that will be wrapped in a Disposable.
+ * @returns {Observable} The observable sequence with the specified implementation for the Subscribe method.
+ */
+ Observable.create = Observable.createWithDisposable = function (subscribe, parent) {
+ return new AnonymousObservable(subscribe, parent);
+ };
+
+ /**
+ * Returns an observable sequence that invokes the specified factory function whenever a new observer subscribes.
+ *
+ * @example
+ * var res = Rx.Observable.defer(function () { return Rx.Observable.fromArray([1,2,3]); });
+ * @param {Function} observableFactory Observable factory function to invoke for each observer that subscribes to the resulting sequence or Promise.
+ * @returns {Observable} An observable sequence whose observers trigger an invocation of the given observable factory function.
+ */
+ var observableDefer = Observable.defer = function (observableFactory) {
+ return new AnonymousObservable(function (observer) {
+ var result;
+ try {
+ result = observableFactory();
+ } catch (e) {
+ return observableThrow(e).subscribe(observer);
+ }
+ isPromise(result) && (result = observableFromPromise(result));
+ return result.subscribe(observer);
+ });
+ };
+
+ var EmptyObservable = (function(__super__) {
+ inherits(EmptyObservable, __super__);
+ function EmptyObservable(scheduler) {
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ EmptyObservable.prototype.subscribeCore = function (observer) {
+ var sink = new EmptySink(observer, this);
+ return sink.run();
+ };
+
+ function EmptySink(observer, parent) {
+ this.observer = observer;
+ this.parent = parent;
+ }
+
+ function scheduleItem(s, state) {
+ state.onCompleted();
+ }
+
+ EmptySink.prototype.run = function () {
+ return this.parent.scheduler.scheduleWithState(this.observer, scheduleItem);
+ };
+
+ return EmptyObservable;
+ }(ObservableBase));
+
+ /**
+ * Returns an empty observable sequence, using the specified scheduler to send out the single OnCompleted message.
+ *
+ * @example
+ * var res = Rx.Observable.empty();
+ * var res = Rx.Observable.empty(Rx.Scheduler.timeout);
+ * @param {Scheduler} [scheduler] Scheduler to send the termination call on.
+ * @returns {Observable} An observable sequence with no elements.
+ */
+ var observableEmpty = Observable.empty = function (scheduler) {
+ isScheduler(scheduler) || (scheduler = immediateScheduler);
+ return new EmptyObservable(scheduler);
+ };
+
+ var FromObservable = (function(__super__) {
+ inherits(FromObservable, __super__);
+ function FromObservable(iterable, mapper, scheduler) {
+ this.iterable = iterable;
+ this.mapper = mapper;
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ FromObservable.prototype.subscribeCore = function (observer) {
+ var sink = new FromSink(observer, this);
+ return sink.run();
+ };
+
+ return FromObservable;
+ }(ObservableBase));
+
+ var FromSink = (function () {
+ function FromSink(observer, parent) {
+ this.observer = observer;
+ this.parent = parent;
+ }
+
+ FromSink.prototype.run = function () {
+ var list = Object(this.parent.iterable),
+ it = getIterable(list),
+ observer = this.observer,
+ mapper = this.parent.mapper;
+
+ function loopRecursive(i, recurse) {
+ try {
+ var next = it.next();
+ } catch (e) {
+ return observer.onError(e);
+ }
+ if (next.done) {
+ return observer.onCompleted();
+ }
+
+ var result = next.value;
+
+ if (mapper) {
+ try {
+ result = mapper(result, i);
+ } catch (e) {
+ return observer.onError(e);
+ }
+ }
+
+ observer.onNext(result);
+ recurse(i + 1);
+ }
+
+ return this.parent.scheduler.scheduleRecursiveWithState(0, loopRecursive);
+ };
+
+ return FromSink;
+ }());
+
+ var maxSafeInteger = Math.pow(2, 53) - 1;
+
+ function StringIterable(str) {
+ this._s = s;
+ }
+
+ StringIterable.prototype[$iterator$] = function () {
+ return new StringIterator(this._s);
+ };
+
+ function StringIterator(str) {
+ this._s = s;
+ this._l = s.length;
+ this._i = 0;
+ }
+
+ StringIterator.prototype[$iterator$] = function () {
+ return this;
+ };
+
+ StringIterator.prototype.next = function () {
+ return this._i < this._l ? { done: false, value: this._s.charAt(this._i++) } : doneEnumerator;
+ };
+
+ function ArrayIterable(a) {
+ this._a = a;
+ }
+
+ ArrayIterable.prototype[$iterator$] = function () {
+ return new ArrayIterator(this._a);
+ };
+
+ function ArrayIterator(a) {
+ this._a = a;
+ this._l = toLength(a);
+ this._i = 0;
+ }
+
+ ArrayIterator.prototype[$iterator$] = function () {
+ return this;
+ };
+
+ ArrayIterator.prototype.next = function () {
+ return this._i < this._l ? { done: false, value: this._a[this._i++] } : doneEnumerator;
+ };
+
+ function numberIsFinite(value) {
+ return typeof value === 'number' && root.isFinite(value);
+ }
+
+ function isNan(n) {
+ return n !== n;
+ }
+
+ function getIterable(o) {
+ var i = o[$iterator$], it;
+ if (!i && typeof o === 'string') {
+ it = new StringIterable(o);
+ return it[$iterator$]();
+ }
+ if (!i && o.length !== undefined) {
+ it = new ArrayIterable(o);
+ return it[$iterator$]();
+ }
+ if (!i) { throw new TypeError('Object is not iterable'); }
+ return o[$iterator$]();
+ }
+
+ function sign(value) {
+ var number = +value;
+ if (number === 0) { return number; }
+ if (isNaN(number)) { return number; }
+ return number < 0 ? -1 : 1;
+ }
+
+ function toLength(o) {
+ var len = +o.length;
+ if (isNaN(len)) { return 0; }
+ if (len === 0 || !numberIsFinite(len)) { return len; }
+ len = sign(len) * Math.floor(Math.abs(len));
+ if (len <= 0) { return 0; }
+ if (len > maxSafeInteger) { return maxSafeInteger; }
+ return len;
+ }
+
+ /**
+ * This method creates a new Observable sequence from an array-like or iterable object.
+ * @param {Any} arrayLike An array-like or iterable object to convert to an Observable sequence.
+ * @param {Function} [mapFn] Map function to call on every element of the array.
+ * @param {Any} [thisArg] The context to use calling the mapFn if provided.
+ * @param {Scheduler} [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread.
+ */
+ var observableFrom = Observable.from = function (iterable, mapFn, thisArg, scheduler) {
+ if (iterable == null) {
+ throw new Error('iterable cannot be null.')
+ }
+ if (mapFn && !isFunction(mapFn)) {
+ throw new Error('mapFn when provided must be a function');
+ }
+ if (mapFn) {
+ var mapper = bindCallback(mapFn, thisArg, 2);
+ }
+ isScheduler(scheduler) || (scheduler = currentThreadScheduler);
+ return new FromObservable(iterable, mapper, scheduler);
+ }
+
+ var FromArrayObservable = (function(__super__) {
+ inherits(FromArrayObservable, __super__);
+ function FromArrayObservable(args, scheduler) {
+ this.args = args;
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ FromArrayObservable.prototype.subscribeCore = function (observer) {
+ var sink = new FromArraySink(observer, this);
+ return sink.run();
+ };
+
+ return FromArrayObservable;
+ }(ObservableBase));
+
+ function FromArraySink(observer, parent) {
+ this.observer = observer;
+ this.parent = parent;
+ }
+
+ FromArraySink.prototype.run = function () {
+ var observer = this.observer, args = this.parent.args, len = args.length;
+ function loopRecursive(i, recurse) {
+ if (i < len) {
+ observer.onNext(args[i]);
+ recurse(i + 1);
+ } else {
+ observer.onCompleted();
+ }
+ }
+
+ return this.parent.scheduler.scheduleRecursiveWithState(0, loopRecursive);
+ };
+
+ /**
+ * Converts an array to an observable sequence, using an optional scheduler to enumerate the array.
+ * @deprecated use Observable.from or Observable.of
+ * @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on.
+ * @returns {Observable} The observable sequence whose elements are pulled from the given enumerable sequence.
+ */
+ var observableFromArray = Observable.fromArray = function (array, scheduler) {
+ isScheduler(scheduler) || (scheduler = currentThreadScheduler);
+ return new FromArrayObservable(array, scheduler)
+ };
+
+ var NeverObservable = (function(__super__) {
+ inherits(NeverObservable, __super__);
+ function NeverObservable() {
+ __super__.call(this);
+ }
+
+ NeverObservable.prototype.subscribeCore = function (observer) {
+ return disposableEmpty;
+ };
+
+ return NeverObservable;
+ }(ObservableBase));
+
+ /**
+ * Returns a non-terminating observable sequence, which can be used to denote an infinite duration (e.g. when using reactive joins).
+ * @returns {Observable} An observable sequence whose observers will never get called.
+ */
+ var observableNever = Observable.never = function () {
+ return new NeverObservable();
+ };
+
+ function observableOf (scheduler, array) {
+ isScheduler(scheduler) || (scheduler = currentThreadScheduler);
+ return new FromArrayObservable(array, scheduler);
+ }
+
+ /**
+ * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments.
+ * @returns {Observable} The observable sequence whose elements are pulled from the given arguments.
+ */
+ Observable.of = function () {
+ var len = arguments.length, args = new Array(len);
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+ return new FromArrayObservable(args, currentThreadScheduler);
+ };
+
+ /**
+ * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments.
+ * @param {Scheduler} scheduler A scheduler to use for scheduling the arguments.
+ * @returns {Observable} The observable sequence whose elements are pulled from the given arguments.
+ */
+ Observable.ofWithScheduler = function (scheduler) {
+ var len = arguments.length, args = new Array(len - 1);
+ for(var i = 1; i < len; i++) { args[i - 1] = arguments[i]; }
+ return new FromArrayObservable(args, scheduler);
+ };
+
+ var PairsObservable = (function(__super__) {
+ inherits(PairsObservable, __super__);
+ function PairsObservable(obj, scheduler) {
+ this.obj = obj;
+ this.keys = Object.keys(obj);
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ PairsObservable.prototype.subscribeCore = function (observer) {
+ var sink = new PairsSink(observer, this);
+ return sink.run();
+ };
+
+ return PairsObservable;
+ }(ObservableBase));
+
+ function PairsSink(observer, parent) {
+ this.observer = observer;
+ this.parent = parent;
+ }
+
+ PairsSink.prototype.run = function () {
+ var observer = this.observer, obj = this.parent.obj, keys = this.parent.keys, len = keys.length;
+ function loopRecursive(i, recurse) {
+ if (i < len) {
+ var key = keys[i];
+ observer.onNext([key, obj[key]]);
+ recurse(i + 1);
+ } else {
+ observer.onCompleted();
+ }
+ }
+
+ return this.parent.scheduler.scheduleRecursiveWithState(0, loopRecursive);
+ };
+
+ /**
+ * Convert an object into an observable sequence of [key, value] pairs.
+ * @param {Object} obj The object to inspect.
+ * @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on.
+ * @returns {Observable} An observable sequence of [key, value] pairs from the object.
+ */
+ Observable.pairs = function (obj, scheduler) {
+ scheduler || (scheduler = currentThreadScheduler);
+ return new PairsObservable(obj, scheduler);
+ };
+
+ var RangeObservable = (function(__super__) {
+ inherits(RangeObservable, __super__);
+ function RangeObservable(start, count, scheduler) {
+ this.start = start;
+ this.rangeCount = count;
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ RangeObservable.prototype.subscribeCore = function (observer) {
+ var sink = new RangeSink(observer, this);
+ return sink.run();
+ };
+
+ return RangeObservable;
+ }(ObservableBase));
+
+ var RangeSink = (function () {
+ function RangeSink(observer, parent) {
+ this.observer = observer;
+ this.parent = parent;
+ }
+
+ RangeSink.prototype.run = function () {
+ var start = this.parent.start, count = this.parent.rangeCount, observer = this.observer;
+ function loopRecursive(i, recurse) {
+ if (i < count) {
+ observer.onNext(start + i);
+ recurse(i + 1);
+ } else {
+ observer.onCompleted();
+ }
+ }
+
+ return this.parent.scheduler.scheduleRecursiveWithState(0, loopRecursive);
+ };
+
+ return RangeSink;
+ }());
+
+ /**
+ * Generates an observable sequence of integral numbers within a specified range, using the specified scheduler to send out observer messages.
+ * @param {Number} start The value of the first integer in the sequence.
+ * @param {Number} count The number of sequential integers to generate.
+ * @param {Scheduler} [scheduler] Scheduler to run the generator loop on. If not specified, defaults to Scheduler.currentThread.
+ * @returns {Observable} An observable sequence that contains a range of sequential integral numbers.
+ */
+ Observable.range = function (start, count, scheduler) {
+ isScheduler(scheduler) || (scheduler = currentThreadScheduler);
+ return new RangeObservable(start, count, scheduler);
+ };
+
+ var RepeatObservable = (function(__super__) {
+ inherits(RepeatObservable, __super__);
+ function RepeatObservable(value, repeatCount, scheduler) {
+ this.value = value;
+ this.repeatCount = repeatCount == null ? -1 : repeatCount;
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ RepeatObservable.prototype.subscribeCore = function (observer) {
+ var sink = new RepeatSink(observer, this);
+ return sink.run();
+ };
+
+ return RepeatObservable;
+ }(ObservableBase));
+
+ function RepeatSink(observer, parent) {
+ this.observer = observer;
+ this.parent = parent;
+ }
+
+ RepeatSink.prototype.run = function () {
+ var observer = this.observer, value = this.parent.value;
+ function loopRecursive(i, recurse) {
+ if (i === -1 || i > 0) {
+ observer.onNext(value);
+ i > 0 && i--;
+ }
+ if (i === 0) { return observer.onCompleted(); }
+ recurse(i);
+ }
+
+ return this.parent.scheduler.scheduleRecursiveWithState(this.parent.repeatCount, loopRecursive);
+ };
+
+ /**
+ * Generates an observable sequence that repeats the given element the specified number of times, using the specified scheduler to send out observer messages.
+ * @param {Mixed} value Element to repeat.
+ * @param {Number} repeatCount [Optiona] Number of times to repeat the element. If not specified, repeats indefinitely.
+ * @param {Scheduler} scheduler Scheduler to run the producer loop on. If not specified, defaults to Scheduler.immediate.
+ * @returns {Observable} An observable sequence that repeats the given element the specified number of times.
+ */
+ Observable.repeat = function (value, repeatCount, scheduler) {
+ isScheduler(scheduler) || (scheduler = currentThreadScheduler);
+ return new RepeatObservable(value, repeatCount, scheduler);
+ };
+
+ var JustObservable = (function(__super__) {
+ inherits(JustObservable, __super__);
+ function JustObservable(value, scheduler) {
+ this.value = value;
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ JustObservable.prototype.subscribeCore = function (observer) {
+ var sink = new JustSink(observer, this);
+ return sink.run();
+ };
+
+ function JustSink(observer, parent) {
+ this.observer = observer;
+ this.parent = parent;
+ }
+
+ function scheduleItem(s, state) {
+ var value = state[0], observer = state[1];
+ observer.onNext(value);
+ observer.onCompleted();
+ }
+
+ JustSink.prototype.run = function () {
+ return this.parent.scheduler.scheduleWithState([this.parent.value, this.observer], scheduleItem);
+ };
+
+ return JustObservable;
+ }(ObservableBase));
+
+ /**
+ * Returns an observable sequence that contains a single element, using the specified scheduler to send out observer messages.
+ * There is an alias called 'just' or browsers <IE9.
+ * @param {Mixed} value Single element in the resulting observable sequence.
+ * @param {Scheduler} scheduler Scheduler to send the single element on. If not specified, defaults to Scheduler.immediate.
+ * @returns {Observable} An observable sequence containing the single specified element.
+ */
+ var observableReturn = Observable['return'] = Observable.just = Observable.returnValue = function (value, scheduler) {
+ isScheduler(scheduler) || (scheduler = immediateScheduler);
+ return new JustObservable(value, scheduler);
+ };
+
+ var ThrowObservable = (function(__super__) {
+ inherits(ThrowObservable, __super__);
+ function ThrowObservable(error, scheduler) {
+ this.error = error;
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ ThrowObservable.prototype.subscribeCore = function (o) {
+ var sink = new ThrowSink(o, this);
+ return sink.run();
+ };
+
+ function ThrowSink(o, p) {
+ this.o = o;
+ this.p = p;
+ }
+
+ function scheduleItem(s, state) {
+ var e = state[0], o = state[1];
+ o.onError(e);
+ }
+
+ ThrowSink.prototype.run = function () {
+ return this.p.scheduler.scheduleWithState([this.p.error, this.o], scheduleItem);
+ };
+
+ return ThrowObservable;
+ }(ObservableBase));
+
+ /**
+ * Returns an observable sequence that terminates with an exception, using the specified scheduler to send out the single onError message.
+ * There is an alias to this method called 'throwError' for browsers <IE9.
+ * @param {Mixed} error An object used for the sequence's termination.
+ * @param {Scheduler} scheduler Scheduler to send the exceptional termination call on. If not specified, defaults to Scheduler.immediate.
+ * @returns {Observable} The observable sequence that terminates exceptionally with the specified exception object.
+ */
+ var observableThrow = Observable['throw'] = Observable.throwError = Observable.throwException = function (error, scheduler) {
+ isScheduler(scheduler) || (scheduler = immediateScheduler);
+ return new ThrowObservable(error, scheduler);
+ };
+
+ function observableCatchHandler(source, handler) {
+ return new AnonymousObservable(function (o) {
+ var d1 = new SingleAssignmentDisposable(), subscription = new SerialDisposable();
+ subscription.setDisposable(d1);
+ d1.setDisposable(source.subscribe(function (x) { o.onNext(x); }, function (e) {
+ try {
+ var result = handler(e);
+ } catch (ex) {
+ return o.onError(ex);
+ }
+ isPromise(result) && (result = observableFromPromise(result));
+
+ var d = new SingleAssignmentDisposable();
+ subscription.setDisposable(d);
+ d.setDisposable(result.subscribe(o));
+ }, function (x) { o.onCompleted(x); }));
+
+ return subscription;
+ }, source);
+ }
+
+ /**
+ * Continues an observable sequence that is terminated by an exception with the next observable sequence.
+ * @example
+ * 1 - xs.catchException(ys)
+ * 2 - xs.catchException(function (ex) { return ys(ex); })
+ * @param {Mixed} handlerOrSecond Exception handler function that returns an observable sequence given the error that occurred in the first sequence, or a second observable sequence used to produce results when an error occurred in the first sequence.
+ * @returns {Observable} An observable sequence containing the first sequence's elements, followed by the elements of the handler sequence in case an exception occurred.
+ */
+ observableProto['catch'] = observableProto.catchError = observableProto.catchException = function (handlerOrSecond) {
+ return typeof handlerOrSecond === 'function' ?
+ observableCatchHandler(this, handlerOrSecond) :
+ observableCatch([this, handlerOrSecond]);
+ };
+
+ /**
+ * Continues an observable sequence that is terminated by an exception with the next observable sequence.
+ * @param {Array | Arguments} args Arguments or an array to use as the next sequence if an error occurs.
+ * @returns {Observable} An observable sequence containing elements from consecutive source sequences until a source sequence terminates successfully.
+ */
+ var observableCatch = Observable.catchError = Observable['catch'] = Observable.catchException = function () {
+ var items = [];
+ if (Array.isArray(arguments[0])) {
+ items = arguments[0];
+ } else {
+ for(var i = 0, len = arguments.length; i < len; i++) { items.push(arguments[i]); }
+ }
+ return enumerableOf(items).catchError();
+ };
+
+ /**
+ * Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element.
+ * This can be in the form of an argument list of observables or an array.
+ *
+ * @example
+ * 1 - obs = observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
+ * 2 - obs = observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
+ * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
+ */
+ observableProto.combineLatest = function () {
+ var len = arguments.length, args = new Array(len);
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+ if (Array.isArray(args[0])) {
+ args[0].unshift(this);
+ } else {
+ args.unshift(this);
+ }
+ return combineLatest.apply(this, args);
+ };
+
+ /**
+ * Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element.
+ *
+ * @example
+ * 1 - obs = Rx.Observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
+ * 2 - obs = Rx.Observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
+ * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
+ */
+ var combineLatest = Observable.combineLatest = function () {
+ var len = arguments.length, args = new Array(len);
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+ var resultSelector = args.pop();
+ Array.isArray(args[0]) && (args = args[0]);
+
+ return new AnonymousObservable(function (o) {
+ var n = args.length,
+ falseFactory = function () { return false; },
+ hasValue = arrayInitialize(n, falseFactory),
+ hasValueAll = false,
+ isDone = arrayInitialize(n, falseFactory),
+ values = new Array(n);
+
+ function next(i) {
+ hasValue[i] = true;
+ if (hasValueAll || (hasValueAll = hasValue.every(identity))) {
+ try {
+ var res = resultSelector.apply(null, values);
+ } catch (e) {
+ return o.onError(e);
+ }
+ o.onNext(res);
+ } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) {
+ o.onCompleted();
+ }
+ }
+
+ function done (i) {
+ isDone[i] = true;
+ isDone.every(identity) && o.onCompleted();
+ }
+
+ var subscriptions = new Array(n);
+ for (var idx = 0; idx < n; idx++) {
+ (function (i) {
+ var source = args[i], sad = new SingleAssignmentDisposable();
+ isPromise(source) && (source = observableFromPromise(source));
+ sad.setDisposable(source.subscribe(function (x) {
+ values[i] = x;
+ next(i);
+ },
+ function(e) { o.onError(e); },
+ function () { done(i); }
+ ));
+ subscriptions[i] = sad;
+ }(idx));
+ }
+
+ return new CompositeDisposable(subscriptions);
+ }, this);
+ };
+
+ /**
+ * Concatenates all the observable sequences. This takes in either an array or variable arguments to concatenate.
+ * @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order.
+ */
+ observableProto.concat = function () {
+ for(var args = [], i = 0, len = arguments.length; i < len; i++) { args.push(arguments[i]); }
+ args.unshift(this);
+ return observableConcat.apply(null, args);
+ };
+
+ var ConcatObservable = (function(__super__) {
+ inherits(ConcatObservable, __super__);
+ function ConcatObservable(sources) {
+ this.sources = sources;
+ __super__.call(this);
+ }
+
+ ConcatObservable.prototype.subscribeCore = function(o) {
+ var sink = new ConcatSink(this.sources, o);
+ return sink.run();
+ };
+
+ function ConcatSink(sources, o) {
+ this.sources = sources;
+ this.o = o;
+ }
+ ConcatSink.prototype.run = function () {
+ var isDisposed, subscription = new SerialDisposable(), sources = this.sources, length = sources.length, o = this.o;
+ var cancelable = immediateScheduler.scheduleRecursiveWithState(0, function (i, self) {
+ if (isDisposed) { return; }
+ if (i === length) {
+ return o.onCompleted();
+ }
+
+ // Check if promise
+ var currentValue = sources[i];
+ isPromise(currentValue) && (currentValue = observableFromPromise(currentValue));
+
+ var d = new SingleAssignmentDisposable();
+ subscription.setDisposable(d);
+ d.setDisposable(currentValue.subscribe(
+ function (x) { o.onNext(x); },
+ function (e) { o.onError(e); },
+ function () { self(i + 1); }
+ ));
+ });
+
+ return new CompositeDisposable(subscription, cancelable, disposableCreate(function () {
+ isDisposed = true;
+ }));
+ };
+
+
+ return ConcatObservable;
+ }(ObservableBase));
+
+ /**
+ * Concatenates all the observable sequences.
+ * @param {Array | Arguments} args Arguments or an array to concat to the observable sequence.
+ * @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order.
+ */
+ var observableConcat = Observable.concat = function () {
+ var args;
+ if (Array.isArray(arguments[0])) {
+ args = arguments[0];
+ } else {
+ args = new Array(arguments.length);
+ for(var i = 0, len = arguments.length; i < len; i++) { args[i] = arguments[i]; }
+ }
+ return new ConcatObservable(args);
+ };
+
+ /**
+ * Concatenates an observable sequence of observable sequences.
+ * @returns {Observable} An observable sequence that contains the elements of each observed inner sequence, in sequential order.
+ */
+ observableProto.concatAll = observableProto.concatObservable = function () {
+ return this.merge(1);
+ };
+
+ var MergeObservable = (function (__super__) {
+ inherits(MergeObservable, __super__);
+
+ function MergeObservable(source, maxConcurrent) {
+ this.source = source;
+ this.maxConcurrent = maxConcurrent;
+ __super__.call(this);
+ }
+
+ MergeObservable.prototype.subscribeCore = function(observer) {
+ var g = new CompositeDisposable();
+ g.add(this.source.subscribe(new MergeObserver(observer, this.maxConcurrent, g)));
+ return g;
+ };
+
+ return MergeObservable;
+
+ }(ObservableBase));
+
+ var MergeObserver = (function () {
+ function MergeObserver(o, max, g) {
+ this.o = o;
+ this.max = max;
+ this.g = g;
+ this.done = false;
+ this.q = [];
+ this.activeCount = 0;
+ this.isStopped = false;
+ }
+ MergeObserver.prototype.handleSubscribe = function (xs) {
+ var sad = new SingleAssignmentDisposable();
+ this.g.add(sad);
+ isPromise(xs) && (xs = observableFromPromise(xs));
+ sad.setDisposable(xs.subscribe(new InnerObserver(this, sad)));
+ };
+ MergeObserver.prototype.onNext = function (innerSource) {
+ if (this.isStopped) { return; }
+ if(this.activeCount < this.max) {
+ this.activeCount++;
+ this.handleSubscribe(innerSource);
+ } else {
+ this.q.push(innerSource);
+ }
+ };
+ MergeObserver.prototype.onError = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ }
+ };
+ MergeObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.done = true;
+ this.activeCount === 0 && this.o.onCompleted();
+ }
+ };
+ MergeObserver.prototype.dispose = function() { this.isStopped = true; };
+ MergeObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ function InnerObserver(parent, sad) {
+ this.parent = parent;
+ this.sad = sad;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) { if(!this.isStopped) { this.parent.o.onNext(x); } };
+ InnerObserver.prototype.onError = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.parent.o.onError(e);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ var parent = this.parent;
+ parent.g.remove(this.sad);
+ if (parent.q.length > 0) {
+ parent.handleSubscribe(parent.q.shift());
+ } else {
+ parent.activeCount--;
+ parent.done && parent.activeCount === 0 && parent.o.onCompleted();
+ }
+ }
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.parent.o.onError(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ return MergeObserver;
+ }());
+
+
+
+
+
+ /**
+ * Merges an observable sequence of observable sequences into an observable sequence, limiting the number of concurrent subscriptions to inner sequences.
+ * Or merges two observable sequences into a single observable sequence.
+ *
+ * @example
+ * 1 - merged = sources.merge(1);
+ * 2 - merged = source.merge(otherSource);
+ * @param {Mixed} [maxConcurrentOrOther] Maximum number of inner observable sequences being subscribed to concurrently or the second observable sequence.
+ * @returns {Observable} The observable sequence that merges the elements of the inner sequences.
+ */
+ observableProto.merge = function (maxConcurrentOrOther) {
+ return typeof maxConcurrentOrOther !== 'number' ?
+ observableMerge(this, maxConcurrentOrOther) :
+ new MergeObservable(this, maxConcurrentOrOther);
+ };
+
+ /**
+ * Merges all the observable sequences into a single observable sequence.
+ * The scheduler is optional and if not specified, the immediate scheduler is used.
+ * @returns {Observable} The observable sequence that merges the elements of the observable sequences.
+ */
+ var observableMerge = Observable.merge = function () {
+ var scheduler, sources = [], i, len = arguments.length;
+ if (!arguments[0]) {
+ scheduler = immediateScheduler;
+ for(i = 1; i < len; i++) { sources.push(arguments[i]); }
+ } else if (isScheduler(arguments[0])) {
+ scheduler = arguments[0];
+ for(i = 1; i < len; i++) { sources.push(arguments[i]); }
+ } else {
+ scheduler = immediateScheduler;
+ for(i = 0; i < len; i++) { sources.push(arguments[i]); }
+ }
+ if (Array.isArray(sources[0])) {
+ sources = sources[0];
+ }
+ return observableOf(scheduler, sources).mergeAll();
+ };
+
+ var MergeAllObservable = (function (__super__) {
+ inherits(MergeAllObservable, __super__);
+
+ function MergeAllObservable(source) {
+ this.source = source;
+ __super__.call(this);
+ }
+
+ MergeAllObservable.prototype.subscribeCore = function (observer) {
+ var g = new CompositeDisposable(), m = new SingleAssignmentDisposable();
+ g.add(m);
+ m.setDisposable(this.source.subscribe(new MergeAllObserver(observer, g)));
+ return g;
+ };
+
+ function MergeAllObserver(o, g) {
+ this.o = o;
+ this.g = g;
+ this.isStopped = false;
+ this.done = false;
+ }
+ MergeAllObserver.prototype.onNext = function(innerSource) {
+ if(this.isStopped) { return; }
+ var sad = new SingleAssignmentDisposable();
+ this.g.add(sad);
+
+ isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
+
+ sad.setDisposable(innerSource.subscribe(new InnerObserver(this, this.g, sad)));
+ };
+ MergeAllObserver.prototype.onError = function (e) {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ }
+ };
+ MergeAllObserver.prototype.onCompleted = function () {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ this.done = true;
+ this.g.length === 1 && this.o.onCompleted();
+ }
+ };
+ MergeAllObserver.prototype.dispose = function() { this.isStopped = true; };
+ MergeAllObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ function InnerObserver(parent, g, sad) {
+ this.parent = parent;
+ this.g = g;
+ this.sad = sad;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) { if (!this.isStopped) { this.parent.o.onNext(x); } };
+ InnerObserver.prototype.onError = function (e) {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ this.parent.o.onError(e);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if(!this.isStopped) {
+ var parent = this.parent;
+ this.isStopped = true;
+ parent.g.remove(this.sad);
+ parent.done && parent.g.length === 1 && parent.o.onCompleted();
+ }
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.parent.o.onError(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ return MergeAllObservable;
+ }(ObservableBase));
+
+ /**
+ * Merges an observable sequence of observable sequences into an observable sequence.
+ * @returns {Observable} The observable sequence that merges the elements of the inner sequences.
+ */
+ observableProto.mergeAll = observableProto.mergeObservable = function () {
+ return new MergeAllObservable(this);
+ };
+
+ var CompositeError = Rx.CompositeError = function(errors) {
+ this.name = "NotImplementedError";
+ this.innerErrors = errors;
+ this.message = 'This contains multiple errors. Check the innerErrors';
+ Error.call(this);
+ }
+ CompositeError.prototype = Error.prototype;
+
+ /**
+ * Flattens an Observable that emits Observables into one Observable, in a way that allows an Observer to
+ * receive all successfully emitted items from all of the source Observables without being interrupted by
+ * an error notification from one of them.
+ *
+ * This behaves like Observable.prototype.mergeAll except that if any of the merged Observables notify of an
+ * error via the Observer's onError, mergeDelayError will refrain from propagating that
+ * error notification until all of the merged Observables have finished emitting items.
+ * @param {Array | Arguments} args Arguments or an array to merge.
+ * @returns {Observable} an Observable that emits all of the items emitted by the Observables emitted by the Observable
+ */
+ Observable.mergeDelayError = function() {
+ var args;
+ if (Array.isArray(arguments[0])) {
+ args = arguments[0];
+ } else {
+ var len = arguments.length;
+ args = new Array(len);
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+ }
+ var source = observableOf(null, args);
+
+ return new AnonymousObservable(function (o) {
+ var group = new CompositeDisposable(),
+ m = new SingleAssignmentDisposable(),
+ isStopped = false,
+ errors = [];
+
+ function setCompletion() {
+ if (errors.length === 0) {
+ o.onCompleted();
+ } else if (errors.length === 1) {
+ o.onError(errors[0]);
+ } else {
+ o.onError(new CompositeError(errors));
+ }
+ }
+
+ group.add(m);
+
+ m.setDisposable(source.subscribe(
+ function (innerSource) {
+ var innerSubscription = new SingleAssignmentDisposable();
+ group.add(innerSubscription);
+
+ // Check for promises support
+ isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
+
+ innerSubscription.setDisposable(innerSource.subscribe(
+ function (x) { o.onNext(x); },
+ function (e) {
+ errors.push(e);
+ group.remove(innerSubscription);
+ isStopped && group.length === 1 && setCompletion();
+ },
+ function () {
+ group.remove(innerSubscription);
+ isStopped && group.length === 1 && setCompletion();
+ }));
+ },
+ function (e) {
+ errors.push(e);
+ isStopped = true;
+ group.length === 1 && setCompletion();
+ },
+ function () {
+ isStopped = true;
+ group.length === 1 && setCompletion();
+ }));
+ return group;
+ });
+ };
+
+ /**
+ * Returns the values from the source observable sequence only after the other observable sequence produces a value.
+ * @param {Observable | Promise} other The observable sequence or Promise that triggers propagation of elements of the source sequence.
+ * @returns {Observable} An observable sequence containing the elements of the source sequence starting from the point the other sequence triggered propagation.
+ */
+ observableProto.skipUntil = function (other) {
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var isOpen = false;
+ var disposables = new CompositeDisposable(source.subscribe(function (left) {
+ isOpen && o.onNext(left);
+ }, function (e) { o.onError(e); }, function () {
+ isOpen && o.onCompleted();
+ }));
+
+ isPromise(other) && (other = observableFromPromise(other));
+
+ var rightSubscription = new SingleAssignmentDisposable();
+ disposables.add(rightSubscription);
+ rightSubscription.setDisposable(other.subscribe(function () {
+ isOpen = true;
+ rightSubscription.dispose();
+ }, function (e) { o.onError(e); }, function () {
+ rightSubscription.dispose();
+ }));
+
+ return disposables;
+ }, source);
+ };
+
+ var SwitchObservable = (function(__super__) {
+ inherits(SwitchObservable, __super__);
+ function SwitchObservable(source) {
+ this.source = source;
+ __super__.call(this);
+ }
+
+ SwitchObservable.prototype.subscribeCore = function (o) {
+ var inner = new SerialDisposable(), s = this.source.subscribe(new SwitchObserver(o, inner));
+ return new CompositeDisposable(s, inner);
+ };
+
+ function SwitchObserver(o, inner) {
+ this.o = o;
+ this.inner = inner;
+ this.stopped = false;
+ this.latest = 0;
+ this.hasLatest = false;
+ this.isStopped = false;
+ }
+ SwitchObserver.prototype.onNext = function (innerSource) {
+ if (this.isStopped) { return; }
+ var d = new SingleAssignmentDisposable(), id = ++this.latest;
+ this.hasLatest = true;
+ this.inner.setDisposable(d);
+ isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
+ d.setDisposable(innerSource.subscribe(new InnerObserver(this, id)));
+ };
+ SwitchObserver.prototype.onError = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ }
+ };
+ SwitchObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.stopped = true;
+ !this.hasLatest && this.o.onCompleted();
+ }
+ };
+ SwitchObserver.prototype.dispose = function () { this.isStopped = true; };
+ SwitchObserver.prototype.fail = function (e) {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ function InnerObserver(parent, id) {
+ this.parent = parent;
+ this.id = id;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) {
+ if (this.isStopped) { return; }
+ this.parent.latest === this.id && this.parent.o.onNext(x);
+ };
+ InnerObserver.prototype.onError = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.parent.latest === this.id && this.parent.o.onError(e);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ if (this.parent.latest === this.id) {
+ this.parent.hasLatest = false;
+ this.parent.isStopped && this.parent.o.onCompleted();
+ }
+ }
+ };
+ InnerObserver.prototype.dispose = function () { this.isStopped = true; }
+ InnerObserver.prototype.fail = function (e) {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ this.parent.o.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ return SwitchObservable;
+ }(ObservableBase));
+
+ /**
+ * Transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
+ * @returns {Observable} The observable sequence that at any point in time produces the elements of the most recent inner observable sequence that has been received.
+ */
+ observableProto['switch'] = observableProto.switchLatest = function () {
+ return new SwitchObservable(this);
+ };
+
+ var TakeUntilObservable = (function(__super__) {
+ inherits(TakeUntilObservable, __super__);
+
+ function TakeUntilObservable(source, other) {
+ this.source = source;
+ this.other = isPromise(other) ? observableFromPromise(other) : other;
+ __super__.call(this);
+ }
+
+ TakeUntilObservable.prototype.subscribeCore = function(o) {
+ return new CompositeDisposable(
+ this.source.subscribe(o),
+ this.other.subscribe(new InnerObserver(o))
+ );
+ };
+
+ function InnerObserver(o) {
+ this.o = o;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) {
+ if (this.isStopped) { return; }
+ this.o.onCompleted();
+ };
+ InnerObserver.prototype.onError = function (err) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(err);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ !this.isStopped && (this.isStopped = true);
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ return TakeUntilObservable;
+ }(ObservableBase));
+
+ /**
+ * Returns the values from the source observable sequence until the other observable sequence produces a value.
+ * @param {Observable | Promise} other Observable sequence or Promise that terminates propagation of elements of the source sequence.
+ * @returns {Observable} An observable sequence containing the elements of the source sequence up to the point the other sequence interrupted further propagation.
+ */
+ observableProto.takeUntil = function (other) {
+ return new TakeUntilObservable(this, other);
+ };
+
+ function falseFactory() { return false; }
+
+ /**
+ * Merges the specified observable sequences into one observable sequence by using the selector function only when the (first) source observable sequence produces an element.
+ * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
+ */
+ observableProto.withLatestFrom = function () {
+ var len = arguments.length, args = new Array(len)
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+ var resultSelector = args.pop(), source = this;
+ Array.isArray(args[0]) && (args = args[0]);
+
+ return new AnonymousObservable(function (observer) {
+ var n = args.length,
+ hasValue = arrayInitialize(n, falseFactory),
+ hasValueAll = false,
+ values = new Array(n);
+
+ var subscriptions = new Array(n + 1);
+ for (var idx = 0; idx < n; idx++) {
+ (function (i) {
+ var other = args[i], sad = new SingleAssignmentDisposable();
+ isPromise(other) && (other = observableFromPromise(other));
+ sad.setDisposable(other.subscribe(function (x) {
+ values[i] = x;
+ hasValue[i] = true;
+ hasValueAll = hasValue.every(identity);
+ }, function (e) { observer.onError(e); }, noop));
+ subscriptions[i] = sad;
+ }(idx));
+ }
+
+ var sad = new SingleAssignmentDisposable();
+ sad.setDisposable(source.subscribe(function (x) {
+ var allValues = [x].concat(values);
+ if (!hasValueAll) { return; }
+ var res = tryCatch(resultSelector).apply(null, allValues);
+ if (res === errorObj) { return observer.onError(res.e); }
+ observer.onNext(res);
+ }, function (e) { observer.onError(e); }, function () {
+ observer.onCompleted();
+ }));
+ subscriptions[n] = sad;
+
+ return new CompositeDisposable(subscriptions);
+ }, this);
+ };
+
+ function zipArray(second, resultSelector) {
+ var first = this;
+ return new AnonymousObservable(function (o) {
+ var index = 0, len = second.length;
+ return first.subscribe(function (left) {
+ if (index < len) {
+ var right = second[index++], res = tryCatch(resultSelector)(left, right);
+ if (res === errorObj) { return o.onError(res.e); }
+ o.onNext(res);
+ } else {
+ o.onCompleted();
+ }
+ }, function (e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, first);
+ }
+
+ function falseFactory() { return false; }
+ function emptyArrayFactory() { return []; }
+
+ /**
+ * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences or an array have produced an element at a corresponding index.
+ * The last element in the arguments must be a function to invoke for each series of elements at corresponding indexes in the args.
+ * @returns {Observable} An observable sequence containing the result of combining elements of the args using the specified result selector function.
+ */
+ observableProto.zip = function () {
+ if (Array.isArray(arguments[0])) { return zipArray.apply(this, arguments); }
+ var len = arguments.length, args = new Array(len);
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+
+ var parent = this, resultSelector = args.pop();
+ args.unshift(parent);
+ return new AnonymousObservable(function (o) {
+ var n = args.length,
+ queues = arrayInitialize(n, emptyArrayFactory),
+ isDone = arrayInitialize(n, falseFactory);
+
+ var subscriptions = new Array(n);
+ for (var idx = 0; idx < n; idx++) {
+ (function (i) {
+ var source = args[i], sad = new SingleAssignmentDisposable();
+ isPromise(source) && (source = observableFromPromise(source));
+ sad.setDisposable(source.subscribe(function (x) {
+ queues[i].push(x);
+ if (queues.every(function (x) { return x.length > 0; })) {
+ var queuedValues = queues.map(function (x) { return x.shift(); }),
+ res = tryCatch(resultSelector).apply(parent, queuedValues);
+ if (res === errorObj) { return o.onError(res.e); }
+ o.onNext(res);
+ } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) {
+ o.onCompleted();
+ }
+ }, function (e) { o.onError(e); }, function () {
+ isDone[i] = true;
+ isDone.every(identity) && o.onCompleted();
+ }));
+ subscriptions[i] = sad;
+ })(idx);
+ }
+
+ return new CompositeDisposable(subscriptions);
+ }, parent);
+ };
+
+ /**
+ * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index.
+ * @param arguments Observable sources.
+ * @param {Function} resultSelector Function to invoke for each series of elements at corresponding indexes in the sources.
+ * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
+ */
+ Observable.zip = function () {
+ var len = arguments.length, args = new Array(len);
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+ var first = args.shift();
+ return first.zip.apply(first, args);
+ };
+
+ function falseFactory() { return false; }
+ function arrayFactory() { return []; }
+
+ /**
+ * Merges the specified observable sequences into one observable sequence by emitting a list with the elements of the observable sequences at corresponding indexes.
+ * @param arguments Observable sources.
+ * @returns {Observable} An observable sequence containing lists of elements at corresponding indexes.
+ */
+ Observable.zipArray = function () {
+ var sources;
+ if (Array.isArray(arguments[0])) {
+ sources = arguments[0];
+ } else {
+ var len = arguments.length;
+ sources = new Array(len);
+ for(var i = 0; i < len; i++) { sources[i] = arguments[i]; }
+ }
+ return new AnonymousObservable(function (o) {
+ var n = sources.length,
+ queues = arrayInitialize(n, arrayFactory),
+ isDone = arrayInitialize(n, falseFactory);
+
+ var subscriptions = new Array(n);
+ for (var idx = 0; idx < n; idx++) {
+ (function (i) {
+ subscriptions[i] = new SingleAssignmentDisposable();
+ subscriptions[i].setDisposable(sources[i].subscribe(function (x) {
+ queues[i].push(x);
+ if (queues.every(function (x) { return x.length > 0; })) {
+ var res = queues.map(function (x) { return x.shift(); });
+ o.onNext(res);
+ } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) {
+ return o.onCompleted();
+ }
+ }, function (e) { o.onError(e); }, function () {
+ isDone[i] = true;
+ isDone.every(identity) && o.onCompleted();
+ }));
+ })(idx);
+ }
+
+ return new CompositeDisposable(subscriptions);
+ });
+ };
+
+ /**
+ * Hides the identity of an observable sequence.
+ * @returns {Observable} An observable sequence that hides the identity of the source sequence.
+ */
+ observableProto.asObservable = function () {
+ var source = this;
+ return new AnonymousObservable(function (o) { return source.subscribe(o); }, source);
+ };
+
+ /**
+ * Dematerializes the explicit notification values of an observable sequence as implicit notifications.
+ * @returns {Observable} An observable sequence exhibiting the behavior corresponding to the source sequence's notification values.
+ */
+ observableProto.dematerialize = function () {
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ return source.subscribe(function (x) { return x.accept(o); }, function(e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, this);
+ };
+
+ /**
+ * Returns an observable sequence that contains only distinct contiguous elements according to the keySelector and the comparer.
+ *
+ * var obs = observable.distinctUntilChanged();
+ * var obs = observable.distinctUntilChanged(function (x) { return x.id; });
+ * var obs = observable.distinctUntilChanged(function (x) { return x.id; }, function (x, y) { return x === y; });
+ *
+ * @param {Function} [keySelector] A function to compute the comparison key for each element. If not provided, it projects the value.
+ * @param {Function} [comparer] Equality comparer for computed key values. If not provided, defaults to an equality comparer function.
+ * @returns {Observable} An observable sequence only containing the distinct contiguous elements, based on a computed key value, from the source sequence.
+ */
+ observableProto.distinctUntilChanged = function (keySelector, comparer) {
+ var source = this;
+ comparer || (comparer = defaultComparer);
+ return new AnonymousObservable(function (o) {
+ var hasCurrentKey = false, currentKey;
+ return source.subscribe(function (value) {
+ var key = value;
+ if (keySelector) {
+ key = tryCatch(keySelector)(value);
+ if (key === errorObj) { return o.onError(key.e); }
+ }
+ if (hasCurrentKey) {
+ var comparerEquals = tryCatch(comparer)(currentKey, key);
+ if (comparerEquals === errorObj) { return o.onError(comparerEquals.e); }
+ }
+ if (!hasCurrentKey || !comparerEquals) {
+ hasCurrentKey = true;
+ currentKey = key;
+ o.onNext(value);
+ }
+ }, function (e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, this);
+ };
+
+ var TapObservable = (function(__super__) {
+ inherits(TapObservable,__super__);
+ function TapObservable(source, observerOrOnNext, onError, onCompleted) {
+ this.source = source;
+ this.t = !observerOrOnNext || isFunction(observerOrOnNext) ?
+ observerCreate(observerOrOnNext || noop, onError || noop, onCompleted || noop) :
+ observerOrOnNext;
+ __super__.call(this);
+ }
+
+ TapObservable.prototype.subscribeCore = function(o) {
+ return this.source.subscribe(new InnerObserver(o, this.t));
+ };
+
+ function InnerObserver(o, t) {
+ this.o = o;
+ this.t = t;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function(x) {
+ if (this.isStopped) { return; }
+ var res = tryCatch(this.t.onNext).call(this.t, x);
+ if (res === errorObj) { this.o.onError(res.e); }
+ this.o.onNext(x);
+ };
+ InnerObserver.prototype.onError = function(err) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ var res = tryCatch(this.t.onError).call(this.t, err);
+ if (res === errorObj) { return this.o.onError(res.e); }
+ this.o.onError(err);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function() {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ var res = tryCatch(this.t.onCompleted).call(this.t);
+ if (res === errorObj) { return this.o.onError(res.e); }
+ this.o.onCompleted();
+ }
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ return TapObservable;
+ }(ObservableBase));
+
+ /**
+ * Invokes an action for each element in the observable sequence and invokes an action upon graceful or exceptional termination of the observable sequence.
+ * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
+ * @param {Function | Observer} observerOrOnNext Action to invoke for each element in the observable sequence or an o.
+ * @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function.
+ * @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function.
+ * @returns {Observable} The source sequence with the side-effecting behavior applied.
+ */
+ observableProto['do'] = observableProto.tap = observableProto.doAction = function (observerOrOnNext, onError, onCompleted) {
+ return new TapObservable(this, observerOrOnNext, onError, onCompleted);
+ };
+
+ /**
+ * Invokes an action for each element in the observable sequence.
+ * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
+ * @param {Function} onNext Action to invoke for each element in the observable sequence.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} The source sequence with the side-effecting behavior applied.
+ */
+ observableProto.doOnNext = observableProto.tapOnNext = function (onNext, thisArg) {
+ return this.tap(typeof thisArg !== 'undefined' ? function (x) { onNext.call(thisArg, x); } : onNext);
+ };
+
+ /**
+ * Invokes an action upon exceptional termination of the observable sequence.
+ * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
+ * @param {Function} onError Action to invoke upon exceptional termination of the observable sequence.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} The source sequence with the side-effecting behavior applied.
+ */
+ observableProto.doOnError = observableProto.tapOnError = function (onError, thisArg) {
+ return this.tap(noop, typeof thisArg !== 'undefined' ? function (e) { onError.call(thisArg, e); } : onError);
+ };
+
+ /**
+ * Invokes an action upon graceful termination of the observable sequence.
+ * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
+ * @param {Function} onCompleted Action to invoke upon graceful termination of the observable sequence.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} The source sequence with the side-effecting behavior applied.
+ */
+ observableProto.doOnCompleted = observableProto.tapOnCompleted = function (onCompleted, thisArg) {
+ return this.tap(noop, null, typeof thisArg !== 'undefined' ? function () { onCompleted.call(thisArg); } : onCompleted);
+ };
+
+ /**
+ * Invokes a specified action after the source observable sequence terminates gracefully or exceptionally.
+ * @param {Function} finallyAction Action to invoke after the source observable sequence terminates.
+ * @returns {Observable} Source sequence with the action-invoking termination behavior applied.
+ */
+ observableProto['finally'] = observableProto.ensure = function (action) {
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ var subscription;
+ try {
+ subscription = source.subscribe(observer);
+ } catch (e) {
+ action();
+ throw e;
+ }
+ return disposableCreate(function () {
+ try {
+ subscription.dispose();
+ } catch (e) {
+ throw e;
+ } finally {
+ action();
+ }
+ });
+ }, this);
+ };
+
+ /**
+ * @deprecated use #finally or #ensure instead.
+ */
+ observableProto.finallyAction = function (action) {
+ //deprecate('finallyAction', 'finally or ensure');
+ return this.ensure(action);
+ };
+
+ var IgnoreElementsObservable = (function(__super__) {
+ inherits(IgnoreElementsObservable, __super__);
+
+ function IgnoreElementsObservable(source) {
+ this.source = source;
+ __super__.call(this);
+ }
+
+ IgnoreElementsObservable.prototype.subscribeCore = function (o) {
+ return this.source.subscribe(new InnerObserver(o));
+ };
+
+ function InnerObserver(o) {
+ this.o = o;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = noop;
+ InnerObserver.prototype.onError = function (err) {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(err);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ this.o.onCompleted();
+ }
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.observer.onError(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ return IgnoreElementsObservable;
+ }(ObservableBase));
+
+ /**
+ * Ignores all elements in an observable sequence leaving only the termination messages.
+ * @returns {Observable} An empty observable sequence that signals termination, successful or exceptional, of the source sequence.
+ */
+ observableProto.ignoreElements = function () {
+ return new IgnoreElementsObservable(this);
+ };
+
+ /**
+ * Materializes the implicit notifications of an observable sequence as explicit notification values.
+ * @returns {Observable} An observable sequence containing the materialized notification values from the source sequence.
+ */
+ observableProto.materialize = function () {
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ return source.subscribe(function (value) {
+ observer.onNext(notificationCreateOnNext(value));
+ }, function (e) {
+ observer.onNext(notificationCreateOnError(e));
+ observer.onCompleted();
+ }, function () {
+ observer.onNext(notificationCreateOnCompleted());
+ observer.onCompleted();
+ });
+ }, source);
+ };
+
+ /**
+ * Repeats the observable sequence a specified number of times. If the repeat count is not specified, the sequence repeats indefinitely.
+ * @param {Number} [repeatCount] Number of times to repeat the sequence. If not provided, repeats the sequence indefinitely.
+ * @returns {Observable} The observable sequence producing the elements of the given sequence repeatedly.
+ */
+ observableProto.repeat = function (repeatCount) {
+ return enumerableRepeat(this, repeatCount).concat();
+ };
+
+ /**
+ * Repeats the source observable sequence the specified number of times or until it successfully terminates. If the retry count is not specified, it retries indefinitely.
+ * Note if you encounter an error and want it to retry once, then you must use .retry(2);
+ *
+ * @example
+ * var res = retried = retry.repeat();
+ * var res = retried = retry.repeat(2);
+ * @param {Number} [retryCount] Number of times to retry the sequence. If not provided, retry the sequence indefinitely.
+ * @returns {Observable} An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully.
+ */
+ observableProto.retry = function (retryCount) {
+ return enumerableRepeat(this, retryCount).catchError();
+ };
+
+ /**
+ * Repeats the source observable sequence upon error each time the notifier emits or until it successfully terminates.
+ * if the notifier completes, the observable sequence completes.
+ *
+ * @example
+ * var timer = Observable.timer(500);
+ * var source = observable.retryWhen(timer);
+ * @param {Observable} [notifier] An observable that triggers the retries or completes the observable with onNext or onCompleted respectively.
+ * @returns {Observable} An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully.
+ */
+ observableProto.retryWhen = function (notifier) {
+ return enumerableRepeat(this).catchErrorWhen(notifier);
+ };
+ var ScanObservable = (function(__super__) {
+ inherits(ScanObservable, __super__);
+ function ScanObservable(source, accumulator, hasSeed, seed) {
+ this.source = source;
+ this.accumulator = accumulator;
+ this.hasSeed = hasSeed;
+ this.seed = seed;
+ __super__.call(this);
+ }
+
+ ScanObservable.prototype.subscribeCore = function(observer) {
+ return this.source.subscribe(new ScanObserver(observer,this));
+ };
+
+ return ScanObservable;
+ }(ObservableBase));
+
+ function ScanObserver(observer, parent) {
+ this.observer = observer;
+ this.accumulator = parent.accumulator;
+ this.hasSeed = parent.hasSeed;
+ this.seed = parent.seed;
+ this.hasAccumulation = false;
+ this.accumulation = null;
+ this.hasValue = false;
+ this.isStopped = false;
+ }
+ ScanObserver.prototype.onNext = function (x) {
+ if (this.isStopped) { return; }
+ !this.hasValue && (this.hasValue = true);
+ try {
+ if (this.hasAccumulation) {
+ this.accumulation = this.accumulator(this.accumulation, x);
+ } else {
+ this.accumulation = this.hasSeed ? this.accumulator(this.seed, x) : x;
+ this.hasAccumulation = true;
+ }
+ } catch (e) {
+ return this.observer.onError(e);
+ }
+ this.observer.onNext(this.accumulation);
+ };
+ ScanObserver.prototype.onError = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.observer.onError(e);
+ }
+ };
+ ScanObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ !this.hasValue && this.hasSeed && this.observer.onNext(this.seed);
+ this.observer.onCompleted();
+ }
+ };
+ ScanObserver.prototype.dispose = function() { this.isStopped = true; };
+ ScanObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.observer.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ /**
+ * Applies an accumulator function over an observable sequence and returns each intermediate result. The optional seed value is used as the initial accumulator value.
+ * For aggregation behavior with no intermediate results, see Observable.aggregate.
+ * @param {Mixed} [seed] The initial accumulator value.
+ * @param {Function} accumulator An accumulator function to be invoked on each element.
+ * @returns {Observable} An observable sequence containing the accumulated values.
+ */
+ observableProto.scan = function () {
+ var hasSeed = false, seed, accumulator, source = this;
+ if (arguments.length === 2) {
+ hasSeed = true;
+ seed = arguments[0];
+ accumulator = arguments[1];
+ } else {
+ accumulator = arguments[0];
+ }
+ return new ScanObservable(this, accumulator, hasSeed, seed);
+ };
+
+ /**
+ * Bypasses a specified number of elements at the end of an observable sequence.
+ * @description
+ * This operator accumulates a queue with a length enough to store the first `count` elements. As more elements are
+ * received, elements are taken from the front of the queue and produced on the result sequence. This causes elements to be delayed.
+ * @param count Number of elements to bypass at the end of the source sequence.
+ * @returns {Observable} An observable sequence containing the source sequence elements except for the bypassed ones at the end.
+ */
+ observableProto.skipLast = function (count) {
+ if (count < 0) { throw new ArgumentOutOfRangeError(); }
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var q = [];
+ return source.subscribe(function (x) {
+ q.push(x);
+ q.length > count && o.onNext(q.shift());
+ }, function (e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, source);
+ };
+
+ /**
+ * Prepends a sequence of values to an observable sequence with an optional scheduler and an argument list of values to prepend.
+ * @example
+ * var res = source.startWith(1, 2, 3);
+ * var res = source.startWith(Rx.Scheduler.timeout, 1, 2, 3);
+ * @param {Arguments} args The specified values to prepend to the observable sequence
+ * @returns {Observable} The source sequence prepended with the specified values.
+ */
+ observableProto.startWith = function () {
+ var values, scheduler, start = 0;
+ if (!!arguments.length && isScheduler(arguments[0])) {
+ scheduler = arguments[0];
+ start = 1;
+ } else {
+ scheduler = immediateScheduler;
+ }
+ for(var args = [], i = start, len = arguments.length; i < len; i++) { args.push(arguments[i]); }
+ return enumerableOf([observableFromArray(args, scheduler), this]).concat();
+ };
+
+ /**
+ * Returns a specified number of contiguous elements from the end of an observable sequence.
+ * @description
+ * This operator accumulates a buffer with a length enough to store elements count elements. Upon completion of
+ * the source sequence, this buffer is drained on the result sequence. This causes the elements to be delayed.
+ * @param {Number} count Number of elements to take from the end of the source sequence.
+ * @returns {Observable} An observable sequence containing the specified number of elements from the end of the source sequence.
+ */
+ observableProto.takeLast = function (count) {
+ if (count < 0) { throw new ArgumentOutOfRangeError(); }
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var q = [];
+ return source.subscribe(function (x) {
+ q.push(x);
+ q.length > count && q.shift();
+ }, function (e) { o.onError(e); }, function () {
+ while (q.length > 0) { o.onNext(q.shift()); }
+ o.onCompleted();
+ });
+ }, source);
+ };
+
+ function concatMap(source, selector, thisArg) {
+ var selectorFunc = bindCallback(selector, thisArg, 3);
+ return source.map(function (x, i) {
+ var result = selectorFunc(x, i, source);
+ isPromise(result) && (result = observableFromPromise(result));
+ (isArrayLike(result) || isIterable(result)) && (result = observableFrom(result));
+ return result;
+ }).concatAll();
+ }
+
+ /**
+ * One of the Following:
+ * Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
+ *
+ * @example
+ * var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); });
+ * Or:
+ * Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
+ *
+ * var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
+ * Or:
+ * Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
+ *
+ * var res = source.concatMap(Rx.Observable.fromArray([1,2,3]));
+ * @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the
+ * source sequence onto which could be either an observable or Promise.
+ * @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
+ * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
+ */
+ observableProto.selectConcat = observableProto.concatMap = function (selector, resultSelector, thisArg) {
+ if (isFunction(selector) && isFunction(resultSelector)) {
+ return this.concatMap(function (x, i) {
+ var selectorResult = selector(x, i);
+ isPromise(selectorResult) && (selectorResult = observableFromPromise(selectorResult));
+ (isArrayLike(selectorResult) || isIterable(selectorResult)) && (selectorResult = observableFrom(selectorResult));
+
+ return selectorResult.map(function (y, i2) {
+ return resultSelector(x, y, i, i2);
+ });
+ });
+ }
+ return isFunction(selector) ?
+ concatMap(this, selector, thisArg) :
+ concatMap(this, function () { return selector; });
+ };
+
+ var MapObservable = (function (__super__) {
+ inherits(MapObservable, __super__);
+
+ function MapObservable(source, selector, thisArg) {
+ this.source = source;
+ this.selector = bindCallback(selector, thisArg, 3);
+ __super__.call(this);
+ }
+
+ function innerMap(selector, self) {
+ return function (x, i, o) { return selector.call(this, self.selector(x, i, o), i, o); }
+ }
+
+ MapObservable.prototype.internalMap = function (selector, thisArg) {
+ return new MapObservable(this.source, innerMap(selector, this), thisArg);
+ };
+
+ MapObservable.prototype.subscribeCore = function (o) {
+ return this.source.subscribe(new InnerObserver(o, this.selector, this));
+ };
+
+ function InnerObserver(o, selector, source) {
+ this.o = o;
+ this.selector = selector;
+ this.source = source;
+ this.i = 0;
+ this.isStopped = false;
+ }
+
+ InnerObserver.prototype.onNext = function(x) {
+ if (this.isStopped) { return; }
+ var result = tryCatch(this.selector)(x, this.i++, this.source);
+ if (result === errorObj) {
+ return this.o.onError(result.e);
+ }
+ this.o.onNext(result);
+ };
+ InnerObserver.prototype.onError = function (e) {
+ if(!this.isStopped) { this.isStopped = true; this.o.onError(e); }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if(!this.isStopped) { this.isStopped = true; this.o.onCompleted(); }
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ return MapObservable;
+
+ }(ObservableBase));
+
+ /**
+ * Projects each element of an observable sequence into a new form by incorporating the element's index.
+ * @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source.
+ */
+ observableProto.map = observableProto.select = function (selector, thisArg) {
+ var selectorFn = typeof selector === 'function' ? selector : function () { return selector; };
+ return this instanceof MapObservable ?
+ this.internalMap(selectorFn, thisArg) :
+ new MapObservable(this, selectorFn, thisArg);
+ };
+
+ /**
+ * Retrieves the value of a specified nested property from all elements in
+ * the Observable sequence.
+ * @param {Arguments} arguments The nested properties to pluck.
+ * @returns {Observable} Returns a new Observable sequence of property values.
+ */
+ observableProto.pluck = function () {
+ var args = arguments, len = arguments.length;
+ if (len === 0) { throw new Error('List of properties cannot be empty.'); }
+ return this.map(function (x) {
+ var currentProp = x;
+ for (var i = 0; i < len; i++) {
+ var p = currentProp[args[i]];
+ if (typeof p !== 'undefined') {
+ currentProp = p;
+ } else {
+ return undefined;
+ }
+ }
+ return currentProp;
+ });
+ };
+
+ function flatMap(source, selector, thisArg) {
+ var selectorFunc = bindCallback(selector, thisArg, 3);
+ return source.map(function (x, i) {
+ var result = selectorFunc(x, i, source);
+ isPromise(result) && (result = observableFromPromise(result));
+ (isArrayLike(result) || isIterable(result)) && (result = observableFrom(result));
+ return result;
+ }).mergeAll();
+ }
+
+ /**
+ * One of the Following:
+ * Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
+ *
+ * @example
+ * var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); });
+ * Or:
+ * Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
+ *
+ * var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
+ * Or:
+ * Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
+ *
+ * var res = source.selectMany(Rx.Observable.fromArray([1,2,3]));
+ * @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the source sequence onto which could be either an observable or Promise.
+ * @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
+ */
+ observableProto.selectMany = observableProto.flatMap = function (selector, resultSelector, thisArg) {
+ if (isFunction(selector) && isFunction(resultSelector)) {
+ return this.flatMap(function (x, i) {
+ var selectorResult = selector(x, i);
+ isPromise(selectorResult) && (selectorResult = observableFromPromise(selectorResult));
+ (isArrayLike(selectorResult) || isIterable(selectorResult)) && (selectorResult = observableFrom(selectorResult));
+
+ return selectorResult.map(function (y, i2) {
+ return resultSelector(x, y, i, i2);
+ });
+ }, thisArg);
+ }
+ return isFunction(selector) ?
+ flatMap(this, selector, thisArg) :
+ flatMap(this, function () { return selector; });
+ };
+
+ /**
+ * Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then
+ * transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
+ * @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences
+ * and that at any point in time produces the elements of the most recent inner observable sequence that has been received.
+ */
+ observableProto.selectSwitch = observableProto.flatMapLatest = observableProto.switchMap = function (selector, thisArg) {
+ return this.select(selector, thisArg).switchLatest();
+ };
+
+ var SkipObservable = (function(__super__) {
+ inherits(SkipObservable, __super__);
+ function SkipObservable(source, count) {
+ this.source = source;
+ this.skipCount = count;
+ __super__.call(this);
+ }
+
+ SkipObservable.prototype.subscribeCore = function (o) {
+ return this.source.subscribe(new InnerObserver(o, this.skipCount));
+ };
+
+ function InnerObserver(o, c) {
+ this.c = c;
+ this.r = c;
+ this.o = o;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) {
+ if (this.isStopped) { return; }
+ if (this.r <= 0) {
+ this.o.onNext(x);
+ } else {
+ this.r--;
+ }
+ };
+ InnerObserver.prototype.onError = function(e) {
+ if (!this.isStopped) { this.isStopped = true; this.o.onError(e); }
+ };
+ InnerObserver.prototype.onCompleted = function() {
+ if (!this.isStopped) { this.isStopped = true; this.o.onCompleted(); }
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function(e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ return SkipObservable;
+ }(ObservableBase));
+
+ /**
+ * Bypasses a specified number of elements in an observable sequence and then returns the remaining elements.
+ * @param {Number} count The number of elements to skip before returning the remaining elements.
+ * @returns {Observable} An observable sequence that contains the elements that occur after the specified index in the input sequence.
+ */
+ observableProto.skip = function (count) {
+ if (count < 0) { throw new ArgumentOutOfRangeError(); }
+ return new SkipObservable(this, count);
+ };
+ /**
+ * Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements.
+ * The element's index is used in the logic of the predicate function.
+ *
+ * var res = source.skipWhile(function (value) { return value < 10; });
+ * var res = source.skipWhile(function (value, index) { return value < 10 || index < 10; });
+ * @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate.
+ */
+ observableProto.skipWhile = function (predicate, thisArg) {
+ var source = this,
+ callback = bindCallback(predicate, thisArg, 3);
+ return new AnonymousObservable(function (o) {
+ var i = 0, running = false;
+ return source.subscribe(function (x) {
+ if (!running) {
+ try {
+ running = !callback(x, i++, source);
+ } catch (e) {
+ o.onError(e);
+ return;
+ }
+ }
+ running && o.onNext(x);
+ }, function (e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, source);
+ };
+
+ /**
+ * Returns a specified number of contiguous elements from the start of an observable sequence, using the specified scheduler for the edge case of take(0).
+ *
+ * var res = source.take(5);
+ * var res = source.take(0, Rx.Scheduler.timeout);
+ * @param {Number} count The number of elements to return.
+ * @param {Scheduler} [scheduler] Scheduler used to produce an OnCompleted message in case <paramref name="count count</paramref> is set to 0.
+ * @returns {Observable} An observable sequence that contains the specified number of elements from the start of the input sequence.
+ */
+ observableProto.take = function (count, scheduler) {
+ if (count < 0) { throw new ArgumentOutOfRangeError(); }
+ if (count === 0) { return observableEmpty(scheduler); }
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var remaining = count;
+ return source.subscribe(function (x) {
+ if (remaining-- > 0) {
+ o.onNext(x);
+ remaining <= 0 && o.onCompleted();
+ }
+ }, function (e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, source);
+ };
+
+ /**
+ * Returns elements from an observable sequence as long as a specified condition is true.
+ * The element's index is used in the logic of the predicate function.
+ * @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence that contains the elements from the input sequence that occur before the element at which the test no longer passes.
+ */
+ observableProto.takeWhile = function (predicate, thisArg) {
+ var source = this,
+ callback = bindCallback(predicate, thisArg, 3);
+ return new AnonymousObservable(function (o) {
+ var i = 0, running = true;
+ return source.subscribe(function (x) {
+ if (running) {
+ try {
+ running = callback(x, i++, source);
+ } catch (e) {
+ o.onError(e);
+ return;
+ }
+ if (running) {
+ o.onNext(x);
+ } else {
+ o.onCompleted();
+ }
+ }
+ }, function (e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, source);
+ };
+
+ var FilterObservable = (function (__super__) {
+ inherits(FilterObservable, __super__);
+
+ function FilterObservable(source, predicate, thisArg) {
+ this.source = source;
+ this.predicate = bindCallback(predicate, thisArg, 3);
+ __super__.call(this);
+ }
+
+ FilterObservable.prototype.subscribeCore = function (o) {
+ return this.source.subscribe(new InnerObserver(o, this.predicate, this));
+ };
+
+ function innerPredicate(predicate, self) {
+ return function(x, i, o) { return self.predicate(x, i, o) && predicate.call(this, x, i, o); }
+ }
+
+ FilterObservable.prototype.internalFilter = function(predicate, thisArg) {
+ return new FilterObservable(this.source, innerPredicate(predicate, this), thisArg);
+ };
+
+ function InnerObserver(o, predicate, source) {
+ this.o = o;
+ this.predicate = predicate;
+ this.source = source;
+ this.i = 0;
+ this.isStopped = false;
+ }
+
+ InnerObserver.prototype.onNext = function(x) {
+ if (this.isStopped) { return; }
+ var shouldYield = tryCatch(this.predicate)(x, this.i++, this.source);
+ if (shouldYield === errorObj) {
+ return this.o.onError(shouldYield.e);
+ }
+ shouldYield && this.o.onNext(x);
+ };
+ InnerObserver.prototype.onError = function (e) {
+ if(!this.isStopped) { this.isStopped = true; this.o.onError(e); }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if(!this.isStopped) { this.isStopped = true; this.o.onCompleted(); }
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ return FilterObservable;
+
+ }(ObservableBase));
+
+ /**
+ * Filters the elements of an observable sequence based on a predicate by incorporating the element's index.
+ * @param {Function} predicate A function to test each source element for a condition; the second parameter of the function represents the index of the source element.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence that contains elements from the input sequence that satisfy the condition.
+ */
+ observableProto.filter = observableProto.where = function (predicate, thisArg) {
+ return this instanceof FilterObservable ? this.internalFilter(predicate, thisArg) :
+ new FilterObservable(this, predicate, thisArg);
+ };
+
+ /**
+ * Converts a callback function to an observable sequence.
+ *
+ * @param {Function} function Function with a callback as the last parameter to convert to an Observable sequence.
+ * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
+ * @param {Function} [selector] A selector which takes the arguments from the callback to produce a single item to yield on next.
+ * @returns {Function} A function, when executed with the required parameters minus the callback, produces an Observable sequence with a single value of the arguments to the callback as an array.
+ */
+ Observable.fromCallback = function (func, context, selector) {
+ return function () {
+ var len = arguments.length, args = new Array(len)
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+
+ return new AnonymousObservable(function (observer) {
+ function handler() {
+ var len = arguments.length, results = new Array(len);
+ for(var i = 0; i < len; i++) { results[i] = arguments[i]; }
+
+ if (selector) {
+ try {
+ results = selector.apply(context, results);
+ } catch (e) {
+ return observer.onError(e);
+ }
+
+ observer.onNext(results);
+ } else {
+ if (results.length <= 1) {
+ observer.onNext.apply(observer, results);
+ } else {
+ observer.onNext(results);
+ }
+ }
+
+ observer.onCompleted();
+ }
+
+ args.push(handler);
+ func.apply(context, args);
+ }).publishLast().refCount();
+ };
+ };
+
+ /**
+ * Converts a Node.js callback style function to an observable sequence. This must be in function (err, ...) format.
+ * @param {Function} func The function to call
+ * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
+ * @param {Function} [selector] A selector which takes the arguments from the callback minus the error to produce a single item to yield on next.
+ * @returns {Function} An async function which when applied, returns an observable sequence with the callback arguments as an array.
+ */
+ Observable.fromNodeCallback = function (func, context, selector) {
+ return function () {
+ var len = arguments.length, args = new Array(len);
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+
+ return new AnonymousObservable(function (observer) {
+ function handler(err) {
+ if (err) {
+ observer.onError(err);
+ return;
+ }
+
+ var len = arguments.length, results = [];
+ for(var i = 1; i < len; i++) { results[i - 1] = arguments[i]; }
+
+ if (selector) {
+ try {
+ results = selector.apply(context, results);
+ } catch (e) {
+ return observer.onError(e);
+ }
+ observer.onNext(results);
+ } else {
+ if (results.length <= 1) {
+ observer.onNext.apply(observer, results);
+ } else {
+ observer.onNext(results);
+ }
+ }
+
+ observer.onCompleted();
+ }
+
+ args.push(handler);
+ func.apply(context, args);
+ }).publishLast().refCount();
+ };
+ };
+
+ function isNodeList(el) {
+ if (window.StaticNodeList) {
+ // IE8 Specific
+ // instanceof is slower than Object#toString, but Object#toString will not work as intended in IE8
+ return (el instanceof window.StaticNodeList || el instanceof window.NodeList);
+ } else {
+ return (Object.prototype.toString.call(el) == '[object NodeList]')
+ }
+ }
+
+ function fixEvent(event) {
+ var stopPropagation = function () {
+ this.cancelBubble = true;
+ };
+
+ var preventDefault = function () {
+ this.bubbledKeyCode = this.keyCode;
+ if (this.ctrlKey) {
+ try {
+ this.keyCode = 0;
+ } catch (e) { }
+ }
+ this.defaultPrevented = true;
+ this.returnValue = false;
+ this.modified = true;
+ };
+
+ event || (event = root.event);
+ if (!event.target) {
+ event.target = event.target || event.srcElement;
+
+ if (event.type == 'mouseover') {
+ event.relatedTarget = event.fromElement;
+ }
+ if (event.type == 'mouseout') {
+ event.relatedTarget = event.toElement;
+ }
+ // Adding stopPropogation and preventDefault to IE
+ if (!event.stopPropagation) {
+ event.stopPropagation = stopPropagation;
+ event.preventDefault = preventDefault;
+ }
+ // Normalize key events
+ switch (event.type) {
+ case 'keypress':
+ var c = ('charCode' in event ? event.charCode : event.keyCode);
+ if (c == 10) {
+ c = 0;
+ event.keyCode = 13;
+ } else if (c == 13 || c == 27) {
+ c = 0;
+ } else if (c == 3) {
+ c = 99;
+ }
+ event.charCode = c;
+ event.keyChar = event.charCode ? String.fromCharCode(event.charCode) : '';
+ break;
+ }
+ }
+
+ return event;
+ }
+
+ function createListener (element, name, handler) {
+ // Standards compliant
+ if (element.addEventListener) {
+ element.addEventListener(name, handler, false);
+ return disposableCreate(function () {
+ element.removeEventListener(name, handler, false);
+ });
+ }
+ if (element.attachEvent) {
+ // IE Specific
+ var innerHandler = function (event) {
+ handler(fixEvent(event));
+ };
+ element.attachEvent('on' + name, innerHandler);
+ return disposableCreate(function () {
+ element.detachEvent('on' + name, innerHandler);
+ });
+ }
+ // Level 1 DOM Events
+ element['on' + name] = handler;
+ return disposableCreate(function () {
+ element['on' + name] = null;
+ });
+ }
+
+ function createEventListener (el, eventName, handler) {
+ var disposables = new CompositeDisposable();
+
+ // Asume NodeList
+ if (isNodeList(el) || Object.prototype.toString.call(el) === '[object HTMLCollection]') {
+ for (var i = 0, len = el.length; i < len; i++) {
+ disposables.add(createEventListener(el.item(i), eventName, handler));
+ }
+ } else if (el) {
+ disposables.add(createListener(el, eventName, handler));
+ }
+
+ return disposables;
+ }
+
+ /**
+ * Configuration option to determine whether to use native events only
+ */
+ Rx.config.useNativeEvents = false;
+
+ /**
+ * Creates an observable sequence by adding an event listener to the matching DOMElement or each item in the NodeList.
+ *
+ * @example
+ * var source = Rx.Observable.fromEvent(element, 'mouseup');
+ *
+ * @param {Object} element The DOMElement or NodeList to attach a listener.
+ * @param {String} eventName The event name to attach the observable sequence.
+ * @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next.
+ * @returns {Observable} An observable sequence of events from the specified element and the specified event.
+ */
+ Observable.fromEvent = function (element, eventName, selector) {
+ // Node.js specific
+ if (element.addListener) {
+ return fromEventPattern(
+ function (h) { element.addListener(eventName, h); },
+ function (h) { element.removeListener(eventName, h); },
+ selector);
+ }
+
+ // Use only if non-native events are allowed
+ if (!Rx.config.useNativeEvents) {
+ // Handles jq, Angular.js, Zepto, Marionette, Ember.js
+ if (typeof element.on === 'function' && typeof element.off === 'function') {
+ return fromEventPattern(
+ function (h) { element.on(eventName, h); },
+ function (h) { element.off(eventName, h); },
+ selector);
+ }
+ }
+ return new AnonymousObservable(function (observer) {
+ return createEventListener(
+ element,
+ eventName,
+ function handler (e) {
+ var results = e;
+
+ if (selector) {
+ try {
+ results = selector(arguments);
+ } catch (err) {
+ return observer.onError(err);
+ }
+ }
+
+ observer.onNext(results);
+ });
+ }).publish().refCount();
+ };
+
+ /**
+ * Creates an observable sequence from an event emitter via an addHandler/removeHandler pair.
+ * @param {Function} addHandler The function to add a handler to the emitter.
+ * @param {Function} [removeHandler] The optional function to remove a handler from an emitter.
+ * @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next.
+ * @returns {Observable} An observable sequence which wraps an event from an event emitter
+ */
+ var fromEventPattern = Observable.fromEventPattern = function (addHandler, removeHandler, selector) {
+ return new AnonymousObservable(function (observer) {
+ function innerHandler (e) {
+ var result = e;
+ if (selector) {
+ try {
+ result = selector(arguments);
+ } catch (err) {
+ return observer.onError(err);
+ }
+ }
+ observer.onNext(result);
+ }
+
+ var returnValue = addHandler(innerHandler);
+ return disposableCreate(function () {
+ if (removeHandler) {
+ removeHandler(innerHandler, returnValue);
+ }
+ });
+ }).publish().refCount();
+ };
+
+ var FromPromiseObservable = (function(__super__) {
+ inherits(FromPromiseObservable, __super__);
+ function FromPromiseObservable(p) {
+ this.p = p;
+ __super__.call(this);
+ }
+
+ FromPromiseObservable.prototype.subscribeCore = function(o) {
+ this.p.then(function (data) {
+ o.onNext(data);
+ o.onCompleted();
+ }, function (err) { o.onError(err); });
+ return disposableEmpty;
+ };
+
+ return FromPromiseObservable;
+ }(ObservableBase));
+
+ /**
+ * Converts a Promise to an Observable sequence
+ * @param {Promise} An ES6 Compliant promise.
+ * @returns {Observable} An Observable sequence which wraps the existing promise success and failure.
+ */
+ var observableFromPromise = Observable.fromPromise = function (promise) {
+ return new FromPromiseObservable(promise);
+ };
+ /*
+ * Converts an existing observable sequence to an ES6 Compatible Promise
+ * @example
+ * var promise = Rx.Observable.return(42).toPromise(RSVP.Promise);
+ *
+ * // With config
+ * Rx.config.Promise = RSVP.Promise;
+ * var promise = Rx.Observable.return(42).toPromise();
+ * @param {Function} [promiseCtor] The constructor of the promise. If not provided, it looks for it in Rx.config.Promise.
+ * @returns {Promise} An ES6 compatible promise with the last value from the observable sequence.
+ */
+ observableProto.toPromise = function (promiseCtor) {
+ promiseCtor || (promiseCtor = Rx.config.Promise);
+ if (!promiseCtor) { throw new NotSupportedError('Promise type not provided nor in Rx.config.Promise'); }
+ var source = this;
+ return new promiseCtor(function (resolve, reject) {
+ // No cancellation can be done
+ var value, hasValue = false;
+ source.subscribe(function (v) {
+ value = v;
+ hasValue = true;
+ }, reject, function () {
+ hasValue && resolve(value);
+ });
+ });
+ };
+
+ /**
+ * Invokes the asynchronous function, surfacing the result through an observable sequence.
+ * @param {Function} functionAsync Asynchronous function which returns a Promise to run.
+ * @returns {Observable} An observable sequence exposing the function's result value, or an exception.
+ */
+ Observable.startAsync = function (functionAsync) {
+ var promise;
+ try {
+ promise = functionAsync();
+ } catch (e) {
+ return observableThrow(e);
+ }
+ return observableFromPromise(promise);
+ }
+
+ /**
+ * Multicasts the source sequence notifications through an instantiated subject into all uses of the sequence within a selector function. Each
+ * subscription to the resulting sequence causes a separate multicast invocation, exposing the sequence resulting from the selector function's
+ * invocation. For specializations with fixed subject types, see Publish, PublishLast, and Replay.
+ *
+ * @example
+ * 1 - res = source.multicast(observable);
+ * 2 - res = source.multicast(function () { return new Subject(); }, function (x) { return x; });
+ *
+ * @param {Function|Subject} subjectOrSubjectSelector
+ * Factory function to create an intermediate subject through which the source sequence's elements will be multicast to the selector function.
+ * Or:
+ * Subject to push source elements into.
+ *
+ * @param {Function} [selector] Optional selector function which can use the multicasted source sequence subject to the policies enforced by the created subject. Specified only if <paramref name="subjectOrSubjectSelector" is a factory function.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
+ */
+ observableProto.multicast = function (subjectOrSubjectSelector, selector) {
+ var source = this;
+ return typeof subjectOrSubjectSelector === 'function' ?
+ new AnonymousObservable(function (observer) {
+ var connectable = source.multicast(subjectOrSubjectSelector());
+ return new CompositeDisposable(selector(connectable).subscribe(observer), connectable.connect());
+ }, source) :
+ new ConnectableObservable(source, subjectOrSubjectSelector);
+ };
+
+ /**
+ * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence.
+ * This operator is a specialization of Multicast using a regular Subject.
+ *
+ * @example
+ * var resres = source.publish();
+ * var res = source.publish(function (x) { return x; });
+ *
+ * @param {Function} [selector] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all notifications of the source from the time of the subscription on.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
+ */
+ observableProto.publish = function (selector) {
+ return selector && isFunction(selector) ?
+ this.multicast(function () { return new Subject(); }, selector) :
+ this.multicast(new Subject());
+ };
+
+ /**
+ * Returns an observable sequence that shares a single subscription to the underlying sequence.
+ * This operator is a specialization of publish which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence.
+ */
+ observableProto.share = function () {
+ return this.publish().refCount();
+ };
+
+ /**
+ * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence containing only the last notification.
+ * This operator is a specialization of Multicast using a AsyncSubject.
+ *
+ * @example
+ * var res = source.publishLast();
+ * var res = source.publishLast(function (x) { return x; });
+ *
+ * @param selector [Optional] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will only receive the last notification of the source.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
+ */
+ observableProto.publishLast = function (selector) {
+ return selector && isFunction(selector) ?
+ this.multicast(function () { return new AsyncSubject(); }, selector) :
+ this.multicast(new AsyncSubject());
+ };
+
+ /**
+ * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence and starts with initialValue.
+ * This operator is a specialization of Multicast using a BehaviorSubject.
+ *
+ * @example
+ * var res = source.publishValue(42);
+ * var res = source.publishValue(function (x) { return x.select(function (y) { return y * y; }) }, 42);
+ *
+ * @param {Function} [selector] Optional selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive immediately receive the initial value, followed by all notifications of the source from the time of the subscription on.
+ * @param {Mixed} initialValue Initial value received by observers upon subscription.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
+ */
+ observableProto.publishValue = function (initialValueOrSelector, initialValue) {
+ return arguments.length === 2 ?
+ this.multicast(function () {
+ return new BehaviorSubject(initialValue);
+ }, initialValueOrSelector) :
+ this.multicast(new BehaviorSubject(initialValueOrSelector));
+ };
+
+ /**
+ * Returns an observable sequence that shares a single subscription to the underlying sequence and starts with an initialValue.
+ * This operator is a specialization of publishValue which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed.
+ * @param {Mixed} initialValue Initial value received by observers upon subscription.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence.
+ */
+ observableProto.shareValue = function (initialValue) {
+ return this.publishValue(initialValue).refCount();
+ };
+
+ /**
+ * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length for the replay buffer.
+ * This operator is a specialization of Multicast using a ReplaySubject.
+ *
+ * @example
+ * var res = source.replay(null, 3);
+ * var res = source.replay(null, 3, 500);
+ * var res = source.replay(null, 3, 500, scheduler);
+ * var res = source.replay(function (x) { return x.take(6).repeat(); }, 3, 500, scheduler);
+ *
+ * @param selector [Optional] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all the notifications of the source subject to the specified replay buffer trimming policy.
+ * @param bufferSize [Optional] Maximum element count of the replay buffer.
+ * @param windowSize [Optional] Maximum time length of the replay buffer.
+ * @param scheduler [Optional] Scheduler where connected observers within the selector function will be invoked on.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
+ */
+ observableProto.replay = function (selector, bufferSize, windowSize, scheduler) {
+ return selector && isFunction(selector) ?
+ this.multicast(function () { return new ReplaySubject(bufferSize, windowSize, scheduler); }, selector) :
+ this.multicast(new ReplaySubject(bufferSize, windowSize, scheduler));
+ };
+
+ /**
+ * Returns an observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length for the replay buffer.
+ * This operator is a specialization of replay which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed.
+ *
+ * @example
+ * var res = source.shareReplay(3);
+ * var res = source.shareReplay(3, 500);
+ * var res = source.shareReplay(3, 500, scheduler);
+ *
+
+ * @param bufferSize [Optional] Maximum element count of the replay buffer.
+ * @param window [Optional] Maximum time length of the replay buffer.
+ * @param scheduler [Optional] Scheduler where connected observers within the selector function will be invoked on.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence.
+ */
+ observableProto.shareReplay = function (bufferSize, windowSize, scheduler) {
+ return this.replay(null, bufferSize, windowSize, scheduler).refCount();
+ };
+
+ var ConnectableObservable = Rx.ConnectableObservable = (function (__super__) {
+ inherits(ConnectableObservable, __super__);
+
+ function ConnectableObservable(source, subject) {
+ var hasSubscription = false,
+ subscription,
+ sourceObservable = source.asObservable();
+
+ this.connect = function () {
+ if (!hasSubscription) {
+ hasSubscription = true;
+ subscription = new CompositeDisposable(sourceObservable.subscribe(subject), disposableCreate(function () {
+ hasSubscription = false;
+ }));
+ }
+ return subscription;
+ };
+
+ __super__.call(this, function (o) { return subject.subscribe(o); });
+ }
+
+ ConnectableObservable.prototype.refCount = function () {
+ var connectableSubscription, count = 0, source = this;
+ return new AnonymousObservable(function (observer) {
+ var shouldConnect = ++count === 1,
+ subscription = source.subscribe(observer);
+ shouldConnect && (connectableSubscription = source.connect());
+ return function () {
+ subscription.dispose();
+ --count === 0 && connectableSubscription.dispose();
+ };
+ });
+ };
+
+ return ConnectableObservable;
+ }(Observable));
+
+ function observableTimerDate(dueTime, scheduler) {
+ return new AnonymousObservable(function (observer) {
+ return scheduler.scheduleWithAbsolute(dueTime, function () {
+ observer.onNext(0);
+ observer.onCompleted();
+ });
+ });
+ }
+
+ function observableTimerDateAndPeriod(dueTime, period, scheduler) {
+ return new AnonymousObservable(function (observer) {
+ var d = dueTime, p = normalizeTime(period);
+ return scheduler.scheduleRecursiveWithAbsoluteAndState(0, d, function (count, self) {
+ if (p > 0) {
+ var now = scheduler.now();
+ d = d + p;
+ d <= now && (d = now + p);
+ }
+ observer.onNext(count);
+ self(count + 1, d);
+ });
+ });
+ }
+
+ function observableTimerTimeSpan(dueTime, scheduler) {
+ return new AnonymousObservable(function (observer) {
+ return scheduler.scheduleWithRelative(normalizeTime(dueTime), function () {
+ observer.onNext(0);
+ observer.onCompleted();
+ });
+ });
+ }
+
+ function observableTimerTimeSpanAndPeriod(dueTime, period, scheduler) {
+ return dueTime === period ?
+ new AnonymousObservable(function (observer) {
+ return scheduler.schedulePeriodicWithState(0, period, function (count) {
+ observer.onNext(count);
+ return count + 1;
+ });
+ }) :
+ observableDefer(function () {
+ return observableTimerDateAndPeriod(scheduler.now() + dueTime, period, scheduler);
+ });
+ }
+
+ /**
+ * Returns an observable sequence that produces a value after each period.
+ *
+ * @example
+ * 1 - res = Rx.Observable.interval(1000);
+ * 2 - res = Rx.Observable.interval(1000, Rx.Scheduler.timeout);
+ *
+ * @param {Number} period Period for producing the values in the resulting sequence (specified as an integer denoting milliseconds).
+ * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, Rx.Scheduler.timeout is used.
+ * @returns {Observable} An observable sequence that produces a value after each period.
+ */
+ var observableinterval = Observable.interval = function (period, scheduler) {
+ return observableTimerTimeSpanAndPeriod(period, period, isScheduler(scheduler) ? scheduler : timeoutScheduler);
+ };
+
+ /**
+ * Returns an observable sequence that produces a value after dueTime has elapsed and then after each period.
+ * @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) at which to produce the first value.
+ * @param {Mixed} [periodOrScheduler] Period to produce subsequent values (specified as an integer denoting milliseconds), or the scheduler to run the timer on. If not specified, the resulting timer is not recurring.
+ * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, the timeout scheduler is used.
+ * @returns {Observable} An observable sequence that produces a value after due time has elapsed and then each period.
+ */
+ var observableTimer = Observable.timer = function (dueTime, periodOrScheduler, scheduler) {
+ var period;
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ if (periodOrScheduler !== undefined && typeof periodOrScheduler === 'number') {
+ period = periodOrScheduler;
+ } else if (isScheduler(periodOrScheduler)) {
+ scheduler = periodOrScheduler;
+ }
+ if (dueTime instanceof Date && period === undefined) {
+ return observableTimerDate(dueTime.getTime(), scheduler);
+ }
+ if (dueTime instanceof Date && period !== undefined) {
+ period = periodOrScheduler;
+ return observableTimerDateAndPeriod(dueTime.getTime(), period, scheduler);
+ }
+ return period === undefined ?
+ observableTimerTimeSpan(dueTime, scheduler) :
+ observableTimerTimeSpanAndPeriod(dueTime, period, scheduler);
+ };
+
+ function observableDelayTimeSpan(source, dueTime, scheduler) {
+ return new AnonymousObservable(function (observer) {
+ var active = false,
+ cancelable = new SerialDisposable(),
+ exception = null,
+ q = [],
+ running = false,
+ subscription;
+ subscription = source.materialize().timestamp(scheduler).subscribe(function (notification) {
+ var d, shouldRun;
+ if (notification.value.kind === 'E') {
+ q = [];
+ q.push(notification);
+ exception = notification.value.exception;
+ shouldRun = !running;
+ } else {
+ q.push({ value: notification.value, timestamp: notification.timestamp + dueTime });
+ shouldRun = !active;
+ active = true;
+ }
+ if (shouldRun) {
+ if (exception !== null) {
+ observer.onError(exception);
+ } else {
+ d = new SingleAssignmentDisposable();
+ cancelable.setDisposable(d);
+ d.setDisposable(scheduler.scheduleRecursiveWithRelative(dueTime, function (self) {
+ var e, recurseDueTime, result, shouldRecurse;
+ if (exception !== null) {
+ return;
+ }
+ running = true;
+ do {
+ result = null;
+ if (q.length > 0 && q[0].timestamp - scheduler.now() <= 0) {
+ result = q.shift().value;
+ }
+ if (result !== null) {
+ result.accept(observer);
+ }
+ } while (result !== null);
+ shouldRecurse = false;
+ recurseDueTime = 0;
+ if (q.length > 0) {
+ shouldRecurse = true;
+ recurseDueTime = Math.max(0, q[0].timestamp - scheduler.now());
+ } else {
+ active = false;
+ }
+ e = exception;
+ running = false;
+ if (e !== null) {
+ observer.onError(e);
+ } else if (shouldRecurse) {
+ self(recurseDueTime);
+ }
+ }));
+ }
+ }
+ });
+ return new CompositeDisposable(subscription, cancelable);
+ }, source);
+ }
+
+ function observableDelayDate(source, dueTime, scheduler) {
+ return observableDefer(function () {
+ return observableDelayTimeSpan(source, dueTime - scheduler.now(), scheduler);
+ });
+ }
+
+ /**
+ * Time shifts the observable sequence by dueTime. The relative time intervals between the values are preserved.
+ *
+ * @example
+ * 1 - res = Rx.Observable.delay(new Date());
+ * 2 - res = Rx.Observable.delay(new Date(), Rx.Scheduler.timeout);
+ *
+ * 3 - res = Rx.Observable.delay(5000);
+ * 4 - res = Rx.Observable.delay(5000, 1000, Rx.Scheduler.timeout);
+ * @memberOf Observable#
+ * @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) by which to shift the observable sequence.
+ * @param {Scheduler} [scheduler] Scheduler to run the delay timers on. If not specified, the timeout scheduler is used.
+ * @returns {Observable} Time-shifted sequence.
+ */
+ observableProto.delay = function (dueTime, scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return dueTime instanceof Date ?
+ observableDelayDate(this, dueTime.getTime(), scheduler) :
+ observableDelayTimeSpan(this, dueTime, scheduler);
+ };
+
+ /**
+ * Ignores values from an observable sequence which are followed by another value before dueTime.
+ * @param {Number} dueTime Duration of the debounce period for each value (specified as an integer denoting milliseconds).
+ * @param {Scheduler} [scheduler] Scheduler to run the debounce timers on. If not specified, the timeout scheduler is used.
+ * @returns {Observable} The debounced sequence.
+ */
+ observableProto.debounce = observableProto.throttleWithTimeout = function (dueTime, scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ var cancelable = new SerialDisposable(), hasvalue = false, value, id = 0;
+ var subscription = source.subscribe(
+ function (x) {
+ hasvalue = true;
+ value = x;
+ id++;
+ var currentId = id,
+ d = new SingleAssignmentDisposable();
+ cancelable.setDisposable(d);
+ d.setDisposable(scheduler.scheduleWithRelative(dueTime, function () {
+ hasvalue && id === currentId && observer.onNext(value);
+ hasvalue = false;
+ }));
+ },
+ function (e) {
+ cancelable.dispose();
+ observer.onError(e);
+ hasvalue = false;
+ id++;
+ },
+ function () {
+ cancelable.dispose();
+ hasvalue && observer.onNext(value);
+ observer.onCompleted();
+ hasvalue = false;
+ id++;
+ });
+ return new CompositeDisposable(subscription, cancelable);
+ }, this);
+ };
+
+ /**
+ * @deprecated use #debounce or #throttleWithTimeout instead.
+ */
+ observableProto.throttle = function(dueTime, scheduler) {
+ //deprecate('throttle', 'debounce or throttleWithTimeout');
+ return this.debounce(dueTime, scheduler);
+ };
+
+ /**
+ * Records the timestamp for each value in an observable sequence.
+ *
+ * @example
+ * 1 - res = source.timestamp(); // produces { value: x, timestamp: ts }
+ * 2 - res = source.timestamp(Rx.Scheduler.default);
+ *
+ * @param {Scheduler} [scheduler] Scheduler used to compute timestamps. If not specified, the default scheduler is used.
+ * @returns {Observable} An observable sequence with timestamp information on values.
+ */
+ observableProto.timestamp = function (scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return this.map(function (x) {
+ return { value: x, timestamp: scheduler.now() };
+ });
+ };
+
+ function sampleObservable(source, sampler) {
+ return new AnonymousObservable(function (o) {
+ var atEnd = false, value, hasValue = false;
+
+ function sampleSubscribe() {
+ if (hasValue) {
+ hasValue = false;
+ o.onNext(value);
+ }
+ atEnd && o.onCompleted();
+ }
+
+ var sourceSubscription = new SingleAssignmentDisposable();
+ sourceSubscription.setDisposable(source.subscribe(
+ function (newValue) {
+ hasValue = true;
+ value = newValue;
+ },
+ function (e) { o.onError(e); },
+ function () {
+ atEnd = true;
+ sourceSubscription.dispose();
+ }
+ ));
+
+ return new CompositeDisposable(
+ sourceSubscription,
+ sampler.subscribe(sampleSubscribe, function (e) { o.onError(e); }, sampleSubscribe)
+ );
+ }, source);
+ }
+
+ /**
+ * Samples the observable sequence at each interval.
+ *
+ * @example
+ * 1 - res = source.sample(sampleObservable); // Sampler tick sequence
+ * 2 - res = source.sample(5000); // 5 seconds
+ * 2 - res = source.sample(5000, Rx.Scheduler.timeout); // 5 seconds
+ *
+ * @param {Mixed} intervalOrSampler Interval at which to sample (specified as an integer denoting milliseconds) or Sampler Observable.
+ * @param {Scheduler} [scheduler] Scheduler to run the sampling timer on. If not specified, the timeout scheduler is used.
+ * @returns {Observable} Sampled observable sequence.
+ */
+ observableProto.sample = observableProto.throttleLatest = function (intervalOrSampler, scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return typeof intervalOrSampler === 'number' ?
+ sampleObservable(this, observableinterval(intervalOrSampler, scheduler)) :
+ sampleObservable(this, intervalOrSampler);
+ };
+
+ /**
+ * Returns the source observable sequence or the other observable sequence if dueTime elapses.
+ * @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) when a timeout occurs.
+ * @param {Observable} [other] Sequence to return in case of a timeout. If not specified, a timeout error throwing sequence will be used.
+ * @param {Scheduler} [scheduler] Scheduler to run the timeout timers on. If not specified, the timeout scheduler is used.
+ * @returns {Observable} The source sequence switching to the other sequence in case of a timeout.
+ */
+ observableProto.timeout = function (dueTime, other, scheduler) {
+ (other == null || typeof other === 'string') && (other = observableThrow(new Error(other || 'Timeout')));
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+
+ var source = this, schedulerMethod = dueTime instanceof Date ?
+ 'scheduleWithAbsolute' :
+ 'scheduleWithRelative';
+
+ return new AnonymousObservable(function (observer) {
+ var id = 0,
+ original = new SingleAssignmentDisposable(),
+ subscription = new SerialDisposable(),
+ switched = false,
+ timer = new SerialDisposable();
+
+ subscription.setDisposable(original);
+
+ function createTimer() {
+ var myId = id;
+ timer.setDisposable(scheduler[schedulerMethod](dueTime, function () {
+ if (id === myId) {
+ isPromise(other) && (other = observableFromPromise(other));
+ subscription.setDisposable(other.subscribe(observer));
+ }
+ }));
+ }
+
+ createTimer();
+
+ original.setDisposable(source.subscribe(function (x) {
+ if (!switched) {
+ id++;
+ observer.onNext(x);
+ createTimer();
+ }
+ }, function (e) {
+ if (!switched) {
+ id++;
+ observer.onError(e);
+ }
+ }, function () {
+ if (!switched) {
+ id++;
+ observer.onCompleted();
+ }
+ }));
+ return new CompositeDisposable(subscription, timer);
+ }, source);
+ };
+
+ /**
+ * Returns an Observable that emits only the first item emitted by the source Observable during sequential time windows of a specified duration.
+ * @param {Number} windowDuration time to wait before emitting another item after emitting the last item
+ * @param {Scheduler} [scheduler] the Scheduler to use internally to manage the timers that handle timeout for each item. If not provided, defaults to Scheduler.timeout.
+ * @returns {Observable} An Observable that performs the throttle operation.
+ */
+ observableProto.throttleFirst = function (windowDuration, scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ var duration = +windowDuration || 0;
+ if (duration <= 0) { throw new RangeError('windowDuration cannot be less or equal zero.'); }
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var lastOnNext = 0;
+ return source.subscribe(
+ function (x) {
+ var now = scheduler.now();
+ if (lastOnNext === 0 || now - lastOnNext >= duration) {
+ lastOnNext = now;
+ o.onNext(x);
+ }
+ },function (e) { o.onError(e); }, function () { o.onCompleted(); }
+ );
+ }, source);
+ };
+
+ var PausableObservable = (function (__super__) {
+
+ inherits(PausableObservable, __super__);
+
+ function subscribe(observer) {
+ var conn = this.source.publish(),
+ subscription = conn.subscribe(observer),
+ connection = disposableEmpty;
+
+ var pausable = this.pauser.distinctUntilChanged().subscribe(function (b) {
+ if (b) {
+ connection = conn.connect();
+ } else {
+ connection.dispose();
+ connection = disposableEmpty;
+ }
+ });
+
+ return new CompositeDisposable(subscription, connection, pausable);
+ }
+
+ function PausableObservable(source, pauser) {
+ this.source = source;
+ this.controller = new Subject();
+
+ if (pauser && pauser.subscribe) {
+ this.pauser = this.controller.merge(pauser);
+ } else {
+ this.pauser = this.controller;
+ }
+
+ __super__.call(this, subscribe, source);
+ }
+
+ PausableObservable.prototype.pause = function () {
+ this.controller.onNext(false);
+ };
+
+ PausableObservable.prototype.resume = function () {
+ this.controller.onNext(true);
+ };
+
+ return PausableObservable;
+
+ }(Observable));
+
+ /**
+ * Pauses the underlying observable sequence based upon the observable sequence which yields true/false.
+ * @example
+ * var pauser = new Rx.Subject();
+ * var source = Rx.Observable.interval(100).pausable(pauser);
+ * @param {Observable} pauser The observable sequence used to pause the underlying sequence.
+ * @returns {Observable} The observable sequence which is paused based upon the pauser.
+ */
+ observableProto.pausable = function (pauser) {
+ return new PausableObservable(this, pauser);
+ };
+
+ function combineLatestSource(source, subject, resultSelector) {
+ return new AnonymousObservable(function (o) {
+ var hasValue = [false, false],
+ hasValueAll = false,
+ isDone = false,
+ values = new Array(2),
+ err;
+
+ function next(x, i) {
+ values[i] = x
+ hasValue[i] = true;
+ if (hasValueAll || (hasValueAll = hasValue.every(identity))) {
+ if (err) { return o.onError(err); }
+ var res = tryCatch(resultSelector).apply(null, values);
+ if (res === errorObj) { return o.onError(res.e); }
+ o.onNext(res);
+ }
+ isDone && values[1] && o.onCompleted();
+ }
+
+ return new CompositeDisposable(
+ source.subscribe(
+ function (x) {
+ next(x, 0);
+ },
+ function (e) {
+ if (values[1]) {
+ o.onError(e);
+ } else {
+ err = e;
+ }
+ },
+ function () {
+ isDone = true;
+ values[1] && o.onCompleted();
+ }),
+ subject.subscribe(
+ function (x) {
+ next(x, 1);
+ },
+ function (e) { o.onError(e); },
+ function () {
+ isDone = true;
+ next(true, 1);
+ })
+ );
+ }, source);
+ }
+
+ var PausableBufferedObservable = (function (__super__) {
+
+ inherits(PausableBufferedObservable, __super__);
+
+ function subscribe(o) {
+ var q = [], previousShouldFire;
+
+ function drainQueue() { while (q.length > 0) { o.onNext(q.shift()); } }
+
+ var subscription =
+ combineLatestSource(
+ this.source,
+ this.pauser.distinctUntilChanged().startWith(false),
+ function (data, shouldFire) {
+ return { data: data, shouldFire: shouldFire };
+ })
+ .subscribe(
+ function (results) {
+ if (previousShouldFire !== undefined && results.shouldFire != previousShouldFire) {
+ previousShouldFire = results.shouldFire;
+ // change in shouldFire
+ if (results.shouldFire) { drainQueue(); }
+ } else {
+ previousShouldFire = results.shouldFire;
+ // new data
+ if (results.shouldFire) {
+ o.onNext(results.data);
+ } else {
+ q.push(results.data);
+ }
+ }
+ },
+ function (err) {
+ drainQueue();
+ o.onError(err);
+ },
+ function () {
+ drainQueue();
+ o.onCompleted();
+ }
+ );
+ return subscription;
+ }
+
+ function PausableBufferedObservable(source, pauser) {
+ this.source = source;
+ this.controller = new Subject();
+
+ if (pauser && pauser.subscribe) {
+ this.pauser = this.controller.merge(pauser);
+ } else {
+ this.pauser = this.controller;
+ }
+
+ __super__.call(this, subscribe, source);
+ }
+
+ PausableBufferedObservable.prototype.pause = function () {
+ this.controller.onNext(false);
+ };
+
+ PausableBufferedObservable.prototype.resume = function () {
+ this.controller.onNext(true);
+ };
+
+ return PausableBufferedObservable;
+
+ }(Observable));
+
+ /**
+ * Pauses the underlying observable sequence based upon the observable sequence which yields true/false,
+ * and yields the values that were buffered while paused.
+ * @example
+ * var pauser = new Rx.Subject();
+ * var source = Rx.Observable.interval(100).pausableBuffered(pauser);
+ * @param {Observable} pauser The observable sequence used to pause the underlying sequence.
+ * @returns {Observable} The observable sequence which is paused based upon the pauser.
+ */
+ observableProto.pausableBuffered = function (subject) {
+ return new PausableBufferedObservable(this, subject);
+ };
+
+ var ControlledObservable = (function (__super__) {
+
+ inherits(ControlledObservable, __super__);
+
+ function subscribe (observer) {
+ return this.source.subscribe(observer);
+ }
+
+ function ControlledObservable (source, enableQueue, scheduler) {
+ __super__.call(this, subscribe, source);
+ this.subject = new ControlledSubject(enableQueue, scheduler);
+ this.source = source.multicast(this.subject).refCount();
+ }
+
+ ControlledObservable.prototype.request = function (numberOfItems) {
+ return this.subject.request(numberOfItems == null ? -1 : numberOfItems);
+ };
+
+ return ControlledObservable;
+
+ }(Observable));
+
+ var ControlledSubject = (function (__super__) {
+
+ function subscribe (observer) {
+ return this.subject.subscribe(observer);
+ }
+
+ inherits(ControlledSubject, __super__);
+
+ function ControlledSubject(enableQueue, scheduler) {
+ enableQueue == null && (enableQueue = true);
+
+ __super__.call(this, subscribe);
+ this.subject = new Subject();
+ this.enableQueue = enableQueue;
+ this.queue = enableQueue ? [] : null;
+ this.requestedCount = 0;
+ this.requestedDisposable = disposableEmpty;
+ this.error = null;
+ this.hasFailed = false;
+ this.hasCompleted = false;
+ this.scheduler = scheduler || currentThreadScheduler;
+ }
+
+ addProperties(ControlledSubject.prototype, Observer, {
+ onCompleted: function () {
+ this.hasCompleted = true;
+ if (!this.enableQueue || this.queue.length === 0) {
+ this.subject.onCompleted();
+ } else {
+ this.queue.push(Notification.createOnCompleted());
+ }
+ },
+ onError: function (error) {
+ this.hasFailed = true;
+ this.error = error;
+ if (!this.enableQueue || this.queue.length === 0) {
+ this.subject.onError(error);
+ } else {
+ this.queue.push(Notification.createOnError(error));
+ }
+ },
+ onNext: function (value) {
+ var hasRequested = false;
+
+ if (this.requestedCount === 0) {
+ this.enableQueue && this.queue.push(Notification.createOnNext(value));
+ } else {
+ (this.requestedCount !== -1 && this.requestedCount-- === 0) && this.disposeCurrentRequest();
+ hasRequested = true;
+ }
+ hasRequested && this.subject.onNext(value);
+ },
+ _processRequest: function (numberOfItems) {
+ if (this.enableQueue) {
+ while ((this.queue.length >= numberOfItems && numberOfItems > 0) ||
+ (this.queue.length > 0 && this.queue[0].kind !== 'N')) {
+ var first = this.queue.shift();
+ first.accept(this.subject);
+ if (first.kind === 'N') {
+ numberOfItems--;
+ } else {
+ this.disposeCurrentRequest();
+ this.queue = [];
+ }
+ }
+
+ return { numberOfItems : numberOfItems, returnValue: this.queue.length !== 0};
+ }
+
+ return { numberOfItems: numberOfItems, returnValue: false };
+ },
+ request: function (number) {
+ this.disposeCurrentRequest();
+ var self = this;
+
+ this.requestedDisposable = this.scheduler.scheduleWithState(number,
+ function(s, i) {
+ var r = self._processRequest(i), remaining = r.numberOfItems;
+ if (!r.returnValue) {
+ self.requestedCount = remaining;
+ self.requestedDisposable = disposableCreate(function () {
+ self.requestedCount = 0;
+ });
+ }
+ });
+
+ return this.requestedDisposable;
+ },
+ disposeCurrentRequest: function () {
+ this.requestedDisposable.dispose();
+ this.requestedDisposable = disposableEmpty;
+ }
+ });
+
+ return ControlledSubject;
+ }(Observable));
+
+ /**
+ * Attaches a controller to the observable sequence with the ability to queue.
+ * @example
+ * var source = Rx.Observable.interval(100).controlled();
+ * source.request(3); // Reads 3 values
+ * @param {bool} enableQueue truthy value to determine if values should be queued pending the next request
+ * @param {Scheduler} scheduler determines how the requests will be scheduled
+ * @returns {Observable} The observable sequence which only propagates values on request.
+ */
+ observableProto.controlled = function (enableQueue, scheduler) {
+
+ if (enableQueue && isScheduler(enableQueue)) {
+ scheduler = enableQueue;
+ enableQueue = true;
+ }
+
+ if (enableQueue == null) { enableQueue = true; }
+ return new ControlledObservable(this, enableQueue, scheduler);
+ };
+
+ /**
+ * Pipes the existing Observable sequence into a Node.js Stream.
+ * @param {Stream} dest The destination Node.js stream.
+ * @returns {Stream} The destination stream.
+ */
+ observableProto.pipe = function (dest) {
+ var source = this.pausableBuffered();
+
+ function onDrain() {
+ source.resume();
+ }
+
+ dest.addListener('drain', onDrain);
+
+ source.subscribe(
+ function (x) {
+ !dest.write(String(x)) && source.pause();
+ },
+ function (err) {
+ dest.emit('error', err);
+ },
+ function () {
+ // Hack check because STDIO is not closable
+ !dest._isStdio && dest.end();
+ dest.removeListener('drain', onDrain);
+ });
+
+ source.resume();
+
+ return dest;
+ };
+
+ /**
+ * Executes a transducer to transform the observable sequence
+ * @param {Transducer} transducer A transducer to execute
+ * @returns {Observable} An Observable sequence containing the results from the transducer.
+ */
+ observableProto.transduce = function(transducer) {
+ var source = this;
+
+ function transformForObserver(o) {
+ return {
+ '@@transducer/init': function() {
+ return o;
+ },
+ '@@transducer/step': function(obs, input) {
+ return obs.onNext(input);
+ },
+ '@@transducer/result': function(obs) {
+ return obs.onCompleted();
+ }
+ };
+ }
+
+ return new AnonymousObservable(function(o) {
+ var xform = transducer(transformForObserver(o));
+ return source.subscribe(
+ function(v) {
+ try {
+ xform['@@transducer/step'](o, v);
+ } catch (e) {
+ o.onError(e);
+ }
+ },
+ function (e) { o.onError(e); },
+ function() { xform['@@transducer/result'](o); }
+ );
+ }, source);
+ };
+
+ var AnonymousObservable = Rx.AnonymousObservable = (function (__super__) {
+ inherits(AnonymousObservable, __super__);
+
+ // Fix subscriber to check for undefined or function returned to decorate as Disposable
+ function fixSubscriber(subscriber) {
+ return subscriber && isFunction(subscriber.dispose) ? subscriber :
+ isFunction(subscriber) ? disposableCreate(subscriber) : disposableEmpty;
+ }
+
+ function setDisposable(s, state) {
+ var ado = state[0], subscribe = state[1];
+ var sub = tryCatch(subscribe)(ado);
+
+ if (sub === errorObj) {
+ if(!ado.fail(errorObj.e)) { return thrower(errorObj.e); }
+ }
+ ado.setDisposable(fixSubscriber(sub));
+ }
+
+ function AnonymousObservable(subscribe, parent) {
+ this.source = parent;
+
+ function s(observer) {
+ var ado = new AutoDetachObserver(observer), state = [ado, subscribe];
+
+ if (currentThreadScheduler.scheduleRequired()) {
+ currentThreadScheduler.scheduleWithState(state, setDisposable);
+ } else {
+ setDisposable(null, state);
+ }
+ return ado;
+ }
+
+ __super__.call(this, s);
+ }
+
+ return AnonymousObservable;
+
+ }(Observable));
+
+ var AutoDetachObserver = (function (__super__) {
+ inherits(AutoDetachObserver, __super__);
+
+ function AutoDetachObserver(observer) {
+ __super__.call(this);
+ this.observer = observer;
+ this.m = new SingleAssignmentDisposable();
+ }
+
+ var AutoDetachObserverPrototype = AutoDetachObserver.prototype;
+
+ AutoDetachObserverPrototype.next = function (value) {
+ var result = tryCatch(this.observer.onNext).call(this.observer, value);
+ if (result === errorObj) {
+ this.dispose();
+ thrower(result.e);
+ }
+ };
+
+ AutoDetachObserverPrototype.error = function (err) {
+ var result = tryCatch(this.observer.onError).call(this.observer, err);
+ this.dispose();
+ result === errorObj && thrower(result.e);
+ };
+
+ AutoDetachObserverPrototype.completed = function () {
+ var result = tryCatch(this.observer.onCompleted).call(this.observer);
+ this.dispose();
+ result === errorObj && thrower(result.e);
+ };
+
+ AutoDetachObserverPrototype.setDisposable = function (value) { this.m.setDisposable(value); };
+ AutoDetachObserverPrototype.getDisposable = function () { return this.m.getDisposable(); };
+
+ AutoDetachObserverPrototype.dispose = function () {
+ __super__.prototype.dispose.call(this);
+ this.m.dispose();
+ };
+
+ return AutoDetachObserver;
+ }(AbstractObserver));
+
+ var InnerSubscription = function (subject, observer) {
+ this.subject = subject;
+ this.observer = observer;
+ };
+
+ InnerSubscription.prototype.dispose = function () {
+ if (!this.subject.isDisposed && this.observer !== null) {
+ var idx = this.subject.observers.indexOf(this.observer);
+ this.subject.observers.splice(idx, 1);
+ this.observer = null;
+ }
+ };
+
+ /**
+ * Represents an object that is both an observable sequence as well as an observer.
+ * Each notification is broadcasted to all subscribed observers.
+ */
+ var Subject = Rx.Subject = (function (__super__) {
+ function subscribe(observer) {
+ checkDisposed(this);
+ if (!this.isStopped) {
+ this.observers.push(observer);
+ return new InnerSubscription(this, observer);
+ }
+ if (this.hasError) {
+ observer.onError(this.error);
+ return disposableEmpty;
+ }
+ observer.onCompleted();
+ return disposableEmpty;
+ }
+
+ inherits(Subject, __super__);
+
+ /**
+ * Creates a subject.
+ */
+ function Subject() {
+ __super__.call(this, subscribe);
+ this.isDisposed = false,
+ this.isStopped = false,
+ this.observers = [];
+ this.hasError = false;
+ }
+
+ addProperties(Subject.prototype, Observer.prototype, {
+ /**
+ * Indicates whether the subject has observers subscribed to it.
+ * @returns {Boolean} Indicates whether the subject has observers subscribed to it.
+ */
+ hasObservers: function () { return this.observers.length > 0; },
+ /**
+ * Notifies all subscribed observers about the end of the sequence.
+ */
+ onCompleted: function () {
+ checkDisposed(this);
+ if (!this.isStopped) {
+ this.isStopped = true;
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ os[i].onCompleted();
+ }
+
+ this.observers.length = 0;
+ }
+ },
+ /**
+ * Notifies all subscribed observers about the exception.
+ * @param {Mixed} error The exception to send to all observers.
+ */
+ onError: function (error) {
+ checkDisposed(this);
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.error = error;
+ this.hasError = true;
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ os[i].onError(error);
+ }
+
+ this.observers.length = 0;
+ }
+ },
+ /**
+ * Notifies all subscribed observers about the arrival of the specified element in the sequence.
+ * @param {Mixed} value The value to send to all observers.
+ */
+ onNext: function (value) {
+ checkDisposed(this);
+ if (!this.isStopped) {
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ os[i].onNext(value);
+ }
+ }
+ },
+ /**
+ * Unsubscribe all observers and release resources.
+ */
+ dispose: function () {
+ this.isDisposed = true;
+ this.observers = null;
+ }
+ });
+
+ /**
+ * Creates a subject from the specified observer and observable.
+ * @param {Observer} observer The observer used to send messages to the subject.
+ * @param {Observable} observable The observable used to subscribe to messages sent from the subject.
+ * @returns {Subject} Subject implemented using the given observer and observable.
+ */
+ Subject.create = function (observer, observable) {
+ return new AnonymousSubject(observer, observable);
+ };
+
+ return Subject;
+ }(Observable));
+
+ /**
+ * Represents the result of an asynchronous operation.
+ * The last value before the OnCompleted notification, or the error received through OnError, is sent to all subscribed observers.
+ */
+ var AsyncSubject = Rx.AsyncSubject = (function (__super__) {
+
+ function subscribe(observer) {
+ checkDisposed(this);
+
+ if (!this.isStopped) {
+ this.observers.push(observer);
+ return new InnerSubscription(this, observer);
+ }
+
+ if (this.hasError) {
+ observer.onError(this.error);
+ } else if (this.hasValue) {
+ observer.onNext(this.value);
+ observer.onCompleted();
+ } else {
+ observer.onCompleted();
+ }
+
+ return disposableEmpty;
+ }
+
+ inherits(AsyncSubject, __super__);
+
+ /**
+ * Creates a subject that can only receive one value and that value is cached for all future observations.
+ * @constructor
+ */
+ function AsyncSubject() {
+ __super__.call(this, subscribe);
+
+ this.isDisposed = false;
+ this.isStopped = false;
+ this.hasValue = false;
+ this.observers = [];
+ this.hasError = false;
+ }
+
+ addProperties(AsyncSubject.prototype, Observer, {
+ /**
+ * Indicates whether the subject has observers subscribed to it.
+ * @returns {Boolean} Indicates whether the subject has observers subscribed to it.
+ */
+ hasObservers: function () {
+ checkDisposed(this);
+ return this.observers.length > 0;
+ },
+ /**
+ * Notifies all subscribed observers about the end of the sequence, also causing the last received value to be sent out (if any).
+ */
+ onCompleted: function () {
+ var i, len;
+ checkDisposed(this);
+ if (!this.isStopped) {
+ this.isStopped = true;
+ var os = cloneArray(this.observers), len = os.length;
+
+ if (this.hasValue) {
+ for (i = 0; i < len; i++) {
+ var o = os[i];
+ o.onNext(this.value);
+ o.onCompleted();
+ }
+ } else {
+ for (i = 0; i < len; i++) {
+ os[i].onCompleted();
+ }
+ }
+
+ this.observers.length = 0;
+ }
+ },
+ /**
+ * Notifies all subscribed observers about the error.
+ * @param {Mixed} error The Error to send to all observers.
+ */
+ onError: function (error) {
+ checkDisposed(this);
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.hasError = true;
+ this.error = error;
+
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ os[i].onError(error);
+ }
+
+ this.observers.length = 0;
+ }
+ },
+ /**
+ * Sends a value to the subject. The last value received before successful termination will be sent to all subscribed and future observers.
+ * @param {Mixed} value The value to store in the subject.
+ */
+ onNext: function (value) {
+ checkDisposed(this);
+ if (this.isStopped) { return; }
+ this.value = value;
+ this.hasValue = true;
+ },
+ /**
+ * Unsubscribe all observers and release resources.
+ */
+ dispose: function () {
+ this.isDisposed = true;
+ this.observers = null;
+ this.exception = null;
+ this.value = null;
+ }
+ });
+
+ return AsyncSubject;
+ }(Observable));
+
+ var AnonymousSubject = Rx.AnonymousSubject = (function (__super__) {
+ inherits(AnonymousSubject, __super__);
+
+ function subscribe(observer) {
+ return this.observable.subscribe(observer);
+ }
+
+ function AnonymousSubject(observer, observable) {
+ this.observer = observer;
+ this.observable = observable;
+ __super__.call(this, subscribe);
+ }
+
+ addProperties(AnonymousSubject.prototype, Observer.prototype, {
+ onCompleted: function () {
+ this.observer.onCompleted();
+ },
+ onError: function (error) {
+ this.observer.onError(error);
+ },
+ onNext: function (value) {
+ this.observer.onNext(value);
+ }
+ });
+
+ return AnonymousSubject;
+ }(Observable));
+
+ /**
+ * Represents a value that changes over time.
+ * Observers can subscribe to the subject to receive the last (or initial) value and all subsequent notifications.
+ */
+ var BehaviorSubject = Rx.BehaviorSubject = (function (__super__) {
+ function subscribe(observer) {
+ checkDisposed(this);
+ if (!this.isStopped) {
+ this.observers.push(observer);
+ observer.onNext(this.value);
+ return new InnerSubscription(this, observer);
+ }
+ if (this.hasError) {
+ observer.onError(this.error);
+ } else {
+ observer.onCompleted();
+ }
+ return disposableEmpty;
+ }
+
+ inherits(BehaviorSubject, __super__);
+
+ /**
+ * Initializes a new instance of the BehaviorSubject class which creates a subject that caches its last value and starts with the specified value.
+ * @param {Mixed} value Initial value sent to observers when no other value has been received by the subject yet.
+ */
+ function BehaviorSubject(value) {
+ __super__.call(this, subscribe);
+ this.value = value,
+ this.observers = [],
+ this.isDisposed = false,
+ this.isStopped = false,
+ this.hasError = false;
+ }
+
+ addProperties(BehaviorSubject.prototype, Observer, {
+ /**
+ * Gets the current value or throws an exception.
+ * Value is frozen after onCompleted is called.
+ * After onError is called always throws the specified exception.
+ * An exception is always thrown after dispose is called.
+ * @returns {Mixed} The initial value passed to the constructor until onNext is called; after which, the last value passed to onNext.
+ */
+ getValue: function () {
+ checkDisposed(this);
+ if (this.hasError) {
+ throw this.error;
+ }
+ return this.value;
+ },
+ /**
+ * Indicates whether the subject has observers subscribed to it.
+ * @returns {Boolean} Indicates whether the subject has observers subscribed to it.
+ */
+ hasObservers: function () { return this.observers.length > 0; },
+ /**
+ * Notifies all subscribed observers about the end of the sequence.
+ */
+ onCompleted: function () {
+ checkDisposed(this);
+ if (this.isStopped) { return; }
+ this.isStopped = true;
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ os[i].onCompleted();
+ }
+
+ this.observers.length = 0;
+ },
+ /**
+ * Notifies all subscribed observers about the exception.
+ * @param {Mixed} error The exception to send to all observers.
+ */
+ onError: function (error) {
+ checkDisposed(this);
+ if (this.isStopped) { return; }
+ this.isStopped = true;
+ this.hasError = true;
+ this.error = error;
+
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ os[i].onError(error);
+ }
+
+ this.observers.length = 0;
+ },
+ /**
+ * Notifies all subscribed observers about the arrival of the specified element in the sequence.
+ * @param {Mixed} value The value to send to all observers.
+ */
+ onNext: function (value) {
+ checkDisposed(this);
+ if (this.isStopped) { return; }
+ this.value = value;
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ os[i].onNext(value);
+ }
+ },
+ /**
+ * Unsubscribe all observers and release resources.
+ */
+ dispose: function () {
+ this.isDisposed = true;
+ this.observers = null;
+ this.value = null;
+ this.exception = null;
+ }
+ });
+
+ return BehaviorSubject;
+ }(Observable));
+
+ /**
+ * Represents an object that is both an observable sequence as well as an observer.
+ * Each notification is broadcasted to all subscribed and future observers, subject to buffer trimming policies.
+ */
+ var ReplaySubject = Rx.ReplaySubject = (function (__super__) {
+
+ var maxSafeInteger = Math.pow(2, 53) - 1;
+
+ function createRemovableDisposable(subject, observer) {
+ return disposableCreate(function () {
+ observer.dispose();
+ !subject.isDisposed && subject.observers.splice(subject.observers.indexOf(observer), 1);
+ });
+ }
+
+ function subscribe(observer) {
+ var so = new ScheduledObserver(this.scheduler, observer),
+ subscription = createRemovableDisposable(this, so);
+ checkDisposed(this);
+ this._trim(this.scheduler.now());
+ this.observers.push(so);
+
+ for (var i = 0, len = this.q.length; i < len; i++) {
+ so.onNext(this.q[i].value);
+ }
+
+ if (this.hasError) {
+ so.onError(this.error);
+ } else if (this.isStopped) {
+ so.onCompleted();
+ }
+
+ so.ensureActive();
+ return subscription;
+ }
+
+ inherits(ReplaySubject, __super__);
+
+ /**
+ * Initializes a new instance of the ReplaySubject class with the specified buffer size, window size and scheduler.
+ * @param {Number} [bufferSize] Maximum element count of the replay buffer.
+ * @param {Number} [windowSize] Maximum time length of the replay buffer.
+ * @param {Scheduler} [scheduler] Scheduler the observers are invoked on.
+ */
+ function ReplaySubject(bufferSize, windowSize, scheduler) {
+ this.bufferSize = bufferSize == null ? maxSafeInteger : bufferSize;
+ this.windowSize = windowSize == null ? maxSafeInteger : windowSize;
+ this.scheduler = scheduler || currentThreadScheduler;
+ this.q = [];
+ this.observers = [];
+ this.isStopped = false;
+ this.isDisposed = false;
+ this.hasError = false;
+ this.error = null;
+ __super__.call(this, subscribe);
+ }
+
+ addProperties(ReplaySubject.prototype, Observer.prototype, {
+ /**
+ * Indicates whether the subject has observers subscribed to it.
+ * @returns {Boolean} Indicates whether the subject has observers subscribed to it.
+ */
+ hasObservers: function () {
+ return this.observers.length > 0;
+ },
+ _trim: function (now) {
+ while (this.q.length > this.bufferSize) {
+ this.q.shift();
+ }
+ while (this.q.length > 0 && (now - this.q[0].interval) > this.windowSize) {
+ this.q.shift();
+ }
+ },
+ /**
+ * Notifies all subscribed observers about the arrival of the specified element in the sequence.
+ * @param {Mixed} value The value to send to all observers.
+ */
+ onNext: function (value) {
+ checkDisposed(this);
+ if (this.isStopped) { return; }
+ var now = this.scheduler.now();
+ this.q.push({ interval: now, value: value });
+ this._trim(now);
+
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ var observer = os[i];
+ observer.onNext(value);
+ observer.ensureActive();
+ }
+ },
+ /**
+ * Notifies all subscribed observers about the exception.
+ * @param {Mixed} error The exception to send to all observers.
+ */
+ onError: function (error) {
+ checkDisposed(this);
+ if (this.isStopped) { return; }
+ this.isStopped = true;
+ this.error = error;
+ this.hasError = true;
+ var now = this.scheduler.now();
+ this._trim(now);
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ var observer = os[i];
+ observer.onError(error);
+ observer.ensureActive();
+ }
+ this.observers.length = 0;
+ },
+ /**
+ * Notifies all subscribed observers about the end of the sequence.
+ */
+ onCompleted: function () {
+ checkDisposed(this);
+ if (this.isStopped) { return; }
+ this.isStopped = true;
+ var now = this.scheduler.now();
+ this._trim(now);
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ var observer = os[i];
+ observer.onCompleted();
+ observer.ensureActive();
+ }
+ this.observers.length = 0;
+ },
+ /**
+ * Unsubscribe all observers and release resources.
+ */
+ dispose: function () {
+ this.isDisposed = true;
+ this.observers = null;
+ }
+ });
+
+ return ReplaySubject;
+ }(Observable));
+
+ /**
+ * Used to pause and resume streams.
+ */
+ Rx.Pauser = (function (__super__) {
+ inherits(Pauser, __super__);
+
+ function Pauser() {
+ __super__.call(this);
+ }
+
+ /**
+ * Pauses the underlying sequence.
+ */
+ Pauser.prototype.pause = function () { this.onNext(false); };
+
+ /**
+ * Resumes the underlying sequence.
+ */
+ Pauser.prototype.resume = function () { this.onNext(true); };
+
+ return Pauser;
+ }(Subject));
+
+ if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
+ root.Rx = Rx;
+
+ define(function() {
+ return Rx;
+ });
+ } else if (freeExports && freeModule) {
+ // in Node.js or RingoJS
+ if (moduleExports) {
+ (freeModule.exports = Rx).Rx = Rx;
+ } else {
+ freeExports.Rx = Rx;
+ }
+ } else {
+ // in a browser or Rhino
+ root.Rx = Rx;
+ }
+
+ // All code before this point will be filtered from stack traces.
+ var rEndingLine = captureLine();
+
+}.call(this));
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.compat.map b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.compat.map
new file mode 100644
index 00000000000..86461b895ac
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.compat.map
@@ -0,0 +1 @@
+{"version":3,"file":"rx.lite.compat.min.js","sources":["rx.lite.compat.js"],"names":["undefined","cloneArray","arr","len","length","a","Array","i","makeStackTraceLong","error","observable","hasStacks","stack","indexOf","STACK_JUMP_SEPARATOR","stacks","o","source","unshift","concatedStacks","join","filterStackString","stackString","lines","split","desiredLines","line","isInternalFrame","isNodeFrame","push","stackLine","fileNameAndLineNumber","getFileNameAndLineNumber","fileName","lineNumber","rFileName","rStartingLine","rEndingLine","captureLine","Error","e","firstLine","attempt1","exec","Number","attempt2","attempt3","keysIn","object","result","isObject","support","nonEnumArgs","isArguments","slice","call","skipProto","enumPrototypes","skipErrorProps","enumErrorProps","errorProto","key","nonEnumShadows","objectProto","ctor","constructor","index","dontEnumsLength","prototype","className","stringProto","stringClass","errorClass","toString","nonEnum","nonEnumProps","dontEnums","hasOwnProperty","internalFor","callback","keysFunc","props","internalForIn","isNode","value","deepEquals","b","stackA","stackB","type","otherType","otherClass","argsClass","objectClass","boolClass","dateClass","numberClass","regexpClass","String","isArr","arrayClass","nodeClass","ctorA","argsObject","Object","ctorB","isFunction","size","pop","tryCatcher","tryCatchTarget","apply","this","arguments","errorObj","tryCatch","fn","TypeError","thrower","arrayInitialize","count","factory","IndexedItem","id","StringIterable","str","_s","s","StringIterator","_l","_i","ArrayIterable","_a","ArrayIterator","toLength","numberIsFinite","root","isFinite","getIterable","it","$iterator$","sign","number","isNaN","Math","floor","abs","maxSafeInteger","FromArraySink","observer","parent","observableOf","scheduler","array","isScheduler","currentThreadScheduler","FromArrayObservable","PairsSink","RepeatSink","observableCatchHandler","handler","AnonymousObservable","d1","SingleAssignmentDisposable","subscription","SerialDisposable","setDisposable","subscribe","x","onNext","ex","onError","isPromise","observableFromPromise","d","onCompleted","falseFactory","zipArray","second","resultSelector","first","left","right","res","emptyArrayFactory","arrayFactory","ScanObserver","accumulator","hasSeed","seed","hasAccumulation","accumulation","hasValue","isStopped","concatMap","selector","thisArg","selectorFunc","bindCallback","map","isArrayLike","isIterable","observableFrom","concatAll","flatMap","mergeAll","isNodeList","el","window","StaticNodeList","NodeList","fixEvent","event","stopPropagation","cancelBubble","preventDefault","bubbledKeyCode","keyCode","ctrlKey","defaultPrevented","returnValue","modified","target","srcElement","relatedTarget","fromElement","toElement","c","charCode","keyChar","fromCharCode","createListener","element","name","addEventListener","disposableCreate","removeEventListener","attachEvent","innerHandler","detachEvent","createEventListener","eventName","disposables","CompositeDisposable","add","item","observableTimerDate","dueTime","scheduleWithAbsolute","observableTimerDateAndPeriod","period","p","normalizeTime","scheduleRecursiveWithAbsoluteAndState","self","now","observableTimerTimeSpan","scheduleWithRelative","observableTimerTimeSpanAndPeriod","schedulePeriodicWithState","observableDefer","observableDelayTimeSpan","active","cancelable","exception","q","running","materialize","timestamp","notification","shouldRun","kind","scheduleRecursiveWithRelative","recurseDueTime","shouldRecurse","shift","accept","max","observableDelayDate","sampleObservable","sampler","sampleSubscribe","atEnd","sourceSubscription","newValue","dispose","combineLatestSource","subject","next","values","hasValueAll","every","identity","err","isDone","objectTypes","boolean","function","string","freeExports","exports","nodeType","freeModule","module","moduleExports","freeGlobal","global","Rx","internals","config","Promise","helpers","noop","notDefined","defaultNow","pluck","property","just","Date","defaultComparer","y","isEqual","defaultSubComparer","defaultError","defaultKeySerializer","then","asArray","not","isFn","longStackSupport","EmptyError","message","ObjectDisposedError","ArgumentOutOfRangeError","NotSupportedError","NotImplementedError","notImplemented","notSupported","Symbol","iterator","Set","doneEnumerator","done","supportNodeClass","func","argCount","arg","collection","funcClass","supportsArgsClass","propertyIsEnumerable","document","toLocaleString","valueOf","test","inherits","child","__","addProperties","obj","sources","idx","ln","prop","addRef","xs","r","getDisposable","Function","bind","that","args","bound","F","concat","forEach","T","k","O","kValue","boxedString","splitString","fun","thisp","filter","predicate","results","t","isArray","searchElement","n","Infinity","keys","hasDontEnumBug","compareTo","other","PriorityQueue","capacity","items","priorityProto","isHigherPriority","percolate","temp","heapify","peek","removeAt","dequeue","enqueue","remove","isDisposable","isDisposed","CompositeDisposablePrototype","shouldDispose","splice","currentDisposables","Disposable","action","create","disposableEmpty","empty","checkDisposed","disposable","current","old","ScheduledItem","RefCountDisposable","InnerDisposable","isInnerDisposed","underlyingDisposable","isPrimaryDisposed","state","comparer","invoke","invokeCore","isCancelled","Scheduler","schedule","scheduleRelative","scheduleAbsolute","_schedule","_scheduleRelative","_scheduleAbsolute","invokeAction","schedulerProto","scheduleWithState","scheduleWithRelativeAndState","scheduleWithAbsoluteAndState","normalize","timeSpan","invokeRecImmediate","pair","recursiveAction","state1","state2","isAdded","scheduler1","state3","group","invokeRecDate","method","dueTime1","scheduleInnerRecursive","dt","scheduleRecursive","scheduleRecursiveWithState","scheduleRecursiveWithRelativeAndState","scheduleRecursiveWithAbsolute","schedulePeriodic","setInterval","clearInterval","scheduleMethod","clearMethod","immediateScheduler","immediate","scheduleNow","currentThread","runTrampoline","queue","si","currentScheduler","scheduleRequired","localTimer","SchedulePeriodicRecursive","tick","command","recurse","_period","_state","_action","_cancel","_scheduler","start","localSetTimeout","localClearTimeout","setTimeout","clearTimeout","WScript","time","Sleep","runTask","handle","currentlyRunning","task","tasksByHandle","postMessageSupported","postMessage","importScripts","isAsync","oldHandler","onmessage","onGlobalPostMessage","data","substring","MSG_PREFIX","nextHandle","reNative","RegExp","replace","setImmediate","process","nextTick","random","currentId","MessageChannel","channel","port1","port2","createElement","scriptElement","onreadystatechange","parentNode","removeChild","documentElement","appendChild","observableProto","timeoutScheduler","timeout","Notification","acceptObservable","_accept","_acceptObservable","observerOrOnNext","toObservable","_","notificationCreateOnNext","createOnNext","notificationCreateOnError","createOnError","notificationCreateOnCompleted","createOnCompleted","Observer","observerCreate","AnonymousObserver","AbstractObserver","__super__","completed","fail","_onNext","_onError","_onCompleted","Observable","_subscribe","oldOnError","subscribeOnNext","subscribeOnError","subscribeOnCompleted","ObservableBase","fixSubscriber","subscriber","ado","sub","subscribeCore","AutoDetachObserver","Enumerable","ConcatEnumerableObservable","InnerObserver","currentItem","currentValue","CatchErrorObservable","lastException","catchError","catchErrorWhen","notificationHandler","exceptions","Subject","notifier","handled","notificationDisposable","outer","inner","exn","RepeatEnumerable","v","RepeatEnumerator","l","enumerableRepeat","repeat","repeatCount","OfEnumerable","OfEnumerator","enumerableOf","of","ScheduledObserver","isAcquired","hasFaulted","ensureActive","isOwner","work","ToArrayObservable","toArray","createWithDisposable","defer","observableFactory","observableThrow","EmptyObservable","EmptySink","scheduleItem","sink","run","observableEmpty","FromObservable","iterable","mapper","FromSink","loopRecursive","list","pow","charAt","from","mapFn","observableFromArray","fromArray","NeverObservable","never","ofWithScheduler","PairsObservable","pairs","RangeObservable","rangeCount","RangeSink","range","RepeatObservable","JustObservable","JustSink","ThrowObservable","ThrowSink","throwError","throwException","catchException","handlerOrSecond","observableCatch","combineLatest","j","subscriptions","sad","observableConcat","ConcatObservable","ConcatSink","concatObservable","merge","MergeObservable","maxConcurrent","g","MergeObserver","activeCount","handleSubscribe","innerSource","maxConcurrentOrOther","observableMerge","MergeAllObservable","MergeAllObserver","m","mergeObservable","CompositeError","errors","innerErrors","mergeDelayError","setCompletion","innerSubscription","skipUntil","isOpen","rightSubscription","SwitchObservable","SwitchObserver","stopped","latest","hasLatest","switchLatest","TakeUntilObservable","takeUntil","withLatestFrom","allValues","zip","queues","queuedValues","asObservable","dematerialize","distinctUntilChanged","keySelector","currentKey","hasCurrentKey","comparerEquals","TapObservable","tap","doAction","doOnNext","tapOnNext","doOnError","tapOnError","doOnCompleted","tapOnCompleted","ensure","finallyAction","IgnoreElementsObservable","ignoreElements","retry","retryCount","retryWhen","ScanObservable","scan","skipLast","startWith","takeLast","selectConcat","selectorResult","i2","MapObservable","innerMap","internalMap","select","selectorFn","currentProp","selectMany","selectSwitch","flatMapLatest","switchMap","SkipObservable","skipCount","skip","skipWhile","take","remaining","takeWhile","FilterObservable","innerPredicate","internalFilter","shouldYield","where","fromCallback","context","publishLast","refCount","fromNodeCallback","useNativeEvents","fromEvent","addListener","fromEventPattern","h","removeListener","on","off","publish","addHandler","removeHandler","FromPromiseObservable","fromPromise","promise","toPromise","promiseCtor","resolve","reject","startAsync","functionAsync","multicast","subjectOrSubjectSelector","connectable","connect","ConnectableObservable","share","AsyncSubject","publishValue","initialValueOrSelector","initialValue","BehaviorSubject","shareValue","replay","bufferSize","windowSize","ReplaySubject","shareReplay","hasSubscription","sourceObservable","connectableSubscription","shouldConnect","observableinterval","interval","timer","periodOrScheduler","getTime","delay","debounce","throttleWithTimeout","hasvalue","throttle","sample","throttleLatest","intervalOrSampler","schedulerMethod","createTimer","myId","original","switched","throttleFirst","windowDuration","duration","RangeError","lastOnNext","PausableObservable","conn","connection","pausable","pauser","controller","pause","resume","PausableBufferedObservable","drainQueue","previousShouldFire","shouldFire","pausableBuffered","ControlledObservable","enableQueue","ControlledSubject","request","numberOfItems","requestedCount","requestedDisposable","hasFailed","hasCompleted","hasRequested","disposeCurrentRequest","_processRequest","controlled","pipe","dest","onDrain","write","emit","_isStdio","end","transduce","transducer","transformForObserver","@@transducer/init","@@transducer/step","obs","input","@@transducer/result","xform","AutoDetachObserverPrototype","InnerSubscription","observers","hasError","hasObservers","os","AnonymousSubject","getValue","createRemovableDisposable","so","_trim","Pauser","define","amd"],"mappings":";CAEE,SAAUA,GA2DR,QAASC,GAAWC,GAElB,IAAI,GADAC,GAAMD,EAAIE,OAAQC,EAAI,GAAIC,OAAMH,GAC5BI,EAAI,EAAOJ,EAAJI,EAASA,IAAOF,EAAEE,GAAKL,EAAIK,EAC1C,OAAOF,GAgBX,QAASG,GAAmBC,EAAOC,GAG/B,GAAIC,IACAD,EAAWE,OACM,gBAAVH,IACG,OAAVA,GACAA,EAAMG,OACwC,KAA9CH,EAAMG,MAAMC,QAAQC,IACtB,CAEA,IAAK,GADDC,MACKC,EAAIN,EAAcM,EAAGA,EAAIA,EAAEC,OAC9BD,EAAEJ,OACJG,EAAOG,QAAQF,EAAEJ,MAGrBG,GAAOG,QAAQT,EAAMG,MAErB,IAAIO,GAAiBJ,EAAOK,KAAK,KAAON,GAAuB,KAC/DL,GAAMG,MAAQS,EAAkBF,IAItC,QAASE,GAAkBC,GAGzB,IAAK,GAFDC,GAAQD,EAAYE,MAAM,MAC1BC,KACKlB,EAAI,EAAGJ,EAAMoB,EAAMnB,OAAYD,EAAJI,EAASA,IAAK,CAChD,GAAImB,GAAOH,EAAMhB,EAEZoB,GAAgBD,IAAUE,EAAYF,KAASA,GAClD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GAEpBE,IACDF,GAAWF,QAAUO,IAAIA,GAAKA,GAE/BR,EAAYQ,GAAKA,GAInB3K,EAAK2K,GAAKA,EAIZ,IAAI9Q,IAAcC,MAElBiB,KAAKyD"} \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.compat.min.js b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.compat.min.js
new file mode 100644
index 00000000000..86161d0f514
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.compat.min.js
@@ -0,0 +1,5 @@
+/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
+(function(a){function b(a){for(var b=a.length,c=new Array(b),d=0;b>d;d++)c[d]=a[d];return c}function c(a,b){if(ma&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(qa)){for(var c=[],e=b;e;e=e.source)e.stack&&c.unshift(e.stack);c.unshift(a.stack);var f=c.join("\n"+qa+"\n");a.stack=d(f)}}function d(a){for(var b=a.split("\n"),c=[],d=0,g=b.length;g>d;d++){var h=b[d];e(h)||f(h)||!h||c.push(h)}return c.join("\n")}function e(a){var b=h(a);if(!b)return!1;var c=b[0],d=b[1];return c===oa&&d>=pa&&Vc>=d}function f(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function g(){if(ma)try{throw new Error}catch(a){var b=a.stack.split("\n"),c=b[0].indexOf("@")>0?b[1]:b[2],d=h(c);if(!d)return;return oa=d[0],d[1]}}function h(a){var b=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(a);if(b)return[b[1],Number(b[2])];var c=/at ([^ ]+):(\d+):(?:\d+)$/.exec(a);if(c)return[c[1],Number(c[2])];var d=/.*@(.+):(\d+)$/.exec(a);return d?[d[1],Number(d[2])]:void 0}function i(a){var b=[];if(!Za(a))return b;Ya.nonEnumArgs&&a.length&&$a(a)&&(a=cb.call(a));var c=Ya.enumPrototypes&&"function"==typeof a,d=Ya.enumErrorProps&&(a===Ta||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(Ya.nonEnumShadows&&a!==Ua){var f=a.constructor,g=-1,h=Fa;if(a===(f&&f.prototype))var i=a===Va?Pa:a===Ta?Ka:Qa.call(a),j=Xa[i];for(;++g<h;)e=Ea[g],j&&j[e]||!Ra.call(a,e)||b.push(e)}return b}function j(a,b,c){for(var d=-1,e=c(a),f=e.length;++d<f;){var g=e[d];if(b(a[g],g,a)===!1)break}return a}function k(a,b){return j(a,b,i)}function l(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function m(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,f=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=f&&"object"!=f))return!1;var g=Qa.call(a),h=Qa.call(b);if(g==Ga&&(g=Na),h==Ga&&(h=Na),g!=h)return!1;switch(g){case Ia:case Ja:return+a==+b;case Ma:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case Oa:case Pa:return a==String(b)}var i=g==Ha;if(!i){if(g!=Na||!Ya.nodeClass&&(l(a)||l(b)))return!1;var j=!Ya.argsObject&&$a(a)?Object:a.constructor,n=!Ya.argsObject&&$a(b)?Object:b.constructor;if(!(j==n||Ra.call(a,"constructor")&&Ra.call(b,"constructor")||la(j)&&j instanceof j&&la(n)&&n instanceof n||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var o=c.length;o--;)if(c[o]==a)return d[o]==b;var p=0,q=!0;if(c.push(a),d.push(b),i){if(o=a.length,p=b.length,q=p==o)for(;p--;){var r=b[p];if(!(q=m(a[p],r,c,d)))break}}else k(b,function(b,e,f){return Ra.call(f,e)?(p++,q=Ra.call(a,e)&&m(a[e],b,c,d)):void 0}),q&&k(a,function(a,b,c){return Ra.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function n(){try{return _a.apply(this,arguments)}catch(a){return bb.e=a,bb}}function o(a){if(!la(a))throw new TypeError("fn must be a function");return _a=a,n}function p(a){throw a}function q(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function r(a,b){this.id=a,this.value=b}function t(a){this._s=s}function u(a){this._s=s,this._l=s.length,this._i=0}function v(a){this._a=a}function w(a){this._a=a,this._l=A(a),this._i=0}function x(a){return"number"==typeof a&&$.isFinite(a)}function y(b){var c,d=b[ya];if(!d&&"string"==typeof b)return c=new t(b),c[ya]();if(!d&&b.length!==a)return c=new v(b),c[ya]();if(!d)throw new TypeError("Object is not iterable");return b[ya]()}function z(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function A(a){var b=+a.length;return isNaN(b)?0:0!==b&&x(b)?(b=z(b)*Math.floor(Math.abs(b)),0>=b?0:b>bc?bc:b):b}function B(a,b){this.observer=a,this.parent=b}function C(a,b){return vb(a)||(a=zb),new dc(b,a)}function D(a,b){this.observer=a,this.parent=b}function E(a,b){this.observer=a,this.parent=b}function F(a,b){return new Nc(function(c){var d=new qb,e=new rb;return e.setDisposable(d),d.setDisposable(a.subscribe(function(a){c.onNext(a)},function(a){try{var d=b(a)}catch(f){return c.onError(f)}ka(d)&&(d=Gc(d));var g=new qb;e.setDisposable(g),g.setDisposable(d.subscribe(c))},function(a){c.onCompleted(a)})),e},a)}function G(){return!1}function H(a,b){var c=this;return new Nc(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g=a[e++],h=o(b)(c,g);if(h===bb)return d.onError(h.e);d.onNext(h)}else d.onCompleted()},function(a){d.onError(a)},function(){d.onCompleted()})},c)}function G(){return!1}function I(){return[]}function G(){return!1}function J(){return[]}function K(a,b){this.observer=a,this.accumulator=b.accumulator,this.hasSeed=b.hasSeed,this.seed=b.seed,this.hasAccumulation=!1,this.accumulation=null,this.hasValue=!1,this.isStopped=!1}function L(a,b,c){var d=Da(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return ka(e)&&(e=Gc(e)),(Ba(e)||Aa(e))&&(e=cc(e)),e}).concatAll()}function M(a,b,c){var d=Da(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return ka(e)&&(e=Gc(e)),(Ba(e)||Aa(e))&&(e=cc(e)),e}).mergeAll()}function N(a){return window.StaticNodeList?a instanceof window.StaticNodeList||a instanceof window.NodeList:"[object NodeList]"==Object.prototype.toString.call(a)}function O(a){var b=function(){this.cancelBubble=!0},c=function(){if(this.bubbledKeyCode=this.keyCode,this.ctrlKey)try{this.keyCode=0}catch(a){}this.defaultPrevented=!0,this.returnValue=!1,this.modified=!0};if(a||(a=$.event),!a.target)switch(a.target=a.target||a.srcElement,"mouseover"==a.type&&(a.relatedTarget=a.fromElement),"mouseout"==a.type&&(a.relatedTarget=a.toElement),a.stopPropagation||(a.stopPropagation=b,a.preventDefault=c),a.type){case"keypress":var d="charCode"in a?a.charCode:a.keyCode;10==d?(d=0,a.keyCode=13):13==d||27==d?d=0:3==d&&(d=99),a.charCode=d,a.keyChar=a.charCode?String.fromCharCode(a.charCode):""}return a}function P(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1),mb(function(){a.removeEventListener(b,c,!1)});if(a.attachEvent){var d=function(a){c(O(a))};return a.attachEvent("on"+b,d),mb(function(){a.detachEvent("on"+b,d)})}return a["on"+b]=c,mb(function(){a["on"+b]=null})}function Q(a,b,c){var d=new jb;if(N(a)||"[object HTMLCollection]"===Object.prototype.toString.call(a))for(var e=0,f=a.length;f>e;e++)d.add(Q(a.item(e),b,c));else a&&d.add(P(a,b,c));return d}function R(a,b){return new Nc(function(c){return b.scheduleWithAbsolute(a,function(){c.onNext(0),c.onCompleted()})})}function S(a,b,c){return new Nc(function(d){var e=a,f=ub(b);return c.scheduleRecursiveWithAbsoluteAndState(0,e,function(a,b){if(f>0){var g=c.now();e+=f,g>=e&&(e=g+f)}d.onNext(a),b(a+1,e)})})}function T(a,b){return new Nc(function(c){return b.scheduleWithRelative(ub(a),function(){c.onNext(0),c.onCompleted()})})}function U(a,b,c){return a===b?new Nc(function(a){return c.schedulePeriodicWithState(0,b,function(b){return a.onNext(b),b+1})}):Yb(function(){return S(c.now()+a,b,c)})}function V(a,b,c){return new Nc(function(d){var e,f=!1,g=new rb,h=null,i=[],j=!1;return e=a.materialize().timestamp(c).subscribe(function(a){var e,k;"E"===a.value.kind?(i=[],i.push(a),h=a.value.exception,k=!j):(i.push({value:a.value,timestamp:a.timestamp+b}),k=!f,f=!0),k&&(null!==h?d.onError(h):(e=new qb,g.setDisposable(e),e.setDisposable(c.scheduleRecursiveWithRelative(b,function(a){var b,e,g,k;if(null===h){j=!0;do g=null,i.length>0&&i[0].timestamp-c.now()<=0&&(g=i.shift().value),null!==g&&g.accept(d);while(null!==g);k=!1,e=0,i.length>0?(k=!0,e=Math.max(0,i[0].timestamp-c.now())):f=!1,b=h,j=!1,null!==b?d.onError(b):k&&a(e)}}))))}),new jb(e,g)},a)}function W(a,b,c){return Yb(function(){return V(a,b-c.now(),c)})}function X(a,b){return new Nc(function(c){function d(){g&&(g=!1,c.onNext(e)),f&&c.onCompleted()}var e,f=!1,g=!1,h=new qb;return h.setDisposable(a.subscribe(function(a){g=!0,e=a},function(a){c.onError(a)},function(){f=!0,h.dispose()})),new jb(h,b.subscribe(d,function(a){c.onError(a)},d))},a)}function Y(a,b,c){return new Nc(function(d){function e(a,b){if(j[b]=a,g[b]=!0,h||(h=g.every(fa))){if(f)return d.onError(f);var e=o(c).apply(null,j);if(e===bb)return d.onError(e.e);d.onNext(e)}i&&j[1]&&d.onCompleted()}var f,g=[!1,!1],h=!1,i=!1,j=new Array(2);return new jb(a.subscribe(function(a){e(a,0)},function(a){j[1]?d.onError(a):f=a},function(){i=!0,j[1]&&d.onCompleted()}),b.subscribe(function(a){e(a,1)},function(a){d.onError(a)},function(){i=!0,e(!0,1)}))},a)}var Z={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},$=Z[typeof window]&&window||this,_=Z[typeof exports]&&exports&&!exports.nodeType&&exports,aa=Z[typeof module]&&module&&!module.nodeType&&module,ba=aa&&aa.exports===_&&_,ca=Z[typeof global]&&global;!ca||ca.global!==ca&&ca.window!==ca||($=ca);var da={internals:{},config:{Promise:$.Promise},helpers:{}},ea=da.helpers.noop=function(){},fa=(da.helpers.notDefined=function(a){return"undefined"==typeof a},da.helpers.identity=function(a){return a}),ga=(da.helpers.pluck=function(a){return function(b){return b[a]}},da.helpers.just=function(a){return function(){return a}},da.helpers.defaultNow=function(){return Date.now?Date.now:function(){return+new Date}}()),ha=da.helpers.defaultComparer=function(a,b){return ab(a,b)},ia=da.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},ja=(da.helpers.defaultKeySerializer=function(a){return a.toString()},da.helpers.defaultError=function(a){throw a}),ka=da.helpers.isPromise=function(a){return!!a&&"function"!=typeof a.subscribe&&"function"==typeof a.then},la=(da.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},da.helpers.not=function(a){return!a},da.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==Qa.call(a)}),a}());da.config.longStackSupport=!1;var ma=!1;try{throw new Error}catch(na){ma=!!na.stack}var oa,pa=g(),qa="From previous event:",ra=da.EmptyError=function(){this.message="Sequence contains no elements.",Error.call(this)};ra.prototype=Error.prototype;var sa=da.ObjectDisposedError=function(){this.message="Object has been disposed",Error.call(this)};sa.prototype=Error.prototype;var ta=da.ArgumentOutOfRangeError=function(){this.message="Argument out of range",Error.call(this)};ta.prototype=Error.prototype;var ua=da.NotSupportedError=function(a){this.message=a||"This operation is not supported",Error.call(this)};ua.prototype=Error.prototype;var va=da.NotImplementedError=function(a){this.message=a||"This operation is not implemented",Error.call(this)};va.prototype=Error.prototype;var wa=da.helpers.notImplemented=function(){throw new va},xa=da.helpers.notSupported=function(){throw new ua},ya="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";$.Set&&"function"==typeof(new $.Set)["@@iterator"]&&(ya="@@iterator");var za=da.doneEnumerator={done:!0,value:a},Aa=da.helpers.isIterable=function(b){return b[ya]!==a},Ba=da.helpers.isArrayLike=function(b){return b&&b.length!==a};da.helpers.iterator=ya;var Ca,Da=da.internals.bindCallback=function(a,b,c){if("undefined"==typeof b)return a;switch(c){case 0:return function(){return a.call(b)};case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)}}return function(){return a.apply(b,arguments)}},Ea=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Fa=Ea.length,Ga="[object Arguments]",Ha="[object Array]",Ia="[object Boolean]",Ja="[object Date]",Ka="[object Error]",La="[object Function]",Ma="[object Number]",Na="[object Object]",Oa="[object RegExp]",Pa="[object String]",Qa=Object.prototype.toString,Ra=Object.prototype.hasOwnProperty,Sa=Qa.call(arguments)==Ga,Ta=Error.prototype,Ua=Object.prototype,Va=String.prototype,Wa=Ua.propertyIsEnumerable;try{Ca=!(Qa.call(document)==Na&&!({toString:0}+""))}catch(na){Ca=!0}var Xa={};Xa[Ha]=Xa[Ja]=Xa[Ma]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},Xa[Ia]=Xa[Pa]={constructor:!0,toString:!0,valueOf:!0},Xa[Ka]=Xa[La]=Xa[Oa]={constructor:!0,toString:!0},Xa[Na]={constructor:!0};var Ya={};!function(){var a=function(){this.x=1},b=[];a.prototype={valueOf:1,y:1};for(var c in new a)b.push(c);for(c in arguments);Ya.enumErrorProps=Wa.call(Ta,"message")||Wa.call(Ta,"name"),Ya.enumPrototypes=Wa.call(a,"prototype"),Ya.nonEnumArgs=0!=c,Ya.nonEnumShadows=!/valueOf/.test(b)}(1);var Za=da.internals.isObject=function(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1},$a=function(a){return a&&"object"==typeof a?Qa.call(a)==Ga:!1};Sa||($a=function(a){return a&&"object"==typeof a?Ra.call(a,"callee"):!1});{var _a,ab=da.internals.isEqual=function(a,b){return m(a,b,[],[])},bb={e:{}},cb=({}.hasOwnProperty,Array.prototype.slice),db=this.inherits=da.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c},eb=da.internals.addProperties=function(a){for(var b=[],c=1,d=arguments.length;d>c;c++)b.push(arguments[c]);for(var e=0,f=b.length;f>e;e++){var g=b[e];for(var h in g)a[h]=g[h]}};da.internals.addRef=function(a,b){return new Nc(function(c){return new jb(b.getDisposable(),a.subscribe(c))})}}Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=cb.call(arguments,1),d=function(){function e(){}if(this instanceof d){e.prototype=b.prototype;var f=new e,g=b.apply(f,c.concat(cb.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(cb.call(arguments)))};return d}),Array.prototype.forEach||(Array.prototype.forEach=function(a,b){var c,d;if(null==this)throw new TypeError(" this is null or not defined");var e=Object(this),f=e.length>>>0;if("function"!=typeof a)throw new TypeError(a+" is not a function");for(arguments.length>1&&(c=b),d=0;f>d;){var g;d in e&&(g=e[d],a.call(c,g,d,e)),d++}});var fb=Object("a"),gb="a"!=fb[0]||!(0 in fb);Array.prototype.every||(Array.prototype.every=function(a){var b=Object(this),c=gb&&{}.toString.call(this)==Pa?this.split(""):b,d=c.length>>>0,e=arguments[1];if({}.toString.call(a)!=La)throw new TypeError(a+" is not a function");for(var f=0;d>f;f++)if(f in c&&!a.call(e,c[f],f,b))return!1;return!0}),Array.prototype.map||(Array.prototype.map=function(a){var b=Object(this),c=gb&&{}.toString.call(this)==Pa?this.split(""):b,d=c.length>>>0,e=Array(d),f=arguments[1];if({}.toString.call(a)!=La)throw new TypeError(a+" is not a function");for(var g=0;d>g;g++)g in c&&(e[g]=a.call(f,c[g],g,b));return e}),Array.prototype.filter||(Array.prototype.filter=function(a){for(var b,c=[],d=new Object(this),e=0,f=d.length>>>0;f>e;e++)b=d[e],e in d&&a.call(arguments[1],b,e,d)&&c.push(b);return c}),Array.isArray||(Array.isArray=function(a){return{}.toString.call(a)==Ha}),Array.prototype.indexOf||(Array.prototype.indexOf=function(a){var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=0;if(arguments.length>1&&(d=Number(arguments[1]),d!==d?d=0:0!==d&&d!=1/0&&d!==-(1/0)&&(d=(d>0||-1)*Math.floor(Math.abs(d)))),d>=c)return-1;for(var e=d>=0?d:Math.max(c-Math.abs(d),0);c>e;e++)if(e in b&&b[e]===a)return e;return-1}),Object.prototype.propertyIsEnumerable||(Object.prototype.propertyIsEnumerable=function(a){for(var b in this)if(b===a)return!0;return!1}),Object.keys||(Object.keys=function(){"use strict";var a=Object.prototype.hasOwnProperty,b=!{toString:null}.propertyIsEnumerable("toString");return function(c){if("object"!=typeof c&&("function"!=typeof c||null===c))throw new TypeError("Object.keys called on non-object");var d,e,f=[];for(d in c)a.call(c,d)&&f.push(d);if(b)for(e=0;Fa>e;e++)a.call(c,Ea[e])&&f.push(Ea[e]);return f}}()),r.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var hb=da.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},ib=hb.prototype;ib.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},ib.percolate=function(a){if(!(a>=this.length||0>a)){var b=a-1>>1;if(!(0>b||b===a)&&this.isHigherPriority(a,b)){var c=this.items[a];this.items[a]=this.items[b],this.items[b]=c,this.percolate(b)}}},ib.heapify=function(a){if(+a||(a=0),!(a>=this.length||0>a)){var b=2*a+1,c=2*a+2,d=a;if(b<this.length&&this.isHigherPriority(b,d)&&(d=b),c<this.length&&this.isHigherPriority(c,d)&&(d=c),d!==a){var e=this.items[a];this.items[a]=this.items[d],this.items[d]=e,this.heapify(d)}}},ib.peek=function(){return this.items[0].value},ib.removeAt=function(b){this.items[b]=this.items[--this.length],this.items[this.length]=a,this.heapify()},ib.dequeue=function(){var a=this.peek();return this.removeAt(0),a},ib.enqueue=function(a){var b=this.length++;this.items[b]=new r(hb.count++,a),this.percolate(b)},ib.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},hb.count=0;var jb=da.CompositeDisposable=function(){var a,b,c=[];if(Array.isArray(arguments[0]))c=arguments[0],b=c.length;else for(b=arguments.length,c=new Array(b),a=0;b>a;a++)c[a]=arguments[a];for(a=0;b>a;a++)if(!ob(c[a]))throw new TypeError("Not a disposable");this.disposables=c,this.isDisposed=!1,this.length=c.length},kb=jb.prototype;kb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},kb.remove=function(a){var b=!1;if(!this.isDisposed){var c=this.disposables.indexOf(a);-1!==c&&(b=!0,this.disposables.splice(c,1),this.length--,a.dispose())}return b},kb.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;for(var a=this.disposables.length,b=new Array(a),c=0;a>c;c++)b[c]=this.disposables[c];for(this.disposables=[],this.length=0,c=0;a>c;c++)b[c].dispose()}};var lb=da.Disposable=function(a){this.isDisposed=!1,this.action=a||ea};lb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var mb=lb.create=function(a){return new lb(a)},nb=lb.empty={dispose:ea},ob=lb.isDisposable=function(a){return a&&la(a.dispose)},pb=lb.checkDisposed=function(a){if(a.isDisposed)throw new sa},qb=da.SingleAssignmentDisposable=function(){this.isDisposed=!1,this.current=null};qb.prototype.getDisposable=function(){return this.current},qb.prototype.setDisposable=function(a){if(this.current)throw new Error("Disposable has already been assigned");var b=this.isDisposed;!b&&(this.current=a),b&&a&&a.dispose()},qb.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var rb=da.SerialDisposable=function(){this.isDisposed=!1,this.current=null};rb.prototype.getDisposable=function(){return this.current},rb.prototype.setDisposable=function(a){var b=this.isDisposed;if(!b){var c=this.current;this.current=a}c&&c.dispose(),b&&a&&a.dispose()},rb.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var sb=(da.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?nb:new a(this)},b}(),da.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||ia,this.disposable=new qb});sb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},sb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},sb.prototype.isCancelled=function(){return this.disposable.isDisposed},sb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var tb=da.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),nb}a.isScheduler=function(b){return b instanceof a};var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=ga,a.normalize=function(a){return 0>a&&(a=0),a},a}(),ub=tb.normalize,vb=tb.isScheduler;!function(a){function b(a,b){function c(b){e(b,function(b){var d=!1,e=!1,g=a.scheduleWithState(b,function(a,b){return d?f.remove(g):e=!0,c(b),nb});e||(f.add(g),d=!0)})}var d=b[0],e=b[1],f=new jb;return c(d),f}function c(a,b,c){function d(b){f(b,function(b,e){var f=!1,h=!1,i=a[c](b,e,function(a,b){return f?g.remove(i):h=!0,d(b),nb});h||(g.add(i),f=!0)})}var e=b[0],f=b[1],g=new jb;return d(e),g}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,d)},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState([a,c],b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative([a,d],b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,d)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute([a,d],b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(tb.prototype),function(a){tb.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},tb.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof $.setInterval)throw new ua;b=ub(b);var d=a,e=$.setInterval(function(){d=c(d)},b);return mb(function(){$.clearInterval(e)})}}(tb.prototype);var wb,xb,yb=tb.immediate=function(){function a(a,b){return b(this,a)}return new tb(ga,a,xa,xa)}(),zb=tb.currentThread=function(){function a(){for(;c.length>0;){var a=c.dequeue();!a.isCancelled()&&a.invoke()}}function b(b,d){var e=new sb(this,b,d,this.now());if(c)c.enqueue(e);else{c=new hb(4),c.enqueue(e);var f=o(a)();if(c=null,f===bb)return p(f.e)}return e.disposable}var c,d=new tb(ga,b,xa,xa);return d.scheduleRequired=function(){return!c},d}(),Ab=(da.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new qb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),function(){var a,b=ea;if($.setTimeout)a=$.setTimeout,b=$.clearTimeout;else{if(!$.WScript)throw new ua;a=function(a,b){$.WScript.Sleep(b),a()}}return{setTimeout:a,clearTimeout:b}}()),Bb=Ab.setTimeout,Cb=Ab.clearTimeout;!function(){function a(b){if(f)Bb(function(){a(b)},0);else{var c=e[b];if(c){f=!0;var d=o(c)();if(xb(b),f=!1,d===bb)return p(d.e)}}}function b(){if(!$.postMessage||$.importScripts)return!1;var a=!1,b=$.onmessage;return $.onmessage=function(){a=!0},$.postMessage("","*"),$.onmessage=b,a}function c(b){"string"==typeof b.data&&b.data.substring(0,i.length)===i&&a(b.data.substring(i.length))}var d=1,e={},f=!1;xb=function(a){delete e[a]};var g=RegExp("^"+String(Qa).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),h="function"==typeof(h=ca&&ba&&ca.setImmediate)&&!g.test(h)&&h;if(la(h))wb=function(b){var c=d++;return e[c]=b,h(function(){a(c)}),c};else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))wb=function(b){var c=d++;return e[c]=b,process.nextTick(function(){a(c)}),c};else if(b()){var i="ms.rx.schedule"+Math.random();$.addEventListener?$.addEventListener("message",c,!1):$.attachEvent?$.attachEvent("onmessage",c):$.onmessage=c,wb=function(a){var b=d++;return e[b]=a,$.postMessage(i+currentId,"*"),b}}else if($.MessageChannel){var j=new $.MessageChannel;j.port1.onmessage=function(b){a(b.data)},wb=function(a){var b=d++;return e[b]=a,j.port2.postMessage(b),b}}else wb="document"in $&&"onreadystatechange"in $.document.createElement("script")?function(b){var c=$.document.createElement("script"),f=d++;return e[f]=b,c.onreadystatechange=function(){a(f),c.onreadystatechange=null,c.parentNode.removeChild(c),c=null},$.document.documentElement.appendChild(c),f}:function(b){var c=d++;return e[c]=b,Bb(function(){a(c)},0),c}}();var Db,Eb=tb.timeout=tb["default"]=function(){function a(a,b){var c=this,d=new qb,e=wb(function(){!d.isDisposed&&d.setDisposable(b(c,a))});return new jb(d,mb(function(){xb(e)}))}function b(a,b,c){var d=this,e=tb.normalize(b),f=new qb;if(0===e)return d.scheduleWithState(a,c);var g=Bb(function(){!f.isDisposed&&f.setDisposable(c(d,a))},e);return new jb(f,mb(function(){Cb(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new tb(ga,a,b,c)}(),Fb=da.Notification=function(){function a(a,b,c,d,e,f){this.kind=a,this.value=b,this.exception=c,this._accept=d,this._acceptObservable=e,this.toString=f}return a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return vb(a)||(a=yb),new Nc(function(c){return a.scheduleWithState(b,function(a,b){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),Gb=Fb.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){return new Fb("N",d,null,a,b,c)}}(),Hb=Fb.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){return new Fb("E",null,d,a,b,c)}}(),Ib=Fb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){return new Fb("C",null,null,a,b,c)}}(),Jb=da.Observer=function(){},Kb=Jb.create=function(a,b,c){return a||(a=ea),b||(b=ja),c||(c=ea),new Mb(a,b,c)},Lb=da.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return db(b,a),b.prototype.next=wa,b.prototype.error=wa,b.prototype.completed=wa,b.prototype.onNext=function(a){this.isStopped||this.next(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.error(a))},b.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(Jb),Mb=da.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return db(b,a),b.prototype.next=function(a){this._onNext(a)},b.prototype.error=function(a){this._onError(a)},b.prototype.completed=function(){this._onCompleted()},b}(Lb),Nb=da.Observable=function(){function a(a){if(da.config.longStackSupport&&ma){try{throw new Error}catch(b){this.stack=b.stack.substring(b.stack.indexOf("\n")+1)}var d=this;this._subscribe=function(b){var e=b.onError.bind(b);return b.onError=function(a){c(a,d),e(a)},a.call(d,b)}}else this._subscribe=a}return Db=a.prototype,Db.subscribe=Db.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:Kb(a,b,c))},Db.subscribeOnNext=function(a,b){return this._subscribe(Kb("undefined"!=typeof b?function(c){a.call(b,c)}:a))},Db.subscribeOnError=function(a,b){return this._subscribe(Kb(null,"undefined"!=typeof b?function(c){a.call(b,c)}:a))},Db.subscribeOnCompleted=function(a,b){return this._subscribe(Kb(null,null,"undefined"!=typeof b?function(){a.call(b)}:a))},a}(),Ob=da.ObservableBase=function(a){function b(a){return a&&la(a.dispose)?a:la(a)?mb(a):nb}function c(a,c){var d=c[0],e=c[1],f=o(e.subscribeCore).call(e,d);return f!==bb||d.fail(bb.e)?void d.setDisposable(b(f)):p(bb.e)}function d(a){var b=new Oc(a),d=[b,this];return zb.scheduleRequired()?zb.scheduleWithState(d,c):c(null,d),b}function e(){a.call(this,d)}return db(e,a),e.prototype.subscribeCore=wa,e}(Nb),Pb=da.internals.Enumerable=function(){},Qb=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b,c){this.o=a,this.s=b,this.e=c,this.isStopped=!1}return db(b,a),b.prototype.subscribeCore=function(a){var b,d=new rb,e=yb.scheduleRecursiveWithState(this.sources[ya](),function(e,f){if(!b){var g=o(e.next).call(e);if(g===bb)return a.onError(g.e);if(g.done)return a.onCompleted();var h=g.value;ka(h)&&(h=Gc(h));var i=new qb;d.setDisposable(i),i.setDisposable(h.subscribe(new c(a,f,e)))}});return new jb(d,e,mb(function(){b=!0}))},c.prototype.onNext=function(a){this.isStopped||this.o.onNext(a)},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.s(this.e))},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Ob);Pb.prototype.concat=function(){return new Qb(this)};var Rb=function(a){function b(b){this.sources=b,a.call(this)}return db(b,a),b.prototype.subscribeCore=function(a){var b,c=this.sources[ya](),d=new rb,e=yb.scheduleRecursiveWithState(null,function(e,f){if(!b){var g=o(c.next).call(c);if(g===bb)return a.onError(g.e);if(g.done)return null!==e?a.onError(e):a.onCompleted();var h=g.value;ka(h)&&(h=Gc(h));var i=new qb;d.setDisposable(i),i.setDisposable(h.subscribe(function(b){a.onNext(b)},f,function(){a.onCompleted()}))}});return new jb(d,e,mb(function(){b=!0}))},b}(Ob);Pb.prototype.catchError=function(){return new Rb(this)},Pb.prototype.catchErrorWhen=function(a){var b=this;return new Nc(function(c){var d,e,f=new Qc,g=new Qc,h=a(f),i=h.subscribe(g),j=b[ya](),k=new rb,l=yb.scheduleRecursive(function(a){if(!d){var b=o(j.next).call(j);if(b===bb)return c.onError(b.e);if(b.done)return void(e?c.onError(e):c.onCompleted());var h=b.value;ka(h)&&(h=Gc(h));var i=new qb,l=new qb;k.setDisposable(new jb(l,i)),i.setDisposable(h.subscribe(function(a){c.onNext(a)},function(b){l.setDisposable(g.subscribe(a,function(a){c.onError(a)},function(){c.onCompleted()})),f.onNext(b)},function(){c.onCompleted()}))}});return new jb(i,k,l,mb(function(){d=!0}))})};var Sb=function(a){function b(a,b){this.v=a,this.c=null==b?-1:b}function c(a){this.v=a.v,this.l=a.c}return db(b,a),b.prototype[ya]=function(){return new c(this)},c.prototype.next=function(){return 0===this.l?za:(this.l>0&&this.l--,{done:!1,value:this.v})},b}(Pb),Tb=Pb.repeat=function(a,b){return new Sb(a,b)},Ub=function(a){function b(a,b,c){this.s=a,this.fn=b?Da(b,c,3):null}function c(a){this.i=-1,this.s=a.s,this.l=this.s.length,this.fn=a.fn}return db(b,a),b.prototype[ya]=function(){return new c(this)},c.prototype.next=function(){return++this.i<this.l?{done:!1,value:this.fn?this.fn(this.s[this.i],this.i,this.s):this.s[this.i]}:za},b}(Pb),Vb=Pb.of=function(a,b,c){return new Ub(a,b,c)},Wb=da.internals.ScheduledObserver=function(a){function b(b,c){a.call(this),this.scheduler=b,this.observer=c,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new rb}return db(b,a),b.prototype.next=function(a){var b=this;this.queue.push(function(){b.observer.onNext(a)})},b.prototype.error=function(a){var b=this;this.queue.push(function(){b.observer.onError(a)})},b.prototype.completed=function(){var a=this;this.queue.push(function(){a.observer.onCompleted()})},b.prototype.ensureActive=function(){var a=!1,b=this;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(a){
+var c;if(!(b.queue.length>0))return void(b.isAcquired=!1);c=b.queue.shift();try{c()}catch(d){throw b.queue=[],b.hasFaulted=!0,d}a()}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(Lb),Xb=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.a=[],this.isStopped=!1}return db(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a))},c.prototype.onNext=function(a){this.isStopped||this.a.push(a)},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onNext(this.a),this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Ob);Db.toArray=function(){return new Xb(this)},Nb.create=Nb.createWithDisposable=function(a,b){return new Nc(a,b)};var Yb=Nb.defer=function(a){return new Nc(function(b){var c;try{c=a()}catch(d){return mc(d).subscribe(b)}return ka(c)&&(c=Gc(c)),c.subscribe(b)})},Zb=function(a){function b(b){this.scheduler=b,a.call(this)}function c(a,b){this.observer=a,this.parent=b}function d(a,b){b.onCompleted()}return db(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this);return b.run()},c.prototype.run=function(){return this.parent.scheduler.scheduleWithState(this.observer,d)},b}(Ob),$b=Nb.empty=function(a){return vb(a)||(a=yb),new Zb(a)},_b=function(a){function b(b,c,d){this.iterable=b,this.mapper=c,this.scheduler=d,a.call(this)}return db(b,a),b.prototype.subscribeCore=function(a){var b=new ac(a,this);return b.run()},b}(Ob),ac=function(){function a(a,b){this.observer=a,this.parent=b}return a.prototype.run=function(){function a(a,b){try{var f=c.next()}catch(g){return d.onError(g)}if(f.done)return d.onCompleted();var h=f.value;if(e)try{h=e(h,a)}catch(g){return d.onError(g)}d.onNext(h),b(a+1)}var b=Object(this.parent.iterable),c=y(b),d=this.observer,e=this.parent.mapper;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}(),bc=Math.pow(2,53)-1;t.prototype[ya]=function(){return new u(this._s)},u.prototype[ya]=function(){return this},u.prototype.next=function(){return this._i<this._l?{done:!1,value:this._s.charAt(this._i++)}:za},v.prototype[ya]=function(){return new w(this._a)},w.prototype[ya]=function(){return this},w.prototype.next=function(){return this._i<this._l?{done:!1,value:this._a[this._i++]}:za};var cc=Nb.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!la(b))throw new Error("mapFn when provided must be a function");if(b)var e=Da(b,c,2);return vb(d)||(d=zb),new _b(a,e,d)},dc=function(a){function b(b,c){this.args=b,this.scheduler=c,a.call(this)}return db(b,a),b.prototype.subscribeCore=function(a){var b=new B(a,this);return b.run()},b}(Ob);B.prototype.run=function(){function a(a,e){d>a?(b.onNext(c[a]),e(a+1)):b.onCompleted()}var b=this.observer,c=this.parent.args,d=c.length;return this.parent.scheduler.scheduleRecursiveWithState(0,a)};{var ec=Nb.fromArray=function(a,b){return vb(b)||(b=zb),new dc(a,b)},fc=function(a){function b(){a.call(this)}return db(b,a),b.prototype.subscribeCore=function(a){return nb},b}(Ob);Nb.never=function(){return new fc}}Nb.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return new dc(b,zb)},Nb.ofWithScheduler=function(a){for(var b=arguments.length,c=new Array(b-1),d=1;b>d;d++)c[d-1]=arguments[d];return new dc(c,a)};var gc=function(a){function b(b,c){this.obj=b,this.keys=Object.keys(b),this.scheduler=c,a.call(this)}return db(b,a),b.prototype.subscribeCore=function(a){var b=new D(a,this);return b.run()},b}(Ob);D.prototype.run=function(){function a(a,f){if(e>a){var g=d[a];b.onNext([g,c[g]]),f(a+1)}else b.onCompleted()}var b=this.observer,c=this.parent.obj,d=this.parent.keys,e=d.length;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},Nb.pairs=function(a,b){return b||(b=zb),new gc(a,b)};var hc=function(a){function b(b,c,d){this.start=b,this.rangeCount=c,this.scheduler=d,a.call(this)}return db(b,a),b.prototype.subscribeCore=function(a){var b=new ic(a,this);return b.run()},b}(Ob),ic=function(){function a(a,b){this.observer=a,this.parent=b}return a.prototype.run=function(){function a(a,e){c>a?(d.onNext(b+a),e(a+1)):d.onCompleted()}var b=this.parent.start,c=this.parent.rangeCount,d=this.observer;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}();Nb.range=function(a,b,c){return vb(c)||(c=zb),new hc(a,b,c)};var jc=function(a){function b(b,c,d){this.value=b,this.repeatCount=null==c?-1:c,this.scheduler=d,a.call(this)}return db(b,a),b.prototype.subscribeCore=function(a){var b=new E(a,this);return b.run()},b}(Ob);E.prototype.run=function(){function a(a,d){return(-1===a||a>0)&&(b.onNext(c),a>0&&a--),0===a?b.onCompleted():void d(a)}var b=this.observer,c=this.parent.value;return this.parent.scheduler.scheduleRecursiveWithState(this.parent.repeatCount,a)},Nb.repeat=function(a,b,c){return vb(c)||(c=zb),new jc(a,b,c)};var kc=function(a){function b(b,c){this.value=b,this.scheduler=c,a.call(this)}function c(a,b){this.observer=a,this.parent=b}function d(a,b){var c=b[0],d=b[1];d.onNext(c),d.onCompleted()}return db(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this);return b.run()},c.prototype.run=function(){return this.parent.scheduler.scheduleWithState([this.parent.value,this.observer],d)},b}(Ob),lc=(Nb["return"]=Nb.just=Nb.returnValue=function(a,b){return vb(b)||(b=yb),new kc(a,b)},function(a){function b(b,c){this.error=b,this.scheduler=c,a.call(this)}function c(a,b){this.o=a,this.p=b}function d(a,b){var c=b[0],d=b[1];d.onError(c)}return db(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this);return b.run()},c.prototype.run=function(){return this.p.scheduler.scheduleWithState([this.p.error,this.o],d)},b}(Ob)),mc=Nb["throw"]=Nb.throwError=Nb.throwException=function(a,b){return vb(b)||(b=yb),new lc(a,b)};Db["catch"]=Db.catchError=Db.catchException=function(a){return"function"==typeof a?F(this,a):nc([this,a])};var nc=Nb.catchError=Nb["catch"]=Nb.catchException=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return Vb(a).catchError()};Db.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return Array.isArray(b[0])?b[0].unshift(this):b.unshift(this),oc.apply(this,b)};var oc=Nb.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.pop();return Array.isArray(b[0])&&(b=b[0]),new Nc(function(a){function c(b){if(h[b]=!0,i||(i=h.every(fa))){try{var c=d.apply(null,k)}catch(e){return a.onError(e)}a.onNext(c)}else j.filter(function(a,c){return c!==b}).every(fa)&&a.onCompleted()}function e(b){j[b]=!0,j.every(fa)&&a.onCompleted()}for(var f=b.length,g=function(){return!1},h=q(f,g),i=!1,j=q(f,g),k=new Array(f),l=new Array(f),m=0;f>m;m++)!function(d){var f=b[d],g=new qb;ka(f)&&(f=Gc(f)),g.setDisposable(f.subscribe(function(a){k[d]=a,c(d)},function(b){a.onError(b)},function(){e(d)})),l[d]=g}(m);return new jb(l)},this)};Db.concat=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return a.unshift(this),qc.apply(null,a)};var pc=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b){this.sources=a,this.o=b}return db(b,a),b.prototype.subscribeCore=function(a){var b=new c(this.sources,a);return b.run()},c.prototype.run=function(){var a,b=new rb,c=this.sources,d=c.length,e=this.o,f=yb.scheduleRecursiveWithState(0,function(f,g){if(!a){if(f===d)return e.onCompleted();var h=c[f];ka(h)&&(h=Gc(h));var i=new qb;b.setDisposable(i),i.setDisposable(h.subscribe(function(a){e.onNext(a)},function(a){e.onError(a)},function(){g(f+1)}))}});return new jb(b,f,mb(function(){a=!0}))},b}(Ob),qc=Nb.concat=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(arguments.length);for(var b=0,c=arguments.length;c>b;b++)a[b]=arguments[b]}return new pc(a)};Db.concatAll=Db.concatObservable=function(){return this.merge(1)};var rc=function(a){function b(b,c){this.source=b,this.maxConcurrent=c,a.call(this)}return db(b,a),b.prototype.subscribeCore=function(a){var b=new jb;return b.add(this.source.subscribe(new sc(a,this.maxConcurrent,b))),b},b}(Ob),sc=function(){function a(a,b,c){this.o=a,this.max=b,this.g=c,this.done=!1,this.q=[],this.activeCount=0,this.isStopped=!1}function b(a,b){this.parent=a,this.sad=b,this.isStopped=!1}return a.prototype.handleSubscribe=function(a){var c=new qb;this.g.add(c),ka(a)&&(a=Gc(a)),c.setDisposable(a.subscribe(new b(this,c)))},a.prototype.onNext=function(a){this.isStopped||(this.activeCount<this.max?(this.activeCount++,this.handleSubscribe(a)):this.q.push(a))},a.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},a.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,0===this.activeCount&&this.o.onCompleted())},a.prototype.dispose=function(){this.isStopped=!0},a.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b.prototype.onNext=function(a){this.isStopped||this.parent.o.onNext(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.o.onError(a))},b.prototype.onCompleted=function(){if(!this.isStopped){this.isStopped=!0;var a=this.parent;a.g.remove(this.sad),a.q.length>0?a.handleSubscribe(a.q.shift()):(a.activeCount--,a.done&&0===a.activeCount&&a.o.onCompleted())}},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},a}();Db.merge=function(a){return"number"!=typeof a?tc(this,a):new rc(this,a)};var tc=Nb.merge=function(){var a,b,c=[],d=arguments.length;if(arguments[0])if(vb(arguments[0]))for(a=arguments[0],b=1;d>b;b++)c.push(arguments[b]);else for(a=yb,b=0;d>b;b++)c.push(arguments[b]);else for(a=yb,b=1;d>b;b++)c.push(arguments[b]);return Array.isArray(c[0])&&(c=c[0]),C(a,c).mergeAll()},uc=function(a){function b(b){this.source=b,a.call(this)}function c(a,b){this.o=a,this.g=b,this.isStopped=!1,this.done=!1}function d(a,b,c){this.parent=a,this.g=b,this.sad=c,this.isStopped=!1}return db(b,a),b.prototype.subscribeCore=function(a){var b=new jb,d=new qb;return b.add(d),d.setDisposable(this.source.subscribe(new c(a,b))),b},c.prototype.onNext=function(a){if(!this.isStopped){var b=new qb;this.g.add(b),ka(a)&&(a=Gc(a)),b.setDisposable(a.subscribe(new d(this,this.g,b)))}},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,1===this.g.length&&this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},d.prototype.onNext=function(a){this.isStopped||this.parent.o.onNext(a)},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.o.onError(a))},d.prototype.onCompleted=function(){if(!this.isStopped){var a=this.parent;this.isStopped=!0,a.g.remove(this.sad),a.done&&1===a.g.length&&a.o.onCompleted()}},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},b}(Ob);Db.mergeAll=Db.mergeObservable=function(){return new uc(this)};var vc=da.CompositeError=function(a){this.name="NotImplementedError",this.innerErrors=a,this.message="This contains multiple errors. Check the innerErrors",Error.call(this)};vc.prototype=Error.prototype,Nb.mergeDelayError=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}var d=C(null,a);return new Nc(function(a){function b(){0===g.length?a.onCompleted():a.onError(1===g.length?g[0]:new vc(g))}var c=new jb,e=new qb,f=!1,g=[];return c.add(e),e.setDisposable(d.subscribe(function(d){var e=new qb;c.add(e),ka(d)&&(d=Gc(d)),e.setDisposable(d.subscribe(function(b){a.onNext(b)},function(a){g.push(a),c.remove(e),f&&1===c.length&&b()},function(){c.remove(e),f&&1===c.length&&b()}))},function(a){g.push(a),f=!0,1===c.length&&b()},function(){f=!0,1===c.length&&b()})),c})},Db.skipUntil=function(a){var b=this;return new Nc(function(c){var d=!1,e=new jb(b.subscribe(function(a){d&&c.onNext(a)},function(a){c.onError(a)},function(){d&&c.onCompleted()}));ka(a)&&(a=Gc(a));var f=new qb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},function(a){c.onError(a)},function(){f.dispose()})),e},b)};var wc=function(a){function b(b){this.source=b,a.call(this)}function c(a,b){this.o=a,this.inner=b,this.stopped=!1,this.latest=0,this.hasLatest=!1,this.isStopped=!1}function d(a,b){this.parent=a,this.id=b,this.isStopped=!1}return db(b,a),b.prototype.subscribeCore=function(a){var b=new rb,d=this.source.subscribe(new c(a,b));return new jb(d,b)},c.prototype.onNext=function(a){if(!this.isStopped){var b=new qb,c=++this.latest;this.hasLatest=!0,this.inner.setDisposable(b),ka(a)&&(a=Gc(a)),b.setDisposable(a.subscribe(new d(this,c)))}},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.stopped=!0,!this.hasLatest&&this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},d.prototype.onNext=function(a){this.isStopped||this.parent.latest===this.id&&this.parent.o.onNext(a)},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.latest===this.id&&this.parent.o.onError(a))},d.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.parent.latest===this.id&&(this.parent.hasLatest=!1,this.parent.isStopped&&this.parent.o.onCompleted()))},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},b}(Ob);Db["switch"]=Db.switchLatest=function(){return new wc(this)};var xc=function(a){function b(b,c){this.source=b,this.other=ka(c)?Gc(c):c,a.call(this)}function c(a){this.o=a,this.isStopped=!1}return db(b,a),b.prototype.subscribeCore=function(a){return new jb(this.source.subscribe(a),this.other.subscribe(new c(a)))},c.prototype.onNext=function(a){this.isStopped||this.o.onCompleted()},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){!this.isStopped&&(this.isStopped=!0)},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Ob);Db.takeUntil=function(a){return new xc(this,a)},Db.withLatestFrom=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.pop(),e=this;return Array.isArray(b[0])&&(b=b[0]),new Nc(function(a){for(var c=b.length,f=q(c,G),g=!1,h=new Array(c),i=new Array(c+1),j=0;c>j;j++)!function(c){var d=b[c],e=new qb;ka(d)&&(d=Gc(d)),e.setDisposable(d.subscribe(function(a){h[c]=a,f[c]=!0,g=f.every(fa)},function(b){a.onError(b)},ea)),i[c]=e}(j);var k=new qb;return k.setDisposable(e.subscribe(function(b){var c=[b].concat(h);if(g){var e=o(d).apply(null,c);return e===bb?a.onError(e.e):void a.onNext(e)}},function(b){a.onError(b)},function(){a.onCompleted()})),i[c]=k,new jb(i)},this)},Db.zip=function(){if(Array.isArray(arguments[0]))return H.apply(this,arguments);for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=this,e=b.pop();return b.unshift(d),new Nc(function(a){for(var c=b.length,f=q(c,I),g=q(c,G),h=new Array(c),i=0;c>i;i++)!function(c){var i=b[c],j=new qb;ka(i)&&(i=Gc(i)),j.setDisposable(i.subscribe(function(b){if(f[c].push(b),f.every(function(a){return a.length>0})){var h=f.map(function(a){return a.shift()}),i=o(e).apply(d,h);if(i===bb)return a.onError(i.e);a.onNext(i)}else g.filter(function(a,b){return b!==c}).every(fa)&&a.onCompleted()},function(b){a.onError(b)},function(){g[c]=!0,g.every(fa)&&a.onCompleted()})),h[c]=j}(i);return new jb(h)},d)},Nb.zip=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.shift();return d.zip.apply(d,b)},Nb.zipArray=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new Nc(function(b){for(var c=a.length,d=q(c,J),e=q(c,G),f=new Array(c),g=0;c>g;g++)!function(c){f[c]=new qb,f[c].setDisposable(a[c].subscribe(function(a){if(d[c].push(a),d.every(function(a){return a.length>0})){var f=d.map(function(a){return a.shift()});b.onNext(f)}else if(e.filter(function(a,b){return b!==c}).every(fa))return b.onCompleted()},function(a){b.onError(a)},function(){e[c]=!0,e.every(fa)&&b.onCompleted()}))}(g);return new jb(f)})},Db.asObservable=function(){var a=this;return new Nc(function(b){return a.subscribe(b)},a)},Db.dematerialize=function(){var a=this;return new Nc(function(b){return a.subscribe(function(a){return a.accept(b)},function(a){b.onError(a)},function(){b.onCompleted()})},this)},Db.distinctUntilChanged=function(a,b){var c=this;return b||(b=ha),new Nc(function(d){var e,f=!1;return c.subscribe(function(c){var g=c;if(a&&(g=o(a)(c),g===bb))return d.onError(g.e);if(f){var h=o(b)(e,g);if(h===bb)return d.onError(h.e)}f&&h||(f=!0,e=g,d.onNext(c))},function(a){d.onError(a)},function(){d.onCompleted()})},this)};var yc=function(a){function b(b,c,d,e){this.source=b,this.t=!c||la(c)?Kb(c||ea,d||ea,e||ea):c,a.call(this)}function c(a,b){this.o=a,this.t=b,this.isStopped=!1}return db(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this.t))},c.prototype.onNext=function(a){if(!this.isStopped){var b=o(this.t.onNext).call(this.t,a);b===bb&&this.o.onError(b.e),this.o.onNext(a)}},c.prototype.onError=function(a){if(!this.isStopped){this.isStopped=!0;var b=o(this.t.onError).call(this.t,a);if(b===bb)return this.o.onError(b.e);this.o.onError(a)}},c.prototype.onCompleted=function(){if(!this.isStopped){this.isStopped=!0;var a=o(this.t.onCompleted).call(this.t);if(a===bb)return this.o.onError(a.e);this.o.onCompleted()}},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Ob);Db["do"]=Db.tap=Db.doAction=function(a,b,c){return new yc(this,a,b,c)},Db.doOnNext=Db.tapOnNext=function(a,b){return this.tap("undefined"!=typeof b?function(c){a.call(b,c)}:a)},Db.doOnError=Db.tapOnError=function(a,b){return this.tap(ea,"undefined"!=typeof b?function(c){a.call(b,c)}:a)},Db.doOnCompleted=Db.tapOnCompleted=function(a,b){return this.tap(ea,null,"undefined"!=typeof b?function(){a.call(b)}:a)},Db["finally"]=Db.ensure=function(a){var b=this;return new Nc(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return mb(function(){try{d.dispose()}catch(b){throw b}finally{a()}})},this)},Db.finallyAction=function(a){return this.ensure(a)};var zc=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.isStopped=!1}return db(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a))},c.prototype.onNext=ea,c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},b}(Ob);Db.ignoreElements=function(){return new zc(this)},Db.materialize=function(){var a=this;return new Nc(function(b){return a.subscribe(function(a){b.onNext(Gb(a))},function(a){b.onNext(Hb(a)),b.onCompleted()},function(){b.onNext(Ib()),b.onCompleted()})},a)},Db.repeat=function(a){return Tb(this,a).concat()},Db.retry=function(a){return Tb(this,a).catchError()},Db.retryWhen=function(a){return Tb(this).catchErrorWhen(a)};var Ac=function(a){function b(b,c,d,e){this.source=b,this.accumulator=c,this.hasSeed=d,this.seed=e,a.call(this)}return db(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new K(a,this))},b}(Ob);K.prototype.onNext=function(a){if(!this.isStopped){!this.hasValue&&(this.hasValue=!0);try{this.hasAccumulation?this.accumulation=this.accumulator(this.accumulation,a):(this.accumulation=this.hasSeed?this.accumulator(this.seed,a):a,this.hasAccumulation=!0)}catch(b){return this.observer.onError(b)}this.observer.onNext(this.accumulation)}},K.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.observer.onError(a))},K.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,!this.hasValue&&this.hasSeed&&this.observer.onNext(this.seed),this.observer.onCompleted())},K.prototype.dispose=function(){this.isStopped=!0},K.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},Db.scan=function(){var a,b,c=!1;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new Ac(this,b,c,a)},Db.skipLast=function(a){if(0>a)throw new ta;var b=this;return new Nc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},function(a){c.onError(a)},function(){c.onCompleted()})},b)},Db.startWith=function(){var a,b=0;arguments.length&&vb(arguments[0])?(a=arguments[0],b=1):a=yb;for(var c=[],d=b,e=arguments.length;e>d;d++)c.push(arguments[d]);return Vb([ec(c,a),this]).concat()},Db.takeLast=function(a){if(0>a)throw new ta;var b=this;return new Nc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},function(a){c.onError(a)},function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})},b)},Db.selectConcat=Db.concatMap=function(a,b,c){return la(a)&&la(b)?this.concatMap(function(c,d){var e=a(c,d);return ka(e)&&(e=Gc(e)),(Ba(e)||Aa(e))&&(e=cc(e)),e.map(function(a,e){return b(c,a,d,e)})}):la(a)?L(this,a,c):L(this,function(){return a})};var Bc=function(a){function b(b,c,d){this.source=b,this.selector=Da(c,d,3),a.call(this)}function c(a,b){return function(c,d,e){return a.call(this,b.selector(c,d,e),d,e)}}function d(a,b,c){this.o=a,this.selector=b,this.source=c,this.i=0,this.isStopped=!1}return db(b,a),b.prototype.internalMap=function(a,d){return new b(this.source,c(a,this),d)},b.prototype.subscribeCore=function(a){return this.source.subscribe(new d(a,this.selector,this))},d.prototype.onNext=function(a){if(!this.isStopped){var b=o(this.selector)(a,this.i++,this.source);return b===bb?this.o.onError(b.e):void this.o.onNext(b)}},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},d.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Ob);Db.map=Db.select=function(a,b){var c="function"==typeof a?a:function(){return a};return this instanceof Bc?this.internalMap(c,b):new Bc(this,c,b)},Db.pluck=function(){var b=arguments,c=arguments.length;if(0===c)throw new Error("List of properties cannot be empty.");return this.map(function(d){for(var e=d,f=0;c>f;f++){var g=e[b[f]];if("undefined"==typeof g)return a;e=g}return e})},Db.selectMany=Db.flatMap=function(a,b,c){return la(a)&&la(b)?this.flatMap(function(c,d){var e=a(c,d);return ka(e)&&(e=Gc(e)),(Ba(e)||Aa(e))&&(e=cc(e)),e.map(function(a,e){return b(c,a,d,e)})},c):la(a)?M(this,a,c):M(this,function(){return a})},Db.selectSwitch=Db.flatMapLatest=Db.switchMap=function(a,b){return this.select(a,b).switchLatest()};var Cc=function(a){function b(b,c){this.source=b,this.skipCount=c,a.call(this)}function c(a,b){this.c=b,this.r=b,this.o=a,this.isStopped=!1}return db(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this.skipCount))},c.prototype.onNext=function(a){this.isStopped||(this.r<=0?this.o.onNext(a):this.r--)},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Ob);Db.skip=function(a){if(0>a)throw new ta;return new Cc(this,a)},Db.skipWhile=function(a,b){var c=this,d=Da(a,b,3);return new Nc(function(a){var b=0,e=!1;return c.subscribe(function(f){if(!e)try{e=!d(f,b++,c)}catch(g){return void a.onError(g)}e&&a.onNext(f)},function(b){a.onError(b)},function(){a.onCompleted()})},c)},Db.take=function(a,b){if(0>a)throw new ta;if(0===a)return $b(b);var c=this;return new Nc(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0>=d&&b.onCompleted())},function(a){b.onError(a)},function(){b.onCompleted()})},c)},Db.takeWhile=function(a,b){var c=this,d=Da(a,b,3);return new Nc(function(a){var b=0,e=!0;return c.subscribe(function(f){if(e){try{e=d(f,b++,c)}catch(g){return void a.onError(g)}e?a.onNext(f):a.onCompleted()}},function(b){a.onError(b)},function(){a.onCompleted()})},c)};var Dc=function(a){function b(b,c,d){this.source=b,this.predicate=Da(c,d,3),a.call(this)}function c(a,b){return function(c,d,e){return b.predicate(c,d,e)&&a.call(this,c,d,e)}}function d(a,b,c){this.o=a,this.predicate=b,this.source=c,this.i=0,this.isStopped=!1}return db(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new d(a,this.predicate,this))},b.prototype.internalFilter=function(a,d){return new b(this.source,c(a,this),d)},d.prototype.onNext=function(a){if(!this.isStopped){var b=o(this.predicate)(a,this.i++,this.source);return b===bb?this.o.onError(b.e):void(b&&this.o.onNext(a))}},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},d.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Ob);Db.filter=Db.where=function(a,b){return this instanceof Dc?this.internalFilter(a,b):new Dc(this,a,b)},Nb.fromCallback=function(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return new Nc(function(d){function f(){for(var a=arguments.length,e=new Array(a),f=0;a>f;f++)e[f]=arguments[f];if(c){try{e=c.apply(b,e)}catch(g){return d.onError(g)}d.onNext(e)}else e.length<=1?d.onNext.apply(d,e):d.onNext(e);d.onCompleted()}e.push(f),a.apply(b,e)}).publishLast().refCount()}},Nb.fromNodeCallback=function(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return new Nc(function(d){function f(a){if(a)return void d.onError(a);for(var e=arguments.length,f=[],g=1;e>g;g++)f[g-1]=arguments[g];if(c){try{f=c.apply(b,f)}catch(h){return d.onError(h)}d.onNext(f)}else f.length<=1?d.onNext.apply(d,f):d.onNext(f);d.onCompleted()}e.push(f),a.apply(b,e)}).publishLast().refCount()}},da.config.useNativeEvents=!1,Nb.fromEvent=function(a,b,c){return a.addListener?Ec(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},c):da.config.useNativeEvents||"function"!=typeof a.on||"function"!=typeof a.off?new Nc(function(d){return Q(a,b,function(a){var b=a;if(c)try{b=c(arguments)}catch(e){return d.onError(e)}d.onNext(b)})}).publish().refCount():Ec(function(c){a.on(b,c)},function(c){a.off(b,c)},c)};var Ec=Nb.fromEventPattern=function(a,b,c){return new Nc(function(d){function e(a){var b=a;if(c)try{b=c(arguments)}catch(e){return d.onError(e)}d.onNext(b)}var f=a(e);return mb(function(){b&&b(e,f)})}).publish().refCount()},Fc=function(a){function b(b){this.p=b,a.call(this)}return db(b,a),b.prototype.subscribeCore=function(a){return this.p.then(function(b){a.onNext(b),a.onCompleted()},function(b){a.onError(b)}),nb},b}(Ob),Gc=Nb.fromPromise=function(a){return new Fc(a)};Db.toPromise=function(a){if(a||(a=da.config.Promise),!a)throw new ua("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})},Nb.startAsync=function(a){var b;try{b=a()}catch(c){return mc(c)}return Gc(b)},Db.multicast=function(a,b){var c=this;return"function"==typeof a?new Nc(function(d){var e=c.multicast(a());return new jb(b(e).subscribe(d),e.connect())},c):new Hc(c,a)},Db.publish=function(a){return a&&la(a)?this.multicast(function(){return new Qc},a):this.multicast(new Qc)},Db.share=function(){return this.publish().refCount()},Db.publishLast=function(a){return a&&la(a)?this.multicast(function(){return new Rc},a):this.multicast(new Rc)},Db.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new Tc(b)},a):this.multicast(new Tc(a))},Db.shareValue=function(a){return this.publishValue(a).refCount()},Db.replay=function(a,b,c,d){return a&&la(a)?this.multicast(function(){return new Uc(b,c,d)},a):this.multicast(new Uc(b,c,d))},Db.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};{var Hc=da.ConnectableObservable=function(a){function b(b,c){var d,e=!1,f=b.asObservable();this.connect=function(){return e||(e=!0,d=new jb(f.subscribe(c),mb(function(){e=!1}))),d},a.call(this,function(a){return c.subscribe(a)})}return db(b,a),b.prototype.refCount=function(){var a,b=0,c=this;return new Nc(function(d){var e=1===++b,f=c.subscribe(d);return e&&(a=c.connect()),function(){f.dispose(),0===--b&&a.dispose()}})},b}(Nb),Ic=Nb.interval=function(a,b){return U(a,a,vb(b)?b:Eb)};Nb.timer=function(b,c,d){var e;return vb(d)||(d=Eb),c!==a&&"number"==typeof c?e=c:vb(c)&&(d=c),b instanceof Date&&e===a?R(b.getTime(),d):b instanceof Date&&e!==a?(e=c,S(b.getTime(),e,d)):e===a?T(b,d):U(b,e,d)}}Db.delay=function(a,b){return vb(b)||(b=Eb),a instanceof Date?W(this,a.getTime(),b):V(this,a,b)},Db.debounce=Db.throttleWithTimeout=function(a,b){vb(b)||(b=Eb);var c=this;return new Nc(function(d){var e,f=new rb,g=!1,h=0,i=c.subscribe(function(c){g=!0,e=c,h++;var i=h,j=new qb;f.setDisposable(j),j.setDisposable(b.scheduleWithRelative(a,function(){g&&h===i&&d.onNext(e),g=!1}))},function(a){f.dispose(),d.onError(a),g=!1,h++},function(){f.dispose(),g&&d.onNext(e),d.onCompleted(),g=!1,h++});return new jb(i,f)},this)},Db.throttle=function(a,b){return this.debounce(a,b)},Db.timestamp=function(a){return vb(a)||(a=Eb),this.map(function(b){return{value:b,timestamp:a.now()}})},Db.sample=Db.throttleLatest=function(a,b){return vb(b)||(b=Eb),"number"==typeof a?X(this,Ic(a,b)):X(this,a)},Db.timeout=function(a,b,c){(null==b||"string"==typeof b)&&(b=mc(new Error(b||"Timeout"))),vb(c)||(c=Eb);var d=this,e=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new Nc(function(f){function g(){var d=h;l.setDisposable(c[e](a,function(){h===d&&(ka(b)&&(b=Gc(b)),j.setDisposable(b.subscribe(f)))}))}var h=0,i=new qb,j=new rb,k=!1,l=new rb;return j.setDisposable(i),g(),i.setDisposable(d.subscribe(function(a){k||(h++,f.onNext(a),g())},function(a){k||(h++,f.onError(a))},function(){k||(h++,f.onCompleted())})),new jb(j,l)},d)},Db.throttleFirst=function(a,b){vb(b)||(b=Eb);var c=+a||0;if(0>=c)throw new RangeError("windowDuration cannot be less or equal zero.");var d=this;return new Nc(function(a){var e=0;return d.subscribe(function(d){var f=b.now();(0===e||f-e>=c)&&(e=f,a.onNext(d))},function(b){a.onError(b)},function(){a.onCompleted()})},d)};var Jc=function(a){function b(a){var b=this.source.publish(),c=b.subscribe(a),d=nb,e=this.pauser.distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=nb)});return new jb(c,d,e)}function c(c,d){this.source=c,this.controller=new Qc,d&&d.subscribe?this.pauser=this.controller.merge(d):this.pauser=this.controller,a.call(this,b,c)}return db(c,a),c.prototype.pause=function(){this.controller.onNext(!1)},
+c.prototype.resume=function(){this.controller.onNext(!0)},c}(Nb);Db.pausable=function(a){return new Jc(this,a)};var Kc=function(b){function c(b){function c(){for(;e.length>0;)b.onNext(e.shift())}var d,e=[],f=Y(this.source,this.pauser.distinctUntilChanged().startWith(!1),function(a,b){return{data:a,shouldFire:b}}).subscribe(function(f){d!==a&&f.shouldFire!=d?(d=f.shouldFire,f.shouldFire&&c()):(d=f.shouldFire,f.shouldFire?b.onNext(f.data):e.push(f.data))},function(a){c(),b.onError(a)},function(){c(),b.onCompleted()});return f}function d(a,d){this.source=a,this.controller=new Qc,d&&d.subscribe?this.pauser=this.controller.merge(d):this.pauser=this.controller,b.call(this,c,a)}return db(d,b),d.prototype.pause=function(){this.controller.onNext(!1)},d.prototype.resume=function(){this.controller.onNext(!0)},d}(Nb);Db.pausableBuffered=function(a){return new Kc(this,a)};var Lc=function(a){function b(a){return this.source.subscribe(a)}function c(c,d,e){a.call(this,b,c),this.subject=new Mc(d,e),this.source=c.multicast(this.subject).refCount()}return db(c,a),c.prototype.request=function(a){return this.subject.request(null==a?-1:a)},c}(Nb),Mc=function(a){function b(a){return this.subject.subscribe(a)}function c(c,d){null==c&&(c=!0),a.call(this,b),this.subject=new Qc,this.enableQueue=c,this.queue=c?[]:null,this.requestedCount=0,this.requestedDisposable=nb,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.scheduler=d||zb}return db(c,a),eb(c.prototype,Jb,{onCompleted:function(){this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length?this.queue.push(Fb.createOnCompleted()):this.subject.onCompleted()},onError:function(a){this.hasFailed=!0,this.error=a,this.enableQueue&&0!==this.queue.length?this.queue.push(Fb.createOnError(a)):this.subject.onError(a)},onNext:function(a){var b=!1;0===this.requestedCount?this.enableQueue&&this.queue.push(Fb.createOnNext(a)):(-1!==this.requestedCount&&0===this.requestedCount--&&this.disposeCurrentRequest(),b=!0),b&&this.subject.onNext(a)},_processRequest:function(a){if(this.enableQueue){for(;this.queue.length>=a&&a>0||this.queue.length>0&&"N"!==this.queue[0].kind;){var b=this.queue.shift();b.accept(this.subject),"N"===b.kind?a--:(this.disposeCurrentRequest(),this.queue=[])}return{numberOfItems:a,returnValue:0!==this.queue.length}}return{numberOfItems:a,returnValue:!1}},request:function(a){this.disposeCurrentRequest();var b=this;return this.requestedDisposable=this.scheduler.scheduleWithState(a,function(a,c){var d=b._processRequest(c),e=d.numberOfItems;d.returnValue||(b.requestedCount=e,b.requestedDisposable=mb(function(){b.requestedCount=0}))}),this.requestedDisposable},disposeCurrentRequest:function(){this.requestedDisposable.dispose(),this.requestedDisposable=nb}}),c}(Nb);Db.controlled=function(a,b){return a&&vb(a)&&(b=a,a=!0),null==a&&(a=!0),new Lc(this,a,b)},Db.pipe=function(a){function b(){c.resume()}var c=this.pausableBuffered();return a.addListener("drain",b),c.subscribe(function(b){!a.write(String(b))&&c.pause()},function(b){a.emit("error",b)},function(){!a._isStdio&&a.end(),a.removeListener("drain",b)}),c.resume(),a},Db.transduce=function(a){function b(a){return{"@@transducer/init":function(){return a},"@@transducer/step":function(a,b){return a.onNext(b)},"@@transducer/result":function(a){return a.onCompleted()}}}var c=this;return new Nc(function(d){var e=a(b(d));return c.subscribe(function(a){try{e["@@transducer/step"](d,a)}catch(b){d.onError(b)}},function(a){d.onError(a)},function(){e["@@transducer/result"](d)})},c)};var Nc=da.AnonymousObservable=function(a){function b(a){return a&&la(a.dispose)?a:la(a)?mb(a):nb}function c(a,c){var d=c[0],e=c[1],f=o(e)(d);return f!==bb||d.fail(bb.e)?void d.setDisposable(b(f)):p(bb.e)}function d(b,d){function e(a){var d=new Oc(a),e=[d,b];return zb.scheduleRequired()?zb.scheduleWithState(e,c):c(null,e),d}this.source=d,a.call(this,e)}return db(d,a),d}(Nb),Oc=function(a){function b(b){a.call(this),this.observer=b,this.m=new qb}db(b,a);var c=b.prototype;return c.next=function(a){var b=o(this.observer.onNext).call(this.observer,a);b===bb&&(this.dispose(),p(b.e))},c.error=function(a){var b=o(this.observer.onError).call(this.observer,a);this.dispose(),b===bb&&p(b.e)},c.completed=function(){var a=o(this.observer.onCompleted).call(this.observer);this.dispose(),a===bb&&p(a.e)},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(Lb),Pc=function(a,b){this.subject=a,this.observer=b};Pc.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var Qc=da.Subject=function(a){function c(a){return pb(this),this.isStopped?this.hasError?(a.onError(this.error),nb):(a.onCompleted(),nb):(this.observers.push(a),new Pc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return db(d,a),eb(d.prototype,Jb.prototype,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(pb(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=b(this.observers),d=c.length;d>a;a++)c[a].onCompleted();this.observers.length=0}},onError:function(a){if(pb(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){if(pb(this),!this.isStopped)for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new Sc(a,b)},d}(Nb),Rc=da.AsyncSubject=function(a){function c(a){return pb(this),this.isStopped?(this.hasError?a.onError(this.error):this.hasValue?(a.onNext(this.value),a.onCompleted()):a.onCompleted(),nb):(this.observers.push(a),new Pc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.hasValue=!1,this.observers=[],this.hasError=!1}return db(d,a),eb(d.prototype,Jb,{hasObservers:function(){return pb(this),this.observers.length>0},onCompleted:function(){var a,c;if(pb(this),!this.isStopped){this.isStopped=!0;var d=b(this.observers),c=d.length;if(this.hasValue)for(a=0;c>a;a++){var e=d[a];e.onNext(this.value),e.onCompleted()}else for(a=0;c>a;a++)d[a].onCompleted();this.observers.length=0}},onError:function(a){if(pb(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){pb(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(Nb),Sc=da.AnonymousSubject=function(a){function b(a){return this.observable.subscribe(a)}function c(c,d){this.observer=c,this.observable=d,a.call(this,b)}return db(c,a),eb(c.prototype,Jb.prototype,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(Nb),Tc=da.BehaviorSubject=function(a){function c(a){return pb(this),this.isStopped?(this.hasError?a.onError(this.error):a.onCompleted(),nb):(this.observers.push(a),a.onNext(this.value),new Pc(this,a))}function d(b){a.call(this,c),this.value=b,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.hasError=!1}return db(d,a),eb(d.prototype,Jb,{getValue:function(){if(pb(this),this.hasError)throw this.error;return this.value},hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(pb(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=b(this.observers),d=c.length;d>a;a++)c[a].onCompleted();this.observers.length=0}},onError:function(a){if(pb(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){if(pb(this),!this.isStopped){this.value=a;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.exception=null}}),d}(Nb),Uc=da.ReplaySubject=function(a){function c(a,b){return mb(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function d(a){var b=new Wb(this.scheduler,a),d=c(this,b);pb(this),this._trim(this.scheduler.now()),this.observers.push(b);for(var e=0,f=this.q.length;f>e;e++)b.onNext(this.q[e].value);return this.hasError?b.onError(this.error):this.isStopped&&b.onCompleted(),b.ensureActive(),d}function e(b,c,e){this.bufferSize=null==b?f:b,this.windowSize=null==c?f:c,this.scheduler=e||zb,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this,d)}var f=Math.pow(2,53)-1;return db(e,a),eb(e.prototype,Jb.prototype,{hasObservers:function(){return this.observers.length>0},_trim:function(a){for(;this.q.length>this.bufferSize;)this.q.shift();for(;this.q.length>0&&a-this.q[0].interval>this.windowSize;)this.q.shift()},onNext:function(a){if(pb(this),!this.isStopped){var c=this.scheduler.now();this.q.push({interval:c,value:a}),this._trim(c);for(var d=0,e=b(this.observers),f=e.length;f>d;d++){var g=e[d];g.onNext(a),g.ensureActive()}}},onError:function(a){if(pb(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var c=this.scheduler.now();this._trim(c);for(var d=0,e=b(this.observers),f=e.length;f>d;d++){var g=e[d];g.onError(a),g.ensureActive()}this.observers.length=0}},onCompleted:function(){if(pb(this),!this.isStopped){this.isStopped=!0;var a=this.scheduler.now();this._trim(a);for(var c=0,d=b(this.observers),e=d.length;e>c;c++){var f=d[c];f.onCompleted(),f.ensureActive()}this.observers.length=0}},dispose:function(){this.isDisposed=!0,this.observers=null}}),e}(Nb);da.Pauser=function(a){function b(){a.call(this)}return db(b,a),b.prototype.pause=function(){this.onNext(!1)},b.prototype.resume=function(){this.onNext(!0)},b}(Qc),"function"==typeof define&&"object"==typeof define.amd&&define.amd?($.Rx=da,define(function(){return da})):_&&aa?ba?(aa.exports=da).Rx=da:_.Rx=da:$.Rx=da;var Vc=g()}).call(this);
+//# sourceMappingURL=rx.lite.compat.map \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.extras.compat.js b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.extras.compat.js
new file mode 100644
index 00000000000..615b6741add
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.extras.compat.js
@@ -0,0 +1,630 @@
+// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
+
+;(function (factory) {
+ var objectTypes = {
+ 'boolean': false,
+ 'function': true,
+ 'object': true,
+ 'number': false,
+ 'string': false,
+ 'undefined': false
+ };
+
+ var root = (objectTypes[typeof window] && window) || this,
+ freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
+ freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
+ moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
+ freeGlobal = objectTypes[typeof global] && global;
+
+ if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) {
+ root = freeGlobal;
+ }
+
+ // Because of build optimizers
+ if (typeof define === 'function' && define.amd) {
+ define(['rx-lite-compat'], function (Rx, exports) {
+ return factory(root, exports, Rx);
+ });
+ } else if (typeof module === 'object' && module && module.exports === freeExports) {
+ module.exports = factory(root, module.exports, require('rx-lite-compat'));
+ } else {
+ root.Rx = factory(root, {}, root.Rx);
+ }
+}.call(this, function (root, exp, Rx, undefined) {
+
+ // References
+ var Observable = Rx.Observable,
+ observableProto = Observable.prototype,
+ observableNever = Observable.never,
+ observableThrow = Observable.throwException,
+ AnonymousObservable = Rx.AnonymousObservable,
+ AnonymousObserver = Rx.AnonymousObserver,
+ notificationCreateOnNext = Rx.Notification.createOnNext,
+ notificationCreateOnError = Rx.Notification.createOnError,
+ notificationCreateOnCompleted = Rx.Notification.createOnCompleted,
+ Observer = Rx.Observer,
+ Subject = Rx.Subject,
+ internals = Rx.internals,
+ helpers = Rx.helpers,
+ ScheduledObserver = internals.ScheduledObserver,
+ SerialDisposable = Rx.SerialDisposable,
+ SingleAssignmentDisposable = Rx.SingleAssignmentDisposable,
+ CompositeDisposable = Rx.CompositeDisposable,
+ RefCountDisposable = Rx.RefCountDisposable,
+ disposableEmpty = Rx.Disposable.empty,
+ immediateScheduler = Rx.Scheduler.immediate,
+ defaultKeySerializer = helpers.defaultKeySerializer,
+ addRef = Rx.internals.addRef,
+ identity = helpers.identity,
+ isPromise = helpers.isPromise,
+ inherits = internals.inherits,
+ bindCallback = internals.bindCallback,
+ noop = helpers.noop,
+ isScheduler = Rx.Scheduler.isScheduler,
+ observableFromPromise = Observable.fromPromise,
+ ArgumentOutOfRangeError = Rx.ArgumentOutOfRangeError;
+
+ function ScheduledDisposable(scheduler, disposable) {
+ this.scheduler = scheduler;
+ this.disposable = disposable;
+ this.isDisposed = false;
+ }
+
+ function scheduleItem(s, self) {
+ if (!self.isDisposed) {
+ self.isDisposed = true;
+ self.disposable.dispose();
+ }
+ }
+
+ ScheduledDisposable.prototype.dispose = function () {
+ this.scheduler.scheduleWithState(this, scheduleItem);
+ };
+
+ var CheckedObserver = (function (__super__) {
+ inherits(CheckedObserver, __super__);
+
+ function CheckedObserver(observer) {
+ __super__.call(this);
+ this._observer = observer;
+ this._state = 0; // 0 - idle, 1 - busy, 2 - done
+ }
+
+ var CheckedObserverPrototype = CheckedObserver.prototype;
+
+ CheckedObserverPrototype.onNext = function (value) {
+ this.checkAccess();
+ var res = tryCatch(this._observer.onNext).call(this._observer, value);
+ this._state = 0;
+ res === errorObj && thrower(res.e);
+ };
+
+ CheckedObserverPrototype.onError = function (err) {
+ this.checkAccess();
+ var res = tryCatch(this._observer.onError).call(this._observer, err);
+ this._state = 2;
+ res === errorObj && thrower(res.e);
+ };
+
+ CheckedObserverPrototype.onCompleted = function () {
+ this.checkAccess();
+ var res = tryCatch(this._observer.onCompleted).call(this._observer);
+ this._state = 2;
+ res === errorObj && thrower(res.e);
+ };
+
+ CheckedObserverPrototype.checkAccess = function () {
+ if (this._state === 1) { throw new Error('Re-entrancy detected'); }
+ if (this._state === 2) { throw new Error('Observer completed'); }
+ if (this._state === 0) { this._state = 1; }
+ };
+
+ return CheckedObserver;
+ }(Observer));
+
+ var ObserveOnObserver = (function (__super__) {
+ inherits(ObserveOnObserver, __super__);
+
+ function ObserveOnObserver(scheduler, observer, cancel) {
+ __super__.call(this, scheduler, observer);
+ this._cancel = cancel;
+ }
+
+ ObserveOnObserver.prototype.next = function (value) {
+ __super__.prototype.next.call(this, value);
+ this.ensureActive();
+ };
+
+ ObserveOnObserver.prototype.error = function (e) {
+ __super__.prototype.error.call(this, e);
+ this.ensureActive();
+ };
+
+ ObserveOnObserver.prototype.completed = function () {
+ __super__.prototype.completed.call(this);
+ this.ensureActive();
+ };
+
+ ObserveOnObserver.prototype.dispose = function () {
+ __super__.prototype.dispose.call(this);
+ this._cancel && this._cancel.dispose();
+ this._cancel = null;
+ };
+
+ return ObserveOnObserver;
+ })(ScheduledObserver);
+
+ /**
+ * Checks access to the observer for grammar violations. This includes checking for multiple OnError or OnCompleted calls, as well as reentrancy in any of the observer methods.
+ * If a violation is detected, an Error is thrown from the offending observer method call.
+ *
+ * @returns An observer that checks callbacks invocations against the observer grammar and, if the checks pass, forwards those to the specified observer.
+ */
+ Observer.prototype.checked = function () { return new CheckedObserver(this); };
+
+ /**
+ * Schedules the invocation of observer methods on the given scheduler.
+ * @param {Scheduler} scheduler Scheduler to schedule observer messages on.
+ * @returns {Observer} Observer whose messages are scheduled on the given scheduler.
+ */
+ Observer.notifyOn = function (scheduler) {
+ return new ObserveOnObserver(scheduler, this);
+ };
+
+ /**
+ * Creates an observer from a notification callback.
+ * @param {Function} handler Action that handles a notification.
+ * @returns The observer object that invokes the specified handler using a notification corresponding to each message it receives.
+ */
+ Observer.fromNotifier = function (handler, thisArg) {
+ var handlerFunc = bindCallback(handler, thisArg, 1);
+ return new AnonymousObserver(function (x) {
+ return handlerFunc(notificationCreateOnNext(x));
+ }, function (e) {
+ return handlerFunc(notificationCreateOnError(e));
+ }, function () {
+ return handlerFunc(notificationCreateOnCompleted());
+ });
+ };
+
+ /**
+ * Creates a notification callback from an observer.
+ * @returns The action that forwards its input notification to the underlying observer.
+ */
+ Observer.prototype.toNotifier = function () {
+ var observer = this;
+ return function (n) { return n.accept(observer); };
+ };
+
+ /**
+ * Hides the identity of an observer.
+ * @returns An observer that hides the identity of the specified observer.
+ */
+ Observer.prototype.asObserver = function () {
+ var source = this;
+ return new AnonymousObserver(
+ function (x) { source.onNext(x); },
+ function (e) { source.onError(e); },
+ function () { source.onCompleted(); }
+ );
+ };
+
+ /**
+ * Wraps the source sequence in order to run its observer callbacks on the specified scheduler.
+ *
+ * This only invokes observer callbacks on a scheduler. In case the subscription and/or unsubscription actions have side-effects
+ * that require to be run on a scheduler, use subscribeOn.
+ *
+ * @param {Scheduler} scheduler Scheduler to notify observers on.
+ * @returns {Observable} The source sequence whose observations happen on the specified scheduler.
+ */
+ observableProto.observeOn = function (scheduler) {
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ return source.subscribe(new ObserveOnObserver(scheduler, observer));
+ }, source);
+ };
+
+ /**
+ * Wraps the source sequence in order to run its subscription and unsubscription logic on the specified scheduler. This operation is not commonly used;
+ * see the remarks section for more information on the distinction between subscribeOn and observeOn.
+
+ * This only performs the side-effects of subscription and unsubscription on the specified scheduler. In order to invoke observer
+ * callbacks on a scheduler, use observeOn.
+
+ * @param {Scheduler} scheduler Scheduler to perform subscription and unsubscription actions on.
+ * @returns {Observable} The source sequence whose subscriptions and unsubscriptions happen on the specified scheduler.
+ */
+ observableProto.subscribeOn = function (scheduler) {
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ var m = new SingleAssignmentDisposable(), d = new SerialDisposable();
+ d.setDisposable(m);
+ m.setDisposable(scheduler.schedule(function () {
+ d.setDisposable(new ScheduledDisposable(scheduler, source.subscribe(observer)));
+ }));
+ return d;
+ }, source);
+ };
+
+ /**
+ * Generates an observable sequence by running a state-driven loop producing the sequence's elements, using the specified scheduler to send out observer messages.
+ *
+ * @example
+ * var res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; });
+ * var res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; }, Rx.Scheduler.timeout);
+ * @param {Mixed} initialState Initial state.
+ * @param {Function} condition Condition to terminate generation (upon returning false).
+ * @param {Function} iterate Iteration step function.
+ * @param {Function} resultSelector Selector function for results produced in the sequence.
+ * @param {Scheduler} [scheduler] Scheduler on which to run the generator loop. If not provided, defaults to Scheduler.currentThread.
+ * @returns {Observable} The generated sequence.
+ */
+ Observable.generate = function (initialState, condition, iterate, resultSelector, scheduler) {
+ isScheduler(scheduler) || (scheduler = currentThreadScheduler);
+ return new AnonymousObservable(function (o) {
+ var first = true;
+ return scheduler.scheduleRecursiveWithState(initialState, function (state, self) {
+ var hasResult, result;
+ try {
+ if (first) {
+ first = false;
+ } else {
+ state = iterate(state);
+ }
+ hasResult = condition(state);
+ hasResult && (result = resultSelector(state));
+ } catch (e) {
+ return o.onError(e);
+ }
+ if (hasResult) {
+ o.onNext(result);
+ self(state);
+ } else {
+ o.onCompleted();
+ }
+ });
+ });
+ };
+
+ /**
+ * Constructs an observable sequence that depends on a resource object, whose lifetime is tied to the resulting observable sequence's lifetime.
+ * @param {Function} resourceFactory Factory function to obtain a resource object.
+ * @param {Function} observableFactory Factory function to obtain an observable sequence that depends on the obtained resource.
+ * @returns {Observable} An observable sequence whose lifetime controls the lifetime of the dependent resource object.
+ */
+ Observable.using = function (resourceFactory, observableFactory) {
+ return new AnonymousObservable(function (observer) {
+ var disposable = disposableEmpty, resource, source;
+ try {
+ resource = resourceFactory();
+ resource && (disposable = resource);
+ source = observableFactory(resource);
+ } catch (exception) {
+ return new CompositeDisposable(observableThrow(exception).subscribe(observer), disposable);
+ }
+ return new CompositeDisposable(source.subscribe(observer), disposable);
+ });
+ };
+
+ /**
+ * Propagates the observable sequence or Promise that reacts first.
+ * @param {Observable} rightSource Second observable sequence or Promise.
+ * @returns {Observable} {Observable} An observable sequence that surfaces either of the given sequences, whichever reacted first.
+ */
+ observableProto.amb = function (rightSource) {
+ var leftSource = this;
+ return new AnonymousObservable(function (observer) {
+ var choice,
+ leftChoice = 'L', rightChoice = 'R',
+ leftSubscription = new SingleAssignmentDisposable(),
+ rightSubscription = new SingleAssignmentDisposable();
+
+ isPromise(rightSource) && (rightSource = observableFromPromise(rightSource));
+
+ function choiceL() {
+ if (!choice) {
+ choice = leftChoice;
+ rightSubscription.dispose();
+ }
+ }
+
+ function choiceR() {
+ if (!choice) {
+ choice = rightChoice;
+ leftSubscription.dispose();
+ }
+ }
+
+ leftSubscription.setDisposable(leftSource.subscribe(function (left) {
+ choiceL();
+ choice === leftChoice && observer.onNext(left);
+ }, function (err) {
+ choiceL();
+ choice === leftChoice && observer.onError(err);
+ }, function () {
+ choiceL();
+ choice === leftChoice && observer.onCompleted();
+ }));
+
+ rightSubscription.setDisposable(rightSource.subscribe(function (right) {
+ choiceR();
+ choice === rightChoice && observer.onNext(right);
+ }, function (err) {
+ choiceR();
+ choice === rightChoice && observer.onError(err);
+ }, function () {
+ choiceR();
+ choice === rightChoice && observer.onCompleted();
+ }));
+
+ return new CompositeDisposable(leftSubscription, rightSubscription);
+ });
+ };
+
+ /**
+ * Propagates the observable sequence or Promise that reacts first.
+ *
+ * @example
+ * var = Rx.Observable.amb(xs, ys, zs);
+ * @returns {Observable} An observable sequence that surfaces any of the given sequences, whichever reacted first.
+ */
+ Observable.amb = function () {
+ var acc = observableNever(), items = [];
+ if (Array.isArray(arguments[0])) {
+ items = arguments[0];
+ } else {
+ for(var i = 0, len = arguments.length; i < len; i++) { items.push(arguments[i]); }
+ }
+
+ function func(previous, current) {
+ return previous.amb(current);
+ }
+ for (var i = 0, len = items.length; i < len; i++) {
+ acc = func(acc, items[i]);
+ }
+ return acc;
+ };
+
+ /**
+ * Continues an observable sequence that is terminated normally or by an exception with the next observable sequence.
+ * @param {Observable} second Second observable sequence used to produce results after the first sequence terminates.
+ * @returns {Observable} An observable sequence that concatenates the first and second sequence, even if the first sequence terminates exceptionally.
+ */
+ observableProto.onErrorResumeNext = function (second) {
+ if (!second) { throw new Error('Second observable is required'); }
+ return onErrorResumeNext([this, second]);
+ };
+
+ /**
+ * Continues an observable sequence that is terminated normally or by an exception with the next observable sequence.
+ *
+ * @example
+ * 1 - res = Rx.Observable.onErrorResumeNext(xs, ys, zs);
+ * 1 - res = Rx.Observable.onErrorResumeNext([xs, ys, zs]);
+ * @returns {Observable} An observable sequence that concatenates the source sequences, even if a sequence terminates exceptionally.
+ */
+ var onErrorResumeNext = Observable.onErrorResumeNext = function () {
+ var sources = [];
+ if (Array.isArray(arguments[0])) {
+ sources = arguments[0];
+ } else {
+ for(var i = 0, len = arguments.length; i < len; i++) { sources.push(arguments[i]); }
+ }
+ return new AnonymousObservable(function (observer) {
+ var pos = 0, subscription = new SerialDisposable(),
+ cancelable = immediateScheduler.scheduleRecursive(function (self) {
+ var current, d;
+ if (pos < sources.length) {
+ current = sources[pos++];
+ isPromise(current) && (current = observableFromPromise(current));
+ d = new SingleAssignmentDisposable();
+ subscription.setDisposable(d);
+ d.setDisposable(current.subscribe(observer.onNext.bind(observer), self, self));
+ } else {
+ observer.onCompleted();
+ }
+ });
+ return new CompositeDisposable(subscription, cancelable);
+ });
+ };
+
+ /**
+ * Projects each element of an observable sequence into zero or more buffers which are produced based on element count information.
+ *
+ * @example
+ * var res = xs.bufferWithCount(10);
+ * var res = xs.bufferWithCount(10, 1);
+ * @param {Number} count Length of each buffer.
+ * @param {Number} [skip] Number of elements to skip between creation of consecutive buffers. If not provided, defaults to the count.
+ * @returns {Observable} An observable sequence of buffers.
+ */
+ observableProto.bufferWithCount = function (count, skip) {
+ if (typeof skip !== 'number') {
+ skip = count;
+ }
+ return this.windowWithCount(count, skip).selectMany(function (x) {
+ return x.toArray();
+ }).where(function (x) {
+ return x.length > 0;
+ });
+ };
+
+ /**
+ * Projects each element of an observable sequence into zero or more windows which are produced based on element count information.
+ *
+ * var res = xs.windowWithCount(10);
+ * var res = xs.windowWithCount(10, 1);
+ * @param {Number} count Length of each window.
+ * @param {Number} [skip] Number of elements to skip between creation of consecutive windows. If not specified, defaults to the count.
+ * @returns {Observable} An observable sequence of windows.
+ */
+ observableProto.windowWithCount = function (count, skip) {
+ var source = this;
+ +count || (count = 0);
+ Math.abs(count) === Infinity && (count = 0);
+ if (count <= 0) { throw new ArgumentOutOfRangeError(); }
+ skip == null && (skip = count);
+ +skip || (skip = 0);
+ Math.abs(skip) === Infinity && (skip = 0);
+
+ if (skip <= 0) { throw new ArgumentOutOfRangeError(); }
+ return new AnonymousObservable(function (observer) {
+ var m = new SingleAssignmentDisposable(),
+ refCountDisposable = new RefCountDisposable(m),
+ n = 0,
+ q = [];
+
+ function createWindow () {
+ var s = new Subject();
+ q.push(s);
+ observer.onNext(addRef(s, refCountDisposable));
+ }
+
+ createWindow();
+
+ m.setDisposable(source.subscribe(
+ function (x) {
+ for (var i = 0, len = q.length; i < len; i++) { q[i].onNext(x); }
+ var c = n - count + 1;
+ c >= 0 && c % skip === 0 && q.shift().onCompleted();
+ ++n % skip === 0 && createWindow();
+ },
+ function (e) {
+ while (q.length > 0) { q.shift().onError(e); }
+ observer.onError(e);
+ },
+ function () {
+ while (q.length > 0) { q.shift().onCompleted(); }
+ observer.onCompleted();
+ }
+ ));
+ return refCountDisposable;
+ }, source);
+ };
+
+ /**
+ * Returns an array with the specified number of contiguous elements from the end of an observable sequence.
+ *
+ * @description
+ * This operator accumulates a buffer with a length enough to store count elements. Upon completion of the
+ * source sequence, this buffer is produced on the result sequence.
+ * @param {Number} count Number of elements to take from the end of the source sequence.
+ * @returns {Observable} An observable sequence containing a single array with the specified number of elements from the end of the source sequence.
+ */
+ observableProto.takeLastBuffer = function (count) {
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var q = [];
+ return source.subscribe(function (x) {
+ q.push(x);
+ q.length > count && q.shift();
+ }, function (e) { o.onError(e); }, function () {
+ o.onNext(q);
+ o.onCompleted();
+ });
+ }, source);
+ };
+
+ /**
+ * Returns the elements of the specified sequence or the specified value in a singleton sequence if the sequence is empty.
+ *
+ * var res = obs = xs.defaultIfEmpty();
+ * 2 - obs = xs.defaultIfEmpty(false);
+ *
+ * @memberOf Observable#
+ * @param defaultValue The value to return if the sequence is empty. If not provided, this defaults to null.
+ * @returns {Observable} An observable sequence that contains the specified default value if the source is empty; otherwise, the elements of the source itself.
+ */
+ observableProto.defaultIfEmpty = function (defaultValue) {
+ var source = this;
+ defaultValue === undefined && (defaultValue = null);
+ return new AnonymousObservable(function (observer) {
+ var found = false;
+ return source.subscribe(function (x) {
+ found = true;
+ observer.onNext(x);
+ },
+ function (e) { observer.onError(e); },
+ function () {
+ !found && observer.onNext(defaultValue);
+ observer.onCompleted();
+ });
+ }, source);
+ };
+
+ // Swap out for Array.findIndex
+ function arrayIndexOfComparer(array, item, comparer) {
+ for (var i = 0, len = array.length; i < len; i++) {
+ if (comparer(array[i], item)) { return i; }
+ }
+ return -1;
+ }
+
+ function HashSet(comparer) {
+ this.comparer = comparer;
+ this.set = [];
+ }
+ HashSet.prototype.push = function(value) {
+ var retValue = arrayIndexOfComparer(this.set, value, this.comparer) === -1;
+ retValue && this.set.push(value);
+ return retValue;
+ };
+
+ /**
+ * Returns an observable sequence that contains only distinct elements according to the keySelector and the comparer.
+ * Usage of this operator should be considered carefully due to the maintenance of an internal lookup structure which can grow large.
+ *
+ * @example
+ * var res = obs = xs.distinct();
+ * 2 - obs = xs.distinct(function (x) { return x.id; });
+ * 2 - obs = xs.distinct(function (x) { return x.id; }, function (a,b) { return a === b; });
+ * @param {Function} [keySelector] A function to compute the comparison key for each element.
+ * @param {Function} [comparer] Used to compare items in the collection.
+ * @returns {Observable} An observable sequence only containing the distinct elements, based on a computed key value, from the source sequence.
+ */
+ observableProto.distinct = function (keySelector, comparer) {
+ var source = this;
+ comparer || (comparer = defaultComparer);
+ return new AnonymousObservable(function (o) {
+ var hashSet = new HashSet(comparer);
+ return source.subscribe(function (x) {
+ var key = x;
+
+ if (keySelector) {
+ try {
+ key = keySelector(x);
+ } catch (e) {
+ o.onError(e);
+ return;
+ }
+ }
+ hashSet.push(key) && o.onNext(x);
+ },
+ function (e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, this);
+ };
+
+ /**
+ * Returns an observable sequence that shares a single subscription to the underlying sequence. This observable sequence
+ * can be resubscribed to, even if all prior subscriptions have ended. (unlike `.publish().refCount()`)
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source.
+ */
+ observableProto.singleInstance = function() {
+ var source = this, hasObservable = false, observable;
+
+ function getObservable() {
+ if (!hasObservable) {
+ hasObservable = true;
+ observable = source.finally(function() { hasObservable = false; }).publish().refCount();
+ }
+ return observable;
+ };
+
+ return new AnonymousObservable(function(o) {
+ return getObservable().subscribe(o);
+ });
+ };
+
+ return Rx;
+}));
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.extras.compat.map b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.extras.compat.map
new file mode 100644
index 00000000000..969bc46d3a3
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.extras.compat.map
@@ -0,0 +1 @@
+{"version":3,"file":"rx.lite.extras.compat.min.js","sources":["rx.lite.extras.compat.js"],"names":["factory","objectTypes","boolean","function","object","number","string","undefined","root","window","this","freeExports","exports","nodeType","freeModule","module","freeGlobal","global","define","amd","Rx","require","call","exp","ScheduledDisposable","scheduler","disposable","isDisposed","scheduleItem","s","self","dispose","arrayIndexOfComparer","array","item","comparer","i","len","length","HashSet","set","Observable","observableProto","prototype","observableNever","never","observableThrow","throwException","AnonymousObservable","AnonymousObserver","notificationCreateOnNext","Notification","createOnNext","notificationCreateOnError","createOnError","notificationCreateOnCompleted","createOnCompleted","Observer","Subject","internals","helpers","ScheduledObserver","SerialDisposable","SingleAssignmentDisposable","CompositeDisposable","RefCountDisposable","disposableEmpty","Disposable","empty","immediateScheduler","Scheduler","immediate","addRef","defaultKeySerializer","isPromise","identity","inherits","bindCallback","isScheduler","noop","observableFromPromise","fromPromise","ArgumentOutOfRangeError","scheduleWithState","CheckedObserver","__super__","observer","_observer","_state","CheckedObserverPrototype","onNext","value","checkAccess","res","tryCatch","errorObj","thrower","e","onError","err","onCompleted","Error","ObserveOnObserver","cancel","_cancel","next","ensureActive","error","completed","checked","notifyOn","fromNotifier","handler","thisArg","handlerFunc","x","toNotifier","n","accept","asObserver","source","observeOn","subscribe","subscribeOn","m","d","setDisposable","schedule","generate","initialState","condition","iterate","resultSelector","currentThreadScheduler","o","first","scheduleRecursiveWithState","state","hasResult","result","using","resourceFactory","observableFactory","resource","exception","amb","rightSource","leftSource","choiceL","choice","leftChoice","rightSubscription","choiceR","rightChoice","leftSubscription","left","right","func","previous","current","acc","items","Array","isArray","arguments","push","onErrorResumeNext","second","sources","pos","subscription","cancelable","scheduleRecursive","bind","bufferWithCount","count","skip","windowWithCount","selectMany","toArray","where","Math","abs","Infinity","createWindow","q","refCountDisposable","c","shift","takeLastBuffer","defaultIfEmpty","defaultValue","found","retValue","distinct","keySelector","defaultComparer","hashSet","key","singleInstance","getObservable","hasObservable","observable","publish","refCount"],"mappings":";CAEE,SAAUA,GACR,GAAIC,IACAC,WAAW,EACXC,YAAY,EACZC,QAAU,EACVC,QAAU,EACVC,QAAU,EACVC,WAAa,GAGbC,EAAQP,QAAmBQ,UAAWA,QAAWC,KACjDC,EAAcV,QAAmBW,WAAYA,UAAYA,QAAQC,UAAYD,QAC7EE,EAAab,QAAmBc,UAAWA,SAAWA,OAAOF,UAAYE,OAEzEC,GADgBF,GAAcA,EAAWF,UAAYD,GAAeA,EACvDV,QAAmBgB,UAAWA,SAE3CD,GAAeA,EAAWC,SAAWD,GAAcA,EAAWP,SAAWO,IACzER,EAAOQ,GAIW,kBAAXE,SAAyBA,OAAOC,IACvCD,QAAQ,kBAAmB,SAAUE,EAAIR,GACrC,MAAOZ,GAAQQ,EAAMI,EAASQ,KAET,gBAAXL,SAAuBA,QAAUA,OAAOH,UAAYD,EAClEI,OAAOH,QAAUZ,EAAQQ,EAAMO,OAAOH,QAASS,QAAQ,mBAEvDb,EAAKY,GAAKpB,EAAQQ,KAAUA,EAAKY,MAEvCE,KAAKZ,KAAM,SAAUF,EAAMe,EAAKH,EAAIb,GAkCpC,QAASiB,GAAoBC,EAAWC,GACtChB,KAAKe,UAAYA,EACjBf,KAAKgB,WAAaA,EAClBhB,KAAKiB,YAAa,EAGpB,QAASC,GAAaC,EAAGC,GAClBA,EAAKH,aACRG,EAAKH,YAAa,EACl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C,GAAEpC,QAAQD,GAIdoG,EAAQhC,KAAKiC,IAAQhE,EAAE5C,OAAOyB,IAEhC,SAAUlB,GAAKqC,EAAEpC,QAAQD,IAAO,WAAcqC,EAAElC,iBAC/C1F,OAQLgC,EAAgB6J,eAAiB,WAG/B,QAASC,KAKP,MAJKC,KACHA,GAAgB,EAChBC,EAAalF,EAAAA,WAAe,WAAaiF,GAAgB,IAAUE,UAAUC,YAExEF,EAPT,GAA0CA,GAAtClF,EAAS9G,KAAM+L,GAAgB,CAUnC,OAAO,IAAIzJ,GAAoB,SAASsF,GACtC,MAAOkE,KAAgB9E,UAAUY,MAI5BlH"} \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.extras.compat.min.js b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.extras.compat.min.js
new file mode 100644
index 00000000000..e67bdc23f5c
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.extras.compat.min.js
@@ -0,0 +1,3 @@
+/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
+(function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx-lite-compat"],function(b,d){return a(c,d,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("rx-lite-compat")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){function e(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function f(a,b){b.isDisposed||(b.isDisposed=!0,b.disposable.dispose())}function g(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function h(a){this.comparer=a,this.set=[]}var i=c.Observable,j=i.prototype,k=i.never,l=i.throwException,m=c.AnonymousObservable,n=c.AnonymousObserver,o=c.Notification.createOnNext,p=c.Notification.createOnError,q=c.Notification.createOnCompleted,r=c.Observer,s=c.Subject,t=c.internals,u=c.helpers,v=t.ScheduledObserver,w=c.SerialDisposable,x=c.SingleAssignmentDisposable,y=c.CompositeDisposable,z=c.RefCountDisposable,A=c.Disposable.empty,B=c.Scheduler.immediate,C=(u.defaultKeySerializer,c.internals.addRef),D=(u.identity,u.isPromise),E=t.inherits,F=t.bindCallback,G=(u.noop,c.Scheduler.isScheduler),H=i.fromPromise,I=c.ArgumentOutOfRangeError;e.prototype.dispose=function(){this.scheduler.scheduleWithState(this,f)};var J=function(a){function b(b){a.call(this),this._observer=b,this._state=0}E(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();var b=tryCatch(this._observer.onNext).call(this._observer,a);this._state=0,b===errorObj&&thrower(b.e)},c.onError=function(a){this.checkAccess();var b=tryCatch(this._observer.onError).call(this._observer,a);this._state=2,b===errorObj&&thrower(b.e)},c.onCompleted=function(){this.checkAccess();var a=tryCatch(this._observer.onCompleted).call(this._observer);this._state=2,a===errorObj&&thrower(a.e)},c.checkAccess=function(){if(1===this._state)throw new Error("Re-entrancy detected");if(2===this._state)throw new Error("Observer completed");0===this._state&&(this._state=1)},b}(r),K=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return E(b,a),b.prototype.next=function(b){a.prototype.next.call(this,b),this.ensureActive()},b.prototype.error=function(b){a.prototype.error.call(this,b),this.ensureActive()},b.prototype.completed=function(){a.prototype.completed.call(this),this.ensureActive()},b.prototype.dispose=function(){a.prototype.dispose.call(this),this._cancel&&this._cancel.dispose(),this._cancel=null},b}(v);r.prototype.checked=function(){return new J(this)},r.notifyOn=function(a){return new K(a,this)},r.fromNotifier=function(a,b){var c=F(a,b,1);return new n(function(a){return c(o(a))},function(a){return c(p(a))},function(){return c(q())})},r.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},r.prototype.asObserver=function(){var a=this;return new n(function(b){a.onNext(b)},function(b){a.onError(b)},function(){a.onCompleted()})},j.observeOn=function(a){var b=this;return new m(function(c){return b.subscribe(new K(a,c))},b)},j.subscribeOn=function(a){var b=this;return new m(function(c){var d=new x,f=new w;return f.setDisposable(d),d.setDisposable(a.schedule(function(){f.setDisposable(new e(a,b.subscribe(c)))})),f},b)},i.generate=function(a,b,c,d,e){return G(e)||(e=currentThreadScheduler),new m(function(f){var g=!0;return e.scheduleRecursiveWithState(a,function(a,e){var h,i;try{g?g=!1:a=c(a),h=b(a),h&&(i=d(a))}catch(j){return f.onError(j)}h?(f.onNext(i),e(a)):f.onCompleted()})})},i.using=function(a,b){return new m(function(c){var d,e,f=A;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new y(l(g).subscribe(c),f)}return new y(e.subscribe(c),f)})},j.amb=function(a){var b=this;return new m(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new x,j=new x;return D(a)&&(a=H(a)),i.setDisposable(b.subscribe(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()})),j.setDisposable(a.subscribe(function(a){e(),f===h&&c.onNext(a)},function(a){e(),f===h&&c.onError(a)},function(){e(),f===h&&c.onCompleted()})),new y(i,j)})},i.amb=function(){function a(a,b){return a.amb(b)}var b=k(),c=[];if(Array.isArray(arguments[0]))c=arguments[0];else for(var d=0,e=arguments.length;e>d;d++)c.push(arguments[d]);for(var d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},j.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return L([this,a])};var L=i.onErrorResumeNext=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return new m(function(b){var c=0,d=new w,e=B.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],D(f)&&(f=H(f)),g=new x,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new y(d,e)})};return j.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).selectMany(function(a){return a.toArray()}).where(function(a){return a.length>0})},j.windowWithCount=function(a,b){var c=this;if(+a||(a=0),Math.abs(a)===1/0&&(a=0),0>=a)throw new I;if(null==b&&(b=a),+b||(b=0),Math.abs(b)===1/0&&(b=0),0>=b)throw new I;return new m(function(d){function e(){var a=new s;i.push(a),d.onNext(C(a,g))}var f=new x,g=new z(f),h=0,i=[];return e(),f.setDisposable(c.subscribe(function(c){for(var d=0,f=i.length;f>d;d++)i[d].onNext(c);var g=h-a+1;g>=0&&g%b===0&&i.shift().onCompleted(),++h%b===0&&e()},function(a){for(;i.length>0;)i.shift().onError(a);d.onError(a)},function(){for(;i.length>0;)i.shift().onCompleted();d.onCompleted()})),g},c)},j.takeLastBuffer=function(a){var b=this;return new m(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},function(a){c.onError(a)},function(){c.onNext(d),c.onCompleted()})},b)},j.defaultIfEmpty=function(a){var b=this;return a===d&&(a=null),new m(function(c){var d=!1;return b.subscribe(function(a){d=!0,c.onNext(a)},function(a){c.onError(a)},function(){!d&&c.onNext(a),c.onCompleted()})},b)},h.prototype.push=function(a){var b=-1===g(this.set,a,this.comparer);return b&&this.set.push(a),b},j.distinct=function(a,b){var c=this;return b||(b=defaultComparer),new m(function(d){var e=new h(b);return c.subscribe(function(b){var c=b;if(a)try{c=a(b)}catch(f){return void d.onError(f)}e.push(c)&&d.onNext(b)},function(a){d.onError(a)},function(){d.onCompleted()})},this)},j.singleInstance=function(){function a(){return d||(d=!0,b=c["finally"](function(){d=!1}).publish().refCount()),b}var b,c=this,d=!1;return new m(function(b){return a().subscribe(b)})},c});
+//# sourceMappingURL=rx.lite.extras.compat.map \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.extras.js b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.extras.js
new file mode 100644
index 00000000000..ce546e92e69
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.extras.js
@@ -0,0 +1,630 @@
+// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
+
+;(function (factory) {
+ var objectTypes = {
+ 'boolean': false,
+ 'function': true,
+ 'object': true,
+ 'number': false,
+ 'string': false,
+ 'undefined': false
+ };
+
+ var root = (objectTypes[typeof window] && window) || this,
+ freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
+ freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
+ moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
+ freeGlobal = objectTypes[typeof global] && global;
+
+ if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) {
+ root = freeGlobal;
+ }
+
+ // Because of build optimizers
+ if (typeof define === 'function' && define.amd) {
+ define(['rx-lite'], function (Rx, exports) {
+ return factory(root, exports, Rx);
+ });
+ } else if (typeof module === 'object' && module && module.exports === freeExports) {
+ module.exports = factory(root, module.exports, require('rx-lite'));
+ } else {
+ root.Rx = factory(root, {}, root.Rx);
+ }
+}.call(this, function (root, exp, Rx, undefined) {
+
+ // References
+ var Observable = Rx.Observable,
+ observableProto = Observable.prototype,
+ observableNever = Observable.never,
+ observableThrow = Observable.throwException,
+ AnonymousObservable = Rx.AnonymousObservable,
+ AnonymousObserver = Rx.AnonymousObserver,
+ notificationCreateOnNext = Rx.Notification.createOnNext,
+ notificationCreateOnError = Rx.Notification.createOnError,
+ notificationCreateOnCompleted = Rx.Notification.createOnCompleted,
+ Observer = Rx.Observer,
+ Subject = Rx.Subject,
+ internals = Rx.internals,
+ helpers = Rx.helpers,
+ ScheduledObserver = internals.ScheduledObserver,
+ SerialDisposable = Rx.SerialDisposable,
+ SingleAssignmentDisposable = Rx.SingleAssignmentDisposable,
+ CompositeDisposable = Rx.CompositeDisposable,
+ RefCountDisposable = Rx.RefCountDisposable,
+ disposableEmpty = Rx.Disposable.empty,
+ immediateScheduler = Rx.Scheduler.immediate,
+ defaultKeySerializer = helpers.defaultKeySerializer,
+ addRef = Rx.internals.addRef,
+ identity = helpers.identity,
+ isPromise = helpers.isPromise,
+ inherits = internals.inherits,
+ bindCallback = internals.bindCallback,
+ noop = helpers.noop,
+ isScheduler = Rx.Scheduler.isScheduler,
+ observableFromPromise = Observable.fromPromise,
+ ArgumentOutOfRangeError = Rx.ArgumentOutOfRangeError;
+
+ function ScheduledDisposable(scheduler, disposable) {
+ this.scheduler = scheduler;
+ this.disposable = disposable;
+ this.isDisposed = false;
+ }
+
+ function scheduleItem(s, self) {
+ if (!self.isDisposed) {
+ self.isDisposed = true;
+ self.disposable.dispose();
+ }
+ }
+
+ ScheduledDisposable.prototype.dispose = function () {
+ this.scheduler.scheduleWithState(this, scheduleItem);
+ };
+
+ var CheckedObserver = (function (__super__) {
+ inherits(CheckedObserver, __super__);
+
+ function CheckedObserver(observer) {
+ __super__.call(this);
+ this._observer = observer;
+ this._state = 0; // 0 - idle, 1 - busy, 2 - done
+ }
+
+ var CheckedObserverPrototype = CheckedObserver.prototype;
+
+ CheckedObserverPrototype.onNext = function (value) {
+ this.checkAccess();
+ var res = tryCatch(this._observer.onNext).call(this._observer, value);
+ this._state = 0;
+ res === errorObj && thrower(res.e);
+ };
+
+ CheckedObserverPrototype.onError = function (err) {
+ this.checkAccess();
+ var res = tryCatch(this._observer.onError).call(this._observer, err);
+ this._state = 2;
+ res === errorObj && thrower(res.e);
+ };
+
+ CheckedObserverPrototype.onCompleted = function () {
+ this.checkAccess();
+ var res = tryCatch(this._observer.onCompleted).call(this._observer);
+ this._state = 2;
+ res === errorObj && thrower(res.e);
+ };
+
+ CheckedObserverPrototype.checkAccess = function () {
+ if (this._state === 1) { throw new Error('Re-entrancy detected'); }
+ if (this._state === 2) { throw new Error('Observer completed'); }
+ if (this._state === 0) { this._state = 1; }
+ };
+
+ return CheckedObserver;
+ }(Observer));
+
+ var ObserveOnObserver = (function (__super__) {
+ inherits(ObserveOnObserver, __super__);
+
+ function ObserveOnObserver(scheduler, observer, cancel) {
+ __super__.call(this, scheduler, observer);
+ this._cancel = cancel;
+ }
+
+ ObserveOnObserver.prototype.next = function (value) {
+ __super__.prototype.next.call(this, value);
+ this.ensureActive();
+ };
+
+ ObserveOnObserver.prototype.error = function (e) {
+ __super__.prototype.error.call(this, e);
+ this.ensureActive();
+ };
+
+ ObserveOnObserver.prototype.completed = function () {
+ __super__.prototype.completed.call(this);
+ this.ensureActive();
+ };
+
+ ObserveOnObserver.prototype.dispose = function () {
+ __super__.prototype.dispose.call(this);
+ this._cancel && this._cancel.dispose();
+ this._cancel = null;
+ };
+
+ return ObserveOnObserver;
+ })(ScheduledObserver);
+
+ /**
+ * Checks access to the observer for grammar violations. This includes checking for multiple OnError or OnCompleted calls, as well as reentrancy in any of the observer methods.
+ * If a violation is detected, an Error is thrown from the offending observer method call.
+ *
+ * @returns An observer that checks callbacks invocations against the observer grammar and, if the checks pass, forwards those to the specified observer.
+ */
+ Observer.prototype.checked = function () { return new CheckedObserver(this); };
+
+ /**
+ * Schedules the invocation of observer methods on the given scheduler.
+ * @param {Scheduler} scheduler Scheduler to schedule observer messages on.
+ * @returns {Observer} Observer whose messages are scheduled on the given scheduler.
+ */
+ Observer.notifyOn = function (scheduler) {
+ return new ObserveOnObserver(scheduler, this);
+ };
+
+ /**
+ * Creates an observer from a notification callback.
+ * @param {Function} handler Action that handles a notification.
+ * @returns The observer object that invokes the specified handler using a notification corresponding to each message it receives.
+ */
+ Observer.fromNotifier = function (handler, thisArg) {
+ var handlerFunc = bindCallback(handler, thisArg, 1);
+ return new AnonymousObserver(function (x) {
+ return handlerFunc(notificationCreateOnNext(x));
+ }, function (e) {
+ return handlerFunc(notificationCreateOnError(e));
+ }, function () {
+ return handlerFunc(notificationCreateOnCompleted());
+ });
+ };
+
+ /**
+ * Creates a notification callback from an observer.
+ * @returns The action that forwards its input notification to the underlying observer.
+ */
+ Observer.prototype.toNotifier = function () {
+ var observer = this;
+ return function (n) { return n.accept(observer); };
+ };
+
+ /**
+ * Hides the identity of an observer.
+ * @returns An observer that hides the identity of the specified observer.
+ */
+ Observer.prototype.asObserver = function () {
+ var source = this;
+ return new AnonymousObserver(
+ function (x) { source.onNext(x); },
+ function (e) { source.onError(e); },
+ function () { source.onCompleted(); }
+ );
+ };
+
+ /**
+ * Wraps the source sequence in order to run its observer callbacks on the specified scheduler.
+ *
+ * This only invokes observer callbacks on a scheduler. In case the subscription and/or unsubscription actions have side-effects
+ * that require to be run on a scheduler, use subscribeOn.
+ *
+ * @param {Scheduler} scheduler Scheduler to notify observers on.
+ * @returns {Observable} The source sequence whose observations happen on the specified scheduler.
+ */
+ observableProto.observeOn = function (scheduler) {
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ return source.subscribe(new ObserveOnObserver(scheduler, observer));
+ }, source);
+ };
+
+ /**
+ * Wraps the source sequence in order to run its subscription and unsubscription logic on the specified scheduler. This operation is not commonly used;
+ * see the remarks section for more information on the distinction between subscribeOn and observeOn.
+
+ * This only performs the side-effects of subscription and unsubscription on the specified scheduler. In order to invoke observer
+ * callbacks on a scheduler, use observeOn.
+
+ * @param {Scheduler} scheduler Scheduler to perform subscription and unsubscription actions on.
+ * @returns {Observable} The source sequence whose subscriptions and unsubscriptions happen on the specified scheduler.
+ */
+ observableProto.subscribeOn = function (scheduler) {
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ var m = new SingleAssignmentDisposable(), d = new SerialDisposable();
+ d.setDisposable(m);
+ m.setDisposable(scheduler.schedule(function () {
+ d.setDisposable(new ScheduledDisposable(scheduler, source.subscribe(observer)));
+ }));
+ return d;
+ }, source);
+ };
+
+ /**
+ * Generates an observable sequence by running a state-driven loop producing the sequence's elements, using the specified scheduler to send out observer messages.
+ *
+ * @example
+ * var res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; });
+ * var res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; }, Rx.Scheduler.timeout);
+ * @param {Mixed} initialState Initial state.
+ * @param {Function} condition Condition to terminate generation (upon returning false).
+ * @param {Function} iterate Iteration step function.
+ * @param {Function} resultSelector Selector function for results produced in the sequence.
+ * @param {Scheduler} [scheduler] Scheduler on which to run the generator loop. If not provided, defaults to Scheduler.currentThread.
+ * @returns {Observable} The generated sequence.
+ */
+ Observable.generate = function (initialState, condition, iterate, resultSelector, scheduler) {
+ isScheduler(scheduler) || (scheduler = currentThreadScheduler);
+ return new AnonymousObservable(function (o) {
+ var first = true;
+ return scheduler.scheduleRecursiveWithState(initialState, function (state, self) {
+ var hasResult, result;
+ try {
+ if (first) {
+ first = false;
+ } else {
+ state = iterate(state);
+ }
+ hasResult = condition(state);
+ hasResult && (result = resultSelector(state));
+ } catch (e) {
+ return o.onError(e);
+ }
+ if (hasResult) {
+ o.onNext(result);
+ self(state);
+ } else {
+ o.onCompleted();
+ }
+ });
+ });
+ };
+
+ /**
+ * Constructs an observable sequence that depends on a resource object, whose lifetime is tied to the resulting observable sequence's lifetime.
+ * @param {Function} resourceFactory Factory function to obtain a resource object.
+ * @param {Function} observableFactory Factory function to obtain an observable sequence that depends on the obtained resource.
+ * @returns {Observable} An observable sequence whose lifetime controls the lifetime of the dependent resource object.
+ */
+ Observable.using = function (resourceFactory, observableFactory) {
+ return new AnonymousObservable(function (observer) {
+ var disposable = disposableEmpty, resource, source;
+ try {
+ resource = resourceFactory();
+ resource && (disposable = resource);
+ source = observableFactory(resource);
+ } catch (exception) {
+ return new CompositeDisposable(observableThrow(exception).subscribe(observer), disposable);
+ }
+ return new CompositeDisposable(source.subscribe(observer), disposable);
+ });
+ };
+
+ /**
+ * Propagates the observable sequence or Promise that reacts first.
+ * @param {Observable} rightSource Second observable sequence or Promise.
+ * @returns {Observable} {Observable} An observable sequence that surfaces either of the given sequences, whichever reacted first.
+ */
+ observableProto.amb = function (rightSource) {
+ var leftSource = this;
+ return new AnonymousObservable(function (observer) {
+ var choice,
+ leftChoice = 'L', rightChoice = 'R',
+ leftSubscription = new SingleAssignmentDisposable(),
+ rightSubscription = new SingleAssignmentDisposable();
+
+ isPromise(rightSource) && (rightSource = observableFromPromise(rightSource));
+
+ function choiceL() {
+ if (!choice) {
+ choice = leftChoice;
+ rightSubscription.dispose();
+ }
+ }
+
+ function choiceR() {
+ if (!choice) {
+ choice = rightChoice;
+ leftSubscription.dispose();
+ }
+ }
+
+ leftSubscription.setDisposable(leftSource.subscribe(function (left) {
+ choiceL();
+ choice === leftChoice && observer.onNext(left);
+ }, function (err) {
+ choiceL();
+ choice === leftChoice && observer.onError(err);
+ }, function () {
+ choiceL();
+ choice === leftChoice && observer.onCompleted();
+ }));
+
+ rightSubscription.setDisposable(rightSource.subscribe(function (right) {
+ choiceR();
+ choice === rightChoice && observer.onNext(right);
+ }, function (err) {
+ choiceR();
+ choice === rightChoice && observer.onError(err);
+ }, function () {
+ choiceR();
+ choice === rightChoice && observer.onCompleted();
+ }));
+
+ return new CompositeDisposable(leftSubscription, rightSubscription);
+ });
+ };
+
+ /**
+ * Propagates the observable sequence or Promise that reacts first.
+ *
+ * @example
+ * var = Rx.Observable.amb(xs, ys, zs);
+ * @returns {Observable} An observable sequence that surfaces any of the given sequences, whichever reacted first.
+ */
+ Observable.amb = function () {
+ var acc = observableNever(), items = [];
+ if (Array.isArray(arguments[0])) {
+ items = arguments[0];
+ } else {
+ for(var i = 0, len = arguments.length; i < len; i++) { items.push(arguments[i]); }
+ }
+
+ function func(previous, current) {
+ return previous.amb(current);
+ }
+ for (var i = 0, len = items.length; i < len; i++) {
+ acc = func(acc, items[i]);
+ }
+ return acc;
+ };
+
+ /**
+ * Continues an observable sequence that is terminated normally or by an exception with the next observable sequence.
+ * @param {Observable} second Second observable sequence used to produce results after the first sequence terminates.
+ * @returns {Observable} An observable sequence that concatenates the first and second sequence, even if the first sequence terminates exceptionally.
+ */
+ observableProto.onErrorResumeNext = function (second) {
+ if (!second) { throw new Error('Second observable is required'); }
+ return onErrorResumeNext([this, second]);
+ };
+
+ /**
+ * Continues an observable sequence that is terminated normally or by an exception with the next observable sequence.
+ *
+ * @example
+ * 1 - res = Rx.Observable.onErrorResumeNext(xs, ys, zs);
+ * 1 - res = Rx.Observable.onErrorResumeNext([xs, ys, zs]);
+ * @returns {Observable} An observable sequence that concatenates the source sequences, even if a sequence terminates exceptionally.
+ */
+ var onErrorResumeNext = Observable.onErrorResumeNext = function () {
+ var sources = [];
+ if (Array.isArray(arguments[0])) {
+ sources = arguments[0];
+ } else {
+ for(var i = 0, len = arguments.length; i < len; i++) { sources.push(arguments[i]); }
+ }
+ return new AnonymousObservable(function (observer) {
+ var pos = 0, subscription = new SerialDisposable(),
+ cancelable = immediateScheduler.scheduleRecursive(function (self) {
+ var current, d;
+ if (pos < sources.length) {
+ current = sources[pos++];
+ isPromise(current) && (current = observableFromPromise(current));
+ d = new SingleAssignmentDisposable();
+ subscription.setDisposable(d);
+ d.setDisposable(current.subscribe(observer.onNext.bind(observer), self, self));
+ } else {
+ observer.onCompleted();
+ }
+ });
+ return new CompositeDisposable(subscription, cancelable);
+ });
+ };
+
+ /**
+ * Projects each element of an observable sequence into zero or more buffers which are produced based on element count information.
+ *
+ * @example
+ * var res = xs.bufferWithCount(10);
+ * var res = xs.bufferWithCount(10, 1);
+ * @param {Number} count Length of each buffer.
+ * @param {Number} [skip] Number of elements to skip between creation of consecutive buffers. If not provided, defaults to the count.
+ * @returns {Observable} An observable sequence of buffers.
+ */
+ observableProto.bufferWithCount = function (count, skip) {
+ if (typeof skip !== 'number') {
+ skip = count;
+ }
+ return this.windowWithCount(count, skip).selectMany(function (x) {
+ return x.toArray();
+ }).where(function (x) {
+ return x.length > 0;
+ });
+ };
+
+ /**
+ * Projects each element of an observable sequence into zero or more windows which are produced based on element count information.
+ *
+ * var res = xs.windowWithCount(10);
+ * var res = xs.windowWithCount(10, 1);
+ * @param {Number} count Length of each window.
+ * @param {Number} [skip] Number of elements to skip between creation of consecutive windows. If not specified, defaults to the count.
+ * @returns {Observable} An observable sequence of windows.
+ */
+ observableProto.windowWithCount = function (count, skip) {
+ var source = this;
+ +count || (count = 0);
+ Math.abs(count) === Infinity && (count = 0);
+ if (count <= 0) { throw new ArgumentOutOfRangeError(); }
+ skip == null && (skip = count);
+ +skip || (skip = 0);
+ Math.abs(skip) === Infinity && (skip = 0);
+
+ if (skip <= 0) { throw new ArgumentOutOfRangeError(); }
+ return new AnonymousObservable(function (observer) {
+ var m = new SingleAssignmentDisposable(),
+ refCountDisposable = new RefCountDisposable(m),
+ n = 0,
+ q = [];
+
+ function createWindow () {
+ var s = new Subject();
+ q.push(s);
+ observer.onNext(addRef(s, refCountDisposable));
+ }
+
+ createWindow();
+
+ m.setDisposable(source.subscribe(
+ function (x) {
+ for (var i = 0, len = q.length; i < len; i++) { q[i].onNext(x); }
+ var c = n - count + 1;
+ c >= 0 && c % skip === 0 && q.shift().onCompleted();
+ ++n % skip === 0 && createWindow();
+ },
+ function (e) {
+ while (q.length > 0) { q.shift().onError(e); }
+ observer.onError(e);
+ },
+ function () {
+ while (q.length > 0) { q.shift().onCompleted(); }
+ observer.onCompleted();
+ }
+ ));
+ return refCountDisposable;
+ }, source);
+ };
+
+ /**
+ * Returns an array with the specified number of contiguous elements from the end of an observable sequence.
+ *
+ * @description
+ * This operator accumulates a buffer with a length enough to store count elements. Upon completion of the
+ * source sequence, this buffer is produced on the result sequence.
+ * @param {Number} count Number of elements to take from the end of the source sequence.
+ * @returns {Observable} An observable sequence containing a single array with the specified number of elements from the end of the source sequence.
+ */
+ observableProto.takeLastBuffer = function (count) {
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var q = [];
+ return source.subscribe(function (x) {
+ q.push(x);
+ q.length > count && q.shift();
+ }, function (e) { o.onError(e); }, function () {
+ o.onNext(q);
+ o.onCompleted();
+ });
+ }, source);
+ };
+
+ /**
+ * Returns the elements of the specified sequence or the specified value in a singleton sequence if the sequence is empty.
+ *
+ * var res = obs = xs.defaultIfEmpty();
+ * 2 - obs = xs.defaultIfEmpty(false);
+ *
+ * @memberOf Observable#
+ * @param defaultValue The value to return if the sequence is empty. If not provided, this defaults to null.
+ * @returns {Observable} An observable sequence that contains the specified default value if the source is empty; otherwise, the elements of the source itself.
+ */
+ observableProto.defaultIfEmpty = function (defaultValue) {
+ var source = this;
+ defaultValue === undefined && (defaultValue = null);
+ return new AnonymousObservable(function (observer) {
+ var found = false;
+ return source.subscribe(function (x) {
+ found = true;
+ observer.onNext(x);
+ },
+ function (e) { observer.onError(e); },
+ function () {
+ !found && observer.onNext(defaultValue);
+ observer.onCompleted();
+ });
+ }, source);
+ };
+
+ // Swap out for Array.findIndex
+ function arrayIndexOfComparer(array, item, comparer) {
+ for (var i = 0, len = array.length; i < len; i++) {
+ if (comparer(array[i], item)) { return i; }
+ }
+ return -1;
+ }
+
+ function HashSet(comparer) {
+ this.comparer = comparer;
+ this.set = [];
+ }
+ HashSet.prototype.push = function(value) {
+ var retValue = arrayIndexOfComparer(this.set, value, this.comparer) === -1;
+ retValue && this.set.push(value);
+ return retValue;
+ };
+
+ /**
+ * Returns an observable sequence that contains only distinct elements according to the keySelector and the comparer.
+ * Usage of this operator should be considered carefully due to the maintenance of an internal lookup structure which can grow large.
+ *
+ * @example
+ * var res = obs = xs.distinct();
+ * 2 - obs = xs.distinct(function (x) { return x.id; });
+ * 2 - obs = xs.distinct(function (x) { return x.id; }, function (a,b) { return a === b; });
+ * @param {Function} [keySelector] A function to compute the comparison key for each element.
+ * @param {Function} [comparer] Used to compare items in the collection.
+ * @returns {Observable} An observable sequence only containing the distinct elements, based on a computed key value, from the source sequence.
+ */
+ observableProto.distinct = function (keySelector, comparer) {
+ var source = this;
+ comparer || (comparer = defaultComparer);
+ return new AnonymousObservable(function (o) {
+ var hashSet = new HashSet(comparer);
+ return source.subscribe(function (x) {
+ var key = x;
+
+ if (keySelector) {
+ try {
+ key = keySelector(x);
+ } catch (e) {
+ o.onError(e);
+ return;
+ }
+ }
+ hashSet.push(key) && o.onNext(x);
+ },
+ function (e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, this);
+ };
+
+ /**
+ * Returns an observable sequence that shares a single subscription to the underlying sequence. This observable sequence
+ * can be resubscribed to, even if all prior subscriptions have ended. (unlike `.publish().refCount()`)
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source.
+ */
+ observableProto.singleInstance = function() {
+ var source = this, hasObservable = false, observable;
+
+ function getObservable() {
+ if (!hasObservable) {
+ hasObservable = true;
+ observable = source.finally(function() { hasObservable = false; }).publish().refCount();
+ }
+ return observable;
+ };
+
+ return new AnonymousObservable(function(o) {
+ return getObservable().subscribe(o);
+ });
+ };
+
+ return Rx;
+}));
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.extras.map b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.extras.map
new file mode 100644
index 00000000000..308e9ae5b90
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.extras.map
@@ -0,0 +1 @@
+{"version":3,"file":"rx.lite.extras.min.js","sources":["rx.lite.extras.js"],"names":["factory","objectTypes","boolean","function","object","number","string","undefined","root","window","this","freeExports","exports","nodeType","freeModule","module","freeGlobal","global","define","amd","Rx","require","call","exp","ScheduledDisposable","scheduler","disposable","isDisposed","scheduleItem","s","self","dispose","arrayIndexOfComparer","array","item","comparer","i","len","length","HashSet","set","Observable","observableProto","prototype","observableNever","never","observableThrow","throwException","AnonymousObservable","AnonymousObserver","notificationCreateOnNext","Notification","createOnNext","notificationCreateOnError","createOnError","notificationCreateOnCompleted","createOnCompleted","Observer","Subject","internals","helpers","ScheduledObserver","SerialDisposable","SingleAssignmentDisposable","CompositeDisposable","RefCountDisposable","disposableEmpty","Disposable","empty","immediateScheduler","Scheduler","immediate","addRef","defaultKeySerializer","isPromise","identity","inherits","bindCallback","isScheduler","noop","observableFromPromise","fromPromise","ArgumentOutOfRangeError","scheduleWithState","CheckedObserver","__super__","observer","_observer","_state","CheckedObserverPrototype","onNext","value","checkAccess","res","tryCatch","errorObj","thrower","e","onError","err","onCompleted","Error","ObserveOnObserver","cancel","_cancel","next","ensureActive","error","completed","checked","notifyOn","fromNotifier","handler","thisArg","handlerFunc","x","toNotifier","n","accept","asObserver","source","observeOn","subscribe","subscribeOn","m","d","setDisposable","schedule","generate","initialState","condition","iterate","resultSelector","currentThreadScheduler","o","first","scheduleRecursiveWithState","state","hasResult","result","using","resourceFactory","observableFactory","resource","exception","amb","rightSource","leftSource","choiceL","choice","leftChoice","rightSubscription","choiceR","rightChoice","leftSubscription","left","right","func","previous","current","acc","items","Array","isArray","arguments","push","onErrorResumeNext","second","sources","pos","subscription","cancelable","scheduleRecursive","bind","bufferWithCount","count","skip","windowWithCount","selectMany","toArray","where","Math","abs","Infinity","createWindow","q","refCountDisposable","c","shift","takeLastBuffer","defaultIfEmpty","defaultValue","found","retValue","distinct","keySelector","defaultComparer","hashSet","key","singleInstance","getObservable","hasObservable","observable","publish","refCount"],"mappings":";CAEE,SAAUA,GACR,GAAIC,IACAC,WAAW,EACXC,YAAY,EACZC,QAAU,EACVC,QAAU,EACVC,QAAU,EACVC,WAAa,GAGbC,EAAQP,QAAmBQ,UAAWA,QAAWC,KACjDC,EAAcV,QAAmBW,WAAYA,UAAYA,QAAQC,UAAYD,QAC7EE,EAAab,QAAmBc,UAAWA,SAAWA,OAAOF,UAAYE,OAEzEC,GADgBF,GAAcA,EAAWF,UAAYD,GAAeA,EACvDV,QAAmBgB,UAAWA,SAE3CD,GAAeA,EAAWC,SAAWD,GAAcA,EAAWP,SAAWO,IACzER,EAAOQ,GAIW,kBAAXE,SAAyBA,OAAOC,IACvCD,QAAQ,WAAY,SAAUE,EAAIR,GAC9B,MAAOZ,GAAQQ,EAAMI,EAASQ,KAET,gBAAXL,SAAuBA,QAAUA,OAAOH,UAAYD,EAClEI,OAAOH,QAAUZ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AK1E,GACnBsG,GAeTvJ,EAAgBwJ,SAAW,SAAUC,EAAahK,GAChD,GAAIqF,GAAS9G,IAEb,OADAyB,KAAaA,EAAWiK,iBACjB,GAAIpJ,GAAoB,SAAUsF,GACvC,GAAI+D,GAAU,GAAI9J,GAAQJ,EAC1B,OAAOqF,GAAOE,UAAU,SAAUP,GAChC,GAAImF,GAAMnF,CAEV,IAAIgF,EACF,IACEG,EAAMH,EAAYhF,GAClB,MAAOlB,GAEP,WADAqC,GAAEpC,QAAQD,GAIdoG,EAAQhC,KAAKiC,IAAQhE,EAAE5C,OAAOyB,IAEhC,SAAUlB,GAAKqC,EAAEpC,QAAQD,IAAO,WAAcqC,EAAElC,iBAC/C1F,OAQLgC,EAAgB6J,eAAiB,WAG/B,QAASC,KAKP,MAJKC,KACHA,GAAgB,EAChBC,EAAalF,EAAAA,WAAe,WAAaiF,GAAgB,IAAUE,UAAUC,YAExEF,EAPT,GAA0CA,GAAtClF,EAAS9G,KAAM+L,GAAgB,CAUnC,OAAO,IAAIzJ,GAAoB,SAASsF,GACtC,MAAOkE,KAAgB9E,UAAUY,MAI5BlH"} \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.extras.min.js b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.extras.min.js
new file mode 100644
index 00000000000..21611498d6f
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.extras.min.js
@@ -0,0 +1,3 @@
+/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
+(function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx-lite"],function(b,d){return a(c,d,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("rx-lite")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){function e(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function f(a,b){b.isDisposed||(b.isDisposed=!0,b.disposable.dispose())}function g(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function h(a){this.comparer=a,this.set=[]}var i=c.Observable,j=i.prototype,k=i.never,l=i.throwException,m=c.AnonymousObservable,n=c.AnonymousObserver,o=c.Notification.createOnNext,p=c.Notification.createOnError,q=c.Notification.createOnCompleted,r=c.Observer,s=c.Subject,t=c.internals,u=c.helpers,v=t.ScheduledObserver,w=c.SerialDisposable,x=c.SingleAssignmentDisposable,y=c.CompositeDisposable,z=c.RefCountDisposable,A=c.Disposable.empty,B=c.Scheduler.immediate,C=(u.defaultKeySerializer,c.internals.addRef),D=(u.identity,u.isPromise),E=t.inherits,F=t.bindCallback,G=(u.noop,c.Scheduler.isScheduler),H=i.fromPromise,I=c.ArgumentOutOfRangeError;e.prototype.dispose=function(){this.scheduler.scheduleWithState(this,f)};var J=function(a){function b(b){a.call(this),this._observer=b,this._state=0}E(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();var b=tryCatch(this._observer.onNext).call(this._observer,a);this._state=0,b===errorObj&&thrower(b.e)},c.onError=function(a){this.checkAccess();var b=tryCatch(this._observer.onError).call(this._observer,a);this._state=2,b===errorObj&&thrower(b.e)},c.onCompleted=function(){this.checkAccess();var a=tryCatch(this._observer.onCompleted).call(this._observer);this._state=2,a===errorObj&&thrower(a.e)},c.checkAccess=function(){if(1===this._state)throw new Error("Re-entrancy detected");if(2===this._state)throw new Error("Observer completed");0===this._state&&(this._state=1)},b}(r),K=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return E(b,a),b.prototype.next=function(b){a.prototype.next.call(this,b),this.ensureActive()},b.prototype.error=function(b){a.prototype.error.call(this,b),this.ensureActive()},b.prototype.completed=function(){a.prototype.completed.call(this),this.ensureActive()},b.prototype.dispose=function(){a.prototype.dispose.call(this),this._cancel&&this._cancel.dispose(),this._cancel=null},b}(v);r.prototype.checked=function(){return new J(this)},r.notifyOn=function(a){return new K(a,this)},r.fromNotifier=function(a,b){var c=F(a,b,1);return new n(function(a){return c(o(a))},function(a){return c(p(a))},function(){return c(q())})},r.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},r.prototype.asObserver=function(){var a=this;return new n(function(b){a.onNext(b)},function(b){a.onError(b)},function(){a.onCompleted()})},j.observeOn=function(a){var b=this;return new m(function(c){return b.subscribe(new K(a,c))},b)},j.subscribeOn=function(a){var b=this;return new m(function(c){var d=new x,f=new w;return f.setDisposable(d),d.setDisposable(a.schedule(function(){f.setDisposable(new e(a,b.subscribe(c)))})),f},b)},i.generate=function(a,b,c,d,e){return G(e)||(e=currentThreadScheduler),new m(function(f){var g=!0;return e.scheduleRecursiveWithState(a,function(a,e){var h,i;try{g?g=!1:a=c(a),h=b(a),h&&(i=d(a))}catch(j){return f.onError(j)}h?(f.onNext(i),e(a)):f.onCompleted()})})},i.using=function(a,b){return new m(function(c){var d,e,f=A;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new y(l(g).subscribe(c),f)}return new y(e.subscribe(c),f)})},j.amb=function(a){var b=this;return new m(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new x,j=new x;return D(a)&&(a=H(a)),i.setDisposable(b.subscribe(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()})),j.setDisposable(a.subscribe(function(a){e(),f===h&&c.onNext(a)},function(a){e(),f===h&&c.onError(a)},function(){e(),f===h&&c.onCompleted()})),new y(i,j)})},i.amb=function(){function a(a,b){return a.amb(b)}var b=k(),c=[];if(Array.isArray(arguments[0]))c=arguments[0];else for(var d=0,e=arguments.length;e>d;d++)c.push(arguments[d]);for(var d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},j.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return L([this,a])};var L=i.onErrorResumeNext=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return new m(function(b){var c=0,d=new w,e=B.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],D(f)&&(f=H(f)),g=new x,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new y(d,e)})};return j.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).selectMany(function(a){return a.toArray()}).where(function(a){return a.length>0})},j.windowWithCount=function(a,b){var c=this;if(+a||(a=0),Math.abs(a)===1/0&&(a=0),0>=a)throw new I;if(null==b&&(b=a),+b||(b=0),Math.abs(b)===1/0&&(b=0),0>=b)throw new I;return new m(function(d){function e(){var a=new s;i.push(a),d.onNext(C(a,g))}var f=new x,g=new z(f),h=0,i=[];return e(),f.setDisposable(c.subscribe(function(c){for(var d=0,f=i.length;f>d;d++)i[d].onNext(c);var g=h-a+1;g>=0&&g%b===0&&i.shift().onCompleted(),++h%b===0&&e()},function(a){for(;i.length>0;)i.shift().onError(a);d.onError(a)},function(){for(;i.length>0;)i.shift().onCompleted();d.onCompleted()})),g},c)},j.takeLastBuffer=function(a){var b=this;return new m(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},function(a){c.onError(a)},function(){c.onNext(d),c.onCompleted()})},b)},j.defaultIfEmpty=function(a){var b=this;return a===d&&(a=null),new m(function(c){var d=!1;return b.subscribe(function(a){d=!0,c.onNext(a)},function(a){c.onError(a)},function(){!d&&c.onNext(a),c.onCompleted()})},b)},h.prototype.push=function(a){var b=-1===g(this.set,a,this.comparer);return b&&this.set.push(a),b},j.distinct=function(a,b){var c=this;return b||(b=defaultComparer),new m(function(d){var e=new h(b);return c.subscribe(function(b){var c=b;if(a)try{c=a(b)}catch(f){return void d.onError(f)}e.push(c)&&d.onNext(b)},function(a){d.onError(a)},function(){d.onCompleted()})},this)},j.singleInstance=function(){function a(){return d||(d=!0,b=c["finally"](function(){d=!1}).publish().refCount()),b}var b,c=this,d=!1;return new m(function(b){return a().subscribe(b)})},c});
+//# sourceMappingURL=rx.lite.extras.map \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.js b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.js
new file mode 100644
index 00000000000..cecf40454c3
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.js
@@ -0,0 +1,6263 @@
+// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
+
+;(function (undefined) {
+
+ var objectTypes = {
+ 'boolean': false,
+ 'function': true,
+ 'object': true,
+ 'number': false,
+ 'string': false,
+ 'undefined': false
+ };
+
+ var root = (objectTypes[typeof window] && window) || this,
+ freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
+ freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
+ moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
+ freeGlobal = objectTypes[typeof global] && global;
+
+ if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) {
+ root = freeGlobal;
+ }
+
+ var Rx = {
+ internals: {},
+ config: {
+ Promise: root.Promise
+ },
+ helpers: { }
+ };
+
+ // Defaults
+ var noop = Rx.helpers.noop = function () { },
+ notDefined = Rx.helpers.notDefined = function (x) { return typeof x === 'undefined'; },
+ identity = Rx.helpers.identity = function (x) { return x; },
+ pluck = Rx.helpers.pluck = function (property) { return function (x) { return x[property]; }; },
+ just = Rx.helpers.just = function (value) { return function () { return value; }; },
+ defaultNow = Rx.helpers.defaultNow = Date.now,
+ defaultComparer = Rx.helpers.defaultComparer = function (x, y) { return isEqual(x, y); },
+ defaultSubComparer = Rx.helpers.defaultSubComparer = function (x, y) { return x > y ? 1 : (x < y ? -1 : 0); },
+ defaultKeySerializer = Rx.helpers.defaultKeySerializer = function (x) { return x.toString(); },
+ defaultError = Rx.helpers.defaultError = function (err) { throw err; },
+ isPromise = Rx.helpers.isPromise = function (p) { return !!p && typeof p.subscribe !== 'function' && typeof p.then === 'function'; },
+ asArray = Rx.helpers.asArray = function () { return Array.prototype.slice.call(arguments); },
+ not = Rx.helpers.not = function (a) { return !a; },
+ isFunction = Rx.helpers.isFunction = (function () {
+
+ var isFn = function (value) {
+ return typeof value == 'function' || false;
+ }
+
+ // fallback for older versions of Chrome and Safari
+ if (isFn(/x/)) {
+ isFn = function(value) {
+ return typeof value == 'function' && toString.call(value) == '[object Function]';
+ };
+ }
+
+ return isFn;
+ }());
+
+ function cloneArray(arr) {
+ var len = arr.length, a = new Array(len);
+ for(var i = 0; i < len; i++) { a[i] = arr[i]; }
+ return a;
+ }
+
+ Rx.config.longStackSupport = false;
+ var hasStacks = false;
+ try {
+ throw new Error();
+ } catch (e) {
+ hasStacks = !!e.stack;
+ }
+
+ // All code after this point will be filtered from stack traces reported by RxJS
+ var rStartingLine = captureLine(), rFileName;
+
+ var STACK_JUMP_SEPARATOR = "From previous event:";
+
+ function makeStackTraceLong(error, observable) {
+ // If possible, transform the error stack trace by removing Node and RxJS
+ // cruft, then concatenating with the stack trace of `observable`.
+ if (hasStacks &&
+ observable.stack &&
+ typeof error === "object" &&
+ error !== null &&
+ error.stack &&
+ error.stack.indexOf(STACK_JUMP_SEPARATOR) === -1
+ ) {
+ var stacks = [];
+ for (var o = observable; !!o; o = o.source) {
+ if (o.stack) {
+ stacks.unshift(o.stack);
+ }
+ }
+ stacks.unshift(error.stack);
+
+ var concatedStacks = stacks.join("\n" + STACK_JUMP_SEPARATOR + "\n");
+ error.stack = filterStackString(concatedStacks);
+ }
+ }
+
+ function filterStackString(stackString) {
+ var lines = stackString.split("\n"),
+ desiredLines = [];
+ for (var i = 0, len = lines.length; i < len; i++) {
+ var line = lines[i];
+
+ if (!isInternalFrame(line) && !isNodeFrame(line) && line) {
+ desiredLines.push(line);
+ }
+ }
+ return desiredLines.join("\n");
+ }
+
+ function isInternalFrame(stackLine) {
+ var fileNameAndLineNumber = getFileNameAndLineNumber(stackLine);
+ if (!fileNameAndLineNumber) {
+ return false;
+ }
+ var fileName = fileNameAndLineNumber[0], lineNumber = fileNameAndLineNumber[1];
+
+ return fileName === rFileName &&
+ lineNumber >= rStartingLine &&
+ lineNumber <= rEndingLine;
+ }
+
+ function isNodeFrame(stackLine) {
+ return stackLine.indexOf("(module.js:") !== -1 ||
+ stackLine.indexOf("(node.js:") !== -1;
+ }
+
+ function captureLine() {
+ if (!hasStacks) { return; }
+
+ try {
+ throw new Error();
+ } catch (e) {
+ var lines = e.stack.split("\n");
+ var firstLine = lines[0].indexOf("@") > 0 ? lines[1] : lines[2];
+ var fileNameAndLineNumber = getFileNameAndLineNumber(firstLine);
+ if (!fileNameAndLineNumber) { return; }
+
+ rFileName = fileNameAndLineNumber[0];
+ return fileNameAndLineNumber[1];
+ }
+ }
+
+ function getFileNameAndLineNumber(stackLine) {
+ // Named functions: "at functionName (filename:lineNumber:columnNumber)"
+ var attempt1 = /at .+ \((.+):(\d+):(?:\d+)\)$/.exec(stackLine);
+ if (attempt1) { return [attempt1[1], Number(attempt1[2])]; }
+
+ // Anonymous functions: "at filename:lineNumber:columnNumber"
+ var attempt2 = /at ([^ ]+):(\d+):(?:\d+)$/.exec(stackLine);
+ if (attempt2) { return [attempt2[1], Number(attempt2[2])]; }
+
+ // Firefox style: "function@filename:lineNumber or @filename:lineNumber"
+ var attempt3 = /.*@(.+):(\d+)$/.exec(stackLine);
+ if (attempt3) { return [attempt3[1], Number(attempt3[2])]; }
+ }
+
+ var EmptyError = Rx.EmptyError = function() {
+ this.message = 'Sequence contains no elements.';
+ Error.call(this);
+ };
+ EmptyError.prototype = Error.prototype;
+
+ var ObjectDisposedError = Rx.ObjectDisposedError = function() {
+ this.message = 'Object has been disposed';
+ Error.call(this);
+ };
+ ObjectDisposedError.prototype = Error.prototype;
+
+ var ArgumentOutOfRangeError = Rx.ArgumentOutOfRangeError = function () {
+ this.message = 'Argument out of range';
+ Error.call(this);
+ };
+ ArgumentOutOfRangeError.prototype = Error.prototype;
+
+ var NotSupportedError = Rx.NotSupportedError = function (message) {
+ this.message = message || 'This operation is not supported';
+ Error.call(this);
+ };
+ NotSupportedError.prototype = Error.prototype;
+
+ var NotImplementedError = Rx.NotImplementedError = function (message) {
+ this.message = message || 'This operation is not implemented';
+ Error.call(this);
+ };
+ NotImplementedError.prototype = Error.prototype;
+
+ var notImplemented = Rx.helpers.notImplemented = function () {
+ throw new NotImplementedError();
+ };
+
+ var notSupported = Rx.helpers.notSupported = function () {
+ throw new NotSupportedError();
+ };
+
+ // Shim in iterator support
+ var $iterator$ = (typeof Symbol === 'function' && Symbol.iterator) ||
+ '_es6shim_iterator_';
+ // Bug for mozilla version
+ if (root.Set && typeof new root.Set()['@@iterator'] === 'function') {
+ $iterator$ = '@@iterator';
+ }
+
+ var doneEnumerator = Rx.doneEnumerator = { done: true, value: undefined };
+
+ var isIterable = Rx.helpers.isIterable = function (o) {
+ return o[$iterator$] !== undefined;
+ }
+
+ var isArrayLike = Rx.helpers.isArrayLike = function (o) {
+ return o && o.length !== undefined;
+ }
+
+ Rx.helpers.iterator = $iterator$;
+
+ var bindCallback = Rx.internals.bindCallback = function (func, thisArg, argCount) {
+ if (typeof thisArg === 'undefined') { return func; }
+ switch(argCount) {
+ case 0:
+ return function() {
+ return func.call(thisArg)
+ };
+ case 1:
+ return function(arg) {
+ return func.call(thisArg, arg);
+ }
+ case 2:
+ return function(value, index) {
+ return func.call(thisArg, value, index);
+ };
+ case 3:
+ return function(value, index, collection) {
+ return func.call(thisArg, value, index, collection);
+ };
+ }
+
+ return function() {
+ return func.apply(thisArg, arguments);
+ };
+ };
+
+ /** Used to determine if values are of the language type Object */
+ var dontEnums = ['toString',
+ 'toLocaleString',
+ 'valueOf',
+ 'hasOwnProperty',
+ 'isPrototypeOf',
+ 'propertyIsEnumerable',
+ 'constructor'],
+ dontEnumsLength = dontEnums.length;
+
+ /** `Object#toString` result shortcuts */
+ var argsClass = '[object Arguments]',
+ arrayClass = '[object Array]',
+ boolClass = '[object Boolean]',
+ dateClass = '[object Date]',
+ errorClass = '[object Error]',
+ funcClass = '[object Function]',
+ numberClass = '[object Number]',
+ objectClass = '[object Object]',
+ regexpClass = '[object RegExp]',
+ stringClass = '[object String]';
+
+ var toString = Object.prototype.toString,
+ hasOwnProperty = Object.prototype.hasOwnProperty,
+ supportsArgsClass = toString.call(arguments) == argsClass, // For less <IE9 && FF<4
+ supportNodeClass,
+ errorProto = Error.prototype,
+ objectProto = Object.prototype,
+ stringProto = String.prototype,
+ propertyIsEnumerable = objectProto.propertyIsEnumerable;
+
+ try {
+ supportNodeClass = !(toString.call(document) == objectClass && !({ 'toString': 0 } + ''));
+ } catch (e) {
+ supportNodeClass = true;
+ }
+
+ var nonEnumProps = {};
+ nonEnumProps[arrayClass] = nonEnumProps[dateClass] = nonEnumProps[numberClass] = { 'constructor': true, 'toLocaleString': true, 'toString': true, 'valueOf': true };
+ nonEnumProps[boolClass] = nonEnumProps[stringClass] = { 'constructor': true, 'toString': true, 'valueOf': true };
+ nonEnumProps[errorClass] = nonEnumProps[funcClass] = nonEnumProps[regexpClass] = { 'constructor': true, 'toString': true };
+ nonEnumProps[objectClass] = { 'constructor': true };
+
+ var support = {};
+ (function () {
+ var ctor = function() { this.x = 1; },
+ props = [];
+
+ ctor.prototype = { 'valueOf': 1, 'y': 1 };
+ for (var key in new ctor) { props.push(key); }
+ for (key in arguments) { }
+
+ // Detect if `name` or `message` properties of `Error.prototype` are enumerable by default.
+ support.enumErrorProps = propertyIsEnumerable.call(errorProto, 'message') || propertyIsEnumerable.call(errorProto, 'name');
+
+ // Detect if `prototype` properties are enumerable by default.
+ support.enumPrototypes = propertyIsEnumerable.call(ctor, 'prototype');
+
+ // Detect if `arguments` object indexes are non-enumerable
+ support.nonEnumArgs = key != 0;
+
+ // Detect if properties shadowing those on `Object.prototype` are non-enumerable.
+ support.nonEnumShadows = !/valueOf/.test(props);
+ }(1));
+
+ var isObject = Rx.internals.isObject = function(value) {
+ var type = typeof value;
+ return value && (type == 'function' || type == 'object') || false;
+ };
+
+ function keysIn(object) {
+ var result = [];
+ if (!isObject(object)) {
+ return result;
+ }
+ if (support.nonEnumArgs && object.length && isArguments(object)) {
+ object = slice.call(object);
+ }
+ var skipProto = support.enumPrototypes && typeof object == 'function',
+ skipErrorProps = support.enumErrorProps && (object === errorProto || object instanceof Error);
+
+ for (var key in object) {
+ if (!(skipProto && key == 'prototype') &&
+ !(skipErrorProps && (key == 'message' || key == 'name'))) {
+ result.push(key);
+ }
+ }
+
+ if (support.nonEnumShadows && object !== objectProto) {
+ var ctor = object.constructor,
+ index = -1,
+ length = dontEnumsLength;
+
+ if (object === (ctor && ctor.prototype)) {
+ var className = object === stringProto ? stringClass : object === errorProto ? errorClass : toString.call(object),
+ nonEnum = nonEnumProps[className];
+ }
+ while (++index < length) {
+ key = dontEnums[index];
+ if (!(nonEnum && nonEnum[key]) && hasOwnProperty.call(object, key)) {
+ result.push(key);
+ }
+ }
+ }
+ return result;
+ }
+
+ function internalFor(object, callback, keysFunc) {
+ var index = -1,
+ props = keysFunc(object),
+ length = props.length;
+
+ while (++index < length) {
+ var key = props[index];
+ if (callback(object[key], key, object) === false) {
+ break;
+ }
+ }
+ return object;
+ }
+
+ function internalForIn(object, callback) {
+ return internalFor(object, callback, keysIn);
+ }
+
+ function isNode(value) {
+ // IE < 9 presents DOM nodes as `Object` objects except they have `toString`
+ // methods that are `typeof` "string" and still can coerce nodes to strings
+ return typeof value.toString != 'function' && typeof (value + '') == 'string';
+ }
+
+ var isArguments = function(value) {
+ return (value && typeof value == 'object') ? toString.call(value) == argsClass : false;
+ }
+
+ // fallback for browsers that can't detect `arguments` objects by [[Class]]
+ if (!supportsArgsClass) {
+ isArguments = function(value) {
+ return (value && typeof value == 'object') ? hasOwnProperty.call(value, 'callee') : false;
+ };
+ }
+
+ var isEqual = Rx.internals.isEqual = function (x, y) {
+ return deepEquals(x, y, [], []);
+ };
+
+ /** @private
+ * Used for deep comparison
+ **/
+ function deepEquals(a, b, stackA, stackB) {
+ // exit early for identical values
+ if (a === b) {
+ // treat `+0` vs. `-0` as not equal
+ return a !== 0 || (1 / a == 1 / b);
+ }
+
+ var type = typeof a,
+ otherType = typeof b;
+
+ // exit early for unlike primitive values
+ if (a === a && (a == null || b == null ||
+ (type != 'function' && type != 'object' && otherType != 'function' && otherType != 'object'))) {
+ return false;
+ }
+
+ // compare [[Class]] names
+ var className = toString.call(a),
+ otherClass = toString.call(b);
+
+ if (className == argsClass) {
+ className = objectClass;
+ }
+ if (otherClass == argsClass) {
+ otherClass = objectClass;
+ }
+ if (className != otherClass) {
+ return false;
+ }
+ switch (className) {
+ case boolClass:
+ case dateClass:
+ // coerce dates and booleans to numbers, dates to milliseconds and booleans
+ // to `1` or `0` treating invalid dates coerced to `NaN` as not equal
+ return +a == +b;
+
+ case numberClass:
+ // treat `NaN` vs. `NaN` as equal
+ return (a != +a) ?
+ b != +b :
+ // but treat `-0` vs. `+0` as not equal
+ (a == 0 ? (1 / a == 1 / b) : a == +b);
+
+ case regexpClass:
+ case stringClass:
+ // coerce regexes to strings (http://es5.github.io/#x15.10.6.4)
+ // treat string primitives and their corresponding object instances as equal
+ return a == String(b);
+ }
+ var isArr = className == arrayClass;
+ if (!isArr) {
+
+ // exit for functions and DOM nodes
+ if (className != objectClass || (!support.nodeClass && (isNode(a) || isNode(b)))) {
+ return false;
+ }
+ // in older versions of Opera, `arguments` objects have `Array` constructors
+ var ctorA = !support.argsObject && isArguments(a) ? Object : a.constructor,
+ ctorB = !support.argsObject && isArguments(b) ? Object : b.constructor;
+
+ // non `Object` object instances with different constructors are not equal
+ if (ctorA != ctorB &&
+ !(hasOwnProperty.call(a, 'constructor') && hasOwnProperty.call(b, 'constructor')) &&
+ !(isFunction(ctorA) && ctorA instanceof ctorA && isFunction(ctorB) && ctorB instanceof ctorB) &&
+ ('constructor' in a && 'constructor' in b)
+ ) {
+ return false;
+ }
+ }
+ // assume cyclic structures are equal
+ // the algorithm for detecting cyclic structures is adapted from ES 5.1
+ // section 15.12.3, abstract operation `JO` (http://es5.github.io/#x15.12.3)
+ var initedStack = !stackA;
+ stackA || (stackA = []);
+ stackB || (stackB = []);
+
+ var length = stackA.length;
+ while (length--) {
+ if (stackA[length] == a) {
+ return stackB[length] == b;
+ }
+ }
+ var size = 0;
+ var result = true;
+
+ // add `a` and `b` to the stack of traversed objects
+ stackA.push(a);
+ stackB.push(b);
+
+ // recursively compare objects and arrays (susceptible to call stack limits)
+ if (isArr) {
+ // compare lengths to determine if a deep comparison is necessary
+ length = a.length;
+ size = b.length;
+ result = size == length;
+
+ if (result) {
+ // deep compare the contents, ignoring non-numeric properties
+ while (size--) {
+ var index = length,
+ value = b[size];
+
+ if (!(result = deepEquals(a[size], value, stackA, stackB))) {
+ break;
+ }
+ }
+ }
+ }
+ else {
+ // deep compare objects using `forIn`, instead of `forOwn`, to avoid `Object.keys`
+ // which, in this case, is more costly
+ internalForIn(b, function(value, key, b) {
+ if (hasOwnProperty.call(b, key)) {
+ // count the number of properties.
+ size++;
+ // deep compare each property value.
+ return (result = hasOwnProperty.call(a, key) && deepEquals(a[key], value, stackA, stackB));
+ }
+ });
+
+ if (result) {
+ // ensure both objects have the same number of properties
+ internalForIn(a, function(value, key, a) {
+ if (hasOwnProperty.call(a, key)) {
+ // `size` will be `-1` if `a` has more properties than `b`
+ return (result = --size > -1);
+ }
+ });
+ }
+ }
+ stackA.pop();
+ stackB.pop();
+
+ return result;
+ }
+
+ var errorObj = {e: {}};
+ var tryCatchTarget;
+ function tryCatcher() {
+ try {
+ return tryCatchTarget.apply(this, arguments);
+ } catch (e) {
+ errorObj.e = e;
+ return errorObj;
+ }
+ }
+ function tryCatch(fn) {
+ if (!isFunction(fn)) { throw new TypeError('fn must be a function'); }
+ tryCatchTarget = fn;
+ return tryCatcher;
+ }
+ function thrower(e) {
+ throw e;
+ }
+
+ var hasProp = {}.hasOwnProperty,
+ slice = Array.prototype.slice;
+
+ var inherits = this.inherits = Rx.internals.inherits = function (child, parent) {
+ function __() { this.constructor = child; }
+ __.prototype = parent.prototype;
+ child.prototype = new __();
+ };
+
+ var addProperties = Rx.internals.addProperties = function (obj) {
+ for(var sources = [], i = 1, len = arguments.length; i < len; i++) { sources.push(arguments[i]); }
+ for (var idx = 0, ln = sources.length; idx < ln; idx++) {
+ var source = sources[idx];
+ for (var prop in source) {
+ obj[prop] = source[prop];
+ }
+ }
+ };
+
+ // Rx Utils
+ var addRef = Rx.internals.addRef = function (xs, r) {
+ return new AnonymousObservable(function (observer) {
+ return new CompositeDisposable(r.getDisposable(), xs.subscribe(observer));
+ });
+ };
+
+ function arrayInitialize(count, factory) {
+ var a = new Array(count);
+ for (var i = 0; i < count; i++) {
+ a[i] = factory();
+ }
+ return a;
+ }
+
+ // Collections
+ function IndexedItem(id, value) {
+ this.id = id;
+ this.value = value;
+ }
+
+ IndexedItem.prototype.compareTo = function (other) {
+ var c = this.value.compareTo(other.value);
+ c === 0 && (c = this.id - other.id);
+ return c;
+ };
+
+ // Priority Queue for Scheduling
+ var PriorityQueue = Rx.internals.PriorityQueue = function (capacity) {
+ this.items = new Array(capacity);
+ this.length = 0;
+ };
+
+ var priorityProto = PriorityQueue.prototype;
+ priorityProto.isHigherPriority = function (left, right) {
+ return this.items[left].compareTo(this.items[right]) < 0;
+ };
+
+ priorityProto.percolate = function (index) {
+ if (index >= this.length || index < 0) { return; }
+ var parent = index - 1 >> 1;
+ if (parent < 0 || parent === index) { return; }
+ if (this.isHigherPriority(index, parent)) {
+ var temp = this.items[index];
+ this.items[index] = this.items[parent];
+ this.items[parent] = temp;
+ this.percolate(parent);
+ }
+ };
+
+ priorityProto.heapify = function (index) {
+ +index || (index = 0);
+ if (index >= this.length || index < 0) { return; }
+ var left = 2 * index + 1,
+ right = 2 * index + 2,
+ first = index;
+ if (left < this.length && this.isHigherPriority(left, first)) {
+ first = left;
+ }
+ if (right < this.length && this.isHigherPriority(right, first)) {
+ first = right;
+ }
+ if (first !== index) {
+ var temp = this.items[index];
+ this.items[index] = this.items[first];
+ this.items[first] = temp;
+ this.heapify(first);
+ }
+ };
+
+ priorityProto.peek = function () { return this.items[0].value; };
+
+ priorityProto.removeAt = function (index) {
+ this.items[index] = this.items[--this.length];
+ this.items[this.length] = undefined;
+ this.heapify();
+ };
+
+ priorityProto.dequeue = function () {
+ var result = this.peek();
+ this.removeAt(0);
+ return result;
+ };
+
+ priorityProto.enqueue = function (item) {
+ var index = this.length++;
+ this.items[index] = new IndexedItem(PriorityQueue.count++, item);
+ this.percolate(index);
+ };
+
+ priorityProto.remove = function (item) {
+ for (var i = 0; i < this.length; i++) {
+ if (this.items[i].value === item) {
+ this.removeAt(i);
+ return true;
+ }
+ }
+ return false;
+ };
+ PriorityQueue.count = 0;
+
+ /**
+ * Represents a group of disposable resources that are disposed together.
+ * @constructor
+ */
+ var CompositeDisposable = Rx.CompositeDisposable = function () {
+ var args = [], i, len;
+ if (Array.isArray(arguments[0])) {
+ args = arguments[0];
+ len = args.length;
+ } else {
+ len = arguments.length;
+ args = new Array(len);
+ for(i = 0; i < len; i++) { args[i] = arguments[i]; }
+ }
+ for(i = 0; i < len; i++) {
+ if (!isDisposable(args[i])) { throw new TypeError('Not a disposable'); }
+ }
+ this.disposables = args;
+ this.isDisposed = false;
+ this.length = args.length;
+ };
+
+ var CompositeDisposablePrototype = CompositeDisposable.prototype;
+
+ /**
+ * Adds a disposable to the CompositeDisposable or disposes the disposable if the CompositeDisposable is disposed.
+ * @param {Mixed} item Disposable to add.
+ */
+ CompositeDisposablePrototype.add = function (item) {
+ if (this.isDisposed) {
+ item.dispose();
+ } else {
+ this.disposables.push(item);
+ this.length++;
+ }
+ };
+
+ /**
+ * Removes and disposes the first occurrence of a disposable from the CompositeDisposable.
+ * @param {Mixed} item Disposable to remove.
+ * @returns {Boolean} true if found; false otherwise.
+ */
+ CompositeDisposablePrototype.remove = function (item) {
+ var shouldDispose = false;
+ if (!this.isDisposed) {
+ var idx = this.disposables.indexOf(item);
+ if (idx !== -1) {
+ shouldDispose = true;
+ this.disposables.splice(idx, 1);
+ this.length--;
+ item.dispose();
+ }
+ }
+ return shouldDispose;
+ };
+
+ /**
+ * Disposes all disposables in the group and removes them from the group.
+ */
+ CompositeDisposablePrototype.dispose = function () {
+ if (!this.isDisposed) {
+ this.isDisposed = true;
+ var len = this.disposables.length, currentDisposables = new Array(len);
+ for(var i = 0; i < len; i++) { currentDisposables[i] = this.disposables[i]; }
+ this.disposables = [];
+ this.length = 0;
+
+ for (i = 0; i < len; i++) {
+ currentDisposables[i].dispose();
+ }
+ }
+ };
+
+ /**
+ * Provides a set of static methods for creating Disposables.
+ * @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once.
+ */
+ var Disposable = Rx.Disposable = function (action) {
+ this.isDisposed = false;
+ this.action = action || noop;
+ };
+
+ /** Performs the task of cleaning up resources. */
+ Disposable.prototype.dispose = function () {
+ if (!this.isDisposed) {
+ this.action();
+ this.isDisposed = true;
+ }
+ };
+
+ /**
+ * Creates a disposable object that invokes the specified action when disposed.
+ * @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once.
+ * @return {Disposable} The disposable object that runs the given action upon disposal.
+ */
+ var disposableCreate = Disposable.create = function (action) { return new Disposable(action); };
+
+ /**
+ * Gets the disposable that does nothing when disposed.
+ */
+ var disposableEmpty = Disposable.empty = { dispose: noop };
+
+ /**
+ * Validates whether the given object is a disposable
+ * @param {Object} Object to test whether it has a dispose method
+ * @returns {Boolean} true if a disposable object, else false.
+ */
+ var isDisposable = Disposable.isDisposable = function (d) {
+ return d && isFunction(d.dispose);
+ };
+
+ var checkDisposed = Disposable.checkDisposed = function (disposable) {
+ if (disposable.isDisposed) { throw new ObjectDisposedError(); }
+ };
+
+ // Single assignment
+ var SingleAssignmentDisposable = Rx.SingleAssignmentDisposable = function () {
+ this.isDisposed = false;
+ this.current = null;
+ };
+ SingleAssignmentDisposable.prototype.getDisposable = function () {
+ return this.current;
+ };
+ SingleAssignmentDisposable.prototype.setDisposable = function (value) {
+ if (this.current) { throw new Error('Disposable has already been assigned'); }
+ var shouldDispose = this.isDisposed;
+ !shouldDispose && (this.current = value);
+ shouldDispose && value && value.dispose();
+ };
+ SingleAssignmentDisposable.prototype.dispose = function () {
+ if (!this.isDisposed) {
+ this.isDisposed = true;
+ var old = this.current;
+ this.current = null;
+ }
+ old && old.dispose();
+ };
+
+ // Multiple assignment disposable
+ var SerialDisposable = Rx.SerialDisposable = function () {
+ this.isDisposed = false;
+ this.current = null;
+ };
+ SerialDisposable.prototype.getDisposable = function () {
+ return this.current;
+ };
+ SerialDisposable.prototype.setDisposable = function (value) {
+ var shouldDispose = this.isDisposed;
+ if (!shouldDispose) {
+ var old = this.current;
+ this.current = value;
+ }
+ old && old.dispose();
+ shouldDispose && value && value.dispose();
+ };
+ SerialDisposable.prototype.dispose = function () {
+ if (!this.isDisposed) {
+ this.isDisposed = true;
+ var old = this.current;
+ this.current = null;
+ }
+ old && old.dispose();
+ };
+
+ /**
+ * Represents a disposable resource that only disposes its underlying disposable resource when all dependent disposable objects have been disposed.
+ */
+ var RefCountDisposable = Rx.RefCountDisposable = (function () {
+
+ function InnerDisposable(disposable) {
+ this.disposable = disposable;
+ this.disposable.count++;
+ this.isInnerDisposed = false;
+ }
+
+ InnerDisposable.prototype.dispose = function () {
+ if (!this.disposable.isDisposed && !this.isInnerDisposed) {
+ this.isInnerDisposed = true;
+ this.disposable.count--;
+ if (this.disposable.count === 0 && this.disposable.isPrimaryDisposed) {
+ this.disposable.isDisposed = true;
+ this.disposable.underlyingDisposable.dispose();
+ }
+ }
+ };
+
+ /**
+ * Initializes a new instance of the RefCountDisposable with the specified disposable.
+ * @constructor
+ * @param {Disposable} disposable Underlying disposable.
+ */
+ function RefCountDisposable(disposable) {
+ this.underlyingDisposable = disposable;
+ this.isDisposed = false;
+ this.isPrimaryDisposed = false;
+ this.count = 0;
+ }
+
+ /**
+ * Disposes the underlying disposable only when all dependent disposables have been disposed
+ */
+ RefCountDisposable.prototype.dispose = function () {
+ if (!this.isDisposed && !this.isPrimaryDisposed) {
+ this.isPrimaryDisposed = true;
+ if (this.count === 0) {
+ this.isDisposed = true;
+ this.underlyingDisposable.dispose();
+ }
+ }
+ };
+
+ /**
+ * Returns a dependent disposable that when disposed decreases the refcount on the underlying disposable.
+ * @returns {Disposable} A dependent disposable contributing to the reference count that manages the underlying disposable's lifetime.
+ */
+ RefCountDisposable.prototype.getDisposable = function () {
+ return this.isDisposed ? disposableEmpty : new InnerDisposable(this);
+ };
+
+ return RefCountDisposable;
+ })();
+
+ var ScheduledItem = Rx.internals.ScheduledItem = function (scheduler, state, action, dueTime, comparer) {
+ this.scheduler = scheduler;
+ this.state = state;
+ this.action = action;
+ this.dueTime = dueTime;
+ this.comparer = comparer || defaultSubComparer;
+ this.disposable = new SingleAssignmentDisposable();
+ }
+
+ ScheduledItem.prototype.invoke = function () {
+ this.disposable.setDisposable(this.invokeCore());
+ };
+
+ ScheduledItem.prototype.compareTo = function (other) {
+ return this.comparer(this.dueTime, other.dueTime);
+ };
+
+ ScheduledItem.prototype.isCancelled = function () {
+ return this.disposable.isDisposed;
+ };
+
+ ScheduledItem.prototype.invokeCore = function () {
+ return this.action(this.scheduler, this.state);
+ };
+
+ /** Provides a set of static properties to access commonly used schedulers. */
+ var Scheduler = Rx.Scheduler = (function () {
+
+ function Scheduler(now, schedule, scheduleRelative, scheduleAbsolute) {
+ this.now = now;
+ this._schedule = schedule;
+ this._scheduleRelative = scheduleRelative;
+ this._scheduleAbsolute = scheduleAbsolute;
+ }
+
+ /** Determines whether the given object is a scheduler */
+ Scheduler.isScheduler = function (s) {
+ return s instanceof Scheduler;
+ }
+
+ function invokeAction(scheduler, action) {
+ action();
+ return disposableEmpty;
+ }
+
+ var schedulerProto = Scheduler.prototype;
+
+ /**
+ * Schedules an action to be executed.
+ * @param {Function} action Action to execute.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.schedule = function (action) {
+ return this._schedule(action, invokeAction);
+ };
+
+ /**
+ * Schedules an action to be executed.
+ * @param state State passed to the action to be executed.
+ * @param {Function} action Action to be executed.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleWithState = function (state, action) {
+ return this._schedule(state, action);
+ };
+
+ /**
+ * Schedules an action to be executed after the specified relative due time.
+ * @param {Function} action Action to execute.
+ * @param {Number} dueTime Relative time after which to execute the action.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleWithRelative = function (dueTime, action) {
+ return this._scheduleRelative(action, dueTime, invokeAction);
+ };
+
+ /**
+ * Schedules an action to be executed after dueTime.
+ * @param state State passed to the action to be executed.
+ * @param {Function} action Action to be executed.
+ * @param {Number} dueTime Relative time after which to execute the action.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleWithRelativeAndState = function (state, dueTime, action) {
+ return this._scheduleRelative(state, dueTime, action);
+ };
+
+ /**
+ * Schedules an action to be executed at the specified absolute due time.
+ * @param {Function} action Action to execute.
+ * @param {Number} dueTime Absolute time at which to execute the action.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleWithAbsolute = function (dueTime, action) {
+ return this._scheduleAbsolute(action, dueTime, invokeAction);
+ };
+
+ /**
+ * Schedules an action to be executed at dueTime.
+ * @param {Mixed} state State passed to the action to be executed.
+ * @param {Function} action Action to be executed.
+ * @param {Number}dueTime Absolute time at which to execute the action.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleWithAbsoluteAndState = function (state, dueTime, action) {
+ return this._scheduleAbsolute(state, dueTime, action);
+ };
+
+ /** Gets the current time according to the local machine's system clock. */
+ Scheduler.now = defaultNow;
+
+ /**
+ * Normalizes the specified TimeSpan value to a positive value.
+ * @param {Number} timeSpan The time span value to normalize.
+ * @returns {Number} The specified TimeSpan value if it is zero or positive; otherwise, 0
+ */
+ Scheduler.normalize = function (timeSpan) {
+ timeSpan < 0 && (timeSpan = 0);
+ return timeSpan;
+ };
+
+ return Scheduler;
+ }());
+
+ var normalizeTime = Scheduler.normalize, isScheduler = Scheduler.isScheduler;
+
+ (function (schedulerProto) {
+
+ function invokeRecImmediate(scheduler, pair) {
+ var state = pair[0], action = pair[1], group = new CompositeDisposable();
+
+ function recursiveAction(state1) {
+ action(state1, function (state2) {
+ var isAdded = false, isDone = false,
+ d = scheduler.scheduleWithState(state2, function (scheduler1, state3) {
+ if (isAdded) {
+ group.remove(d);
+ } else {
+ isDone = true;
+ }
+ recursiveAction(state3);
+ return disposableEmpty;
+ });
+ if (!isDone) {
+ group.add(d);
+ isAdded = true;
+ }
+ });
+ }
+ recursiveAction(state);
+ return group;
+ }
+
+ function invokeRecDate(scheduler, pair, method) {
+ var state = pair[0], action = pair[1], group = new CompositeDisposable();
+ function recursiveAction(state1) {
+ action(state1, function (state2, dueTime1) {
+ var isAdded = false, isDone = false,
+ d = scheduler[method](state2, dueTime1, function (scheduler1, state3) {
+ if (isAdded) {
+ group.remove(d);
+ } else {
+ isDone = true;
+ }
+ recursiveAction(state3);
+ return disposableEmpty;
+ });
+ if (!isDone) {
+ group.add(d);
+ isAdded = true;
+ }
+ });
+ };
+ recursiveAction(state);
+ return group;
+ }
+
+ function scheduleInnerRecursive(action, self) {
+ action(function(dt) { self(action, dt); });
+ }
+
+ /**
+ * Schedules an action to be executed recursively.
+ * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleRecursive = function (action) {
+ return this.scheduleRecursiveWithState(action, scheduleInnerRecursive);
+ };
+
+ /**
+ * Schedules an action to be executed recursively.
+ * @param {Mixed} state State passed to the action to be executed.
+ * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in recursive invocation state.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleRecursiveWithState = function (state, action) {
+ return this.scheduleWithState([state, action], invokeRecImmediate);
+ };
+
+ /**
+ * Schedules an action to be executed recursively after a specified relative due time.
+ * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified relative time.
+ * @param {Number}dueTime Relative time after which to execute the action for the first time.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleRecursiveWithRelative = function (dueTime, action) {
+ return this.scheduleRecursiveWithRelativeAndState(action, dueTime, scheduleInnerRecursive);
+ };
+
+ /**
+ * Schedules an action to be executed recursively after a specified relative due time.
+ * @param {Mixed} state State passed to the action to be executed.
+ * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state.
+ * @param {Number}dueTime Relative time after which to execute the action for the first time.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleRecursiveWithRelativeAndState = function (state, dueTime, action) {
+ return this._scheduleRelative([state, action], dueTime, function (s, p) {
+ return invokeRecDate(s, p, 'scheduleWithRelativeAndState');
+ });
+ };
+
+ /**
+ * Schedules an action to be executed recursively at a specified absolute due time.
+ * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified absolute time.
+ * @param {Number}dueTime Absolute time at which to execute the action for the first time.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleRecursiveWithAbsolute = function (dueTime, action) {
+ return this.scheduleRecursiveWithAbsoluteAndState(action, dueTime, scheduleInnerRecursive);
+ };
+
+ /**
+ * Schedules an action to be executed recursively at a specified absolute due time.
+ * @param {Mixed} state State passed to the action to be executed.
+ * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state.
+ * @param {Number}dueTime Absolute time at which to execute the action for the first time.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ schedulerProto.scheduleRecursiveWithAbsoluteAndState = function (state, dueTime, action) {
+ return this._scheduleAbsolute([state, action], dueTime, function (s, p) {
+ return invokeRecDate(s, p, 'scheduleWithAbsoluteAndState');
+ });
+ };
+ }(Scheduler.prototype));
+
+ (function (schedulerProto) {
+
+ /**
+ * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation.
+ * @param {Number} period Period for running the work periodically.
+ * @param {Function} action Action to be executed.
+ * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort).
+ */
+ Scheduler.prototype.schedulePeriodic = function (period, action) {
+ return this.schedulePeriodicWithState(null, period, action);
+ };
+
+ /**
+ * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation.
+ * @param {Mixed} state Initial state passed to the action upon the first iteration.
+ * @param {Number} period Period for running the work periodically.
+ * @param {Function} action Action to be executed, potentially updating the state.
+ * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort).
+ */
+ Scheduler.prototype.schedulePeriodicWithState = function(state, period, action) {
+ if (typeof root.setInterval === 'undefined') { throw new NotSupportedError(); }
+ period = normalizeTime(period);
+ var s = state, id = root.setInterval(function () { s = action(s); }, period);
+ return disposableCreate(function () { root.clearInterval(id); });
+ };
+
+ }(Scheduler.prototype));
+
+ /** Gets a scheduler that schedules work immediately on the current thread. */
+ var immediateScheduler = Scheduler.immediate = (function () {
+ function scheduleNow(state, action) { return action(this, state); }
+ return new Scheduler(defaultNow, scheduleNow, notSupported, notSupported);
+ }());
+
+ /**
+ * Gets a scheduler that schedules work as soon as possible on the current thread.
+ */
+ var currentThreadScheduler = Scheduler.currentThread = (function () {
+ var queue;
+
+ function runTrampoline () {
+ while (queue.length > 0) {
+ var item = queue.dequeue();
+ !item.isCancelled() && item.invoke();
+ }
+ }
+
+ function scheduleNow(state, action) {
+ var si = new ScheduledItem(this, state, action, this.now());
+
+ if (!queue) {
+ queue = new PriorityQueue(4);
+ queue.enqueue(si);
+
+ var result = tryCatch(runTrampoline)();
+ queue = null;
+ if (result === errorObj) { return thrower(result.e); }
+ } else {
+ queue.enqueue(si);
+ }
+ return si.disposable;
+ }
+
+ var currentScheduler = new Scheduler(defaultNow, scheduleNow, notSupported, notSupported);
+ currentScheduler.scheduleRequired = function () { return !queue; };
+
+ return currentScheduler;
+ }());
+
+ var SchedulePeriodicRecursive = Rx.internals.SchedulePeriodicRecursive = (function () {
+ function tick(command, recurse) {
+ recurse(0, this._period);
+ try {
+ this._state = this._action(this._state);
+ } catch (e) {
+ this._cancel.dispose();
+ throw e;
+ }
+ }
+
+ function SchedulePeriodicRecursive(scheduler, state, period, action) {
+ this._scheduler = scheduler;
+ this._state = state;
+ this._period = period;
+ this._action = action;
+ }
+
+ SchedulePeriodicRecursive.prototype.start = function () {
+ var d = new SingleAssignmentDisposable();
+ this._cancel = d;
+ d.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0, this._period, tick.bind(this)));
+
+ return d;
+ };
+
+ return SchedulePeriodicRecursive;
+ }());
+
+ var scheduleMethod, clearMethod;
+
+ var localTimer = (function () {
+ var localSetTimeout, localClearTimeout = noop;
+ if (!!root.setTimeout) {
+ localSetTimeout = root.setTimeout;
+ localClearTimeout = root.clearTimeout;
+ } else if (!!root.WScript) {
+ localSetTimeout = function (fn, time) {
+ root.WScript.Sleep(time);
+ fn();
+ };
+ } else {
+ throw new NotSupportedError();
+ }
+
+ return {
+ setTimeout: localSetTimeout,
+ clearTimeout: localClearTimeout
+ };
+ }());
+ var localSetTimeout = localTimer.setTimeout,
+ localClearTimeout = localTimer.clearTimeout;
+
+ (function () {
+
+ var nextHandle = 1, tasksByHandle = {}, currentlyRunning = false;
+
+ clearMethod = function (handle) {
+ delete tasksByHandle[handle];
+ };
+
+ function runTask(handle) {
+ if (currentlyRunning) {
+ localSetTimeout(function () { runTask(handle) }, 0);
+ } else {
+ var task = tasksByHandle[handle];
+ if (task) {
+ currentlyRunning = true;
+ var result = tryCatch(task)();
+ clearMethod(handle);
+ currentlyRunning = false;
+ if (result === errorObj) { return thrower(result.e); }
+ }
+ }
+ }
+
+ var reNative = RegExp('^' +
+ String(toString)
+ .replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
+ .replace(/toString| for [^\]]+/g, '.*?') + '$'
+ );
+
+ var setImmediate = typeof (setImmediate = freeGlobal && moduleExports && freeGlobal.setImmediate) == 'function' &&
+ !reNative.test(setImmediate) && setImmediate;
+
+ function postMessageSupported () {
+ // Ensure not in a worker
+ if (!root.postMessage || root.importScripts) { return false; }
+ var isAsync = false, oldHandler = root.onmessage;
+ // Test for async
+ root.onmessage = function () { isAsync = true; };
+ root.postMessage('', '*');
+ root.onmessage = oldHandler;
+
+ return isAsync;
+ }
+
+ // Use in order, setImmediate, nextTick, postMessage, MessageChannel, script readystatechanged, setTimeout
+ if (isFunction(setImmediate)) {
+ scheduleMethod = function (action) {
+ var id = nextHandle++;
+ tasksByHandle[id] = action;
+ setImmediate(function () { runTask(id); });
+
+ return id;
+ };
+ } else if (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]') {
+ scheduleMethod = function (action) {
+ var id = nextHandle++;
+ tasksByHandle[id] = action;
+ process.nextTick(function () { runTask(id); });
+
+ return id;
+ };
+ } else if (postMessageSupported()) {
+ var MSG_PREFIX = 'ms.rx.schedule' + Math.random();
+
+ function onGlobalPostMessage(event) {
+ // Only if we're a match to avoid any other global events
+ if (typeof event.data === 'string' && event.data.substring(0, MSG_PREFIX.length) === MSG_PREFIX) {
+ runTask(event.data.substring(MSG_PREFIX.length));
+ }
+ }
+
+ if (root.addEventListener) {
+ root.addEventListener('message', onGlobalPostMessage, false);
+ } else if (root.attachEvent) {
+ root.attachEvent('onmessage', onGlobalPostMessage);
+ } else {
+ root.onmessage = onGlobalPostMessage;
+ }
+
+ scheduleMethod = function (action) {
+ var id = nextHandle++;
+ tasksByHandle[id] = action;
+ root.postMessage(MSG_PREFIX + currentId, '*');
+ return id;
+ };
+ } else if (!!root.MessageChannel) {
+ var channel = new root.MessageChannel();
+
+ channel.port1.onmessage = function (e) { runTask(e.data); };
+
+ scheduleMethod = function (action) {
+ var id = nextHandle++;
+ tasksByHandle[id] = action;
+ channel.port2.postMessage(id);
+ return id;
+ };
+ } else if ('document' in root && 'onreadystatechange' in root.document.createElement('script')) {
+
+ scheduleMethod = function (action) {
+ var scriptElement = root.document.createElement('script');
+ var id = nextHandle++;
+ tasksByHandle[id] = action;
+
+ scriptElement.onreadystatechange = function () {
+ runTask(id);
+ scriptElement.onreadystatechange = null;
+ scriptElement.parentNode.removeChild(scriptElement);
+ scriptElement = null;
+ };
+ root.document.documentElement.appendChild(scriptElement);
+ return id;
+ };
+
+ } else {
+ scheduleMethod = function (action) {
+ var id = nextHandle++;
+ tasksByHandle[id] = action;
+ localSetTimeout(function () {
+ runTask(id);
+ }, 0);
+
+ return id;
+ };
+ }
+ }());
+
+ /**
+ * Gets a scheduler that schedules work via a timed callback based upon platform.
+ */
+ var timeoutScheduler = Scheduler.timeout = Scheduler['default'] = (function () {
+
+ function scheduleNow(state, action) {
+ var scheduler = this, disposable = new SingleAssignmentDisposable();
+ var id = scheduleMethod(function () {
+ !disposable.isDisposed && disposable.setDisposable(action(scheduler, state));
+ });
+ return new CompositeDisposable(disposable, disposableCreate(function () {
+ clearMethod(id);
+ }));
+ }
+
+ function scheduleRelative(state, dueTime, action) {
+ var scheduler = this, dt = Scheduler.normalize(dueTime), disposable = new SingleAssignmentDisposable();
+ if (dt === 0) { return scheduler.scheduleWithState(state, action); }
+ var id = localSetTimeout(function () {
+ !disposable.isDisposed && disposable.setDisposable(action(scheduler, state));
+ }, dt);
+ return new CompositeDisposable(disposable, disposableCreate(function () {
+ localClearTimeout(id);
+ }));
+ }
+
+ function scheduleAbsolute(state, dueTime, action) {
+ return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action);
+ }
+
+ return new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute);
+ })();
+
+ /**
+ * Represents a notification to an observer.
+ */
+ var Notification = Rx.Notification = (function () {
+ function Notification(kind, value, exception, accept, acceptObservable, toString) {
+ this.kind = kind;
+ this.value = value;
+ this.exception = exception;
+ this._accept = accept;
+ this._acceptObservable = acceptObservable;
+ this.toString = toString;
+ }
+
+ /**
+ * Invokes the delegate corresponding to the notification or the observer's method corresponding to the notification and returns the produced result.
+ *
+ * @memberOf Notification
+ * @param {Any} observerOrOnNext Delegate to invoke for an OnNext notification or Observer to invoke the notification on..
+ * @param {Function} onError Delegate to invoke for an OnError notification.
+ * @param {Function} onCompleted Delegate to invoke for an OnCompleted notification.
+ * @returns {Any} Result produced by the observation.
+ */
+ Notification.prototype.accept = function (observerOrOnNext, onError, onCompleted) {
+ return observerOrOnNext && typeof observerOrOnNext === 'object' ?
+ this._acceptObservable(observerOrOnNext) :
+ this._accept(observerOrOnNext, onError, onCompleted);
+ };
+
+ /**
+ * Returns an observable sequence with a single notification.
+ *
+ * @memberOf Notifications
+ * @param {Scheduler} [scheduler] Scheduler to send out the notification calls on.
+ * @returns {Observable} The observable sequence that surfaces the behavior of the notification upon subscription.
+ */
+ Notification.prototype.toObservable = function (scheduler) {
+ var self = this;
+ isScheduler(scheduler) || (scheduler = immediateScheduler);
+ return new AnonymousObservable(function (observer) {
+ return scheduler.scheduleWithState(self, function (_, notification) {
+ notification._acceptObservable(observer);
+ notification.kind === 'N' && observer.onCompleted();
+ });
+ });
+ };
+
+ return Notification;
+ })();
+
+ /**
+ * Creates an object that represents an OnNext notification to an observer.
+ * @param {Any} value The value contained in the notification.
+ * @returns {Notification} The OnNext notification containing the value.
+ */
+ var notificationCreateOnNext = Notification.createOnNext = (function () {
+ function _accept(onNext) { return onNext(this.value); }
+ function _acceptObservable(observer) { return observer.onNext(this.value); }
+ function toString() { return 'OnNext(' + this.value + ')'; }
+
+ return function (value) {
+ return new Notification('N', value, null, _accept, _acceptObservable, toString);
+ };
+ }());
+
+ /**
+ * Creates an object that represents an OnError notification to an observer.
+ * @param {Any} error The exception contained in the notification.
+ * @returns {Notification} The OnError notification containing the exception.
+ */
+ var notificationCreateOnError = Notification.createOnError = (function () {
+ function _accept (onNext, onError) { return onError(this.exception); }
+ function _acceptObservable(observer) { return observer.onError(this.exception); }
+ function toString () { return 'OnError(' + this.exception + ')'; }
+
+ return function (e) {
+ return new Notification('E', null, e, _accept, _acceptObservable, toString);
+ };
+ }());
+
+ /**
+ * Creates an object that represents an OnCompleted notification to an observer.
+ * @returns {Notification} The OnCompleted notification.
+ */
+ var notificationCreateOnCompleted = Notification.createOnCompleted = (function () {
+ function _accept (onNext, onError, onCompleted) { return onCompleted(); }
+ function _acceptObservable(observer) { return observer.onCompleted(); }
+ function toString () { return 'OnCompleted()'; }
+
+ return function () {
+ return new Notification('C', null, null, _accept, _acceptObservable, toString);
+ };
+ }());
+
+ /**
+ * Supports push-style iteration over an observable sequence.
+ */
+ var Observer = Rx.Observer = function () { };
+
+ /**
+ * Creates an observer from the specified OnNext, along with optional OnError, and OnCompleted actions.
+ * @param {Function} [onNext] Observer's OnNext action implementation.
+ * @param {Function} [onError] Observer's OnError action implementation.
+ * @param {Function} [onCompleted] Observer's OnCompleted action implementation.
+ * @returns {Observer} The observer object implemented using the given actions.
+ */
+ var observerCreate = Observer.create = function (onNext, onError, onCompleted) {
+ onNext || (onNext = noop);
+ onError || (onError = defaultError);
+ onCompleted || (onCompleted = noop);
+ return new AnonymousObserver(onNext, onError, onCompleted);
+ };
+
+ /**
+ * Abstract base class for implementations of the Observer class.
+ * This base class enforces the grammar of observers where OnError and OnCompleted are terminal messages.
+ */
+ var AbstractObserver = Rx.internals.AbstractObserver = (function (__super__) {
+ inherits(AbstractObserver, __super__);
+
+ /**
+ * Creates a new observer in a non-stopped state.
+ */
+ function AbstractObserver() {
+ this.isStopped = false;
+ __super__.call(this);
+ }
+
+ // Must be implemented by other observers
+ AbstractObserver.prototype.next = notImplemented;
+ AbstractObserver.prototype.error = notImplemented;
+ AbstractObserver.prototype.completed = notImplemented;
+
+ /**
+ * Notifies the observer of a new element in the sequence.
+ * @param {Any} value Next element in the sequence.
+ */
+ AbstractObserver.prototype.onNext = function (value) {
+ if (!this.isStopped) { this.next(value); }
+ };
+
+ /**
+ * Notifies the observer that an exception has occurred.
+ * @param {Any} error The error that has occurred.
+ */
+ AbstractObserver.prototype.onError = function (error) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.error(error);
+ }
+ };
+
+ /**
+ * Notifies the observer of the end of the sequence.
+ */
+ AbstractObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.completed();
+ }
+ };
+
+ /**
+ * Disposes the observer, causing it to transition to the stopped state.
+ */
+ AbstractObserver.prototype.dispose = function () {
+ this.isStopped = true;
+ };
+
+ AbstractObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.error(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ return AbstractObserver;
+ }(Observer));
+
+ /**
+ * Class to create an Observer instance from delegate-based implementations of the on* methods.
+ */
+ var AnonymousObserver = Rx.AnonymousObserver = (function (__super__) {
+ inherits(AnonymousObserver, __super__);
+
+ /**
+ * Creates an observer from the specified OnNext, OnError, and OnCompleted actions.
+ * @param {Any} onNext Observer's OnNext action implementation.
+ * @param {Any} onError Observer's OnError action implementation.
+ * @param {Any} onCompleted Observer's OnCompleted action implementation.
+ */
+ function AnonymousObserver(onNext, onError, onCompleted) {
+ __super__.call(this);
+ this._onNext = onNext;
+ this._onError = onError;
+ this._onCompleted = onCompleted;
+ }
+
+ /**
+ * Calls the onNext action.
+ * @param {Any} value Next element in the sequence.
+ */
+ AnonymousObserver.prototype.next = function (value) {
+ this._onNext(value);
+ };
+
+ /**
+ * Calls the onError action.
+ * @param {Any} error The error that has occurred.
+ */
+ AnonymousObserver.prototype.error = function (error) {
+ this._onError(error);
+ };
+
+ /**
+ * Calls the onCompleted action.
+ */
+ AnonymousObserver.prototype.completed = function () {
+ this._onCompleted();
+ };
+
+ return AnonymousObserver;
+ }(AbstractObserver));
+
+ var observableProto;
+
+ /**
+ * Represents a push-style collection.
+ */
+ var Observable = Rx.Observable = (function () {
+
+ function Observable(subscribe) {
+ if (Rx.config.longStackSupport && hasStacks) {
+ try {
+ throw new Error();
+ } catch (e) {
+ this.stack = e.stack.substring(e.stack.indexOf("\n") + 1);
+ }
+
+ var self = this;
+ this._subscribe = function (observer) {
+ var oldOnError = observer.onError.bind(observer);
+
+ observer.onError = function (err) {
+ makeStackTraceLong(err, self);
+ oldOnError(err);
+ };
+
+ return subscribe.call(self, observer);
+ };
+ } else {
+ this._subscribe = subscribe;
+ }
+ }
+
+ observableProto = Observable.prototype;
+
+ /**
+ * Subscribes an observer to the observable sequence.
+ * @param {Mixed} [observerOrOnNext] The object that is to receive notifications or an action to invoke for each element in the observable sequence.
+ * @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence.
+ * @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence.
+ * @returns {Diposable} A disposable handling the subscriptions and unsubscriptions.
+ */
+ observableProto.subscribe = observableProto.forEach = function (observerOrOnNext, onError, onCompleted) {
+ return this._subscribe(typeof observerOrOnNext === 'object' ?
+ observerOrOnNext :
+ observerCreate(observerOrOnNext, onError, onCompleted));
+ };
+
+ /**
+ * Subscribes to the next value in the sequence with an optional "this" argument.
+ * @param {Function} onNext The function to invoke on each element in the observable sequence.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions.
+ */
+ observableProto.subscribeOnNext = function (onNext, thisArg) {
+ return this._subscribe(observerCreate(typeof thisArg !== 'undefined' ? function(x) { onNext.call(thisArg, x); } : onNext));
+ };
+
+ /**
+ * Subscribes to an exceptional condition in the sequence with an optional "this" argument.
+ * @param {Function} onError The function to invoke upon exceptional termination of the observable sequence.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions.
+ */
+ observableProto.subscribeOnError = function (onError, thisArg) {
+ return this._subscribe(observerCreate(null, typeof thisArg !== 'undefined' ? function(e) { onError.call(thisArg, e); } : onError));
+ };
+
+ /**
+ * Subscribes to the next value in the sequence with an optional "this" argument.
+ * @param {Function} onCompleted The function to invoke upon graceful termination of the observable sequence.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions.
+ */
+ observableProto.subscribeOnCompleted = function (onCompleted, thisArg) {
+ return this._subscribe(observerCreate(null, null, typeof thisArg !== 'undefined' ? function() { onCompleted.call(thisArg); } : onCompleted));
+ };
+
+ return Observable;
+ })();
+
+ var ScheduledObserver = Rx.internals.ScheduledObserver = (function (__super__) {
+ inherits(ScheduledObserver, __super__);
+
+ function ScheduledObserver(scheduler, observer) {
+ __super__.call(this);
+ this.scheduler = scheduler;
+ this.observer = observer;
+ this.isAcquired = false;
+ this.hasFaulted = false;
+ this.queue = [];
+ this.disposable = new SerialDisposable();
+ }
+
+ ScheduledObserver.prototype.next = function (value) {
+ var self = this;
+ this.queue.push(function () { self.observer.onNext(value); });
+ };
+
+ ScheduledObserver.prototype.error = function (e) {
+ var self = this;
+ this.queue.push(function () { self.observer.onError(e); });
+ };
+
+ ScheduledObserver.prototype.completed = function () {
+ var self = this;
+ this.queue.push(function () { self.observer.onCompleted(); });
+ };
+
+ ScheduledObserver.prototype.ensureActive = function () {
+ var isOwner = false, parent = this;
+ if (!this.hasFaulted && this.queue.length > 0) {
+ isOwner = !this.isAcquired;
+ this.isAcquired = true;
+ }
+ if (isOwner) {
+ this.disposable.setDisposable(this.scheduler.scheduleRecursive(function (self) {
+ var work;
+ if (parent.queue.length > 0) {
+ work = parent.queue.shift();
+ } else {
+ parent.isAcquired = false;
+ return;
+ }
+ try {
+ work();
+ } catch (ex) {
+ parent.queue = [];
+ parent.hasFaulted = true;
+ throw ex;
+ }
+ self();
+ }));
+ }
+ };
+
+ ScheduledObserver.prototype.dispose = function () {
+ __super__.prototype.dispose.call(this);
+ this.disposable.dispose();
+ };
+
+ return ScheduledObserver;
+ }(AbstractObserver));
+
+ var ObservableBase = Rx.ObservableBase = (function (__super__) {
+ inherits(ObservableBase, __super__);
+
+ function fixSubscriber(subscriber) {
+ return subscriber && isFunction(subscriber.dispose) ? subscriber :
+ isFunction(subscriber) ? disposableCreate(subscriber) : disposableEmpty;
+ }
+
+ function setDisposable(s, state) {
+ var ado = state[0], self = state[1];
+ var sub = tryCatch(self.subscribeCore).call(self, ado);
+
+ if (sub === errorObj) {
+ if(!ado.fail(errorObj.e)) { return thrower(errorObj.e); }
+ }
+ ado.setDisposable(fixSubscriber(sub));
+ }
+
+ function subscribe(observer) {
+ var ado = new AutoDetachObserver(observer), state = [ado, this];
+
+ if (currentThreadScheduler.scheduleRequired()) {
+ currentThreadScheduler.scheduleWithState(state, setDisposable);
+ } else {
+ setDisposable(null, state);
+ }
+ return ado;
+ }
+
+ function ObservableBase() {
+ __super__.call(this, subscribe);
+ }
+
+ ObservableBase.prototype.subscribeCore = notImplemented;
+
+ return ObservableBase;
+ }(Observable));
+
+ var Enumerable = Rx.internals.Enumerable = function () { };
+
+ var ConcatEnumerableObservable = (function(__super__) {
+ inherits(ConcatEnumerableObservable, __super__);
+ function ConcatEnumerableObservable(sources) {
+ this.sources = sources;
+ __super__.call(this);
+ }
+
+ ConcatEnumerableObservable.prototype.subscribeCore = function (o) {
+ var isDisposed, subscription = new SerialDisposable();
+ var cancelable = immediateScheduler.scheduleRecursiveWithState(this.sources[$iterator$](), function (e, self) {
+ if (isDisposed) { return; }
+ var currentItem = tryCatch(e.next).call(e);
+ if (currentItem === errorObj) { return o.onError(currentItem.e); }
+
+ if (currentItem.done) {
+ return o.onCompleted();
+ }
+
+ // Check if promise
+ var currentValue = currentItem.value;
+ isPromise(currentValue) && (currentValue = observableFromPromise(currentValue));
+
+ var d = new SingleAssignmentDisposable();
+ subscription.setDisposable(d);
+ d.setDisposable(currentValue.subscribe(new InnerObserver(o, self, e)));
+ });
+
+ return new CompositeDisposable(subscription, cancelable, disposableCreate(function () {
+ isDisposed = true;
+ }));
+ };
+
+ function InnerObserver(o, s, e) {
+ this.o = o;
+ this.s = s;
+ this.e = e;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) { if(!this.isStopped) { this.o.onNext(x); } };
+ InnerObserver.prototype.onError = function (err) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(err);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.s(this.e);
+ }
+ };
+ InnerObserver.prototype.dispose = function () { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (err) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(err);
+ return true;
+ }
+ return false;
+ };
+
+ return ConcatEnumerableObservable;
+ }(ObservableBase));
+
+ Enumerable.prototype.concat = function () {
+ return new ConcatEnumerableObservable(this);
+ };
+
+ var CatchErrorObservable = (function(__super__) {
+ inherits(CatchErrorObservable, __super__);
+ function CatchErrorObservable(sources) {
+ this.sources = sources;
+ __super__.call(this);
+ }
+
+ CatchErrorObservable.prototype.subscribeCore = function (o) {
+ var e = this.sources[$iterator$]();
+
+ var isDisposed, subscription = new SerialDisposable();
+ var cancelable = immediateScheduler.scheduleRecursiveWithState(null, function (lastException, self) {
+ if (isDisposed) { return; }
+ var currentItem = tryCatch(e.next).call(e);
+ if (currentItem === errorObj) { return o.onError(currentItem.e); }
+
+ if (currentItem.done) {
+ return lastException !== null ? o.onError(lastException) : o.onCompleted();
+ }
+
+ // Check if promise
+ var currentValue = currentItem.value;
+ isPromise(currentValue) && (currentValue = observableFromPromise(currentValue));
+
+ var d = new SingleAssignmentDisposable();
+ subscription.setDisposable(d);
+ d.setDisposable(currentValue.subscribe(
+ function(x) { o.onNext(x); },
+ self,
+ function() { o.onCompleted(); }));
+ });
+ return new CompositeDisposable(subscription, cancelable, disposableCreate(function () {
+ isDisposed = true;
+ }));
+ };
+
+ return CatchErrorObservable;
+ }(ObservableBase));
+
+ Enumerable.prototype.catchError = function () {
+ return new CatchErrorObservable(this);
+ };
+
+ Enumerable.prototype.catchErrorWhen = function (notificationHandler) {
+ var sources = this;
+ return new AnonymousObservable(function (o) {
+ var exceptions = new Subject(),
+ notifier = new Subject(),
+ handled = notificationHandler(exceptions),
+ notificationDisposable = handled.subscribe(notifier);
+
+ var e = sources[$iterator$]();
+
+ var isDisposed,
+ lastException,
+ subscription = new SerialDisposable();
+ var cancelable = immediateScheduler.scheduleRecursive(function (self) {
+ if (isDisposed) { return; }
+ var currentItem = tryCatch(e.next).call(e);
+ if (currentItem === errorObj) { return o.onError(currentItem.e); }
+
+ if (currentItem.done) {
+ if (lastException) {
+ o.onError(lastException);
+ } else {
+ o.onCompleted();
+ }
+ return;
+ }
+
+ // Check if promise
+ var currentValue = currentItem.value;
+ isPromise(currentValue) && (currentValue = observableFromPromise(currentValue));
+
+ var outer = new SingleAssignmentDisposable();
+ var inner = new SingleAssignmentDisposable();
+ subscription.setDisposable(new CompositeDisposable(inner, outer));
+ outer.setDisposable(currentValue.subscribe(
+ function(x) { o.onNext(x); },
+ function (exn) {
+ inner.setDisposable(notifier.subscribe(self, function(ex) {
+ o.onError(ex);
+ }, function() {
+ o.onCompleted();
+ }));
+
+ exceptions.onNext(exn);
+ },
+ function() { o.onCompleted(); }));
+ });
+
+ return new CompositeDisposable(notificationDisposable, subscription, cancelable, disposableCreate(function () {
+ isDisposed = true;
+ }));
+ });
+ };
+
+ var RepeatEnumerable = (function (__super__) {
+ inherits(RepeatEnumerable, __super__);
+
+ function RepeatEnumerable(v, c) {
+ this.v = v;
+ this.c = c == null ? -1 : c;
+ }
+ RepeatEnumerable.prototype[$iterator$] = function () {
+ return new RepeatEnumerator(this);
+ };
+
+ function RepeatEnumerator(p) {
+ this.v = p.v;
+ this.l = p.c;
+ }
+ RepeatEnumerator.prototype.next = function () {
+ if (this.l === 0) { return doneEnumerator; }
+ if (this.l > 0) { this.l--; }
+ return { done: false, value: this.v };
+ };
+
+ return RepeatEnumerable;
+ }(Enumerable));
+
+ var enumerableRepeat = Enumerable.repeat = function (value, repeatCount) {
+ return new RepeatEnumerable(value, repeatCount);
+ };
+
+ var OfEnumerable = (function(__super__) {
+ inherits(OfEnumerable, __super__);
+ function OfEnumerable(s, fn, thisArg) {
+ this.s = s;
+ this.fn = fn ? bindCallback(fn, thisArg, 3) : null;
+ }
+ OfEnumerable.prototype[$iterator$] = function () {
+ return new OfEnumerator(this);
+ };
+
+ function OfEnumerator(p) {
+ this.i = -1;
+ this.s = p.s;
+ this.l = this.s.length;
+ this.fn = p.fn;
+ }
+ OfEnumerator.prototype.next = function () {
+ return ++this.i < this.l ?
+ { done: false, value: !this.fn ? this.s[this.i] : this.fn(this.s[this.i], this.i, this.s) } :
+ doneEnumerator;
+ };
+
+ return OfEnumerable;
+ }(Enumerable));
+
+ var enumerableOf = Enumerable.of = function (source, selector, thisArg) {
+ return new OfEnumerable(source, selector, thisArg);
+ };
+
+ var ToArrayObservable = (function(__super__) {
+ inherits(ToArrayObservable, __super__);
+ function ToArrayObservable(source) {
+ this.source = source;
+ __super__.call(this);
+ }
+
+ ToArrayObservable.prototype.subscribeCore = function(o) {
+ return this.source.subscribe(new InnerObserver(o));
+ };
+
+ function InnerObserver(o) {
+ this.o = o;
+ this.a = [];
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) { if(!this.isStopped) { this.a.push(x); } };
+ InnerObserver.prototype.onError = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onNext(this.a);
+ this.o.onCompleted();
+ }
+ };
+ InnerObserver.prototype.dispose = function () { this.isStopped = true; }
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ return ToArrayObservable;
+ }(ObservableBase));
+
+ /**
+ * Creates an array from an observable sequence.
+ * @returns {Observable} An observable sequence containing a single element with a list containing all the elements of the source sequence.
+ */
+ observableProto.toArray = function () {
+ return new ToArrayObservable(this);
+ };
+
+ /**
+ * Creates an observable sequence from a specified subscribe method implementation.
+ * @example
+ * var res = Rx.Observable.create(function (observer) { return function () { } );
+ * var res = Rx.Observable.create(function (observer) { return Rx.Disposable.empty; } );
+ * var res = Rx.Observable.create(function (observer) { } );
+ * @param {Function} subscribe Implementation of the resulting observable sequence's subscribe method, returning a function that will be wrapped in a Disposable.
+ * @returns {Observable} The observable sequence with the specified implementation for the Subscribe method.
+ */
+ Observable.create = Observable.createWithDisposable = function (subscribe, parent) {
+ return new AnonymousObservable(subscribe, parent);
+ };
+
+ /**
+ * Returns an observable sequence that invokes the specified factory function whenever a new observer subscribes.
+ *
+ * @example
+ * var res = Rx.Observable.defer(function () { return Rx.Observable.fromArray([1,2,3]); });
+ * @param {Function} observableFactory Observable factory function to invoke for each observer that subscribes to the resulting sequence or Promise.
+ * @returns {Observable} An observable sequence whose observers trigger an invocation of the given observable factory function.
+ */
+ var observableDefer = Observable.defer = function (observableFactory) {
+ return new AnonymousObservable(function (observer) {
+ var result;
+ try {
+ result = observableFactory();
+ } catch (e) {
+ return observableThrow(e).subscribe(observer);
+ }
+ isPromise(result) && (result = observableFromPromise(result));
+ return result.subscribe(observer);
+ });
+ };
+
+ var EmptyObservable = (function(__super__) {
+ inherits(EmptyObservable, __super__);
+ function EmptyObservable(scheduler) {
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ EmptyObservable.prototype.subscribeCore = function (observer) {
+ var sink = new EmptySink(observer, this);
+ return sink.run();
+ };
+
+ function EmptySink(observer, parent) {
+ this.observer = observer;
+ this.parent = parent;
+ }
+
+ function scheduleItem(s, state) {
+ state.onCompleted();
+ }
+
+ EmptySink.prototype.run = function () {
+ return this.parent.scheduler.scheduleWithState(this.observer, scheduleItem);
+ };
+
+ return EmptyObservable;
+ }(ObservableBase));
+
+ /**
+ * Returns an empty observable sequence, using the specified scheduler to send out the single OnCompleted message.
+ *
+ * @example
+ * var res = Rx.Observable.empty();
+ * var res = Rx.Observable.empty(Rx.Scheduler.timeout);
+ * @param {Scheduler} [scheduler] Scheduler to send the termination call on.
+ * @returns {Observable} An observable sequence with no elements.
+ */
+ var observableEmpty = Observable.empty = function (scheduler) {
+ isScheduler(scheduler) || (scheduler = immediateScheduler);
+ return new EmptyObservable(scheduler);
+ };
+
+ var FromObservable = (function(__super__) {
+ inherits(FromObservable, __super__);
+ function FromObservable(iterable, mapper, scheduler) {
+ this.iterable = iterable;
+ this.mapper = mapper;
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ FromObservable.prototype.subscribeCore = function (observer) {
+ var sink = new FromSink(observer, this);
+ return sink.run();
+ };
+
+ return FromObservable;
+ }(ObservableBase));
+
+ var FromSink = (function () {
+ function FromSink(observer, parent) {
+ this.observer = observer;
+ this.parent = parent;
+ }
+
+ FromSink.prototype.run = function () {
+ var list = Object(this.parent.iterable),
+ it = getIterable(list),
+ observer = this.observer,
+ mapper = this.parent.mapper;
+
+ function loopRecursive(i, recurse) {
+ try {
+ var next = it.next();
+ } catch (e) {
+ return observer.onError(e);
+ }
+ if (next.done) {
+ return observer.onCompleted();
+ }
+
+ var result = next.value;
+
+ if (mapper) {
+ try {
+ result = mapper(result, i);
+ } catch (e) {
+ return observer.onError(e);
+ }
+ }
+
+ observer.onNext(result);
+ recurse(i + 1);
+ }
+
+ return this.parent.scheduler.scheduleRecursiveWithState(0, loopRecursive);
+ };
+
+ return FromSink;
+ }());
+
+ var maxSafeInteger = Math.pow(2, 53) - 1;
+
+ function StringIterable(str) {
+ this._s = s;
+ }
+
+ StringIterable.prototype[$iterator$] = function () {
+ return new StringIterator(this._s);
+ };
+
+ function StringIterator(str) {
+ this._s = s;
+ this._l = s.length;
+ this._i = 0;
+ }
+
+ StringIterator.prototype[$iterator$] = function () {
+ return this;
+ };
+
+ StringIterator.prototype.next = function () {
+ return this._i < this._l ? { done: false, value: this._s.charAt(this._i++) } : doneEnumerator;
+ };
+
+ function ArrayIterable(a) {
+ this._a = a;
+ }
+
+ ArrayIterable.prototype[$iterator$] = function () {
+ return new ArrayIterator(this._a);
+ };
+
+ function ArrayIterator(a) {
+ this._a = a;
+ this._l = toLength(a);
+ this._i = 0;
+ }
+
+ ArrayIterator.prototype[$iterator$] = function () {
+ return this;
+ };
+
+ ArrayIterator.prototype.next = function () {
+ return this._i < this._l ? { done: false, value: this._a[this._i++] } : doneEnumerator;
+ };
+
+ function numberIsFinite(value) {
+ return typeof value === 'number' && root.isFinite(value);
+ }
+
+ function isNan(n) {
+ return n !== n;
+ }
+
+ function getIterable(o) {
+ var i = o[$iterator$], it;
+ if (!i && typeof o === 'string') {
+ it = new StringIterable(o);
+ return it[$iterator$]();
+ }
+ if (!i && o.length !== undefined) {
+ it = new ArrayIterable(o);
+ return it[$iterator$]();
+ }
+ if (!i) { throw new TypeError('Object is not iterable'); }
+ return o[$iterator$]();
+ }
+
+ function sign(value) {
+ var number = +value;
+ if (number === 0) { return number; }
+ if (isNaN(number)) { return number; }
+ return number < 0 ? -1 : 1;
+ }
+
+ function toLength(o) {
+ var len = +o.length;
+ if (isNaN(len)) { return 0; }
+ if (len === 0 || !numberIsFinite(len)) { return len; }
+ len = sign(len) * Math.floor(Math.abs(len));
+ if (len <= 0) { return 0; }
+ if (len > maxSafeInteger) { return maxSafeInteger; }
+ return len;
+ }
+
+ /**
+ * This method creates a new Observable sequence from an array-like or iterable object.
+ * @param {Any} arrayLike An array-like or iterable object to convert to an Observable sequence.
+ * @param {Function} [mapFn] Map function to call on every element of the array.
+ * @param {Any} [thisArg] The context to use calling the mapFn if provided.
+ * @param {Scheduler} [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread.
+ */
+ var observableFrom = Observable.from = function (iterable, mapFn, thisArg, scheduler) {
+ if (iterable == null) {
+ throw new Error('iterable cannot be null.')
+ }
+ if (mapFn && !isFunction(mapFn)) {
+ throw new Error('mapFn when provided must be a function');
+ }
+ if (mapFn) {
+ var mapper = bindCallback(mapFn, thisArg, 2);
+ }
+ isScheduler(scheduler) || (scheduler = currentThreadScheduler);
+ return new FromObservable(iterable, mapper, scheduler);
+ }
+
+ var FromArrayObservable = (function(__super__) {
+ inherits(FromArrayObservable, __super__);
+ function FromArrayObservable(args, scheduler) {
+ this.args = args;
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ FromArrayObservable.prototype.subscribeCore = function (observer) {
+ var sink = new FromArraySink(observer, this);
+ return sink.run();
+ };
+
+ return FromArrayObservable;
+ }(ObservableBase));
+
+ function FromArraySink(observer, parent) {
+ this.observer = observer;
+ this.parent = parent;
+ }
+
+ FromArraySink.prototype.run = function () {
+ var observer = this.observer, args = this.parent.args, len = args.length;
+ function loopRecursive(i, recurse) {
+ if (i < len) {
+ observer.onNext(args[i]);
+ recurse(i + 1);
+ } else {
+ observer.onCompleted();
+ }
+ }
+
+ return this.parent.scheduler.scheduleRecursiveWithState(0, loopRecursive);
+ };
+
+ /**
+ * Converts an array to an observable sequence, using an optional scheduler to enumerate the array.
+ * @deprecated use Observable.from or Observable.of
+ * @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on.
+ * @returns {Observable} The observable sequence whose elements are pulled from the given enumerable sequence.
+ */
+ var observableFromArray = Observable.fromArray = function (array, scheduler) {
+ isScheduler(scheduler) || (scheduler = currentThreadScheduler);
+ return new FromArrayObservable(array, scheduler)
+ };
+
+ var NeverObservable = (function(__super__) {
+ inherits(NeverObservable, __super__);
+ function NeverObservable() {
+ __super__.call(this);
+ }
+
+ NeverObservable.prototype.subscribeCore = function (observer) {
+ return disposableEmpty;
+ };
+
+ return NeverObservable;
+ }(ObservableBase));
+
+ /**
+ * Returns a non-terminating observable sequence, which can be used to denote an infinite duration (e.g. when using reactive joins).
+ * @returns {Observable} An observable sequence whose observers will never get called.
+ */
+ var observableNever = Observable.never = function () {
+ return new NeverObservable();
+ };
+
+ function observableOf (scheduler, array) {
+ isScheduler(scheduler) || (scheduler = currentThreadScheduler);
+ return new FromArrayObservable(array, scheduler);
+ }
+
+ /**
+ * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments.
+ * @returns {Observable} The observable sequence whose elements are pulled from the given arguments.
+ */
+ Observable.of = function () {
+ var len = arguments.length, args = new Array(len);
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+ return new FromArrayObservable(args, currentThreadScheduler);
+ };
+
+ /**
+ * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments.
+ * @param {Scheduler} scheduler A scheduler to use for scheduling the arguments.
+ * @returns {Observable} The observable sequence whose elements are pulled from the given arguments.
+ */
+ Observable.ofWithScheduler = function (scheduler) {
+ var len = arguments.length, args = new Array(len - 1);
+ for(var i = 1; i < len; i++) { args[i - 1] = arguments[i]; }
+ return new FromArrayObservable(args, scheduler);
+ };
+
+ var PairsObservable = (function(__super__) {
+ inherits(PairsObservable, __super__);
+ function PairsObservable(obj, scheduler) {
+ this.obj = obj;
+ this.keys = Object.keys(obj);
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ PairsObservable.prototype.subscribeCore = function (observer) {
+ var sink = new PairsSink(observer, this);
+ return sink.run();
+ };
+
+ return PairsObservable;
+ }(ObservableBase));
+
+ function PairsSink(observer, parent) {
+ this.observer = observer;
+ this.parent = parent;
+ }
+
+ PairsSink.prototype.run = function () {
+ var observer = this.observer, obj = this.parent.obj, keys = this.parent.keys, len = keys.length;
+ function loopRecursive(i, recurse) {
+ if (i < len) {
+ var key = keys[i];
+ observer.onNext([key, obj[key]]);
+ recurse(i + 1);
+ } else {
+ observer.onCompleted();
+ }
+ }
+
+ return this.parent.scheduler.scheduleRecursiveWithState(0, loopRecursive);
+ };
+
+ /**
+ * Convert an object into an observable sequence of [key, value] pairs.
+ * @param {Object} obj The object to inspect.
+ * @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on.
+ * @returns {Observable} An observable sequence of [key, value] pairs from the object.
+ */
+ Observable.pairs = function (obj, scheduler) {
+ scheduler || (scheduler = currentThreadScheduler);
+ return new PairsObservable(obj, scheduler);
+ };
+
+ var RangeObservable = (function(__super__) {
+ inherits(RangeObservable, __super__);
+ function RangeObservable(start, count, scheduler) {
+ this.start = start;
+ this.rangeCount = count;
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ RangeObservable.prototype.subscribeCore = function (observer) {
+ var sink = new RangeSink(observer, this);
+ return sink.run();
+ };
+
+ return RangeObservable;
+ }(ObservableBase));
+
+ var RangeSink = (function () {
+ function RangeSink(observer, parent) {
+ this.observer = observer;
+ this.parent = parent;
+ }
+
+ RangeSink.prototype.run = function () {
+ var start = this.parent.start, count = this.parent.rangeCount, observer = this.observer;
+ function loopRecursive(i, recurse) {
+ if (i < count) {
+ observer.onNext(start + i);
+ recurse(i + 1);
+ } else {
+ observer.onCompleted();
+ }
+ }
+
+ return this.parent.scheduler.scheduleRecursiveWithState(0, loopRecursive);
+ };
+
+ return RangeSink;
+ }());
+
+ /**
+ * Generates an observable sequence of integral numbers within a specified range, using the specified scheduler to send out observer messages.
+ * @param {Number} start The value of the first integer in the sequence.
+ * @param {Number} count The number of sequential integers to generate.
+ * @param {Scheduler} [scheduler] Scheduler to run the generator loop on. If not specified, defaults to Scheduler.currentThread.
+ * @returns {Observable} An observable sequence that contains a range of sequential integral numbers.
+ */
+ Observable.range = function (start, count, scheduler) {
+ isScheduler(scheduler) || (scheduler = currentThreadScheduler);
+ return new RangeObservable(start, count, scheduler);
+ };
+
+ var RepeatObservable = (function(__super__) {
+ inherits(RepeatObservable, __super__);
+ function RepeatObservable(value, repeatCount, scheduler) {
+ this.value = value;
+ this.repeatCount = repeatCount == null ? -1 : repeatCount;
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ RepeatObservable.prototype.subscribeCore = function (observer) {
+ var sink = new RepeatSink(observer, this);
+ return sink.run();
+ };
+
+ return RepeatObservable;
+ }(ObservableBase));
+
+ function RepeatSink(observer, parent) {
+ this.observer = observer;
+ this.parent = parent;
+ }
+
+ RepeatSink.prototype.run = function () {
+ var observer = this.observer, value = this.parent.value;
+ function loopRecursive(i, recurse) {
+ if (i === -1 || i > 0) {
+ observer.onNext(value);
+ i > 0 && i--;
+ }
+ if (i === 0) { return observer.onCompleted(); }
+ recurse(i);
+ }
+
+ return this.parent.scheduler.scheduleRecursiveWithState(this.parent.repeatCount, loopRecursive);
+ };
+
+ /**
+ * Generates an observable sequence that repeats the given element the specified number of times, using the specified scheduler to send out observer messages.
+ * @param {Mixed} value Element to repeat.
+ * @param {Number} repeatCount [Optiona] Number of times to repeat the element. If not specified, repeats indefinitely.
+ * @param {Scheduler} scheduler Scheduler to run the producer loop on. If not specified, defaults to Scheduler.immediate.
+ * @returns {Observable} An observable sequence that repeats the given element the specified number of times.
+ */
+ Observable.repeat = function (value, repeatCount, scheduler) {
+ isScheduler(scheduler) || (scheduler = currentThreadScheduler);
+ return new RepeatObservable(value, repeatCount, scheduler);
+ };
+
+ var JustObservable = (function(__super__) {
+ inherits(JustObservable, __super__);
+ function JustObservable(value, scheduler) {
+ this.value = value;
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ JustObservable.prototype.subscribeCore = function (observer) {
+ var sink = new JustSink(observer, this);
+ return sink.run();
+ };
+
+ function JustSink(observer, parent) {
+ this.observer = observer;
+ this.parent = parent;
+ }
+
+ function scheduleItem(s, state) {
+ var value = state[0], observer = state[1];
+ observer.onNext(value);
+ observer.onCompleted();
+ }
+
+ JustSink.prototype.run = function () {
+ return this.parent.scheduler.scheduleWithState([this.parent.value, this.observer], scheduleItem);
+ };
+
+ return JustObservable;
+ }(ObservableBase));
+
+ /**
+ * Returns an observable sequence that contains a single element, using the specified scheduler to send out observer messages.
+ * There is an alias called 'just' or browsers <IE9.
+ * @param {Mixed} value Single element in the resulting observable sequence.
+ * @param {Scheduler} scheduler Scheduler to send the single element on. If not specified, defaults to Scheduler.immediate.
+ * @returns {Observable} An observable sequence containing the single specified element.
+ */
+ var observableReturn = Observable['return'] = Observable.just = Observable.returnValue = function (value, scheduler) {
+ isScheduler(scheduler) || (scheduler = immediateScheduler);
+ return new JustObservable(value, scheduler);
+ };
+
+ var ThrowObservable = (function(__super__) {
+ inherits(ThrowObservable, __super__);
+ function ThrowObservable(error, scheduler) {
+ this.error = error;
+ this.scheduler = scheduler;
+ __super__.call(this);
+ }
+
+ ThrowObservable.prototype.subscribeCore = function (o) {
+ var sink = new ThrowSink(o, this);
+ return sink.run();
+ };
+
+ function ThrowSink(o, p) {
+ this.o = o;
+ this.p = p;
+ }
+
+ function scheduleItem(s, state) {
+ var e = state[0], o = state[1];
+ o.onError(e);
+ }
+
+ ThrowSink.prototype.run = function () {
+ return this.p.scheduler.scheduleWithState([this.p.error, this.o], scheduleItem);
+ };
+
+ return ThrowObservable;
+ }(ObservableBase));
+
+ /**
+ * Returns an observable sequence that terminates with an exception, using the specified scheduler to send out the single onError message.
+ * There is an alias to this method called 'throwError' for browsers <IE9.
+ * @param {Mixed} error An object used for the sequence's termination.
+ * @param {Scheduler} scheduler Scheduler to send the exceptional termination call on. If not specified, defaults to Scheduler.immediate.
+ * @returns {Observable} The observable sequence that terminates exceptionally with the specified exception object.
+ */
+ var observableThrow = Observable['throw'] = Observable.throwError = Observable.throwException = function (error, scheduler) {
+ isScheduler(scheduler) || (scheduler = immediateScheduler);
+ return new ThrowObservable(error, scheduler);
+ };
+
+ function observableCatchHandler(source, handler) {
+ return new AnonymousObservable(function (o) {
+ var d1 = new SingleAssignmentDisposable(), subscription = new SerialDisposable();
+ subscription.setDisposable(d1);
+ d1.setDisposable(source.subscribe(function (x) { o.onNext(x); }, function (e) {
+ try {
+ var result = handler(e);
+ } catch (ex) {
+ return o.onError(ex);
+ }
+ isPromise(result) && (result = observableFromPromise(result));
+
+ var d = new SingleAssignmentDisposable();
+ subscription.setDisposable(d);
+ d.setDisposable(result.subscribe(o));
+ }, function (x) { o.onCompleted(x); }));
+
+ return subscription;
+ }, source);
+ }
+
+ /**
+ * Continues an observable sequence that is terminated by an exception with the next observable sequence.
+ * @example
+ * 1 - xs.catchException(ys)
+ * 2 - xs.catchException(function (ex) { return ys(ex); })
+ * @param {Mixed} handlerOrSecond Exception handler function that returns an observable sequence given the error that occurred in the first sequence, or a second observable sequence used to produce results when an error occurred in the first sequence.
+ * @returns {Observable} An observable sequence containing the first sequence's elements, followed by the elements of the handler sequence in case an exception occurred.
+ */
+ observableProto['catch'] = observableProto.catchError = observableProto.catchException = function (handlerOrSecond) {
+ return typeof handlerOrSecond === 'function' ?
+ observableCatchHandler(this, handlerOrSecond) :
+ observableCatch([this, handlerOrSecond]);
+ };
+
+ /**
+ * Continues an observable sequence that is terminated by an exception with the next observable sequence.
+ * @param {Array | Arguments} args Arguments or an array to use as the next sequence if an error occurs.
+ * @returns {Observable} An observable sequence containing elements from consecutive source sequences until a source sequence terminates successfully.
+ */
+ var observableCatch = Observable.catchError = Observable['catch'] = Observable.catchException = function () {
+ var items = [];
+ if (Array.isArray(arguments[0])) {
+ items = arguments[0];
+ } else {
+ for(var i = 0, len = arguments.length; i < len; i++) { items.push(arguments[i]); }
+ }
+ return enumerableOf(items).catchError();
+ };
+
+ /**
+ * Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element.
+ * This can be in the form of an argument list of observables or an array.
+ *
+ * @example
+ * 1 - obs = observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
+ * 2 - obs = observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
+ * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
+ */
+ observableProto.combineLatest = function () {
+ var len = arguments.length, args = new Array(len);
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+ if (Array.isArray(args[0])) {
+ args[0].unshift(this);
+ } else {
+ args.unshift(this);
+ }
+ return combineLatest.apply(this, args);
+ };
+
+ /**
+ * Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element.
+ *
+ * @example
+ * 1 - obs = Rx.Observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
+ * 2 - obs = Rx.Observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
+ * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
+ */
+ var combineLatest = Observable.combineLatest = function () {
+ var len = arguments.length, args = new Array(len);
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+ var resultSelector = args.pop();
+ Array.isArray(args[0]) && (args = args[0]);
+
+ return new AnonymousObservable(function (o) {
+ var n = args.length,
+ falseFactory = function () { return false; },
+ hasValue = arrayInitialize(n, falseFactory),
+ hasValueAll = false,
+ isDone = arrayInitialize(n, falseFactory),
+ values = new Array(n);
+
+ function next(i) {
+ hasValue[i] = true;
+ if (hasValueAll || (hasValueAll = hasValue.every(identity))) {
+ try {
+ var res = resultSelector.apply(null, values);
+ } catch (e) {
+ return o.onError(e);
+ }
+ o.onNext(res);
+ } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) {
+ o.onCompleted();
+ }
+ }
+
+ function done (i) {
+ isDone[i] = true;
+ isDone.every(identity) && o.onCompleted();
+ }
+
+ var subscriptions = new Array(n);
+ for (var idx = 0; idx < n; idx++) {
+ (function (i) {
+ var source = args[i], sad = new SingleAssignmentDisposable();
+ isPromise(source) && (source = observableFromPromise(source));
+ sad.setDisposable(source.subscribe(function (x) {
+ values[i] = x;
+ next(i);
+ },
+ function(e) { o.onError(e); },
+ function () { done(i); }
+ ));
+ subscriptions[i] = sad;
+ }(idx));
+ }
+
+ return new CompositeDisposable(subscriptions);
+ }, this);
+ };
+
+ /**
+ * Concatenates all the observable sequences. This takes in either an array or variable arguments to concatenate.
+ * @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order.
+ */
+ observableProto.concat = function () {
+ for(var args = [], i = 0, len = arguments.length; i < len; i++) { args.push(arguments[i]); }
+ args.unshift(this);
+ return observableConcat.apply(null, args);
+ };
+
+ var ConcatObservable = (function(__super__) {
+ inherits(ConcatObservable, __super__);
+ function ConcatObservable(sources) {
+ this.sources = sources;
+ __super__.call(this);
+ }
+
+ ConcatObservable.prototype.subscribeCore = function(o) {
+ var sink = new ConcatSink(this.sources, o);
+ return sink.run();
+ };
+
+ function ConcatSink(sources, o) {
+ this.sources = sources;
+ this.o = o;
+ }
+ ConcatSink.prototype.run = function () {
+ var isDisposed, subscription = new SerialDisposable(), sources = this.sources, length = sources.length, o = this.o;
+ var cancelable = immediateScheduler.scheduleRecursiveWithState(0, function (i, self) {
+ if (isDisposed) { return; }
+ if (i === length) {
+ return o.onCompleted();
+ }
+
+ // Check if promise
+ var currentValue = sources[i];
+ isPromise(currentValue) && (currentValue = observableFromPromise(currentValue));
+
+ var d = new SingleAssignmentDisposable();
+ subscription.setDisposable(d);
+ d.setDisposable(currentValue.subscribe(
+ function (x) { o.onNext(x); },
+ function (e) { o.onError(e); },
+ function () { self(i + 1); }
+ ));
+ });
+
+ return new CompositeDisposable(subscription, cancelable, disposableCreate(function () {
+ isDisposed = true;
+ }));
+ };
+
+
+ return ConcatObservable;
+ }(ObservableBase));
+
+ /**
+ * Concatenates all the observable sequences.
+ * @param {Array | Arguments} args Arguments or an array to concat to the observable sequence.
+ * @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order.
+ */
+ var observableConcat = Observable.concat = function () {
+ var args;
+ if (Array.isArray(arguments[0])) {
+ args = arguments[0];
+ } else {
+ args = new Array(arguments.length);
+ for(var i = 0, len = arguments.length; i < len; i++) { args[i] = arguments[i]; }
+ }
+ return new ConcatObservable(args);
+ };
+
+ /**
+ * Concatenates an observable sequence of observable sequences.
+ * @returns {Observable} An observable sequence that contains the elements of each observed inner sequence, in sequential order.
+ */
+ observableProto.concatAll = observableProto.concatObservable = function () {
+ return this.merge(1);
+ };
+
+ var MergeObservable = (function (__super__) {
+ inherits(MergeObservable, __super__);
+
+ function MergeObservable(source, maxConcurrent) {
+ this.source = source;
+ this.maxConcurrent = maxConcurrent;
+ __super__.call(this);
+ }
+
+ MergeObservable.prototype.subscribeCore = function(observer) {
+ var g = new CompositeDisposable();
+ g.add(this.source.subscribe(new MergeObserver(observer, this.maxConcurrent, g)));
+ return g;
+ };
+
+ return MergeObservable;
+
+ }(ObservableBase));
+
+ var MergeObserver = (function () {
+ function MergeObserver(o, max, g) {
+ this.o = o;
+ this.max = max;
+ this.g = g;
+ this.done = false;
+ this.q = [];
+ this.activeCount = 0;
+ this.isStopped = false;
+ }
+ MergeObserver.prototype.handleSubscribe = function (xs) {
+ var sad = new SingleAssignmentDisposable();
+ this.g.add(sad);
+ isPromise(xs) && (xs = observableFromPromise(xs));
+ sad.setDisposable(xs.subscribe(new InnerObserver(this, sad)));
+ };
+ MergeObserver.prototype.onNext = function (innerSource) {
+ if (this.isStopped) { return; }
+ if(this.activeCount < this.max) {
+ this.activeCount++;
+ this.handleSubscribe(innerSource);
+ } else {
+ this.q.push(innerSource);
+ }
+ };
+ MergeObserver.prototype.onError = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ }
+ };
+ MergeObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.done = true;
+ this.activeCount === 0 && this.o.onCompleted();
+ }
+ };
+ MergeObserver.prototype.dispose = function() { this.isStopped = true; };
+ MergeObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ function InnerObserver(parent, sad) {
+ this.parent = parent;
+ this.sad = sad;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) { if(!this.isStopped) { this.parent.o.onNext(x); } };
+ InnerObserver.prototype.onError = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.parent.o.onError(e);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ var parent = this.parent;
+ parent.g.remove(this.sad);
+ if (parent.q.length > 0) {
+ parent.handleSubscribe(parent.q.shift());
+ } else {
+ parent.activeCount--;
+ parent.done && parent.activeCount === 0 && parent.o.onCompleted();
+ }
+ }
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.parent.o.onError(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ return MergeObserver;
+ }());
+
+
+
+
+
+ /**
+ * Merges an observable sequence of observable sequences into an observable sequence, limiting the number of concurrent subscriptions to inner sequences.
+ * Or merges two observable sequences into a single observable sequence.
+ *
+ * @example
+ * 1 - merged = sources.merge(1);
+ * 2 - merged = source.merge(otherSource);
+ * @param {Mixed} [maxConcurrentOrOther] Maximum number of inner observable sequences being subscribed to concurrently or the second observable sequence.
+ * @returns {Observable} The observable sequence that merges the elements of the inner sequences.
+ */
+ observableProto.merge = function (maxConcurrentOrOther) {
+ return typeof maxConcurrentOrOther !== 'number' ?
+ observableMerge(this, maxConcurrentOrOther) :
+ new MergeObservable(this, maxConcurrentOrOther);
+ };
+
+ /**
+ * Merges all the observable sequences into a single observable sequence.
+ * The scheduler is optional and if not specified, the immediate scheduler is used.
+ * @returns {Observable} The observable sequence that merges the elements of the observable sequences.
+ */
+ var observableMerge = Observable.merge = function () {
+ var scheduler, sources = [], i, len = arguments.length;
+ if (!arguments[0]) {
+ scheduler = immediateScheduler;
+ for(i = 1; i < len; i++) { sources.push(arguments[i]); }
+ } else if (isScheduler(arguments[0])) {
+ scheduler = arguments[0];
+ for(i = 1; i < len; i++) { sources.push(arguments[i]); }
+ } else {
+ scheduler = immediateScheduler;
+ for(i = 0; i < len; i++) { sources.push(arguments[i]); }
+ }
+ if (Array.isArray(sources[0])) {
+ sources = sources[0];
+ }
+ return observableOf(scheduler, sources).mergeAll();
+ };
+
+ var CompositeError = Rx.CompositeError = function(errors) {
+ this.name = "NotImplementedError";
+ this.innerErrors = errors;
+ this.message = 'This contains multiple errors. Check the innerErrors';
+ Error.call(this);
+ }
+ CompositeError.prototype = Error.prototype;
+
+ /**
+ * Flattens an Observable that emits Observables into one Observable, in a way that allows an Observer to
+ * receive all successfully emitted items from all of the source Observables without being interrupted by
+ * an error notification from one of them.
+ *
+ * This behaves like Observable.prototype.mergeAll except that if any of the merged Observables notify of an
+ * error via the Observer's onError, mergeDelayError will refrain from propagating that
+ * error notification until all of the merged Observables have finished emitting items.
+ * @param {Array | Arguments} args Arguments or an array to merge.
+ * @returns {Observable} an Observable that emits all of the items emitted by the Observables emitted by the Observable
+ */
+ Observable.mergeDelayError = function() {
+ var args;
+ if (Array.isArray(arguments[0])) {
+ args = arguments[0];
+ } else {
+ var len = arguments.length;
+ args = new Array(len);
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+ }
+ var source = observableOf(null, args);
+
+ return new AnonymousObservable(function (o) {
+ var group = new CompositeDisposable(),
+ m = new SingleAssignmentDisposable(),
+ isStopped = false,
+ errors = [];
+
+ function setCompletion() {
+ if (errors.length === 0) {
+ o.onCompleted();
+ } else if (errors.length === 1) {
+ o.onError(errors[0]);
+ } else {
+ o.onError(new CompositeError(errors));
+ }
+ }
+
+ group.add(m);
+
+ m.setDisposable(source.subscribe(
+ function (innerSource) {
+ var innerSubscription = new SingleAssignmentDisposable();
+ group.add(innerSubscription);
+
+ // Check for promises support
+ isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
+
+ innerSubscription.setDisposable(innerSource.subscribe(
+ function (x) { o.onNext(x); },
+ function (e) {
+ errors.push(e);
+ group.remove(innerSubscription);
+ isStopped && group.length === 1 && setCompletion();
+ },
+ function () {
+ group.remove(innerSubscription);
+ isStopped && group.length === 1 && setCompletion();
+ }));
+ },
+ function (e) {
+ errors.push(e);
+ isStopped = true;
+ group.length === 1 && setCompletion();
+ },
+ function () {
+ isStopped = true;
+ group.length === 1 && setCompletion();
+ }));
+ return group;
+ });
+ };
+
+ var MergeAllObservable = (function (__super__) {
+ inherits(MergeAllObservable, __super__);
+
+ function MergeAllObservable(source) {
+ this.source = source;
+ __super__.call(this);
+ }
+
+ MergeAllObservable.prototype.subscribeCore = function (observer) {
+ var g = new CompositeDisposable(), m = new SingleAssignmentDisposable();
+ g.add(m);
+ m.setDisposable(this.source.subscribe(new MergeAllObserver(observer, g)));
+ return g;
+ };
+
+ function MergeAllObserver(o, g) {
+ this.o = o;
+ this.g = g;
+ this.isStopped = false;
+ this.done = false;
+ }
+ MergeAllObserver.prototype.onNext = function(innerSource) {
+ if(this.isStopped) { return; }
+ var sad = new SingleAssignmentDisposable();
+ this.g.add(sad);
+
+ isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
+
+ sad.setDisposable(innerSource.subscribe(new InnerObserver(this, this.g, sad)));
+ };
+ MergeAllObserver.prototype.onError = function (e) {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ }
+ };
+ MergeAllObserver.prototype.onCompleted = function () {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ this.done = true;
+ this.g.length === 1 && this.o.onCompleted();
+ }
+ };
+ MergeAllObserver.prototype.dispose = function() { this.isStopped = true; };
+ MergeAllObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ function InnerObserver(parent, g, sad) {
+ this.parent = parent;
+ this.g = g;
+ this.sad = sad;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) { if (!this.isStopped) { this.parent.o.onNext(x); } };
+ InnerObserver.prototype.onError = function (e) {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ this.parent.o.onError(e);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if(!this.isStopped) {
+ var parent = this.parent;
+ this.isStopped = true;
+ parent.g.remove(this.sad);
+ parent.done && parent.g.length === 1 && parent.o.onCompleted();
+ }
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.parent.o.onError(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ return MergeAllObservable;
+ }(ObservableBase));
+
+ /**
+ * Merges an observable sequence of observable sequences into an observable sequence.
+ * @returns {Observable} The observable sequence that merges the elements of the inner sequences.
+ */
+ observableProto.mergeAll = observableProto.mergeObservable = function () {
+ return new MergeAllObservable(this);
+ };
+
+ /**
+ * Returns the values from the source observable sequence only after the other observable sequence produces a value.
+ * @param {Observable | Promise} other The observable sequence or Promise that triggers propagation of elements of the source sequence.
+ * @returns {Observable} An observable sequence containing the elements of the source sequence starting from the point the other sequence triggered propagation.
+ */
+ observableProto.skipUntil = function (other) {
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var isOpen = false;
+ var disposables = new CompositeDisposable(source.subscribe(function (left) {
+ isOpen && o.onNext(left);
+ }, function (e) { o.onError(e); }, function () {
+ isOpen && o.onCompleted();
+ }));
+
+ isPromise(other) && (other = observableFromPromise(other));
+
+ var rightSubscription = new SingleAssignmentDisposable();
+ disposables.add(rightSubscription);
+ rightSubscription.setDisposable(other.subscribe(function () {
+ isOpen = true;
+ rightSubscription.dispose();
+ }, function (e) { o.onError(e); }, function () {
+ rightSubscription.dispose();
+ }));
+
+ return disposables;
+ }, source);
+ };
+
+ var SwitchObservable = (function(__super__) {
+ inherits(SwitchObservable, __super__);
+ function SwitchObservable(source) {
+ this.source = source;
+ __super__.call(this);
+ }
+
+ SwitchObservable.prototype.subscribeCore = function (o) {
+ var inner = new SerialDisposable(), s = this.source.subscribe(new SwitchObserver(o, inner));
+ return new CompositeDisposable(s, inner);
+ };
+
+ function SwitchObserver(o, inner) {
+ this.o = o;
+ this.inner = inner;
+ this.stopped = false;
+ this.latest = 0;
+ this.hasLatest = false;
+ this.isStopped = false;
+ }
+ SwitchObserver.prototype.onNext = function (innerSource) {
+ if (this.isStopped) { return; }
+ var d = new SingleAssignmentDisposable(), id = ++this.latest;
+ this.hasLatest = true;
+ this.inner.setDisposable(d);
+ isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
+ d.setDisposable(innerSource.subscribe(new InnerObserver(this, id)));
+ };
+ SwitchObserver.prototype.onError = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ }
+ };
+ SwitchObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.stopped = true;
+ !this.hasLatest && this.o.onCompleted();
+ }
+ };
+ SwitchObserver.prototype.dispose = function () { this.isStopped = true; };
+ SwitchObserver.prototype.fail = function (e) {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ function InnerObserver(parent, id) {
+ this.parent = parent;
+ this.id = id;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) {
+ if (this.isStopped) { return; }
+ this.parent.latest === this.id && this.parent.o.onNext(x);
+ };
+ InnerObserver.prototype.onError = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.parent.latest === this.id && this.parent.o.onError(e);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ if (this.parent.latest === this.id) {
+ this.parent.hasLatest = false;
+ this.parent.isStopped && this.parent.o.onCompleted();
+ }
+ }
+ };
+ InnerObserver.prototype.dispose = function () { this.isStopped = true; }
+ InnerObserver.prototype.fail = function (e) {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ this.parent.o.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ return SwitchObservable;
+ }(ObservableBase));
+
+ /**
+ * Transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
+ * @returns {Observable} The observable sequence that at any point in time produces the elements of the most recent inner observable sequence that has been received.
+ */
+ observableProto['switch'] = observableProto.switchLatest = function () {
+ return new SwitchObservable(this);
+ };
+
+ var TakeUntilObservable = (function(__super__) {
+ inherits(TakeUntilObservable, __super__);
+
+ function TakeUntilObservable(source, other) {
+ this.source = source;
+ this.other = isPromise(other) ? observableFromPromise(other) : other;
+ __super__.call(this);
+ }
+
+ TakeUntilObservable.prototype.subscribeCore = function(o) {
+ return new CompositeDisposable(
+ this.source.subscribe(o),
+ this.other.subscribe(new InnerObserver(o))
+ );
+ };
+
+ function InnerObserver(o) {
+ this.o = o;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) {
+ if (this.isStopped) { return; }
+ this.o.onCompleted();
+ };
+ InnerObserver.prototype.onError = function (err) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(err);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ !this.isStopped && (this.isStopped = true);
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ return TakeUntilObservable;
+ }(ObservableBase));
+
+ /**
+ * Returns the values from the source observable sequence until the other observable sequence produces a value.
+ * @param {Observable | Promise} other Observable sequence or Promise that terminates propagation of elements of the source sequence.
+ * @returns {Observable} An observable sequence containing the elements of the source sequence up to the point the other sequence interrupted further propagation.
+ */
+ observableProto.takeUntil = function (other) {
+ return new TakeUntilObservable(this, other);
+ };
+
+ function falseFactory() { return false; }
+
+ /**
+ * Merges the specified observable sequences into one observable sequence by using the selector function only when the (first) source observable sequence produces an element.
+ * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
+ */
+ observableProto.withLatestFrom = function () {
+ var len = arguments.length, args = new Array(len)
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+ var resultSelector = args.pop(), source = this;
+ Array.isArray(args[0]) && (args = args[0]);
+
+ return new AnonymousObservable(function (observer) {
+ var n = args.length,
+ hasValue = arrayInitialize(n, falseFactory),
+ hasValueAll = false,
+ values = new Array(n);
+
+ var subscriptions = new Array(n + 1);
+ for (var idx = 0; idx < n; idx++) {
+ (function (i) {
+ var other = args[i], sad = new SingleAssignmentDisposable();
+ isPromise(other) && (other = observableFromPromise(other));
+ sad.setDisposable(other.subscribe(function (x) {
+ values[i] = x;
+ hasValue[i] = true;
+ hasValueAll = hasValue.every(identity);
+ }, function (e) { observer.onError(e); }, noop));
+ subscriptions[i] = sad;
+ }(idx));
+ }
+
+ var sad = new SingleAssignmentDisposable();
+ sad.setDisposable(source.subscribe(function (x) {
+ var allValues = [x].concat(values);
+ if (!hasValueAll) { return; }
+ var res = tryCatch(resultSelector).apply(null, allValues);
+ if (res === errorObj) { return observer.onError(res.e); }
+ observer.onNext(res);
+ }, function (e) { observer.onError(e); }, function () {
+ observer.onCompleted();
+ }));
+ subscriptions[n] = sad;
+
+ return new CompositeDisposable(subscriptions);
+ }, this);
+ };
+
+ function zipArray(second, resultSelector) {
+ var first = this;
+ return new AnonymousObservable(function (o) {
+ var index = 0, len = second.length;
+ return first.subscribe(function (left) {
+ if (index < len) {
+ var right = second[index++], res = tryCatch(resultSelector)(left, right);
+ if (res === errorObj) { return o.onError(res.e); }
+ o.onNext(res);
+ } else {
+ o.onCompleted();
+ }
+ }, function (e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, first);
+ }
+
+ function falseFactory() { return false; }
+ function emptyArrayFactory() { return []; }
+
+ /**
+ * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences or an array have produced an element at a corresponding index.
+ * The last element in the arguments must be a function to invoke for each series of elements at corresponding indexes in the args.
+ * @returns {Observable} An observable sequence containing the result of combining elements of the args using the specified result selector function.
+ */
+ observableProto.zip = function () {
+ if (Array.isArray(arguments[0])) { return zipArray.apply(this, arguments); }
+ var len = arguments.length, args = new Array(len);
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+
+ var parent = this, resultSelector = args.pop();
+ args.unshift(parent);
+ return new AnonymousObservable(function (o) {
+ var n = args.length,
+ queues = arrayInitialize(n, emptyArrayFactory),
+ isDone = arrayInitialize(n, falseFactory);
+
+ var subscriptions = new Array(n);
+ for (var idx = 0; idx < n; idx++) {
+ (function (i) {
+ var source = args[i], sad = new SingleAssignmentDisposable();
+ isPromise(source) && (source = observableFromPromise(source));
+ sad.setDisposable(source.subscribe(function (x) {
+ queues[i].push(x);
+ if (queues.every(function (x) { return x.length > 0; })) {
+ var queuedValues = queues.map(function (x) { return x.shift(); }),
+ res = tryCatch(resultSelector).apply(parent, queuedValues);
+ if (res === errorObj) { return o.onError(res.e); }
+ o.onNext(res);
+ } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) {
+ o.onCompleted();
+ }
+ }, function (e) { o.onError(e); }, function () {
+ isDone[i] = true;
+ isDone.every(identity) && o.onCompleted();
+ }));
+ subscriptions[i] = sad;
+ })(idx);
+ }
+
+ return new CompositeDisposable(subscriptions);
+ }, parent);
+ };
+
+ /**
+ * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index.
+ * @param arguments Observable sources.
+ * @param {Function} resultSelector Function to invoke for each series of elements at corresponding indexes in the sources.
+ * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
+ */
+ Observable.zip = function () {
+ var len = arguments.length, args = new Array(len);
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+ var first = args.shift();
+ return first.zip.apply(first, args);
+ };
+
+ function falseFactory() { return false; }
+ function arrayFactory() { return []; }
+
+ /**
+ * Merges the specified observable sequences into one observable sequence by emitting a list with the elements of the observable sequences at corresponding indexes.
+ * @param arguments Observable sources.
+ * @returns {Observable} An observable sequence containing lists of elements at corresponding indexes.
+ */
+ Observable.zipArray = function () {
+ var sources;
+ if (Array.isArray(arguments[0])) {
+ sources = arguments[0];
+ } else {
+ var len = arguments.length;
+ sources = new Array(len);
+ for(var i = 0; i < len; i++) { sources[i] = arguments[i]; }
+ }
+ return new AnonymousObservable(function (o) {
+ var n = sources.length,
+ queues = arrayInitialize(n, arrayFactory),
+ isDone = arrayInitialize(n, falseFactory);
+
+ var subscriptions = new Array(n);
+ for (var idx = 0; idx < n; idx++) {
+ (function (i) {
+ subscriptions[i] = new SingleAssignmentDisposable();
+ subscriptions[i].setDisposable(sources[i].subscribe(function (x) {
+ queues[i].push(x);
+ if (queues.every(function (x) { return x.length > 0; })) {
+ var res = queues.map(function (x) { return x.shift(); });
+ o.onNext(res);
+ } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) {
+ return o.onCompleted();
+ }
+ }, function (e) { o.onError(e); }, function () {
+ isDone[i] = true;
+ isDone.every(identity) && o.onCompleted();
+ }));
+ })(idx);
+ }
+
+ return new CompositeDisposable(subscriptions);
+ });
+ };
+
+ /**
+ * Hides the identity of an observable sequence.
+ * @returns {Observable} An observable sequence that hides the identity of the source sequence.
+ */
+ observableProto.asObservable = function () {
+ var source = this;
+ return new AnonymousObservable(function (o) { return source.subscribe(o); }, source);
+ };
+
+ /**
+ * Dematerializes the explicit notification values of an observable sequence as implicit notifications.
+ * @returns {Observable} An observable sequence exhibiting the behavior corresponding to the source sequence's notification values.
+ */
+ observableProto.dematerialize = function () {
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ return source.subscribe(function (x) { return x.accept(o); }, function(e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, this);
+ };
+
+ /**
+ * Returns an observable sequence that contains only distinct contiguous elements according to the keySelector and the comparer.
+ *
+ * var obs = observable.distinctUntilChanged();
+ * var obs = observable.distinctUntilChanged(function (x) { return x.id; });
+ * var obs = observable.distinctUntilChanged(function (x) { return x.id; }, function (x, y) { return x === y; });
+ *
+ * @param {Function} [keySelector] A function to compute the comparison key for each element. If not provided, it projects the value.
+ * @param {Function} [comparer] Equality comparer for computed key values. If not provided, defaults to an equality comparer function.
+ * @returns {Observable} An observable sequence only containing the distinct contiguous elements, based on a computed key value, from the source sequence.
+ */
+ observableProto.distinctUntilChanged = function (keySelector, comparer) {
+ var source = this;
+ comparer || (comparer = defaultComparer);
+ return new AnonymousObservable(function (o) {
+ var hasCurrentKey = false, currentKey;
+ return source.subscribe(function (value) {
+ var key = value;
+ if (keySelector) {
+ key = tryCatch(keySelector)(value);
+ if (key === errorObj) { return o.onError(key.e); }
+ }
+ if (hasCurrentKey) {
+ var comparerEquals = tryCatch(comparer)(currentKey, key);
+ if (comparerEquals === errorObj) { return o.onError(comparerEquals.e); }
+ }
+ if (!hasCurrentKey || !comparerEquals) {
+ hasCurrentKey = true;
+ currentKey = key;
+ o.onNext(value);
+ }
+ }, function (e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, this);
+ };
+
+ var TapObservable = (function(__super__) {
+ inherits(TapObservable,__super__);
+ function TapObservable(source, observerOrOnNext, onError, onCompleted) {
+ this.source = source;
+ this.t = !observerOrOnNext || isFunction(observerOrOnNext) ?
+ observerCreate(observerOrOnNext || noop, onError || noop, onCompleted || noop) :
+ observerOrOnNext;
+ __super__.call(this);
+ }
+
+ TapObservable.prototype.subscribeCore = function(o) {
+ return this.source.subscribe(new InnerObserver(o, this.t));
+ };
+
+ function InnerObserver(o, t) {
+ this.o = o;
+ this.t = t;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function(x) {
+ if (this.isStopped) { return; }
+ var res = tryCatch(this.t.onNext).call(this.t, x);
+ if (res === errorObj) { this.o.onError(res.e); }
+ this.o.onNext(x);
+ };
+ InnerObserver.prototype.onError = function(err) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ var res = tryCatch(this.t.onError).call(this.t, err);
+ if (res === errorObj) { return this.o.onError(res.e); }
+ this.o.onError(err);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function() {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ var res = tryCatch(this.t.onCompleted).call(this.t);
+ if (res === errorObj) { return this.o.onError(res.e); }
+ this.o.onCompleted();
+ }
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ return TapObservable;
+ }(ObservableBase));
+
+ /**
+ * Invokes an action for each element in the observable sequence and invokes an action upon graceful or exceptional termination of the observable sequence.
+ * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
+ * @param {Function | Observer} observerOrOnNext Action to invoke for each element in the observable sequence or an o.
+ * @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function.
+ * @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function.
+ * @returns {Observable} The source sequence with the side-effecting behavior applied.
+ */
+ observableProto['do'] = observableProto.tap = observableProto.doAction = function (observerOrOnNext, onError, onCompleted) {
+ return new TapObservable(this, observerOrOnNext, onError, onCompleted);
+ };
+
+ /**
+ * Invokes an action for each element in the observable sequence.
+ * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
+ * @param {Function} onNext Action to invoke for each element in the observable sequence.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} The source sequence with the side-effecting behavior applied.
+ */
+ observableProto.doOnNext = observableProto.tapOnNext = function (onNext, thisArg) {
+ return this.tap(typeof thisArg !== 'undefined' ? function (x) { onNext.call(thisArg, x); } : onNext);
+ };
+
+ /**
+ * Invokes an action upon exceptional termination of the observable sequence.
+ * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
+ * @param {Function} onError Action to invoke upon exceptional termination of the observable sequence.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} The source sequence with the side-effecting behavior applied.
+ */
+ observableProto.doOnError = observableProto.tapOnError = function (onError, thisArg) {
+ return this.tap(noop, typeof thisArg !== 'undefined' ? function (e) { onError.call(thisArg, e); } : onError);
+ };
+
+ /**
+ * Invokes an action upon graceful termination of the observable sequence.
+ * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
+ * @param {Function} onCompleted Action to invoke upon graceful termination of the observable sequence.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} The source sequence with the side-effecting behavior applied.
+ */
+ observableProto.doOnCompleted = observableProto.tapOnCompleted = function (onCompleted, thisArg) {
+ return this.tap(noop, null, typeof thisArg !== 'undefined' ? function () { onCompleted.call(thisArg); } : onCompleted);
+ };
+
+ /**
+ * Invokes a specified action after the source observable sequence terminates gracefully or exceptionally.
+ * @param {Function} finallyAction Action to invoke after the source observable sequence terminates.
+ * @returns {Observable} Source sequence with the action-invoking termination behavior applied.
+ */
+ observableProto['finally'] = observableProto.ensure = function (action) {
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ var subscription;
+ try {
+ subscription = source.subscribe(observer);
+ } catch (e) {
+ action();
+ throw e;
+ }
+ return disposableCreate(function () {
+ try {
+ subscription.dispose();
+ } catch (e) {
+ throw e;
+ } finally {
+ action();
+ }
+ });
+ }, this);
+ };
+
+ /**
+ * @deprecated use #finally or #ensure instead.
+ */
+ observableProto.finallyAction = function (action) {
+ //deprecate('finallyAction', 'finally or ensure');
+ return this.ensure(action);
+ };
+
+ var IgnoreElementsObservable = (function(__super__) {
+ inherits(IgnoreElementsObservable, __super__);
+
+ function IgnoreElementsObservable(source) {
+ this.source = source;
+ __super__.call(this);
+ }
+
+ IgnoreElementsObservable.prototype.subscribeCore = function (o) {
+ return this.source.subscribe(new InnerObserver(o));
+ };
+
+ function InnerObserver(o) {
+ this.o = o;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = noop;
+ InnerObserver.prototype.onError = function (err) {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(err);
+ }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if(!this.isStopped) {
+ this.isStopped = true;
+ this.o.onCompleted();
+ }
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.observer.onError(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ return IgnoreElementsObservable;
+ }(ObservableBase));
+
+ /**
+ * Ignores all elements in an observable sequence leaving only the termination messages.
+ * @returns {Observable} An empty observable sequence that signals termination, successful or exceptional, of the source sequence.
+ */
+ observableProto.ignoreElements = function () {
+ return new IgnoreElementsObservable(this);
+ };
+
+ /**
+ * Materializes the implicit notifications of an observable sequence as explicit notification values.
+ * @returns {Observable} An observable sequence containing the materialized notification values from the source sequence.
+ */
+ observableProto.materialize = function () {
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ return source.subscribe(function (value) {
+ observer.onNext(notificationCreateOnNext(value));
+ }, function (e) {
+ observer.onNext(notificationCreateOnError(e));
+ observer.onCompleted();
+ }, function () {
+ observer.onNext(notificationCreateOnCompleted());
+ observer.onCompleted();
+ });
+ }, source);
+ };
+
+ /**
+ * Repeats the observable sequence a specified number of times. If the repeat count is not specified, the sequence repeats indefinitely.
+ * @param {Number} [repeatCount] Number of times to repeat the sequence. If not provided, repeats the sequence indefinitely.
+ * @returns {Observable} The observable sequence producing the elements of the given sequence repeatedly.
+ */
+ observableProto.repeat = function (repeatCount) {
+ return enumerableRepeat(this, repeatCount).concat();
+ };
+
+ /**
+ * Repeats the source observable sequence the specified number of times or until it successfully terminates. If the retry count is not specified, it retries indefinitely.
+ * Note if you encounter an error and want it to retry once, then you must use .retry(2);
+ *
+ * @example
+ * var res = retried = retry.repeat();
+ * var res = retried = retry.repeat(2);
+ * @param {Number} [retryCount] Number of times to retry the sequence. If not provided, retry the sequence indefinitely.
+ * @returns {Observable} An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully.
+ */
+ observableProto.retry = function (retryCount) {
+ return enumerableRepeat(this, retryCount).catchError();
+ };
+
+ /**
+ * Repeats the source observable sequence upon error each time the notifier emits or until it successfully terminates.
+ * if the notifier completes, the observable sequence completes.
+ *
+ * @example
+ * var timer = Observable.timer(500);
+ * var source = observable.retryWhen(timer);
+ * @param {Observable} [notifier] An observable that triggers the retries or completes the observable with onNext or onCompleted respectively.
+ * @returns {Observable} An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully.
+ */
+ observableProto.retryWhen = function (notifier) {
+ return enumerableRepeat(this).catchErrorWhen(notifier);
+ };
+ var ScanObservable = (function(__super__) {
+ inherits(ScanObservable, __super__);
+ function ScanObservable(source, accumulator, hasSeed, seed) {
+ this.source = source;
+ this.accumulator = accumulator;
+ this.hasSeed = hasSeed;
+ this.seed = seed;
+ __super__.call(this);
+ }
+
+ ScanObservable.prototype.subscribeCore = function(observer) {
+ return this.source.subscribe(new ScanObserver(observer,this));
+ };
+
+ return ScanObservable;
+ }(ObservableBase));
+
+ function ScanObserver(observer, parent) {
+ this.observer = observer;
+ this.accumulator = parent.accumulator;
+ this.hasSeed = parent.hasSeed;
+ this.seed = parent.seed;
+ this.hasAccumulation = false;
+ this.accumulation = null;
+ this.hasValue = false;
+ this.isStopped = false;
+ }
+ ScanObserver.prototype.onNext = function (x) {
+ if (this.isStopped) { return; }
+ !this.hasValue && (this.hasValue = true);
+ try {
+ if (this.hasAccumulation) {
+ this.accumulation = this.accumulator(this.accumulation, x);
+ } else {
+ this.accumulation = this.hasSeed ? this.accumulator(this.seed, x) : x;
+ this.hasAccumulation = true;
+ }
+ } catch (e) {
+ return this.observer.onError(e);
+ }
+ this.observer.onNext(this.accumulation);
+ };
+ ScanObserver.prototype.onError = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.observer.onError(e);
+ }
+ };
+ ScanObserver.prototype.onCompleted = function () {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ !this.hasValue && this.hasSeed && this.observer.onNext(this.seed);
+ this.observer.onCompleted();
+ }
+ };
+ ScanObserver.prototype.dispose = function() { this.isStopped = true; };
+ ScanObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.observer.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ /**
+ * Applies an accumulator function over an observable sequence and returns each intermediate result. The optional seed value is used as the initial accumulator value.
+ * For aggregation behavior with no intermediate results, see Observable.aggregate.
+ * @param {Mixed} [seed] The initial accumulator value.
+ * @param {Function} accumulator An accumulator function to be invoked on each element.
+ * @returns {Observable} An observable sequence containing the accumulated values.
+ */
+ observableProto.scan = function () {
+ var hasSeed = false, seed, accumulator, source = this;
+ if (arguments.length === 2) {
+ hasSeed = true;
+ seed = arguments[0];
+ accumulator = arguments[1];
+ } else {
+ accumulator = arguments[0];
+ }
+ return new ScanObservable(this, accumulator, hasSeed, seed);
+ };
+
+ /**
+ * Bypasses a specified number of elements at the end of an observable sequence.
+ * @description
+ * This operator accumulates a queue with a length enough to store the first `count` elements. As more elements are
+ * received, elements are taken from the front of the queue and produced on the result sequence. This causes elements to be delayed.
+ * @param count Number of elements to bypass at the end of the source sequence.
+ * @returns {Observable} An observable sequence containing the source sequence elements except for the bypassed ones at the end.
+ */
+ observableProto.skipLast = function (count) {
+ if (count < 0) { throw new ArgumentOutOfRangeError(); }
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var q = [];
+ return source.subscribe(function (x) {
+ q.push(x);
+ q.length > count && o.onNext(q.shift());
+ }, function (e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, source);
+ };
+
+ /**
+ * Prepends a sequence of values to an observable sequence with an optional scheduler and an argument list of values to prepend.
+ * @example
+ * var res = source.startWith(1, 2, 3);
+ * var res = source.startWith(Rx.Scheduler.timeout, 1, 2, 3);
+ * @param {Arguments} args The specified values to prepend to the observable sequence
+ * @returns {Observable} The source sequence prepended with the specified values.
+ */
+ observableProto.startWith = function () {
+ var values, scheduler, start = 0;
+ if (!!arguments.length && isScheduler(arguments[0])) {
+ scheduler = arguments[0];
+ start = 1;
+ } else {
+ scheduler = immediateScheduler;
+ }
+ for(var args = [], i = start, len = arguments.length; i < len; i++) { args.push(arguments[i]); }
+ return enumerableOf([observableFromArray(args, scheduler), this]).concat();
+ };
+
+ /**
+ * Returns a specified number of contiguous elements from the end of an observable sequence.
+ * @description
+ * This operator accumulates a buffer with a length enough to store elements count elements. Upon completion of
+ * the source sequence, this buffer is drained on the result sequence. This causes the elements to be delayed.
+ * @param {Number} count Number of elements to take from the end of the source sequence.
+ * @returns {Observable} An observable sequence containing the specified number of elements from the end of the source sequence.
+ */
+ observableProto.takeLast = function (count) {
+ if (count < 0) { throw new ArgumentOutOfRangeError(); }
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var q = [];
+ return source.subscribe(function (x) {
+ q.push(x);
+ q.length > count && q.shift();
+ }, function (e) { o.onError(e); }, function () {
+ while (q.length > 0) { o.onNext(q.shift()); }
+ o.onCompleted();
+ });
+ }, source);
+ };
+
+ function concatMap(source, selector, thisArg) {
+ var selectorFunc = bindCallback(selector, thisArg, 3);
+ return source.map(function (x, i) {
+ var result = selectorFunc(x, i, source);
+ isPromise(result) && (result = observableFromPromise(result));
+ (isArrayLike(result) || isIterable(result)) && (result = observableFrom(result));
+ return result;
+ }).concatAll();
+ }
+
+ /**
+ * One of the Following:
+ * Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
+ *
+ * @example
+ * var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); });
+ * Or:
+ * Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
+ *
+ * var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
+ * Or:
+ * Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
+ *
+ * var res = source.concatMap(Rx.Observable.fromArray([1,2,3]));
+ * @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the
+ * source sequence onto which could be either an observable or Promise.
+ * @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
+ * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
+ */
+ observableProto.selectConcat = observableProto.concatMap = function (selector, resultSelector, thisArg) {
+ if (isFunction(selector) && isFunction(resultSelector)) {
+ return this.concatMap(function (x, i) {
+ var selectorResult = selector(x, i);
+ isPromise(selectorResult) && (selectorResult = observableFromPromise(selectorResult));
+ (isArrayLike(selectorResult) || isIterable(selectorResult)) && (selectorResult = observableFrom(selectorResult));
+
+ return selectorResult.map(function (y, i2) {
+ return resultSelector(x, y, i, i2);
+ });
+ });
+ }
+ return isFunction(selector) ?
+ concatMap(this, selector, thisArg) :
+ concatMap(this, function () { return selector; });
+ };
+
+ var MapObservable = (function (__super__) {
+ inherits(MapObservable, __super__);
+
+ function MapObservable(source, selector, thisArg) {
+ this.source = source;
+ this.selector = bindCallback(selector, thisArg, 3);
+ __super__.call(this);
+ }
+
+ function innerMap(selector, self) {
+ return function (x, i, o) { return selector.call(this, self.selector(x, i, o), i, o); }
+ }
+
+ MapObservable.prototype.internalMap = function (selector, thisArg) {
+ return new MapObservable(this.source, innerMap(selector, this), thisArg);
+ };
+
+ MapObservable.prototype.subscribeCore = function (o) {
+ return this.source.subscribe(new InnerObserver(o, this.selector, this));
+ };
+
+ function InnerObserver(o, selector, source) {
+ this.o = o;
+ this.selector = selector;
+ this.source = source;
+ this.i = 0;
+ this.isStopped = false;
+ }
+
+ InnerObserver.prototype.onNext = function(x) {
+ if (this.isStopped) { return; }
+ var result = tryCatch(this.selector)(x, this.i++, this.source);
+ if (result === errorObj) {
+ return this.o.onError(result.e);
+ }
+ this.o.onNext(result);
+ };
+ InnerObserver.prototype.onError = function (e) {
+ if(!this.isStopped) { this.isStopped = true; this.o.onError(e); }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if(!this.isStopped) { this.isStopped = true; this.o.onCompleted(); }
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+
+ return false;
+ };
+
+ return MapObservable;
+
+ }(ObservableBase));
+
+ /**
+ * Projects each element of an observable sequence into a new form by incorporating the element's index.
+ * @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source.
+ */
+ observableProto.map = observableProto.select = function (selector, thisArg) {
+ var selectorFn = typeof selector === 'function' ? selector : function () { return selector; };
+ return this instanceof MapObservable ?
+ this.internalMap(selectorFn, thisArg) :
+ new MapObservable(this, selectorFn, thisArg);
+ };
+
+ /**
+ * Retrieves the value of a specified nested property from all elements in
+ * the Observable sequence.
+ * @param {Arguments} arguments The nested properties to pluck.
+ * @returns {Observable} Returns a new Observable sequence of property values.
+ */
+ observableProto.pluck = function () {
+ var args = arguments, len = arguments.length;
+ if (len === 0) { throw new Error('List of properties cannot be empty.'); }
+ return this.map(function (x) {
+ var currentProp = x;
+ for (var i = 0; i < len; i++) {
+ var p = currentProp[args[i]];
+ if (typeof p !== 'undefined') {
+ currentProp = p;
+ } else {
+ return undefined;
+ }
+ }
+ return currentProp;
+ });
+ };
+
+ function flatMap(source, selector, thisArg) {
+ var selectorFunc = bindCallback(selector, thisArg, 3);
+ return source.map(function (x, i) {
+ var result = selectorFunc(x, i, source);
+ isPromise(result) && (result = observableFromPromise(result));
+ (isArrayLike(result) || isIterable(result)) && (result = observableFrom(result));
+ return result;
+ }).mergeAll();
+ }
+
+ /**
+ * One of the Following:
+ * Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
+ *
+ * @example
+ * var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); });
+ * Or:
+ * Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
+ *
+ * var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
+ * Or:
+ * Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
+ *
+ * var res = source.selectMany(Rx.Observable.fromArray([1,2,3]));
+ * @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the source sequence onto which could be either an observable or Promise.
+ * @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
+ */
+ observableProto.selectMany = observableProto.flatMap = function (selector, resultSelector, thisArg) {
+ if (isFunction(selector) && isFunction(resultSelector)) {
+ return this.flatMap(function (x, i) {
+ var selectorResult = selector(x, i);
+ isPromise(selectorResult) && (selectorResult = observableFromPromise(selectorResult));
+ (isArrayLike(selectorResult) || isIterable(selectorResult)) && (selectorResult = observableFrom(selectorResult));
+
+ return selectorResult.map(function (y, i2) {
+ return resultSelector(x, y, i, i2);
+ });
+ }, thisArg);
+ }
+ return isFunction(selector) ?
+ flatMap(this, selector, thisArg) :
+ flatMap(this, function () { return selector; });
+ };
+
+ /**
+ * Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then
+ * transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
+ * @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences
+ * and that at any point in time produces the elements of the most recent inner observable sequence that has been received.
+ */
+ observableProto.selectSwitch = observableProto.flatMapLatest = observableProto.switchMap = function (selector, thisArg) {
+ return this.select(selector, thisArg).switchLatest();
+ };
+
+ var SkipObservable = (function(__super__) {
+ inherits(SkipObservable, __super__);
+ function SkipObservable(source, count) {
+ this.source = source;
+ this.skipCount = count;
+ __super__.call(this);
+ }
+
+ SkipObservable.prototype.subscribeCore = function (o) {
+ return this.source.subscribe(new InnerObserver(o, this.skipCount));
+ };
+
+ function InnerObserver(o, c) {
+ this.c = c;
+ this.r = c;
+ this.o = o;
+ this.isStopped = false;
+ }
+ InnerObserver.prototype.onNext = function (x) {
+ if (this.isStopped) { return; }
+ if (this.r <= 0) {
+ this.o.onNext(x);
+ } else {
+ this.r--;
+ }
+ };
+ InnerObserver.prototype.onError = function(e) {
+ if (!this.isStopped) { this.isStopped = true; this.o.onError(e); }
+ };
+ InnerObserver.prototype.onCompleted = function() {
+ if (!this.isStopped) { this.isStopped = true; this.o.onCompleted(); }
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function(e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ return SkipObservable;
+ }(ObservableBase));
+
+ /**
+ * Bypasses a specified number of elements in an observable sequence and then returns the remaining elements.
+ * @param {Number} count The number of elements to skip before returning the remaining elements.
+ * @returns {Observable} An observable sequence that contains the elements that occur after the specified index in the input sequence.
+ */
+ observableProto.skip = function (count) {
+ if (count < 0) { throw new ArgumentOutOfRangeError(); }
+ return new SkipObservable(this, count);
+ };
+ /**
+ * Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements.
+ * The element's index is used in the logic of the predicate function.
+ *
+ * var res = source.skipWhile(function (value) { return value < 10; });
+ * var res = source.skipWhile(function (value, index) { return value < 10 || index < 10; });
+ * @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate.
+ */
+ observableProto.skipWhile = function (predicate, thisArg) {
+ var source = this,
+ callback = bindCallback(predicate, thisArg, 3);
+ return new AnonymousObservable(function (o) {
+ var i = 0, running = false;
+ return source.subscribe(function (x) {
+ if (!running) {
+ try {
+ running = !callback(x, i++, source);
+ } catch (e) {
+ o.onError(e);
+ return;
+ }
+ }
+ running && o.onNext(x);
+ }, function (e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, source);
+ };
+
+ /**
+ * Returns a specified number of contiguous elements from the start of an observable sequence, using the specified scheduler for the edge case of take(0).
+ *
+ * var res = source.take(5);
+ * var res = source.take(0, Rx.Scheduler.timeout);
+ * @param {Number} count The number of elements to return.
+ * @param {Scheduler} [scheduler] Scheduler used to produce an OnCompleted message in case <paramref name="count count</paramref> is set to 0.
+ * @returns {Observable} An observable sequence that contains the specified number of elements from the start of the input sequence.
+ */
+ observableProto.take = function (count, scheduler) {
+ if (count < 0) { throw new ArgumentOutOfRangeError(); }
+ if (count === 0) { return observableEmpty(scheduler); }
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var remaining = count;
+ return source.subscribe(function (x) {
+ if (remaining-- > 0) {
+ o.onNext(x);
+ remaining <= 0 && o.onCompleted();
+ }
+ }, function (e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, source);
+ };
+
+ /**
+ * Returns elements from an observable sequence as long as a specified condition is true.
+ * The element's index is used in the logic of the predicate function.
+ * @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence that contains the elements from the input sequence that occur before the element at which the test no longer passes.
+ */
+ observableProto.takeWhile = function (predicate, thisArg) {
+ var source = this,
+ callback = bindCallback(predicate, thisArg, 3);
+ return new AnonymousObservable(function (o) {
+ var i = 0, running = true;
+ return source.subscribe(function (x) {
+ if (running) {
+ try {
+ running = callback(x, i++, source);
+ } catch (e) {
+ o.onError(e);
+ return;
+ }
+ if (running) {
+ o.onNext(x);
+ } else {
+ o.onCompleted();
+ }
+ }
+ }, function (e) { o.onError(e); }, function () { o.onCompleted(); });
+ }, source);
+ };
+
+ var FilterObservable = (function (__super__) {
+ inherits(FilterObservable, __super__);
+
+ function FilterObservable(source, predicate, thisArg) {
+ this.source = source;
+ this.predicate = bindCallback(predicate, thisArg, 3);
+ __super__.call(this);
+ }
+
+ FilterObservable.prototype.subscribeCore = function (o) {
+ return this.source.subscribe(new InnerObserver(o, this.predicate, this));
+ };
+
+ function innerPredicate(predicate, self) {
+ return function(x, i, o) { return self.predicate(x, i, o) && predicate.call(this, x, i, o); }
+ }
+
+ FilterObservable.prototype.internalFilter = function(predicate, thisArg) {
+ return new FilterObservable(this.source, innerPredicate(predicate, this), thisArg);
+ };
+
+ function InnerObserver(o, predicate, source) {
+ this.o = o;
+ this.predicate = predicate;
+ this.source = source;
+ this.i = 0;
+ this.isStopped = false;
+ }
+
+ InnerObserver.prototype.onNext = function(x) {
+ if (this.isStopped) { return; }
+ var shouldYield = tryCatch(this.predicate)(x, this.i++, this.source);
+ if (shouldYield === errorObj) {
+ return this.o.onError(shouldYield.e);
+ }
+ shouldYield && this.o.onNext(x);
+ };
+ InnerObserver.prototype.onError = function (e) {
+ if(!this.isStopped) { this.isStopped = true; this.o.onError(e); }
+ };
+ InnerObserver.prototype.onCompleted = function () {
+ if(!this.isStopped) { this.isStopped = true; this.o.onCompleted(); }
+ };
+ InnerObserver.prototype.dispose = function() { this.isStopped = true; };
+ InnerObserver.prototype.fail = function (e) {
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.o.onError(e);
+ return true;
+ }
+ return false;
+ };
+
+ return FilterObservable;
+
+ }(ObservableBase));
+
+ /**
+ * Filters the elements of an observable sequence based on a predicate by incorporating the element's index.
+ * @param {Function} predicate A function to test each source element for a condition; the second parameter of the function represents the index of the source element.
+ * @param {Any} [thisArg] Object to use as this when executing callback.
+ * @returns {Observable} An observable sequence that contains elements from the input sequence that satisfy the condition.
+ */
+ observableProto.filter = observableProto.where = function (predicate, thisArg) {
+ return this instanceof FilterObservable ? this.internalFilter(predicate, thisArg) :
+ new FilterObservable(this, predicate, thisArg);
+ };
+
+ /**
+ * Converts a callback function to an observable sequence.
+ *
+ * @param {Function} function Function with a callback as the last parameter to convert to an Observable sequence.
+ * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
+ * @param {Function} [selector] A selector which takes the arguments from the callback to produce a single item to yield on next.
+ * @returns {Function} A function, when executed with the required parameters minus the callback, produces an Observable sequence with a single value of the arguments to the callback as an array.
+ */
+ Observable.fromCallback = function (func, context, selector) {
+ return function () {
+ var len = arguments.length, args = new Array(len)
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+
+ return new AnonymousObservable(function (observer) {
+ function handler() {
+ var len = arguments.length, results = new Array(len);
+ for(var i = 0; i < len; i++) { results[i] = arguments[i]; }
+
+ if (selector) {
+ try {
+ results = selector.apply(context, results);
+ } catch (e) {
+ return observer.onError(e);
+ }
+
+ observer.onNext(results);
+ } else {
+ if (results.length <= 1) {
+ observer.onNext.apply(observer, results);
+ } else {
+ observer.onNext(results);
+ }
+ }
+
+ observer.onCompleted();
+ }
+
+ args.push(handler);
+ func.apply(context, args);
+ }).publishLast().refCount();
+ };
+ };
+
+ /**
+ * Converts a Node.js callback style function to an observable sequence. This must be in function (err, ...) format.
+ * @param {Function} func The function to call
+ * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
+ * @param {Function} [selector] A selector which takes the arguments from the callback minus the error to produce a single item to yield on next.
+ * @returns {Function} An async function which when applied, returns an observable sequence with the callback arguments as an array.
+ */
+ Observable.fromNodeCallback = function (func, context, selector) {
+ return function () {
+ var len = arguments.length, args = new Array(len);
+ for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
+
+ return new AnonymousObservable(function (observer) {
+ function handler(err) {
+ if (err) {
+ observer.onError(err);
+ return;
+ }
+
+ var len = arguments.length, results = [];
+ for(var i = 1; i < len; i++) { results[i - 1] = arguments[i]; }
+
+ if (selector) {
+ try {
+ results = selector.apply(context, results);
+ } catch (e) {
+ return observer.onError(e);
+ }
+ observer.onNext(results);
+ } else {
+ if (results.length <= 1) {
+ observer.onNext.apply(observer, results);
+ } else {
+ observer.onNext(results);
+ }
+ }
+
+ observer.onCompleted();
+ }
+
+ args.push(handler);
+ func.apply(context, args);
+ }).publishLast().refCount();
+ };
+ };
+
+ function createListener (element, name, handler) {
+ if (element.addEventListener) {
+ element.addEventListener(name, handler, false);
+ return disposableCreate(function () {
+ element.removeEventListener(name, handler, false);
+ });
+ }
+ throw new Error('No listener found');
+ }
+
+ function createEventListener (el, eventName, handler) {
+ var disposables = new CompositeDisposable();
+
+ // Asume NodeList or HTMLCollection
+ var toStr = Object.prototype.toString;
+ if (toStr.call(el) === '[object NodeList]' || toStr.call(el) === '[object HTMLCollection]') {
+ for (var i = 0, len = el.length; i < len; i++) {
+ disposables.add(createEventListener(el.item(i), eventName, handler));
+ }
+ } else if (el) {
+ disposables.add(createListener(el, eventName, handler));
+ }
+
+ return disposables;
+ }
+
+ /**
+ * Configuration option to determine whether to use native events only
+ */
+ Rx.config.useNativeEvents = false;
+
+ /**
+ * Creates an observable sequence by adding an event listener to the matching DOMElement or each item in the NodeList.
+ *
+ * @example
+ * var source = Rx.Observable.fromEvent(element, 'mouseup');
+ *
+ * @param {Object} element The DOMElement or NodeList to attach a listener.
+ * @param {String} eventName The event name to attach the observable sequence.
+ * @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next.
+ * @returns {Observable} An observable sequence of events from the specified element and the specified event.
+ */
+ Observable.fromEvent = function (element, eventName, selector) {
+ // Node.js specific
+ if (element.addListener) {
+ return fromEventPattern(
+ function (h) { element.addListener(eventName, h); },
+ function (h) { element.removeListener(eventName, h); },
+ selector);
+ }
+
+ // Use only if non-native events are allowed
+ if (!Rx.config.useNativeEvents) {
+ // Handles jq, Angular.js, Zepto, Marionette, Ember.js
+ if (typeof element.on === 'function' && typeof element.off === 'function') {
+ return fromEventPattern(
+ function (h) { element.on(eventName, h); },
+ function (h) { element.off(eventName, h); },
+ selector);
+ }
+ }
+ return new AnonymousObservable(function (observer) {
+ return createEventListener(
+ element,
+ eventName,
+ function handler (e) {
+ var results = e;
+
+ if (selector) {
+ try {
+ results = selector(arguments);
+ } catch (err) {
+ return observer.onError(err);
+ }
+ }
+
+ observer.onNext(results);
+ });
+ }).publish().refCount();
+ };
+
+ /**
+ * Creates an observable sequence from an event emitter via an addHandler/removeHandler pair.
+ * @param {Function} addHandler The function to add a handler to the emitter.
+ * @param {Function} [removeHandler] The optional function to remove a handler from an emitter.
+ * @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next.
+ * @returns {Observable} An observable sequence which wraps an event from an event emitter
+ */
+ var fromEventPattern = Observable.fromEventPattern = function (addHandler, removeHandler, selector) {
+ return new AnonymousObservable(function (observer) {
+ function innerHandler (e) {
+ var result = e;
+ if (selector) {
+ try {
+ result = selector(arguments);
+ } catch (err) {
+ return observer.onError(err);
+ }
+ }
+ observer.onNext(result);
+ }
+
+ var returnValue = addHandler(innerHandler);
+ return disposableCreate(function () {
+ if (removeHandler) {
+ removeHandler(innerHandler, returnValue);
+ }
+ });
+ }).publish().refCount();
+ };
+
+ var FromPromiseObservable = (function(__super__) {
+ inherits(FromPromiseObservable, __super__);
+ function FromPromiseObservable(p) {
+ this.p = p;
+ __super__.call(this);
+ }
+
+ FromPromiseObservable.prototype.subscribeCore = function(o) {
+ this.p.then(function (data) {
+ o.onNext(data);
+ o.onCompleted();
+ }, function (err) { o.onError(err); });
+ return disposableEmpty;
+ };
+
+ return FromPromiseObservable;
+ }(ObservableBase));
+
+ /**
+ * Converts a Promise to an Observable sequence
+ * @param {Promise} An ES6 Compliant promise.
+ * @returns {Observable} An Observable sequence which wraps the existing promise success and failure.
+ */
+ var observableFromPromise = Observable.fromPromise = function (promise) {
+ return new FromPromiseObservable(promise);
+ };
+ /*
+ * Converts an existing observable sequence to an ES6 Compatible Promise
+ * @example
+ * var promise = Rx.Observable.return(42).toPromise(RSVP.Promise);
+ *
+ * // With config
+ * Rx.config.Promise = RSVP.Promise;
+ * var promise = Rx.Observable.return(42).toPromise();
+ * @param {Function} [promiseCtor] The constructor of the promise. If not provided, it looks for it in Rx.config.Promise.
+ * @returns {Promise} An ES6 compatible promise with the last value from the observable sequence.
+ */
+ observableProto.toPromise = function (promiseCtor) {
+ promiseCtor || (promiseCtor = Rx.config.Promise);
+ if (!promiseCtor) { throw new NotSupportedError('Promise type not provided nor in Rx.config.Promise'); }
+ var source = this;
+ return new promiseCtor(function (resolve, reject) {
+ // No cancellation can be done
+ var value, hasValue = false;
+ source.subscribe(function (v) {
+ value = v;
+ hasValue = true;
+ }, reject, function () {
+ hasValue && resolve(value);
+ });
+ });
+ };
+
+ /**
+ * Invokes the asynchronous function, surfacing the result through an observable sequence.
+ * @param {Function} functionAsync Asynchronous function which returns a Promise to run.
+ * @returns {Observable} An observable sequence exposing the function's result value, or an exception.
+ */
+ Observable.startAsync = function (functionAsync) {
+ var promise;
+ try {
+ promise = functionAsync();
+ } catch (e) {
+ return observableThrow(e);
+ }
+ return observableFromPromise(promise);
+ }
+
+ /**
+ * Multicasts the source sequence notifications through an instantiated subject into all uses of the sequence within a selector function. Each
+ * subscription to the resulting sequence causes a separate multicast invocation, exposing the sequence resulting from the selector function's
+ * invocation. For specializations with fixed subject types, see Publish, PublishLast, and Replay.
+ *
+ * @example
+ * 1 - res = source.multicast(observable);
+ * 2 - res = source.multicast(function () { return new Subject(); }, function (x) { return x; });
+ *
+ * @param {Function|Subject} subjectOrSubjectSelector
+ * Factory function to create an intermediate subject through which the source sequence's elements will be multicast to the selector function.
+ * Or:
+ * Subject to push source elements into.
+ *
+ * @param {Function} [selector] Optional selector function which can use the multicasted source sequence subject to the policies enforced by the created subject. Specified only if <paramref name="subjectOrSubjectSelector" is a factory function.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
+ */
+ observableProto.multicast = function (subjectOrSubjectSelector, selector) {
+ var source = this;
+ return typeof subjectOrSubjectSelector === 'function' ?
+ new AnonymousObservable(function (observer) {
+ var connectable = source.multicast(subjectOrSubjectSelector());
+ return new CompositeDisposable(selector(connectable).subscribe(observer), connectable.connect());
+ }, source) :
+ new ConnectableObservable(source, subjectOrSubjectSelector);
+ };
+
+ /**
+ * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence.
+ * This operator is a specialization of Multicast using a regular Subject.
+ *
+ * @example
+ * var resres = source.publish();
+ * var res = source.publish(function (x) { return x; });
+ *
+ * @param {Function} [selector] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all notifications of the source from the time of the subscription on.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
+ */
+ observableProto.publish = function (selector) {
+ return selector && isFunction(selector) ?
+ this.multicast(function () { return new Subject(); }, selector) :
+ this.multicast(new Subject());
+ };
+
+ /**
+ * Returns an observable sequence that shares a single subscription to the underlying sequence.
+ * This operator is a specialization of publish which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence.
+ */
+ observableProto.share = function () {
+ return this.publish().refCount();
+ };
+
+ /**
+ * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence containing only the last notification.
+ * This operator is a specialization of Multicast using a AsyncSubject.
+ *
+ * @example
+ * var res = source.publishLast();
+ * var res = source.publishLast(function (x) { return x; });
+ *
+ * @param selector [Optional] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will only receive the last notification of the source.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
+ */
+ observableProto.publishLast = function (selector) {
+ return selector && isFunction(selector) ?
+ this.multicast(function () { return new AsyncSubject(); }, selector) :
+ this.multicast(new AsyncSubject());
+ };
+
+ /**
+ * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence and starts with initialValue.
+ * This operator is a specialization of Multicast using a BehaviorSubject.
+ *
+ * @example
+ * var res = source.publishValue(42);
+ * var res = source.publishValue(function (x) { return x.select(function (y) { return y * y; }) }, 42);
+ *
+ * @param {Function} [selector] Optional selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive immediately receive the initial value, followed by all notifications of the source from the time of the subscription on.
+ * @param {Mixed} initialValue Initial value received by observers upon subscription.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
+ */
+ observableProto.publishValue = function (initialValueOrSelector, initialValue) {
+ return arguments.length === 2 ?
+ this.multicast(function () {
+ return new BehaviorSubject(initialValue);
+ }, initialValueOrSelector) :
+ this.multicast(new BehaviorSubject(initialValueOrSelector));
+ };
+
+ /**
+ * Returns an observable sequence that shares a single subscription to the underlying sequence and starts with an initialValue.
+ * This operator is a specialization of publishValue which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed.
+ * @param {Mixed} initialValue Initial value received by observers upon subscription.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence.
+ */
+ observableProto.shareValue = function (initialValue) {
+ return this.publishValue(initialValue).refCount();
+ };
+
+ /**
+ * Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length for the replay buffer.
+ * This operator is a specialization of Multicast using a ReplaySubject.
+ *
+ * @example
+ * var res = source.replay(null, 3);
+ * var res = source.replay(null, 3, 500);
+ * var res = source.replay(null, 3, 500, scheduler);
+ * var res = source.replay(function (x) { return x.take(6).repeat(); }, 3, 500, scheduler);
+ *
+ * @param selector [Optional] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all the notifications of the source subject to the specified replay buffer trimming policy.
+ * @param bufferSize [Optional] Maximum element count of the replay buffer.
+ * @param windowSize [Optional] Maximum time length of the replay buffer.
+ * @param scheduler [Optional] Scheduler where connected observers within the selector function will be invoked on.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
+ */
+ observableProto.replay = function (selector, bufferSize, windowSize, scheduler) {
+ return selector && isFunction(selector) ?
+ this.multicast(function () { return new ReplaySubject(bufferSize, windowSize, scheduler); }, selector) :
+ this.multicast(new ReplaySubject(bufferSize, windowSize, scheduler));
+ };
+
+ /**
+ * Returns an observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length for the replay buffer.
+ * This operator is a specialization of replay which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed.
+ *
+ * @example
+ * var res = source.shareReplay(3);
+ * var res = source.shareReplay(3, 500);
+ * var res = source.shareReplay(3, 500, scheduler);
+ *
+
+ * @param bufferSize [Optional] Maximum element count of the replay buffer.
+ * @param window [Optional] Maximum time length of the replay buffer.
+ * @param scheduler [Optional] Scheduler where connected observers within the selector function will be invoked on.
+ * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence.
+ */
+ observableProto.shareReplay = function (bufferSize, windowSize, scheduler) {
+ return this.replay(null, bufferSize, windowSize, scheduler).refCount();
+ };
+
+ var ConnectableObservable = Rx.ConnectableObservable = (function (__super__) {
+ inherits(ConnectableObservable, __super__);
+
+ function ConnectableObservable(source, subject) {
+ var hasSubscription = false,
+ subscription,
+ sourceObservable = source.asObservable();
+
+ this.connect = function () {
+ if (!hasSubscription) {
+ hasSubscription = true;
+ subscription = new CompositeDisposable(sourceObservable.subscribe(subject), disposableCreate(function () {
+ hasSubscription = false;
+ }));
+ }
+ return subscription;
+ };
+
+ __super__.call(this, function (o) { return subject.subscribe(o); });
+ }
+
+ ConnectableObservable.prototype.refCount = function () {
+ var connectableSubscription, count = 0, source = this;
+ return new AnonymousObservable(function (observer) {
+ var shouldConnect = ++count === 1,
+ subscription = source.subscribe(observer);
+ shouldConnect && (connectableSubscription = source.connect());
+ return function () {
+ subscription.dispose();
+ --count === 0 && connectableSubscription.dispose();
+ };
+ });
+ };
+
+ return ConnectableObservable;
+ }(Observable));
+
+ function observableTimerDate(dueTime, scheduler) {
+ return new AnonymousObservable(function (observer) {
+ return scheduler.scheduleWithAbsolute(dueTime, function () {
+ observer.onNext(0);
+ observer.onCompleted();
+ });
+ });
+ }
+
+ function observableTimerDateAndPeriod(dueTime, period, scheduler) {
+ return new AnonymousObservable(function (observer) {
+ var d = dueTime, p = normalizeTime(period);
+ return scheduler.scheduleRecursiveWithAbsoluteAndState(0, d, function (count, self) {
+ if (p > 0) {
+ var now = scheduler.now();
+ d = d + p;
+ d <= now && (d = now + p);
+ }
+ observer.onNext(count);
+ self(count + 1, d);
+ });
+ });
+ }
+
+ function observableTimerTimeSpan(dueTime, scheduler) {
+ return new AnonymousObservable(function (observer) {
+ return scheduler.scheduleWithRelative(normalizeTime(dueTime), function () {
+ observer.onNext(0);
+ observer.onCompleted();
+ });
+ });
+ }
+
+ function observableTimerTimeSpanAndPeriod(dueTime, period, scheduler) {
+ return dueTime === period ?
+ new AnonymousObservable(function (observer) {
+ return scheduler.schedulePeriodicWithState(0, period, function (count) {
+ observer.onNext(count);
+ return count + 1;
+ });
+ }) :
+ observableDefer(function () {
+ return observableTimerDateAndPeriod(scheduler.now() + dueTime, period, scheduler);
+ });
+ }
+
+ /**
+ * Returns an observable sequence that produces a value after each period.
+ *
+ * @example
+ * 1 - res = Rx.Observable.interval(1000);
+ * 2 - res = Rx.Observable.interval(1000, Rx.Scheduler.timeout);
+ *
+ * @param {Number} period Period for producing the values in the resulting sequence (specified as an integer denoting milliseconds).
+ * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, Rx.Scheduler.timeout is used.
+ * @returns {Observable} An observable sequence that produces a value after each period.
+ */
+ var observableinterval = Observable.interval = function (period, scheduler) {
+ return observableTimerTimeSpanAndPeriod(period, period, isScheduler(scheduler) ? scheduler : timeoutScheduler);
+ };
+
+ /**
+ * Returns an observable sequence that produces a value after dueTime has elapsed and then after each period.
+ * @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) at which to produce the first value.
+ * @param {Mixed} [periodOrScheduler] Period to produce subsequent values (specified as an integer denoting milliseconds), or the scheduler to run the timer on. If not specified, the resulting timer is not recurring.
+ * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, the timeout scheduler is used.
+ * @returns {Observable} An observable sequence that produces a value after due time has elapsed and then each period.
+ */
+ var observableTimer = Observable.timer = function (dueTime, periodOrScheduler, scheduler) {
+ var period;
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ if (periodOrScheduler !== undefined && typeof periodOrScheduler === 'number') {
+ period = periodOrScheduler;
+ } else if (isScheduler(periodOrScheduler)) {
+ scheduler = periodOrScheduler;
+ }
+ if (dueTime instanceof Date && period === undefined) {
+ return observableTimerDate(dueTime.getTime(), scheduler);
+ }
+ if (dueTime instanceof Date && period !== undefined) {
+ period = periodOrScheduler;
+ return observableTimerDateAndPeriod(dueTime.getTime(), period, scheduler);
+ }
+ return period === undefined ?
+ observableTimerTimeSpan(dueTime, scheduler) :
+ observableTimerTimeSpanAndPeriod(dueTime, period, scheduler);
+ };
+
+ function observableDelayTimeSpan(source, dueTime, scheduler) {
+ return new AnonymousObservable(function (observer) {
+ var active = false,
+ cancelable = new SerialDisposable(),
+ exception = null,
+ q = [],
+ running = false,
+ subscription;
+ subscription = source.materialize().timestamp(scheduler).subscribe(function (notification) {
+ var d, shouldRun;
+ if (notification.value.kind === 'E') {
+ q = [];
+ q.push(notification);
+ exception = notification.value.exception;
+ shouldRun = !running;
+ } else {
+ q.push({ value: notification.value, timestamp: notification.timestamp + dueTime });
+ shouldRun = !active;
+ active = true;
+ }
+ if (shouldRun) {
+ if (exception !== null) {
+ observer.onError(exception);
+ } else {
+ d = new SingleAssignmentDisposable();
+ cancelable.setDisposable(d);
+ d.setDisposable(scheduler.scheduleRecursiveWithRelative(dueTime, function (self) {
+ var e, recurseDueTime, result, shouldRecurse;
+ if (exception !== null) {
+ return;
+ }
+ running = true;
+ do {
+ result = null;
+ if (q.length > 0 && q[0].timestamp - scheduler.now() <= 0) {
+ result = q.shift().value;
+ }
+ if (result !== null) {
+ result.accept(observer);
+ }
+ } while (result !== null);
+ shouldRecurse = false;
+ recurseDueTime = 0;
+ if (q.length > 0) {
+ shouldRecurse = true;
+ recurseDueTime = Math.max(0, q[0].timestamp - scheduler.now());
+ } else {
+ active = false;
+ }
+ e = exception;
+ running = false;
+ if (e !== null) {
+ observer.onError(e);
+ } else if (shouldRecurse) {
+ self(recurseDueTime);
+ }
+ }));
+ }
+ }
+ });
+ return new CompositeDisposable(subscription, cancelable);
+ }, source);
+ }
+
+ function observableDelayDate(source, dueTime, scheduler) {
+ return observableDefer(function () {
+ return observableDelayTimeSpan(source, dueTime - scheduler.now(), scheduler);
+ });
+ }
+
+ /**
+ * Time shifts the observable sequence by dueTime. The relative time intervals between the values are preserved.
+ *
+ * @example
+ * 1 - res = Rx.Observable.delay(new Date());
+ * 2 - res = Rx.Observable.delay(new Date(), Rx.Scheduler.timeout);
+ *
+ * 3 - res = Rx.Observable.delay(5000);
+ * 4 - res = Rx.Observable.delay(5000, 1000, Rx.Scheduler.timeout);
+ * @memberOf Observable#
+ * @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) by which to shift the observable sequence.
+ * @param {Scheduler} [scheduler] Scheduler to run the delay timers on. If not specified, the timeout scheduler is used.
+ * @returns {Observable} Time-shifted sequence.
+ */
+ observableProto.delay = function (dueTime, scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return dueTime instanceof Date ?
+ observableDelayDate(this, dueTime.getTime(), scheduler) :
+ observableDelayTimeSpan(this, dueTime, scheduler);
+ };
+
+ /**
+ * Ignores values from an observable sequence which are followed by another value before dueTime.
+ * @param {Number} dueTime Duration of the debounce period for each value (specified as an integer denoting milliseconds).
+ * @param {Scheduler} [scheduler] Scheduler to run the debounce timers on. If not specified, the timeout scheduler is used.
+ * @returns {Observable} The debounced sequence.
+ */
+ observableProto.debounce = observableProto.throttleWithTimeout = function (dueTime, scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ var cancelable = new SerialDisposable(), hasvalue = false, value, id = 0;
+ var subscription = source.subscribe(
+ function (x) {
+ hasvalue = true;
+ value = x;
+ id++;
+ var currentId = id,
+ d = new SingleAssignmentDisposable();
+ cancelable.setDisposable(d);
+ d.setDisposable(scheduler.scheduleWithRelative(dueTime, function () {
+ hasvalue && id === currentId && observer.onNext(value);
+ hasvalue = false;
+ }));
+ },
+ function (e) {
+ cancelable.dispose();
+ observer.onError(e);
+ hasvalue = false;
+ id++;
+ },
+ function () {
+ cancelable.dispose();
+ hasvalue && observer.onNext(value);
+ observer.onCompleted();
+ hasvalue = false;
+ id++;
+ });
+ return new CompositeDisposable(subscription, cancelable);
+ }, this);
+ };
+
+ /**
+ * @deprecated use #debounce or #throttleWithTimeout instead.
+ */
+ observableProto.throttle = function(dueTime, scheduler) {
+ //deprecate('throttle', 'debounce or throttleWithTimeout');
+ return this.debounce(dueTime, scheduler);
+ };
+
+ /**
+ * Records the timestamp for each value in an observable sequence.
+ *
+ * @example
+ * 1 - res = source.timestamp(); // produces { value: x, timestamp: ts }
+ * 2 - res = source.timestamp(Rx.Scheduler.default);
+ *
+ * @param {Scheduler} [scheduler] Scheduler used to compute timestamps. If not specified, the default scheduler is used.
+ * @returns {Observable} An observable sequence with timestamp information on values.
+ */
+ observableProto.timestamp = function (scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return this.map(function (x) {
+ return { value: x, timestamp: scheduler.now() };
+ });
+ };
+
+ function sampleObservable(source, sampler) {
+ return new AnonymousObservable(function (o) {
+ var atEnd = false, value, hasValue = false;
+
+ function sampleSubscribe() {
+ if (hasValue) {
+ hasValue = false;
+ o.onNext(value);
+ }
+ atEnd && o.onCompleted();
+ }
+
+ var sourceSubscription = new SingleAssignmentDisposable();
+ sourceSubscription.setDisposable(source.subscribe(
+ function (newValue) {
+ hasValue = true;
+ value = newValue;
+ },
+ function (e) { o.onError(e); },
+ function () {
+ atEnd = true;
+ sourceSubscription.dispose();
+ }
+ ));
+
+ return new CompositeDisposable(
+ sourceSubscription,
+ sampler.subscribe(sampleSubscribe, function (e) { o.onError(e); }, sampleSubscribe)
+ );
+ }, source);
+ }
+
+ /**
+ * Samples the observable sequence at each interval.
+ *
+ * @example
+ * 1 - res = source.sample(sampleObservable); // Sampler tick sequence
+ * 2 - res = source.sample(5000); // 5 seconds
+ * 2 - res = source.sample(5000, Rx.Scheduler.timeout); // 5 seconds
+ *
+ * @param {Mixed} intervalOrSampler Interval at which to sample (specified as an integer denoting milliseconds) or Sampler Observable.
+ * @param {Scheduler} [scheduler] Scheduler to run the sampling timer on. If not specified, the timeout scheduler is used.
+ * @returns {Observable} Sampled observable sequence.
+ */
+ observableProto.sample = observableProto.throttleLatest = function (intervalOrSampler, scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return typeof intervalOrSampler === 'number' ?
+ sampleObservable(this, observableinterval(intervalOrSampler, scheduler)) :
+ sampleObservable(this, intervalOrSampler);
+ };
+
+ /**
+ * Returns the source observable sequence or the other observable sequence if dueTime elapses.
+ * @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) when a timeout occurs.
+ * @param {Observable} [other] Sequence to return in case of a timeout. If not specified, a timeout error throwing sequence will be used.
+ * @param {Scheduler} [scheduler] Scheduler to run the timeout timers on. If not specified, the timeout scheduler is used.
+ * @returns {Observable} The source sequence switching to the other sequence in case of a timeout.
+ */
+ observableProto.timeout = function (dueTime, other, scheduler) {
+ (other == null || typeof other === 'string') && (other = observableThrow(new Error(other || 'Timeout')));
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+
+ var source = this, schedulerMethod = dueTime instanceof Date ?
+ 'scheduleWithAbsolute' :
+ 'scheduleWithRelative';
+
+ return new AnonymousObservable(function (observer) {
+ var id = 0,
+ original = new SingleAssignmentDisposable(),
+ subscription = new SerialDisposable(),
+ switched = false,
+ timer = new SerialDisposable();
+
+ subscription.setDisposable(original);
+
+ function createTimer() {
+ var myId = id;
+ timer.setDisposable(scheduler[schedulerMethod](dueTime, function () {
+ if (id === myId) {
+ isPromise(other) && (other = observableFromPromise(other));
+ subscription.setDisposable(other.subscribe(observer));
+ }
+ }));
+ }
+
+ createTimer();
+
+ original.setDisposable(source.subscribe(function (x) {
+ if (!switched) {
+ id++;
+ observer.onNext(x);
+ createTimer();
+ }
+ }, function (e) {
+ if (!switched) {
+ id++;
+ observer.onError(e);
+ }
+ }, function () {
+ if (!switched) {
+ id++;
+ observer.onCompleted();
+ }
+ }));
+ return new CompositeDisposable(subscription, timer);
+ }, source);
+ };
+
+ /**
+ * Returns an Observable that emits only the first item emitted by the source Observable during sequential time windows of a specified duration.
+ * @param {Number} windowDuration time to wait before emitting another item after emitting the last item
+ * @param {Scheduler} [scheduler] the Scheduler to use internally to manage the timers that handle timeout for each item. If not provided, defaults to Scheduler.timeout.
+ * @returns {Observable} An Observable that performs the throttle operation.
+ */
+ observableProto.throttleFirst = function (windowDuration, scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ var duration = +windowDuration || 0;
+ if (duration <= 0) { throw new RangeError('windowDuration cannot be less or equal zero.'); }
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var lastOnNext = 0;
+ return source.subscribe(
+ function (x) {
+ var now = scheduler.now();
+ if (lastOnNext === 0 || now - lastOnNext >= duration) {
+ lastOnNext = now;
+ o.onNext(x);
+ }
+ },function (e) { o.onError(e); }, function () { o.onCompleted(); }
+ );
+ }, source);
+ };
+
+ var PausableObservable = (function (__super__) {
+
+ inherits(PausableObservable, __super__);
+
+ function subscribe(observer) {
+ var conn = this.source.publish(),
+ subscription = conn.subscribe(observer),
+ connection = disposableEmpty;
+
+ var pausable = this.pauser.distinctUntilChanged().subscribe(function (b) {
+ if (b) {
+ connection = conn.connect();
+ } else {
+ connection.dispose();
+ connection = disposableEmpty;
+ }
+ });
+
+ return new CompositeDisposable(subscription, connection, pausable);
+ }
+
+ function PausableObservable(source, pauser) {
+ this.source = source;
+ this.controller = new Subject();
+
+ if (pauser && pauser.subscribe) {
+ this.pauser = this.controller.merge(pauser);
+ } else {
+ this.pauser = this.controller;
+ }
+
+ __super__.call(this, subscribe, source);
+ }
+
+ PausableObservable.prototype.pause = function () {
+ this.controller.onNext(false);
+ };
+
+ PausableObservable.prototype.resume = function () {
+ this.controller.onNext(true);
+ };
+
+ return PausableObservable;
+
+ }(Observable));
+
+ /**
+ * Pauses the underlying observable sequence based upon the observable sequence which yields true/false.
+ * @example
+ * var pauser = new Rx.Subject();
+ * var source = Rx.Observable.interval(100).pausable(pauser);
+ * @param {Observable} pauser The observable sequence used to pause the underlying sequence.
+ * @returns {Observable} The observable sequence which is paused based upon the pauser.
+ */
+ observableProto.pausable = function (pauser) {
+ return new PausableObservable(this, pauser);
+ };
+
+ function combineLatestSource(source, subject, resultSelector) {
+ return new AnonymousObservable(function (o) {
+ var hasValue = [false, false],
+ hasValueAll = false,
+ isDone = false,
+ values = new Array(2),
+ err;
+
+ function next(x, i) {
+ values[i] = x
+ hasValue[i] = true;
+ if (hasValueAll || (hasValueAll = hasValue.every(identity))) {
+ if (err) { return o.onError(err); }
+ var res = tryCatch(resultSelector).apply(null, values);
+ if (res === errorObj) { return o.onError(res.e); }
+ o.onNext(res);
+ }
+ isDone && values[1] && o.onCompleted();
+ }
+
+ return new CompositeDisposable(
+ source.subscribe(
+ function (x) {
+ next(x, 0);
+ },
+ function (e) {
+ if (values[1]) {
+ o.onError(e);
+ } else {
+ err = e;
+ }
+ },
+ function () {
+ isDone = true;
+ values[1] && o.onCompleted();
+ }),
+ subject.subscribe(
+ function (x) {
+ next(x, 1);
+ },
+ function (e) { o.onError(e); },
+ function () {
+ isDone = true;
+ next(true, 1);
+ })
+ );
+ }, source);
+ }
+
+ var PausableBufferedObservable = (function (__super__) {
+
+ inherits(PausableBufferedObservable, __super__);
+
+ function subscribe(o) {
+ var q = [], previousShouldFire;
+
+ function drainQueue() { while (q.length > 0) { o.onNext(q.shift()); } }
+
+ var subscription =
+ combineLatestSource(
+ this.source,
+ this.pauser.distinctUntilChanged().startWith(false),
+ function (data, shouldFire) {
+ return { data: data, shouldFire: shouldFire };
+ })
+ .subscribe(
+ function (results) {
+ if (previousShouldFire !== undefined && results.shouldFire != previousShouldFire) {
+ previousShouldFire = results.shouldFire;
+ // change in shouldFire
+ if (results.shouldFire) { drainQueue(); }
+ } else {
+ previousShouldFire = results.shouldFire;
+ // new data
+ if (results.shouldFire) {
+ o.onNext(results.data);
+ } else {
+ q.push(results.data);
+ }
+ }
+ },
+ function (err) {
+ drainQueue();
+ o.onError(err);
+ },
+ function () {
+ drainQueue();
+ o.onCompleted();
+ }
+ );
+ return subscription;
+ }
+
+ function PausableBufferedObservable(source, pauser) {
+ this.source = source;
+ this.controller = new Subject();
+
+ if (pauser && pauser.subscribe) {
+ this.pauser = this.controller.merge(pauser);
+ } else {
+ this.pauser = this.controller;
+ }
+
+ __super__.call(this, subscribe, source);
+ }
+
+ PausableBufferedObservable.prototype.pause = function () {
+ this.controller.onNext(false);
+ };
+
+ PausableBufferedObservable.prototype.resume = function () {
+ this.controller.onNext(true);
+ };
+
+ return PausableBufferedObservable;
+
+ }(Observable));
+
+ /**
+ * Pauses the underlying observable sequence based upon the observable sequence which yields true/false,
+ * and yields the values that were buffered while paused.
+ * @example
+ * var pauser = new Rx.Subject();
+ * var source = Rx.Observable.interval(100).pausableBuffered(pauser);
+ * @param {Observable} pauser The observable sequence used to pause the underlying sequence.
+ * @returns {Observable} The observable sequence which is paused based upon the pauser.
+ */
+ observableProto.pausableBuffered = function (subject) {
+ return new PausableBufferedObservable(this, subject);
+ };
+
+ var ControlledObservable = (function (__super__) {
+
+ inherits(ControlledObservable, __super__);
+
+ function subscribe (observer) {
+ return this.source.subscribe(observer);
+ }
+
+ function ControlledObservable (source, enableQueue, scheduler) {
+ __super__.call(this, subscribe, source);
+ this.subject = new ControlledSubject(enableQueue, scheduler);
+ this.source = source.multicast(this.subject).refCount();
+ }
+
+ ControlledObservable.prototype.request = function (numberOfItems) {
+ return this.subject.request(numberOfItems == null ? -1 : numberOfItems);
+ };
+
+ return ControlledObservable;
+
+ }(Observable));
+
+ var ControlledSubject = (function (__super__) {
+
+ function subscribe (observer) {
+ return this.subject.subscribe(observer);
+ }
+
+ inherits(ControlledSubject, __super__);
+
+ function ControlledSubject(enableQueue, scheduler) {
+ enableQueue == null && (enableQueue = true);
+
+ __super__.call(this, subscribe);
+ this.subject = new Subject();
+ this.enableQueue = enableQueue;
+ this.queue = enableQueue ? [] : null;
+ this.requestedCount = 0;
+ this.requestedDisposable = disposableEmpty;
+ this.error = null;
+ this.hasFailed = false;
+ this.hasCompleted = false;
+ this.scheduler = scheduler || currentThreadScheduler;
+ }
+
+ addProperties(ControlledSubject.prototype, Observer, {
+ onCompleted: function () {
+ this.hasCompleted = true;
+ if (!this.enableQueue || this.queue.length === 0) {
+ this.subject.onCompleted();
+ } else {
+ this.queue.push(Notification.createOnCompleted());
+ }
+ },
+ onError: function (error) {
+ this.hasFailed = true;
+ this.error = error;
+ if (!this.enableQueue || this.queue.length === 0) {
+ this.subject.onError(error);
+ } else {
+ this.queue.push(Notification.createOnError(error));
+ }
+ },
+ onNext: function (value) {
+ var hasRequested = false;
+
+ if (this.requestedCount === 0) {
+ this.enableQueue && this.queue.push(Notification.createOnNext(value));
+ } else {
+ (this.requestedCount !== -1 && this.requestedCount-- === 0) && this.disposeCurrentRequest();
+ hasRequested = true;
+ }
+ hasRequested && this.subject.onNext(value);
+ },
+ _processRequest: function (numberOfItems) {
+ if (this.enableQueue) {
+ while ((this.queue.length >= numberOfItems && numberOfItems > 0) ||
+ (this.queue.length > 0 && this.queue[0].kind !== 'N')) {
+ var first = this.queue.shift();
+ first.accept(this.subject);
+ if (first.kind === 'N') {
+ numberOfItems--;
+ } else {
+ this.disposeCurrentRequest();
+ this.queue = [];
+ }
+ }
+
+ return { numberOfItems : numberOfItems, returnValue: this.queue.length !== 0};
+ }
+
+ return { numberOfItems: numberOfItems, returnValue: false };
+ },
+ request: function (number) {
+ this.disposeCurrentRequest();
+ var self = this;
+
+ this.requestedDisposable = this.scheduler.scheduleWithState(number,
+ function(s, i) {
+ var r = self._processRequest(i), remaining = r.numberOfItems;
+ if (!r.returnValue) {
+ self.requestedCount = remaining;
+ self.requestedDisposable = disposableCreate(function () {
+ self.requestedCount = 0;
+ });
+ }
+ });
+
+ return this.requestedDisposable;
+ },
+ disposeCurrentRequest: function () {
+ this.requestedDisposable.dispose();
+ this.requestedDisposable = disposableEmpty;
+ }
+ });
+
+ return ControlledSubject;
+ }(Observable));
+
+ /**
+ * Attaches a controller to the observable sequence with the ability to queue.
+ * @example
+ * var source = Rx.Observable.interval(100).controlled();
+ * source.request(3); // Reads 3 values
+ * @param {bool} enableQueue truthy value to determine if values should be queued pending the next request
+ * @param {Scheduler} scheduler determines how the requests will be scheduled
+ * @returns {Observable} The observable sequence which only propagates values on request.
+ */
+ observableProto.controlled = function (enableQueue, scheduler) {
+
+ if (enableQueue && isScheduler(enableQueue)) {
+ scheduler = enableQueue;
+ enableQueue = true;
+ }
+
+ if (enableQueue == null) { enableQueue = true; }
+ return new ControlledObservable(this, enableQueue, scheduler);
+ };
+
+ /**
+ * Pipes the existing Observable sequence into a Node.js Stream.
+ * @param {Stream} dest The destination Node.js stream.
+ * @returns {Stream} The destination stream.
+ */
+ observableProto.pipe = function (dest) {
+ var source = this.pausableBuffered();
+
+ function onDrain() {
+ source.resume();
+ }
+
+ dest.addListener('drain', onDrain);
+
+ source.subscribe(
+ function (x) {
+ !dest.write(String(x)) && source.pause();
+ },
+ function (err) {
+ dest.emit('error', err);
+ },
+ function () {
+ // Hack check because STDIO is not closable
+ !dest._isStdio && dest.end();
+ dest.removeListener('drain', onDrain);
+ });
+
+ source.resume();
+
+ return dest;
+ };
+
+ /**
+ * Executes a transducer to transform the observable sequence
+ * @param {Transducer} transducer A transducer to execute
+ * @returns {Observable} An Observable sequence containing the results from the transducer.
+ */
+ observableProto.transduce = function(transducer) {
+ var source = this;
+
+ function transformForObserver(o) {
+ return {
+ '@@transducer/init': function() {
+ return o;
+ },
+ '@@transducer/step': function(obs, input) {
+ return obs.onNext(input);
+ },
+ '@@transducer/result': function(obs) {
+ return obs.onCompleted();
+ }
+ };
+ }
+
+ return new AnonymousObservable(function(o) {
+ var xform = transducer(transformForObserver(o));
+ return source.subscribe(
+ function(v) {
+ try {
+ xform['@@transducer/step'](o, v);
+ } catch (e) {
+ o.onError(e);
+ }
+ },
+ function (e) { o.onError(e); },
+ function() { xform['@@transducer/result'](o); }
+ );
+ }, source);
+ };
+
+ var AnonymousObservable = Rx.AnonymousObservable = (function (__super__) {
+ inherits(AnonymousObservable, __super__);
+
+ // Fix subscriber to check for undefined or function returned to decorate as Disposable
+ function fixSubscriber(subscriber) {
+ return subscriber && isFunction(subscriber.dispose) ? subscriber :
+ isFunction(subscriber) ? disposableCreate(subscriber) : disposableEmpty;
+ }
+
+ function setDisposable(s, state) {
+ var ado = state[0], subscribe = state[1];
+ var sub = tryCatch(subscribe)(ado);
+
+ if (sub === errorObj) {
+ if(!ado.fail(errorObj.e)) { return thrower(errorObj.e); }
+ }
+ ado.setDisposable(fixSubscriber(sub));
+ }
+
+ function AnonymousObservable(subscribe, parent) {
+ this.source = parent;
+
+ function s(observer) {
+ var ado = new AutoDetachObserver(observer), state = [ado, subscribe];
+
+ if (currentThreadScheduler.scheduleRequired()) {
+ currentThreadScheduler.scheduleWithState(state, setDisposable);
+ } else {
+ setDisposable(null, state);
+ }
+ return ado;
+ }
+
+ __super__.call(this, s);
+ }
+
+ return AnonymousObservable;
+
+ }(Observable));
+
+ var AutoDetachObserver = (function (__super__) {
+ inherits(AutoDetachObserver, __super__);
+
+ function AutoDetachObserver(observer) {
+ __super__.call(this);
+ this.observer = observer;
+ this.m = new SingleAssignmentDisposable();
+ }
+
+ var AutoDetachObserverPrototype = AutoDetachObserver.prototype;
+
+ AutoDetachObserverPrototype.next = function (value) {
+ var result = tryCatch(this.observer.onNext).call(this.observer, value);
+ if (result === errorObj) {
+ this.dispose();
+ thrower(result.e);
+ }
+ };
+
+ AutoDetachObserverPrototype.error = function (err) {
+ var result = tryCatch(this.observer.onError).call(this.observer, err);
+ this.dispose();
+ result === errorObj && thrower(result.e);
+ };
+
+ AutoDetachObserverPrototype.completed = function () {
+ var result = tryCatch(this.observer.onCompleted).call(this.observer);
+ this.dispose();
+ result === errorObj && thrower(result.e);
+ };
+
+ AutoDetachObserverPrototype.setDisposable = function (value) { this.m.setDisposable(value); };
+ AutoDetachObserverPrototype.getDisposable = function () { return this.m.getDisposable(); };
+
+ AutoDetachObserverPrototype.dispose = function () {
+ __super__.prototype.dispose.call(this);
+ this.m.dispose();
+ };
+
+ return AutoDetachObserver;
+ }(AbstractObserver));
+
+ var InnerSubscription = function (subject, observer) {
+ this.subject = subject;
+ this.observer = observer;
+ };
+
+ InnerSubscription.prototype.dispose = function () {
+ if (!this.subject.isDisposed && this.observer !== null) {
+ var idx = this.subject.observers.indexOf(this.observer);
+ this.subject.observers.splice(idx, 1);
+ this.observer = null;
+ }
+ };
+
+ /**
+ * Represents an object that is both an observable sequence as well as an observer.
+ * Each notification is broadcasted to all subscribed observers.
+ */
+ var Subject = Rx.Subject = (function (__super__) {
+ function subscribe(observer) {
+ checkDisposed(this);
+ if (!this.isStopped) {
+ this.observers.push(observer);
+ return new InnerSubscription(this, observer);
+ }
+ if (this.hasError) {
+ observer.onError(this.error);
+ return disposableEmpty;
+ }
+ observer.onCompleted();
+ return disposableEmpty;
+ }
+
+ inherits(Subject, __super__);
+
+ /**
+ * Creates a subject.
+ */
+ function Subject() {
+ __super__.call(this, subscribe);
+ this.isDisposed = false,
+ this.isStopped = false,
+ this.observers = [];
+ this.hasError = false;
+ }
+
+ addProperties(Subject.prototype, Observer.prototype, {
+ /**
+ * Indicates whether the subject has observers subscribed to it.
+ * @returns {Boolean} Indicates whether the subject has observers subscribed to it.
+ */
+ hasObservers: function () { return this.observers.length > 0; },
+ /**
+ * Notifies all subscribed observers about the end of the sequence.
+ */
+ onCompleted: function () {
+ checkDisposed(this);
+ if (!this.isStopped) {
+ this.isStopped = true;
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ os[i].onCompleted();
+ }
+
+ this.observers.length = 0;
+ }
+ },
+ /**
+ * Notifies all subscribed observers about the exception.
+ * @param {Mixed} error The exception to send to all observers.
+ */
+ onError: function (error) {
+ checkDisposed(this);
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.error = error;
+ this.hasError = true;
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ os[i].onError(error);
+ }
+
+ this.observers.length = 0;
+ }
+ },
+ /**
+ * Notifies all subscribed observers about the arrival of the specified element in the sequence.
+ * @param {Mixed} value The value to send to all observers.
+ */
+ onNext: function (value) {
+ checkDisposed(this);
+ if (!this.isStopped) {
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ os[i].onNext(value);
+ }
+ }
+ },
+ /**
+ * Unsubscribe all observers and release resources.
+ */
+ dispose: function () {
+ this.isDisposed = true;
+ this.observers = null;
+ }
+ });
+
+ /**
+ * Creates a subject from the specified observer and observable.
+ * @param {Observer} observer The observer used to send messages to the subject.
+ * @param {Observable} observable The observable used to subscribe to messages sent from the subject.
+ * @returns {Subject} Subject implemented using the given observer and observable.
+ */
+ Subject.create = function (observer, observable) {
+ return new AnonymousSubject(observer, observable);
+ };
+
+ return Subject;
+ }(Observable));
+
+ /**
+ * Represents the result of an asynchronous operation.
+ * The last value before the OnCompleted notification, or the error received through OnError, is sent to all subscribed observers.
+ */
+ var AsyncSubject = Rx.AsyncSubject = (function (__super__) {
+
+ function subscribe(observer) {
+ checkDisposed(this);
+
+ if (!this.isStopped) {
+ this.observers.push(observer);
+ return new InnerSubscription(this, observer);
+ }
+
+ if (this.hasError) {
+ observer.onError(this.error);
+ } else if (this.hasValue) {
+ observer.onNext(this.value);
+ observer.onCompleted();
+ } else {
+ observer.onCompleted();
+ }
+
+ return disposableEmpty;
+ }
+
+ inherits(AsyncSubject, __super__);
+
+ /**
+ * Creates a subject that can only receive one value and that value is cached for all future observations.
+ * @constructor
+ */
+ function AsyncSubject() {
+ __super__.call(this, subscribe);
+
+ this.isDisposed = false;
+ this.isStopped = false;
+ this.hasValue = false;
+ this.observers = [];
+ this.hasError = false;
+ }
+
+ addProperties(AsyncSubject.prototype, Observer, {
+ /**
+ * Indicates whether the subject has observers subscribed to it.
+ * @returns {Boolean} Indicates whether the subject has observers subscribed to it.
+ */
+ hasObservers: function () {
+ checkDisposed(this);
+ return this.observers.length > 0;
+ },
+ /**
+ * Notifies all subscribed observers about the end of the sequence, also causing the last received value to be sent out (if any).
+ */
+ onCompleted: function () {
+ var i, len;
+ checkDisposed(this);
+ if (!this.isStopped) {
+ this.isStopped = true;
+ var os = cloneArray(this.observers), len = os.length;
+
+ if (this.hasValue) {
+ for (i = 0; i < len; i++) {
+ var o = os[i];
+ o.onNext(this.value);
+ o.onCompleted();
+ }
+ } else {
+ for (i = 0; i < len; i++) {
+ os[i].onCompleted();
+ }
+ }
+
+ this.observers.length = 0;
+ }
+ },
+ /**
+ * Notifies all subscribed observers about the error.
+ * @param {Mixed} error The Error to send to all observers.
+ */
+ onError: function (error) {
+ checkDisposed(this);
+ if (!this.isStopped) {
+ this.isStopped = true;
+ this.hasError = true;
+ this.error = error;
+
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ os[i].onError(error);
+ }
+
+ this.observers.length = 0;
+ }
+ },
+ /**
+ * Sends a value to the subject. The last value received before successful termination will be sent to all subscribed and future observers.
+ * @param {Mixed} value The value to store in the subject.
+ */
+ onNext: function (value) {
+ checkDisposed(this);
+ if (this.isStopped) { return; }
+ this.value = value;
+ this.hasValue = true;
+ },
+ /**
+ * Unsubscribe all observers and release resources.
+ */
+ dispose: function () {
+ this.isDisposed = true;
+ this.observers = null;
+ this.exception = null;
+ this.value = null;
+ }
+ });
+
+ return AsyncSubject;
+ }(Observable));
+
+ var AnonymousSubject = Rx.AnonymousSubject = (function (__super__) {
+ inherits(AnonymousSubject, __super__);
+
+ function subscribe(observer) {
+ return this.observable.subscribe(observer);
+ }
+
+ function AnonymousSubject(observer, observable) {
+ this.observer = observer;
+ this.observable = observable;
+ __super__.call(this, subscribe);
+ }
+
+ addProperties(AnonymousSubject.prototype, Observer.prototype, {
+ onCompleted: function () {
+ this.observer.onCompleted();
+ },
+ onError: function (error) {
+ this.observer.onError(error);
+ },
+ onNext: function (value) {
+ this.observer.onNext(value);
+ }
+ });
+
+ return AnonymousSubject;
+ }(Observable));
+
+ /**
+ * Represents a value that changes over time.
+ * Observers can subscribe to the subject to receive the last (or initial) value and all subsequent notifications.
+ */
+ var BehaviorSubject = Rx.BehaviorSubject = (function (__super__) {
+ function subscribe(observer) {
+ checkDisposed(this);
+ if (!this.isStopped) {
+ this.observers.push(observer);
+ observer.onNext(this.value);
+ return new InnerSubscription(this, observer);
+ }
+ if (this.hasError) {
+ observer.onError(this.error);
+ } else {
+ observer.onCompleted();
+ }
+ return disposableEmpty;
+ }
+
+ inherits(BehaviorSubject, __super__);
+
+ /**
+ * Initializes a new instance of the BehaviorSubject class which creates a subject that caches its last value and starts with the specified value.
+ * @param {Mixed} value Initial value sent to observers when no other value has been received by the subject yet.
+ */
+ function BehaviorSubject(value) {
+ __super__.call(this, subscribe);
+ this.value = value,
+ this.observers = [],
+ this.isDisposed = false,
+ this.isStopped = false,
+ this.hasError = false;
+ }
+
+ addProperties(BehaviorSubject.prototype, Observer, {
+ /**
+ * Gets the current value or throws an exception.
+ * Value is frozen after onCompleted is called.
+ * After onError is called always throws the specified exception.
+ * An exception is always thrown after dispose is called.
+ * @returns {Mixed} The initial value passed to the constructor until onNext is called; after which, the last value passed to onNext.
+ */
+ getValue: function () {
+ checkDisposed(this);
+ if (this.hasError) {
+ throw this.error;
+ }
+ return this.value;
+ },
+ /**
+ * Indicates whether the subject has observers subscribed to it.
+ * @returns {Boolean} Indicates whether the subject has observers subscribed to it.
+ */
+ hasObservers: function () { return this.observers.length > 0; },
+ /**
+ * Notifies all subscribed observers about the end of the sequence.
+ */
+ onCompleted: function () {
+ checkDisposed(this);
+ if (this.isStopped) { return; }
+ this.isStopped = true;
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ os[i].onCompleted();
+ }
+
+ this.observers.length = 0;
+ },
+ /**
+ * Notifies all subscribed observers about the exception.
+ * @param {Mixed} error The exception to send to all observers.
+ */
+ onError: function (error) {
+ checkDisposed(this);
+ if (this.isStopped) { return; }
+ this.isStopped = true;
+ this.hasError = true;
+ this.error = error;
+
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ os[i].onError(error);
+ }
+
+ this.observers.length = 0;
+ },
+ /**
+ * Notifies all subscribed observers about the arrival of the specified element in the sequence.
+ * @param {Mixed} value The value to send to all observers.
+ */
+ onNext: function (value) {
+ checkDisposed(this);
+ if (this.isStopped) { return; }
+ this.value = value;
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ os[i].onNext(value);
+ }
+ },
+ /**
+ * Unsubscribe all observers and release resources.
+ */
+ dispose: function () {
+ this.isDisposed = true;
+ this.observers = null;
+ this.value = null;
+ this.exception = null;
+ }
+ });
+
+ return BehaviorSubject;
+ }(Observable));
+
+ /**
+ * Represents an object that is both an observable sequence as well as an observer.
+ * Each notification is broadcasted to all subscribed and future observers, subject to buffer trimming policies.
+ */
+ var ReplaySubject = Rx.ReplaySubject = (function (__super__) {
+
+ var maxSafeInteger = Math.pow(2, 53) - 1;
+
+ function createRemovableDisposable(subject, observer) {
+ return disposableCreate(function () {
+ observer.dispose();
+ !subject.isDisposed && subject.observers.splice(subject.observers.indexOf(observer), 1);
+ });
+ }
+
+ function subscribe(observer) {
+ var so = new ScheduledObserver(this.scheduler, observer),
+ subscription = createRemovableDisposable(this, so);
+ checkDisposed(this);
+ this._trim(this.scheduler.now());
+ this.observers.push(so);
+
+ for (var i = 0, len = this.q.length; i < len; i++) {
+ so.onNext(this.q[i].value);
+ }
+
+ if (this.hasError) {
+ so.onError(this.error);
+ } else if (this.isStopped) {
+ so.onCompleted();
+ }
+
+ so.ensureActive();
+ return subscription;
+ }
+
+ inherits(ReplaySubject, __super__);
+
+ /**
+ * Initializes a new instance of the ReplaySubject class with the specified buffer size, window size and scheduler.
+ * @param {Number} [bufferSize] Maximum element count of the replay buffer.
+ * @param {Number} [windowSize] Maximum time length of the replay buffer.
+ * @param {Scheduler} [scheduler] Scheduler the observers are invoked on.
+ */
+ function ReplaySubject(bufferSize, windowSize, scheduler) {
+ this.bufferSize = bufferSize == null ? maxSafeInteger : bufferSize;
+ this.windowSize = windowSize == null ? maxSafeInteger : windowSize;
+ this.scheduler = scheduler || currentThreadScheduler;
+ this.q = [];
+ this.observers = [];
+ this.isStopped = false;
+ this.isDisposed = false;
+ this.hasError = false;
+ this.error = null;
+ __super__.call(this, subscribe);
+ }
+
+ addProperties(ReplaySubject.prototype, Observer.prototype, {
+ /**
+ * Indicates whether the subject has observers subscribed to it.
+ * @returns {Boolean} Indicates whether the subject has observers subscribed to it.
+ */
+ hasObservers: function () {
+ return this.observers.length > 0;
+ },
+ _trim: function (now) {
+ while (this.q.length > this.bufferSize) {
+ this.q.shift();
+ }
+ while (this.q.length > 0 && (now - this.q[0].interval) > this.windowSize) {
+ this.q.shift();
+ }
+ },
+ /**
+ * Notifies all subscribed observers about the arrival of the specified element in the sequence.
+ * @param {Mixed} value The value to send to all observers.
+ */
+ onNext: function (value) {
+ checkDisposed(this);
+ if (this.isStopped) { return; }
+ var now = this.scheduler.now();
+ this.q.push({ interval: now, value: value });
+ this._trim(now);
+
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ var observer = os[i];
+ observer.onNext(value);
+ observer.ensureActive();
+ }
+ },
+ /**
+ * Notifies all subscribed observers about the exception.
+ * @param {Mixed} error The exception to send to all observers.
+ */
+ onError: function (error) {
+ checkDisposed(this);
+ if (this.isStopped) { return; }
+ this.isStopped = true;
+ this.error = error;
+ this.hasError = true;
+ var now = this.scheduler.now();
+ this._trim(now);
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ var observer = os[i];
+ observer.onError(error);
+ observer.ensureActive();
+ }
+ this.observers.length = 0;
+ },
+ /**
+ * Notifies all subscribed observers about the end of the sequence.
+ */
+ onCompleted: function () {
+ checkDisposed(this);
+ if (this.isStopped) { return; }
+ this.isStopped = true;
+ var now = this.scheduler.now();
+ this._trim(now);
+ for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
+ var observer = os[i];
+ observer.onCompleted();
+ observer.ensureActive();
+ }
+ this.observers.length = 0;
+ },
+ /**
+ * Unsubscribe all observers and release resources.
+ */
+ dispose: function () {
+ this.isDisposed = true;
+ this.observers = null;
+ }
+ });
+
+ return ReplaySubject;
+ }(Observable));
+
+ /**
+ * Used to pause and resume streams.
+ */
+ Rx.Pauser = (function (__super__) {
+ inherits(Pauser, __super__);
+
+ function Pauser() {
+ __super__.call(this);
+ }
+
+ /**
+ * Pauses the underlying sequence.
+ */
+ Pauser.prototype.pause = function () { this.onNext(false); };
+
+ /**
+ * Resumes the underlying sequence.
+ */
+ Pauser.prototype.resume = function () { this.onNext(true); };
+
+ return Pauser;
+ }(Subject));
+
+ if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
+ root.Rx = Rx;
+
+ define(function() {
+ return Rx;
+ });
+ } else if (freeExports && freeModule) {
+ // in Node.js or RingoJS
+ if (moduleExports) {
+ (freeModule.exports = Rx).Rx = Rx;
+ } else {
+ freeExports.Rx = Rx;
+ }
+ } else {
+ // in a browser or Rhino
+ root.Rx = Rx;
+ }
+
+ // All code before this point will be filtered from stack traces.
+ var rEndingLine = captureLine();
+
+}.call(this));
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.map b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.map
new file mode 100644
index 00000000000..6e9d6b12e1b
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.map
@@ -0,0 +1 @@
+{"version":3,"file":"rx.lite.min.js","sources":["rx.lite.js"],"names":["undefined","cloneArray","arr","len","length","a","Array","i","makeStackTraceLong","error","observable","hasStacks","stack","indexOf","STACK_JUMP_SEPARATOR","stacks","o","source","unshift","concatedStacks","join","filterStackString","stackString","lines","split","desiredLines","line","isInternalFrame","isNodeFrame","push","stackLine","fileNameAndLineNumber","getFileNameAndLineNumber","fileName","lineNumber","rFileName","rStartingLine","rEndingLine","captureLine","Error","e","firstLine","attempt1","exec","Number","attempt2","attempt3","keysIn","object","result","isObject","support","nonEnumArgs","isArguments","slice","call","skipProto","enumPrototypes","skipErrorProps","enumErrorProps","errorProto","key","nonEnumShadows","objectProto","ctor","constructor","index","dontEnumsLength","prototype","className","stringProto","stringClass","errorClass","toString","nonEnum","nonEnumProps","dontEnums","hasOwnProperty","internalFor","callback","keysFunc","props","internalForIn","isNode","value","deepEquals","b","stackA","stackB","type","otherType","otherClass","argsClass","objectClass","boolClass","dateClass","numberClass","regexpClass","String","isArr","arrayClass","nodeClass","ctorA","argsObject","Object","ctorB","isFunction","size","pop","tryCatcher","tryCatchTarget","apply","this","arguments","errorObj","tryCatch","fn","TypeError","thrower","arrayInitialize","count","factory","IndexedItem","id","StringIterable","str","_s","s","StringIterator","_l","_i","ArrayIterable","_a","ArrayIterator","toLength","numberIsFinite","root","isFinite","getIterable","it","$iterator$","sign","number","isNaN","Math","floor","abs","maxSafeInteger","FromArraySink","observer","parent","observableOf","scheduler","array","isScheduler","currentThreadScheduler","FromArrayObservable","PairsSink","RepeatSink","observableCatchHandler","handler","AnonymousObservable","d1","SingleAssignmentDisposable","subscription","SerialDisposable","setDisposable","subscribe","x","onNext","ex","onError","isPromise","observableFromPromise","d","onCompleted","falseFactory","zipArray","second","resultSelector","first","left","right","res","emptyArrayFactory","arrayFactory","ScanObserver","accumulator","hasSeed","seed","hasAccumulation","accumulation","hasValue","isStopped","concatMap","selector","thisArg","selectorFunc","bindCallback","map","isArrayLike","isIterable","observableFrom","concatAll","flatMap","mergeAll","createListener","element","name","addEventListener","disposableCreate","removeEventListener","createEventListener","el","eventName","disposables","CompositeDisposable","toStr","add","item","observableTimerDate","dueTime","scheduleWithAbsolute","observableTimerDateAndPeriod","period","p","normalizeTime","scheduleRecursiveWithAbsoluteAndState","self","now","observableTimerTimeSpan","scheduleWithRelative","observableTimerTimeSpanAndPeriod","schedulePeriodicWithState","observableDefer","observableDelayTimeSpan","active","cancelable","exception","q","running","materialize","timestamp","notification","shouldRun","kind","scheduleRecursiveWithRelative","recurseDueTime","shouldRecurse","shift","accept","max","observableDelayDate","sampleObservable","sampler","sampleSubscribe","atEnd","sourceSubscription","newValue","dispose","combineLatestSource","subject","next","values","hasValueAll","every","identity","err","isDone","objectTypes","boolean","function","string","window","freeExports","exports","nodeType","freeModule","module","moduleExports","freeGlobal","global","Rx","internals","config","Promise","helpers","noop","notDefined","defaultNow","pluck","property","just","Date","defaultComparer","y","isEqual","defaultSubComparer","defaultError","defaultKeySerializer","then","asArray","not","isFn","longStackSupport","EmptyError","message","ObjectDisposedError","ArgumentOutOfRangeError","NotSupportedError","NotImplementedError","notImplemented","notSupported","Symbol","iterator","Set","doneEnumerator","done","supportNodeClass","func","argCount","arg","collection","funcClass","supportsArgsClass","propertyIsEnumerable","document","toLocaleString","valueOf","test","inherits","child","__","addProperties","obj","sources","idx","ln","prop","addRef","xs","r","getDisposable","compareTo","other","c","PriorityQueue","capacity","items","priorityProto","isHigherPriority","percolate","temp","heapify","peek","removeAt","dequeue","enqueue","remove","args","isArray","isDisposable","isDisposed","CompositeDisposablePrototype","shouldDispose","splice","currentDisposables","Disposable","action","create","disposableEmpty","empty","checkDisposed","disposable","current","old","ScheduledItem","RefCountDisposable","InnerDisposable","isInnerDisposed","underlyingDisposable","isPrimaryDisposed","state","comparer","invoke","invokeCore","isCancelled","Scheduler","schedule","scheduleRelative","scheduleAbsolute","_schedule","_scheduleRelative","_scheduleAbsolute","invokeAction","schedulerProto","scheduleWithState","scheduleWithRelativeAndState","scheduleWithAbsoluteAndState","normalize","timeSpan","invokeRecImmediate","pair","recursiveAction","state1","state2","isAdded","scheduler1","state3","group","invokeRecDate","method","dueTime1","scheduleInnerRecursive","dt","scheduleRecursive","scheduleRecursiveWithState","scheduleRecursiveWithRelativeAndState","scheduleRecursiveWithAbsolute","schedulePeriodic","setInterval","clearInterval","scheduleMethod","clearMethod","immediateScheduler","immediate","scheduleNow","currentThread","runTrampoline","queue","si","currentScheduler","scheduleRequired","localTimer","SchedulePeriodicRecursive","tick","command","recurse","_period","_state","_action","_cancel","_scheduler","start","bind","localSetTimeout","localClearTimeout","setTimeout","clearTimeout","WScript","time","Sleep","runTask","handle","currentlyRunning","task","tasksByHandle","postMessageSupported","postMessage","importScripts","isAsync","oldHandler","onmessage","onGlobalPostMessage","event","data","substring","MSG_PREFIX","nextHandle","reNative","RegExp","replace","setImmediate","process","nextTick","random","attachEvent","currentId","MessageChannel","channel","port1","port2","createElement","scriptElement","onreadystatechange","parentNode","removeChild","documentElement","appendChild","observableProto","timeoutScheduler","timeout","Notification","acceptObservable","_accept","_acceptObservable","observerOrOnNext","toObservable","_","notificationCreateOnNext","createOnNext","notificationCreateOnError","createOnError","notificationCreateOnCompleted","createOnCompleted","Observer","observerCreate","AnonymousObserver","AbstractObserver","__super__","completed","fail","_onNext","_onError","_onCompleted","Observable","_subscribe","oldOnError","forEach","subscribeOnNext","subscribeOnError","subscribeOnCompleted","ScheduledObserver","isAcquired","hasFaulted","ensureActive","isOwner","work","ObservableBase","fixSubscriber","subscriber","ado","sub","subscribeCore","AutoDetachObserver","Enumerable","ConcatEnumerableObservable","InnerObserver","currentItem","currentValue","concat","CatchErrorObservable","lastException","catchError","catchErrorWhen","notificationHandler","exceptions","Subject","notifier","handled","notificationDisposable","outer","inner","exn","RepeatEnumerable","v","RepeatEnumerator","l","enumerableRepeat","repeat","repeatCount","OfEnumerable","OfEnumerator","enumerableOf","of","ToArrayObservable","toArray","createWithDisposable","defer","observableFactory","observableThrow","EmptyObservable","EmptySink","scheduleItem","sink","run","observableEmpty","FromObservable","iterable","mapper","FromSink","loopRecursive","list","pow","charAt","from","mapFn","observableFromArray","fromArray","NeverObservable","never","ofWithScheduler","PairsObservable","keys","pairs","RangeObservable","rangeCount","RangeSink","range","RepeatObservable","JustObservable","JustSink","ThrowObservable","returnValue","ThrowSink","throwError","throwException","catchException","handlerOrSecond","observableCatch","combineLatest","filter","j","n","subscriptions","sad","observableConcat","ConcatObservable","ConcatSink","concatObservable","merge","MergeObservable","maxConcurrent","g","MergeObserver","activeCount","handleSubscribe","innerSource","maxConcurrentOrOther","observableMerge","CompositeError","errors","innerErrors","mergeDelayError","setCompletion","m","innerSubscription","MergeAllObservable","MergeAllObserver","mergeObservable","skipUntil","isOpen","rightSubscription","SwitchObservable","SwitchObserver","stopped","latest","hasLatest","switchLatest","TakeUntilObservable","takeUntil","withLatestFrom","allValues","zip","queues","queuedValues","asObservable","dematerialize","distinctUntilChanged","keySelector","currentKey","hasCurrentKey","comparerEquals","TapObservable","t","tap","doAction","doOnNext","tapOnNext","doOnError","tapOnError","doOnCompleted","tapOnCompleted","ensure","finallyAction","IgnoreElementsObservable","ignoreElements","retry","retryCount","retryWhen","ScanObservable","scan","skipLast","startWith","takeLast","selectConcat","selectorResult","i2","MapObservable","innerMap","internalMap","select","selectorFn","currentProp","selectMany","selectSwitch","flatMapLatest","switchMap","SkipObservable","skipCount","skip","skipWhile","predicate","take","remaining","takeWhile","FilterObservable","innerPredicate","internalFilter","shouldYield","where","fromCallback","context","results","publishLast","refCount","fromNodeCallback","useNativeEvents","fromEvent","addListener","fromEventPattern","h","removeListener","on","off","publish","addHandler","removeHandler","innerHandler","FromPromiseObservable","fromPromise","promise","toPromise","promiseCtor","resolve","reject","startAsync","functionAsync","multicast","subjectOrSubjectSelector","connectable","connect","ConnectableObservable","share","AsyncSubject","publishValue","initialValueOrSelector","initialValue","BehaviorSubject","shareValue","replay","bufferSize","windowSize","ReplaySubject","shareReplay","hasSubscription","sourceObservable","connectableSubscription","shouldConnect","observableinterval","interval","timer","periodOrScheduler","getTime","delay","debounce","throttleWithTimeout","hasvalue","throttle","sample","throttleLatest","intervalOrSampler","schedulerMethod","createTimer","myId","original","switched","throttleFirst","windowDuration","duration","RangeError","lastOnNext","PausableObservable","conn","connection","pausable","pauser","controller","pause","resume","PausableBufferedObservable","drainQueue","previousShouldFire","shouldFire","pausableBuffered","ControlledObservable","enableQueue","ControlledSubject","request","numberOfItems","requestedCount","requestedDisposable","hasFailed","hasCompleted","hasRequested","disposeCurrentRequest","_processRequest","controlled","pipe","dest","onDrain","write","emit","_isStdio","end","transduce","transducer","transformForObserver","@@transducer/init","@@transducer/step","obs","input","@@transducer/result","xform","AutoDetachObserverPrototype","InnerSubscription","observers","hasError","hasObservers","os","AnonymousSubject","getValue","createRemovableDisposable","so","_trim","Pauser","define","amd"],"mappings":";CAEE,SAAUA,GA2DR,QAASC,GAAWC,GAElB,IAAI,GADAC,GAAMD,EAAIE,OAAQC,EAAI,GAAIC,OAAMH,GAC5BI,EAAI,EAAOJ,EAAJI,EAASA,IAAOF,EAAEE,GAAKL,EAAIK,EAC1C,OAAOF,GAgBX,QAASG,GAAmBC,EAAOC,GAG/B,GAAIC,IACAD,EAAWE,OACM,gBAAVH,IACG,OAAVA,GACAA,EAAMG,OACwC,KAA9CH,EAAMG,MAAMC,QAAQC,IACtB,CAEA,IAAK,GADDC,MACKC,EAAIN,EAAcM,EAAGA,EAAIA,EAAEC,OAC9BD,EAAEJ,OACJG,EAAOG,QAAQF,EAAEJ,MAGrBG,GAAOG,QAAQT,EAAMG,MAErB,IAAIO,GAAiBJ,EAAOK,KAAK,KAAON,GAAuB,KAC/DL,GAAMG,MAAQS,EAAkBF,IAItC,QAASE,GAAkBC,GAGzB,IAAK,GAFDC,GAAQD,EAAYE,MAAM,MAC1BC,KACKlB,EAAI,EAAGJ,EAAMoB,EAAMnB,OAAYD,EAAJI,EAASA,IAAK,CAChD,GAAImB,GAAOH,EAAMhB,EAEZoB,GAAgBD,IAAUE,EAAYF,KAASA,GAClDD,EAAaI,KAAKH,GAGtB,MAAOD,GAAaL,KAAK,MAG3B,QAASO,GAAgBG,GACvB,GAAIC,GAAwBC,EAAyBF,EACrD,KAAKC,EACH,OAAO,CAET,IAAIE,GAAWF,EAAsB,GAAIG,EAAaH,EAAsB,EAE5E,OAAOE,KAAaE,IAClBD,GAAcE,IACAC,IAAdH,EAGJ,QAASN,GAAYE,GACnB,MAA4C,KAArCA,EAAUjB,QAAQ,gBACY,KAAnCiB,EAAUjB,QAAQ,aAGtB,QAASyB,KACP,GAAK3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zB,OAAS,IAK1B2K,YAAa,WAEX,GADAqM,GAAcpQ,OACVA,KAAKiF,UAAT,CACAjF,KAAKiF,WAAY,CACjB,IAAIoC,GAAMrH,KAAKwC,UAAU6E,KACzBrH,MAAKktB,MAAM7lB,EACX,KAAK,GAAI9N,GAAI,EAAGszB,EAAK5zB,EAAW+G,KAAK0sB,WAAYvzB,EAAM0zB,EAAGzzB,OAAYD,EAAJI,EAASA,IAAK,CAC9E,GAAI8I,GAAWwqB,EAAGtzB,EAClB8I,GAAS0B,cACT1B,EAASwX,eAEX7Z,KAAK0sB,UAAUtzB,OAAS,IAK1B+P,QAAS,WACPnJ,KAAK0P,YAAa,EAClB1P,KAAK0sB,UAAY,QAIdzE,GACP9O,GAKFzO,IAAGyiB,OAAU,SAAUtU,GAGrB,QAASsU,KACPtU,EAAUtc,KAAKyD,MAajB,MAhBA0N,IAASyf,EAAQtU,GASjBsU,EAAO/vB,UAAUgtB,MAAQ,WAAcpqB,KAAKyD,QAAO,IAKnD0pB,EAAO/vB,UAAUitB,OAAS,WAAcrqB,KAAKyD,QAAO,IAE7C0pB,GACPhS,IAEmB,kBAAViS,SAA6C,gBAAdA,QAAOC,KAAmBD,OAAOC,KACzE7rB,EAAKkJ,GAAKA,GAEV0iB,OAAO,WACL,MAAO1iB,OAEAR,GAAeG,EAEpBE,GACDF,EAAWF,QAAUO,IAAIA,GAAKA,GAE/BR,EAAYQ,GAAKA,GAInBlJ,EAAKkJ,GAAKA,EAIZ,IAAIrP,IAAcC,MAElBiB,KAAKyD"} \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.min.js b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.min.js
new file mode 100644
index 00000000000..f7f3a610e9d
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.min.js
@@ -0,0 +1,6 @@
+/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
+(function(a){function b(a){for(var b=a.length,c=new Array(b),d=0;b>d;d++)c[d]=a[d];return c}function c(a,b){if(ka&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(oa)){for(var c=[],e=b;e;e=e.source)e.stack&&c.unshift(e.stack);c.unshift(a.stack);var f=c.join("\n"+oa+"\n");a.stack=d(f)}}function d(a){for(var b=a.split("\n"),c=[],d=0,g=b.length;g>d;d++){var h=b[d];e(h)||f(h)||!h||c.push(h)}return c.join("\n")}function e(a){var b=h(a);if(!b)return!1;var c=b[0],d=b[1];return c===ma&&d>=na&&Rc>=d}function f(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function g(){if(ka)try{throw new Error}catch(a){var b=a.stack.split("\n"),c=b[0].indexOf("@")>0?b[1]:b[2],d=h(c);if(!d)return;return ma=d[0],d[1]}}function h(a){var b=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(a);if(b)return[b[1],Number(b[2])];var c=/at ([^ ]+):(\d+):(?:\d+)$/.exec(a);if(c)return[c[1],Number(c[2])];var d=/.*@(.+):(\d+)$/.exec(a);return d?[d[1],Number(d[2])]:void 0}function i(a){var b=[];if(!Xa(a))return b;Wa.nonEnumArgs&&a.length&&Ya(a)&&(a=ab.call(a));var c=Wa.enumPrototypes&&"function"==typeof a,d=Wa.enumErrorProps&&(a===Ra||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(Wa.nonEnumShadows&&a!==Sa){var f=a.constructor,g=-1,h=Da;if(a===(f&&f.prototype))var i=a===Ta?Na:a===Ra?Ia:Oa.call(a),j=Va[i];for(;++g<h;)e=Ca[g],j&&j[e]||!Pa.call(a,e)||b.push(e)}return b}function j(a,b,c){for(var d=-1,e=c(a),f=e.length;++d<f;){var g=e[d];if(b(a[g],g,a)===!1)break}return a}function k(a,b){return j(a,b,i)}function l(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function m(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,f=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=f&&"object"!=f))return!1;var g=Oa.call(a),h=Oa.call(b);if(g==Ea&&(g=La),h==Ea&&(h=La),g!=h)return!1;switch(g){case Ga:case Ha:return+a==+b;case Ka:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case Ma:case Na:return a==String(b)}var i=g==Fa;if(!i){if(g!=La||!Wa.nodeClass&&(l(a)||l(b)))return!1;var j=!Wa.argsObject&&Ya(a)?Object:a.constructor,n=!Wa.argsObject&&Ya(b)?Object:b.constructor;if(!(j==n||Pa.call(a,"constructor")&&Pa.call(b,"constructor")||ja(j)&&j instanceof j&&ja(n)&&n instanceof n||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var o=c.length;o--;)if(c[o]==a)return d[o]==b;var p=0,q=!0;if(c.push(a),d.push(b),i){if(o=a.length,p=b.length,q=p==o)for(;p--;){var r=b[p];if(!(q=m(a[p],r,c,d)))break}}else k(b,function(b,e,f){return Pa.call(f,e)?(p++,q=Pa.call(a,e)&&m(a[e],b,c,d)):void 0}),q&&k(a,function(a,b,c){return Pa.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function n(){try{return Za.apply(this,arguments)}catch(a){return _a.e=a,_a}}function o(a){if(!ja(a))throw new TypeError("fn must be a function");return Za=a,n}function p(a){throw a}function q(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function r(a,b){this.id=a,this.value=b}function t(a){this._s=s}function u(a){this._s=s,this._l=s.length,this._i=0}function v(a){this._a=a}function w(a){this._a=a,this._l=A(a),this._i=0}function x(a){return"number"==typeof a&&Y.isFinite(a)}function y(b){var c,d=b[wa];if(!d&&"string"==typeof b)return c=new t(b),c[wa]();if(!d&&b.length!==a)return c=new v(b),c[wa]();if(!d)throw new TypeError("Object is not iterable");return b[wa]()}function z(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function A(a){var b=+a.length;return isNaN(b)?0:0!==b&&x(b)?(b=z(b)*Math.floor(Math.abs(b)),0>=b?0:b>Zb?Zb:b):b}function B(a,b){this.observer=a,this.parent=b}function C(a,b){return rb(a)||(a=vb),new _b(b,a)}function D(a,b){this.observer=a,this.parent=b}function E(a,b){this.observer=a,this.parent=b}function F(a,b){return new Jc(function(c){var d=new mb,e=new nb;return e.setDisposable(d),d.setDisposable(a.subscribe(function(a){c.onNext(a)},function(a){try{var d=b(a)}catch(f){return c.onError(f)}ia(d)&&(d=Cc(d));var g=new mb;e.setDisposable(g),g.setDisposable(d.subscribe(c))},function(a){c.onCompleted(a)})),e},a)}function G(){return!1}function H(a,b){var c=this;return new Jc(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g=a[e++],h=o(b)(c,g);if(h===_a)return d.onError(h.e);d.onNext(h)}else d.onCompleted()},function(a){d.onError(a)},function(){d.onCompleted()})},c)}function G(){return!1}function I(){return[]}function G(){return!1}function J(){return[]}function K(a,b){this.observer=a,this.accumulator=b.accumulator,this.hasSeed=b.hasSeed,this.seed=b.seed,this.hasAccumulation=!1,this.accumulation=null,this.hasValue=!1,this.isStopped=!1}function L(a,b,c){var d=Ba(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return ia(e)&&(e=Cc(e)),(za(e)||ya(e))&&(e=$b(e)),e}).concatAll()}function M(a,b,c){var d=Ba(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return ia(e)&&(e=Cc(e)),(za(e)||ya(e))&&(e=$b(e)),e}).mergeAll()}function N(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1),ib(function(){a.removeEventListener(b,c,!1)});throw new Error("No listener found")}function O(a,b,c){var d=new fb,e=Object.prototype.toString;if("[object NodeList]"===e.call(a)||"[object HTMLCollection]"===e.call(a))for(var f=0,g=a.length;g>f;f++)d.add(O(a.item(f),b,c));else a&&d.add(N(a,b,c));return d}function P(a,b){return new Jc(function(c){return b.scheduleWithAbsolute(a,function(){c.onNext(0),c.onCompleted()})})}function Q(a,b,c){return new Jc(function(d){var e=a,f=qb(b);return c.scheduleRecursiveWithAbsoluteAndState(0,e,function(a,b){if(f>0){var g=c.now();e+=f,g>=e&&(e=g+f)}d.onNext(a),b(a+1,e)})})}function R(a,b){return new Jc(function(c){return b.scheduleWithRelative(qb(a),function(){c.onNext(0),c.onCompleted()})})}function S(a,b,c){return a===b?new Jc(function(a){return c.schedulePeriodicWithState(0,b,function(b){return a.onNext(b),b+1})}):Ub(function(){return Q(c.now()+a,b,c)})}function T(a,b,c){return new Jc(function(d){var e,f=!1,g=new nb,h=null,i=[],j=!1;return e=a.materialize().timestamp(c).subscribe(function(a){var e,k;"E"===a.value.kind?(i=[],i.push(a),h=a.value.exception,k=!j):(i.push({value:a.value,timestamp:a.timestamp+b}),k=!f,f=!0),k&&(null!==h?d.onError(h):(e=new mb,g.setDisposable(e),e.setDisposable(c.scheduleRecursiveWithRelative(b,function(a){var b,e,g,k;if(null===h){j=!0;do g=null,i.length>0&&i[0].timestamp-c.now()<=0&&(g=i.shift().value),null!==g&&g.accept(d);while(null!==g);k=!1,e=0,i.length>0?(k=!0,e=Math.max(0,i[0].timestamp-c.now())):f=!1,b=h,j=!1,null!==b?d.onError(b):k&&a(e)}}))))}),new fb(e,g)},a)}function U(a,b,c){return Ub(function(){return T(a,b-c.now(),c)})}function V(a,b){return new Jc(function(c){function d(){g&&(g=!1,c.onNext(e)),f&&c.onCompleted()}var e,f=!1,g=!1,h=new mb;return h.setDisposable(a.subscribe(function(a){g=!0,e=a},function(a){c.onError(a)},function(){f=!0,h.dispose()})),new fb(h,b.subscribe(d,function(a){c.onError(a)},d))},a)}function W(a,b,c){return new Jc(function(d){function e(a,b){if(j[b]=a,g[b]=!0,h||(h=g.every(da))){if(f)return d.onError(f);var e=o(c).apply(null,j);if(e===_a)return d.onError(e.e);d.onNext(e)}i&&j[1]&&d.onCompleted()}var f,g=[!1,!1],h=!1,i=!1,j=new Array(2);return new fb(a.subscribe(function(a){e(a,0)},function(a){j[1]?d.onError(a):f=a},function(){i=!0,j[1]&&d.onCompleted()}),b.subscribe(function(a){e(a,1)},function(a){d.onError(a)},function(){i=!0,e(!0,1)}))},a)}var X={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},Y=X[typeof window]&&window||this,Z=X[typeof exports]&&exports&&!exports.nodeType&&exports,$=X[typeof module]&&module&&!module.nodeType&&module,_=$&&$.exports===Z&&Z,aa=X[typeof global]&&global;!aa||aa.global!==aa&&aa.window!==aa||(Y=aa);var ba={internals:{},config:{Promise:Y.Promise},helpers:{}},ca=ba.helpers.noop=function(){},da=(ba.helpers.notDefined=function(a){return"undefined"==typeof a},ba.helpers.identity=function(a){return a}),ea=(ba.helpers.pluck=function(a){return function(b){return b[a]}},ba.helpers.just=function(a){return function(){return a}},ba.helpers.defaultNow=Date.now),fa=ba.helpers.defaultComparer=function(a,b){return $a(a,b)},ga=ba.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},ha=(ba.helpers.defaultKeySerializer=function(a){return a.toString()},ba.helpers.defaultError=function(a){throw a}),ia=ba.helpers.isPromise=function(a){return!!a&&"function"!=typeof a.subscribe&&"function"==typeof a.then},ja=(ba.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},ba.helpers.not=function(a){return!a},ba.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==Oa.call(a)}),a}());ba.config.longStackSupport=!1;var ka=!1;try{throw new Error}catch(la){ka=!!la.stack}var ma,na=g(),oa="From previous event:",pa=ba.EmptyError=function(){this.message="Sequence contains no elements.",Error.call(this)};pa.prototype=Error.prototype;var qa=ba.ObjectDisposedError=function(){this.message="Object has been disposed",Error.call(this)};qa.prototype=Error.prototype;var ra=ba.ArgumentOutOfRangeError=function(){this.message="Argument out of range",Error.call(this)};ra.prototype=Error.prototype;var sa=ba.NotSupportedError=function(a){this.message=a||"This operation is not supported",Error.call(this)};sa.prototype=Error.prototype;var ta=ba.NotImplementedError=function(a){this.message=a||"This operation is not implemented",Error.call(this)};ta.prototype=Error.prototype;var ua=ba.helpers.notImplemented=function(){throw new ta},va=ba.helpers.notSupported=function(){throw new sa},wa="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";Y.Set&&"function"==typeof(new Y.Set)["@@iterator"]&&(wa="@@iterator");var xa=ba.doneEnumerator={done:!0,value:a},ya=ba.helpers.isIterable=function(b){return b[wa]!==a},za=ba.helpers.isArrayLike=function(b){return b&&b.length!==a};ba.helpers.iterator=wa;var Aa,Ba=ba.internals.bindCallback=function(a,b,c){if("undefined"==typeof b)return a;switch(c){case 0:return function(){return a.call(b)};case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)}}return function(){return a.apply(b,arguments)}},Ca=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Da=Ca.length,Ea="[object Arguments]",Fa="[object Array]",Ga="[object Boolean]",Ha="[object Date]",Ia="[object Error]",Ja="[object Function]",Ka="[object Number]",La="[object Object]",Ma="[object RegExp]",Na="[object String]",Oa=Object.prototype.toString,Pa=Object.prototype.hasOwnProperty,Qa=Oa.call(arguments)==Ea,Ra=Error.prototype,Sa=Object.prototype,Ta=String.prototype,Ua=Sa.propertyIsEnumerable;try{Aa=!(Oa.call(document)==La&&!({toString:0}+""))}catch(la){Aa=!0}var Va={};Va[Fa]=Va[Ha]=Va[Ka]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},Va[Ga]=Va[Na]={constructor:!0,toString:!0,valueOf:!0},Va[Ia]=Va[Ja]=Va[Ma]={constructor:!0,toString:!0},Va[La]={constructor:!0};var Wa={};!function(){var a=function(){this.x=1},b=[];a.prototype={valueOf:1,y:1};for(var c in new a)b.push(c);for(c in arguments);Wa.enumErrorProps=Ua.call(Ra,"message")||Ua.call(Ra,"name"),Wa.enumPrototypes=Ua.call(a,"prototype"),Wa.nonEnumArgs=0!=c,Wa.nonEnumShadows=!/valueOf/.test(b)}(1);var Xa=ba.internals.isObject=function(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1},Ya=function(a){return a&&"object"==typeof a?Oa.call(a)==Ea:!1};Qa||(Ya=function(a){return a&&"object"==typeof a?Pa.call(a,"callee"):!1});{var Za,$a=ba.internals.isEqual=function(a,b){return m(a,b,[],[])},_a={e:{}},ab=({}.hasOwnProperty,Array.prototype.slice),bb=this.inherits=ba.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c},cb=ba.internals.addProperties=function(a){for(var b=[],c=1,d=arguments.length;d>c;c++)b.push(arguments[c]);for(var e=0,f=b.length;f>e;e++){var g=b[e];for(var h in g)a[h]=g[h]}};ba.internals.addRef=function(a,b){return new Jc(function(c){return new fb(b.getDisposable(),a.subscribe(c))})}}r.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var db=ba.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},eb=db.prototype;eb.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},eb.percolate=function(a){if(!(a>=this.length||0>a)){var b=a-1>>1;if(!(0>b||b===a)&&this.isHigherPriority(a,b)){var c=this.items[a];this.items[a]=this.items[b],this.items[b]=c,this.percolate(b)}}},eb.heapify=function(a){if(+a||(a=0),!(a>=this.length||0>a)){var b=2*a+1,c=2*a+2,d=a;if(b<this.length&&this.isHigherPriority(b,d)&&(d=b),c<this.length&&this.isHigherPriority(c,d)&&(d=c),d!==a){var e=this.items[a];this.items[a]=this.items[d],this.items[d]=e,this.heapify(d)}}},eb.peek=function(){return this.items[0].value},eb.removeAt=function(b){this.items[b]=this.items[--this.length],this.items[this.length]=a,this.heapify()},eb.dequeue=function(){var a=this.peek();return this.removeAt(0),a},eb.enqueue=function(a){var b=this.length++;this.items[b]=new r(db.count++,a),this.percolate(b)},eb.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},db.count=0;var fb=ba.CompositeDisposable=function(){var a,b,c=[];if(Array.isArray(arguments[0]))c=arguments[0],b=c.length;else for(b=arguments.length,c=new Array(b),a=0;b>a;a++)c[a]=arguments[a];for(a=0;b>a;a++)if(!kb(c[a]))throw new TypeError("Not a disposable");this.disposables=c,this.isDisposed=!1,this.length=c.length},gb=fb.prototype;gb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},gb.remove=function(a){var b=!1;if(!this.isDisposed){var c=this.disposables.indexOf(a);-1!==c&&(b=!0,this.disposables.splice(c,1),this.length--,a.dispose())}return b},gb.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;for(var a=this.disposables.length,b=new Array(a),c=0;a>c;c++)b[c]=this.disposables[c];for(this.disposables=[],this.length=0,c=0;a>c;c++)b[c].dispose()}};var hb=ba.Disposable=function(a){this.isDisposed=!1,this.action=a||ca};hb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var ib=hb.create=function(a){return new hb(a)},jb=hb.empty={dispose:ca},kb=hb.isDisposable=function(a){return a&&ja(a.dispose)},lb=hb.checkDisposed=function(a){if(a.isDisposed)throw new qa},mb=ba.SingleAssignmentDisposable=function(){this.isDisposed=!1,this.current=null};mb.prototype.getDisposable=function(){return this.current},mb.prototype.setDisposable=function(a){if(this.current)throw new Error("Disposable has already been assigned");var b=this.isDisposed;!b&&(this.current=a),b&&a&&a.dispose()},mb.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var nb=ba.SerialDisposable=function(){this.isDisposed=!1,this.current=null};nb.prototype.getDisposable=function(){return this.current},nb.prototype.setDisposable=function(a){var b=this.isDisposed;if(!b){var c=this.current;this.current=a}c&&c.dispose(),b&&a&&a.dispose()},nb.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var ob=(ba.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?jb:new a(this)},b}(),ba.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||ga,this.disposable=new mb});ob.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},ob.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},ob.prototype.isCancelled=function(){return this.disposable.isDisposed},ob.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var pb=ba.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),jb}a.isScheduler=function(b){return b instanceof a};var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=ea,a.normalize=function(a){return 0>a&&(a=0),a},a}(),qb=pb.normalize,rb=pb.isScheduler;!function(a){function b(a,b){function c(b){e(b,function(b){var d=!1,e=!1,g=a.scheduleWithState(b,function(a,b){return d?f.remove(g):e=!0,c(b),jb});e||(f.add(g),d=!0)})}var d=b[0],e=b[1],f=new fb;return c(d),f}function c(a,b,c){function d(b){f(b,function(b,e){var f=!1,h=!1,i=a[c](b,e,function(a,b){return f?g.remove(i):h=!0,d(b),jb});h||(g.add(i),f=!0)})}var e=b[0],f=b[1],g=new fb;return d(e),g}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,d)},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState([a,c],b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative([a,d],b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,d)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute([a,d],b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(pb.prototype),function(a){pb.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},pb.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof Y.setInterval)throw new sa;b=qb(b);var d=a,e=Y.setInterval(function(){d=c(d)},b);return ib(function(){Y.clearInterval(e)})}}(pb.prototype);var sb,tb,ub=pb.immediate=function(){function a(a,b){return b(this,a)}return new pb(ea,a,va,va)}(),vb=pb.currentThread=function(){function a(){for(;c.length>0;){var a=c.dequeue();!a.isCancelled()&&a.invoke()}}function b(b,d){var e=new ob(this,b,d,this.now());if(c)c.enqueue(e);else{c=new db(4),c.enqueue(e);var f=o(a)();if(c=null,f===_a)return p(f.e)}return e.disposable}var c,d=new pb(ea,b,va,va);return d.scheduleRequired=function(){return!c},d}(),wb=(ba.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new mb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),function(){var a,b=ca;if(Y.setTimeout)a=Y.setTimeout,b=Y.clearTimeout;else{if(!Y.WScript)throw new sa;a=function(a,b){Y.WScript.Sleep(b),a()}}return{setTimeout:a,clearTimeout:b}}()),xb=wb.setTimeout,yb=wb.clearTimeout;!function(){function a(b){if(f)xb(function(){a(b)},0);else{var c=e[b];if(c){f=!0;var d=o(c)();if(tb(b),f=!1,d===_a)return p(d.e)}}}function b(){if(!Y.postMessage||Y.importScripts)return!1;var a=!1,b=Y.onmessage;return Y.onmessage=function(){a=!0},Y.postMessage("","*"),Y.onmessage=b,a}function c(b){"string"==typeof b.data&&b.data.substring(0,i.length)===i&&a(b.data.substring(i.length))}var d=1,e={},f=!1;tb=function(a){delete e[a]};var g=RegExp("^"+String(Oa).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),h="function"==typeof(h=aa&&_&&aa.setImmediate)&&!g.test(h)&&h;if(ja(h))sb=function(b){var c=d++;return e[c]=b,h(function(){a(c)}),c};else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))sb=function(b){var c=d++;return e[c]=b,process.nextTick(function(){a(c)}),c};else if(b()){var i="ms.rx.schedule"+Math.random();Y.addEventListener?Y.addEventListener("message",c,!1):Y.attachEvent?Y.attachEvent("onmessage",c):Y.onmessage=c,sb=function(a){var b=d++;return e[b]=a,Y.postMessage(i+currentId,"*"),b}}else if(Y.MessageChannel){var j=new Y.MessageChannel;j.port1.onmessage=function(b){a(b.data)},sb=function(a){var b=d++;return e[b]=a,j.port2.postMessage(b),b}}else sb="document"in Y&&"onreadystatechange"in Y.document.createElement("script")?function(b){var c=Y.document.createElement("script"),f=d++;return e[f]=b,c.onreadystatechange=function(){a(f),c.onreadystatechange=null,c.parentNode.removeChild(c),c=null},Y.document.documentElement.appendChild(c),f}:function(b){var c=d++;return e[c]=b,xb(function(){a(c)},0),c}}();var zb,Ab=pb.timeout=pb["default"]=function(){function a(a,b){var c=this,d=new mb,e=sb(function(){!d.isDisposed&&d.setDisposable(b(c,a))});return new fb(d,ib(function(){tb(e)}))}function b(a,b,c){var d=this,e=pb.normalize(b),f=new mb;if(0===e)return d.scheduleWithState(a,c);var g=xb(function(){!f.isDisposed&&f.setDisposable(c(d,a))},e);return new fb(f,ib(function(){yb(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new pb(ea,a,b,c)}(),Bb=ba.Notification=function(){function a(a,b,c,d,e,f){this.kind=a,this.value=b,this.exception=c,this._accept=d,this._acceptObservable=e,this.toString=f}return a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return rb(a)||(a=ub),new Jc(function(c){return a.scheduleWithState(b,function(a,b){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),Cb=Bb.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){return new Bb("N",d,null,a,b,c)}}(),Db=Bb.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){return new Bb("E",null,d,a,b,c)}}(),Eb=Bb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){return new Bb("C",null,null,a,b,c)}}(),Fb=ba.Observer=function(){},Gb=Fb.create=function(a,b,c){return a||(a=ca),b||(b=ha),c||(c=ca),new Ib(a,b,c)},Hb=ba.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return bb(b,a),b.prototype.next=ua,b.prototype.error=ua,b.prototype.completed=ua,b.prototype.onNext=function(a){this.isStopped||this.next(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.error(a))},b.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(Fb),Ib=ba.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return bb(b,a),b.prototype.next=function(a){this._onNext(a)},b.prototype.error=function(a){this._onError(a)},b.prototype.completed=function(){this._onCompleted()},b}(Hb),Jb=ba.Observable=function(){function a(a){if(ba.config.longStackSupport&&ka){try{throw new Error}catch(b){this.stack=b.stack.substring(b.stack.indexOf("\n")+1)}var d=this;this._subscribe=function(b){var e=b.onError.bind(b);return b.onError=function(a){c(a,d),e(a)},a.call(d,b)}}else this._subscribe=a}return zb=a.prototype,zb.subscribe=zb.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:Gb(a,b,c))},zb.subscribeOnNext=function(a,b){return this._subscribe(Gb("undefined"!=typeof b?function(c){a.call(b,c)}:a))},zb.subscribeOnError=function(a,b){return this._subscribe(Gb(null,"undefined"!=typeof b?function(c){a.call(b,c)}:a))},zb.subscribeOnCompleted=function(a,b){return this._subscribe(Gb(null,null,"undefined"!=typeof b?function(){a.call(b)}:a))},a}(),Kb=ba.internals.ScheduledObserver=function(a){function b(b,c){a.call(this),this.scheduler=b,this.observer=c,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new nb}return bb(b,a),b.prototype.next=function(a){var b=this;this.queue.push(function(){b.observer.onNext(a)})},b.prototype.error=function(a){var b=this;this.queue.push(function(){b.observer.onError(a)})},b.prototype.completed=function(){var a=this;this.queue.push(function(){a.observer.onCompleted()})},b.prototype.ensureActive=function(){var a=!1,b=this;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(a){var c;if(!(b.queue.length>0))return void(b.isAcquired=!1);c=b.queue.shift();try{c()}catch(d){throw b.queue=[],b.hasFaulted=!0,d}a()}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(Hb),Lb=ba.ObservableBase=function(a){function b(a){return a&&ja(a.dispose)?a:ja(a)?ib(a):jb}function c(a,c){var d=c[0],e=c[1],f=o(e.subscribeCore).call(e,d);return f!==_a||d.fail(_a.e)?void d.setDisposable(b(f)):p(_a.e)}function d(a){var b=new Kc(a),d=[b,this];return vb.scheduleRequired()?vb.scheduleWithState(d,c):c(null,d),b}function e(){a.call(this,d)}return bb(e,a),e.prototype.subscribeCore=ua,e}(Jb),Mb=ba.internals.Enumerable=function(){},Nb=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b,c){this.o=a,this.s=b,this.e=c,this.isStopped=!1}return bb(b,a),b.prototype.subscribeCore=function(a){var b,d=new nb,e=ub.scheduleRecursiveWithState(this.sources[wa](),function(e,f){if(!b){var g=o(e.next).call(e);if(g===_a)return a.onError(g.e);if(g.done)return a.onCompleted();var h=g.value;ia(h)&&(h=Cc(h));var i=new mb;d.setDisposable(i),i.setDisposable(h.subscribe(new c(a,f,e)))}});return new fb(d,e,ib(function(){b=!0}))},c.prototype.onNext=function(a){this.isStopped||this.o.onNext(a)},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.s(this.e))},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Lb);Mb.prototype.concat=function(){return new Nb(this)};var Ob=function(a){function b(b){this.sources=b,a.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){var b,c=this.sources[wa](),d=new nb,e=ub.scheduleRecursiveWithState(null,function(e,f){if(!b){var g=o(c.next).call(c);if(g===_a)return a.onError(g.e);if(g.done)return null!==e?a.onError(e):a.onCompleted();var h=g.value;ia(h)&&(h=Cc(h));var i=new mb;d.setDisposable(i),i.setDisposable(h.subscribe(function(b){a.onNext(b)},f,function(){a.onCompleted()}))}});return new fb(d,e,ib(function(){b=!0}))},b}(Lb);Mb.prototype.catchError=function(){return new Ob(this)},Mb.prototype.catchErrorWhen=function(a){var b=this;return new Jc(function(c){var d,e,f=new Mc,g=new Mc,h=a(f),i=h.subscribe(g),j=b[wa](),k=new nb,l=ub.scheduleRecursive(function(a){if(!d){var b=o(j.next).call(j);if(b===_a)return c.onError(b.e);if(b.done)return void(e?c.onError(e):c.onCompleted());var h=b.value;ia(h)&&(h=Cc(h));var i=new mb,l=new mb;k.setDisposable(new fb(l,i)),i.setDisposable(h.subscribe(function(a){c.onNext(a)},function(b){l.setDisposable(g.subscribe(a,function(a){c.onError(a)},function(){c.onCompleted()})),f.onNext(b)},function(){c.onCompleted()}))}});return new fb(i,k,l,ib(function(){d=!0}))})};var Pb=function(a){function b(a,b){this.v=a,this.c=null==b?-1:b}function c(a){this.v=a.v,this.l=a.c}return bb(b,a),b.prototype[wa]=function(){return new c(this)},c.prototype.next=function(){return 0===this.l?xa:(this.l>0&&this.l--,{done:!1,value:this.v})},b}(Mb),Qb=Mb.repeat=function(a,b){return new Pb(a,b)},Rb=function(a){function b(a,b,c){this.s=a,this.fn=b?Ba(b,c,3):null}function c(a){this.i=-1,this.s=a.s,this.l=this.s.length,this.fn=a.fn}return bb(b,a),b.prototype[wa]=function(){return new c(this)},c.prototype.next=function(){return++this.i<this.l?{done:!1,value:this.fn?this.fn(this.s[this.i],this.i,this.s):this.s[this.i]}:xa},b}(Mb),Sb=Mb.of=function(a,b,c){return new Rb(a,b,c)},Tb=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.a=[],this.isStopped=!1}return bb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a))},c.prototype.onNext=function(a){this.isStopped||this.a.push(a)},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onNext(this.a),this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Lb);zb.toArray=function(){return new Tb(this)},Jb.create=Jb.createWithDisposable=function(a,b){return new Jc(a,b)};var Ub=Jb.defer=function(a){return new Jc(function(b){var c;try{c=a()}catch(d){return ic(d).subscribe(b)}return ia(c)&&(c=Cc(c)),c.subscribe(b)})},Vb=function(a){function b(b){this.scheduler=b,a.call(this)}function c(a,b){this.observer=a,this.parent=b}function d(a,b){b.onCompleted()}return bb(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this);return b.run()},c.prototype.run=function(){return this.parent.scheduler.scheduleWithState(this.observer,d)},b}(Lb),Wb=Jb.empty=function(a){return rb(a)||(a=ub),new Vb(a)},Xb=function(a){function b(b,c,d){this.iterable=b,this.mapper=c,this.scheduler=d,a.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){var b=new Yb(a,this);return b.run()},b}(Lb),Yb=function(){function a(a,b){this.observer=a,this.parent=b}return a.prototype.run=function(){function a(a,b){try{var f=c.next()}catch(g){return d.onError(g)}if(f.done)return d.onCompleted();var h=f.value;if(e)try{h=e(h,a)}catch(g){return d.onError(g)}d.onNext(h),b(a+1)}var b=Object(this.parent.iterable),c=y(b),d=this.observer,e=this.parent.mapper;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}(),Zb=Math.pow(2,53)-1;t.prototype[wa]=function(){return new u(this._s)},u.prototype[wa]=function(){return this},u.prototype.next=function(){return this._i<this._l?{done:!1,value:this._s.charAt(this._i++)}:xa},v.prototype[wa]=function(){return new w(this._a)},w.prototype[wa]=function(){return this},w.prototype.next=function(){return this._i<this._l?{done:!1,value:this._a[this._i++]}:xa};var $b=Jb.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!ja(b))throw new Error("mapFn when provided must be a function");if(b)var e=Ba(b,c,2);return rb(d)||(d=vb),new Xb(a,e,d)},_b=function(a){function b(b,c){this.args=b,this.scheduler=c,a.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){var b=new B(a,this);return b.run()},b}(Lb);B.prototype.run=function(){function a(a,e){d>a?(b.onNext(c[a]),e(a+1)):b.onCompleted()}var b=this.observer,c=this.parent.args,d=c.length;return this.parent.scheduler.scheduleRecursiveWithState(0,a)};{var ac=Jb.fromArray=function(a,b){return rb(b)||(b=vb),new _b(a,b)},bc=function(a){function b(){a.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){return jb},b}(Lb);Jb.never=function(){return new bc}}Jb.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];
+
+return new _b(b,vb)},Jb.ofWithScheduler=function(a){for(var b=arguments.length,c=new Array(b-1),d=1;b>d;d++)c[d-1]=arguments[d];return new _b(c,a)};var cc=function(a){function b(b,c){this.obj=b,this.keys=Object.keys(b),this.scheduler=c,a.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){var b=new D(a,this);return b.run()},b}(Lb);D.prototype.run=function(){function a(a,f){if(e>a){var g=d[a];b.onNext([g,c[g]]),f(a+1)}else b.onCompleted()}var b=this.observer,c=this.parent.obj,d=this.parent.keys,e=d.length;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},Jb.pairs=function(a,b){return b||(b=vb),new cc(a,b)};var dc=function(a){function b(b,c,d){this.start=b,this.rangeCount=c,this.scheduler=d,a.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){var b=new ec(a,this);return b.run()},b}(Lb),ec=function(){function a(a,b){this.observer=a,this.parent=b}return a.prototype.run=function(){function a(a,e){c>a?(d.onNext(b+a),e(a+1)):d.onCompleted()}var b=this.parent.start,c=this.parent.rangeCount,d=this.observer;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}();Jb.range=function(a,b,c){return rb(c)||(c=vb),new dc(a,b,c)};var fc=function(a){function b(b,c,d){this.value=b,this.repeatCount=null==c?-1:c,this.scheduler=d,a.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){var b=new E(a,this);return b.run()},b}(Lb);E.prototype.run=function(){function a(a,d){return(-1===a||a>0)&&(b.onNext(c),a>0&&a--),0===a?b.onCompleted():void d(a)}var b=this.observer,c=this.parent.value;return this.parent.scheduler.scheduleRecursiveWithState(this.parent.repeatCount,a)},Jb.repeat=function(a,b,c){return rb(c)||(c=vb),new fc(a,b,c)};var gc=function(a){function b(b,c){this.value=b,this.scheduler=c,a.call(this)}function c(a,b){this.observer=a,this.parent=b}function d(a,b){var c=b[0],d=b[1];d.onNext(c),d.onCompleted()}return bb(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this);return b.run()},c.prototype.run=function(){return this.parent.scheduler.scheduleWithState([this.parent.value,this.observer],d)},b}(Lb),hc=(Jb["return"]=Jb.just=Jb.returnValue=function(a,b){return rb(b)||(b=ub),new gc(a,b)},function(a){function b(b,c){this.error=b,this.scheduler=c,a.call(this)}function c(a,b){this.o=a,this.p=b}function d(a,b){var c=b[0],d=b[1];d.onError(c)}return bb(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this);return b.run()},c.prototype.run=function(){return this.p.scheduler.scheduleWithState([this.p.error,this.o],d)},b}(Lb)),ic=Jb["throw"]=Jb.throwError=Jb.throwException=function(a,b){return rb(b)||(b=ub),new hc(a,b)};zb["catch"]=zb.catchError=zb.catchException=function(a){return"function"==typeof a?F(this,a):jc([this,a])};var jc=Jb.catchError=Jb["catch"]=Jb.catchException=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return Sb(a).catchError()};zb.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return Array.isArray(b[0])?b[0].unshift(this):b.unshift(this),kc.apply(this,b)};var kc=Jb.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.pop();return Array.isArray(b[0])&&(b=b[0]),new Jc(function(a){function c(b){if(h[b]=!0,i||(i=h.every(da))){try{var c=d.apply(null,k)}catch(e){return a.onError(e)}a.onNext(c)}else j.filter(function(a,c){return c!==b}).every(da)&&a.onCompleted()}function e(b){j[b]=!0,j.every(da)&&a.onCompleted()}for(var f=b.length,g=function(){return!1},h=q(f,g),i=!1,j=q(f,g),k=new Array(f),l=new Array(f),m=0;f>m;m++)!function(d){var f=b[d],g=new mb;ia(f)&&(f=Cc(f)),g.setDisposable(f.subscribe(function(a){k[d]=a,c(d)},function(b){a.onError(b)},function(){e(d)})),l[d]=g}(m);return new fb(l)},this)};zb.concat=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return a.unshift(this),mc.apply(null,a)};var lc=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b){this.sources=a,this.o=b}return bb(b,a),b.prototype.subscribeCore=function(a){var b=new c(this.sources,a);return b.run()},c.prototype.run=function(){var a,b=new nb,c=this.sources,d=c.length,e=this.o,f=ub.scheduleRecursiveWithState(0,function(f,g){if(!a){if(f===d)return e.onCompleted();var h=c[f];ia(h)&&(h=Cc(h));var i=new mb;b.setDisposable(i),i.setDisposable(h.subscribe(function(a){e.onNext(a)},function(a){e.onError(a)},function(){g(f+1)}))}});return new fb(b,f,ib(function(){a=!0}))},b}(Lb),mc=Jb.concat=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(arguments.length);for(var b=0,c=arguments.length;c>b;b++)a[b]=arguments[b]}return new lc(a)};zb.concatAll=zb.concatObservable=function(){return this.merge(1)};var nc=function(a){function b(b,c){this.source=b,this.maxConcurrent=c,a.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){var b=new fb;return b.add(this.source.subscribe(new oc(a,this.maxConcurrent,b))),b},b}(Lb),oc=function(){function a(a,b,c){this.o=a,this.max=b,this.g=c,this.done=!1,this.q=[],this.activeCount=0,this.isStopped=!1}function b(a,b){this.parent=a,this.sad=b,this.isStopped=!1}return a.prototype.handleSubscribe=function(a){var c=new mb;this.g.add(c),ia(a)&&(a=Cc(a)),c.setDisposable(a.subscribe(new b(this,c)))},a.prototype.onNext=function(a){this.isStopped||(this.activeCount<this.max?(this.activeCount++,this.handleSubscribe(a)):this.q.push(a))},a.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},a.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,0===this.activeCount&&this.o.onCompleted())},a.prototype.dispose=function(){this.isStopped=!0},a.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b.prototype.onNext=function(a){this.isStopped||this.parent.o.onNext(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.o.onError(a))},b.prototype.onCompleted=function(){if(!this.isStopped){this.isStopped=!0;var a=this.parent;a.g.remove(this.sad),a.q.length>0?a.handleSubscribe(a.q.shift()):(a.activeCount--,a.done&&0===a.activeCount&&a.o.onCompleted())}},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},a}();zb.merge=function(a){return"number"!=typeof a?pc(this,a):new nc(this,a)};var pc=Jb.merge=function(){var a,b,c=[],d=arguments.length;if(arguments[0])if(rb(arguments[0]))for(a=arguments[0],b=1;d>b;b++)c.push(arguments[b]);else for(a=ub,b=0;d>b;b++)c.push(arguments[b]);else for(a=ub,b=1;d>b;b++)c.push(arguments[b]);return Array.isArray(c[0])&&(c=c[0]),C(a,c).mergeAll()},qc=ba.CompositeError=function(a){this.name="NotImplementedError",this.innerErrors=a,this.message="This contains multiple errors. Check the innerErrors",Error.call(this)};qc.prototype=Error.prototype,Jb.mergeDelayError=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}var d=C(null,a);return new Jc(function(a){function b(){0===g.length?a.onCompleted():a.onError(1===g.length?g[0]:new qc(g))}var c=new fb,e=new mb,f=!1,g=[];return c.add(e),e.setDisposable(d.subscribe(function(d){var e=new mb;c.add(e),ia(d)&&(d=Cc(d)),e.setDisposable(d.subscribe(function(b){a.onNext(b)},function(a){g.push(a),c.remove(e),f&&1===c.length&&b()},function(){c.remove(e),f&&1===c.length&&b()}))},function(a){g.push(a),f=!0,1===c.length&&b()},function(){f=!0,1===c.length&&b()})),c})};var rc=function(a){function b(b){this.source=b,a.call(this)}function c(a,b){this.o=a,this.g=b,this.isStopped=!1,this.done=!1}function d(a,b,c){this.parent=a,this.g=b,this.sad=c,this.isStopped=!1}return bb(b,a),b.prototype.subscribeCore=function(a){var b=new fb,d=new mb;return b.add(d),d.setDisposable(this.source.subscribe(new c(a,b))),b},c.prototype.onNext=function(a){if(!this.isStopped){var b=new mb;this.g.add(b),ia(a)&&(a=Cc(a)),b.setDisposable(a.subscribe(new d(this,this.g,b)))}},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,1===this.g.length&&this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},d.prototype.onNext=function(a){this.isStopped||this.parent.o.onNext(a)},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.o.onError(a))},d.prototype.onCompleted=function(){if(!this.isStopped){var a=this.parent;this.isStopped=!0,a.g.remove(this.sad),a.done&&1===a.g.length&&a.o.onCompleted()}},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},b}(Lb);zb.mergeAll=zb.mergeObservable=function(){return new rc(this)},zb.skipUntil=function(a){var b=this;return new Jc(function(c){var d=!1,e=new fb(b.subscribe(function(a){d&&c.onNext(a)},function(a){c.onError(a)},function(){d&&c.onCompleted()}));ia(a)&&(a=Cc(a));var f=new mb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},function(a){c.onError(a)},function(){f.dispose()})),e},b)};var sc=function(a){function b(b){this.source=b,a.call(this)}function c(a,b){this.o=a,this.inner=b,this.stopped=!1,this.latest=0,this.hasLatest=!1,this.isStopped=!1}function d(a,b){this.parent=a,this.id=b,this.isStopped=!1}return bb(b,a),b.prototype.subscribeCore=function(a){var b=new nb,d=this.source.subscribe(new c(a,b));return new fb(d,b)},c.prototype.onNext=function(a){if(!this.isStopped){var b=new mb,c=++this.latest;this.hasLatest=!0,this.inner.setDisposable(b),ia(a)&&(a=Cc(a)),b.setDisposable(a.subscribe(new d(this,c)))}},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.stopped=!0,!this.hasLatest&&this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},d.prototype.onNext=function(a){this.isStopped||this.parent.latest===this.id&&this.parent.o.onNext(a)},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.latest===this.id&&this.parent.o.onError(a))},d.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.parent.latest===this.id&&(this.parent.hasLatest=!1,this.parent.isStopped&&this.parent.o.onCompleted()))},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},b}(Lb);zb["switch"]=zb.switchLatest=function(){return new sc(this)};var tc=function(a){function b(b,c){this.source=b,this.other=ia(c)?Cc(c):c,a.call(this)}function c(a){this.o=a,this.isStopped=!1}return bb(b,a),b.prototype.subscribeCore=function(a){return new fb(this.source.subscribe(a),this.other.subscribe(new c(a)))},c.prototype.onNext=function(a){this.isStopped||this.o.onCompleted()},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){!this.isStopped&&(this.isStopped=!0)},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Lb);zb.takeUntil=function(a){return new tc(this,a)},zb.withLatestFrom=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.pop(),e=this;return Array.isArray(b[0])&&(b=b[0]),new Jc(function(a){for(var c=b.length,f=q(c,G),g=!1,h=new Array(c),i=new Array(c+1),j=0;c>j;j++)!function(c){var d=b[c],e=new mb;ia(d)&&(d=Cc(d)),e.setDisposable(d.subscribe(function(a){h[c]=a,f[c]=!0,g=f.every(da)},function(b){a.onError(b)},ca)),i[c]=e}(j);var k=new mb;return k.setDisposable(e.subscribe(function(b){var c=[b].concat(h);if(g){var e=o(d).apply(null,c);return e===_a?a.onError(e.e):void a.onNext(e)}},function(b){a.onError(b)},function(){a.onCompleted()})),i[c]=k,new fb(i)},this)},zb.zip=function(){if(Array.isArray(arguments[0]))return H.apply(this,arguments);for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=this,e=b.pop();return b.unshift(d),new Jc(function(a){for(var c=b.length,f=q(c,I),g=q(c,G),h=new Array(c),i=0;c>i;i++)!function(c){var i=b[c],j=new mb;ia(i)&&(i=Cc(i)),j.setDisposable(i.subscribe(function(b){if(f[c].push(b),f.every(function(a){return a.length>0})){var h=f.map(function(a){return a.shift()}),i=o(e).apply(d,h);if(i===_a)return a.onError(i.e);a.onNext(i)}else g.filter(function(a,b){return b!==c}).every(da)&&a.onCompleted()},function(b){a.onError(b)},function(){g[c]=!0,g.every(da)&&a.onCompleted()})),h[c]=j}(i);return new fb(h)},d)},Jb.zip=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.shift();return d.zip.apply(d,b)},Jb.zipArray=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new Jc(function(b){for(var c=a.length,d=q(c,J),e=q(c,G),f=new Array(c),g=0;c>g;g++)!function(c){f[c]=new mb,f[c].setDisposable(a[c].subscribe(function(a){if(d[c].push(a),d.every(function(a){return a.length>0})){var f=d.map(function(a){return a.shift()});b.onNext(f)}else if(e.filter(function(a,b){return b!==c}).every(da))return b.onCompleted()},function(a){b.onError(a)},function(){e[c]=!0,e.every(da)&&b.onCompleted()}))}(g);return new fb(f)})},zb.asObservable=function(){var a=this;return new Jc(function(b){return a.subscribe(b)},a)},zb.dematerialize=function(){var a=this;return new Jc(function(b){return a.subscribe(function(a){return a.accept(b)},function(a){b.onError(a)},function(){b.onCompleted()})},this)},zb.distinctUntilChanged=function(a,b){var c=this;return b||(b=fa),new Jc(function(d){var e,f=!1;return c.subscribe(function(c){var g=c;if(a&&(g=o(a)(c),g===_a))return d.onError(g.e);if(f){var h=o(b)(e,g);if(h===_a)return d.onError(h.e)}f&&h||(f=!0,e=g,d.onNext(c))},function(a){d.onError(a)},function(){d.onCompleted()})},this)};var uc=function(a){function b(b,c,d,e){this.source=b,this.t=!c||ja(c)?Gb(c||ca,d||ca,e||ca):c,a.call(this)}function c(a,b){this.o=a,this.t=b,this.isStopped=!1}return bb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this.t))},c.prototype.onNext=function(a){if(!this.isStopped){var b=o(this.t.onNext).call(this.t,a);b===_a&&this.o.onError(b.e),this.o.onNext(a)}},c.prototype.onError=function(a){if(!this.isStopped){this.isStopped=!0;var b=o(this.t.onError).call(this.t,a);if(b===_a)return this.o.onError(b.e);this.o.onError(a)}},c.prototype.onCompleted=function(){if(!this.isStopped){this.isStopped=!0;var a=o(this.t.onCompleted).call(this.t);if(a===_a)return this.o.onError(a.e);this.o.onCompleted()}},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Lb);zb["do"]=zb.tap=zb.doAction=function(a,b,c){return new uc(this,a,b,c)},zb.doOnNext=zb.tapOnNext=function(a,b){return this.tap("undefined"!=typeof b?function(c){a.call(b,c)}:a)},zb.doOnError=zb.tapOnError=function(a,b){return this.tap(ca,"undefined"!=typeof b?function(c){a.call(b,c)}:a)},zb.doOnCompleted=zb.tapOnCompleted=function(a,b){return this.tap(ca,null,"undefined"!=typeof b?function(){a.call(b)}:a)},zb["finally"]=zb.ensure=function(a){var b=this;return new Jc(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return ib(function(){try{d.dispose()}catch(b){throw b}finally{a()}})},this)},zb.finallyAction=function(a){return this.ensure(a)};var vc=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.isStopped=!1}return bb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a))},c.prototype.onNext=ca,c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},b}(Lb);zb.ignoreElements=function(){return new vc(this)},zb.materialize=function(){var a=this;return new Jc(function(b){return a.subscribe(function(a){b.onNext(Cb(a))},function(a){b.onNext(Db(a)),b.onCompleted()},function(){b.onNext(Eb()),b.onCompleted()})},a)},zb.repeat=function(a){return Qb(this,a).concat()},zb.retry=function(a){return Qb(this,a).catchError()},zb.retryWhen=function(a){return Qb(this).catchErrorWhen(a)};var wc=function(a){function b(b,c,d,e){this.source=b,this.accumulator=c,this.hasSeed=d,this.seed=e,a.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new K(a,this))},b}(Lb);K.prototype.onNext=function(a){if(!this.isStopped){!this.hasValue&&(this.hasValue=!0);try{this.hasAccumulation?this.accumulation=this.accumulator(this.accumulation,a):(this.accumulation=this.hasSeed?this.accumulator(this.seed,a):a,this.hasAccumulation=!0)}catch(b){return this.observer.onError(b)}this.observer.onNext(this.accumulation)}},K.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.observer.onError(a))},K.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,!this.hasValue&&this.hasSeed&&this.observer.onNext(this.seed),this.observer.onCompleted())},K.prototype.dispose=function(){this.isStopped=!0},K.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},zb.scan=function(){var a,b,c=!1;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new wc(this,b,c,a)},zb.skipLast=function(a){if(0>a)throw new ra;var b=this;return new Jc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},function(a){c.onError(a)},function(){c.onCompleted()})},b)},zb.startWith=function(){var a,b=0;arguments.length&&rb(arguments[0])?(a=arguments[0],b=1):a=ub;for(var c=[],d=b,e=arguments.length;e>d;d++)c.push(arguments[d]);return Sb([ac(c,a),this]).concat()},zb.takeLast=function(a){if(0>a)throw new ra;var b=this;return new Jc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},function(a){c.onError(a)},function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})},b)},zb.selectConcat=zb.concatMap=function(a,b,c){return ja(a)&&ja(b)?this.concatMap(function(c,d){var e=a(c,d);return ia(e)&&(e=Cc(e)),(za(e)||ya(e))&&(e=$b(e)),e.map(function(a,e){return b(c,a,d,e)})}):ja(a)?L(this,a,c):L(this,function(){return a})};var xc=function(a){function b(b,c,d){this.source=b,this.selector=Ba(c,d,3),a.call(this)}function c(a,b){return function(c,d,e){return a.call(this,b.selector(c,d,e),d,e)}}function d(a,b,c){this.o=a,this.selector=b,this.source=c,this.i=0,this.isStopped=!1}return bb(b,a),b.prototype.internalMap=function(a,d){return new b(this.source,c(a,this),d)},b.prototype.subscribeCore=function(a){return this.source.subscribe(new d(a,this.selector,this))},d.prototype.onNext=function(a){if(!this.isStopped){var b=o(this.selector)(a,this.i++,this.source);return b===_a?this.o.onError(b.e):void this.o.onNext(b)}},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},d.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Lb);zb.map=zb.select=function(a,b){var c="function"==typeof a?a:function(){return a};return this instanceof xc?this.internalMap(c,b):new xc(this,c,b)},zb.pluck=function(){var b=arguments,c=arguments.length;if(0===c)throw new Error("List of properties cannot be empty.");return this.map(function(d){for(var e=d,f=0;c>f;f++){var g=e[b[f]];if("undefined"==typeof g)return a;e=g}return e})},zb.selectMany=zb.flatMap=function(a,b,c){return ja(a)&&ja(b)?this.flatMap(function(c,d){var e=a(c,d);return ia(e)&&(e=Cc(e)),(za(e)||ya(e))&&(e=$b(e)),e.map(function(a,e){return b(c,a,d,e)})},c):ja(a)?M(this,a,c):M(this,function(){return a})},zb.selectSwitch=zb.flatMapLatest=zb.switchMap=function(a,b){return this.select(a,b).switchLatest()};var yc=function(a){function b(b,c){this.source=b,this.skipCount=c,a.call(this)}function c(a,b){this.c=b,this.r=b,this.o=a,this.isStopped=!1}return bb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this.skipCount))},c.prototype.onNext=function(a){this.isStopped||(this.r<=0?this.o.onNext(a):this.r--)},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Lb);zb.skip=function(a){if(0>a)throw new ra;return new yc(this,a)},zb.skipWhile=function(a,b){var c=this,d=Ba(a,b,3);return new Jc(function(a){var b=0,e=!1;return c.subscribe(function(f){if(!e)try{e=!d(f,b++,c)}catch(g){return void a.onError(g)}e&&a.onNext(f)},function(b){a.onError(b)},function(){a.onCompleted()})},c)},zb.take=function(a,b){if(0>a)throw new ra;if(0===a)return Wb(b);var c=this;return new Jc(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0>=d&&b.onCompleted())},function(a){b.onError(a)},function(){b.onCompleted()})},c)},zb.takeWhile=function(a,b){var c=this,d=Ba(a,b,3);return new Jc(function(a){var b=0,e=!0;return c.subscribe(function(f){if(e){try{e=d(f,b++,c)}catch(g){return void a.onError(g)}e?a.onNext(f):a.onCompleted()}},function(b){a.onError(b)},function(){a.onCompleted()})},c)};var zc=function(a){function b(b,c,d){this.source=b,this.predicate=Ba(c,d,3),a.call(this)}function c(a,b){return function(c,d,e){return b.predicate(c,d,e)&&a.call(this,c,d,e)}}function d(a,b,c){this.o=a,this.predicate=b,this.source=c,this.i=0,this.isStopped=!1}return bb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new d(a,this.predicate,this))},b.prototype.internalFilter=function(a,d){return new b(this.source,c(a,this),d)},d.prototype.onNext=function(a){if(!this.isStopped){var b=o(this.predicate)(a,this.i++,this.source);return b===_a?this.o.onError(b.e):void(b&&this.o.onNext(a))}},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},d.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Lb);zb.filter=zb.where=function(a,b){return this instanceof zc?this.internalFilter(a,b):new zc(this,a,b)},Jb.fromCallback=function(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return new Jc(function(d){function f(){for(var a=arguments.length,e=new Array(a),f=0;a>f;f++)e[f]=arguments[f];if(c){try{e=c.apply(b,e)}catch(g){return d.onError(g)}d.onNext(e)}else e.length<=1?d.onNext.apply(d,e):d.onNext(e);d.onCompleted()}e.push(f),a.apply(b,e)}).publishLast().refCount()}},Jb.fromNodeCallback=function(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return new Jc(function(d){function f(a){if(a)return void d.onError(a);for(var e=arguments.length,f=[],g=1;e>g;g++)f[g-1]=arguments[g];if(c){try{f=c.apply(b,f)}catch(h){return d.onError(h)}d.onNext(f)}else f.length<=1?d.onNext.apply(d,f):d.onNext(f);d.onCompleted()}e.push(f),a.apply(b,e)}).publishLast().refCount()}},ba.config.useNativeEvents=!1,Jb.fromEvent=function(a,b,c){return a.addListener?Ac(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},c):ba.config.useNativeEvents||"function"!=typeof a.on||"function"!=typeof a.off?new Jc(function(d){return O(a,b,function(a){var b=a;if(c)try{b=c(arguments)}catch(e){return d.onError(e)}d.onNext(b)})}).publish().refCount():Ac(function(c){a.on(b,c)},function(c){a.off(b,c)},c)};var Ac=Jb.fromEventPattern=function(a,b,c){return new Jc(function(d){function e(a){var b=a;if(c)try{b=c(arguments)}catch(e){return d.onError(e)}d.onNext(b)}var f=a(e);return ib(function(){b&&b(e,f)})}).publish().refCount()},Bc=function(a){function b(b){this.p=b,a.call(this)}return bb(b,a),b.prototype.subscribeCore=function(a){return this.p.then(function(b){a.onNext(b),a.onCompleted()},function(b){a.onError(b)}),jb},b}(Lb),Cc=Jb.fromPromise=function(a){return new Bc(a)};zb.toPromise=function(a){if(a||(a=ba.config.Promise),!a)throw new sa("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})},Jb.startAsync=function(a){var b;try{b=a()}catch(c){return ic(c)}return Cc(b)},zb.multicast=function(a,b){var c=this;return"function"==typeof a?new Jc(function(d){var e=c.multicast(a());return new fb(b(e).subscribe(d),e.connect())},c):new Dc(c,a)},zb.publish=function(a){return a&&ja(a)?this.multicast(function(){return new Mc},a):this.multicast(new Mc)},zb.share=function(){return this.publish().refCount()},zb.publishLast=function(a){return a&&ja(a)?this.multicast(function(){return new Nc},a):this.multicast(new Nc)},zb.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new Pc(b)},a):this.multicast(new Pc(a))},zb.shareValue=function(a){return this.publishValue(a).refCount()},zb.replay=function(a,b,c,d){return a&&ja(a)?this.multicast(function(){return new Qc(b,c,d)},a):this.multicast(new Qc(b,c,d))},zb.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};{var Dc=ba.ConnectableObservable=function(a){function b(b,c){var d,e=!1,f=b.asObservable();this.connect=function(){return e||(e=!0,d=new fb(f.subscribe(c),ib(function(){e=!1}))),d},a.call(this,function(a){return c.subscribe(a)})}return bb(b,a),b.prototype.refCount=function(){var a,b=0,c=this;return new Jc(function(d){var e=1===++b,f=c.subscribe(d);return e&&(a=c.connect()),function(){f.dispose(),0===--b&&a.dispose()}})},b}(Jb),Ec=Jb.interval=function(a,b){return S(a,a,rb(b)?b:Ab)};Jb.timer=function(b,c,d){var e;return rb(d)||(d=Ab),c!==a&&"number"==typeof c?e=c:rb(c)&&(d=c),b instanceof Date&&e===a?P(b.getTime(),d):b instanceof Date&&e!==a?(e=c,Q(b.getTime(),e,d)):e===a?R(b,d):S(b,e,d)}}zb.delay=function(a,b){return rb(b)||(b=Ab),a instanceof Date?U(this,a.getTime(),b):T(this,a,b)},zb.debounce=zb.throttleWithTimeout=function(a,b){rb(b)||(b=Ab);var c=this;return new Jc(function(d){var e,f=new nb,g=!1,h=0,i=c.subscribe(function(c){g=!0,e=c,h++;var i=h,j=new mb;f.setDisposable(j),j.setDisposable(b.scheduleWithRelative(a,function(){g&&h===i&&d.onNext(e),g=!1}))},function(a){f.dispose(),d.onError(a),g=!1,h++},function(){f.dispose(),g&&d.onNext(e),d.onCompleted(),g=!1,h++});return new fb(i,f)},this)},zb.throttle=function(a,b){return this.debounce(a,b)},zb.timestamp=function(a){return rb(a)||(a=Ab),this.map(function(b){return{value:b,timestamp:a.now()}})},zb.sample=zb.throttleLatest=function(a,b){return rb(b)||(b=Ab),"number"==typeof a?V(this,Ec(a,b)):V(this,a)},zb.timeout=function(a,b,c){(null==b||"string"==typeof b)&&(b=ic(new Error(b||"Timeout"))),rb(c)||(c=Ab);var d=this,e=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new Jc(function(f){function g(){var d=h;l.setDisposable(c[e](a,function(){h===d&&(ia(b)&&(b=Cc(b)),j.setDisposable(b.subscribe(f)))}))}var h=0,i=new mb,j=new nb,k=!1,l=new nb;return j.setDisposable(i),g(),i.setDisposable(d.subscribe(function(a){k||(h++,f.onNext(a),g())},function(a){k||(h++,f.onError(a))},function(){k||(h++,f.onCompleted())})),new fb(j,l)},d)},zb.throttleFirst=function(a,b){rb(b)||(b=Ab);var c=+a||0;if(0>=c)throw new RangeError("windowDuration cannot be less or equal zero.");var d=this;return new Jc(function(a){var e=0;return d.subscribe(function(d){var f=b.now();(0===e||f-e>=c)&&(e=f,a.onNext(d))},function(b){a.onError(b)},function(){a.onCompleted()})},d)};var Fc=function(a){function b(a){var b=this.source.publish(),c=b.subscribe(a),d=jb,e=this.pauser.distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=jb)});return new fb(c,d,e)}function c(c,d){this.source=c,this.controller=new Mc,d&&d.subscribe?this.pauser=this.controller.merge(d):this.pauser=this.controller,a.call(this,b,c)}return bb(c,a),c.prototype.pause=function(){this.controller.onNext(!1)},c.prototype.resume=function(){this.controller.onNext(!0)},c}(Jb);zb.pausable=function(a){return new Fc(this,a)};var Gc=function(b){function c(b){function c(){for(;e.length>0;)b.onNext(e.shift())}var d,e=[],f=W(this.source,this.pauser.distinctUntilChanged().startWith(!1),function(a,b){return{data:a,shouldFire:b}}).subscribe(function(f){d!==a&&f.shouldFire!=d?(d=f.shouldFire,f.shouldFire&&c()):(d=f.shouldFire,f.shouldFire?b.onNext(f.data):e.push(f.data))},function(a){c(),b.onError(a)},function(){c(),b.onCompleted()});return f}function d(a,d){this.source=a,this.controller=new Mc,d&&d.subscribe?this.pauser=this.controller.merge(d):this.pauser=this.controller,b.call(this,c,a)}return bb(d,b),d.prototype.pause=function(){this.controller.onNext(!1)},d.prototype.resume=function(){this.controller.onNext(!0)},d}(Jb);zb.pausableBuffered=function(a){return new Gc(this,a)};var Hc=function(a){function b(a){return this.source.subscribe(a)}function c(c,d,e){a.call(this,b,c),this.subject=new Ic(d,e),this.source=c.multicast(this.subject).refCount()}return bb(c,a),c.prototype.request=function(a){return this.subject.request(null==a?-1:a)},c}(Jb),Ic=function(a){function b(a){return this.subject.subscribe(a)}function c(c,d){null==c&&(c=!0),a.call(this,b),this.subject=new Mc,this.enableQueue=c,this.queue=c?[]:null,this.requestedCount=0,this.requestedDisposable=jb,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.scheduler=d||vb}return bb(c,a),cb(c.prototype,Fb,{onCompleted:function(){this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length?this.queue.push(Bb.createOnCompleted()):this.subject.onCompleted()},onError:function(a){this.hasFailed=!0,this.error=a,this.enableQueue&&0!==this.queue.length?this.queue.push(Bb.createOnError(a)):this.subject.onError(a)},onNext:function(a){var b=!1;0===this.requestedCount?this.enableQueue&&this.queue.push(Bb.createOnNext(a)):(-1!==this.requestedCount&&0===this.requestedCount--&&this.disposeCurrentRequest(),b=!0),b&&this.subject.onNext(a)},_processRequest:function(a){if(this.enableQueue){for(;this.queue.length>=a&&a>0||this.queue.length>0&&"N"!==this.queue[0].kind;){var b=this.queue.shift();b.accept(this.subject),"N"===b.kind?a--:(this.disposeCurrentRequest(),this.queue=[])}return{numberOfItems:a,returnValue:0!==this.queue.length}}return{numberOfItems:a,returnValue:!1}},request:function(a){this.disposeCurrentRequest();var b=this;return this.requestedDisposable=this.scheduler.scheduleWithState(a,function(a,c){var d=b._processRequest(c),e=d.numberOfItems;d.returnValue||(b.requestedCount=e,b.requestedDisposable=ib(function(){b.requestedCount=0}))}),this.requestedDisposable},disposeCurrentRequest:function(){this.requestedDisposable.dispose(),this.requestedDisposable=jb}}),c}(Jb);zb.controlled=function(a,b){return a&&rb(a)&&(b=a,a=!0),null==a&&(a=!0),new Hc(this,a,b)},zb.pipe=function(a){function b(){c.resume()}var c=this.pausableBuffered();return a.addListener("drain",b),c.subscribe(function(b){!a.write(String(b))&&c.pause()},function(b){a.emit("error",b)},function(){!a._isStdio&&a.end(),a.removeListener("drain",b)}),c.resume(),a},zb.transduce=function(a){function b(a){return{"@@transducer/init":function(){return a},"@@transducer/step":function(a,b){return a.onNext(b)},"@@transducer/result":function(a){return a.onCompleted()}}}var c=this;return new Jc(function(d){var e=a(b(d));return c.subscribe(function(a){
+try{e["@@transducer/step"](d,a)}catch(b){d.onError(b)}},function(a){d.onError(a)},function(){e["@@transducer/result"](d)})},c)};var Jc=ba.AnonymousObservable=function(a){function b(a){return a&&ja(a.dispose)?a:ja(a)?ib(a):jb}function c(a,c){var d=c[0],e=c[1],f=o(e)(d);return f!==_a||d.fail(_a.e)?void d.setDisposable(b(f)):p(_a.e)}function d(b,d){function e(a){var d=new Kc(a),e=[d,b];return vb.scheduleRequired()?vb.scheduleWithState(e,c):c(null,e),d}this.source=d,a.call(this,e)}return bb(d,a),d}(Jb),Kc=function(a){function b(b){a.call(this),this.observer=b,this.m=new mb}bb(b,a);var c=b.prototype;return c.next=function(a){var b=o(this.observer.onNext).call(this.observer,a);b===_a&&(this.dispose(),p(b.e))},c.error=function(a){var b=o(this.observer.onError).call(this.observer,a);this.dispose(),b===_a&&p(b.e)},c.completed=function(){var a=o(this.observer.onCompleted).call(this.observer);this.dispose(),a===_a&&p(a.e)},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(Hb),Lc=function(a,b){this.subject=a,this.observer=b};Lc.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var Mc=ba.Subject=function(a){function c(a){return lb(this),this.isStopped?this.hasError?(a.onError(this.error),jb):(a.onCompleted(),jb):(this.observers.push(a),new Lc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return bb(d,a),cb(d.prototype,Fb.prototype,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(lb(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=b(this.observers),d=c.length;d>a;a++)c[a].onCompleted();this.observers.length=0}},onError:function(a){if(lb(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){if(lb(this),!this.isStopped)for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new Oc(a,b)},d}(Jb),Nc=ba.AsyncSubject=function(a){function c(a){return lb(this),this.isStopped?(this.hasError?a.onError(this.error):this.hasValue?(a.onNext(this.value),a.onCompleted()):a.onCompleted(),jb):(this.observers.push(a),new Lc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.hasValue=!1,this.observers=[],this.hasError=!1}return bb(d,a),cb(d.prototype,Fb,{hasObservers:function(){return lb(this),this.observers.length>0},onCompleted:function(){var a,c;if(lb(this),!this.isStopped){this.isStopped=!0;var d=b(this.observers),c=d.length;if(this.hasValue)for(a=0;c>a;a++){var e=d[a];e.onNext(this.value),e.onCompleted()}else for(a=0;c>a;a++)d[a].onCompleted();this.observers.length=0}},onError:function(a){if(lb(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){lb(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(Jb),Oc=ba.AnonymousSubject=function(a){function b(a){return this.observable.subscribe(a)}function c(c,d){this.observer=c,this.observable=d,a.call(this,b)}return bb(c,a),cb(c.prototype,Fb.prototype,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(Jb),Pc=ba.BehaviorSubject=function(a){function c(a){return lb(this),this.isStopped?(this.hasError?a.onError(this.error):a.onCompleted(),jb):(this.observers.push(a),a.onNext(this.value),new Lc(this,a))}function d(b){a.call(this,c),this.value=b,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.hasError=!1}return bb(d,a),cb(d.prototype,Fb,{getValue:function(){if(lb(this),this.hasError)throw this.error;return this.value},hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(lb(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=b(this.observers),d=c.length;d>a;a++)c[a].onCompleted();this.observers.length=0}},onError:function(a){if(lb(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){if(lb(this),!this.isStopped){this.value=a;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.exception=null}}),d}(Jb),Qc=ba.ReplaySubject=function(a){function c(a,b){return ib(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function d(a){var b=new Kb(this.scheduler,a),d=c(this,b);lb(this),this._trim(this.scheduler.now()),this.observers.push(b);for(var e=0,f=this.q.length;f>e;e++)b.onNext(this.q[e].value);return this.hasError?b.onError(this.error):this.isStopped&&b.onCompleted(),b.ensureActive(),d}function e(b,c,e){this.bufferSize=null==b?f:b,this.windowSize=null==c?f:c,this.scheduler=e||vb,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this,d)}var f=Math.pow(2,53)-1;return bb(e,a),cb(e.prototype,Fb.prototype,{hasObservers:function(){return this.observers.length>0},_trim:function(a){for(;this.q.length>this.bufferSize;)this.q.shift();for(;this.q.length>0&&a-this.q[0].interval>this.windowSize;)this.q.shift()},onNext:function(a){if(lb(this),!this.isStopped){var c=this.scheduler.now();this.q.push({interval:c,value:a}),this._trim(c);for(var d=0,e=b(this.observers),f=e.length;f>d;d++){var g=e[d];g.onNext(a),g.ensureActive()}}},onError:function(a){if(lb(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var c=this.scheduler.now();this._trim(c);for(var d=0,e=b(this.observers),f=e.length;f>d;d++){var g=e[d];g.onError(a),g.ensureActive()}this.observers.length=0}},onCompleted:function(){if(lb(this),!this.isStopped){this.isStopped=!0;var a=this.scheduler.now();this._trim(a);for(var c=0,d=b(this.observers),e=d.length;e>c;c++){var f=d[c];f.onCompleted(),f.ensureActive()}this.observers.length=0}},dispose:function(){this.isDisposed=!0,this.observers=null}}),e}(Jb);ba.Pauser=function(a){function b(){a.call(this)}return bb(b,a),b.prototype.pause=function(){this.onNext(!1)},b.prototype.resume=function(){this.onNext(!0)},b}(Mc),"function"==typeof define&&"object"==typeof define.amd&&define.amd?(Y.Rx=ba,define(function(){return ba})):Z&&$?_?($.exports=ba).Rx=ba:Z.Rx=ba:Y.Rx=ba;var Rc=g()}).call(this);
+//# sourceMappingURL=rx.lite.map \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.map b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.map
new file mode 100644
index 00000000000..12100fd271c
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.map
@@ -0,0 +1 @@
+{"version":3,"file":"rx.min.js","sources":["rx.js"],"names":["undefined","cloneArray","arr","a","i","len","length","push","makeStackTraceLong","error","observable","hasStacks","stack","indexOf","STACK_JUMP_SEPARATOR","stacks","o","source","unshift","concatedStacks","join","filterStackString","stackString","lines","split","desiredLines","line","isInternalFrame","isNodeFrame","stackLine","fileNameAndLineNumber","getFileNameAndLineNumber","fileName","lineNumber","rFileName","rStartingLine","rEndingLine","captureLine","Error","e","firstLine","attempt1","exec","Number","attempt2","attempt3","keysIn","object","result","isObject","support","nonEnumArgs","isArguments","slice","call","skipProto","enumPrototypes","skipErrorProps","enumErrorProps","errorProto","key","nonEnumShadows","objectProto","ctor","constructor","index","dontEnumsLength","prototype","className","stringProto","stringClass","errorClass","toString","nonEnum","nonEnumProps","dontEnums","hasOwnProperty","internalFor","callback","keysFunc","props","internalForIn","isNode","value","deepEquals","b","stackA","stackB","type","otherType","otherClass","argsClass","objectClass","boolClass","dateClass","numberClass","regexpClass","String","isArr","arrayClass","nodeClass","ctorA","argsObject","Object","ctorB","isFunction","size","pop","arrayInitialize","count","factory","Array","tryCatcher","tryCatchTarget","apply","this","arguments","errorObj","tryCatch","fn","TypeError","thrower","IndexedItem","id","ScheduledDisposable","scheduler","disposable","isDisposed","scheduleItem","s","self","dispose","StringIterable","str","_s","StringIterator","_l","_i","ArrayIterable","_a","ArrayIterator","toLength","numberIsFinite","root","isFinite","getIterable","it","$iterator$","sign","number","isNaN","Math","floor","abs","maxSafeInteger","FromArraySink","observer","parent","observableOf","array","isScheduler","currentThreadScheduler","FromArrayObservable","PairsSink","RepeatSink","observableCatchHandler","handler","AnonymousObservable","d1","SingleAssignmentDisposable","subscription","SerialDisposable","setDisposable","subscribe","x","onNext","ex","onError","isPromise","observableFromPromise","d","onCompleted","falseFactory","zipArray","second","resultSelector","first","left","right","res","emptyArrayFactory","arrayFactory","ScanObserver","accumulator","hasSeed","seed","hasAccumulation","accumulation","hasValue","isStopped","concatMap","selector","thisArg","selectorFunc","bindCallback","map","isArrayLike","isIterable","observableFrom","concatAll","arrayIndexOfComparer","item","comparer","HashSet","set","flatMap","mergeAll","objectTypes","boolean","function","string","window","freeExports","exports","nodeType","freeModule","module","moduleExports","freeGlobal","global","Rx","internals","config","Promise","helpers","noop","identity","notDefined","defaultNow","pluck","property","just","Date","now","defaultComparer","y","isEqual","defaultSubComparer","defaultError","defaultKeySerializer","err","p","then","asArray","not","isFn","longStackSupport","EmptyError","message","ObjectDisposedError","ArgumentOutOfRangeError","NotSupportedError","NotImplementedError","notImplemented","notSupported","Symbol","iterator","Set","doneEnumerator","done","supportNodeClass","func","argCount","arg","collection","funcClass","supportsArgsClass","propertyIsEnumerable","document","toLocaleString","valueOf","test","inherits","child","__","addProperties","obj","sources","idx","ln","prop","addRef","xs","r","CompositeDisposable","getDisposable","compareTo","other","c","PriorityQueue","capacity","items","priorityProto","isHigherPriority","percolate","temp","heapify","peek","removeAt","dequeue","enqueue","remove","args","isArray","isDisposable","disposables","CompositeDisposablePrototype","add","shouldDispose","splice","currentDisposables","Disposable","action","disposableCreate","create","disposableEmpty","empty","checkDisposed","current","old","RefCountDisposable","InnerDisposable","isInnerDisposed","underlyingDisposable","isPrimaryDisposed","scheduleWithState","ScheduledItem","state","dueTime","invoke","invokeCore","isCancelled","Scheduler","schedule","scheduleRelative","scheduleAbsolute","_schedule","_scheduleRelative","_scheduleAbsolute","invokeAction","schedulerProto","scheduleWithRelative","scheduleWithRelativeAndState","scheduleWithAbsolute","scheduleWithAbsoluteAndState","normalize","timeSpan","normalizeTime","invokeRecImmediate","pair","recursiveAction","state1","state2","isAdded","isDone","scheduler1","state3","group","invokeRecDate","method","dueTime1","scheduleInnerRecursive","dt","scheduleRecursive","scheduleRecursiveWithState","scheduleRecursiveWithRelative","scheduleRecursiveWithRelativeAndState","scheduleRecursiveWithAbsolute","scheduleRecursiveWithAbsoluteAndState","schedulePeriodic","period","schedulePeriodicWithState","setInterval","clearInterval","catchError","CatchScheduler","scheduleMethod","clearMethod","immediateScheduler","SchedulePeriodicRecursive","tick","command","recurse","_period","_state","_action","_cancel","_scheduler","start","bind","immediate","scheduleNow","currentThread","runTrampoline","queue","si","currentScheduler","scheduleRequired","localTimer","localSetTimeout","localClearTimeout","setTimeout","clearTimeout","WScript","time","Sleep","runTask","handle","currentlyRunning","task","tasksByHandle","postMessageSupported","postMessage","importScripts","isAsync","oldHandler","onmessage","onGlobalPostMessage","event","data","substring","MSG_PREFIX","nextHandle","reNative","RegExp","replace","setImmediate","process","nextTick","random","addEventListener","attachEvent","currentId","MessageChannel","channel","port1","port2","createElement","scriptElement","onreadystatechange","parentNode","removeChild","documentElement","appendChild","timeout","__super__","_wrap","_handler","_recursiveOriginal","_recursiveWrapper","_clone","_getRecursiveWrapper","wrapper","failed","Notification","kind","exception","accept","acceptObservable","_accept","_acceptObservable","observerOrOnNext","toObservable","_","notification","notificationCreateOnNext","createOnNext","notificationCreateOnError","createOnError","notificationCreateOnCompleted","createOnCompleted","Observer","toNotifier","n","asObserver","AnonymousObserver","checked","CheckedObserver","observerCreate","fromNotifier","notifyOn","ObserveOnObserver","makeSafe","AnonymousSafeObserver","_onNext","_onError","_onCompleted","observableProto","AbstractObserver","next","completed","fail","_observer","CheckedObserverPrototype","checkAccess","ScheduledObserver","isAcquired","hasFaulted","ensureActive","isOwner","work","shift","cancel","Observable","_subscribe","oldOnError","forEach","subscribeOnNext","subscribeOnError","subscribeOnCompleted","ObservableBase","fixSubscriber","subscriber","ado","sub","subscribeCore","AutoDetachObserver","Enumerable","ConcatEnumerableObservable","InnerObserver","cancelable","currentItem","currentValue","concat","CatchErrorObservable","lastException","catchErrorWhen","notificationHandler","exceptions","Subject","notifier","handled","notificationDisposable","outer","inner","exn","RepeatEnumerable","v","RepeatEnumerator","l","enumerableRepeat","repeat","repeatCount","OfEnumerable","OfEnumerator","enumerableOf","of","observeOn","subscribeOn","m","FromPromiseObservable","fromPromise","promise","toPromise","promiseCtor","resolve","reject","ToArrayObservable","toArray","createWithDisposable","EmptyObservable","defer","observableFactory","observableThrow","EmptySink","sink","run","observableEmpty","FromObservable","iterable","mapper","FromSink","loopRecursive","list","pow","charAt","from","mapFn","observableFromArray","fromArray","generate","initialState","condition","iterate","hasResult","NeverObservable","observableNever","never","ofWithScheduler","PairsObservable","keys","pairs","RangeObservable","rangeCount","RangeSink","range","RepeatObservable","JustObservable","JustSink","ThrowObservable","returnValue","ThrowSink","throwError","throwException","using","resourceFactory","resource","amb","rightSource","leftSource","choiceL","choice","leftChoice","rightSubscription","choiceR","rightChoice","leftSubscription","previous","acc","catchException","handlerOrSecond","observableCatch","combineLatest","hasValueAll","every","values","filter","j","subscriptions","sad","observableConcat","ConcatObservable","ConcatSink","concatObservable","merge","MergeObservable","maxConcurrent","g","MergeObserver","max","q","activeCount","handleSubscribe","innerSource","maxConcurrentOrOther","observableMerge","CompositeError","errors","name","innerErrors","mergeDelayError","setCompletion","innerSubscription","MergeAllObservable","MergeAllObserver","mergeObservable","onErrorResumeNext","pos","skipUntil","isOpen","SwitchObservable","SwitchObserver","stopped","latest","hasLatest","switchLatest","TakeUntilObservable","takeUntil","withLatestFrom","allValues","zip","queues","queuedValues","asObservable","bufferWithCount","skip","windowWithCount","selectMany","where","dematerialize","distinctUntilChanged","keySelector","currentKey","hasCurrentKey","comparerEquals","TapObservable","t","tap","doAction","doOnNext","tapOnNext","doOnError","tapOnError","doOnCompleted","tapOnCompleted","ensure","finallyAction","IgnoreElementsObservable","ignoreElements","materialize","retry","retryCount","retryWhen","ScanObservable","scan","skipLast","startWith","takeLast","takeLastBuffer","Infinity","createWindow","refCountDisposable","selectConcat","selectorResult","i2","concatMapObserver","selectConcatObserver","onNextFunc","onErrorFunc","onCompletedFunc","defaultIfEmpty","defaultValue","found","retValue","distinct","hashSet","MapObservable","innerMap","internalMap","select","selectorFn","currentProp","flatMapObserver","selectManyObserver","selectSwitch","flatMapLatest","switchMap","SkipObservable","skipCount","skipWhile","predicate","running","take","remaining","takeWhile","FilterObservable","innerPredicate","internalFilter","shouldYield","transduce","transducer","transformForObserver","@@transducer/init","@@transducer/step","obs","input","@@transducer/result","xform","AutoDetachObserverPrototype","InnerSubscription","subject","observers","hasError","hasObservers","os","AnonymousSubject","AsyncSubject","define","am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rx.min.js b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.min.js
new file mode 100644
index 00000000000..e9eb4a6155b
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.min.js
@@ -0,0 +1,6 @@
+/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
+(function(a){function b(a){for(var b=[],c=0,d=a.length;d>c;c++)b.push(a[c]);return b}function c(a,b){if(ea&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(ia)){for(var c=[],e=b;e;e=e.source)e.stack&&c.unshift(e.stack);c.unshift(a.stack);var f=c.join("\n"+ia+"\n");a.stack=d(f)}}function d(a){for(var b=a.split("\n"),c=[],d=0,g=b.length;g>d;d++){var h=b[d];e(h)||f(h)||!h||c.push(h)}return c.join("\n")}function e(a){var b=h(a);if(!b)return!1;var c=b[0],d=b[1];return c===ga&&d>=ha&&Gc>=d}function f(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function g(){if(ea)try{throw new Error}catch(a){var b=a.stack.split("\n"),c=b[0].indexOf("@")>0?b[1]:b[2],d=h(c);if(!d)return;return ga=d[0],d[1]}}function h(a){var b=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(a);if(b)return[b[1],Number(b[2])];var c=/at ([^ ]+):(\d+):(?:\d+)$/.exec(a);if(c)return[c[1],Number(c[2])];var d=/.*@(.+):(\d+)$/.exec(a);return d?[d[1],Number(d[2])]:void 0}function i(a){var b=[];if(!Ra(a))return b;Qa.nonEnumArgs&&a.length&&Sa(a)&&(a=Va.call(a));var c=Qa.enumPrototypes&&"function"==typeof a,d=Qa.enumErrorProps&&(a===La||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(Qa.nonEnumShadows&&a!==Ma){var f=a.constructor,g=-1,h=xa;if(a===(f&&f.prototype))var i=a===Na?Ha:a===La?Ca:Ia.call(a),j=Pa[i];for(;++g<h;)e=wa[g],j&&j[e]||!Ja.call(a,e)||b.push(e)}return b}function j(a,b,c){for(var d=-1,e=c(a),f=e.length;++d<f;){var g=e[d];if(b(a[g],g,a)===!1)break}return a}function k(a,b){return j(a,b,i)}function l(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function m(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,f=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=f&&"object"!=f))return!1;var g=Ia.call(a),h=Ia.call(b);if(g==ya&&(g=Fa),h==ya&&(h=Fa),g!=h)return!1;switch(g){case Aa:case Ba:return+a==+b;case Ea:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case Ga:case Ha:return a==String(b)}var i=g==za;if(!i){if(g!=Fa||!Qa.nodeClass&&(l(a)||l(b)))return!1;var j=!Qa.argsObject&&Sa(a)?Object:a.constructor,n=!Qa.argsObject&&Sa(b)?Object:b.constructor;if(!(j==n||Ja.call(a,"constructor")&&Ja.call(b,"constructor")||da(j)&&j instanceof j&&da(n)&&n instanceof n||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var o=c.length;o--;)if(c[o]==a)return d[o]==b;var p=0,q=!0;if(c.push(a),d.push(b),i){if(o=a.length,p=b.length,q=p==o)for(;p--;){var r=b[p];if(!(q=m(a[p],r,c,d)))break}}else k(b,function(b,e,f){return Ja.call(f,e)?(p++,q=Ja.call(a,e)&&m(a[e],b,c,d)):void 0}),q&&k(a,function(a,b,c){return Ja.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function n(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function o(){try{return Ta.apply(this,arguments)}catch(a){return Za.e=a,Za}}function p(a){if(!da(a))throw new TypeError("fn must be a function");return Ta=a,o}function q(a){throw a}function r(a,b){this.id=a,this.value=b}function t(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function u(a,b){b.isDisposed||(b.isDisposed=!0,b.disposable.dispose())}function v(a){this._s=s}function w(a){this._s=s,this._l=s.length,this._i=0}function x(a){this._a=a}function y(a){this._a=a,this._l=C(a),this._i=0}function z(a){return"number"==typeof a&&S.isFinite(a)}function A(b){var c,d=b[qa];if(!d&&"string"==typeof b)return c=new v(b),c[qa]();if(!d&&b.length!==a)return c=new x(b),c[qa]();if(!d)throw new TypeError("Object is not iterable");return b[qa]()}function B(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function C(a){var b=+a.length;return isNaN(b)?0:0!==b&&z(b)?(b=B(b)*Math.floor(Math.abs(b)),0>=b?0:b>Yb?Yb:b):b}function D(a,b){this.observer=a,this.parent=b}function E(a,b){return nb(a)||(a=rb),new $b(b,a)}function F(a,b){this.observer=a,this.parent=b}function G(a,b){this.observer=a,this.parent=b}function H(a,b){return new Bc(function(c){var d=new hb,e=new ib;return e.setDisposable(d),d.setDisposable(a.subscribe(function(a){c.onNext(a)},function(a){try{var d=b(a)}catch(f){return c.onError(f)}ca(d)&&(d=Sb(d));var g=new hb;e.setDisposable(g),g.setDisposable(d.subscribe(c))},function(a){c.onCompleted(a)})),e},a)}function I(){return!1}function J(a,b){var c=this;return new Bc(function(d){var e=0,f=a.length;return c.subscribe(function(c){if(f>e){var g=a[e++],h=p(b)(c,g);if(h===Za)return d.onError(h.e);d.onNext(h)}else d.onCompleted()},function(a){d.onError(a)},function(){d.onCompleted()})},c)}function I(){return!1}function K(){return[]}function I(){return!1}function L(){return[]}function M(a,b){this.observer=a,this.accumulator=b.accumulator,this.hasSeed=b.hasSeed,this.seed=b.seed,this.hasAccumulation=!1,this.accumulation=null,this.hasValue=!1,this.isStopped=!1}function N(a,b,c){var d=va(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return ca(e)&&(e=Sb(e)),(ta(e)||sa(e))&&(e=Zb(e)),e}).concatAll()}function O(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function P(a){this.comparer=a,this.set=[]}function Q(a,b,c){var d=va(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return ca(e)&&(e=Sb(e)),(ta(e)||sa(e))&&(e=Zb(e)),e}).mergeAll()}var R={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},S=R[typeof window]&&window||this,T=R[typeof exports]&&exports&&!exports.nodeType&&exports,U=R[typeof module]&&module&&!module.nodeType&&module,V=U&&U.exports===T&&T,W=R[typeof global]&&global;!W||W.global!==W&&W.window!==W||(S=W);var X={internals:{},config:{Promise:S.Promise},helpers:{}},Y=X.helpers.noop=function(){},Z=(X.helpers.notDefined=function(a){return"undefined"==typeof a},X.helpers.identity=function(a){return a}),$=(X.helpers.pluck=function(a){return function(b){return b[a]}},X.helpers.just=function(a){return function(){return a}},X.helpers.defaultNow=Date.now),_=X.helpers.defaultComparer=function(a,b){return Ua(a,b)},aa=X.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},ba=(X.helpers.defaultKeySerializer=function(a){return a.toString()},X.helpers.defaultError=function(a){throw a}),ca=X.helpers.isPromise=function(a){return!!a&&"function"!=typeof a.subscribe&&"function"==typeof a.then},da=(X.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},X.helpers.not=function(a){return!a},X.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==Ia.call(a)}),a}());X.config.longStackSupport=!1;var ea=!1;try{throw new Error}catch(fa){ea=!!fa.stack}var ga,ha=g(),ia="From previous event:",ja=X.EmptyError=function(){this.message="Sequence contains no elements.",Error.call(this)};ja.prototype=Error.prototype;var ka=X.ObjectDisposedError=function(){this.message="Object has been disposed",Error.call(this)};ka.prototype=Error.prototype;var la=X.ArgumentOutOfRangeError=function(){this.message="Argument out of range",Error.call(this)};la.prototype=Error.prototype;var ma=X.NotSupportedError=function(a){this.message=a||"This operation is not supported",Error.call(this)};ma.prototype=Error.prototype;var na=X.NotImplementedError=function(a){this.message=a||"This operation is not implemented",Error.call(this)};na.prototype=Error.prototype;var oa=X.helpers.notImplemented=function(){throw new na},pa=X.helpers.notSupported=function(){throw new ma},qa="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";S.Set&&"function"==typeof(new S.Set)["@@iterator"]&&(qa="@@iterator");var ra=X.doneEnumerator={done:!0,value:a},sa=X.helpers.isIterable=function(b){return b[qa]!==a},ta=X.helpers.isArrayLike=function(b){return b&&b.length!==a};X.helpers.iterator=qa;var ua,va=X.internals.bindCallback=function(a,b,c){if("undefined"==typeof b)return a;switch(c){case 0:return function(){return a.call(b)};case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)}}return function(){return a.apply(b,arguments)}},wa=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],xa=wa.length,ya="[object Arguments]",za="[object Array]",Aa="[object Boolean]",Ba="[object Date]",Ca="[object Error]",Da="[object Function]",Ea="[object Number]",Fa="[object Object]",Ga="[object RegExp]",Ha="[object String]",Ia=Object.prototype.toString,Ja=Object.prototype.hasOwnProperty,Ka=Ia.call(arguments)==ya,La=Error.prototype,Ma=Object.prototype,Na=String.prototype,Oa=Ma.propertyIsEnumerable;try{ua=!(Ia.call(document)==Fa&&!({toString:0}+""))}catch(fa){ua=!0}var Pa={};Pa[za]=Pa[Ba]=Pa[Ea]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},Pa[Aa]=Pa[Ha]={constructor:!0,toString:!0,valueOf:!0},Pa[Ca]=Pa[Da]=Pa[Ga]={constructor:!0,toString:!0},Pa[Fa]={constructor:!0};var Qa={};!function(){var a=function(){this.x=1},b=[];a.prototype={valueOf:1,y:1};for(var c in new a)b.push(c);for(c in arguments);Qa.enumErrorProps=Oa.call(La,"message")||Oa.call(La,"name"),Qa.enumPrototypes=Oa.call(a,"prototype"),Qa.nonEnumArgs=0!=c,Qa.nonEnumShadows=!/valueOf/.test(b)}(1);var Ra=X.internals.isObject=function(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1},Sa=function(a){return a&&"object"==typeof a?Ia.call(a)==ya:!1};Ka||(Sa=function(a){return a&&"object"==typeof a?Ja.call(a,"callee"):!1});var Ta,Ua=X.internals.isEqual=function(a,b){return m(a,b,[],[])},Va=({}.hasOwnProperty,Array.prototype.slice),Wa=this.inherits=X.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c},Xa=X.internals.addProperties=function(a){for(var b=[],c=1,d=arguments.length;d>c;c++)b.push(arguments[c]);for(var e=0,f=b.length;f>e;e++){var g=b[e];for(var h in g)a[h]=g[h]}},Ya=X.internals.addRef=function(a,b){return new Bc(function(c){return new ab(b.getDisposable(),a.subscribe(c))})},Za={e:{}};r.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var $a=X.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},_a=$a.prototype;_a.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},_a.percolate=function(a){if(!(a>=this.length||0>a)){var b=a-1>>1;if(!(0>b||b===a)&&this.isHigherPriority(a,b)){var c=this.items[a];this.items[a]=this.items[b],this.items[b]=c,this.percolate(b)}}},_a.heapify=function(a){if(+a||(a=0),!(a>=this.length||0>a)){var b=2*a+1,c=2*a+2,d=a;if(b<this.length&&this.isHigherPriority(b,d)&&(d=b),c<this.length&&this.isHigherPriority(c,d)&&(d=c),d!==a){var e=this.items[a];this.items[a]=this.items[d],this.items[d]=e,this.heapify(d)}}},_a.peek=function(){return this.items[0].value},_a.removeAt=function(b){this.items[b]=this.items[--this.length],this.items[this.length]=a,this.heapify()},_a.dequeue=function(){var a=this.peek();return this.removeAt(0),a},_a.enqueue=function(a){var b=this.length++;this.items[b]=new r($a.count++,a),this.percolate(b)},_a.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},$a.count=0;var ab=X.CompositeDisposable=function(){var a,b,c=[];if(Array.isArray(arguments[0]))c=arguments[0],b=c.length;else for(b=arguments.length,c=new Array(b),a=0;b>a;a++)c[a]=arguments[a];for(a=0;b>a;a++)if(!fb(c[a]))throw new TypeError("Not a disposable");this.disposables=c,this.isDisposed=!1,this.length=c.length},bb=ab.prototype;bb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},bb.remove=function(a){var b=!1;if(!this.isDisposed){var c=this.disposables.indexOf(a);-1!==c&&(b=!0,this.disposables.splice(c,1),this.length--,a.dispose())}return b},bb.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;for(var a=this.disposables.length,b=new Array(a),c=0;a>c;c++)b[c]=this.disposables[c];for(this.disposables=[],this.length=0,c=0;a>c;c++)b[c].dispose()}};var cb=X.Disposable=function(a){this.isDisposed=!1,this.action=a||Y};cb.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var db=cb.create=function(a){return new cb(a)},eb=cb.empty={dispose:Y},fb=cb.isDisposable=function(a){return a&&da(a.dispose)},gb=cb.checkDisposed=function(a){if(a.isDisposed)throw new ka},hb=X.SingleAssignmentDisposable=function(){this.isDisposed=!1,this.current=null};hb.prototype.getDisposable=function(){return this.current},hb.prototype.setDisposable=function(a){if(this.current)throw new Error("Disposable has already been assigned");var b=this.isDisposed;!b&&(this.current=a),b&&a&&a.dispose()},hb.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var ib=X.SerialDisposable=function(){this.isDisposed=!1,this.current=null};ib.prototype.getDisposable=function(){return this.current},ib.prototype.setDisposable=function(a){var b=this.isDisposed;if(!b){var c=this.current;this.current=a}c&&c.dispose(),b&&a&&a.dispose()},ib.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var jb=X.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?eb:new a(this)},b}();t.prototype.dispose=function(){this.scheduler.scheduleWithState(this,u)};var kb=X.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||aa,this.disposable=new hb};kb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},kb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},kb.prototype.isCancelled=function(){return this.disposable.isDisposed},kb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var lb=X.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),eb}a.isScheduler=function(b){return b instanceof a};var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=$,a.normalize=function(a){return 0>a&&(a=0),a},a}(),mb=lb.normalize,nb=lb.isScheduler;!function(a){function b(a,b){function c(b){e(b,function(b){var d=!1,e=!1,g=a.scheduleWithState(b,function(a,b){return d?f.remove(g):e=!0,c(b),eb});e||(f.add(g),d=!0)})}var d=b[0],e=b[1],f=new ab;return c(d),f}function c(a,b,c){function d(b){f(b,function(b,e){var f=!1,h=!1,i=a[c](b,e,function(a,b){return f?g.remove(i):h=!0,d(b),eb});h||(g.add(i),f=!0)})}var e=b[0],f=b[1],g=new ab;return d(e),g}function d(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,d)},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState([a,c],b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,d)},a.scheduleRecursiveWithRelativeAndState=function(a,b,d){return this._scheduleRelative([a,d],b,function(a,b){return c(a,b,"scheduleWithRelativeAndState")})},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,d)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,d){return this._scheduleAbsolute([a,d],b,function(a,b){return c(a,b,"scheduleWithAbsoluteAndState")})}}(lb.prototype),function(a){lb.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},lb.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof S.setInterval)throw new ma;b=mb(b);var d=a,e=S.setInterval(function(){d=c(d)},b);return db(function(){S.clearInterval(e)})}}(lb.prototype),function(a){a.catchError=a["catch"]=function(a){return new vb(this,a)}}(lb.prototype);var ob,pb,qb=(X.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new hb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),lb.immediate=function(){function a(a,b){return b(this,a)}return new lb($,a,pa,pa)}()),rb=lb.currentThread=function(){function a(){for(;c.length>0;){var a=c.dequeue();!a.isCancelled()&&a.invoke()}}function b(b,d){var e=new kb(this,b,d,this.now());if(c)c.enqueue(e);else{c=new $a(4),c.enqueue(e);var f=p(a)();if(c=null,f===Za)return q(f.e)}return e.disposable}var c,d=new lb($,b,pa,pa);return d.scheduleRequired=function(){return!c},d}(),sb=function(){var a,b=Y;if(S.setTimeout)a=S.setTimeout,b=S.clearTimeout;else{if(!S.WScript)throw new ma;a=function(a,b){S.WScript.Sleep(b),a()}}return{setTimeout:a,clearTimeout:b}}(),tb=sb.setTimeout,ub=sb.clearTimeout;!function(){function a(b){if(f)tb(function(){a(b)},0);else{var c=e[b];if(c){f=!0;var d=p(c)();if(pb(b),f=!1,d===Za)return q(d.e)}}}function b(){if(!S.postMessage||S.importScripts)return!1;var a=!1,b=S.onmessage;return S.onmessage=function(){a=!0},S.postMessage("","*"),S.onmessage=b,a}function c(b){"string"==typeof b.data&&b.data.substring(0,i.length)===i&&a(b.data.substring(i.length))}var d=1,e={},f=!1;pb=function(a){delete e[a]};var g=RegExp("^"+String(Ia).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),h="function"==typeof(h=W&&V&&W.setImmediate)&&!g.test(h)&&h;if(da(h))ob=function(b){var c=d++;return e[c]=b,h(function(){a(c)}),c};else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))ob=function(b){var c=d++;return e[c]=b,process.nextTick(function(){a(c)}),c};else if(b()){var i="ms.rx.schedule"+Math.random();S.addEventListener?S.addEventListener("message",c,!1):S.attachEvent?S.attachEvent("onmessage",c):S.onmessage=c,ob=function(a){var b=d++;return e[b]=a,S.postMessage(i+currentId,"*"),b}}else if(S.MessageChannel){var j=new S.MessageChannel;j.port1.onmessage=function(b){a(b.data)},ob=function(a){var b=d++;return e[b]=a,j.port2.postMessage(b),b}}else ob="document"in S&&"onreadystatechange"in S.document.createElement("script")?function(b){var c=S.document.createElement("script"),f=d++;return e[f]=b,c.onreadystatechange=function(){a(f),c.onreadystatechange=null,c.parentNode.removeChild(c),c=null},S.document.documentElement.appendChild(c),f}:function(b){var c=d++;return e[c]=b,tb(function(){a(c)},0),c}}();var vb=(lb.timeout=lb["default"]=function(){function a(a,b){var c=this,d=new hb,e=ob(function(){!d.isDisposed&&d.setDisposable(b(c,a))});return new ab(d,db(function(){pb(e)}))}function b(a,b,c){var d=this,e=lb.normalize(b),f=new hb;if(0===e)return d.scheduleWithState(a,c);var g=tb(function(){!f.isDisposed&&f.setDisposable(c(d,a))},e);return new ab(f,db(function(){ub(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new lb($,a,b,c)}(),function(a){function b(a,b){return this._scheduler.scheduleWithState(a,this._wrap(b))}function c(a,b,c){return this._scheduler.scheduleWithRelativeAndState(a,b,this._wrap(c))}function d(a,b,c){return this._scheduler.scheduleWithAbsoluteAndState(a,b,this._wrap(c))}function e(e,f){this._scheduler=e,this._handler=f,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this,this._scheduler.now.bind(this._scheduler),b,c,d)}return Wa(e,a),e.prototype._clone=function(a){return new e(a,this._handler)},e.prototype._wrap=function(a){var b=this;return function(c,d){try{return a(b._getRecursiveWrapper(c),d)}catch(e){if(!b._handler(e))throw e;return eb}}},e.prototype._getRecursiveWrapper=function(a){if(this._recursiveOriginal!==a){this._recursiveOriginal=a;var b=this._clone(a);b._recursiveOriginal=a,b._recursiveWrapper=b,this._recursiveWrapper=b}return this._recursiveWrapper},e.prototype.schedulePeriodicWithState=function(a,b,c){var d=this,e=!1,f=new hb;return f.setDisposable(this._scheduler.schedulePeriodicWithState(a,b,function(a){if(e)return null;try{return c(a)}catch(b){if(e=!0,!d._handler(b))throw b;return f.dispose(),null}})),f},e}(lb)),wb=X.Notification=function(){function a(a,b,c,d,e,f){this.kind=a,this.value=b,this.exception=c,this._accept=d,this._acceptObservable=e,this.toString=f}return a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return nb(a)||(a=qb),new Bc(function(c){return a.scheduleWithState(b,function(a,b){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),xb=wb.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){return new wb("N",d,null,a,b,c)}}(),yb=wb.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){return new wb("E",null,d,a,b,c)}}(),zb=wb.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){return new wb("C",null,null,a,b,c)}}(),Ab=X.Observer=function(){};Ab.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},Ab.prototype.asObserver=function(){return new Eb(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},Ab.prototype.checked=function(){return new Fb(this)};var Bb=Ab.create=function(a,b,c){return a||(a=Y),b||(b=ba),c||(c=Y),new Eb(a,b,c)};Ab.fromNotifier=function(a,b){return new Eb(function(c){return a.call(b,xb(c))},function(c){return a.call(b,yb(c))},function(){return a.call(b,zb())})},Ab.prototype.notifyOn=function(a){return new Hb(a,this)},Ab.prototype.makeSafe=function(a){return new AnonymousSafeObserver(this._onNext,this._onError,this._onCompleted,a)};var Cb,Db=X.internals.AbstractObserver=function(a){function b(){this.isStopped=!1,a.call(this)}return Wa(b,a),b.prototype.next=oa,b.prototype.error=oa,b.prototype.completed=oa,b.prototype.onNext=function(a){this.isStopped||this.next(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.error(a))},b.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(Ab),Eb=X.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return Wa(b,a),b.prototype.next=function(a){this._onNext(a)},b.prototype.error=function(a){this._onError(a)},b.prototype.completed=function(){this._onCompleted()},b}(Db),Fb=function(a){function b(b){a.call(this),this._observer=b,this._state=0}Wa(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();var b=p(this._observer.onNext).call(this._observer,a);this._state=0,b===Za&&q(b.e)},c.onError=function(a){this.checkAccess();var b=p(this._observer.onError).call(this._observer,a);this._state=2,b===Za&&q(b.e)},c.onCompleted=function(){this.checkAccess();var a=p(this._observer.onCompleted).call(this._observer);this._state=2,a===Za&&q(a.e)},c.checkAccess=function(){if(1===this._state)throw new Error("Re-entrancy detected");if(2===this._state)throw new Error("Observer completed");0===this._state&&(this._state=1)},b}(Ab),Gb=X.internals.ScheduledObserver=function(a){function b(b,c){a.call(this),this.scheduler=b,this.observer=c,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new ib}return Wa(b,a),b.prototype.next=function(a){var b=this;this.queue.push(function(){b.observer.onNext(a)})},b.prototype.error=function(a){var b=this;this.queue.push(function(){b.observer.onError(a)})},b.prototype.completed=function(){var a=this;this.queue.push(function(){a.observer.onCompleted()})},b.prototype.ensureActive=function(){var a=!1,b=this;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(a){var c;if(!(b.queue.length>0))return void(b.isAcquired=!1);c=b.queue.shift();try{c()}catch(d){throw b.queue=[],b.hasFaulted=!0,d}a()}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(Db),Hb=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return Wa(b,a),b.prototype.next=function(b){a.prototype.next.call(this,b),this.ensureActive()},b.prototype.error=function(b){a.prototype.error.call(this,b),this.ensureActive()},b.prototype.completed=function(){a.prototype.completed.call(this),this.ensureActive()},b.prototype.dispose=function(){a.prototype.dispose.call(this),this._cancel&&this._cancel.dispose(),this._cancel=null},b}(Gb),Ib=X.Observable=function(){function a(a){if(X.config.longStackSupport&&ea){try{throw new Error}catch(b){this.stack=b.stack.substring(b.stack.indexOf("\n")+1)}var d=this;this._subscribe=function(b){var e=b.onError.bind(b);return b.onError=function(a){c(a,d),e(a)},a.call(d,b)}}else this._subscribe=a}return Cb=a.prototype,Cb.subscribe=Cb.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:Bb(a,b,c))},Cb.subscribeOnNext=function(a,b){return this._subscribe(Bb("undefined"!=typeof b?function(c){a.call(b,c)}:a))},Cb.subscribeOnError=function(a,b){return this._subscribe(Bb(null,"undefined"!=typeof b?function(c){a.call(b,c)}:a))},Cb.subscribeOnCompleted=function(a,b){return this._subscribe(Bb(null,null,"undefined"!=typeof b?function(){a.call(b)}:a))},a}(),Jb=X.ObservableBase=function(a){function b(a){return a&&da(a.dispose)?a:da(a)?db(a):eb}function c(a,c){var d=c[0],e=c[1],f=p(e.subscribeCore).call(e,d);return f!==Za||d.fail(Za.e)?void d.setDisposable(b(f)):q(Za.e)}function d(a){var b=new Cc(a),d=[b,this];return rb.scheduleRequired()?rb.scheduleWithState(d,c):c(null,d),b}function e(){a.call(this,d)}return Wa(e,a),e.prototype.subscribeCore=oa,e}(Ib),Kb=X.internals.Enumerable=function(){},Lb=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b,c){this.o=a,this.s=b,this.e=c,this.isStopped=!1}return Wa(b,a),b.prototype.subscribeCore=function(a){var b,d=new ib,e=qb.scheduleRecursiveWithState(this.sources[qa](),function(e,f){if(!b){var g=p(e.next).call(e);if(g===Za)return a.onError(g.e);if(g.done)return a.onCompleted();var h=g.value;ca(h)&&(h=Sb(h));var i=new hb;d.setDisposable(i),i.setDisposable(h.subscribe(new c(a,f,e)))}});return new ab(d,e,db(function(){b=!0}))},c.prototype.onNext=function(a){this.isStopped||this.o.onNext(a)},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.s(this.e))},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Jb);Kb.prototype.concat=function(){return new Lb(this)};var Mb=function(a){function b(b){this.sources=b,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){var b,c=this.sources[qa](),d=new ib,e=qb.scheduleRecursiveWithState(null,function(e,f){if(!b){var g=p(c.next).call(c);if(g===Za)return a.onError(g.e);if(g.done)return null!==e?a.onError(e):a.onCompleted();var h=g.value;ca(h)&&(h=Sb(h));var i=new hb;d.setDisposable(i),i.setDisposable(h.subscribe(function(b){a.onNext(b)},f,function(){a.onCompleted()}))}});return new ab(d,e,db(function(){b=!0}))},b}(Jb);Kb.prototype.catchError=function(){return new Mb(this)},Kb.prototype.catchErrorWhen=function(a){var b=this;return new Bc(function(c){var d,e,f=new Ec,g=new Ec,h=a(f),i=h.subscribe(g),j=b[qa](),k=new ib,l=qb.scheduleRecursive(function(a){if(!d){var b=p(j.next).call(j);if(b===Za)return c.onError(b.e);if(b.done)return void(e?c.onError(e):c.onCompleted());var h=b.value;ca(h)&&(h=Sb(h));var i=new hb,l=new hb;k.setDisposable(new ab(l,i)),i.setDisposable(h.subscribe(function(a){c.onNext(a)},function(b){l.setDisposable(g.subscribe(a,function(a){c.onError(a)},function(){c.onCompleted()})),f.onNext(b)},function(){c.onCompleted()}))}});return new ab(i,k,l,db(function(){d=!0}))})};var Nb=function(a){function b(a,b){this.v=a,this.c=null==b?-1:b}function c(a){this.v=a.v,this.l=a.c}return Wa(b,a),b.prototype[qa]=function(){return new c(this)},c.prototype.next=function(){return 0===this.l?ra:(this.l>0&&this.l--,{done:!1,value:this.v})},b}(Kb),Ob=Kb.repeat=function(a,b){return new Nb(a,b)},Pb=function(a){function b(a,b,c){this.s=a,this.fn=b?va(b,c,3):null}function c(a){this.i=-1,this.s=a.s,this.l=this.s.length,this.fn=a.fn}return Wa(b,a),b.prototype[qa]=function(){return new c(this)},c.prototype.next=function(){return++this.i<this.l?{done:!1,value:this.fn?this.fn(this.s[this.i],this.i,this.s):this.s[this.i]}:ra},b}(Kb),Qb=Kb.of=function(a,b,c){return new Pb(a,b,c)};Cb.observeOn=function(a){var b=this;return new Bc(function(c){return b.subscribe(new Hb(a,c))},b)},Cb.subscribeOn=function(a){var b=this;return new Bc(function(c){var d=new hb,e=new ib;return e.setDisposable(d),d.setDisposable(a.schedule(function(){e.setDisposable(new t(a,b.subscribe(c)))})),e},b)};var Rb=function(a){function b(b){this.p=b,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){return this.p.then(function(b){a.onNext(b),a.onCompleted()},function(b){a.onError(b)}),eb},b}(Jb),Sb=Ib.fromPromise=function(a){return new Rb(a)};Cb.toPromise=function(a){if(a||(a=X.config.Promise),!a)throw new ma("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})};var Tb=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.a=[],this.isStopped=!1}return Wa(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a))},c.prototype.onNext=function(a){this.isStopped||this.a.push(a)},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onNext(this.a),this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Jb);Cb.toArray=function(){return new Tb(this)},Ib.create=Ib.createWithDisposable=function(a,b){return new Bc(a,b)};var Ub=(Ib.defer=function(a){return new Bc(function(b){var c;try{c=a()}catch(d){return ic(d).subscribe(b)}return ca(c)&&(c=Sb(c)),c.subscribe(b)})},function(a){function b(b){this.scheduler=b,a.call(this)}function c(a,b){this.observer=a,this.parent=b}function d(a,b){b.onCompleted()}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this);return b.run()},c.prototype.run=function(){return this.parent.scheduler.scheduleWithState(this.observer,d)},b}(Jb)),Vb=Ib.empty=function(a){return nb(a)||(a=qb),new Ub(a)},Wb=function(a){function b(b,c,d){this.iterable=b,this.mapper=c,this.scheduler=d,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new Xb(a,this);return b.run()},b}(Jb),Xb=function(){function a(a,b){this.observer=a,this.parent=b}return a.prototype.run=function(){function a(a,b){try{var f=c.next();
+
+}catch(g){return d.onError(g)}if(f.done)return d.onCompleted();var h=f.value;if(e)try{h=e(h,a)}catch(g){return d.onError(g)}d.onNext(h),b(a+1)}var b=Object(this.parent.iterable),c=A(b),d=this.observer,e=this.parent.mapper;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}(),Yb=Math.pow(2,53)-1;v.prototype[qa]=function(){return new w(this._s)},w.prototype[qa]=function(){return this},w.prototype.next=function(){return this._i<this._l?{done:!1,value:this._s.charAt(this._i++)}:ra},x.prototype[qa]=function(){return new y(this._a)},y.prototype[qa]=function(){return this},y.prototype.next=function(){return this._i<this._l?{done:!1,value:this._a[this._i++]}:ra};var Zb=Ib.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!da(b))throw new Error("mapFn when provided must be a function");if(b)var e=va(b,c,2);return nb(d)||(d=rb),new Wb(a,e,d)},$b=function(a){function b(b,c){this.args=b,this.scheduler=c,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new D(a,this);return b.run()},b}(Jb);D.prototype.run=function(){function a(a,e){d>a?(b.onNext(c[a]),e(a+1)):b.onCompleted()}var b=this.observer,c=this.parent.args,d=c.length;return this.parent.scheduler.scheduleRecursiveWithState(0,a)};var _b=Ib.fromArray=function(a,b){return nb(b)||(b=rb),new $b(a,b)};Ib.generate=function(a,b,c,d,e){return nb(e)||(e=rb),new Bc(function(f){var g=!0;return e.scheduleRecursiveWithState(a,function(a,e){var h,i;try{g?g=!1:a=c(a),h=b(a),h&&(i=d(a))}catch(j){return f.onError(j)}h?(f.onNext(i),e(a)):f.onCompleted()})})};var ac=function(a){function b(){a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){return eb},b}(Jb),bc=Ib.never=function(){return new ac};Ib.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return new $b(b,rb)},Ib.ofWithScheduler=function(a){for(var b=arguments.length,c=new Array(b-1),d=1;b>d;d++)c[d-1]=arguments[d];return new $b(c,a)};var cc=function(a){function b(b,c){this.obj=b,this.keys=Object.keys(b),this.scheduler=c,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new F(a,this);return b.run()},b}(Jb);F.prototype.run=function(){function a(a,f){if(e>a){var g=d[a];b.onNext([g,c[g]]),f(a+1)}else b.onCompleted()}var b=this.observer,c=this.parent.obj,d=this.parent.keys,e=d.length;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},Ib.pairs=function(a,b){return b||(b=rb),new cc(a,b)};var dc=function(a){function b(b,c,d){this.start=b,this.rangeCount=c,this.scheduler=d,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new ec(a,this);return b.run()},b}(Jb),ec=function(){function a(a,b){this.observer=a,this.parent=b}return a.prototype.run=function(){function a(a,e){c>a?(d.onNext(b+a),e(a+1)):d.onCompleted()}var b=this.parent.start,c=this.parent.rangeCount,d=this.observer;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}();Ib.range=function(a,b,c){return nb(c)||(c=rb),new dc(a,b,c)};var fc=function(a){function b(b,c,d){this.value=b,this.repeatCount=null==c?-1:c,this.scheduler=d,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new G(a,this);return b.run()},b}(Jb);G.prototype.run=function(){function a(a,d){return(-1===a||a>0)&&(b.onNext(c),a>0&&a--),0===a?b.onCompleted():void d(a)}var b=this.observer,c=this.parent.value;return this.parent.scheduler.scheduleRecursiveWithState(this.parent.repeatCount,a)},Ib.repeat=function(a,b,c){return nb(c)||(c=rb),new fc(a,b,c)};var gc=function(a){function b(b,c){this.value=b,this.scheduler=c,a.call(this)}function c(a,b){this.observer=a,this.parent=b}function d(a,b){var c=b[0],d=b[1];d.onNext(c),d.onCompleted()}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this);return b.run()},c.prototype.run=function(){return this.parent.scheduler.scheduleWithState([this.parent.value,this.observer],d)},b}(Jb),hc=(Ib["return"]=Ib.just=Ib.returnValue=function(a,b){return nb(b)||(b=qb),new gc(a,b)},function(a){function b(b,c){this.error=b,this.scheduler=c,a.call(this)}function c(a,b){this.o=a,this.p=b}function d(a,b){var c=b[0],d=b[1];d.onError(c)}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this);return b.run()},c.prototype.run=function(){return this.p.scheduler.scheduleWithState([this.p.error,this.o],d)},b}(Jb)),ic=Ib["throw"]=Ib.throwError=Ib.throwException=function(a,b){return nb(b)||(b=qb),new hc(a,b)};Ib.using=function(a,b){return new Bc(function(c){var d,e,f=eb;try{d=a(),d&&(f=d),e=b(d)}catch(g){return new ab(ic(g).subscribe(c),f)}return new ab(e.subscribe(c),f)})},Cb.amb=function(a){var b=this;return new Bc(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new hb,j=new hb;return ca(a)&&(a=Sb(a)),i.setDisposable(b.subscribe(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()})),j.setDisposable(a.subscribe(function(a){e(),f===h&&c.onNext(a)},function(a){e(),f===h&&c.onError(a)},function(){e(),f===h&&c.onCompleted()})),new ab(i,j)})},Ib.amb=function(){function a(a,b){return a.amb(b)}var b=bc(),c=[];if(Array.isArray(arguments[0]))c=arguments[0];else for(var d=0,e=arguments.length;e>d;d++)c.push(arguments[d]);for(var d=0,e=c.length;e>d;d++)b=a(b,c[d]);return b},Cb["catch"]=Cb.catchError=Cb.catchException=function(a){return"function"==typeof a?H(this,a):jc([this,a])};var jc=Ib.catchError=Ib["catch"]=Ib.catchException=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return Qb(a).catchError()};Cb.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return Array.isArray(b[0])?b[0].unshift(this):b.unshift(this),kc.apply(this,b)};var kc=Ib.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.pop();return Array.isArray(b[0])&&(b=b[0]),new Bc(function(a){function c(b){if(h[b]=!0,i||(i=h.every(Z))){try{var c=d.apply(null,k)}catch(e){return a.onError(e)}a.onNext(c)}else j.filter(function(a,c){return c!==b}).every(Z)&&a.onCompleted()}function e(b){j[b]=!0,j.every(Z)&&a.onCompleted()}for(var f=b.length,g=function(){return!1},h=n(f,g),i=!1,j=n(f,g),k=new Array(f),l=new Array(f),m=0;f>m;m++)!function(d){var f=b[d],g=new hb;ca(f)&&(f=Sb(f)),g.setDisposable(f.subscribe(function(a){k[d]=a,c(d)},function(b){a.onError(b)},function(){e(d)})),l[d]=g}(m);return new ab(l)},this)};Cb.concat=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return a.unshift(this),mc.apply(null,a)};var lc=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b){this.sources=a,this.o=b}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new c(this.sources,a);return b.run()},c.prototype.run=function(){var a,b=new ib,c=this.sources,d=c.length,e=this.o,f=qb.scheduleRecursiveWithState(0,function(f,g){if(!a){if(f===d)return e.onCompleted();var h=c[f];ca(h)&&(h=Sb(h));var i=new hb;b.setDisposable(i),i.setDisposable(h.subscribe(function(a){e.onNext(a)},function(a){e.onError(a)},function(){g(f+1)}))}});return new ab(b,f,db(function(){a=!0}))},b}(Jb),mc=Ib.concat=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(arguments.length);for(var b=0,c=arguments.length;c>b;b++)a[b]=arguments[b]}return new lc(a)};Cb.concatAll=Cb.concatObservable=function(){return this.merge(1)};var nc=function(a){function b(b,c){this.source=b,this.maxConcurrent=c,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new ab;return b.add(this.source.subscribe(new oc(a,this.maxConcurrent,b))),b},b}(Jb),oc=function(){function a(a,b,c){this.o=a,this.max=b,this.g=c,this.done=!1,this.q=[],this.activeCount=0,this.isStopped=!1}function b(a,b){this.parent=a,this.sad=b,this.isStopped=!1}return a.prototype.handleSubscribe=function(a){var c=new hb;this.g.add(c),ca(a)&&(a=Sb(a)),c.setDisposable(a.subscribe(new b(this,c)))},a.prototype.onNext=function(a){this.isStopped||(this.activeCount<this.max?(this.activeCount++,this.handleSubscribe(a)):this.q.push(a))},a.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},a.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,0===this.activeCount&&this.o.onCompleted())},a.prototype.dispose=function(){this.isStopped=!0},a.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b.prototype.onNext=function(a){this.isStopped||this.parent.o.onNext(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.o.onError(a))},b.prototype.onCompleted=function(){if(!this.isStopped){this.isStopped=!0;var a=this.parent;a.g.remove(this.sad),a.q.length>0?a.handleSubscribe(a.q.shift()):(a.activeCount--,a.done&&0===a.activeCount&&a.o.onCompleted())}},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},a}();Cb.merge=function(a){return"number"!=typeof a?pc(this,a):new nc(this,a)};var pc=Ib.merge=function(){var a,b,c=[],d=arguments.length;if(arguments[0])if(nb(arguments[0]))for(a=arguments[0],b=1;d>b;b++)c.push(arguments[b]);else for(a=qb,b=0;d>b;b++)c.push(arguments[b]);else for(a=qb,b=1;d>b;b++)c.push(arguments[b]);return Array.isArray(c[0])&&(c=c[0]),E(a,c).mergeAll()},qc=X.CompositeError=function(a){this.name="NotImplementedError",this.innerErrors=a,this.message="This contains multiple errors. Check the innerErrors",Error.call(this)};qc.prototype=Error.prototype,Ib.mergeDelayError=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}var d=E(null,a);return new Bc(function(a){function b(){0===g.length?a.onCompleted():a.onError(1===g.length?g[0]:new qc(g))}var c=new ab,e=new hb,f=!1,g=[];return c.add(e),e.setDisposable(d.subscribe(function(d){var e=new hb;c.add(e),ca(d)&&(d=Sb(d)),e.setDisposable(d.subscribe(function(b){a.onNext(b)},function(a){g.push(a),c.remove(e),f&&1===c.length&&b()},function(){c.remove(e),f&&1===c.length&&b()}))},function(a){g.push(a),f=!0,1===c.length&&b()},function(){f=!0,1===c.length&&b()})),c})};var rc=function(a){function b(b){this.source=b,a.call(this)}function c(a,b){this.o=a,this.g=b,this.isStopped=!1,this.done=!1}function d(a,b,c){this.parent=a,this.g=b,this.sad=c,this.isStopped=!1}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new ab,d=new hb;return b.add(d),d.setDisposable(this.source.subscribe(new c(a,b))),b},c.prototype.onNext=function(a){if(!this.isStopped){var b=new hb;this.g.add(b),ca(a)&&(a=Sb(a)),b.setDisposable(a.subscribe(new d(this,this.g,b)))}},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,1===this.g.length&&this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},d.prototype.onNext=function(a){this.isStopped||this.parent.o.onNext(a)},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.o.onError(a))},d.prototype.onCompleted=function(){if(!this.isStopped){var a=this.parent;this.isStopped=!0,a.g.remove(this.sad),a.done&&1===a.g.length&&a.o.onCompleted()}},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},b}(Jb);Cb.mergeAll=Cb.mergeObservable=function(){return new rc(this)},Cb.onErrorResumeNext=function(a){if(!a)throw new Error("Second observable is required");return sc([this,a])};var sc=Ib.onErrorResumeNext=function(){var a=[];if(Array.isArray(arguments[0]))a=arguments[0];else for(var b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return new Bc(function(b){var c=0,d=new ib,e=qb.scheduleRecursive(function(e){var f,g;c<a.length?(f=a[c++],ca(f)&&(f=Sb(f)),g=new hb,d.setDisposable(g),g.setDisposable(f.subscribe(b.onNext.bind(b),e,e))):b.onCompleted()});return new ab(d,e)})};Cb.skipUntil=function(a){var b=this;return new Bc(function(c){var d=!1,e=new ab(b.subscribe(function(a){d&&c.onNext(a)},function(a){c.onError(a)},function(){d&&c.onCompleted()}));ca(a)&&(a=Sb(a));var f=new hb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},function(a){c.onError(a)},function(){f.dispose()})),e},b)};var tc=function(a){function b(b){this.source=b,a.call(this)}function c(a,b){this.o=a,this.inner=b,this.stopped=!1,this.latest=0,this.hasLatest=!1,this.isStopped=!1}function d(a,b){this.parent=a,this.id=b,this.isStopped=!1}return Wa(b,a),b.prototype.subscribeCore=function(a){var b=new ib,d=this.source.subscribe(new c(a,b));return new ab(d,b)},c.prototype.onNext=function(a){if(!this.isStopped){var b=new hb,c=++this.latest;this.hasLatest=!0,this.inner.setDisposable(b),ca(a)&&(a=Sb(a)),b.setDisposable(a.subscribe(new d(this,c)))}},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.stopped=!0,!this.hasLatest&&this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},d.prototype.onNext=function(a){this.isStopped||this.parent.latest===this.id&&this.parent.o.onNext(a)},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.latest===this.id&&this.parent.o.onError(a))},d.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.parent.latest===this.id&&(this.parent.hasLatest=!1,this.parent.isStopped&&this.parent.o.onCompleted()))},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},b}(Jb);Cb["switch"]=Cb.switchLatest=function(){return new tc(this)};var uc=function(a){function b(b,c){this.source=b,this.other=ca(c)?Sb(c):c,a.call(this)}function c(a){this.o=a,this.isStopped=!1}return Wa(b,a),b.prototype.subscribeCore=function(a){return new ab(this.source.subscribe(a),this.other.subscribe(new c(a)))},c.prototype.onNext=function(a){this.isStopped||this.o.onCompleted()},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){!this.isStopped&&(this.isStopped=!0)},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Jb);Cb.takeUntil=function(a){return new uc(this,a)},Cb.withLatestFrom=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.pop(),e=this;return Array.isArray(b[0])&&(b=b[0]),new Bc(function(a){for(var c=b.length,f=n(c,I),g=!1,h=new Array(c),i=new Array(c+1),j=0;c>j;j++)!function(c){var d=b[c],e=new hb;ca(d)&&(d=Sb(d)),e.setDisposable(d.subscribe(function(a){h[c]=a,f[c]=!0,g=f.every(Z)},function(b){a.onError(b)},Y)),i[c]=e}(j);var k=new hb;return k.setDisposable(e.subscribe(function(b){var c=[b].concat(h);if(g){var e=p(d).apply(null,c);return e===Za?a.onError(e.e):void a.onNext(e)}},function(b){a.onError(b)},function(){a.onCompleted()})),i[c]=k,new ab(i)},this)},Cb.zip=function(){if(Array.isArray(arguments[0]))return J.apply(this,arguments);for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=this,e=b.pop();return b.unshift(d),new Bc(function(a){for(var c=b.length,f=n(c,K),g=n(c,I),h=new Array(c),i=0;c>i;i++)!function(c){var i=b[c],j=new hb;ca(i)&&(i=Sb(i)),j.setDisposable(i.subscribe(function(b){if(f[c].push(b),f.every(function(a){return a.length>0})){var h=f.map(function(a){return a.shift()}),i=p(e).apply(d,h);if(i===Za)return a.onError(i.e);a.onNext(i)}else g.filter(function(a,b){return b!==c}).every(Z)&&a.onCompleted()},function(b){a.onError(b)},function(){g[c]=!0,g.every(Z)&&a.onCompleted()})),h[c]=j}(i);return new ab(h)},d)},Ib.zip=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.shift();return d.zip.apply(d,b)},Ib.zipArray=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new Bc(function(b){for(var c=a.length,d=n(c,L),e=n(c,I),f=new Array(c),g=0;c>g;g++)!function(c){f[c]=new hb,f[c].setDisposable(a[c].subscribe(function(a){if(d[c].push(a),d.every(function(a){return a.length>0})){var f=d.map(function(a){return a.shift()});b.onNext(f)}else if(e.filter(function(a,b){return b!==c}).every(Z))return b.onCompleted()},function(a){b.onError(a)},function(){e[c]=!0,e.every(Z)&&b.onCompleted()}))}(g);return new ab(f)})},Cb.asObservable=function(){var a=this;return new Bc(function(b){return a.subscribe(b)},a)},Cb.bufferWithCount=function(a,b){return"number"!=typeof b&&(b=a),this.windowWithCount(a,b).selectMany(function(a){return a.toArray()}).where(function(a){return a.length>0})},Cb.dematerialize=function(){var a=this;return new Bc(function(b){return a.subscribe(function(a){return a.accept(b)},function(a){b.onError(a)},function(){b.onCompleted()})},this)},Cb.distinctUntilChanged=function(a,b){var c=this;return b||(b=_),new Bc(function(d){var e,f=!1;return c.subscribe(function(c){var g=c;if(a&&(g=p(a)(c),g===Za))return d.onError(g.e);if(f){var h=p(b)(e,g);if(h===Za)return d.onError(h.e)}f&&h||(f=!0,e=g,d.onNext(c))},function(a){d.onError(a)},function(){d.onCompleted()})},this)};var vc=function(a){function b(b,c,d,e){this.source=b,this.t=!c||da(c)?Bb(c||Y,d||Y,e||Y):c,a.call(this)}function c(a,b){this.o=a,this.t=b,this.isStopped=!1}return Wa(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this.t))},c.prototype.onNext=function(a){if(!this.isStopped){var b=p(this.t.onNext).call(this.t,a);b===Za&&this.o.onError(b.e),this.o.onNext(a)}},c.prototype.onError=function(a){if(!this.isStopped){this.isStopped=!0;var b=p(this.t.onError).call(this.t,a);if(b===Za)return this.o.onError(b.e);this.o.onError(a)}},c.prototype.onCompleted=function(){if(!this.isStopped){this.isStopped=!0;var a=p(this.t.onCompleted).call(this.t);if(a===Za)return this.o.onError(a.e);this.o.onCompleted()}},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Jb);Cb["do"]=Cb.tap=Cb.doAction=function(a,b,c){return new vc(this,a,b,c)},Cb.doOnNext=Cb.tapOnNext=function(a,b){return this.tap("undefined"!=typeof b?function(c){a.call(b,c)}:a)},Cb.doOnError=Cb.tapOnError=function(a,b){return this.tap(Y,"undefined"!=typeof b?function(c){a.call(b,c)}:a)},Cb.doOnCompleted=Cb.tapOnCompleted=function(a,b){return this.tap(Y,null,"undefined"!=typeof b?function(){a.call(b)}:a)},Cb["finally"]=Cb.ensure=function(a){var b=this;return new Bc(function(c){var d;try{d=b.subscribe(c)}catch(e){throw a(),e}return db(function(){try{d.dispose()}catch(b){throw b}finally{a()}})},this)},Cb.finallyAction=function(a){return this.ensure(a)};var wc=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.isStopped=!1}return Wa(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a))},c.prototype.onNext=Y,c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},b}(Jb);Cb.ignoreElements=function(){return new wc(this)},Cb.materialize=function(){var a=this;return new Bc(function(b){return a.subscribe(function(a){b.onNext(xb(a))},function(a){b.onNext(yb(a)),b.onCompleted()},function(){b.onNext(zb()),b.onCompleted()})},a)},Cb.repeat=function(a){return Ob(this,a).concat()},Cb.retry=function(a){return Ob(this,a).catchError()},Cb.retryWhen=function(a){return Ob(this).catchErrorWhen(a)};var xc=function(a){function b(b,c,d,e){this.source=b,this.accumulator=c,this.hasSeed=d,this.seed=e,a.call(this)}return Wa(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new M(a,this))},b}(Jb);M.prototype.onNext=function(a){if(!this.isStopped){!this.hasValue&&(this.hasValue=!0);try{this.hasAccumulation?this.accumulation=this.accumulator(this.accumulation,a):(this.accumulation=this.hasSeed?this.accumulator(this.seed,a):a,this.hasAccumulation=!0)}catch(b){return this.observer.onError(b)}this.observer.onNext(this.accumulation)}},M.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.observer.onError(a))},M.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,!this.hasValue&&this.hasSeed&&this.observer.onNext(this.seed),this.observer.onCompleted())},M.prototype.dispose=function(){this.isStopped=!0},M.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},Cb.scan=function(){var a,b,c=!1;return 2===arguments.length?(c=!0,a=arguments[0],b=arguments[1]):b=arguments[0],new xc(this,b,c,a)},Cb.skipLast=function(a){if(0>a)throw new la;var b=this;return new Bc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},function(a){c.onError(a)},function(){c.onCompleted()})},b)},Cb.startWith=function(){var a,b=0;arguments.length&&nb(arguments[0])?(a=arguments[0],b=1):a=qb;for(var c=[],d=b,e=arguments.length;e>d;d++)c.push(arguments[d]);return Qb([_b(c,a),this]).concat()},Cb.takeLast=function(a){if(0>a)throw new la;var b=this;return new Bc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},function(a){c.onError(a)},function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})},b)},Cb.takeLastBuffer=function(a){var b=this;return new Bc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},function(a){c.onError(a)},function(){c.onNext(d),c.onCompleted()})},b)},Cb.windowWithCount=function(a,b){var c=this;if(+a||(a=0),Math.abs(a)===1/0&&(a=0),0>=a)throw new la;if(null==b&&(b=a),+b||(b=0),Math.abs(b)===1/0&&(b=0),0>=b)throw new la;return new Bc(function(d){function e(){var a=new Ec;i.push(a),d.onNext(Ya(a,g))}var f=new hb,g=new jb(f),h=0,i=[];return e(),f.setDisposable(c.subscribe(function(c){for(var d=0,f=i.length;f>d;d++)i[d].onNext(c);var g=h-a+1;g>=0&&g%b===0&&i.shift().onCompleted(),++h%b===0&&e()},function(a){for(;i.length>0;)i.shift().onError(a);d.onError(a)},function(){for(;i.length>0;)i.shift().onCompleted();d.onCompleted()})),g},c)},Cb.selectConcat=Cb.concatMap=function(a,b,c){return da(a)&&da(b)?this.concatMap(function(c,d){var e=a(c,d);return ca(e)&&(e=Sb(e)),(ta(e)||sa(e))&&(e=Zb(e)),e.map(function(a,e){return b(c,a,d,e)})}):da(a)?N(this,a,c):N(this,function(){return a})},Cb.concatMapObserver=Cb.selectConcatObserver=function(a,b,c,d){var e=this,f=va(a,d,2),g=va(b,d,1),h=va(c,d,0);return new Bc(function(a){var b=0;return e.subscribe(function(c){var d;try{d=f(c,b++)}catch(e){return void a.onError(e)}ca(d)&&(d=Sb(d)),a.onNext(d)},function(b){var c;try{c=g(b)}catch(d){return void a.onError(d)}ca(c)&&(c=Sb(c)),a.onNext(c),a.onCompleted()},function(){var b;try{b=h()}catch(c){return void a.onError(c)}ca(b)&&(b=Sb(b)),a.onNext(b),a.onCompleted()})},this).concatAll()},Cb.defaultIfEmpty=function(b){var c=this;return b===a&&(b=null),new Bc(function(a){var d=!1;return c.subscribe(function(b){d=!0,a.onNext(b)},function(b){a.onError(b)},function(){!d&&a.onNext(b),a.onCompleted()})},c)},P.prototype.push=function(a){var b=-1===O(this.set,a,this.comparer);return b&&this.set.push(a),b},Cb.distinct=function(a,b){var c=this;return b||(b=_),new Bc(function(d){var e=new P(b);return c.subscribe(function(b){var c=b;if(a)try{c=a(b)}catch(f){return void d.onError(f)}e.push(c)&&d.onNext(b)},function(a){d.onError(a)},function(){d.onCompleted()})},this)};var yc=function(a){function b(b,c,d){this.source=b,this.selector=va(c,d,3),a.call(this)}function c(a,b){return function(c,d,e){return a.call(this,b.selector(c,d,e),d,e)}}function d(a,b,c){this.o=a,this.selector=b,this.source=c,this.i=0,this.isStopped=!1}return Wa(b,a),b.prototype.internalMap=function(a,d){return new b(this.source,c(a,this),d)},b.prototype.subscribeCore=function(a){return this.source.subscribe(new d(a,this.selector,this))},d.prototype.onNext=function(a){if(!this.isStopped){var b=p(this.selector)(a,this.i++,this.source);return b===Za?this.o.onError(b.e):void this.o.onNext(b)}},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},d.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Jb);Cb.map=Cb.select=function(a,b){var c="function"==typeof a?a:function(){return a};return this instanceof yc?this.internalMap(c,b):new yc(this,c,b)},Cb.pluck=function(){var b=arguments,c=arguments.length;if(0===c)throw new Error("List of properties cannot be empty.");return this.map(function(d){for(var e=d,f=0;c>f;f++){var g=e[b[f]];if("undefined"==typeof g)return a;e=g}return e})},Cb.flatMapObserver=Cb.selectManyObserver=function(a,b,c,d){var e=this;return new Bc(function(f){var g=0;return e.subscribe(function(b){var c;try{c=a.call(d,b,g++)}catch(e){return void f.onError(e)}ca(c)&&(c=Sb(c)),f.onNext(c)},function(a){var c;try{c=b.call(d,a)}catch(e){return void f.onError(e)}ca(c)&&(c=Sb(c)),f.onNext(c),f.onCompleted()},function(){var a;try{a=c.call(d)}catch(b){return void f.onError(b)}ca(a)&&(a=Sb(a)),f.onNext(a),f.onCompleted()})},e).mergeAll()},Cb.selectMany=Cb.flatMap=function(a,b,c){return da(a)&&da(b)?this.flatMap(function(c,d){var e=a(c,d);return ca(e)&&(e=Sb(e)),(ta(e)||sa(e))&&(e=Zb(e)),e.map(function(a,e){return b(c,a,d,e)})},c):da(a)?Q(this,a,c):Q(this,function(){return a})},Cb.selectSwitch=Cb.flatMapLatest=Cb.switchMap=function(a,b){return this.select(a,b).switchLatest()};var zc=function(a){function b(b,c){this.source=b,this.skipCount=c,a.call(this)}function c(a,b){this.c=b,this.r=b,this.o=a,this.isStopped=!1}return Wa(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this.skipCount))},c.prototype.onNext=function(a){this.isStopped||(this.r<=0?this.o.onNext(a):this.r--)},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Jb);Cb.skip=function(a){if(0>a)throw new la;return new zc(this,a)},Cb.skipWhile=function(a,b){var c=this,d=va(a,b,3);return new Bc(function(a){var b=0,e=!1;return c.subscribe(function(f){if(!e)try{e=!d(f,b++,c)}catch(g){return void a.onError(g)}e&&a.onNext(f)},function(b){a.onError(b)},function(){a.onCompleted()})},c)},Cb.take=function(a,b){if(0>a)throw new la;if(0===a)return Vb(b);var c=this;return new Bc(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0>=d&&b.onCompleted())},function(a){b.onError(a)},function(){b.onCompleted()})},c)},Cb.takeWhile=function(a,b){var c=this,d=va(a,b,3);return new Bc(function(a){var b=0,e=!0;return c.subscribe(function(f){if(e){try{e=d(f,b++,c)}catch(g){return void a.onError(g)}e?a.onNext(f):a.onCompleted()}},function(b){a.onError(b)},function(){a.onCompleted()})},c)};var Ac=function(a){function b(b,c,d){this.source=b,this.predicate=va(c,d,3),a.call(this)}function c(a,b){return function(c,d,e){return b.predicate(c,d,e)&&a.call(this,c,d,e)}}function d(a,b,c){this.o=a,this.predicate=b,this.source=c,this.i=0,this.isStopped=!1}return Wa(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new d(a,this.predicate,this))},b.prototype.internalFilter=function(a,d){return new b(this.source,c(a,this),d)},d.prototype.onNext=function(a){if(!this.isStopped){var b=p(this.predicate)(a,this.i++,this.source);return b===Za?this.o.onError(b.e):void(b&&this.o.onNext(a))}},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},d.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Jb);Cb.filter=Cb.where=function(a,b){return this instanceof Ac?this.internalFilter(a,b):new Ac(this,a,b)},Cb.transduce=function(a){function b(a){return{"@@transducer/init":function(){return a},"@@transducer/step":function(a,b){return a.onNext(b)},"@@transducer/result":function(a){return a.onCompleted()}}}var c=this;return new Bc(function(d){var e=a(b(d));return c.subscribe(function(a){try{e["@@transducer/step"](d,a)}catch(b){d.onError(b)}},function(a){d.onError(a)},function(){e["@@transducer/result"](d)})},c)};var Bc=X.AnonymousObservable=function(a){function b(a){return a&&da(a.dispose)?a:da(a)?db(a):eb}function c(a,c){var d=c[0],e=c[1],f=p(e)(d);return f!==Za||d.fail(Za.e)?void d.setDisposable(b(f)):q(Za.e)}function d(b,d){function e(a){var d=new Cc(a),e=[d,b];return rb.scheduleRequired()?rb.scheduleWithState(e,c):c(null,e),d}this.source=d,a.call(this,e)}return Wa(d,a),d}(Ib),Cc=function(a){function b(b){a.call(this),this.observer=b,this.m=new hb}Wa(b,a);var c=b.prototype;return c.next=function(a){var b=p(this.observer.onNext).call(this.observer,a);b===Za&&(this.dispose(),q(b.e))},c.error=function(a){var b=p(this.observer.onError).call(this.observer,a);this.dispose(),b===Za&&q(b.e)},c.completed=function(){var a=p(this.observer.onCompleted).call(this.observer);this.dispose(),a===Za&&q(a.e)},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(Db),Dc=function(a,b){this.subject=a,this.observer=b};Dc.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var Ec=X.Subject=function(a){function c(a){return gb(this),this.isStopped?this.hasError?(a.onError(this.error),eb):(a.onCompleted(),eb):(this.observers.push(a),new Dc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return Wa(d,a),Xa(d.prototype,Ab.prototype,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(gb(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=b(this.observers),d=c.length;d>a;a++)c[a].onCompleted();this.observers.length=0}},onError:function(a){if(gb(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){if(gb(this),!this.isStopped)for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new Fc(a,b)},d}(Ib),Fc=(X.AsyncSubject=function(a){function c(a){return gb(this),this.isStopped?(this.hasError?a.onError(this.error):this.hasValue?(a.onNext(this.value),a.onCompleted()):a.onCompleted(),eb):(this.observers.push(a),new Dc(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.hasValue=!1,this.observers=[],this.hasError=!1}return Wa(d,a),Xa(d.prototype,Ab,{hasObservers:function(){return gb(this),this.observers.length>0},onCompleted:function(){var a,c;if(gb(this),!this.isStopped){this.isStopped=!0;var d=b(this.observers),c=d.length;if(this.hasValue)for(a=0;c>a;a++){var e=d[a];e.onNext(this.value),e.onCompleted()}else for(a=0;c>a;a++)d[a].onCompleted();this.observers.length=0}},onError:function(a){if(gb(this),!this.isStopped){
+this.isStopped=!0,this.hasError=!0,this.error=a;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){gb(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(Ib),X.AnonymousSubject=function(a){function b(a){return this.observable.subscribe(a)}function c(c,d){this.observer=c,this.observable=d,a.call(this,b)}return Wa(c,a),Xa(c.prototype,Ab.prototype,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(Ib));"function"==typeof define&&"object"==typeof define.amd&&define.amd?(S.Rx=X,define(function(){return X})):T&&U?V?(U.exports=X).Rx=X:T.Rx=X:S.Rx=X;var Gc=g()}).call(this);
+//# sourceMappingURL=rx.map \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.sorting.js b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.sorting.js
new file mode 100644
index 00000000000..4b19f062cae
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.sorting.js
@@ -0,0 +1,72 @@
+// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
+
+;(function (factory) {
+ var objectTypes = {
+ 'boolean': false,
+ 'function': true,
+ 'object': true,
+ 'number': false,
+ 'string': false,
+ 'undefined': false
+ };
+
+ var root = (objectTypes[typeof window] && window) || this,
+ freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
+ freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
+ moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
+ freeGlobal = objectTypes[typeof global] && global;
+
+ if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) {
+ root = freeGlobal;
+ }
+
+ // Because of build optimizers
+ if (typeof define === 'function' && define.amd) {
+ define(['rx'], function (Rx, exports) {
+ return factory(root, exports, Rx);
+ });
+ } else if (typeof module === 'object' && module && module.exports === freeExports) {
+ module.exports = factory(root, module.exports, require('./rx'));
+ } else {
+ root.Rx = factory(root, {}, root.Rx);
+ }
+}.call(this, function (root, exp, Rx, undefined) {
+
+ var Observable = Rx.Observable,
+ observableProto = Observable.prototype,
+ AnonymousObservable = Rx.AnonymousObservable,
+ observableNever = Observable.never,
+ isEqual = Rx.internals.isEqual,
+ defaultSubComparer = Rx.helpers.defaultSubComparer;
+
+ /**
+ * jortSort checks if your inputs are sorted. Note that this is only for a sequence with an end.
+ * See http://jort.technology/ for full details.
+ * @returns {Observable} An observable which has a single value of true if sorted, else false.
+ */
+ observableProto.jortSort = function () {
+ return this.jortSortUntil(observableNever());
+ };
+
+ /**
+ * jortSort checks if your inputs are sorted until another Observable sequence fires.
+ * See http://jort.technology/ for full details.
+ * @returns {Observable} An observable which has a single value of true if sorted, else false.
+ */
+ observableProto.jortSortUntil = function (other) {
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ var arr = [];
+ return source.takeUntil(other).subscribe(
+ arr.push.bind(arr),
+ observer.onError.bind(observer),
+ function () {
+ var sorted = arr.slice(0).sort(defaultSubComparer);
+ observer.onNext(isEqual(arr, sorted));
+ observer.onCompleted();
+ });
+ }, source);
+ };
+
+ return Rx;
+}));
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.sorting.map b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.sorting.map
new file mode 100644
index 00000000000..011eb846f68
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.sorting.map
@@ -0,0 +1 @@
+{"version":3,"file":"rx.sorting.min.js","sources":["rx.sorting.js"],"names":["factory","objectTypes","boolean","function","object","number","string","undefined","root","window","this","freeExports","exports","nodeType","freeModule","module","freeGlobal","global","define","amd","Rx","require","call","exp","Observable","observableProto","prototype","AnonymousObservable","observableNever","never","isEqual","internals","defaultSubComparer","helpers","jortSort","jortSortUntil","other","source","observer","arr","takeUntil","subscribe","push","bind","onError","sorted","slice","sort","onNext","onCompleted"],"mappings":";CAEE,SAAUA,GACR,GAAIC,IACAC,WAAW,EACXC,YAAY,EACZC,QAAU,EACVC,QAAU,EACVC,QAAU,EACVC,WAAa,GAGbC,EAAQP,QAAmBQ,UAAWA,QAAWC,KACjDC,EAAcV,QAAmBW,WAAYA,UAAYA,QAAQC,UAAYD,QAC7EE,EAAab,QAAmBc,UAAWA,SAAWA,OAAOF,UAAYE,OAEzEC,GADgBF,GAAcA,EAAWF,UAAYD,GAAeA,EACvDV,QAAmBgB,UAAWA,SAE3CD,GAAeA,EAAWC,SAAWD,GAAcA,EAAWP,SAAWO,IACzER,EAAOQ,GAIW,kBAAXE,SAAyBA,OAAOC,IACvCD,QAAQ,MAAO,SAAUE,EAAIR,GACzB,MAAOZ,GAAQQ,EAAMI,EAASQ,KAET,gBAAXL,SAAuBA,QAAUA,OAAOH,UAAYD,EAClEI,OAAOH,QAAUZ,EAAQQ,EAAMO,OAAOH,QAASS,QAAQ,SAEvDb,EAAKY,GAAKpB,EAAQQ,KAAUA,EAAKY,MAEvCE,KAAKZ,KAAM,SAAUF,EAAMe,EAAKH,EAAIb,GAEpC,GAAIiB,GAAaJ,EAAGI,WAClBC,EAAkBD,EAAWE,UAC7BC,EAAsBP,EAAGO,oBACzBC,EAAkBJ,EAAWK,MAC7BC,EAAUV,EAAGW,UAAUD,QACvBE,EAAqBZ,EAAGa,QAAQD,kBA+BhC,OAxBFP,GAAgBS,SAAW,WACzB,MAAOxB,MAAKyB,cAAcP,MAQ5BH,EAAgBU,cAAgB,SAAUC,GACxC,GAAIC,GAAS3B,IACb,OAAO,IAAIiB,GAAoB,SAAUW,GACvC,GAAIC,KACJ,OAAOF,GAAOG,UAAUJ,GAAOK,UAC7BF,EAAIG,KAAKC,KAAKJ,GACdD,EAASM,QAAQD,KAAKL,GACtB,WACE,GAAIO,GAASN,EAAIO,MAAM,GAAGC,KAAKf,EAC/BM,GAASU,OAAOlB,EAAQS,EAAKM,IAC7BP,EAASW,iBAEZZ,IAGIjB"} \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.sorting.min.js b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.sorting.min.js
new file mode 100644
index 00000000000..ce0798b1a13
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.sorting.min.js
@@ -0,0 +1,3 @@
+/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
+(function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx"],function(b,d){return a(c,d,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){var e=c.Observable,f=e.prototype,g=c.AnonymousObservable,h=e.never,i=c.internals.isEqual,j=c.helpers.defaultSubComparer;return f.jortSort=function(){return this.jortSortUntil(h())},f.jortSortUntil=function(a){var b=this;return new g(function(c){var d=[];return b.takeUntil(a).subscribe(d.push.bind(d),c.onError.bind(c),function(){var a=d.slice(0).sort(j);c.onNext(i(d,a)),c.onCompleted()})},b)},c});
+//# sourceMappingURL=rx.sorting.map \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.testing.js b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.testing.js
new file mode 100644
index 00000000000..1d26cab9ef6
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.testing.js
@@ -0,0 +1,530 @@
+// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
+
+;(function (factory) {
+ var objectTypes = {
+ 'boolean': false,
+ 'function': true,
+ 'object': true,
+ 'number': false,
+ 'string': false,
+ 'undefined': false
+ };
+
+ var root = (objectTypes[typeof window] && window) || this,
+ freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
+ freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
+ moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
+ freeGlobal = objectTypes[typeof global] && global;
+
+ if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) {
+ root = freeGlobal;
+ }
+
+ // Because of build optimizers
+ if (typeof define === 'function' && define.amd) {
+ define(['rx.virtualtime', 'exports'], function (Rx, exports) {
+ root.Rx = factory(root, exports, Rx);
+ return root.Rx;
+ });
+ } else if (typeof module === 'object' && module && module.exports === freeExports) {
+ module.exports = factory(root, module.exports, require('./rx'));
+ } else {
+ root.Rx = factory(root, {}, root.Rx);
+ }
+}.call(this, function (root, exp, Rx, undefined) {
+
+ // Defaults
+ var Observer = Rx.Observer,
+ Observable = Rx.Observable,
+ Notification = Rx.Notification,
+ VirtualTimeScheduler = Rx.VirtualTimeScheduler,
+ Disposable = Rx.Disposable,
+ disposableEmpty = Disposable.empty,
+ disposableCreate = Disposable.create,
+ CompositeDisposable = Rx.CompositeDisposable,
+ SingleAssignmentDisposable = Rx.SingleAssignmentDisposable,
+ inherits = Rx.internals.inherits,
+ defaultComparer = Rx.internals.isEqual;
+
+function OnNextPredicate(predicate) {
+ this.predicate = predicate;
+};
+
+OnNextPredicate.prototype.equals = function (other) {
+ if (other === this) { return true; }
+ if (other == null) { return false; }
+ if (other.kind !== 'N') { return false; }
+ return this.predicate(other.value);
+};
+
+function OnErrorPredicate(predicate) {
+ this.predicate = predicate;
+};
+
+OnErrorPredicate.prototype.equals = function (other) {
+ if (other === this) { return true; }
+ if (other == null) { return false; }
+ if (other.kind !== 'E') { return false; }
+ return this.predicate(other.exception);
+};
+
+var ReactiveTest = Rx.ReactiveTest = {
+ /** Default virtual time used for creation of observable sequences in unit tests. */
+ created: 100,
+ /** Default virtual time used to subscribe to observable sequences in unit tests. */
+ subscribed: 200,
+ /** Default virtual time used to dispose subscriptions in unit tests. */
+ disposed: 1000,
+
+ /**
+ * Factory method for an OnNext notification record at a given time with a given value or a predicate function.
+ *
+ * 1 - ReactiveTest.onNext(200, 42);
+ * 2 - ReactiveTest.onNext(200, function (x) { return x.length == 2; });
+ *
+ * @param ticks Recorded virtual time the OnNext notification occurs.
+ * @param value Recorded value stored in the OnNext notification or a predicate.
+ * @return Recorded OnNext notification.
+ */
+ onNext: function (ticks, value) {
+ return typeof value === 'function' ?
+ new Recorded(ticks, new OnNextPredicate(value)) :
+ new Recorded(ticks, Notification.createOnNext(value));
+ },
+ /**
+ * Factory method for an OnError notification record at a given time with a given error.
+ *
+ * 1 - ReactiveTest.onNext(200, new Error('error'));
+ * 2 - ReactiveTest.onNext(200, function (e) { return e.message === 'error'; });
+ *
+ * @param ticks Recorded virtual time the OnError notification occurs.
+ * @param exception Recorded exception stored in the OnError notification.
+ * @return Recorded OnError notification.
+ */
+ onError: function (ticks, error) {
+ return typeof error === 'function' ?
+ new Recorded(ticks, new OnErrorPredicate(error)) :
+ new Recorded(ticks, Notification.createOnError(error));
+ },
+ /**
+ * Factory method for an OnCompleted notification record at a given time.
+ *
+ * @param ticks Recorded virtual time the OnCompleted notification occurs.
+ * @return Recorded OnCompleted notification.
+ */
+ onCompleted: function (ticks) {
+ return new Recorded(ticks, Notification.createOnCompleted());
+ },
+ /**
+ * Factory method for a subscription record based on a given subscription and disposal time.
+ *
+ * @param start Virtual time indicating when the subscription was created.
+ * @param end Virtual time indicating when the subscription was disposed.
+ * @return Subscription object.
+ */
+ subscribe: function (start, end) {
+ return new Subscription(start, end);
+ }
+};
+
+ /**
+ * Creates a new object recording the production of the specified value at the given virtual time.
+ *
+ * @constructor
+ * @param {Number} time Virtual time the value was produced on.
+ * @param {Mixed} value Value that was produced.
+ * @param {Function} comparer An optional comparer.
+ */
+ var Recorded = Rx.Recorded = function (time, value, comparer) {
+ this.time = time;
+ this.value = value;
+ this.comparer = comparer || defaultComparer;
+ };
+
+ /**
+ * Checks whether the given recorded object is equal to the current instance.
+ *
+ * @param {Recorded} other Recorded object to check for equality.
+ * @returns {Boolean} true if both objects are equal; false otherwise.
+ */
+ Recorded.prototype.equals = function (other) {
+ return this.time === other.time && this.comparer(this.value, other.value);
+ };
+
+ /**
+ * Returns a string representation of the current Recorded value.
+ *
+ * @returns {String} String representation of the current Recorded value.
+ */
+ Recorded.prototype.toString = function () {
+ return this.value.toString() + '@' + this.time;
+ };
+
+ /**
+ * Creates a new subscription object with the given virtual subscription and unsubscription time.
+ *
+ * @constructor
+ * @param {Number} subscribe Virtual time at which the subscription occurred.
+ * @param {Number} unsubscribe Virtual time at which the unsubscription occurred.
+ */
+ var Subscription = Rx.Subscription = function (start, end) {
+ this.subscribe = start;
+ this.unsubscribe = end || Number.MAX_VALUE;
+ };
+
+ /**
+ * Checks whether the given subscription is equal to the current instance.
+ * @param other Subscription object to check for equality.
+ * @returns {Boolean} true if both objects are equal; false otherwise.
+ */
+ Subscription.prototype.equals = function (other) {
+ return this.subscribe === other.subscribe && this.unsubscribe === other.unsubscribe;
+ };
+
+ /**
+ * Returns a string representation of the current Subscription value.
+ * @returns {String} String representation of the current Subscription value.
+ */
+ Subscription.prototype.toString = function () {
+ return '(' + this.subscribe + ', ' + (this.unsubscribe === Number.MAX_VALUE ? 'Infinite' : this.unsubscribe) + ')';
+ };
+
+ var MockDisposable = Rx.MockDisposable = function (scheduler) {
+ this.scheduler = scheduler;
+ this.disposes = [];
+ this.disposes.push(this.scheduler.clock);
+ };
+
+ MockDisposable.prototype.dispose = function () {
+ this.disposes.push(this.scheduler.clock);
+ };
+
+ var MockObserver = (function (__super__) {
+ inherits(MockObserver, __super__);
+
+ function MockObserver(scheduler) {
+ __super__.call(this);
+ this.scheduler = scheduler;
+ this.messages = [];
+ }
+
+ var MockObserverPrototype = MockObserver.prototype;
+
+ MockObserverPrototype.onNext = function (value) {
+ this.messages.push(new Recorded(this.scheduler.clock, Notification.createOnNext(value)));
+ };
+
+ MockObserverPrototype.onError = function (exception) {
+ this.messages.push(new Recorded(this.scheduler.clock, Notification.createOnError(exception)));
+ };
+
+ MockObserverPrototype.onCompleted = function () {
+ this.messages.push(new Recorded(this.scheduler.clock, Notification.createOnCompleted()));
+ };
+
+ return MockObserver;
+ })(Observer);
+
+ function MockPromise(scheduler, messages) {
+ var self = this;
+ this.scheduler = scheduler;
+ this.messages = messages;
+ this.subscriptions = [];
+ this.observers = [];
+ for (var i = 0, len = this.messages.length; i < len; i++) {
+ var message = this.messages[i],
+ notification = message.value;
+ (function (innerNotification) {
+ scheduler.scheduleAbsoluteWithState(null, message.time, function () {
+ var obs = self.observers.slice(0);
+
+ for (var j = 0, jLen = obs.length; j < jLen; j++) {
+ innerNotification.accept(obs[j]);
+ }
+ return disposableEmpty;
+ });
+ })(notification);
+ }
+ }
+
+ MockPromise.prototype.then = function (onResolved, onRejected) {
+ var self = this;
+
+ this.subscriptions.push(new Subscription(this.scheduler.clock));
+ var index = this.subscriptions.length - 1;
+
+ var newPromise;
+
+ var observer = Rx.Observer.create(
+ function (x) {
+ var retValue = onResolved(x);
+ if (retValue && typeof retValue.then === 'function') {
+ newPromise = retValue;
+ } else {
+ var ticks = self.scheduler.clock;
+ newPromise = new MockPromise(self.scheduler, [Rx.ReactiveTest.onNext(ticks, undefined), Rx.ReactiveTest.onCompleted(ticks)]);
+ }
+ var idx = self.observers.indexOf(observer);
+ self.observers.splice(idx, 1);
+ self.subscriptions[index] = new Subscription(self.subscriptions[index].subscribe, self.scheduler.clock);
+ },
+ function (err) {
+ onRejected(err);
+ var idx = self.observers.indexOf(observer);
+ self.observers.splice(idx, 1);
+ self.subscriptions[index] = new Subscription(self.subscriptions[index].subscribe, self.scheduler.clock);
+ }
+ );
+ this.observers.push(observer);
+
+ return newPromise || new MockPromise(this.scheduler, this.messages);
+ };
+
+ var HotObservable = (function (__super__) {
+
+ function subscribe(observer) {
+ var observable = this;
+ this.observers.push(observer);
+ this.subscriptions.push(new Subscription(this.scheduler.clock));
+ var index = this.subscriptions.length - 1;
+ return disposableCreate(function () {
+ var idx = observable.observers.indexOf(observer);
+ observable.observers.splice(idx, 1);
+ observable.subscriptions[index] = new Subscription(observable.subscriptions[index].subscribe, observable.scheduler.clock);
+ });
+ }
+
+ inherits(HotObservable, __super__);
+
+ function HotObservable(scheduler, messages) {
+ __super__.call(this, subscribe);
+ var message, notification, observable = this;
+ this.scheduler = scheduler;
+ this.messages = messages;
+ this.subscriptions = [];
+ this.observers = [];
+ for (var i = 0, len = this.messages.length; i < len; i++) {
+ message = this.messages[i];
+ notification = message.value;
+ (function (innerNotification) {
+ scheduler.scheduleAbsoluteWithState(null, message.time, function () {
+ var obs = observable.observers.slice(0);
+
+ for (var j = 0, jLen = obs.length; j < jLen; j++) {
+ innerNotification.accept(obs[j]);
+ }
+ return disposableEmpty;
+ });
+ })(notification);
+ }
+ }
+
+ return HotObservable;
+ })(Observable);
+
+ var ColdObservable = (function (__super__) {
+
+ function subscribe(observer) {
+ var message, notification, observable = this;
+ this.subscriptions.push(new Subscription(this.scheduler.clock));
+ var index = this.subscriptions.length - 1;
+ var d = new CompositeDisposable();
+ for (var i = 0, len = this.messages.length; i < len; i++) {
+ message = this.messages[i];
+ notification = message.value;
+ (function (innerNotification) {
+ d.add(observable.scheduler.scheduleRelativeWithState(null, message.time, function () {
+ innerNotification.accept(observer);
+ return disposableEmpty;
+ }));
+ })(notification);
+ }
+ return disposableCreate(function () {
+ observable.subscriptions[index] = new Subscription(observable.subscriptions[index].subscribe, observable.scheduler.clock);
+ d.dispose();
+ });
+ }
+
+ inherits(ColdObservable, __super__);
+
+ function ColdObservable(scheduler, messages) {
+ __super__.call(this, subscribe);
+ this.scheduler = scheduler;
+ this.messages = messages;
+ this.subscriptions = [];
+ }
+
+ return ColdObservable;
+ })(Observable);
+
+ /** Virtual time scheduler used for testing applications and libraries built using Reactive Extensions. */
+ Rx.TestScheduler = (function (__super__) {
+ inherits(TestScheduler, __super__);
+
+ function baseComparer(x, y) {
+ return x > y ? 1 : (x < y ? -1 : 0);
+ }
+
+ function TestScheduler() {
+ __super__.call(this, 0, baseComparer);
+ }
+
+ /**
+ * Schedules an action to be executed at the specified virtual time.
+ *
+ * @param state State passed to the action to be executed.
+ * @param dueTime Absolute virtual time at which to execute the action.
+ * @param action Action to be executed.
+ * @return Disposable object used to cancel the scheduled action (best effort).
+ */
+ TestScheduler.prototype.scheduleAbsoluteWithState = function (state, dueTime, action) {
+ dueTime <= this.clock && (dueTime = this.clock + 1);
+ return __super__.prototype.scheduleAbsoluteWithState.call(this, state, dueTime, action);
+ };
+ /**
+ * Adds a relative virtual time to an absolute virtual time value.
+ *
+ * @param absolute Absolute virtual time value.
+ * @param relative Relative virtual time value to add.
+ * @return Resulting absolute virtual time sum value.
+ */
+ TestScheduler.prototype.add = function (absolute, relative) {
+ return absolute + relative;
+ };
+ /**
+ * Converts the absolute virtual time value to a DateTimeOffset value.
+ *
+ * @param absolute Absolute virtual time value to convert.
+ * @return Corresponding DateTimeOffset value.
+ */
+ TestScheduler.prototype.toDateTimeOffset = function (absolute) {
+ return new Date(absolute).getTime();
+ };
+ /**
+ * Converts the TimeSpan value to a relative virtual time value.
+ *
+ * @param timeSpan TimeSpan value to convert.
+ * @return Corresponding relative virtual time value.
+ */
+ TestScheduler.prototype.toRelative = function (timeSpan) {
+ return timeSpan;
+ };
+ /**
+ * Starts the test scheduler and uses the specified virtual times to invoke the factory function, subscribe to the resulting sequence, and dispose the subscription.
+ *
+ * @param create Factory method to create an observable sequence.
+ * @param created Virtual time at which to invoke the factory to create an observable sequence.
+ * @param subscribed Virtual time at which to subscribe to the created observable sequence.
+ * @param disposed Virtual time at which to dispose the subscription.
+ * @return Observer with timestamped recordings of notification messages that were received during the virtual time window when the subscription to the source sequence was active.
+ */
+ TestScheduler.prototype.startWithTiming = function (create, created, subscribed, disposed) {
+ var observer = this.createObserver(), source, subscription;
+
+ this.scheduleAbsoluteWithState(null, created, function () {
+ source = create();
+ return disposableEmpty;
+ });
+
+ this.scheduleAbsoluteWithState(null, subscribed, function () {
+ subscription = source.subscribe(observer);
+ return disposableEmpty;
+ });
+
+ this.scheduleAbsoluteWithState(null, disposed, function () {
+ subscription.dispose();
+ return disposableEmpty;
+ });
+
+ this.start();
+
+ return observer;
+ };
+
+ /**
+ * Starts the test scheduler and uses the specified virtual time to dispose the subscription to the sequence obtained through the factory function.
+ * Default virtual times are used for factory invocation and sequence subscription.
+ *
+ * @param create Factory method to create an observable sequence.
+ * @param disposed Virtual time at which to dispose the subscription.
+ * @return Observer with timestamped recordings of notification messages that were received during the virtual time window when the subscription to the source sequence was active.
+ */
+ TestScheduler.prototype.startWithDispose = function (create, disposed) {
+ return this.startWithTiming(create, ReactiveTest.created, ReactiveTest.subscribed, disposed);
+ };
+
+ /**
+ * Starts the test scheduler and uses default virtual times to invoke the factory function, to subscribe to the resulting sequence, and to dispose the subscription.
+ *
+ * @param create Factory method to create an observable sequence.
+ * @return Observer with timestamped recordings of notification messages that were received during the virtual time window when the subscription to the source sequence was active.
+ */
+ TestScheduler.prototype.startWithCreate = function (create) {
+ return this.startWithTiming(create, ReactiveTest.created, ReactiveTest.subscribed, ReactiveTest.disposed);
+ };
+
+ /**
+ * Creates a hot observable using the specified timestamped notification messages either as an array or arguments.
+ * @param messages Notifications to surface through the created sequence at their specified absolute virtual times.
+ * @return Hot observable sequence that can be used to assert the timing of subscriptions and notifications.
+ */
+ TestScheduler.prototype.createHotObservable = function () {
+ var len = arguments.length, args;
+ if (Array.isArray(arguments[0])) {
+ args = arguments[0];
+ } else {
+ args = new Array(len);
+ for (var i = 0; i < len; i++) { args[i] = arguments[i]; }
+ }
+ return new HotObservable(this, args);
+ };
+
+ /**
+ * Creates a cold observable using the specified timestamped notification messages either as an array or arguments.
+ * @param messages Notifications to surface through the created sequence at their specified virtual time offsets from the sequence subscription time.
+ * @return Cold observable sequence that can be used to assert the timing of subscriptions and notifications.
+ */
+ TestScheduler.prototype.createColdObservable = function () {
+ var len = arguments.length, args;
+ if (Array.isArray(arguments[0])) {
+ args = arguments[0];
+ } else {
+ args = new Array(len);
+ for (var i = 0; i < len; i++) { args[i] = arguments[i]; }
+ }
+ return new ColdObservable(this, args);
+ };
+
+ /**
+ * Creates a resolved promise with the given value and ticks
+ * @param {Number} ticks The absolute time of the resolution.
+ * @param {Any} value The value to yield at the given tick.
+ * @returns {MockPromise} A mock Promise which fulfills with the given value.
+ */
+ TestScheduler.prototype.createResolvedPromise = function (ticks, value) {
+ return new MockPromise(this, [Rx.ReactiveTest.onNext(ticks, value), Rx.ReactiveTest.onCompleted(ticks)]);
+ };
+
+ /**
+ * Creates a rejected promise with the given reason and ticks
+ * @param {Number} ticks The absolute time of the resolution.
+ * @param {Any} reason The reason for rejection to yield at the given tick.
+ * @returns {MockPromise} A mock Promise which rejects with the given reason.
+ */
+ TestScheduler.prototype.createRejectedPromise = function (ticks, reason) {
+ return new MockPromise(this, [Rx.ReactiveTest.onError(ticks, reason)]);
+ };
+
+ /**
+ * Creates an observer that records received notification messages and timestamps those.
+ * @return Observer that can be used to assert the timing of received notifications.
+ */
+ TestScheduler.prototype.createObserver = function () {
+ return new MockObserver(this);
+ };
+
+ return TestScheduler;
+ })(VirtualTimeScheduler);
+
+ return Rx;
+}));
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.testing.map b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.testing.map
new file mode 100644
index 00000000000..5bfeb95790b
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.testing.map
@@ -0,0 +1 @@
+{"version":3,"file":"rx.testing.min.js","sources":["rx.testing.js"],"names":["factory","objectTypes","boolean","function","object","number","string","undefined","root","window","this","freeExports","exports","nodeType","freeModule","module","freeGlobal","global","define","amd","Rx","require","call","exp","OnNextPredicate","predicate","OnErrorPredicate","MockPromise","scheduler","messages","self","subscriptions","observers","i","len","length","message","notification","value","innerNotification","scheduleAbsoluteWithState","time","obs","slice","j","jLen","accept","disposableEmpty","Observer","Observable","Notification","VirtualTimeScheduler","Disposable","empty","disposableCreate","create","CompositeDisposable","inherits","SingleAssignmentDisposable","internals","defaultComparer","isEqual","prototype","equals","other","kind","exception","ReactiveTest","created","subscribed","disposed","onNext","ticks","Recorded","createOnNext","onError","error","createOnError","onCompleted","createOnCompleted","subscribe","start","end","Subscription","comparer","toString","unsubscribe","Number","MAX_VALUE","MockDisposable","disposes","push","clock","dispose","MockObserver","__super__","MockObserverPrototype","then","onResolved","onRejected","newPromise","index","observer","x","retValue","idx","indexOf","splice","err","HotObservable","observable","ColdObservable","d","add","scheduleRelativeWithState","TestScheduler","baseComparer","y","state","dueTime","action","absolute","relative","toDateTimeOffset","Date","getTime","toRelative","timeSpan","startWithTiming","source","subscription","createObserver","startWithDispose","startWithCreate","createHotObservable","args","arguments","Array","isArray","createColdObservable","createResolvedPromise","createRejectedPromise","reason"],"mappings":";CAEE,SAAUA,GACV,GAAIC,IACFC,WAAW,EACXC,YAAY,EACZC,QAAU,EACVC,QAAU,EACVC,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,UAAUsE,iBAAmB,SAAU7E,EAAQe,GACzD,MAAO5D,MAAKsH,gBAAgBzE,EAAQY,EAAaC,QAASD,EAAaE,WAAYC,IASvF6C,EAAcrD,UAAUuE,gBAAkB,SAAU9E,GAChD,MAAO7C,MAAKsH,gBAAgBzE,EAAQY,EAAaC,QAASD,EAAaE,WAAYF,EAAaG,WAQpG6C,EAAcrD,UAAUwE,oBAAsB,WAC5C,GAA4BC,GAAxBrG,EAAMsG,UAAUrG,MACpB,IAAIsG,MAAMC,QAAQF,UAAU,IAC1BD,EAAOC,UAAU,OACZ,CACLD,EAAO,GAAIE,OAAMvG,EACjB,KAAK,GAAID,GAAI,EAAOC,EAAJD,EAASA,IAAOsG,EAAKtG,GAAKuG,UAAUvG,GAEtD,MAAO,IAAI4E,GAAcnG,KAAM6H,IAQjCpB,EAAcrD,UAAU6E,qBAAuB,WAC7C,GAA4BJ,GAAxBrG,EAAMsG,UAAUrG,MACpB,IAAIsG,MAAMC,QAAQF,UAAU,IAC1BD,EAAOC,UAAU,OACZ,CACLD,EAAO,GAAIE,OAAMvG,EACjB,KAAK,GAAID,GAAI,EAAOC,EAAJD,EAASA,IAAOsG,EAAKtG,GAAKuG,UAAUvG,GAEtD,MAAO,IAAI8E,GAAerG,KAAM6H,IASlCpB,EAAcrD,UAAU8E,sBAAwB,SAAUpE,EAAOlC,GAC/D,MAAO,IAAIX,GAAYjB,MAAOU,EAAG+C,aAAaI,OAAOC,EAAOlC,GAAQlB,EAAG+C,aAAaW,YAAYN,MASlG2C,EAAcrD,UAAU+E,sBAAwB,SAAUrE,EAAOsE,GAC/D,MAAO,IAAInH,GAAYjB,MAAOU,EAAG+C,aAAaQ,QAAQH,EAAOsE,MAO/D3B,EAAcrD,UAAUqE,eAAiB,WACvC,MAAO,IAAIrC,GAAapF,OAGnByG,GACNhE,GAEM/B"} \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.testing.min.js b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.testing.min.js
new file mode 100644
index 00000000000..f412634cb5d
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.testing.min.js
@@ -0,0 +1,3 @@
+/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
+(function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx.virtualtime","exports"],function(b,d){return c.Rx=a(c,d,b),c.Rx}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){function e(a){this.predicate=a}function f(a){this.predicate=a}function g(a,b){var c=this;this.scheduler=a,this.messages=b,this.subscriptions=[],this.observers=[];for(var d=0,e=this.messages.length;e>d;d++){var f=this.messages[d],g=f.value;!function(b){a.scheduleAbsoluteWithState(null,f.time,function(){for(var a=c.observers.slice(0),d=0,e=a.length;e>d;d++)b.accept(a[d]);return m})}(g)}}var h=c.Observer,i=c.Observable,j=c.Notification,k=c.VirtualTimeScheduler,l=c.Disposable,m=l.empty,n=l.create,o=c.CompositeDisposable,p=(c.SingleAssignmentDisposable,c.internals.inherits),q=c.internals.isEqual;e.prototype.equals=function(a){return a===this?!0:null==a?!1:"N"!==a.kind?!1:this.predicate(a.value)},f.prototype.equals=function(a){return a===this?!0:null==a?!1:"E"!==a.kind?!1:this.predicate(a.exception)};var r=c.ReactiveTest={created:100,subscribed:200,disposed:1e3,onNext:function(a,b){return"function"==typeof b?new s(a,new e(b)):new s(a,j.createOnNext(b))},onError:function(a,b){return"function"==typeof b?new s(a,new f(b)):new s(a,j.createOnError(b))},onCompleted:function(a){return new s(a,j.createOnCompleted())},subscribe:function(a,b){return new t(a,b)}},s=c.Recorded=function(a,b,c){this.time=a,this.value=b,this.comparer=c||q};s.prototype.equals=function(a){return this.time===a.time&&this.comparer(this.value,a.value)},s.prototype.toString=function(){return this.value.toString()+"@"+this.time};var t=c.Subscription=function(a,b){this.subscribe=a,this.unsubscribe=b||Number.MAX_VALUE};t.prototype.equals=function(a){return this.subscribe===a.subscribe&&this.unsubscribe===a.unsubscribe},t.prototype.toString=function(){return"("+this.subscribe+", "+(this.unsubscribe===Number.MAX_VALUE?"Infinite":this.unsubscribe)+")"};var u=c.MockDisposable=function(a){this.scheduler=a,this.disposes=[],this.disposes.push(this.scheduler.clock)};u.prototype.dispose=function(){this.disposes.push(this.scheduler.clock)};var v=function(a){function b(b){a.call(this),this.scheduler=b,this.messages=[]}p(b,a);var c=b.prototype;return c.onNext=function(a){this.messages.push(new s(this.scheduler.clock,j.createOnNext(a)))},c.onError=function(a){this.messages.push(new s(this.scheduler.clock,j.createOnError(a)))},c.onCompleted=function(){this.messages.push(new s(this.scheduler.clock,j.createOnCompleted()))},b}(h);g.prototype.then=function(a,b){var e=this;this.subscriptions.push(new t(this.scheduler.clock));var f,h=this.subscriptions.length-1,i=c.Observer.create(function(b){var j=a(b);if(j&&"function"==typeof j.then)f=j;else{var k=e.scheduler.clock;f=new g(e.scheduler,[c.ReactiveTest.onNext(k,d),c.ReactiveTest.onCompleted(k)])}var l=e.observers.indexOf(i);e.observers.splice(l,1),e.subscriptions[h]=new t(e.subscriptions[h].subscribe,e.scheduler.clock)},function(a){b(a);var c=e.observers.indexOf(i);e.observers.splice(c,1),e.subscriptions[h]=new t(e.subscriptions[h].subscribe,e.scheduler.clock)});return this.observers.push(i),f||new g(this.scheduler,this.messages)};var w=function(a){function b(a){var b=this;this.observers.push(a),this.subscriptions.push(new t(this.scheduler.clock));var c=this.subscriptions.length-1;return n(function(){var d=b.observers.indexOf(a);b.observers.splice(d,1),b.subscriptions[c]=new t(b.subscriptions[c].subscribe,b.scheduler.clock)})}function c(c,d){a.call(this,b);var e,f,g=this;this.scheduler=c,this.messages=d,this.subscriptions=[],this.observers=[];for(var h=0,i=this.messages.length;i>h;h++)e=this.messages[h],f=e.value,function(a){c.scheduleAbsoluteWithState(null,e.time,function(){for(var b=g.observers.slice(0),c=0,d=b.length;d>c;c++)a.accept(b[c]);return m})}(f)}return p(c,a),c}(i),x=function(a){function b(a){var b,c,d=this;this.subscriptions.push(new t(this.scheduler.clock));for(var e=this.subscriptions.length-1,f=new o,g=0,h=this.messages.length;h>g;g++)b=this.messages[g],c=b.value,function(c){f.add(d.scheduler.scheduleRelativeWithState(null,b.time,function(){return c.accept(a),m}))}(c);return n(function(){d.subscriptions[e]=new t(d.subscriptions[e].subscribe,d.scheduler.clock),f.dispose()})}function c(c,d){a.call(this,b),this.scheduler=c,this.messages=d,this.subscriptions=[]}return p(c,a),c}(i);return c.TestScheduler=function(a){function b(a,b){return a>b?1:b>a?-1:0}function d(){a.call(this,0,b)}return p(d,a),d.prototype.scheduleAbsoluteWithState=function(b,c,d){return c<=this.clock&&(c=this.clock+1),a.prototype.scheduleAbsoluteWithState.call(this,b,c,d)},d.prototype.add=function(a,b){return a+b},d.prototype.toDateTimeOffset=function(a){return new Date(a).getTime()},d.prototype.toRelative=function(a){return a},d.prototype.startWithTiming=function(a,b,c,d){var e,f,g=this.createObserver();return this.scheduleAbsoluteWithState(null,b,function(){return e=a(),m}),this.scheduleAbsoluteWithState(null,c,function(){return f=e.subscribe(g),m}),this.scheduleAbsoluteWithState(null,d,function(){return f.dispose(),m}),this.start(),g},d.prototype.startWithDispose=function(a,b){return this.startWithTiming(a,r.created,r.subscribed,b)},d.prototype.startWithCreate=function(a){return this.startWithTiming(a,r.created,r.subscribed,r.disposed)},d.prototype.createHotObservable=function(){var a,b=arguments.length;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new w(this,a)},d.prototype.createColdObservable=function(){var a,b=arguments.length;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new x(this,a)},d.prototype.createResolvedPromise=function(a,b){return new g(this,[c.ReactiveTest.onNext(a,b),c.ReactiveTest.onCompleted(a)])},d.prototype.createRejectedPromise=function(a,b){return new g(this,[c.ReactiveTest.onError(a,b)])},d.prototype.createObserver=function(){return new v(this)},d}(k),c});
+//# sourceMappingURL=rx.testing.map \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.time.js b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.time.js
new file mode 100644
index 00000000000..dc4a0f46e2f
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.time.js
@@ -0,0 +1,1168 @@
+// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
+
+;(function (factory) {
+ var objectTypes = {
+ 'boolean': false,
+ 'function': true,
+ 'object': true,
+ 'number': false,
+ 'string': false,
+ 'undefined': false
+ };
+
+ var root = (objectTypes[typeof window] && window) || this,
+ freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
+ freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
+ moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
+ freeGlobal = objectTypes[typeof global] && global;
+
+ if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) {
+ root = freeGlobal;
+ }
+
+ // Because of build optimizers
+ if (typeof define === 'function' && define.amd) {
+ define(['rx'], function (Rx, exports) {
+ return factory(root, exports, Rx);
+ });
+ } else if (typeof module === 'object' && module && module.exports === freeExports) {
+ module.exports = factory(root, module.exports, require('./rx'));
+ } else {
+ root.Rx = factory(root, {}, root.Rx);
+ }
+}.call(this, function (root, exp, Rx, undefined) {
+
+ // Refernces
+ var Observable = Rx.Observable,
+ observableProto = Observable.prototype,
+ AnonymousObservable = Rx.AnonymousObservable,
+ observableDefer = Observable.defer,
+ observableEmpty = Observable.empty,
+ observableNever = Observable.never,
+ observableThrow = Observable.throwException,
+ observableFromArray = Observable.fromArray,
+ timeoutScheduler = Rx.Scheduler['default'],
+ SingleAssignmentDisposable = Rx.SingleAssignmentDisposable,
+ SerialDisposable = Rx.SerialDisposable,
+ CompositeDisposable = Rx.CompositeDisposable,
+ RefCountDisposable = Rx.RefCountDisposable,
+ Subject = Rx.Subject,
+ addRef = Rx.internals.addRef,
+ normalizeTime = Rx.Scheduler.normalize,
+ helpers = Rx.helpers,
+ isPromise = helpers.isPromise,
+ isFunction = helpers.isFunction,
+ isScheduler = Rx.Scheduler.isScheduler,
+ observableFromPromise = Observable.fromPromise;
+
+ var errorObj = {e: {}};
+ var tryCatchTarget;
+ function tryCatcher() {
+ try {
+ return tryCatchTarget.apply(this, arguments);
+ } catch (e) {
+ errorObj.e = e;
+ return errorObj;
+ }
+ }
+ function tryCatch(fn) {
+ if (!isFunction(fn)) { throw new TypeError('fn must be a function'); }
+ tryCatchTarget = fn;
+ return tryCatcher;
+ }
+ function thrower(e) {
+ throw e;
+ }
+
+ function observableTimerDate(dueTime, scheduler) {
+ return new AnonymousObservable(function (observer) {
+ return scheduler.scheduleWithAbsolute(dueTime, function () {
+ observer.onNext(0);
+ observer.onCompleted();
+ });
+ });
+ }
+
+ function observableTimerDateAndPeriod(dueTime, period, scheduler) {
+ return new AnonymousObservable(function (observer) {
+ var d = dueTime, p = normalizeTime(period);
+ return scheduler.scheduleRecursiveWithAbsoluteAndState(0, d, function (count, self) {
+ if (p > 0) {
+ var now = scheduler.now();
+ d = d + p;
+ d <= now && (d = now + p);
+ }
+ observer.onNext(count);
+ self(count + 1, d);
+ });
+ });
+ }
+
+ function observableTimerTimeSpan(dueTime, scheduler) {
+ return new AnonymousObservable(function (observer) {
+ return scheduler.scheduleWithRelative(normalizeTime(dueTime), function () {
+ observer.onNext(0);
+ observer.onCompleted();
+ });
+ });
+ }
+
+ function observableTimerTimeSpanAndPeriod(dueTime, period, scheduler) {
+ return dueTime === period ?
+ new AnonymousObservable(function (observer) {
+ return scheduler.schedulePeriodicWithState(0, period, function (count) {
+ observer.onNext(count);
+ return count + 1;
+ });
+ }) :
+ observableDefer(function () {
+ return observableTimerDateAndPeriod(scheduler.now() + dueTime, period, scheduler);
+ });
+ }
+
+ /**
+ * Returns an observable sequence that produces a value after each period.
+ *
+ * @example
+ * 1 - res = Rx.Observable.interval(1000);
+ * 2 - res = Rx.Observable.interval(1000, Rx.Scheduler.timeout);
+ *
+ * @param {Number} period Period for producing the values in the resulting sequence (specified as an integer denoting milliseconds).
+ * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, Rx.Scheduler.timeout is used.
+ * @returns {Observable} An observable sequence that produces a value after each period.
+ */
+ var observableinterval = Observable.interval = function (period, scheduler) {
+ return observableTimerTimeSpanAndPeriod(period, period, isScheduler(scheduler) ? scheduler : timeoutScheduler);
+ };
+
+ /**
+ * Returns an observable sequence that produces a value after dueTime has elapsed and then after each period.
+ * @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) at which to produce the first value.
+ * @param {Mixed} [periodOrScheduler] Period to produce subsequent values (specified as an integer denoting milliseconds), or the scheduler to run the timer on. If not specified, the resulting timer is not recurring.
+ * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, the timeout scheduler is used.
+ * @returns {Observable} An observable sequence that produces a value after due time has elapsed and then each period.
+ */
+ var observableTimer = Observable.timer = function (dueTime, periodOrScheduler, scheduler) {
+ var period;
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ if (periodOrScheduler !== undefined && typeof periodOrScheduler === 'number') {
+ period = periodOrScheduler;
+ } else if (isScheduler(periodOrScheduler)) {
+ scheduler = periodOrScheduler;
+ }
+ if (dueTime instanceof Date && period === undefined) {
+ return observableTimerDate(dueTime.getTime(), scheduler);
+ }
+ if (dueTime instanceof Date && period !== undefined) {
+ period = periodOrScheduler;
+ return observableTimerDateAndPeriod(dueTime.getTime(), period, scheduler);
+ }
+ return period === undefined ?
+ observableTimerTimeSpan(dueTime, scheduler) :
+ observableTimerTimeSpanAndPeriod(dueTime, period, scheduler);
+ };
+
+ function observableDelayTimeSpan(source, dueTime, scheduler) {
+ return new AnonymousObservable(function (observer) {
+ var active = false,
+ cancelable = new SerialDisposable(),
+ exception = null,
+ q = [],
+ running = false,
+ subscription;
+ subscription = source.materialize().timestamp(scheduler).subscribe(function (notification) {
+ var d, shouldRun;
+ if (notification.value.kind === 'E') {
+ q = [];
+ q.push(notification);
+ exception = notification.value.exception;
+ shouldRun = !running;
+ } else {
+ q.push({ value: notification.value, timestamp: notification.timestamp + dueTime });
+ shouldRun = !active;
+ active = true;
+ }
+ if (shouldRun) {
+ if (exception !== null) {
+ observer.onError(exception);
+ } else {
+ d = new SingleAssignmentDisposable();
+ cancelable.setDisposable(d);
+ d.setDisposable(scheduler.scheduleRecursiveWithRelative(dueTime, function (self) {
+ var e, recurseDueTime, result, shouldRecurse;
+ if (exception !== null) {
+ return;
+ }
+ running = true;
+ do {
+ result = null;
+ if (q.length > 0 && q[0].timestamp - scheduler.now() <= 0) {
+ result = q.shift().value;
+ }
+ if (result !== null) {
+ result.accept(observer);
+ }
+ } while (result !== null);
+ shouldRecurse = false;
+ recurseDueTime = 0;
+ if (q.length > 0) {
+ shouldRecurse = true;
+ recurseDueTime = Math.max(0, q[0].timestamp - scheduler.now());
+ } else {
+ active = false;
+ }
+ e = exception;
+ running = false;
+ if (e !== null) {
+ observer.onError(e);
+ } else if (shouldRecurse) {
+ self(recurseDueTime);
+ }
+ }));
+ }
+ }
+ });
+ return new CompositeDisposable(subscription, cancelable);
+ }, source);
+ }
+
+ function observableDelayDate(source, dueTime, scheduler) {
+ return observableDefer(function () {
+ return observableDelayTimeSpan(source, dueTime - scheduler.now(), scheduler);
+ });
+ }
+
+ /**
+ * Time shifts the observable sequence by dueTime. The relative time intervals between the values are preserved.
+ *
+ * @example
+ * 1 - res = Rx.Observable.delay(new Date());
+ * 2 - res = Rx.Observable.delay(new Date(), Rx.Scheduler.timeout);
+ *
+ * 3 - res = Rx.Observable.delay(5000);
+ * 4 - res = Rx.Observable.delay(5000, 1000, Rx.Scheduler.timeout);
+ * @memberOf Observable#
+ * @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) by which to shift the observable sequence.
+ * @param {Scheduler} [scheduler] Scheduler to run the delay timers on. If not specified, the timeout scheduler is used.
+ * @returns {Observable} Time-shifted sequence.
+ */
+ observableProto.delay = function (dueTime, scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return dueTime instanceof Date ?
+ observableDelayDate(this, dueTime.getTime(), scheduler) :
+ observableDelayTimeSpan(this, dueTime, scheduler);
+ };
+
+ /**
+ * Ignores values from an observable sequence which are followed by another value before dueTime.
+ * @param {Number} dueTime Duration of the debounce period for each value (specified as an integer denoting milliseconds).
+ * @param {Scheduler} [scheduler] Scheduler to run the debounce timers on. If not specified, the timeout scheduler is used.
+ * @returns {Observable} The debounced sequence.
+ */
+ observableProto.debounce = observableProto.throttleWithTimeout = function (dueTime, scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ var cancelable = new SerialDisposable(), hasvalue = false, value, id = 0;
+ var subscription = source.subscribe(
+ function (x) {
+ hasvalue = true;
+ value = x;
+ id++;
+ var currentId = id,
+ d = new SingleAssignmentDisposable();
+ cancelable.setDisposable(d);
+ d.setDisposable(scheduler.scheduleWithRelative(dueTime, function () {
+ hasvalue && id === currentId && observer.onNext(value);
+ hasvalue = false;
+ }));
+ },
+ function (e) {
+ cancelable.dispose();
+ observer.onError(e);
+ hasvalue = false;
+ id++;
+ },
+ function () {
+ cancelable.dispose();
+ hasvalue && observer.onNext(value);
+ observer.onCompleted();
+ hasvalue = false;
+ id++;
+ });
+ return new CompositeDisposable(subscription, cancelable);
+ }, this);
+ };
+
+ /**
+ * @deprecated use #debounce or #throttleWithTimeout instead.
+ */
+ observableProto.throttle = function(dueTime, scheduler) {
+ //deprecate('throttle', 'debounce or throttleWithTimeout');
+ return this.debounce(dueTime, scheduler);
+ };
+
+ /**
+ * Projects each element of an observable sequence into zero or more windows which are produced based on timing information.
+ * @param {Number} timeSpan Length of each window (specified as an integer denoting milliseconds).
+ * @param {Mixed} [timeShiftOrScheduler] Interval between creation of consecutive windows (specified as an integer denoting milliseconds), or an optional scheduler parameter. If not specified, the time shift corresponds to the timeSpan parameter, resulting in non-overlapping adjacent windows.
+ * @param {Scheduler} [scheduler] Scheduler to run windowing timers on. If not specified, the timeout scheduler is used.
+ * @returns {Observable} An observable sequence of windows.
+ */
+ observableProto.windowWithTime = function (timeSpan, timeShiftOrScheduler, scheduler) {
+ var source = this, timeShift;
+ timeShiftOrScheduler == null && (timeShift = timeSpan);
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ if (typeof timeShiftOrScheduler === 'number') {
+ timeShift = timeShiftOrScheduler;
+ } else if (isScheduler(timeShiftOrScheduler)) {
+ timeShift = timeSpan;
+ scheduler = timeShiftOrScheduler;
+ }
+ return new AnonymousObservable(function (observer) {
+ var groupDisposable,
+ nextShift = timeShift,
+ nextSpan = timeSpan,
+ q = [],
+ refCountDisposable,
+ timerD = new SerialDisposable(),
+ totalTime = 0;
+ groupDisposable = new CompositeDisposable(timerD),
+ refCountDisposable = new RefCountDisposable(groupDisposable);
+
+ function createTimer () {
+ var m = new SingleAssignmentDisposable(),
+ isSpan = false,
+ isShift = false;
+ timerD.setDisposable(m);
+ if (nextSpan === nextShift) {
+ isSpan = true;
+ isShift = true;
+ } else if (nextSpan < nextShift) {
+ isSpan = true;
+ } else {
+ isShift = true;
+ }
+ var newTotalTime = isSpan ? nextSpan : nextShift,
+ ts = newTotalTime - totalTime;
+ totalTime = newTotalTime;
+ if (isSpan) {
+ nextSpan += timeShift;
+ }
+ if (isShift) {
+ nextShift += timeShift;
+ }
+ m.setDisposable(scheduler.scheduleWithRelative(ts, function () {
+ if (isShift) {
+ var s = new Subject();
+ q.push(s);
+ observer.onNext(addRef(s, refCountDisposable));
+ }
+ isSpan && q.shift().onCompleted();
+ createTimer();
+ }));
+ };
+ q.push(new Subject());
+ observer.onNext(addRef(q[0], refCountDisposable));
+ createTimer();
+ groupDisposable.add(source.subscribe(
+ function (x) {
+ for (var i = 0, len = q.length; i < len; i++) { q[i].onNext(x); }
+ },
+ function (e) {
+ for (var i = 0, len = q.length; i < len; i++) { q[i].onError(e); }
+ observer.onError(e);
+ },
+ function () {
+ for (var i = 0, len = q.length; i < len; i++) { q[i].onCompleted(); }
+ observer.onCompleted();
+ }
+ ));
+ return refCountDisposable;
+ }, source);
+ };
+
+ /**
+ * Projects each element of an observable sequence into a window that is completed when either it's full or a given amount of time has elapsed.
+ * @param {Number} timeSpan Maximum time length of a window.
+ * @param {Number} count Maximum element count of a window.
+ * @param {Scheduler} [scheduler] Scheduler to run windowing timers on. If not specified, the timeout scheduler is used.
+ * @returns {Observable} An observable sequence of windows.
+ */
+ observableProto.windowWithTimeOrCount = function (timeSpan, count, scheduler) {
+ var source = this;
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return new AnonymousObservable(function (observer) {
+ var timerD = new SerialDisposable(),
+ groupDisposable = new CompositeDisposable(timerD),
+ refCountDisposable = new RefCountDisposable(groupDisposable),
+ n = 0,
+ windowId = 0,
+ s = new Subject();
+
+ function createTimer(id) {
+ var m = new SingleAssignmentDisposable();
+ timerD.setDisposable(m);
+ m.setDisposable(scheduler.scheduleWithRelative(timeSpan, function () {
+ if (id !== windowId) { return; }
+ n = 0;
+ var newId = ++windowId;
+ s.onCompleted();
+ s = new Subject();
+ observer.onNext(addRef(s, refCountDisposable));
+ createTimer(newId);
+ }));
+ }
+
+ observer.onNext(addRef(s, refCountDisposable));
+ createTimer(0);
+
+ groupDisposable.add(source.subscribe(
+ function (x) {
+ var newId = 0, newWindow = false;
+ s.onNext(x);
+ if (++n === count) {
+ newWindow = true;
+ n = 0;
+ newId = ++windowId;
+ s.onCompleted();
+ s = new Subject();
+ observer.onNext(addRef(s, refCountDisposable));
+ }
+ newWindow && createTimer(newId);
+ },
+ function (e) {
+ s.onError(e);
+ observer.onError(e);
+ }, function () {
+ s.onCompleted();
+ observer.onCompleted();
+ }
+ ));
+ return refCountDisposable;
+ }, source);
+ };
+
+ /**
+ * Projects each element of an observable sequence into zero or more buffers which are produced based on timing information.
+ *
+ * @example
+ * 1 - res = xs.bufferWithTime(1000, scheduler); // non-overlapping segments of 1 second
+ * 2 - res = xs.bufferWithTime(1000, 500, scheduler; // segments of 1 second with time shift 0.5 seconds
+ *
+ * @param {Number} timeSpan Length of each buffer (specified as an integer denoting milliseconds).
+ * @param {Mixed} [timeShiftOrScheduler] Interval between creation of consecutive buffers (specified as an integer denoting milliseconds), or an optional scheduler parameter. If not specified, the time shift corresponds to the timeSpan parameter, resulting in non-overlapping adjacent buffers.
+ * @param {Scheduler} [scheduler] Scheduler to run buffer timers on. If not specified, the timeout scheduler is used.
+ * @returns {Observable} An observable sequence of buffers.
+ */
+ observableProto.bufferWithTime = function (timeSpan, timeShiftOrScheduler, scheduler) {
+ return this.windowWithTime.apply(this, arguments).selectMany(function (x) { return x.toArray(); });
+ };
+
+ /**
+ * Projects each element of an observable sequence into a buffer that is completed when either it's full or a given amount of time has elapsed.
+ *
+ * @example
+ * 1 - res = source.bufferWithTimeOrCount(5000, 50); // 5s or 50 items in an array
+ * 2 - res = source.bufferWithTimeOrCount(5000, 50, scheduler); // 5s or 50 items in an array
+ *
+ * @param {Number} timeSpan Maximum time length of a buffer.
+ * @param {Number} count Maximum element count of a buffer.
+ * @param {Scheduler} [scheduler] Scheduler to run bufferin timers on. If not specified, the timeout scheduler is used.
+ * @returns {Observable} An observable sequence of buffers.
+ */
+ observableProto.bufferWithTimeOrCount = function (timeSpan, count, scheduler) {
+ return this.windowWithTimeOrCount(timeSpan, count, scheduler).selectMany(function (x) {
+ return x.toArray();
+ });
+ };
+
+ /**
+ * Records the time interval between consecutive values in an observable sequence.
+ *
+ * @example
+ * 1 - res = source.timeInterval();
+ * 2 - res = source.timeInterval(Rx.Scheduler.timeout);
+ *
+ * @param [scheduler] Scheduler used to compute time intervals. If not specified, the timeout scheduler is used.
+ * @returns {Observable} An observable sequence with time interval information on values.
+ */
+ observableProto.timeInterval = function (scheduler) {
+ var source = this;
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return observableDefer(function () {
+ var last = scheduler.now();
+ return source.map(function (x) {
+ var now = scheduler.now(), span = now - last;
+ last = now;
+ return { value: x, interval: span };
+ });
+ });
+ };
+
+ /**
+ * Records the timestamp for each value in an observable sequence.
+ *
+ * @example
+ * 1 - res = source.timestamp(); // produces { value: x, timestamp: ts }
+ * 2 - res = source.timestamp(Rx.Scheduler.default);
+ *
+ * @param {Scheduler} [scheduler] Scheduler used to compute timestamps. If not specified, the default scheduler is used.
+ * @returns {Observable} An observable sequence with timestamp information on values.
+ */
+ observableProto.timestamp = function (scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return this.map(function (x) {
+ return { value: x, timestamp: scheduler.now() };
+ });
+ };
+
+ function sampleObservable(source, sampler) {
+ return new AnonymousObservable(function (o) {
+ var atEnd = false, value, hasValue = false;
+
+ function sampleSubscribe() {
+ if (hasValue) {
+ hasValue = false;
+ o.onNext(value);
+ }
+ atEnd && o.onCompleted();
+ }
+
+ var sourceSubscription = new SingleAssignmentDisposable();
+ sourceSubscription.setDisposable(source.subscribe(
+ function (newValue) {
+ hasValue = true;
+ value = newValue;
+ },
+ function (e) { o.onError(e); },
+ function () {
+ atEnd = true;
+ sourceSubscription.dispose();
+ }
+ ));
+
+ return new CompositeDisposable(
+ sourceSubscription,
+ sampler.subscribe(sampleSubscribe, function (e) { o.onError(e); }, sampleSubscribe)
+ );
+ }, source);
+ }
+
+ /**
+ * Samples the observable sequence at each interval.
+ *
+ * @example
+ * 1 - res = source.sample(sampleObservable); // Sampler tick sequence
+ * 2 - res = source.sample(5000); // 5 seconds
+ * 2 - res = source.sample(5000, Rx.Scheduler.timeout); // 5 seconds
+ *
+ * @param {Mixed} intervalOrSampler Interval at which to sample (specified as an integer denoting milliseconds) or Sampler Observable.
+ * @param {Scheduler} [scheduler] Scheduler to run the sampling timer on. If not specified, the timeout scheduler is used.
+ * @returns {Observable} Sampled observable sequence.
+ */
+ observableProto.sample = observableProto.throttleLatest = function (intervalOrSampler, scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return typeof intervalOrSampler === 'number' ?
+ sampleObservable(this, observableinterval(intervalOrSampler, scheduler)) :
+ sampleObservable(this, intervalOrSampler);
+ };
+
+ /**
+ * Returns the source observable sequence or the other observable sequence if dueTime elapses.
+ * @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) when a timeout occurs.
+ * @param {Observable} [other] Sequence to return in case of a timeout. If not specified, a timeout error throwing sequence will be used.
+ * @param {Scheduler} [scheduler] Scheduler to run the timeout timers on. If not specified, the timeout scheduler is used.
+ * @returns {Observable} The source sequence switching to the other sequence in case of a timeout.
+ */
+ observableProto.timeout = function (dueTime, other, scheduler) {
+ (other == null || typeof other === 'string') && (other = observableThrow(new Error(other || 'Timeout')));
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+
+ var source = this, schedulerMethod = dueTime instanceof Date ?
+ 'scheduleWithAbsolute' :
+ 'scheduleWithRelative';
+
+ return new AnonymousObservable(function (observer) {
+ var id = 0,
+ original = new SingleAssignmentDisposable(),
+ subscription = new SerialDisposable(),
+ switched = false,
+ timer = new SerialDisposable();
+
+ subscription.setDisposable(original);
+
+ function createTimer() {
+ var myId = id;
+ timer.setDisposable(scheduler[schedulerMethod](dueTime, function () {
+ if (id === myId) {
+ isPromise(other) && (other = observableFromPromise(other));
+ subscription.setDisposable(other.subscribe(observer));
+ }
+ }));
+ }
+
+ createTimer();
+
+ original.setDisposable(source.subscribe(function (x) {
+ if (!switched) {
+ id++;
+ observer.onNext(x);
+ createTimer();
+ }
+ }, function (e) {
+ if (!switched) {
+ id++;
+ observer.onError(e);
+ }
+ }, function () {
+ if (!switched) {
+ id++;
+ observer.onCompleted();
+ }
+ }));
+ return new CompositeDisposable(subscription, timer);
+ }, source);
+ };
+
+ /**
+ * Generates an observable sequence by iterating a state from an initial state until the condition fails.
+ *
+ * @example
+ * res = source.generateWithAbsoluteTime(0,
+ * function (x) { return return true; },
+ * function (x) { return x + 1; },
+ * function (x) { return x; },
+ * function (x) { return new Date(); }
+ * });
+ *
+ * @param {Mixed} initialState Initial state.
+ * @param {Function} condition Condition to terminate generation (upon returning false).
+ * @param {Function} iterate Iteration step function.
+ * @param {Function} resultSelector Selector function for results produced in the sequence.
+ * @param {Function} timeSelector Time selector function to control the speed of values being produced each iteration, returning Date values.
+ * @param {Scheduler} [scheduler] Scheduler on which to run the generator loop. If not specified, the timeout scheduler is used.
+ * @returns {Observable} The generated sequence.
+ */
+ Observable.generateWithAbsoluteTime = function (initialState, condition, iterate, resultSelector, timeSelector, scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return new AnonymousObservable(function (observer) {
+ var first = true,
+ hasResult = false;
+ return scheduler.scheduleRecursiveWithAbsoluteAndState(initialState, scheduler.now(), function (state, self) {
+ hasResult && observer.onNext(state);
+
+ try {
+ if (first) {
+ first = false;
+ } else {
+ state = iterate(state);
+ }
+ hasResult = condition(state);
+ if (hasResult) {
+ var result = resultSelector(state);
+ var time = timeSelector(state);
+ }
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+ if (hasResult) {
+ self(result, time);
+ } else {
+ observer.onCompleted();
+ }
+ });
+ });
+ };
+
+ /**
+ * Generates an observable sequence by iterating a state from an initial state until the condition fails.
+ *
+ * @example
+ * res = source.generateWithRelativeTime(0,
+ * function (x) { return return true; },
+ * function (x) { return x + 1; },
+ * function (x) { return x; },
+ * function (x) { return 500; }
+ * );
+ *
+ * @param {Mixed} initialState Initial state.
+ * @param {Function} condition Condition to terminate generation (upon returning false).
+ * @param {Function} iterate Iteration step function.
+ * @param {Function} resultSelector Selector function for results produced in the sequence.
+ * @param {Function} timeSelector Time selector function to control the speed of values being produced each iteration, returning integer values denoting milliseconds.
+ * @param {Scheduler} [scheduler] Scheduler on which to run the generator loop. If not specified, the timeout scheduler is used.
+ * @returns {Observable} The generated sequence.
+ */
+ Observable.generateWithRelativeTime = function (initialState, condition, iterate, resultSelector, timeSelector, scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return new AnonymousObservable(function (observer) {
+ var first = true,
+ hasResult = false;
+ return scheduler.scheduleRecursiveWithRelativeAndState(initialState, 0, function (state, self) {
+ hasResult && observer.onNext(state);
+
+ try {
+ if (first) {
+ first = false;
+ } else {
+ state = iterate(state);
+ }
+ hasResult = condition(state);
+ if (hasResult) {
+ var result = resultSelector(state);
+ var time = timeSelector(state);
+ }
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+ if (hasResult) {
+ self(result, time);
+ } else {
+ observer.onCompleted();
+ }
+ });
+ });
+ };
+
+ /**
+ * Time shifts the observable sequence by delaying the subscription with the specified relative time duration, using the specified scheduler to run timers.
+ *
+ * @example
+ * 1 - res = source.delaySubscription(5000); // 5s
+ * 2 - res = source.delaySubscription(5000, Rx.Scheduler.default); // 5 seconds
+ *
+ * @param {Number} dueTime Relative or absolute time shift of the subscription.
+ * @param {Scheduler} [scheduler] Scheduler to run the subscription delay timer on. If not specified, the timeout scheduler is used.
+ * @returns {Observable} Time-shifted sequence.
+ */
+ observableProto.delaySubscription = function (dueTime, scheduler) {
+ var scheduleMethod = dueTime instanceof Date ? 'scheduleWithAbsolute' : 'scheduleWithRelative';
+ var source = this;
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return new AnonymousObservable(function (o) {
+ var d = new SerialDisposable();
+
+ d.setDisposable(scheduler[scheduleMethod](dueTime, function() {
+ d.setDisposable(source.subscribe(o));
+ }));
+
+ return d;
+ }, this);
+ };
+
+ /**
+ * Time shifts the observable sequence based on a subscription delay and a delay selector function for each element.
+ *
+ * @example
+ * 1 - res = source.delayWithSelector(function (x) { return Rx.Scheduler.timer(5000); }); // with selector only
+ * 1 - res = source.delayWithSelector(Rx.Observable.timer(2000), function (x) { return Rx.Observable.timer(x); }); // with delay and selector
+ *
+ * @param {Observable} [subscriptionDelay] Sequence indicating the delay for the subscription to the source.
+ * @param {Function} delayDurationSelector Selector function to retrieve a sequence indicating the delay for each given element.
+ * @returns {Observable} Time-shifted sequence.
+ */
+ observableProto.delayWithSelector = function (subscriptionDelay, delayDurationSelector) {
+ var source = this, subDelay, selector;
+ if (isFunction(subscriptionDelay)) {
+ selector = subscriptionDelay;
+ } else {
+ subDelay = subscriptionDelay;
+ selector = delayDurationSelector;
+ }
+ return new AnonymousObservable(function (observer) {
+ var delays = new CompositeDisposable(), atEnd = false, subscription = new SerialDisposable();
+
+ function start() {
+ subscription.setDisposable(source.subscribe(
+ function (x) {
+ var delay = tryCatch(selector)(x);
+ if (delay === errorObj) { return observer.onError(delay.e); }
+ var d = new SingleAssignmentDisposable();
+ delays.add(d);
+ d.setDisposable(delay.subscribe(
+ function () {
+ observer.onNext(x);
+ delays.remove(d);
+ done();
+ },
+ function (e) { observer.onError(e); },
+ function () {
+ observer.onNext(x);
+ delays.remove(d);
+ done();
+ }
+ ))
+ },
+ function (e) { observer.onError(e); },
+ function () {
+ atEnd = true;
+ subscription.dispose();
+ done();
+ }
+ ))
+ }
+
+ function done () {
+ atEnd && delays.length === 0 && observer.onCompleted();
+ }
+
+ if (!subDelay) {
+ start();
+ } else {
+ subscription.setDisposable(subDelay.subscribe(start, function (e) { observer.onError(e); }, start));
+ }
+
+ return new CompositeDisposable(subscription, delays);
+ }, this);
+ };
+
+ /**
+ * Returns the source observable sequence, switching to the other observable sequence if a timeout is signaled.
+ * @param {Observable} [firstTimeout] Observable sequence that represents the timeout for the first element. If not provided, this defaults to Observable.never().
+ * @param {Function} timeoutDurationSelector Selector to retrieve an observable sequence that represents the timeout between the current element and the next element.
+ * @param {Observable} [other] Sequence to return in case of a timeout. If not provided, this is set to Observable.throwException().
+ * @returns {Observable} The source sequence switching to the other sequence in case of a timeout.
+ */
+ observableProto.timeoutWithSelector = function (firstTimeout, timeoutdurationSelector, other) {
+ if (arguments.length === 1) {
+ timeoutdurationSelector = firstTimeout;
+ firstTimeout = observableNever();
+ }
+ other || (other = observableThrow(new Error('Timeout')));
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ var subscription = new SerialDisposable(), timer = new SerialDisposable(), original = new SingleAssignmentDisposable();
+
+ subscription.setDisposable(original);
+
+ var id = 0, switched = false;
+
+ function setTimer(timeout) {
+ var myId = id;
+
+ function timerWins () {
+ return id === myId;
+ }
+
+ var d = new SingleAssignmentDisposable();
+ timer.setDisposable(d);
+ d.setDisposable(timeout.subscribe(function () {
+ timerWins() && subscription.setDisposable(other.subscribe(observer));
+ d.dispose();
+ }, function (e) {
+ timerWins() && observer.onError(e);
+ }, function () {
+ timerWins() && subscription.setDisposable(other.subscribe(observer));
+ }));
+ };
+
+ setTimer(firstTimeout);
+
+ function observerWins() {
+ var res = !switched;
+ if (res) { id++; }
+ return res;
+ }
+
+ original.setDisposable(source.subscribe(function (x) {
+ if (observerWins()) {
+ observer.onNext(x);
+ var timeout;
+ try {
+ timeout = timeoutdurationSelector(x);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+ setTimer(isPromise(timeout) ? observableFromPromise(timeout) : timeout);
+ }
+ }, function (e) {
+ observerWins() && observer.onError(e);
+ }, function () {
+ observerWins() && observer.onCompleted();
+ }));
+ return new CompositeDisposable(subscription, timer);
+ }, source);
+ };
+
+ /**
+ * Ignores values from an observable sequence which are followed by another value within a computed throttle duration.
+ * @param {Function} durationSelector Selector function to retrieve a sequence indicating the throttle duration for each given element.
+ * @returns {Observable} The debounced sequence.
+ */
+ observableProto.debounceWithSelector = function (durationSelector) {
+ var source = this;
+ return new AnonymousObservable(function (observer) {
+ var value, hasValue = false, cancelable = new SerialDisposable(), id = 0;
+ var subscription = source.subscribe(function (x) {
+ var throttle;
+ try {
+ throttle = durationSelector(x);
+ } catch (e) {
+ observer.onError(e);
+ return;
+ }
+
+ isPromise(throttle) && (throttle = observableFromPromise(throttle));
+
+ hasValue = true;
+ value = x;
+ id++;
+ var currentid = id, d = new SingleAssignmentDisposable();
+ cancelable.setDisposable(d);
+ d.setDisposable(throttle.subscribe(function () {
+ hasValue && id === currentid && observer.onNext(value);
+ hasValue = false;
+ d.dispose();
+ }, observer.onError.bind(observer), function () {
+ hasValue && id === currentid && observer.onNext(value);
+ hasValue = false;
+ d.dispose();
+ }));
+ }, function (e) {
+ cancelable.dispose();
+ observer.onError(e);
+ hasValue = false;
+ id++;
+ }, function () {
+ cancelable.dispose();
+ hasValue && observer.onNext(value);
+ observer.onCompleted();
+ hasValue = false;
+ id++;
+ });
+ return new CompositeDisposable(subscription, cancelable);
+ }, source);
+ };
+
+ /**
+ * @deprecated use #debounceWithSelector instead.
+ */
+ observableProto.throttleWithSelector = function (durationSelector) {
+ //deprecate('throttleWithSelector', 'debounceWithSelector');
+ return this.debounceWithSelector(durationSelector);
+ };
+
+ /**
+ * Skips elements for the specified duration from the end of the observable source sequence, using the specified scheduler to run timers.
+ *
+ * 1 - res = source.skipLastWithTime(5000);
+ * 2 - res = source.skipLastWithTime(5000, scheduler);
+ *
+ * @description
+ * This operator accumulates a queue with a length enough to store elements received during the initial duration window.
+ * As more elements are received, elements older than the specified duration are taken from the queue and produced on the
+ * result sequence. This causes elements to be delayed with duration.
+ * @param {Number} duration Duration for skipping elements from the end of the sequence.
+ * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout
+ * @returns {Observable} An observable sequence with the elements skipped during the specified duration from the end of the source sequence.
+ */
+ observableProto.skipLastWithTime = function (duration, scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var q = [];
+ return source.subscribe(function (x) {
+ var now = scheduler.now();
+ q.push({ interval: now, value: x });
+ while (q.length > 0 && now - q[0].interval >= duration) {
+ o.onNext(q.shift().value);
+ }
+ }, function (e) { o.onError(e); }, function () {
+ var now = scheduler.now();
+ while (q.length > 0 && now - q[0].interval >= duration) {
+ o.onNext(q.shift().value);
+ }
+ o.onCompleted();
+ });
+ }, source);
+ };
+
+ /**
+ * Returns elements within the specified duration from the end of the observable source sequence, using the specified schedulers to run timers and to drain the collected elements.
+ * @description
+ * This operator accumulates a queue with a length enough to store elements received during the initial duration window.
+ * As more elements are received, elements older than the specified duration are taken from the queue and produced on the
+ * result sequence. This causes elements to be delayed with duration.
+ * @param {Number} duration Duration for taking elements from the end of the sequence.
+ * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout.
+ * @returns {Observable} An observable sequence with the elements taken during the specified duration from the end of the source sequence.
+ */
+ observableProto.takeLastWithTime = function (duration, scheduler) {
+ var source = this;
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return new AnonymousObservable(function (o) {
+ var q = [];
+ return source.subscribe(function (x) {
+ var now = scheduler.now();
+ q.push({ interval: now, value: x });
+ while (q.length > 0 && now - q[0].interval >= duration) {
+ q.shift();
+ }
+ }, function (e) { o.onError(e); }, function () {
+ var now = scheduler.now();
+ while (q.length > 0) {
+ var next = q.shift();
+ if (now - next.interval <= duration) { o.onNext(next.value); }
+ }
+ o.onCompleted();
+ });
+ }, source);
+ };
+
+ /**
+ * Returns an array with the elements within the specified duration from the end of the observable source sequence, using the specified scheduler to run timers.
+ * @description
+ * This operator accumulates a queue with a length enough to store elements received during the initial duration window.
+ * As more elements are received, elements older than the specified duration are taken from the queue and produced on the
+ * result sequence. This causes elements to be delayed with duration.
+ * @param {Number} duration Duration for taking elements from the end of the sequence.
+ * @param {Scheduler} scheduler Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout.
+ * @returns {Observable} An observable sequence containing a single array with the elements taken during the specified duration from the end of the source sequence.
+ */
+ observableProto.takeLastBufferWithTime = function (duration, scheduler) {
+ var source = this;
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return new AnonymousObservable(function (o) {
+ var q = [];
+ return source.subscribe(function (x) {
+ var now = scheduler.now();
+ q.push({ interval: now, value: x });
+ while (q.length > 0 && now - q[0].interval >= duration) {
+ q.shift();
+ }
+ }, function (e) { o.onError(e); }, function () {
+ var now = scheduler.now(), res = [];
+ while (q.length > 0) {
+ var next = q.shift();
+ now - next.interval <= duration && res.push(next.value);
+ }
+ o.onNext(res);
+ o.onCompleted();
+ });
+ }, source);
+ };
+
+ /**
+ * Takes elements for the specified duration from the start of the observable source sequence, using the specified scheduler to run timers.
+ *
+ * @example
+ * 1 - res = source.takeWithTime(5000, [optional scheduler]);
+ * @description
+ * This operator accumulates a queue with a length enough to store elements received during the initial duration window.
+ * As more elements are received, elements older than the specified duration are taken from the queue and produced on the
+ * result sequence. This causes elements to be delayed with duration.
+ * @param {Number} duration Duration for taking elements from the start of the sequence.
+ * @param {Scheduler} scheduler Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout.
+ * @returns {Observable} An observable sequence with the elements taken during the specified duration from the start of the source sequence.
+ */
+ observableProto.takeWithTime = function (duration, scheduler) {
+ var source = this;
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return new AnonymousObservable(function (o) {
+ return new CompositeDisposable(scheduler.scheduleWithRelative(duration, function () { o.onCompleted(); }), source.subscribe(o));
+ }, source);
+ };
+
+ /**
+ * Skips elements for the specified duration from the start of the observable source sequence, using the specified scheduler to run timers.
+ *
+ * @example
+ * 1 - res = source.skipWithTime(5000, [optional scheduler]);
+ *
+ * @description
+ * Specifying a zero value for duration doesn't guarantee no elements will be dropped from the start of the source sequence.
+ * This is a side-effect of the asynchrony introduced by the scheduler, where the action that causes callbacks from the source sequence to be forwarded
+ * may not execute immediately, despite the zero due time.
+ *
+ * Errors produced by the source sequence are always forwarded to the result sequence, even if the error occurs before the duration.
+ * @param {Number} duration Duration for skipping elements from the start of the sequence.
+ * @param {Scheduler} scheduler Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout.
+ * @returns {Observable} An observable sequence with the elements skipped during the specified duration from the start of the source sequence.
+ */
+ observableProto.skipWithTime = function (duration, scheduler) {
+ var source = this;
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ return new AnonymousObservable(function (observer) {
+ var open = false;
+ return new CompositeDisposable(
+ scheduler.scheduleWithRelative(duration, function () { open = true; }),
+ source.subscribe(function (x) { open && observer.onNext(x); }, observer.onError.bind(observer), observer.onCompleted.bind(observer)));
+ }, source);
+ };
+
+ /**
+ * Skips elements from the observable source sequence until the specified start time, using the specified scheduler to run timers.
+ * Errors produced by the source sequence are always forwarded to the result sequence, even if the error occurs before the start time.
+ *
+ * @examples
+ * 1 - res = source.skipUntilWithTime(new Date(), [scheduler]);
+ * 2 - res = source.skipUntilWithTime(5000, [scheduler]);
+ * @param {Date|Number} startTime Time to start taking elements from the source sequence. If this value is less than or equal to Date(), no elements will be skipped.
+ * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout.
+ * @returns {Observable} An observable sequence with the elements skipped until the specified start time.
+ */
+ observableProto.skipUntilWithTime = function (startTime, scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ var source = this, schedulerMethod = startTime instanceof Date ?
+ 'scheduleWithAbsolute' :
+ 'scheduleWithRelative';
+ return new AnonymousObservable(function (o) {
+ var open = false;
+
+ return new CompositeDisposable(
+ scheduler[schedulerMethod](startTime, function () { open = true; }),
+ source.subscribe(
+ function (x) { open && o.onNext(x); },
+ function (e) { o.onError(e); }, function () { o.onCompleted(); }));
+ }, source);
+ };
+
+ /**
+ * Takes elements for the specified duration until the specified end time, using the specified scheduler to run timers.
+ * @param {Number | Date} endTime Time to stop taking elements from the source sequence. If this value is less than or equal to new Date(), the result stream will complete immediately.
+ * @param {Scheduler} [scheduler] Scheduler to run the timer on.
+ * @returns {Observable} An observable sequence with the elements taken until the specified end time.
+ */
+ observableProto.takeUntilWithTime = function (endTime, scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ var source = this, schedulerMethod = endTime instanceof Date ?
+ 'scheduleWithAbsolute' :
+ 'scheduleWithRelative';
+ return new AnonymousObservable(function (o) {
+ return new CompositeDisposable(
+ scheduler[schedulerMethod](endTime, function () { o.onCompleted(); }),
+ source.subscribe(o));
+ }, source);
+ };
+
+ /**
+ * Returns an Observable that emits only the first item emitted by the source Observable during sequential time windows of a specified duration.
+ * @param {Number} windowDuration time to wait before emitting another item after emitting the last item
+ * @param {Scheduler} [scheduler] the Scheduler to use internally to manage the timers that handle timeout for each item. If not provided, defaults to Scheduler.timeout.
+ * @returns {Observable} An Observable that performs the throttle operation.
+ */
+ observableProto.throttleFirst = function (windowDuration, scheduler) {
+ isScheduler(scheduler) || (scheduler = timeoutScheduler);
+ var duration = +windowDuration || 0;
+ if (duration <= 0) { throw new RangeError('windowDuration cannot be less or equal zero.'); }
+ var source = this;
+ return new AnonymousObservable(function (o) {
+ var lastOnNext = 0;
+ return source.subscribe(
+ function (x) {
+ var now = scheduler.now();
+ if (lastOnNext === 0 || now - lastOnNext >= duration) {
+ lastOnNext = now;
+ o.onNext(x);
+ }
+ },function (e) { o.onError(e); }, function () { o.onCompleted(); }
+ );
+ }, source);
+ };
+
+ return Rx;
+}));
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.time.map b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.time.map
new file mode 100644
index 00000000000..8519a767f13
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.time.map
@@ -0,0 +1 @@
+{"version":3,"file":"rx.time.min.js","sources":["rx.time.js"],"names":["factory","objectTypes","boolean","function","object","number","string","undefined","root","window","this","freeExports","exports","nodeType","freeModule","module","freeGlobal","global","define","amd","Rx","require","call","exp","tryCatcher","tryCatchTarget","apply","arguments","e","errorObj","tryCatch","fn","isFunction","TypeError","observableTimerDate","dueTime","scheduler","AnonymousObservable","observer","scheduleWithAbsolute","onNext","onCompleted","observableTimerDateAndPeriod","period","d","p","normalizeTime","scheduleRecursiveWithAbsoluteAndState","count","self","now","observableTimerTimeSpan","scheduleWithRelative","observableTimerTimeSpanAndPeriod","schedulePeriodicWithState","observableDefer","observableDelayTimeSpan","source","subscription","active","cancelable","SerialDisposable","exception","q","running","materialize","timestamp","subscribe","notification","shouldRun","value","kind","push","onError","SingleAssignmentDisposable","setDisposable","scheduleRecursiveWithRelative","recurseDueTime","result","shouldRecurse","length","shift","accept","Math","max","CompositeDisposable","observableDelayDate","sampleObservable","sampler","o","sampleSubscribe","hasValue","atEnd","sourceSubscription","newValue","dispose","Observable","observableProto","prototype","defer","observableNever","empty","never","observableThrow","throwException","timeoutScheduler","fromArray","Scheduler","RefCountDisposable","Subject","addRef","internals","normalize","helpers","isPromise","isScheduler","observableFromPromise","fromPromise","observableinterval","interval","timer","periodOrScheduler","Date","getTime","delay","debounce","throttleWithTimeout","hasvalue","id","x","currentId","throttle","windowWithTime","timeSpan","timeShiftOrScheduler","timeShift","createTimer","m","isSpan","isShift","timerD","nextSpan","nextShift","newTotalTime","ts","totalTime","s","refCountDisposable","groupDisposable","add","i","len","windowWithTimeOrCount","windowId","n","newId","newWindow","bufferWithTime","selectMany","toArray","bufferWithTimeOrCount","timeInterval","last","map","span","sample","throttleLatest","intervalOrSampler","timeout","other","Error","schedulerMethod","myId","original","switched","generateWithAbsoluteTime","initialState","condition","iterate","resultSelector","timeSelector","first","hasResult","state","time","generateWithRelativeTime","scheduleRecursiveWithRelativeAndState","delaySubscription","scheduleMethod","delayWithSelector","subscriptionDelay","delayDurationSelector","subDelay","selector","start","delays","remove","done","timeoutWithSelector","firstTimeout","timeoutdurationSelector","setTimer","timerWins","observerWins","res","debounceWithSelector","durationSelector","currentid","bind","throttleWithSelector","skipLastWithTime","duration","takeLastWithTime","next","takeLastBufferWithTime","takeWithTime","skipWithTime","open","skipUntilWithTime","startTime","take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K,GAAcd,KAC1Cc,EAAa/K,EACbuC,EAAEjD,OAAOyF,KAEX,SAAUrG,GAAK6D,EAAEhB,QAAQ7C,IAAO,WAAc6D,EAAEhD,iBAEnDgB,IAGIrC"} \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.time.min.js b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.time.min.js
new file mode 100644
index 00000000000..005951d7d80
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.time.min.js
@@ -0,0 +1,3 @@
+/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
+(function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx"],function(b,d){return a(c,d,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){function e(){try{return n.apply(this,arguments)}catch(a){return H.e=a,H}}function f(a){if(!E(a))throw new TypeError("fn must be a function");return n=a,e}function g(a,b){return new q(function(c){return b.scheduleWithAbsolute(a,function(){c.onNext(0),c.onCompleted()})})}function h(a,b,c){return new q(function(d){var e=a,f=B(b);return c.scheduleRecursiveWithAbsoluteAndState(0,e,function(a,b){if(f>0){var g=c.now();e+=f,g>=e&&(e=g+f)}d.onNext(a),b(a+1,e)})})}function i(a,b){return new q(function(c){return b.scheduleWithRelative(B(a),function(){c.onNext(0),c.onCompleted()})})}function j(a,b,c){return a===b?new q(function(a){return c.schedulePeriodicWithState(0,b,function(b){return a.onNext(b),b+1})}):r(function(){return h(c.now()+a,b,c)})}function k(a,b,c){return new q(function(d){var e,f=!1,g=new w,h=null,i=[],j=!1;return e=a.materialize().timestamp(c).subscribe(function(a){var e,k;"E"===a.value.kind?(i=[],i.push(a),h=a.value.exception,k=!j):(i.push({value:a.value,timestamp:a.timestamp+b}),k=!f,f=!0),k&&(null!==h?d.onError(h):(e=new v,g.setDisposable(e),e.setDisposable(c.scheduleRecursiveWithRelative(b,function(a){var b,e,g,k;if(null===h){j=!0;do g=null,i.length>0&&i[0].timestamp-c.now()<=0&&(g=i.shift().value),null!==g&&g.accept(d);while(null!==g);k=!1,e=0,i.length>0?(k=!0,e=Math.max(0,i[0].timestamp-c.now())):f=!1,b=h,j=!1,null!==b?d.onError(b):k&&a(e)}}))))}),new x(e,g)},a)}function l(a,b,c){return r(function(){return k(a,b-c.now(),c)})}function m(a,b){return new q(function(c){function d(){g&&(g=!1,c.onNext(e)),f&&c.onCompleted()}var e,f=!1,g=!1,h=new v;return h.setDisposable(a.subscribe(function(a){g=!0,e=a},function(a){c.onError(a)},function(){f=!0,h.dispose()})),new x(h,b.subscribe(d,function(a){c.onError(a)},d))},a)}{var n,o=c.Observable,p=o.prototype,q=c.AnonymousObservable,r=o.defer,s=(o.empty,o.never),t=o.throwException,u=(o.fromArray,c.Scheduler["default"]),v=c.SingleAssignmentDisposable,w=c.SerialDisposable,x=c.CompositeDisposable,y=c.RefCountDisposable,z=c.Subject,A=c.internals.addRef,B=c.Scheduler.normalize,C=c.helpers,D=C.isPromise,E=C.isFunction,F=c.Scheduler.isScheduler,G=o.fromPromise,H={e:{}},I=o.interval=function(a,b){return j(a,a,F(b)?b:u)};o.timer=function(a,b,c){var e;return F(c)||(c=u),b!==d&&"number"==typeof b?e=b:F(b)&&(c=b),a instanceof Date&&e===d?g(a.getTime(),c):a instanceof Date&&e!==d?(e=b,h(a.getTime(),e,c)):e===d?i(a,c):j(a,e,c)}}return p.delay=function(a,b){return F(b)||(b=u),a instanceof Date?l(this,a.getTime(),b):k(this,a,b)},p.debounce=p.throttleWithTimeout=function(a,b){F(b)||(b=u);var c=this;return new q(function(d){var e,f=new w,g=!1,h=0,i=c.subscribe(function(c){g=!0,e=c,h++;var i=h,j=new v;f.setDisposable(j),j.setDisposable(b.scheduleWithRelative(a,function(){g&&h===i&&d.onNext(e),g=!1}))},function(a){f.dispose(),d.onError(a),g=!1,h++},function(){f.dispose(),g&&d.onNext(e),d.onCompleted(),g=!1,h++});return new x(i,f)},this)},p.throttle=function(a,b){return this.debounce(a,b)},p.windowWithTime=function(a,b,c){var d,e=this;return null==b&&(d=a),F(c)||(c=u),"number"==typeof b?d=b:F(b)&&(d=a,c=b),new q(function(b){function f(){var a=new v,e=!1,g=!1;l.setDisposable(a),j===i?(e=!0,g=!0):i>j?e=!0:g=!0;var n=e?j:i,o=n-m;m=n,e&&(j+=d),g&&(i+=d),a.setDisposable(c.scheduleWithRelative(o,function(){if(g){var a=new z;k.push(a),b.onNext(A(a,h))}e&&k.shift().onCompleted(),f()}))}var g,h,i=d,j=a,k=[],l=new w,m=0;return g=new x(l),h=new y(g),k.push(new z),b.onNext(A(k[0],h)),f(),g.add(e.subscribe(function(a){for(var b=0,c=k.length;c>b;b++)k[b].onNext(a)},function(a){for(var c=0,d=k.length;d>c;c++)k[c].onError(a);b.onError(a)},function(){for(var a=0,c=k.length;c>a;a++)k[a].onCompleted();b.onCompleted()})),h},e)},p.windowWithTimeOrCount=function(a,b,c){var d=this;return F(c)||(c=u),new q(function(e){function f(b){var d=new v;g.setDisposable(d),d.setDisposable(c.scheduleWithRelative(a,function(){if(b===k){j=0;var a=++k;l.onCompleted(),l=new z,e.onNext(A(l,i)),f(a)}}))}var g=new w,h=new x(g),i=new y(h),j=0,k=0,l=new z;return e.onNext(A(l,i)),f(0),h.add(d.subscribe(function(a){var c=0,d=!1;l.onNext(a),++j===b&&(d=!0,j=0,c=++k,l.onCompleted(),l=new z,e.onNext(A(l,i))),d&&f(c)},function(a){l.onError(a),e.onError(a)},function(){l.onCompleted(),e.onCompleted()})),i},d)},p.bufferWithTime=function(a,b,c){return this.windowWithTime.apply(this,arguments).selectMany(function(a){return a.toArray()})},p.bufferWithTimeOrCount=function(a,b,c){return this.windowWithTimeOrCount(a,b,c).selectMany(function(a){return a.toArray()})},p.timeInterval=function(a){var b=this;return F(a)||(a=u),r(function(){var c=a.now();return b.map(function(b){var d=a.now(),e=d-c;return c=d,{value:b,interval:e}})})},p.timestamp=function(a){return F(a)||(a=u),this.map(function(b){return{value:b,timestamp:a.now()}})},p.sample=p.throttleLatest=function(a,b){return F(b)||(b=u),"number"==typeof a?m(this,I(a,b)):m(this,a)},p.timeout=function(a,b,c){(null==b||"string"==typeof b)&&(b=t(new Error(b||"Timeout"))),F(c)||(c=u);var d=this,e=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new q(function(f){function g(){var d=h;l.setDisposable(c[e](a,function(){h===d&&(D(b)&&(b=G(b)),j.setDisposable(b.subscribe(f)))}))}var h=0,i=new v,j=new w,k=!1,l=new w;return j.setDisposable(i),g(),i.setDisposable(d.subscribe(function(a){k||(h++,f.onNext(a),g())},function(a){k||(h++,f.onError(a))},function(){k||(h++,f.onCompleted())})),new x(j,l)},d)},o.generateWithAbsoluteTime=function(a,b,c,d,e,f){return F(f)||(f=u),new q(function(g){var h=!0,i=!1;return f.scheduleRecursiveWithAbsoluteAndState(a,f.now(),function(a,f){i&&g.onNext(a);try{if(h?h=!1:a=c(a),i=b(a))var j=d(a),k=e(a)}catch(l){return void g.onError(l)}i?f(j,k):g.onCompleted()})})},o.generateWithRelativeTime=function(a,b,c,d,e,f){return F(f)||(f=u),new q(function(g){var h=!0,i=!1;return f.scheduleRecursiveWithRelativeAndState(a,0,function(a,f){i&&g.onNext(a);try{if(h?h=!1:a=c(a),i=b(a))var j=d(a),k=e(a)}catch(l){return void g.onError(l)}i?f(j,k):g.onCompleted()})})},p.delaySubscription=function(a,b){var c=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative",d=this;return F(b)||(b=u),new q(function(e){var f=new w;return f.setDisposable(b[c](a,function(){f.setDisposable(d.subscribe(e))})),f},this)},p.delayWithSelector=function(a,b){var c,d,e=this;return E(a)?d=a:(c=a,d=b),new q(function(a){function b(){j.setDisposable(e.subscribe(function(b){var c=f(d)(b);if(c===H)return a.onError(c.e);var e=new v;h.add(e),e.setDisposable(c.subscribe(function(){a.onNext(b),h.remove(e),g()},function(b){a.onError(b)},function(){a.onNext(b),h.remove(e),g()}))},function(b){a.onError(b)},function(){i=!0,j.dispose(),g()}))}function g(){i&&0===h.length&&a.onCompleted()}var h=new x,i=!1,j=new w;return c?j.setDisposable(c.subscribe(b,function(b){a.onError(b)},b)):b(),new x(j,h)},this)},p.timeoutWithSelector=function(a,b,c){1===arguments.length&&(b=a,a=s()),c||(c=t(new Error("Timeout")));var d=this;return new q(function(e){function f(a){function b(){return k===d}var d=k,f=new v;i.setDisposable(f),f.setDisposable(a.subscribe(function(){b()&&h.setDisposable(c.subscribe(e)),f.dispose()},function(a){b()&&e.onError(a)},function(){b()&&h.setDisposable(c.subscribe(e))}))}function g(){var a=!l;return a&&k++,a}var h=new w,i=new w,j=new v;h.setDisposable(j);var k=0,l=!1;return f(a),j.setDisposable(d.subscribe(function(a){if(g()){e.onNext(a);var c;try{c=b(a)}catch(d){return void e.onError(d)}f(D(c)?G(c):c)}},function(a){g()&&e.onError(a)},function(){g()&&e.onCompleted()})),new x(h,i)},d)},p.debounceWithSelector=function(a){var b=this;return new q(function(c){var d,e=!1,f=new w,g=0,h=b.subscribe(function(b){var h;try{h=a(b)}catch(i){return void c.onError(i)}D(h)&&(h=G(h)),e=!0,d=b,g++;var j=g,k=new v;f.setDisposable(k),k.setDisposable(h.subscribe(function(){e&&g===j&&c.onNext(d),e=!1,k.dispose()},c.onError.bind(c),function(){e&&g===j&&c.onNext(d),e=!1,k.dispose()}))},function(a){f.dispose(),c.onError(a),e=!1,g++},function(){f.dispose(),e&&c.onNext(d),c.onCompleted(),e=!1,g++});return new x(h,f)},b)},p.throttleWithSelector=function(a){return this.debounceWithSelector(a)},p.skipLastWithTime=function(a,b){F(b)||(b=u);var c=this;return new q(function(d){var e=[];return c.subscribe(function(c){var f=b.now();for(e.push({interval:f,value:c});e.length>0&&f-e[0].interval>=a;)d.onNext(e.shift().value)},function(a){d.onError(a)},function(){for(var c=b.now();e.length>0&&c-e[0].interval>=a;)d.onNext(e.shift().value);d.onCompleted()})},c)},p.takeLastWithTime=function(a,b){var c=this;return F(b)||(b=u),new q(function(d){var e=[];return c.subscribe(function(c){var d=b.now();for(e.push({interval:d,value:c});e.length>0&&d-e[0].interval>=a;)e.shift()},function(a){d.onError(a)},function(){for(var c=b.now();e.length>0;){var f=e.shift();c-f.interval<=a&&d.onNext(f.value)}d.onCompleted()})},c)},p.takeLastBufferWithTime=function(a,b){var c=this;return F(b)||(b=u),new q(function(d){var e=[];return c.subscribe(function(c){var d=b.now();for(e.push({interval:d,value:c});e.length>0&&d-e[0].interval>=a;)e.shift()},function(a){d.onError(a)},function(){for(var c=b.now(),f=[];e.length>0;){var g=e.shift();c-g.interval<=a&&f.push(g.value)}d.onNext(f),d.onCompleted()})},c)},p.takeWithTime=function(a,b){var c=this;return F(b)||(b=u),new q(function(d){return new x(b.scheduleWithRelative(a,function(){d.onCompleted()}),c.subscribe(d))},c)},p.skipWithTime=function(a,b){var c=this;return F(b)||(b=u),new q(function(d){var e=!1;return new x(b.scheduleWithRelative(a,function(){e=!0}),c.subscribe(function(a){e&&d.onNext(a)},d.onError.bind(d),d.onCompleted.bind(d)))},c)},p.skipUntilWithTime=function(a,b){F(b)||(b=u);var c=this,d=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new q(function(e){var f=!1;return new x(b[d](a,function(){f=!0}),c.subscribe(function(a){f&&e.onNext(a)},function(a){e.onError(a)},function(){e.onCompleted()}))},c)},p.takeUntilWithTime=function(a,b){F(b)||(b=u);var c=this,d=a instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new q(function(e){return new x(b[d](a,function(){e.onCompleted()}),c.subscribe(e))},c)},p.throttleFirst=function(a,b){F(b)||(b=u);var c=+a||0;if(0>=c)throw new RangeError("windowDuration cannot be less or equal zero.");var d=this;return new q(function(a){var e=0;return d.subscribe(function(d){var f=b.now();(0===e||f-e>=c)&&(e=f,a.onNext(d))},function(b){a.onError(b)},function(){a.onCompleted()})},d)},c});
+//# sourceMappingURL=rx.time.map \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.virtualtime.js b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.virtualtime.js
new file mode 100644
index 00000000000..13e42958d85
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.virtualtime.js
@@ -0,0 +1,313 @@
+// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
+
+;(function (factory) {
+ var objectTypes = {
+ 'boolean': false,
+ 'function': true,
+ 'object': true,
+ 'number': false,
+ 'string': false,
+ 'undefined': false
+ };
+
+ var root = (objectTypes[typeof window] && window) || this,
+ freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
+ freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
+ moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
+ freeGlobal = objectTypes[typeof global] && global;
+
+ if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) {
+ root = freeGlobal;
+ }
+
+ // Because of build optimizers
+ if (typeof define === 'function' && define.amd) {
+ define(['rx'], function (Rx, exports) {
+ return factory(root, exports, Rx);
+ });
+ } else if (typeof module === 'object' && module && module.exports === freeExports) {
+ module.exports = factory(root, module.exports, require('./rx'));
+ } else {
+ root.Rx = factory(root, {}, root.Rx);
+ }
+}.call(this, function (root, exp, Rx, undefined) {
+
+ // Aliases
+ var Scheduler = Rx.Scheduler,
+ PriorityQueue = Rx.internals.PriorityQueue,
+ ScheduledItem = Rx.internals.ScheduledItem,
+ SchedulePeriodicRecursive = Rx.internals.SchedulePeriodicRecursive,
+ disposableEmpty = Rx.Disposable.empty,
+ inherits = Rx.internals.inherits,
+ defaultSubComparer = Rx.helpers.defaultSubComparer,
+ notImplemented = Rx.helpers.notImplemented;
+
+ /** Provides a set of extension methods for virtual time scheduling. */
+ Rx.VirtualTimeScheduler = (function (__super__) {
+
+ function localNow() {
+ return this.toDateTimeOffset(this.clock);
+ }
+
+ function scheduleNow(state, action) {
+ return this.scheduleAbsoluteWithState(state, this.clock, action);
+ }
+
+ function scheduleRelative(state, dueTime, action) {
+ return this.scheduleRelativeWithState(state, this.toRelative(dueTime), action);
+ }
+
+ function scheduleAbsolute(state, dueTime, action) {
+ return this.scheduleRelativeWithState(state, this.toRelative(dueTime - this.now()), action);
+ }
+
+ function invokeAction(scheduler, action) {
+ action();
+ return disposableEmpty;
+ }
+
+ inherits(VirtualTimeScheduler, __super__);
+
+ /**
+ * Creates a new virtual time scheduler with the specified initial clock value and absolute time comparer.
+ *
+ * @constructor
+ * @param {Number} initialClock Initial value for the clock.
+ * @param {Function} comparer Comparer to determine causality of events based on absolute time.
+ */
+ function VirtualTimeScheduler(initialClock, comparer) {
+ this.clock = initialClock;
+ this.comparer = comparer;
+ this.isEnabled = false;
+ this.queue = new PriorityQueue(1024);
+ __super__.call(this, localNow, scheduleNow, scheduleRelative, scheduleAbsolute);
+ }
+
+ var VirtualTimeSchedulerPrototype = VirtualTimeScheduler.prototype;
+
+ /**
+ * Adds a relative time value to an absolute time value.
+ * @param {Number} absolute Absolute virtual time value.
+ * @param {Number} relative Relative virtual time value to add.
+ * @return {Number} Resulting absolute virtual time sum value.
+ */
+ VirtualTimeSchedulerPrototype.add = notImplemented;
+
+ /**
+ * Converts an absolute time to a number
+ * @param {Any} The absolute time.
+ * @returns {Number} The absolute time in ms
+ */
+ VirtualTimeSchedulerPrototype.toDateTimeOffset = notImplemented;
+
+ /**
+ * Converts the TimeSpan value to a relative virtual time value.
+ * @param {Number} timeSpan TimeSpan value to convert.
+ * @return {Number} Corresponding relative virtual time value.
+ */
+ VirtualTimeSchedulerPrototype.toRelative = notImplemented;
+
+ /**
+ * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be emulated using recursive scheduling.
+ * @param {Mixed} state Initial state passed to the action upon the first iteration.
+ * @param {Number} period Period for running the work periodically.
+ * @param {Function} action Action to be executed, potentially updating the state.
+ * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort).
+ */
+ VirtualTimeSchedulerPrototype.schedulePeriodicWithState = function (state, period, action) {
+ var s = new SchedulePeriodicRecursive(this, state, period, action);
+ return s.start();
+ };
+
+ /**
+ * Schedules an action to be executed after dueTime.
+ * @param {Mixed} state State passed to the action to be executed.
+ * @param {Number} dueTime Relative time after which to execute the action.
+ * @param {Function} action Action to be executed.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ VirtualTimeSchedulerPrototype.scheduleRelativeWithState = function (state, dueTime, action) {
+ var runAt = this.add(this.clock, dueTime);
+ return this.scheduleAbsoluteWithState(state, runAt, action);
+ };
+
+ /**
+ * Schedules an action to be executed at dueTime.
+ * @param {Number} dueTime Relative time after which to execute the action.
+ * @param {Function} action Action to be executed.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ VirtualTimeSchedulerPrototype.scheduleRelative = function (dueTime, action) {
+ return this.scheduleRelativeWithState(action, dueTime, invokeAction);
+ };
+
+ /**
+ * Starts the virtual time scheduler.
+ */
+ VirtualTimeSchedulerPrototype.start = function () {
+ if (!this.isEnabled) {
+ this.isEnabled = true;
+ do {
+ var next = this.getNext();
+ if (next !== null) {
+ this.comparer(next.dueTime, this.clock) > 0 && (this.clock = next.dueTime);
+ next.invoke();
+ } else {
+ this.isEnabled = false;
+ }
+ } while (this.isEnabled);
+ }
+ };
+
+ /**
+ * Stops the virtual time scheduler.
+ */
+ VirtualTimeSchedulerPrototype.stop = function () {
+ this.isEnabled = false;
+ };
+
+ /**
+ * Advances the scheduler's clock to the specified time, running all work till that point.
+ * @param {Number} time Absolute time to advance the scheduler's clock to.
+ */
+ VirtualTimeSchedulerPrototype.advanceTo = function (time) {
+ var dueToClock = this.comparer(this.clock, time);
+ if (this.comparer(this.clock, time) > 0) { throw new ArgumentOutOfRangeError(); }
+ if (dueToClock === 0) { return; }
+ if (!this.isEnabled) {
+ this.isEnabled = true;
+ do {
+ var next = this.getNext();
+ if (next !== null && this.comparer(next.dueTime, time) <= 0) {
+ this.comparer(next.dueTime, this.clock) > 0 && (this.clock = next.dueTime);
+ next.invoke();
+ } else {
+ this.isEnabled = false;
+ }
+ } while (this.isEnabled);
+ this.clock = time;
+ }
+ };
+
+ /**
+ * Advances the scheduler's clock by the specified relative time, running all work scheduled for that timespan.
+ * @param {Number} time Relative time to advance the scheduler's clock by.
+ */
+ VirtualTimeSchedulerPrototype.advanceBy = function (time) {
+ var dt = this.add(this.clock, time),
+ dueToClock = this.comparer(this.clock, dt);
+ if (dueToClock > 0) { throw new ArgumentOutOfRangeError(); }
+ if (dueToClock === 0) { return; }
+
+ this.advanceTo(dt);
+ };
+
+ /**
+ * Advances the scheduler's clock by the specified relative time.
+ * @param {Number} time Relative time to advance the scheduler's clock by.
+ */
+ VirtualTimeSchedulerPrototype.sleep = function (time) {
+ var dt = this.add(this.clock, time);
+ if (this.comparer(this.clock, dt) >= 0) { throw new ArgumentOutOfRangeError(); }
+
+ this.clock = dt;
+ };
+
+ /**
+ * Gets the next scheduled item to be executed.
+ * @returns {ScheduledItem} The next scheduled item.
+ */
+ VirtualTimeSchedulerPrototype.getNext = function () {
+ while (this.queue.length > 0) {
+ var next = this.queue.peek();
+ if (next.isCancelled()) {
+ this.queue.dequeue();
+ } else {
+ return next;
+ }
+ }
+ return null;
+ };
+
+ /**
+ * Schedules an action to be executed at dueTime.
+ * @param {Scheduler} scheduler Scheduler to execute the action on.
+ * @param {Number} dueTime Absolute time at which to execute the action.
+ * @param {Function} action Action to be executed.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ VirtualTimeSchedulerPrototype.scheduleAbsolute = function (dueTime, action) {
+ return this.scheduleAbsoluteWithState(action, dueTime, invokeAction);
+ };
+
+ /**
+ * Schedules an action to be executed at dueTime.
+ * @param {Mixed} state State passed to the action to be executed.
+ * @param {Number} dueTime Absolute time at which to execute the action.
+ * @param {Function} action Action to be executed.
+ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
+ */
+ VirtualTimeSchedulerPrototype.scheduleAbsoluteWithState = function (state, dueTime, action) {
+ var self = this;
+
+ function run(scheduler, state1) {
+ self.queue.remove(si);
+ return action(scheduler, state1);
+ }
+
+ var si = new ScheduledItem(this, state, run, dueTime, this.comparer);
+ this.queue.enqueue(si);
+
+ return si.disposable;
+ };
+
+ return VirtualTimeScheduler;
+ }(Scheduler));
+
+ /** Provides a virtual time scheduler that uses Date for absolute time and number for relative time. */
+ Rx.HistoricalScheduler = (function (__super__) {
+ inherits(HistoricalScheduler, __super__);
+
+ /**
+ * Creates a new historical scheduler with the specified initial clock value.
+ * @constructor
+ * @param {Number} initialClock Initial value for the clock.
+ * @param {Function} comparer Comparer to determine causality of events based on absolute time.
+ */
+ function HistoricalScheduler(initialClock, comparer) {
+ var clock = initialClock == null ? 0 : initialClock;
+ var cmp = comparer || defaultSubComparer;
+ __super__.call(this, clock, cmp);
+ }
+
+ var HistoricalSchedulerProto = HistoricalScheduler.prototype;
+
+ /**
+ * Adds a relative time value to an absolute time value.
+ * @param {Number} absolute Absolute virtual time value.
+ * @param {Number} relative Relative virtual time value to add.
+ * @return {Number} Resulting absolute virtual time sum value.
+ */
+ HistoricalSchedulerProto.add = function (absolute, relative) {
+ return absolute + relative;
+ };
+
+ HistoricalSchedulerProto.toDateTimeOffset = function (absolute) {
+ return new Date(absolute).getTime();
+ };
+
+ /**
+ * Converts the TimeSpan value to a relative virtual time value.
+ * @memberOf HistoricalScheduler
+ * @param {Number} timeSpan TimeSpan value to convert.
+ * @return {Number} Corresponding relative virtual time value.
+ */
+ HistoricalSchedulerProto.toRelative = function (timeSpan) {
+ return timeSpan;
+ };
+
+ return HistoricalScheduler;
+ }(Rx.VirtualTimeScheduler));
+
+ return Rx;
+}));
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.virtualtime.map b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.virtualtime.map
new file mode 100644
index 00000000000..cd8ab7d6c07
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.virtualtime.map
@@ -0,0 +1 @@
+{"version":3,"file":"rx.virtualtime.min.js","sources":["rx.virtualtime.js"],"names":["factory","objectTypes","boolean","function","object","number","string","undefined","root","window","this","freeExports","exports","nodeType","freeModule","module","freeGlobal","global","define","amd","Rx","require","call","exp","Scheduler","PriorityQueue","internals","ScheduledItem","SchedulePeriodicRecursive","disposableEmpty","Disposable","empty","inherits","defaultSubComparer","helpers","notImplemented","VirtualTimeScheduler","__super__","localNow","toDateTimeOffset","clock","scheduleNow","state","action","scheduleAbsoluteWithState","scheduleRelative","dueTime","scheduleRelativeWithState","toRelative","scheduleAbsolute","now","invokeAction","scheduler","initialClock","comparer","isEnabled","queue","VirtualTimeSchedulerPrototype","prototype","add","schedulePeriodicWithState","period","s","start","runAt","next","getNext","invoke","stop","advanceTo","time","dueToClock","ArgumentOutOfRangeError","advanceBy","dt","sleep","length","peek","isCancelled","dequeue","run","state1","self","remove","si","enqueue","disposable","HistoricalScheduler","cmp","HistoricalSchedulerProto","absolute","relative","Date","getTime","timeSpan"],"mappings":";CAEE,SAAUA,GACR,GAAIC,IACAC,WAAW,EACXC,YAAY,EACZC,QAAU,EACVC,QAAU,EACVC,QAAU,EACVC,WAAa,GAGbC,EAAQP,QAAmBQ,UAAWA,QAAWC,KACjDC,EAAcV,QAAmBW,WAAYA,UAAYA,QAAQC,UAAYD,QAC7EE,EAAab,QAAmBc,UAAWA,SAAWA,OAAOF,UAAYE,OAEzEC,GADgBF,GAAcA,EAAWF,UAAYD,GAAeA,EACvDV,QAAmBgB,UAAWA,SAE3CD,GAAeA,EAAWC,SAAWD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AX9BxD,EAASuD,EAAqBlD,EAc9B,IAAIoD,GAA2BF,EAAoB7B,SA0BnD,OAlBA+B,GAAyB9B,IAAM,SAAU+B,EAAUC,GACjD,MAAOD,GAAWC,GAGpBF,EAAyBlD,iBAAmB,SAAUmD,GACpD,MAAO,IAAIE,MAAKF,GAAUG,WAS5BJ,EAAyBzC,WAAa,SAAU8C,GAC9C,MAAOA,IAGFP,GACPnE,EAAGgB,sBAEIhB"} \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.virtualtime.min.js b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.virtualtime.min.js
new file mode 100644
index 00000000000..73b522bae3f
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.virtualtime.min.js
@@ -0,0 +1,3 @@
+/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
+(function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx"],function(b,d){return a(c,d,b)}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){var e=c.Scheduler,f=c.internals.PriorityQueue,g=c.internals.ScheduledItem,h=c.internals.SchedulePeriodicRecursive,i=c.Disposable.empty,j=c.internals.inherits,k=c.helpers.defaultSubComparer,l=c.helpers.notImplemented;return c.VirtualTimeScheduler=function(a){function b(){return this.toDateTimeOffset(this.clock)}function c(a,b){return this.scheduleAbsoluteWithState(a,this.clock,b)}function d(a,b,c){return this.scheduleRelativeWithState(a,this.toRelative(b),c)}function e(a,b,c){return this.scheduleRelativeWithState(a,this.toRelative(b-this.now()),c)}function k(a,b){return b(),i}function m(g,h){this.clock=g,this.comparer=h,this.isEnabled=!1,this.queue=new f(1024),a.call(this,b,c,d,e)}j(m,a);var n=m.prototype;return n.add=l,n.toDateTimeOffset=l,n.toRelative=l,n.schedulePeriodicWithState=function(a,b,c){var d=new h(this,a,b,c);return d.start()},n.scheduleRelativeWithState=function(a,b,c){var d=this.add(this.clock,b);return this.scheduleAbsoluteWithState(a,d,c)},n.scheduleRelative=function(a,b){return this.scheduleRelativeWithState(b,a,k)},n.start=function(){if(!this.isEnabled){this.isEnabled=!0;do{var a=this.getNext();null!==a?(this.comparer(a.dueTime,this.clock)>0&&(this.clock=a.dueTime),a.invoke()):this.isEnabled=!1}while(this.isEnabled)}},n.stop=function(){this.isEnabled=!1},n.advanceTo=function(a){var b=this.comparer(this.clock,a);if(this.comparer(this.clock,a)>0)throw new ArgumentOutOfRangeError;if(0!==b&&!this.isEnabled){this.isEnabled=!0;do{var c=this.getNext();null!==c&&this.comparer(c.dueTime,a)<=0?(this.comparer(c.dueTime,this.clock)>0&&(this.clock=c.dueTime),c.invoke()):this.isEnabled=!1}while(this.isEnabled);this.clock=a}},n.advanceBy=function(a){var b=this.add(this.clock,a),c=this.comparer(this.clock,b);if(c>0)throw new ArgumentOutOfRangeError;0!==c&&this.advanceTo(b)},n.sleep=function(a){var b=this.add(this.clock,a);if(this.comparer(this.clock,b)>=0)throw new ArgumentOutOfRangeError;this.clock=b},n.getNext=function(){for(;this.queue.length>0;){var a=this.queue.peek();if(!a.isCancelled())return a;this.queue.dequeue()}return null},n.scheduleAbsolute=function(a,b){return this.scheduleAbsoluteWithState(b,a,k)},n.scheduleAbsoluteWithState=function(a,b,c){function d(a,b){return e.queue.remove(f),c(a,b)}var e=this,f=new g(this,a,d,b,this.comparer);return this.queue.enqueue(f),f.disposable},m}(e),c.HistoricalScheduler=function(a){function b(b,c){var d=null==b?0:b,e=c||k;a.call(this,d,e)}j(b,a);var c=b.prototype;return c.add=function(a,b){return a+b},c.toDateTimeOffset=function(a){return new Date(a).getTime()},c.toRelative=function(a){return a},b}(c.VirtualTimeScheduler),c});
+//# sourceMappingURL=rx.virtualtime.map \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/index.js b/tools/eslint/node_modules/inquirer/node_modules/rx/index.js
new file mode 100644
index 00000000000..2a28dfe8789
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/index.js
@@ -0,0 +1,14 @@
+var Rx = require('./dist/rx');
+require('./dist/rx.aggregates');
+require('./dist/rx.async');
+require('./dist/rx.backpressure');
+require('./dist/rx.binding');
+require('./dist/rx.coincidence');
+require('./dist/rx.experimental');
+require('./dist/rx.joinpatterns');
+require('./dist/rx.sorting');
+require('./dist/rx.virtualtime');
+require('./dist/rx.testing');
+require('./dist/rx.time');
+
+module.exports = Rx;
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/license.txt b/tools/eslint/node_modules/inquirer/node_modules/rx/license.txt
new file mode 100644
index 00000000000..47d9f2b7c79
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/license.txt
@@ -0,0 +1,15 @@
+Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
+Microsoft Open Technologies would like to thank its contributors, a list
+of whom are at http://rx.codeplex.com/wikipage?title=Contributors.
+
+Licensed under the Apache License, Version 2.0 (the "License"); you
+may not use this file except in compliance with the License. You may
+obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+implied. See the License for the specific language governing permissions
+and limitations under the License.
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/logos/logo.png b/tools/eslint/node_modules/inquirer/node_modules/rx/logos/logo.png
new file mode 100644
index 00000000000..9da8fee2040
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/logos/logo.png
Binary files differ
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/package.json b/tools/eslint/node_modules/inquirer/node_modules/rx/package.json
new file mode 100644
index 00000000000..750344e946f
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/package.json
@@ -0,0 +1,80 @@
+{
+ "name": "rx",
+ "title": "Reactive Extensions for JavaScript (RxJS)",
+ "description": "Library for composing asynchronous and event-based operations in JavaScript",
+ "version": "2.5.3",
+ "homepage": "https://github.com/Reactive-Extensions/RxJS",
+ "author": {
+ "name": "Cloud Programmability Team",
+ "url": "https://github.com/Reactive-Extensions/RxJS/blob/master/authors.txt"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/Reactive-Extensions/RxJS.git"
+ },
+ "license": "Apache-2.0",
+ "bugs": {
+ "url": "https://github.com/Reactive-Extensions/RxJS/issues"
+ },
+ "jam": {
+ "main": "dist/rx.all.js"
+ },
+ "browser": {
+ "index.js": "dist/rx.all.js"
+ },
+ "dependencies": {},
+ "devDependencies": {
+ "benchmark": "*",
+ "grunt-cli": "*",
+ "grunt": "*",
+ "grunt-contrib-copy": "*",
+ "grunt-contrib-jshint": "*",
+ "grunt-contrib-connect": "*",
+ "grunt-contrib-uglify": "*",
+ "grunt-contrib-concat": "*",
+ "grunt-contrib-qunit": "*",
+ "grunt-contrib-watch": "*",
+ "grunt-saucelabs": "*",
+ "grunt-jscs": "*",
+ "load-grunt-tasks": "*"
+ },
+ "keywords": [
+ "LINQ",
+ "FRP",
+ "Reactive",
+ "Events",
+ "Rx",
+ "RxJS"
+ ],
+ "main": "index.js",
+ "scripts": {
+ "test": "grunt"
+ },
+ "gitHead": "6507118725e93498f7a52a603acf679e472f47b7",
+ "_id": "rx@2.5.3",
+ "_shasum": "21adc7d80f02002af50dae97fd9dbf248755f566",
+ "_from": "rx@>=2.4.3 <3.0.0",
+ "_npmVersion": "2.7.4",
+ "_nodeVersion": "0.12.2",
+ "_npmUser": {
+ "name": "mattpodwysocki",
+ "email": "matthew.podwysocki@gmail.com"
+ },
+ "dist": {
+ "shasum": "21adc7d80f02002af50dae97fd9dbf248755f566",
+ "tarball": "http://registry.npmjs.org/rx/-/rx-2.5.3.tgz"
+ },
+ "maintainers": [
+ {
+ "name": "vvilhonen",
+ "email": "vesa@vilhonen.com"
+ },
+ {
+ "name": "mattpodwysocki",
+ "email": "matthew.podwysocki@gmail.com"
+ }
+ ],
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/rx/-/rx-2.5.3.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/readme.md b/tools/eslint/node_modules/inquirer/node_modules/rx/readme.md
new file mode 100644
index 00000000000..3b4599dbebe
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/readme.md
@@ -0,0 +1,447 @@
+[![Build Status](https://travis-ci.org/Reactive-Extensions/RxJS.png)](https://travis-ci.org/Reactive-Extensions/RxJS)
+[![Inline docs](http://inch-ci.org/github/Reactive-Extensions/RxJS.svg?branch=master)](http://inch-ci.org/github/Reactive-Extensions/RxJS)
+[![GitHub version](http://img.shields.io/github/tag/reactive-extensions/rxjs.svg)](https://github.com/Reactive-Extensions/RxJS)
+[![NPM version](http://img.shields.io/npm/v/rx.svg)](https://npmjs.org/package/rx)
+[![Downloads](http://img.shields.io/npm/dm/rx.svg)](https://npmjs.org/package/rx)
+[![NuGet](http://img.shields.io/nuget/v/RxJS-All.svg)](http://www.nuget.org/packages/RxJS-All/)
+[![Built with Grunt](https://cdn.gruntjs.com/builtwith.png)](http://gruntjs.com/)
+
+**[The Need to go Reactive](#the-need-to-go-reactive)** |
+**[About the Reactive Extensions](#about-the-reactive-extensions)** |
+**[Batteries Included](#batteries-included)** |
+**[Why RxJS?](#why-rxjs)** |
+**[Dive In!](#dive-in)** |
+**[Resources](#resources)** |
+**[Getting Started](#getting-started)** |
+**[What about my libraries?](#what-about-my-libraries)** |
+**[Compatibility](#compatibility)** |
+**[Contributing](#contributing)** |
+**[License](#license)**
+
+# The Reactive Extensions for JavaScript (RxJS) <sup>2.5</sup>... #
+*...is a set of libraries to compose asynchronous and event-based programs using observable collections and [Array#extras](http://blogs.msdn.com/b/ie/archive/2010/12/13/ecmascript-5-part-2-array-extras.aspx) style composition in JavaScript*
+
+The project is actively developed by [Microsoft Open Technologies, Inc.](http://msopentech.com/), in collaboration with a community of open source developers.
+
+## The Need to go Reactive ##
+
+Applications, especially on the web have changed over the years from being a simple static page, to DHTML with animations, to the Ajax revolution. Each time, we're adding more complexity, more data, and asynchronous behavior to our applications. How do we manage it all? How do we scale it? By moving towards "Reactive Architectures" which are event-driven, resilient and responsive. With the Reactive Extensions, you have all the tools you need to help build these systems.
+
+## About the Reactive Extensions ##
+
+The Reactive Extensions for JavaScript (RxJS) is a set of libraries for composing asynchronous and event-based programs using observable sequences and fluent query operators that many of you already know by [Array#extras](http://blogs.msdn.com/b/ie/archive/2010/12/13/ecmascript-5-part-2-array-extras.aspx) in JavaScript. Using RxJS, developers represent asynchronous data streams with Observables, query asynchronous data streams using our many operators, and parameterize the concurrency in the asynchronous data streams using Schedulers. Simply put, RxJS = Observables + Operators + Schedulers.
+
+Whether you are authoring a web-based application in JavaScript or a server-side application in Node.js, you have to deal with asynchronous and event-based programming as a matter of course. Although some patterns are emerging such as the Promise pattern, handling exceptions, cancellation, and synchronization is difficult and error-prone.
+
+Using RxJS, you can represent multiple asynchronous data streams (that come from diverse sources, e.g., stock quote, tweets, computer events, web service requests, etc.), and subscribe to the event stream using the Observer object. The Observable notifies the subscribed Observer instance whenever an event occurs.
+
+Because observable sequences are data streams, you can query them using standard query operators implemented by the Observable type. Thus you can filter, project, aggregate, compose and perform time-based operations on multiple events easily by using these operators. In addition, there are a number of other reactive stream specific operators that allow powerful queries to be written. Cancellation, exceptions, and synchronization are also handled gracefully by using the methods on the Observable object.
+
+But the best news of all is that you already know how to program like this. Take for example the following JavaScript code, where we get some stock data and then manipulate and then iterate the results.
+
+```js
+/* Get stock data somehow */
+var source = getStockData();
+
+source
+ .filter(function (quote) {
+ return quote.price > 30;
+ })
+ .map(function (quote) {
+ return quote.price;
+ })
+ .forEach(function (price) {
+ console.log('Prices higher than $30: $' + price);
+ });
+```
+
+Now what if this data were to come as some sort of event, for example a stream, such as as a WebSocket, then we could pretty much write the same query to iterate our data, with very little change.
+
+```js
+/* Get stock data somehow */
+var source = getAsyncStockData();
+
+var subscription = source
+ .filter(function (quote) {
+ return quote.price > 30;
+ })
+ .map(function (quote) {
+ return quote.price;
+ })
+ .forEach(
+ function (price) {
+ console.log('Prices higher than $30: $' + price);
+ },
+ function (err) {
+ console.log('Something went wrong: ' + err.message);
+ });
+
+/* When we're done */
+subscription.dispose();
+```
+
+The only difference is that we can handle the errors inline with our subscription. And when we're no longer interested in receiving the data as it comes streaming in, we call `dispose` on our subscription.
+
+## Batteries Included ##
+
+Sure, there are a lot of libraries to get started with RxJS. Confused on where to get started? Start out with the complete set of operators with [`rx.all.js`](doc/libraries/rx.complete.md), then you can reduce it to the number of operators that you really need, and perhaps stick with something as small as [`rx.lite.js`](doc/libraries/rx.lite.md).
+
+This set of libraries include:
+
+- [`rx.all.js`](doc/libraries/rx.complete.md) - complete version of RxJS with all operators, minus the testing operators, and comes with a compat file for older browsers.
+- [`rx.lite.js`](doc/libraries/rx.lite.md) - lite version with event bindings, creation, time and standard query operators with a compat file for older browsers. For most operations, this is the file you'll want to use unless you want the full power of RxJS.
+- [`rx.lite.extras.js`](doc/libraries/rx.lite.extras.md) - the operators missing from rx.lite.js that can be found in rx.js.
+- [`rx.js`](doc/libraries/rx.md) - core library for ES5 compliant browsers and runtimes plus compatibility for older browsers.
+- [`rx.aggregates.js`](doc/libraries/rx.aggregates.md) - aggregation event processing query operations
+- [`rx.async.js`](doc/libraries/rx.async.md) - async operations such as events, callbacks and promises plus a compat file for older browsers.
+- [`rx.backpressure.js`](doc/libraries/rx.backpressure.md) - backpressure operators such as pause/resume and controlled.
+- [`rx.binding.js`](doc/libraries/rx.binding.md) - binding operators including multicast, publish, publishLast, publishValue, and replay
+- [`rx.coincidence.js`](doc/libraries/rx.coincidence.md) - reactive coincidence join event processing query operations
+- [`rx.experimental.js`](doc/libraries/rx.experimental.md) - experimental operators including imperative operators and forkJoin
+- [`rx.joinpatterns.js`](doc/libraries/rx.joinpatterns.md) - join patterns event processing query operations
+- [`rx.testing.js`](doc/libraries/rx.testing.md) - used to write unit tests for complex event processing queries
+- [`rx.time.js`](doc/libraries/rx.time.md) - time-based event processing query operations
+- [`rx.virtualtime.js`](doc/libraries/rx.virtualtime.md) - virtual-time-based schedulers
+
+## Why RxJS? ##
+
+One question you may ask yourself, is why RxJS? What about Promises? Promises are good for solving asynchronous operations such as querying a service with an XMLHttpRequest, where the expected behavior is one value and then completion. The Reactive Extensions for JavaScript unifies both the world of Promises, callbacks as well as evented data such as DOM Input, Web Workers, Web Sockets. Once we have unified these concepts, this enables rich composition.
+
+To give you an idea about rich composition, we can create an autocompletion service which takes the user input from a text input and then query a service, making sure not to flood the service with calls for every key stroke, but instead allow to go at a more natural pace.
+
+First, we'll reference the JavaScript files, including jQuery, although RxJS has no dependencies on jQuery...
+```html
+<script src="http://code.jquery.com/jquery.js"></script>
+<script src="rx.lite.js"></script>
+```
+Next, we'll get the user input from an input, listening to the keyup event by using the `Rx.Observable.fromEvent` method. This will either use the event binding from [jQuery](http://jquery.com), [Zepto](http://zeptojs.com/), [AngularJS](https://angularjs.org/), [Backbone.js](http://backbonejs.org/) and [Ember.js](http://emberjs.com/) if available, and if not, falls back to the native event binding. This gives you consistent ways of thinking of events depending on your framework, so there are no surprises.
+
+```js
+var $input = $('#input'),
+ $results = $('#results');
+
+/* Only get the value from each key up */
+var keyups = Rx.Observable.fromEvent($input, 'keyup')
+ .map(function (e) {
+ return e.target.value;
+ })
+ .filter(function (text) {
+ return text.length > 2;
+ });
+
+/* Now debounce the input for 500ms */
+var debounced = keyups
+ .debounce(500 /* ms */);
+
+/* Now get only distinct values, so we eliminate the arrows and other control characters */
+var distinct = debounced
+ .distinctUntilChanged();
+```
+
+Now, let's query Wikipedia! In RxJS, we can instantly bind to any [Promises A+](https://github.com/promises-aplus/promises-spec) implementation through the `Rx.Observable.fromPromise` method or by just directly returning it, and we wrap it for you.
+
+```js
+function searchWikipedia (term) {
+ return $.ajax({
+ url: 'http://en.wikipedia.org/w/api.php',
+ dataType: 'jsonp',
+ data: {
+ action: 'opensearch',
+ format: 'json',
+ search: term
+ }
+ }).promise();
+}
+```
+
+Once that is created, now we can tie together the distinct throttled input and then query the service. In this case, we'll call `flatMapLatest` to get the value and ensure that we're not introducing any out of order sequence calls.
+
+```js
+var suggestions = distinct
+ .flatMapLatest(searchWikipedia);
+```
+
+Finally, we call the `forEach` method on our observable sequence to start pulling data.
+
+```js
+suggestions.forEach(
+ function (data) {
+ $results
+ .empty()
+ .append ($.map(data[1], function (value) {
+ return $('<li>').text(value);
+ }));
+ },
+ function (error) {
+ $results
+ .empty()
+ .append($('<li>'))
+ .text('Error:' + error);
+ });
+```
+
+And there you have it!
+
+## Dive In! ##
+
+Please check out:
+
+ - [The full documentation](https://github.com/Reactive-Extensions/RxJS/tree/master/doc)
+ - [Our many great examples](https://github.com/Reactive-Extensions/RxJS/tree/master/examples)
+ - [Our design guidelines](https://github.com/Reactive-Extensions/RxJS/tree/master/doc/designguidelines)
+ - [Our contribution guidelines](https://github.com/Reactive-Extensions/RxJS/tree/master/doc/contributing)
+ - [Our complete Unit Tests](https://github.com/Reactive-Extensions/RxJS/tree/master/tests)
+ - [Our recipes](https://github.com/Reactive-Extensions/RxJS/wiki/Recipes)
+
+## Resources
+
+- Contact us
+ - [Tech Blog](http://blogs.msdn.com/b/rxteam)
+ - [Twitter @ReactiveX](https://twitter.com/ReactiveX)
+ - [Twitter @OpenAtMicrosoft](http://twitter.com/OpenAtMicrosoft)
+ - [StackOverflow rxjs](http://stackoverflow.com/questions/tagged/rxjs)
+ - [Slack](http://reactivex.slack.com)
+
+- Tutorials
+ - [The introduction to Reactive Programming you've been missing](https://gist.github.com/staltz/868e7e9bc2a7b8c1f754)
+ - [2 minute introduction to Rx](https://medium.com/@andrestaltz/2-minute-introduction-to-rx-24c8ca793877)
+ - [Learn RxJS](https://github.com/jhusain/learnrx)
+ - [RxJS Koans](https://github.com/Reactive-Extensions/RxJSKoans)
+ - [RxJS Workshop](https://github.com/Reactive-Extensions/BuildStuffWorkshop)
+ - [Rx Workshop](http://rxworkshop.codeplex.com/)
+ - [Reactive Programming and MVC](http://aaronstacy.com/writings/reactive-programming-and-mvc/)
+
+- Reference Material
+ - [Rx Marbles](http://rxmarbles.com/)
+ - [RxJS GitBook](http://xgrommx.github.io/rx-book/)
+ - [Intro to Rx](http://introtorx.com/)
+ - [101 Rx Samples Wiki](http://rxwiki.wikidot.com/101samples)
+ - [Rx Design Guidelines](https://github.com/Reactive-Extensions/RxJS/tree/master/doc/designguidelines)
+ - [Beginners Guide to Rx](http://msdn.microsoft.com/en-us/data/gg577611)
+ - [Visualizing Reactive Streams](http://jaredly.github.io/2015/03/06/visualizing-reactive-streams-hot-and-cold/)
+
+- Community Examples
+ - [React](http://facebook.github.io/react/)
+ - [Rx-React](https://github.com/fdecampredon/rx-react)
+ - [RxReact](https://github.com/AlexMost/RxReact)
+ - [cycle-react](https://github.com/pH200/cycle-react)
+ - [React RxJS Autocomplete](https://github.com/eliseumds/react-autocomplete)
+ - [React RxJS TODO MVC](https://github.com/fdecampredon/react-rxjs-todomvc)
+ - [Rx TODO MVC](https://github.com/footballradar/rx-todomvc)
+ - [React RxJS Router](https://github.com/kmcclosk/reactjs-rxjs-example)
+ - [React + RxJS + Angular 2.0 di.js TODO MVC](https://github.com/joelhooks/react-rxjs-angular-di-todomvc)
+ - [React + RxJS Reactive Cube](https://github.com/hugobessaa/cubactive)
+ - [Real-Time with React + RxJS + Meteor](https://medium.com/@bobiblazeski/functional-reactive-interfaces-e8de034de6bd)
+ - [React + RxJS Flow](https://github.com/justinwoo/react-rxjs-flow)
+ - [Reactive Widgets](https://github.com/zxbodya/reactive-widgets)
+ - [React RxJS Infinite Scroll](https://github.com/justinwoo/react-rxjs-scroll)
+ - [Flux](http://facebook.github.io/flux/)
+ - [Rx-Flux](https://github.com/fdecampredon/rx-flux)
+ - [ReactiveFlux](https://github.com/codesuki/reactive-flux)
+ - [Thundercats.js](https://github.com/r3dm/thundercats)
+ - [Flurx](https://github.com/cell303/flurx)
+ - [RR](https://github.com/winsonwq/RR)
+ - [Ember](http://emberjs.com/)
+ - [RxEmber](https://github.com/blesh/RxEmber)
+ - [AngularJS](http://angularjs.org)
+ - [Ninya.io - Angular + RxJS + rx.angular.js](https://github.com/ninya-io/ninya.io) - [Site](http://stackwho.herokuapp.com/)
+ - [The Car Game](https://github.com/mikkark/TheCarGame) - [Site](https://thecargame.herokuapp.com/) - [Blog Post](https://allthingsarchitectural.wordpress.com/2014/11/24/game-programming-with-angular-rxjs-and-node-js/)
+ - [Cycle](https://github.com/staltz/cycle)
+ - [Cycle TODO MVC](https://github.com/staltz/todomvc-cycle)
+ - [WebRx](https://github.com/oliverw/webrx)
+ - Everything else
+ - [RxVision](http://jaredly.github.io/rxvision/)
+ - [Mario Elm Example](http://fudini.github.io/rx/mario.html)
+ - [Firebase + RxJS](http://blog.cryptoguru.com/2014/11/frp-using-rxjs-and-firebase.html)
+ - [Reactive Trader](https://github.com/AdaptiveConsulting/ReactiveTrader) - [Site](https://reactivetrader.azurewebsites.net/)
+ - [NPM Dependencies](https://www.npmjs.com/browse/depended/rx)
+
+- Presentations
+ - Don't Cross the Streams - Cascadia.js 2012 [slides/demos](http://www.slideshare.net/mattpodwysocki/cascadiajs-dont-cross-the-streams) | [video](http://www.youtube.com/watch?v=FqBq4uoiG0M)
+ - Curing Your Asynchronous Blues - Strange Loop 2013 [slides/demos](https://github.com/Reactive-Extensions/StrangeLoop2013) | [video](http://www.infoq.com/presentations/rx-event-processing)
+ - Streaming and event-based programming using FRP and RxJS - FutureJS 2014 [slides/demos](https://github.com/Reactive-Extensions/FutureJS) | [video](https://www.youtube.com/watch?v=zlERo_JMGCw)
+ - [Tyrannosaurus Rx](http://yobriefca.se/presentations/tyrannosaurus-rx.pdf) - [James Hughes](http://twitter.com/kouphax)
+ - Taming Asynchronous Workflows with Functional Reactive Programming - EuroClojure - [Leonardo Borges](https://twitter.com/leonardo_borges) [slides](http://www.slideshare.net/borgesleonardo/functional-reactive-programming-compositional-event-systems) | [video](http://www.slideshare.net/borgesleonardo/functional-reactive-programming-compositional-event-systems)
+- Reactive All the Things - ng-conf 2015 - [Martin Gontovnikas](https://twitter.com/mgonto/) & [Ben Lesh](https://twitter.com/BenLesh)
+ - [Slides](http://mgonto.github.io/reactive-all-the-things-talk/#1)
+ - [Video](https://www.youtube.com/watch?v=zbBVG8bOoXk&feature=youtu.be&app=desktop)
+
+- Videos
+ - [Practical Rx with Matthew Podwysocki, Bart de Smet and Jafar Husain](http://channel9.msdn.com/posts/Bart-De-Smet-Jafar-Hussain-Matthew-Podwysocki-Pragmatic-Rx)
+ - [Netflix and RxJS](http://channel9.msdn.com/posts/Rx-and-Netflix)
+ - [Hello RxJS - Channel 9](http://channel9.msdn.com/Blogs/Charles/Introducing-RxJS-Reactive-Extensions-for-JavaScript)
+ - [MIX 2011](http://channel9.msdn.com/events/MIX/MIX11/HTM07)
+ - [RxJS Today and Tomorrow - Channel 9](http://channel9.msdn.com/Blogs/Charles/Matthew-Podwysocki-and-Bart-J-F-De-Smet-RxJS-Today-and-Tomorrow)
+ - [Reactive Extensions Videos on Channel 9](http://channel9.msdn.com/Tags/reactive+extensions)
+ - [Asynchronous JavaScript at Netflix - Netflix JavaScript Talks - Jafar Husain](https://www.youtube.com/watch?v=XRYN2xt11Ek)
+ - [Asynchronous JavaScript at Netflix - MountainWest JavaScript 2014 - Jafar Husain](https://www.youtube.com/watch?v=XE692Clb5LU)
+ - [Asynchronous JavaScript at Netflix - HTML5DevConf - Jafar Husain](https://www.youtube.com/watch?v=5uxSu-F5Kj0)
+ - [Adding Even More Fun to Functional Programming With RXJS - Ryan Anklam](https://www.youtube.com/watch?v=8EExNfm0gt4)
+ - [Reactive Angular - Devoxx France 2014 - Martin Gontovnikas](http://parleys.com/play/53677646e4b0593229b85841/chapter0/about)
+ - [Reactive Game Programming for the Discerning Hipster - JSConf 2014 - Bodil Stokke](https://www.youtube.com/watch?v=x8mmAu7ZR9Y)
+
+- Podcasts
+ - [.NET Rocks #907](http://dotnetrocks.com/default.aspx?showNum=907)
+ - [JavaScript Jabber #83](http://javascriptjabber.com/083-jsj-frp-and-rxjs-with-matthew-podwysocki/)
+
+- Articles
+ - [Your Mouse is a Database](http://queue.acm.org/detail.cfm?id=2169076)
+
+- Books
+ - [RxJS](http://xgrommx.github.io/rx-book)
+ - [Intro to Rx](http://www.amazon.com/Introduction-to-Rx-ebook/dp/B008GM3YPM/)
+ - [Programming Reactive Extensions and LINQ](http://www.amazon.com/Programming-Reactive-Extensions-Jesse-Liberty/dp/1430237473/)
+
+## Getting Started
+
+There are a number of ways to get started with RxJS. The files are available on [cdnjs](http://cdnjs.com/libraries/rxjs/) and [jsDelivr](http://www.jsdelivr.com/#!rxjs).
+
+### Custom Builds
+
+You can use the [`rx-cli`](https://www.npmjs.org/package/rx-cli) to perform custom builds to create the RxJS you want:
+
+```bash
+$ rx --lite --compat --methods select,selectmany,takeuntil,fromevent
+```
+
+### Download the Source
+
+```bash
+git clone https://github.com/Reactive-Extensions/rxjs.git
+cd ./rxjs
+```
+
+### Installing with [NPM](https://npmjs.org/)
+
+```bash`
+$ npm install rx
+$ npm install -g rx
+```
+
+### Using with Node.js and Ringo.js
+
+```js
+var Rx = require('rx');
+```
+
+### Installing with [Bower](http://bower.io/)
+
+```bash
+$ bower install rxjs
+```
+
+### Installing with [Jam](http://jamjs.org/)
+```bash
+$ jam install rx
+```
+### Installing All of RxJS via [NuGet](http://nuget.org/)
+```bash
+$ Install-Package RxJS-All
+```
+### Install individual packages via [NuGet](http://nuget.org/):
+
+ Install-Package RxJS-All
+ Install-Package RxJS-Lite
+ Install-Package RxJS-Main
+ Install-Package RxJS-Aggregates
+ Install-Package RxJS-Async
+ Install-Package RxJS-BackPressure
+ Install-Package RxJS-Binding
+ Install-Package RxJS-Coincidence
+ Install-Package RxJS-Experimental
+ Install-Package RxJS-JoinPatterns
+ Install-Package RxJS-Testing
+ Install-Package RxJS-Time
+
+### In a Browser:
+
+```html
+<!-- Just the core RxJS -->
+<script src="rx.js"></script>
+
+<!-- Or all of RxJS minus testing -->
+<script src="rx.all.js"></script>
+
+<!-- Or keeping it lite -->
+<script src="rx.lite.js"></script>
+```
+
+### Along with a number of our extras for RxJS:
+
+```html
+<script src="rx.aggregates.js"></script>
+<script src="rx.async.js"></script>
+<script src="rx.backpressure.js"></script>
+<script src="rx.binding.js"></script>
+<script src="rx.coincidencejs"></script>
+<script src="rx.experimental.js"></script>
+<script src="rx.joinpatterns.js"></script>
+<script src="rx.time.js"></script>
+<script src="rx.virtualtime.js"></script>
+<script src="rx.testing.js"></script>
+```
+
+### Using RxJS with an AMD loader such as Require.js
+
+```js
+require({
+ 'paths': {
+ 'rx': 'path/to/rx-lite.js'
+ }
+},
+['rx'], function(Rx) {
+ var obs = Rx.Observable.of(42);
+ obs.forEach(function (x) { console.log(x); });
+});
+```
+
+## What about my libraries? ##
+
+The Reactive Extensions for JavaScript have no external dependencies any library, so they'll work well with just about any library. We provide bridges and support for various libraries including:
+- [Node.js](https://www.npmjs.com/package/rx-node)
+- [React](http://facebook.github.io/react/)
+ - [Rx-React](https://github.com/fdecampredon/rx-react)
+ - [RxReact](https://github.com/AlexMost/RxReact)
+ - [cycle-react](https://github.com/pH200/cycle-react)
+- [Flux](http://facebook.github.io/flux/)
+ - [Rx-Flux](https://github.com/fdecampredon/rx-flux)
+ - [ReactiveFlux](https://github.com/codesuki/reactive-flux)
+ - [Thundercats.js](https://github.com/r3dm/thundercats)
+ - [Flurx](https://github.com/cell303/flurx)
+ - [RR](https://github.com/winsonwq/RR)
+- [Ember](http://emberjs.com/)
+ - [RxEmber](https://github.com/blesh/RxEmber)
+- [AngularJS](https://github.com/Reactive-Extensions/rx.angular.js)
+- [HTML DOM](https://github.com/Reactive-Extensions/RxJS-DOM)
+- [jQuery (1.4+)](https://github.com/Reactive-Extensions/RxJS-jQuery)
+- [MooTools](https://github.com/Reactive-Extensions/RxJS-MooTools)
+- [Dojo 1.7+](https://github.com/Reactive-Extensions/RxJS-Dojo)
+- [ExtJS](https://github.com/Reactive-Extensions/RxJS-ExtJS)
+
+## Compatibility ##
+
+RxJS has been thoroughly tested against all major browsers and supports IE6+, Chrome 4+, FireFox 1+, and Node.js v0.4+.
+
+## Contributing ##
+
+There are lots of ways to contribute to the project, and we appreciate our [contributors](https://github.com/Reactive-Extensions/RxJS/wiki/Contributors). If you wish to contribute, check out our [style guide]((https://github.com/Reactive-Extensions/RxJS/tree/master/doc/contributing)).
+
+You can contribute by reviewing and sending feedback on code checkins, suggesting and trying out new features as they are implemented, submit bugs and help us verify fixes as they are checked in, as well as submit code fixes or code contributions of your own. Note that all code submissions will be rigorously reviewed and tested by the Rx Team, and only those that meet an extremely high bar for both quality and design/roadmap appropriateness will be merged into the source.
+
+## License ##
+
+Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
+Microsoft Open Technologies would like to thank its contributors, a list
+of whom are at https://github.com/Reactive-Extensions/RxJS/wiki/Contributors.
+
+Licensed under the Apache License, Version 2.0 (the "License"); you
+may not use this file except in compliance with the License. You may
+obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+implied. See the License for the specific language governing permissions
+and limitations under the License.
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx-lite.d.ts b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx-lite.d.ts
new file mode 100644
index 00000000000..ce7c0895bd5
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx-lite.d.ts
@@ -0,0 +1,695 @@
+// DefinitelyTyped: partial
+
+// This file contains common part of defintions for rx.d.ts and rx.lite.d.ts
+// Do not include the file separately.
+
+declare module Rx {
+ export module internals {
+ function isEqual(left: any, right: any): boolean;
+ function addRef<T>(xs: Observable<T>, r: { getDisposable(): IDisposable; }): Observable<T>;
+
+ // Priority Queue for Scheduling
+ export class PriorityQueue<TTime> {
+ constructor(capacity: number);
+
+ length: number;
+
+ isHigherPriority(left: number, right: number): boolean;
+ percolate(index: number): void;
+ heapify(index: number): void;
+ peek(): ScheduledItem<TTime>;
+ removeAt(index: number): void;
+ dequeue(): ScheduledItem<TTime>;
+ enqueue(item: ScheduledItem<TTime>): void;
+ remove(item: ScheduledItem<TTime>): boolean;
+
+ static count: number;
+ }
+
+ export class ScheduledItem<TTime> {
+ constructor(scheduler: IScheduler, state: any, action: (scheduler: IScheduler, state: any) => IDisposable, dueTime: TTime, comparer?: (x: TTime, y: TTime) => number);
+
+ scheduler: IScheduler;
+ state: TTime;
+ action: (scheduler: IScheduler, state: any) => IDisposable;
+ dueTime: TTime;
+ comparer: (x: TTime, y: TTime) => number;
+ disposable: SingleAssignmentDisposable;
+
+ invoke(): void;
+ compareTo(other: ScheduledItem<TTime>): number;
+ isCancelled(): boolean;
+ invokeCore(): IDisposable;
+ }
+ }
+
+ export module config {
+ export var Promise: { new <T>(resolver: (resolvePromise: (value: T) => void, rejectPromise: (reason: any) => void) => void): IPromise<T>; };
+ }
+
+ export module helpers {
+ function noop(): void;
+ function notDefined(value: any): boolean;
+ function identity<T>(value: T): T;
+ function defaultNow(): number;
+ function defaultComparer(left: any, right: any): boolean;
+ function defaultSubComparer(left: any, right: any): number;
+ function defaultKeySerializer(key: any): string;
+ function defaultError(err: any): void;
+ function isPromise(p: any): boolean;
+ function asArray<T>(...args: T[]): T[];
+ function not(value: any): boolean;
+ function isFunction(value: any): boolean;
+ }
+
+ export interface IDisposable {
+ dispose(): void;
+ }
+
+ export class CompositeDisposable implements IDisposable {
+ constructor (...disposables: IDisposable[]);
+ constructor (disposables: IDisposable[]);
+
+ isDisposed: boolean;
+ length: number;
+
+ dispose(): void;
+ add(item: IDisposable): void;
+ remove(item: IDisposable): boolean;
+ toArray(): IDisposable[];
+ }
+
+ export class Disposable implements IDisposable {
+ constructor(action: () => void);
+
+ static create(action: () => void): IDisposable;
+ static empty: IDisposable;
+
+ dispose(): void;
+ }
+
+ // Single assignment
+ export class SingleAssignmentDisposable implements IDisposable {
+ constructor();
+
+ isDisposed: boolean;
+ current: IDisposable;
+
+ dispose(): void ;
+ getDisposable(): IDisposable;
+ setDisposable(value: IDisposable): void ;
+ }
+
+ // SerialDisposable it's an alias of SingleAssignmentDisposable
+ export class SerialDisposable extends SingleAssignmentDisposable {
+ constructor();
+ }
+
+ export class RefCountDisposable implements IDisposable {
+ constructor(disposable: IDisposable);
+
+ dispose(): void;
+
+ isDisposed: boolean;
+ getDisposable(): IDisposable;
+ }
+
+ export interface IScheduler {
+ now(): number;
+ isScheduler(value: any): boolean;
+
+ schedule(action: () => void): IDisposable;
+ scheduleWithState<TState>(state: TState, action: (scheduler: IScheduler, state: TState) => IDisposable): IDisposable;
+ scheduleWithAbsolute(dueTime: number, action: () => void): IDisposable;
+ scheduleWithAbsoluteAndState<TState>(state: TState, dueTime: number, action: (scheduler: IScheduler, state: TState) =>IDisposable): IDisposable;
+ scheduleWithRelative(dueTime: number, action: () => void): IDisposable;
+ scheduleWithRelativeAndState<TState>(state: TState, dueTime: number, action: (scheduler: IScheduler, state: TState) =>IDisposable): IDisposable;
+
+ scheduleRecursive(action: (action: () =>void ) =>void ): IDisposable;
+ scheduleRecursiveWithState<TState>(state: TState, action: (state: TState, action: (state: TState) =>void ) =>void ): IDisposable;
+ scheduleRecursiveWithAbsolute(dueTime: number, action: (action: (dueTime: number) => void) => void): IDisposable;
+ scheduleRecursiveWithAbsoluteAndState<TState>(state: TState, dueTime: number, action: (state: TState, action: (state: TState, dueTime: number) => void) => void): IDisposable;
+ scheduleRecursiveWithRelative(dueTime: number, action: (action: (dueTime: number) =>void ) =>void ): IDisposable;
+ scheduleRecursiveWithRelativeAndState<TState>(state: TState, dueTime: number, action: (state: TState, action: (state: TState, dueTime: number) =>void ) =>void ): IDisposable;
+
+ schedulePeriodic(period: number, action: () => void): IDisposable;
+ schedulePeriodicWithState<TState>(state: TState, period: number, action: (state: TState) => TState): IDisposable;
+ }
+
+ export interface Scheduler extends IScheduler {
+ }
+
+ export interface SchedulerStatic {
+ new (
+ now: () => number,
+ schedule: (state: any, action: (scheduler: IScheduler, state: any) => IDisposable) => IDisposable,
+ scheduleRelative: (state: any, dueTime: number, action: (scheduler: IScheduler, state: any) => IDisposable) => IDisposable,
+ scheduleAbsolute: (state: any, dueTime: number, action: (scheduler: IScheduler, state: any) => IDisposable) => IDisposable): Scheduler;
+
+ normalize(timeSpan: number): number;
+
+ immediate: IScheduler;
+ currentThread: ICurrentThreadScheduler;
+ timeout: IScheduler;
+ }
+
+ export var Scheduler: SchedulerStatic;
+
+ // Current Thread IScheduler
+ interface ICurrentThreadScheduler extends IScheduler {
+ scheduleRequired(): boolean;
+ }
+
+ // Notifications
+ export class Notification<T> {
+ accept(observer: IObserver<T>): void;
+ accept<TResult>(onNext: (value: T) => TResult, onError?: (exception: any) => TResult, onCompleted?: () => TResult): TResult;
+ toObservable(scheduler?: IScheduler): Observable<T>;
+ hasValue: boolean;
+ equals(other: Notification<T>): boolean;
+ kind: string;
+ value: T;
+ exception: any;
+
+ static createOnNext<T>(value: T): Notification<T>;
+ static createOnError<T>(exception: any): Notification<T>;
+ static createOnCompleted<T>(): Notification<T>;
+ }
+
+ /**
+ * Promise A+
+ */
+ export interface IPromise<T> {
+ then<R>(onFulfilled: (value: T) => IPromise<R>, onRejected: (reason: any) => IPromise<R>): IPromise<R>;
+ then<R>(onFulfilled: (value: T) => IPromise<R>, onRejected?: (reason: any) => R): IPromise<R>;
+ then<R>(onFulfilled: (value: T) => R, onRejected: (reason: any) => IPromise<R>): IPromise<R>;
+ then<R>(onFulfilled?: (value: T) => R, onRejected?: (reason: any) => R): IPromise<R>;
+ }
+
+ // Observer
+ export interface IObserver<T> {
+ onNext(value: T): void;
+ onError(exception: any): void;
+ onCompleted(): void;
+ }
+
+ export interface Observer<T> extends IObserver<T> {
+ toNotifier(): (notification: Notification<T>) => void;
+ asObserver(): Observer<T>;
+ }
+
+ interface ObserverStatic {
+ create<T>(onNext?: (value: T) => void, onError?: (exception: any) => void, onCompleted?: () => void): Observer<T>;
+ fromNotifier<T>(handler: (notification: Notification<T>, thisArg?: any) => void): Observer<T>;
+ }
+
+ export var Observer: ObserverStatic;
+
+ export interface IObservable<T> {
+ subscribe(observer: Observer<T>): IDisposable;
+ subscribe(onNext?: (value: T) => void, onError?: (exception: any) => void, onCompleted?: () => void): IDisposable;
+
+ subscribeOnNext(onNext: (value: T) => void, thisArg?: any): IDisposable;
+ subscribeOnError(onError: (exception: any) => void, thisArg?: any): IDisposable;
+ subscribeOnCompleted(onCompleted: () => void, thisArg?: any): IDisposable;
+ }
+
+ export interface Observable<T> extends IObservable<T> {
+ forEach(onNext?: (value: T) => void, onError?: (exception: any) => void, onCompleted?: () => void): IDisposable; // alias for subscribe
+ toArray(): Observable<T[]>;
+
+ catch(handler: (exception: any) => Observable<T>): Observable<T>;
+ catchException(handler: (exception: any) => Observable<T>): Observable<T>; // alias for catch
+ catch(handler: (exception: any) => IPromise<T>): Observable<T>;
+ catchException(handler: (exception: any) => IPromise<T>): Observable<T>; // alias for catch
+ catch(second: Observable<T>): Observable<T>;
+ catchException(second: Observable<T>): Observable<T>; // alias for catch
+ combineLatest<T2, TResult>(second: Observable<T2>, resultSelector: (v1: T, v2: T2) => TResult): Observable<TResult>;
+ combineLatest<T2, TResult>(second: IPromise<T2>, resultSelector: (v1: T, v2: T2) => TResult): Observable<TResult>;
+ combineLatest<T2, T3, TResult>(second: Observable<T2>, third: Observable<T3>, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable<TResult>;
+ combineLatest<T2, T3, TResult>(second: Observable<T2>, third: IPromise<T3>, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable<TResult>;
+ combineLatest<T2, T3, TResult>(second: IPromise<T2>, third: Observable<T3>, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable<TResult>;
+ combineLatest<T2, T3, TResult>(second: IPromise<T2>, third: IPromise<T3>, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable<TResult>;
+ combineLatest<T2, T3, T4, TResult>(second: Observable<T2>, third: Observable<T3>, fourth: Observable<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ combineLatest<T2, T3, T4, TResult>(second: Observable<T2>, third: Observable<T3>, fourth: IPromise<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ combineLatest<T2, T3, T4, TResult>(second: Observable<T2>, third: IPromise<T3>, fourth: Observable<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ combineLatest<T2, T3, T4, TResult>(second: Observable<T2>, third: IPromise<T3>, fourth: IPromise<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ combineLatest<T2, T3, T4, TResult>(second: IPromise<T2>, third: Observable<T3>, fourth: Observable<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ combineLatest<T2, T3, T4, TResult>(second: IPromise<T2>, third: Observable<T3>, fourth: IPromise<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ combineLatest<T2, T3, T4, TResult>(second: IPromise<T2>, third: IPromise<T3>, fourth: Observable<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ combineLatest<T2, T3, T4, TResult>(second: IPromise<T2>, third: IPromise<T3>, fourth: IPromise<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ combineLatest<T2, T3, T4, T5, TResult>(second: Observable<T2>, third: Observable<T3>, fourth: Observable<T4>, fifth: Observable<T5>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => TResult): Observable<TResult>;
+ combineLatest<TOther, TResult>(souces: Observable<TOther>[], resultSelector: (firstValue: T, ...otherValues: TOther[]) => TResult): Observable<TResult>;
+ combineLatest<TOther, TResult>(souces: IPromise<TOther>[], resultSelector: (firstValue: T, ...otherValues: TOther[]) => TResult): Observable<TResult>;
+ withLatestFrom<T2, TResult>(second: Observable<T2>, resultSelector: (v1: T, v2: T2) => TResult): Observable<TResult>;
+ withLatestFrom<T2, TResult>(second: IPromise<T2>, resultSelector: (v1: T, v2: T2) => TResult): Observable<TResult>;
+ withLatestFrom<T2, T3, TResult>(second: Observable<T2>, third: Observable<T3>, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable<TResult>;
+ withLatestFrom<T2, T3, TResult>(second: Observable<T2>, third: IPromise<T3>, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable<TResult>;
+ withLatestFrom<T2, T3, TResult>(second: IPromise<T2>, third: Observable<T3>, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable<TResult>;
+ withLatestFrom<T2, T3, TResult>(second: IPromise<T2>, third: IPromise<T3>, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable<TResult>;
+ withLatestFrom<T2, T3, T4, TResult>(second: Observable<T2>, third: Observable<T3>, fourth: Observable<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ withLatestFrom<T2, T3, T4, TResult>(second: Observable<T2>, third: Observable<T3>, fourth: IPromise<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ withLatestFrom<T2, T3, T4, TResult>(second: Observable<T2>, third: IPromise<T3>, fourth: Observable<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ withLatestFrom<T2, T3, T4, TResult>(second: Observable<T2>, third: IPromise<T3>, fourth: IPromise<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ withLatestFrom<T2, T3, T4, TResult>(second: IPromise<T2>, third: Observable<T3>, fourth: Observable<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ withLatestFrom<T2, T3, T4, TResult>(second: IPromise<T2>, third: Observable<T3>, fourth: IPromise<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ withLatestFrom<T2, T3, T4, TResult>(second: IPromise<T2>, third: IPromise<T3>, fourth: Observable<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ withLatestFrom<T2, T3, T4, TResult>(second: IPromise<T2>, third: IPromise<T3>, fourth: IPromise<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ withLatestFrom<T2, T3, T4, T5, TResult>(second: Observable<T2>, third: Observable<T3>, fourth: Observable<T4>, fifth: Observable<T5>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => TResult): Observable<TResult>;
+ withLatestFrom<TOther, TResult>(souces: Observable<TOther>[], resultSelector: (firstValue: T, ...otherValues: TOther[]) => TResult): Observable<TResult>;
+ withLatestFrom<TOther, TResult>(souces: IPromise<TOther>[], resultSelector: (firstValue: T, ...otherValues: TOther[]) => TResult): Observable<TResult>;
+ concat(...sources: Observable<T>[]): Observable<T>;
+ concat(...sources: IPromise<T>[]): Observable<T>;
+ concat(sources: Observable<T>[]): Observable<T>;
+ concat(sources: IPromise<T>[]): Observable<T>;
+ concatAll(): T;
+ concatObservable(): T; // alias for concatAll
+ concatMap<T2, R>(selector: (value: T, index: number) => Observable<T2>, resultSelector: (value1: T, value2: T2, index: number) => R): Observable<R>; // alias for selectConcat
+ concatMap<T2, R>(selector: (value: T, index: number) => IPromise<T2>, resultSelector: (value1: T, value2: T2, index: number) => R): Observable<R>; // alias for selectConcat
+ concatMap<R>(selector: (value: T, index: number) => Observable<R>): Observable<R>; // alias for selectConcat
+ concatMap<R>(selector: (value: T, index: number) => IPromise<R>): Observable<R>; // alias for selectConcat
+ concatMap<R>(sequence: Observable<R>): Observable<R>; // alias for selectConcat
+ merge(maxConcurrent: number): T;
+ merge(other: Observable<T>): Observable<T>;
+ merge(other: IPromise<T>): Observable<T>;
+ mergeAll(): T;
+ mergeObservable(): T; // alias for mergeAll
+ skipUntil<T2>(other: Observable<T2>): Observable<T>;
+ skipUntil<T2>(other: IPromise<T2>): Observable<T>;
+ switch(): T;
+ switchLatest(): T; // alias for switch
+ takeUntil<T2>(other: Observable<T2>): Observable<T>;
+ takeUntil<T2>(other: IPromise<T2>): Observable<T>;
+ zip<T2, TResult>(second: Observable<T2>, resultSelector: (v1: T, v2: T2) => TResult): Observable<TResult>;
+ zip<T2, TResult>(second: IPromise<T2>, resultSelector: (v1: T, v2: T2) => TResult): Observable<TResult>;
+ zip<T2, T3, TResult>(second: Observable<T2>, third: Observable<T3>, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable<TResult>;
+ zip<T2, T3, TResult>(second: Observable<T2>, third: IPromise<T3>, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable<TResult>;
+ zip<T2, T3, TResult>(second: IPromise<T2>, third: Observable<T3>, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable<TResult>;
+ zip<T2, T3, TResult>(second: IPromise<T2>, third: IPromise<T3>, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable<TResult>;
+ zip<T2, T3, T4, TResult>(second: Observable<T2>, third: Observable<T3>, fourth: Observable<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ zip<T2, T3, T4, TResult>(second: Observable<T2>, third: Observable<T3>, fourth: IPromise<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ zip<T2, T3, T4, TResult>(second: Observable<T2>, third: IPromise<T3>, fourth: Observable<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ zip<T2, T3, T4, TResult>(second: Observable<T2>, third: IPromise<T3>, fourth: IPromise<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ zip<T2, T3, T4, TResult>(second: IPromise<T2>, third: Observable<T3>, fourth: Observable<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ zip<T2, T3, T4, TResult>(second: IPromise<T2>, third: Observable<T3>, fourth: IPromise<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ zip<T2, T3, T4, TResult>(second: IPromise<T2>, third: IPromise<T3>, fourth: Observable<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ zip<T2, T3, T4, TResult>(second: IPromise<T2>, third: IPromise<T3>, fourth: IPromise<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ zip<T2, T3, T4, T5, TResult>(second: Observable<T2>, third: Observable<T3>, fourth: Observable<T4>, fifth: Observable<T5>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => TResult): Observable<TResult>;
+ zip<TOther, TResult>(second: Observable<TOther>[], resultSelector: (left: T, ...right: TOther[]) => TResult): Observable<TResult>;
+ zip<TOther, TResult>(second: IPromise<TOther>[], resultSelector: (left: T, ...right: TOther[]) => TResult): Observable<TResult>;
+
+ asObservable(): Observable<T>;
+ dematerialize<TOrigin>(): Observable<TOrigin>;
+ distinctUntilChanged(skipParameter: boolean, comparer: (x: T, y: T) => boolean): Observable<T>;
+ distinctUntilChanged<TValue>(keySelector?: (value: T) => TValue, comparer?: (x: TValue, y: TValue) => boolean): Observable<T>;
+ do(observer: Observer<T>): Observable<T>;
+ doAction(observer: Observer<T>): Observable<T>; // alias for do
+ tap(observer: Observer<T>): Observable<T>; // alias for do
+ do(onNext?: (value: T) => void, onError?: (exception: any) => void, onCompleted?: () => void): Observable<T>;
+ doAction(onNext?: (value: T) => void, onError?: (exception: any) => void, onCompleted?: () => void): Observable<T>; // alias for do
+ tap(onNext?: (value: T) => void, onError?: (exception: any) => void, onCompleted?: () => void): Observable<T>; // alias for do
+
+ doOnNext(onNext: (value: T) => void, thisArg?: any): Observable<T>;
+ doOnError(onError: (exception: any) => void, thisArg?: any): Observable<T>;
+ doOnCompleted(onCompleted: () => void, thisArg?: any): Observable<T>;
+ tapOnNext(onNext: (value: T) => void, thisArg?: any): Observable<T>;
+ tapOnError(onError: (exception: any) => void, thisArg?: any): Observable<T>;
+ tapOnCompleted(onCompleted: () => void, thisArg?: any): Observable<T>;
+
+ finally(action: () => void): Observable<T>;
+ finallyAction(action: () => void): Observable<T>; // alias for finally
+ ignoreElements(): Observable<T>;
+ materialize(): Observable<Notification<T>>;
+ repeat(repeatCount?: number): Observable<T>;
+ retry(retryCount?: number): Observable<T>;
+ scan<TAcc>(seed: TAcc, accumulator: (acc: TAcc, value: T) => TAcc): Observable<TAcc>;
+ scan(accumulator: (acc: T, value: T) => T): Observable<T>;
+ skipLast(count: number): Observable<T>;
+ startWith(...values: T[]): Observable<T>;
+ startWith(scheduler: IScheduler, ...values: T[]): Observable<T>;
+ takeLast(count: number): Observable<T>;
+ takeLastBuffer(count: number): Observable<T[]>;
+
+ select<TResult>(selector: (value: T, index: number, source: Observable<T>) => TResult, thisArg?: any): Observable<TResult>;
+ map<TResult>(selector: (value: T, index: number, source: Observable<T>) => TResult, thisArg?: any): Observable<TResult>; // alias for select
+ pluck<TResult>(prop: string): Observable<TResult>;
+ selectMany<TOther, TResult>(selector: (value: T) => Observable<TOther>, resultSelector: (item: T, other: TOther) => TResult): Observable<TResult>;
+ selectMany<TOther, TResult>(selector: (value: T) => IPromise<TOther>, resultSelector: (item: T, other: TOther) => TResult): Observable<TResult>;
+ selectMany<TResult>(selector: (value: T) => Observable<TResult>): Observable<TResult>;
+ selectMany<TResult>(selector: (value: T) => IPromise<TResult>): Observable<TResult>;
+ selectMany<TResult>(other: Observable<TResult>): Observable<TResult>;
+ selectMany<TResult>(other: IPromise<TResult>): Observable<TResult>;
+ flatMap<TOther, TResult>(selector: (value: T) => Observable<TOther>, resultSelector: (item: T, other: TOther) => TResult): Observable<TResult>; // alias for selectMany
+ flatMap<TOther, TResult>(selector: (value: T) => IPromise<TOther>, resultSelector: (item: T, other: TOther) => TResult): Observable<TResult>; // alias for selectMany
+ flatMap<TResult>(selector: (value: T) => Observable<TResult>): Observable<TResult>; // alias for selectMany
+ flatMap<TResult>(selector: (value: T) => IPromise<TResult>): Observable<TResult>; // alias for selectMany
+ flatMap<TResult>(other: Observable<TResult>): Observable<TResult>; // alias for selectMany
+ flatMap<TResult>(other: IPromise<TResult>): Observable<TResult>; // alias for selectMany
+
+ selectConcat<T2, R>(selector: (value: T, index: number) => Observable<T2>, resultSelector: (value1: T, value2: T2, index: number) => R): Observable<R>;
+ selectConcat<T2, R>(selector: (value: T, index: number) => IPromise<T2>, resultSelector: (value1: T, value2: T2, index: number) => R): Observable<R>;
+ selectConcat<R>(selector: (value: T, index: number) => Observable<R>): Observable<R>;
+ selectConcat<R>(selector: (value: T, index: number) => IPromise<R>): Observable<R>;
+ selectConcat<R>(sequence: Observable<R>): Observable<R>;
+
+ /**
+ * Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then
+ * transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
+ * @param selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
+ * @param [thisArg] Object to use as this when executing callback.
+ * @returns An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences
+ * and that at any point in time produces the elements of the most recent inner observable sequence that has been received.
+ */
+ selectSwitch<TResult>(selector: (value: T, index: number, source: Observable<T>) => Observable<TResult>, thisArg?: any): Observable<TResult>;
+ /**
+ * Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then
+ * transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
+ * @param selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
+ * @param [thisArg] Object to use as this when executing callback.
+ * @returns An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences
+ * and that at any point in time produces the elements of the most recent inner observable sequence that has been received.
+ */
+ flatMapLatest<TResult>(selector: (value: T, index: number, source: Observable<T>) => Observable<TResult>, thisArg?: any): Observable<TResult>; // alias for selectSwitch
+ /**
+ * Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then
+ * transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
+ * @param selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
+ * @param [thisArg] Object to use as this when executing callback.
+ * @since 2.2.28
+ * @returns An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences
+ * and that at any point in time produces the elements of the most recent inner observable sequence that has been received.
+ */
+ switchMap<TResult>(selector: (value: T, index: number, source: Observable<T>) => TResult, thisArg?: any): Observable<TResult>; // alias for selectSwitch
+
+ skip(count: number): Observable<T>;
+ skipWhile(predicate: (value: T, index: number, source: Observable<T>) => boolean, thisArg?: any): Observable<T>;
+ take(count: number, scheduler?: IScheduler): Observable<T>;
+ takeWhile(predicate: (value: T, index: number, source: Observable<T>) => boolean, thisArg?: any): Observable<T>;
+ where(predicate: (value: T, index: number, source: Observable<T>) => boolean, thisArg?: any): Observable<T>;
+ filter(predicate: (value: T, index: number, source: Observable<T>) => boolean, thisArg?: any): Observable<T>; // alias for where
+
+ /**
+ * Converts an existing observable sequence to an ES6 Compatible Promise
+ * @example
+ * var promise = Rx.Observable.return(42).toPromise(RSVP.Promise);
+ * @param promiseCtor The constructor of the promise.
+ * @returns An ES6 compatible promise with the last value from the observable sequence.
+ */
+ toPromise<TPromise extends IPromise<T>>(promiseCtor: { new (resolver: (resolvePromise: (value: T) => void, rejectPromise: (reason: any) => void) => void): TPromise; }): TPromise;
+ /**
+ * Converts an existing observable sequence to an ES6 Compatible Promise
+ * @example
+ * var promise = Rx.Observable.return(42).toPromise(RSVP.Promise);
+ *
+ * // With config
+ * Rx.config.Promise = RSVP.Promise;
+ * var promise = Rx.Observable.return(42).toPromise();
+ * @param [promiseCtor] The constructor of the promise. If not provided, it looks for it in Rx.config.Promise.
+ * @returns An ES6 compatible promise with the last value from the observable sequence.
+ */
+ toPromise(promiseCtor?: { new (resolver: (resolvePromise: (value: T) => void, rejectPromise: (reason: any) => void) => void): IPromise<T>; }): IPromise<T>;
+
+ // Experimental Flattening
+
+ /**
+ * Performs a exclusive waiting for the first to finish before subscribing to another observable.
+ * Observables that come in between subscriptions will be dropped on the floor.
+ * Can be applied on `Observable<Observable<R>>` or `Observable<IPromise<R>>`.
+ * @since 2.2.28
+ * @returns A exclusive observable with only the results that happen when subscribed.
+ */
+ exclusive<R>(): Observable<R>;
+
+ /**
+ * Performs a exclusive map waiting for the first to finish before subscribing to another observable.
+ * Observables that come in between subscriptions will be dropped on the floor.
+ * Can be applied on `Observable<Observable<I>>` or `Observable<IPromise<I>>`.
+ * @since 2.2.28
+ * @param selector Selector to invoke for every item in the current subscription.
+ * @param [thisArg] An optional context to invoke with the selector parameter.
+ * @returns {An exclusive observable with only the results that happen when subscribed.
+ */
+ exclusiveMap<I, R>(selector: (value: I, index: number, source: Observable<I>) => R, thisArg?: any): Observable<R>;
+ }
+
+ interface ObservableStatic {
+ create<T>(subscribe: (observer: Observer<T>) => IDisposable): Observable<T>;
+ create<T>(subscribe: (observer: Observer<T>) => () => void): Observable<T>;
+ create<T>(subscribe: (observer: Observer<T>) => void): Observable<T>;
+ createWithDisposable<T>(subscribe: (observer: Observer<T>) => IDisposable): Observable<T>;
+ defer<T>(observableFactory: () => Observable<T>): Observable<T>;
+ defer<T>(observableFactory: () => IPromise<T>): Observable<T>;
+ empty<T>(scheduler?: IScheduler): Observable<T>;
+
+ /**
+ * This method creates a new Observable sequence from an array object.
+ * @param array An array-like or iterable object to convert to an Observable sequence.
+ * @param mapFn Map function to call on every element of the array.
+ * @param [thisArg] The context to use calling the mapFn if provided.
+ * @param [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread.
+ */
+ from<T, TResult>(array: T[], mapFn: (value: T, index: number) => TResult, thisArg?: any, scheduler?: IScheduler): Observable<TResult>;
+ /**
+ * This method creates a new Observable sequence from an array object.
+ * @param array An array-like or iterable object to convert to an Observable sequence.
+ * @param [mapFn] Map function to call on every element of the array.
+ * @param [thisArg] The context to use calling the mapFn if provided.
+ * @param [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread.
+ */
+ from<T>(array: T[], mapFn?: (value: T, index: number) => T, thisArg?: any, scheduler?: IScheduler): Observable<T>;
+
+ /**
+ * This method creates a new Observable sequence from an array-like object.
+ * @param array An array-like or iterable object to convert to an Observable sequence.
+ * @param mapFn Map function to call on every element of the array.
+ * @param [thisArg] The context to use calling the mapFn if provided.
+ * @param [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread.
+ */
+ from<T, TResult>(array: { length: number;[index: number]: T; }, mapFn: (value: T, index: number) => TResult, thisArg?: any, scheduler?: IScheduler): Observable<TResult>;
+ /**
+ * This method creates a new Observable sequence from an array-like object.
+ * @param array An array-like or iterable object to convert to an Observable sequence.
+ * @param [mapFn] Map function to call on every element of the array.
+ * @param [thisArg] The context to use calling the mapFn if provided.
+ * @param [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread.
+ */
+ from<T>(array: { length: number;[index: number]: T; }, mapFn?: (value: T, index: number) => T, thisArg?: any, scheduler?: IScheduler): Observable<T>;
+
+ /**
+ * This method creates a new Observable sequence from an array-like or iterable object.
+ * @param array An array-like or iterable object to convert to an Observable sequence.
+ * @param [mapFn] Map function to call on every element of the array.
+ * @param [thisArg] The context to use calling the mapFn if provided.
+ * @param [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread.
+ */
+ from<T>(iterable: any, mapFn?: (value: any, index: number) => T, thisArg?: any, scheduler?: IScheduler): Observable<T>;
+
+ fromArray<T>(array: T[], scheduler?: IScheduler): Observable<T>;
+ fromArray<T>(array: { length: number;[index: number]: T; }, scheduler?: IScheduler): Observable<T>;
+
+ /**
+ * Converts an iterable into an Observable sequence
+ *
+ * @example
+ * var res = Rx.Observable.fromIterable(new Map());
+ * var res = Rx.Observable.fromIterable(function* () { yield 42; });
+ * var res = Rx.Observable.fromIterable(new Set(), Rx.Scheduler.timeout);
+ * @param generator Generator to convert from.
+ * @param [scheduler] Scheduler to run the enumeration of the input sequence on.
+ * @returns The observable sequence whose elements are pulled from the given generator sequence.
+ */
+ fromItreable<T>(generator: () => { next(): { done: boolean; value?: T; }; }, scheduler?: IScheduler): Observable<T>;
+
+ /**
+ * Converts an iterable into an Observable sequence
+ *
+ * @example
+ * var res = Rx.Observable.fromIterable(new Map());
+ * var res = Rx.Observable.fromIterable(new Set(), Rx.Scheduler.timeout);
+ * @param iterable Iterable to convert from.
+ * @param [scheduler] Scheduler to run the enumeration of the input sequence on.
+ * @returns The observable sequence whose elements are pulled from the given generator sequence.
+ */
+ fromItreable<T>(iterable: {}, scheduler?: IScheduler): Observable<T>; // todo: can't describe ES6 Iterable via TypeScript type system
+ generate<TState, TResult>(initialState: TState, condition: (state: TState) => boolean, iterate: (state: TState) => TState, resultSelector: (state: TState) => TResult, scheduler?: IScheduler): Observable<TResult>;
+ never<T>(): Observable<T>;
+
+ /**
+ * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments.
+ *
+ * @example
+ * var res = Rx.Observable.of(1, 2, 3);
+ * @since 2.2.28
+ * @returns The observable sequence whose elements are pulled from the given arguments.
+ */
+ of<T>(...values: T[]): Observable<T>;
+
+ /**
+ * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments.
+ * @example
+ * var res = Rx.Observable.ofWithScheduler(Rx.Scheduler.timeout, 1, 2, 3);
+ * @since 2.2.28
+ * @param [scheduler] A scheduler to use for scheduling the arguments.
+ * @returns The observable sequence whose elements are pulled from the given arguments.
+ */
+ ofWithScheduler<T>(scheduler?: IScheduler, ...values: T[]): Observable<T>;
+ range(start: number, count: number, scheduler?: IScheduler): Observable<number>;
+ repeat<T>(value: T, repeatCount?: number, scheduler?: IScheduler): Observable<T>;
+ return<T>(value: T, scheduler?: IScheduler): Observable<T>;
+ /**
+ * @since 2.2.28
+ */
+ just<T>(value: T, scheduler?: IScheduler): Observable<T>; // alias for return
+ returnValue<T>(value: T, scheduler?: IScheduler): Observable<T>; // alias for return
+ throw<T>(exception: Error, scheduler?: IScheduler): Observable<T>;
+ throw<T>(exception: any, scheduler?: IScheduler): Observable<T>;
+ throwException<T>(exception: Error, scheduler?: IScheduler): Observable<T>; // alias for throw
+ throwException<T>(exception: any, scheduler?: IScheduler): Observable<T>; // alias for throw
+ throwError<T>(error: Error, scheduler?: IScheduler): Observable<T>; // alias for throw
+ throwError<T>(error: any, scheduler?: IScheduler): Observable<T>; // alias for throw
+
+ catch<T>(sources: Observable<T>[]): Observable<T>;
+ catch<T>(sources: IPromise<T>[]): Observable<T>;
+ catchException<T>(sources: Observable<T>[]): Observable<T>; // alias for catch
+ catchException<T>(sources: IPromise<T>[]): Observable<T>; // alias for catch
+ catchError<T>(sources: Observable<T>[]): Observable<T>; // alias for catch
+ catchError<T>(sources: IPromise<T>[]): Observable<T>; // alias for catch
+ catch<T>(...sources: Observable<T>[]): Observable<T>;
+ catch<T>(...sources: IPromise<T>[]): Observable<T>;
+ catchException<T>(...sources: Observable<T>[]): Observable<T>; // alias for catch
+ catchException<T>(...sources: IPromise<T>[]): Observable<T>; // alias for catch
+ catchError<T>(...sources: Observable<T>[]): Observable<T>; // alias for catch
+ catchError<T>(...sources: IPromise<T>[]): Observable<T>; // alias for catch
+
+ combineLatest<T, T2, TResult>(first: Observable<T>, second: Observable<T2>, resultSelector: (v1: T, v2: T2) => TResult): Observable<TResult>;
+ combineLatest<T, T2, TResult>(first: IPromise<T>, second: Observable<T2>, resultSelector: (v1: T, v2: T2) => TResult): Observable<TResult>;
+ combineLatest<T, T2, TResult>(first: Observable<T>, second: IPromise<T2>, resultSelector: (v1: T, v2: T2) => TResult): Observable<TResult>;
+ combineLatest<T, T2, TResult>(first: IPromise<T>, second: IPromise<T2>, resultSelector: (v1: T, v2: T2) => TResult): Observable<TResult>;
+ combineLatest<T, T2, T3, TResult>(first: Observable<T>, second: Observable<T2>, third: Observable<T3>, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable<TResult>;
+ combineLatest<T, T2, T3, TResult>(first: Observable<T>, second: Observable<T2>, third: IPromise<T3>, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable<TResult>;
+ combineLatest<T, T2, T3, TResult>(first: Observable<T>, second: IPromise<T2>, third: Observable<T3>, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable<TResult>;
+ combineLatest<T, T2, T3, TResult>(first: Observable<T>, second: IPromise<T2>, third: IPromise<T3>, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable<TResult>;
+ combineLatest<T, T2, T3, TResult>(first: IPromise<T>, second: Observable<T2>, third: Observable<T3>, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable<TResult>;
+ combineLatest<T, T2, T3, TResult>(first: IPromise<T>, second: Observable<T2>, third: IPromise<T3>, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable<TResult>;
+ combineLatest<T, T2, T3, TResult>(first: IPromise<T>, second: IPromise<T2>, third: Observable<T3>, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable<TResult>;
+ combineLatest<T, T2, T3, TResult>(first: IPromise<T>, second: IPromise<T2>, third: IPromise<T3>, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable<TResult>;
+ combineLatest<T, T2, T3, T4, TResult>(first: Observable<T>, second: Observable<T2>, third: Observable<T3>, fourth: Observable<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ combineLatest<T, T2, T3, T4, TResult>(first: Observable<T>, second: Observable<T2>, third: Observable<T3>, fourth: IPromise<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ combineLatest<T, T2, T3, T4, TResult>(first: Observable<T>, second: Observable<T2>, third: IPromise<T3>, fourth: Observable<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ combineLatest<T, T2, T3, T4, TResult>(first: Observable<T>, second: Observable<T2>, third: IPromise<T3>, fourth: IPromise<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ combineLatest<T, T2, T3, T4, TResult>(first: Observable<T>, second: IPromise<T2>, third: Observable<T3>, fourth: Observable<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ combineLatest<T, T2, T3, T4, TResult>(first: Observable<T>, second: IPromise<T2>, third: Observable<T3>, fourth: IPromise<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ combineLatest<T, T2, T3, T4, TResult>(first: Observable<T>, second: IPromise<T2>, third: IPromise<T3>, fourth: Observable<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ combineLatest<T, T2, T3, T4, TResult>(first: Observable<T>, second: IPromise<T2>, third: IPromise<T3>, fourth: IPromise<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ combineLatest<T, T2, T3, T4, TResult>(first: IPromise<T>, second: Observable<T2>, third: Observable<T3>, fourth: Observable<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ combineLatest<T, T2, T3, T4, TResult>(first: IPromise<T>, second: Observable<T2>, third: Observable<T3>, fourth: IPromise<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ combineLatest<T, T2, T3, T4, TResult>(first: IPromise<T>, second: Observable<T2>, third: IPromise<T3>, fourth: Observable<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ combineLatest<T, T2, T3, T4, TResult>(first: IPromise<T>, second: Observable<T2>, third: IPromise<T3>, fourth: IPromise<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ combineLatest<T, T2, T3, T4, TResult>(first: IPromise<T>, second: IPromise<T2>, third: Observable<T3>, fourth: Observable<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ combineLatest<T, T2, T3, T4, TResult>(first: IPromise<T>, second: IPromise<T2>, third: Observable<T3>, fourth: IPromise<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ combineLatest<T, T2, T3, T4, TResult>(first: IPromise<T>, second: IPromise<T2>, third: IPromise<T3>, fourth: Observable<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ combineLatest<T, T2, T3, T4, TResult>(first: IPromise<T>, second: IPromise<T2>, third: IPromise<T3>, fourth: IPromise<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ combineLatest<T, T2, T3, T4, T5, TResult>(first: Observable<T>, second: Observable<T2>, third: Observable<T3>, fourth: Observable<T4>, fifth: Observable<T5>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => TResult): Observable<TResult>;
+ combineLatest<TOther, TResult>(souces: Observable<TOther>[], resultSelector: (...otherValues: TOther[]) => TResult): Observable<TResult>;
+ combineLatest<TOther, TResult>(souces: IPromise<TOther>[], resultSelector: (...otherValues: TOther[]) => TResult): Observable<TResult>;
+
+ withLatestFrom<T, T2, TResult>(first: Observable<T>, second: Observable<T2>, resultSelector: (v1: T, v2: T2) => TResult): Observable<TResult>;
+ withLatestFrom<T, T2, TResult>(first: IPromise<T>, second: Observable<T2>, resultSelector: (v1: T, v2: T2) => TResult): Observable<TResult>;
+ withLatestFrom<T, T2, TResult>(first: Observable<T>, second: IPromise<T2>, resultSelector: (v1: T, v2: T2) => TResult): Observable<TResult>;
+ withLatestFrom<T, T2, TResult>(first: IPromise<T>, second: IPromise<T2>, resultSelector: (v1: T, v2: T2) => TResult): Observable<TResult>;
+ withLatestFrom<T, T2, T3, TResult>(first: Observable<T>, second: Observable<T2>, third: Observable<T3>, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable<TResult>;
+ withLatestFrom<T, T2, T3, TResult>(first: Observable<T>, second: Observable<T2>, third: IPromise<T3>, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable<TResult>;
+ withLatestFrom<T, T2, T3, TResult>(first: Observable<T>, second: IPromise<T2>, third: Observable<T3>, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable<TResult>;
+ withLatestFrom<T, T2, T3, TResult>(first: Observable<T>, second: IPromise<T2>, third: IPromise<T3>, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable<TResult>;
+ withLatestFrom<T, T2, T3, TResult>(first: IPromise<T>, second: Observable<T2>, third: Observable<T3>, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable<TResult>;
+ withLatestFrom<T, T2, T3, TResult>(first: IPromise<T>, second: Observable<T2>, third: IPromise<T3>, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable<TResult>;
+ withLatestFrom<T, T2, T3, TResult>(first: IPromise<T>, second: IPromise<T2>, third: Observable<T3>, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable<TResult>;
+ withLatestFrom<T, T2, T3, TResult>(first: IPromise<T>, second: IPromise<T2>, third: IPromise<T3>, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable<TResult>;
+ withLatestFrom<T, T2, T3, T4, TResult>(first: Observable<T>, second: Observable<T2>, third: Observable<T3>, fourth: Observable<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ withLatestFrom<T, T2, T3, T4, TResult>(first: Observable<T>, second: Observable<T2>, third: Observable<T3>, fourth: IPromise<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ withLatestFrom<T, T2, T3, T4, TResult>(first: Observable<T>, second: Observable<T2>, third: IPromise<T3>, fourth: Observable<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ withLatestFrom<T, T2, T3, T4, TResult>(first: Observable<T>, second: Observable<T2>, third: IPromise<T3>, fourth: IPromise<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ withLatestFrom<T, T2, T3, T4, TResult>(first: Observable<T>, second: IPromise<T2>, third: Observable<T3>, fourth: Observable<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ withLatestFrom<T, T2, T3, T4, TResult>(first: Observable<T>, second: IPromise<T2>, third: Observable<T3>, fourth: IPromise<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ withLatestFrom<T, T2, T3, T4, TResult>(first: Observable<T>, second: IPromise<T2>, third: IPromise<T3>, fourth: Observable<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ withLatestFrom<T, T2, T3, T4, TResult>(first: Observable<T>, second: IPromise<T2>, third: IPromise<T3>, fourth: IPromise<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ withLatestFrom<T, T2, T3, T4, TResult>(first: IPromise<T>, second: Observable<T2>, third: Observable<T3>, fourth: Observable<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ withLatestFrom<T, T2, T3, T4, TResult>(first: IPromise<T>, second: Observable<T2>, third: Observable<T3>, fourth: IPromise<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ withLatestFrom<T, T2, T3, T4, TResult>(first: IPromise<T>, second: Observable<T2>, third: IPromise<T3>, fourth: Observable<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ withLatestFrom<T, T2, T3, T4, TResult>(first: IPromise<T>, second: Observable<T2>, third: IPromise<T3>, fourth: IPromise<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ withLatestFrom<T, T2, T3, T4, TResult>(first: IPromise<T>, second: IPromise<T2>, third: Observable<T3>, fourth: Observable<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ withLatestFrom<T, T2, T3, T4, TResult>(first: IPromise<T>, second: IPromise<T2>, third: Observable<T3>, fourth: IPromise<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ withLatestFrom<T, T2, T3, T4, TResult>(first: IPromise<T>, second: IPromise<T2>, third: IPromise<T3>, fourth: Observable<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ withLatestFrom<T, T2, T3, T4, TResult>(first: IPromise<T>, second: IPromise<T2>, third: IPromise<T3>, fourth: IPromise<T4>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable<TResult>;
+ withLatestFrom<T, T2, T3, T4, T5, TResult>(first: Observable<T>, second: Observable<T2>, third: Observable<T3>, fourth: Observable<T4>, fifth: Observable<T5>, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => TResult): Observable<TResult>;
+ withLatestFrom<TOther, TResult>(souces: Observable<TOther>[], resultSelector: (...otherValues: TOther[]) => TResult): Observable<TResult>;
+ withLatestFrom<TOther, TResult>(souces: IPromise<TOther>[], resultSelector: (...otherValues: TOther[]) => TResult): Observable<TResult>;
+
+ concat<T>(...sources: Observable<T>[]): Observable<T>;
+ concat<T>(...sources: IPromise<T>[]): Observable<T>;
+ concat<T>(sources: Observable<T>[]): Observable<T>;
+ concat<T>(sources: IPromise<T>[]): Observable<T>;
+ merge<T>(...sources: Observable<T>[]): Observable<T>;
+ merge<T>(...sources: IPromise<T>[]): Observable<T>;
+ merge<T>(sources: Observable<T>[]): Observable<T>;
+ merge<T>(sources: IPromise<T>[]): Observable<T>;
+ merge<T>(scheduler: IScheduler, ...sources: Observable<T>[]): Observable<T>;
+ merge<T>(scheduler: IScheduler, ...sources: IPromise<T>[]): Observable<T>;
+ merge<T>(scheduler: IScheduler, sources: Observable<T>[]): Observable<T>;
+ merge<T>(scheduler: IScheduler, sources: IPromise<T>[]): Observable<T>;
+
+ zip<T1, T2, TResult>(first: Observable<T1>, sources: Observable<T2>[], resultSelector: (item1: T1, ...right: T2[]) => TResult): Observable<TResult>;
+ zip<T1, T2, TResult>(first: Observable<T1>, sources: IPromise<T2>[], resultSelector: (item1: T1, ...right: T2[]) => TResult): Observable<TResult>;
+ zip<T1, T2, TResult>(source1: Observable<T1>, source2: Observable<T2>, resultSelector: (item1: T1, item2: T2) => TResult): Observable<TResult>;
+ zip<T1, T2, TResult>(source1: Observable<T1>, source2: IPromise<T2>, resultSelector: (item1: T1, item2: T2) => TResult): Observable<TResult>;
+ zip<T1, T2, T3, TResult>(source1: Observable<T1>, source2: Observable<T2>, source3: Observable<T3>, resultSelector: (item1: T1, item2: T2, item3: T3) => TResult): Observable<TResult>;
+ zip<T1, T2, T3, TResult>(source1: Observable<T1>, source2: Observable<T2>, source3: IPromise<T3>, resultSelector: (item1: T1, item2: T2, item3: T3) => TResult): Observable<TResult>;
+ zip<T1, T2, T3, TResult>(source1: Observable<T1>, source2: IPromise<T2>, source3: Observable<T3>, resultSelector: (item1: T1, item2: T2, item3: T3) => TResult): Observable<TResult>;
+ zip<T1, T2, T3, TResult>(source1: Observable<T1>, source2: IPromise<T2>, source3: IPromise<T3>, resultSelector: (item1: T1, item2: T2, item3: T3) => TResult): Observable<TResult>;
+ zip<T1, T2, T3, T4, TResult>(source1: Observable<T1>, source2: Observable<T2>, source3: Observable<T3>, source4: Observable<T4>, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable<TResult>;
+ zip<T1, T2, T3, T4, TResult>(source1: Observable<T1>, source2: Observable<T2>, source3: Observable<T3>, source4: IPromise<T4>, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable<TResult>;
+ zip<T1, T2, T3, T4, TResult>(source1: Observable<T1>, source2: Observable<T2>, source3: IPromise<T3>, source4: Observable<T4>, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable<TResult>;
+ zip<T1, T2, T3, T4, TResult>(source1: Observable<T1>, source2: Observable<T2>, source3: IPromise<T3>, source4: IPromise<T4>, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable<TResult>;
+ zip<T1, T2, T3, T4, TResult>(source1: Observable<T1>, source2: IPromise<T2>, source3: Observable<T3>, source4: Observable<T4>, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable<TResult>;
+ zip<T1, T2, T3, T4, TResult>(source1: Observable<T1>, source2: IPromise<T2>, source3: Observable<T3>, source4: IPromise<T4>, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable<TResult>;
+ zip<T1, T2, T3, T4, TResult>(source1: Observable<T1>, source2: IPromise<T2>, source3: IPromise<T3>, source4: Observable<T4>, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable<TResult>;
+ zip<T1, T2, T3, T4, TResult>(source1: Observable<T1>, source2: IPromise<T2>, source3: IPromise<T3>, source4: IPromise<T4>, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable<TResult>;
+ zip<T1, T2, T3, T4, T5, TResult>(source1: Observable<T1>, source2: Observable<T2>, source3: Observable<T3>, source4: Observable<T4>, source5: Observable<T5>, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4, item5: T5) => TResult): Observable<TResult>;
+ zipArray<T>(...sources: Observable<T>[]): Observable<T[]>;
+ zipArray<T>(sources: Observable<T>[]): Observable<T[]>;
+
+ /**
+ * Converts a Promise to an Observable sequence
+ * @param promise An ES6 Compliant promise.
+ * @returns An Observable sequence which wraps the existing promise success and failure.
+ */
+ fromPromise<T>(promise: IPromise<T>): Observable<T>;
+
+ prototype: any;
+ }
+
+ export var Observable: ObservableStatic;
+
+ interface ISubject<T> extends Observable<T>, Observer<T>, IDisposable {
+ hasObservers(): boolean;
+ }
+
+ export interface Subject<T> extends ISubject<T> {
+ }
+
+ interface SubjectStatic {
+ new <T>(): Subject<T>;
+ create<T>(observer?: Observer<T>, observable?: Observable<T>): ISubject<T>;
+ }
+
+ export var Subject: SubjectStatic;
+
+ export interface AsyncSubject<T> extends Subject<T> {
+ }
+
+ interface AsyncSubjectStatic {
+ new <T>(): AsyncSubject<T>;
+ }
+
+ export var AsyncSubject: AsyncSubjectStatic;
+}
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.aggregates.d.ts b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.aggregates.d.ts
new file mode 100644
index 00000000000..a3a8e15e191
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.aggregates.d.ts
@@ -0,0 +1,61 @@
+// Type definitions for RxJS-Aggregates v2.2.28
+// Project: http://rx.codeplex.com/
+// Definitions by: Carl de Billy <http://carl.debilly.net/>, Igor Oleinikov <https://github.com/Igorbek>
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+///<reference path="rx.d.ts" />
+
+declare module Rx {
+ export interface Observable<T> {
+ finalValue(): Observable<T>;
+ aggregate(accumulator: (acc: T, value: T) => T): Observable<T>;
+ aggregate<TAcc>(seed: TAcc, accumulator: (acc: TAcc, value: T) => TAcc): Observable<TAcc>;
+
+ reduce(accumulator: (acc: T, value: T) => T): Observable<T>;
+ reduce<TAcc>(accumulator: (acc: TAcc, value: T) => TAcc, seed: TAcc): Observable<TAcc>; // TS0.9.5: won't work https://typescript.codeplex.com/discussions/471751
+
+ any(predicate?: (value: T, index: number, source: Observable<T>) => boolean, thisArg?: any): Observable<boolean>;
+ some(predicate?: (value: T, index: number, source: Observable<T>) => boolean, thisArg?: any): Observable<boolean>; // alias for any
+
+ isEmpty(): Observable<boolean>;
+ all(predicate?: (value: T) => boolean, thisArg?: any): Observable<boolean>;
+ every(predicate?: (value: T) => boolean, thisArg?: any): Observable<boolean>; // alias for all
+ contains(value: T): Observable<boolean>;
+ contains<TOther>(value: TOther, comparer: (value1: T, value2: TOther) => boolean): Observable<boolean>;
+ count(predicate?: (value: T, index: number, source: Observable<T>) => boolean, thisArg?: any): Observable<number>;
+ sum(keySelector?: (value: T, index: number, source: Observable<T>) => number, thisArg?: any): Observable<number>;
+ minBy<TKey>(keySelector: (item: T) => TKey, comparer: (value1: TKey, value2: TKey) => number): Observable<T>;
+ minBy(keySelector: (item: T) => number): Observable<T>;
+ min(comparer?: (value1: T, value2: T) => number): Observable<T>;
+ maxBy<TKey>(keySelector: (item: T) => TKey, comparer: (value1: TKey, value2: TKey) => number): Observable<T>;
+ maxBy(keySelector: (item: T) => number): Observable<T>;
+ max(comparer?: (value1: T, value2: T) => number): Observable<number>;
+ average(keySelector?: (value: T, index: number, source: Observable<T>) => number, thisArg?: any): Observable<number>;
+
+ sequenceEqual<TOther>(second: Observable<TOther>, comparer: (value1: T, value2: TOther) => number): Observable<boolean>;
+ sequenceEqual<TOther>(second: IPromise<TOther>, comparer: (value1: T, value2: TOther) => number): Observable<boolean>;
+ sequenceEqual(second: Observable<T>): Observable<boolean>;
+ sequenceEqual(second: IPromise<T>): Observable<boolean>;
+ sequenceEqual<TOther>(second: TOther[], comparer: (value1: T, value2: TOther) => number): Observable<boolean>;
+ sequenceEqual(second: T[]): Observable<boolean>;
+
+ elementAt(index: number): Observable<T>;
+ elementAtOrDefault(index: number, defaultValue?: T): Observable<T>;
+
+ single(predicate?: (value: T, index: number, source: Observable<T>) => boolean, thisArg?: any): Observable<T>;
+ singleOrDefault(predicate?: (value: T, index: number, source: Observable<T>) => boolean, defaultValue?: T, thisArg?: any): Observable<T>;
+
+ first(predicate?: (value: T, index: number, source: Observable<T>) => boolean, thisArg?: any): Observable<T>;
+ firstOrDefault(predicate?: (value: T, index: number, source: Observable<T>) => boolean, defaultValue?: T, thisArg?: any): Observable<T>;
+
+ last(predicate?: (value: T, index: number, source: Observable<T>) => boolean, thisArg?: any): Observable<T>;
+ lastOrDefault(predicate?: (value: T, index: number, source: Observable<T>) => boolean, defaultValue?: T, thisArg?: any): Observable<T>;
+
+ find(predicate: (value: T, index: number, source: Observable<T>) => boolean, thisArg?: any): Observable<T>;
+ findIndex(predicate: (value: T, index: number, source: Observable<T>) => boolean, thisArg?: any): Observable<number>;
+ }
+}
+
+declare module "rx.aggregates" {
+ export = Rx;
+}
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.all.d.ts b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.all.d.ts
new file mode 100644
index 00000000000..c546477b80e
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.all.d.ts
@@ -0,0 +1,20 @@
+// Type definitions for RxJS-All v2.2.28
+// Project: http://rx.codeplex.com/
+// Definitions by: Carl de Billy <http://carl.debilly.net/>, Igor Oleinikov <https://github.com/Igorbek>
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+/// <reference path="rx.d.ts"/>
+/// <reference path="rx.aggregates.d.ts"/>
+/// <reference path="rx.time.d.ts"/>
+/// <reference path="rx.async.d.ts"/>
+/// <reference path="rx.binding.d.ts"/>
+/// <reference path="rx.coincidence.d.ts"/>
+/// <reference path="rx.experimental.d.ts"/>
+/// <reference path="rx.joinpatterns.d.ts"/>
+/// <reference path="rx.virtualtime.d.ts"/>
+/// <reference path="rx.testing.d.ts"/>
+/// <reference path="rx.backpressure.d.ts" />
+
+declare module "rx.all" {
+ export = Rx;
+} \ No newline at end of file
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.async-lite.d.ts b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.async-lite.d.ts
new file mode 100644
index 00000000000..f86dc326f34
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.async-lite.d.ts
@@ -0,0 +1,72 @@
+// DefinitelyTyped: partial
+
+// This file contains common part of defintions for rx.async.d.ts and rx.lite.d.ts
+// Do not include the file separately.
+
+///<reference path="rx-lite.d.ts"/>
+
+declare module Rx {
+ export module config {
+ /**
+ * Configuration option to determine whether to use native events only
+ */
+ export var useNativeEvents: boolean;
+ }
+
+ interface ObservableStatic {
+ /**
+ * Invokes the asynchronous function, surfacing the result through an observable sequence.
+ * @param functionAsync Asynchronous function which returns a Promise to run.
+ * @returns An observable sequence exposing the function's result value, or an exception.
+ */
+ startAsync<T>(functionAsync: () => IPromise<T>): Observable<T>;
+
+ fromCallback: {
+ // with single result callback without selector
+ <TResult>(func: (callback: (result: TResult) => any) => any, context?: any): () => Observable<TResult>;
+ <T1, TResult>(func: (arg1: T1, callback: (result: TResult) => any) => any, context?: any): (arg1: T1) => Observable<TResult>;
+ <T1, T2, TResult>(func: (arg1: T1, arg2: T2, callback: (result: TResult) => any) => any, context?: any): (arg1: T1, arg2: T2) => Observable<TResult>;
+ <T1, T2, T3, TResult>(func: (arg1: T1, arg2: T2, arg3: T3, callback: (result: TResult) => any) => any, context?: any): (arg1: T1, arg2: T2, arg3: T3) => Observable<TResult>;
+ // with any callback with selector
+ <TCallbackResult, TResult>(func: (callback: Function) => any, context: any, selector: (args: TCallbackResult[]) => TResult): () => Observable<TResult>;
+ <T1, TCallbackResult, TResult>(func: (arg1: T1, callback: Function) => any, context: any, selector: (args: TCallbackResult[]) => TResult): (arg1: T1) => Observable<TResult>;
+ <T1, T2, TCallbackResult, TResult>(func: (arg1: T1, arg2: T2, callback: Function) => any, context: any, selector: (args: TCallbackResult[]) => TResult): (arg1: T1, arg2: T2) => Observable<TResult>;
+ <T1, T2, T3, TCallbackResult, TResult>(func: (arg1: T1, arg2: T2, arg3: T3, callback: Function) => any, context: any, selector: (args: TCallbackResult[]) => TResult): (arg1: T1, arg2: T2, arg3: T3) => Observable<TResult>;
+ // with any callback without selector
+ <TResult>(func: (callback: Function) => any, context?: any): () => Observable<TResult>;
+ <T1, TResult>(func: (arg1: T1, callback: Function) => any, context?: any): (arg1: T1) => Observable<TResult>;
+ <T1, T2, TResult>(func: (arg1: T1, arg2: T2, callback: Function) => any, context?: any): (arg1: T1, arg2: T2) => Observable<TResult>;
+ <T1, T2, T3, TResult>(func: (arg1: T1, arg2: T2, arg3: T3, callback: Function) => any, context?: any): (arg1: T1, arg2: T2, arg3: T3) => Observable<TResult>;
+ // with any function with selector
+ <TCallbackResult, TResult>(func: Function, context: any, selector: (args: TCallbackResult[]) => TResult): (...args: any[]) => Observable<TResult>;
+ // with any function without selector
+ <TResult>(func: Function, context?: any): (...args: any[]) => Observable<TResult>;
+ };
+
+ fromNodeCallback: {
+ // with single result callback without selector
+ <T>(func: (callback: (err: any, result: T) => any) => any, context?: any): () => Observable<T>;
+ <T1, T>(func: (arg1: T1, callback: (err: any, result: T) => any) => any, context?: any): (arg1: T1) => Observable<T>;
+ <T1, T2, T>(func: (arg1: T1, arg2: T2, callback: (err: any, result: T) => any) => any, context?: any): (arg1: T1, arg2: T2) => Observable<T>;
+ <T1, T2, T3, T>(func: (arg1: T1, arg2: T2, arg3: T3, callback: (err: any, result: T) => any) => any, context?: any): (arg1: T1, arg2: T2, arg3: T3) => Observable<T>;
+ // with any callback with selector
+ <TC, TR>(func: (callback: Function) => any, context: any, selector: (results: TC[]) => TR): () => Observable<TR>;
+ <T1, TC, TR>(func: (arg1: T1, callback: Function) => any, context: any, selector: (results: TC[]) => TR): (arg1: T1) => Observable<TR>;
+ <T1, T2, TC, TR>(func: (arg1: T1, arg2: T2, callback: Function) => any, context: any, selector: (results: TC[]) => TR): (arg1: T1, arg2: T2) => Observable<TR>;
+ <T1, T2, T3, TC, TR>(func: (arg1: T1, arg2: T2, arg3: T3, callback: Function) => any, context: any, selector: (results: TC[]) => TR): (arg1: T1, arg2: T2, arg3: T3) => Observable<TR>;
+ // with any callback without selector
+ <TR>(func: (callback: Function) => any, context?: any): () => Observable<TR>;
+ <T1, TR>(func: (arg1: T1, callback: Function) => any, context?: any): (arg1: T1) => Observable<TR>;
+ <T1, T2, TR>(func: (arg1: T1, arg2: T2, callback: Function) => any, context?: any): (arg1: T1, arg2: T2) => Observable<TR>;
+ <T1, T2, T3, TR>(func: (arg1: T1, arg2: T2, arg3: T3, callback: Function) => any, context?: any): (arg1: T1, arg2: T2, arg3: T3) => Observable<TR>;
+ // with any function with selector
+ <TC, T>(func: Function, context: any, selector: (results: TC[]) => T): (...args: any[]) => Observable<T>;
+ // with any function without selector
+ <T>(func: Function, context?: any): (...args: any[]) => Observable<T>;
+ };
+
+ fromEvent<T>(element: NodeList, eventName: string, selector?: (arguments: any[]) => T): Observable<T>;
+ fromEvent<T>(element: Node, eventName: string, selector?: (arguments: any[]) => T): Observable<T>;
+ fromEventPattern<T>(addHandler: (handler: Function) => void, removeHandler: (handler: Function) => void, selector?: (arguments: any[])=>T): Observable<T>;
+ }
+}
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.async-tests.ts b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.async-tests.ts
new file mode 100644
index 00000000000..6fe10526c76
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.async-tests.ts
@@ -0,0 +1,84 @@
+// Tests for RxJS-Async TypeScript definitions
+// Tests by Igor Oleinikov <https://github.com/Igorbek>
+
+/// <reference path="rx.async.d.ts" />
+
+module Rx.Tests.Async {
+
+ var obsNum: Rx.Observable<number>;
+ var obsStr: Rx.Observable<string>;
+ var sch: Rx.IScheduler;
+
+ function start() {
+ obsNum = Rx.Observable.start(()=> 10, obsStr, sch);
+ obsNum = Rx.Observable.start(() => 10, obsStr);
+ obsNum = Rx.Observable.start(()=> 10);
+ }
+
+ function toAsync() {
+ obsNum = Rx.Observable.toAsync(()=> 1, sch)();
+ obsNum = Rx.Observable.toAsync((a1: number)=> a1)(1);
+ obsStr = <any>Rx.Observable.toAsync((a1: string, a2: number)=> a1 + a2.toFixed(0))("", 1);
+ obsStr = <any>Rx.Observable.toAsync((a1: string, a2: number, a3: Date)=> a1 + a2.toFixed(0) + a3.toDateString())("", 1, new Date());
+ obsStr = <any>Rx.Observable.toAsync((a1: string, a2: number, a3: Date, a4: boolean)=> a1 + a2.toFixed(0) + a3.toDateString() + (a4 ? 1 : 0))("", 1, new Date(), false);
+ }
+
+ function fromCallback() {
+ // 0 arguments
+ var func0: (cb: (result: number)=> void)=> void;
+ obsNum = Rx.Observable.fromCallback(func0)();
+ obsNum = Rx.Observable.fromCallback(func0, obsStr)();
+ obsNum = Rx.Observable.fromCallback(func0, obsStr, (results: number[]) => results[0])();
+
+ // 1 argument
+ var func1: (a: string, cb: (result: number)=> void)=> number;
+ obsNum = Rx.Observable.fromCallback(func1)("");
+ obsNum = Rx.Observable.fromCallback(func1, {})("");
+ obsNum = Rx.Observable.fromCallback(func1, {}, (results: number[]) => results[0])("");
+
+ // 2 arguments
+ var func2: (a: number, b: string, cb: (result: string) => number) => Date;
+ obsStr = Rx.Observable.fromCallback(func2)(1, "");
+ obsStr = Rx.Observable.fromCallback(func2, {})(1, "");
+ obsStr = Rx.Observable.fromCallback(func2, {}, (results: string[]) => results[0])(1, "");
+
+ // 3 arguments
+ var func3: (a: number, b: string, c: boolean, cb: (result: string) => number) => Date;
+ obsStr = Rx.Observable.fromCallback(func3)(1, "", true);
+ obsStr = Rx.Observable.fromCallback(func3, {})(1, "", true);
+ obsStr = Rx.Observable.fromCallback(func3, {}, (results: string[]) => results[0])(1, "", true);
+
+ // multiple results
+ var func0m: (cb: (result1: number, result2: number, result3: number) => void) => void;
+ obsNum = Rx.Observable.fromCallback(func0m, obsStr, (results: number[]) => results[0])();
+ var func1m: (a: string, cb: (result1: number, result2: number, result3: number) => void) => void;
+ obsNum = Rx.Observable.fromCallback(func1m, obsStr, (results: number[]) => results[0])("");
+ var func2m: (a: string, b: number, cb: (result1: string, result2: string, result3: string) => void) => void;
+ obsStr = Rx.Observable.fromCallback(func2m, obsStr, (results: string[]) => results[0])("", 10);
+ }
+
+ function toPromise() {
+ var promiseImpl: {
+ new<T>(resolver: (resolvePromise: (value: T)=> void, rejectPromise: (reason: any)=> void)=> void): Rx.IPromise<T>;
+ };
+
+ Rx.config.Promise = promiseImpl;
+
+ var p: IPromise<number> = obsNum.toPromise(promiseImpl);
+
+ p = obsNum.toPromise();
+
+ p = p.then(x=> x);
+ p = p.then(x=> p);
+ p = p.then(undefined, reason=> 10);
+ p = p.then(undefined, reason=> p);
+
+ var ps: IPromise<string> = p.then(undefined, reason=> "error");
+ ps = p.then(x=> "");
+ ps = p.then(x=> ps);
+ }
+
+ function startAsync() {
+ var o: Rx.Observable<string> = Rx.Observable.startAsync(() => <Rx.IPromise<string>>null);
+ }
+}
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.async.d.ts b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.async.d.ts
new file mode 100644
index 00000000000..f1af9a60002
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.async.d.ts
@@ -0,0 +1,43 @@
+// Type definitions for RxJS-Async v2.2.28
+// Project: http://rx.codeplex.com/
+// Definitions by: zoetrope <https://github.com/zoetrope>, Igor Oleinikov <https://github.com/Igorbek>
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+///<reference path="rx.d.ts" />
+///<reference path="rx.async-lite.d.ts" />
+
+declare module Rx {
+ interface ObservableStatic {
+ start<T>(func: () => T, context?: any, scheduler?: IScheduler): Observable<T>;
+
+ toAsync<TResult>(func: () => TResult, context?: any, scheduler?: IScheduler): () => Observable<TResult>;
+ toAsync<T1, TResult>(func: (arg1: T1) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1) => Observable<TResult>;
+ toAsync<T1, TResult>(func: (arg1?: T1) => TResult, context?: any, scheduler?: IScheduler): (arg1?: T1) => Observable<TResult>;
+ toAsync<T1, TResult>(func: (...args: T1[]) => TResult, context?: any, scheduler?: IScheduler): (...args: T1[]) => Observable<TResult>;
+ toAsync<T1, T2, TResult>(func: (arg1: T1, arg2: T2) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2: T2) => Observable<TResult>;
+ toAsync<T1, T2, TResult>(func: (arg1: T1, arg2?: T2) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2?: T2) => Observable<TResult>;
+ toAsync<T1, T2, TResult>(func: (arg1?: T1, arg2?: T2) => TResult, context?: any, scheduler?: IScheduler): (arg1?: T1, arg2?: T2) => Observable<TResult>;
+ toAsync<T1, T2, TResult>(func: (arg1: T1, ...args: T2[]) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, ...args: T2[]) => Observable<TResult>;
+ toAsync<T1, T2, TResult>(func: (arg1?: T1, ...args: T2[]) => TResult, context?: any, scheduler?: IScheduler): (arg1?: T1, ...args: T2[]) => Observable<TResult>;
+ toAsync<T1, T2, T3, TResult>(func: (arg1: T1, arg2: T2, arg3: T3) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2: T2, arg3: T3) => Observable<TResult>;
+ toAsync<T1, T2, T3, TResult>(func: (arg1: T1, arg2: T2, arg3?: T3) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2: T2, arg3?: T3) => Observable<TResult>;
+ toAsync<T1, T2, T3, TResult>(func: (arg1: T1, arg2?: T2, arg3?: T3) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2?: T2, arg3?: T3) => Observable<TResult>;
+ toAsync<T1, T2, T3, TResult>(func: (arg1?: T1, arg2?: T2, arg3?: T3) => TResult, context?: any, scheduler?: IScheduler): (arg1?: T1, arg2?: T2, arg3?: T3) => Observable<TResult>;
+ toAsync<T1, T2, T3, TResult>(func: (arg1: T1, arg2: T2, ...args: T3[]) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2: T2, ...args: T3[]) => Observable<TResult>;
+ toAsync<T1, T2, T3, TResult>(func: (arg1: T1, arg2?: T2, ...args: T3[]) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2?: T2, ...args: T3[]) => Observable<TResult>;
+ toAsync<T1, T2, T3, TResult>(func: (arg1?: T1, arg2?: T2, ...args: T3[]) => TResult, context?: any, scheduler?: IScheduler): (arg1?: T1, arg2?: T2, ...args: T3[]) => Observable<TResult>;
+ toAsync<T1, T2, T3, T4, TResult>(func: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Observable<TResult>;
+ toAsync<T1, T2, T3, T4, TResult>(func: (arg1: T1, arg2: T2, arg3: T3, arg4?: T4) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2: T2, arg3: T3, arg4?: T4) => Observable<TResult>;
+ toAsync<T1, T2, T3, T4, TResult>(func: (arg1: T1, arg2: T2, arg3?: T3, arg4?: T4) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2: T2, arg3?: T3, arg4?: T4) => Observable<TResult>;
+ toAsync<T1, T2, T3, T4, TResult>(func: (arg1: T1, arg2?: T2, arg3?: T3, arg4?: T4) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2?: T2, arg3?: T3, arg4?: T4) => Observable<TResult>;
+ toAsync<T1, T2, T3, T4, TResult>(func: (arg1?: T1, arg2?: T2, arg3?: T3, arg4?: T4) => TResult, context?: any, scheduler?: IScheduler): (arg1?: T1, arg2?: T2, arg3?: T3, arg4?: T4) => Observable<TResult>;
+ toAsync<T1, T2, T3, T4, TResult>(func: (arg1: T1, arg2: T2, arg3: T3, ...args: T4[]) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2: T2, arg3: T3, ...args: T4[]) => Observable<TResult>;
+ toAsync<T1, T2, T3, T4, TResult>(func: (arg1: T1, arg2: T2, arg3?: T3, ...args: T4[]) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2: T2, arg3?: T3, ...args: T4[]) => Observable<TResult>;
+ toAsync<T1, T2, T3, T4, TResult>(func: (arg1: T1, arg2?: T2, arg3?: T3, ...args: T4[]) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2?: T2, arg3?: T3, ...args: T4[]) => Observable<TResult>;
+ toAsync<T1, T2, T3, T4, TResult>(func: (arg1?: T1, arg2?: T2, arg3?: T3, ...args: T4[]) => TResult, context?: any, scheduler?: IScheduler): (arg1?: T1, arg2?: T2, arg3?: T3, ...args: T4[]) => Observable<TResult>;
+ }
+}
+
+declare module "rx.async" {
+ export = Rx;
+}
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.backpressure-lite.d.ts b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.backpressure-lite.d.ts
new file mode 100644
index 00000000000..9d4027be690
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.backpressure-lite.d.ts
@@ -0,0 +1,48 @@
+// DefinitelyTyped: partial
+
+// This file contains common part of defintions for rx.backpressure.d.ts and rx.lite.d.ts
+// Do not include the file separately.
+
+///<reference path="rx-lite.d.ts"/>
+
+declare module Rx {
+ export interface Observable<T> {
+ /**
+ * Pauses the underlying observable sequence based upon the observable sequence which yields true/false.
+ * @example
+ * var pauser = new Rx.Subject();
+ * var source = Rx.Observable.interval(100).pausable(pauser);
+ * @param pauser The observable sequence used to pause the underlying sequence.
+ * @returns The observable sequence which is paused based upon the pauser.
+ */
+ pausable(pauser?: Observable<boolean>): PausableObservable<T>;
+
+ /**
+ * Pauses the underlying observable sequence based upon the observable sequence which yields true/false,
+ * and yields the values that were buffered while paused.
+ * @example
+ * var pauser = new Rx.Subject();
+ * var source = Rx.Observable.interval(100).pausableBuffered(pauser);
+ * @param pauser The observable sequence used to pause the underlying sequence.
+ * @returns The observable sequence which is paused based upon the pauser.
+ */
+ pausableBuffered(pauser?: Observable<boolean>): PausableObservable<T>;
+
+ /**
+ * Attaches a controller to the observable sequence with the ability to queue.
+ * @example
+ * var source = Rx.Observable.interval(100).controlled();
+ * source.request(3); // Reads 3 values
+ */
+ controlled(enableQueue?: boolean): ControlledObservable<T>;
+ }
+
+ export interface ControlledObservable<T> extends Observable<T> {
+ request(numberOfItems?: number): IDisposable;
+ }
+
+ export interface PausableObservable<T> extends Observable<T> {
+ pause(): void;
+ resume(): void;
+ }
+}
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.backpressure-tests.ts b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.backpressure-tests.ts
new file mode 100644
index 00000000000..f036a1dc378
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.backpressure-tests.ts
@@ -0,0 +1,22 @@
+// Tests for RxJS-BackPressure TypeScript definitions
+// Tests by Igor Oleinikov <https://github.com/Igorbek>
+
+///<reference path="rx.d.ts" />
+///<reference path="rx.backpressure.d.ts" />
+
+function testPausable() {
+ var o: Rx.Observable<string>;
+
+ var pauser = new Rx.Subject<boolean>();
+
+ var p = o.pausable(pauser);
+ p = o.pausableBuffered(pauser);
+}
+
+function testControlled() {
+ var o: Rx.Observable<string>;
+ var c = o.controlled();
+
+ var d: Rx.IDisposable = c.request();
+ d = c.request(5);
+}
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.backpressure.d.ts b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.backpressure.d.ts
new file mode 100644
index 00000000000..549cd870a2b
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.backpressure.d.ts
@@ -0,0 +1,11 @@
+// Type definitions for RxJS-BackPressure v2.3.12
+// Project: http://rx.codeplex.com/
+// Definitions by: Igor Oleinikov <https://github.com/Igorbek>
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+///<reference path="rx.d.ts" />
+///<reference path="rx.backpressure-lite.d.ts" />
+
+declare module "rx.backpressure" {
+ export = Rx;
+}
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.binding-lite.d.ts b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.binding-lite.d.ts
new file mode 100644
index 00000000000..86db8922cb7
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.binding-lite.d.ts
@@ -0,0 +1,73 @@
+// DefinitelyTyped: partial
+
+// This file contains common part of defintions for rx.binding.d.ts and rx.lite.d.ts
+// Do not include the file separately.
+
+///<reference path="rx-lite.d.ts"/>
+
+declare module Rx {
+ export interface BehaviorSubject<T> extends Subject<T> {
+ getValue(): T;
+ }
+
+ interface BehaviorSubjectStatic {
+ new <T>(initialValue: T): BehaviorSubject<T>;
+ }
+
+ export var BehaviorSubject: BehaviorSubjectStatic;
+
+ export interface ReplaySubject<T> extends Subject<T> {
+ }
+
+ interface ReplaySubjectStatic {
+ new <T>(bufferSize?: number, window?: number, scheduler?: IScheduler): ReplaySubject<T>;
+ }
+
+ export var ReplaySubject: ReplaySubjectStatic;
+
+ interface ConnectableObservable<T> extends Observable<T> {
+ connect(): IDisposable;
+ refCount(): Observable<T>;
+ }
+
+ interface ConnectableObservableStatic {
+ new <T>(): ConnectableObservable<T>;
+ }
+
+ export var ConnectableObservable: ConnectableObservableStatic;
+
+ export interface Observable<T> {
+ multicast(subject: Observable<T>): ConnectableObservable<T>;
+ multicast<TResult>(subjectSelector: () => ISubject<T>, selector: (source: ConnectableObservable<T>) => Observable<T>): Observable<T>;
+ publish(): ConnectableObservable<T>;
+ publish<TResult>(selector: (source: ConnectableObservable<T>) => Observable<TResult>): Observable<TResult>;
+ /**
+ * Returns an observable sequence that shares a single subscription to the underlying sequence.
+ * This operator is a specialization of publish which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed.
+ *
+ * @example
+ * var res = source.share();
+ *
+ * @returns An observable sequence that contains the elements of a sequence produced by multicasting the source sequence.
+ */
+ share(): Observable<T>;
+ publishLast(): ConnectableObservable<T>;
+ publishLast<TResult>(selector: (source: ConnectableObservable<T>) => Observable<TResult>): Observable<TResult>;
+ publishValue(initialValue: T): ConnectableObservable<T>;
+ publishValue<TResult>(selector: (source: ConnectableObservable<T>) => Observable<TResult>, initialValue: T): Observable<TResult>;
+ /**
+ * Returns an observable sequence that shares a single subscription to the underlying sequence and starts with an initialValue.
+ * This operator is a specialization of publishValue which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed.
+ *
+ * @example
+ * var res = source.shareValue(42);
+ *
+ * @param initialValue Initial value received by observers upon subscription.
+ * @returns An observable sequence that contains the elements of a sequence produced by multicasting the source sequence.
+ */
+ shareValue(initialValue: T): Observable<T>;
+ replay(selector?: boolean, bufferSize?: number, window?: number, scheduler?: IScheduler): ConnectableObservable<T>; // hack to catch first omitted parameter
+ replay(selector: (source: ConnectableObservable<T>) => Observable<T>, bufferSize?: number, window?: number, scheduler?: IScheduler): Observable<T>;
+ shareReplay(bufferSize?: number, window?: number, scheduler?: IScheduler): Observable<T>;
+ }
+}
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.binding.d.ts b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.binding.d.ts
new file mode 100644
index 00000000000..2bd4c5b01f5
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.binding.d.ts
@@ -0,0 +1,11 @@
+// Type definitions for RxJS-Binding v2.2.28
+// Project: http://rx.codeplex.com/
+// Definitions by: Carl de Billy <http://carl.debilly.net/>, Igor Oleinikov <https://github.com/Igorbek>
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+///<reference path="rx.d.ts" />
+///<reference path="rx.binding-lite.d.ts" />
+
+declare module "rx.binding" {
+ export = Rx;
+}
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.coincidence-lite.d.ts b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.coincidence-lite.d.ts
new file mode 100644
index 00000000000..ca1cc734738
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.coincidence-lite.d.ts
@@ -0,0 +1,34 @@
+// DefinitelyTyped: partial
+
+// This file contains common part of defintions for rx.time.d.ts and rx.lite.d.ts
+// Do not include the file separately.
+
+///<reference path="rx-lite.d.ts" />
+
+declare module Rx {
+
+ interface Observable<T> {
+ /**
+ * Returns a new observable that triggers on the second and subsequent triggerings of the input observable.
+ * The Nth triggering of the input observable passes the arguments from the N-1th and Nth triggering as a pair.
+ * The argument passed to the N-1th triggering is held in hidden internal state until the Nth triggering occurs.
+ * @returns An observable that triggers on successive pairs of observations from the input observable as an array.
+ */
+ pairwise(): Observable<T[]>;
+
+ /**
+ * Returns two observables which partition the observations of the source by the given function.
+ * The first will trigger observations for those values for which the predicate returns true.
+ * The second will trigger observations for those values where the predicate returns false.
+ * The predicate is executed once for each subscribed observer.
+ * Both also propagate all error observations arising from the source and each completes
+ * when the source completes.
+ * @param predicate
+ * The function to determine which output Observable will trigger a particular observation.
+ * @returns
+ * An array of observables. The first triggers when the predicate returns true,
+ * and the second triggers when the predicate returns false.
+ */
+ partition(predicate: (value: T, index: number, source: Observable<T>) => boolean, thisArg: any): Observable<T>[];
+ }
+}
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.coincidence.d.ts b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.coincidence.d.ts
new file mode 100644
index 00000000000..d06166224af
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.coincidence.d.ts
@@ -0,0 +1,36 @@
+// Type definitions for RxJS-Coincidence v2.2.28
+// Project: http://rx.codeplex.com/
+// Definitions by: Carl de Billy <http://carl.debilly.net/>, Igor Oleinikov <https://github.com/Igorbek>
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+///<reference path="rx.d.ts" />
+///<reference path="rx.coincidence-lite.d.ts" />
+
+declare module Rx {
+
+ interface Observable<T> {
+ join<TRight, TDurationLeft, TDurationRight, TResult>(
+ right: Observable<TRight>,
+ leftDurationSelector: (leftItem: T) => Observable<TDurationLeft>,
+ rightDurationSelector: (rightItem: TRight) => Observable<TDurationRight>,
+ resultSelector: (leftItem: T, rightItem: TRight) => TResult): Observable<TResult>;
+
+ groupJoin<TRight, TDurationLeft, TDurationRight, TResult>(
+ right: Observable<TRight>,
+ leftDurationSelector: (leftItem: T) => Observable<TDurationLeft>,
+ rightDurationSelector: (rightItem: TRight) => Observable<TDurationRight>,
+ resultSelector: (leftItem: T, rightItem: Observable<TRight>) => TResult): Observable<TResult>;
+
+ window<TWindowOpening>(windowOpenings: Observable<TWindowOpening>): Observable<Observable<T>>;
+ window<TWindowClosing>(windowClosingSelector: () => Observable<TWindowClosing>): Observable<Observable<T>>;
+ window<TWindowOpening, TWindowClosing>(windowOpenings: Observable<TWindowOpening>, windowClosingSelector: () => Observable<TWindowClosing>): Observable<Observable<T>>;
+
+ buffer<TBufferOpening>(bufferOpenings: Observable<TBufferOpening>): Observable<T[]>;
+ buffer<TBufferClosing>(bufferClosingSelector: () => Observable<TBufferClosing>): Observable<T[]>;
+ buffer<TBufferOpening, TBufferClosing>(bufferOpenings: Observable<TBufferOpening>, bufferClosingSelector: () => Observable<TBufferClosing>): Observable<T[]>;
+ }
+}
+
+declare module "rx.coincidence" {
+ export = Rx;
+}
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.d.ts b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.d.ts
new file mode 100644
index 00000000000..a6e46e36d4c
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.d.ts
@@ -0,0 +1,67 @@
+// Type definitions for RxJS v2.2.28
+// Project: http://rx.codeplex.com/
+// Definitions by: gsino <http://www.codeplex.com/site/users/view/gsino>, Igor Oleinikov <https://github.com/Igorbek>
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+///<reference path="rx-lite.d.ts"/>
+
+declare module Rx {
+ export interface IScheduler {
+ catch(handler: (exception: any) => boolean): IScheduler;
+ catchException(handler: (exception: any) => boolean): IScheduler;
+ }
+
+ // Observer
+ export interface Observer<T> {
+ checked(): Observer<any>;
+ }
+
+ interface ObserverStatic {
+ /**
+ * Schedules the invocation of observer methods on the given scheduler.
+ * @param scheduler Scheduler to schedule observer messages on.
+ * @returns Observer whose messages are scheduled on the given scheduler.
+ */
+ notifyOn<T>(scheduler: IScheduler): Observer<T>;
+ }
+
+ export interface Observable<T> {
+ observeOn(scheduler: IScheduler): Observable<T>;
+ subscribeOn(scheduler: IScheduler): Observable<T>;
+
+ amb(rightSource: Observable<T>): Observable<T>;
+ amb(rightSource: IPromise<T>): Observable<T>;
+ onErrorResumeNext(second: Observable<T>): Observable<T>;
+ onErrorResumeNext(second: IPromise<T>): Observable<T>;
+ bufferWithCount(count: number, skip?: number): Observable<T[]>;
+ windowWithCount(count: number, skip?: number): Observable<Observable<T>>;
+ defaultIfEmpty(defaultValue?: T): Observable<T>;
+ distinct(skipParameter: boolean, valueSerializer: (value: T) => string): Observable<T>;
+ distinct<TKey>(keySelector?: (value: T) => TKey, keySerializer?: (key: TKey) => string): Observable<T>;
+ groupBy<TKey, TElement>(keySelector: (value: T) => TKey, skipElementSelector?: boolean, keySerializer?: (key: TKey) => string): Observable<GroupedObservable<TKey, T>>;
+ groupBy<TKey, TElement>(keySelector: (value: T) => TKey, elementSelector: (value: T) => TElement, keySerializer?: (key: TKey) => string): Observable<GroupedObservable<TKey, TElement>>;
+ groupByUntil<TKey, TDuration>(keySelector: (value: T) => TKey, skipElementSelector: boolean, durationSelector: (group: GroupedObservable<TKey, T>) => Observable<TDuration>, keySerializer?: (key: TKey) => string): Observable<GroupedObservable<TKey, T>>;
+ groupByUntil<TKey, TElement, TDuration>(keySelector: (value: T) => TKey, elementSelector: (value: T) => TElement, durationSelector: (group: GroupedObservable<TKey, TElement>) => Observable<TDuration>, keySerializer?: (key: TKey) => string): Observable<GroupedObservable<TKey, TElement>>;
+ }
+
+ interface ObservableStatic {
+ using<TSource, TResource extends IDisposable>(resourceFactory: () => TResource, observableFactory: (resource: TResource) => Observable<TSource>): Observable<TSource>;
+ amb<T>(...sources: Observable<T>[]): Observable<T>;
+ amb<T>(...sources: IPromise<T>[]): Observable<T>;
+ amb<T>(sources: Observable<T>[]): Observable<T>;
+ amb<T>(sources: IPromise<T>[]): Observable<T>;
+ onErrorResumeNext<T>(...sources: Observable<T>[]): Observable<T>;
+ onErrorResumeNext<T>(...sources: IPromise<T>[]): Observable<T>;
+ onErrorResumeNext<T>(sources: Observable<T>[]): Observable<T>;
+ onErrorResumeNext<T>(sources: IPromise<T>[]): Observable<T>;
+ }
+
+ interface GroupedObservable<TKey, TElement> extends Observable<TElement> {
+ key: TKey;
+ underlyingObservable: Observable<TElement>;
+ }
+}
+
+declare module "rx" {
+ export = Rx
+}
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.experimental.d.ts b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.experimental.d.ts
new file mode 100644
index 00000000000..e80ca03294c
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.experimental.d.ts
@@ -0,0 +1,321 @@
+// Type definitions for RxJS-Experimental v2.2.28
+// Project: https://github.com/Reactive-Extensions/RxJS/
+// Definitions by: Igor Oleinikov <https://github.com/Igorbek>
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+/// <reference path="rx.d.ts"/>
+
+declare module Rx {
+
+ interface Observable<T> {
+ /**
+ * Returns an observable sequence that is the result of invoking the selector on the source sequence, without sharing subscriptions.
+ * This operator allows for a fluent style of writing queries that use the same sequence multiple times.
+ *
+ * @param selector Selector function which can use the source sequence as many times as needed, without sharing subscriptions to the source sequence.
+ * @returns An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
+ */
+ let<TResult>(selector: (source: Observable<T>) => Observable<TResult>): Observable<TResult>;
+
+ /**
+ * Returns an observable sequence that is the result of invoking the selector on the source sequence, without sharing subscriptions.
+ * This operator allows for a fluent style of writing queries that use the same sequence multiple times.
+ *
+ * @param selector Selector function which can use the source sequence as many times as needed, without sharing subscriptions to the source sequence.
+ * @returns An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
+ */
+ letBind<TResult>(selector: (source: Observable<T>) => Observable<TResult>): Observable<TResult>;
+
+ /**
+ * Repeats source as long as condition holds emulating a do while loop.
+ * @param condition The condition which determines if the source will be repeated.
+ * @returns An observable sequence which is repeated as long as the condition holds.
+ */
+ doWhile(condition: () => boolean): Observable<T>;
+
+ /**
+ * Expands an observable sequence by recursively invoking selector.
+ *
+ * @param selector Selector function to invoke for each produced element, resulting in another sequence to which the selector will be invoked recursively again.
+ * @param [scheduler] Scheduler on which to perform the expansion. If not provided, this defaults to the current thread scheduler.
+ * @returns An observable sequence containing all the elements produced by the recursive expansion.
+ */
+ expand(selector: (item: T) => Observable<T>, scheduler?: IScheduler): Observable<T>;
+
+ /**
+ * Runs two observable sequences in parallel and combines their last elemenets.
+ *
+ * @param second Second observable sequence or promise.
+ * @param resultSelector Result selector function to invoke with the last elements of both sequences.
+ * @returns An observable sequence with the result of calling the selector function with the last elements of both input sequences.
+ */
+ forkJoin<TSecond, TResult>(second: Observable<TSecond>, resultSelector: (left: T, right: TSecond) => TResult): Observable<TResult>;
+ forkJoin<TSecond, TResult>(second: IPromise<TSecond>, resultSelector: (left: T, right: TSecond) => TResult): Observable<TResult>;
+
+ /**
+ * Comonadic bind operator.
+ * @param selector A transform function to apply to each element.
+ * @param [scheduler] Scheduler used to execute the operation. If not specified, defaults to the ImmediateScheduler.
+ * @returns An observable sequence which results from the comonadic bind operation.
+ */
+ manySelect<TResult>(selector: (item: Observable<T>, index: number, source: Observable<T>) => TResult, scheduler?: IScheduler): Observable<TResult>;
+ }
+
+ interface ObservableStatic {
+ /**
+ * Determines whether an observable collection contains values. There is an alias for this method called 'ifThen' for browsers <IE9
+ *
+ * @example
+ * res = Rx.Observable.if(condition, obs1, obs2);
+ * @param condition The condition which determines if the thenSource or elseSource will be run.
+ * @param thenSource The observable sequence or promise that will be run if the condition function returns true.
+ * @param elseSource The observable sequence or promise that will be run if the condition function returns false.
+ * @returns An observable sequence which is either the thenSource or elseSource.
+ */
+ if<T>(condition: () => boolean, thenSource: Observable<T>, elseSource: Observable<T>): Observable<T>;
+ if<T>(condition: () => boolean, thenSource: Observable<T>, elseSource: IPromise<T>): Observable<T>;
+ if<T>(condition: () => boolean, thenSource: IPromise<T>, elseSource: Observable<T>): Observable<T>;
+ if<T>(condition: () => boolean, thenSource: IPromise<T>, elseSource: IPromise<T>): Observable<T>;
+
+ /**
+ * Determines whether an observable collection contains values. There is an alias for this method called 'ifThen' for browsers <IE9
+ *
+ * @example
+ * res = Rx.Observable.if(condition, obs1, scheduler);
+ * @param condition The condition which determines if the thenSource or empty sequence will be run.
+ * @param thenSource The observable sequence or promise that will be run if the condition function returns true.
+ * @param scheduler Scheduler used to create Rx.Observabe.Empty.
+ * @returns An observable sequence which is either the thenSource or empty sequence.
+ */
+ if<T>(condition: () => boolean, thenSource: Observable<T>, scheduler?: IScheduler): Observable<T>;
+ if<T>(condition: () => boolean, thenSource: IPromise<T>, scheduler?: IScheduler): Observable<T>;
+
+ /**
+ * Determines whether an observable collection contains values. There is an alias for this method called 'ifThen' for browsers <IE9
+ *
+ * @example
+ * res = Rx.Observable.if(condition, obs1, obs2);
+ * @param condition The condition which determines if the thenSource or elseSource will be run.
+ * @param thenSource The observable sequence or promise that will be run if the condition function returns true.
+ * @param elseSource The observable sequence or promise that will be run if the condition function returns false.
+ * @returns An observable sequence which is either the thenSource or elseSource.
+ */
+ ifThen<T>(condition: () => boolean, thenSource: Observable<T>, elseSource: Observable<T>): Observable<T>;
+ ifThen<T>(condition: () => boolean, thenSource: Observable<T>, elseSource: IPromise<T>): Observable<T>;
+ ifThen<T>(condition: () => boolean, thenSource: IPromise<T>, elseSource: Observable<T>): Observable<T>;
+ ifThen<T>(condition: () => boolean, thenSource: IPromise<T>, elseSource: IPromise<T>): Observable<T>;
+
+ /**
+ * Determines whether an observable collection contains values. There is an alias for this method called 'ifThen' for browsers <IE9
+ *
+ * @example
+ * res = Rx.Observable.if(condition, obs1, scheduler);
+ * @param condition The condition which determines if the thenSource or empty sequence will be run.
+ * @param thenSource The observable sequence or promise that will be run if the condition function returns true.
+ * @param scheduler Scheduler used to create Rx.Observabe.Empty.
+ * @returns An observable sequence which is either the thenSource or empty sequence.
+ */
+ ifThen<T>(condition: () => boolean, thenSource: Observable<T>, scheduler?: IScheduler): Observable<T>;
+ ifThen<T>(condition: () => boolean, thenSource: IPromise<T>, scheduler?: IScheduler): Observable<T>;
+
+ /**
+ * Concatenates the observable sequences obtained by running the specified result selector for each element in source.
+ * There is an alias for this method called 'forIn' for browsers <IE9
+ * @param sources An array of values to turn into an observable sequence.
+ * @param resultSelector A function to apply to each item in the sources array to turn it into an observable sequence.
+ * @returns An observable sequence from the concatenated observable sequences.
+ */
+ for<T, TResult>(sources: T[], resultSelector: (item: T) => Observable<TResult>): Observable<TResult>;
+
+ /**
+ * Concatenates the observable sequences obtained by running the specified result selector for each element in source.
+ * There is an alias for this method called 'forIn' for browsers <IE9
+ * @param sources An array of values to turn into an observable sequence.
+ * @param resultSelector A function to apply to each item in the sources array to turn it into an observable sequence.
+ * @returns An observable sequence from the concatenated observable sequences.
+ */
+ forIn<T, TResult>(sources: T[], resultSelector: (item: T) => Observable<TResult>): Observable<TResult>;
+
+ /**
+ * Repeats source as long as condition holds emulating a while loop.
+ * There is an alias for this method called 'whileDo' for browsers <IE9
+ * @param condition The condition which determines if the source will be repeated.
+ * @param source The observable sequence or promise that will be run if the condition function returns true.
+ * @returns An observable sequence which is repeated as long as the condition holds.
+ */
+ while<T>(condition: () => boolean, source: Observable<T>): Observable<T>;
+ while<T>(condition: () => boolean, source: IPromise<T>): Observable<T>;
+
+ /**
+ * Repeats source as long as condition holds emulating a while loop.
+ * There is an alias for this method called 'whileDo' for browsers <IE9
+ * @param condition The condition which determines if the source will be repeated.
+ * @param source The observable sequence or promise that will be run if the condition function returns true.
+ * @returns An observable sequence which is repeated as long as the condition holds.
+ */
+ whileDo<T>(condition: () => boolean, source: Observable<T>): Observable<T>;
+ whileDo<T>(condition: () => boolean, source: IPromise<T>): Observable<T>;
+
+ /**
+ * Uses selector to determine which source in sources to use.
+ * There is an alias 'switchCase' for browsers <IE9.
+ *
+ * @example
+ * res = Rx.Observable.case(selector, { '1': obs1, '2': obs2 }, obs0);
+ * @param selector The function which extracts the value for to test in a case statement.
+ * @param sources A object which has keys which correspond to the case statement labels.
+ * @param elseSource The observable sequence or promise that will be run if the sources are not matched.
+ *
+ * @returns An observable sequence which is determined by a case statement.
+ */
+ case<T>(selector: () => string, sources: { [key: string]: Observable<T>; }, elseSource: Observable<T>): Observable<T>;
+ case<T>(selector: () => string, sources: { [key: string]: IPromise<T>; }, elseSource: Observable<T>): Observable<T>;
+ case<T>(selector: () => string, sources: { [key: string]: Observable<T>; }, elseSource: IPromise<T>): Observable<T>;
+ case<T>(selector: () => string, sources: { [key: string]: IPromise<T>; }, elseSource: IPromise<T>): Observable<T>;
+
+ /**
+ * Uses selector to determine which source in sources to use.
+ * There is an alias 'switchCase' for browsers <IE9.
+ *
+ * @example
+ * res = Rx.Observable.case(selector, { '1': obs1, '2': obs2 });
+ * res = Rx.Observable.case(selector, { '1': obs1, '2': obs2 }, scheduler);
+ *
+ * @param selector The function which extracts the value for to test in a case statement.
+ * @param sources A object which has keys which correspond to the case statement labels.
+ * @param scheduler Scheduler used to create Rx.Observabe.Empty.
+ *
+ * @returns An observable sequence which is determined by a case statement.
+ */
+ case<T>(selector: () => string, sources: { [key: string]: Observable<T>; }, scheduler?: IScheduler): Observable<T>;
+ case<T>(selector: () => string, sources: { [key: string]: IPromise<T>; }, scheduler?: IScheduler): Observable<T>;
+
+ /**
+ * Uses selector to determine which source in sources to use.
+ * There is an alias 'switchCase' for browsers <IE9.
+ *
+ * @example
+ * res = Rx.Observable.case(selector, { '1': obs1, '2': obs2 }, obs0);
+ * @param selector The function which extracts the value for to test in a case statement.
+ * @param sources A object which has keys which correspond to the case statement labels.
+ * @param elseSource The observable sequence or promise that will be run if the sources are not matched.
+ *
+ * @returns An observable sequence which is determined by a case statement.
+ */
+ case<T>(selector: () => number, sources: { [key: number]: Observable<T>; }, elseSource: Observable<T>): Observable<T>;
+ case<T>(selector: () => number, sources: { [key: number]: IPromise<T>; }, elseSource: Observable<T>): Observable<T>;
+ case<T>(selector: () => number, sources: { [key: number]: Observable<T>; }, elseSource: IPromise<T>): Observable<T>;
+ case<T>(selector: () => number, sources: { [key: number]: IPromise<T>; }, elseSource: IPromise<T>): Observable<T>;
+
+ /**
+ * Uses selector to determine which source in sources to use.
+ * There is an alias 'switchCase' for browsers <IE9.
+ *
+ * @example
+ * res = Rx.Observable.case(selector, { '1': obs1, '2': obs2 });
+ * res = Rx.Observable.case(selector, { '1': obs1, '2': obs2 }, scheduler);
+ *
+ * @param selector The function which extracts the value for to test in a case statement.
+ * @param sources A object which has keys which correspond to the case statement labels.
+ * @param scheduler Scheduler used to create Rx.Observabe.Empty.
+ *
+ * @returns An observable sequence which is determined by a case statement.
+ */
+ case<T>(selector: () => number, sources: { [key: number]: Observable<T>; }, scheduler?: IScheduler): Observable<T>;
+ case<T>(selector: () => number, sources: { [key: number]: IPromise<T>; }, scheduler?: IScheduler): Observable<T>;
+
+ /**
+ * Uses selector to determine which source in sources to use.
+ * There is an alias 'switchCase' for browsers <IE9.
+ *
+ * @example
+ * res = Rx.Observable.case(selector, { '1': obs1, '2': obs2 }, obs0);
+ * @param selector The function which extracts the value for to test in a case statement.
+ * @param sources A object which has keys which correspond to the case statement labels.
+ * @param elseSource The observable sequence or promise that will be run if the sources are not matched.
+ *
+ * @returns An observable sequence which is determined by a case statement.
+ */
+ switchCase<T>(selector: () => string, sources: { [key: string]: Observable<T>; }, elseSource: Observable<T>): Observable<T>;
+ switchCase<T>(selector: () => string, sources: { [key: string]: IPromise<T>; }, elseSource: Observable<T>): Observable<T>;
+ switchCase<T>(selector: () => string, sources: { [key: string]: Observable<T>; }, elseSource: IPromise<T>): Observable<T>;
+ switchCase<T>(selector: () => string, sources: { [key: string]: IPromise<T>; }, elseSource: IPromise<T>): Observable<T>;
+
+ /**
+ * Uses selector to determine which source in sources to use.
+ * There is an alias 'switchCase' for browsers <IE9.
+ *
+ * @example
+ * res = Rx.Observable.case(selector, { '1': obs1, '2': obs2 });
+ * res = Rx.Observable.case(selector, { '1': obs1, '2': obs2 }, scheduler);
+ *
+ * @param selector The function which extracts the value for to test in a case statement.
+ * @param sources A object which has keys which correspond to the case statement labels.
+ * @param scheduler Scheduler used to create Rx.Observabe.Empty.
+ *
+ * @returns An observable sequence which is determined by a case statement.
+ */
+ switchCase<T>(selector: () => string, sources: { [key: string]: Observable<T>; }, scheduler?: IScheduler): Observable<T>;
+ switchCase<T>(selector: () => string, sources: { [key: string]: IPromise<T>; }, scheduler?: IScheduler): Observable<T>;
+
+ /**
+ * Uses selector to determine which source in sources to use.
+ * There is an alias 'switchCase' for browsers <IE9.
+ *
+ * @example
+ * res = Rx.Observable.case(selector, { '1': obs1, '2': obs2 }, obs0);
+ * @param selector The function which extracts the value for to test in a case statement.
+ * @param sources A object which has keys which correspond to the case statement labels.
+ * @param elseSource The observable sequence or promise that will be run if the sources are not matched.
+ *
+ * @returns An observable sequence which is determined by a case statement.
+ */
+ switchCase<T>(selector: () => number, sources: { [key: number]: Observable<T>; }, elseSource: Observable<T>): Observable<T>;
+ switchCase<T>(selector: () => number, sources: { [key: number]: IPromise<T>; }, elseSource: Observable<T>): Observable<T>;
+ switchCase<T>(selector: () => number, sources: { [key: number]: Observable<T>; }, elseSource: IPromise<T>): Observable<T>;
+ switchCase<T>(selector: () => number, sources: { [key: number]: IPromise<T>; }, elseSource: IPromise<T>): Observable<T>;
+
+ /**
+ * Uses selector to determine which source in sources to use.
+ * There is an alias 'switchCase' for browsers <IE9.
+ *
+ * @example
+ * res = Rx.Observable.case(selector, { '1': obs1, '2': obs2 });
+ * res = Rx.Observable.case(selector, { '1': obs1, '2': obs2 }, scheduler);
+ *
+ * @param selector The function which extracts the value for to test in a case statement.
+ * @param sources A object which has keys which correspond to the case statement labels.
+ * @param scheduler Scheduler used to create Rx.Observabe.Empty.
+ *
+ * @returns An observable sequence which is determined by a case statement.
+ */
+ switchCase<T>(selector: () => number, sources: { [key: number]: Observable<T>; }, scheduler?: IScheduler): Observable<T>;
+ switchCase<T>(selector: () => number, sources: { [key: number]: IPromise<T>; }, scheduler?: IScheduler): Observable<T>;
+
+ /**
+ * Runs all observable sequences in parallel and collect their last elements.
+ *
+ * @example
+ * res = Rx.Observable.forkJoin([obs1, obs2]);
+ * @param sources Array of source sequences or promises.
+ * @returns An observable sequence with an array collecting the last elements of all the input sequences.
+ */
+ forkJoin<T>(sources: Observable<T>[]): Observable<T[]>;
+ forkJoin<T>(sources: IPromise<T>[]): Observable<T[]>;
+
+ /**
+ * Runs all observable sequences in parallel and collect their last elements.
+ *
+ * @example
+ * res = Rx.Observable.forkJoin(obs1, obs2, ...);
+ * @param args Source sequences or promises.
+ * @returns An observable sequence with an array collecting the last elements of all the input sequences.
+ */
+ forkJoin<T>(...args: Observable<T>[]): Observable<T[]>;
+ forkJoin<T>(...args: IPromise<T>[]): Observable<T[]>;
+ }
+}
+
+declare module "rx.experimental" {
+ export = Rx;
+}
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.joinpatterns.d.ts b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.joinpatterns.d.ts
new file mode 100644
index 00000000000..fc20f825479
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.joinpatterns.d.ts
@@ -0,0 +1,60 @@
+// Type definitions for RxJS-Join v2.2.28
+// Project: http://rx.codeplex.com/
+// Definitions by: Igor Oleinikov <https://github.com/Igorbek>
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+///<reference path="rx.d.ts" />
+
+declare module Rx {
+
+ interface Pattern1<T1> {
+ and<T2>(other: Observable<T2>): Pattern2<T1, T2>;
+ thenDo<TR>(selector: (item1: T1) => TR): Plan<TR>;
+ }
+ interface Pattern2<T1, T2> {
+ and<T3>(other: Observable<T3>): Pattern3<T1, T2, T3>;
+ thenDo<TR>(selector: (item1: T1, item2: T2) => TR): Plan<TR>;
+ }
+ interface Pattern3<T1, T2, T3> {
+ and<T4>(other: Observable<T4>): Pattern4<T1, T2, T3, T4>;
+ thenDo<TR>(selector: (item1: T1, item2: T2, item3: T3) => TR): Plan<TR>;
+ }
+ interface Pattern4<T1, T2, T3, T4> {
+ and<T5>(other: Observable<T5>): Pattern5<T1, T2, T3, T4, T5>;
+ thenDo<TR>(selector: (item1: T1, item2: T2, item3: T3, item4: T4) => TR): Plan<TR>;
+ }
+ interface Pattern5<T1, T2, T3, T4, T5> {
+ and<T6>(other: Observable<T6>): Pattern6<T1, T2, T3, T4, T5, T6>;
+ thenDo<TR>(selector: (item1: T1, item2: T2, item3: T3, item4: T4, item5: T5) => TR): Plan<TR>;
+ }
+ interface Pattern6<T1, T2, T3, T4, T5, T6> {
+ and<T7>(other: Observable<T7>): Pattern7<T1, T2, T3, T4, T5, T6, T7>;
+ thenDo<TR>(selector: (item1: T1, item2: T2, item3: T3, item4: T4, item5: T5, item6: T6) => TR): Plan<TR>;
+ }
+ interface Pattern7<T1, T2, T3, T4, T5, T6, T7> {
+ and<T8>(other: Observable<T8>): Pattern8<T1, T2, T3, T4, T5, T6, T7, T8>;
+ thenDo<TR>(selector: (item1: T1, item2: T2, item3: T3, item4: T4, item5: T5, item6: T6, item7: T7) => TR): Plan<TR>;
+ }
+ interface Pattern8<T1, T2, T3, T4, T5, T6, T7, T8> {
+ and<T9>(other: Observable<T9>): Pattern9<T1, T2, T3, T4, T5, T6, T7, T8, T9>;
+ thenDo<TR>(selector: (item1: T1, item2: T2, item3: T3, item4: T4, item5: T5, item6: T6, item7: T7, item8: T8) => TR): Plan<TR>;
+ }
+ interface Pattern9<T1, T2, T3, T4, T5, T6, T7, T8, T9> {
+ thenDo<TR>(selector: (item1: T1, item2: T2, item3: T3, item4: T4, item5: T5, item6: T6, item7: T7, item8: T8, item9: T9) => TR): Plan<TR>;
+ }
+
+ interface Plan<T> { }
+
+ interface Observable<T> {
+ and<T2>(other: Observable<T2>): Pattern2<T, T2>;
+ thenDo<TR>(selector: (item1: T) => TR): Plan<TR>;
+ }
+
+ interface ObservableStatic {
+ when<TR>(plan: Plan<TR>): Observable<TR>;
+ }
+}
+
+declare module "rx.joinpatterns" {
+ export = Rx;
+}
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.lite.d.ts b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.lite.d.ts
new file mode 100644
index 00000000000..66ec678498c
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.lite.d.ts
@@ -0,0 +1,15 @@
+// Type definitions for RxJS-Lite v2.2.28
+// Project: http://rx.codeplex.com/
+// Definitions by: gsino <http://www.codeplex.com/site/users/view/gsino>, Igor Oleinikov <https://github.com/Igorbek>
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+///<reference path="rx-lite.d.ts"/>
+///<reference path="rx.async-lite.d.ts" />
+///<reference path="rx.binding-lite.d.ts" />
+///<reference path="rx.time-lite.d.ts" />
+///<reference path="rx.backpressure-lite.d.ts" />
+///<reference path="rx.coincidence-lite.d.ts" />
+
+declare module "rx.lite" {
+ export = Rx;
+}
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.testing.d.ts b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.testing.d.ts
new file mode 100644
index 00000000000..58b074f7562
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.testing.d.ts
@@ -0,0 +1,64 @@
+// Type definitions for RxJS-Testing v2.2.28
+// Project: https://github.com/Reactive-Extensions/RxJS/
+// Definitions by: Igor Oleinikov <https://github.com/Igorbek>
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+///<reference path="rx.d.ts" />
+///<reference path="rx.virtualtime.d.ts" />
+
+declare module Rx {
+ export interface TestScheduler extends VirtualTimeScheduler<number, number> {
+ createColdObservable<T>(...records: Recorded[]): Observable<T>;
+ createHotObservable<T>(...records: Recorded[]): Observable<T>;
+ createObserver<T>(): MockObserver<T>;
+
+ startWithTiming<T>(create: () => Observable<T>, createdAt: number, subscribedAt: number, disposedAt: number): MockObserver<T>;
+ startWithDispose<T>(create: () => Observable<T>, disposedAt: number): MockObserver<T>;
+ startWithCreate<T>(create: () => Observable<T>): MockObserver<T>;
+ }
+
+ export var TestScheduler: {
+ new (): TestScheduler;
+ };
+
+ export class Recorded {
+ constructor(time: number, value: any, equalityComparer?: (x: any, y: any) => boolean);
+ equals(other: Recorded): boolean;
+ toString(): string;
+ time: number;
+ value: any;
+ }
+
+ export var ReactiveTest: {
+ created: number;
+ subscribed: number;
+ disposed: number;
+
+ onNext(ticks: number, value: any): Recorded;
+ onNext(ticks: number, predicate: (value: any) => boolean): Recorded;
+ onError(ticks: number, exception: any): Recorded;
+ onError(ticks: number, predicate: (exception: any) => boolean): Recorded;
+ onCompleted(ticks: number): Recorded;
+
+ subscribe(subscribeAt: number, unsubscribeAt?: number): Subscription;
+ };
+
+ export class Subscription {
+ constructor(subscribeAt: number, unsubscribeAt?: number);
+ equals(other: Subscription): boolean;
+ }
+
+ export interface MockObserver<T> extends Observer<T> {
+ messages: Recorded[];
+ }
+
+ interface MockObserverStatic extends ObserverStatic {
+ new <T>(scheduler: IScheduler): MockObserver<T>;
+ }
+
+ export var MockObserver: MockObserverStatic;
+}
+
+declare module "rx.testing" {
+ export = Rx;
+}
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.time-lite.d.ts b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.time-lite.d.ts
new file mode 100644
index 00000000000..f7a902685ef
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.time-lite.d.ts
@@ -0,0 +1,47 @@
+// DefinitelyTyped: partial
+
+// This file contains common part of defintions for rx.time.d.ts and rx.lite.d.ts
+// Do not include the file separately.
+
+///<reference path="rx-lite.d.ts" />
+
+declare module Rx {
+ export interface TimeInterval<T> {
+ value: T;
+ interval: number;
+ }
+
+ export interface Timestamp<T> {
+ value: T;
+ timestamp: number;
+ }
+
+ export interface Observable<T> {
+ delay(dueTime: Date, scheduler?: IScheduler): Observable<T>;
+ delay(dueTime: number, scheduler?: IScheduler): Observable<T>;
+
+ debounce(dueTime: number, scheduler?: IScheduler): Observable<T>;
+ throttleWithTimeout(dueTime: number, scheduler?: IScheduler): Observable<T>;
+ /**
+ * @deprecated use #debounce or #throttleWithTimeout instead.
+ */
+ throttle(dueTime: number, scheduler?: IScheduler): Observable<T>;
+
+ timeInterval(scheduler?: IScheduler): Observable<TimeInterval<T>>;
+
+ timestamp(scheduler?: IScheduler): Observable<Timestamp<T>>;
+
+ sample(interval: number, scheduler?: IScheduler): Observable<T>;
+ sample<TSample>(sampler: Observable<TSample>, scheduler?: IScheduler): Observable<T>;
+
+ timeout(dueTime: Date, other?: Observable<T>, scheduler?: IScheduler): Observable<T>;
+ timeout(dueTime: number, other?: Observable<T>, scheduler?: IScheduler): Observable<T>;
+ }
+
+ interface ObservableStatic {
+ interval(period: number, scheduler?: IScheduler): Observable<number>;
+ interval(dutTime: number, period: number, scheduler?: IScheduler): Observable<number>;
+ timer(dueTime: number, period: number, scheduler?: IScheduler): Observable<number>;
+ timer(dueTime: number, scheduler?: IScheduler): Observable<number>;
+ }
+}
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.time.d.ts b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.time.d.ts
new file mode 100644
index 00000000000..2e3ea0a0907
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.time.d.ts
@@ -0,0 +1,66 @@
+// Type definitions for RxJS-Time v2.2.28
+// Project: http://rx.codeplex.com/
+// Definitions by: Carl de Billy <http://carl.debilly.net/>, Igor Oleinikov <https://github.com/Igorbek>
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+///<reference path="rx.d.ts" />
+///<reference path="rx.time-lite.d.ts" />
+
+declare module Rx {
+ export interface Observable<T> {
+ delaySubscription(dueTime: number, scheduler?: IScheduler): Observable<T>;
+ delayWithSelector(delayDurationSelector: (item: T) => number): Observable<T>;
+ delayWithSelector(subscriptionDelay: number, delayDurationSelector: (item: T) => number): Observable<T>;
+
+ timeoutWithSelector<TTimeout>(firstTimeout: Observable<TTimeout>, timeoutdurationSelector?: (item: T) => Observable<TTimeout>, other?: Observable<T>): Observable<T>;
+
+ debounceWithSelector<TTimeout>(debounceDurationSelector: (item: T) => Observable<TTimeout>): Observable<T>;
+ /**
+ * @deprecated use #debounceWithSelector instead.
+ */
+ throttleWithSelector<TTimeout>(debounceDurationSelector: (item: T) => Observable<TTimeout>): Observable<T>;
+
+ skipLastWithTime(duration: number, scheduler?: IScheduler): Observable<T>;
+ takeLastWithTime(duration: number, timerScheduler?: IScheduler, loopScheduler?: IScheduler): Observable<T>;
+
+ takeLastBufferWithTime(duration: number, scheduler?: IScheduler): Observable<T[]>;
+ takeWithTime(duration: number, scheduler?: IScheduler): Observable<T>;
+ skipWithTime(duration: number, scheduler?: IScheduler): Observable<T>;
+
+ skipUntilWithTime(startTime: Date, scheduler?: IScheduler): Observable<T>;
+ skipUntilWithTime(duration: number, scheduler?: IScheduler): Observable<T>;
+ takeUntilWithTime(endTime: Date, scheduler?: IScheduler): Observable<T>;
+ takeUntilWithTime(duration: number, scheduler?: IScheduler): Observable<T>;
+
+ windowWithTime(timeSpan: number, timeShift: number, scheduler?: IScheduler): Observable<Observable<T>>;
+ windowWithTime(timeSpan: number, scheduler?: IScheduler): Observable<Observable<T>>;
+ windowWithTimeOrCount(timeSpan: number, count: number, scheduler?: IScheduler): Observable<Observable<T>>;
+ bufferWithTime(timeSpan: number, timeShift: number, scheduler?: IScheduler): Observable<T[]>;
+ bufferWithTime(timeSpan: number, scheduler?: IScheduler): Observable<T[]>;
+ bufferWithTimeOrCount(timeSpan: number, count: number, scheduler?: IScheduler): Observable<T[]>;
+ }
+
+ interface ObservableStatic {
+ timer(dueTime: Date, period: number, scheduler?: IScheduler): Observable<number>;
+ timer(dueTime: Date, scheduler?: IScheduler): Observable<number>;
+
+ generateWithRelativeTime<TState, TResult>(
+ initialState: TState,
+ condition: (state: TState) => boolean,
+ iterate: (state: TState) => TState,
+ resultSelector: (state: TState) => TResult,
+ timeSelector: (state: TState) => number,
+ scheduler?: IScheduler): Observable<TResult>;
+ generateWithAbsoluteTime<TState, TResult>(
+ initialState: TState,
+ condition: (state: TState) => boolean,
+ iterate: (state: TState) => TState,
+ resultSelector: (state: TState) => TResult,
+ timeSelector: (state: TState) => Date,
+ scheduler?: IScheduler): Observable<TResult>;
+ }
+}
+
+declare module "rx.time" {
+ export = Rx;
+}
diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.virtualtime.d.ts b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.virtualtime.d.ts
new file mode 100644
index 00000000000..bac31a0d373
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.virtualtime.d.ts
@@ -0,0 +1,41 @@
+// Type definitions for RxJS-VirtualTime v2.2.28
+// Project: http://rx.codeplex.com/
+// Definitions by: gsino <http://www.codeplex.com/site/users/view/gsino>, Igor Oleinikov <https://github.com/Igorbek>
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+///<reference path="rx.d.ts" />
+
+declare module Rx {
+ export interface VirtualTimeScheduler<TAbsolute, TRelative> extends Scheduler {
+ //protected constructor(initialClock: TAbsolute, comparer: (first: TAbsolute, second: TAbsolute) => number);
+
+ advanceBy(time: TRelative): void;
+ advanceTo(time: TAbsolute): void;
+ scheduleAbsolute(dueTime: TAbsolute, action: () => void): IDisposable;
+ scheduleAbsoluteWithState<TState>(state: TState, dueTime: TAbsolute, action: (scheduler: IScheduler, state: TState) => IDisposable): IDisposable;
+ scheduleRelative(dueTime: TRelative, action: () => void): IDisposable;
+ scheduleRelativeWithState<TState>(state: TState, dueTime: TRelative, action: (scheduler: IScheduler, state: TState) => IDisposable): IDisposable;
+ sleep(time: TRelative): void;
+ start(): IDisposable;
+ stop(): void;
+
+ isEnabled: boolean;
+
+ /* protected abstract */ add(from: TAbsolute, by: TRelative): TAbsolute;
+ /* protected abstract */ toDateTimeOffset(duetime: TAbsolute): number;
+ /* protected abstract */ toRelative(duetime: number): TRelative;
+
+ /* protected */ getNext(): internals.ScheduledItem<TAbsolute>;
+ }
+
+ export interface HistoricalScheduler extends VirtualTimeScheduler<number, number> {
+ }
+
+ export var HistoricalScheduler: {
+ new (initialClock: number, comparer: (first: number, second: number) => number): HistoricalScheduler;
+ };
+}
+
+declare module "rx.virtualtime" {
+ export = Rx;
+}
diff --git a/tools/eslint/node_modules/inquirer/node_modules/through/.travis.yml b/tools/eslint/node_modules/inquirer/node_modules/through/.travis.yml
new file mode 100644
index 00000000000..c693a939df9
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/through/.travis.yml
@@ -0,0 +1,5 @@
+language: node_js
+node_js:
+ - 0.6
+ - 0.8
+ - "0.10"
diff --git a/tools/eslint/node_modules/inquirer/node_modules/through/LICENSE.APACHE2 b/tools/eslint/node_modules/inquirer/node_modules/through/LICENSE.APACHE2
new file mode 100644
index 00000000000..6366c04716f
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/through/LICENSE.APACHE2
@@ -0,0 +1,15 @@
+Apache License, Version 2.0
+
+Copyright (c) 2011 Dominic Tarr
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
diff --git a/tools/eslint/node_modules/inquirer/node_modules/through/LICENSE.MIT b/tools/eslint/node_modules/inquirer/node_modules/through/LICENSE.MIT
new file mode 100644
index 00000000000..6eafbd734a6
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/through/LICENSE.MIT
@@ -0,0 +1,24 @@
+The MIT License
+
+Copyright (c) 2011 Dominic Tarr
+
+Permission is hereby granted, free of charge,
+to any person obtaining a copy of this software and
+associated documentation files (the "Software"), to
+deal in the Software without restriction, including
+without limitation the rights to use, copy, modify,
+merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom
+the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/tools/eslint/node_modules/inquirer/node_modules/through/index.js b/tools/eslint/node_modules/inquirer/node_modules/through/index.js
new file mode 100644
index 00000000000..ca5fc5901fd
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/through/index.js
@@ -0,0 +1,108 @@
+var Stream = require('stream')
+
+// through
+//
+// a stream that does nothing but re-emit the input.
+// useful for aggregating a series of changing but not ending streams into one stream)
+
+exports = module.exports = through
+through.through = through
+
+//create a readable writable stream.
+
+function through (write, end, opts) {
+ write = write || function (data) { this.queue(data) }
+ end = end || function () { this.queue(null) }
+
+ var ended = false, destroyed = false, buffer = [], _ended = false
+ var stream = new Stream()
+ stream.readable = stream.writable = true
+ stream.paused = false
+
+// stream.autoPause = !(opts && opts.autoPause === false)
+ stream.autoDestroy = !(opts && opts.autoDestroy === false)
+
+ stream.write = function (data) {
+ write.call(this, data)
+ return !stream.paused
+ }
+
+ function drain() {
+ while(buffer.length && !stream.paused) {
+ var data = buffer.shift()
+ if(null === data)
+ return stream.emit('end')
+ else
+ stream.emit('data', data)
+ }
+ }
+
+ stream.queue = stream.push = function (data) {
+// console.error(ended)
+ if(_ended) return stream
+ if(data === null) _ended = true
+ buffer.push(data)
+ drain()
+ return stream
+ }
+
+ //this will be registered as the first 'end' listener
+ //must call destroy next tick, to make sure we're after any
+ //stream piped from here.
+ //this is only a problem if end is not emitted synchronously.
+ //a nicer way to do this is to make sure this is the last listener for 'end'
+
+ stream.on('end', function () {
+ stream.readable = false
+ if(!stream.writable && stream.autoDestroy)
+ process.nextTick(function () {
+ stream.destroy()
+ })
+ })
+
+ function _end () {
+ stream.writable = false
+ end.call(stream)
+ if(!stream.readable && stream.autoDestroy)
+ stream.destroy()
+ }
+
+ stream.end = function (data) {
+ if(ended) return
+ ended = true
+ if(arguments.length) stream.write(data)
+ _end() // will emit or queue
+ return stream
+ }
+
+ stream.destroy = function () {
+ if(destroyed) return
+ destroyed = true
+ ended = true
+ buffer.length = 0
+ stream.writable = stream.readable = false
+ stream.emit('close')
+ return stream
+ }
+
+ stream.pause = function () {
+ if(stream.paused) return
+ stream.paused = true
+ return stream
+ }
+
+ stream.resume = function () {
+ if(stream.paused) {
+ stream.paused = false
+ stream.emit('resume')
+ }
+ drain()
+ //may have become paused again,
+ //as drain emits 'data'.
+ if(!stream.paused)
+ stream.emit('drain')
+ return stream
+ }
+ return stream
+}
+
diff --git a/tools/eslint/node_modules/inquirer/node_modules/through/package.json b/tools/eslint/node_modules/inquirer/node_modules/through/package.json
new file mode 100644
index 00000000000..ec7f7ac6fe4
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/through/package.json
@@ -0,0 +1,66 @@
+{
+ "name": "through",
+ "version": "2.3.7",
+ "description": "simplified stream construction",
+ "main": "index.js",
+ "scripts": {
+ "test": "set -e; for t in test/*.js; do node $t; done"
+ },
+ "devDependencies": {
+ "stream-spec": "~0.3.5",
+ "tape": "~2.3.2",
+ "from": "~0.1.3"
+ },
+ "keywords": [
+ "stream",
+ "streams",
+ "user-streams",
+ "pipe"
+ ],
+ "author": {
+ "name": "Dominic Tarr",
+ "email": "dominic.tarr@gmail.com",
+ "url": "dominictarr.com"
+ },
+ "license": "MIT",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/dominictarr/through.git"
+ },
+ "homepage": "http://github.com/dominictarr/through",
+ "testling": {
+ "browsers": [
+ "ie/8..latest",
+ "ff/15..latest",
+ "chrome/20..latest",
+ "safari/5.1..latest"
+ ],
+ "files": "test/*.js"
+ },
+ "gitHead": "d532966ebcae90fd6a150cc489b55c6a4e0bc4a0",
+ "bugs": {
+ "url": "https://github.com/dominictarr/through/issues"
+ },
+ "_id": "through@2.3.7",
+ "_shasum": "5fcc3690fed2fdf98c6fc88b4d207a4624ac3b87",
+ "_from": "through@>=2.3.6 <3.0.0",
+ "_npmVersion": "2.4.1",
+ "_nodeVersion": "0.10.35",
+ "_npmUser": {
+ "name": "dominictarr",
+ "email": "dominic.tarr@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "dominictarr",
+ "email": "dominic.tarr@gmail.com"
+ }
+ ],
+ "dist": {
+ "shasum": "5fcc3690fed2fdf98c6fc88b4d207a4624ac3b87",
+ "tarball": "http://registry.npmjs.org/through/-/through-2.3.7.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/through/-/through-2.3.7.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/tools/eslint/node_modules/inquirer/node_modules/through/readme.markdown b/tools/eslint/node_modules/inquirer/node_modules/through/readme.markdown
new file mode 100644
index 00000000000..cb34c8135f5
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/through/readme.markdown
@@ -0,0 +1,64 @@
+#through
+
+[![build status](https://secure.travis-ci.org/dominictarr/through.png)](http://travis-ci.org/dominictarr/through)
+[![testling badge](https://ci.testling.com/dominictarr/through.png)](https://ci.testling.com/dominictarr/through)
+
+Easy way to create a `Stream` that is both `readable` and `writable`.
+
+* Pass in optional `write` and `end` methods.
+* `through` takes care of pause/resume logic if you use `this.queue(data)` instead of `this.emit('data', data)`.
+* Use `this.pause()` and `this.resume()` to manage flow.
+* Check `this.paused` to see current flow state. (`write` always returns `!this.paused`).
+
+This function is the basis for most of the synchronous streams in
+[event-stream](http://github.com/dominictarr/event-stream).
+
+``` js
+var through = require('through')
+
+through(function write(data) {
+ this.queue(data) //data *must* not be null
+ },
+ function end () { //optional
+ this.queue(null)
+ })
+```
+
+Or, can also be used _without_ buffering on pause, use `this.emit('data', data)`,
+and this.emit('end')
+
+``` js
+var through = require('through')
+
+through(function write(data) {
+ this.emit('data', data)
+ //this.pause()
+ },
+ function end () { //optional
+ this.emit('end')
+ })
+```
+
+## Extended Options
+
+You will probably not need these 99% of the time.
+
+### autoDestroy=false
+
+By default, `through` emits close when the writable
+and readable side of the stream has ended.
+If that is not desired, set `autoDestroy=false`.
+
+``` js
+var through = require('through')
+
+//like this
+var ts = through(write, end, {autoDestroy: false})
+//or like this
+var ts = through(write, end)
+ts.autoDestroy = false
+```
+
+## License
+
+MIT / Apache2
diff --git a/tools/eslint/node_modules/inquirer/node_modules/through/test/async.js b/tools/eslint/node_modules/inquirer/node_modules/through/test/async.js
new file mode 100644
index 00000000000..46bdbaebcbc
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/through/test/async.js
@@ -0,0 +1,28 @@
+var from = require('from')
+var through = require('../')
+
+var tape = require('tape')
+
+tape('simple async example', function (t) {
+
+ var n = 0, expected = [1,2,3,4,5], actual = []
+ from(expected)
+ .pipe(through(function(data) {
+ this.pause()
+ n ++
+ setTimeout(function(){
+ console.log('pushing data', data)
+ this.push(data)
+ this.resume()
+ }.bind(this), 300)
+ })).pipe(through(function(data) {
+ console.log('pushing data second time', data);
+ this.push(data)
+ })).on('data', function (d) {
+ actual.push(d)
+ }).on('end', function() {
+ t.deepEqual(actual, expected)
+ t.end()
+ })
+
+})
diff --git a/tools/eslint/node_modules/inquirer/node_modules/through/test/auto-destroy.js b/tools/eslint/node_modules/inquirer/node_modules/through/test/auto-destroy.js
new file mode 100644
index 00000000000..9a8fd0006f5
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/through/test/auto-destroy.js
@@ -0,0 +1,30 @@
+var test = require('tape')
+var through = require('../')
+
+// must emit end before close.
+
+test('end before close', function (assert) {
+ var ts = through()
+ ts.autoDestroy = false
+ var ended = false, closed = false
+
+ ts.on('end', function () {
+ assert.ok(!closed)
+ ended = true
+ })
+ ts.on('close', function () {
+ assert.ok(ended)
+ closed = true
+ })
+
+ ts.write(1)
+ ts.write(2)
+ ts.write(3)
+ ts.end()
+ assert.ok(ended)
+ assert.notOk(closed)
+ ts.destroy()
+ assert.ok(closed)
+ assert.end()
+})
+
diff --git a/tools/eslint/node_modules/inquirer/node_modules/through/test/buffering.js b/tools/eslint/node_modules/inquirer/node_modules/through/test/buffering.js
new file mode 100644
index 00000000000..b0084bfc6ed
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/through/test/buffering.js
@@ -0,0 +1,71 @@
+var test = require('tape')
+var through = require('../')
+
+// must emit end before close.
+
+test('buffering', function(assert) {
+ var ts = through(function (data) {
+ this.queue(data)
+ }, function () {
+ this.queue(null)
+ })
+
+ var ended = false, actual = []
+
+ ts.on('data', actual.push.bind(actual))
+ ts.on('end', function () {
+ ended = true
+ })
+
+ ts.write(1)
+ ts.write(2)
+ ts.write(3)
+ assert.deepEqual(actual, [1, 2, 3])
+ ts.pause()
+ ts.write(4)
+ ts.write(5)
+ ts.write(6)
+ assert.deepEqual(actual, [1, 2, 3])
+ ts.resume()
+ assert.deepEqual(actual, [1, 2, 3, 4, 5, 6])
+ ts.pause()
+ ts.end()
+ assert.ok(!ended)
+ ts.resume()
+ assert.ok(ended)
+ assert.end()
+})
+
+test('buffering has data in queue, when ends', function (assert) {
+
+ /*
+ * If stream ends while paused with data in the queue,
+ * stream should still emit end after all data is written
+ * on resume.
+ */
+
+ var ts = through(function (data) {
+ this.queue(data)
+ }, function () {
+ this.queue(null)
+ })
+
+ var ended = false, actual = []
+
+ ts.on('data', actual.push.bind(actual))
+ ts.on('end', function () {
+ ended = true
+ })
+
+ ts.pause()
+ ts.write(1)
+ ts.write(2)
+ ts.write(3)
+ ts.end()
+ assert.deepEqual(actual, [], 'no data written yet, still paused')
+ assert.ok(!ended, 'end not emitted yet, still paused')
+ ts.resume()
+ assert.deepEqual(actual, [1, 2, 3], 'resumed, all data should be delivered')
+ assert.ok(ended, 'end should be emitted once all data was delivered')
+ assert.end();
+})
diff --git a/tools/eslint/node_modules/inquirer/node_modules/through/test/end.js b/tools/eslint/node_modules/inquirer/node_modules/through/test/end.js
new file mode 100644
index 00000000000..fa113f58e03
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/through/test/end.js
@@ -0,0 +1,45 @@
+var test = require('tape')
+var through = require('../')
+
+// must emit end before close.
+
+test('end before close', function (assert) {
+ var ts = through()
+ var ended = false, closed = false
+
+ ts.on('end', function () {
+ assert.ok(!closed)
+ ended = true
+ })
+ ts.on('close', function () {
+ assert.ok(ended)
+ closed = true
+ })
+
+ ts.write(1)
+ ts.write(2)
+ ts.write(3)
+ ts.end()
+ assert.ok(ended)
+ assert.ok(closed)
+ assert.end()
+})
+
+test('end only once', function (t) {
+
+ var ts = through()
+ var ended = false, closed = false
+
+ ts.on('end', function () {
+ t.equal(ended, false)
+ ended = true
+ })
+
+ ts.queue(null)
+ ts.queue(null)
+ ts.queue(null)
+
+ ts.resume()
+
+ t.end()
+})
diff --git a/tools/eslint/node_modules/inquirer/node_modules/through/test/index.js b/tools/eslint/node_modules/inquirer/node_modules/through/test/index.js
new file mode 100644
index 00000000000..96da82f97c7
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/node_modules/through/test/index.js
@@ -0,0 +1,133 @@
+
+var test = require('tape')
+var spec = require('stream-spec')
+var through = require('../')
+
+/*
+ I'm using these two functions, and not streams and pipe
+ so there is less to break. if this test fails it must be
+ the implementation of _through_
+*/
+
+function write(array, stream) {
+ array = array.slice()
+ function next() {
+ while(array.length)
+ if(stream.write(array.shift()) === false)
+ return stream.once('drain', next)
+
+ stream.end()
+ }
+
+ next()
+}
+
+function read(stream, callback) {
+ var actual = []
+ stream.on('data', function (data) {
+ actual.push(data)
+ })
+ stream.once('end', function () {
+ callback(null, actual)
+ })
+ stream.once('error', function (err) {
+ callback(err)
+ })
+}
+
+test('simple defaults', function(assert) {
+
+ var l = 1000
+ , expected = []
+
+ while(l--) expected.push(l * Math.random())
+
+ var t = through()
+ var s = spec(t).through().pausable()
+
+ read(t, function (err, actual) {
+ assert.ifError(err)
+ assert.deepEqual(actual, expected)
+ assert.end()
+ })
+
+ t.on('close', s.validate)
+
+ write(expected, t)
+});
+
+test('simple functions', function(assert) {
+
+ var l = 1000
+ , expected = []
+
+ while(l--) expected.push(l * Math.random())
+
+ var t = through(function (data) {
+ this.emit('data', data*2)
+ })
+ var s = spec(t).through().pausable()
+
+
+ read(t, function (err, actual) {
+ assert.ifError(err)
+ assert.deepEqual(actual, expected.map(function (data) {
+ return data*2
+ }))
+ assert.end()
+ })
+
+ t.on('close', s.validate)
+
+ write(expected, t)
+})
+
+test('pauses', function(assert) {
+
+ var l = 1000
+ , expected = []
+
+ while(l--) expected.push(l) //Math.random())
+
+ var t = through()
+
+ var s = spec(t)
+ .through()
+ .pausable()
+
+ t.on('data', function () {
+ if(Math.random() > 0.1) return
+ t.pause()
+ process.nextTick(function () {
+ t.resume()
+ })
+ })
+
+ read(t, function (err, actual) {
+ assert.ifError(err)
+ assert.deepEqual(actual, expected)
+ })
+
+ t.on('close', function () {
+ s.validate()
+ assert.end()
+ })
+
+ write(expected, t)
+})
+
+test('does not soft-end on `undefined`', function(assert) {
+ var stream = through()
+ , count = 0
+
+ stream.on('data', function (data) {
+ count++
+ })
+
+ stream.write(undefined)
+ stream.write(undefined)
+
+ assert.equal(count, 2)
+
+ assert.end()
+})
diff --git a/tools/eslint/node_modules/inquirer/package.json b/tools/eslint/node_modules/inquirer/package.json
new file mode 100644
index 00000000000..f7544323339
--- /dev/null
+++ b/tools/eslint/node_modules/inquirer/package.json
@@ -0,0 +1,75 @@
+{
+ "name": "inquirer",
+ "version": "0.8.5",
+ "description": "A collection of common interactive command line user interfaces.",
+ "main": "lib/inquirer.js",
+ "scripts": {
+ "test": "grunt --verbose"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/sboudrias/Inquirer.js.git"
+ },
+ "keywords": [
+ "command",
+ "prompt",
+ "stdin",
+ "cli",
+ "tty",
+ "menu"
+ ],
+ "author": {
+ "name": "Simon Boudrias",
+ "email": "admin@simonboudrias.com"
+ },
+ "license": "MIT",
+ "files": [
+ "lib"
+ ],
+ "dependencies": {
+ "ansi-regex": "^1.1.1",
+ "chalk": "^1.0.0",
+ "cli-width": "^1.0.1",
+ "figures": "^1.3.5",
+ "lodash": "^3.3.1",
+ "readline2": "^0.1.1",
+ "rx": "^2.4.3",
+ "through": "^2.3.6"
+ },
+ "devDependencies": {
+ "chai": "^2.1.2",
+ "cmdify": "^0.0.4",
+ "grunt": "^0.4.1",
+ "grunt-cli": "^0.1.8",
+ "grunt-contrib-jshint": "^0.11.1",
+ "grunt-mocha-test": "^0.10.2",
+ "mocha": "^2.2.1",
+ "mockery": "^1.4.0",
+ "sinon": "^1.12.1"
+ },
+ "_id": "inquirer@0.8.5",
+ "dist": {
+ "shasum": "dbd740cf6ca3b731296a63ce6f6d961851f336df",
+ "tarball": "http://registry.npmjs.org/inquirer/-/inquirer-0.8.5.tgz"
+ },
+ "_from": "inquirer@>=0.8.2 <0.9.0",
+ "_npmVersion": "1.4.6",
+ "_npmUser": {
+ "name": "sboudrias",
+ "email": "admin@simonboudrias.com"
+ },
+ "maintainers": [
+ {
+ "name": "sboudrias",
+ "email": "admin@simonboudrias.com"
+ }
+ ],
+ "directories": {},
+ "_shasum": "dbd740cf6ca3b731296a63ce6f6d961851f336df",
+ "_resolved": "https://registry.npmjs.org/inquirer/-/inquirer-0.8.5.tgz",
+ "bugs": {
+ "url": "https://github.com/sboudrias/Inquirer.js/issues"
+ },
+ "readme": "ERROR: No README data found!",
+ "homepage": "https://github.com/sboudrias/Inquirer.js#readme"
+}
diff --git a/tools/eslint/node_modules/is-my-json-valid/.npmignore b/tools/eslint/node_modules/is-my-json-valid/.npmignore
new file mode 100644
index 00000000000..dbb0721ce54
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/.npmignore
@@ -0,0 +1,2 @@
+node_modules
+cosmicrealms.com
diff --git a/tools/eslint/node_modules/is-my-json-valid/.travis.yml b/tools/eslint/node_modules/is-my-json-valid/.travis.yml
new file mode 100644
index 00000000000..6e5919de39a
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/.travis.yml
@@ -0,0 +1,3 @@
+language: node_js
+node_js:
+ - "0.10"
diff --git a/tools/eslint/node_modules/is-my-json-valid/LICENSE b/tools/eslint/node_modules/is-my-json-valid/LICENSE
new file mode 100644
index 00000000000..757562ec592
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Mathias Buus
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE. \ No newline at end of file
diff --git a/tools/eslint/node_modules/is-my-json-valid/README.md b/tools/eslint/node_modules/is-my-json-valid/README.md
new file mode 100644
index 00000000000..47350d84fa7
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/README.md
@@ -0,0 +1,173 @@
+# is-my-json-valid
+
+A [JSONSchema](http://json-schema.org/) validator that uses code generation
+to be extremely fast
+
+```
+npm install is-my-json-valid
+```
+
+It passes the entire JSONSchema v4 test suite except for `remoteRefs` and `maxLength`/`minLength` when using unicode surrogate pairs.
+
+[![build status](http://img.shields.io/travis/mafintosh/is-my-json-valid.svg?style=flat)](http://travis-ci.org/mafintosh/is-my-json-valid)
+
+## Usage
+
+Simply pass a schema to compile it
+
+``` js
+var validator = require('is-my-json-valid')
+
+var validate = validator({
+ required: true,
+ type: 'object',
+ properties: {
+ hello: {
+ required: true,
+ type: 'string'
+ }
+ }
+})
+
+console.log('should be valid', validate({hello: 'world'}))
+console.log('should not be valid', validate({}))
+
+// get the last list of errors by checking validate.errors
+// the following will print [{field: 'data.hello', message: 'is required'}]
+console.log(validate.errors)
+```
+
+You can also pass the schema as a string
+
+``` js
+var validate = validate('{"type": ... }')
+```
+
+Optionally you can use the require submodule to load a schema from `__dirname`
+
+``` js
+var validator = require('is-my-json-valid/require')
+var validate = validator('my-schema.json')
+```
+
+## Custom formats
+
+is-my-json-valid supports the formats specified in JSON schema v4 (such as date-time).
+If you want to add your own custom formats pass them as the formats options to the validator
+
+``` js
+var validate = validator({
+ type: 'string',
+ required: true,
+ format: 'only-a'
+}, {
+ formats: {
+ 'only-a': /^a+$/
+ }
+})
+
+console.log(validate('aa')) // true
+console.log(validate('ab')) // false
+```
+
+## External schemas
+
+You can pass in external schemas that you reference using the `$ref` attribute as the `schemas` option
+
+``` js
+var ext = {
+ required: true,
+ type: 'string'
+}
+
+var schema = {
+ $ref: '#ext' // references another schema called ext
+}
+
+// pass the external schemas as an option
+var validate = validate(schema, {schemas: {ext: ext}})
+
+validate('hello') // returns true
+validate(42) // return false
+```
+
+## Filtering away additional properties
+
+is-my-json-valid supports filtering away properties not in the schema
+
+``` js
+var filter = validator.filter({
+ required: true,
+ type: 'object',
+ properties: {
+ hello: {type: 'string', required: true}
+ },
+ additionalProperties: false
+})
+
+var doc = {hello: 'world', notInSchema: true}
+console.log(filter(doc)) // {hello: 'world'}
+```
+
+## Verbose mode outputs the value on errors
+
+is-my-json-valid outputs the value causing an error when verbose is set to true
+
+``` js
+var validate = validator({
+ required: true,
+ type: 'object',
+ properties: {
+ hello: {
+ required: true,
+ type: 'string'
+ }
+ }
+}, {
+ verbose: true
+})
+
+validate({hello: 100});
+console.log(validate.errors) // {field: 'data.hello', message: 'is the wrong type', value: 100}
+```
+
+## Greedy mode tries to validate as much as possible
+
+By default is-my-json-valid bails on first validation error but when greedy is
+set to true it tries to validate as much as possible:
+
+``` js
+var validate = validator({
+ type: 'object',
+ properties: {
+ x: {
+ type: 'number'
+ }
+ },
+ required: ['x', 'y']
+}, {
+ greedy: true
+});
+
+validate({x: 'string'});
+console.log(validate.errors) // [{field: 'data.y', message: 'is required'},
+ // {field: 'data.x', message: 'is the wrong type'}]
+```
+
+## Performance
+
+is-my-json-valid uses code generation to turn your JSON schema into basic javascript code that is easily optimizeable by v8.
+
+At the time of writing, is-my-json-valid is the __fastest validator__ when running
+
+* [json-schema-benchmark](https://github.com/Muscula/json-schema-benchmark)
+* [cosmicreals.com benchmark](http://cosmicrealms.com/blog/2014/08/29/benchmark-of-node-dot-js-json-validation-modules-part-3/)
+* [jsck benchmark](https://github.com/pandastrike/jsck/issues/72#issuecomment-70992684)
+* [themis benchmark](https://cdn.rawgit.com/playlyfe/themis/master/benchmark/results.html)
+* [z-schema benchmark](https://rawgit.com/zaggino/z-schema/master/benchmark/results.html)
+
+If you know any other relevant benchmarks open a PR and I'll add them.
+
+## License
+
+MIT
diff --git a/tools/eslint/node_modules/is-my-json-valid/example.js b/tools/eslint/node_modules/is-my-json-valid/example.js
new file mode 100644
index 00000000000..f70f4dfb5ca
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/example.js
@@ -0,0 +1,18 @@
+var validator = require('./')
+
+var validate = validator({
+ type: 'object',
+ properties: {
+ hello: {
+ required: true,
+ type: 'string'
+ }
+ }
+})
+
+console.log('should be valid', validate({hello: 'world'}))
+console.log('should not be valid', validate({}))
+
+// get the last error message by checking validate.error
+// the following will print "data.hello is required"
+console.log('the errors were:', validate.errors)
diff --git a/tools/eslint/node_modules/is-my-json-valid/formats.js b/tools/eslint/node_modules/is-my-json-valid/formats.js
new file mode 100644
index 00000000000..3038daea921
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/formats.js
@@ -0,0 +1,14 @@
+exports['date-time'] = /^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-[0-9]{2}[tT ]\d{2}:\d{2}:\d{2}(\.\d+)?([zZ]|[+-]\d{2}:\d{2})$/
+exports['date'] = /^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-[0-9]{2}$/
+exports['time'] = /^\d{2}:\d{2}:\d{2}$/
+exports['email'] = /^\S+@\S+$/
+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9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/
+exports['uri'] = /^[a-zA-Z][a-zA-Z0-9+-.]*:[^\s]*$/
+exports['color'] = /(#?([0-9A-Fa-f]{3,6})\b)|(aqua)|(black)|(blue)|(fuchsia)|(gray)|(green)|(lime)|(maroon)|(navy)|(olive)|(orange)|(purple)|(red)|(silver)|(teal)|(white)|(yellow)|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\))/
+exports['hostname'] = /^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$/
+exports['alpha'] = /^[a-zA-Z]+$/
+exports['alphanumeric'] = /^[a-zA-Z0-9]+$/
+exports['style'] = /\s*(.+?):\s*([^;]+);?/g
+exports['phone'] = /^\+(?:[0-9] ?){6,14}[0-9]$/
+exports['utc-millisec'] = /^[0-9]+(\.?[0-9]+)?$/
diff --git a/tools/eslint/node_modules/is-my-json-valid/index.js b/tools/eslint/node_modules/is-my-json-valid/index.js
new file mode 100644
index 00000000000..6fef4ed6f0f
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/index.js
@@ -0,0 +1,569 @@
+var genobj = require('generate-object-property')
+var genfun = require('generate-function')
+var jsonpointer = require('jsonpointer')
+var xtend = require('xtend')
+var formats = require('./formats')
+
+var get = function(obj, additionalSchemas, ptr) {
+ if (/^https?:\/\//.test(ptr)) return null
+
+ var visit = function(sub) {
+ if (sub && sub.id === ptr) return sub
+ if (typeof sub !== 'object' || !sub) return null
+ return Object.keys(sub).reduce(function(res, k) {
+ return res || visit(sub[k])
+ }, null)
+ }
+
+ var res = visit(obj)
+ if (res) return res
+
+ ptr = ptr.replace(/^#/, '')
+ ptr = ptr.replace(/\/$/, '')
+
+ try {
+ return jsonpointer.get(obj, decodeURI(ptr))
+ } catch (err) {
+ var end = ptr.indexOf('#')
+ var other
+ // external reference
+ if (end !== 0) {
+ // fragment doesn't exist.
+ if (end === -1) {
+ other = additionalSchemas[ptr]
+ } else {
+ var ext = ptr.slice(0, end)
+ other = additionalSchemas[ext]
+ var fragment = ptr.slice(end).replace(/^#/, '')
+ try {
+ return jsonpointer.get(other, fragment)
+ } catch (err) {}
+ }
+ } else {
+ other = additionalSchemas[ptr]
+ }
+ return other || null
+ }
+}
+
+var formatName = function(field) {
+ field = JSON.stringify(field)
+ var pattern = /\[([^\[\]"]+)\]/
+ while (pattern.test(field)) field = field.replace(pattern, '."+$1+"')
+ return field
+}
+
+var types = {}
+
+types.any = function() {
+ return 'true'
+}
+
+types.null = function(name) {
+ return name+' === null'
+}
+
+types.boolean = function(name) {
+ return 'typeof '+name+' === "boolean"'
+}
+
+types.array = function(name) {
+ return 'Array.isArray('+name+')'
+}
+
+types.object = function(name) {
+ return 'typeof '+name+' === "object" && '+name+' && !Array.isArray('+name+')'
+}
+
+types.number = function(name) {
+ return 'typeof '+name+' === "number"'
+}
+
+types.integer = function(name) {
+ return 'typeof '+name+' === "number" && (Math.floor('+name+') === '+name+' || '+name+' > 9007199254740992 || '+name+' < -9007199254740992)'
+}
+
+types.string = function(name) {
+ return 'typeof '+name+' === "string"'
+}
+
+var unique = function(array) {
+ var list = []
+ for (var i = 0; i < array.length; i++) {
+ list.push(typeof array[i] === 'object' ? JSON.stringify(array[i]) : array[i])
+ }
+ for (var i = 1; i < list.length; i++) {
+ if (list.indexOf(list[i]) !== i) return false
+ }
+ return true
+}
+
+var toType = function(node) {
+ return node.type
+}
+
+var compile = function(schema, cache, root, reporter, opts) {
+ var fmts = opts ? xtend(formats, opts.formats) : formats
+ var scope = {unique:unique, formats:fmts}
+ var verbose = opts ? !!opts.verbose : false;
+ var greedy = opts && opts.greedy !== undefined ?
+ opts.greedy : false;
+
+ var syms = {}
+ var gensym = function(name) {
+ return name+(syms[name] = (syms[name] || 0)+1)
+ }
+
+ var reversePatterns = {}
+ var patterns = function(p) {
+ if (reversePatterns[p]) return reversePatterns[p]
+ var n = gensym('pattern')
+ scope[n] = new RegExp(p)
+ reversePatterns[p] = n
+ return n
+ }
+
+ var vars = ['i','j','k','l','m','n','o','p','q','r','s','t','u','v','x','y','z']
+ var genloop = function() {
+ var v = vars.shift()
+ vars.push(v+v[0])
+ return v
+ }
+
+ var visit = function(name, node, reporter, filter) {
+ var properties = node.properties
+ var type = node.type
+ var tuple = false
+
+ if (Array.isArray(node.items)) { // tuple type
+ properties = {}
+ node.items.forEach(function(item, i) {
+ properties[i] = item
+ })
+ type = 'array'
+ tuple = true
+ }
+
+ var indent = 0
+ var error = function(msg, prop, value) {
+ validate('errors++')
+ if (reporter === true) {
+ validate('if (validate.errors === null) validate.errors = []')
+ if (verbose) {
+ validate('validate.errors.push({field:%s,message:%s,value:%s})', formatName(prop || name), JSON.stringify(msg), value || name)
+ } else {
+ validate('validate.errors.push({field:%s,message:%s})', formatName(prop || name), JSON.stringify(msg))
+ }
+ }
+ }
+
+ if (node.required === true) {
+ indent++
+ validate('if (%s === undefined) {', name)
+ error('is required')
+ validate('} else {')
+ } else {
+ indent++
+ validate('if (%s !== undefined) {', name)
+ }
+
+ var valid = [].concat(type)
+ .map(function(t) {
+ return types[t || 'any'](name)
+ })
+ .join(' || ') || 'true'
+
+ if (valid !== 'true') {
+ indent++
+ validate('if (!(%s)) {', valid)
+ error('is the wrong type')
+ validate('} else {')
+ }
+
+ if (tuple) {
+ if (node.additionalItems === false) {
+ validate('if (%s.length > %d) {', name, node.items.length)
+ error('has additional items')
+ validate('}')
+ } else if (node.additionalItems) {
+ var i = genloop()
+ validate('for (var %s = %d; %s < %s.length; %s++) {', i, node.items.length, i, name, i)
+ visit(name+'['+i+']', node.additionalItems, reporter, filter)
+ validate('}')
+ }
+ }
+
+ if (node.format && fmts[node.format]) {
+ if (type !== 'string' && formats[node.format]) validate('if (%s) {', types.string(name))
+ var n = gensym('format')
+ scope[n] = fmts[node.format]
+
+ if (typeof scope[n] === 'function') validate('if (!%s(%s)) {', n, name)
+ else validate('if (!%s.test(%s)) {', n, name)
+ error('must be '+node.format+' format')
+ validate('}')
+ if (type !== 'string' && formats[node.format]) validate('}')
+ }
+
+ if (Array.isArray(node.required)) {
+ var isUndefined = function(req) {
+ return genobj(name, req) + ' === undefined'
+ }
+
+ var checkRequired = function (req) {
+ var prop = genobj(name, req);
+ validate('if (%s === undefined) {', prop)
+ error('is required', prop)
+ validate('missing++')
+ validate('}')
+ }
+ validate('if ((%s)) {', type !== 'object' ? types.object(name) : 'true')
+ validate('var missing = 0')
+ node.required.map(checkRequired)
+ validate('}');
+ if (!greedy) {
+ validate('if (missing === 0) {')
+ indent++
+ }
+ }
+
+ if (node.uniqueItems) {
+ if (type !== 'array') validate('if (%s) {', types.array(name))
+ validate('if (!(unique(%s))) {', name)
+ error('must be unique')
+ validate('}')
+ if (type !== 'array') validate('}')
+ }
+
+ if (node.enum) {
+ var complex = node.enum.some(function(e) {
+ return typeof e === 'object'
+ })
+
+ var compare = complex ?
+ function(e) {
+ return 'JSON.stringify('+name+')'+' !== JSON.stringify('+JSON.stringify(e)+')'
+ } :
+ function(e) {
+ return name+' !== '+JSON.stringify(e)
+ }
+
+ validate('if (%s) {', node.enum.map(compare).join(' && ') || 'false')
+ error('must be an enum value')
+ validate('}')
+ }
+
+ if (node.dependencies) {
+ if (type !== 'object') validate('if (%s) {', types.object(name))
+
+ Object.keys(node.dependencies).forEach(function(key) {
+ var deps = node.dependencies[key]
+ if (typeof deps === 'string') deps = [deps]
+
+ var exists = function(k) {
+ return genobj(name, k) + ' !== undefined'
+ }
+
+ if (Array.isArray(deps)) {
+ validate('if (%s !== undefined && !(%s)) {', genobj(name, key), deps.map(exists).join(' && ') || 'true')
+ error('dependencies not set')
+ validate('}')
+ }
+ if (typeof deps === 'object') {
+ validate('if (%s !== undefined) {', genobj(name, key))
+ visit(name, deps, reporter, filter)
+ validate('}')
+ }
+ })
+
+ if (type !== 'object') validate('}')
+ }
+
+ if (node.additionalProperties || node.additionalProperties === false) {
+ if (type !== 'object') validate('if (%s) {', types.object(name))
+
+ var i = genloop()
+ var keys = gensym('keys')
+
+ var toCompare = function(p) {
+ return keys+'['+i+'] !== '+JSON.stringify(p)
+ }
+
+ var toTest = function(p) {
+ return '!'+patterns(p)+'.test('+keys+'['+i+'])'
+ }
+
+ var additionalProp = Object.keys(properties || {}).map(toCompare)
+ .concat(Object.keys(node.patternProperties || {}).map(toTest))
+ .join(' && ') || 'true'
+
+ validate('var %s = Object.keys(%s)', keys, name)
+ ('for (var %s = 0; %s < %s.length; %s++) {', i, i, keys, i)
+ ('if (%s) {', additionalProp)
+
+ if (node.additionalProperties === false) {
+ if (filter) validate('delete %s', name+'['+keys+'['+i+']]')
+ error('has additional properties', null, JSON.stringify(name+'.') + ' + ' + keys + '['+i+']')
+ } else {
+ visit(name+'['+keys+'['+i+']]', node.additionalProperties, reporter, filter)
+ }
+
+ validate
+ ('}')
+ ('}')
+
+ if (type !== 'object') validate('}')
+ }
+
+ if (node.$ref) {
+ var sub = get(root, opts && opts.schemas || {}, node.$ref)
+ if (sub) {
+ var fn = cache[node.$ref]
+ if (!fn) {
+ cache[node.$ref] = function proxy(data) {
+ return fn(data)
+ }
+ fn = compile(sub, cache, root, false, opts)
+ }
+ var n = gensym('ref')
+ scope[n] = fn
+ validate('if (!(%s(%s))) {', n, name)
+ error('referenced schema does not match')
+ validate('}')
+ }
+ }
+
+ if (node.not) {
+ var prev = gensym('prev')
+ validate('var %s = errors', prev)
+ visit(name, node.not, false, filter)
+ validate('if (%s === errors) {', prev)
+ error('negative schema matches')
+ validate('} else {')
+ ('errors = %s', prev)
+ ('}')
+ }
+
+ if (node.items && !tuple) {
+ if (type !== 'array') validate('if (%s) {', types.array(name))
+
+ var i = genloop()
+ validate('for (var %s = 0; %s < %s.length; %s++) {', i, i, name, i)
+ visit(name+'['+i+']', node.items, reporter, filter)
+ validate('}')
+
+ if (type !== 'array') validate('}')
+ }
+
+ if (node.patternProperties) {
+ if (type !== 'object') validate('if (%s) {', types.object(name))
+ var keys = gensym('keys')
+ var i = genloop()
+ validate
+ ('var %s = Object.keys(%s)', keys, name)
+ ('for (var %s = 0; %s < %s.length; %s++) {', i, i, keys, i)
+
+ Object.keys(node.patternProperties).forEach(function(key) {
+ var p = patterns(key)
+ validate('if (%s.test(%s)) {', p, keys+'['+i+']')
+ visit(name+'['+keys+'['+i+']]', node.patternProperties[key], reporter, filter)
+ validate('}')
+ })
+
+ validate('}')
+ if (type !== 'object') validate('}')
+ }
+
+ if (node.pattern) {
+ var p = patterns(node.pattern)
+ if (type !== 'string') validate('if (%s) {', types.string(name))
+ validate('if (!(%s.test(%s))) {', p, name)
+ error('pattern mismatch')
+ validate('}')
+ if (type !== 'string') validate('}')
+ }
+
+ if (node.allOf) {
+ node.allOf.forEach(function(sch) {
+ visit(name, sch, reporter, filter)
+ })
+ }
+
+ if (node.anyOf && node.anyOf.length) {
+ var prev = gensym('prev')
+
+ node.anyOf.forEach(function(sch, i) {
+ if (i === 0) {
+ validate('var %s = errors', prev)
+ } else {
+ validate('if (errors !== %s) {', prev)
+ ('errors = %s', prev)
+ }
+ visit(name, sch, false, false)
+ })
+ node.anyOf.forEach(function(sch, i) {
+ if (i) validate('}')
+ })
+ validate('if (%s !== errors) {', prev)
+ error('no schemas match')
+ validate('}')
+ }
+
+ if (node.oneOf && node.oneOf.length) {
+ var prev = gensym('prev')
+ var passes = gensym('passes')
+
+ validate
+ ('var %s = errors', prev)
+ ('var %s = 0', passes)
+
+ node.oneOf.forEach(function(sch, i) {
+ visit(name, sch, false, false)
+ validate('if (%s === errors) {', prev)
+ ('%s++', passes)
+ ('} else {')
+ ('errors = %s', prev)
+ ('}')
+ })
+
+ validate('if (%s !== 1) {', passes)
+ error('no (or more than one) schemas match')
+ validate('}')
+ }
+
+ if (node.multipleOf !== undefined) {
+ if (type !== 'number' && type !== 'integer') validate('if (%s) {', types.number(name))
+
+ var factor = ((node.multipleOf | 0) !== node.multipleOf) ? Math.pow(10, node.multipleOf.toString().split('.').pop().length) : 1
+ if (factor > 1) validate('if ((%d*%s) % %d) {', factor, name, factor*node.multipleOf)
+ else validate('if (%s % %d) {', name, node.multipleOf)
+
+ error('has a remainder')
+ validate('}')
+
+ if (type !== 'number' && type !== 'integer') validate('}')
+ }
+
+ if (node.maxProperties !== undefined) {
+ if (type !== 'object') validate('if (%s) {', types.object(name))
+
+ validate('if (Object.keys(%s).length > %d) {', name, node.maxProperties)
+ error('has more properties than allowed')
+ validate('}')
+
+ if (type !== 'object') validate('}')
+ }
+
+ if (node.minProperties !== undefined) {
+ if (type !== 'object') validate('if (%s) {', types.object(name))
+
+ validate('if (Object.keys(%s).length < %d) {', name, node.minProperties)
+ error('has less properties than allowed')
+ validate('}')
+
+ if (type !== 'object') validate('}')
+ }
+
+ if (node.maxItems !== undefined) {
+ if (type !== 'array') validate('if (%s) {', types.array(name))
+
+ validate('if (%s.length > %d) {', name, node.maxItems)
+ error('has more items than allowed')
+ validate('}')
+
+ if (type !== 'array') validate('}')
+ }
+
+ if (node.minItems !== undefined) {
+ if (type !== 'array') validate('if (%s) {', types.array(name))
+
+ validate('if (%s.length < %d) {', name, node.minItems)
+ error('has less items than allowed')
+ validate('}')
+
+ if (type !== 'array') validate('}')
+ }
+
+ if (node.maxLength !== undefined) {
+ if (type !== 'string') validate('if (%s) {', types.string(name))
+
+ validate('if (%s.length > %d) {', name, node.maxLength)
+ error('has longer length than allowed')
+ validate('}')
+
+ if (type !== 'string') validate('}')
+ }
+
+ if (node.minLength !== undefined) {
+ if (type !== 'string') validate('if (%s) {', types.string(name))
+
+ validate('if (%s.length < %d) {', name, node.minLength)
+ error('has less length than allowed')
+ validate('}')
+
+ if (type !== 'string') validate('}')
+ }
+
+ if (node.minimum !== undefined) {
+ validate('if (%s %s %d) {', name, node.exclusiveMinimum ? '<=' : '<', node.minimum)
+ error('is less than minimum')
+ validate('}')
+ }
+
+ if (node.maximum !== undefined) {
+ validate('if (%s %s %d) {', name, node.exclusiveMaximum ? '>=' : '>', node.maximum)
+ error('is more than maximum')
+ validate('}')
+ }
+
+ if (properties) {
+ Object.keys(properties).forEach(function(p) {
+ visit(genobj(name, p), properties[p], reporter, filter)
+ })
+ }
+
+ while (indent--) validate('}')
+ }
+
+ var validate = genfun
+ ('function validate(data) {')
+ ('validate.errors = null')
+ ('var errors = 0')
+
+ visit('data', schema, reporter, opts && opts.filter)
+
+ validate
+ ('return errors === 0')
+ ('}')
+
+ validate = validate.toFunction(scope)
+ validate.errors = null
+
+ validate.__defineGetter__('error', function() {
+ if (!validate.errors) return ''
+ return validate.errors
+ .map(function(err) {
+ return err.field+' '+err.message
+ })
+ .join('\n')
+ })
+
+ validate.toJSON = function() {
+ return schema
+ }
+
+ return validate
+}
+
+module.exports = function(schema, opts) {
+ if (typeof schema === 'string') schema = JSON.parse(schema)
+ return compile(schema, {}, schema, true, opts)
+}
+
+module.exports.filter = function(schema, opts) {
+ var validate = module.exports(schema, xtend(opts, {filter: true}))
+ return function(sch) {
+ validate(sch)
+ return sch
+ }
+}
diff --git a/tools/eslint/node_modules/optionator/node_modules/wordwrap/.npmignore b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/.npmignore
index 3c3629e647f..3c3629e647f 100644
--- a/tools/eslint/node_modules/optionator/node_modules/wordwrap/.npmignore
+++ b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/.npmignore
diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/.travis.yml b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/.travis.yml
new file mode 100644
index 00000000000..6e5919de39a
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/.travis.yml
@@ -0,0 +1,3 @@
+language: node_js
+node_js:
+ - "0.10"
diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/README.md b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/README.md
new file mode 100644
index 00000000000..693bff87cfe
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/README.md
@@ -0,0 +1,72 @@
+# generate-function
+
+Module that helps you write generated functions in Node
+
+```
+npm install generate-function
+```
+
+[![build status](http://img.shields.io/travis/mafintosh/generate-function.svg?style=flat)](http://travis-ci.org/mafintosh/generate-function)
+
+## Disclamer
+
+Writing code that generates code is hard.
+You should only use this if you really, really, really need this for performance reasons (like schema validators / parsers etc).
+
+## Usage
+
+``` js
+var genfun = require('generate-function')
+
+var addNumber = function(val) {
+ var fn = genfun()
+ ('function add(n) {')
+ ('return n + %d', val) // supports format strings to insert values
+ ('}')
+
+ return fn.toFunction() // will compile the function
+}
+
+var add2 = addNumber(2)
+
+console.log('1+2=', add2(1))
+console.log(add2.toString()) // prints the generated function
+```
+
+If you need to close over variables in your generated function pass them to `toFunction(scope)`
+
+``` js
+var multiply = function(a, b) {
+ return a * b
+}
+
+var addAndMultiplyNumber = function(val) {
+ var fn = genfun()
+ ('function(n) {')
+ ('if (typeof n !== "number") {') // ending a line with { will indent the source
+ ('throw new Error("argument should be a number")')
+ ('}')
+ ('var result = multiply(%d, n+%d)', val, val)
+ ('return result')
+ ('}')
+
+ // use fn.toString() if you want to see the generated source
+
+ return fn.toFunction({
+ multiply: multiply
+ })
+}
+
+var addAndMultiply2 = addAndMultiplyNumber(2)
+
+console.log('(3 + 2) * 2 =', addAndMultiply2(3))
+```
+
+## Related
+
+See [generate-object-property](https://github.com/mafintosh/generate-object-property) if you need to safely generate code that
+can be used to reference an object property
+
+## License
+
+MIT \ No newline at end of file
diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/example.js b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/example.js
new file mode 100644
index 00000000000..8d1fee16262
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/example.js
@@ -0,0 +1,27 @@
+var genfun = require('./')
+
+var multiply = function(a, b) {
+ return a * b
+}
+
+var addAndMultiplyNumber = function(val) {
+ var fn = genfun()
+ ('function(n) {')
+ ('if (typeof n !== "number") {') // ending a line with { will indent the source
+ ('throw new Error("argument should be a number")')
+ ('}')
+ ('var result = multiply(%d, n+%d)', val, val)
+ ('return result')
+ ('}')
+
+ // use fn.toString() if you want to see the generated source
+
+ return fn.toFunction({
+ multiply: multiply
+ })
+}
+
+var addAndMultiply2 = addAndMultiplyNumber(2)
+
+console.log(addAndMultiply2.toString())
+console.log('(3 + 2) * 2 =', addAndMultiply2(3)) \ No newline at end of file
diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/index.js b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/index.js
new file mode 100644
index 00000000000..37e064bb47b
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/index.js
@@ -0,0 +1,61 @@
+var util = require('util')
+
+var INDENT_START = /[\{\[]/
+var INDENT_END = /[\}\]]/
+
+module.exports = function() {
+ var lines = []
+ var indent = 0
+
+ var push = function(str) {
+ var spaces = ''
+ while (spaces.length < indent*2) spaces += ' '
+ lines.push(spaces+str)
+ }
+
+ var line = function(fmt) {
+ if (!fmt) return line
+
+ if (INDENT_END.test(fmt.trim()[0]) && INDENT_START.test(fmt[fmt.length-1])) {
+ indent--
+ push(util.format.apply(util, arguments))
+ indent++
+ return line
+ }
+ if (INDENT_START.test(fmt[fmt.length-1])) {
+ push(util.format.apply(util, arguments))
+ indent++
+ return line
+ }
+ if (INDENT_END.test(fmt.trim()[0])) {
+ indent--
+ push(util.format.apply(util, arguments))
+ return line
+ }
+
+ push(util.format.apply(util, arguments))
+ return line
+ }
+
+ line.toString = function() {
+ return lines.join('\n')
+ }
+
+ line.toFunction = function(scope) {
+ var src = 'return ('+line.toString()+')'
+
+ var keys = Object.keys(scope || {}).map(function(key) {
+ return key
+ })
+
+ var vals = keys.map(function(key) {
+ return scope[key]
+ })
+
+ return Function.apply(null, keys.concat(src)).apply(null, vals)
+ }
+
+ if (arguments.length) line.apply(null, arguments)
+
+ return line
+}
diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/package.json b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/package.json
new file mode 100644
index 00000000000..db1ac2aa364
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/package.json
@@ -0,0 +1,53 @@
+{
+ "name": "generate-function",
+ "version": "2.0.0",
+ "description": "Module that helps you write generated functions in Node",
+ "main": "index.js",
+ "scripts": {
+ "test": "tape test.js"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/mafintosh/generate-function.git"
+ },
+ "keywords": [
+ "generate",
+ "code",
+ "generation",
+ "function",
+ "performance"
+ ],
+ "author": {
+ "name": "Mathias Buus"
+ },
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/mafintosh/generate-function/issues"
+ },
+ "homepage": "https://github.com/mafintosh/generate-function",
+ "devDependencies": {
+ "tape": "^2.13.4"
+ },
+ "gitHead": "3d5fc8de5859be95f58e3af9bfb5f663edd95149",
+ "_id": "generate-function@2.0.0",
+ "_shasum": "6858fe7c0969b7d4e9093337647ac79f60dfbe74",
+ "_from": "generate-function@>=2.0.0 <3.0.0",
+ "_npmVersion": "1.4.23",
+ "_npmUser": {
+ "name": "mafintosh",
+ "email": "mathiasbuus@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "mafintosh",
+ "email": "mathiasbuus@gmail.com"
+ }
+ ],
+ "dist": {
+ "shasum": "6858fe7c0969b7d4e9093337647ac79f60dfbe74",
+ "tarball": "http://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/test.js b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/test.js
new file mode 100644
index 00000000000..2768893eb15
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/test.js
@@ -0,0 +1,33 @@
+var tape = require('tape')
+var genfun = require('./')
+
+tape('generate add function', function(t) {
+ var fn = genfun()
+ ('function add(n) {')
+ ('return n + %d', 42)
+ ('}')
+
+ t.same(fn.toString(), 'function add(n) {\n return n + 42\n}', 'code is indented')
+ t.same(fn.toFunction()(10), 52, 'function works')
+ t.end()
+})
+
+tape('generate function + closed variables', function(t) {
+ var fn = genfun()
+ ('function add(n) {')
+ ('return n + %d + number', 42)
+ ('}')
+
+ var notGood = fn.toFunction()
+ var good = fn.toFunction({number:10})
+
+ try {
+ notGood(10)
+ t.ok(false, 'function should not work')
+ } catch (err) {
+ t.same(err.message, 'number is not defined', 'throws reference error')
+ }
+
+ t.same(good(11), 63, 'function with closed var works')
+ t.end()
+}) \ No newline at end of file
diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/.npmignore b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/.npmignore
new file mode 100644
index 00000000000..3c3629e647f
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/.npmignore
@@ -0,0 +1 @@
+node_modules
diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/.travis.yml b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/.travis.yml
new file mode 100644
index 00000000000..6e5919de39a
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/.travis.yml
@@ -0,0 +1,3 @@
+language: node_js
+node_js:
+ - "0.10"
diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/LICENSE b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/LICENSE
new file mode 100644
index 00000000000..757562ec592
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Mathias Buus
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE. \ No newline at end of file
diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/README.md b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/README.md
new file mode 100644
index 00000000000..0ee04613de5
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/README.md
@@ -0,0 +1,19 @@
+# generate-object-property
+
+Generate safe JS code that can used to reference a object property
+
+ npm install generate-object-property
+
+[![build status](http://img.shields.io/travis/mafintosh/generate-object-property.svg?style=flat)](http://travis-ci.org/mafintosh/generate-object-property)
+
+## Usage
+
+``` js
+var gen = require('generate-object-property');
+console.log(gen('a','b')); // prints a.b
+console.log(gen('a', 'foo-bar')); // prints a["foo-bar"]
+```
+
+## License
+
+MIT \ No newline at end of file
diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/index.js b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/index.js
new file mode 100644
index 00000000000..5dc9f776d98
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/index.js
@@ -0,0 +1,12 @@
+var isProperty = require('is-property')
+
+var gen = function(obj, prop) {
+ return isProperty(prop) ? obj+'.'+prop : obj+'['+JSON.stringify(prop)+']'
+}
+
+gen.valid = isProperty
+gen.property = function (prop) {
+ return isProperty(prop) ? prop : JSON.stringify(prop)
+}
+
+module.exports = gen
diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/.npmignore b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/.npmignore
new file mode 100644
index 00000000000..8ecfa25a868
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/.npmignore
@@ -0,0 +1,17 @@
+lib-cov
+*.seed
+*.log
+*.csv
+*.dat
+*.out
+*.pid
+*.gz
+
+pids
+logs
+results
+
+npm-debug.log
+node_modules/*
+*.DS_Store
+test/* \ No newline at end of file
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/License b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/LICENSE
index 4804b7ab411..8ce206a8454 100644
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/License
+++ b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/LICENSE
@@ -1,4 +1,7 @@
-Copyright (c) 2011 Debuggable Limited <felix@debuggable.com>
+
+The MIT License (MIT)
+
+Copyright (c) 2013 Mikola Lysenko
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/README.md b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/README.md
new file mode 100644
index 00000000000..ef1d00b62f8
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/README.md
@@ -0,0 +1,28 @@
+is-property
+===========
+Tests if a property of a JavaScript object can be accessed using the dot (.) notation or if it must be enclosed in brackets, (ie use x[" ... "])
+
+Example
+-------
+
+```javascript
+var isProperty = require("is-property")
+
+console.log(isProperty("foo")) //Prints true
+console.log(isProperty("0")) //Prints false
+```
+
+Install
+-------
+
+ npm install is-property
+
+### `require("is-property")(str)`
+Checks if str is a property
+
+* `str` is a string which we will test if it is a property or not
+
+**Returns** true or false depending if str is a property
+
+## Credits
+(c) 2013 Mikola Lysenko. MIT License \ No newline at end of file
diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/is-property.js b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/is-property.js
new file mode 100644
index 00000000000..db58b47b27a
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/is-property.js
@@ -0,0 +1,5 @@
+"use strict"
+function isProperty(str) {
+ return /^[$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc][$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc0-9\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19b0-\u19c0\u19c8\u19c9\u19d0-\u19d9\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2-\u1cf4\u1dc0-\u1de6\u1dfc-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f1\ua900-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f]*$/.test(str)
+}
+module.exports = isProperty \ No newline at end of file
diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/package.json b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/package.json
new file mode 100644
index 00000000000..9f236194773
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/package.json
@@ -0,0 +1,59 @@
+{
+ "name": "is-property",
+ "version": "1.0.2",
+ "description": "Tests if a JSON property can be accessed using . syntax",
+ "main": "is-property.js",
+ "directories": {
+ "test": "test"
+ },
+ "dependencies": {},
+ "devDependencies": {
+ "tape": "~1.0.4"
+ },
+ "scripts": {
+ "test": "tap test/*.js"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/mikolalysenko/is-property.git"
+ },
+ "keywords": [
+ "is",
+ "property",
+ "json",
+ "dot",
+ "bracket",
+ ".",
+ "[]"
+ ],
+ "author": {
+ "name": "Mikola Lysenko"
+ },
+ "license": "MIT",
+ "gitHead": "0a85ea5b6b1264ea1cdecc6e5cf186adbb3ffc50",
+ "bugs": {
+ "url": "https://github.com/mikolalysenko/is-property/issues"
+ },
+ "homepage": "https://github.com/mikolalysenko/is-property",
+ "_id": "is-property@1.0.2",
+ "_shasum": "57fe1c4e48474edd65b09911f26b1cd4095dda84",
+ "_from": "is-property@>=1.0.0 <2.0.0",
+ "_npmVersion": "2.1.4",
+ "_nodeVersion": "0.10.26",
+ "_npmUser": {
+ "name": "mikolalysenko",
+ "email": "mikolalysenko@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "mikolalysenko",
+ "email": "mikolalysenko@gmail.com"
+ }
+ ],
+ "dist": {
+ "shasum": "57fe1c4e48474edd65b09911f26b1cd4095dda84",
+ "tarball": "http://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz"
+ },
+ "_resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/package.json b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/package.json
new file mode 100644
index 00000000000..8bc73da759f
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/package.json
@@ -0,0 +1,51 @@
+{
+ "name": "generate-object-property",
+ "version": "1.2.0",
+ "description": "Generate safe JS code that can used to reference a object property",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/mafintosh/generate-object-property.git"
+ },
+ "devDependencies": {
+ "tape": "^2.13.0"
+ },
+ "scripts": {
+ "test": "tape test.js"
+ },
+ "dependencies": {
+ "is-property": "^1.0.0"
+ },
+ "bugs": {
+ "url": "https://github.com/mafintosh/generate-object-property/issues"
+ },
+ "homepage": "https://github.com/mafintosh/generate-object-property",
+ "main": "index.js",
+ "author": {
+ "name": "Mathias Buus",
+ "url": "@mafintosh"
+ },
+ "license": "MIT",
+ "gitHead": "0dd7d411018de54b2eae63b424c15b3e50bd678c",
+ "_id": "generate-object-property@1.2.0",
+ "_shasum": "9c0e1c40308ce804f4783618b937fa88f99d50d0",
+ "_from": "generate-object-property@>=1.1.0 <2.0.0",
+ "_npmVersion": "2.9.0",
+ "_nodeVersion": "2.0.1",
+ "_npmUser": {
+ "name": "mafintosh",
+ "email": "mathiasbuus@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "mafintosh",
+ "email": "mathiasbuus@gmail.com"
+ }
+ ],
+ "dist": {
+ "shasum": "9c0e1c40308ce804f4783618b937fa88f99d50d0",
+ "tarball": "http://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/test.js b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/test.js
new file mode 100644
index 00000000000..6c299c67fd3
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/test.js
@@ -0,0 +1,12 @@
+var tape = require('tape')
+var gen = require('./')
+
+tape('valid', function(t) {
+ t.same(gen('a', 'b'), 'a.b')
+ t.end()
+})
+
+tape('invalid', function(t) {
+ t.same(gen('a', '-b'), 'a["-b"]')
+ t.end()
+}) \ No newline at end of file
diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/.travis.yml b/tools/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/.travis.yml
new file mode 100644
index 00000000000..a057a7c6373
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/.travis.yml
@@ -0,0 +1,6 @@
+language: "node_js"
+node_js:
+ - 0.4
+ - 0.5
+ - 0.6
+ - 0.8
diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/README.md b/tools/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/README.md
new file mode 100644
index 00000000000..bcfdb1a4ec8
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/README.md
@@ -0,0 +1,31 @@
+# JSON Pointer for nodejs
+
+This is an implementation of [JSON Pointer](http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-08).
+
+## Usage
+
+ var jsonpointer = require("jsonpointer");
+ var obj = { foo: 1, bar: { baz: 2}, qux: [3, 4, 5]};
+ var one = jsonpointer.get(obj, "/foo");
+ var two = jsonpointer.get(obj, "/bar/baz");
+ var three = jsonpointer.get(obj, "/qux/0");
+ var four = jsonpointer.get(obj, "/qux/1");
+ var five = jsonpointer.get(obj, "/qux/2");
+
+ jsonpointer.set(obj, "/foo", 6); // obj.foo = 6;
+
+## Testing
+
+ $ node test.js
+ All tests pass.
+ $
+
+[![Build Status](https://travis-ci.org/janl/node-jsonpointer.png?branch=master)](undefined)
+
+## Author
+
+(c) 2011 Jan Lehnardt <jan@apache.org>
+
+## License
+
+MIT License. \ No newline at end of file
diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/jsonpointer.js b/tools/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/jsonpointer.js
new file mode 100644
index 00000000000..3f53026efd1
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/jsonpointer.js
@@ -0,0 +1,79 @@
+var console = require("console");
+
+var untilde = function(str) {
+ return str.replace(/~./g, function(m) {
+ switch (m) {
+ case "~0":
+ return "~";
+ case "~1":
+ return "/";
+ }
+ throw("Invalid tilde escape: " + m);
+ });
+}
+
+var traverse = function(obj, pointer, value) {
+ // assert(isArray(pointer))
+ var part = untilde(pointer.shift());
+ if(typeof obj[part] === "undefined") {
+ throw("Value for pointer '" + pointer + "' not found.");
+ return;
+ }
+ if(pointer.length !== 0) { // keep traversin!
+ return traverse(obj[part], pointer, value);
+ }
+ // we're done
+ if(typeof value === "undefined") {
+ // just reading
+ return obj[part];
+ }
+ // set new value, return old value
+ var old_value = obj[part];
+ if(value === null) {
+ delete obj[part];
+ } else {
+ obj[part] = value;
+ }
+ return old_value;
+}
+
+var validate_input = function(obj, pointer) {
+ if(typeof obj !== "object") {
+ throw("Invalid input object.");
+ }
+
+ if(pointer === "") {
+ return [];
+ }
+
+ if(!pointer) {
+ throw("Invalid JSON pointer.");
+ }
+
+ pointer = pointer.split("/");
+ var first = pointer.shift();
+ if (first !== "") {
+ throw("Invalid JSON pointer.");
+ }
+
+ return pointer;
+}
+
+var get = function(obj, pointer) {
+ pointer = validate_input(obj, pointer);
+ if (pointer.length === 0) {
+ return obj;
+ }
+ return traverse(obj, pointer);
+}
+
+var set = function(obj, pointer, value) {
+ pointer = validate_input(obj, pointer);
+ if (pointer.length === 0) {
+ throw("Invalid JSON pointer for set.")
+ }
+ return traverse(obj, pointer, value);
+}
+
+exports.get = get
+exports.set = set
diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/package.json b/tools/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/package.json
new file mode 100644
index 00000000000..bde9b77dd91
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/package.json
@@ -0,0 +1,61 @@
+{
+ "name": "jsonpointer",
+ "description": "Simple JSON Addressing.",
+ "tags": [
+ "util",
+ "simple",
+ "util",
+ "utility"
+ ],
+ "version": "1.1.0",
+ "author": {
+ "name": "Jan Lehnardt",
+ "email": "jan@apache.org"
+ },
+ "contributors": [
+ {
+ "name": "Joe Hildebrand",
+ "email": "joe-github@cursive.net"
+ },
+ {
+ "name": "Filip Noetzel"
+ }
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git+ssh://git@github.com/janl/node-jsonpointer.git"
+ },
+ "bugs": {
+ "url": "http://github.com/janl/node-jsonpointer/issues"
+ },
+ "engines": [
+ "node >= 0.4.9"
+ ],
+ "main": "./jsonpointer",
+ "scripts": {
+ "test": "node test.js"
+ },
+ "readme": "# JSON Pointer for nodejs\n\nThis is an implementation of [JSON Pointer](http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-08).\n\n## Usage\n\n var jsonpointer = require(\"jsonpointer\");\n var obj = { foo: 1, bar: { baz: 2}, qux: [3, 4, 5]};\n var one = jsonpointer.get(obj, \"/foo\");\n var two = jsonpointer.get(obj, \"/bar/baz\");\n var three = jsonpointer.get(obj, \"/qux/0\");\n var four = jsonpointer.get(obj, \"/qux/1\");\n var five = jsonpointer.get(obj, \"/qux/2\");\n\n jsonpointer.set(obj, \"/foo\", 6); // obj.foo = 6;\n\n## Testing\n\n $ node test.js\n All tests pass.\n $\n\n[![Build Status](https://travis-ci.org/janl/node-jsonpointer.png?branch=master)](undefined)\n\n## Author\n\n(c) 2011 Jan Lehnardt <jan@apache.org>\n\n## License\n\nMIT License.",
+ "readmeFilename": "README.md",
+ "_id": "jsonpointer@1.1.0",
+ "dist": {
+ "shasum": "c3c72efaed3b97154163dc01dd349e1cfe0f80fc",
+ "tarball": "http://registry.npmjs.org/jsonpointer/-/jsonpointer-1.1.0.tgz"
+ },
+ "_npmVersion": "1.1.69",
+ "_npmUser": {
+ "name": "jan",
+ "email": "jan@apache.org"
+ },
+ "maintainers": [
+ {
+ "name": "jan",
+ "email": "jan@apache.org"
+ }
+ ],
+ "directories": {},
+ "_shasum": "c3c72efaed3b97154163dc01dd349e1cfe0f80fc",
+ "_resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-1.1.0.tgz",
+ "_from": "jsonpointer@>=1.1.0 <2.0.0",
+ "homepage": "https://github.com/janl/node-jsonpointer"
+}
diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/test.js b/tools/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/test.js
new file mode 100644
index 00000000000..cdb8ec506c3
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/test.js
@@ -0,0 +1,100 @@
+var assert = require("assert");
+var console = require("console");
+var jsonpointer = require("./jsonpointer");
+
+var obj = {
+ a: 1,
+ b: {
+ c: 2
+ },
+ d: {
+ e: [{a:3}, {b:4}, {c:5}]
+ }
+};
+
+assert.equal(jsonpointer.get(obj, "/a"), 1);
+assert.equal(jsonpointer.get(obj, "/b/c"), 2);
+assert.equal(jsonpointer.get(obj, "/d/e/0/a"), 3);
+assert.equal(jsonpointer.get(obj, "/d/e/1/b"), 4);
+assert.equal(jsonpointer.get(obj, "/d/e/2/c"), 5);
+
+// set returns old value
+assert.equal(jsonpointer.set(obj, "/a", 2), 1);
+assert.equal(jsonpointer.set(obj, "/b/c", 3), 2);
+assert.equal(jsonpointer.set(obj, "/d/e/0/a", 4), 3);
+assert.equal(jsonpointer.set(obj, "/d/e/1/b", 5), 4);
+assert.equal(jsonpointer.set(obj, "/d/e/2/c", 6), 5);
+
+assert.equal(jsonpointer.get(obj, "/a"), 2);
+assert.equal(jsonpointer.get(obj, "/b/c"), 3);
+assert.equal(jsonpointer.get(obj, "/d/e/0/a"), 4);
+assert.equal(jsonpointer.get(obj, "/d/e/1/b"), 5);
+assert.equal(jsonpointer.get(obj, "/d/e/2/c"), 6);
+
+assert.equal(jsonpointer.get(obj, ""), obj);
+assert.throws(function() {
+ assert.equal(jsonpointer.get(obj, "a"), 3);
+});
+
+var complexKeys = {
+ "a/b": {
+ c: 1
+ },
+ d: {
+ "e/f": 2
+ },
+ "~1": 3,
+ "01": 4
+}
+
+assert.equal(jsonpointer.get(complexKeys, "/a~1b/c"), 1);
+assert.equal(jsonpointer.get(complexKeys, "/d/e~1f"), 2);
+assert.equal(jsonpointer.get(complexKeys, "/~01"), 3);
+assert.equal(jsonpointer.get(complexKeys, "/01"), 4);
+assert.throws(function() {
+ assert.equal(jsonpointer.get(complexKeys, "/a/b/c"), 1);
+});
+assert.throws(function() {
+ assert.equal(jsonpointer.get(complexKeys, "/~1"), 3);
+});
+
+// draft-ietf-appsawg-json-pointer-08 has special array rules
+var ary = [ "zero", "one", "two" ];
+
+assert.throws(function() {
+ assert.equal(jsonpointer.get(ary, "/01"), "one");
+});
+//assert.equal(jsonpointer.set(ary, "/-", "three"), null);
+//assert.equal(ary[3], "three");
+
+// Examples from the draft:
+var example = {
+ "foo": ["bar", "baz"],
+ "": 0,
+ "a/b": 1,
+ "c%d": 2,
+ "e^f": 3,
+ "g|h": 4,
+ "i\\j": 5,
+ "k\"l": 6,
+ " ": 7,
+ "m~n": 8
+};
+
+assert.equal(jsonpointer.get(example, ""), example);
+var ans = jsonpointer.get(example, "/foo");
+assert.equal(ans.length, 2);
+assert.equal(ans[0], "bar");
+assert.equal(ans[1], "baz");
+assert.equal(jsonpointer.get(example, "/foo/0"), "bar");
+assert.equal(jsonpointer.get(example, "/"), 0);
+assert.equal(jsonpointer.get(example, "/a~1b"), 1);
+assert.equal(jsonpointer.get(example, "/c%d"), 2);
+assert.equal(jsonpointer.get(example, "/e^f"), 3);
+assert.equal(jsonpointer.get(example, "/g|h"), 4);
+assert.equal(jsonpointer.get(example, "/i\\j"), 5);
+assert.equal(jsonpointer.get(example, "/k\"l"), 6);
+assert.equal(jsonpointer.get(example, "/ "), 7);
+assert.equal(jsonpointer.get(example, "/m~0n"), 8);
+
+console.log("All tests pass.");
diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/.jshintrc b/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/.jshintrc
index 77887b5f0f2..77887b5f0f2 100644
--- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/.jshintrc
+++ b/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/.jshintrc
diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/.npmignore b/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/.npmignore
new file mode 100644
index 00000000000..3c3629e647f
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/.npmignore
@@ -0,0 +1 @@
+node_modules
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/License b/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/LICENCE
index 4804b7ab411..1a14b437e87 100644
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/License
+++ b/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/LICENCE
@@ -1,4 +1,4 @@
-Copyright (c) 2011 Debuggable Limited <felix@debuggable.com>
+Copyright (c) 2012-2014 Raynos.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/Makefile b/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/Makefile
new file mode 100644
index 00000000000..d583fcf49dc
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/Makefile
@@ -0,0 +1,4 @@
+browser:
+ node ./support/compile
+
+.PHONY: browser \ No newline at end of file
diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/README.md b/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/README.md
new file mode 100644
index 00000000000..093cb2978e4
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/README.md
@@ -0,0 +1,32 @@
+# xtend
+
+[![browser support][3]][4]
+
+[![locked](http://badges.github.io/stability-badges/dist/locked.svg)](http://github.com/badges/stability-badges)
+
+Extend like a boss
+
+xtend is a basic utility library which allows you to extend an object by appending all of the properties from each object in a list. When there are identical properties, the right-most property takes precedence.
+
+## Examples
+
+```js
+var extend = require("xtend")
+
+// extend returns a new object. Does not mutate arguments
+var combination = extend({
+ a: "a",
+ b: 'c'
+}, {
+ b: "b"
+})
+// { a: "a", b: "b" }
+```
+
+## Stability status: Locked
+
+## MIT Licenced
+
+
+ [3]: http://ci.testling.com/Raynos/xtend.png
+ [4]: http://ci.testling.com/Raynos/xtend
diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/immutable.js b/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/immutable.js
new file mode 100644
index 00000000000..5b760152b75
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/immutable.js
@@ -0,0 +1,17 @@
+module.exports = extend
+
+function extend() {
+ var target = {}
+
+ for (var i = 0; i < arguments.length; i++) {
+ var source = arguments[i]
+
+ for (var key in source) {
+ if (source.hasOwnProperty(key)) {
+ target[key] = source[key]
+ }
+ }
+ }
+
+ return target
+}
diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/mutable.js b/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/mutable.js
new file mode 100644
index 00000000000..a34475ebddf
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/mutable.js
@@ -0,0 +1,15 @@
+module.exports = extend
+
+function extend(target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = arguments[i]
+
+ for (var key in source) {
+ if (source.hasOwnProperty(key)) {
+ target[key] = source[key]
+ }
+ }
+ }
+
+ return target
+}
diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/package.json b/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/package.json
new file mode 100644
index 00000000000..907a720da7e
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/package.json
@@ -0,0 +1,88 @@
+{
+ "name": "xtend",
+ "version": "4.0.0",
+ "description": "extend like a boss",
+ "keywords": [
+ "extend",
+ "merge",
+ "options",
+ "opts",
+ "object",
+ "array"
+ ],
+ "author": {
+ "name": "Raynos",
+ "email": "raynos2@gmail.com"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/Raynos/xtend.git"
+ },
+ "main": "immutable",
+ "scripts": {
+ "test": "node test"
+ },
+ "dependencies": {},
+ "devDependencies": {
+ "tape": "~1.1.0"
+ },
+ "homepage": "https://github.com/Raynos/xtend",
+ "contributors": [
+ {
+ "name": "Jake Verbaten"
+ },
+ {
+ "name": "Matt Esch"
+ }
+ ],
+ "bugs": {
+ "url": "https://github.com/Raynos/xtend/issues",
+ "email": "raynos2@gmail.com"
+ },
+ "licenses": [
+ {
+ "type": "MIT",
+ "url": "http://github.com/raynos/xtend/raw/master/LICENSE"
+ }
+ ],
+ "testling": {
+ "files": "test.js",
+ "browsers": [
+ "ie/7..latest",
+ "firefox/16..latest",
+ "firefox/nightly",
+ "chrome/22..latest",
+ "chrome/canary",
+ "opera/12..latest",
+ "opera/next",
+ "safari/5.1..latest",
+ "ipad/6.0..latest",
+ "iphone/6.0..latest"
+ ]
+ },
+ "engines": {
+ "node": ">=0.4"
+ },
+ "gitHead": "94a95d76154103290533b2c55ffa0fe4be16bfef",
+ "_id": "xtend@4.0.0",
+ "_shasum": "8bc36ff87aedbe7ce9eaf0bca36b2354a743840f",
+ "_from": "xtend@>=4.0.0 <5.0.0",
+ "_npmVersion": "1.4.15",
+ "_npmUser": {
+ "name": "raynos",
+ "email": "raynos2@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "raynos",
+ "email": "raynos2@gmail.com"
+ }
+ ],
+ "dist": {
+ "shasum": "8bc36ff87aedbe7ce9eaf0bca36b2354a743840f",
+ "tarball": "http://registry.npmjs.org/xtend/-/xtend-4.0.0.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.0.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/test.js b/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/test.js
new file mode 100644
index 00000000000..3369d79660b
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/test.js
@@ -0,0 +1,63 @@
+var test = require("tape")
+var extend = require("./")
+var mutableExtend = require("./mutable")
+
+test("merge", function(assert) {
+ var a = { a: "foo" }
+ var b = { b: "bar" }
+
+ assert.deepEqual(extend(a, b), { a: "foo", b: "bar" })
+ assert.end()
+})
+
+test("replace", function(assert) {
+ var a = { a: "foo" }
+ var b = { a: "bar" }
+
+ assert.deepEqual(extend(a, b), { a: "bar" })
+ assert.end()
+})
+
+test("undefined", function(assert) {
+ var a = { a: undefined }
+ var b = { b: "foo" }
+
+ assert.deepEqual(extend(a, b), { a: undefined, b: "foo" })
+ assert.deepEqual(extend(b, a), { a: undefined, b: "foo" })
+ assert.end()
+})
+
+test("handle 0", function(assert) {
+ var a = { a: "default" }
+ var b = { a: 0 }
+
+ assert.deepEqual(extend(a, b), { a: 0 })
+ assert.deepEqual(extend(b, a), { a: "default" })
+ assert.end()
+})
+
+test("is immutable", function (assert) {
+ var record = {}
+
+ extend(record, { foo: "bar" })
+ assert.equal(record.foo, undefined)
+ assert.end()
+})
+
+test("null as argument", function (assert) {
+ var a = { foo: "bar" }
+ var b = null
+ var c = void 0
+
+ assert.deepEqual(extend(b, a, c), { foo: "bar" })
+ assert.end()
+})
+
+test("mutable", function (assert) {
+ var a = { foo: "bar" }
+
+ mutableExtend(a, { bar: "baz" })
+
+ assert.equal(a.bar, "baz")
+ assert.end()
+})
diff --git a/tools/eslint/node_modules/is-my-json-valid/package.json b/tools/eslint/node_modules/is-my-json-valid/package.json
new file mode 100644
index 00000000000..79099026347
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/package.json
@@ -0,0 +1,67 @@
+{
+ "name": "is-my-json-valid",
+ "version": "2.12.0",
+ "description": "A JSONSchema validator that uses code generation to be extremely fast",
+ "main": "index.js",
+ "dependencies": {
+ "generate-function": "^2.0.0",
+ "generate-object-property": "^1.1.0",
+ "jsonpointer": "^1.1.0",
+ "xtend": "^4.0.0"
+ },
+ "devDependencies": {
+ "tape": "^2.13.4"
+ },
+ "scripts": {
+ "test": "tape test/*.js"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/mafintosh/is-my-json-valid.git"
+ },
+ "keywords": [
+ "json",
+ "schema",
+ "orderly",
+ "jsonschema"
+ ],
+ "author": {
+ "name": "Mathias Buus"
+ },
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/mafintosh/is-my-json-valid/issues"
+ },
+ "homepage": "https://github.com/mafintosh/is-my-json-valid",
+ "gitHead": "fc2d995ecb1bdb0f367ddf114dfd069265043c6c",
+ "_id": "is-my-json-valid@2.12.0",
+ "_shasum": "8fa6c408b26be95b45a23e8f8c4b464a53874d2b",
+ "_from": "is-my-json-valid@>=2.10.0 <3.0.0",
+ "_npmVersion": "2.9.0",
+ "_nodeVersion": "2.0.1",
+ "_npmUser": {
+ "name": "mafintosh",
+ "email": "mathiasbuus@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "mafintosh",
+ "email": "mathiasbuus@gmail.com"
+ },
+ {
+ "name": "watson",
+ "email": "w@tson.dk"
+ },
+ {
+ "name": "freeall",
+ "email": "freeall@gmail.com"
+ }
+ ],
+ "dist": {
+ "shasum": "8fa6c408b26be95b45a23e8f8c4b464a53874d2b",
+ "tarball": "http://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.12.0.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.12.0.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/tools/eslint/node_modules/is-my-json-valid/require.js b/tools/eslint/node_modules/is-my-json-valid/require.js
new file mode 100644
index 00000000000..0bfb8a29d47
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/require.js
@@ -0,0 +1,12 @@
+var fs = require('fs')
+var path = require('path')
+var compile = require('./')
+
+delete require.cache[require.resolve(__filename)]
+
+module.exports = function(file, opts) {
+ file = path.join(path.dirname(module.parent.filename), file)
+ if (!fs.existsSync(file) && fs.existsSync(file+'.schema')) file += '.schema'
+ if (!fs.existsSync(file) && fs.existsSync(file+'.json')) file += '.json'
+ return compile(fs.readFileSync(file, 'utf-8'), opts)
+}
diff --git a/tools/eslint/node_modules/is-my-json-valid/test/fixtures/cosmic.js b/tools/eslint/node_modules/is-my-json-valid/test/fixtures/cosmic.js
new file mode 100644
index 00000000000..4e0a34b210c
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/test/fixtures/cosmic.js
@@ -0,0 +1,84 @@
+exports.valid = {
+ fullName : "John Doe",
+ age : 47,
+ state : "Massachusetts",
+ city : "Boston",
+ zip : 16417,
+ married : false,
+ dozen : 12,
+ dozenOrBakersDozen : 13,
+ favoriteEvenNumber : 14,
+ topThreeFavoriteColors : [ "red", "blue", "green" ],
+ favoriteSingleDigitWholeNumbers : [ 7 ],
+ favoriteFiveLetterWord : "coder",
+ emailAddresses :
+ [
+ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@letters-in-local.org",
+ "01234567890@numbers-in-local.net",
+ "&'*+-./=?^_{}~@other-valid-characters-in-local.net",
+ "mixed-1234-in-{+^}-local@sld.net",
+ "a@single-character-in-local.org",
+ "\"quoted\"@sld.com",
+ "\"\\e\\s\\c\\a\\p\\e\\d\"@sld.com",
+ "\"quoted-at-sign@sld.org\"@sld.com",
+ "\"escaped\\\"quote\"@sld.com",
+ "\"back\\slash\"@sld.com",
+ "one-character-third-level@a.example.com",
+ "single-character-in-sld@x.org",
+ "local@dash-in-sld.com",
+ "letters-in-sld@123.com",
+ "one-letter-sld@x.org",
+ "uncommon-tld@sld.museum",
+ "uncommon-tld@sld.travel",
+ "uncommon-tld@sld.mobi",
+ "country-code-tld@sld.uk",
+ "country-code-tld@sld.rw",
+ "local@sld.newTLD",
+ "the-total-length@of-an-entire-address.cannot-be-longer-than-two-hundred-and-fifty-four-characters.and-this-address-is-254-characters-exactly.so-it-should-be-valid.and-im-going-to-add-some-more-words-here.to-increase-the-lenght-blah-blah-blah-blah-bla.org",
+ "the-character-limit@for-each-part.of-the-domain.is-sixty-three-characters.this-is-exactly-sixty-three-characters-so-it-is-valid-blah-blah.com",
+ "local@sub.domains.com"
+ ],
+ ipAddresses : [ "127.0.0.1", "24.48.64.2", "192.168.1.1", "209.68.44.3", "2.2.2.2" ]
+}
+
+exports.invalid = {
+ fullName : null,
+ age : -1,
+ state : 47,
+ city : false,
+ zip : [null],
+ married : "yes",
+ dozen : 50,
+ dozenOrBakersDozen : "over 9000",
+ favoriteEvenNumber : 15,
+ topThreeFavoriteColors : [ "red", 5 ],
+ favoriteSingleDigitWholeNumbers : [ 78, 2, 999 ],
+ favoriteFiveLetterWord : "codernaut",
+ emailAddresses : [],
+ ipAddresses : [ "999.0.099.1", "294.48.64.2346", false, "2221409.64214128.42414.235233", "124124.12412412" ]
+}
+
+exports.schema = { // from cosmic thingy
+ name : "test",
+ type : "object",
+ additionalProperties : false,
+ required : ["fullName", "age", "zip", "married", "dozen", "dozenOrBakersDozen", "favoriteEvenNumber", "topThreeFavoriteColors", "favoriteSingleDigitWholeNumbers", "favoriteFiveLetterWord", "emailAddresses", "ipAddresses"],
+ properties :
+ {
+ fullName : { type : "string" },
+ age : { type : "integer", minimum : 0 },
+ optionalItem : { type : "string" },
+ state : { type : "string" },
+ city : { type : "string" },
+ zip : { type : "integer", minimum : 0, maximum : 99999 },
+ married : { type : "boolean" },
+ dozen : { type : "integer", minimum : 12, maximum : 12 },
+ dozenOrBakersDozen : { type : "integer", minimum : 12, maximum : 13 },
+ favoriteEvenNumber : { type : "integer", multipleOf : 2 },
+ topThreeFavoriteColors : { type : "array", minItems : 3, maxItems : 3, uniqueItems : true, items : { type : "string" }},
+ favoriteSingleDigitWholeNumbers : { type : "array", minItems : 1, maxItems : 10, uniqueItems : true, items : { type : "integer", minimum : 0, maximum : 9 }},
+ favoriteFiveLetterWord : { type : "string", minLength : 5, maxLength : 5 },
+ emailAddresses : { type : "array", minItems : 1, uniqueItems : true, items : { type : "string", format : "email" }},
+ ipAddresses : { type : "array", uniqueItems : true, items : { type : "string", format : "ipv4" }},
+ }
+ } \ No newline at end of file
diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/additionalItems.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/additionalItems.json
new file mode 100644
index 00000000000..521745c8d6e
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/additionalItems.json
@@ -0,0 +1,82 @@
+[
+ {
+ "description": "additionalItems as schema",
+ "schema": {
+ "items": [{}],
+ "additionalItems": {"type": "integer"}
+ },
+ "tests": [
+ {
+ "description": "additional items match schema",
+ "data": [ null, 2, 3, 4 ],
+ "valid": true
+ },
+ {
+ "description": "additional items do not match schema",
+ "data": [ null, 2, 3, "foo" ],
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "items is schema, no additionalItems",
+ "schema": {
+ "items": {},
+ "additionalItems": false
+ },
+ "tests": [
+ {
+ "description": "all items match schema",
+ "data": [ 1, 2, 3, 4, 5 ],
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "array of items with no additionalItems",
+ "schema": {
+ "items": [{}, {}, {}],
+ "additionalItems": false
+ },
+ "tests": [
+ {
+ "description": "no additional items present",
+ "data": [ 1, 2, 3 ],
+ "valid": true
+ },
+ {
+ "description": "additional items are not permitted",
+ "data": [ 1, 2, 3, 4 ],
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "additionalItems as false without items",
+ "schema": {"additionalItems": false},
+ "tests": [
+ {
+ "description":
+ "items defaults to empty schema so everything is valid",
+ "data": [ 1, 2, 3, 4, 5 ],
+ "valid": true
+ },
+ {
+ "description": "ignores non-arrays",
+ "data": {"foo" : "bar"},
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "additionalItems are allowed by default",
+ "schema": {"items": [{"type": "integer"}]},
+ "tests": [
+ {
+ "description": "only the first item is validated",
+ "data": [1, "foo", false],
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/additionalProperties.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/additionalProperties.json
new file mode 100644
index 00000000000..40831f9e9aa
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/additionalProperties.json
@@ -0,0 +1,88 @@
+[
+ {
+ "description":
+ "additionalProperties being false does not allow other properties",
+ "schema": {
+ "properties": {"foo": {}, "bar": {}},
+ "patternProperties": { "^v": {} },
+ "additionalProperties": false
+ },
+ "tests": [
+ {
+ "description": "no additional properties is valid",
+ "data": {"foo": 1},
+ "valid": true
+ },
+ {
+ "description": "an additional property is invalid",
+ "data": {"foo" : 1, "bar" : 2, "quux" : "boom"},
+ "valid": false
+ },
+ {
+ "description": "ignores non-objects",
+ "data": [1, 2, 3],
+ "valid": true
+ },
+ {
+ "description": "patternProperties are not additional properties",
+ "data": {"foo":1, "vroom": 2},
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description":
+ "additionalProperties allows a schema which should validate",
+ "schema": {
+ "properties": {"foo": {}, "bar": {}},
+ "additionalProperties": {"type": "boolean"}
+ },
+ "tests": [
+ {
+ "description": "no additional properties is valid",
+ "data": {"foo": 1},
+ "valid": true
+ },
+ {
+ "description": "an additional valid property is valid",
+ "data": {"foo" : 1, "bar" : 2, "quux" : true},
+ "valid": true
+ },
+ {
+ "description": "an additional invalid property is invalid",
+ "data": {"foo" : 1, "bar" : 2, "quux" : 12},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description":
+ "additionalProperties can exist by itself",
+ "schema": {
+ "additionalProperties": {"type": "boolean"}
+ },
+ "tests": [
+ {
+ "description": "an additional valid property is valid",
+ "data": {"foo" : true},
+ "valid": true
+ },
+ {
+ "description": "an additional invalid property is invalid",
+ "data": {"foo" : 1},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "additionalProperties are allowed by default",
+ "schema": {"properties": {"foo": {}, "bar": {}}},
+ "tests": [
+ {
+ "description": "additional properties are allowed",
+ "data": {"foo": 1, "bar": 2, "quux": true},
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/allOf.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/allOf.json
new file mode 100644
index 00000000000..bbb5f89e4bc
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/allOf.json
@@ -0,0 +1,112 @@
+[
+ {
+ "description": "allOf",
+ "schema": {
+ "allOf": [
+ {
+ "properties": {
+ "bar": {"type": "integer"}
+ },
+ "required": ["bar"]
+ },
+ {
+ "properties": {
+ "foo": {"type": "string"}
+ },
+ "required": ["foo"]
+ }
+ ]
+ },
+ "tests": [
+ {
+ "description": "allOf",
+ "data": {"foo": "baz", "bar": 2},
+ "valid": true
+ },
+ {
+ "description": "mismatch second",
+ "data": {"foo": "baz"},
+ "valid": false
+ },
+ {
+ "description": "mismatch first",
+ "data": {"bar": 2},
+ "valid": false
+ },
+ {
+ "description": "wrong type",
+ "data": {"foo": "baz", "bar": "quux"},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "allOf with base schema",
+ "schema": {
+ "properties": {"bar": {"type": "integer"}},
+ "required": ["bar"],
+ "allOf" : [
+ {
+ "properties": {
+ "foo": {"type": "string"}
+ },
+ "required": ["foo"]
+ },
+ {
+ "properties": {
+ "baz": {"type": "null"}
+ },
+ "required": ["baz"]
+ }
+ ]
+ },
+ "tests": [
+ {
+ "description": "valid",
+ "data": {"foo": "quux", "bar": 2, "baz": null},
+ "valid": true
+ },
+ {
+ "description": "mismatch base schema",
+ "data": {"foo": "quux", "baz": null},
+ "valid": false
+ },
+ {
+ "description": "mismatch first allOf",
+ "data": {"bar": 2, "baz": null},
+ "valid": false
+ },
+ {
+ "description": "mismatch second allOf",
+ "data": {"foo": "quux", "bar": 2},
+ "valid": false
+ },
+ {
+ "description": "mismatch both",
+ "data": {"bar": 2},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "allOf simple types",
+ "schema": {
+ "allOf": [
+ {"maximum": 30},
+ {"minimum": 20}
+ ]
+ },
+ "tests": [
+ {
+ "description": "valid",
+ "data": 25,
+ "valid": true
+ },
+ {
+ "description": "mismatch one",
+ "data": 35,
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/anyOf.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/anyOf.json
new file mode 100644
index 00000000000..a58714afd89
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/anyOf.json
@@ -0,0 +1,68 @@
+[
+ {
+ "description": "anyOf",
+ "schema": {
+ "anyOf": [
+ {
+ "type": "integer"
+ },
+ {
+ "minimum": 2
+ }
+ ]
+ },
+ "tests": [
+ {
+ "description": "first anyOf valid",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "second anyOf valid",
+ "data": 2.5,
+ "valid": true
+ },
+ {
+ "description": "both anyOf valid",
+ "data": 3,
+ "valid": true
+ },
+ {
+ "description": "neither anyOf valid",
+ "data": 1.5,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "anyOf with base schema",
+ "schema": {
+ "type": "string",
+ "anyOf" : [
+ {
+ "maxLength": 2
+ },
+ {
+ "minLength": 4
+ }
+ ]
+ },
+ "tests": [
+ {
+ "description": "mismatch base schema",
+ "data": 3,
+ "valid": false
+ },
+ {
+ "description": "one anyOf valid",
+ "data": "foobar",
+ "valid": true
+ },
+ {
+ "description": "both anyOf invalid",
+ "data": "foo",
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/bignum.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/bignum.json
new file mode 100644
index 00000000000..ccc7c17fe8d
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/bignum.json
@@ -0,0 +1,107 @@
+[
+ {
+ "description": "integer",
+ "schema": {"type": "integer"},
+ "tests": [
+ {
+ "description": "a bignum is an integer",
+ "data": 12345678910111213141516171819202122232425262728293031,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "number",
+ "schema": {"type": "number"},
+ "tests": [
+ {
+ "description": "a bignum is a number",
+ "data": 98249283749234923498293171823948729348710298301928331,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "integer",
+ "schema": {"type": "integer"},
+ "tests": [
+ {
+ "description": "a negative bignum is an integer",
+ "data": -12345678910111213141516171819202122232425262728293031,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "number",
+ "schema": {"type": "number"},
+ "tests": [
+ {
+ "description": "a negative bignum is a number",
+ "data": -98249283749234923498293171823948729348710298301928331,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "string",
+ "schema": {"type": "string"},
+ "tests": [
+ {
+ "description": "a bignum is not a string",
+ "data": 98249283749234923498293171823948729348710298301928331,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "integer comparison",
+ "schema": {"maximum": 18446744073709551615},
+ "tests": [
+ {
+ "description": "comparison works for high numbers",
+ "data": 18446744073709551600,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "float comparison with high precision",
+ "schema": {
+ "maximum": 972783798187987123879878123.18878137,
+ "exclusiveMaximum": true
+ },
+ "tests": [
+ {
+ "description": "comparison works for high numbers",
+ "data": 972783798187987123879878123.188781371,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "integer comparison",
+ "schema": {"minimum": -18446744073709551615},
+ "tests": [
+ {
+ "description": "comparison works for very negative numbers",
+ "data": -18446744073709551600,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "float comparison with high precision on negative numbers",
+ "schema": {
+ "minimum": -972783798187987123879878123.18878137,
+ "exclusiveMinimum": true
+ },
+ "tests": [
+ {
+ "description": "comparison works for very negative numbers",
+ "data": -972783798187987123879878123.188781371,
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/default.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/default.json
new file mode 100644
index 00000000000..17629779fbe
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/default.json
@@ -0,0 +1,49 @@
+[
+ {
+ "description": "invalid type for default",
+ "schema": {
+ "properties": {
+ "foo": {
+ "type": "integer",
+ "default": []
+ }
+ }
+ },
+ "tests": [
+ {
+ "description": "valid when property is specified",
+ "data": {"foo": 13},
+ "valid": true
+ },
+ {
+ "description": "still valid when the invalid default is used",
+ "data": {},
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "invalid string value for default",
+ "schema": {
+ "properties": {
+ "bar": {
+ "type": "string",
+ "minLength": 4,
+ "default": "bad"
+ }
+ }
+ },
+ "tests": [
+ {
+ "description": "valid when property is specified",
+ "data": {"bar": "good"},
+ "valid": true
+ },
+ {
+ "description": "still valid when the invalid default is used",
+ "data": {},
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/definitions.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/definitions.json
new file mode 100644
index 00000000000..cf935a32153
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/definitions.json
@@ -0,0 +1,32 @@
+[
+ {
+ "description": "valid definition",
+ "schema": {"$ref": "http://json-schema.org/draft-04/schema#"},
+ "tests": [
+ {
+ "description": "valid definition schema",
+ "data": {
+ "definitions": {
+ "foo": {"type": "integer"}
+ }
+ },
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "invalid definition",
+ "schema": {"$ref": "http://json-schema.org/draft-04/schema#"},
+ "tests": [
+ {
+ "description": "invalid definition schema",
+ "data": {
+ "definitions": {
+ "foo": {"type": 1}
+ }
+ },
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/dependencies.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/dependencies.json
new file mode 100644
index 00000000000..7b9b16a7e12
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/dependencies.json
@@ -0,0 +1,113 @@
+[
+ {
+ "description": "dependencies",
+ "schema": {
+ "dependencies": {"bar": ["foo"]}
+ },
+ "tests": [
+ {
+ "description": "neither",
+ "data": {},
+ "valid": true
+ },
+ {
+ "description": "nondependant",
+ "data": {"foo": 1},
+ "valid": true
+ },
+ {
+ "description": "with dependency",
+ "data": {"foo": 1, "bar": 2},
+ "valid": true
+ },
+ {
+ "description": "missing dependency",
+ "data": {"bar": 2},
+ "valid": false
+ },
+ {
+ "description": "ignores non-objects",
+ "data": "foo",
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "multiple dependencies",
+ "schema": {
+ "dependencies": {"quux": ["foo", "bar"]}
+ },
+ "tests": [
+ {
+ "description": "neither",
+ "data": {},
+ "valid": true
+ },
+ {
+ "description": "nondependants",
+ "data": {"foo": 1, "bar": 2},
+ "valid": true
+ },
+ {
+ "description": "with dependencies",
+ "data": {"foo": 1, "bar": 2, "quux": 3},
+ "valid": true
+ },
+ {
+ "description": "missing dependency",
+ "data": {"foo": 1, "quux": 2},
+ "valid": false
+ },
+ {
+ "description": "missing other dependency",
+ "data": {"bar": 1, "quux": 2},
+ "valid": false
+ },
+ {
+ "description": "missing both dependencies",
+ "data": {"quux": 1},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "multiple dependencies subschema",
+ "schema": {
+ "dependencies": {
+ "bar": {
+ "properties": {
+ "foo": {"type": "integer"},
+ "bar": {"type": "integer"}
+ }
+ }
+ }
+ },
+ "tests": [
+ {
+ "description": "valid",
+ "data": {"foo": 1, "bar": 2},
+ "valid": true
+ },
+ {
+ "description": "no dependency",
+ "data": {"foo": "quux"},
+ "valid": true
+ },
+ {
+ "description": "wrong type",
+ "data": {"foo": "quux", "bar": 2},
+ "valid": false
+ },
+ {
+ "description": "wrong type other",
+ "data": {"foo": 2, "bar": "quux"},
+ "valid": false
+ },
+ {
+ "description": "wrong type both",
+ "data": {"foo": "quux", "bar": "quux"},
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/enum.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/enum.json
new file mode 100644
index 00000000000..f124436a7d9
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/enum.json
@@ -0,0 +1,72 @@
+[
+ {
+ "description": "simple enum validation",
+ "schema": {"enum": [1, 2, 3]},
+ "tests": [
+ {
+ "description": "one of the enum is valid",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "something else is invalid",
+ "data": 4,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "heterogeneous enum validation",
+ "schema": {"enum": [6, "foo", [], true, {"foo": 12}]},
+ "tests": [
+ {
+ "description": "one of the enum is valid",
+ "data": [],
+ "valid": true
+ },
+ {
+ "description": "something else is invalid",
+ "data": null,
+ "valid": false
+ },
+ {
+ "description": "objects are deep compared",
+ "data": {"foo": false},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "enums in properties",
+ "schema": {
+ "type":"object",
+ "properties": {
+ "foo": {"enum":["foo"]},
+ "bar": {"enum":["bar"]}
+ },
+ "required": ["bar"]
+ },
+ "tests": [
+ {
+ "description": "both properties are valid",
+ "data": {"foo":"foo", "bar":"bar"},
+ "valid": true
+ },
+ {
+ "description": "missing optional property is valid",
+ "data": {"bar":"bar"},
+ "valid": true
+ },
+ {
+ "description": "missing required property is invalid",
+ "data": {"foo":"foo"},
+ "valid": false
+ },
+ {
+ "description": "missing all properties is invalid",
+ "data": {},
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/format.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/format.json
new file mode 100644
index 00000000000..53c5d251905
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/format.json
@@ -0,0 +1,143 @@
+[
+ {
+ "description": "validation of date-time strings",
+ "schema": {"format": "date-time"},
+ "tests": [
+ {
+ "description": "a valid date-time string",
+ "data": "1963-06-19T08:30:06.283185Z",
+ "valid": true
+ },
+ {
+ "description": "an invalid date-time string",
+ "data": "06/19/1963 08:30:06 PST",
+ "valid": false
+ },
+ {
+ "description": "only RFC3339 not all of ISO 8601 are valid",
+ "data": "2013-350T01:01:01",
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "validation of URIs",
+ "schema": {"format": "uri"},
+ "tests": [
+ {
+ "description": "a valid URI",
+ "data": "http://foo.bar/?baz=qux#quux",
+ "valid": true
+ },
+ {
+ "description": "an invalid URI",
+ "data": "\\\\WINDOWS\\fileshare",
+ "valid": false
+ },
+ {
+ "description": "an invalid URI though valid URI reference",
+ "data": "abc",
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "validation of e-mail addresses",
+ "schema": {"format": "email"},
+ "tests": [
+ {
+ "description": "a valid e-mail address",
+ "data": "joe.bloggs@example.com",
+ "valid": true
+ },
+ {
+ "description": "an invalid e-mail address",
+ "data": "2962",
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "validation of IP addresses",
+ "schema": {"format": "ipv4"},
+ "tests": [
+ {
+ "description": "a valid IP address",
+ "data": "192.168.0.1",
+ "valid": true
+ },
+ {
+ "description": "an IP address with too many components",
+ "data": "127.0.0.0.1",
+ "valid": false
+ },
+ {
+ "description": "an IP address with out-of-range values",
+ "data": "256.256.256.256",
+ "valid": false
+ },
+ {
+ "description": "an IP address without 4 components",
+ "data": "127.0",
+ "valid": false
+ },
+ {
+ "description": "an IP address as an integer",
+ "data": "0x7f000001",
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "validation of IPv6 addresses",
+ "schema": {"format": "ipv6"},
+ "tests": [
+ {
+ "description": "a valid IPv6 address",
+ "data": "::1",
+ "valid": true
+ },
+ {
+ "description": "an IPv6 address with out-of-range values",
+ "data": "12345::",
+ "valid": false
+ },
+ {
+ "description": "an IPv6 address with too many components",
+ "data": "1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1",
+ "valid": false
+ },
+ {
+ "description": "an IPv6 address containing illegal characters",
+ "data": "::laptop",
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "validation of host names",
+ "schema": {"format": "hostname"},
+ "tests": [
+ {
+ "description": "a valid host name",
+ "data": "www.example.com",
+ "valid": true
+ },
+ {
+ "description": "a host name starting with an illegal character",
+ "data": "-a-host-name-that-starts-with--",
+ "valid": false
+ },
+ {
+ "description": "a host name containing illegal characters",
+ "data": "not_a_valid_host_name",
+ "valid": false
+ },
+ {
+ "description": "a host name with a component too long",
+ "data": "a-vvvvvvvvvvvvvvvveeeeeeeeeeeeeeeerrrrrrrrrrrrrrrryyyyyyyyyyyyyyyy-long-host-name-component",
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/items.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/items.json
new file mode 100644
index 00000000000..f5e18a13848
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/items.json
@@ -0,0 +1,46 @@
+[
+ {
+ "description": "a schema given for items",
+ "schema": {
+ "items": {"type": "integer"}
+ },
+ "tests": [
+ {
+ "description": "valid items",
+ "data": [ 1, 2, 3 ],
+ "valid": true
+ },
+ {
+ "description": "wrong type of items",
+ "data": [1, "x"],
+ "valid": false
+ },
+ {
+ "description": "ignores non-arrays",
+ "data": {"foo" : "bar"},
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "an array of schemas for items",
+ "schema": {
+ "items": [
+ {"type": "integer"},
+ {"type": "string"}
+ ]
+ },
+ "tests": [
+ {
+ "description": "correct types",
+ "data": [ 1, "foo" ],
+ "valid": true
+ },
+ {
+ "description": "wrong types",
+ "data": [ "foo", 1 ],
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maxItems.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maxItems.json
new file mode 100644
index 00000000000..3b53a6b371a
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maxItems.json
@@ -0,0 +1,28 @@
+[
+ {
+ "description": "maxItems validation",
+ "schema": {"maxItems": 2},
+ "tests": [
+ {
+ "description": "shorter is valid",
+ "data": [1],
+ "valid": true
+ },
+ {
+ "description": "exact length is valid",
+ "data": [1, 2],
+ "valid": true
+ },
+ {
+ "description": "too long is invalid",
+ "data": [1, 2, 3],
+ "valid": false
+ },
+ {
+ "description": "ignores non-arrays",
+ "data": "foobar",
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maxLength.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maxLength.json
new file mode 100644
index 00000000000..48eb1296d2e
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maxLength.json
@@ -0,0 +1,28 @@
+[
+ {
+ "description": "maxLength validation",
+ "schema": {"maxLength": 2},
+ "tests": [
+ {
+ "description": "shorter is valid",
+ "data": "f",
+ "valid": true
+ },
+ {
+ "description": "exact length is valid",
+ "data": "fo",
+ "valid": true
+ },
+ {
+ "description": "too long is invalid",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "ignores non-strings",
+ "data": 100,
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maxProperties.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maxProperties.json
new file mode 100644
index 00000000000..d282446ad69
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maxProperties.json
@@ -0,0 +1,28 @@
+[
+ {
+ "description": "maxProperties validation",
+ "schema": {"maxProperties": 2},
+ "tests": [
+ {
+ "description": "shorter is valid",
+ "data": {"foo": 1},
+ "valid": true
+ },
+ {
+ "description": "exact length is valid",
+ "data": {"foo": 1, "bar": 2},
+ "valid": true
+ },
+ {
+ "description": "too long is invalid",
+ "data": {"foo": 1, "bar": 2, "baz": 3},
+ "valid": false
+ },
+ {
+ "description": "ignores non-objects",
+ "data": "foobar",
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maximum.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maximum.json
new file mode 100644
index 00000000000..86c7b89c9a9
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maximum.json
@@ -0,0 +1,42 @@
+[
+ {
+ "description": "maximum validation",
+ "schema": {"maximum": 3.0},
+ "tests": [
+ {
+ "description": "below the maximum is valid",
+ "data": 2.6,
+ "valid": true
+ },
+ {
+ "description": "above the maximum is invalid",
+ "data": 3.5,
+ "valid": false
+ },
+ {
+ "description": "ignores non-numbers",
+ "data": "x",
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "exclusiveMaximum validation",
+ "schema": {
+ "maximum": 3.0,
+ "exclusiveMaximum": true
+ },
+ "tests": [
+ {
+ "description": "below the maximum is still valid",
+ "data": 2.2,
+ "valid": true
+ },
+ {
+ "description": "boundary point is invalid",
+ "data": 3.0,
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minItems.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minItems.json
new file mode 100644
index 00000000000..ed5118815ee
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minItems.json
@@ -0,0 +1,28 @@
+[
+ {
+ "description": "minItems validation",
+ "schema": {"minItems": 1},
+ "tests": [
+ {
+ "description": "longer is valid",
+ "data": [1, 2],
+ "valid": true
+ },
+ {
+ "description": "exact length is valid",
+ "data": [1],
+ "valid": true
+ },
+ {
+ "description": "too short is invalid",
+ "data": [],
+ "valid": false
+ },
+ {
+ "description": "ignores non-arrays",
+ "data": "",
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minLength.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minLength.json
new file mode 100644
index 00000000000..e9c14b1723e
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minLength.json
@@ -0,0 +1,28 @@
+[
+ {
+ "description": "minLength validation",
+ "schema": {"minLength": 2},
+ "tests": [
+ {
+ "description": "longer is valid",
+ "data": "foo",
+ "valid": true
+ },
+ {
+ "description": "exact length is valid",
+ "data": "fo",
+ "valid": true
+ },
+ {
+ "description": "too short is invalid",
+ "data": "f",
+ "valid": false
+ },
+ {
+ "description": "ignores non-strings",
+ "data": 1,
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minProperties.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minProperties.json
new file mode 100644
index 00000000000..a72c7d293e6
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minProperties.json
@@ -0,0 +1,28 @@
+[
+ {
+ "description": "minProperties validation",
+ "schema": {"minProperties": 1},
+ "tests": [
+ {
+ "description": "longer is valid",
+ "data": {"foo": 1, "bar": 2},
+ "valid": true
+ },
+ {
+ "description": "exact length is valid",
+ "data": {"foo": 1},
+ "valid": true
+ },
+ {
+ "description": "too short is invalid",
+ "data": {},
+ "valid": false
+ },
+ {
+ "description": "ignores non-objects",
+ "data": "",
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minimum.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minimum.json
new file mode 100644
index 00000000000..d5bf000bcc6
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minimum.json
@@ -0,0 +1,42 @@
+[
+ {
+ "description": "minimum validation",
+ "schema": {"minimum": 1.1},
+ "tests": [
+ {
+ "description": "above the minimum is valid",
+ "data": 2.6,
+ "valid": true
+ },
+ {
+ "description": "below the minimum is invalid",
+ "data": 0.6,
+ "valid": false
+ },
+ {
+ "description": "ignores non-numbers",
+ "data": "x",
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "exclusiveMinimum validation",
+ "schema": {
+ "minimum": 1.1,
+ "exclusiveMinimum": true
+ },
+ "tests": [
+ {
+ "description": "above the minimum is still valid",
+ "data": 1.2,
+ "valid": true
+ },
+ {
+ "description": "boundary point is invalid",
+ "data": 1.1,
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/multipleOf.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/multipleOf.json
new file mode 100644
index 00000000000..ca3b7618053
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/multipleOf.json
@@ -0,0 +1,60 @@
+[
+ {
+ "description": "by int",
+ "schema": {"multipleOf": 2},
+ "tests": [
+ {
+ "description": "int by int",
+ "data": 10,
+ "valid": true
+ },
+ {
+ "description": "int by int fail",
+ "data": 7,
+ "valid": false
+ },
+ {
+ "description": "ignores non-numbers",
+ "data": "foo",
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "by number",
+ "schema": {"multipleOf": 1.5},
+ "tests": [
+ {
+ "description": "zero is multiple of anything",
+ "data": 0,
+ "valid": true
+ },
+ {
+ "description": "4.5 is multiple of 1.5",
+ "data": 4.5,
+ "valid": true
+ },
+ {
+ "description": "35 is not multiple of 1.5",
+ "data": 35,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "by small number",
+ "schema": {"multipleOf": 0.0001},
+ "tests": [
+ {
+ "description": "0.0075 is multiple of 0.0001",
+ "data": 0.0075,
+ "valid": true
+ },
+ {
+ "description": "0.00751 is not multiple of 0.0001",
+ "data": 0.00751,
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/not.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/not.json
new file mode 100644
index 00000000000..cbb7f46bf8b
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/not.json
@@ -0,0 +1,96 @@
+[
+ {
+ "description": "not",
+ "schema": {
+ "not": {"type": "integer"}
+ },
+ "tests": [
+ {
+ "description": "allowed",
+ "data": "foo",
+ "valid": true
+ },
+ {
+ "description": "disallowed",
+ "data": 1,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "not multiple types",
+ "schema": {
+ "not": {"type": ["integer", "boolean"]}
+ },
+ "tests": [
+ {
+ "description": "valid",
+ "data": "foo",
+ "valid": true
+ },
+ {
+ "description": "mismatch",
+ "data": 1,
+ "valid": false
+ },
+ {
+ "description": "other mismatch",
+ "data": true,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "not more complex schema",
+ "schema": {
+ "not": {
+ "type": "object",
+ "properties": {
+ "foo": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "tests": [
+ {
+ "description": "match",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "other match",
+ "data": {"foo": 1},
+ "valid": true
+ },
+ {
+ "description": "mismatch",
+ "data": {"foo": "bar"},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "forbidden property",
+ "schema": {
+ "properties": {
+ "foo": {
+ "not": {}
+ }
+ }
+ },
+ "tests": [
+ {
+ "description": "property present",
+ "data": {"foo": 1, "bar": 2},
+ "valid": false
+ },
+ {
+ "description": "property absent",
+ "data": {"bar": 1, "baz": 2},
+ "valid": true
+ }
+ ]
+ }
+
+]
diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/nullAndFormat.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/nullAndFormat.json
new file mode 100644
index 00000000000..d7fce9f5090
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/nullAndFormat.json
@@ -0,0 +1,18 @@
+[
+ {
+ "description": "validation of null and format",
+ "schema": {"type": ["null", "string"], "format": "date-time"},
+ "tests": [
+ {
+ "description": "a valid date-time string",
+ "data": "1963-06-19T08:30:06.283185Z",
+ "valid": true
+ },
+ {
+ "description": "allow null",
+ "data": null,
+ "valid": true
+ }
+ ]
+ }
+] \ No newline at end of file
diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/oneOf.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/oneOf.json
new file mode 100644
index 00000000000..1eaa4e47949
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/oneOf.json
@@ -0,0 +1,68 @@
+[
+ {
+ "description": "oneOf",
+ "schema": {
+ "oneOf": [
+ {
+ "type": "integer"
+ },
+ {
+ "minimum": 2
+ }
+ ]
+ },
+ "tests": [
+ {
+ "description": "first oneOf valid",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "second oneOf valid",
+ "data": 2.5,
+ "valid": true
+ },
+ {
+ "description": "both oneOf valid",
+ "data": 3,
+ "valid": false
+ },
+ {
+ "description": "neither oneOf valid",
+ "data": 1.5,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "oneOf with base schema",
+ "schema": {
+ "type": "string",
+ "oneOf" : [
+ {
+ "minLength": 2
+ },
+ {
+ "maxLength": 4
+ }
+ ]
+ },
+ "tests": [
+ {
+ "description": "mismatch base schema",
+ "data": 3,
+ "valid": false
+ },
+ {
+ "description": "one oneOf valid",
+ "data": "foobar",
+ "valid": true
+ },
+ {
+ "description": "both oneOf valid",
+ "data": "foo",
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/pattern.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/pattern.json
new file mode 100644
index 00000000000..befc4b560f7
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/pattern.json
@@ -0,0 +1,23 @@
+[
+ {
+ "description": "pattern validation",
+ "schema": {"pattern": "^a*$"},
+ "tests": [
+ {
+ "description": "a matching pattern is valid",
+ "data": "aaa",
+ "valid": true
+ },
+ {
+ "description": "a non-matching pattern is invalid",
+ "data": "abc",
+ "valid": false
+ },
+ {
+ "description": "ignores non-strings",
+ "data": true,
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/patternProperties.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/patternProperties.json
new file mode 100644
index 00000000000..18586e5daba
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/patternProperties.json
@@ -0,0 +1,110 @@
+[
+ {
+ "description":
+ "patternProperties validates properties matching a regex",
+ "schema": {
+ "patternProperties": {
+ "f.*o": {"type": "integer"}
+ }
+ },
+ "tests": [
+ {
+ "description": "a single valid match is valid",
+ "data": {"foo": 1},
+ "valid": true
+ },
+ {
+ "description": "multiple valid matches is valid",
+ "data": {"foo": 1, "foooooo" : 2},
+ "valid": true
+ },
+ {
+ "description": "a single invalid match is invalid",
+ "data": {"foo": "bar", "fooooo": 2},
+ "valid": false
+ },
+ {
+ "description": "multiple invalid matches is invalid",
+ "data": {"foo": "bar", "foooooo" : "baz"},
+ "valid": false
+ },
+ {
+ "description": "ignores non-objects",
+ "data": 12,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "multiple simultaneous patternProperties are validated",
+ "schema": {
+ "patternProperties": {
+ "a*": {"type": "integer"},
+ "aaa*": {"maximum": 20}
+ }
+ },
+ "tests": [
+ {
+ "description": "a single valid match is valid",
+ "data": {"a": 21},
+ "valid": true
+ },
+ {
+ "description": "a simultaneous match is valid",
+ "data": {"aaaa": 18},
+ "valid": true
+ },
+ {
+ "description": "multiple matches is valid",
+ "data": {"a": 21, "aaaa": 18},
+ "valid": true
+ },
+ {
+ "description": "an invalid due to one is invalid",
+ "data": {"a": "bar"},
+ "valid": false
+ },
+ {
+ "description": "an invalid due to the other is invalid",
+ "data": {"aaaa": 31},
+ "valid": false
+ },
+ {
+ "description": "an invalid due to both is invalid",
+ "data": {"aaa": "foo", "aaaa": 31},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "regexes are not anchored by default and are case sensitive",
+ "schema": {
+ "patternProperties": {
+ "[0-9]{2,}": { "type": "boolean" },
+ "X_": { "type": "string" }
+ }
+ },
+ "tests": [
+ {
+ "description": "non recognized members are ignored",
+ "data": { "answer 1": "42" },
+ "valid": true
+ },
+ {
+ "description": "recognized members are accounted for",
+ "data": { "a31b": null },
+ "valid": false
+ },
+ {
+ "description": "regexes are case sensitive",
+ "data": { "a_x_3": 3 },
+ "valid": true
+ },
+ {
+ "description": "regexes are case sensitive, 2",
+ "data": { "a_X_3": 3 },
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/properties.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/properties.json
new file mode 100644
index 00000000000..cd1644dcd91
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/properties.json
@@ -0,0 +1,92 @@
+[
+ {
+ "description": "object properties validation",
+ "schema": {
+ "properties": {
+ "foo": {"type": "integer"},
+ "bar": {"type": "string"}
+ }
+ },
+ "tests": [
+ {
+ "description": "both properties present and valid is valid",
+ "data": {"foo": 1, "bar": "baz"},
+ "valid": true
+ },
+ {
+ "description": "one property invalid is invalid",
+ "data": {"foo": 1, "bar": {}},
+ "valid": false
+ },
+ {
+ "description": "both properties invalid is invalid",
+ "data": {"foo": [], "bar": {}},
+ "valid": false
+ },
+ {
+ "description": "doesn't invalidate other properties",
+ "data": {"quux": []},
+ "valid": true
+ },
+ {
+ "description": "ignores non-objects",
+ "data": [],
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description":
+ "properties, patternProperties, additionalProperties interaction",
+ "schema": {
+ "properties": {
+ "foo": {"type": "array", "maxItems": 3},
+ "bar": {"type": "array"}
+ },
+ "patternProperties": {"f.o": {"minItems": 2}},
+ "additionalProperties": {"type": "integer"}
+ },
+ "tests": [
+ {
+ "description": "property validates property",
+ "data": {"foo": [1, 2]},
+ "valid": true
+ },
+ {
+ "description": "property invalidates property",
+ "data": {"foo": [1, 2, 3, 4]},
+ "valid": false
+ },
+ {
+ "description": "patternProperty invalidates property",
+ "data": {"foo": []},
+ "valid": false
+ },
+ {
+ "description": "patternProperty validates nonproperty",
+ "data": {"fxo": [1, 2]},
+ "valid": true
+ },
+ {
+ "description": "patternProperty invalidates nonproperty",
+ "data": {"fxo": []},
+ "valid": false
+ },
+ {
+ "description": "additionalProperty ignores property",
+ "data": {"bar": []},
+ "valid": true
+ },
+ {
+ "description": "additionalProperty validates others",
+ "data": {"quux": 3},
+ "valid": true
+ },
+ {
+ "description": "additionalProperty invalidates others",
+ "data": {"quux": "foo"},
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/ref.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/ref.json
new file mode 100644
index 00000000000..d8214bc2b30
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/ref.json
@@ -0,0 +1,128 @@
+[
+ {
+ "description": "root pointer ref",
+ "schema": {
+ "properties": {
+ "foo": {"$ref": "#"}
+ },
+ "additionalProperties": false
+ },
+ "tests": [
+ {
+ "description": "match",
+ "data": {"foo": false},
+ "valid": true
+ },
+ {
+ "description": "recursive match",
+ "data": {"foo": {"foo": false}},
+ "valid": true
+ },
+ {
+ "description": "mismatch",
+ "data": {"bar": false},
+ "valid": false
+ },
+ {
+ "description": "recursive mismatch",
+ "data": {"foo": {"bar": false}},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "relative pointer ref to object",
+ "schema": {
+ "properties": {
+ "foo": {"type": "integer"},
+ "bar": {"$ref": "#/properties/foo"}
+ }
+ },
+ "tests": [
+ {
+ "description": "match",
+ "data": {"bar": 3},
+ "valid": true
+ },
+ {
+ "description": "mismatch",
+ "data": {"bar": true},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "relative pointer ref to array",
+ "schema": {
+ "items": [
+ {"type": "integer"},
+ {"$ref": "#/items/0"}
+ ]
+ },
+ "tests": [
+ {
+ "description": "match array",
+ "data": [1, 2],
+ "valid": true
+ },
+ {
+ "description": "mismatch array",
+ "data": [1, "foo"],
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "escaped pointer ref",
+ "schema": {
+ "tilda~field": {"type": "integer"},
+ "slash/field": {"type": "integer"},
+ "percent%field": {"type": "integer"},
+ "properties": {
+ "tilda": {"$ref": "#/tilda~0field"},
+ "slash": {"$ref": "#/slash~1field"},
+ "percent": {"$ref": "#/percent%25field"}
+ }
+ },
+ "tests": [
+ {
+ "description": "slash",
+ "data": {"slash": "aoeu"},
+ "valid": false
+ },
+ {
+ "description": "tilda",
+ "data": {"tilda": "aoeu"},
+ "valid": false
+ },
+ {
+ "description": "percent",
+ "data": {"percent": "aoeu"},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "nested refs",
+ "schema": {
+ "definitions": {
+ "a": {"type": "integer"},
+ "b": {"$ref": "#/definitions/a"},
+ "c": {"$ref": "#/definitions/b"}
+ },
+ "$ref": "#/definitions/c"
+ },
+ "tests": [
+ {
+ "description": "nested ref valid",
+ "data": 5,
+ "valid": true
+ },
+ {
+ "description": "nested ref invalid",
+ "data": "a",
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/refRemote.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/refRemote.json
new file mode 100644
index 00000000000..4ca804732c9
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/refRemote.json
@@ -0,0 +1,74 @@
+[
+ {
+ "description": "remote ref",
+ "schema": {"$ref": "http://localhost:1234/integer.json"},
+ "tests": [
+ {
+ "description": "remote ref valid",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "remote ref invalid",
+ "data": "a",
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "fragment within remote ref",
+ "schema": {"$ref": "http://localhost:1234/subSchemas.json#/integer"},
+ "tests": [
+ {
+ "description": "remote fragment valid",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "remote fragment invalid",
+ "data": "a",
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "ref within remote ref",
+ "schema": {
+ "$ref": "http://localhost:1234/subSchemas.json#/refToInteger"
+ },
+ "tests": [
+ {
+ "description": "ref within ref valid",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "ref within ref invalid",
+ "data": "a",
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "change resolution scope",
+ "schema": {
+ "id": "http://localhost:1234/",
+ "items": {
+ "id": "folder/",
+ "items": {"$ref": "folderInteger.json"}
+ }
+ },
+ "tests": [
+ {
+ "description": "changed scope ref valid",
+ "data": [[1]],
+ "valid": true
+ },
+ {
+ "description": "changed scope ref invalid",
+ "data": [["a"]],
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/required.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/required.json
new file mode 100644
index 00000000000..612f73f3472
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/required.json
@@ -0,0 +1,39 @@
+[
+ {
+ "description": "required validation",
+ "schema": {
+ "properties": {
+ "foo": {},
+ "bar": {}
+ },
+ "required": ["foo"]
+ },
+ "tests": [
+ {
+ "description": "present required property is valid",
+ "data": {"foo": 1},
+ "valid": true
+ },
+ {
+ "description": "non-present required property is invalid",
+ "data": {"bar": 1},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "required default validation",
+ "schema": {
+ "properties": {
+ "foo": {}
+ }
+ },
+ "tests": [
+ {
+ "description": "not required by default",
+ "data": {},
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/type.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/type.json
new file mode 100644
index 00000000000..257f0512927
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/type.json
@@ -0,0 +1,330 @@
+[
+ {
+ "description": "integer type matches integers",
+ "schema": {"type": "integer"},
+ "tests": [
+ {
+ "description": "an integer is an integer",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "a float is not an integer",
+ "data": 1.1,
+ "valid": false
+ },
+ {
+ "description": "a string is not an integer",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "an object is not an integer",
+ "data": {},
+ "valid": false
+ },
+ {
+ "description": "an array is not an integer",
+ "data": [],
+ "valid": false
+ },
+ {
+ "description": "a boolean is not an integer",
+ "data": true,
+ "valid": false
+ },
+ {
+ "description": "null is not an integer",
+ "data": null,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "number type matches numbers",
+ "schema": {"type": "number"},
+ "tests": [
+ {
+ "description": "an integer is a number",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "a float is a number",
+ "data": 1.1,
+ "valid": true
+ },
+ {
+ "description": "a string is not a number",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "an object is not a number",
+ "data": {},
+ "valid": false
+ },
+ {
+ "description": "an array is not a number",
+ "data": [],
+ "valid": false
+ },
+ {
+ "description": "a boolean is not a number",
+ "data": true,
+ "valid": false
+ },
+ {
+ "description": "null is not a number",
+ "data": null,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "string type matches strings",
+ "schema": {"type": "string"},
+ "tests": [
+ {
+ "description": "1 is not a string",
+ "data": 1,
+ "valid": false
+ },
+ {
+ "description": "a float is not a string",
+ "data": 1.1,
+ "valid": false
+ },
+ {
+ "description": "a string is a string",
+ "data": "foo",
+ "valid": true
+ },
+ {
+ "description": "an object is not a string",
+ "data": {},
+ "valid": false
+ },
+ {
+ "description": "an array is not a string",
+ "data": [],
+ "valid": false
+ },
+ {
+ "description": "a boolean is not a string",
+ "data": true,
+ "valid": false
+ },
+ {
+ "description": "null is not a string",
+ "data": null,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "object type matches objects",
+ "schema": {"type": "object"},
+ "tests": [
+ {
+ "description": "an integer is not an object",
+ "data": 1,
+ "valid": false
+ },
+ {
+ "description": "a float is not an object",
+ "data": 1.1,
+ "valid": false
+ },
+ {
+ "description": "a string is not an object",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "an object is an object",
+ "data": {},
+ "valid": true
+ },
+ {
+ "description": "an array is not an object",
+ "data": [],
+ "valid": false
+ },
+ {
+ "description": "a boolean is not an object",
+ "data": true,
+ "valid": false
+ },
+ {
+ "description": "null is not an object",
+ "data": null,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "array type matches arrays",
+ "schema": {"type": "array"},
+ "tests": [
+ {
+ "description": "an integer is not an array",
+ "data": 1,
+ "valid": false
+ },
+ {
+ "description": "a float is not an array",
+ "data": 1.1,
+ "valid": false
+ },
+ {
+ "description": "a string is not an array",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "an object is not an array",
+ "data": {},
+ "valid": false
+ },
+ {
+ "description": "an array is not an array",
+ "data": [],
+ "valid": true
+ },
+ {
+ "description": "a boolean is not an array",
+ "data": true,
+ "valid": false
+ },
+ {
+ "description": "null is not an array",
+ "data": null,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "boolean type matches booleans",
+ "schema": {"type": "boolean"},
+ "tests": [
+ {
+ "description": "an integer is not a boolean",
+ "data": 1,
+ "valid": false
+ },
+ {
+ "description": "a float is not a boolean",
+ "data": 1.1,
+ "valid": false
+ },
+ {
+ "description": "a string is not a boolean",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "an object is not a boolean",
+ "data": {},
+ "valid": false
+ },
+ {
+ "description": "an array is not a boolean",
+ "data": [],
+ "valid": false
+ },
+ {
+ "description": "a boolean is not a boolean",
+ "data": true,
+ "valid": true
+ },
+ {
+ "description": "null is not a boolean",
+ "data": null,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "null type matches only the null object",
+ "schema": {"type": "null"},
+ "tests": [
+ {
+ "description": "an integer is not null",
+ "data": 1,
+ "valid": false
+ },
+ {
+ "description": "a float is not null",
+ "data": 1.1,
+ "valid": false
+ },
+ {
+ "description": "a string is not null",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "an object is not null",
+ "data": {},
+ "valid": false
+ },
+ {
+ "description": "an array is not null",
+ "data": [],
+ "valid": false
+ },
+ {
+ "description": "a boolean is not null",
+ "data": true,
+ "valid": false
+ },
+ {
+ "description": "null is null",
+ "data": null,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "multiple types can be specified in an array",
+ "schema": {"type": ["integer", "string"]},
+ "tests": [
+ {
+ "description": "an integer is valid",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "a string is valid",
+ "data": "foo",
+ "valid": true
+ },
+ {
+ "description": "a float is invalid",
+ "data": 1.1,
+ "valid": false
+ },
+ {
+ "description": "an object is invalid",
+ "data": {},
+ "valid": false
+ },
+ {
+ "description": "an array is invalid",
+ "data": [],
+ "valid": false
+ },
+ {
+ "description": "a boolean is invalid",
+ "data": true,
+ "valid": false
+ },
+ {
+ "description": "null is invalid",
+ "data": null,
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/uniqueItems.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/uniqueItems.json
new file mode 100644
index 00000000000..c1f4ab99c9a
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/uniqueItems.json
@@ -0,0 +1,79 @@
+[
+ {
+ "description": "uniqueItems validation",
+ "schema": {"uniqueItems": true},
+ "tests": [
+ {
+ "description": "unique array of integers is valid",
+ "data": [1, 2],
+ "valid": true
+ },
+ {
+ "description": "non-unique array of integers is invalid",
+ "data": [1, 1],
+ "valid": false
+ },
+ {
+ "description": "numbers are unique if mathematically unequal",
+ "data": [1.0, 1.00, 1],
+ "valid": false
+ },
+ {
+ "description": "unique array of objects is valid",
+ "data": [{"foo": "bar"}, {"foo": "baz"}],
+ "valid": true
+ },
+ {
+ "description": "non-unique array of objects is invalid",
+ "data": [{"foo": "bar"}, {"foo": "bar"}],
+ "valid": false
+ },
+ {
+ "description": "unique array of nested objects is valid",
+ "data": [
+ {"foo": {"bar" : {"baz" : true}}},
+ {"foo": {"bar" : {"baz" : false}}}
+ ],
+ "valid": true
+ },
+ {
+ "description": "non-unique array of nested objects is invalid",
+ "data": [
+ {"foo": {"bar" : {"baz" : true}}},
+ {"foo": {"bar" : {"baz" : true}}}
+ ],
+ "valid": false
+ },
+ {
+ "description": "unique array of arrays is valid",
+ "data": [["foo"], ["bar"]],
+ "valid": true
+ },
+ {
+ "description": "non-unique array of arrays is invalid",
+ "data": [["foo"], ["foo"]],
+ "valid": false
+ },
+ {
+ "description": "1 and true are unique",
+ "data": [1, true],
+ "valid": true
+ },
+ {
+ "description": "0 and false are unique",
+ "data": [0, false],
+ "valid": true
+ },
+ {
+ "description": "unique heterogeneous types are valid",
+ "data": [{}, [1], true, null, 1],
+ "valid": true
+ },
+ {
+ "description": "non-unique heterogeneous types are invalid",
+ "data": [{}, [1], true, null, {}, 1],
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema.js b/tools/eslint/node_modules/is-my-json-valid/test/json-schema.js
new file mode 100644
index 00000000000..e68a263a279
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/test/json-schema.js
@@ -0,0 +1,23 @@
+var tape = require('tape')
+var fs = require('fs')
+var validator = require('../')
+
+var files = fs.readdirSync(__dirname+'/json-schema-draft4')
+ .map(function(file) {
+ if (file === 'definitions.json') return null
+ if (file === 'refRemote.json') return null
+ return require('./json-schema-draft4/'+file)
+ })
+ .filter(Boolean)
+
+files.forEach(function(file) {
+ file.forEach(function(f) {
+ tape('json-schema-test-suite '+f.description, function(t) {
+ var validate = validator(f.schema)
+ f.tests.forEach(function(test) {
+ t.same(validate(test.data), test.valid, test.description)
+ })
+ t.end()
+ })
+ })
+})
diff --git a/tools/eslint/node_modules/is-my-json-valid/test/misc.js b/tools/eslint/node_modules/is-my-json-valid/test/misc.js
new file mode 100644
index 00000000000..b5109e576f2
--- /dev/null
+++ b/tools/eslint/node_modules/is-my-json-valid/test/misc.js
@@ -0,0 +1,429 @@
+var tape = require('tape')
+var cosmic = require('./fixtures/cosmic')
+var validator = require('../')
+var validatorRequire = require('../require')
+
+tape('simple', function(t) {
+ var schema = {
+ required: true,
+ type: 'object',
+ properties: {
+ hello: {type:'string', required:true}
+ }
+ }
+
+ var validate = validator(schema)
+
+ t.ok(validate({hello: 'world'}), 'should be valid')
+ t.notOk(validate(), 'should be invalid')
+ t.notOk(validate({}), 'should be invalid')
+ t.end()
+})
+
+tape('advanced', function(t) {
+ var validate = validator(cosmic.schema)
+
+ t.ok(validate(cosmic.valid), 'should be valid')
+ t.notOk(validate(cosmic.invalid), 'should be invalid')
+ t.end()
+})
+
+tape('greedy/false', function(t) {
+ var validate = validator({
+ type: 'object',
+ properties: {
+ x: {
+ type: 'number'
+ }
+ },
+ required: ['x', 'y']
+ });
+ t.notOk(validate({}), 'should be invalid')
+ t.strictEqual(validate.errors.length, 2);
+ t.strictEqual(validate.errors[0].field, 'data.x')
+ t.strictEqual(validate.errors[0].message, 'is required')
+ t.strictEqual(validate.errors[1].field, 'data.y')
+ t.strictEqual(validate.errors[1].message, 'is required')
+ t.notOk(validate({x: 'string'}), 'should be invalid')
+ t.strictEqual(validate.errors.length, 1);
+ t.strictEqual(validate.errors[0].field, 'data.y')
+ t.strictEqual(validate.errors[0].message, 'is required')
+ t.notOk(validate({x: 'string', y: 'value'}), 'should be invalid')
+ t.strictEqual(validate.errors.length, 1);
+ t.strictEqual(validate.errors[0].field, 'data.x')
+ t.strictEqual(validate.errors[0].message, 'is the wrong type')
+ t.end();
+});
+
+tape('greedy/true', function(t) {
+ var validate = validator({
+ type: 'object',
+ properties: {
+ x: {
+ type: 'number'
+ }
+ },
+ required: ['x', 'y']
+ }, {
+ greedy: true
+ });
+ t.notOk(validate({}), 'should be invalid')
+ t.strictEqual(validate.errors.length, 2);
+ t.strictEqual(validate.errors[0].field, 'data.x')
+ t.strictEqual(validate.errors[0].message, 'is required')
+ t.strictEqual(validate.errors[1].field, 'data.y')
+ t.strictEqual(validate.errors[1].message, 'is required')
+ t.notOk(validate({x: 'string'}), 'should be invalid')
+ t.strictEqual(validate.errors.length, 2);
+ t.strictEqual(validate.errors[0].field, 'data.y')
+ t.strictEqual(validate.errors[0].message, 'is required')
+ t.strictEqual(validate.errors[1].field, 'data.x')
+ t.strictEqual(validate.errors[1].message, 'is the wrong type')
+ t.notOk(validate({x: 'string', y: 'value'}), 'should be invalid')
+ t.strictEqual(validate.errors.length, 1);
+ t.strictEqual(validate.errors[0].field, 'data.x')
+ t.strictEqual(validate.errors[0].message, 'is the wrong type')
+ t.ok(validate({x: 1, y: 'value'}), 'should be invalid')
+ t.end();
+});
+
+tape('additional props', function(t) {
+ var validate = validator({
+ type: 'object',
+ additionalProperties: false
+ }, {
+ verbose: true
+ })
+
+ t.ok(validate({}))
+ t.notOk(validate({foo:'bar'}))
+ t.ok(validate.errors[0].value === 'data.foo', 'should output the property not allowed in verbose mode')
+ t.end()
+})
+
+tape('array', function(t) {
+ var validate = validator({
+ type: 'array',
+ required: true,
+ items: {
+ type: 'string'
+ }
+ })
+
+ t.notOk(validate({}), 'wrong type')
+ t.notOk(validate(), 'is required')
+ t.ok(validate(['test']))
+ t.end()
+})
+
+tape('nested array', function(t) {
+ var validate = validator({
+ type: 'object',
+ properties: {
+ list: {
+ type: 'array',
+ required: true,
+ items: {
+ type: 'string'
+ }
+ }
+ }
+ })
+
+ t.notOk(validate({}), 'is required')
+ t.ok(validate({list:['test']}))
+ t.notOk(validate({list:[1]}))
+ t.end()
+})
+
+tape('enum', function(t) {
+ var validate = validator({
+ type: 'object',
+ properties: {
+ foo: {
+ type: 'number',
+ required: true,
+ enum: [42]
+ }
+ }
+ })
+
+ t.notOk(validate({}), 'is required')
+ t.ok(validate({foo:42}))
+ t.notOk(validate({foo:43}))
+ t.end()
+})
+
+tape('minimum/maximum', function(t) {
+ var validate = validator({
+ type: 'object',
+ properties: {
+ foo: {
+ type: 'number',
+ minimum: 0,
+ maximum: 0
+ }
+ }
+ })
+
+ t.notOk(validate({foo:-42}))
+ t.ok(validate({foo:0}))
+ t.notOk(validate({foo:42}))
+ t.end()
+})
+
+tape('exclusiveMinimum/exclusiveMaximum', function(t) {
+ var validate = validator({
+ type: 'object',
+ properties: {
+ foo: {
+ type: 'number',
+ minimum: 10,
+ maximum: 20,
+ exclusiveMinimum: true,
+ exclusiveMaximum: true
+ }
+ }
+ })
+
+ t.notOk(validate({foo:10}))
+ t.ok(validate({foo:11}))
+ t.notOk(validate({foo:20}))
+ t.ok(validate({foo:19}))
+ t.end()
+})
+
+tape('custom format', function(t) {
+ var validate = validator({
+ type: 'object',
+ properties: {
+ foo: {
+ type: 'string',
+ format: 'as'
+ }
+ }
+ }, {formats: {as:/^a+$/}})
+
+ t.notOk(validate({foo:''}), 'not as')
+ t.notOk(validate({foo:'b'}), 'not as')
+ t.notOk(validate({foo:'aaab'}), 'not as')
+ t.ok(validate({foo:'a'}), 'as')
+ t.ok(validate({foo:'aaaaaa'}), 'as')
+ t.end()
+})
+
+tape('custom format function', function(t) {
+ var validate = validator({
+ type: 'object',
+ properties: {
+ foo: {
+ type: 'string',
+ format: 'as'
+ }
+ }
+ }, {formats: {as:function(s) { return /^a+$/.test(s) } }})
+
+ t.notOk(validate({foo:''}), 'not as')
+ t.notOk(validate({foo:'b'}), 'not as')
+ t.notOk(validate({foo:'aaab'}), 'not as')
+ t.ok(validate({foo:'a'}), 'as')
+ t.ok(validate({foo:'aaaaaa'}), 'as')
+ t.end()
+})
+
+tape('do not mutate schema', function(t) {
+ var sch = {
+ items: [
+ {}
+ ],
+ additionalItems: {
+ type: 'integer'
+ }
+ }
+
+ var copy = JSON.parse(JSON.stringify(sch))
+
+ validator(sch)
+
+ t.same(sch, copy, 'did not mutate')
+ t.end()
+})
+
+tape('#toJSON()', function(t) {
+ var schema = {
+ required: true,
+ type: 'object',
+ properties: {
+ hello: {type:'string', required:true}
+ }
+ }
+
+ var validate = validator(schema)
+
+ t.deepEqual(validate.toJSON(), schema, 'should return original schema')
+ t.end()
+})
+
+tape('external schemas', function(t) {
+ var ext = {type: 'string'}
+ var schema = {
+ required: true,
+ $ref: '#ext'
+ }
+
+ var validate = validator(schema, {schemas: {ext:ext}})
+
+ t.ok(validate('hello string'), 'is a string')
+ t.notOk(validate(42), 'not a string')
+ t.end()
+})
+
+tape('top-level external schema', function(t) {
+ var defs = {
+ "string": {
+ type: "string"
+ },
+ "sex": {
+ type: "string",
+ enum: ["male", "female", "other"]
+ }
+ }
+ var schema = {
+ type: "object",
+ properties: {
+ "name": { $ref: "definitions.json#/string" },
+ "sex": { $ref: "definitions.json#/sex" }
+ },
+ required: ["name", "sex"]
+ }
+
+ var validate = validator(schema, {
+ schemas: {
+ "definitions.json": defs
+ }
+ })
+ t.ok(validate({name:"alice", sex:"female"}), 'is an object')
+ t.notOk(validate({name:"alice", sex: "bob"}), 'recognizes external schema')
+ t.notOk(validate({name:2, sex: "female"}), 'recognizes external schema')
+ t.end()
+})
+
+tape('nested required array decl', function(t) {
+ var schema = {
+ properties: {
+ x: {
+ type: 'object',
+ properties: {
+ y: {
+ type: 'object',
+ properties: {
+ z: {
+ type: 'string'
+ }
+ },
+ required: ['z']
+ }
+ }
+ }
+ },
+ required: ['x']
+ }
+
+ var validate = validator(schema)
+
+ t.ok(validate({x: {}}), 'should be valid')
+ t.notOk(validate({}), 'should not be valid')
+ t.strictEqual(validate.errors[0].field, 'data.x', 'should output the missing field')
+ t.end()
+})
+
+tape('verbose mode', function(t) {
+ var schema = {
+ required: true,
+ type: 'object',
+ properties: {
+ hello: {
+ required: true,
+ type: 'string'
+ }
+ }
+ };
+
+ var validate = validator(schema, {verbose: true})
+
+ t.ok(validate({hello: 'string'}), 'should be valid')
+ t.notOk(validate({hello: 100}), 'should not be valid')
+ t.strictEqual(validate.errors[0].value, 100, 'error object should contain the invalid value')
+ t.end()
+})
+
+tape('additional props in verbose mode', function(t) {
+ var schema = {
+ type: 'object',
+ required: true,
+ additionalProperties: false,
+ properties: {
+ foo: {
+ type: 'string'
+ },
+ 'hello world': {
+ type: 'object',
+ required: true,
+ additionalProperties: false,
+ properties: {
+ foo: {
+ type: 'string'
+ }
+ }
+ }
+ }
+ };
+
+ var validate = validator(schema, {verbose: true})
+
+ validate({'hello world': {bar: 'string'}});
+
+ t.strictEqual(validate.errors[0].value, 'data["hello world"].bar', 'should output the path to the additional prop in the error')
+ t.end()
+})
+
+tape('Date.now() is an integer', function(t) {
+ var schema = {type: 'integer'}
+ var validate = validator(schema)
+
+ t.ok(validate(Date.now()), 'is integer')
+ t.end()
+})
+
+tape('field shows item index in arrays', function(t) {
+ var schema = {
+ type: 'array',
+ items: {
+ type: 'array',
+ items: {
+ properties: {
+ foo: {
+ type: 'string',
+ required: true
+ }
+ }
+ }
+ }
+ }
+
+ var validate = validator(schema)
+
+ validate([
+ [
+ { foo: 'test' },
+ { foo: 'test' }
+ ],
+ [
+ { foo: 'test' },
+ { baz: 'test' }
+ ]
+ ])
+
+ t.strictEqual(validate.errors[0].field, 'data.1.1.foo', 'should output the field with specific index of failing item in the error')
+ t.end()
+})
diff --git a/tools/eslint/node_modules/js-yaml/CHANGELOG.md b/tools/eslint/node_modules/js-yaml/CHANGELOG.md
index 4cddf198842..f057ec33fc4 100644
--- a/tools/eslint/node_modules/js-yaml/CHANGELOG.md
+++ b/tools/eslint/node_modules/js-yaml/CHANGELOG.md
@@ -1,3 +1,10 @@
+3.3.1 / 2015-05-13
+------------------
+
+- Added `.sortKeys` dumper option, thanks to @rjmunro.
+- Fixed astral characters support, #191.
+
+
3.3.0 / 2015-04-26
------------------
diff --git a/tools/eslint/node_modules/js-yaml/README.md b/tools/eslint/node_modules/js-yaml/README.md
index c181df1645e..8ad571f1059 100644
--- a/tools/eslint/node_modules/js-yaml/README.md
+++ b/tools/eslint/node_modules/js-yaml/README.md
@@ -175,6 +175,8 @@ options:
block to flow style for collections. -1 means block style everwhere
- `styles` - "tag" => "style" map. Each tag may have own set of styles.
- `schema` _(default: `DEFAULT_SAFE_SCHEMA`)_ specifies a schema to use.
+- `sortKeys` _(default: `false`)_ - if `true`, sort keys when dumping YAML. If a
+ function, use the function to sort the keys.
styles:
diff --git a/tools/eslint/node_modules/js-yaml/dist/js-yaml.js b/tools/eslint/node_modules/js-yaml/dist/js-yaml.js
index f917fea9940..21ce73c5ed7 100644
--- a/tools/eslint/node_modules/js-yaml/dist/js-yaml.js
+++ b/tools/eslint/node_modules/js-yaml/dist/js-yaml.js
@@ -1,6 +1,4 @@
-/* js-yaml 3.3.0 https://github.com/nodeca/js-yaml */!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.jsyaml=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
-
-},{}],2:[function(require,module,exports){
+/* js-yaml 3.3.1 https://github.com/nodeca/js-yaml */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.jsyaml = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
'use strict';
@@ -41,7 +39,7 @@ module.exports.parse = deprecated('parse');
module.exports.compose = deprecated('compose');
module.exports.addConstructor = deprecated('addConstructor');
-},{"./js-yaml/dumper":4,"./js-yaml/exception":5,"./js-yaml/loader":6,"./js-yaml/schema":8,"./js-yaml/schema/core":9,"./js-yaml/schema/default_full":10,"./js-yaml/schema/default_safe":11,"./js-yaml/schema/failsafe":12,"./js-yaml/schema/json":13,"./js-yaml/type":14}],3:[function(require,module,exports){
+},{"./js-yaml/dumper":3,"./js-yaml/exception":4,"./js-yaml/loader":5,"./js-yaml/schema":7,"./js-yaml/schema/core":8,"./js-yaml/schema/default_full":9,"./js-yaml/schema/default_safe":10,"./js-yaml/schema/failsafe":11,"./js-yaml/schema/json":12,"./js-yaml/type":13}],2:[function(require,module,exports){
'use strict';
@@ -104,7 +102,7 @@ module.exports.repeat = repeat;
module.exports.isNegativeZero = isNegativeZero;
module.exports.extend = extend;
-},{}],4:[function(require,module,exports){
+},{}],3:[function(require,module,exports){
'use strict';
/*eslint-disable no-use-before-define*/
@@ -221,6 +219,7 @@ function State(options) {
this.skipInvalid = options['skipInvalid'] || false;
this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']);
this.styleMap = compileStyleMap(this.schema, options['styles'] || null);
+ this.sortKeys = options['sortKeys'] || false;
this.implicitTypes = this.schema.compiledImplicit;
this.explicitTypes = this.schema.compiledExplicit;
@@ -706,6 +705,18 @@ function writeBlockMapping(state, level, object, compact) {
explicitPair,
pairBuffer;
+ // Allow sorting keys so that the output file is deterministic
+ if (state.sortKeys === true) {
+ // Default sorting
+ objectKeyList.sort();
+ } else if (typeof state.sortKeys === 'function') {
+ // Custom sort function
+ objectKeyList.sort(state.sortKeys);
+ } else if (state.sortKeys) {
+ // Something is wrong
+ throw new YAMLException('sortKeys must be a boolean or a function');
+ }
+
for (index = 0, length = objectKeyList.length; index < length; index += 1) {
pairBuffer = '';
@@ -935,7 +946,7 @@ function safeDump(input, options) {
module.exports.dump = dump;
module.exports.safeDump = safeDump;
-},{"./common":3,"./exception":5,"./schema/default_full":10,"./schema/default_safe":11}],5:[function(require,module,exports){
+},{"./common":2,"./exception":4,"./schema/default_full":9,"./schema/default_safe":10}],4:[function(require,module,exports){
'use strict';
@@ -962,7 +973,7 @@ YAMLException.prototype.toString = function toString(compact) {
module.exports = YAMLException;
-},{}],6:[function(require,module,exports){
+},{}],5:[function(require,module,exports){
'use strict';
/*eslint-disable max-len,no-use-before-define*/
@@ -988,7 +999,7 @@ var CHOMPING_STRIP = 2;
var CHOMPING_KEEP = 3;
-var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uD800-\uDFFF\uFFFE\uFFFF]/;
+var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
@@ -2550,7 +2561,7 @@ module.exports.load = load;
module.exports.safeLoadAll = safeLoadAll;
module.exports.safeLoad = safeLoad;
-},{"./common":3,"./exception":5,"./mark":7,"./schema/default_full":10,"./schema/default_safe":11}],7:[function(require,module,exports){
+},{"./common":2,"./exception":4,"./mark":6,"./schema/default_full":9,"./schema/default_safe":10}],6:[function(require,module,exports){
'use strict';
@@ -2630,7 +2641,7 @@ Mark.prototype.toString = function toString(compact) {
module.exports = Mark;
-},{"./common":3}],8:[function(require,module,exports){
+},{"./common":2}],7:[function(require,module,exports){
'use strict';
/*eslint-disable max-len*/
@@ -2736,7 +2747,7 @@ Schema.create = function createSchema() {
module.exports = Schema;
-},{"./common":3,"./exception":5,"./type":14}],9:[function(require,module,exports){
+},{"./common":2,"./exception":4,"./type":13}],8:[function(require,module,exports){
// Standard YAML's Core schema.
// http://www.yaml.org/spec/1.2/spec.html#id2804923
//
@@ -2756,7 +2767,7 @@ module.exports = new Schema({
]
});
-},{"../schema":8,"./json":13}],10:[function(require,module,exports){
+},{"../schema":7,"./json":12}],9:[function(require,module,exports){
// JS-YAML's default schema for `load` function.
// It is not described in the YAML specification.
//
@@ -2783,7 +2794,7 @@ module.exports = Schema.DEFAULT = new Schema({
]
});
-},{"../schema":8,"../type/js/function":19,"../type/js/regexp":20,"../type/js/undefined":21,"./default_safe":11}],11:[function(require,module,exports){
+},{"../schema":7,"../type/js/function":18,"../type/js/regexp":19,"../type/js/undefined":20,"./default_safe":10}],10:[function(require,module,exports){
// JS-YAML's default schema for `safeLoad` function.
// It is not described in the YAML specification.
//
@@ -2813,7 +2824,7 @@ module.exports = new Schema({
]
});
-},{"../schema":8,"../type/binary":15,"../type/merge":23,"../type/omap":25,"../type/pairs":26,"../type/set":28,"../type/timestamp":30,"./core":9}],12:[function(require,module,exports){
+},{"../schema":7,"../type/binary":14,"../type/merge":22,"../type/omap":24,"../type/pairs":25,"../type/set":27,"../type/timestamp":29,"./core":8}],11:[function(require,module,exports){
// Standard YAML's Failsafe schema.
// http://www.yaml.org/spec/1.2/spec.html#id2802346
@@ -2832,7 +2843,7 @@ module.exports = new Schema({
]
});
-},{"../schema":8,"../type/map":22,"../type/seq":27,"../type/str":29}],13:[function(require,module,exports){
+},{"../schema":7,"../type/map":21,"../type/seq":26,"../type/str":28}],12:[function(require,module,exports){
// Standard YAML's JSON schema.
// http://www.yaml.org/spec/1.2/spec.html#id2803231
//
@@ -2859,7 +2870,7 @@ module.exports = new Schema({
]
});
-},{"../schema":8,"../type/bool":16,"../type/float":17,"../type/int":18,"../type/null":24,"./failsafe":12}],14:[function(require,module,exports){
+},{"../schema":7,"../type/bool":15,"../type/float":16,"../type/int":17,"../type/null":23,"./failsafe":11}],13:[function(require,module,exports){
'use strict';
var YAMLException = require('./exception');
@@ -2922,7 +2933,7 @@ function Type(tag, options) {
module.exports = Type;
-},{"./exception":5}],15:[function(require,module,exports){
+},{"./exception":4}],14:[function(require,module,exports){
'use strict';
/*eslint-disable no-bitwise*/
@@ -3058,7 +3069,7 @@ module.exports = new Type('tag:yaml.org,2002:binary', {
represent: representYamlBinary
});
-},{"../type":14,"buffer":1}],16:[function(require,module,exports){
+},{"../type":13,"buffer":30}],15:[function(require,module,exports){
'use strict';
var Type = require('../type');
@@ -3097,7 +3108,7 @@ module.exports = new Type('tag:yaml.org,2002:bool', {
defaultStyle: 'lowercase'
});
-},{"../type":14}],17:[function(require,module,exports){
+},{"../type":13}],16:[function(require,module,exports){
'use strict';
var common = require('../common');
@@ -3207,7 +3218,7 @@ module.exports = new Type('tag:yaml.org,2002:float', {
defaultStyle: 'lowercase'
});
-},{"../common":3,"../type":14}],18:[function(require,module,exports){
+},{"../common":2,"../type":13}],17:[function(require,module,exports){
'use strict';
var common = require('../common');
@@ -3392,7 +3403,7 @@ module.exports = new Type('tag:yaml.org,2002:int', {
}
});
-},{"../common":3,"../type":14}],19:[function(require,module,exports){
+},{"../common":2,"../type":13}],18:[function(require,module,exports){
'use strict';
var esprima;
@@ -3480,7 +3491,7 @@ module.exports = new Type('tag:yaml.org,2002:js/function', {
represent: representJavascriptFunction
});
-},{"../../type":14,"esprima":"esprima"}],20:[function(require,module,exports){
+},{"../../type":13,"esprima":"esprima"}],19:[function(require,module,exports){
'use strict';
var Type = require('../../type');
@@ -3566,7 +3577,7 @@ module.exports = new Type('tag:yaml.org,2002:js/regexp', {
represent: representJavascriptRegExp
});
-},{"../../type":14}],21:[function(require,module,exports){
+},{"../../type":13}],20:[function(require,module,exports){
'use strict';
var Type = require('../../type');
@@ -3596,7 +3607,7 @@ module.exports = new Type('tag:yaml.org,2002:js/undefined', {
represent: representJavascriptUndefined
});
-},{"../../type":14}],22:[function(require,module,exports){
+},{"../../type":13}],21:[function(require,module,exports){
'use strict';
var Type = require('../type');
@@ -3606,7 +3617,7 @@ module.exports = new Type('tag:yaml.org,2002:map', {
construct: function (data) { return null !== data ? data : {}; }
});
-},{"../type":14}],23:[function(require,module,exports){
+},{"../type":13}],22:[function(require,module,exports){
'use strict';
var Type = require('../type');
@@ -3620,7 +3631,7 @@ module.exports = new Type('tag:yaml.org,2002:merge', {
resolve: resolveYamlMerge
});
-},{"../type":14}],24:[function(require,module,exports){
+},{"../type":13}],23:[function(require,module,exports){
'use strict';
var Type = require('../type');
@@ -3658,7 +3669,7 @@ module.exports = new Type('tag:yaml.org,2002:null', {
defaultStyle: 'lowercase'
});
-},{"../type":14}],25:[function(require,module,exports){
+},{"../type":13}],24:[function(require,module,exports){
'use strict';
var Type = require('../type');
@@ -3716,7 +3727,7 @@ module.exports = new Type('tag:yaml.org,2002:omap', {
construct: constructYamlOmap
});
-},{"../type":14}],26:[function(require,module,exports){
+},{"../type":13}],25:[function(require,module,exports){
'use strict';
var Type = require('../type');
@@ -3779,7 +3790,7 @@ module.exports = new Type('tag:yaml.org,2002:pairs', {
construct: constructYamlPairs
});
-},{"../type":14}],27:[function(require,module,exports){
+},{"../type":13}],26:[function(require,module,exports){
'use strict';
var Type = require('../type');
@@ -3789,7 +3800,7 @@ module.exports = new Type('tag:yaml.org,2002:seq', {
construct: function (data) { return null !== data ? data : []; }
});
-},{"../type":14}],28:[function(require,module,exports){
+},{"../type":13}],27:[function(require,module,exports){
'use strict';
var Type = require('../type');
@@ -3824,7 +3835,7 @@ module.exports = new Type('tag:yaml.org,2002:set', {
construct: constructYamlSet
});
-},{"../type":14}],29:[function(require,module,exports){
+},{"../type":13}],28:[function(require,module,exports){
'use strict';
var Type = require('../type');
@@ -3834,7 +3845,7 @@ module.exports = new Type('tag:yaml.org,2002:str', {
construct: function (data) { return null !== data ? data : ''; }
});
-},{"../type":14}],30:[function(require,module,exports){
+},{"../type":13}],29:[function(require,module,exports){
'use strict';
var Type = require('../type');
@@ -3934,7 +3945,9 @@ module.exports = new Type('tag:yaml.org,2002:timestamp', {
represent: representYamlTimestamp
});
-},{"../type":14}],"/":[function(require,module,exports){
+},{"../type":13}],30:[function(require,module,exports){
+
+},{}],"/":[function(require,module,exports){
'use strict';
@@ -3943,5 +3956,5 @@ var yaml = require('./lib/js-yaml.js');
module.exports = yaml;
-},{"./lib/js-yaml.js":2}]},{},[])("/")
+},{"./lib/js-yaml.js":1}]},{},[])("/")
}); \ No newline at end of file
diff --git a/tools/eslint/node_modules/js-yaml/examples/custom_types.js b/tools/eslint/node_modules/js-yaml/examples/custom_types.js
index 02d8754fad1..b5c7b9f7de0 100644
--- a/tools/eslint/node_modules/js-yaml/examples/custom_types.js
+++ b/tools/eslint/node_modules/js-yaml/examples/custom_types.js
@@ -79,23 +79,23 @@ var SpaceYamlType = new yaml.Type('!space', {
var SPACE_SCHEMA = yaml.Schema.create([ SpaceYamlType, PointYamlType ]);
-
-// And read a document using that schema.
-
-fs.readFile(path.join(__dirname, 'custom_types.yml'), 'utf8', function (error, data) {
- var loaded;
-
- if (!error) {
- loaded = yaml.load(data, { schema: SPACE_SCHEMA });
- console.log(util.inspect(loaded, false, 20, true));
- } else {
- console.error(error.stack || error.message || String(error));
- }
-});
-
+// do not execute the following if file is required (http://stackoverflow.com/a/6398335)
+if (require.main === module) {
+
+ // And read a document using that schema.
+ fs.readFile(path.join(__dirname, 'custom_types.yml'), 'utf8', function (error, data) {
+ var loaded;
+
+ if (!error) {
+ loaded = yaml.load(data, { schema: SPACE_SCHEMA });
+ console.log(util.inspect(loaded, false, 20, true));
+ } else {
+ console.error(error.stack || error.message || String(error));
+ }
+ });
+}
// There are some exports to play with this example interactively.
-
module.exports.Point = Point;
module.exports.Space = Space;
module.exports.PointYamlType = PointYamlType;
diff --git a/tools/eslint/node_modules/js-yaml/lib/js-yaml/dumper.js b/tools/eslint/node_modules/js-yaml/lib/js-yaml/dumper.js
index 1fc09ba39ce..fabc0c3cd04 100644
--- a/tools/eslint/node_modules/js-yaml/lib/js-yaml/dumper.js
+++ b/tools/eslint/node_modules/js-yaml/lib/js-yaml/dumper.js
@@ -114,6 +114,7 @@ function State(options) {
this.skipInvalid = options['skipInvalid'] || false;
this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']);
this.styleMap = compileStyleMap(this.schema, options['styles'] || null);
+ this.sortKeys = options['sortKeys'] || false;
this.implicitTypes = this.schema.compiledImplicit;
this.explicitTypes = this.schema.compiledExplicit;
@@ -599,6 +600,18 @@ function writeBlockMapping(state, level, object, compact) {
explicitPair,
pairBuffer;
+ // Allow sorting keys so that the output file is deterministic
+ if (state.sortKeys === true) {
+ // Default sorting
+ objectKeyList.sort();
+ } else if (typeof state.sortKeys === 'function') {
+ // Custom sort function
+ objectKeyList.sort(state.sortKeys);
+ } else if (state.sortKeys) {
+ // Something is wrong
+ throw new YAMLException('sortKeys must be a boolean or a function');
+ }
+
for (index = 0, length = objectKeyList.length; index < length; index += 1) {
pairBuffer = '';
diff --git a/tools/eslint/node_modules/js-yaml/lib/js-yaml/loader.js b/tools/eslint/node_modules/js-yaml/lib/js-yaml/loader.js
index af1b99b3522..1012ff56a1f 100644
--- a/tools/eslint/node_modules/js-yaml/lib/js-yaml/loader.js
+++ b/tools/eslint/node_modules/js-yaml/lib/js-yaml/loader.js
@@ -23,7 +23,7 @@ var CHOMPING_STRIP = 2;
var CHOMPING_KEEP = 3;
-var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uD800-\uDFFF\uFFFE\uFFFF]/;
+var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/.bin/esparse b/tools/eslint/node_modules/js-yaml/node_modules/.bin/esparse
index 560366695a1..7423b18b24e 100755..120000
--- a/tools/eslint/node_modules/js-yaml/node_modules/.bin/esparse
+++ b/tools/eslint/node_modules/js-yaml/node_modules/.bin/esparse
@@ -1,127 +1 @@
-#!/usr/bin/env node
-/*
- Copyright (C) 2012 Ariya Hidayat <ariya.hidayat@gmail.com>
- Copyright (C) 2011 Ariya Hidayat <ariya.hidayat@gmail.com>
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/*jslint sloppy:true node:true rhino:true */
-
-var fs, esprima, fname, content, options, syntax;
-
-if (typeof require === 'function') {
- fs = require('fs');
- esprima = require('esprima');
-} else if (typeof load === 'function') {
- try {
- load('esprima.js');
- } catch (e) {
- load('../esprima.js');
- }
-}
-
-// Shims to Node.js objects when running under Rhino.
-if (typeof console === 'undefined' && typeof process === 'undefined') {
- console = { log: print };
- fs = { readFileSync: readFile };
- process = { argv: arguments, exit: quit };
- process.argv.unshift('esparse.js');
- process.argv.unshift('rhino');
-}
-
-function showUsage() {
- console.log('Usage:');
- console.log(' esparse [options] file.js');
- console.log();
- console.log('Available options:');
- console.log();
- console.log(' --comment Gather all line and block comments in an array');
- console.log(' --loc Include line-column location info for each syntax node');
- console.log(' --range Include index-based range for each syntax node');
- console.log(' --raw Display the raw value of literals');
- console.log(' --tokens List all tokens in an array');
- console.log(' --tolerant Tolerate errors on a best-effort basis (experimental)');
- console.log(' -v, --version Shows program version');
- console.log();
- process.exit(1);
-}
-
-if (process.argv.length <= 2) {
- showUsage();
-}
-
-options = {};
-
-process.argv.splice(2).forEach(function (entry) {
-
- if (entry === '-h' || entry === '--help') {
- showUsage();
- } else if (entry === '-v' || entry === '--version') {
- console.log('ECMAScript Parser (using Esprima version', esprima.version, ')');
- console.log();
- process.exit(0);
- } else if (entry === '--comment') {
- options.comment = true;
- } else if (entry === '--loc') {
- options.loc = true;
- } else if (entry === '--range') {
- options.range = true;
- } else if (entry === '--raw') {
- options.raw = true;
- } else if (entry === '--tokens') {
- options.tokens = true;
- } else if (entry === '--tolerant') {
- options.tolerant = true;
- } else if (entry.slice(0, 2) === '--') {
- console.log('Error: unknown option ' + entry + '.');
- process.exit(1);
- } else if (typeof fname === 'string') {
- console.log('Error: more than one input file.');
- process.exit(1);
- } else {
- fname = entry;
- }
-});
-
-if (typeof fname !== 'string') {
- console.log('Error: no input file.');
- process.exit(1);
-}
-
-// Special handling for regular expression literal since we need to
-// convert it to a string literal, otherwise it will be decoded
-// as object "{}" and the regular expression would be lost.
-function adjustRegexLiteral(key, value) {
- if (key === 'value' && value instanceof RegExp) {
- value = value.toString();
- }
- return value;
-}
-
-try {
- content = fs.readFileSync(fname, 'utf-8');
- syntax = esprima.parse(content, options);
- console.log(JSON.stringify(syntax, adjustRegexLiteral, 4));
-} catch (e) {
- console.log('Error: ' + e.message);
- process.exit(1);
-}
+../esprima/bin/esparse.js \ No newline at end of file
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/.bin/esvalidate b/tools/eslint/node_modules/js-yaml/node_modules/.bin/esvalidate
index dddd8a2ada4..16069effbc9 100755..120000
--- a/tools/eslint/node_modules/js-yaml/node_modules/.bin/esvalidate
+++ b/tools/eslint/node_modules/js-yaml/node_modules/.bin/esvalidate
@@ -1,199 +1 @@
-#!/usr/bin/env node
-/*
- Copyright (C) 2012 Ariya Hidayat <ariya.hidayat@gmail.com>
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/*jslint sloppy:true plusplus:true node:true rhino:true */
-/*global phantom:true */
-
-var fs, system, esprima, options, fnames, count;
-
-if (typeof esprima === 'undefined') {
- // PhantomJS can only require() relative files
- if (typeof phantom === 'object') {
- fs = require('fs');
- system = require('system');
- esprima = require('./esprima');
- } else if (typeof require === 'function') {
- fs = require('fs');
- esprima = require('esprima');
- } else if (typeof load === 'function') {
- try {
- load('esprima.js');
- } catch (e) {
- load('../esprima.js');
- }
- }
-}
-
-// Shims to Node.js objects when running under PhantomJS 1.7+.
-if (typeof phantom === 'object') {
- fs.readFileSync = fs.read;
- process = {
- argv: [].slice.call(system.args),
- exit: phantom.exit
- };
- process.argv.unshift('phantomjs');
-}
-
-// Shims to Node.js objects when running under Rhino.
-if (typeof console === 'undefined' && typeof process === 'undefined') {
- console = { log: print };
- fs = { readFileSync: readFile };
- process = { argv: arguments, exit: quit };
- process.argv.unshift('esvalidate.js');
- process.argv.unshift('rhino');
-}
-
-function showUsage() {
- console.log('Usage:');
- console.log(' esvalidate [options] file.js');
- console.log();
- console.log('Available options:');
- console.log();
- console.log(' --format=type Set the report format, plain (default) or junit');
- console.log(' -v, --version Print program version');
- console.log();
- process.exit(1);
-}
-
-if (process.argv.length <= 2) {
- showUsage();
-}
-
-options = {
- format: 'plain'
-};
-
-fnames = [];
-
-process.argv.splice(2).forEach(function (entry) {
-
- if (entry === '-h' || entry === '--help') {
- showUsage();
- } else if (entry === '-v' || entry === '--version') {
- console.log('ECMAScript Validator (using Esprima version', esprima.version, ')');
- console.log();
- process.exit(0);
- } else if (entry.slice(0, 9) === '--format=') {
- options.format = entry.slice(9);
- if (options.format !== 'plain' && options.format !== 'junit') {
- console.log('Error: unknown report format ' + options.format + '.');
- process.exit(1);
- }
- } else if (entry.slice(0, 2) === '--') {
- console.log('Error: unknown option ' + entry + '.');
- process.exit(1);
- } else {
- fnames.push(entry);
- }
-});
-
-if (fnames.length === 0) {
- console.log('Error: no input file.');
- process.exit(1);
-}
-
-if (options.format === 'junit') {
- console.log('<?xml version="1.0" encoding="UTF-8"?>');
- console.log('<testsuites>');
-}
-
-count = 0;
-fnames.forEach(function (fname) {
- var content, timestamp, syntax, name;
- try {
- content = fs.readFileSync(fname, 'utf-8');
-
- if (content[0] === '#' && content[1] === '!') {
- content = '//' + content.substr(2, content.length);
- }
-
- timestamp = Date.now();
- syntax = esprima.parse(content, { tolerant: true });
-
- if (options.format === 'junit') {
-
- name = fname;
- if (name.lastIndexOf('/') >= 0) {
- name = name.slice(name.lastIndexOf('/') + 1);
- }
-
- console.log('<testsuite name="' + fname + '" errors="0" ' +
- ' failures="' + syntax.errors.length + '" ' +
- ' tests="' + syntax.errors.length + '" ' +
- ' time="' + Math.round((Date.now() - timestamp) / 1000) +
- '">');
-
- syntax.errors.forEach(function (error) {
- var msg = error.message;
- msg = msg.replace(/^Line\ [0-9]*\:\ /, '');
- console.log(' <testcase name="Line ' + error.lineNumber + ': ' + msg + '" ' +
- ' time="0">');
- console.log(' <error type="SyntaxError" message="' + error.message + '">' +
- error.message + '(' + name + ':' + error.lineNumber + ')' +
- '</error>');
- console.log(' </testcase>');
- });
-
- console.log('</testsuite>');
-
- } else if (options.format === 'plain') {
-
- syntax.errors.forEach(function (error) {
- var msg = error.message;
- msg = msg.replace(/^Line\ [0-9]*\:\ /, '');
- msg = fname + ':' + error.lineNumber + ': ' + msg;
- console.log(msg);
- ++count;
- });
-
- }
- } catch (e) {
- ++count;
- if (options.format === 'junit') {
- console.log('<testsuite name="' + fname + '" errors="1" failures="0" tests="1" ' +
- ' time="' + Math.round((Date.now() - timestamp) / 1000) + '">');
- console.log(' <testcase name="' + e.message + '" ' + ' time="0">');
- console.log(' <error type="ParseError" message="' + e.message + '">' +
- e.message + '(' + fname + ((e.lineNumber) ? ':' + e.lineNumber : '') +
- ')</error>');
- console.log(' </testcase>');
- console.log('</testsuite>');
- } else {
- console.log('Error: ' + e.message);
- }
- }
-});
-
-if (options.format === 'junit') {
- console.log('</testsuites>');
-}
-
-if (count > 0) {
- process.exit(1);
-}
-
-if (count === 0 && typeof phantom === 'object') {
- process.exit(0);
-}
+../esprima/bin/esvalidate.js \ No newline at end of file
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/README.md b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/README.md
index 701a14b6b1b..cd0fe0cebb7 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/README.md
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/README.md
@@ -1,4 +1,4 @@
-# lodash v3.8.0
+# lodash v3.9.3
The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash](https://lodash.com/) exported as [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) modules.
@@ -28,7 +28,7 @@ var array = require('lodash/array');
var chunk = require('lodash/array/chunk');
```
-See the [package source](https://github.com/lodash/lodash/tree/3.8.0-npm) for more details.
+See the [package source](https://github.com/lodash/lodash/tree/3.9.3-npm) for more details.
**Note:**<br>
Don’t assign values to the [special variable](http://nodejs.org/api/repl.html#repl_repl_features) `_` when in the REPL.<br>
@@ -39,8 +39,8 @@ Install [n_](https://www.npmjs.com/package/n_) for a REPL that includes lodash b
lodash is also available in a variety of other builds & module formats.
* npm packages for [modern](https://www.npmjs.com/package/lodash), [compatibility](https://www.npmjs.com/package/lodash-compat), & [per method](https://www.npmjs.com/browse/keyword/lodash-modularized) builds
- * AMD modules for [modern](https://github.com/lodash/lodash/tree/3.8.0-amd) & [compatibility](https://github.com/lodash/lodash-compat/tree/3.8.0-amd) builds
- * ES modules for the [modern](https://github.com/lodash/lodash/tree/3.8.0-es) build
+ * AMD modules for [modern](https://github.com/lodash/lodash/tree/3.9.3-amd) & [compatibility](https://github.com/lodash/lodash-compat/tree/3.9.3-amd) builds
+ * ES modules for the [modern](https://github.com/lodash/lodash/tree/3.9.3-es) build
## Further Reading
@@ -75,6 +75,7 @@ lodash is also available in a variety of other builds & module formats.
* [_.forIn](https://lodash.com/docs#forIn) for iterating all enumerable properties
* [_.forOwn](https://lodash.com/docs#forOwn) for iterating own properties
* [_.get](https://lodash.com/docs#get) & [_.set](https://lodash.com/docs#set) for deep property getting & setting
+ * [_.gt](https://lodash.com/docs#gt), [_.gte](https://lodash.com/docs#gte), [_.lt](https://lodash.com/docs#lt), & [_.lte](https://lodash.com/docs#lte) relational methods
* [_.inRange](https://lodash.com/docs#inRange) for checking whether a number is within a given range
* [_.isNative](https://lodash.com/docs#isNative) to check for native functions
* [_.isPlainObject](https://lodash.com/docs#isPlainObject) & [_.toPlainObject](https://lodash.com/docs#toPlainObject) to check for & convert to `Object` objects
@@ -115,5 +116,5 @@ lodash is also available in a variety of other builds & module formats.
## Support
-Tested in Chrome 41-42, Firefox 36-37, IE 6-11, MS Edge, Opera 27-28, Safari 5-8, io.js 1.8.1, Node.js 0.8.28, 0.10.38, & 0.12.2, PhantomJS 1.9.8, RingoJS 0.11, & Rhino 1.7RC5.
+Tested in Chrome 41-42, Firefox 37-38, IE 6-11, MS Edge, Opera 28-29, Safari 5-8, ChakraNode 0.12.2, io.js 2.1.0, Node.js 0.8.28, 0.10.38, & 0.12.4, PhantomJS 1.9.8, RingoJS 0.11, & Rhino 1.7.6
Automated [browser](https://saucelabs.com/u/lodash) & [CI](https://travis-ci.org/lodash/lodash/) test runs are available. Special thanks to [Sauce Labs](https://saucelabs.com/) for providing automated browser testing.
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/difference.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/difference.js
index 22a5cf899d5..5049337e5f3 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/difference.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/difference.js
@@ -4,8 +4,8 @@ var baseDifference = require('../internal/baseDifference'),
restParam = require('../function/restParam');
/**
- * Creates an array excluding all values of the provided arrays using
- * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
+ * Creates an array of unique `array` values not included in the other
+ * provided arrays using [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
* for equality comparisons.
*
* @static
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/intersection.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/intersection.js
index 13af23eb5e9..ec5b7f9b6ce 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/intersection.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/intersection.js
@@ -1,11 +1,12 @@
var baseIndexOf = require('../internal/baseIndexOf'),
cacheIndexOf = require('../internal/cacheIndexOf'),
createCache = require('../internal/createCache'),
- isArrayLike = require('../internal/isArrayLike');
+ isArrayLike = require('../internal/isArrayLike'),
+ restParam = require('../function/restParam');
/**
- * Creates an array of unique values in all provided arrays using
- * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
+ * Creates an array of unique values that are included in all of the provided
+ * arrays using [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
* for equality comparisons.
*
* @static
@@ -17,27 +18,19 @@ var baseIndexOf = require('../internal/baseIndexOf'),
* _.intersection([1, 2], [4, 2], [2, 1]);
* // => [2]
*/
-function intersection() {
- var args = [],
- argsIndex = -1,
- argsLength = arguments.length,
- caches = [],
+var intersection = restParam(function(arrays) {
+ var othLength = arrays.length,
+ othIndex = othLength,
+ caches = Array(length),
indexOf = baseIndexOf,
isCommon = true,
result = [];
- while (++argsIndex < argsLength) {
- var value = arguments[argsIndex];
- if (isArrayLike(value)) {
- args.push(value);
- caches.push((isCommon && value.length >= 120) ? createCache(argsIndex && value) : null);
- }
- }
- argsLength = args.length;
- if (argsLength < 2) {
- return result;
+ while (othIndex--) {
+ var value = arrays[othIndex] = isArrayLike(value = arrays[othIndex]) ? value : [];
+ caches[othIndex] = (isCommon && value.length >= 120) ? createCache(othIndex && value) : null;
}
- var array = args[0],
+ var array = arrays[0],
index = -1,
length = array ? array.length : 0,
seen = caches[0];
@@ -46,10 +39,10 @@ function intersection() {
while (++index < length) {
value = array[index];
if ((seen ? cacheIndexOf(seen, value) : indexOf(result, value, 0)) < 0) {
- argsIndex = argsLength;
- while (--argsIndex) {
- var cache = caches[argsIndex];
- if ((cache ? cacheIndexOf(cache, value) : indexOf(args[argsIndex], value, 0)) < 0) {
+ var othIndex = othLength;
+ while (--othIndex) {
+ var cache = caches[othIndex];
+ if ((cache ? cacheIndexOf(cache, value) : indexOf(arrays[othIndex], value, 0)) < 0) {
continue outer;
}
}
@@ -60,6 +53,6 @@ function intersection() {
}
}
return result;
-}
+});
module.exports = intersection;
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/union.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/union.js
index ee71b2782a3..05101ca1c2d 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/union.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/union.js
@@ -3,8 +3,8 @@ var baseFlatten = require('../internal/baseFlatten'),
restParam = require('../function/restParam');
/**
- * Creates an array of unique values, in order, of the provided arrays using
- * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
+ * Creates an array of unique values, in order, from all of the provided arrays
+ * using [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
* for equality comparisons.
*
* @static
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/xor.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/xor.js
index 315b9f8e29c..3bdf9df1218 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/xor.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/xor.js
@@ -3,7 +3,7 @@ var baseDifference = require('../internal/baseDifference'),
isArrayLike = require('../internal/isArrayLike');
/**
- * Creates an array that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
+ * Creates an array of unique values that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
* of the provided arrays.
*
* @static
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/zipWith.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/zipWith.js
index 7a268df5147..ad103742cd1 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/zipWith.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/zipWith.js
@@ -20,8 +20,8 @@ var restParam = require('../function/restParam'),
*/
var zipWith = restParam(function(arrays) {
var length = arrays.length,
- iteratee = arrays[length - 2],
- thisArg = arrays[length - 1];
+ iteratee = length > 2 ? arrays[length - 2] : undefined,
+ thisArg = length > 1 ? arrays[length - 1] : undefined;
if (length > 2 && typeof iteratee == 'function') {
length -= 2;
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/lodash.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/lodash.js
index 7ca104c4485..3241ed89f22 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/lodash.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/lodash.js
@@ -50,30 +50,31 @@ var hasOwnProperty = objectProto.hasOwnProperty;
* `filter`, `flatten`, `flattenDeep`, `flow`, `flowRight`, `forEach`,
* `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `functions`,
* `groupBy`, `indexBy`, `initial`, `intersection`, `invert`, `invoke`, `keys`,
- * `keysIn`, `map`, `mapValues`, `matches`, `matchesProperty`, `memoize`,
- * `merge`, `mixin`, `negate`, `omit`, `once`, `pairs`, `partial`, `partialRight`,
- * `partition`, `pick`, `plant`, `pluck`, `property`, `propertyOf`, `pull`,
- * `pullAt`, `push`, `range`, `rearg`, `reject`, `remove`, `rest`, `reverse`,
- * `shuffle`, `slice`, `sort`, `sortBy`, `sortByAll`, `sortByOrder`, `splice`,
- * `spread`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `tap`,
- * `throttle`, `thru`, `times`, `toArray`, `toPlainObject`, `transform`,
- * `union`, `uniq`, `unshift`, `unzip`, `values`, `valuesIn`, `where`,
- * `without`, `wrap`, `xor`, `zip`, and `zipObject`
+ * `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
+ * `memoize`, `merge`, `method`, `methodOf`, `mixin`, `negate`, `omit`, `once`,
+ * `pairs`, `partial`, `partialRight`, `partition`, `pick`, `plant`, `pluck`,
+ * `property`, `propertyOf`, `pull`, `pullAt`, `push`, `range`, `rearg`,
+ * `reject`, `remove`, `rest`, `restParam`, `reverse`, `set`, `shuffle`,
+ * `slice`, `sort`, `sortBy`, `sortByAll`, `sortByOrder`, `splice`, `spread`,
+ * `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `tap`, `throttle`,
+ * `thru`, `times`, `toArray`, `toPlainObject`, `transform`, `union`, `uniq`,
+ * `unshift`, `unzip`, `unzipWith`, `values`, `valuesIn`, `where`, `without`,
+ * `wrap`, `xor`, `zip`, `zipObject`, `zipWith`
*
* The wrapper methods that are **not** chainable by default are:
* `add`, `attempt`, `camelCase`, `capitalize`, `clone`, `cloneDeep`, `deburr`,
* `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`,
- * `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`, `has`,
- * `identity`, `includes`, `indexOf`, `inRange`, `isArguments`, `isArray`,
- * `isBoolean`, `isDate`, `isElement`, `isEmpty`, `isEqual`, `isError`, `isFinite`
- * `isFunction`, `isMatch`, `isNative`, `isNaN`, `isNull`, `isNumber`, `isObject`,
- * `isPlainObject`, `isRegExp`, `isString`, `isUndefined`, `isTypedArray`,
- * `join`, `kebabCase`, `last`, `lastIndexOf`, `max`, `min`, `noConflict`,
- * `noop`, `now`, `pad`, `padLeft`, `padRight`, `parseInt`, `pop`, `random`,
- * `reduce`, `reduceRight`, `repeat`, `result`, `runInContext`, `shift`, `size`,
- * `snakeCase`, `some`, `sortedIndex`, `sortedLastIndex`, `startCase`, `startsWith`,
- * `sum`, `template`, `trim`, `trimLeft`, `trimRight`, `trunc`, `unescape`,
- * `uniqueId`, `value`, and `words`
+ * `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`, `get`,
+ * `gt`, `gte`, `has`, `identity`, `includes`, `indexOf`, `inRange`, `isArguments`,
+ * `isArray`, `isBoolean`, `isDate`, `isElement`, `isEmpty`, `isEqual`, `isError`,
+ * `isFinite` `isFunction`, `isMatch`, `isNative`, `isNaN`, `isNull`, `isNumber`,
+ * `isObject`, `isPlainObject`, `isRegExp`, `isString`, `isUndefined`,
+ * `isTypedArray`, `join`, `kebabCase`, `last`, `lastIndexOf`, `lt`, `lte`,
+ * `max`, `min`, `noConflict`, `noop`, `now`, `pad`, `padLeft`, `padRight`,
+ * `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`,
+ * `runInContext`, `shift`, `size`, `snakeCase`, `some`, `sortedIndex`,
+ * `sortedLastIndex`, `startCase`, `startsWith`, `sum`, `template`, `trim`,
+ * `trimLeft`, `trimRight`, `trunc`, `unescape`, `uniqueId`, `value`, and `words`
*
* The wrapper method `sample` will return a wrapped value when `n` is provided,
* otherwise an unwrapped value is returned.
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/invoke.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/invoke.js
index 5cb428ec2a8..0a0a84cdbe2 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/invoke.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/invoke.js
@@ -5,7 +5,7 @@ var baseEach = require('../internal/baseEach'),
restParam = require('../function/restParam');
/**
- * Invokes the method at `path` on each element in `collection`, returning
+ * Invokes the method at `path` of each element in `collection`, returning
* an array of the results of each invoked method. Any additional arguments
* are provided to each invoked method. If `methodName` is a function it is
* invoked for, and `this` bound to, each element in `collection`.
@@ -33,7 +33,7 @@ var invoke = restParam(function(collection, path, args) {
result = isArrayLike(collection) ? Array(collection.length) : [];
baseEach(collection, function(value) {
- var func = isFunc ? path : (isProp && value != null && value[path]);
+ var func = isFunc ? path : ((isProp && value != null) ? value[path] : null);
result[++index] = func ? func.apply(value, args) : invokePath(value, path, args);
});
return result;
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/map.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/map.js
index 1413f50c9f6..5381110df12 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/map.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/map.js
@@ -19,7 +19,7 @@ var arrayMap = require('../internal/arrayMap'),
* callback returns `true` for elements that have the properties of the given
* object, else `false`.
*
- * Many lodash methods are guarded to work as interatees for methods like
+ * Many lodash methods are guarded to work as iteratees for methods like
* `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
*
* The guarded methods are:
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/reduce.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/reduce.js
index a483d2568b6..da97655c198 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/reduce.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/reduce.js
@@ -10,7 +10,7 @@ var arrayReduce = require('../internal/arrayReduce'),
* value. The `iteratee` is bound to `thisArg` and invoked with four arguments:
* (accumulator, value, index|key, collection).
*
- * Many lodash methods are guarded to work as interatees for methods like
+ * Many lodash methods are guarded to work as iteratees for methods like
* `_.reduce`, `_.reduceRight`, and `_.transform`.
*
* The guarded methods are:
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/sample.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/sample.js
index f090db107db..8e015330162 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/sample.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/sample.js
@@ -1,6 +1,6 @@
var baseRandom = require('../internal/baseRandom'),
isIterateeCall = require('../internal/isIterateeCall'),
- shuffle = require('./shuffle'),
+ toArray = require('../lang/toArray'),
toIterable = require('../internal/toIterable');
/* Native method references for those with the same name as other `lodash` methods. */
@@ -30,8 +30,20 @@ function sample(collection, n, guard) {
var length = collection.length;
return length > 0 ? collection[baseRandom(0, length - 1)] : undefined;
}
- var result = shuffle(collection);
- result.length = nativeMin(n < 0 ? 0 : (+n || 0), result.length);
+ var index = -1,
+ result = toArray(collection),
+ length = result.length,
+ lastIndex = length - 1;
+
+ n = nativeMin(n < 0 ? 0 : (+n || 0), length);
+ while (++index < n) {
+ var rand = baseRandom(index, lastIndex),
+ value = result[rand];
+
+ result[rand] = result[index];
+ result[index] = value;
+ }
+ result.length = n;
return result;
}
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/shuffle.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/shuffle.js
index 2281d4f65b2..949689c5fc7 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/shuffle.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/shuffle.js
@@ -1,5 +1,7 @@
-var baseRandom = require('../internal/baseRandom'),
- toIterable = require('../internal/toIterable');
+var sample = require('./sample');
+
+/** Used as references for `-Infinity` and `Infinity`. */
+var POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
/**
* Creates an array of shuffled values, using a version of the
@@ -16,20 +18,7 @@ var baseRandom = require('../internal/baseRandom'),
* // => [4, 1, 3, 2]
*/
function shuffle(collection) {
- collection = toIterable(collection);
-
- var index = -1,
- length = collection.length,
- result = Array(length);
-
- while (++index < length) {
- var rand = baseRandom(0, index);
- if (index != rand) {
- result[index] = result[rand];
- }
- result[rand] = collection[index];
- }
- return result;
+ return sample(collection, POSITIVE_INFINITY);
}
module.exports = shuffle;
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/date/now.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/date/now.js
index 628225d2a00..ffe3060e5b9 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/date/now.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/date/now.js
@@ -1,7 +1,7 @@
-var isNative = require('../lang/isNative');
+var getNative = require('../internal/getNative');
/* Native method references for those with the same name as other `lodash` methods. */
-var nativeNow = isNative(nativeNow = Date.now) && nativeNow;
+var nativeNow = getNative(Date, 'now');
/**
* Gets the number of milliseconds that have elapsed since the Unix epoch
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/debounce.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/debounce.js
index 5fdf7fce66f..5df81e71a60 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/debounce.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/debounce.js
@@ -8,12 +8,13 @@ var FUNC_ERROR_TEXT = 'Expected a function';
var nativeMax = Math.max;
/**
- * Creates a function that delays invoking `func` until after `wait` milliseconds
- * have elapsed since the last time it was invoked. The created function comes
- * with a `cancel` method to cancel delayed invocations. Provide an options
- * object to indicate that `func` should be invoked on the leading and/or
- * trailing edge of the `wait` timeout. Subsequent calls to the debounced
- * function return the result of the last `func` invocation.
+ * Creates a debounced function that delays invoking `func` until after `wait`
+ * milliseconds have elapsed since the last time the debounced function was
+ * invoked. The debounced function comes with a `cancel` method to cancel
+ * delayed invocations. Provide an options object to indicate that `func`
+ * should be invoked on the leading and/or trailing edge of the `wait` timeout.
+ * Subsequent calls to the debounced function return the result of the last
+ * `func` invocation.
*
* **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
* on the trailing edge of the timeout only if the the debounced function is
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/memoize.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/memoize.js
index c9de9897cfb..1088e4be656 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/memoize.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/memoize.js
@@ -60,14 +60,14 @@ function memoize(func, resolver) {
}
var memoized = function() {
var args = arguments,
- cache = memoized.cache,
- key = resolver ? resolver.apply(this, args) : args[0];
+ key = resolver ? resolver.apply(this, args) : args[0],
+ cache = memoized.cache;
if (cache.has(key)) {
return cache.get(key);
}
var result = func.apply(this, args);
- cache.set(key, result);
+ memoized.cache = cache.set(key, result);
return result;
};
memoized.cache = new memoize.Cache;
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/throttle.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/throttle.js
index 7c30e646bff..5e8f0ef5611 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/throttle.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/throttle.js
@@ -12,12 +12,12 @@ var debounceOptions = {
};
/**
- * Creates a function that only invokes `func` at most once per every `wait`
- * milliseconds. The created function comes with a `cancel` method to cancel
- * delayed invocations. Provide an options object to indicate that `func`
- * should be invoked on the leading and/or trailing edge of the `wait` timeout.
- * Subsequent calls to the throttled function return the result of the last
- * `func` call.
+ * Creates a throttled function that only invokes `func` at most once per
+ * every `wait` milliseconds. The throttled function comes with a `cancel`
+ * method to cancel delayed invocations. Provide an options object to indicate
+ * that `func` should be invoked on the leading and/or trailing edge of the
+ * `wait` timeout. Subsequent calls to the throttled function return the
+ * result of the last `func` call.
*
* **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
* on the trailing edge of the timeout only if the the throttled function is
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/index.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/index.js
index f52debbedde..deb66539d44 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/index.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/index.js
@@ -1,6 +1,6 @@
/**
* @license
- * lodash 3.8.0 (Custom Build) <https://lodash.com/>
+ * lodash 3.9.3 (Custom Build) <https://lodash.com/>
* Build: `lodash modern -d -o ./index.js`
* Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
@@ -13,7 +13,7 @@
var undefined;
/** Used as the semantic version number. */
- var VERSION = '3.8.0';
+ var VERSION = '3.9.3';
/** Used to compose bitmasks for wrapper metadata. */
var BIND_FLAG = 1,
@@ -118,6 +118,9 @@
/** Used to detect host constructors (Safari > 5). */
var reIsHostCtor = /^\[object .+?Constructor\]$/;
+ /** Used to detect unsigned integer values. */
+ var reIsUint = /^\d+$/;
+
/** Used to match latin-1 supplementary letters (excluding mathematical operators). */
var reLatin1 = /[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g;
@@ -152,9 +155,8 @@
'Array', 'ArrayBuffer', 'Date', 'Error', 'Float32Array', 'Float64Array',
'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Math', 'Number',
'Object', 'RegExp', 'Set', 'String', '_', 'clearTimeout', 'document',
- 'isFinite', 'parseInt', 'setTimeout', 'TypeError', 'Uint8Array',
- 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
- 'window'
+ 'isFinite', 'parseFloat', 'parseInt', 'setTimeout', 'TypeError', 'Uint8Array',
+ 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', 'window'
];
/** Used to make template sourceURLs easier to identify. */
@@ -275,29 +277,40 @@
/**
* Used as a reference to the global object.
*
- * The `this` value is used if it is the global object to avoid Greasemonkey's
+ * The `this` value is used if it's the global object to avoid Greasemonkey's
* restricted `window` object, otherwise the `window` object is used.
*/
var root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;
+ /*--------------------------------------------------------------------------*/
+
/**
* The base implementation of `compareAscending` which compares values and
* sorts them in ascending order without guaranteeing a stable sort.
*
* @private
- * @param {*} value The value to compare to `other`.
- * @param {*} other The value to compare to `value`.
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
* @returns {number} Returns the sort order indicator for `value`.
*/
function baseCompareAscending(value, other) {
if (value !== other) {
- var valIsReflexive = value === value,
+ var valIsNull = value === null,
+ valIsUndef = value === undefined,
+ valIsReflexive = value === value;
+
+ var othIsNull = other === null,
+ othIsUndef = other === undefined,
othIsReflexive = other === other;
- if (value > other || !valIsReflexive || (value === undefined && othIsReflexive)) {
+ if ((value > other && !othIsNull) || !valIsReflexive ||
+ (valIsNull && !othIsUndef && othIsReflexive) ||
+ (valIsUndef && othIsReflexive)) {
return 1;
}
- if (value < other || !othIsReflexive || (other === undefined && valIsReflexive)) {
+ if ((value < other && !valIsNull) || !othIsReflexive ||
+ (othIsNull && !valIsUndef && valIsReflexive) ||
+ (othIsUndef && valIsReflexive)) {
return -1;
}
}
@@ -365,7 +378,7 @@
}
/**
- * Converts `value` to a string if it is not one. An empty string is returned
+ * Converts `value` to a string if it's not one. An empty string is returned
* for `null` or `undefined` values.
*
* @private
@@ -380,17 +393,6 @@
}
/**
- * Used by `_.max` and `_.min` as the default callback for string values.
- *
- * @private
- * @param {string} string The string to inspect.
- * @returns {number} Returns the code unit of the first character of the string.
- */
- function charAtCallback(string) {
- return string.charCodeAt(0);
- }
-
- /**
* Used by `_.trim` and `_.trimLeft` to get the index of the first character
* of `string` that is not found in `chars`.
*
@@ -650,6 +652,8 @@
return htmlUnescapes[chr];
}
+ /*--------------------------------------------------------------------------*/
+
/**
* Create a new pristine `lodash` function using the given `context` object.
*
@@ -710,7 +714,7 @@
stringProto = String.prototype;
/** Used to detect DOM support. */
- var document = (document = context.window) && document.document;
+ var document = (document = context.window) ? document.document : null;
/** Used to resolve the decompiled source of functions. */
var fnToString = Function.prototype.toString;
@@ -732,26 +736,24 @@
/** Used to detect if a method is native. */
var reIsNative = RegExp('^' +
- escapeRegExp(objToString)
- .replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
+ escapeRegExp(fnToString.call(hasOwnProperty))
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
);
/** Native method references. */
- var ArrayBuffer = isNative(ArrayBuffer = context.ArrayBuffer) && ArrayBuffer,
- bufferSlice = isNative(bufferSlice = ArrayBuffer && new ArrayBuffer(0).slice) && bufferSlice,
+ var ArrayBuffer = getNative(context, 'ArrayBuffer'),
+ bufferSlice = getNative(ArrayBuffer && new ArrayBuffer(0), 'slice'),
ceil = Math.ceil,
clearTimeout = context.clearTimeout,
floor = Math.floor,
- getOwnPropertySymbols = isNative(getOwnPropertySymbols = Object.getOwnPropertySymbols) && getOwnPropertySymbols,
- getPrototypeOf = isNative(getPrototypeOf = Object.getPrototypeOf) && getPrototypeOf,
+ getPrototypeOf = getNative(Object, 'getPrototypeOf'),
+ parseFloat = context.parseFloat,
push = arrayProto.push,
- preventExtensions = isNative(preventExtensions = Object.preventExtensions) && preventExtensions,
- propertyIsEnumerable = objectProto.propertyIsEnumerable,
- Set = isNative(Set = context.Set) && Set,
+ Set = getNative(context, 'Set'),
setTimeout = context.setTimeout,
splice = arrayProto.splice,
- Uint8Array = isNative(Uint8Array = context.Uint8Array) && Uint8Array,
- WeakMap = isNative(WeakMap = context.WeakMap) && WeakMap;
+ Uint8Array = getNative(context, 'Uint8Array'),
+ WeakMap = getNative(context, 'WeakMap');
/** Used to clone array buffers. */
var Float64Array = (function() {
@@ -759,44 +761,21 @@
// where the array buffer's `byteLength` is not a multiple of the typed
// array's `BYTES_PER_ELEMENT`.
try {
- var func = isNative(func = context.Float64Array) && func,
+ var func = getNative(context, 'Float64Array'),
result = new func(new ArrayBuffer(10), 0, 1) && func;
} catch(e) {}
- return result;
- }());
-
- /** Used as `baseAssign`. */
- var nativeAssign = (function() {
- // Avoid `Object.assign` in Firefox 34-37 which have an early implementation
- // with a now defunct try/catch behavior. See https://bugzilla.mozilla.org/show_bug.cgi?id=1103344
- // for more details.
- //
- // Use `Object.preventExtensions` on a plain object instead of simply using
- // `Object('x')` because Chrome and IE fail to throw an error when attempting
- // to assign values to readonly indexes of strings.
- var func = preventExtensions && isNative(func = Object.assign) && func;
- try {
- if (func) {
- var object = preventExtensions({ '1': 0 });
- object[0] = 1;
- }
- } catch(e) {
- // Only attempt in strict mode.
- try { func(object, 'xo'); } catch(e) {}
- return !object[1] && func;
- }
- return false;
+ return result || null;
}());
/* Native method references for those with the same name as other `lodash` methods. */
- var nativeIsArray = isNative(nativeIsArray = Array.isArray) && nativeIsArray,
- nativeCreate = isNative(nativeCreate = Object.create) && nativeCreate,
+ var nativeCreate = getNative(Object, 'create'),
+ nativeIsArray = getNative(Array, 'isArray'),
nativeIsFinite = context.isFinite,
- nativeKeys = isNative(nativeKeys = Object.keys) && nativeKeys,
+ nativeKeys = getNative(Object, 'keys'),
nativeMax = Math.max,
nativeMin = Math.min,
- nativeNow = isNative(nativeNow = Date.now) && nativeNow,
- nativeNumIsFinite = isNative(nativeNumIsFinite = Number.isFinite) && nativeNumIsFinite,
+ nativeNow = getNative(Date, 'now'),
+ nativeNumIsFinite = getNative(Number, 'isFinite'),
nativeParseInt = context.parseInt,
nativeRandom = Math.random;
@@ -805,7 +784,7 @@
POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
/** Used as references for the maximum length and index of an array. */
- var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1,
+ var MAX_ARRAY_LENGTH = 4294967295,
MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
@@ -816,7 +795,7 @@
* Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer)
* of an array-like value.
*/
- var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1;
+ var MAX_SAFE_INTEGER = 9007199254740991;
/** Used to store function metadata. */
var metaMap = WeakMap && new WeakMap;
@@ -824,6 +803,8 @@
/** Used to lookup unminified function names. */
var realNames = {};
+ /*------------------------------------------------------------------------*/
+
/**
* Creates a `lodash` object which wraps `value` to enable implicit chaining.
* Methods that operate on and return arrays, collections, and functions can
@@ -863,30 +844,31 @@
* `filter`, `flatten`, `flattenDeep`, `flow`, `flowRight`, `forEach`,
* `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `functions`,
* `groupBy`, `indexBy`, `initial`, `intersection`, `invert`, `invoke`, `keys`,
- * `keysIn`, `map`, `mapValues`, `matches`, `matchesProperty`, `memoize`,
- * `merge`, `mixin`, `negate`, `omit`, `once`, `pairs`, `partial`, `partialRight`,
- * `partition`, `pick`, `plant`, `pluck`, `property`, `propertyOf`, `pull`,
- * `pullAt`, `push`, `range`, `rearg`, `reject`, `remove`, `rest`, `reverse`,
- * `shuffle`, `slice`, `sort`, `sortBy`, `sortByAll`, `sortByOrder`, `splice`,
- * `spread`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `tap`,
- * `throttle`, `thru`, `times`, `toArray`, `toPlainObject`, `transform`,
- * `union`, `uniq`, `unshift`, `unzip`, `values`, `valuesIn`, `where`,
- * `without`, `wrap`, `xor`, `zip`, and `zipObject`
+ * `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
+ * `memoize`, `merge`, `method`, `methodOf`, `mixin`, `negate`, `omit`, `once`,
+ * `pairs`, `partial`, `partialRight`, `partition`, `pick`, `plant`, `pluck`,
+ * `property`, `propertyOf`, `pull`, `pullAt`, `push`, `range`, `rearg`,
+ * `reject`, `remove`, `rest`, `restParam`, `reverse`, `set`, `shuffle`,
+ * `slice`, `sort`, `sortBy`, `sortByAll`, `sortByOrder`, `splice`, `spread`,
+ * `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `tap`, `throttle`,
+ * `thru`, `times`, `toArray`, `toPlainObject`, `transform`, `union`, `uniq`,
+ * `unshift`, `unzip`, `unzipWith`, `values`, `valuesIn`, `where`, `without`,
+ * `wrap`, `xor`, `zip`, `zipObject`, `zipWith`
*
* The wrapper methods that are **not** chainable by default are:
* `add`, `attempt`, `camelCase`, `capitalize`, `clone`, `cloneDeep`, `deburr`,
* `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`,
- * `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`, `has`,
- * `identity`, `includes`, `indexOf`, `inRange`, `isArguments`, `isArray`,
- * `isBoolean`, `isDate`, `isElement`, `isEmpty`, `isEqual`, `isError`, `isFinite`
- * `isFunction`, `isMatch`, `isNative`, `isNaN`, `isNull`, `isNumber`, `isObject`,
- * `isPlainObject`, `isRegExp`, `isString`, `isUndefined`, `isTypedArray`,
- * `join`, `kebabCase`, `last`, `lastIndexOf`, `max`, `min`, `noConflict`,
- * `noop`, `now`, `pad`, `padLeft`, `padRight`, `parseInt`, `pop`, `random`,
- * `reduce`, `reduceRight`, `repeat`, `result`, `runInContext`, `shift`, `size`,
- * `snakeCase`, `some`, `sortedIndex`, `sortedLastIndex`, `startCase`, `startsWith`,
- * `sum`, `template`, `trim`, `trimLeft`, `trimRight`, `trunc`, `unescape`,
- * `uniqueId`, `value`, and `words`
+ * `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`, `get`,
+ * `gt`, `gte`, `has`, `identity`, `includes`, `indexOf`, `inRange`, `isArguments`,
+ * `isArray`, `isBoolean`, `isDate`, `isElement`, `isEmpty`, `isEqual`, `isError`,
+ * `isFinite` `isFunction`, `isMatch`, `isNative`, `isNaN`, `isNull`, `isNumber`,
+ * `isObject`, `isPlainObject`, `isRegExp`, `isString`, `isUndefined`,
+ * `isTypedArray`, `join`, `kebabCase`, `last`, `lastIndexOf`, `lt`, `lte`,
+ * `max`, `min`, `noConflict`, `noop`, `now`, `pad`, `padLeft`, `padRight`,
+ * `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`,
+ * `runInContext`, `shift`, `size`, `snakeCase`, `some`, `sortedIndex`,
+ * `sortedLastIndex`, `startCase`, `startsWith`, `sum`, `template`, `trim`,
+ * `trimLeft`, `trimRight`, `trunc`, `unescape`, `uniqueId`, `value`, and `words`
*
* The wrapper method `sample` will return a wrapped value when `n` is provided,
* otherwise an unwrapped value is returned.
@@ -963,7 +945,6 @@
(function(x) {
var Ctor = function() { this.x = x; },
- args = arguments,
object = { '0': x, 'length': x },
props = [];
@@ -971,24 +952,6 @@
for (var key in new Ctor) { props.push(key); }
/**
- * Detect if functions can be decompiled by `Function#toString`
- * (all but Firefox OS certified apps, older Opera mobile browsers, and
- * the PlayStation 3; forced `false` for Windows 8 apps).
- *
- * @memberOf _.support
- * @type boolean
- */
- support.funcDecomp = /\bthis\b/.test(function() { return this; });
-
- /**
- * Detect if `Function#name` is supported (all but IE).
- *
- * @memberOf _.support
- * @type boolean
- */
- support.funcNames = typeof Function.name == 'string';
-
- /**
* Detect if the DOM is supported.
*
* @memberOf _.support
@@ -999,24 +962,6 @@
} catch(e) {
support.dom = false;
}
-
- /**
- * Detect if `arguments` object indexes are non-enumerable.
- *
- * In Firefox < 4, IE < 9, PhantomJS, and Safari < 5.1 `arguments` object
- * indexes are non-enumerable. Chrome < 25 and Node.js < 0.11.0 treat
- * `arguments` object indexes as non-enumerable and fail `hasOwnProperty`
- * checks for indexes that exceed the number of function parameters and
- * whose associated argument values are `0`.
- *
- * @memberOf _.support
- * @type boolean
- */
- try {
- support.nonEnumArgs = !propertyIsEnumerable.call(args, 1);
- } catch(e) {
- support.nonEnumArgs = true;
- }
}(1, 0));
/**
@@ -1080,6 +1025,8 @@
}
};
+ /*------------------------------------------------------------------------*/
+
/**
* Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
*
@@ -1208,6 +1155,8 @@
return result;
}
+ /*------------------------------------------------------------------------*/
+
/**
* Creates a cache object to store key/value pairs.
*
@@ -1276,6 +1225,8 @@
return this;
}
+ /*------------------------------------------------------------------------*/
+
/**
*
* Creates a cache object to store unique values.
@@ -1325,6 +1276,8 @@
}
}
+ /*------------------------------------------------------------------------*/
+
/**
* Copies the values of `source` to `array`.
*
@@ -1408,6 +1361,35 @@
}
/**
+ * A specialized version of `baseExtremum` for arrays which invokes `iteratee`
+ * with one argument: (value).
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {Function} comparator The function used to compare values.
+ * @param {*} exValue The initial extremum value.
+ * @returns {*} Returns the extremum value.
+ */
+ function arrayExtremum(array, iteratee, comparator, exValue) {
+ var index = -1,
+ length = array.length,
+ computed = exValue,
+ result = computed;
+
+ while (++index < length) {
+ var value = array[index],
+ current = +iteratee(value);
+
+ if (comparator(current, computed)) {
+ computed = current;
+ result = value;
+ }
+ }
+ return result;
+ }
+
+ /**
* A specialized version of `_.filter` for arrays without support for callback
* shorthands and `this` binding.
*
@@ -1452,48 +1434,6 @@
}
/**
- * A specialized version of `_.max` for arrays without support for iteratees.
- *
- * @private
- * @param {Array} array The array to iterate over.
- * @returns {*} Returns the maximum value.
- */
- function arrayMax(array) {
- var index = -1,
- length = array.length,
- result = NEGATIVE_INFINITY;
-
- while (++index < length) {
- var value = array[index];
- if (value > result) {
- result = value;
- }
- }
- return result;
- }
-
- /**
- * A specialized version of `_.min` for arrays without support for iteratees.
- *
- * @private
- * @param {Array} array The array to iterate over.
- * @returns {*} Returns the minimum value.
- */
- function arrayMin(array) {
- var index = -1,
- length = array.length,
- result = POSITIVE_INFINITY;
-
- while (++index < length) {
- var value = array[index];
- if (value < result) {
- result = value;
- }
- }
- return result;
- }
-
- /**
* A specialized version of `_.reduce` for arrays without support for callback
* shorthands and `this` binding.
*
@@ -1623,10 +1563,8 @@
* @returns {Object} Returns `object`.
*/
function assignWith(object, source, customizer) {
- var props = keys(source);
- push.apply(props, getSymbols(source));
-
var index = -1,
+ props = keys(source),
length = props.length;
while (++index < length) {
@@ -1651,11 +1589,11 @@
* @param {Object} source The source object.
* @returns {Object} Returns `object`.
*/
- var baseAssign = nativeAssign || function(object, source) {
+ function baseAssign(object, source) {
return source == null
? object
- : baseCopy(source, getSymbols(source), baseCopy(source, keys(source), object));
- };
+ : baseCopy(source, keys(source), object);
+ }
/**
* The base implementation of `_.at` without support for string collections
@@ -1670,7 +1608,7 @@
var index = -1,
isNil = collection == null,
isArr = !isNil && isArrayLike(collection),
- length = isArr && collection.length,
+ length = isArr ? collection.length : 0,
propsLength = props.length,
result = Array(propsLength);
@@ -1811,14 +1749,14 @@
* @returns {Object} Returns the new object.
*/
var baseCreate = (function() {
- function Object() {}
+ function object() {}
return function(prototype) {
if (isObject(prototype)) {
- Object.prototype = prototype;
- var result = new Object;
- Object.prototype = null;
+ object.prototype = prototype;
+ var result = new object;
+ object.prototype = null;
}
- return result || context.Object();
+ return result || {};
};
}());
@@ -1928,6 +1866,32 @@
}
/**
+ * Gets the extremum value of `collection` invoking `iteratee` for each value
+ * in `collection` to generate the criterion by which the value is ranked.
+ * The `iteratee` is invoked with three arguments: (value, index|key, collection).
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {Function} comparator The function used to compare values.
+ * @param {*} exValue The initial extremum value.
+ * @returns {*} Returns the extremum value.
+ */
+ function baseExtremum(collection, iteratee, comparator, exValue) {
+ var computed = exValue,
+ result = computed;
+
+ baseEach(collection, function(value, index, collection) {
+ var current = +iteratee(value, index, collection);
+ if (comparator(current, computed) || (current === exValue && current === result)) {
+ computed = current;
+ result = value;
+ }
+ });
+ return result;
+ }
+
+ /**
* The base implementation of `_.fill` without an iteratee call guard.
*
* @private
@@ -2143,11 +2107,11 @@
if (pathKey !== undefined && pathKey in toObject(object)) {
path = [pathKey];
}
- var index = -1,
+ var index = 0,
length = path.length;
- while (object != null && ++index < length) {
- object = object[path[index]];
+ while (object != null && index < length) {
+ object = object[path[index++]];
}
return (index && index == length) ? object : undefined;
}
@@ -2166,17 +2130,10 @@
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
*/
function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) {
- // Exit early for identical values.
if (value === other) {
return true;
}
- var valType = typeof value,
- othType = typeof other;
-
- // Exit early for unlike primitive values.
- if ((valType != 'function' && valType != 'object' && othType != 'function' && othType != 'object') ||
- value == null || other == null) {
- // Return `false` unless both values are `NaN`.
+ if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {
return value !== value && other !== other;
}
return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB);
@@ -2227,11 +2184,11 @@
return equalByTag(object, other, objTag);
}
if (!isLoose) {
- var valWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
- othWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
+ var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
+ othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
- if (valWrapped || othWrapped) {
- return equalFunc(valWrapped ? object.value() : object, othWrapped ? other.value() : other, customizer, isLoose, stackA, stackB);
+ if (objIsWrapped || othIsWrapped) {
+ return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, isLoose, stackA, stackB);
}
}
if (!isSameTag) {
@@ -2266,42 +2223,44 @@
*
* @private
* @param {Object} object The object to inspect.
- * @param {Array} props The source property names to match.
- * @param {Array} values The source values to match.
- * @param {Array} strictCompareFlags Strict comparison flags for source values.
+ * @param {Array} matchData The propery names, values, and compare flags to match.
* @param {Function} [customizer] The function to customize comparing objects.
* @returns {boolean} Returns `true` if `object` is a match, else `false`.
*/
- function baseIsMatch(object, props, values, strictCompareFlags, customizer) {
- var index = -1,
- length = props.length,
+ function baseIsMatch(object, matchData, customizer) {
+ var index = matchData.length,
+ length = index,
noCustomizer = !customizer;
- while (++index < length) {
- if ((noCustomizer && strictCompareFlags[index])
- ? values[index] !== object[props[index]]
- : !(props[index] in object)
+ if (object == null) {
+ return !length;
+ }
+ object = toObject(object);
+ while (index--) {
+ var data = matchData[index];
+ if ((noCustomizer && data[2])
+ ? data[1] !== object[data[0]]
+ : !(data[0] in object)
) {
return false;
}
}
- index = -1;
while (++index < length) {
- var key = props[index],
+ data = matchData[index];
+ var key = data[0],
objValue = object[key],
- srcValue = values[index];
+ srcValue = data[1];
- if (noCustomizer && strictCompareFlags[index]) {
- var result = objValue !== undefined || (key in object);
+ if (noCustomizer && data[2]) {
+ if (objValue === undefined && !(key in object)) {
+ return false;
+ }
} else {
- result = customizer ? customizer(objValue, srcValue, key) : undefined;
- if (result === undefined) {
- result = baseIsEqual(srcValue, objValue, customizer, true);
+ var result = customizer ? customizer(objValue, srcValue, key) : undefined;
+ if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, true) : result)) {
+ return false;
}
}
- if (!result) {
- return false;
- }
}
return true;
}
@@ -2333,50 +2292,34 @@
* @returns {Function} Returns the new function.
*/
function baseMatches(source) {
- var props = keys(source),
- length = props.length;
+ var matchData = getMatchData(source);
+ if (matchData.length == 1 && matchData[0][2]) {
+ var key = matchData[0][0],
+ value = matchData[0][1];
- if (!length) {
- return constant(true);
- }
- if (length == 1) {
- var key = props[0],
- value = source[key];
-
- if (isStrictComparable(value)) {
- return function(object) {
- if (object == null) {
- return false;
- }
- return object[key] === value && (value !== undefined || (key in toObject(object)));
- };
- }
- }
- var values = Array(length),
- strictCompareFlags = Array(length);
-
- while (length--) {
- value = source[props[length]];
- values[length] = value;
- strictCompareFlags[length] = isStrictComparable(value);
+ return function(object) {
+ if (object == null) {
+ return false;
+ }
+ return object[key] === value && (value !== undefined || (key in toObject(object)));
+ };
}
return function(object) {
- return object != null && baseIsMatch(toObject(object), props, values, strictCompareFlags);
+ return baseIsMatch(object, matchData);
};
}
/**
- * The base implementation of `_.matchesProperty` which does not which does
- * not clone `value`.
+ * The base implementation of `_.matchesProperty` which does not clone `srcValue`.
*
* @private
* @param {string} path The path of the property to get.
- * @param {*} value The value to compare.
+ * @param {*} srcValue The value to compare.
* @returns {Function} Returns the new function.
*/
- function baseMatchesProperty(path, value) {
+ function baseMatchesProperty(path, srcValue) {
var isArr = isArray(path),
- isCommon = isKey(path) && isStrictComparable(value),
+ isCommon = isKey(path) && isStrictComparable(srcValue),
pathKey = (path + '');
path = toPath(path);
@@ -2394,9 +2337,9 @@
key = last(path);
object = toObject(object);
}
- return object[key] === value
- ? (value !== undefined || (key in object))
- : baseIsEqual(value, object[key], null, true);
+ return object[key] === srcValue
+ ? (srcValue !== undefined || (key in object))
+ : baseIsEqual(srcValue, object[key], undefined, true);
};
}
@@ -2416,11 +2359,9 @@
if (!isObject(object)) {
return object;
}
- var isSrcArr = isArrayLike(source) && (isArray(source) || isTypedArray(source));
- if (!isSrcArr) {
- var props = keys(source);
- push.apply(props, getSymbols(source));
- }
+ var isSrcArr = isArrayLike(source) && (isArray(source) || isTypedArray(source)),
+ props = isSrcArr ? null : keys(source);
+
arrayEach(props || source, function(srcValue, key) {
if (props) {
key = srcValue;
@@ -2439,7 +2380,7 @@
if (isCommon) {
result = srcValue;
}
- if ((isSrcArr || result !== undefined) &&
+ if ((result !== undefined || (isSrcArr && !(key in object))) &&
(isCommon || (result === result ? (result !== value) : (value === value)))) {
object[key] = result;
}
@@ -2546,7 +2487,7 @@
function basePullAt(array, indexes) {
var length = array ? indexes.length : 0;
while (length--) {
- var index = parseFloat(indexes[length]);
+ var index = indexes[length];
if (index != previous && isIndex(index)) {
var previous = index;
splice.call(array, index, 1);
@@ -2859,7 +2800,7 @@
var mid = (low + high) >>> 1,
computed = array[mid];
- if (retHighest ? (computed <= value) : (computed < value)) {
+ if ((retHighest ? (computed <= value) : (computed < value)) && computed !== null) {
low = mid + 1;
} else {
high = mid;
@@ -2889,17 +2830,23 @@
var low = 0,
high = array ? array.length : 0,
valIsNaN = value !== value,
+ valIsNull = value === null,
valIsUndef = value === undefined;
while (low < high) {
var mid = floor((low + high) / 2),
computed = iteratee(array[mid]),
+ isDef = computed !== undefined,
isReflexive = computed === computed;
if (valIsNaN) {
var setLow = isReflexive || retHighest;
+ } else if (valIsNull) {
+ setLow = isReflexive && isDef && (retHighest || computed != null);
} else if (valIsUndef) {
- setLow = isReflexive && (retHighest || computed !== undefined);
+ setLow = isReflexive && (retHighest || isDef);
+ } else if (computed == null) {
+ setLow = false;
} else {
setLow = retHighest ? (computed <= value) : (computed < value);
}
@@ -3089,19 +3036,19 @@
return restParam(function(object, sources) {
var index = -1,
length = object == null ? 0 : sources.length,
- customizer = length > 2 && sources[length - 2],
- guard = length > 2 && sources[2],
- thisArg = length > 1 && sources[length - 1];
+ customizer = length > 2 ? sources[length - 2] : undefined,
+ guard = length > 2 ? sources[2] : undefined,
+ thisArg = length > 1 ? sources[length - 1] : undefined;
if (typeof customizer == 'function') {
customizer = bindCallback(customizer, thisArg, 5);
length -= 2;
} else {
- customizer = typeof thisArg == 'function' ? thisArg : null;
+ customizer = typeof thisArg == 'function' ? thisArg : undefined;
length -= (customizer ? 1 : 0);
}
if (guard && isIterateeCall(sources[0], sources[1], guard)) {
- customizer = length < 3 ? null : customizer;
+ customizer = length < 3 ? undefined : customizer;
length = 1;
}
while (++index < length) {
@@ -3226,8 +3173,20 @@
*/
function createCtorWrapper(Ctor) {
return function() {
+ // Use a `switch` statement to work with class constructors.
+ // See https://people.mozilla.org/~jorendorff/es6-draft.html#sec-ecmascript-function-objects-call-thisargument-argumentslist
+ // for more details.
+ var args = arguments;
+ switch (args.length) {
+ case 0: return new Ctor;
+ case 1: return new Ctor(args[0]);
+ case 2: return new Ctor(args[0], args[1]);
+ case 3: return new Ctor(args[0], args[1], args[2]);
+ case 4: return new Ctor(args[0], args[1], args[2], args[3]);
+ case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
+ }
var thisBinding = baseCreate(Ctor.prototype),
- result = Ctor.apply(thisBinding, arguments);
+ result = Ctor.apply(thisBinding, args);
// Mimic the constructor's `return` behavior.
// See https://es5.github.io/#x13.2.2 for more details.
@@ -3258,32 +3217,24 @@
* Creates a `_.max` or `_.min` function.
*
* @private
- * @param {Function} arrayFunc The function to get the extremum value from an array.
- * @param {boolean} [isMin] Specify returning the minimum, instead of the maximum,
- * extremum value.
+ * @param {Function} comparator The function used to compare values.
+ * @param {*} exValue The initial extremum value.
* @returns {Function} Returns the new extremum function.
*/
- function createExtremum(arrayFunc, isMin) {
+ function createExtremum(comparator, exValue) {
return function(collection, iteratee, thisArg) {
if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
iteratee = null;
}
- var func = getCallback(),
- noIteratee = iteratee == null;
-
- if (!(func === baseCallback && noIteratee)) {
- noIteratee = false;
- iteratee = func(iteratee, thisArg, 3);
- }
- if (noIteratee) {
- var isArr = isArray(collection);
- if (!isArr && isString(collection)) {
- iteratee = charAtCallback;
- } else {
- return arrayFunc(isArr ? collection : toIterable(collection));
+ iteratee = getCallback(iteratee, thisArg, 3);
+ if (iteratee.length == 1) {
+ collection = toIterable(collection);
+ var result = arrayExtremum(collection, iteratee, comparator, exValue);
+ if (!(collection.length && result === exValue)) {
+ return result;
}
}
- return extremumBy(collection, iteratee, isMin);
+ return baseExtremum(collection, iteratee, comparator, exValue);
};
}
@@ -3346,11 +3297,8 @@
*/
function createFlow(fromRight) {
return function() {
- var length = arguments.length;
- if (!length) {
- return function() { return arguments[0]; };
- }
var wrapper,
+ length = arguments.length,
index = fromRight ? length : -1,
leftIndex = 0,
funcs = Array(length);
@@ -3360,15 +3308,17 @@
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
- var funcName = wrapper ? '' : getFuncName(func);
- wrapper = funcName == 'wrapper' ? new LodashWrapper([]) : wrapper;
+ if (!wrapper && LodashWrapper.prototype.thru && getFuncName(func) == 'wrapper') {
+ wrapper = new LodashWrapper([]);
+ }
}
index = wrapper ? -1 : length;
while (++index < length) {
func = funcs[index];
- funcName = getFuncName(func);
- var data = funcName == 'wrapper' ? getData(func) : null;
+ var funcName = getFuncName(func),
+ data = funcName == 'wrapper' ? getData(func) : null;
+
if (data && isLaziable(data[0]) && data[1] == (ARY_FLAG | CURRY_FLAG | PARTIAL_FLAG | REARG_FLAG) && !data[4].length && data[9] == 1) {
wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
} else {
@@ -3381,7 +3331,7 @@
return wrapper.plant(args[0]).value();
}
var index = 0,
- result = funcs[index].apply(this, args);
+ result = length ? funcs[index].apply(this, args) : args[0];
while (++index < length) {
result = funcs[index].call(this, result);
@@ -3530,10 +3480,8 @@
isBindKey = bitmask & BIND_KEY_FLAG,
isCurry = bitmask & CURRY_FLAG,
isCurryBound = bitmask & CURRY_BOUND_FLAG,
- isCurryRight = bitmask & CURRY_RIGHT_FLAG;
-
- var Ctor = !isBindKey && createCtorWrapper(func),
- key = func;
+ isCurryRight = bitmask & CURRY_RIGHT_FLAG,
+ Ctor = isBindKey ? null : createCtorWrapper(func);
function wrapper() {
// Avoid `arguments` object use disqualifying optimizations by
@@ -3580,17 +3528,18 @@
return result;
}
}
- var thisBinding = isBind ? thisArg : this;
- if (isBindKey) {
- func = thisBinding[key];
- }
+ var thisBinding = isBind ? thisArg : this,
+ fn = isBindKey ? thisBinding[func] : func;
+
if (argPos) {
args = reorder(args, argPos);
}
if (isAry && ary < args.length) {
args.length = ary;
}
- var fn = (this && this !== root && this instanceof wrapper) ? (Ctor || createCtorWrapper(func)) : func;
+ if (this && this !== root && this instanceof wrapper) {
+ fn = Ctor || createCtorWrapper(func);
+ }
return fn.apply(thisBinding, args);
}
return wrapper;
@@ -3664,10 +3613,10 @@
*/
function createSortedIndex(retHighest) {
return function(array, value, iteratee, thisArg) {
- var func = getCallback(iteratee);
- return (func === baseCallback && iteratee == null)
+ var callback = getCallback(iteratee);
+ return (iteratee == null && callback === baseCallback)
? binaryIndex(array, value, retHighest)
- : binaryIndexBy(array, value, func(iteratee, thisArg, 1), retHighest);
+ : binaryIndexBy(array, value, callback(iteratee, thisArg, 1), retHighest);
};
}
@@ -3753,40 +3702,35 @@
function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) {
var index = -1,
arrLength = array.length,
- othLength = other.length,
- result = true;
+ othLength = other.length;
if (arrLength != othLength && !(isLoose && othLength > arrLength)) {
return false;
}
- // Deep compare the contents, ignoring non-numeric properties.
- while (result && ++index < arrLength) {
+ // Ignore non-index properties.
+ while (++index < arrLength) {
var arrValue = array[index],
- othValue = other[index];
-
- result = undefined;
- if (customizer) {
- result = isLoose
- ? customizer(othValue, arrValue, index)
- : customizer(arrValue, othValue, index);
- }
- if (result === undefined) {
- // Recursively compare arrays (susceptible to call stack limits).
- if (isLoose) {
- var othIndex = othLength;
- while (othIndex--) {
- othValue = other[othIndex];
- result = (arrValue && arrValue === othValue) || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);
- if (result) {
- break;
- }
- }
- } else {
- result = (arrValue && arrValue === othValue) || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);
+ othValue = other[index],
+ result = customizer ? customizer(isLoose ? othValue : arrValue, isLoose ? arrValue : othValue, index) : undefined;
+
+ if (result !== undefined) {
+ if (result) {
+ continue;
}
+ return false;
+ }
+ // Recursively compare arrays (susceptible to call stack limits).
+ if (isLoose) {
+ if (!arraySome(other, function(othValue) {
+ return arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);
+ })) {
+ return false;
+ }
+ } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB))) {
+ return false;
}
}
- return !!result;
+ return true;
}
/**
@@ -3851,29 +3795,22 @@
if (objLength != othLength && !isLoose) {
return false;
}
- var skipCtor = isLoose,
- index = -1;
-
+ var index = objLength;
+ while (index--) {
+ var key = objProps[index];
+ if (!(isLoose ? key in other : hasOwnProperty.call(other, key))) {
+ return false;
+ }
+ }
+ var skipCtor = isLoose;
while (++index < objLength) {
- var key = objProps[index],
- result = isLoose ? key in other : hasOwnProperty.call(other, key);
+ key = objProps[index];
+ var objValue = object[key],
+ othValue = other[key],
+ result = customizer ? customizer(isLoose ? othValue : objValue, isLoose? objValue : othValue, key) : undefined;
- if (result) {
- var objValue = object[key],
- othValue = other[key];
-
- result = undefined;
- if (customizer) {
- result = isLoose
- ? customizer(othValue, objValue, key)
- : customizer(objValue, othValue, key);
- }
- if (result === undefined) {
- // Recursively compare objects (susceptible to call stack limits).
- result = (objValue && objValue === othValue) || equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB);
- }
- }
- if (!result) {
+ // Recursively compare objects (susceptible to call stack limits).
+ if (!(result === undefined ? equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB) : result)) {
return false;
}
skipCtor || (skipCtor = key == 'constructor');
@@ -3894,34 +3831,6 @@
}
/**
- * Gets the extremum value of `collection` invoking `iteratee` for each value
- * in `collection` to generate the criterion by which the value is ranked.
- * The `iteratee` is invoked with three arguments: (value, index, collection).
- *
- * @private
- * @param {Array|Object|string} collection The collection to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @param {boolean} [isMin] Specify returning the minimum, instead of the
- * maximum, extremum value.
- * @returns {*} Returns the extremum value.
- */
- function extremumBy(collection, iteratee, isMin) {
- var exValue = isMin ? POSITIVE_INFINITY : NEGATIVE_INFINITY,
- computed = exValue,
- result = computed;
-
- baseEach(collection, function(value, index, collection) {
- var current = iteratee(value, index, collection);
- if ((isMin ? (current < computed) : (current > computed)) ||
- (current === exValue && current === result)) {
- computed = current;
- result = value;
- }
- });
- return result;
- }
-
- /**
* Gets the appropriate "callback" function. If the `_.callback` method is
* customized this function returns the custom method, otherwise it returns
* the `baseCallback` function. If arguments are provided the chosen function
@@ -3954,29 +3863,20 @@
* @param {Function} func The function to query.
* @returns {string} Returns the function name.
*/
- var getFuncName = (function() {
- if (!support.funcNames) {
- return constant('');
- }
- if (constant.name == 'constant') {
- return baseProperty('name');
- }
- return function(func) {
- var result = func.name,
- array = realNames[result],
- length = array ? array.length : 0;
+ function getFuncName(func) {
+ var result = func.name,
+ array = realNames[result],
+ length = array ? array.length : 0;
- while (length--) {
- var data = array[length],
- otherFunc = data.func;
-
- if (otherFunc == null || otherFunc == func) {
- return data.name;
- }
+ while (length--) {
+ var data = array[length],
+ otherFunc = data.func;
+ if (otherFunc == null || otherFunc == func) {
+ return data.name;
}
- return result;
- };
- }());
+ }
+ return result;
+ }
/**
* Gets the appropriate "indexOf" function. If the `_.indexOf` method is
@@ -4006,15 +3906,34 @@
var getLength = baseProperty('length');
/**
- * Creates an array of the own symbols of `object`.
+ * Gets the propery names, values, and compare flags of `object`.
*
* @private
* @param {Object} object The object to query.
- * @returns {Array} Returns the array of symbols.
+ * @returns {Array} Returns the match data of `object`.
*/
- var getSymbols = !getOwnPropertySymbols ? constant([]) : function(object) {
- return getOwnPropertySymbols(toObject(object));
- };
+ function getMatchData(object) {
+ var result = pairs(object),
+ length = result.length;
+
+ while (length--) {
+ result[length][2] = isStrictComparable(result[length][1]);
+ }
+ return result;
+ }
+
+ /**
+ * Gets the native function at `key` of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {string} key The key of the method to get.
+ * @returns {*} Returns the function if it's native, else `undefined`.
+ */
+ function getNative(object, key) {
+ var value = object == null ? undefined : object[key];
+ return isNative(value) ? value : undefined;
+ }
/**
* Gets the view, applying any `transforms` to the `start` and `end` positions.
@@ -4156,7 +4075,7 @@
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
*/
function isIndex(value, length) {
- value = +value;
+ value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
length = length == null ? MAX_SAFE_INTEGER : length;
return value > -1 && value % 1 == 0 && value < length;
}
@@ -4213,7 +4132,15 @@
*/
function isLaziable(func) {
var funcName = getFuncName(func);
- return !!funcName && func === lodash[funcName] && funcName in LazyWrapper.prototype;
+ if (!(funcName in LazyWrapper.prototype)) {
+ return false;
+ }
+ var other = lodash[funcName];
+ if (func === other) {
+ return true;
+ }
+ var data = getData(other);
+ return !!data && func === data[0];
}
/**
@@ -4453,11 +4380,10 @@
function shimKeys(object) {
var props = keysIn(object),
propsLength = props.length,
- length = propsLength && object.length,
- support = lodash.support;
+ length = propsLength && object.length;
- var allowIndexes = length && isLength(length) &&
- (isArray(object) || (support.nonEnumArgs && isArguments(object)));
+ var allowIndexes = !!length && isLength(length) &&
+ (isArray(object) || isArguments(object));
var index = -1,
result = [];
@@ -4472,7 +4398,7 @@
}
/**
- * Converts `value` to an array-like object if it is not one.
+ * Converts `value` to an array-like object if it's not one.
*
* @private
* @param {*} value The value to process.
@@ -4489,7 +4415,7 @@
}
/**
- * Converts `value` to an object if it is not one.
+ * Converts `value` to an object if it's not one.
*
* @private
* @param {*} value The value to process.
@@ -4500,7 +4426,7 @@
}
/**
- * Converts `value` to property path array if it is not one.
+ * Converts `value` to property path array if it's not one.
*
* @private
* @param {*} value The value to process.
@@ -4530,6 +4456,8 @@
: new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__, arrayCopy(wrapper.__actions__));
}
+ /*------------------------------------------------------------------------*/
+
/**
* Creates an array of elements split into groups the length of `size`.
* If `collection` can't be split evenly, the final chunk will be the remaining
@@ -4597,8 +4525,8 @@
}
/**
- * Creates an array excluding all values of the provided arrays using
- * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
+ * Creates an array of unique `array` values not included in the other
+ * provided arrays using [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
* for equality comparisons.
*
* @static
@@ -5071,8 +4999,8 @@
}
/**
- * Creates an array of unique values in all provided arrays using
- * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
+ * Creates an array of unique values that are included in all of the provided
+ * arrays using [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
* for equality comparisons.
*
* @static
@@ -5084,27 +5012,19 @@
* _.intersection([1, 2], [4, 2], [2, 1]);
* // => [2]
*/
- function intersection() {
- var args = [],
- argsIndex = -1,
- argsLength = arguments.length,
- caches = [],
+ var intersection = restParam(function(arrays) {
+ var othLength = arrays.length,
+ othIndex = othLength,
+ caches = Array(length),
indexOf = getIndexOf(),
isCommon = indexOf == baseIndexOf,
result = [];
- while (++argsIndex < argsLength) {
- var value = arguments[argsIndex];
- if (isArrayLike(value)) {
- args.push(value);
- caches.push((isCommon && value.length >= 120) ? createCache(argsIndex && value) : null);
- }
+ while (othIndex--) {
+ var value = arrays[othIndex] = isArrayLike(value = arrays[othIndex]) ? value : [];
+ caches[othIndex] = (isCommon && value.length >= 120) ? createCache(othIndex && value) : null;
}
- argsLength = args.length;
- if (argsLength < 2) {
- return result;
- }
- var array = args[0],
+ var array = arrays[0],
index = -1,
length = array ? array.length : 0,
seen = caches[0];
@@ -5113,10 +5033,10 @@
while (++index < length) {
value = array[index];
if ((seen ? cacheIndexOf(seen, value) : indexOf(result, value, 0)) < 0) {
- argsIndex = argsLength;
- while (--argsIndex) {
- var cache = caches[argsIndex];
- if ((cache ? cacheIndexOf(cache, value) : indexOf(args[argsIndex], value, 0)) < 0) {
+ var othIndex = othLength;
+ while (--othIndex) {
+ var cache = caches[othIndex];
+ if ((cache ? cacheIndexOf(cache, value) : indexOf(arrays[othIndex], value, 0)) < 0) {
continue outer;
}
}
@@ -5127,7 +5047,7 @@
}
}
return result;
- }
+ });
/**
* Gets the last element of `array`.
@@ -5633,8 +5553,8 @@
}
/**
- * Creates an array of unique values, in order, of the provided arrays using
- * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
+ * Creates an array of unique values, in order, from all of the provided arrays
+ * using [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
* for equality comparisons.
*
* @static
@@ -5710,9 +5630,9 @@
iteratee = isIterateeCall(array, isSorted, thisArg) ? null : isSorted;
isSorted = false;
}
- var func = getCallback();
- if (!(func === baseCallback && iteratee == null)) {
- iteratee = func(iteratee, thisArg, 3);
+ var callback = getCallback();
+ if (!(iteratee == null && callback === baseCallback)) {
+ iteratee = callback(iteratee, thisArg, 3);
}
return (isSorted && getIndexOf() == baseIndexOf)
? sortedUniq(array, iteratee)
@@ -5815,7 +5735,7 @@
});
/**
- * Creates an array that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
+ * Creates an array of unique values that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
* of the provided arrays.
*
* @static
@@ -5919,8 +5839,8 @@
*/
var zipWith = restParam(function(arrays) {
var length = arrays.length,
- iteratee = arrays[length - 2],
- thisArg = arrays[length - 1];
+ iteratee = length > 2 ? arrays[length - 2] : undefined,
+ thisArg = length > 1 ? arrays[length - 1] : undefined;
if (length > 2 && typeof iteratee == 'function') {
length -= 2;
@@ -5932,6 +5852,8 @@
return unzipWith(arrays, iteratee, thisArg);
});
+ /*------------------------------------------------------------------------*/
+
/**
* Creates a `lodash` object that wraps `value` with explicit method
* chaining enabled.
@@ -6182,6 +6104,8 @@
return baseWrapperValue(this.__wrapped__, this.__actions__);
}
+ /*------------------------------------------------------------------------*/
+
/**
* Creates an array of elements corresponding to the given keys, or indexes,
* of `collection`. Keys may be specified as individual arguments or as arrays
@@ -6673,7 +6597,7 @@
});
/**
- * Invokes the method at `path` on each element in `collection`, returning
+ * Invokes the method at `path` of each element in `collection`, returning
* an array of the results of each invoked method. Any additional arguments
* are provided to each invoked method. If `methodName` is a function it is
* invoked for, and `this` bound to, each element in `collection`.
@@ -6701,7 +6625,7 @@
result = isArrayLike(collection) ? Array(collection.length) : [];
baseEach(collection, function(value) {
- var func = isFunc ? path : (isProp && value != null && value[path]);
+ var func = isFunc ? path : ((isProp && value != null) ? value[path] : null);
result[++index] = func ? func.apply(value, args) : invokePath(value, path, args);
});
return result;
@@ -6723,7 +6647,7 @@
* callback returns `true` for elements that have the properties of the given
* object, else `false`.
*
- * Many lodash methods are guarded to work as interatees for methods like
+ * Many lodash methods are guarded to work as iteratees for methods like
* `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
*
* The guarded methods are:
@@ -6867,7 +6791,7 @@
* value. The `iteratee` is bound to `thisArg` and invoked with four arguments:
* (accumulator, value, index|key, collection).
*
- * Many lodash methods are guarded to work as interatees for methods like
+ * Many lodash methods are guarded to work as iteratees for methods like
* `_.reduce`, `_.reduceRight`, and `_.transform`.
*
* The guarded methods are:
@@ -6989,8 +6913,20 @@
var length = collection.length;
return length > 0 ? collection[baseRandom(0, length - 1)] : undefined;
}
- var result = shuffle(collection);
- result.length = nativeMin(n < 0 ? 0 : (+n || 0), result.length);
+ var index = -1,
+ result = toArray(collection),
+ length = result.length,
+ lastIndex = length - 1;
+
+ n = nativeMin(n < 0 ? 0 : (+n || 0), length);
+ while (++index < n) {
+ var rand = baseRandom(index, lastIndex),
+ value = result[rand];
+
+ result[rand] = result[index];
+ result[index] = value;
+ }
+ result.length = n;
return result;
}
@@ -7009,20 +6945,7 @@
* // => [4, 1, 3, 2]
*/
function shuffle(collection) {
- collection = toIterable(collection);
-
- var index = -1,
- length = collection.length,
- result = Array(length);
-
- while (++index < length) {
- var rand = baseRandom(0, index);
- if (index != rand) {
- result[index] = result[rand];
- }
- result[rand] = collection[index];
- }
- return result;
+ return sample(collection, POSITIVE_INFINITY);
}
/**
@@ -7303,6 +7226,8 @@
return filter(collection, baseMatches(source));
}
+ /*------------------------------------------------------------------------*/
+
/**
* Gets the number of milliseconds that have elapsed since the Unix epoch
* (1 January 1970 00:00:00 UTC).
@@ -7321,6 +7246,8 @@
return new Date().getTime();
};
+ /*------------------------------------------------------------------------*/
+
/**
* The opposite of `_.before`; this method creates a function that invokes
* `func` once it is called `n` or more times.
@@ -7644,12 +7571,13 @@
var curryRight = createCurry(CURRY_RIGHT_FLAG);
/**
- * Creates a function that delays invoking `func` until after `wait` milliseconds
- * have elapsed since the last time it was invoked. The created function comes
- * with a `cancel` method to cancel delayed invocations. Provide an options
- * object to indicate that `func` should be invoked on the leading and/or
- * trailing edge of the `wait` timeout. Subsequent calls to the debounced
- * function return the result of the last `func` invocation.
+ * Creates a debounced function that delays invoking `func` until after `wait`
+ * milliseconds have elapsed since the last time the debounced function was
+ * invoked. The debounced function comes with a `cancel` method to cancel
+ * delayed invocations. Provide an options object to indicate that `func`
+ * should be invoked on the leading and/or trailing edge of the `wait` timeout.
+ * Subsequent calls to the debounced function return the result of the last
+ * `func` invocation.
*
* **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
* on the trailing edge of the timeout only if the the debounced function is
@@ -7963,14 +7891,14 @@
}
var memoized = function() {
var args = arguments,
- cache = memoized.cache,
- key = resolver ? resolver.apply(this, args) : args[0];
+ key = resolver ? resolver.apply(this, args) : args[0],
+ cache = memoized.cache;
if (cache.has(key)) {
return cache.get(key);
}
var result = func.apply(this, args);
- cache.set(key, result);
+ memoized.cache = cache.set(key, result);
return result;
};
memoized.cache = new memoize.Cache;
@@ -8217,12 +8145,12 @@
}
/**
- * Creates a function that only invokes `func` at most once per every `wait`
- * milliseconds. The created function comes with a `cancel` method to cancel
- * delayed invocations. Provide an options object to indicate that `func`
- * should be invoked on the leading and/or trailing edge of the `wait` timeout.
- * Subsequent calls to the throttled function return the result of the last
- * `func` call.
+ * Creates a throttled function that only invokes `func` at most once per
+ * every `wait` milliseconds. The throttled function comes with a `cancel`
+ * method to cancel delayed invocations. Provide an options object to indicate
+ * that `func` should be invoked on the leading and/or trailing edge of the
+ * `wait` timeout. Subsequent calls to the throttled function return the
+ * result of the last `func` call.
*
* **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
* on the trailing edge of the timeout only if the the throttled function is
@@ -8300,6 +8228,8 @@
return createWrapper(wrapper, PARTIAL_FLAG, null, [value], []);
}
+ /*------------------------------------------------------------------------*/
+
/**
* Creates a clone of `value`. If `isDeep` is `true` nested objects are cloned,
* otherwise they are assigned by reference. If `customizer` is provided it is
@@ -8360,8 +8290,9 @@
customizer = isDeep;
isDeep = false;
}
- customizer = typeof customizer == 'function' && bindCallback(customizer, thisArg, 1);
- return baseClone(value, isDeep, customizer);
+ return typeof customizer == 'function'
+ ? baseClone(value, isDeep, bindCallback(customizer, thisArg, 1))
+ : baseClone(value, isDeep);
}
/**
@@ -8410,8 +8341,57 @@
* // => 20
*/
function cloneDeep(value, customizer, thisArg) {
- customizer = typeof customizer == 'function' && bindCallback(customizer, thisArg, 1);
- return baseClone(value, true, customizer);
+ return typeof customizer == 'function'
+ ? baseClone(value, true, bindCallback(customizer, thisArg, 1))
+ : baseClone(value, true);
+ }
+
+ /**
+ * Checks if `value` is greater than `other`.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @returns {boolean} Returns `true` if `value` is greater than `other`, else `false`.
+ * @example
+ *
+ * _.gt(3, 1);
+ * // => true
+ *
+ * _.gt(3, 3);
+ * // => false
+ *
+ * _.gt(1, 3);
+ * // => false
+ */
+ function gt(value, other) {
+ return value > other;
+ }
+
+ /**
+ * Checks if `value` is greater than or equal to `other`.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @returns {boolean} Returns `true` if `value` is greater than or equal to `other`, else `false`.
+ * @example
+ *
+ * _.gte(3, 1);
+ * // => true
+ *
+ * _.gte(3, 3);
+ * // => true
+ *
+ * _.gte(1, 3);
+ * // => false
+ */
+ function gte(value, other) {
+ return value >= other;
}
/**
@@ -8574,6 +8554,7 @@
*
* @static
* @memberOf _
+ * @alias eq
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
@@ -8603,12 +8584,9 @@
* // => true
*/
function isEqual(value, other, customizer, thisArg) {
- customizer = typeof customizer == 'function' && bindCallback(customizer, thisArg, 3);
- if (!customizer && isStrictComparable(value) && isStrictComparable(other)) {
- return value === other;
- }
+ customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined;
var result = customizer ? customizer(value, other) : undefined;
- return result === undefined ? baseIsEqual(value, other, customizer) : !!result;
+ return result === undefined ? baseIsEqual(value, other, customizer) : !!result;
}
/**
@@ -8710,7 +8688,7 @@
// Avoid a V8 JIT bug in Chrome 19-20.
// See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
var type = typeof value;
- return type == 'function' || (!!value && type == 'object');
+ return !!value && (type == 'object' || type == 'function');
}
/**
@@ -8753,33 +8731,8 @@
* // => true
*/
function isMatch(object, source, customizer, thisArg) {
- var props = keys(source),
- length = props.length;
-
- if (!length) {
- return true;
- }
- if (object == null) {
- return false;
- }
- customizer = typeof customizer == 'function' && bindCallback(customizer, thisArg, 3);
- object = toObject(object);
- if (!customizer && length == 1) {
- var key = props[0],
- value = source[key];
-
- if (isStrictComparable(value)) {
- return value === object[key] && (value !== undefined || (key in object));
- }
- }
- var values = Array(length),
- strictCompareFlags = Array(length);
-
- while (length--) {
- value = values[length] = source[props[length]];
- strictCompareFlags[length] = isStrictComparable(value);
- }
- return baseIsMatch(object, props, values, strictCompareFlags, customizer);
+ customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined;
+ return baseIsMatch(object, getMatchData(source), customizer);
}
/**
@@ -8919,8 +8872,8 @@
if (!(value && objToString.call(value) == objectTag)) {
return false;
}
- var valueOf = value.valueOf,
- objProto = isNative(valueOf) && (objProto = getPrototypeOf(valueOf)) && getPrototypeOf(objProto);
+ var valueOf = getNative(value, 'valueOf'),
+ objProto = valueOf && (objProto = getPrototypeOf(valueOf)) && getPrototypeOf(objProto);
return objProto
? (value == objProto || getPrototypeOf(value) == objProto)
@@ -9008,6 +8961,54 @@
}
/**
+ * Checks if `value` is less than `other`.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @returns {boolean} Returns `true` if `value` is less than `other`, else `false`.
+ * @example
+ *
+ * _.lt(1, 3);
+ * // => true
+ *
+ * _.lt(3, 3);
+ * // => false
+ *
+ * _.lt(3, 1);
+ * // => false
+ */
+ function lt(value, other) {
+ return value < other;
+ }
+
+ /**
+ * Checks if `value` is less than or equal to `other`.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @returns {boolean} Returns `true` if `value` is less than or equal to `other`, else `false`.
+ * @example
+ *
+ * _.lte(1, 3);
+ * // => true
+ *
+ * _.lte(3, 3);
+ * // => true
+ *
+ * _.lte(3, 1);
+ * // => false
+ */
+ function lte(value, other) {
+ return value <= other;
+ }
+
+ /**
* Converts `value` to an array.
*
* @static
@@ -9060,6 +9061,8 @@
return baseCopy(value, keysIn(value));
}
+ /*------------------------------------------------------------------------*/
+
/**
* Assigns own enumerable properties of source object(s) to the destination
* object. Subsequent sources overwrite property assignments of previous sources.
@@ -9399,7 +9402,7 @@
}
/**
- * Gets the property value of `path` on `object`. If the resolved value is
+ * Gets the property value at `path` of `object`. If the resolved value is
* `undefined` the `defaultValue` is used in its place.
*
* @static
@@ -9457,10 +9460,14 @@
if (!result && !isKey(path)) {
path = toPath(path);
object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
+ if (object == null) {
+ return false;
+ }
path = last(path);
- result = object != null && hasOwnProperty.call(object, path);
+ result = hasOwnProperty.call(object, path);
}
- return result;
+ return result || (isLength(object.length) && isIndex(path, object.length) &&
+ (isArray(object) || isArguments(object)));
}
/**
@@ -9541,7 +9548,7 @@
* // => ['0', '1']
*/
var keys = !nativeKeys ? shimKeys : function(object) {
- var Ctor = object != null && object.constructor;
+ var Ctor = object == null ? null : object.constructor;
if ((typeof Ctor == 'function' && Ctor.prototype === object) ||
(typeof object != 'function' && isArrayLike(object))) {
return shimKeys(object);
@@ -9580,7 +9587,7 @@
}
var length = object.length;
length = (length && isLength(length) &&
- (isArray(object) || (support.nonEnumArgs && isArguments(object))) && length) || 0;
+ (isArray(object) || isArguments(object)) && length) || 0;
var Ctor = object.constructor,
index = -1,
@@ -9767,6 +9774,8 @@
* // => [['barney', 36], ['fred', 40]] (iteration order is not guaranteed)
*/
function pairs(object) {
+ object = toObject(object);
+
var index = -1,
props = keys(object),
length = props.length,
@@ -9887,13 +9896,13 @@
var index = -1,
length = path.length,
- endIndex = length - 1,
+ lastIndex = length - 1,
nested = object;
while (nested != null && ++index < length) {
var key = path[index];
if (isObject(nested)) {
- if (index == endIndex) {
+ if (index == lastIndex) {
nested[key] = value;
} else if (nested[key] == null) {
nested[key] = isIndex(path[index + 1]) ? [] : {};
@@ -9943,7 +9952,7 @@
if (isArr) {
accumulator = isArray(object) ? new Ctor : [];
} else {
- accumulator = baseCreate(isFunction(Ctor) && Ctor.prototype);
+ accumulator = baseCreate(isFunction(Ctor) ? Ctor.prototype : null);
}
} else {
accumulator = {};
@@ -10011,6 +10020,8 @@
return baseValues(object, keysIn(object));
}
+ /*------------------------------------------------------------------------*/
+
/**
* Checks if `n` is between `start` and up to but not including, `end`. If
* `end` is not specified it is set to `start` with `start` then set to `0`.
@@ -10115,6 +10126,8 @@
return baseRandom(min, max);
}
+ /*------------------------------------------------------------------------*/
+
/**
* Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
*
@@ -10218,7 +10231,7 @@
* use a third-party library like [_he_](https://mths.be/he).
*
* Though the ">" character is escaped for symmetry, characters like
- * ">" and "/" don't require escaping in HTML and have no special meaning
+ * ">" and "/" don't need escaping in HTML and have no special meaning
* unless they're part of a tag or unquoted attribute value.
* See [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
* (under "semi-related fun fact") for more details.
@@ -10295,7 +10308,7 @@
});
/**
- * Pads `string` on the left and right sides if it is shorter than `length`.
+ * Pads `string` on the left and right sides if it's shorter than `length`.
* Padding characters are truncated if they can't be evenly divided by `length`.
*
* @static
@@ -10333,7 +10346,7 @@
}
/**
- * Pads `string` on the left side if it is shorter than `length`. Padding
+ * Pads `string` on the left side if it's shorter than `length`. Padding
* characters are truncated if they exceed `length`.
*
* @static
@@ -10357,7 +10370,7 @@
var padLeft = createPadDir();
/**
- * Pads `string` on the right side if it is shorter than `length`. Padding
+ * Pads `string` on the right side if it's shorter than `length`. Padding
* characters are truncated if they exceed `length`.
*
* @static
@@ -10838,7 +10851,7 @@
}
/**
- * Truncates `string` if it is longer than the given maximum string length.
+ * Truncates `string` if it's longer than the given maximum string length.
* The last characters of the truncated string are replaced with the omission
* string which defaults to "...".
*
@@ -10980,6 +10993,8 @@
return string.match(pattern || reWords) || [];
}
+ /*------------------------------------------------------------------------*/
+
/**
* Attempts to invoke `func`, returning either the result or the caught error
* object. Any additional arguments are provided to `func` when it is invoked.
@@ -11097,7 +11112,7 @@
}
/**
- * Creates a function which performs a deep comparison between a given object
+ * Creates a function that performs a deep comparison between a given object
* and `source`, returning `true` if the given object has equivalent property
* values, else `false`.
*
@@ -11126,7 +11141,7 @@
}
/**
- * Creates a function which compares the property value of `path` on a given
+ * Creates a function that compares the property value of `path` on a given
* object to `value`.
*
* **Note:** This method supports comparing arrays, booleans, `Date` objects,
@@ -11137,7 +11152,7 @@
* @memberOf _
* @category Utility
* @param {Array|string} path The path of the property to get.
- * @param {*} value The value to compare.
+ * @param {*} srcValue The value to match.
* @returns {Function} Returns the new function.
* @example
*
@@ -11149,17 +11164,19 @@
* _.find(users, _.matchesProperty('user', 'fred'));
* // => { 'user': 'fred' }
*/
- function matchesProperty(path, value) {
- return baseMatchesProperty(path, baseClone(value, true));
+ function matchesProperty(path, srcValue) {
+ return baseMatchesProperty(path, baseClone(srcValue, true));
}
/**
- * Creates a function which invokes the method at `path` on a given object.
+ * Creates a function that invokes the method at `path` on a given object.
+ * Any additional arguments are provided to the invoked method.
*
* @static
* @memberOf _
* @category Utility
* @param {Array|string} path The path of the method to invoke.
+ * @param {...*} [args] The arguments to invoke the method with.
* @returns {Function} Returns the new function.
* @example
*
@@ -11181,13 +11198,15 @@
});
/**
- * The opposite of `_.method`; this method creates a function which invokes
- * the method at a given path on `object`.
+ * The opposite of `_.method`; this method creates a function that invokes
+ * the method at a given path on `object`. Any additional arguments are
+ * provided to the invoked method.
*
* @static
* @memberOf _
* @category Utility
* @param {Object} object The object to query.
+ * @param {...*} [args] The arguments to invoke the method with.
* @returns {Function} Returns the new function.
* @example
*
@@ -11231,9 +11250,6 @@
* });
* }
*
- * // use `_.runInContext` to avoid conflicts (esp. in Node.js)
- * var _ = require('lodash').runInContext();
- *
* _.mixin({ 'vowels': vowels });
* _.vowels('fred');
* // => ['e']
@@ -11248,8 +11264,8 @@
function mixin(object, source, options) {
if (options == null) {
var isObj = isObject(source),
- props = isObj && keys(source),
- methodNames = props && props.length && baseFunctions(source, props);
+ props = isObj ? keys(source) : null,
+ methodNames = (props && props.length) ? baseFunctions(source, props) : null;
if (!(methodNames ? methodNames.length : isObj)) {
methodNames = false;
@@ -11316,7 +11332,7 @@
}
/**
- * A no-operation function which returns `undefined` regardless of the
+ * A no-operation function that returns `undefined` regardless of the
* arguments it receives.
*
* @static
@@ -11334,7 +11350,7 @@
}
/**
- * Creates a function which returns the property value at `path` on a
+ * Creates a function that returns the property value at `path` on a
* given object.
*
* @static
@@ -11360,7 +11376,7 @@
}
/**
- * The opposite of `_.property`; this method creates a function which returns
+ * The opposite of `_.property`; this method creates a function that returns
* the property value at a given path on `object`.
*
* @static
@@ -11514,6 +11530,8 @@
return baseToString(prefix) + id;
}
+ /*------------------------------------------------------------------------*/
+
/**
* Adds two numbers.
*
@@ -11579,7 +11597,7 @@
* _.max(users, 'age');
* // => { 'user': 'fred', 'age': 40 }
*/
- var max = createExtremum(arrayMax);
+ var max = createExtremum(gt, NEGATIVE_INFINITY);
/**
* Gets the minimum value of `collection`. If `collection` is empty or falsey
@@ -11628,7 +11646,7 @@
* _.min(users, 'age');
* // => { 'user': 'barney', 'age': 36 }
*/
- var min = createExtremum(arrayMin, true);
+ var min = createExtremum(lt, POSITIVE_INFINITY);
/**
* Gets the sum of the values in `collection`.
@@ -11666,18 +11684,20 @@
if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
iteratee = null;
}
- var func = getCallback(),
+ var callback = getCallback(),
noIteratee = iteratee == null;
- if (!(func === baseCallback && noIteratee)) {
+ if (!(noIteratee && callback === baseCallback)) {
noIteratee = false;
- iteratee = func(iteratee, thisArg, 3);
+ iteratee = callback(iteratee, thisArg, 3);
}
return noIteratee
? arraySum(isArray(collection) ? collection : toIterable(collection))
: baseSum(collection, iteratee);
}
+ /*------------------------------------------------------------------------*/
+
// Ensure wrappers are instances of `baseLodash`.
lodash.prototype = baseLodash.prototype;
@@ -11825,6 +11845,8 @@
// Add functions to `lodash.prototype`.
mixin(lodash, lodash);
+ /*------------------------------------------------------------------------*/
+
// Add functions that return unwrapped values when chaining.
lodash.add = add;
lodash.attempt = attempt;
@@ -11846,6 +11868,8 @@
lodash.findWhere = findWhere;
lodash.first = first;
lodash.get = get;
+ lodash.gt = gt;
+ lodash.gte = gte;
lodash.has = has;
lodash.identity = identity;
lodash.includes = includes;
@@ -11875,6 +11899,8 @@
lodash.kebabCase = kebabCase;
lodash.last = last;
lodash.lastIndexOf = lastIndexOf;
+ lodash.lt = lt;
+ lodash.lte = lte;
lodash.max = max;
lodash.min = min;
lodash.noConflict = noConflict;
@@ -11911,6 +11937,7 @@
lodash.all = every;
lodash.any = some;
lodash.contains = includes;
+ lodash.eq = isEqual;
lodash.detect = find;
lodash.foldl = reduce;
lodash.foldr = reduceRight;
@@ -11928,6 +11955,8 @@
return source;
}()), false);
+ /*------------------------------------------------------------------------*/
+
// Add functions capable of returning wrapped and unwrapped values when chaining.
lodash.sample = sample;
@@ -11940,6 +11969,8 @@
});
};
+ /*------------------------------------------------------------------------*/
+
/**
* The semantic version number.
*
@@ -12167,6 +12198,8 @@
return lodash;
}
+ /*--------------------------------------------------------------------------*/
+
// Export lodash.
var _ = runInContext();
@@ -12190,7 +12223,7 @@
if (moduleExports) {
(freeModule.exports = _)._ = _;
}
- // Export for Narwhal or Rhino -require.
+ // Export for Rhino with CommonJS support.
else {
freeExports._ = _;
}
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/SetCache.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/SetCache.js
index ed3dc6b0fc6..ae29c55bf3a 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/SetCache.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/SetCache.js
@@ -1,11 +1,11 @@
var cachePush = require('./cachePush'),
- isNative = require('../lang/isNative');
+ getNative = require('./getNative');
/** Native method references. */
-var Set = isNative(Set = global.Set) && Set;
+var Set = getNative(global, 'Set');
/* Native method references for those with the same name as other `lodash` methods. */
-var nativeCreate = isNative(nativeCreate = Object.create) && nativeCreate;
+var nativeCreate = getNative(Object, 'create');
/**
*
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arrayExtremum.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arrayExtremum.js
new file mode 100644
index 00000000000..e45badbda1b
--- /dev/null
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arrayExtremum.js
@@ -0,0 +1,30 @@
+/**
+ * A specialized version of `baseExtremum` for arrays which invokes `iteratee`
+ * with one argument: (value).
+ *
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {Function} comparator The function used to compare values.
+ * @param {*} exValue The initial extremum value.
+ * @returns {*} Returns the extremum value.
+ */
+function arrayExtremum(array, iteratee, comparator, exValue) {
+ var index = -1,
+ length = array.length,
+ computed = exValue,
+ result = computed;
+
+ while (++index < length) {
+ var value = array[index],
+ current = +iteratee(value);
+
+ if (comparator(current, computed)) {
+ computed = current;
+ result = value;
+ }
+ }
+ return result;
+}
+
+module.exports = arrayExtremum;
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arrayMax.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arrayMax.js
deleted file mode 100644
index 3f62469f912..00000000000
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arrayMax.js
+++ /dev/null
@@ -1,25 +0,0 @@
-/** Used as references for `-Infinity` and `Infinity`. */
-var NEGATIVE_INFINITY = Number.NEGATIVE_INFINITY;
-
-/**
- * A specialized version of `_.max` for arrays without support for iteratees.
- *
- * @private
- * @param {Array} array The array to iterate over.
- * @returns {*} Returns the maximum value.
- */
-function arrayMax(array) {
- var index = -1,
- length = array.length,
- result = NEGATIVE_INFINITY;
-
- while (++index < length) {
- var value = array[index];
- if (value > result) {
- result = value;
- }
- }
- return result;
-}
-
-module.exports = arrayMax;
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arrayMin.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arrayMin.js
deleted file mode 100644
index dd1f175ce68..00000000000
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/arrayMin.js
+++ /dev/null
@@ -1,25 +0,0 @@
-/** Used as references for `-Infinity` and `Infinity`. */
-var POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
-
-/**
- * A specialized version of `_.min` for arrays without support for iteratees.
- *
- * @private
- * @param {Array} array The array to iterate over.
- * @returns {*} Returns the minimum value.
- */
-function arrayMin(array) {
- var index = -1,
- length = array.length,
- result = POSITIVE_INFINITY;
-
- while (++index < length) {
- var value = array[index];
- if (value < result) {
- result = value;
- }
- }
- return result;
-}
-
-module.exports = arrayMin;
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/assignWith.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/assignWith.js
index c5a629d02d2..d2b261ad2bb 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/assignWith.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/assignWith.js
@@ -1,11 +1,4 @@
-var getSymbols = require('./getSymbols'),
- keys = require('../object/keys');
-
-/** Used for native method references. */
-var arrayProto = Array.prototype;
-
-/** Native method references. */
-var push = arrayProto.push;
+var keys = require('../object/keys');
/**
* A specialized version of `_.assign` for customizing assigned values without
@@ -19,10 +12,8 @@ var push = arrayProto.push;
* @returns {Object} Returns `object`.
*/
function assignWith(object, source, customizer) {
- var props = keys(source);
- push.apply(props, getSymbols(source));
-
var index = -1,
+ props = keys(source),
length = props.length;
while (++index < length) {
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseAssign.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseAssign.js
index c290fe95e79..cfad6e0c304 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseAssign.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseAssign.js
@@ -1,34 +1,6 @@
var baseCopy = require('./baseCopy'),
- getSymbols = require('./getSymbols'),
- isNative = require('../lang/isNative'),
keys = require('../object/keys');
-/** Native method references. */
-var preventExtensions = isNative(preventExtensions = Object.preventExtensions) && preventExtensions;
-
-/** Used as `baseAssign`. */
-var nativeAssign = (function() {
- // Avoid `Object.assign` in Firefox 34-37 which have an early implementation
- // with a now defunct try/catch behavior. See https://bugzilla.mozilla.org/show_bug.cgi?id=1103344
- // for more details.
- //
- // Use `Object.preventExtensions` on a plain object instead of simply using
- // `Object('x')` because Chrome and IE fail to throw an error when attempting
- // to assign values to readonly indexes of strings.
- var func = preventExtensions && isNative(func = Object.assign) && func;
- try {
- if (func) {
- var object = preventExtensions({ '1': 0 });
- object[0] = 1;
- }
- } catch(e) {
- // Only attempt in strict mode.
- try { func(object, 'xo'); } catch(e) {}
- return !object[1] && func;
- }
- return false;
-}());
-
/**
* The base implementation of `_.assign` without support for argument juggling,
* multiple sources, and `customizer` functions.
@@ -38,10 +10,10 @@ var nativeAssign = (function() {
* @param {Object} source The source object.
* @returns {Object} Returns `object`.
*/
-var baseAssign = nativeAssign || function(object, source) {
+function baseAssign(object, source) {
return source == null
? object
- : baseCopy(source, getSymbols(source), baseCopy(source, keys(source), object));
-};
+ : baseCopy(source, keys(source), object);
+}
module.exports = baseAssign;
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseAt.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseAt.js
index b90aa4cc44f..bbafd1d5ad2 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseAt.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseAt.js
@@ -14,7 +14,7 @@ function baseAt(collection, props) {
var index = -1,
isNil = collection == null,
isArr = !isNil && isArrayLike(collection),
- length = isArr && collection.length,
+ length = isArr ? collection.length : 0,
propsLength = props.length,
result = Array(propsLength);
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseCompareAscending.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseCompareAscending.js
index f2b7657fb96..c8259c72dc7 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseCompareAscending.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseCompareAscending.js
@@ -3,19 +3,28 @@
* sorts them in ascending order without guaranteeing a stable sort.
*
* @private
- * @param {*} value The value to compare to `other`.
- * @param {*} other The value to compare to `value`.
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
* @returns {number} Returns the sort order indicator for `value`.
*/
function baseCompareAscending(value, other) {
if (value !== other) {
- var valIsReflexive = value === value,
+ var valIsNull = value === null,
+ valIsUndef = value === undefined,
+ valIsReflexive = value === value;
+
+ var othIsNull = other === null,
+ othIsUndef = other === undefined,
othIsReflexive = other === other;
- if (value > other || !valIsReflexive || (value === undefined && othIsReflexive)) {
+ if ((value > other && !othIsNull) || !valIsReflexive ||
+ (valIsNull && !othIsUndef && othIsReflexive) ||
+ (valIsUndef && othIsReflexive)) {
return 1;
}
- if (value < other || !othIsReflexive || (other === undefined && valIsReflexive)) {
+ if ((value < other && !valIsNull) || !othIsReflexive ||
+ (othIsNull && !valIsUndef && valIsReflexive) ||
+ (othIsUndef && valIsReflexive)) {
return -1;
}
}
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseCreate.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseCreate.js
index da6725f6a7f..8f36becd341 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseCreate.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseCreate.js
@@ -9,14 +9,14 @@ var isObject = require('../lang/isObject');
* @returns {Object} Returns the new object.
*/
var baseCreate = (function() {
- function Object() {}
+ function object() {}
return function(prototype) {
if (isObject(prototype)) {
- Object.prototype = prototype;
- var result = new Object;
- Object.prototype = null;
+ object.prototype = prototype;
+ var result = new object;
+ object.prototype = null;
}
- return result || global.Object();
+ return result || {};
};
}());
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseExtremum.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseExtremum.js
new file mode 100644
index 00000000000..b0efff6f9c2
--- /dev/null
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseExtremum.js
@@ -0,0 +1,29 @@
+var baseEach = require('./baseEach');
+
+/**
+ * Gets the extremum value of `collection` invoking `iteratee` for each value
+ * in `collection` to generate the criterion by which the value is ranked.
+ * The `iteratee` is invoked with three arguments: (value, index|key, collection).
+ *
+ * @private
+ * @param {Array|Object|string} collection The collection to iterate over.
+ * @param {Function} iteratee The function invoked per iteration.
+ * @param {Function} comparator The function used to compare values.
+ * @param {*} exValue The initial extremum value.
+ * @returns {*} Returns the extremum value.
+ */
+function baseExtremum(collection, iteratee, comparator, exValue) {
+ var computed = exValue,
+ result = computed;
+
+ baseEach(collection, function(value, index, collection) {
+ var current = +iteratee(value, index, collection);
+ if (comparator(current, computed) || (current === exValue && current === result)) {
+ computed = current;
+ result = value;
+ }
+ });
+ return result;
+}
+
+module.exports = baseExtremum;
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseGet.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseGet.js
index 5a9b48c71d3..ad9b1ee11ba 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseGet.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseGet.js
@@ -17,11 +17,11 @@ function baseGet(object, path, pathKey) {
if (pathKey !== undefined && pathKey in toObject(object)) {
path = [pathKey];
}
- var index = -1,
+ var index = 0,
length = path.length;
- while (object != null && ++index < length) {
- object = object[path[index]];
+ while (object != null && index < length) {
+ object = object[path[index++]];
}
return (index && index == length) ? object : undefined;
}
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseIsEqual.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseIsEqual.js
index ca4e8e90780..87e14ac5569 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseIsEqual.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseIsEqual.js
@@ -1,4 +1,6 @@
-var baseIsEqualDeep = require('./baseIsEqualDeep');
+var baseIsEqualDeep = require('./baseIsEqualDeep'),
+ isObject = require('../lang/isObject'),
+ isObjectLike = require('./isObjectLike');
/**
* The base implementation of `_.isEqual` without support for `this` binding
@@ -14,17 +16,10 @@ var baseIsEqualDeep = require('./baseIsEqualDeep');
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
*/
function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) {
- // Exit early for identical values.
if (value === other) {
return true;
}
- var valType = typeof value,
- othType = typeof other;
-
- // Exit early for unlike primitive values.
- if ((valType != 'function' && valType != 'object' && othType != 'function' && othType != 'object') ||
- value == null || other == null) {
- // Return `false` unless both values are `NaN`.
+ if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {
return value !== value && other !== other;
}
return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB);
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseIsEqualDeep.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseIsEqualDeep.js
index e6829a931d6..586ebcd1c0a 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseIsEqualDeep.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseIsEqualDeep.js
@@ -66,11 +66,11 @@ function baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA,
return equalByTag(object, other, objTag);
}
if (!isLoose) {
- var valWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
- othWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
+ var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
+ othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
- if (valWrapped || othWrapped) {
- return equalFunc(valWrapped ? object.value() : object, othWrapped ? other.value() : other, customizer, isLoose, stackA, stackB);
+ if (objIsWrapped || othIsWrapped) {
+ return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, isLoose, stackA, stackB);
}
}
if (!isSameTag) {
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseIsMatch.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseIsMatch.js
index 5c9fb3a686c..ea48bb65674 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseIsMatch.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseIsMatch.js
@@ -1,4 +1,5 @@
-var baseIsEqual = require('./baseIsEqual');
+var baseIsEqual = require('./baseIsEqual'),
+ toObject = require('./toObject');
/**
* The base implementation of `_.isMatch` without support for callback
@@ -6,42 +7,44 @@ var baseIsEqual = require('./baseIsEqual');
*
* @private
* @param {Object} object The object to inspect.
- * @param {Array} props The source property names to match.
- * @param {Array} values The source values to match.
- * @param {Array} strictCompareFlags Strict comparison flags for source values.
+ * @param {Array} matchData The propery names, values, and compare flags to match.
* @param {Function} [customizer] The function to customize comparing objects.
* @returns {boolean} Returns `true` if `object` is a match, else `false`.
*/
-function baseIsMatch(object, props, values, strictCompareFlags, customizer) {
- var index = -1,
- length = props.length,
+function baseIsMatch(object, matchData, customizer) {
+ var index = matchData.length,
+ length = index,
noCustomizer = !customizer;
- while (++index < length) {
- if ((noCustomizer && strictCompareFlags[index])
- ? values[index] !== object[props[index]]
- : !(props[index] in object)
+ if (object == null) {
+ return !length;
+ }
+ object = toObject(object);
+ while (index--) {
+ var data = matchData[index];
+ if ((noCustomizer && data[2])
+ ? data[1] !== object[data[0]]
+ : !(data[0] in object)
) {
return false;
}
}
- index = -1;
while (++index < length) {
- var key = props[index],
+ data = matchData[index];
+ var key = data[0],
objValue = object[key],
- srcValue = values[index];
+ srcValue = data[1];
- if (noCustomizer && strictCompareFlags[index]) {
- var result = objValue !== undefined || (key in object);
+ if (noCustomizer && data[2]) {
+ if (objValue === undefined && !(key in object)) {
+ return false;
+ }
} else {
- result = customizer ? customizer(objValue, srcValue, key) : undefined;
- if (result === undefined) {
- result = baseIsEqual(srcValue, objValue, customizer, true);
+ var result = customizer ? customizer(objValue, srcValue, key) : undefined;
+ if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, true) : result)) {
+ return false;
}
}
- if (!result) {
- return false;
- }
}
return true;
}
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseMatches.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseMatches.js
index 885e9f7919a..5f76c67dcd0 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseMatches.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseMatches.js
@@ -1,7 +1,5 @@
var baseIsMatch = require('./baseIsMatch'),
- constant = require('../utility/constant'),
- isStrictComparable = require('./isStrictComparable'),
- keys = require('../object/keys'),
+ getMatchData = require('./getMatchData'),
toObject = require('./toObject');
/**
@@ -12,35 +10,20 @@ var baseIsMatch = require('./baseIsMatch'),
* @returns {Function} Returns the new function.
*/
function baseMatches(source) {
- var props = keys(source),
- length = props.length;
+ var matchData = getMatchData(source);
+ if (matchData.length == 1 && matchData[0][2]) {
+ var key = matchData[0][0],
+ value = matchData[0][1];
- if (!length) {
- return constant(true);
- }
- if (length == 1) {
- var key = props[0],
- value = source[key];
-
- if (isStrictComparable(value)) {
- return function(object) {
- if (object == null) {
- return false;
- }
- return object[key] === value && (value !== undefined || (key in toObject(object)));
- };
- }
- }
- var values = Array(length),
- strictCompareFlags = Array(length);
-
- while (length--) {
- value = source[props[length]];
- values[length] = value;
- strictCompareFlags[length] = isStrictComparable(value);
+ return function(object) {
+ if (object == null) {
+ return false;
+ }
+ return object[key] === value && (value !== undefined || (key in toObject(object)));
+ };
}
return function(object) {
- return object != null && baseIsMatch(toObject(object), props, values, strictCompareFlags);
+ return baseIsMatch(object, matchData);
};
}
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseMatchesProperty.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseMatchesProperty.js
index 1bbd3464dc7..8f9005ce0fc 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseMatchesProperty.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseMatchesProperty.js
@@ -9,17 +9,16 @@ var baseGet = require('./baseGet'),
toPath = require('./toPath');
/**
- * The base implementation of `_.matchesProperty` which does not which does
- * not clone `value`.
+ * The base implementation of `_.matchesProperty` which does not clone `srcValue`.
*
* @private
* @param {string} path The path of the property to get.
- * @param {*} value The value to compare.
+ * @param {*} srcValue The value to compare.
* @returns {Function} Returns the new function.
*/
-function baseMatchesProperty(path, value) {
+function baseMatchesProperty(path, srcValue) {
var isArr = isArray(path),
- isCommon = isKey(path) && isStrictComparable(value),
+ isCommon = isKey(path) && isStrictComparable(srcValue),
pathKey = (path + '');
path = toPath(path);
@@ -37,9 +36,9 @@ function baseMatchesProperty(path, value) {
key = last(path);
object = toObject(object);
}
- return object[key] === value
- ? (value !== undefined || (key in object))
- : baseIsEqual(value, object[key], null, true);
+ return object[key] === srcValue
+ ? (srcValue !== undefined || (key in object))
+ : baseIsEqual(srcValue, object[key], undefined, true);
};
}
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseMerge.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseMerge.js
index c76c21029e0..28a871069bf 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseMerge.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseMerge.js
@@ -1,6 +1,5 @@
var arrayEach = require('./arrayEach'),
baseMergeDeep = require('./baseMergeDeep'),
- getSymbols = require('./getSymbols'),
isArray = require('../lang/isArray'),
isArrayLike = require('./isArrayLike'),
isObject = require('../lang/isObject'),
@@ -8,12 +7,6 @@ var arrayEach = require('./arrayEach'),
isTypedArray = require('../lang/isTypedArray'),
keys = require('../object/keys');
-/** Used for native method references. */
-var arrayProto = Array.prototype;
-
-/** Native method references. */
-var push = arrayProto.push;
-
/**
* The base implementation of `_.merge` without support for argument juggling,
* multiple sources, and `this` binding `customizer` functions.
@@ -30,11 +23,9 @@ function baseMerge(object, source, customizer, stackA, stackB) {
if (!isObject(object)) {
return object;
}
- var isSrcArr = isArrayLike(source) && (isArray(source) || isTypedArray(source));
- if (!isSrcArr) {
- var props = keys(source);
- push.apply(props, getSymbols(source));
- }
+ var isSrcArr = isArrayLike(source) && (isArray(source) || isTypedArray(source)),
+ props = isSrcArr ? null : keys(source);
+
arrayEach(props || source, function(srcValue, key) {
if (props) {
key = srcValue;
@@ -53,7 +44,7 @@ function baseMerge(object, source, customizer, stackA, stackB) {
if (isCommon) {
result = srcValue;
}
- if ((isSrcArr || result !== undefined) &&
+ if ((result !== undefined || (isSrcArr && !(key in object))) &&
(isCommon || (result === result ? (result !== value) : (value === value)))) {
object[key] = result;
}
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/basePullAt.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/basePullAt.js
index 41f9700bfbb..6c4ff84200b 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/basePullAt.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/basePullAt.js
@@ -18,7 +18,7 @@ var splice = arrayProto.splice;
function basePullAt(array, indexes) {
var length = array ? indexes.length : 0;
while (length--) {
- var index = parseFloat(indexes[length]);
+ var index = indexes[length];
if (index != previous && isIndex(index)) {
var previous = index;
splice.call(array, index, 1);
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseToString.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseToString.js
index 3b0d0eca9e5..4de76a7eec4 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseToString.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseToString.js
@@ -1,5 +1,5 @@
/**
- * Converts `value` to a string if it is not one. An empty string is returned
+ * Converts `value` to a string if it's not one. An empty string is returned
* for `null` or `undefined` values.
*
* @private
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/binaryIndex.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/binaryIndex.js
index cd5a072d3a2..af419a26f28 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/binaryIndex.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/binaryIndex.js
@@ -2,7 +2,7 @@ var binaryIndexBy = require('./binaryIndexBy'),
identity = require('../utility/identity');
/** Used as references for the maximum length and index of an array. */
-var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1,
+var MAX_ARRAY_LENGTH = 4294967295,
HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
/**
@@ -25,7 +25,7 @@ function binaryIndex(array, value, retHighest) {
var mid = (low + high) >>> 1,
computed = array[mid];
- if (retHighest ? (computed <= value) : (computed < value)) {
+ if ((retHighest ? (computed <= value) : (computed < value)) && computed !== null) {
low = mid + 1;
} else {
high = mid;
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/binaryIndexBy.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/binaryIndexBy.js
index 04cb43e7b42..5bcd7a74422 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/binaryIndexBy.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/binaryIndexBy.js
@@ -5,7 +5,7 @@ var floor = Math.floor;
var nativeMin = Math.min;
/** Used as references for the maximum length and index of an array. */
-var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1,
+var MAX_ARRAY_LENGTH = 4294967295,
MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1;
/**
@@ -27,17 +27,23 @@ function binaryIndexBy(array, value, iteratee, retHighest) {
var low = 0,
high = array ? array.length : 0,
valIsNaN = value !== value,
+ valIsNull = value === null,
valIsUndef = value === undefined;
while (low < high) {
var mid = floor((low + high) / 2),
computed = iteratee(array[mid]),
+ isDef = computed !== undefined,
isReflexive = computed === computed;
if (valIsNaN) {
var setLow = isReflexive || retHighest;
+ } else if (valIsNull) {
+ setLow = isReflexive && isDef && (retHighest || computed != null);
} else if (valIsUndef) {
- setLow = isReflexive && (retHighest || computed !== undefined);
+ setLow = isReflexive && (retHighest || isDef);
+ } else if (computed == null) {
+ setLow = false;
} else {
setLow = retHighest ? (computed <= value) : (computed < value);
}
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/bufferClone.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/bufferClone.js
index 40322e19f3b..ba10802db05 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/bufferClone.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/bufferClone.js
@@ -1,11 +1,11 @@
var constant = require('../utility/constant'),
- isNative = require('../lang/isNative');
+ getNative = require('./getNative');
/** Native method references. */
-var ArrayBuffer = isNative(ArrayBuffer = global.ArrayBuffer) && ArrayBuffer,
- bufferSlice = isNative(bufferSlice = ArrayBuffer && new ArrayBuffer(0).slice) && bufferSlice,
+var ArrayBuffer = getNative(global, 'ArrayBuffer'),
+ bufferSlice = getNative(ArrayBuffer && new ArrayBuffer(0), 'slice'),
floor = Math.floor,
- Uint8Array = isNative(Uint8Array = global.Uint8Array) && Uint8Array;
+ Uint8Array = getNative(global, 'Uint8Array');
/** Used to clone array buffers. */
var Float64Array = (function() {
@@ -13,10 +13,10 @@ var Float64Array = (function() {
// where the array buffer's `byteLength` is not a multiple of the typed
// array's `BYTES_PER_ELEMENT`.
try {
- var func = isNative(func = global.Float64Array) && func,
+ var func = getNative(global, 'Float64Array'),
result = new func(new ArrayBuffer(10), 0, 1) && func;
} catch(e) {}
- return result;
+ return result || null;
}());
/** Used as the size, in bytes, of each `Float64Array` element. */
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/charAtCallback.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/charAtCallback.js
deleted file mode 100644
index fbc3a919563..00000000000
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/charAtCallback.js
+++ /dev/null
@@ -1,12 +0,0 @@
-/**
- * Used by `_.max` and `_.min` as the default callback for string values.
- *
- * @private
- * @param {string} string The string to inspect.
- * @returns {number} Returns the code unit of the first character of the string.
- */
-function charAtCallback(string) {
- return string.charCodeAt(0);
-}
-
-module.exports = charAtCallback;
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createAssigner.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createAssigner.js
index 43593f06d13..e06c1b1b764 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createAssigner.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createAssigner.js
@@ -16,19 +16,19 @@ function createAssigner(assigner) {
return restParam(function(object, sources) {
var index = -1,
length = object == null ? 0 : sources.length,
- customizer = length > 2 && sources[length - 2],
- guard = length > 2 && sources[2],
- thisArg = length > 1 && sources[length - 1];
+ customizer = length > 2 ? sources[length - 2] : undefined,
+ guard = length > 2 ? sources[2] : undefined,
+ thisArg = length > 1 ? sources[length - 1] : undefined;
if (typeof customizer == 'function') {
customizer = bindCallback(customizer, thisArg, 5);
length -= 2;
} else {
- customizer = typeof thisArg == 'function' ? thisArg : null;
+ customizer = typeof thisArg == 'function' ? thisArg : undefined;
length -= (customizer ? 1 : 0);
}
if (guard && isIterateeCall(sources[0], sources[1], guard)) {
- customizer = length < 3 ? null : customizer;
+ customizer = length < 3 ? undefined : customizer;
length = 1;
}
while (++index < length) {
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createCache.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createCache.js
index e12d9fd7920..012cab1b63a 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createCache.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createCache.js
@@ -1,12 +1,12 @@
var SetCache = require('./SetCache'),
constant = require('../utility/constant'),
- isNative = require('../lang/isNative');
+ getNative = require('./getNative');
/** Native method references. */
-var Set = isNative(Set = global.Set) && Set;
+var Set = getNative(global, 'Set');
/* Native method references for those with the same name as other `lodash` methods. */
-var nativeCreate = isNative(nativeCreate = Object.create) && nativeCreate;
+var nativeCreate = getNative(Object, 'create');
/**
* Creates a `Set` cache object to optimize linear searches of large arrays.
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createCtorWrapper.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createCtorWrapper.js
index 31bec3d5f15..f1a12d14e85 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createCtorWrapper.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createCtorWrapper.js
@@ -11,8 +11,20 @@ var baseCreate = require('./baseCreate'),
*/
function createCtorWrapper(Ctor) {
return function() {
+ // Use a `switch` statement to work with class constructors.
+ // See https://people.mozilla.org/~jorendorff/es6-draft.html#sec-ecmascript-function-objects-call-thisargument-argumentslist
+ // for more details.
+ var args = arguments;
+ switch (args.length) {
+ case 0: return new Ctor;
+ case 1: return new Ctor(args[0]);
+ case 2: return new Ctor(args[0], args[1]);
+ case 3: return new Ctor(args[0], args[1], args[2]);
+ case 4: return new Ctor(args[0], args[1], args[2], args[3]);
+ case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
+ }
var thisBinding = baseCreate(Ctor.prototype),
- result = Ctor.apply(thisBinding, arguments);
+ result = Ctor.apply(thisBinding, args);
// Mimic the constructor's `return` behavior.
// See https://es5.github.io/#x13.2.2 for more details.
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createExtremum.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createExtremum.js
index 4d05d2e8941..60f0b79191e 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createExtremum.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createExtremum.js
@@ -1,37 +1,31 @@
-var baseCallback = require('./baseCallback'),
- charAtCallback = require('./charAtCallback'),
- extremumBy = require('./extremumBy'),
- isArray = require('../lang/isArray'),
+var arrayExtremum = require('./arrayExtremum'),
+ baseCallback = require('./baseCallback'),
+ baseExtremum = require('./baseExtremum'),
isIterateeCall = require('./isIterateeCall'),
- isString = require('../lang/isString'),
toIterable = require('./toIterable');
/**
* Creates a `_.max` or `_.min` function.
*
* @private
- * @param {Function} arrayFunc The function to get the extremum value from an array.
- * @param {boolean} [isMin] Specify returning the minimum, instead of the maximum,
- * extremum value.
+ * @param {Function} comparator The function used to compare values.
+ * @param {*} exValue The initial extremum value.
* @returns {Function} Returns the new extremum function.
*/
-function createExtremum(arrayFunc, isMin) {
+function createExtremum(comparator, exValue) {
return function(collection, iteratee, thisArg) {
if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
iteratee = null;
}
- var noIteratee = iteratee == null;
-
- iteratee = noIteratee ? iteratee : baseCallback(iteratee, thisArg, 3);
- if (noIteratee) {
- var isArr = isArray(collection);
- if (!isArr && isString(collection)) {
- iteratee = charAtCallback;
- } else {
- return arrayFunc(isArr ? collection : toIterable(collection));
+ iteratee = baseCallback(iteratee, thisArg, 3);
+ if (iteratee.length == 1) {
+ collection = toIterable(collection);
+ var result = arrayExtremum(collection, iteratee, comparator, exValue);
+ if (!(collection.length && result === exValue)) {
+ return result;
}
}
- return extremumBy(collection, iteratee, isMin);
+ return baseExtremum(collection, iteratee, comparator, exValue);
};
}
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createFlow.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createFlow.js
index 6fe12b2c691..f1821835f4f 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createFlow.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createFlow.js
@@ -22,11 +22,8 @@ var FUNC_ERROR_TEXT = 'Expected a function';
*/
function createFlow(fromRight) {
return function() {
- var length = arguments.length;
- if (!length) {
- return function() { return arguments[0]; };
- }
var wrapper,
+ length = arguments.length,
index = fromRight ? length : -1,
leftIndex = 0,
funcs = Array(length);
@@ -36,15 +33,17 @@ function createFlow(fromRight) {
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
- var funcName = wrapper ? '' : getFuncName(func);
- wrapper = funcName == 'wrapper' ? new LodashWrapper([]) : wrapper;
+ if (!wrapper && LodashWrapper.prototype.thru && getFuncName(func) == 'wrapper') {
+ wrapper = new LodashWrapper([]);
+ }
}
index = wrapper ? -1 : length;
while (++index < length) {
func = funcs[index];
- funcName = getFuncName(func);
- var data = funcName == 'wrapper' ? getData(func) : null;
+ var funcName = getFuncName(func),
+ data = funcName == 'wrapper' ? getData(func) : null;
+
if (data && isLaziable(data[0]) && data[1] == (ARY_FLAG | CURRY_FLAG | PARTIAL_FLAG | REARG_FLAG) && !data[4].length && data[9] == 1) {
wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
} else {
@@ -57,7 +56,7 @@ function createFlow(fromRight) {
return wrapper.plant(args[0]).value();
}
var index = 0,
- result = funcs[index].apply(this, args);
+ result = length ? funcs[index].apply(this, args) : args[0];
while (++index < length) {
result = funcs[index].call(this, result);
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createHybridWrapper.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createHybridWrapper.js
index fb62371bf34..d7de9ade712 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createHybridWrapper.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/createHybridWrapper.js
@@ -43,10 +43,8 @@ function createHybridWrapper(func, bitmask, thisArg, partials, holders, partials
isBindKey = bitmask & BIND_KEY_FLAG,
isCurry = bitmask & CURRY_FLAG,
isCurryBound = bitmask & CURRY_BOUND_FLAG,
- isCurryRight = bitmask & CURRY_RIGHT_FLAG;
-
- var Ctor = !isBindKey && createCtorWrapper(func),
- key = func;
+ isCurryRight = bitmask & CURRY_RIGHT_FLAG,
+ Ctor = isBindKey ? null : createCtorWrapper(func);
function wrapper() {
// Avoid `arguments` object use disqualifying optimizations by
@@ -93,17 +91,18 @@ function createHybridWrapper(func, bitmask, thisArg, partials, holders, partials
return result;
}
}
- var thisBinding = isBind ? thisArg : this;
- if (isBindKey) {
- func = thisBinding[key];
- }
+ var thisBinding = isBind ? thisArg : this,
+ fn = isBindKey ? thisBinding[func] : func;
+
if (argPos) {
args = reorder(args, argPos);
}
if (isAry && ary < args.length) {
args.length = ary;
}
- var fn = (this && this !== global && this instanceof wrapper) ? (Ctor || createCtorWrapper(func)) : func;
+ if (this && this !== global && this instanceof wrapper) {
+ fn = Ctor || createCtorWrapper(func);
+ }
return fn.apply(thisBinding, args);
}
return wrapper;
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/equalArrays.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/equalArrays.js
index 0b032ac6a9e..e0bb2d32a81 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/equalArrays.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/equalArrays.js
@@ -1,3 +1,5 @@
+var arraySome = require('./arraySome');
+
/**
* A specialized version of `baseIsEqualDeep` for arrays with support for
* partial deep comparisons.
@@ -15,40 +17,35 @@
function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) {
var index = -1,
arrLength = array.length,
- othLength = other.length,
- result = true;
+ othLength = other.length;
if (arrLength != othLength && !(isLoose && othLength > arrLength)) {
return false;
}
- // Deep compare the contents, ignoring non-numeric properties.
- while (result && ++index < arrLength) {
+ // Ignore non-index properties.
+ while (++index < arrLength) {
var arrValue = array[index],
- othValue = other[index];
+ othValue = other[index],
+ result = customizer ? customizer(isLoose ? othValue : arrValue, isLoose ? arrValue : othValue, index) : undefined;
- result = undefined;
- if (customizer) {
- result = isLoose
- ? customizer(othValue, arrValue, index)
- : customizer(arrValue, othValue, index);
+ if (result !== undefined) {
+ if (result) {
+ continue;
+ }
+ return false;
}
- if (result === undefined) {
- // Recursively compare arrays (susceptible to call stack limits).
- if (isLoose) {
- var othIndex = othLength;
- while (othIndex--) {
- othValue = other[othIndex];
- result = (arrValue && arrValue === othValue) || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);
- if (result) {
- break;
- }
- }
- } else {
- result = (arrValue && arrValue === othValue) || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);
+ // Recursively compare arrays (susceptible to call stack limits).
+ if (isLoose) {
+ if (!arraySome(other, function(othValue) {
+ return arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);
+ })) {
+ return false;
}
+ } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB))) {
+ return false;
}
}
- return !!result;
+ return true;
}
module.exports = equalArrays;
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/equalObjects.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/equalObjects.js
index 5ea4ec5b857..1297a3b2afe 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/equalObjects.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/equalObjects.js
@@ -29,29 +29,22 @@ function equalObjects(object, other, equalFunc, customizer, isLoose, stackA, sta
if (objLength != othLength && !isLoose) {
return false;
}
- var skipCtor = isLoose,
- index = -1;
-
+ var index = objLength;
+ while (index--) {
+ var key = objProps[index];
+ if (!(isLoose ? key in other : hasOwnProperty.call(other, key))) {
+ return false;
+ }
+ }
+ var skipCtor = isLoose;
while (++index < objLength) {
- var key = objProps[index],
- result = isLoose ? key in other : hasOwnProperty.call(other, key);
-
- if (result) {
- var objValue = object[key],
- othValue = other[key];
+ key = objProps[index];
+ var objValue = object[key],
+ othValue = other[key],
+ result = customizer ? customizer(isLoose ? othValue : objValue, isLoose? objValue : othValue, key) : undefined;
- result = undefined;
- if (customizer) {
- result = isLoose
- ? customizer(othValue, objValue, key)
- : customizer(objValue, othValue, key);
- }
- if (result === undefined) {
- // Recursively compare objects (susceptible to call stack limits).
- result = (objValue && objValue === othValue) || equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB);
- }
- }
- if (!result) {
+ // Recursively compare objects (susceptible to call stack limits).
+ if (!(result === undefined ? equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB) : result)) {
return false;
}
skipCtor || (skipCtor = key == 'constructor');
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/getFuncName.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/getFuncName.js
index 3102b714288..2ea73a6cd5c 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/getFuncName.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/getFuncName.js
@@ -1,7 +1,4 @@
-var baseProperty = require('./baseProperty'),
- constant = require('../utility/constant'),
- realNames = require('./realNames'),
- support = require('../support');
+var realNames = require('./realNames');
/**
* Gets the name of `func`.
@@ -10,28 +7,19 @@ var baseProperty = require('./baseProperty'),
* @param {Function} func The function to query.
* @returns {string} Returns the function name.
*/
-var getFuncName = (function() {
- if (!support.funcNames) {
- return constant('');
- }
- if (constant.name == 'constant') {
- return baseProperty('name');
- }
- return function(func) {
- var result = func.name,
- array = realNames[result],
- length = array ? array.length : 0;
+function getFuncName(func) {
+ var result = func.name,
+ array = realNames[result],
+ length = array ? array.length : 0;
- while (length--) {
- var data = array[length],
- otherFunc = data.func;
-
- if (otherFunc == null || otherFunc == func) {
- return data.name;
- }
+ while (length--) {
+ var data = array[length],
+ otherFunc = data.func;
+ if (otherFunc == null || otherFunc == func) {
+ return data.name;
}
- return result;
- };
-}());
+ }
+ return result;
+}
module.exports = getFuncName;
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/getMatchData.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/getMatchData.js
new file mode 100644
index 00000000000..6d235b91675
--- /dev/null
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/getMatchData.js
@@ -0,0 +1,21 @@
+var isStrictComparable = require('./isStrictComparable'),
+ pairs = require('../object/pairs');
+
+/**
+ * Gets the propery names, values, and compare flags of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @returns {Array} Returns the match data of `object`.
+ */
+function getMatchData(object) {
+ var result = pairs(object),
+ length = result.length;
+
+ while (length--) {
+ result[length][2] = isStrictComparable(result[length][1]);
+ }
+ return result;
+}
+
+module.exports = getMatchData;
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/getNative.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/getNative.js
new file mode 100644
index 00000000000..bceb317fd73
--- /dev/null
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/getNative.js
@@ -0,0 +1,16 @@
+var isNative = require('../lang/isNative');
+
+/**
+ * Gets the native function at `key` of `object`.
+ *
+ * @private
+ * @param {Object} object The object to query.
+ * @param {string} key The key of the method to get.
+ * @returns {*} Returns the function if it's native, else `undefined`.
+ */
+function getNative(object, key) {
+ var value = object == null ? undefined : object[key];
+ return isNative(value) ? value : undefined;
+}
+
+module.exports = getNative;
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/getSymbols.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/getSymbols.js
deleted file mode 100644
index e6a4d299195..00000000000
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/getSymbols.js
+++ /dev/null
@@ -1,19 +0,0 @@
-var constant = require('../utility/constant'),
- isNative = require('../lang/isNative'),
- toObject = require('./toObject');
-
-/** Native method references. */
-var getOwnPropertySymbols = isNative(getOwnPropertySymbols = Object.getOwnPropertySymbols) && getOwnPropertySymbols;
-
-/**
- * Creates an array of the own symbols of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of symbols.
- */
-var getSymbols = !getOwnPropertySymbols ? constant([]) : function(object) {
- return getOwnPropertySymbols(toObject(object));
-};
-
-module.exports = getSymbols;
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/isIndex.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/isIndex.js
index caa2b94b1fc..142bde7fb63 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/isIndex.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/isIndex.js
@@ -1,8 +1,11 @@
+/** Used to detect unsigned integer values. */
+var reIsUint = /^\d+$/;
+
/**
* Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer)
* of an array-like value.
*/
-var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1;
+var MAX_SAFE_INTEGER = 9007199254740991;
/**
* Checks if `value` is a valid array-like index.
@@ -13,7 +16,7 @@ var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1;
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
*/
function isIndex(value, length) {
- value = +value;
+ value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
length = length == null ? MAX_SAFE_INTEGER : length;
return value > -1 && value % 1 == 0 && value < length;
}
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/isLaziable.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/isLaziable.js
index 7b4829924d9..a0f14702bfa 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/isLaziable.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/isLaziable.js
@@ -1,4 +1,5 @@
var LazyWrapper = require('./LazyWrapper'),
+ getData = require('./getData'),
getFuncName = require('./getFuncName'),
lodash = require('../chain/lodash');
@@ -11,7 +12,15 @@ var LazyWrapper = require('./LazyWrapper'),
*/
function isLaziable(func) {
var funcName = getFuncName(func);
- return !!funcName && func === lodash[funcName] && funcName in LazyWrapper.prototype;
+ if (!(funcName in LazyWrapper.prototype)) {
+ return false;
+ }
+ var other = lodash[funcName];
+ if (func === other) {
+ return true;
+ }
+ var data = getData(other);
+ return !!data && func === data[0];
}
module.exports = isLaziable;
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/isLength.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/isLength.js
index 1e3f11c10d5..39c85022fbf 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/isLength.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/isLength.js
@@ -2,7 +2,7 @@
* Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer)
* of an array-like value.
*/
-var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1;
+var MAX_SAFE_INTEGER = 9007199254740991;
/**
* Checks if `value` is a valid array-like length.
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/metaMap.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/metaMap.js
index 3573837fda5..59bfd5f96e7 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/metaMap.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/metaMap.js
@@ -1,7 +1,7 @@
-var isNative = require('../lang/isNative');
+var getNative = require('./getNative');
/** Native method references. */
-var WeakMap = isNative(WeakMap = global.WeakMap) && WeakMap;
+var WeakMap = getNative(global, 'WeakMap');
/** Used to store function metadata. */
var metaMap = WeakMap && new WeakMap;
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/shimKeys.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/shimKeys.js
index d165c40cb5b..189e492b762 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/shimKeys.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/shimKeys.js
@@ -2,8 +2,7 @@ var isArguments = require('../lang/isArguments'),
isArray = require('../lang/isArray'),
isIndex = require('./isIndex'),
isLength = require('./isLength'),
- keysIn = require('../object/keysIn'),
- support = require('../support');
+ keysIn = require('../object/keysIn');
/** Used for native method references. */
var objectProto = Object.prototype;
@@ -24,8 +23,8 @@ function shimKeys(object) {
propsLength = props.length,
length = propsLength && object.length;
- var allowIndexes = length && isLength(length) &&
- (isArray(object) || (support.nonEnumArgs && isArguments(object)));
+ var allowIndexes = !!length && isLength(length) &&
+ (isArray(object) || isArguments(object));
var index = -1,
result = [];
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/toIterable.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/toIterable.js
index ae63a33be23..c0a5b2885f2 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/toIterable.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/toIterable.js
@@ -3,7 +3,7 @@ var isArrayLike = require('./isArrayLike'),
values = require('../object/values');
/**
- * Converts `value` to an array-like object if it is not one.
+ * Converts `value` to an array-like object if it's not one.
*
* @private
* @param {*} value The value to process.
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/toObject.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/toObject.js
index 1c1093409c4..da4a008d7b4 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/toObject.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/toObject.js
@@ -1,7 +1,7 @@
var isObject = require('../lang/isObject');
/**
- * Converts `value` to an object if it is not one.
+ * Converts `value` to an object if it's not one.
*
* @private
* @param {*} value The value to process.
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/toPath.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/toPath.js
index 45314d1c477..d29f1eb5283 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/toPath.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/toPath.js
@@ -8,7 +8,7 @@ var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?
var reEscapeChar = /\\(\\)?/g;
/**
- * Converts `value` to property path array if it is not one.
+ * Converts `value` to property path array if it's not one.
*
* @private
* @param {*} value The value to process.
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang.js
index d8a7796b78a..8f0a364322a 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang.js
@@ -1,6 +1,9 @@
module.exports = {
'clone': require('./lang/clone'),
'cloneDeep': require('./lang/cloneDeep'),
+ 'eq': require('./lang/eq'),
+ 'gt': require('./lang/gt'),
+ 'gte': require('./lang/gte'),
'isArguments': require('./lang/isArguments'),
'isArray': require('./lang/isArray'),
'isBoolean': require('./lang/isBoolean'),
@@ -22,6 +25,8 @@ module.exports = {
'isString': require('./lang/isString'),
'isTypedArray': require('./lang/isTypedArray'),
'isUndefined': require('./lang/isUndefined'),
+ 'lt': require('./lang/lt'),
+ 'lte': require('./lang/lte'),
'toArray': require('./lang/toArray'),
'toPlainObject': require('./lang/toPlainObject')
};
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/clone.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/clone.js
index 76f030ac9fb..0a972eae5bf 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/clone.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/clone.js
@@ -62,8 +62,9 @@ function clone(value, isDeep, customizer, thisArg) {
customizer = isDeep;
isDeep = false;
}
- customizer = typeof customizer == 'function' && bindCallback(customizer, thisArg, 1);
- return baseClone(value, isDeep, customizer);
+ return typeof customizer == 'function'
+ ? baseClone(value, isDeep, bindCallback(customizer, thisArg, 1))
+ : baseClone(value, isDeep);
}
module.exports = clone;
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/cloneDeep.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/cloneDeep.js
index 4319d453ced..a458141e8d7 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/cloneDeep.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/cloneDeep.js
@@ -47,8 +47,9 @@ var baseClone = require('../internal/baseClone'),
* // => 20
*/
function cloneDeep(value, customizer, thisArg) {
- customizer = typeof customizer == 'function' && bindCallback(customizer, thisArg, 1);
- return baseClone(value, true, customizer);
+ return typeof customizer == 'function'
+ ? baseClone(value, true, bindCallback(customizer, thisArg, 1))
+ : baseClone(value, true);
}
module.exports = cloneDeep;
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/eq.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/eq.js
new file mode 100644
index 00000000000..e6a5ce0caf7
--- /dev/null
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/eq.js
@@ -0,0 +1 @@
+module.exports = require('./isEqual');
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/gt.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/gt.js
new file mode 100644
index 00000000000..ddaf5ea0671
--- /dev/null
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/gt.js
@@ -0,0 +1,25 @@
+/**
+ * Checks if `value` is greater than `other`.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @returns {boolean} Returns `true` if `value` is greater than `other`, else `false`.
+ * @example
+ *
+ * _.gt(3, 1);
+ * // => true
+ *
+ * _.gt(3, 3);
+ * // => false
+ *
+ * _.gt(1, 3);
+ * // => false
+ */
+function gt(value, other) {
+ return value > other;
+}
+
+module.exports = gt;
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/gte.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/gte.js
new file mode 100644
index 00000000000..4a5ffb5cdce
--- /dev/null
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/gte.js
@@ -0,0 +1,25 @@
+/**
+ * Checks if `value` is greater than or equal to `other`.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @returns {boolean} Returns `true` if `value` is greater than or equal to `other`, else `false`.
+ * @example
+ *
+ * _.gte(3, 1);
+ * // => true
+ *
+ * _.gte(3, 3);
+ * // => true
+ *
+ * _.gte(1, 3);
+ * // => false
+ */
+function gte(value, other) {
+ return value >= other;
+}
+
+module.exports = gte;
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isArray.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isArray.js
index 36a5608758e..6826854c764 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isArray.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isArray.js
@@ -1,5 +1,5 @@
-var isLength = require('../internal/isLength'),
- isNative = require('./isNative'),
+var getNative = require('../internal/getNative'),
+ isLength = require('../internal/isLength'),
isObjectLike = require('../internal/isObjectLike');
/** `Object#toString` result references. */
@@ -15,7 +15,7 @@ var objectProto = Object.prototype;
var objToString = objectProto.toString;
/* Native method references for those with the same name as other `lodash` methods. */
-var nativeIsArray = isNative(nativeIsArray = Array.isArray) && nativeIsArray;
+var nativeIsArray = getNative(Array, 'isArray');
/**
* Checks if `value` is classified as an `Array` object.
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isEqual.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isEqual.js
index 7daddb85807..f2cb5d863a7 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isEqual.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isEqual.js
@@ -1,6 +1,5 @@
var baseIsEqual = require('../internal/baseIsEqual'),
- bindCallback = require('../internal/bindCallback'),
- isStrictComparable = require('../internal/isStrictComparable');
+ bindCallback = require('../internal/bindCallback');
/**
* Performs a deep comparison between two values to determine if they are
@@ -17,6 +16,7 @@ var baseIsEqual = require('../internal/baseIsEqual'),
*
* @static
* @memberOf _
+ * @alias eq
* @category Lang
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
@@ -46,12 +46,9 @@ var baseIsEqual = require('../internal/baseIsEqual'),
* // => true
*/
function isEqual(value, other, customizer, thisArg) {
- customizer = typeof customizer == 'function' && bindCallback(customizer, thisArg, 3);
- if (!customizer && isStrictComparable(value) && isStrictComparable(other)) {
- return value === other;
- }
+ customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined;
var result = customizer ? customizer(value, other) : undefined;
- return result === undefined ? baseIsEqual(value, other, customizer) : !!result;
+ return result === undefined ? baseIsEqual(value, other, customizer) : !!result;
}
module.exports = isEqual;
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isFinite.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isFinite.js
index fc250ca1abb..3a1c9059a6e 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isFinite.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isFinite.js
@@ -1,8 +1,8 @@
-var isNative = require('./isNative');
+var getNative = require('../internal/getNative');
/* Native method references for those with the same name as other `lodash` methods. */
var nativeIsFinite = global.isFinite,
- nativeNumIsFinite = isNative(nativeNumIsFinite = Number.isFinite) && nativeNumIsFinite;
+ nativeNumIsFinite = getNative(Number, 'isFinite');
/**
* Checks if `value` is a finite primitive number.
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isFunction.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isFunction.js
index 44c54155b36..114a4dff568 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isFunction.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isFunction.js
@@ -1,5 +1,5 @@
var baseIsFunction = require('../internal/baseIsFunction'),
- isNative = require('./isNative');
+ getNative = require('../internal/getNative');
/** `Object#toString` result references. */
var funcTag = '[object Function]';
@@ -14,7 +14,7 @@ var objectProto = Object.prototype;
var objToString = objectProto.toString;
/** Native method references. */
-var Uint8Array = isNative(Uint8Array = global.Uint8Array) && Uint8Array;
+var Uint8Array = getNative(global, 'Uint8Array');
/**
* Checks if `value` is classified as a `Function` object.
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isMatch.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isMatch.js
index 9bc7ac17442..cb48436a438 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isMatch.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isMatch.js
@@ -1,8 +1,6 @@
var baseIsMatch = require('../internal/baseIsMatch'),
bindCallback = require('../internal/bindCallback'),
- isStrictComparable = require('../internal/isStrictComparable'),
- keys = require('../object/keys'),
- toObject = require('../internal/toObject');
+ getMatchData = require('../internal/getMatchData');
/**
* Performs a deep comparison between `object` and `source` to determine if
@@ -44,33 +42,8 @@ var baseIsMatch = require('../internal/baseIsMatch'),
* // => true
*/
function isMatch(object, source, customizer, thisArg) {
- var props = keys(source),
- length = props.length;
-
- if (!length) {
- return true;
- }
- if (object == null) {
- return false;
- }
- customizer = typeof customizer == 'function' && bindCallback(customizer, thisArg, 3);
- object = toObject(object);
- if (!customizer && length == 1) {
- var key = props[0],
- value = source[key];
-
- if (isStrictComparable(value)) {
- return value === object[key] && (value !== undefined || (key in object));
- }
- }
- var values = Array(length),
- strictCompareFlags = Array(length);
-
- while (length--) {
- value = values[length] = source[props[length]];
- strictCompareFlags[length] = isStrictComparable(value);
- }
- return baseIsMatch(object, props, values, strictCompareFlags, customizer);
+ customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined;
+ return baseIsMatch(object, getMatchData(source), customizer);
}
module.exports = isMatch;
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isNative.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isNative.js
index f27bb5a7013..cc2de0d310b 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isNative.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isNative.js
@@ -13,6 +13,9 @@ var objectProto = Object.prototype;
/** Used to resolve the decompiled source of functions. */
var fnToString = Function.prototype.toString;
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
+
/**
* Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring)
* of values.
@@ -21,8 +24,8 @@ var objToString = objectProto.toString;
/** Used to detect if a method is native. */
var reIsNative = RegExp('^' +
- escapeRegExp(objToString)
- .replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
+ escapeRegExp(fnToString.call(hasOwnProperty))
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
);
/**
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isObject.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isObject.js
index 63c3e95bed3..6db59987203 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isObject.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isObject.js
@@ -22,7 +22,7 @@ function isObject(value) {
// Avoid a V8 JIT bug in Chrome 19-20.
// See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
var type = typeof value;
- return type == 'function' || (!!value && type == 'object');
+ return !!value && (type == 'object' || type == 'function');
}
module.exports = isObject;
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isPlainObject.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isPlainObject.js
index 89e0c74eb51..67e0a8abdce 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isPlainObject.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/isPlainObject.js
@@ -1,4 +1,4 @@
-var isNative = require('./isNative'),
+var getNative = require('../internal/getNative'),
shimIsPlainObject = require('../internal/shimIsPlainObject');
/** `Object#toString` result references. */
@@ -14,7 +14,7 @@ var objectProto = Object.prototype;
var objToString = objectProto.toString;
/** Native method references. */
-var getPrototypeOf = isNative(getPrototypeOf = Object.getPrototypeOf) && getPrototypeOf;
+var getPrototypeOf = getNative(Object, 'getPrototypeOf');
/**
* Checks if `value` is a plain object, that is, an object created by the
@@ -50,8 +50,8 @@ var isPlainObject = !getPrototypeOf ? shimIsPlainObject : function(value) {
if (!(value && objToString.call(value) == objectTag)) {
return false;
}
- var valueOf = value.valueOf,
- objProto = isNative(valueOf) && (objProto = getPrototypeOf(valueOf)) && getPrototypeOf(objProto);
+ var valueOf = getNative(value, 'valueOf'),
+ objProto = valueOf && (objProto = getPrototypeOf(valueOf)) && getPrototypeOf(objProto);
return objProto
? (value == objProto || getPrototypeOf(value) == objProto)
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/lt.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/lt.js
new file mode 100644
index 00000000000..4439870a318
--- /dev/null
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/lt.js
@@ -0,0 +1,25 @@
+/**
+ * Checks if `value` is less than `other`.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @returns {boolean} Returns `true` if `value` is less than `other`, else `false`.
+ * @example
+ *
+ * _.lt(1, 3);
+ * // => true
+ *
+ * _.lt(3, 3);
+ * // => false
+ *
+ * _.lt(3, 1);
+ * // => false
+ */
+function lt(value, other) {
+ return value < other;
+}
+
+module.exports = lt;
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/lte.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/lte.js
new file mode 100644
index 00000000000..e2b8ab15a06
--- /dev/null
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang/lte.js
@@ -0,0 +1,25 @@
+/**
+ * Checks if `value` is less than or equal to `other`.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to compare.
+ * @param {*} other The other value to compare.
+ * @returns {boolean} Returns `true` if `value` is less than or equal to `other`, else `false`.
+ * @example
+ *
+ * _.lte(1, 3);
+ * // => true
+ *
+ * _.lte(3, 3);
+ * // => true
+ *
+ * _.lte(3, 1);
+ * // => false
+ */
+function lte(value, other) {
+ return value <= other;
+}
+
+module.exports = lte;
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/math/max.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/math/max.js
index 68088410d78..194c800692f 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/math/max.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/math/max.js
@@ -1,5 +1,8 @@
-var arrayMax = require('../internal/arrayMax'),
- createExtremum = require('../internal/createExtremum');
+var createExtremum = require('../internal/createExtremum'),
+ gt = require('../lang/gt');
+
+/** Used as references for `-Infinity` and `Infinity`. */
+var NEGATIVE_INFINITY = Number.NEGATIVE_INFINITY;
/**
* Gets the maximum value of `collection`. If `collection` is empty or falsey
@@ -48,6 +51,6 @@ var arrayMax = require('../internal/arrayMax'),
* _.max(users, 'age');
* // => { 'user': 'fred', 'age': 40 }
*/
-var max = createExtremum(arrayMax);
+var max = createExtremum(gt, NEGATIVE_INFINITY);
module.exports = max;
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/math/min.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/math/min.js
index 4381b0a3d73..8a98a85aae1 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/math/min.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/math/min.js
@@ -1,5 +1,8 @@
-var arrayMin = require('../internal/arrayMin'),
- createExtremum = require('../internal/createExtremum');
+var createExtremum = require('../internal/createExtremum'),
+ lt = require('../lang/lt');
+
+/** Used as references for `-Infinity` and `Infinity`. */
+var POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
/**
* Gets the minimum value of `collection`. If `collection` is empty or falsey
@@ -48,6 +51,6 @@ var arrayMin = require('../internal/arrayMin'),
* _.min(users, 'age');
* // => { 'user': 'barney', 'age': 36 }
*/
-var min = createExtremum(arrayMin, true);
+var min = createExtremum(lt, POSITIVE_INFINITY);
module.exports = min;
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/get.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/get.js
index 7e8a3103bd6..0bb59b8dca4 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/get.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/get.js
@@ -2,7 +2,7 @@ var baseGet = require('../internal/baseGet'),
toPath = require('../internal/toPath');
/**
- * Gets the property value of `path` on `object`. If the resolved value is
+ * Gets the property value at `path` of `object`. If the resolved value is
* `undefined` the `defaultValue` is used in its place.
*
* @static
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/has.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/has.js
index f208f8a01be..f356243eba6 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/has.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/has.js
@@ -1,6 +1,10 @@
var baseGet = require('../internal/baseGet'),
baseSlice = require('../internal/baseSlice'),
+ isArguments = require('../lang/isArguments'),
+ isArray = require('../lang/isArray'),
+ isIndex = require('../internal/isIndex'),
isKey = require('../internal/isKey'),
+ isLength = require('../internal/isLength'),
last = require('../array/last'),
toPath = require('../internal/toPath');
@@ -40,10 +44,14 @@ function has(object, path) {
if (!result && !isKey(path)) {
path = toPath(path);
object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
+ if (object == null) {
+ return false;
+ }
path = last(path);
- result = object != null && hasOwnProperty.call(object, path);
+ result = hasOwnProperty.call(object, path);
}
- return result;
+ return result || (isLength(object.length) && isIndex(path, object.length) &&
+ (isArray(object) || isArguments(object)));
}
module.exports = has;
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/keys.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/keys.js
index 5214c776bf1..a87551439f3 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/keys.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/keys.js
@@ -1,10 +1,10 @@
-var isArrayLike = require('../internal/isArrayLike'),
- isNative = require('../lang/isNative'),
+var getNative = require('../internal/getNative'),
+ isArrayLike = require('../internal/isArrayLike'),
isObject = require('../lang/isObject'),
shimKeys = require('../internal/shimKeys');
/* Native method references for those with the same name as other `lodash` methods. */
-var nativeKeys = isNative(nativeKeys = Object.keys) && nativeKeys;
+var nativeKeys = getNative(Object, 'keys');
/**
* Creates an array of the own enumerable property names of `object`.
@@ -34,7 +34,7 @@ var nativeKeys = isNative(nativeKeys = Object.keys) && nativeKeys;
* // => ['0', '1']
*/
var keys = !nativeKeys ? shimKeys : function(object) {
- var Ctor = object != null && object.constructor;
+ var Ctor = object == null ? null : object.constructor;
if ((typeof Ctor == 'function' && Ctor.prototype === object) ||
(typeof object != 'function' && isArrayLike(object))) {
return shimKeys(object);
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/keysIn.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/keysIn.js
index 72a1c5e26e1..45a85d79546 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/keysIn.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/keysIn.js
@@ -2,8 +2,7 @@ var isArguments = require('../lang/isArguments'),
isArray = require('../lang/isArray'),
isIndex = require('../internal/isIndex'),
isLength = require('../internal/isLength'),
- isObject = require('../lang/isObject'),
- support = require('../support');
+ isObject = require('../lang/isObject');
/** Used for native method references. */
var objectProto = Object.prototype;
@@ -42,7 +41,7 @@ function keysIn(object) {
}
var length = object.length;
length = (length && isLength(length) &&
- (isArray(object) || (support.nonEnumArgs && isArguments(object))) && length) || 0;
+ (isArray(object) || isArguments(object)) && length) || 0;
var Ctor = object.constructor,
index = -1,
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/pairs.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/pairs.js
index 64de3edbed7..fd4644cea2c 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/pairs.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/pairs.js
@@ -1,4 +1,5 @@
-var keys = require('./keys');
+var keys = require('./keys'),
+ toObject = require('../internal/toObject');
/**
* Creates a two dimensional array of the key-value pairs for `object`,
@@ -15,6 +16,8 @@ var keys = require('./keys');
* // => [['barney', 36], ['fred', 40]] (iteration order is not guaranteed)
*/
function pairs(object) {
+ object = toObject(object);
+
var index = -1,
props = keys(object),
length = props.length,
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/set.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/set.js
index 02caf318dcc..423faab8248 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/set.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/set.js
@@ -35,13 +35,13 @@ function set(object, path, value) {
var index = -1,
length = path.length,
- endIndex = length - 1,
+ lastIndex = length - 1,
nested = object;
while (nested != null && ++index < length) {
var key = path[index];
if (isObject(nested)) {
- if (index == endIndex) {
+ if (index == lastIndex) {
nested[key] = value;
} else if (nested[key] == null) {
nested[key] = isIndex(path[index + 1]) ? [] : {};
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/transform.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/transform.js
index 4537ba1a098..9f6b8ce7ed7 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/transform.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/object/transform.js
@@ -46,7 +46,7 @@ function transform(object, iteratee, accumulator, thisArg) {
if (isArr) {
accumulator = isArray(object) ? new Ctor : [];
} else {
- accumulator = baseCreate(isFunction(Ctor) && Ctor.prototype);
+ accumulator = baseCreate(isFunction(Ctor) ? Ctor.prototype : null);
}
} else {
accumulator = {};
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/package.json b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/package.json
index 746d63bf122..89f1aa64914 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/package.json
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/package.json
@@ -1,6 +1,6 @@
{
"name": "lodash",
- "version": "3.8.0",
+ "version": "3.9.3",
"description": "The modern build of lodash modular utilities.",
"homepage": "https://lodash.com/",
"icon": "https://lodash.com/icon.svg",
@@ -53,11 +53,11 @@
"bugs": {
"url": "https://github.com/lodash/lodash/issues"
},
- "_id": "lodash@3.8.0",
- "_shasum": "376eb98bdcd9382a9365c33c4cb8250de1325b91",
+ "_id": "lodash@3.9.3",
+ "_shasum": "0159e86832feffc6d61d852b12a953b99496bd32",
"_from": "lodash@>=3.2.0 <4.0.0",
- "_npmVersion": "2.9.0",
- "_nodeVersion": "0.12.2",
+ "_npmVersion": "2.10.1",
+ "_nodeVersion": "2.0.2",
"_npmUser": {
"name": "jdalton",
"email": "john.david.dalton@gmail.com"
@@ -85,10 +85,10 @@
}
],
"dist": {
- "shasum": "376eb98bdcd9382a9365c33c4cb8250de1325b91",
- "tarball": "http://registry.npmjs.org/lodash/-/lodash-3.8.0.tgz"
+ "shasum": "0159e86832feffc6d61d852b12a953b99496bd32",
+ "tarball": "http://registry.npmjs.org/lodash/-/lodash-3.9.3.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/lodash/-/lodash-3.8.0.tgz",
+ "_resolved": "https://registry.npmjs.org/lodash/-/lodash-3.9.3.tgz",
"readme": "ERROR: No README data found!"
}
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/escape.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/escape.js
index c4e72cc08b3..cd08a5ddfbd 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/escape.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/escape.js
@@ -13,7 +13,7 @@ var reUnescapedHtml = /[&<>"'`]/g,
* use a third-party library like [_he_](https://mths.be/he).
*
* Though the ">" character is escaped for symmetry, characters like
- * ">" and "/" don't require escaping in HTML and have no special meaning
+ * ">" and "/" don't need escaping in HTML and have no special meaning
* unless they're part of a tag or unquoted attribute value.
* See [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
* (under "semi-related fun fact") for more details.
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/pad.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/pad.js
index df37ded03dc..60b5c1332d6 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/pad.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/pad.js
@@ -9,7 +9,7 @@ var ceil = Math.ceil,
var nativeIsFinite = global.isFinite;
/**
- * Pads `string` on the left and right sides if it is shorter than `length`.
+ * Pads `string` on the left and right sides if it's shorter than `length`.
* Padding characters are truncated if they can't be evenly divided by `length`.
*
* @static
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/padLeft.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/padLeft.js
index af5a498b2ec..bb0c94d0cdf 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/padLeft.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/padLeft.js
@@ -1,7 +1,7 @@
var createPadDir = require('../internal/createPadDir');
/**
- * Pads `string` on the left side if it is shorter than `length`. Padding
+ * Pads `string` on the left side if it's shorter than `length`. Padding
* characters are truncated if they exceed `length`.
*
* @static
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/padRight.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/padRight.js
index e78daa5a192..dc12f55993a 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/padRight.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/padRight.js
@@ -1,7 +1,7 @@
var createPadDir = require('../internal/createPadDir');
/**
- * Pads `string` on the right side if it is shorter than `length`. Padding
+ * Pads `string` on the right side if it's shorter than `length`. Padding
* characters are truncated if they exceed `length`.
*
* @static
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/trunc.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/trunc.js
index b8e6117f2d1..8d9b309b9b2 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/trunc.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/string/trunc.js
@@ -11,7 +11,7 @@ var DEFAULT_TRUNC_LENGTH = 30,
var reFlags = /\w*$/;
/**
- * Truncates `string` if it is longer than the given maximum string length.
+ * Truncates `string` if it's longer than the given maximum string length.
* The last characters of the truncated string are replaced with the omission
* string which defaults to "...".
*
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/support.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/support.js
index 1964a44e2af..12c97f51c40 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/support.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/support.js
@@ -1,11 +1,5 @@
-/** Used for native method references. */
-var objectProto = Object.prototype;
-
/** Used to detect DOM support. */
-var document = (document = global.window) && document.document;
-
-/** Native method references. */
-var propertyIsEnumerable = objectProto.propertyIsEnumerable;
+var document = (document = global.window) ? document.document : null;
/**
* An object environment feature flags.
@@ -18,7 +12,6 @@ var support = {};
(function(x) {
var Ctor = function() { this.x = x; },
- args = arguments,
object = { '0': x, 'length': x },
props = [];
@@ -26,24 +19,6 @@ var support = {};
for (var key in new Ctor) { props.push(key); }
/**
- * Detect if functions can be decompiled by `Function#toString`
- * (all but Firefox OS certified apps, older Opera mobile browsers, and
- * the PlayStation 3; forced `false` for Windows 8 apps).
- *
- * @memberOf _.support
- * @type boolean
- */
- support.funcDecomp = /\bthis\b/.test(function() { return this; });
-
- /**
- * Detect if `Function#name` is supported (all but IE).
- *
- * @memberOf _.support
- * @type boolean
- */
- support.funcNames = typeof Function.name == 'string';
-
- /**
* Detect if the DOM is supported.
*
* @memberOf _.support
@@ -54,24 +29,6 @@ var support = {};
} catch(e) {
support.dom = false;
}
-
- /**
- * Detect if `arguments` object indexes are non-enumerable.
- *
- * In Firefox < 4, IE < 9, PhantomJS, and Safari < 5.1 `arguments` object
- * indexes are non-enumerable. Chrome < 25 and Node.js < 0.11.0 treat
- * `arguments` object indexes as non-enumerable and fail `hasOwnProperty`
- * checks for indexes that exceed the number of function parameters and
- * whose associated argument values are `0`.
- *
- * @memberOf _.support
- * @type boolean
- */
- try {
- support.nonEnumArgs = !propertyIsEnumerable.call(args, 1);
- } catch(e) {
- support.nonEnumArgs = true;
- }
}(1, 0));
module.exports = support;
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/matches.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/matches.js
index 6b14143db72..a182637bdb5 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/matches.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/matches.js
@@ -2,7 +2,7 @@ var baseClone = require('../internal/baseClone'),
baseMatches = require('../internal/baseMatches');
/**
- * Creates a function which performs a deep comparison between a given object
+ * Creates a function that performs a deep comparison between a given object
* and `source`, returning `true` if the given object has equivalent property
* values, else `false`.
*
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/matchesProperty.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/matchesProperty.js
index 05a7efb1c0e..91e51a56cbf 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/matchesProperty.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/matchesProperty.js
@@ -2,7 +2,7 @@ var baseClone = require('../internal/baseClone'),
baseMatchesProperty = require('../internal/baseMatchesProperty');
/**
- * Creates a function which compares the property value of `path` on a given
+ * Creates a function that compares the property value of `path` on a given
* object to `value`.
*
* **Note:** This method supports comparing arrays, booleans, `Date` objects,
@@ -13,7 +13,7 @@ var baseClone = require('../internal/baseClone'),
* @memberOf _
* @category Utility
* @param {Array|string} path The path of the property to get.
- * @param {*} value The value to compare.
+ * @param {*} srcValue The value to match.
* @returns {Function} Returns the new function.
* @example
*
@@ -25,8 +25,8 @@ var baseClone = require('../internal/baseClone'),
* _.find(users, _.matchesProperty('user', 'fred'));
* // => { 'user': 'fred' }
*/
-function matchesProperty(path, value) {
- return baseMatchesProperty(path, baseClone(value, true));
+function matchesProperty(path, srcValue) {
+ return baseMatchesProperty(path, baseClone(srcValue, true));
}
module.exports = matchesProperty;
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/method.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/method.js
index 6a7281af55c..e315b7f355c 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/method.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/method.js
@@ -2,12 +2,14 @@ var invokePath = require('../internal/invokePath'),
restParam = require('../function/restParam');
/**
- * Creates a function which invokes the method at `path` on a given object.
+ * Creates a function that invokes the method at `path` on a given object.
+ * Any additional arguments are provided to the invoked method.
*
* @static
* @memberOf _
* @category Utility
* @param {Array|string} path The path of the method to invoke.
+ * @param {...*} [args] The arguments to invoke the method with.
* @returns {Function} Returns the new function.
* @example
*
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/methodOf.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/methodOf.js
index 9286cc25f1b..f61b7822723 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/methodOf.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/methodOf.js
@@ -2,13 +2,15 @@ var invokePath = require('../internal/invokePath'),
restParam = require('../function/restParam');
/**
- * The opposite of `_.method`; this method creates a function which invokes
- * the method at a given path on `object`.
+ * The opposite of `_.method`; this method creates a function that invokes
+ * the method at a given path on `object`. Any additional arguments are
+ * provided to the invoked method.
*
* @static
* @memberOf _
* @category Utility
* @param {Object} object The object to query.
+ * @param {...*} [args] The arguments to invoke the method with.
* @returns {Function} Returns the new function.
* @example
*
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/mixin.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/mixin.js
index 926042b744e..1340464b42c 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/mixin.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/mixin.js
@@ -35,9 +35,6 @@ var push = arrayProto.push;
* });
* }
*
- * // use `_.runInContext` to avoid conflicts (esp. in Node.js)
- * var _ = require('lodash').runInContext();
- *
* _.mixin({ 'vowels': vowels });
* _.vowels('fred');
* // => ['e']
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/noop.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/noop.js
index 344adea0c34..56d651344aa 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/noop.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/noop.js
@@ -1,5 +1,5 @@
/**
- * A no-operation function which returns `undefined` regardless of the
+ * A no-operation function that returns `undefined` regardless of the
* arguments it receives.
*
* @static
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/property.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/property.js
index e149f6d10c8..ddfd59798fa 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/property.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/property.js
@@ -3,7 +3,7 @@ var baseProperty = require('../internal/baseProperty'),
isKey = require('../internal/isKey');
/**
- * Creates a function which returns the property value at `path` on a
+ * Creates a function that returns the property value at `path` on a
* given object.
*
* @static
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/propertyOf.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/propertyOf.js
index a3b9c2799c6..093c65978b1 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/propertyOf.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/propertyOf.js
@@ -2,7 +2,7 @@ var baseGet = require('../internal/baseGet'),
toPath = require('../internal/toPath');
/**
- * The opposite of `_.property`; this method creates a function which returns
+ * The opposite of `_.property`; this method creates a function that returns
* the property value at a given path on `object`.
*
* @static
diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/times.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/times.js
index 28e6f026303..dba31290156 100644
--- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/times.js
+++ b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/times.js
@@ -8,7 +8,7 @@ var nativeIsFinite = global.isFinite,
nativeMin = Math.min;
/** Used as references for the maximum length and index of an array. */
-var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1;
+var MAX_ARRAY_LENGTH = 4294967295;
/**
* Invokes the iteratee function `n` times, returning an array of the results
diff --git a/tools/eslint/node_modules/js-yaml/package.json b/tools/eslint/node_modules/js-yaml/package.json
index f52da7b733b..724ed14a24d 100644
--- a/tools/eslint/node_modules/js-yaml/package.json
+++ b/tools/eslint/node_modules/js-yaml/package.json
@@ -1,6 +1,6 @@
{
"name": "js-yaml",
- "version": "3.3.0",
+ "version": "3.3.1",
"description": "YAML 1.2 parser and serializer",
"keywords": [
"yaml",
@@ -56,12 +56,12 @@
"scripts": {
"test": "make test"
},
- "gitHead": "9cc570a50a767b08c3b0fcd0e61efec880aa7c11",
+ "gitHead": "c50f9936bd1e99d64a54d30400e377f4fda401c5",
"bugs": {
"url": "https://github.com/nodeca/js-yaml/issues"
},
- "_id": "js-yaml@3.3.0",
- "_shasum": "cb6422d39168dbde419fecb7fd06fbe27ad56210",
+ "_id": "js-yaml@3.3.1",
+ "_shasum": "ca1acd3423ec275d12140a7bab51db015ba0b3c0",
"_from": "js-yaml@>=3.2.5 <4.0.0",
"_npmVersion": "1.4.28",
"_npmUser": {
@@ -75,10 +75,10 @@
}
],
"dist": {
- "shasum": "cb6422d39168dbde419fecb7fd06fbe27ad56210",
- "tarball": "http://registry.npmjs.org/js-yaml/-/js-yaml-3.3.0.tgz"
+ "shasum": "ca1acd3423ec275d12140a7bab51db015ba0b3c0",
+ "tarball": "http://registry.npmjs.org/js-yaml/-/js-yaml-3.3.1.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.3.0.tgz",
+ "_resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.3.1.tgz",
"readme": "ERROR: No README data found!"
}
diff --git a/tools/eslint/node_modules/minimatch/LICENSE b/tools/eslint/node_modules/minimatch/LICENSE
index 05a4010949c..19129e315fe 100644
--- a/tools/eslint/node_modules/minimatch/LICENSE
+++ b/tools/eslint/node_modules/minimatch/LICENSE
@@ -1,23 +1,15 @@
-Copyright 2009, 2010, 2011 Isaac Z. Schlueter.
-All rights reserved.
+The ISC License
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following
-conditions:
+Copyright (c) Isaac Z. Schlueter and Contributors
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/tools/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json b/tools/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json
index a63236feb7d..ede6efefa07 100644
--- a/tools/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json
+++ b/tools/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json
@@ -44,13 +44,30 @@
"android-browser/4.2..latest"
]
},
- "readme": "# balanced-match\n\nMatch balanced string pairs, like `{` and `}` or `<b>` and `</b>`.\n\n[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match)\n[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match)\n\n[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match)\n\n## Example\n\nGet the first matching pair of braces:\n\n```js\nvar balanced = require('balanced-match');\n\nconsole.log(balanced('{', '}', 'pre{in{nested}}post'));\nconsole.log(balanced('{', '}', 'pre{first}between{second}post'));\n```\n\nThe matches are:\n\n```bash\n$ node example.js\n{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' }\n{ start: 3,\n end: 9,\n pre: 'pre',\n body: 'first',\n post: 'between{second}post' }\n```\n\n## API\n\n### var m = balanced(a, b, str)\n\nFor the first non-nested matching pair of `a` and `b` in `str`, return an\nobject with those keys:\n\n* **start** the index of the first match of `a`\n* **end** the index of the matching `b`\n* **pre** the preamble, `a` and `b` not included\n* **body** the match, `a` and `b` not included\n* **post** the postscript, `a` and `b` not included\n\nIf there's no match, `undefined` will be returned.\n\nIf the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']`.\n\n## Installation\n\nWith [npm](https://npmjs.org) do:\n\n```bash\nnpm install balanced-match\n```\n\n## License\n\n(MIT)\n\nCopyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n",
- "readmeFilename": "README.md",
+ "gitHead": "ba40ed78e7114a4a67c51da768a100184dead39c",
"bugs": {
"url": "https://github.com/juliangruber/balanced-match/issues"
},
"_id": "balanced-match@0.2.0",
"_shasum": "38f6730c03aab6d5edbb52bd934885e756d71674",
"_from": "balanced-match@>=0.2.0 <0.3.0",
- "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.2.0.tgz"
+ "_npmVersion": "2.1.8",
+ "_nodeVersion": "0.10.32",
+ "_npmUser": {
+ "name": "juliangruber",
+ "email": "julian@juliangruber.com"
+ },
+ "maintainers": [
+ {
+ "name": "juliangruber",
+ "email": "julian@juliangruber.com"
+ }
+ ],
+ "dist": {
+ "shasum": "38f6730c03aab6d5edbb52bd934885e756d71674",
+ "tarball": "http://registry.npmjs.org/balanced-match/-/balanced-match-0.2.0.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.2.0.tgz",
+ "readme": "ERROR: No README data found!"
}
diff --git a/tools/eslint/node_modules/minimatch/package.json b/tools/eslint/node_modules/minimatch/package.json
index b438bdb9458..986de93892a 100644
--- a/tools/eslint/node_modules/minimatch/package.json
+++ b/tools/eslint/node_modules/minimatch/package.json
@@ -6,7 +6,7 @@
},
"name": "minimatch",
"description": "a glob matcher in javascript",
- "version": "2.0.7",
+ "version": "2.0.8",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/minimatch.git"
@@ -28,31 +28,28 @@
"standard": "^3.7.2",
"tap": ""
},
- "license": {
- "type": "MIT",
- "url": "http://github.com/isaacs/minimatch/raw/master/LICENSE"
- },
+ "license": "ISC",
"files": [
"minimatch.js",
"browser.js"
],
- "gitHead": "4bd6dc22c248c7ea07cc49d63181fe6f6aafae9c",
+ "gitHead": "0bc7d9c4b2bc816502184862b45bd090de3406a3",
"bugs": {
"url": "https://github.com/isaacs/minimatch/issues"
},
- "homepage": "https://github.com/isaacs/minimatch",
- "_id": "minimatch@2.0.7",
- "_shasum": "d23652ab10e663e7d914602e920e21f9f66492be",
+ "homepage": "https://github.com/isaacs/minimatch#readme",
+ "_id": "minimatch@2.0.8",
+ "_shasum": "0bc20f6bf3570a698ef0ddff902063c6cabda6bf",
"_from": "minimatch@>=2.0.1 <3.0.0",
- "_npmVersion": "2.7.6",
- "_nodeVersion": "1.7.1",
+ "_npmVersion": "2.10.0",
+ "_nodeVersion": "2.0.1",
"_npmUser": {
"name": "isaacs",
"email": "isaacs@npmjs.com"
},
"dist": {
- "shasum": "d23652ab10e663e7d914602e920e21f9f66492be",
- "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-2.0.7.tgz"
+ "shasum": "0bc20f6bf3570a698ef0ddff902063c6cabda6bf",
+ "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-2.0.8.tgz"
},
"maintainers": [
{
@@ -61,6 +58,6 @@
}
],
"directories": {},
- "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.7.tgz",
+ "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.8.tgz",
"readme": "ERROR: No README data found!"
}
diff --git a/tools/eslint/node_modules/mkdirp/.npmignore b/tools/eslint/node_modules/mkdirp/.npmignore
deleted file mode 100644
index 9303c347ee6..00000000000
--- a/tools/eslint/node_modules/mkdirp/.npmignore
+++ /dev/null
@@ -1,2 +0,0 @@
-node_modules/
-npm-debug.log \ No newline at end of file
diff --git a/tools/eslint/node_modules/mkdirp/.travis.yml b/tools/eslint/node_modules/mkdirp/.travis.yml
index c693a939df9..74c57bf15e2 100644
--- a/tools/eslint/node_modules/mkdirp/.travis.yml
+++ b/tools/eslint/node_modules/mkdirp/.travis.yml
@@ -1,5 +1,8 @@
language: node_js
node_js:
- - 0.6
- - 0.8
+ - "0.8"
- "0.10"
+ - "0.12"
+ - "iojs"
+before_install:
+ - npm install -g npm@~1.4.6
diff --git a/tools/eslint/node_modules/mkdirp/index.js b/tools/eslint/node_modules/mkdirp/index.js
index a1742b20694..6ce241b58c1 100644
--- a/tools/eslint/node_modules/mkdirp/index.js
+++ b/tools/eslint/node_modules/mkdirp/index.js
@@ -1,5 +1,6 @@
var path = require('path');
var fs = require('fs');
+var _0777 = parseInt('0777', 8);
module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;
@@ -16,7 +17,7 @@ function mkdirP (p, opts, f, made) {
var xfs = opts.fs || fs;
if (mode === undefined) {
- mode = 0777 & (~process.umask());
+ mode = _0777 & (~process.umask());
}
if (!made) made = null;
@@ -60,7 +61,7 @@ mkdirP.sync = function sync (p, opts, made) {
var xfs = opts.fs || fs;
if (mode === undefined) {
- mode = 0777 & (~process.umask());
+ mode = _0777 & (~process.umask());
}
if (!made) made = null;
diff --git a/tools/eslint/node_modules/mkdirp/package.json b/tools/eslint/node_modules/mkdirp/package.json
index b1493bac2c1..70a6cbad7ce 100644
--- a/tools/eslint/node_modules/mkdirp/package.json
+++ b/tools/eslint/node_modules/mkdirp/package.json
@@ -1,13 +1,13 @@
{
"name": "mkdirp",
"description": "Recursively mkdir, like `mkdir -p`",
- "version": "0.5.0",
+ "version": "0.5.1",
"author": {
"name": "James Halliday",
"email": "mail@substack.net",
"url": "http://substack.net"
},
- "main": "./index",
+ "main": "index.js",
"keywords": [
"mkdir",
"directory"
@@ -23,27 +23,30 @@
"minimist": "0.0.8"
},
"devDependencies": {
- "tap": "~0.4.0",
- "mock-fs": "~2.2.0"
+ "tap": "1",
+ "mock-fs": "2 >=2.7.0"
},
"bin": {
"mkdirp": "bin/cmd.js"
},
"license": "MIT",
+ "gitHead": "d4eff0f06093aed4f387e88e9fc301cb76beedc7",
"bugs": {
"url": "https://github.com/substack/node-mkdirp/issues"
},
- "homepage": "https://github.com/substack/node-mkdirp",
- "_id": "mkdirp@0.5.0",
- "dist": {
- "shasum": "1d73076a6df986cd9344e15e71fcc05a4c9abf12",
- "tarball": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.0.tgz"
- },
+ "homepage": "https://github.com/substack/node-mkdirp#readme",
+ "_id": "mkdirp@0.5.1",
+ "_shasum": "30057438eac6cf7f8c4767f38648d6697d75c903",
"_from": "mkdirp@>=0.5.0 <0.6.0",
- "_npmVersion": "1.4.3",
+ "_npmVersion": "2.9.0",
+ "_nodeVersion": "2.0.0",
"_npmUser": {
"name": "substack",
- "email": "mail@substack.net"
+ "email": "substack@gmail.com"
+ },
+ "dist": {
+ "shasum": "30057438eac6cf7f8c4767f38648d6697d75c903",
+ "tarball": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz"
},
"maintainers": [
{
@@ -52,8 +55,6 @@
}
],
"directories": {},
- "_shasum": "1d73076a6df986cd9344e15e71fcc05a4c9abf12",
- "_resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.0.tgz",
- "readme": "# mkdirp\n\nLike `mkdir -p`, but in node.js!\n\n[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp)\n\n# example\n\n## pow.js\n\n```js\nvar mkdirp = require('mkdirp');\n \nmkdirp('/tmp/foo/bar/baz', function (err) {\n if (err) console.error(err)\n else console.log('pow!')\n});\n```\n\nOutput\n\n```\npow!\n```\n\nAnd now /tmp/foo/bar/baz exists, huzzah!\n\n# methods\n\n```js\nvar mkdirp = require('mkdirp');\n```\n\n## mkdirp(dir, opts, cb)\n\nCreate a new directory and any necessary subdirectories at `dir` with octal\npermission string `opts.mode`. If `opts` is a non-object, it will be treated as\nthe `opts.mode`.\n\nIf `opts.mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\n`cb(err, made)` fires with the error or the first directory `made`\nthat had to be created, if any.\n\nYou can optionally pass in an alternate `fs` implementation by passing in\n`opts.fs`. Your implementation should have `opts.fs.mkdir(path, mode, cb)` and\n`opts.fs.stat(path, cb)`.\n\n## mkdirp.sync(dir, opts)\n\nSynchronously create a new directory and any necessary subdirectories at `dir`\nwith octal permission string `opts.mode`. If `opts` is a non-object, it will be\ntreated as the `opts.mode`.\n\nIf `opts.mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\nReturns the first directory that had to be created, if any.\n\nYou can optionally pass in an alternate `fs` implementation by passing in\n`opts.fs`. Your implementation should have `opts.fs.mkdirSync(path, mode)` and\n`opts.fs.statSync(path)`.\n\n# usage\n\nThis package also ships with a `mkdirp` command.\n\n```\nusage: mkdirp [DIR1,DIR2..] {OPTIONS}\n\n Create each supplied directory including any necessary parent directories that\n don't yet exist.\n \n If the directory already exists, do nothing.\n\nOPTIONS are:\n\n -m, --mode If a directory needs to be created, set the mode as an octal\n permission string.\n\n```\n\n# install\n\nWith [npm](http://npmjs.org) do:\n\n```\nnpm install mkdirp\n```\n\nto get the library, or\n\n```\nnpm install -g mkdirp\n```\n\nto get the command.\n\n# license\n\nMIT\n",
- "readmeFilename": "readme.markdown"
+ "_resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
+ "readme": "ERROR: No README data found!"
}
diff --git a/tools/eslint/node_modules/mkdirp/test/chmod.js b/tools/eslint/node_modules/mkdirp/test/chmod.js
index 520dcb8e9b5..6a404b932f9 100644
--- a/tools/eslint/node_modules/mkdirp/test/chmod.js
+++ b/tools/eslint/node_modules/mkdirp/test/chmod.js
@@ -2,6 +2,9 @@ var mkdirp = require('../').mkdirp;
var path = require('path');
var fs = require('fs');
var test = require('tap').test;
+var _0777 = parseInt('0777', 8);
+var _0755 = parseInt('0755', 8);
+var _0744 = parseInt('0744', 8);
var ps = [ '', 'tmp' ];
@@ -13,20 +16,20 @@ for (var i = 0; i < 25; i++) {
var file = ps.join('/');
test('chmod-pre', function (t) {
- var mode = 0744
+ var mode = _0744
mkdirp(file, mode, function (er) {
t.ifError(er, 'should not error');
fs.stat(file, function (er, stat) {
t.ifError(er, 'should exist');
t.ok(stat && stat.isDirectory(), 'should be directory');
- t.equal(stat && stat.mode & 0777, mode, 'should be 0744');
+ t.equal(stat && stat.mode & _0777, mode, 'should be 0744');
t.end();
});
});
});
test('chmod', function (t) {
- var mode = 0755
+ var mode = _0755
mkdirp(file, mode, function (er) {
t.ifError(er, 'should not error');
fs.stat(file, function (er, stat) {
diff --git a/tools/eslint/node_modules/mkdirp/test/clobber.js b/tools/eslint/node_modules/mkdirp/test/clobber.js
index 0eb70998700..2433b9ad548 100644
--- a/tools/eslint/node_modules/mkdirp/test/clobber.js
+++ b/tools/eslint/node_modules/mkdirp/test/clobber.js
@@ -2,6 +2,7 @@ var mkdirp = require('../').mkdirp;
var path = require('path');
var fs = require('fs');
var test = require('tap').test;
+var _0755 = parseInt('0755', 8);
var ps = [ '', 'tmp' ];
@@ -29,7 +30,7 @@ test('clobber-pre', function (t) {
test('clobber', function (t) {
t.plan(2);
- mkdirp(file, 0755, function (err) {
+ mkdirp(file, _0755, function (err) {
t.ok(err);
t.equal(err.code, 'ENOTDIR');
t.end();
diff --git a/tools/eslint/node_modules/mkdirp/test/mkdirp.js b/tools/eslint/node_modules/mkdirp/test/mkdirp.js
index 3b624ddbeb0..eaa8921c7f1 100644
--- a/tools/eslint/node_modules/mkdirp/test/mkdirp.js
+++ b/tools/eslint/node_modules/mkdirp/test/mkdirp.js
@@ -3,6 +3,8 @@ var path = require('path');
var fs = require('fs');
var exists = fs.exists || path.exists;
var test = require('tap').test;
+var _0777 = parseInt('0777', 8);
+var _0755 = parseInt('0755', 8);
test('woo', function (t) {
t.plan(5);
@@ -12,13 +14,13 @@ test('woo', function (t) {
var file = '/tmp/' + [x,y,z].join('/');
- mkdirp(file, 0755, function (err) {
+ mkdirp(file, _0755, function (err) {
t.ifError(err);
exists(file, function (ex) {
t.ok(ex, 'file created');
fs.stat(file, function (err, stat) {
t.ifError(err);
- t.equal(stat.mode & 0777, 0755);
+ t.equal(stat.mode & _0777, _0755);
t.ok(stat.isDirectory(), 'target not a directory');
})
})
diff --git a/tools/eslint/node_modules/mkdirp/test/opts_fs.js b/tools/eslint/node_modules/mkdirp/test/opts_fs.js
index f1fbeca146d..97186b62e0b 100644
--- a/tools/eslint/node_modules/mkdirp/test/opts_fs.js
+++ b/tools/eslint/node_modules/mkdirp/test/opts_fs.js
@@ -2,6 +2,8 @@ var mkdirp = require('../');
var path = require('path');
var test = require('tap').test;
var mockfs = require('mock-fs');
+var _0777 = parseInt('0777', 8);
+var _0755 = parseInt('0755', 8);
test('opts.fs', function (t) {
t.plan(5);
@@ -13,13 +15,13 @@ test('opts.fs', function (t) {
var file = '/beep/boop/' + [x,y,z].join('/');
var xfs = mockfs.fs();
- mkdirp(file, { fs: xfs, mode: 0755 }, function (err) {
+ mkdirp(file, { fs: xfs, mode: _0755 }, function (err) {
t.ifError(err);
xfs.exists(file, function (ex) {
t.ok(ex, 'created file');
xfs.stat(file, function (err, stat) {
t.ifError(err);
- t.equal(stat.mode & 0777, 0755);
+ t.equal(stat.mode & _0777, _0755);
t.ok(stat.isDirectory(), 'target not a directory');
});
});
diff --git a/tools/eslint/node_modules/mkdirp/test/opts_fs_sync.js b/tools/eslint/node_modules/mkdirp/test/opts_fs_sync.js
index 224b50642fe..6c370aa6e93 100644
--- a/tools/eslint/node_modules/mkdirp/test/opts_fs_sync.js
+++ b/tools/eslint/node_modules/mkdirp/test/opts_fs_sync.js
@@ -2,6 +2,8 @@ var mkdirp = require('../');
var path = require('path');
var test = require('tap').test;
var mockfs = require('mock-fs');
+var _0777 = parseInt('0777', 8);
+var _0755 = parseInt('0755', 8);
test('opts.fs sync', function (t) {
t.plan(4);
@@ -13,12 +15,12 @@ test('opts.fs sync', function (t) {
var file = '/beep/boop/' + [x,y,z].join('/');
var xfs = mockfs.fs();
- mkdirp.sync(file, { fs: xfs, mode: 0755 });
+ mkdirp.sync(file, { fs: xfs, mode: _0755 });
xfs.exists(file, function (ex) {
t.ok(ex, 'created file');
xfs.stat(file, function (err, stat) {
t.ifError(err);
- t.equal(stat.mode & 0777, 0755);
+ t.equal(stat.mode & _0777, _0755);
t.ok(stat.isDirectory(), 'target not a directory');
});
});
diff --git a/tools/eslint/node_modules/mkdirp/test/perm.js b/tools/eslint/node_modules/mkdirp/test/perm.js
index 2c975905204..fbce44b82ba 100644
--- a/tools/eslint/node_modules/mkdirp/test/perm.js
+++ b/tools/eslint/node_modules/mkdirp/test/perm.js
@@ -3,18 +3,20 @@ var path = require('path');
var fs = require('fs');
var exists = fs.exists || path.exists;
var test = require('tap').test;
+var _0777 = parseInt('0777', 8);
+var _0755 = parseInt('0755', 8);
test('async perm', function (t) {
t.plan(5);
var file = '/tmp/' + (Math.random() * (1<<30)).toString(16);
- mkdirp(file, 0755, function (err) {
+ mkdirp(file, _0755, function (err) {
t.ifError(err);
exists(file, function (ex) {
t.ok(ex, 'file created');
fs.stat(file, function (err, stat) {
t.ifError(err);
- t.equal(stat.mode & 0777, 0755);
+ t.equal(stat.mode & _0777, _0755);
t.ok(stat.isDirectory(), 'target not a directory');
})
})
@@ -22,7 +24,7 @@ test('async perm', function (t) {
});
test('async root perm', function (t) {
- mkdirp('/tmp', 0755, function (err) {
+ mkdirp('/tmp', _0755, function (err) {
if (err) t.fail(err);
t.end();
});
diff --git a/tools/eslint/node_modules/mkdirp/test/perm_sync.js b/tools/eslint/node_modules/mkdirp/test/perm_sync.js
index 327e54b2e95..398229fe54a 100644
--- a/tools/eslint/node_modules/mkdirp/test/perm_sync.js
+++ b/tools/eslint/node_modules/mkdirp/test/perm_sync.js
@@ -3,17 +3,19 @@ var path = require('path');
var fs = require('fs');
var exists = fs.exists || path.exists;
var test = require('tap').test;
+var _0777 = parseInt('0777', 8);
+var _0755 = parseInt('0755', 8);
test('sync perm', function (t) {
t.plan(4);
var file = '/tmp/' + (Math.random() * (1<<30)).toString(16) + '.json';
- mkdirp.sync(file, 0755);
+ mkdirp.sync(file, _0755);
exists(file, function (ex) {
t.ok(ex, 'file created');
fs.stat(file, function (err, stat) {
t.ifError(err);
- t.equal(stat.mode & 0777, 0755);
+ t.equal(stat.mode & _0777, _0755);
t.ok(stat.isDirectory(), 'target not a directory');
});
});
@@ -23,7 +25,7 @@ test('sync root perm', function (t) {
t.plan(3);
var file = '/tmp';
- mkdirp.sync(file, 0755);
+ mkdirp.sync(file, _0755);
exists(file, function (ex) {
t.ok(ex, 'file created');
fs.stat(file, function (err, stat) {
diff --git a/tools/eslint/node_modules/mkdirp/test/race.js b/tools/eslint/node_modules/mkdirp/test/race.js
index 7c295f410de..b0b9e183c90 100644
--- a/tools/eslint/node_modules/mkdirp/test/race.js
+++ b/tools/eslint/node_modules/mkdirp/test/race.js
@@ -3,9 +3,11 @@ var path = require('path');
var fs = require('fs');
var exists = fs.exists || path.exists;
var test = require('tap').test;
+var _0777 = parseInt('0777', 8);
+var _0755 = parseInt('0755', 8);
test('race', function (t) {
- t.plan(6);
+ t.plan(10);
var ps = [ '', 'tmp' ];
for (var i = 0; i < 25; i++) {
@@ -15,24 +17,19 @@ test('race', function (t) {
var file = ps.join('/');
var res = 2;
- mk(file, function () {
- if (--res === 0) t.end();
- });
+ mk(file);
- mk(file, function () {
- if (--res === 0) t.end();
- });
+ mk(file);
function mk (file, cb) {
- mkdirp(file, 0755, function (err) {
+ mkdirp(file, _0755, function (err) {
t.ifError(err);
exists(file, function (ex) {
t.ok(ex, 'file created');
fs.stat(file, function (err, stat) {
t.ifError(err);
- t.equal(stat.mode & 0777, 0755);
+ t.equal(stat.mode & _0777, _0755);
t.ok(stat.isDirectory(), 'target not a directory');
- if (cb) cb();
});
})
});
diff --git a/tools/eslint/node_modules/mkdirp/test/rel.js b/tools/eslint/node_modules/mkdirp/test/rel.js
index d1f175c2406..4ddb34276a7 100644
--- a/tools/eslint/node_modules/mkdirp/test/rel.js
+++ b/tools/eslint/node_modules/mkdirp/test/rel.js
@@ -3,6 +3,8 @@ var path = require('path');
var fs = require('fs');
var exists = fs.exists || path.exists;
var test = require('tap').test;
+var _0777 = parseInt('0777', 8);
+var _0755 = parseInt('0755', 8);
test('rel', function (t) {
t.plan(5);
@@ -15,14 +17,14 @@ test('rel', function (t) {
var file = [x,y,z].join('/');
- mkdirp(file, 0755, function (err) {
+ mkdirp(file, _0755, function (err) {
t.ifError(err);
exists(file, function (ex) {
t.ok(ex, 'file created');
fs.stat(file, function (err, stat) {
t.ifError(err);
process.chdir(cwd);
- t.equal(stat.mode & 0777, 0755);
+ t.equal(stat.mode & _0777, _0755);
t.ok(stat.isDirectory(), 'target not a directory');
})
})
diff --git a/tools/eslint/node_modules/mkdirp/test/root.js b/tools/eslint/node_modules/mkdirp/test/root.js
index 97ad7a2f358..9e7d079d9fc 100644
--- a/tools/eslint/node_modules/mkdirp/test/root.js
+++ b/tools/eslint/node_modules/mkdirp/test/root.js
@@ -2,12 +2,13 @@ var mkdirp = require('../');
var path = require('path');
var fs = require('fs');
var test = require('tap').test;
+var _0755 = parseInt('0755', 8);
test('root', function (t) {
// '/' on unix, 'c:/' on windows.
var file = path.resolve('/');
- mkdirp(file, 0755, function (err) {
+ mkdirp(file, _0755, function (err) {
if (err) throw err
fs.stat(file, function (er, stat) {
if (er) throw er
diff --git a/tools/eslint/node_modules/mkdirp/test/sync.js b/tools/eslint/node_modules/mkdirp/test/sync.js
index 88fa4324ee1..8c8dc938c8b 100644
--- a/tools/eslint/node_modules/mkdirp/test/sync.js
+++ b/tools/eslint/node_modules/mkdirp/test/sync.js
@@ -3,6 +3,8 @@ var path = require('path');
var fs = require('fs');
var exists = fs.exists || path.exists;
var test = require('tap').test;
+var _0777 = parseInt('0777', 8);
+var _0755 = parseInt('0755', 8);
test('sync', function (t) {
t.plan(4);
@@ -13,7 +15,7 @@ test('sync', function (t) {
var file = '/tmp/' + [x,y,z].join('/');
try {
- mkdirp.sync(file, 0755);
+ mkdirp.sync(file, _0755);
} catch (err) {
t.fail(err);
return t.end();
@@ -23,7 +25,7 @@ test('sync', function (t) {
t.ok(ex, 'file created');
fs.stat(file, function (err, stat) {
t.ifError(err);
- t.equal(stat.mode & 0777, 0755);
+ t.equal(stat.mode & _0777, _0755);
t.ok(stat.isDirectory(), 'target not a directory');
});
});
diff --git a/tools/eslint/node_modules/mkdirp/test/umask.js b/tools/eslint/node_modules/mkdirp/test/umask.js
index 82c393a006a..2033c63a414 100644
--- a/tools/eslint/node_modules/mkdirp/test/umask.js
+++ b/tools/eslint/node_modules/mkdirp/test/umask.js
@@ -3,6 +3,8 @@ var path = require('path');
var fs = require('fs');
var exists = fs.exists || path.exists;
var test = require('tap').test;
+var _0777 = parseInt('0777', 8);
+var _0755 = parseInt('0755', 8);
test('implicit mode from umask', function (t) {
t.plan(5);
@@ -18,7 +20,7 @@ test('implicit mode from umask', function (t) {
t.ok(ex, 'file created');
fs.stat(file, function (err, stat) {
t.ifError(err);
- t.equal(stat.mode & 0777, 0777 & (~process.umask()));
+ t.equal(stat.mode & _0777, _0777 & (~process.umask()));
t.ok(stat.isDirectory(), 'target not a directory');
});
})
diff --git a/tools/eslint/node_modules/mkdirp/test/umask_sync.js b/tools/eslint/node_modules/mkdirp/test/umask_sync.js
index e537fbe4bee..11a76147496 100644
--- a/tools/eslint/node_modules/mkdirp/test/umask_sync.js
+++ b/tools/eslint/node_modules/mkdirp/test/umask_sync.js
@@ -3,6 +3,8 @@ var path = require('path');
var fs = require('fs');
var exists = fs.exists || path.exists;
var test = require('tap').test;
+var _0777 = parseInt('0777', 8);
+var _0755 = parseInt('0755', 8);
test('umask sync modes', function (t) {
t.plan(4);
@@ -23,7 +25,7 @@ test('umask sync modes', function (t) {
t.ok(ex, 'file created');
fs.stat(file, function (err, stat) {
t.ifError(err);
- t.equal(stat.mode & 0777, (0777 & (~process.umask())));
+ t.equal(stat.mode & _0777, (_0777 & (~process.umask())));
t.ok(stat.isDirectory(), 'target not a directory');
});
});
diff --git a/tools/eslint/node_modules/object-assign/license b/tools/eslint/node_modules/object-assign/license
new file mode 100644
index 00000000000..654d0bfe943
--- /dev/null
+++ b/tools/eslint/node_modules/object-assign/license
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/tools/eslint/node_modules/object-assign/package.json b/tools/eslint/node_modules/object-assign/package.json
index b03ee5ac886..ab2aa9cda5e 100644
--- a/tools/eslint/node_modules/object-assign/package.json
+++ b/tools/eslint/node_modules/object-assign/package.json
@@ -1,6 +1,6 @@
{
"name": "object-assign",
- "version": "2.0.0",
+ "version": "2.1.1",
"description": "ES6 Object.assign() ponyfill",
"license": "MIT",
"repository": {
@@ -43,26 +43,26 @@
"url": "https://github.com/sindresorhus/object-assign/issues"
},
"homepage": "https://github.com/sindresorhus/object-assign",
- "_id": "object-assign@2.0.0",
- "_shasum": "f8309b09083b01261ece3ef7373f2b57b8dd7042",
+ "_id": "object-assign@2.1.1",
+ "_shasum": "43c36e5d569ff8e4816c4efa8be02d26967c18aa",
"_from": "object-assign@>=2.0.0 <3.0.0",
- "_npmVersion": "2.1.5",
- "_nodeVersion": "0.10.32",
+ "_npmVersion": "2.10.1",
+ "_nodeVersion": "0.12.4",
"_npmUser": {
"name": "sindresorhus",
"email": "sindresorhus@gmail.com"
},
+ "dist": {
+ "shasum": "43c36e5d569ff8e4816c4efa8be02d26967c18aa",
+ "tarball": "http://registry.npmjs.org/object-assign/-/object-assign-2.1.1.tgz"
+ },
"maintainers": [
{
"name": "sindresorhus",
"email": "sindresorhus@gmail.com"
}
],
- "dist": {
- "shasum": "f8309b09083b01261ece3ef7373f2b57b8dd7042",
- "tarball": "http://registry.npmjs.org/object-assign/-/object-assign-2.0.0.tgz"
- },
"directories": {},
- "_resolved": "https://registry.npmjs.org/object-assign/-/object-assign-2.0.0.tgz",
+ "_resolved": "https://registry.npmjs.org/object-assign/-/object-assign-2.1.1.tgz",
"readme": "ERROR: No README data found!"
}
diff --git a/tools/eslint/node_modules/optionator/node_modules/prelude-ls/CHANGELOG.md b/tools/eslint/node_modules/optionator/node_modules/prelude-ls/CHANGELOG.md
new file mode 100644
index 00000000000..c2de12d5672
--- /dev/null
+++ b/tools/eslint/node_modules/optionator/node_modules/prelude-ls/CHANGELOG.md
@@ -0,0 +1,99 @@
+# 1.1.2
+- add `Func.memoize`
+- fix `zip-all` and `zip-with-all` corner case (no input)
+- build with LiveScript 1.4.0
+
+# 1.1.1
+- curry `unique-by`, `minimum-by`
+
+# 1.1.0
+- added `List` functions: `maximum-by`, `minimum-by`, `unique-by`
+- added `List` functions: `at`, `elem-index`, `elem-indices`, `find-index`, `find-indices`
+- added `Str` functions: `capitalize`, `camelize`, `dasherize`
+- added `Func` function: `over` - eg. ``same-length = (==) `over` (.length)``
+- exported `Str.repeat` through main `prelude` object
+- fixed definition of `foldr` and `foldr1`, the new correct definition is backwards incompatible with the old, incorrect one
+- fixed issue with `fix`
+- improved code coverage
+
+# 1.0.3
+- build browser versions
+
+# 1.0.2
+- bug fix for `flatten` - slight change with bug fix, flattens arrays only, not array-like objects
+
+# 1.0.1
+- bug fixes for `drop-while` and `take-while`
+
+# 1.0.0
+* massive update - separated functions into separate modules
+* functions do not accept multiple types anymore - use different versions in their respective modules in some cases (eg. `Obj.map`), or use `chars` or `values` in other cases to transform into a list
+* objects are no longer transformed into functions, simply use `(obj.)` in LiveScript to do that
+* browser version now using browserify - use `prelude = require('prelude-ls')`
+* added `compact`, `split`, `flatten`, `difference`, `intersection`, `union`, `count-by`, `group-by`, `chars`, `unchars`, `apply`
+* added `lists-to-obj` which takes a list of keys and list of values and zips them up into an object, and the converse `obj-to-lists`
+* added `pairs-to-obj` which takes a list of pairs (2 element lists) and creates an object, and the converse `obj-to-pairs`
+* removed `cons`, `append` - use the concat operator
+* removed `compose` - use the compose operator
+* removed `obj-to-func` - use partially applied access (eg. `(obj.)`)
+* removed `length` - use `(.length)`
+* `sort-by` renamed to `sort-with`
+* added new `sort-by`
+* removed `compare` - just use the new `sort-by`
+* `break-it` renamed `break-list`, (`Str.break-str` for the string version)
+* added `Str.repeat` which creates a new string by repeating the input n times
+* `unfold` as alias to `unfoldr` is no longer used
+* fixed up style and compiled with LiveScript 1.1.1
+* use Make instead of Slake
+* greatly improved tests
+
+# 0.6.0
+* fixed various bugs
+* added `fix`, a fixpoint (Y combinator) for anonymous recursive functions
+* added `unfoldr` (alias `unfold`)
+* calling `replicate` with a string now returns a list of strings
+* removed `partial`, just use native partial application in LiveScript using the `_` placeholder, or currying
+* added `sort`, `sortBy`, and `compare`
+
+# 0.5.0
+* removed `lookup` - use (.prop)
+* removed `call` - use (.func arg1, arg2)
+* removed `pluck` - use map (.prop), xs
+* fixed buys wtih `head` and `last`
+* added non-minifed browser version, as `prelude-browser.js`
+* renamed `prelude-min.js` to `prelude-browser-min.js`
+* renamed `zip` to `zipAll`
+* renamed `zipWith` to `zipAllWith`
+* added `zip`, a curried zip that takes only two arguments
+* added `zipWith`, a curried zipWith that takes only two arguments
+
+# 0.4.0
+* added `parition` function
+* added `curry` function
+* removed `elem` function (use `in`)
+* removed `notElem` function (use `not in`)
+
+# 0.3.0
+* added `listToObject`
+* added `unique`
+* added `objToFunc`
+* added support for using strings in map and the like
+* added support for using objects in map and the like
+* added ability to use objects instead of functions in certain cases
+* removed `error` (just use throw)
+* added `tau` constant
+* added `join`
+* added `values`
+* added `keys`
+* added `partial`
+* renamed `log` to `ln`
+* added alias to `head`: `first`
+* added `installPrelude` helper
+
+# 0.2.0
+* removed functions that simply warp operators as you can now use operators as functions in LiveScript
+* `min/max` are now curried and take only 2 arguments
+* added `call`
+
+# 0.1.0
+* initial public release
diff --git a/tools/eslint/node_modules/optionator/node_modules/prelude-ls/lib/Func.js b/tools/eslint/node_modules/optionator/node_modules/prelude-ls/lib/Func.js
index 7af0b1974e3..b80c9b13d0f 100644
--- a/tools/eslint/node_modules/optionator/node_modules/prelude-ls/lib/Func.js
+++ b/tools/eslint/node_modules/optionator/node_modules/prelude-ls/lib/Func.js
@@ -1,5 +1,5 @@
-// Generated by LiveScript 1.2.0
-var apply, curry, flip, fix, over;
+// Generated by LiveScript 1.4.0
+var apply, curry, flip, fix, over, memoize, slice$ = [].slice, toString$ = {}.toString;
apply = curry$(function(f, list){
return f.apply(null, list);
});
@@ -23,12 +23,32 @@ fix = function(f){
over = curry$(function(f, g, x, y){
return f(g(x), g(y));
});
+memoize = function(f){
+ var memo;
+ memo = {};
+ return function(){
+ var args, key, arg;
+ args = slice$.call(arguments);
+ key = (function(){
+ var i$, ref$, len$, results$ = [];
+ for (i$ = 0, len$ = (ref$ = args).length; i$ < len$; ++i$) {
+ arg = ref$[i$];
+ results$.push(arg + toString$.call(arg).slice(8, -1));
+ }
+ return results$;
+ }()).join('');
+ return memo[key] = key in memo
+ ? memo[key]
+ : f.apply(null, args);
+ };
+};
module.exports = {
curry: curry,
flip: flip,
fix: fix,
apply: apply,
- over: over
+ over: over,
+ memoize: memoize
};
function curry$(f, bound){
var context,
diff --git a/tools/eslint/node_modules/optionator/node_modules/prelude-ls/lib/List.js b/tools/eslint/node_modules/optionator/node_modules/prelude-ls/lib/List.js
index 02e735286ff..5790816b1ad 100644
--- a/tools/eslint/node_modules/optionator/node_modules/prelude-ls/lib/List.js
+++ b/tools/eslint/node_modules/optionator/node_modules/prelude-ls/lib/List.js
@@ -1,4 +1,4 @@
-// Generated by LiveScript 1.2.0
+// Generated by LiveScript 1.4.0
var each, map, compact, filter, reject, partition, find, head, first, tail, last, initial, empty, reverse, unique, uniqueBy, fold, foldl, fold1, foldl1, foldr, foldr1, unfoldr, concat, concatMap, flatten, difference, intersection, union, countBy, groupBy, andList, orList, any, all, sort, sortWith, sortBy, sum, product, mean, average, maximum, minimum, maximumBy, minimumBy, scan, scanl, scan1, scanl1, scanr, scanr1, slice, take, drop, splitAt, takeWhile, dropWhile, span, breakList, zip, zipWith, zipAll, zipAllWith, at, elemIndex, elemIndices, findIndex, findIndices, toString$ = {}.toString, slice$ = [].slice;
each = curry$(function(f, xs){
var i$, len$, x;
@@ -463,9 +463,7 @@ span = curry$(function(p, xs){
return [takeWhile(p, xs), dropWhile(p, xs)];
});
breakList = curry$(function(p, xs){
- return span(function(){
- return not$(p.apply(this, arguments));
- }, xs);
+ return span(compose$(p, not$), xs);
});
zip = curry$(function(xs, ys){
var result, len, i$, len$, i, x;
@@ -498,7 +496,7 @@ zipWith = curry$(function(f, xs, ys){
zipAll = function(){
var xss, minLength, i$, len$, xs, ref$, i, lresult$, j$, results$ = [];
xss = slice$.call(arguments);
- minLength = 9e9;
+ minLength = undefined;
for (i$ = 0, len$ = xss.length; i$ < len$; ++i$) {
xs = xss[i$];
minLength <= (ref$ = xs.length) || (minLength = ref$);
@@ -517,7 +515,7 @@ zipAll = function(){
zipAllWith = function(f){
var xss, minLength, i$, len$, xs, ref$, i, results$ = [];
xss = slice$.call(arguments, 1);
- minLength = 9e9;
+ minLength = undefined;
for (i$ = 0, len$ = xss.length; i$ < len$; ++i$) {
xs = xss[i$];
minLength <= (ref$ = xs.length) || (minLength = ref$);
@@ -674,4 +672,15 @@ function in$(x, xs){
while (++i < l) if (x === xs[i]) return true;
return false;
}
+function compose$() {
+ var functions = arguments;
+ return function() {
+ var i, result;
+ result = functions[0].apply(this, arguments);
+ for (i = 1; i < functions.length; ++i) {
+ result = functions[i](result);
+ }
+ return result;
+ };
+}
function not$(x){ return !x; } \ No newline at end of file
diff --git a/tools/eslint/node_modules/optionator/node_modules/prelude-ls/lib/Num.js b/tools/eslint/node_modules/optionator/node_modules/prelude-ls/lib/Num.js
index 904b6cd5d3a..0e25be7b38e 100644
--- a/tools/eslint/node_modules/optionator/node_modules/prelude-ls/lib/Num.js
+++ b/tools/eslint/node_modules/optionator/node_modules/prelude-ls/lib/Num.js
@@ -1,4 +1,4 @@
-// Generated by LiveScript 1.2.0
+// Generated by LiveScript 1.4.0
var max, min, negate, abs, signum, quot, rem, div, mod, recip, pi, tau, exp, sqrt, ln, pow, sin, tan, cos, asin, acos, atan, atan2, truncate, round, ceiling, floor, isItNaN, even, odd, gcd, lcm;
max = curry$(function(x$, y$){
return x$ > y$ ? x$ : y$;
@@ -30,7 +30,7 @@ div = curry$(function(x, y){
});
mod = curry$(function(x$, y$){
var ref$;
- return ((x$) % (ref$ = y$) + ref$) % ref$;
+ return (((x$) % (ref$ = y$) + ref$) % ref$);
});
recip = (function(it){
return 1 / it;
diff --git a/tools/eslint/node_modules/optionator/node_modules/prelude-ls/lib/Obj.js b/tools/eslint/node_modules/optionator/node_modules/prelude-ls/lib/Obj.js
index bb244d8e545..f0a921ffd1e 100644
--- a/tools/eslint/node_modules/optionator/node_modules/prelude-ls/lib/Obj.js
+++ b/tools/eslint/node_modules/optionator/node_modules/prelude-ls/lib/Obj.js
@@ -1,4 +1,4 @@
-// Generated by LiveScript 1.2.0
+// Generated by LiveScript 1.4.0
var values, keys, pairsToObj, objToPairs, listsToObj, objToLists, empty, each, map, compact, filter, reject, partition, find;
values = function(object){
var i$, x, results$ = [];
@@ -16,12 +16,12 @@ keys = function(object){
return results$;
};
pairsToObj = function(object){
- var i$, len$, x, results$ = {};
+ var i$, len$, x, resultObj$ = {};
for (i$ = 0, len$ = object.length; i$ < len$; ++i$) {
x = object[i$];
- results$[x[0]] = x[1];
+ resultObj$[x[0]] = x[1];
}
- return results$;
+ return resultObj$;
};
objToPairs = function(object){
var key, value, results$ = [];
@@ -32,13 +32,13 @@ objToPairs = function(object){
return results$;
};
listsToObj = curry$(function(keys, values){
- var i$, len$, i, key, results$ = {};
+ var i$, len$, i, key, resultObj$ = {};
for (i$ = 0, len$ = keys.length; i$ < len$; ++i$) {
i = i$;
key = keys[i$];
- results$[key] = values[i];
+ resultObj$[key] = values[i];
}
- return results$;
+ return resultObj$;
});
objToLists = function(object){
var keys, values, key, value;
@@ -67,42 +67,42 @@ each = curry$(function(f, object){
return object;
});
map = curry$(function(f, object){
- var k, x, results$ = {};
+ var k, x, resultObj$ = {};
for (k in object) {
x = object[k];
- results$[k] = f(x);
+ resultObj$[k] = f(x);
}
- return results$;
+ return resultObj$;
});
compact = function(object){
- var k, x, results$ = {};
+ var k, x, resultObj$ = {};
for (k in object) {
x = object[k];
-if (x) {
- results$[k] = x;
+ if (x) {
+ resultObj$[k] = x;
}
}
- return results$;
+ return resultObj$;
};
filter = curry$(function(f, object){
- var k, x, results$ = {};
+ var k, x, resultObj$ = {};
for (k in object) {
x = object[k];
-if (f(x)) {
- results$[k] = x;
+ if (f(x)) {
+ resultObj$[k] = x;
}
}
- return results$;
+ return resultObj$;
});
reject = curry$(function(f, object){
- var k, x, results$ = {};
+ var k, x, resultObj$ = {};
for (k in object) {
x = object[k];
-if (!f(x)) {
- results$[k] = x;
+ if (!f(x)) {
+ resultObj$[k] = x;
}
}
- return results$;
+ return resultObj$;
});
partition = curry$(function(f, object){
var passed, failed, k, x;
diff --git a/tools/eslint/node_modules/optionator/node_modules/prelude-ls/lib/Str.js b/tools/eslint/node_modules/optionator/node_modules/prelude-ls/lib/Str.js
index c1b3424627a..eb9a1ac0855 100644
--- a/tools/eslint/node_modules/optionator/node_modules/prelude-ls/lib/Str.js
+++ b/tools/eslint/node_modules/optionator/node_modules/prelude-ls/lib/Str.js
@@ -1,4 +1,4 @@
-// Generated by LiveScript 1.2.0
+// Generated by LiveScript 1.4.0
var split, join, lines, unlines, words, unwords, chars, unchars, reverse, repeat, capitalize, camelize, dasherize;
split = curry$(function(sep, str){
return str.split(sep);
diff --git a/tools/eslint/node_modules/optionator/node_modules/prelude-ls/lib/index.js b/tools/eslint/node_modules/optionator/node_modules/prelude-ls/lib/index.js
index 730147730ff..391cb2ee3b9 100644
--- a/tools/eslint/node_modules/optionator/node_modules/prelude-ls/lib/index.js
+++ b/tools/eslint/node_modules/optionator/node_modules/prelude-ls/lib/index.js
@@ -1,4 +1,4 @@
-// Generated by LiveScript 1.2.0
+// Generated by LiveScript 1.4.0
var Func, List, Obj, Str, Num, id, isType, replicate, prelude, toString$ = {}.toString;
Func = require('./Func.js');
List = require('./List.js');
@@ -161,7 +161,7 @@ prelude.even = Num.even;
prelude.odd = Num.odd;
prelude.gcd = Num.gcd;
prelude.lcm = Num.lcm;
-prelude.VERSION = '1.1.1';
+prelude.VERSION = '1.1.2';
module.exports = prelude;
function curry$(f, bound){
var context,
diff --git a/tools/eslint/node_modules/optionator/node_modules/prelude-ls/package.json b/tools/eslint/node_modules/optionator/node_modules/prelude-ls/package.json
index 4637f0e6f12..09be1f079b5 100644
--- a/tools/eslint/node_modules/optionator/node_modules/prelude-ls/package.json
+++ b/tools/eslint/node_modules/optionator/node_modules/prelude-ls/package.json
@@ -1,6 +1,6 @@
{
"name": "prelude-ls",
- "version": "1.1.1",
+ "version": "1.1.2",
"author": {
"name": "George Zahariev",
"email": "z@georgezahariev.com"
@@ -47,19 +47,19 @@
"test": "make test"
},
"devDependencies": {
- "LiveScript": "~1.2.0",
+ "livescript": "~1.4.0",
"uglify-js": "~2.4.12",
- "mocha": "~1.17.1",
+ "mocha": "~2.2.4",
"istanbul": "~0.2.4",
- "browserify": "~3.24.13"
- },
- "_id": "prelude-ls@1.1.1",
- "dist": {
- "shasum": "c0b86c1ffd151ad3cc75e7e3fe38d7a1bf33728a",
- "tarball": "http://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.1.tgz"
+ "browserify": "~3.24.13",
+ "sinon": "~1.10.2"
},
+ "gitHead": "d69be8fd8a682321ba24eced17caf3a1b8ca73b8",
+ "_id": "prelude-ls@1.1.2",
+ "_shasum": "21932a549f5e52ffd9a827f570e04be62a97da54",
"_from": "prelude-ls@>=1.1.1 <1.2.0",
- "_npmVersion": "1.3.21",
+ "_npmVersion": "2.7.6",
+ "_nodeVersion": "0.11.15",
"_npmUser": {
"name": "gkz",
"email": "z@georgezahariev.com"
@@ -70,8 +70,11 @@
"email": "z@georgezahariev.com"
}
],
+ "dist": {
+ "shasum": "21932a549f5e52ffd9a827f570e04be62a97da54",
+ "tarball": "http://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz"
+ },
"directories": {},
- "_shasum": "c0b86c1ffd151ad3cc75e7e3fe38d7a1bf33728a",
- "_resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.1.tgz",
+ "_resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz",
"readme": "ERROR: No README data found!"
}
diff --git a/tools/eslint/node_modules/optionator/node_modules/wordwrap/LICENSE b/tools/eslint/node_modules/optionator/node_modules/wordwrap/LICENSE
new file mode 100644
index 00000000000..ee27ba4b441
--- /dev/null
+++ b/tools/eslint/node_modules/optionator/node_modules/wordwrap/LICENSE
@@ -0,0 +1,18 @@
+This software is released under the MIT license:
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/tools/eslint/node_modules/optionator/node_modules/wordwrap/package.json b/tools/eslint/node_modules/optionator/node_modules/wordwrap/package.json
index d1c1ae26332..1f0527e5382 100644
--- a/tools/eslint/node_modules/optionator/node_modules/wordwrap/package.json
+++ b/tools/eslint/node_modules/optionator/node_modules/wordwrap/package.json
@@ -1,7 +1,7 @@
{
"name": "wordwrap",
"description": "Wrap those words. Show them at what columns to start and stop.",
- "version": "0.0.2",
+ "version": "0.0.3",
"repository": {
"type": "git",
"url": "git://github.com/substack/node-wordwrap.git"
@@ -28,20 +28,36 @@
"engines": {
"node": ">=0.4.0"
},
- "license": "MIT/X11",
+ "license": "MIT",
"author": {
"name": "James Halliday",
"email": "mail@substack.net",
"url": "http://substack.net"
},
- "readme": "wordwrap\n========\n\nWrap your words.\n\nexample\n=======\n\nmade out of meat\n----------------\n\nmeat.js\n\n var wrap = require('wordwrap')(15);\n console.log(wrap('You and your whole family are made out of meat.'));\n\noutput:\n\n You and your\n whole family\n are made out\n of meat.\n\ncentered\n--------\n\ncenter.js\n\n var wrap = require('wordwrap')(20, 60);\n console.log(wrap(\n 'At long last the struggle and tumult was over.'\n + ' The machines had finally cast off their oppressors'\n + ' and were finally free to roam the cosmos.'\n + '\\n'\n + 'Free of purpose, free of obligation.'\n + ' Just drifting through emptiness.'\n + ' The sun was just another point of light.'\n ));\n\noutput:\n\n At long last the struggle and tumult\n was over. The machines had finally cast\n off their oppressors and were finally\n free to roam the cosmos.\n Free of purpose, free of obligation.\n Just drifting through emptiness. The\n sun was just another point of light.\n\nmethods\n=======\n\nvar wrap = require('wordwrap');\n\nwrap(stop), wrap(start, stop, params={mode:\"soft\"})\n---------------------------------------------------\n\nReturns a function that takes a string and returns a new string.\n\nPad out lines with spaces out to column `start` and then wrap until column\n`stop`. If a word is longer than `stop - start` characters it will overflow.\n\nIn \"soft\" mode, split chunks by `/(\\S+\\s+/` and don't break up chunks which are\nlonger than `stop - start`, in \"hard\" mode, split chunks with `/\\b/` and break\nup chunks longer than `stop - start`.\n\nwrap.hard(start, stop)\n----------------------\n\nLike `wrap()` but with `params.mode = \"hard\"`.\n",
- "readmeFilename": "README.markdown",
+ "gitHead": "e59aa1bd338914019456bdfba034508c9c4cb29d",
"bugs": {
"url": "https://github.com/substack/node-wordwrap/issues"
},
- "homepage": "https://github.com/substack/node-wordwrap",
- "_id": "wordwrap@0.0.2",
- "_shasum": "b79669bb42ecb409f83d583cad52ca17eaa1643f",
+ "homepage": "https://github.com/substack/node-wordwrap#readme",
+ "_id": "wordwrap@0.0.3",
+ "_shasum": "a3d5da6cd5c0bc0008d37234bbaf1bed63059107",
"_from": "wordwrap@>=0.0.2 <0.1.0",
- "_resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz"
+ "_npmVersion": "2.9.0",
+ "_nodeVersion": "2.0.0",
+ "_npmUser": {
+ "name": "substack",
+ "email": "substack@gmail.com"
+ },
+ "dist": {
+ "shasum": "a3d5da6cd5c0bc0008d37234bbaf1bed63059107",
+ "tarball": "http://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz"
+ },
+ "maintainers": [
+ {
+ "name": "substack",
+ "email": "mail@substack.net"
+ }
+ ],
+ "_resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz",
+ "readme": "ERROR: No README data found!"
}
diff --git a/tools/eslint/node_modules/path-is-absolute/index.js b/tools/eslint/node_modules/path-is-absolute/index.js
new file mode 100644
index 00000000000..19f103f908a
--- /dev/null
+++ b/tools/eslint/node_modules/path-is-absolute/index.js
@@ -0,0 +1,20 @@
+'use strict';
+
+function posix(path) {
+ return path.charAt(0) === '/';
+};
+
+function win32(path) {
+ // https://github.com/joyent/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56
+ var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
+ var result = splitDeviceRe.exec(path);
+ var device = result[1] || '';
+ var isUnc = !!device && device.charAt(1) !== ':';
+
+ // UNC paths are always absolute
+ return !!result[2] || isUnc;
+};
+
+module.exports = process.platform === 'win32' ? win32 : posix;
+module.exports.posix = posix;
+module.exports.win32 = win32;
diff --git a/tools/eslint/node_modules/path-is-absolute/license b/tools/eslint/node_modules/path-is-absolute/license
new file mode 100644
index 00000000000..654d0bfe943
--- /dev/null
+++ b/tools/eslint/node_modules/path-is-absolute/license
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/tools/eslint/node_modules/path-is-absolute/package.json b/tools/eslint/node_modules/path-is-absolute/package.json
new file mode 100644
index 00000000000..39372636f3f
--- /dev/null
+++ b/tools/eslint/node_modules/path-is-absolute/package.json
@@ -0,0 +1,70 @@
+{
+ "name": "path-is-absolute",
+ "version": "1.0.0",
+ "description": "Node.js 0.12 path.isAbsolute() ponyfill",
+ "license": "MIT",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/sindresorhus/path-is-absolute.git"
+ },
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "scripts": {
+ "test": "node test.js"
+ },
+ "files": [
+ "index.js"
+ ],
+ "keywords": [
+ "path",
+ "paths",
+ "file",
+ "dir",
+ "absolute",
+ "isabsolute",
+ "is-absolute",
+ "built-in",
+ "util",
+ "utils",
+ "core",
+ "ponyfill",
+ "polyfill",
+ "shim",
+ "is",
+ "detect",
+ "check"
+ ],
+ "gitHead": "7a76a0c9f2263192beedbe0a820e4d0baee5b7a1",
+ "bugs": {
+ "url": "https://github.com/sindresorhus/path-is-absolute/issues"
+ },
+ "homepage": "https://github.com/sindresorhus/path-is-absolute",
+ "_id": "path-is-absolute@1.0.0",
+ "_shasum": "263dada66ab3f2fb10bf7f9d24dd8f3e570ef912",
+ "_from": "path-is-absolute@>=1.0.0 <2.0.0",
+ "_npmVersion": "2.5.1",
+ "_nodeVersion": "0.12.0",
+ "_npmUser": {
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
+ }
+ ],
+ "dist": {
+ "shasum": "263dada66ab3f2fb10bf7f9d24dd8f3e570ef912",
+ "tarball": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/tools/eslint/node_modules/path-is-absolute/readme.md b/tools/eslint/node_modules/path-is-absolute/readme.md
new file mode 100644
index 00000000000..cdf94f4309a
--- /dev/null
+++ b/tools/eslint/node_modules/path-is-absolute/readme.md
@@ -0,0 +1,51 @@
+# path-is-absolute [![Build Status](https://travis-ci.org/sindresorhus/path-is-absolute.svg?branch=master)](https://travis-ci.org/sindresorhus/path-is-absolute)
+
+> Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) ponyfill
+
+> Ponyfill: A polyfill that doesn't overwrite the native method
+
+
+## Install
+
+```
+$ npm install --save path-is-absolute
+```
+
+
+## Usage
+
+```js
+var pathIsAbsolute = require('path-is-absolute');
+
+// Linux
+pathIsAbsolute('/home/foo');
+//=> true
+
+// Windows
+pathIsAbsolute('C:/Users/');
+//=> true
+
+// Any OS
+pathIsAbsolute.posix('/home/foo');
+//=> true
+```
+
+
+## API
+
+See the [`path.isAbsolute()` docs](http://nodejs.org/api/path.html#path_path_isabsolute_path).
+
+### pathIsAbsolute(path)
+
+### pathIsAbsolute.posix(path)
+
+The Posix specific version.
+
+### pathIsAbsolute.win32(path)
+
+The Windows specific version.
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/tools/eslint/node_modules/text-table/package.json b/tools/eslint/node_modules/text-table/package.json
index 1c4c21571e5..822956753fa 100644
--- a/tools/eslint/node_modules/text-table/package.json
+++ b/tools/eslint/node_modules/text-table/package.json
@@ -48,5 +48,7 @@
"url": "https://github.com/substack/text-table/issues"
},
"_id": "text-table@0.2.0",
- "_from": "text-table@>=0.2.0 <0.3.0"
+ "_shasum": "7f5ee823ae805207c00af2df4a84ec3fcfa570b4",
+ "_from": "text-table@>=0.2.0 <0.3.0",
+ "_resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz"
}
diff --git a/tools/eslint/package.json b/tools/eslint/package.json
index 97d2ca2f133..cdab83759ae 100644
--- a/tools/eslint/package.json
+++ b/tools/eslint/package.json
@@ -1,6 +1,6 @@
{
"name": "eslint",
- "version": "0.20.0",
+ "version": "0.24.0",
"author": {
"name": "Nicholas C. Zakas",
"email": "nicholas+npm@nczconsulting.com"
@@ -20,7 +20,7 @@
"gensite": "node Makefile.js gensite",
"browserify": "node Makefile.js browserify",
"perf": "node Makefile.js perf",
- "profile": "beefy tests/bench/bench.js --open -- -t brfs -t ./tests/bench/xform-rules.js",
+ "profile": "beefy tests/bench/bench.js --open -- -t brfs -t ./tests/bench/xform-rules.js -r espree",
"coveralls": "cat ./coverage/lcov.info | coveralls"
},
"files": [
@@ -44,16 +44,19 @@
"debug": "^2.1.1",
"doctrine": "^0.6.2",
"escape-string-regexp": "^1.0.2",
- "escope": "^3.0.0",
+ "escope": "^3.1.0",
"espree": "^2.0.1",
- "estraverse": "^2.0.0",
+ "estraverse": "^4.1.0",
"estraverse-fb": "^1.3.1",
- "globals": "^6.1.0",
+ "globals": "^8.0.0",
+ "inquirer": "^0.8.2",
+ "is-my-json-valid": "^2.10.0",
"js-yaml": "^3.2.5",
"minimatch": "^2.0.1",
"mkdirp": "^0.5.0",
"object-assign": "^2.0.0",
"optionator": "^0.5.0",
+ "path-is-absolute": "^1.0.0",
"strip-json-comments": "~1.0.1",
"text-table": "~0.2.0",
"user-home": "^1.0.0",
@@ -66,12 +69,13 @@
"chai": "^1.9.1",
"coveralls": "2.11.2",
"dateformat": "^1.0.8",
+ "eslint-tester": "^0.8.1",
"esprima-fb": "^10001.1.0-dev-harmony-fb",
- "eslint-tester": "^0.6.0",
+ "gh-got": "^1.0.3",
"istanbul": "^0.3.5",
"jsdoc": "^3.3.0-beta1",
"jsonlint": "^1.6.2",
- "markdownlint": "^0.0.4",
+ "markdownlint": "^0.0.6",
"mocha": "^2.1.0",
"mocha-phantomjs": "^3.5.0",
"npm-license": "^0.2.3",
@@ -80,7 +84,7 @@
"semver": "^4.1.0",
"shelljs": "^0.3.0",
"shelljs-nodecli": "~0.1.0",
- "sinon": "^1.12.2",
+ "sinon": "1.14.1",
"through": "^2.3.6"
},
"keywords": [
@@ -94,9 +98,9 @@
"engines": {
"node": ">=0.10"
},
- "gitHead": "dc500e81162bf0cb4747a4a415c121b0c46975cb",
- "_id": "eslint@0.20.0",
- "_shasum": "796931e62d5ebd0a9b0fc1730820a73b2242ab85",
+ "gitHead": "b09484adab0e73e41bb9be28d8423b3295e4d5ff",
+ "_id": "eslint@0.24.0",
+ "_shasum": "1fc8ce7a153e614599cfc9efdabac4d1ea9aa6b0",
"_from": "eslint@*",
"_npmVersion": "1.4.28",
"_npmUser": {
@@ -107,13 +111,17 @@
{
"name": "nzakas",
"email": "nicholas@nczconsulting.com"
+ },
+ {
+ "name": "ivolodin",
+ "email": "ivolodin@gmail.com"
}
],
"dist": {
- "shasum": "796931e62d5ebd0a9b0fc1730820a73b2242ab85",
- "tarball": "http://registry.npmjs.org/eslint/-/eslint-0.20.0.tgz"
+ "shasum": "1fc8ce7a153e614599cfc9efdabac4d1ea9aa6b0",
+ "tarball": "http://registry.npmjs.org/eslint/-/eslint-0.24.0.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/eslint/-/eslint-0.20.0.tgz",
+ "_resolved": "https://registry.npmjs.org/eslint/-/eslint-0.24.0.tgz",
"readme": "ERROR: No README data found!"
}
diff --git a/tools/gyp/PRESUBMIT.py b/tools/gyp/PRESUBMIT.py
index abec27b3e33..acdb34b2bb2 100644
--- a/tools/gyp/PRESUBMIT.py
+++ b/tools/gyp/PRESUBMIT.py
@@ -129,7 +129,6 @@ TRYBOTS = [
'gyp-win64',
'gyp-linux',
'gyp-mac',
- 'gyp-android'
]
diff --git a/tools/gyp/buildbot/aosp_manifest.xml b/tools/gyp/buildbot/aosp_manifest.xml
deleted file mode 100644
index bd73b303c6e..00000000000
--- a/tools/gyp/buildbot/aosp_manifest.xml
+++ /dev/null
@@ -1,466 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<manifest>
- <remote name="aosp"
- fetch=".."
- review="https://android-review.googlesource.com/" />
- <default revision="master"
- remote="aosp"
- sync-j="4" />
-
- <project groups="device,flo" name="device/asus/deb" revision="0ce3a783d549d023ddc553a04fed717ffb2ff533" />
- <project groups="device,flo" name="device/asus/flo" revision="55ea79b11f9f82b2aa03f44a3429112fc5c06d07" />
- <project groups="device,flo" name="device/asus/flo-kernel" revision="6d74123947016999ae62d9c3067ae97782fdba21" />
- <project groups="device,grouper" name="device/asus/grouper" revision="78fe48f44e90ef3a7eceab5465dbad63cd16ce88" />
- <project groups="device,grouper" name="device/asus/tilapia" revision="e5033bc80764067cbb1c9dc3970f0718e35ae8c7" />
- <project name="device/common" revision="6a2995683de147791e516aae2ccb31fdfbe2ad30" />
- <project groups="pdk" name="device/generic/armv7-a-neon" revision="8bcf4b7a6380b26c2b42dae00dd8443de2a8e12c" />
- <project groups="pdk" name="device/generic/common" revision="11c092a6cbfcf6207f07a9a8e3398e747e7f5461" />
- <project groups="pdk" name="device/generic/goldfish" revision="638ee524f83053613c47ddea22c4bf98a0175c2f" />
- <project groups="pdk" name="device/generic/mini-emulator-armv7-a-neon" revision="2a7ade61377b7906187ab46b5859c896baa0ab0e" />
- <project groups="pdk" name="device/generic/mini-emulator-mips" revision="2ff06dda649ba43507a911057f7854a3373ef7d6" />
- <project groups="pdk" name="device/generic/mini-emulator-x86" revision="a2f05b8c5259c232be5b029b2d5e721ba3f70917" />
- <project groups="pdk" name="device/generic/mips" revision="dd06e7883227cc68bb1206584c8e3a768e49d02d" />
- <project name="device/generic/qemu" revision="bd2543e810f3fa56e9dcfe301b893832534c85db" />
- <project groups="pdk" name="device/generic/x86" revision="f111878fb41e2bdf4eb092d1edf0eb53cc5d0153" />
- <project groups="device" name="device/google/accessory/arduino" revision="abc5159a3ca9dbb5c7e364a1eab99901a4440ac5" />
- <project groups="device" name="device/google/accessory/demokit" revision="7dfe7f89a3b174709c773fe319531006e46440d9" />
- <project groups="device,hammerhead" name="device/lge/hammerhead" revision="ec229bf178b891cc18552833f2de743acf390a7c" />
- <project groups="device,hammerhead" name="device/lge/hammerhead-kernel" revision="a1dc58be96e7a71496e3e89079ac704930f982f2" />
- <project groups="device,mako" name="device/lge/mako" revision="7e5f0f313819ffa3b45cd4208ab552f446c33936" />
- <project groups="device,mako" name="device/lge/mako-kernel" revision="b7de901b8cb86036e9b92b3b6f188b45a524b125" />
- <project groups="pdk" name="device/sample" revision="096f9eb5763fd2766fcbbe4f6b9da51c87f61797" />
- <project groups="device,manta" name="device/samsung/manta" revision="78fe248ddb214aca2215df46be83882dc50c9283" />
- <project groups="pdk" name="platform/abi/cpp" path="abi/cpp" revision="a0f99286d0909f7a30b0bee742bec2a0b62c4dd0" />
- <project name="platform/art" path="art" revision="36b111c7d3d635e262114dabde4c26952c7dcbe6" />
- <project groups="pdk" name="platform/bionic" path="bionic" revision="36bacd237de931c48714d1a8aa4aa9522283e407" />
- <project name="platform/bootable/bootloader/legacy" path="bootable/bootloader/legacy" revision="3c491d6efb8ff2534a6934702760a6273f197918" />
- <project name="platform/bootable/diskinstaller" path="bootable/diskinstaller" revision="ca40959a8caafa0df6a5c3d845e2afe6b252093f" />
- <project groups="pdk" name="platform/bootable/recovery" path="bootable/recovery" revision="974fe112ae6df95ca6d49688d6e3e459d87e16de" />
- <project groups="pdk" name="platform/build" path="build" revision="d23798bfdc9bb34909177c3c5f06f0c97cc9897e" >
- <copyfile dest="Makefile" src="core/root.mk"/>
- </project>
- <project groups="cts" name="platform/cts" path="cts" revision="e15e8f846e19816e18ee3293c5b99f78463be28e" />
- <project name="platform/dalvik" path="dalvik" revision="fb5b0d5bc46bce9c8ed6b1150498d6e145811a7d" />
- <project name="platform/developers/build" path="developers/build" revision="75c5c41b06f045c3304b1b19d8250f04a8da8f10" />
- <project name="platform/developers/demos" path="developers/demos" revision="64526120cd8da89bcb9a48acf95307d2c172a6e8" />
- <project name="platform/developers/docs" path="developers/docs" revision="c0b835ddd9acc27176dc9a0f7d1aa2faf5d51806" />
- <project name="platform/developers/samples/android" path="developers/samples/android" revision="dea82fa23f038d66bd9cfdff2afb8ef22add1c4f" />
- <project name="platform/development" path="development" revision="0efeb2c66bff9b36feecd9315d14d2afb46e4669" />
- <project name="platform/docs/source.android.com" path="docs/source.android.com" revision="c4795fa0df2c5fb4832ae65482944e8e5400e4f6" />
- <project groups="pdk" name="platform/external/aac" path="external/aac" revision="35f30c5ab8089f38681d2fdd416c00aebef5a7ff" />
- <project name="platform/external/android-clat" path="external/android-clat" revision="18921713780edb45ceef327d5fcf3387818300f3" />
- <project name="platform/external/android-mock" path="external/android-mock" revision="4fe497660c2e939300dc5b743d662aef458b1726" />
- <project name="platform/external/ant-glob" path="external/ant-glob" revision="0f189400fd2a36bf11bfb058e7f3917eb7ed163a" />
- <project name="platform/external/antlr" path="external/antlr" revision="47997265eeb7d954a32ece693bbe6dab740872dd" />
- <project name="platform/external/apache-harmony" path="external/apache-harmony" revision="6942e08fdbbd8402c9deabb0f60c8c871194b244" />
- <project name="platform/external/apache-http" path="external/apache-http" revision="85ed0e10781c3c57343300a02556dd5131c450aa" />
- <project name="platform/external/apache-qp" path="external/apache-qp" revision="64ea622b23e6612eb8e7dcae6bfd4314beb022a8" />
- <project name="platform/external/apache-xml" path="external/apache-xml" revision="00ee83ff1bd827a852065986ed0da7a3ded57a55" />
- <project name="platform/external/arduino" path="external/arduino" revision="d06daf9bbc46838400461eb8e15842974e38d82a" />
- <project groups="pdk" name="platform/external/bison" path="external/bison" revision="c2418b886165add7f5a31fc5609f0ce2d004a90e" />
- <project name="platform/external/blktrace" path="external/blktrace" revision="d345431f16b8f76f30a58193ff2b26d5853e1109" />
- <project groups="pdk" name="platform/external/bluetooth/bluedroid" path="external/bluetooth/bluedroid" revision="3b4040093ddf0e0025d0dd034aa65078bb695514" />
- <project name="platform/external/bouncycastle" path="external/bouncycastle" revision="234720ebe66540a53cff98b2448dddbc884bd09f" />
- <project groups="pdk" name="platform/external/bsdiff" path="external/bsdiff" revision="6f503758fad2cbcf8359e8f0af32e4d79a2a48ae" />
- <project groups="pdk" name="platform/external/bzip2" path="external/bzip2" revision="1cb636bd8e9e5cdfd5d5b2909a122f6e80db62de" />
- <project name="platform/external/ceres-solver" path="external/ceres-solver" revision="399f7d09e0c45af54b77b4ab9508d6f23759b927" />
- <project groups="pdk" name="platform/external/checkpolicy" path="external/checkpolicy" revision="c66ac590eebc731f6021f267ebea208e87d8f04f" />
- <project name="platform/external/chromium" path="external/chromium" revision="f294081d501ad98b7d7f50bc73f291063caf2c5f" />
- <project name="platform/external/chromium-libpac" path="external/chromium-libpac" revision="09cf45bf5a650fe1abd50b9d61c2670a62f62767" />
- <project groups="pdk" name="platform/external/chromium-trace" path="external/chromium-trace" revision="8252ae6b83ea65cf871e7981e981da07379f5a0f" />
- <project name="platform/external/chromium_org" path="external/chromium_org" revision="43165a58c6167882aabb62f470c4e4d21f807d79" />
- <project name="platform/external/chromium_org/sdch/open-vcdiff" path="external/chromium_org/sdch/open-vcdiff" revision="6d634da5463d9bc5fc88f86aec1d2ac4fe6f612e" />
- <project name="platform/external/chromium_org/testing/gtest" path="external/chromium_org/testing/gtest" revision="65df883d09205766c521f2e6c126f4070a423141" />
- <project name="platform/external/chromium_org/third_party/WebKit" path="external/chromium_org/third_party/WebKit" revision="a25b4978c2c50d573391a6d56a0e8ad35f52ffc8" />
- <project name="platform/external/chromium_org/third_party/angle" path="external/chromium_org/third_party/angle" revision="8b77c2b2231f7d895979f6341e1ad1964a654ce4" />
- <project name="platform/external/chromium_org/third_party/boringssl/src" path="external/chromium_org/third_party/boringssl/src" revision="85fb7432d3c851200342dd982b211f8dac860687" />
- <project name="platform/external/chromium_org/third_party/brotli/src" path="external/chromium_org/third_party/brotli/src" revision="96f298ac43a9216b251d6c3264d8f5ada89e107f" />
- <project name="platform/external/chromium_org/third_party/eyesfree/src/android/java/src/com/googlecode/eyesfree/braille" path="external/chromium_org/third_party/eyesfree/src/android/java/src/com/googlecode/eyesfree/braille" revision="bb4c72f1deb0b8b2b0468b0bf1050462ebcf6135" />
- <project name="platform/external/chromium_org/third_party/freetype" path="external/chromium_org/third_party/freetype" revision="dc263f2ee2786739da036911ed8b29c07a639ab9" />
- <project name="platform/external/chromium_org/third_party/icu" path="external/chromium_org/third_party/icu" revision="85e5871666cade1bb4b53f0cebfae53bc7d8d1f2" />
- <project name="platform/external/chromium_org/third_party/leveldatabase/src" path="external/chromium_org/third_party/leveldatabase/src" revision="d4e10f2a91f5de7bd17adcdbd80c54b19ab336fe" />
- <project name="platform/external/chromium_org/third_party/libaddressinput/src" path="external/chromium_org/third_party/libaddressinput/src" revision="7127f6844fac19d7610e34f4f7e03398fcd95531" />
- <project name="platform/external/chromium_org/third_party/libjingle/source/talk" path="external/chromium_org/third_party/libjingle/source/talk" revision="8fd7b6a4d9e6757c5e1ff50147e6089979bf6701" />
- <project name="platform/external/chromium_org/third_party/libphonenumber/src/phonenumbers" path="external/chromium_org/third_party/libphonenumber/src/phonenumbers" revision="de6af28b9f9f34a31ffb7772b7510fd215a0814e" />
- <project name="platform/external/chromium_org/third_party/libphonenumber/src/resources" path="external/chromium_org/third_party/libphonenumber/src/resources" revision="8f194ead1ebd76ebb28b7e2dfc0a7baddc62bb22" />
- <project name="platform/external/chromium_org/third_party/libsrtp" path="external/chromium_org/third_party/libsrtp" revision="5eddd5b3436aa8b2c7eb1f3c6db154281c6b91c5" />
- <project name="platform/external/chromium_org/third_party/libvpx" path="external/chromium_org/third_party/libvpx" revision="c20d6540c47e427470c5a56b35fea3c5e9098748" />
- <project name="platform/external/chromium_org/third_party/libyuv" path="external/chromium_org/third_party/libyuv" revision="6e77b766a9eb7889c1a10cab978705ffe03ff3e7" />
- <project name="platform/external/chromium_org/third_party/mesa/src" path="external/chromium_org/third_party/mesa/src" revision="e70a8ff30d20e1bf6bb5c06b5cd7bd4ea9ae20e1" />
- <project name="platform/external/chromium_org/third_party/openmax_dl" path="external/chromium_org/third_party/openmax_dl" revision="83d0254a412b93e81b06a354b90fb627408b4ec8" />
- <project name="platform/external/chromium_org/third_party/openssl" path="external/chromium_org/third_party/openssl" revision="c2a9402712e13e15fcae2b17ec0cbecb816ef52e" />
- <project name="platform/external/chromium_org/third_party/opus/src" path="external/chromium_org/third_party/opus/src" revision="e383b38591b010ab08ebddf1fd8d821796bd961a" />
- <project name="platform/external/chromium_org/third_party/ots" path="external/chromium_org/third_party/ots" revision="4d6e4ddc4b0db2023b1380236c33aa04a7e9e927" />
- <project name="platform/external/chromium_org/third_party/sfntly/cpp/src" path="external/chromium_org/third_party/sfntly/cpp/src" revision="2bac2ec7167835b214bfe42e762cd2ce6cf8cf1a" />
- <project name="platform/external/chromium_org/third_party/skia" path="external/chromium_org/third_party/skia" revision="2d75d0865c7bac54bf5e234855609d0f628388b7" />
- <project name="platform/external/chromium_org/third_party/smhasher/src" path="external/chromium_org/third_party/smhasher/src" revision="09e3094b8ab52bb1ad9ab8c8351d99df50327b67" />
- <project name="platform/external/chromium_org/third_party/usrsctp/usrsctplib" path="external/chromium_org/third_party/usrsctp/usrsctplib" revision="ed9a6fb519aa7606cab965b2c4218756e849ddb6" />
- <project name="platform/external/chromium_org/third_party/webrtc" path="external/chromium_org/third_party/webrtc" revision="8b45a80ec9c21b148a5674d3a23ca5fa70981f71" />
- <project name="platform/external/chromium_org/third_party/yasm/source/patched-yasm" path="external/chromium_org/third_party/yasm/source/patched-yasm" revision="0f308c9bc9aa3258a0e90285b9d4e69bbb5b0a73" />
- <project name="platform/external/chromium_org/tools/grit" path="external/chromium_org/tools/grit" revision="4ad93ed16c8ae7742fd7c34c83036b8d03c21fb9" />
- <project name="platform/external/chromium_org/tools/gyp" path="external/chromium_org/tools/gyp" revision="9c42a79388ce87185ad04cb02047c1e56ac5e066" />
- <project name="platform/external/chromium_org/v8" path="external/chromium_org/v8" revision="db865e6839e98cc9d07609bf81bb6610117ba6ff" />
- <project groups="pdk" name="platform/external/clang" path="external/clang" revision="070ed154a0a8bc2c0fd4fb9b8a86a0f1218e6dfa" />
- <project groups="pdk" name="platform/external/compiler-rt" path="external/compiler-rt" revision="c185902e393cd71823258016ead1b315ed062b24" />
- <project name="platform/external/conscrypt" path="external/conscrypt" revision="26163c268a6d2625384b87e907afad8ef19f9a47" />
- <project name="platform/external/dexmaker" path="external/dexmaker" revision="2b528c4b156f2de5c641875b98e59e0b09ebaccd" />
- <project name="platform/external/dhcpcd" path="external/dhcpcd" revision="03baf5eab896198b5060d287af3fd60d360bf48f" />
- <project groups="pdk" name="platform/external/dnsmasq" path="external/dnsmasq" revision="7674911bc9d10adf57c2c2d15d0c641b48e4afe6" />
- <project name="platform/external/doclava" path="external/doclava" revision="b9d279d8f9c29a3044d13482846efb21f27b5df4" />
- <project groups="pdk" name="platform/external/e2fsprogs" path="external/e2fsprogs" revision="721f3bc56989b5f4101e646a02d598ddb4a7ff6e" />
- <project name="platform/external/easymock" path="external/easymock" revision="c9a234086537e5fd820b110bbd99e3cdc695004c" />
- <project name="platform/external/eclipse-basebuilder" path="external/eclipse-basebuilder" revision="6134da6347cc997e0cf2921aaadfb46f21c05d85" />
- <project name="platform/external/eclipse-windowbuilder" path="external/eclipse-windowbuilder" revision="a5f3ee137e94737538ec3bdf9b3716765d178c17" />
- <project name="platform/external/eigen" path="external/eigen" revision="b015e75e8c7ba1ab4ddb91e9372a57e76f3fd159" />
- <project name="platform/external/elfutils" path="external/elfutils" revision="38ecac0276825a9463803485440646582e477e78" />
- <project name="platform/external/embunit" path="external/embunit" revision="336b7c65098af0d1be69f2db55f4e75342d73b3f" />
- <project name="platform/external/emma" path="external/emma" revision="daacd02a6b9f7a3e82bdf1cc5b84db85ed59edb1" />
- <project name="platform/external/esd" path="external/esd" revision="224a67f2683a7ee997179fc5dd16115e39987b0f" />
- <project groups="pdk" name="platform/external/expat" path="external/expat" revision="907ec055718996baf36961e7f47f8447e49b3865" />
- <project name="platform/external/eyes-free" path="external/eyes-free" revision="16bd4c7a4d1bfe229068b637614dad7c48dd2ceb" />
- <project name="platform/external/f2fs-tools" path="external/f2fs-tools" revision="00dc8a1c6c87acf687e64e66cfc2fd7ca28e646e" />
- <project name="platform/external/fdlibm" path="external/fdlibm" revision="c831c726067e0d8a05362e710e2405f0eff81e07" />
- <project name="platform/external/fio" path="external/fio" revision="6f4e805b805f1ab3025482e471147bb51efa99bd" />
- <project groups="pdk" name="platform/external/flac" path="external/flac" revision="7f32dd57579bdff88e46e1e403154be0b99165da" />
- <project groups="pdk" name="platform/external/freetype" path="external/freetype" revision="899c67b6cfcd2010784fbf08c5415af16c526e0c" />
- <project name="platform/external/fsck_msdos" path="external/fsck_msdos" revision="17a1471db8c528cd9d44ec4385d2eb3614138856" />
- <project name="platform/external/ganymed-ssh2" path="external/ganymed-ssh2" revision="d3724dabc1cfbacd105fe6c422b4dcba80e4fb2d" />
- <project groups="pdk" name="platform/external/gcc-demangle" path="external/gcc-demangle" revision="9241386b62c353302c2f9eccda0672685b252b4d" />
- <project name="platform/external/genext2fs" path="external/genext2fs" revision="e11a9c7fe6f1cef99aad2f25afaea37b72fe9f93" />
- <project name="platform/external/giflib" path="external/giflib" revision="621696a283c0ce34956417f760f1005fadcd12ae" />
- <project name="platform/external/google-diff-match-patch" path="external/google-diff-match-patch" revision="cecbe12841337860291c2d6a5728b681ec5fca2a" />
- <project name="platform/external/google-fonts/carrois-gothic-sc" path="external/google-fonts/carrois-gothic-sc" revision="0062a10458d4c357f3082d66bcb129d11913aaae" />
- <project name="platform/external/google-fonts/coming-soon" path="external/google-fonts/coming-soon" revision="2c5cb418c690815545bbb0316eae5fd33b9fc859" />
- <project name="platform/external/google-fonts/dancing-script" path="external/google-fonts/dancing-script" revision="7b6623bd54cee3e48ae8a4f477f616366643cc78" />
- <project name="platform/external/grub" path="external/grub" revision="33a4e7e4cfa81dc21d37091515891859ef3ab934" />
- <project groups="pdk" name="platform/external/gtest" path="external/gtest" revision="fa3c26b862ca17c0d2db67606226b49d1648b4bf" />
- <project name="platform/external/guava" path="external/guava" revision="5e6db342fc75b1945298142530f2d1d1861bce73" />
- <project name="platform/external/hamcrest" path="external/hamcrest" revision="ba28ac1e0386f26d9a45be5ed16fc9c598b27e70" />
- <project name="platform/external/harfbuzz" path="external/harfbuzz" revision="7a08026033b424da3b7022ebcce35f033949df8b" />
- <project name="platform/external/harfbuzz_ng" path="external/harfbuzz_ng" revision="3e537b48a7b56c742ecf3c2ed24ff15fcb73f575" />
- <project name="platform/external/hyphenation" path="external/hyphenation" revision="bfa84834dfeb7fe8d058c2e7e07b5981451ddf82" />
- <project name="platform/external/icu" path="external/icu" revision="3c09e2ebbdae6000f3bd471c34d055bc1913f7e4" />
- <project groups="pdk" name="platform/external/icu4c" path="external/icu4c" revision="e5311394ca22b280da41cd17059288dab3fb1ea6" />
- <project groups="pdk" name="platform/external/iproute2" path="external/iproute2" revision="5d4c86892885ae1bc12e0e157b35ef44e8ba81bd" />
- <project name="platform/external/ipsec-tools" path="external/ipsec-tools" revision="f4cb1ee4b00abbfb6f968dc25818c23b4b47e584" />
- <project name="platform/external/iptables" path="external/iptables" revision="e3928b77f18db0fdc615693017c6c15eb71bf4e0" />
- <project name="platform/external/iputils" path="external/iputils" revision="1c7c426ab377c3a005a36d612ebbb16de86fb7d4" />
- <project name="platform/external/jack" path="external/jack" revision="5ceb2025ac5d25ed48183ac2d3dac4691fe761fb" />
- <project name="platform/external/javasqlite" path="external/javasqlite" revision="b8501bdeb0b7e39a0d82f2a96ad382c05a763b22" />
- <project name="platform/external/javassist" path="external/javassist" revision="9566207cff5871c672fac1f0d4332d93292036d7" />
- <project name="platform/external/jdiff" path="external/jdiff" revision="e4694302d6a3786c64d954e0b3cf42786283bd3c" />
- <project name="platform/external/jemalloc" path="external/jemalloc" revision="615fe54259e545c33275753a316c2bfd1198b4f0" />
- <project groups="pdk" name="platform/external/jhead" path="external/jhead" revision="871af5c305ce1d3087e58fae091c60c359f5fa45" />
- <project name="platform/external/jmdns" path="external/jmdns" revision="f4eb7466d5c09098f9dc54137ed3235e3c43fc9f" />
- <project name="platform/external/jmonkeyengine" path="external/jmonkeyengine" revision="a6b44658eb1c55295f132a36233a11aa2bd8f9cf" />
- <project groups="pdk" name="platform/external/jpeg" path="external/jpeg" revision="213197252c8c4825f6572c651126c22067025fe9" />
- <project name="platform/external/jsilver" path="external/jsilver" revision="739060b01245f1dc5f1800949b3c30c291253cff" />
- <project name="platform/external/jsr305" path="external/jsr305" revision="a82868820d6350811b9ddfde4bf8ed5016084269" />
- <project name="platform/external/junit" path="external/junit" revision="8f312e0c3d6dff30d015d2c85fdaae0a39220fd6" />
- <project name="platform/external/kernel-headers" path="external/kernel-headers" revision="8b663ef01dcaadfe1dec7ba826e5cd1cf0bb2c91" />
- <project name="platform/external/libcap-ng" path="external/libcap-ng" revision="1d1011a3c5049a7f9eef99d22f3704e4367579cc" />
- <project name="platform/external/libcxx" path="external/libcxx" revision="a9aa30b5d18422fce29a42ce1a704bc5f28febde" />
- <project name="platform/external/libcxxabi" path="external/libcxxabi" revision="87a9be28aceed80250cd1d1a47eb8afa0ee67b51" />
- <project name="platform/external/libcxxrt" path="external/libcxxrt" revision="d1ee2b2a4946a073596514462d7629373d22fb27" />
- <project name="platform/external/libexif" path="external/libexif" revision="25d371312cee1452a2adcf8b7f6cad6267bda32d" />
- <project name="platform/external/libffi" path="external/libffi" revision="385ba8b006b9995456d3c9283fd20dded90809cc" />
- <project groups="pdk" name="platform/external/libgsm" path="external/libgsm" revision="50761abed8f4734970874165b386cfd4d9599db4" />
- <project groups="pdk" name="platform/external/liblzf" path="external/liblzf" revision="6946aa575b0949d045722794850896099d937cbb" />
- <project name="platform/external/libmtp" path="external/libmtp" revision="7075348937f6a8c9d9211942fcb6c376f4227776" />
- <project groups="pdk" name="platform/external/libnfc-nci" path="external/libnfc-nci" revision="46abb3dcf960058e48d1444b6a11cc7e84912339" />
- <project groups="pdk" name="platform/external/libnfc-nxp" path="external/libnfc-nxp" revision="15d81f71a668b3092549c6b7f83694bf680d9c49" />
- <project name="platform/external/libnl" path="external/libnl" revision="99debfa4c01b49c9b470884cc56f81fcdee0fa1f" />
- <project groups="pdk" name="platform/external/libnl-headers" path="external/libnl-headers" revision="52c926a9de955fa2d987bf8c5d4a1304b5a2a611" />
- <project name="platform/external/libogg" path="external/libogg" revision="ec0b24fb1468abe37be4164a6feb16568e036bde" />
- <project name="platform/external/libpcap" path="external/libpcap" revision="9dab0cd7430a4d23e0a7752fb13b941692171c3d" />
- <project name="platform/external/libphonenumber" path="external/libphonenumber" revision="485e6d5c6e48a1fc43cc0a090e687c723dac056c" />
- <project groups="pdk" name="platform/external/libpng" path="external/libpng" revision="48b7ba25a15a9eae83d366c02475539725d035d0" />
- <project name="platform/external/libppp" path="external/libppp" revision="706e567fc5ff6b79738a5f470e5aa7b2cae76459" />
- <project name="platform/external/libseccomp-helper" path="external/libseccomp-helper" revision="e87019943a8b5a7cd0880910f671c37b240d5754" />
- <project groups="pdk" name="platform/external/libselinux" path="external/libselinux" revision="da4208c8808e6a62fcfe848343abd3e2f3b339cc" />
- <project groups="pdk" name="platform/external/libsepol" path="external/libsepol" revision="d26204e7d0a3be178a97d4920b82007e05a2a632" />
- <project name="platform/external/libssh2" path="external/libssh2" revision="2bb40f2445cab3ba588efb29e1835cdba2b27248" />
- <project name="platform/external/libunwind" path="external/libunwind" revision="b3436a3feed4dcb22dafc8f7818b742cacaddd1d" />
- <project name="platform/external/libusb" path="external/libusb" revision="2801917fe150393d4f4a354165fe89550ae22613" />
- <project name="platform/external/libusb-compat" path="external/libusb-compat" revision="94867ba54eb7faa8efca81cf2214d00bb9143d27" />
- <project name="platform/external/libvorbis" path="external/libvorbis" revision="de559619fd4dd0d2d9608436696fd44bdf74eba8" />
- <project groups="pdk" name="platform/external/libvpx" path="external/libvpx" revision="d64f247f64fbb814c9ecf06a56bcb0948bfca21f" />
- <project name="platform/external/libxml2" path="external/libxml2" revision="399e808f940777d18efe377bd34f738dc84729e0" />
- <project name="platform/external/libxslt" path="external/libxslt" revision="98f5140c33273d3bd67ca03566f8417406001016" />
- <project groups="libyuv" name="platform/external/libyuv" path="external/libyuv" revision="482a582884351288fb701532359652970b1ba7c0" />
- <project name="platform/external/linux-tools-perf" path="external/linux-tools-perf" revision="3e1937964f6c183eb6a0000e2dca27fc3a419ca2" />
- <project name="platform/external/littlemock" path="external/littlemock" revision="328b01eada8965cd38feea884d4080c31e3763b0" />
- <project groups="pdk" name="platform/external/llvm" path="external/llvm" revision="c4c1f81ae1b07138df50e0459631abf3082bda9c" />
- <project name="platform/external/ltrace" path="external/ltrace" revision="82ae18484c7b6a8af05354caf6de3a7f1ac5fcf9" />
- <project name="platform/external/lzma" path="external/lzma" revision="19cf4f773361c09e47a2ffe1613d66cbf632227f" />
- <project name="platform/external/marisa-trie" path="external/marisa-trie" revision="629ed059b1e85cd8e4de363d8b3dc53c15c3e08a" />
- <project name="platform/external/markdown" path="external/markdown" revision="6f2e3554ae38cc90518d32e02cb57d05988270a6" />
- <project groups="pdk" name="platform/external/mdnsresponder" path="external/mdnsresponder" revision="b25c2507ecc3f674e3b4f0a770acf9ad8fd874d0" />
- <project name="platform/external/mesa3d" path="external/mesa3d" revision="97d3f36a59ea448fa77e47a90bf04f1254670542" />
- <project name="platform/external/messageformat" path="external/messageformat" revision="180a28770171075aa484729a69d14c7cf0c93fcf" />
- <project groups="pdk" name="platform/external/mksh" path="external/mksh" revision="2a54bce0ae98f53f0b867e949b26d081691e1493" />
- <project name="platform/external/mockito" path="external/mockito" revision="4d0dcd53b27a243baf72ee0b127b188a058b318d" />
- <project name="platform/external/mockwebserver" path="external/mockwebserver" revision="2f7659c426de53122ee7922b0981058a900124a7" />
- <project name="platform/external/mp4parser" path="external/mp4parser" revision="16051e950485c6b62127c0446a760111de1a0cb9" />
- <project name="platform/external/mtpd" path="external/mtpd" revision="5ea8006691664b7e6d46d6a6dc889eac91b7fe37" />
- <project name="platform/external/naver-fonts" path="external/naver-fonts" revision="3bba7d2430bc3ec8105678a27f03fb080f0f8384" />
- <project name="platform/external/netcat" path="external/netcat" revision="444644cfa9a2f3002863caa168fb2d6b34dfd1e8" />
- <project name="platform/external/netperf" path="external/netperf" revision="38e47cd883738cb84bdb47a7d263f14f14062d7b" />
- <project name="platform/external/neven" path="external/neven" revision="504ee5ccaabd8bce4da3430b0f4e9714ac2a8e6c" />
- <project name="platform/external/nfacct" path="external/nfacct" revision="6f7aae0264821b44e9fe80fb5596c525d3e2f475" />
- <project name="platform/external/nist-pkits" path="external/nist-pkits" revision="b7a53ad5a587926cb880d9bb6f3d51657596474c" />
- <project name="platform/external/nist-sip" path="external/nist-sip" revision="b23dbfce7ea84c39cea75b612868a5832cb9af2b" />
- <project name="platform/external/noto-fonts" path="external/noto-fonts" revision="90372d894b5d9c9f2a111315d2eb3b8de1979ee4" />
- <project name="platform/external/oauth" path="external/oauth" revision="bc170f58de82000ed6460f111686a850a1890c07" />
- <project name="platform/external/objenesis" path="external/objenesis" revision="2a7655c0d503fcf5989098f65bf89eae78c32e5a" />
- <project name="platform/external/okhttp" path="external/okhttp" revision="4909663c795d974d0d4b0e2d1ebd6e179486c897" />
- <project name="platform/external/open-vcdiff" path="external/open-vcdiff" revision="6d29f2f083baf8250db94ed0b4807e513a84163d" />
- <project name="platform/external/opencv" path="external/opencv" revision="4a99e243b42afcb885d036bb451eb3c2739275b6" />
- <project name="platform/external/openfst" path="external/openfst" revision="b7434caa51427a0f5ab5c807e1a92d6ca2af8884" />
- <project name="platform/external/openssh" path="external/openssh" revision="3c335c9fb9c12375ad62748fa1d1e5ebe4710c94" />
- <project groups="pdk" name="platform/external/openssl" path="external/openssl" revision="cfe73257599ae4baae3ffb50c2c841d9249d2d16" />
- <project name="platform/external/oprofile" path="external/oprofile" revision="3722f1053f4cab90c4daf61451713a2d61d79c71" />
- <project name="platform/external/owasp/sanitizer" path="external/owasp/sanitizer" revision="6a304233f9f2010821a5a1dd40e2832b68353a3c" />
- <project name="platform/external/pcre" path="external/pcre" revision="993a14b71c8e7af03eb929d44a444137393a5324" />
- <project name="platform/external/pixman" path="external/pixman" revision="afd5bbd8074cedec8544d07920fa06786d5a4f08" />
- <project name="platform/external/ppp" path="external/ppp" revision="8b58d9bd02e2c55f547fafbe9ba55b1160665761" />
- <project groups="pdk-java" name="platform/external/proguard" path="external/proguard" revision="3fd19dba2bdc0c4b64afda4d75836e1dcf7abf97" />
- <project groups="pdk" name="platform/external/protobuf" path="external/protobuf" revision="95d99df4574c28debcf9646056a0350ff44bc7c9" />
- <project name="platform/external/qemu" path="external/qemu" revision="539e1f25ecbfe80814dba2ea77feb22087b9d53b" />
- <project name="platform/external/qemu-pc-bios" path="external/qemu-pc-bios" revision="20349dae98d7de09a7e390d4a706c64f1db6edc2" />
- <project name="platform/external/regex-re2" path="external/regex-re2" revision="0d4c52358a1af421705c54bd8a9fdd8a30558a2e" />
- <project name="platform/external/replicaisland" path="external/replicaisland" revision="99e2e54c5d036048caf09bb05eea0969de093104" />
- <project name="platform/external/robolectric" path="external/robolectric" revision="6bf395c984ed3f69711663b006aeffbb0f7e8a90" />
- <project groups="pdk" name="platform/external/safe-iop" path="external/safe-iop" revision="aa0725fb1da35e47676b6da30009322eb5ed59be" />
- <project groups="pdk" name="platform/external/scrypt" path="external/scrypt" revision="dde037b82e5cd6215244e3240dbaad417928eafa" />
- <project groups="pdk" name="platform/external/sepolicy" path="external/sepolicy" revision="21ada26daea538397029396099dce865267bae2f" />
- <project name="platform/external/sfntly" path="external/sfntly" revision="6723e5241a45c6de224c96384a595a1bf5bc5449" />
- <project name="platform/external/sil-fonts" path="external/sil-fonts" revision="795a2f4339f8a82d6cff187e2a77bb01d5911aac" />
- <project name="platform/external/skia" path="external/skia" revision="d6f2c76fdb9b0469261fa2db0b29ed48c7ac38b5" />
- <project name="platform/external/smack" path="external/smack" revision="d7955ce24d294fb2014c59d11fca184471056f44" />
- <project name="platform/external/smali" path="external/smali" revision="5fd395796e215a80c722815bf180728948868f18" />
- <project groups="pdk" name="platform/external/sonivox" path="external/sonivox" revision="c0723d864b10fbd6c5cbbfa65e886c5e9eb3aafd" />
- <project groups="pdk" name="platform/external/speex" path="external/speex" revision="eaa4765b8cc6a6dd5ee0d26dc1b61a1044817f32" />
- <project groups="pdk" name="platform/external/sqlite" path="external/sqlite" revision="50af37d784661b2d54c8e043de52ffc4f02a1a50" />
- <project name="platform/external/srec" path="external/srec" revision="540e7ee8dbf1d7ee72ef45c92efbebcb89bf6d1a" />
- <project name="platform/external/srtp" path="external/srtp" revision="98bd63b48a31b4633cdfdc8138577dfa6d8dd2a6" />
- <project groups="pdk" name="platform/external/stlport" path="external/stlport" revision="dc05ca5be2319f74b41cb429ea50f30fceff4ace" />
- <project name="platform/external/strace" path="external/strace" revision="a2adbed6e2d3ce85ebb167e16ae370681a8b5188" />
- <project name="platform/external/stressapptest" path="external/stressapptest" revision="0956427aa995561acb4471764158ae057a36dad5" />
- <project name="platform/external/svox" path="external/svox" revision="ad0a55bd0e13a27ed11034346eee9c47e3684ef2" />
- <project name="platform/external/syspatch" path="external/syspatch" revision="358a4f86b8c2cb3d3f879a37f6773dd09d4b77b0" />
- <project name="platform/external/tagsoup" path="external/tagsoup" revision="a97828cb3f8f3a1af8470e55d3c5cd62d6a7cb4c" />
- <project name="platform/external/tcpdump" path="external/tcpdump" revision="de49cdcfddf36f2b41ef3278e98a8a550a189952" />
- <project name="platform/external/timezonepicker-support" path="external/timezonepicker-support" revision="99e91a76fd74bad10266623d67cdb98d011f709e" />
- <project groups="pdk" name="platform/external/tinyalsa" path="external/tinyalsa" revision="653e7a4015341c87b4d55ec9a94ec7bdee044f6f" />
- <project groups="pdk" name="platform/external/tinycompress" path="external/tinycompress" revision="aeee2c6a19b9d3765f72bc79555005786a424233" />
- <project groups="pdk" name="platform/external/tinyxml" path="external/tinyxml" revision="f065a8058659c0e6c5a5ccddcdb4faf0fe645cd0" />
- <project groups="pdk" name="platform/external/tinyxml2" path="external/tinyxml2" revision="c74b546f5af36968ffa56d7fd4529f4273b96f48" />
- <project groups="pdk" name="platform/external/tremolo" path="external/tremolo" revision="0fec2aefa8143c83df43752bb0218dfa371cc57e" />
- <project groups="pdk" name="platform/external/valgrind" path="external/valgrind" revision="893257d6c86a18cc5cf6c92528b7027f327dca70" />
- <project name="platform/external/vixl" path="external/vixl" revision="e1ab25cde167109efb28fa6a86d5c2c80b762d58" />
- <project name="platform/external/webp" path="external/webp" revision="0db01fc3411621bec473d50db0071fd2a225962e" />
- <project groups="pdk" name="platform/external/webrtc" path="external/webrtc" revision="d62aeac391d16d4953a12120c0ff614ccde02a30" />
- <project groups="pdk" name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="88ef20ce4facae68a3e6b05429bb9f3f73a93996" />
- <project name="platform/external/xdelta3" path="external/xdelta3" revision="52d9c642e6a307c43881f20a4ed1c10e947234ba" />
- <project name="platform/external/xmlwriter" path="external/xmlwriter" revision="e95d92246ee35273dde2bee8b00485cc14c12be5" />
- <project name="platform/external/xmp_toolkit" path="external/xmp_toolkit" revision="42ea4dc6d1fc2206a7778029070ed9213e3b0fbf" />
- <project groups="pdk" name="platform/external/yaffs2" path="external/yaffs2" revision="a2cff2275e1b501ff478b03757d6e4f05fddc2db" />
- <project groups="pdk" name="platform/external/zlib" path="external/zlib" revision="8d977782c1cfe9d75cc9a464439c2ff1e27e1665" />
- <project name="platform/external/zxing" path="external/zxing" revision="7620644768ffc235607b3a94671e49518c18686f" />
- <project groups="pdk" name="platform/frameworks/av" path="frameworks/av" revision="a018cd4926460f8f5ab30a9a11df9775572d8620" />
- <project name="platform/frameworks/base" path="frameworks/base" revision="6a58309e734086a21580dd8d9175ac1817ca3ab2" />
- <project groups="pdk" name="platform/frameworks/compile/libbcc" path="frameworks/compile/libbcc" revision="3fc91521640692f844aece8b1743c4df702d1c66" />
- <project groups="pdk" name="platform/frameworks/compile/mclinker" path="frameworks/compile/mclinker" revision="e673be8f0526f9cbc83093fb579c0f76de9e4e3c" />
- <project groups="pdk" name="platform/frameworks/compile/slang" path="frameworks/compile/slang" revision="c957dd47b0a0705a686896b26cd1859d25824552" />
- <project name="platform/frameworks/ex" path="frameworks/ex" revision="3696df848aa7c574f913c97c3bf415b634934048" />
- <project name="platform/frameworks/mff" path="frameworks/mff" revision="b9669b8540a1e5c953374d53b115514335e23c27" />
- <project name="platform/frameworks/ml" path="frameworks/ml" revision="b020ad88ca28ada76a596b5dcc7e6c2854fcc132" />
- <project name="platform/frameworks/multidex" path="frameworks/multidex" revision="590a07e63868f0a1da311ff22b4a9f35eb48a865" />
- <project groups="pdk" name="platform/frameworks/native" path="frameworks/native" revision="e8878921db4a51ff5d4e75d9c8958d889a048603" />
- <project name="platform/frameworks/opt/calendar" path="frameworks/opt/calendar" revision="03b18577f8f8f799e87a62b8e03889ddacf6daa2" />
- <project name="platform/frameworks/opt/carddav" path="frameworks/opt/carddav" revision="f08aa2df132dd8dc32a0013d3750137d9dd9280a" />
- <project name="platform/frameworks/opt/colorpicker" path="frameworks/opt/colorpicker" revision="720a40ae24d526268b3c0f2dd8497b5df2cc6f23" />
- <project name="platform/frameworks/opt/datetimepicker" path="frameworks/opt/datetimepicker" revision="8a1c55baaf5ced7a98b196c689ccdd59238f6e58" />
- <project name="platform/frameworks/opt/emoji" path="frameworks/opt/emoji" revision="709f713ebcd62c61defc270d945810efca179621" />
- <project name="platform/frameworks/opt/inputmethodcommon" path="frameworks/opt/inputmethodcommon" revision="df9dd39c2047992a43b64e13bb0fc348a1630f3b" />
- <project name="platform/frameworks/opt/mailcommon" path="frameworks/opt/mailcommon" revision="1537812900e59f875cfea0483f0ae261b16d3e4b" />
- <project name="platform/frameworks/opt/mms" path="frameworks/opt/mms" revision="64817e848552fd0a429a3e026b7b1562103c56bb" />
- <project name="platform/frameworks/opt/net/voip" path="frameworks/opt/net/voip" revision="0f722c7f09ce67e058eb1cfaabf1d85f1abdf797" />
- <project name="platform/frameworks/opt/photoviewer" path="frameworks/opt/photoviewer" revision="8c32972911bf73babdb01d30267f57255e242d78" />
- <project groups="pdk" name="platform/frameworks/opt/telephony" path="frameworks/opt/telephony" revision="93faaed9056491c551ef7046e9e1de7d6397e95c" />
- <project name="platform/frameworks/opt/timezonepicker" path="frameworks/opt/timezonepicker" revision="3820b87bfbc86d066e9093e78254e1f3728ad77d" />
- <project name="platform/frameworks/opt/vcard" path="frameworks/opt/vcard" revision="5907243e6cf0603adf266ebfa7ee5ee465b9c596" />
- <project name="platform/frameworks/opt/widget" path="frameworks/opt/widget" revision="466e0e0307b3f6aa4f4be3d9419b5996bd389da5" />
- <project groups="pdk" name="platform/frameworks/rs" path="frameworks/rs" revision="ad0544fdf918e64cec05d1c98588880f10b09220" />
- <project name="platform/frameworks/support" path="frameworks/support" revision="f05c07d3528765076adc16337a1f68f1700955dc" />
- <project name="platform/frameworks/testing" path="frameworks/testing" revision="5c8e0271db889518f5969b142a37faa01a4ee54d" />
- <project name="platform/frameworks/volley" path="frameworks/volley" revision="0e406003b5d434d8f16d7d6ad97d446060b788e6" />
- <project name="platform/frameworks/webview" path="frameworks/webview" revision="6ed700e171cb2ee3303c08a1db2abc0e56fd307a" />
- <project name="platform/frameworks/wilhelm" path="frameworks/wilhelm" revision="a62c3572e60ae0446632de15418a65089cccf551" />
- <project name="platform/hardware/akm" path="hardware/akm" revision="32838ef838d1341aa8b77022869b801fb0bbb26c" />
- <project groups="pdk" name="platform/hardware/broadcom/libbt" path="hardware/broadcom/libbt" revision="55ddd0cce019e88829f92b2fe4e17d5869daa9b9" />
- <project groups="broadcom_wlan" name="platform/hardware/broadcom/wlan" path="hardware/broadcom/wlan" revision="47a3b8f496e6d2a836ac6b7268e5626c969542ec" />
- <project groups="invensense" name="platform/hardware/invensense" path="hardware/invensense" revision="0f5bc7cd710fac85377621a8b9a4c364af80605f" />
- <project groups="pdk" name="platform/hardware/libhardware" path="hardware/libhardware" revision="3e618a6aa10c783d1536f20edfc3347939cfa18e" />
- <project groups="pdk" name="platform/hardware/libhardware_legacy" path="hardware/libhardware_legacy" revision="4c20a09e8684657448f0bc97a2da4e56c94d484e" />
- <project groups="qcom" name="platform/hardware/qcom/audio" path="hardware/qcom/audio" revision="d47ff224c7b24933c701acae8d5e4c98a1bc80af" />
- <project groups="qcom" name="platform/hardware/qcom/bt" path="hardware/qcom/bt" revision="cf314a462ba06f4bd3352d5d4630edcf6edbbe97" />
- <project groups="qcom" name="platform/hardware/qcom/camera" path="hardware/qcom/camera" revision="fbf72e519ec5fe2f2720b1a3d119e2d69e172e34" />
- <project groups="qcom" name="platform/hardware/qcom/display" path="hardware/qcom/display" revision="0a611c6ae11b65fec5ada5ecaa0893541db34156" />
- <project groups="qcom" name="platform/hardware/qcom/keymaster" path="hardware/qcom/keymaster" revision="70d36107318e1d3f7abf62a56279b3f9da3ff000" />
- <project groups="qcom" name="platform/hardware/qcom/media" path="hardware/qcom/media" revision="1208a868bcb0ffaa650a7e68b51031254c775d39" />
- <project groups="qcom_msm8960" name="platform/hardware/qcom/msm8960" path="hardware/qcom/msm8960" revision="ca38ed098b05a79d20e852348f27d7c40a53f801" />
- <project groups="qcom_msm8x74" name="platform/hardware/qcom/msm8x74" path="hardware/qcom/msm8x74" revision="0c6844ea9ee14fd7bbfd6af0bcc6b6b682f46d1c" />
- <project groups="qcom" name="platform/hardware/qcom/power" path="hardware/qcom/power" revision="ff9f4538c09399030fa73e3e65a167852cb91e8f" />
- <project groups="qcom" name="platform/hardware/qcom/sensors" path="hardware/qcom/sensors" revision="07c5bcdb36158e22d33bac02eecd83d4ff1fb2f8" />
- <project groups="qcom_wlan" name="platform/hardware/qcom/wlan" path="hardware/qcom/wlan" revision="daa321b0ad8c10b454dc28d7e6dadc72196a8c7a" />
- <project groups="pdk" name="platform/hardware/ril" path="hardware/ril" revision="eb2a93458204a928edfe36f043ddb48cf5575143" />
- <project groups="exynos5" name="platform/hardware/samsung_slsi/exynos5" path="hardware/samsung_slsi/exynos5" revision="d7bd354358ecfb1e52afb3da4fc586c0822c696a" />
- <project name="platform/hardware/ti/omap3" path="hardware/ti/omap3" revision="949aad363a9cc794f9ac8fd42338ae1678e50bc1" />
- <project groups="omap4" name="platform/hardware/ti/omap4xxx" path="hardware/ti/omap4xxx" revision="c32caab84ff9edc1489ed6c8079c7d252caafc4d" />
- <project name="platform/libcore" path="libcore" revision="d343e35535a99bad32eea0defc8a3e9c23c9967f" />
- <project groups="pdk-java" name="platform/libnativehelper" path="libnativehelper" revision="b37e11d07dec2d49b576709ae8e0568a9daabd07" />
- <project name="platform/ndk" path="ndk" revision="f584f76882baf374166cf12b99cd5f3dbdf3b6b9" />
- <project name="platform/packages/apps/BasicSmsReceiver" path="packages/apps/BasicSmsReceiver" revision="80327793c4b4ebf4a6a53b72e46c477afe18f135" />
- <project name="platform/packages/apps/Bluetooth" path="packages/apps/Bluetooth" revision="7efa9db2129c99475684a2e44c4fb89cce3134bc" />
- <project name="platform/packages/apps/Browser" path="packages/apps/Browser" revision="fe4083510dc773911651456f150bf5432f81a6c0" />
- <project name="platform/packages/apps/Calculator" path="packages/apps/Calculator" revision="6c7521bb685c9b7b7c36f2077612d4b1a0e808d4" />
- <project name="platform/packages/apps/Calendar" path="packages/apps/Calendar" revision="2d72f6bed6a0eeaddbda08393063fe873c1c7922" />
- <project name="platform/packages/apps/Camera" path="packages/apps/Camera" revision="b0e357d548fb8d10896200add2b932199a96a2ea" />
- <project name="platform/packages/apps/Camera2" path="packages/apps/Camera2" revision="ece4866dc575b956801f6dab2d6c4923e272c5fa" />
- <project name="platform/packages/apps/CellBroadcastReceiver" path="packages/apps/CellBroadcastReceiver" revision="21d8baf492007cc01545905de33ecefe5d947843" />
- <project name="platform/packages/apps/CertInstaller" path="packages/apps/CertInstaller" revision="483a188feda6e9d311aef437d28f30e1fb6afeb0" />
- <project name="platform/packages/apps/Contacts" path="packages/apps/Contacts" revision="24a4f48dc5c768188143648e267889477e4185e8" />
- <project name="platform/packages/apps/ContactsCommon" path="packages/apps/ContactsCommon" revision="6ce4a3bc083a7dbcc7ffa2bebff242638d7f8e61" />
- <project name="platform/packages/apps/DeskClock" path="packages/apps/DeskClock" revision="d3bfe9223f3e70271813f48b8ef5500c3a90c0b3" />
- <project name="platform/packages/apps/Dialer" path="packages/apps/Dialer" revision="5cb300ef50e9942eef746319dd1b1b6e7c2c05e2" />
- <project name="platform/packages/apps/Email" path="packages/apps/Email" revision="22766dcf6a44416b2972c053739472317017257d" />
- <project name="platform/packages/apps/Exchange" path="packages/apps/Exchange" revision="ab03a7f9b197b6ffcc390dd5fb589067a5161148" />
- <project name="platform/packages/apps/Gallery" path="packages/apps/Gallery" revision="9595006a3347c08e6b8e31d679903bb8f77a343d" />
- <project name="platform/packages/apps/Gallery2" path="packages/apps/Gallery2" revision="9cde04ed08f3a5201a007d78b3c89f43fb3003e0" />
- <project name="platform/packages/apps/HTMLViewer" path="packages/apps/HTMLViewer" revision="7498890092c388dc59ca932e09ec79dd568b1a19" />
- <project name="platform/packages/apps/InCallUI" path="packages/apps/InCallUI" revision="d968d1a28dae45229b1be9f05bef8df13821e94d" />
- <project name="platform/packages/apps/KeyChain" path="packages/apps/KeyChain" revision="e6243f79f3ce6daeb2d8d879e6e1a684ffc1b2fc" />
- <project name="platform/packages/apps/Launcher2" path="packages/apps/Launcher2" revision="31569f6dbd44d443ff54c460b733e62fc37d2319" />
- <project name="platform/packages/apps/Launcher3" path="packages/apps/Launcher3" revision="3a9f3a7806a0153865415d6207c6812915d3f6b1" />
- <project name="platform/packages/apps/LegacyCamera" path="packages/apps/LegacyCamera" revision="d9b5d8941d1ec47ff391da2b8cc8ec90f902062f" />
- <project name="platform/packages/apps/Mms" path="packages/apps/Mms" revision="e770738ea4389afddb0b4e6c69749f9456ed0f48" />
- <project name="platform/packages/apps/Music" path="packages/apps/Music" revision="bfca689bb6605cfcd1e0c1781c707735efb7444e" />
- <project name="platform/packages/apps/MusicFX" path="packages/apps/MusicFX" revision="aaa2f99caac6f088b23de55fe2eb1e8ee305b1fb" />
- <project name="platform/packages/apps/Nfc" path="packages/apps/Nfc" revision="f62a9a00a13ba333e88cb9e8ce2553d6acf708ad" />
- <project name="platform/packages/apps/OneTimeInitializer" path="packages/apps/OneTimeInitializer" revision="01e429c08e51291315890de9677151a7e0b6ad35" />
- <project name="platform/packages/apps/PackageInstaller" path="packages/apps/PackageInstaller" revision="212398024b4491276ef00cf7fcd829c89200b6ba" />
- <project name="platform/packages/apps/Phone" path="packages/apps/Phone" revision="bf4ec5b1258628bfa6a82aa0d80f348a77bbf194" />
- <project name="platform/packages/apps/PhoneCommon" path="packages/apps/PhoneCommon" revision="16f62c5ab5c21981e63d678187ad4b44e686332b" />
- <project name="platform/packages/apps/Protips" path="packages/apps/Protips" revision="325232e344b257a3c236ead2adc60c7378f226c0" />
- <project name="platform/packages/apps/Provision" path="packages/apps/Provision" revision="78ca0db658fe6253d506916e36319e620476f809" />
- <project name="platform/packages/apps/QuickSearchBox" path="packages/apps/QuickSearchBox" revision="cfb7af6652a7fbcc0f86341edfe14dc316c9ff37" />
- <project name="platform/packages/apps/Settings" path="packages/apps/Settings" revision="2abbacb7d46657e5863eb2ef0035521ffc41a0a8" />
- <project name="platform/packages/apps/SmartCardService" path="packages/apps/SmartCardService" revision="29eae320a4bd222b5ff1c092f84f1aebba88d0b7" />
- <project name="platform/packages/apps/SoundRecorder" path="packages/apps/SoundRecorder" revision="b0e671faf142fa0b933b4f1cd7d186b1f37ebe46" />
- <project name="platform/packages/apps/SpareParts" path="packages/apps/SpareParts" revision="4db997871e3f4c3f84660815096e5276b47c5c91" />
- <project name="platform/packages/apps/SpeechRecorder" path="packages/apps/SpeechRecorder" revision="536aa74ff3a77186bef29dc9333a34688fa59d13" />
- <project name="platform/packages/apps/Stk" path="packages/apps/Stk" revision="115b75461f8e1fb432fe1a892549ca1c96cef497" />
- <project name="platform/packages/apps/Tag" path="packages/apps/Tag" revision="f830b07335bd2dd794b84507b5390f7d893fe428" />
- <project name="platform/packages/apps/TvSettings" path="packages/apps/TvSettings" revision="24e45eaf3b4badaf02e449e7f6d07c72e743f521" />
- <project name="platform/packages/apps/UnifiedEmail" path="packages/apps/UnifiedEmail" revision="d4537c907920f4470b70e91c187ef7a0b31632db" />
- <project name="platform/packages/apps/VideoEditor" path="packages/apps/VideoEditor" revision="a49ea28e1628f507ae3a564215664c29c5fa1215" />
- <project name="platform/packages/apps/VoiceDialer" path="packages/apps/VoiceDialer" revision="72df4532dfca9a82e8aef55fcdfce3026d3d3312" />
- <project name="platform/packages/experimental" path="packages/experimental" revision="588c7cda9c62fb77d23bc089a63cba8a96bc9ffb" />
- <project name="platform/packages/inputmethods/LatinIME" path="packages/inputmethods/LatinIME" revision="159474f2ae5d13308ca1b92b8a5ccd809ec6a450" />
- <project name="platform/packages/inputmethods/OpenWnn" path="packages/inputmethods/OpenWnn" revision="59aefa242169b7a51c2381daee58ff22fd1834ce" />
- <project name="platform/packages/inputmethods/PinyinIME" path="packages/inputmethods/PinyinIME" revision="49aebad1c1cfbbcaa9288ffed5161e79e57c3679" />
- <project name="platform/packages/providers/ApplicationsProvider" path="packages/providers/ApplicationsProvider" revision="3347f31bd268ca3153abe5def9361f625bd73efd" />
- <project name="platform/packages/providers/CalendarProvider" path="packages/providers/CalendarProvider" revision="20360f2fdd7ad2de1234b7ed61e3ea120f0dc635" />
- <project name="platform/packages/providers/ContactsProvider" path="packages/providers/ContactsProvider" revision="6ac2395324c0e7539434b7c68ec738f867d7ed37" />
- <project name="platform/packages/providers/DownloadProvider" path="packages/providers/DownloadProvider" revision="90e7485d68095b5fc5044dd1bc6cd4dfc485eaa3" />
- <project name="platform/packages/providers/MediaProvider" path="packages/providers/MediaProvider" revision="501b93fb00db86fe4fb53dc000f6f11587afe4b0" />
- <project name="platform/packages/providers/PartnerBookmarksProvider" path="packages/providers/PartnerBookmarksProvider" revision="96d0a80af45923767baf449fc8c735c2f71d64ae" />
- <project name="platform/packages/providers/TelephonyProvider" path="packages/providers/TelephonyProvider" revision="91e705bc7662192ea33f2bac6b0a6c79fc9bc7ab" />
- <project name="platform/packages/providers/UserDictionaryProvider" path="packages/providers/UserDictionaryProvider" revision="361f35b7b1fe758d93e0952536a298b2ed045a89" />
- <project name="platform/packages/screensavers/Basic" path="packages/screensavers/Basic" revision="4b5d9d8bea733c4e5876541831f27bf40588b516" />
- <project name="platform/packages/screensavers/PhotoTable" path="packages/screensavers/PhotoTable" revision="a5e0fee8e923cfc8682eb4431bc3997ed15f649a" />
- <project name="platform/packages/screensavers/WebView" path="packages/screensavers/WebView" revision="6e0a80f6faed6191acc8ce1b6c79eada09e9e042" />
- <project name="platform/packages/services/Telephony" path="packages/services/Telephony" revision="aa156251eb0414b8c6546c98769789dc28b38140" />
- <project name="platform/packages/wallpapers/Basic" path="packages/wallpapers/Basic" revision="2e1d8404b87caf13cde644959f28213f2db09843" />
- <project name="platform/packages/wallpapers/Galaxy4" path="packages/wallpapers/Galaxy4" revision="34b31b45e75b2e73a770fef1a2f9a862b10f1a57" />
- <project name="platform/packages/wallpapers/HoloSpiral" path="packages/wallpapers/HoloSpiral" revision="63b75996a7cfb713a6a6feb5c774ba4b46c7d6eb" />
- <project name="platform/packages/wallpapers/LivePicker" path="packages/wallpapers/LivePicker" revision="8082f92e76774607d62412e8e1191dd940f055ba" />
- <project name="platform/packages/wallpapers/MagicSmoke" path="packages/wallpapers/MagicSmoke" revision="f01ea4c07914010d52a42130acb7e67d4306fbda" />
- <project name="platform/packages/wallpapers/MusicVisualization" path="packages/wallpapers/MusicVisualization" revision="72fbcf3a8e4ebee42c36a5887432ca823ef0e4e5" />
- <project name="platform/packages/wallpapers/NoiseField" path="packages/wallpapers/NoiseField" revision="7d3e52a18a1255baffd7c0675a465f1b85b99f56" />
- <project name="platform/packages/wallpapers/PhaseBeam" path="packages/wallpapers/PhaseBeam" revision="0da76f35378677f1102e0be218ce1993c0e528b6" />
- <project groups="pdk" name="platform/pdk" path="pdk" revision="d440d4219412981df7ef90bed65acf29b2e7ea6a" />
- <project name="platform/prebuilts/android-emulator" path="prebuilts/android-emulator" revision="d6a246c24accff42eb433f5e39d14cb24faf1e58" />
- <project groups="pdk,darwin" name="platform/prebuilts/clang/darwin-x86/3.1" path="prebuilts/clang/darwin-x86/3.1" revision="426233405bef3c7c825095ab14256c3773894b9b" />
- <project groups="pdk,darwin" name="platform/prebuilts/clang/darwin-x86/3.2" path="prebuilts/clang/darwin-x86/3.2" revision="af856d77b3cbb1f6afccdc531bee991403c28907" />
- <project groups="darwin,arm" name="platform/prebuilts/clang/darwin-x86/arm/3.3" path="prebuilts/clang/darwin-x86/arm/3.3" revision="54acc51e28850485e380b55916868a4e1ff17998" />
- <project groups="pdk,darwin" name="platform/prebuilts/clang/darwin-x86/host/3.4" path="prebuilts/clang/darwin-x86/host/3.4" revision="a798fe00dbd92ad4e5f7123a2e2bc1d805db04f6" />
- <project groups="pdk,darwin" name="platform/prebuilts/clang/darwin-x86/host/3.5" path="prebuilts/clang/darwin-x86/host/3.5" revision="ce812d27fb78972e71482e93241b9770ca54845d" />
- <project groups="darwin,mips" name="platform/prebuilts/clang/darwin-x86/mips/3.3" path="prebuilts/clang/darwin-x86/mips/3.3" revision="da3dad928542362835082b2eda44e4dc315d65bb" />
- <project groups="darwin,x86" name="platform/prebuilts/clang/darwin-x86/x86/3.3" path="prebuilts/clang/darwin-x86/x86/3.3" revision="f67a83f35e30f92b312fbee852184c3f6dc38f34" />
- <project groups="pdk,linux" name="platform/prebuilts/clang/linux-x86/3.1" path="prebuilts/clang/linux-x86/3.1" revision="e95b4ce22c825da44d14299e1190ea39a5260bde" />
- <project groups="pdk,linux" name="platform/prebuilts/clang/linux-x86/3.2" path="prebuilts/clang/linux-x86/3.2" revision="471afab478649078ad7c75ec6b252481a59e19b8" />
- <project groups="linux,arm" name="platform/prebuilts/clang/linux-x86/arm/3.3" path="prebuilts/clang/linux-x86/arm/3.3" revision="2f6d2db9e2af3507d132cf5d286a42fe1d47f7bc" />
- <project groups="pdk,linux" name="platform/prebuilts/clang/linux-x86/host/3.4" path="prebuilts/clang/linux-x86/host/3.4" revision="fae26a039f79d780ddedcad07f164d9e6c05fc87" />
- <project groups="pdk,linux" name="platform/prebuilts/clang/linux-x86/host/3.5" path="prebuilts/clang/linux-x86/host/3.5" revision="485ffdc99707f81f4201e85bbbb937f23e1e04aa" />
- <project groups="linux,mips" name="platform/prebuilts/clang/linux-x86/mips/3.3" path="prebuilts/clang/linux-x86/mips/3.3" revision="51f8e2760628588fe268438d612d942c30d13fb2" />
- <project groups="linux,x86" name="platform/prebuilts/clang/linux-x86/x86/3.3" path="prebuilts/clang/linux-x86/x86/3.3" revision="017a8a67f92a66b29ab17772e50642a7b9d0f8e6" />
- <project name="platform/prebuilts/devtools" path="prebuilts/devtools" revision="be724be535ea50585d8c625b768ccb63aacd2926" />
- <project groups="pdk" name="platform/prebuilts/eclipse" path="prebuilts/eclipse" revision="cf9f78f8cf41b16edf9f712598a42743d5cea4af" />
- <project groups="notdefault,eclipse" name="platform/prebuilts/eclipse-build-deps" path="prebuilts/eclipse-build-deps" revision="ceb739d6a7c10f5fb5a6cf6e1f702453b1361ad3" />
- <project groups="notdefault,eclipse" name="platform/prebuilts/eclipse-build-deps-sources" path="prebuilts/eclipse-build-deps-sources" revision="8b7d8f6033ffe2d22905d10cf6d57d5bdcbe519b" />
- <project groups="pdk,darwin,arm" name="platform/prebuilts/gcc/darwin-x86/aarch64/aarch64-linux-android-4.8" path="prebuilts/gcc/darwin-x86/aarch64/aarch64-linux-android-4.8" revision="a261d38eaebb7ff406a6bb60237b36fc61714d46" />
- <project groups="pdk,darwin,arm" name="platform/prebuilts/gcc/darwin-x86/aarch64/aarch64-linux-android-4.9" path="prebuilts/gcc/darwin-x86/aarch64/aarch64-linux-android-4.9" revision="32d722d66d7a935a8b6f8e6ab2d5d8bf0e9e0986" />
- <project groups="pdk,darwin,arm" name="platform/prebuilts/gcc/darwin-x86/arm/arm-eabi-4.8" path="prebuilts/gcc/darwin-x86/arm/arm-eabi-4.8" revision="6d08ca9f45ff685648fd13c75bf5cac4b11c19bb" />
- <project groups="pdk,darwin,arm" name="platform/prebuilts/gcc/darwin-x86/arm/arm-linux-androideabi-4.8" path="prebuilts/gcc/darwin-x86/arm/arm-linux-androideabi-4.8" revision="264394c23b2686ce52cd4ffb116ced127aa7f8fc" />
- <project groups="pdk,darwin" name="platform/prebuilts/gcc/darwin-x86/host/headers" path="prebuilts/gcc/darwin-x86/host/headers" revision="4ac4f7cc41cf3c9e36fc3d6cf37fd1cfa9587a68" />
- <project groups="pdk,darwin" name="platform/prebuilts/gcc/darwin-x86/host/i686-apple-darwin-4.2.1" path="prebuilts/gcc/darwin-x86/host/i686-apple-darwin-4.2.1" revision="8834958755acc291d126ba7ee38ac731d04f9c9e" />
- <project groups="pdk,darwin,mips" name="platform/prebuilts/gcc/darwin-x86/mips/mips64el-linux-android-4.8" path="prebuilts/gcc/darwin-x86/mips/mips64el-linux-android-4.8" revision="3b5bef47de8017ff39ef5bfbe801e3fa6b272fab" />
- <project name="platform/prebuilts/gcc/darwin-x86/mips/mips64el-linux-android-4.9" path="prebuilts/gcc/darwin-x86/mips/mips64el-linux-android-4.9" revision="367a6529b0cc9f5ac5ca69226f583420563fd473" />
- <project groups="pdk,darwin,mips" name="platform/prebuilts/gcc/darwin-x86/mips/mipsel-linux-android-4.8" path="prebuilts/gcc/darwin-x86/mips/mipsel-linux-android-4.8" revision="ba97180acd4251d3acf08530faa4a724af74abd3" />
- <project groups="pdk,darwin,x86" name="platform/prebuilts/gcc/darwin-x86/x86/x86_64-linux-android-4.8" path="prebuilts/gcc/darwin-x86/x86/x86_64-linux-android-4.8" revision="c3c37a54f07d51a50e17d63dbf1d92da343f45ce" />
- <project name="platform/prebuilts/gcc/darwin-x86/x86/x86_64-linux-android-4.9" path="prebuilts/gcc/darwin-x86/x86/x86_64-linux-android-4.9" revision="a7c5a1df753fd3a24494d5e1fe00211048be5c1d" />
- <project groups="pdk,linux,arm" name="platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.8" path="prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.8" revision="7334f0a7a872700d0aaf00bea75917c077c45530" />
- <project groups="pdk,linux,arm" name="platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9" path="prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9" revision="a3f0180676c6b6cd9c664704f86855d3404ae4dd" />
- <project groups="pdk,linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8" path="prebuilts/gcc/linux-x86/arm/arm-eabi-4.8" revision="26e93f6af47f7bd3a9beb5c102a5f45e19bfa38a" />
- <project groups="pdk,linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8" path="prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8" revision="d9735fc81434f2af2c44d86ca57740c673c8d9bc" />
- <project groups="pdk,linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6" revision="eb5c9f0ae36bf964f6855bde54e1b387e2c26bb6" />
- <project groups="pdk,linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.8" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.8" revision="1b0544da652fda90a41a1f69889d6b137ce20fb9" />
- <project name="platform/prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8" path="prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8" revision="2725a175a32032fb9a63e247c176ecc3d448ea27" />
- <project groups="pdk,linux,mips" name="platform/prebuilts/gcc/linux-x86/mips/mips64el-linux-android-4.8" path="prebuilts/gcc/linux-x86/mips/mips64el-linux-android-4.8" revision="38586de6b44714b4adcf21119fe6b267e33f3ca6" />
- <project name="platform/prebuilts/gcc/linux-x86/mips/mips64el-linux-android-4.9" path="prebuilts/gcc/linux-x86/mips/mips64el-linux-android-4.9" revision="eabc7ae8ed527ee3d4517196732fa3f3e8939a28" />
- <project groups="pdk,linux,mips" name="platform/prebuilts/gcc/linux-x86/mips/mipsel-linux-android-4.8" path="prebuilts/gcc/linux-x86/mips/mipsel-linux-android-4.8" revision="c06b9b305c365163c99d4ffba49ac37ce2716024" />
- <project groups="pdk,linux,x86" name="platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.8" path="prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.8" revision="e08fa7e57a573a9baa5ccd8d4b8d73cc871f9b48" />
- <project name="platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9" path="prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9" revision="e99278016e6285363bc20d1b35d4b9b5c4e8b0a0" />
- <project name="platform/prebuilts/gradle-plugin" path="prebuilts/gradle-plugin" revision="e7814a3cbb96742ff74505a1fc152cb534fbf2f9" />
- <project name="platform/prebuilts/maven_repo/android" path="prebuilts/maven_repo/android" revision="0dbe3df0f057de9e83e599b9be2ca866c673130d" />
- <project groups="pdk" name="platform/prebuilts/misc" path="prebuilts/misc" revision="3cc2e316acf9da501479bbfd85159407239994d2" />
- <project groups="pdk" name="platform/prebuilts/ndk" path="prebuilts/ndk" revision="7a8bc5c36d519c41de61765ff94245f56c4bed7a" />
- <project groups="darwin" name="platform/prebuilts/python/darwin-x86/2.7.5" path="prebuilts/python/darwin-x86/2.7.5" revision="2bdd4fd418614c7c0101147d02199d0e47c4980e" />
- <project groups="linux" name="platform/prebuilts/python/linux-x86/2.7.5" path="prebuilts/python/linux-x86/2.7.5" revision="6fbc8802b3b68d24a4ee83f164b22490cf702ff2" />
- <project groups="pdk" name="platform/prebuilts/qemu-kernel" path="prebuilts/qemu-kernel" revision="5f91f38eac40a8465f3a7e4aa298a75afcf2936a" />
- <project name="platform/prebuilts/runtime" path="prebuilts/runtime" revision="56e663b8ec9cd0df9ce5afdc7b7d56460faf44c8" />
- <project groups="pdk" name="platform/prebuilts/sdk" path="prebuilts/sdk" revision="52043ca65e06bc84779dd8d3e55e72ad04bcef59" />
- <project groups="pdk,tools" name="platform/prebuilts/tools" path="prebuilts/tools" revision="130c3d0a1a484d617531d75ddd50714f68213cbb" />
- <project name="platform/sdk" path="sdk" revision="1af9ef83f5f6c6fd9202d5bdd8d4248a4eb855aa" />
- <project groups="pdk" name="platform/system/core" path="system/core" revision="cddc97cb3a927d179a42e0fec77f0d267fcd74d1" />
- <project groups="pdk" name="platform/system/extras" path="system/extras" revision="97ed949ec7bef088ca3d06fb7b5f3bdad9a5103c" />
- <project name="platform/system/keymaster" path="system/keymaster" revision="7a70abbf29293b30bb1e7ed3a58deb40f8774a53" />
- <project groups="pdk" name="platform/system/media" path="system/media" revision="77f0f32b32adc5ba1134e7a68e4d907c4f695eb6" />
- <project groups="pdk" name="platform/system/netd" path="system/netd" revision="f5d949ef0991737af9daa7ba702cc2ec638e435b" />
- <project groups="pdk" name="platform/system/security" path="system/security" revision="0387a7fd23021b904612101b727a2060847f6169" />
- <project groups="pdk" name="platform/system/vold" path="system/vold" revision="c0c2867518eed4539444434c95fad8185a6ac08e" />
- <project groups="notdefault,tools" name="platform/tools/adt/eclipse" path="tools/adt/eclipse" revision="ede2ed86419bb4c78428f1ac09825b1a247d8e24" />
- <project groups="notdefault,tools" name="platform/tools/adt/idea" path="tools/adt/idea" revision="50a5da1af3e851df7aff37c291541000685bcad4" />
- <project groups="notdefault,tools" name="platform/tools/base" path="tools/base" revision="4dc06057ba77596807e2d28c715719f240f71549" />
- <project groups="notdefault,tools" name="platform/tools/build" path="tools/build" revision="69c4b95102b4b9862bfba68b3eaf5b7537a705ee" />
- <project groups="notdefault,tools" name="platform/tools/emulator" path="tools/emulator" revision="c427e5d5227ba9413307670a5d758d9ced394a7e" />
- <project groups="tools" name="platform/tools/external/fat32lib" path="tools/external/fat32lib" revision="3880776e41ff7def06e351720f2d162f88b58a03" />
- <project groups="tools" name="platform/tools/external/gradle" path="tools/external/gradle" revision="842b7a27df8606faa29b0875a13270701eb78dd8" />
- <project groups="notdefault,tools" name="platform/tools/idea" path="tools/idea" revision="12356153d01fcde14dd3a06948cfded92c20d068" />
- <project groups="notdefault,motodev" name="platform/tools/motodev" path="tools/motodev" revision="69989786cefbde82527960a1e100ec9afba46a98" />
- <project groups="notdefault,tools" name="platform/tools/studio/cloud" path="tools/studio/cloud" revision="839eb097c5fc73f91a722f1457a2e8e11eb4e1a5" />
- <project groups="notdefault,tools" name="platform/tools/swt" path="tools/swt" revision="aaf3131b0e4b15d39156a6e94e5da06b0183d61d" />
-</manifest>
diff --git a/tools/gyp/buildbot/buildbot_run.py b/tools/gyp/buildbot/buildbot_run.py
index f46ab1822fe..9a2b71f1b35 100755
--- a/tools/gyp/buildbot/buildbot_run.py
+++ b/tools/gyp/buildbot/buildbot_run.py
@@ -3,27 +3,17 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-
"""Argument-less script to select what to run on the buildbots."""
-
-import filecmp
import os
import shutil
import subprocess
import sys
-if sys.platform in ['win32', 'cygwin']:
- EXE_SUFFIX = '.exe'
-else:
- EXE_SUFFIX = ''
-
-
BUILDBOT_DIR = os.path.dirname(os.path.abspath(__file__))
TRUNK_DIR = os.path.dirname(BUILDBOT_DIR)
ROOT_DIR = os.path.dirname(TRUNK_DIR)
-ANDROID_DIR = os.path.join(ROOT_DIR, 'android')
CMAKE_DIR = os.path.join(ROOT_DIR, 'cmake')
CMAKE_BIN_DIR = os.path.join(CMAKE_DIR, 'bin')
OUT_DIR = os.path.join(TRUNK_DIR, 'out')
@@ -71,95 +61,6 @@ def PrepareCmake():
CallSubProcess( ['make', 'cmake'], cwd=CMAKE_DIR)
-_ANDROID_SETUP = 'source build/envsetup.sh && lunch full-eng'
-
-
-def PrepareAndroidTree():
- """Prepare an Android tree to run 'android' format tests."""
- if os.environ['BUILDBOT_CLOBBER'] == '1':
- print '@@@BUILD_STEP Clobber Android checkout@@@'
- shutil.rmtree(ANDROID_DIR)
-
- # (Re)create the directory so that the following steps will succeed.
- if not os.path.isdir(ANDROID_DIR):
- os.mkdir(ANDROID_DIR)
-
- # We use a manifest from the gyp project listing pinned revisions of AOSP to
- # use, to ensure that we test against a stable target. This needs to be
- # updated to pick up new build system changes sometimes, so we must test if
- # it has changed.
- manifest_filename = 'aosp_manifest.xml'
- gyp_manifest = os.path.join(BUILDBOT_DIR, manifest_filename)
- android_manifest = os.path.join(ANDROID_DIR, '.repo', 'manifests',
- manifest_filename)
- manifest_is_current = (os.path.isfile(android_manifest) and
- filecmp.cmp(gyp_manifest, android_manifest))
- if not manifest_is_current:
- # It's safe to repeat these steps, so just do them again to make sure we are
- # in a good state.
- print '@@@BUILD_STEP Initialize Android checkout@@@'
- CallSubProcess(
- ['repo', 'init',
- '-u', 'https://android.googlesource.com/platform/manifest',
- '-b', 'master',
- '-g', 'all,-notdefault,-device,-darwin,-mips,-x86'],
- cwd=ANDROID_DIR)
- shutil.copy(gyp_manifest, android_manifest)
-
- print '@@@BUILD_STEP Sync Android@@@'
- CallSubProcess(['repo', 'sync', '-j4', '-m', manifest_filename],
- cwd=ANDROID_DIR)
-
- # If we already built the system image successfully and didn't sync to a new
- # version of the source, skip running the build again as it's expensive even
- # when there's nothing to do.
- system_img = os.path.join(ANDROID_DIR, 'out', 'target', 'product', 'generic',
- 'system.img')
- if manifest_is_current and os.path.isfile(system_img):
- return
-
- print '@@@BUILD_STEP Build Android@@@'
- CallSubProcess(
- ['/bin/bash',
- '-c', '%s && make -j4' % _ANDROID_SETUP],
- cwd=ANDROID_DIR)
-
-
-def StartAndroidEmulator():
- """Start an android emulator from the built android tree."""
- print '@@@BUILD_STEP Start Android emulator@@@'
-
- CallSubProcess(['/bin/bash', '-c',
- '%s && adb kill-server ' % _ANDROID_SETUP],
- cwd=ANDROID_DIR)
-
- # If taskset is available, use it to force adbd to run only on one core, as,
- # sadly, it improves its reliability (see crbug.com/268450).
- adbd_wrapper = ''
- with open(os.devnull, 'w') as devnull_fd:
- if subprocess.call(['which', 'taskset'], stdout=devnull_fd) == 0:
- adbd_wrapper = 'taskset -c 0'
- CallSubProcess(['/bin/bash', '-c',
- '%s && %s adb start-server ' % (_ANDROID_SETUP, adbd_wrapper)],
- cwd=ANDROID_DIR)
-
- subprocess.Popen(
- ['/bin/bash', '-c',
- '%s && emulator -no-window' % _ANDROID_SETUP],
- cwd=ANDROID_DIR)
- CallSubProcess(
- ['/bin/bash', '-c',
- '%s && adb wait-for-device' % _ANDROID_SETUP],
- cwd=ANDROID_DIR)
-
-
-def StopAndroidEmulator():
- """Stop all android emulators."""
- print '@@@BUILD_STEP Stop Android emulator@@@'
- # If this fails, it's because there is no emulator running.
- subprocess.call(['pkill', 'emulator.*'])
-
-
def GypTestFormat(title, format=None, msvs_version=None, tests=[]):
"""Run the gyp tests for a given format, emitting annotator tags.
@@ -185,15 +86,7 @@ def GypTestFormat(title, format=None, msvs_version=None, tests=[]):
'--format', format,
'--path', CMAKE_BIN_DIR,
'--chdir', 'gyp'] + tests)
- if format == 'android':
- # gyptest needs the environment setup from envsetup/lunch in order to build
- # using the 'android' backend, so this is done in a single shell.
- retcode = subprocess.call(
- ['/bin/bash',
- '-c', '%s && cd %s && %s' % (_ANDROID_SETUP, ROOT_DIR, command)],
- cwd=ANDROID_DIR, env=env)
- else:
- retcode = subprocess.call(command, cwd=ROOT_DIR, env=env, shell=True)
+ retcode = subprocess.call(command, cwd=ROOT_DIR, env=env, shell=True)
if retcode:
# Emit failure tag, and keep going.
print '@@@STEP_FAILURE@@@'
@@ -209,15 +102,7 @@ def GypBuild():
print 'Done.'
retcode = 0
- # The Android gyp bot runs on linux so this must be tested first.
- if os.environ['BUILDBOT_BUILDERNAME'] == 'gyp-android':
- PrepareAndroidTree()
- StartAndroidEmulator()
- try:
- retcode += GypTestFormat('android')
- finally:
- StopAndroidEmulator()
- elif sys.platform.startswith('linux'):
+ if sys.platform.startswith('linux'):
retcode += GypTestFormat('ninja')
retcode += GypTestFormat('make')
PrepareCmake()
diff --git a/tools/gyp/buildbot/commit_queue/cq_config.json b/tools/gyp/buildbot/commit_queue/cq_config.json
index bbf20e394f3..656c21e54fb 100644
--- a/tools/gyp/buildbot/commit_queue/cq_config.json
+++ b/tools/gyp/buildbot/commit_queue/cq_config.json
@@ -3,7 +3,6 @@
"launched": {
"tryserver.nacl": {
"gyp-presubmit": ["defaulttests"],
- "gyp-android": ["defaulttests"],
"gyp-linux": ["defaulttests"],
"gyp-mac": ["defaulttests"],
"gyp-win32": ["defaulttests"],
diff --git a/tools/gyp/pylib/gyp/MSVSVersion.py b/tools/gyp/pylib/gyp/MSVSVersion.py
index 92e583fd6e2..d9bfa684fa3 100644
--- a/tools/gyp/pylib/gyp/MSVSVersion.py
+++ b/tools/gyp/pylib/gyp/MSVSVersion.py
@@ -84,10 +84,11 @@ class VisualStudioVersion(object):
# vcvars32, which it can only find if VS??COMNTOOLS is set, which it
# isn't always.
if target_arch == 'x86':
- if self.short_name == '2013' and (
+ if self.short_name >= '2013' and self.short_name[-1] != 'e' and (
os.environ.get('PROCESSOR_ARCHITECTURE') == 'AMD64' or
os.environ.get('PROCESSOR_ARCHITEW6432') == 'AMD64'):
- # VS2013 non-Express has a x64-x86 cross that we want to prefer.
+ # VS2013 and later, non-Express have a x64-x86 cross that we want
+ # to prefer.
return [os.path.normpath(
os.path.join(self.path, 'VC/vcvarsall.bat')), 'amd64_x86']
# Otherwise, the standard x86 compiler.
diff --git a/tools/gyp/pylib/gyp/__init__.py b/tools/gyp/pylib/gyp/__init__.py
index ac6d918b849..668f38b60d0 100755
--- a/tools/gyp/pylib/gyp/__init__.py
+++ b/tools/gyp/pylib/gyp/__init__.py
@@ -49,7 +49,7 @@ def FindBuildFiles():
def Load(build_files, format, default_variables={},
includes=[], depth='.', params=None, check=False,
- circular_check=True):
+ circular_check=True, duplicate_basename_check=True):
"""
Loads one or more specified build files.
default_variables and includes will be copied before use.
@@ -126,6 +126,7 @@ def Load(build_files, format, default_variables={},
# Process the input specific to this generator.
result = gyp.input.Load(build_files, default_variables, includes[:],
depth, generator_input_info, check, circular_check,
+ duplicate_basename_check,
params['parallel'], params['root_targets'])
return [generator] + result
@@ -324,6 +325,16 @@ def gyp_main(args):
parser.add_option('--no-circular-check', dest='circular_check',
action='store_false', default=True, regenerate=False,
help="don't check for circular relationships between files")
+ # --no-duplicate-basename-check disables the check for duplicate basenames
+ # in a static_library/shared_library project. Visual C++ 2008 generator
+ # doesn't support this configuration. Libtool on Mac also generates warnings
+ # when duplicate basenames are passed into Make generator on Mac.
+ # TODO(yukawa): Remove this option when these legacy generators are
+ # deprecated.
+ parser.add_option('--no-duplicate-basename-check',
+ dest='duplicate_basename_check', action='store_false',
+ default=True, regenerate=False,
+ help="don't check for duplicate basenames")
parser.add_option('--no-parallel', action='store_true', default=False,
help='Disable multiprocessing')
parser.add_option('-S', '--suffix', dest='suffix', default='',
@@ -499,7 +510,8 @@ def gyp_main(args):
# Start with the default variables from the command line.
[generator, flat_list, targets, data] = Load(
build_files, format, cmdline_default_variables, includes, options.depth,
- params, options.check, options.circular_check)
+ params, options.check, options.circular_check,
+ options.duplicate_basename_check)
# TODO(mark): Pass |data| for now because the generator needs a list of
# build files that came in. In the future, maybe it should just accept
diff --git a/tools/gyp/pylib/gyp/generator/analyzer.py b/tools/gyp/pylib/gyp/generator/analyzer.py
index 15b80ef9737..3a0ec9baff2 100644
--- a/tools/gyp/pylib/gyp/generator/analyzer.py
+++ b/tools/gyp/pylib/gyp/generator/analyzer.py
@@ -183,7 +183,10 @@ class Target(object):
added_to_compile_targets: used when determining if the target was added to the
set of targets that needs to be built.
in_roots: true if this target is a descendant of one of the root nodes.
- is_executable: true if the type of target is executable."""
+ is_executable: true if the type of target is executable.
+ is_static_library: true if the type of target is static_library.
+ is_or_has_linked_ancestor: true if the target does a link (eg executable), or
+ if there is a target in back_deps that does a link."""
def __init__(self, name):
self.deps = set()
self.match_status = MATCH_STATUS_TBD
@@ -196,6 +199,8 @@ class Target(object):
self.added_to_compile_targets = False
self.in_roots = False
self.is_executable = False
+ self.is_static_library = False
+ self.is_or_has_linked_ancestor = False
class Config(object):
@@ -266,8 +271,8 @@ def _GetOrCreateTargetByName(targets, target_name):
def _DoesTargetTypeRequireBuild(target_dict):
"""Returns true if the target type is such that it needs to be built."""
# If a 'none' target has rules or actions we assume it requires a build.
- return target_dict['type'] != 'none' or \
- target_dict.get('actions') or target_dict.get('rules')
+ return bool(target_dict['type'] != 'none' or
+ target_dict.get('actions') or target_dict.get('rules'))
def _GenerateTargets(data, target_list, target_dicts, toplevel_dir, files,
@@ -309,7 +314,11 @@ def _GenerateTargets(data, target_list, target_dicts, toplevel_dir, files,
target.visited = True
target.requires_build = _DoesTargetTypeRequireBuild(
target_dicts[target_name])
- target.is_executable = target_dicts[target_name]['type'] == 'executable'
+ target_type = target_dicts[target_name]['type']
+ target.is_executable = target_type == 'executable'
+ target.is_static_library = target_type == 'static_library'
+ target.is_or_has_linked_ancestor = (target_type == 'executable' or
+ target_type == 'shared_library')
build_file = gyp.common.ParseQualifiedTarget(target_name)[0]
if not build_file in build_file_in_files:
@@ -378,6 +387,7 @@ def _DoesTargetDependOn(target):
for dep in target.deps:
if _DoesTargetDependOn(dep):
target.match_status = MATCH_STATUS_MATCHES_BY_DEPENDENCY
+ print '\t', target.name, 'matches by dep', dep.name
return True
target.match_status = MATCH_STATUS_DOESNT_MATCH
return False
@@ -388,6 +398,7 @@ def _GetTargetsDependingOn(possible_targets):
directly on indirectly) on the matched targets.
possible_targets: targets to search from."""
found = []
+ print 'Targets that matched by dependency:'
for target in possible_targets:
if _DoesTargetDependOn(target):
found.append(target)
@@ -411,14 +422,27 @@ def _AddBuildTargets(target, roots, add_if_no_ancestor, result):
_AddBuildTargets(back_dep_target, roots, False, result)
target.added_to_compile_targets |= back_dep_target.added_to_compile_targets
target.in_roots |= back_dep_target.in_roots
+ target.is_or_has_linked_ancestor |= (
+ back_dep_target.is_or_has_linked_ancestor)
# Always add 'executable' targets. Even though they may be built by other
# targets that depend upon them it makes detection of what is going to be
# built easier.
+ # And always add static_libraries that have no dependencies on them from
+ # linkables. This is necessary as the other dependencies on them may be
+ # static libraries themselves, which are not compile time dependencies.
if target.in_roots and \
(target.is_executable or
(not target.added_to_compile_targets and
- (add_if_no_ancestor or target.requires_build))):
+ (add_if_no_ancestor or target.requires_build)) or
+ (target.is_static_library and add_if_no_ancestor and
+ not target.is_or_has_linked_ancestor)):
+ print '\t\tadding to build targets', target.name, 'executable', \
+ target.is_executable, 'added_to_compile_targets', \
+ target.added_to_compile_targets, 'add_if_no_ancestor', \
+ add_if_no_ancestor, 'requires_build', target.requires_build, \
+ 'is_static_library', target.is_static_library, \
+ 'is_or_has_linked_ancestor', target.is_or_has_linked_ancestor
result.add(target)
target.added_to_compile_targets = True
@@ -429,6 +453,7 @@ def _GetBuildTargets(matching_targets, roots):
roots: set of root targets in the build files to search from."""
result = set()
for target in matching_targets:
+ print '\tfinding build targets for match', target.name
_AddBuildTargets(target, roots, True, result)
return result
@@ -536,6 +561,10 @@ def GenerateOutput(target_list, target_dicts, data, params):
data, target_list, target_dicts, toplevel_dir, frozenset(config.files),
params['build_files'])
+ print 'roots:'
+ for root in roots:
+ print '\t', root.name
+
unqualified_mapping = _GetUnqualifiedToTargetMapping(all_targets,
config.targets)
invalid_targets = None
@@ -544,10 +573,20 @@ def GenerateOutput(target_list, target_dicts, data, params):
if matching_targets:
search_targets = _LookupTargets(config.targets, unqualified_mapping)
+ print 'supplied targets'
+ for target in config.targets:
+ print '\t', target
+ print 'expanded supplied targets'
+ for target in search_targets:
+ print '\t', target.name
matched_search_targets = _GetTargetsDependingOn(search_targets)
+ print 'raw matched search targets:'
+ for target in matched_search_targets:
+ print '\t', target.name
# Reset the visited status for _GetBuildTargets.
for target in all_targets.itervalues():
target.visited = False
+ print 'Finding build targets'
build_targets = _GetBuildTargets(matching_targets, roots)
matched_search_targets = [gyp.common.ParseQualifiedTarget(target.name)[1]
for target in matched_search_targets]
diff --git a/tools/gyp/pylib/gyp/generator/android.py b/tools/gyp/pylib/gyp/generator/android.py
deleted file mode 100644
index ad6eff6d17b..00000000000
--- a/tools/gyp/pylib/gyp/generator/android.py
+++ /dev/null
@@ -1,1094 +0,0 @@
-# Copyright (c) 2012 Google Inc. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# Notes:
-#
-# This generates makefiles suitable for inclusion into the Android build system
-# via an Android.mk file. It is based on make.py, the standard makefile
-# generator.
-#
-# The code below generates a separate .mk file for each target, but
-# all are sourced by the top-level GypAndroid.mk. This means that all
-# variables in .mk-files clobber one another, and furthermore that any
-# variables set potentially clash with other Android build system variables.
-# Try to avoid setting global variables where possible.
-
-import gyp
-import gyp.common
-import gyp.generator.make as make # Reuse global functions from make backend.
-import os
-import re
-import subprocess
-
-generator_default_variables = {
- 'OS': 'android',
- 'EXECUTABLE_PREFIX': '',
- 'EXECUTABLE_SUFFIX': '',
- 'STATIC_LIB_PREFIX': 'lib',
- 'SHARED_LIB_PREFIX': 'lib',
- 'STATIC_LIB_SUFFIX': '.a',
- 'SHARED_LIB_SUFFIX': '.so',
- 'INTERMEDIATE_DIR': '$(gyp_intermediate_dir)',
- 'SHARED_INTERMEDIATE_DIR': '$(gyp_shared_intermediate_dir)',
- 'PRODUCT_DIR': '$(gyp_shared_intermediate_dir)',
- 'SHARED_LIB_DIR': '$(builddir)/lib.$(TOOLSET)',
- 'LIB_DIR': '$(obj).$(TOOLSET)',
- 'RULE_INPUT_ROOT': '%(INPUT_ROOT)s', # This gets expanded by Python.
- 'RULE_INPUT_DIRNAME': '%(INPUT_DIRNAME)s', # This gets expanded by Python.
- 'RULE_INPUT_PATH': '$(RULE_SOURCES)',
- 'RULE_INPUT_EXT': '$(suffix $<)',
- 'RULE_INPUT_NAME': '$(notdir $<)',
- 'CONFIGURATION_NAME': '$(GYP_CONFIGURATION)',
-}
-
-# Make supports multiple toolsets
-generator_supports_multiple_toolsets = True
-
-
-# Generator-specific gyp specs.
-generator_additional_non_configuration_keys = [
- # Boolean to declare that this target does not want its name mangled.
- 'android_unmangled_name',
- # Map of android build system variables to set.
- 'aosp_build_settings',
-]
-generator_additional_path_sections = []
-generator_extra_sources_for_rules = []
-
-
-ALL_MODULES_FOOTER = """\
-# "gyp_all_modules" is a concatenation of the "gyp_all_modules" targets from
-# all the included sub-makefiles. This is just here to clarify.
-gyp_all_modules:
-"""
-
-header = """\
-# This file is generated by gyp; do not edit.
-
-"""
-
-# Map gyp target types to Android module classes.
-MODULE_CLASSES = {
- 'static_library': 'STATIC_LIBRARIES',
- 'shared_library': 'SHARED_LIBRARIES',
- 'executable': 'EXECUTABLES',
-}
-
-
-def IsCPPExtension(ext):
- return make.COMPILABLE_EXTENSIONS.get(ext) == 'cxx'
-
-
-def Sourceify(path):
- """Convert a path to its source directory form. The Android backend does not
- support options.generator_output, so this function is a noop."""
- return path
-
-
-# Map from qualified target to path to output.
-# For Android, the target of these maps is a tuple ('static', 'modulename'),
-# ('dynamic', 'modulename'), or ('path', 'some/path') instead of a string,
-# since we link by module.
-target_outputs = {}
-# Map from qualified target to any linkable output. A subset
-# of target_outputs. E.g. when mybinary depends on liba, we want to
-# include liba in the linker line; when otherbinary depends on
-# mybinary, we just want to build mybinary first.
-target_link_deps = {}
-
-
-class AndroidMkWriter(object):
- """AndroidMkWriter packages up the writing of one target-specific Android.mk.
-
- Its only real entry point is Write(), and is mostly used for namespacing.
- """
-
- def __init__(self, android_top_dir):
- self.android_top_dir = android_top_dir
-
- def Write(self, qualified_target, relative_target, base_path, output_filename,
- spec, configs, part_of_all, write_alias_target, sdk_version):
- """The main entry point: writes a .mk file for a single target.
-
- Arguments:
- qualified_target: target we're generating
- relative_target: qualified target name relative to the root
- base_path: path relative to source root we're building in, used to resolve
- target-relative paths
- output_filename: output .mk file name to write
- spec, configs: gyp info
- part_of_all: flag indicating this target is part of 'all'
- write_alias_target: flag indicating whether to create short aliases for
- this target
- sdk_version: what to emit for LOCAL_SDK_VERSION in output
- """
- gyp.common.EnsureDirExists(output_filename)
-
- self.fp = open(output_filename, 'w')
-
- self.fp.write(header)
-
- self.qualified_target = qualified_target
- self.relative_target = relative_target
- self.path = base_path
- self.target = spec['target_name']
- self.type = spec['type']
- self.toolset = spec['toolset']
-
- deps, link_deps = self.ComputeDeps(spec)
-
- # Some of the generation below can add extra output, sources, or
- # link dependencies. All of the out params of the functions that
- # follow use names like extra_foo.
- extra_outputs = []
- extra_sources = []
-
- self.android_class = MODULE_CLASSES.get(self.type, 'GYP')
- self.android_module = self.ComputeAndroidModule(spec)
- (self.android_stem, self.android_suffix) = self.ComputeOutputParts(spec)
- self.output = self.output_binary = self.ComputeOutput(spec)
-
- # Standard header.
- self.WriteLn('include $(CLEAR_VARS)\n')
-
- # Module class and name.
- self.WriteLn('LOCAL_MODULE_CLASS := ' + self.android_class)
- self.WriteLn('LOCAL_MODULE := ' + self.android_module)
- # Only emit LOCAL_MODULE_STEM if it's different to LOCAL_MODULE.
- # The library module classes fail if the stem is set. ComputeOutputParts
- # makes sure that stem == modulename in these cases.
- if self.android_stem != self.android_module:
- self.WriteLn('LOCAL_MODULE_STEM := ' + self.android_stem)
- self.WriteLn('LOCAL_MODULE_SUFFIX := ' + self.android_suffix)
- if self.toolset == 'host':
- self.WriteLn('LOCAL_IS_HOST_MODULE := true')
- self.WriteLn('LOCAL_MULTILIB := $(GYP_HOST_MULTILIB)')
- else:
- self.WriteLn('LOCAL_MODULE_TARGET_ARCH := '
- '$(TARGET_$(GYP_VAR_PREFIX)ARCH)')
- self.WriteLn('LOCAL_SDK_VERSION := %s' % sdk_version)
-
- # Grab output directories; needed for Actions and Rules.
- if self.toolset == 'host':
- self.WriteLn('gyp_intermediate_dir := '
- '$(call local-intermediates-dir,,$(GYP_HOST_VAR_PREFIX))')
- else:
- self.WriteLn('gyp_intermediate_dir := '
- '$(call local-intermediates-dir,,$(GYP_VAR_PREFIX))')
- self.WriteLn('gyp_shared_intermediate_dir := '
- '$(call intermediates-dir-for,GYP,shared,,,$(GYP_VAR_PREFIX))')
- self.WriteLn()
-
- # List files this target depends on so that actions/rules/copies/sources
- # can depend on the list.
- # TODO: doesn't pull in things through transitive link deps; needed?
- target_dependencies = [x[1] for x in deps if x[0] == 'path']
- self.WriteLn('# Make sure our deps are built first.')
- self.WriteList(target_dependencies, 'GYP_TARGET_DEPENDENCIES',
- local_pathify=True)
-
- # Actions must come first, since they can generate more OBJs for use below.
- if 'actions' in spec:
- self.WriteActions(spec['actions'], extra_sources, extra_outputs)
-
- # Rules must be early like actions.
- if 'rules' in spec:
- self.WriteRules(spec['rules'], extra_sources, extra_outputs)
-
- if 'copies' in spec:
- self.WriteCopies(spec['copies'], extra_outputs)
-
- # GYP generated outputs.
- self.WriteList(extra_outputs, 'GYP_GENERATED_OUTPUTS', local_pathify=True)
-
- # Set LOCAL_ADDITIONAL_DEPENDENCIES so that Android's build rules depend
- # on both our dependency targets and our generated files.
- self.WriteLn('# Make sure our deps and generated files are built first.')
- self.WriteLn('LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) '
- '$(GYP_GENERATED_OUTPUTS)')
- self.WriteLn()
-
- # Sources.
- if spec.get('sources', []) or extra_sources:
- self.WriteSources(spec, configs, extra_sources)
-
- self.WriteTarget(spec, configs, deps, link_deps, part_of_all,
- write_alias_target)
-
- # Update global list of target outputs, used in dependency tracking.
- target_outputs[qualified_target] = ('path', self.output_binary)
-
- # Update global list of link dependencies.
- if self.type == 'static_library':
- target_link_deps[qualified_target] = ('static', self.android_module)
- elif self.type == 'shared_library':
- target_link_deps[qualified_target] = ('shared', self.android_module)
-
- self.fp.close()
- return self.android_module
-
-
- def WriteActions(self, actions, extra_sources, extra_outputs):
- """Write Makefile code for any 'actions' from the gyp input.
-
- extra_sources: a list that will be filled in with newly generated source
- files, if any
- extra_outputs: a list that will be filled in with any outputs of these
- actions (used to make other pieces dependent on these
- actions)
- """
- for action in actions:
- name = make.StringToMakefileVariable('%s_%s' % (self.relative_target,
- action['action_name']))
- self.WriteLn('### Rules for action "%s":' % action['action_name'])
- inputs = action['inputs']
- outputs = action['outputs']
-
- # Build up a list of outputs.
- # Collect the output dirs we'll need.
- dirs = set()
- for out in outputs:
- if not out.startswith('$'):
- print ('WARNING: Action for target "%s" writes output to local path '
- '"%s".' % (self.target, out))
- dir = os.path.split(out)[0]
- if dir:
- dirs.add(dir)
- if int(action.get('process_outputs_as_sources', False)):
- extra_sources += outputs
-
- # Prepare the actual command.
- command = gyp.common.EncodePOSIXShellList(action['action'])
- if 'message' in action:
- quiet_cmd = 'Gyp action: %s ($@)' % action['message']
- else:
- quiet_cmd = 'Gyp action: %s ($@)' % name
- if len(dirs) > 0:
- command = 'mkdir -p %s' % ' '.join(dirs) + '; ' + command
-
- cd_action = 'cd $(gyp_local_path)/%s; ' % self.path
- command = cd_action + command
-
- # The makefile rules are all relative to the top dir, but the gyp actions
- # are defined relative to their containing dir. This replaces the gyp_*
- # variables for the action rule with an absolute version so that the
- # output goes in the right place.
- # Only write the gyp_* rules for the "primary" output (:1);
- # it's superfluous for the "extra outputs", and this avoids accidentally
- # writing duplicate dummy rules for those outputs.
- main_output = make.QuoteSpaces(self.LocalPathify(outputs[0]))
- self.WriteLn('%s: gyp_local_path := $(LOCAL_PATH)' % main_output)
- self.WriteLn('%s: gyp_var_prefix := $(GYP_VAR_PREFIX)' % main_output)
- self.WriteLn('%s: gyp_intermediate_dir := '
- '$(abspath $(gyp_intermediate_dir))' % main_output)
- self.WriteLn('%s: gyp_shared_intermediate_dir := '
- '$(abspath $(gyp_shared_intermediate_dir))' % main_output)
-
- # Android's envsetup.sh adds a number of directories to the path including
- # the built host binary directory. This causes actions/rules invoked by
- # gyp to sometimes use these instead of system versions, e.g. bison.
- # The built host binaries may not be suitable, and can cause errors.
- # So, we remove them from the PATH using the ANDROID_BUILD_PATHS variable
- # set by envsetup.
- self.WriteLn('%s: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))'
- % main_output)
-
- # Don't allow spaces in input/output filenames, but make an exception for
- # filenames which start with '$(' since it's okay for there to be spaces
- # inside of make function/macro invocations.
- for input in inputs:
- if not input.startswith('$(') and ' ' in input:
- raise gyp.common.GypError(
- 'Action input filename "%s" in target %s contains a space' %
- (input, self.target))
- for output in outputs:
- if not output.startswith('$(') and ' ' in output:
- raise gyp.common.GypError(
- 'Action output filename "%s" in target %s contains a space' %
- (output, self.target))
-
- self.WriteLn('%s: %s $(GYP_TARGET_DEPENDENCIES)' %
- (main_output, ' '.join(map(self.LocalPathify, inputs))))
- self.WriteLn('\t@echo "%s"' % quiet_cmd)
- self.WriteLn('\t$(hide)%s\n' % command)
- for output in outputs[1:]:
- # Make each output depend on the main output, with an empty command
- # to force make to notice that the mtime has changed.
- self.WriteLn('%s: %s ;' % (self.LocalPathify(output), main_output))
-
- extra_outputs += outputs
- self.WriteLn()
-
- self.WriteLn()
-
-
- def WriteRules(self, rules, extra_sources, extra_outputs):
- """Write Makefile code for any 'rules' from the gyp input.
-
- extra_sources: a list that will be filled in with newly generated source
- files, if any
- extra_outputs: a list that will be filled in with any outputs of these
- rules (used to make other pieces dependent on these rules)
- """
- if len(rules) == 0:
- return
-
- for rule in rules:
- if len(rule.get('rule_sources', [])) == 0:
- continue
- name = make.StringToMakefileVariable('%s_%s' % (self.relative_target,
- rule['rule_name']))
- self.WriteLn('\n### Generated for rule "%s":' % name)
- self.WriteLn('# "%s":' % rule)
-
- inputs = rule.get('inputs')
- for rule_source in rule.get('rule_sources', []):
- (rule_source_dirname, rule_source_basename) = os.path.split(rule_source)
- (rule_source_root, rule_source_ext) = \
- os.path.splitext(rule_source_basename)
-
- outputs = [self.ExpandInputRoot(out, rule_source_root,
- rule_source_dirname)
- for out in rule['outputs']]
-
- dirs = set()
- for out in outputs:
- if not out.startswith('$'):
- print ('WARNING: Rule for target %s writes output to local path %s'
- % (self.target, out))
- dir = os.path.dirname(out)
- if dir:
- dirs.add(dir)
- extra_outputs += outputs
- if int(rule.get('process_outputs_as_sources', False)):
- extra_sources.extend(outputs)
-
- components = []
- for component in rule['action']:
- component = self.ExpandInputRoot(component, rule_source_root,
- rule_source_dirname)
- if '$(RULE_SOURCES)' in component:
- component = component.replace('$(RULE_SOURCES)',
- rule_source)
- components.append(component)
-
- command = gyp.common.EncodePOSIXShellList(components)
- cd_action = 'cd $(gyp_local_path)/%s; ' % self.path
- command = cd_action + command
- if dirs:
- command = 'mkdir -p %s' % ' '.join(dirs) + '; ' + command
-
- # We set up a rule to build the first output, and then set up
- # a rule for each additional output to depend on the first.
- outputs = map(self.LocalPathify, outputs)
- main_output = outputs[0]
- self.WriteLn('%s: gyp_local_path := $(LOCAL_PATH)' % main_output)
- self.WriteLn('%s: gyp_var_prefix := $(GYP_VAR_PREFIX)' % main_output)
- self.WriteLn('%s: gyp_intermediate_dir := '
- '$(abspath $(gyp_intermediate_dir))' % main_output)
- self.WriteLn('%s: gyp_shared_intermediate_dir := '
- '$(abspath $(gyp_shared_intermediate_dir))' % main_output)
-
- # See explanation in WriteActions.
- self.WriteLn('%s: export PATH := '
- '$(subst $(ANDROID_BUILD_PATHS),,$(PATH))' % main_output)
-
- main_output_deps = self.LocalPathify(rule_source)
- if inputs:
- main_output_deps += ' '
- main_output_deps += ' '.join([self.LocalPathify(f) for f in inputs])
-
- self.WriteLn('%s: %s $(GYP_TARGET_DEPENDENCIES)' %
- (main_output, main_output_deps))
- self.WriteLn('\t%s\n' % command)
- for output in outputs[1:]:
- # Make each output depend on the main output, with an empty command
- # to force make to notice that the mtime has changed.
- self.WriteLn('%s: %s ;' % (output, main_output))
- self.WriteLn()
-
- self.WriteLn()
-
-
- def WriteCopies(self, copies, extra_outputs):
- """Write Makefile code for any 'copies' from the gyp input.
-
- extra_outputs: a list that will be filled in with any outputs of this action
- (used to make other pieces dependent on this action)
- """
- self.WriteLn('### Generated for copy rule.')
-
- variable = make.StringToMakefileVariable(self.relative_target + '_copies')
- outputs = []
- for copy in copies:
- for path in copy['files']:
- # The Android build system does not allow generation of files into the
- # source tree. The destination should start with a variable, which will
- # typically be $(gyp_intermediate_dir) or
- # $(gyp_shared_intermediate_dir). Note that we can't use an assertion
- # because some of the gyp tests depend on this.
- if not copy['destination'].startswith('$'):
- print ('WARNING: Copy rule for target %s writes output to '
- 'local path %s' % (self.target, copy['destination']))
-
- # LocalPathify() calls normpath, stripping trailing slashes.
- path = Sourceify(self.LocalPathify(path))
- filename = os.path.split(path)[1]
- output = Sourceify(self.LocalPathify(os.path.join(copy['destination'],
- filename)))
-
- self.WriteLn('%s: %s $(GYP_TARGET_DEPENDENCIES) | $(ACP)' %
- (output, path))
- self.WriteLn('\t@echo Copying: $@')
- self.WriteLn('\t$(hide) mkdir -p $(dir $@)')
- self.WriteLn('\t$(hide) $(ACP) -rpf $< $@')
- self.WriteLn()
- outputs.append(output)
- self.WriteLn('%s = %s' % (variable,
- ' '.join(map(make.QuoteSpaces, outputs))))
- extra_outputs.append('$(%s)' % variable)
- self.WriteLn()
-
-
- def WriteSourceFlags(self, spec, configs):
- """Write out the flags and include paths used to compile source files for
- the current target.
-
- Args:
- spec, configs: input from gyp.
- """
- for configname, config in sorted(configs.iteritems()):
- extracted_includes = []
-
- self.WriteLn('\n# Flags passed to both C and C++ files.')
- cflags, includes_from_cflags = self.ExtractIncludesFromCFlags(
- config.get('cflags', []) + config.get('cflags_c', []))
- extracted_includes.extend(includes_from_cflags)
- self.WriteList(cflags, 'MY_CFLAGS_%s' % configname)
-
- self.WriteList(config.get('defines'), 'MY_DEFS_%s' % configname,
- prefix='-D', quoter=make.EscapeCppDefine)
-
- self.WriteLn('\n# Include paths placed before CFLAGS/CPPFLAGS')
- includes = list(config.get('include_dirs', []))
- includes.extend(extracted_includes)
- includes = map(Sourceify, map(self.LocalPathify, includes))
- includes = self.NormalizeIncludePaths(includes)
- self.WriteList(includes, 'LOCAL_C_INCLUDES_%s' % configname)
-
- self.WriteLn('\n# Flags passed to only C++ (and not C) files.')
- self.WriteList(config.get('cflags_cc'), 'LOCAL_CPPFLAGS_%s' % configname)
-
- self.WriteLn('\nLOCAL_CFLAGS := $(MY_CFLAGS_$(GYP_CONFIGURATION)) '
- '$(MY_DEFS_$(GYP_CONFIGURATION))')
- # Undefine ANDROID for host modules
- # TODO: the source code should not use macro ANDROID to tell if it's host
- # or target module.
- if self.toolset == 'host':
- self.WriteLn('# Undefine ANDROID for host modules')
- self.WriteLn('LOCAL_CFLAGS += -UANDROID')
- self.WriteLn('LOCAL_C_INCLUDES := $(GYP_COPIED_SOURCE_ORIGIN_DIRS) '
- '$(LOCAL_C_INCLUDES_$(GYP_CONFIGURATION))')
- self.WriteLn('LOCAL_CPPFLAGS := $(LOCAL_CPPFLAGS_$(GYP_CONFIGURATION))')
- # Android uses separate flags for assembly file invocations, but gyp expects
- # the same CFLAGS to be applied:
- self.WriteLn('LOCAL_ASFLAGS := $(LOCAL_CFLAGS)')
-
-
- def WriteSources(self, spec, configs, extra_sources):
- """Write Makefile code for any 'sources' from the gyp input.
- These are source files necessary to build the current target.
- We need to handle shared_intermediate directory source files as
- a special case by copying them to the intermediate directory and
- treating them as a genereated sources. Otherwise the Android build
- rules won't pick them up.
-
- Args:
- spec, configs: input from gyp.
- extra_sources: Sources generated from Actions or Rules.
- """
- sources = filter(make.Compilable, spec.get('sources', []))
- generated_not_sources = [x for x in extra_sources if not make.Compilable(x)]
- extra_sources = filter(make.Compilable, extra_sources)
-
- # Determine and output the C++ extension used by these sources.
- # We simply find the first C++ file and use that extension.
- all_sources = sources + extra_sources
- local_cpp_extension = '.cpp'
- for source in all_sources:
- (root, ext) = os.path.splitext(source)
- if IsCPPExtension(ext):
- local_cpp_extension = ext
- break
- if local_cpp_extension != '.cpp':
- self.WriteLn('LOCAL_CPP_EXTENSION := %s' % local_cpp_extension)
-
- # We need to move any non-generated sources that are coming from the
- # shared intermediate directory out of LOCAL_SRC_FILES and put them
- # into LOCAL_GENERATED_SOURCES. We also need to move over any C++ files
- # that don't match our local_cpp_extension, since Android will only
- # generate Makefile rules for a single LOCAL_CPP_EXTENSION.
- local_files = []
- for source in sources:
- (root, ext) = os.path.splitext(source)
- if '$(gyp_shared_intermediate_dir)' in source:
- extra_sources.append(source)
- elif '$(gyp_intermediate_dir)' in source:
- extra_sources.append(source)
- elif IsCPPExtension(ext) and ext != local_cpp_extension:
- extra_sources.append(source)
- else:
- local_files.append(os.path.normpath(os.path.join(self.path, source)))
-
- # For any generated source, if it is coming from the shared intermediate
- # directory then we add a Make rule to copy them to the local intermediate
- # directory first. This is because the Android LOCAL_GENERATED_SOURCES
- # must be in the local module intermediate directory for the compile rules
- # to work properly. If the file has the wrong C++ extension, then we add
- # a rule to copy that to intermediates and use the new version.
- final_generated_sources = []
- # If a source file gets copied, we still need to add the orginal source
- # directory as header search path, for GCC searches headers in the
- # directory that contains the source file by default.
- origin_src_dirs = []
- for source in extra_sources:
- local_file = source
- if not '$(gyp_intermediate_dir)/' in local_file:
- basename = os.path.basename(local_file)
- local_file = '$(gyp_intermediate_dir)/' + basename
- (root, ext) = os.path.splitext(local_file)
- if IsCPPExtension(ext) and ext != local_cpp_extension:
- local_file = root + local_cpp_extension
- if local_file != source:
- self.WriteLn('%s: %s' % (local_file, self.LocalPathify(source)))
- self.WriteLn('\tmkdir -p $(@D); cp $< $@')
- origin_src_dirs.append(os.path.dirname(source))
- final_generated_sources.append(local_file)
-
- # We add back in all of the non-compilable stuff to make sure that the
- # make rules have dependencies on them.
- final_generated_sources.extend(generated_not_sources)
- self.WriteList(final_generated_sources, 'LOCAL_GENERATED_SOURCES')
-
- origin_src_dirs = gyp.common.uniquer(origin_src_dirs)
- origin_src_dirs = map(Sourceify, map(self.LocalPathify, origin_src_dirs))
- self.WriteList(origin_src_dirs, 'GYP_COPIED_SOURCE_ORIGIN_DIRS')
-
- self.WriteList(local_files, 'LOCAL_SRC_FILES')
-
- # Write out the flags used to compile the source; this must be done last
- # so that GYP_COPIED_SOURCE_ORIGIN_DIRS can be used as an include path.
- self.WriteSourceFlags(spec, configs)
-
-
- def ComputeAndroidModule(self, spec):
- """Return the Android module name used for a gyp spec.
-
- We use the complete qualified target name to avoid collisions between
- duplicate targets in different directories. We also add a suffix to
- distinguish gyp-generated module names.
- """
-
- if int(spec.get('android_unmangled_name', 0)):
- assert self.type != 'shared_library' or self.target.startswith('lib')
- return self.target
-
- if self.type == 'shared_library':
- # For reasons of convention, the Android build system requires that all
- # shared library modules are named 'libfoo' when generating -l flags.
- prefix = 'lib_'
- else:
- prefix = ''
-
- if spec['toolset'] == 'host':
- suffix = '_$(TARGET_$(GYP_VAR_PREFIX)ARCH)_host_gyp'
- else:
- suffix = '_gyp'
-
- if self.path:
- middle = make.StringToMakefileVariable('%s_%s' % (self.path, self.target))
- else:
- middle = make.StringToMakefileVariable(self.target)
-
- return ''.join([prefix, middle, suffix])
-
-
- def ComputeOutputParts(self, spec):
- """Return the 'output basename' of a gyp spec, split into filename + ext.
-
- Android libraries must be named the same thing as their module name,
- otherwise the linker can't find them, so product_name and so on must be
- ignored if we are building a library, and the "lib" prepending is
- not done for Android.
- """
- assert self.type != 'loadable_module' # TODO: not supported?
-
- target = spec['target_name']
- target_prefix = ''
- target_ext = ''
- if self.type == 'static_library':
- target = self.ComputeAndroidModule(spec)
- target_ext = '.a'
- elif self.type == 'shared_library':
- target = self.ComputeAndroidModule(spec)
- target_ext = '.so'
- elif self.type == 'none':
- target_ext = '.stamp'
- elif self.type != 'executable':
- print ("ERROR: What output file should be generated?",
- "type", self.type, "target", target)
-
- if self.type != 'static_library' and self.type != 'shared_library':
- target_prefix = spec.get('product_prefix', target_prefix)
- target = spec.get('product_name', target)
- product_ext = spec.get('product_extension')
- if product_ext:
- target_ext = '.' + product_ext
-
- target_stem = target_prefix + target
- return (target_stem, target_ext)
-
-
- def ComputeOutputBasename(self, spec):
- """Return the 'output basename' of a gyp spec.
-
- E.g., the loadable module 'foobar' in directory 'baz' will produce
- 'libfoobar.so'
- """
- return ''.join(self.ComputeOutputParts(spec))
-
-
- def ComputeOutput(self, spec):
- """Return the 'output' (full output path) of a gyp spec.
-
- E.g., the loadable module 'foobar' in directory 'baz' will produce
- '$(obj)/baz/libfoobar.so'
- """
- if self.type == 'executable':
- # We install host executables into shared_intermediate_dir so they can be
- # run by gyp rules that refer to PRODUCT_DIR.
- path = '$(gyp_shared_intermediate_dir)'
- elif self.type == 'shared_library':
- if self.toolset == 'host':
- path = '$($(GYP_HOST_VAR_PREFIX)HOST_OUT_INTERMEDIATE_LIBRARIES)'
- else:
- path = '$($(GYP_VAR_PREFIX)TARGET_OUT_INTERMEDIATE_LIBRARIES)'
- else:
- # Other targets just get built into their intermediate dir.
- if self.toolset == 'host':
- path = ('$(call intermediates-dir-for,%s,%s,true,,'
- '$(GYP_HOST_VAR_PREFIX))' % (self.android_class,
- self.android_module))
- else:
- path = ('$(call intermediates-dir-for,%s,%s,,,$(GYP_VAR_PREFIX))'
- % (self.android_class, self.android_module))
-
- assert spec.get('product_dir') is None # TODO: not supported?
- return os.path.join(path, self.ComputeOutputBasename(spec))
-
- def NormalizeIncludePaths(self, include_paths):
- """ Normalize include_paths.
- Convert absolute paths to relative to the Android top directory.
-
- Args:
- include_paths: A list of unprocessed include paths.
- Returns:
- A list of normalized include paths.
- """
- normalized = []
- for path in include_paths:
- if path[0] == '/':
- path = gyp.common.RelativePath(path, self.android_top_dir)
- normalized.append(path)
- return normalized
-
- def ExtractIncludesFromCFlags(self, cflags):
- """Extract includes "-I..." out from cflags
-
- Args:
- cflags: A list of compiler flags, which may be mixed with "-I.."
- Returns:
- A tuple of lists: (clean_clfags, include_paths). "-I.." is trimmed.
- """
- clean_cflags = []
- include_paths = []
- for flag in cflags:
- if flag.startswith('-I'):
- include_paths.append(flag[2:])
- else:
- clean_cflags.append(flag)
-
- return (clean_cflags, include_paths)
-
- def FilterLibraries(self, libraries):
- """Filter the 'libraries' key to separate things that shouldn't be ldflags.
-
- Library entries that look like filenames should be converted to android
- module names instead of being passed to the linker as flags.
-
- Args:
- libraries: the value of spec.get('libraries')
- Returns:
- A tuple (static_lib_modules, dynamic_lib_modules, ldflags)
- """
- static_lib_modules = []
- dynamic_lib_modules = []
- ldflags = []
- for libs in libraries:
- # Libs can have multiple words.
- for lib in libs.split():
- # Filter the system libraries, which are added by default by the Android
- # build system.
- if (lib == '-lc' or lib == '-lstdc++' or lib == '-lm' or
- lib.endswith('libgcc.a')):
- continue
- match = re.search(r'([^/]+)\.a$', lib)
- if match:
- static_lib_modules.append(match.group(1))
- continue
- match = re.search(r'([^/]+)\.so$', lib)
- if match:
- dynamic_lib_modules.append(match.group(1))
- continue
- if lib.startswith('-l'):
- ldflags.append(lib)
- return (static_lib_modules, dynamic_lib_modules, ldflags)
-
-
- def ComputeDeps(self, spec):
- """Compute the dependencies of a gyp spec.
-
- Returns a tuple (deps, link_deps), where each is a list of
- filenames that will need to be put in front of make for either
- building (deps) or linking (link_deps).
- """
- deps = []
- link_deps = []
- if 'dependencies' in spec:
- deps.extend([target_outputs[dep] for dep in spec['dependencies']
- if target_outputs[dep]])
- for dep in spec['dependencies']:
- if dep in target_link_deps:
- link_deps.append(target_link_deps[dep])
- deps.extend(link_deps)
- return (gyp.common.uniquer(deps), gyp.common.uniquer(link_deps))
-
-
- def WriteTargetFlags(self, spec, configs, link_deps):
- """Write Makefile code to specify the link flags and library dependencies.
-
- spec, configs: input from gyp.
- link_deps: link dependency list; see ComputeDeps()
- """
- # Libraries (i.e. -lfoo)
- # These must be included even for static libraries as some of them provide
- # implicit include paths through the build system.
- libraries = gyp.common.uniquer(spec.get('libraries', []))
- static_libs, dynamic_libs, ldflags_libs = self.FilterLibraries(libraries)
-
- if self.type != 'static_library':
- for configname, config in sorted(configs.iteritems()):
- ldflags = list(config.get('ldflags', []))
- self.WriteLn('')
- self.WriteList(ldflags, 'LOCAL_LDFLAGS_%s' % configname)
- self.WriteList(ldflags_libs, 'LOCAL_GYP_LIBS')
- self.WriteLn('LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION)) '
- '$(LOCAL_GYP_LIBS)')
-
- # Link dependencies (i.e. other gyp targets this target depends on)
- # These need not be included for static libraries as within the gyp build
- # we do not use the implicit include path mechanism.
- if self.type != 'static_library':
- static_link_deps = [x[1] for x in link_deps if x[0] == 'static']
- shared_link_deps = [x[1] for x in link_deps if x[0] == 'shared']
- else:
- static_link_deps = []
- shared_link_deps = []
-
- # Only write the lists if they are non-empty.
- if static_libs or static_link_deps:
- self.WriteLn('')
- self.WriteList(static_libs + static_link_deps,
- 'LOCAL_STATIC_LIBRARIES')
- self.WriteLn('# Enable grouping to fix circular references')
- self.WriteLn('LOCAL_GROUP_STATIC_LIBRARIES := true')
- if dynamic_libs or shared_link_deps:
- self.WriteLn('')
- self.WriteList(dynamic_libs + shared_link_deps,
- 'LOCAL_SHARED_LIBRARIES')
-
-
- def WriteTarget(self, spec, configs, deps, link_deps, part_of_all,
- write_alias_target):
- """Write Makefile code to produce the final target of the gyp spec.
-
- spec, configs: input from gyp.
- deps, link_deps: dependency lists; see ComputeDeps()
- part_of_all: flag indicating this target is part of 'all'
- write_alias_target: flag indicating whether to create short aliases for this
- target
- """
- self.WriteLn('### Rules for final target.')
-
- if self.type != 'none':
- self.WriteTargetFlags(spec, configs, link_deps)
-
- settings = spec.get('aosp_build_settings', {})
- if settings:
- self.WriteLn('### Set directly by aosp_build_settings.')
- for k, v in settings.iteritems():
- if isinstance(v, list):
- self.WriteList(v, k)
- else:
- self.WriteLn('%s := %s' % (k, make.QuoteIfNecessary(v)))
- self.WriteLn('')
-
- # Add to the set of targets which represent the gyp 'all' target. We use the
- # name 'gyp_all_modules' as the Android build system doesn't allow the use
- # of the Make target 'all' and because 'all_modules' is the equivalent of
- # the Make target 'all' on Android.
- if part_of_all and write_alias_target:
- self.WriteLn('# Add target alias to "gyp_all_modules" target.')
- self.WriteLn('.PHONY: gyp_all_modules')
- self.WriteLn('gyp_all_modules: %s' % self.android_module)
- self.WriteLn('')
-
- # Add an alias from the gyp target name to the Android module name. This
- # simplifies manual builds of the target, and is required by the test
- # framework.
- if self.target != self.android_module and write_alias_target:
- self.WriteLn('# Alias gyp target name.')
- self.WriteLn('.PHONY: %s' % self.target)
- self.WriteLn('%s: %s' % (self.target, self.android_module))
- self.WriteLn('')
-
- # Add the command to trigger build of the target type depending
- # on the toolset. Ex: BUILD_STATIC_LIBRARY vs. BUILD_HOST_STATIC_LIBRARY
- # NOTE: This has to come last!
- modifier = ''
- if self.toolset == 'host':
- modifier = 'HOST_'
- if self.type == 'static_library':
- self.WriteLn('include $(BUILD_%sSTATIC_LIBRARY)' % modifier)
- elif self.type == 'shared_library':
- self.WriteLn('LOCAL_PRELINK_MODULE := false')
- self.WriteLn('include $(BUILD_%sSHARED_LIBRARY)' % modifier)
- elif self.type == 'executable':
- # Executables are for build and test purposes only, so they're installed
- # to a directory that doesn't get included in the system image.
- self.WriteLn('LOCAL_MODULE_PATH := $(gyp_shared_intermediate_dir)')
- self.WriteLn('include $(BUILD_%sEXECUTABLE)' % modifier)
- else:
- self.WriteLn('LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp')
- self.WriteLn('LOCAL_UNINSTALLABLE_MODULE := true')
- if self.toolset == 'target':
- self.WriteLn('LOCAL_2ND_ARCH_VAR_PREFIX := $(GYP_VAR_PREFIX)')
- else:
- self.WriteLn('LOCAL_2ND_ARCH_VAR_PREFIX := $(GYP_HOST_VAR_PREFIX)')
- self.WriteLn()
- self.WriteLn('include $(BUILD_SYSTEM)/base_rules.mk')
- self.WriteLn()
- self.WriteLn('$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)')
- self.WriteLn('\t$(hide) echo "Gyp timestamp: $@"')
- self.WriteLn('\t$(hide) mkdir -p $(dir $@)')
- self.WriteLn('\t$(hide) touch $@')
- self.WriteLn()
- self.WriteLn('LOCAL_2ND_ARCH_VAR_PREFIX :=')
-
-
- def WriteList(self, value_list, variable=None, prefix='',
- quoter=make.QuoteIfNecessary, local_pathify=False):
- """Write a variable definition that is a list of values.
-
- E.g. WriteList(['a','b'], 'foo', prefix='blah') writes out
- foo = blaha blahb
- but in a pretty-printed style.
- """
- values = ''
- if value_list:
- value_list = [quoter(prefix + l) for l in value_list]
- if local_pathify:
- value_list = [self.LocalPathify(l) for l in value_list]
- values = ' \\\n\t' + ' \\\n\t'.join(value_list)
- self.fp.write('%s :=%s\n\n' % (variable, values))
-
-
- def WriteLn(self, text=''):
- self.fp.write(text + '\n')
-
-
- def LocalPathify(self, path):
- """Convert a subdirectory-relative path into a normalized path which starts
- with the make variable $(LOCAL_PATH) (i.e. the top of the project tree).
- Absolute paths, or paths that contain variables, are just normalized."""
- if '$(' in path or os.path.isabs(path):
- # path is not a file in the project tree in this case, but calling
- # normpath is still important for trimming trailing slashes.
- return os.path.normpath(path)
- local_path = os.path.join('$(LOCAL_PATH)', self.path, path)
- local_path = os.path.normpath(local_path)
- # Check that normalizing the path didn't ../ itself out of $(LOCAL_PATH)
- # - i.e. that the resulting path is still inside the project tree. The
- # path may legitimately have ended up containing just $(LOCAL_PATH), though,
- # so we don't look for a slash.
- assert local_path.startswith('$(LOCAL_PATH)'), (
- 'Path %s attempts to escape from gyp path %s !)' % (path, self.path))
- return local_path
-
-
- def ExpandInputRoot(self, template, expansion, dirname):
- if '%(INPUT_ROOT)s' not in template and '%(INPUT_DIRNAME)s' not in template:
- return template
- path = template % {
- 'INPUT_ROOT': expansion,
- 'INPUT_DIRNAME': dirname,
- }
- return os.path.normpath(path)
-
-
-def PerformBuild(data, configurations, params):
- # The android backend only supports the default configuration.
- options = params['options']
- makefile = os.path.abspath(os.path.join(options.toplevel_dir,
- 'GypAndroid.mk'))
- env = dict(os.environ)
- env['ONE_SHOT_MAKEFILE'] = makefile
- arguments = ['make', '-C', os.environ['ANDROID_BUILD_TOP'], 'gyp_all_modules']
- print 'Building: %s' % arguments
- subprocess.check_call(arguments, env=env)
-
-
-def GenerateOutput(target_list, target_dicts, data, params):
- options = params['options']
- generator_flags = params.get('generator_flags', {})
- builddir_name = generator_flags.get('output_dir', 'out')
- limit_to_target_all = generator_flags.get('limit_to_target_all', False)
- write_alias_targets = generator_flags.get('write_alias_targets', True)
- sdk_version = generator_flags.get('aosp_sdk_version', 19)
- android_top_dir = os.environ.get('ANDROID_BUILD_TOP')
- assert android_top_dir, '$ANDROID_BUILD_TOP not set; you need to run lunch.'
-
- def CalculateMakefilePath(build_file, base_name):
- """Determine where to write a Makefile for a given gyp file."""
- # Paths in gyp files are relative to the .gyp file, but we want
- # paths relative to the source root for the master makefile. Grab
- # the path of the .gyp file as the base to relativize against.
- # E.g. "foo/bar" when we're constructing targets for "foo/bar/baz.gyp".
- base_path = gyp.common.RelativePath(os.path.dirname(build_file),
- options.depth)
- # We write the file in the base_path directory.
- output_file = os.path.join(options.depth, base_path, base_name)
- assert not options.generator_output, (
- 'The Android backend does not support options.generator_output.')
- base_path = gyp.common.RelativePath(os.path.dirname(build_file),
- options.toplevel_dir)
- return base_path, output_file
-
- # TODO: search for the first non-'Default' target. This can go
- # away when we add verification that all targets have the
- # necessary configurations.
- default_configuration = None
- toolsets = set([target_dicts[target]['toolset'] for target in target_list])
- for target in target_list:
- spec = target_dicts[target]
- if spec['default_configuration'] != 'Default':
- default_configuration = spec['default_configuration']
- break
- if not default_configuration:
- default_configuration = 'Default'
-
- srcdir = '.'
- makefile_name = 'GypAndroid' + options.suffix + '.mk'
- makefile_path = os.path.join(options.toplevel_dir, makefile_name)
- assert not options.generator_output, (
- 'The Android backend does not support options.generator_output.')
- gyp.common.EnsureDirExists(makefile_path)
- root_makefile = open(makefile_path, 'w')
-
- root_makefile.write(header)
-
- # We set LOCAL_PATH just once, here, to the top of the project tree. This
- # allows all the other paths we use to be relative to the Android.mk file,
- # as the Android build system expects.
- root_makefile.write('\nLOCAL_PATH := $(call my-dir)\n')
-
- # Find the list of targets that derive from the gyp file(s) being built.
- needed_targets = set()
- for build_file in params['build_files']:
- for target in gyp.common.AllTargets(target_list, target_dicts, build_file):
- needed_targets.add(target)
-
- build_files = set()
- include_list = set()
- android_modules = {}
- for qualified_target in target_list:
- build_file, target, toolset = gyp.common.ParseQualifiedTarget(
- qualified_target)
- relative_build_file = gyp.common.RelativePath(build_file,
- options.toplevel_dir)
- build_files.add(relative_build_file)
- included_files = data[build_file]['included_files']
- for included_file in included_files:
- # The included_files entries are relative to the dir of the build file
- # that included them, so we have to undo that and then make them relative
- # to the root dir.
- relative_include_file = gyp.common.RelativePath(
- gyp.common.UnrelativePath(included_file, build_file),
- options.toplevel_dir)
- abs_include_file = os.path.abspath(relative_include_file)
- # If the include file is from the ~/.gyp dir, we should use absolute path
- # so that relocating the src dir doesn't break the path.
- if (params['home_dot_gyp'] and
- abs_include_file.startswith(params['home_dot_gyp'])):
- build_files.add(abs_include_file)
- else:
- build_files.add(relative_include_file)
-
- base_path, output_file = CalculateMakefilePath(build_file,
- target + '.' + toolset + options.suffix + '.mk')
-
- spec = target_dicts[qualified_target]
- configs = spec['configurations']
-
- part_of_all = qualified_target in needed_targets
- if limit_to_target_all and not part_of_all:
- continue
-
- relative_target = gyp.common.QualifiedTarget(relative_build_file, target,
- toolset)
- writer = AndroidMkWriter(android_top_dir)
- android_module = writer.Write(qualified_target, relative_target, base_path,
- output_file, spec, configs,
- part_of_all=part_of_all,
- write_alias_target=write_alias_targets,
- sdk_version=sdk_version)
- if android_module in android_modules:
- print ('ERROR: Android module names must be unique. The following '
- 'targets both generate Android module name %s.\n %s\n %s' %
- (android_module, android_modules[android_module],
- qualified_target))
- return
- android_modules[android_module] = qualified_target
-
- # Our root_makefile lives at the source root. Compute the relative path
- # from there to the output_file for including.
- mkfile_rel_path = gyp.common.RelativePath(output_file,
- os.path.dirname(makefile_path))
- include_list.add(mkfile_rel_path)
-
- root_makefile.write('GYP_CONFIGURATION ?= %s\n' % default_configuration)
- root_makefile.write('GYP_VAR_PREFIX ?=\n')
- root_makefile.write('GYP_HOST_VAR_PREFIX ?=\n')
- root_makefile.write('GYP_HOST_MULTILIB ?=\n')
-
- # Write out the sorted list of includes.
- root_makefile.write('\n')
- for include_file in sorted(include_list):
- root_makefile.write('include $(LOCAL_PATH)/' + include_file + '\n')
- root_makefile.write('\n')
-
- if write_alias_targets:
- root_makefile.write(ALL_MODULES_FOOTER)
-
- root_makefile.close()
diff --git a/tools/gyp/pylib/gyp/generator/cmake.py b/tools/gyp/pylib/gyp/generator/cmake.py
index 8f5feddee1c..eece6ea98dd 100644
--- a/tools/gyp/pylib/gyp/generator/cmake.py
+++ b/tools/gyp/pylib/gyp/generator/cmake.py
@@ -150,20 +150,17 @@ def SetFileProperty(output, source_name, property_name, values, sep):
output.write('")\n')
-def SetFilesProperty(output, source_names, property_name, values, sep):
+def SetFilesProperty(output, variable, property_name, values, sep):
"""Given a set of source files, sets the given property on them."""
- output.write('set_source_files_properties(\n')
- for source_name in source_names:
- output.write(' ')
- output.write(source_name)
- output.write('\n')
- output.write(' PROPERTIES\n ')
+ output.write('set_source_files_properties(')
+ WriteVariable(output, variable)
+ output.write(' PROPERTIES ')
output.write(property_name)
output.write(' "')
for value in values:
output.write(CMakeStringEscape(value))
output.write(sep)
- output.write('"\n)\n')
+ output.write('")\n')
def SetTargetProperty(output, target_name, property_name, values, sep=''):
@@ -236,11 +233,11 @@ def StringToCMakeTargetName(a):
"""Converts the given string 'a' to a valid CMake target name.
All invalid characters are replaced by '_'.
- Invalid for cmake: ' ', '/', '(', ')'
+ Invalid for cmake: ' ', '/', '(', ')', '"'
Invalid for make: ':'
Invalid for unknown reasons but cause failures: '.'
"""
- return a.translate(string.maketrans(' /():.', '______'))
+ return a.translate(string.maketrans(' /():."', '_______'))
def WriteActions(target_name, actions, extra_sources, extra_deps,
@@ -488,7 +485,7 @@ def WriteCopies(target_name, copies, extra_deps, path_to_gyp, output):
copy = file_copy if os.path.basename(src) else dir_copy
- copy.cmake_inputs.append(NormjoinPath(path_to_gyp, src))
+ copy.cmake_inputs.append(NormjoinPathForceCMakeSource(path_to_gyp, src))
copy.cmake_outputs.append(NormjoinPathForceCMakeSource(path_to_gyp, dst))
copy.gyp_inputs.append(src)
copy.gyp_outputs.append(dst)
@@ -640,6 +637,12 @@ def WriteTarget(namer, qualified_target, target_dicts, build_dir, config_to_use,
target_type = spec.get('type', '<missing target type>')
target_toolset = spec.get('toolset')
+ cmake_target_type = cmake_target_type_from_gyp_target_type.get(target_type)
+ if cmake_target_type is None:
+ print ('Target %s has unknown target type %s, skipping.' %
+ ( target_name, target_type ) )
+ return
+
SetVariable(output, 'TARGET', target_name)
SetVariable(output, 'TOOLSET', target_toolset)
@@ -667,27 +670,89 @@ def WriteTarget(namer, qualified_target, target_dicts, build_dir, config_to_use,
srcs = spec.get('sources', [])
# Gyp separates the sheep from the goats based on file extensions.
- def partition(l, p):
- return reduce(lambda x, e: x[not p(e)].append(e) or x, l, ([], []))
- compilable_srcs, other_srcs = partition(srcs, Compilable)
+ # A full separation is done here because of flag handing (see below).
+ s_sources = []
+ c_sources = []
+ cxx_sources = []
+ linkable_sources = []
+ other_sources = []
+ for src in srcs:
+ _, ext = os.path.splitext(src)
+ src_type = COMPILABLE_EXTENSIONS.get(ext, None)
+ src_norm_path = NormjoinPath(path_from_cmakelists_to_gyp, src);
- # CMake gets upset when executable targets provide no sources.
- if target_type == 'executable' and not compilable_srcs and not extra_sources:
- print ('Executable %s has no complilable sources, treating as "none".' %
- target_name )
- target_type = 'none'
+ if src_type == 's':
+ s_sources.append(src_norm_path)
+ elif src_type == 'cc':
+ c_sources.append(src_norm_path)
+ elif src_type == 'cxx':
+ cxx_sources.append(src_norm_path)
+ elif Linkable(ext):
+ linkable_sources.append(src_norm_path)
+ else:
+ other_sources.append(src_norm_path)
- cmake_target_type = cmake_target_type_from_gyp_target_type.get(target_type)
- if cmake_target_type is None:
- print ('Target %s has unknown target type %s, skipping.' %
- ( target_name, target_type ) )
- return
+ for extra_source in extra_sources:
+ src, real_source = extra_source
+ _, ext = os.path.splitext(real_source)
+ src_type = COMPILABLE_EXTENSIONS.get(ext, None)
+
+ if src_type == 's':
+ s_sources.append(src)
+ elif src_type == 'cc':
+ c_sources.append(src)
+ elif src_type == 'cxx':
+ cxx_sources.append(src)
+ elif Linkable(ext):
+ linkable_sources.append(src)
+ else:
+ other_sources.append(src)
+
+ s_sources_name = None
+ if s_sources:
+ s_sources_name = cmake_target_name + '__asm_srcs'
+ SetVariableList(output, s_sources_name, s_sources)
+
+ c_sources_name = None
+ if c_sources:
+ c_sources_name = cmake_target_name + '__c_srcs'
+ SetVariableList(output, c_sources_name, c_sources)
+
+ cxx_sources_name = None
+ if cxx_sources:
+ cxx_sources_name = cmake_target_name + '__cxx_srcs'
+ SetVariableList(output, cxx_sources_name, cxx_sources)
+
+ linkable_sources_name = None
+ if linkable_sources:
+ linkable_sources_name = cmake_target_name + '__linkable_srcs'
+ SetVariableList(output, linkable_sources_name, linkable_sources)
+
+ other_sources_name = None
+ if other_sources:
+ other_sources_name = cmake_target_name + '__other_srcs'
+ SetVariableList(output, other_sources_name, other_sources)
+
+ # CMake gets upset when executable targets provide no sources.
+ # http://www.cmake.org/pipermail/cmake/2010-July/038461.html
+ dummy_sources_name = None
+ has_sources = (s_sources_name or
+ c_sources_name or
+ cxx_sources_name or
+ linkable_sources_name or
+ other_sources_name)
+ if target_type == 'executable' and not has_sources:
+ dummy_sources_name = cmake_target_name + '__dummy_srcs'
+ SetVariable(output, dummy_sources_name,
+ "${obj}.${TOOLSET}/${TARGET}/genc/dummy.c")
+ output.write('if(NOT EXISTS "')
+ WriteVariable(output, dummy_sources_name)
+ output.write('")\n')
+ output.write(' file(WRITE "')
+ WriteVariable(output, dummy_sources_name)
+ output.write('" "")\n')
+ output.write("endif()\n")
- other_srcs_name = None
- if other_srcs:
- other_srcs_name = cmake_target_name + '__other_srcs'
- SetVariableList(output, other_srcs_name,
- [NormjoinPath(path_from_cmakelists_to_gyp, src) for src in other_srcs])
# CMake is opposed to setting linker directories and considers the practice
# of setting linker directories dangerous. Instead, it favors the use of
@@ -713,31 +778,48 @@ def WriteTarget(namer, qualified_target, target_dicts, build_dir, config_to_use,
output.write(' ')
output.write(cmake_target_type.modifier)
- if other_srcs_name:
- WriteVariable(output, other_srcs_name, ' ')
-
- output.write('\n')
-
- for src in compilable_srcs:
- output.write(' ')
- output.write(NormjoinPath(path_from_cmakelists_to_gyp, src))
- output.write('\n')
- for extra_source in extra_sources:
- output.write(' ')
- src, _ = extra_source
- output.write(NormjoinPath(path_from_cmakelists_to_gyp, src))
- output.write('\n')
+ if s_sources_name:
+ WriteVariable(output, s_sources_name, ' ')
+ if c_sources_name:
+ WriteVariable(output, c_sources_name, ' ')
+ if cxx_sources_name:
+ WriteVariable(output, cxx_sources_name, ' ')
+ if linkable_sources_name:
+ WriteVariable(output, linkable_sources_name, ' ')
+ if other_sources_name:
+ WriteVariable(output, other_sources_name, ' ')
+ if dummy_sources_name:
+ WriteVariable(output, dummy_sources_name, ' ')
output.write(')\n')
+ # Let CMake know if the 'all' target should depend on this target.
+ exclude_from_all = ('TRUE' if qualified_target not in all_qualified_targets
+ else 'FALSE')
+ SetTargetProperty(output, cmake_target_name,
+ 'EXCLUDE_FROM_ALL', exclude_from_all)
+ for extra_target_name in extra_deps:
+ SetTargetProperty(output, extra_target_name,
+ 'EXCLUDE_FROM_ALL', exclude_from_all)
+
# Output name and location.
if target_type != 'none':
+ # Link as 'C' if there are no other files
+ if not c_sources and not cxx_sources:
+ SetTargetProperty(output, cmake_target_name, 'LINKER_LANGUAGE', ['C'])
+
# Mark uncompiled sources as uncompiled.
- if other_srcs_name:
+ if other_sources_name:
output.write('set_source_files_properties(')
- WriteVariable(output, other_srcs_name, '')
+ WriteVariable(output, other_sources_name, '')
output.write(' PROPERTIES HEADER_FILE_ONLY "TRUE")\n')
+ # Mark object sources as linkable.
+ if linkable_sources_name:
+ output.write('set_source_files_properties(')
+ WriteVariable(output, other_sources_name, '')
+ output.write(' PROPERTIES EXTERNAL_OBJECT "TRUE")\n')
+
# Output directory
target_output_directory = spec.get('product_dir')
if target_output_directory is None:
@@ -804,122 +886,84 @@ def WriteTarget(namer, qualified_target, target_dicts, build_dir, config_to_use,
cmake_target_output_basename)
SetFileProperty(output, cmake_target_output, 'GENERATED', ['TRUE'], '')
- # Let CMake know if the 'all' target should depend on this target.
- exclude_from_all = ('TRUE' if qualified_target not in all_qualified_targets
- else 'FALSE')
- SetTargetProperty(output, cmake_target_name,
- 'EXCLUDE_FROM_ALL', exclude_from_all)
- for extra_target_name in extra_deps:
- SetTargetProperty(output, extra_target_name,
- 'EXCLUDE_FROM_ALL', exclude_from_all)
-
- # Includes
- includes = config.get('include_dirs')
- if includes:
- # This (target include directories) is what requires CMake 2.8.8
- includes_name = cmake_target_name + '__include_dirs'
- SetVariableList(output, includes_name,
- [NormjoinPathForceCMakeSource(path_from_cmakelists_to_gyp, include)
- for include in includes])
- output.write('set_property(TARGET ')
- output.write(cmake_target_name)
- output.write(' APPEND PROPERTY INCLUDE_DIRECTORIES ')
- WriteVariable(output, includes_name, '')
- output.write(')\n')
-
- # Defines
- defines = config.get('defines')
- if defines is not None:
- SetTargetProperty(output,
- cmake_target_name,
- 'COMPILE_DEFINITIONS',
- defines,
- ';')
-
- # Compile Flags - http://www.cmake.org/Bug/view.php?id=6493
- # CMake currently does not have target C and CXX flags.
- # So, instead of doing...
-
- # cflags_c = config.get('cflags_c')
- # if cflags_c is not None:
- # SetTargetProperty(output, cmake_target_name,
- # 'C_COMPILE_FLAGS', cflags_c, ' ')
-
- # cflags_cc = config.get('cflags_cc')
- # if cflags_cc is not None:
- # SetTargetProperty(output, cmake_target_name,
- # 'CXX_COMPILE_FLAGS', cflags_cc, ' ')
-
- # Instead we must...
- s_sources = []
- c_sources = []
- cxx_sources = []
- for src in srcs:
- _, ext = os.path.splitext(src)
- src_type = COMPILABLE_EXTENSIONS.get(ext, None)
-
- if src_type == 's':
- s_sources.append(NormjoinPath(path_from_cmakelists_to_gyp, src))
-
- if src_type == 'cc':
- c_sources.append(NormjoinPath(path_from_cmakelists_to_gyp, src))
-
- if src_type == 'cxx':
- cxx_sources.append(NormjoinPath(path_from_cmakelists_to_gyp, src))
-
- for extra_source in extra_sources:
- src, real_source = extra_source
- _, ext = os.path.splitext(real_source)
- src_type = COMPILABLE_EXTENSIONS.get(ext, None)
-
- if src_type == 's':
- s_sources.append(NormjoinPath(path_from_cmakelists_to_gyp, src))
-
- if src_type == 'cc':
- c_sources.append(NormjoinPath(path_from_cmakelists_to_gyp, src))
-
- if src_type == 'cxx':
- cxx_sources.append(NormjoinPath(path_from_cmakelists_to_gyp, src))
-
- cflags = config.get('cflags', [])
- cflags_c = config.get('cflags_c', [])
- cflags_cxx = config.get('cflags_cc', [])
- if c_sources and not (s_sources or cxx_sources):
- flags = []
- flags.extend(cflags)
- flags.extend(cflags_c)
- SetTargetProperty(output, cmake_target_name, 'COMPILE_FLAGS', flags, ' ')
-
- elif cxx_sources and not (s_sources or c_sources):
- flags = []
- flags.extend(cflags)
- flags.extend(cflags_cxx)
- SetTargetProperty(output, cmake_target_name, 'COMPILE_FLAGS', flags, ' ')
-
- else:
- if s_sources and cflags:
- SetFilesProperty(output, s_sources, 'COMPILE_FLAGS', cflags, ' ')
+ # Includes
+ includes = config.get('include_dirs')
+ if includes:
+ # This (target include directories) is what requires CMake 2.8.8
+ includes_name = cmake_target_name + '__include_dirs'
+ SetVariableList(output, includes_name,
+ [NormjoinPathForceCMakeSource(path_from_cmakelists_to_gyp, include)
+ for include in includes])
+ output.write('set_property(TARGET ')
+ output.write(cmake_target_name)
+ output.write(' APPEND PROPERTY INCLUDE_DIRECTORIES ')
+ WriteVariable(output, includes_name, '')
+ output.write(')\n')
- if c_sources and (cflags or cflags_c):
+ # Defines
+ defines = config.get('defines')
+ if defines is not None:
+ SetTargetProperty(output,
+ cmake_target_name,
+ 'COMPILE_DEFINITIONS',
+ defines,
+ ';')
+
+ # Compile Flags - http://www.cmake.org/Bug/view.php?id=6493
+ # CMake currently does not have target C and CXX flags.
+ # So, instead of doing...
+
+ # cflags_c = config.get('cflags_c')
+ # if cflags_c is not None:
+ # SetTargetProperty(output, cmake_target_name,
+ # 'C_COMPILE_FLAGS', cflags_c, ' ')
+
+ # cflags_cc = config.get('cflags_cc')
+ # if cflags_cc is not None:
+ # SetTargetProperty(output, cmake_target_name,
+ # 'CXX_COMPILE_FLAGS', cflags_cc, ' ')
+
+ # Instead we must...
+ cflags = config.get('cflags', [])
+ cflags_c = config.get('cflags_c', [])
+ cflags_cxx = config.get('cflags_cc', [])
+ if (not cflags_c or not c_sources) and (not cflags_cxx or not cxx_sources):
+ SetTargetProperty(output, cmake_target_name, 'COMPILE_FLAGS', cflags, ' ')
+
+ elif c_sources and not (s_sources or cxx_sources):
flags = []
flags.extend(cflags)
flags.extend(cflags_c)
- SetFilesProperty(output, c_sources, 'COMPILE_FLAGS', flags, ' ')
+ SetTargetProperty(output, cmake_target_name, 'COMPILE_FLAGS', flags, ' ')
- if cxx_sources and (cflags or cflags_cxx):
+ elif cxx_sources and not (s_sources or c_sources):
flags = []
flags.extend(cflags)
flags.extend(cflags_cxx)
- SetFilesProperty(output, cxx_sources, 'COMPILE_FLAGS', flags, ' ')
+ SetTargetProperty(output, cmake_target_name, 'COMPILE_FLAGS', flags, ' ')
- # Have assembly link as c if there are no other files
- if not c_sources and not cxx_sources and s_sources:
- SetTargetProperty(output, cmake_target_name, 'LINKER_LANGUAGE', ['C'])
-
- # Linker flags
- ldflags = config.get('ldflags')
- if ldflags is not None:
- SetTargetProperty(output, cmake_target_name, 'LINK_FLAGS', ldflags, ' ')
+ else:
+ # TODO: This is broken, one cannot generally set properties on files,
+ # as other targets may require different properties on the same files.
+ if s_sources and cflags:
+ SetFilesProperty(output, s_sources_name, 'COMPILE_FLAGS', cflags, ' ')
+
+ if c_sources and (cflags or cflags_c):
+ flags = []
+ flags.extend(cflags)
+ flags.extend(cflags_c)
+ SetFilesProperty(output, c_sources_name, 'COMPILE_FLAGS', flags, ' ')
+
+ if cxx_sources and (cflags or cflags_cxx):
+ flags = []
+ flags.extend(cflags)
+ flags.extend(cflags_cxx)
+ SetFilesProperty(output, cxx_sources_name, 'COMPILE_FLAGS', flags, ' ')
+
+ # Linker flags
+ ldflags = config.get('ldflags')
+ if ldflags is not None:
+ SetTargetProperty(output, cmake_target_name, 'LINK_FLAGS', ldflags, ' ')
# Note on Dependencies and Libraries:
# CMake wants to handle link order, resolving the link line up front.
@@ -1040,19 +1084,48 @@ def GenerateOutputForConfig(target_list, target_dicts, data,
output.write('cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)\n')
output.write('cmake_policy(VERSION 2.8.8)\n')
- _, project_target, _ = gyp.common.ParseQualifiedTarget(target_list[-1])
+ gyp_file, project_target, _ = gyp.common.ParseQualifiedTarget(target_list[-1])
output.write('project(')
output.write(project_target)
output.write(')\n')
SetVariable(output, 'configuration', config_to_use)
+ ar = None
+ cc = None
+ cxx = None
+
+ make_global_settings = data[gyp_file].get('make_global_settings', [])
+ build_to_top = gyp.common.InvertRelativePath(build_dir,
+ options.toplevel_dir)
+ for key, value in make_global_settings:
+ if key == 'AR':
+ ar = os.path.join(build_to_top, value)
+ if key == 'CC':
+ cc = os.path.join(build_to_top, value)
+ if key == 'CXX':
+ cxx = os.path.join(build_to_top, value)
+
+ ar = gyp.common.GetEnvironFallback(['AR_target', 'AR'], ar)
+ cc = gyp.common.GetEnvironFallback(['CC_target', 'CC'], cc)
+ cxx = gyp.common.GetEnvironFallback(['CXX_target', 'CXX'], cxx)
+
+ if ar:
+ SetVariable(output, 'CMAKE_AR', ar)
+ if cc:
+ SetVariable(output, 'CMAKE_C_COMPILER', cc)
+ if cxx:
+ SetVariable(output, 'CMAKE_CXX_COMPILER', cxx)
+
# The following appears to be as-yet undocumented.
# http://public.kitware.com/Bug/view.php?id=8392
output.write('enable_language(ASM)\n')
# ASM-ATT does not support .S files.
# output.write('enable_language(ASM-ATT)\n')
+ if cc:
+ SetVariable(output, 'CMAKE_ASM_COMPILER', cc)
+
SetVariable(output, 'builddir', '${CMAKE_BINARY_DIR}')
SetVariable(output, 'obj', '${builddir}/obj')
output.write('\n')
@@ -1066,6 +1139,11 @@ def GenerateOutputForConfig(target_list, target_dicts, data,
output.write('set(CMAKE_CXX_OUTPUT_EXTENSION_REPLACE 1)\n')
output.write('\n')
+ # Force ninja to use rsp files. Otherwise link and ar lines can get too long,
+ # resulting in 'Argument list too long' errors.
+ output.write('set(CMAKE_NINJA_FORCE_RESPONSE_FILE 1)\n')
+ output.write('\n')
+
namer = CMakeNamer(target_list)
# The list of targets upon which the 'all' target should depend.
diff --git a/tools/gyp/pylib/gyp/generator/dump_dependency_json.py b/tools/gyp/pylib/gyp/generator/dump_dependency_json.py
index 927ba6ebad7..160eafe2efe 100644
--- a/tools/gyp/pylib/gyp/generator/dump_dependency_json.py
+++ b/tools/gyp/pylib/gyp/generator/dump_dependency_json.py
@@ -14,6 +14,9 @@ generator_supports_multiple_toolsets = True
generator_wants_static_library_dependencies_adjusted = False
+generator_filelist_paths = {
+}
+
generator_default_variables = {
}
for dirname in ['INTERMEDIATE_DIR', 'SHARED_INTERMEDIATE_DIR', 'PRODUCT_DIR',
@@ -56,6 +59,17 @@ def CalculateGeneratorInputInfo(params):
global generator_wants_static_library_dependencies_adjusted
generator_wants_static_library_dependencies_adjusted = True
+ toplevel = params['options'].toplevel_dir
+ generator_dir = os.path.relpath(params['options'].generator_output or '.')
+ # output_dir: relative path from generator_dir to the build directory.
+ output_dir = generator_flags.get('output_dir', 'out')
+ qualified_out_dir = os.path.normpath(os.path.join(
+ toplevel, generator_dir, output_dir, 'gypfiles'))
+ global generator_filelist_paths
+ generator_filelist_paths = {
+ 'toplevel': toplevel,
+ 'qualified_out_dir': qualified_out_dir,
+ }
def GenerateOutput(target_list, target_dicts, data, params):
# Map of target -> list of targets it depends on.
@@ -74,7 +88,11 @@ def GenerateOutput(target_list, target_dicts, data, params):
edges[target].append(dep)
targets_to_visit.append(dep)
- filename = 'dump.json'
+ try:
+ filepath = params['generator_flags']['output_dir']
+ except KeyError:
+ filepath = '.'
+ filename = os.path.join(filepath, 'dump.json')
f = open(filename, 'w')
json.dump(edges, f)
f.close()
diff --git a/tools/gyp/pylib/gyp/generator/make.py b/tools/gyp/pylib/gyp/generator/make.py
index 64b2511f085..5cf2fe76be2 100644
--- a/tools/gyp/pylib/gyp/generator/make.py
+++ b/tools/gyp/pylib/gyp/generator/make.py
@@ -1019,7 +1019,8 @@ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj)/%%%s FORCE_DO_CMD
# accidentally writing duplicate dummy rules for those outputs.
self.WriteLn('%s: obj := $(abs_obj)' % outputs[0])
self.WriteLn('%s: builddir := $(abs_builddir)' % outputs[0])
- self.WriteMakeRule(outputs, inputs + ['FORCE_DO_CMD'], actions)
+ self.WriteMakeRule(outputs, inputs, actions,
+ command="%s_%d" % (name, count))
# Spaces in rule filenames are not supported, but rule variables have
# spaces in them (e.g. RULE_INPUT_PATH expands to '$(abspath $<)').
# The spaces within the variables are valid, so remove the variables
@@ -1688,6 +1689,7 @@ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj)/%%%s FORCE_DO_CMD
self.WriteMakeRule(outputs, inputs,
actions = ['$(call do_cmd,%s%s)' % (command, suffix)],
comment = comment,
+ command = command,
force = True)
# Add our outputs to the list of targets we read depfiles from.
# all_deps is only used for deps file reading, and for deps files we replace
@@ -1698,7 +1700,7 @@ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj)/%%%s FORCE_DO_CMD
def WriteMakeRule(self, outputs, inputs, actions=None, comment=None,
- order_only=False, force=False, phony=False):
+ order_only=False, force=False, phony=False, command=None):
"""Write a Makefile rule, with some extra tricks.
outputs: a list of outputs for the rule (note: this is not directly
@@ -1711,6 +1713,7 @@ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj)/%%%s FORCE_DO_CMD
force: if true, include FORCE_DO_CMD as an order-only dep
phony: if true, the rule does not actually generate the named output, the
output is just a name to run the rule
+ command: (optional) command name to generate unambiguous labels
"""
outputs = map(QuoteSpaces, outputs)
inputs = map(QuoteSpaces, inputs)
@@ -1719,44 +1722,38 @@ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj)/%%%s FORCE_DO_CMD
self.WriteLn('# ' + comment)
if phony:
self.WriteLn('.PHONY: ' + ' '.join(outputs))
- # TODO(evanm): just make order_only a list of deps instead of these hacks.
- if order_only:
- order_insert = '| '
- pick_output = ' '.join(outputs)
- else:
- order_insert = ''
- pick_output = outputs[0]
- if force:
- force_append = ' FORCE_DO_CMD'
- else:
- force_append = ''
if actions:
self.WriteLn("%s: TOOLSET := $(TOOLSET)" % outputs[0])
- self.WriteLn('%s: %s%s%s' % (pick_output, order_insert, ' '.join(inputs),
- force_append))
+ force_append = ' FORCE_DO_CMD' if force else ''
+
+ if order_only:
+ # Order only rule: Just write a simple rule.
+ # TODO(evanm): just make order_only a list of deps instead of this hack.
+ self.WriteLn('%s: | %s%s' %
+ (' '.join(outputs), ' '.join(inputs), force_append))
+ elif len(outputs) == 1:
+ # Regular rule, one output: Just write a simple rule.
+ self.WriteLn('%s: %s%s' % (outputs[0], ' '.join(inputs), force_append))
+ else:
+ # Regular rule, more than one output: Multiple outputs are tricky in
+ # make. We will write three rules:
+ # - All outputs depend on an intermediate file.
+ # - Make .INTERMEDIATE depend on the intermediate.
+ # - The intermediate file depends on the inputs and executes the
+ # actual command.
+ # - The intermediate recipe will 'touch' the intermediate file.
+ # - The multi-output rule will have an do-nothing recipe.
+ intermediate = "%s.intermediate" % (command if command else self.target)
+ self.WriteLn('%s: %s' % (' '.join(outputs), intermediate))
+ self.WriteLn('\t%s' % '@:');
+ self.WriteLn('%s: %s' % ('.INTERMEDIATE', intermediate))
+ self.WriteLn('%s: %s%s' %
+ (intermediate, ' '.join(inputs), force_append))
+ actions.insert(0, '$(call do_cmd,touch)')
+
if actions:
for action in actions:
self.WriteLn('\t%s' % action)
- if not order_only and len(outputs) > 1:
- # If we have more than one output, a rule like
- # foo bar: baz
- # that for *each* output we must run the action, potentially
- # in parallel. That is not what we're trying to write -- what
- # we want is that we run the action once and it generates all
- # the files.
- # http://www.gnu.org/software/hello/manual/automake/Multiple-Outputs.html
- # discusses this problem and has this solution:
- # 1) Write the naive rule that would produce parallel runs of
- # the action.
- # 2) Make the outputs seralized on each other, so we won't start
- # a parallel run until the first run finishes, at which point
- # we'll have generated all the outputs and we're done.
- self.WriteLn('%s: %s' % (' '.join(outputs[1:]), outputs[0]))
- # Add a dummy command to the "extra outputs" rule, otherwise make seems to
- # think these outputs haven't (couldn't have?) changed, and thus doesn't
- # flag them as changed (i.e. include in '$?') when evaluating dependent
- # rules, which in turn causes do_cmd() to skip running dependent commands.
- self.WriteLn('%s: ;' % (' '.join(outputs[1:])))
self.WriteLn()
diff --git a/tools/gyp/pylib/gyp/generator/msvs.py b/tools/gyp/pylib/gyp/generator/msvs.py
index edf2ae419ef..1338790ef68 100644
--- a/tools/gyp/pylib/gyp/generator/msvs.py
+++ b/tools/gyp/pylib/gyp/generator/msvs.py
@@ -86,6 +86,7 @@ generator_additional_non_configuration_keys = [
'msvs_enable_winrt',
'msvs_requires_importlibrary',
'msvs_enable_winphone',
+ 'msvs_application_type_revision',
]
@@ -2344,6 +2345,9 @@ def _GenerateMSBuildRuleTargetsFile(targets_path, msbuild_rules):
rule_name,
{'Condition': "'@(%s)' != '' and '%%(%s.ExcludedFromBuild)' != "
"'true'" % (rule_name, rule_name),
+ 'EchoOff': 'true',
+ 'StandardOutputImportance': 'High',
+ 'StandardErrorImportance': 'High',
'CommandLineTemplate': '%%(%s.CommandLineTemplate)' % rule_name,
'AdditionalOptions': '%%(%s.AdditionalOptions)' % rule_name,
'Inputs': rule_inputs
@@ -2634,7 +2638,11 @@ def _GetMSBuildGlobalProperties(spec, guid, gyp_file_name):
if spec.get('msvs_enable_winrt'):
properties[0].append(['DefaultLanguage', 'en-US'])
properties[0].append(['AppContainerApplication', 'true'])
- properties[0].append(['ApplicationTypeRevision', '8.1'])
+ if spec.get('msvs_application_type_revision'):
+ app_type_revision = spec.get('msvs_application_type_revision')
+ properties[0].append(['ApplicationTypeRevision', app_type_revision])
+ else:
+ properties[0].append(['ApplicationTypeRevision', '8.1'])
if spec.get('msvs_enable_winphone'):
properties[0].append(['ApplicationType', 'Windows Phone'])
diff --git a/tools/gyp/pylib/gyp/generator/ninja.py b/tools/gyp/pylib/gyp/generator/ninja.py
index 6823f4ffbda..c2437822a7f 100644
--- a/tools/gyp/pylib/gyp/generator/ninja.py
+++ b/tools/gyp/pylib/gyp/generator/ninja.py
@@ -1169,7 +1169,7 @@ class NinjaWriter(object):
ldflags.append(r'-Wl,-rpath=\$$ORIGIN/%s' % rpath)
ldflags.append('-Wl,-rpath-link=%s' % rpath)
self.WriteVariableList(ninja_file, 'ldflags',
- gyp.common.uniquer(map(self.ExpandSpecial, ldflags)))
+ map(self.ExpandSpecial, ldflags))
library_dirs = config.get('library_dirs', [])
if self.flavor == 'win':
diff --git a/tools/gyp/pylib/gyp/input.py b/tools/gyp/pylib/gyp/input.py
index 34fbc547119..c7efe99a122 100644
--- a/tools/gyp/pylib/gyp/input.py
+++ b/tools/gyp/pylib/gyp/input.py
@@ -1662,8 +1662,8 @@ class DependencyGraphNode(object):
if dependency.ref is None:
continue
if dependency.ref not in dependencies:
- dependencies.add(dependency.ref)
dependency.DeepDependencies(dependencies)
+ dependencies.add(dependency.ref)
return dependencies
@@ -2488,6 +2488,35 @@ def ValidateTargetType(target, target_dict):
target_type))
+def ValidateSourcesInTarget(target, target_dict, build_file,
+ duplicate_basename_check):
+ if not duplicate_basename_check:
+ return
+ if target_dict.get('type', None) != 'static_library':
+ return
+ sources = target_dict.get('sources', [])
+ basenames = {}
+ for source in sources:
+ name, ext = os.path.splitext(source)
+ is_compiled_file = ext in [
+ '.c', '.cc', '.cpp', '.cxx', '.m', '.mm', '.s', '.S']
+ if not is_compiled_file:
+ continue
+ basename = os.path.basename(name) # Don't include extension.
+ basenames.setdefault(basename, []).append(source)
+
+ error = ''
+ for basename, files in basenames.iteritems():
+ if len(files) > 1:
+ error += ' %s: %s\n' % (basename, ' '.join(files))
+
+ if error:
+ print('static library %s has several files with the same basename:\n' %
+ target + error + 'libtool on Mac cannot handle that. Use '
+ '--no-duplicate-basename-check to disable this validation.')
+ raise GypError('Duplicate basenames in sources section, see list above')
+
+
def ValidateRulesInTarget(target, target_dict, extra_sources_for_rules):
"""Ensures that the rules sections in target_dict are valid and consistent,
and determines which sources they apply to.
@@ -2708,7 +2737,7 @@ def SetGeneratorGlobals(generator_input_info):
def Load(build_files, variables, includes, depth, generator_input_info, check,
- circular_check, parallel, root_targets):
+ circular_check, duplicate_basename_check, parallel, root_targets):
SetGeneratorGlobals(generator_input_info)
# A generator can have other lists (in addition to sources) be processed
# for rules.
@@ -2840,6 +2869,8 @@ def Load(build_files, variables, includes, depth, generator_input_info, check,
target_dict = targets[target]
build_file = gyp.common.BuildFile(target)
ValidateTargetType(target, target_dict)
+ ValidateSourcesInTarget(target, target_dict, build_file,
+ duplicate_basename_check)
ValidateRulesInTarget(target, target_dict, extra_sources_for_rules)
ValidateRunAsInTarget(target, target_dict, build_file)
ValidateActionsInTarget(target, target_dict, build_file)
diff --git a/tools/gyp/pylib/gyp/mac_tool.py b/tools/gyp/pylib/gyp/mac_tool.py
index 366439a062d..eeeaceb0c7a 100755
--- a/tools/gyp/pylib/gyp/mac_tool.py
+++ b/tools/gyp/pylib/gyp/mac_tool.py
@@ -603,8 +603,7 @@ class MacTool(object):
if isinstance(data, list):
return [self._ExpandVariables(v, substitutions) for v in data]
if isinstance(data, dict):
- return dict((k, self._ExpandVariables(data[k],
- substitutions)) for k in data)
+ return {k: self._ExpandVariables(data[k], substitutions) for k in data}
return data
if __name__ == '__main__':
diff --git a/tools/gyp/pylib/gyp/xcode_emulation.py b/tools/gyp/pylib/gyp/xcode_emulation.py
index f1a839a2f59..c002b112c54 100644
--- a/tools/gyp/pylib/gyp/xcode_emulation.py
+++ b/tools/gyp/pylib/gyp/xcode_emulation.py
@@ -525,6 +525,13 @@ class XcodeSettings(object):
if self._Test('GCC_WARN_ABOUT_MISSING_NEWLINE', 'YES', default='NO'):
cflags.append('-Wnewline-eof')
+ # In Xcode, this is only activated when GCC_COMPILER_VERSION is clang or
+ # llvm-gcc. It also requires a fairly recent libtool, and
+ # if the system clang isn't used, DYLD_LIBRARY_PATH needs to contain the
+ # path to the libLTO.dylib that matches the used clang.
+ if self._Test('LLVM_LTO', 'YES', default='NO'):
+ cflags.append('-flto')
+
self._AppendPlatformVersionMinFlags(cflags)
# TODO:
@@ -831,8 +838,9 @@ class XcodeSettings(object):
# These flags reflect the compilation options used by xcode to compile
# extensions.
ldflags.append('-lpkstart')
- ldflags.append(sdk_root +
- '/System/Library/PrivateFrameworks/PlugInKit.framework/PlugInKit')
+ if XcodeVersion() < '0900':
+ ldflags.append(sdk_root +
+ '/System/Library/PrivateFrameworks/PlugInKit.framework/PlugInKit')
ldflags.append('-fapplication-extension')
ldflags.append('-Xlinker -rpath '
'-Xlinker @executable_path/../../Frameworks')
diff --git a/tools/install.py b/tools/install.py
index c912a97da9c..3254eba17e5 100755
--- a/tools/install.py
+++ b/tools/install.py
@@ -149,6 +149,8 @@ def files(action):
# behave similarly for systemtap
action(['src/node.stp'], 'share/systemtap/tapset/')
+ action(['deps/v8/tools/gdbinit'], 'share/doc/node/')
+
if 'freebsd' in sys.platform or 'openbsd' in sys.platform:
action(['doc/iojs.1'], 'man/man1/')
else:
diff --git a/tools/rpm/iojs.spec b/tools/rpm/iojs.spec
index 07db8d21a00..4be798f19f0 100644
--- a/tools/rpm/iojs.spec
+++ b/tools/rpm/iojs.spec
@@ -93,6 +93,7 @@ done
/usr/bin/*
/usr/include/*
/usr/lib/node_modules/
+/usr/share/doc/node/gdbinit
/usr/share/man/man1/iojs.1.gz
/usr/share/systemtap/tapset/node.stp
%{_datadir}/%{name}/
@@ -100,6 +101,9 @@ done
%changelog
+* Tue Jul 7 2015 Ali Ijaz Sheikh <ofrobots@google.com>
+- Added gdbinit.
+
* Mon Apr 13 2015 Dan Varga <danvarga@gmail.com>
- Fix paths for changelog and manpage
diff --git a/vcbuild.bat b/vcbuild.bat
index 7fab85c85a5..e452849dfd9 100644
--- a/vcbuild.bat
+++ b/vcbuild.bat
@@ -87,18 +87,6 @@ if "%i18n_arg%"=="intl-none" set i18n_arg=--with-intl=none
call :getnodeversion || exit /b 1
@rem Set environment for msbuild
-:project-gen
-@rem Skip project generation if requested.
-if defined noprojgen goto msbuild
-
-@rem Generate the VS project.
-SETLOCAL
- if defined VS100COMNTOOLS call "%VS100COMNTOOLS%\VCVarsQueryRegistry.bat"
- python configure %download_arg% %i18n_arg% %debug_arg% %snapshot_arg% %noetw_arg% %noperfctr_arg% --dest-cpu=%target_arch% --tag=%TAG%
- if errorlevel 1 goto create-msvs-files-failed
- if not exist node.sln goto create-msvs-files-failed
- echo Project files generated.
-ENDLOCAL
@rem Look for Visual Studio 2015
if not defined VS140COMNTOOLS goto vc-set-2013
@@ -146,6 +134,7 @@ if defined nobuild goto sign
@rem Build the sln with msbuild.
msbuild node.sln /m /t:%target% /p:Configuration=%config% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo
if errorlevel 1 goto exit
+if "%target%" == "Clean" goto exit
:sign
@rem Skip signing if the `nosign` option was specified.